jtulach commented on code in PR #9768:
URL: https://github.com/apache/netbeans/pull/9768#discussion_r4430431891


##########
contrib/groovy.grails/src/org/netbeans/modules/groovy/grails/api/GrailsProjectConfig.java:
##########
@@ -245,7 +245,7 @@ public JavaPlatform getJavaPlatform() {
             return JavaPlatform.getDefault();
         }
 
-        JavaPlatform[] platforms = PLATFORM_MANAGER.getPlatforms(null, new 
Specification("j2se", null)); //NOI18N

Review Comment:
   - It would be more reviewable if there was a single commit with just the API 
change
   - Seeing all these refactorings hides the core part of the change



##########
java/java.platform/src/org/netbeans/api/java/platform/Specification.java:
##########
@@ -19,20 +19,29 @@
 
 package org.netbeans.api.java.platform;
 
+import java.util.Arrays;
 import java.util.Locale;
+import java.util.Objects;
 import org.netbeans.api.annotations.common.NonNull;
 import org.netbeans.api.annotations.common.NullAllowed;
 import org.openide.modules.SpecificationVersion;
 
 /** Specification of the Java SDK
  */
-public final class Specification {
+public final class Specification implements Comparable<Specification> {
 
     private final String name;
-    private final SpecificationVersion version;
+    private final Runtime.Version version;
     private final Profile[] profiles;
     private final String displayName;
 
+    /**
+     * Creates new SDK Specification
+     * @param name of the specification e.g J2SE

Review Comment:
   ```suggestion
        * @param name of the specification e.g J2SE
        * @since 1.77
        
   ```



##########
java/java.platform/apichanges.xml:
##########
@@ -83,6 +83,32 @@ is the proper place.
     <!-- ACTUAL CHANGES BEGIN HERE: -->
 
     <changes>
+        <change id="Specification.jdk.version">

Review Comment:
   +1



##########
java/java.project.ui/src/org/netbeans/modules/java/project/ui/FixProjectSourceLevel.java:
##########
@@ -184,17 +186,21 @@ private static final class PlatformModel extends 
DefaultComboBoxModel {
             refresh();
         }
 
-
         void refresh() {
             removeAllElements();
             final JavaPlatform[] platforms = 
JavaPlatformManager.getDefault().getPlatforms(
                     null,
-                    new Specification(type, null));
+                    new Specification(type));

Review Comment:
   - every module that uses the new API methods must update its dependencies
   - e.g. depend on version 1.77 of the `java.platform` module



##########
java/java.platform/src/org/netbeans/api/java/platform/Specification.java:
##########
@@ -19,20 +19,29 @@
 
 package org.netbeans.api.java.platform;
 
+import java.util.Arrays;
 import java.util.Locale;
+import java.util.Objects;
 import org.netbeans.api.annotations.common.NonNull;
 import org.netbeans.api.annotations.common.NullAllowed;
 import org.openide.modules.SpecificationVersion;
 
 /** Specification of the Java SDK
  */
-public final class Specification {
+public final class Specification implements Comparable<Specification> {
 
     private final String name;
-    private final SpecificationVersion version;
+    private final Runtime.Version version;
     private final Profile[] profiles;
     private final String displayName;
 
+    /**
+     * Creates new SDK Specification

Review Comment:
   Is this sentence finished? Shouldn't the javadoc explain what the version of 
the "SDK Specification" then is?



##########
java/java.platform/src/org/netbeans/api/java/platform/Specification.java:
##########
@@ -19,20 +19,29 @@
 
 package org.netbeans.api.java.platform;
 
+import java.util.Arrays;
 import java.util.Locale;
+import java.util.Objects;
 import org.netbeans.api.annotations.common.NonNull;
 import org.netbeans.api.annotations.common.NullAllowed;
 import org.openide.modules.SpecificationVersion;
 
 /** Specification of the Java SDK

Review Comment:
   ```suggestion
   /** Specification of the Java SDK. Since version X.Y it implements {@link 
Comparable}.
   ```



##########
java/java.platform/nbproject/org-netbeans-modules-java-platform.sig:
##########
@@ -65,6 +68,20 @@ supr java.lang.Object
 hfds name,version
 
 CLSS public final org.netbeans.api.java.platform.Specification
+cons public init(java.lang.String)

Review Comment:
   The API changes look sane.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to