You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2020/01/10 14:00:18 UTC

[GitHub] [groovy] paulk-asert opened a new pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class

paulk-asert opened a new pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class
URL: https://github.com/apache/groovy/pull/1137
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] danielsun1106 commented on a change in pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on a change in pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class
URL: https://github.com/apache/groovy/pull/1137#discussion_r365317148
 
 

 ##########
 File path: subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java
 ##########
 @@ -78,7 +86,15 @@ protected SourceUnit getSourceUnit() {
 
     @Override
     public void visitClass(ClassNode node) {
-        List<String> imports = node.getModule().getImports().stream().map(ImportNode::getClassName).collect(Collectors.toList());
+        final Map<String, String> aliases = new HashMap<>();
+        final List<String> imports = new ArrayList<>();
+        for (ImportNode iNode : node.getModule().getImports()) {
+            String name = iNode.getClassName();
+            imports.add(name);
+            if (iNode.getAlias() != null && !iNode.getAlias().isEmpty()) {
+                aliases.put(iNode.getAlias(), name.replaceAll("\\.", "/"));
 
 Review comment:
   `name.replaceAll("\\.", "/"))` can be replaced with `name.replace('.', '/'))` to avoid regex compilation

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] PascalSchumacher commented on a change in pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class

Posted by GitBox <gi...@apache.org>.
PascalSchumacher commented on a change in pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class
URL: https://github.com/apache/groovy/pull/1137#discussion_r365282720
 
 

 ##########
 File path: subprojects/groovy-templates/src/main/groovy/groovy/text/GStringTemplateEngine.java
 ##########
 @@ -199,6 +199,7 @@ public Object run() {
             try {
                 groovyClass = loader.parseClass(new GroovyCodeSource(templateExpressions.toString(), "GStringTemplateScript" + counter.incrementAndGet() + ".groovy", "x"));
             } catch (Exception e) {
+                System.err.println("templateExpressions = " + templateExpressions);
 
 Review comment:
   I guess this line should be reverted?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] paulk-asert commented on a change in pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class

Posted by GitBox <gi...@apache.org>.
paulk-asert commented on a change in pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class
URL: https://github.com/apache/groovy/pull/1137#discussion_r365463740
 
 

 ##########
 File path: subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java
 ##########
 @@ -78,7 +86,15 @@ protected SourceUnit getSourceUnit() {
 
     @Override
     public void visitClass(ClassNode node) {
-        List<String> imports = node.getModule().getImports().stream().map(ImportNode::getClassName).collect(Collectors.toList());
+        final Map<String, String> aliases = new HashMap<>();
+        final List<String> imports = new ArrayList<>();
+        for (ImportNode iNode : node.getModule().getImports()) {
+            String name = iNode.getClassName();
+            imports.add(name);
+            if (iNode.getAlias() != null && !iNode.getAlias().isEmpty()) {
+                aliases.put(iNode.getAlias(), name.replaceAll("\\.", "/"));
 
 Review comment:
   Nice suggestion.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] asfgit closed pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class
URL: https://github.com/apache/groovy/pull/1137
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] danielsun1106 commented on issue #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on issue #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class
URL: https://github.com/apache/groovy/pull/1137#issuecomment-573067881
 
 
   +1

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [groovy] paulk-asert commented on a change in pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class

Posted by GitBox <gi...@apache.org>.
paulk-asert commented on a change in pull request #1137: GROOVY-8296: Groovydoc Recognition exception with Java 8 class
URL: https://github.com/apache/groovy/pull/1137#discussion_r365463693
 
 

 ##########
 File path: subprojects/groovy-templates/src/main/groovy/groovy/text/GStringTemplateEngine.java
 ##########
 @@ -199,6 +199,7 @@ public Object run() {
             try {
                 groovyClass = loader.parseClass(new GroovyCodeSource(templateExpressions.toString(), "GStringTemplateScript" + counter.incrementAndGet() + ".groovy", "x"));
             } catch (Exception e) {
+                System.err.println("templateExpressions = " + templateExpressions);
 
 Review comment:
   Thanks for spotting that, yes I'll revert.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services