[ 
https://issues.apache.org/jira/browse/GROOVY-11680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17954065#comment-17954065
 ] 

ASF GitHub Bot commented on GROOVY-11680:
-----------------------------------------

Copilot commented on code in PR #2235:
URL: https://github.com/apache/groovy/pull/2235#discussion_r2107024682


##########
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:
   [nitpick] Consider adding a comment here to clarify that string types are 
intentionally handled separately (assigned null) to avoid the deprecated 
constructor usage, which aligns with the updated test expectations.





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

Reply via email to