[ https://issues.apache.org/jira/browse/GROOVY-11680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17954148#comment-17954148 ]
ASF GitHub Bot commented on GROOVY-11680: ----------------------------------------- eric-milles commented on code in PR #2235: URL: https://github.com/apache/groovy/pull/2235#discussion_r2107780392 ########## src/main/java/org/codehaus/groovy/tools/javac/JavaStubGenerator.java: ########## @@ -475,8 +476,8 @@ 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)) { Review Comment: A null value for a String could be seen as an acceptable constant value, which is not what you want. > Java stubs use deprecated constant constructors in some cases > ------------------------------------------------------------- > > Key: GROOVY-11680 > URL: https://issues.apache.org/jira/browse/GROOVY-11680 > Project: Groovy > Issue Type: Improvement > Reporter: Paul King > Assignee: Paul King > Priority: Major > > In stub code for static constants in classes, generated code uses the > deprecated (from JDK9) constructors like {{new Boolean(false)}} instead of > {{Boolean.valueOf(false)}}. -- This message was sent by Atlassian Jira (v8.20.10#820010)