eric-milles commented on code in PR #2235:
URL: https://github.com/apache/groovy/pull/2235#discussion_r2110087586


##########
src/main/java/org/codehaus/groovy/tools/javac/JavaStubGenerator.java:
##########
@@ -475,10 +475,12 @@ private void printField(final PrintWriter out, final 
FieldNode field, final bool
                 }
 
                 // GROOVY-5150, GROOVY-10902, GROOVY-10928, GROOVY-11019: 
dummy value that prevents inlining
-                if (isPrimitiveType(type) || isStringType(type)) {
-                    out.print("new " + getWrapper(type) + "(");
+                if (isPrimitiveType(type)) {
+                    out.print(getWrapper(type) + ".valueOf(");
                     printValue(out, type, defaultValueX(type));
                     out.print(')');
+                } else if (isStringType(type)) {
+                    out.print("new String()");

Review Comment:
   I'd keep the qualifier.  Although, a `valueOf` expression would not be that 
difficult to produce.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@groovy.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to