You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/10/27 04:43:40 UTC

[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2409: [NETBEANS-4881] Automatically detect & list Payara Platform version in the server registration panel

JaroslavTulach commented on a change in pull request #2409:
URL: https://github.com/apache/netbeans/pull/2409#discussion_r512406871



##########
File path: enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig
##########
@@ -503,7 +503,7 @@ meth public final void setName(java.lang.String)
 meth public final void setPriority(int)
 meth public final void stop()
  anno 0 java.lang.Deprecated()
-meth public final void stop(java.lang.Throwable)
+meth public final void stop(java.lang.Throwable)	

Review comment:
       Is this an unnecessary change just adding empty space at the end of the line?

##########
File path: enterprise/payara.micro/nbproject/org-netbeans-modules-payara-micro.sig
##########
@@ -40,7 +40,6 @@ fld public final static java.lang.String PROP_ARTIFACT_ID = "artifactId"
 fld public final static java.lang.String PROP_AUTO_BIND_HTTP = "autoBindHttp"
 fld public final static java.lang.String PROP_CONTEXT_ROOT = "contextRoot"
 fld public final static java.lang.String PROP_GROUP_ID = "groupId"
-fld public final static java.lang.String PROP_JAVA_EE_VERSION = "javaeeVersion"

Review comment:
       Removing a field from an API is probably completely unnecessary. Rather mark as `@Deprecated`.

##########
File path: enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
##########
@@ -1398,34 +1398,9 @@ meth public abstract org.netbeans.modules.payara.tooling.TaskEvent getEvent()
 meth public abstract org.netbeans.modules.payara.tooling.data.PayaraStatusCheck getType()
 meth public abstract org.netbeans.modules.payara.tooling.data.PayaraStatusCheckResult getStatus()
 
-CLSS public final !enum org.netbeans.modules.payara.tooling.data.PayaraVersion
+CLSS public final org.netbeans.modules.payara.tooling.data.PayaraVersion

Review comment:
       Another attempt to change an `enum` to something extensible. See [again](http://wiki.apidesign.org/wiki/Enum).

##########
File path: enterprise/payara.tooling/nbproject/project.xml
##########
@@ -71,7 +80,7 @@
                 </test-type>
             </test-dependencies>
             <friend-packages>
-                <friend>org.netbeans.modules.payara.cloud</friend>
+                <friend>org.netbeans.modules.payara.micro</friend>

Review comment:
       Removing from list of friends is an incompatible API change.

##########
File path: enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig
##########
@@ -1490,48 +1490,11 @@ meth public org.netbeans.modules.payara.tooling.TaskState call2()
 supr org.netbeans.modules.payara.common.BasicTask<org.netbeans.modules.payara.tooling.TaskState>
 hfds LOGGER,RESTART_DELAY,support
 
-CLSS public final !enum org.netbeans.modules.payara.common.ServerDetails

Review comment:
       Changing `enum` to normal `class`? That is binary incompatible change. Now there are two options:
   * do the change in a compatible way
   * properly document/label/version an incompatible change
   
   In case you want to evolve `enum` to non-enum in a compatible way, read [this essay](http://wiki.apidesign.org/wiki/Enum). It can be done, but just changing to `class ServerDetails` isn't the right approach.

##########
File path: enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraVersion.java
##########
@@ -18,354 +18,203 @@
  */
 package org.netbeans.modules.payara.tooling.data;
 
-import java.util.HashMap;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.TreeMap;
+import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
 import org.netbeans.api.annotations.common.CheckForNull;
 import org.netbeans.api.annotations.common.NonNull;
-import org.netbeans.modules.payara.tooling.utils.EnumUtils;
-import org.openide.util.Parameters;
+import org.openide.util.Exceptions;
 
 /**
  * Payara server version.
  * <p/>
  * @author Tomas Kraus, Peter Benedikovic
  * @author Gaurav Gupta
  */
-public enum PayaraVersion {
-
-    //add new version
-    ////////////////////////////////////////////////////////////////////////////
-    // Enum values                                                            //
-    ////////////////////////////////////////////////////////////////////////////
-    /** Payara 4.1.144 */
-    PF_4_1_144 ((short) 4, (short) 1, (short) 0, (short) 0, (short) 14, (short) 4, (short) 0, PayaraVersion.PF_4_1_144_STR),
-    /** Payara 4.1.151 */
-    PF_4_1_151 ((short) 4, (short) 1, (short) 0, (short) 0, (short) 15, (short) 1, (short) 0, PayaraVersion.PF_4_1_151_STR),
-    /** Payara 4.1.152 */
-    PF_4_1_152 ((short) 4, (short) 1, (short) 0, (short) 0, (short) 15, (short) 2, (short) 0, PayaraVersion.PF_4_1_152_STR),
-    /** Payara 4.1.153 */
-    PF_4_1_153 ((short) 4, (short) 1, (short) 0, (short) 0, (short) 15, (short) 3, (short) 0, PayaraVersion.PF_4_1_153_STR),
-    /** Payara 4.1.1.154 */
-    PF_4_1_1_154 ((short) 4, (short) 1, (short) 1, (short) 0, (short) 15, (short) 4, (short) 0, PayaraVersion.PF_4_1_1_154_STR),
-    /** Payara 4.1.1.161 */
-    PF_4_1_1_161 ((short) 4, (short) 1, (short) 1, (short) 0, (short) 16, (short) 1, (short) 0, PayaraVersion.PF_4_1_1_161_STR),
-    /** Payara 4.1.1.162 */
-    PF_4_1_1_162 ((short) 4, (short) 1, (short) 1, (short) 0, (short) 16, (short) 2, (short) 0, PayaraVersion.PF_4_1_1_162_STR),
-    /** Payara 4.1.1.163 */
-    PF_4_1_1_163 ((short) 4, (short) 1, (short) 1, (short) 0, (short) 16, (short) 3, (short) 0, PayaraVersion.PF_4_1_1_163_STR),
-    /** Payara 4.1.1.164 */
-    PF_4_1_1_164 ((short) 4, (short) 1, (short) 1, (short) 0, (short) 16, (short) 4, (short) 0, PayaraVersion.PF_4_1_1_164_STR),
-    /** Payara 4.1.1.171 */
-    PF_4_1_1_171 ((short) 4, (short) 1, (short) 1, (short) 0, (short) 17, (short) 1, (short) 0, PayaraVersion.PF_4_1_1_171_STR),
-    /** Payara 4.1.2.172 */
-    PF_4_1_2_172 ((short) 4, (short) 1, (short) 2, (short) 0, (short) 17, (short) 2, (short) 0, PayaraVersion.PF_4_1_2_172_STR),
-    /** Payara 4.1.2.173 */
-    PF_4_1_2_173 ((short) 4, (short) 1, (short) 2, (short) 0, (short) 17, (short) 3, (short) 0, PayaraVersion.PF_4_1_2_173_STR),
-    /** Payara 4.1.2.174 */
-    PF_4_1_2_174 ((short) 4, (short) 1, (short) 2, (short) 0, (short) 17, (short) 4, (short) 0, PayaraVersion.PF_4_1_2_174_STR),
-    /** Payara 4.1.2.181 */
-    PF_4_1_2_181 ((short) 4, (short) 1, (short) 2, (short) 0, (short) 18, (short) 1, (short) 0, PayaraVersion.PF_4_1_2_181_STR),
-    /** Payara 5.181 */
-    PF_5_181 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 18, (short) 1, (short) 0, PayaraVersion.PF_5_181_STR),
-    /** Payara 5.182 */
-    PF_5_182 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 18, (short) 2, (short) 0, PayaraVersion.PF_5_182_STR),
-    /** Payara 5.183 */
-    PF_5_183 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 18, (short) 3, (short) 0, PayaraVersion.PF_5_183_STR),
-    /** Payara 5.184 */
-    PF_5_184 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 18, (short) 4, (short) 0, PayaraVersion.PF_5_184_STR),
-    /** Payara 5.191 */
-    PF_5_191 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 19, (short) 1, (short) 0, PayaraVersion.PF_5_191_STR),
-    /** Payara 5.192 */
-    PF_5_192 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 19, (short) 2, (short) 0, PayaraVersion.PF_5_192_STR),
-    /** Payara 5.193 */
-    PF_5_193 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 19, (short) 3, (short) 0, PayaraVersion.PF_5_193_STR),
-    /** Payara 5.194 */
-    PF_5_194 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 19, (short) 4, (short) 0, PayaraVersion.PF_5_194_STR),
-    /** Payara 5.201 */
-    PF_5_201 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 20, (short) 1, (short) 0, PayaraVersion.PF_5_201_STR),
-    /** Payara 5.202 */
-    PF_5_202 ((short) 5, (short) 0, (short) 0, (short) 0, (short) 20, (short) 2, (short) 0, PayaraVersion.PF_5_202_STR);
-
-    //add new version
-    /**  A <code>String</code> representation of PF_4_1_144 value. */
-    static final String PF_4_1_144_STR = "4.1.144";
-    /** Additional <code>String</code> representations of 4.1.144 value. */
-    static final String PF_4_1_144_STR_NEXT[] = {"4.1.144.0"};
-    /**  A <code>String</code> representation of PF_4_1_151 value. */
-    static final String PF_4_1_151_STR = "4.1.151";
-    /** Additional <code>String</code> representations of 4.1.151 value. */
-    static final String PF_4_1_151_STR_NEXT[] = {"4.1.151.0"};
-    /**  A <code>String</code> representation of PF_4_1_152 value. */
-    static final String PF_4_1_152_STR = "4.1.152";
-    /** Additional <code>String</code> representations of 4.1.152 value. */
-    static final String PF_4_1_152_STR_NEXT[] = {"4.1.152.0"};
-    /**  A <code>String</code> representation of PF_4_1_153 value. */
-    static final String PF_4_1_153_STR = "4.1.153";
-    /** Additional <code>String</code> representations of 4.1.153 value. */
-    static final String PF_4_1_153_STR_NEXT[] = {"4.1.153.0"};
-    /**  A <code>String</code> representation of PF_4_1_1_154 value. */
-    static final String PF_4_1_1_154_STR = "4.1.1.154";
-    /** Additional <code>String</code> representations of 4.1.1.154 value. */
-    static final String PF_4_1_1_154_STR_NEXT[] = {"4.1.1.154.0"};
-    /**  A <code>String</code> representation of PF_4_1_1_161 value. */
-    static final String PF_4_1_1_161_STR = "4.1.1.161";
-    /** Additional <code>String</code> representations of 4.1.1.161 value. */
-    static final String PF_4_1_1_161_STR_NEXT[] = {"4.1.1.161.0"};
-    /**  A <code>String</code> representation of PF_4_1_1_162 value. */
-    static final String PF_4_1_1_162_STR = "4.1.1.162";
-    /** Additional <code>String</code> representations of 4.1.1.162 value. */
-    static final String PF_4_1_1_162_STR_NEXT[] = {"4.1.1.162.0"};
-    /**  A <code>String</code> representation of PF_4_1_1_163 value. */
-    static final String PF_4_1_1_163_STR = "4.1.1.163";
-    /** Additional <code>String</code> representations of 4.1.1.163 value. */
-    static final String PF_4_1_1_163_STR_NEXT[] = {"4.1.1.163.0"};
-    /**  A <code>String</code> representation of PF_4_1_1_164 value. */
-    static final String PF_4_1_1_164_STR = "4.1.1.164";
-    /** Additional <code>String</code> representations of 4.1.1.164 value. */
-    static final String PF_4_1_1_164_STR_NEXT[] = {"4.1.1.164.0"};
-    /**  A <code>String</code> representation of PF_4_1_1_171 value. */
-    static final String PF_4_1_1_171_STR = "4.1.1.171";
-    /** Additional <code>String</code> representations of 4.1.1.171 value. */
-    static final String PF_4_1_1_171_STR_NEXT[] = {"4.1.1.171.0"};
-    /**  A <code>String</code> representation of PF_4_1_2_172 value. */
-    static final String PF_4_1_2_172_STR = "4.1.2.172";
-    /** Additional <code>String</code> representations of 4.1.2.172 value. */
-    static final String PF_4_1_2_172_STR_NEXT[] = {"4.1.2.172.0"};
-    /**  A <code>String</code> representation of PF_4_1_2_173 value. */
-    static final String PF_4_1_2_173_STR = "4.1.2.173";
-    /** Additional <code>String</code> representations of 4.1.2.173 value. */
-    static final String PF_4_1_2_173_STR_NEXT[] = {"4.1.2.173.0"};
-    /**  A <code>String</code> representation of PF_4_1_2_174 value. */
-    static final String PF_4_1_2_174_STR = "4.1.2.174";
-    /** Additional <code>String</code> representations of 4.1.2.174 value. */
-    static final String PF_4_1_2_174_STR_NEXT[] = {"4.1.2.174.0"};
-    /**  A <code>String</code> representation of PF_4_1_2_181 value. */
-    static final String PF_4_1_2_181_STR = "4.1.2.181";
-    /** Additional <code>String</code> representations of 4.1.2.181 value. */
-    static final String PF_4_1_2_181_STR_NEXT[] = {"4.1.2.181.0"};
-    /**  A <code>String</code> representation of PF_5_181 value. */
-    static final String PF_5_181_STR = "5.181";
-    /** Additional <code>String</code> representations of 5.181 value. */
-    static final String PF_5_181_STR_NEXT[] = {"5.181.0"};
-    /**  A <code>String</code> representation of PF_5_182 value. */
-    static final String PF_5_182_STR = "5.182";
-    /** Additional <code>String</code> representations of 5.182 value. */
-    static final String PF_5_182_STR_NEXT[] = {"5.182.0"};
-    /**  A <code>String</code> representation of PF_5_183 value. */
-    static final String PF_5_183_STR = "5.183";
-    /** Additional <code>String</code> representations of 5.183 value. */
-    static final String PF_5_183_STR_NEXT[] = {"5.183.0"};
-    /**  A <code>String</code> representation of PF_5_184 value. */
-    static final String PF_5_184_STR = "5.184";
-    /** Additional <code>String</code> representations of 5.184 value. */
-    static final String PF_5_184_STR_NEXT[] = {"5.184.0"};
-    /**  A <code>String</code> representation of PF_5_191 value. */
-    static final String PF_5_191_STR = "5.191";
-    /** Additional <code>String</code> representations of 5.191 value. */
-    static final String PF_5_191_STR_NEXT[] = {"5.191.0"};
-    /**  A <code>String</code> representation of PF_5_192 value. */
-    static final String PF_5_192_STR = "5.192";
-    /** Additional <code>String</code> representations of 5.192 value. */
-    static final String PF_5_192_STR_NEXT[] = {"5.192.0"};
-    /**  A <code>String</code> representation of PF_5_193 value. */
-    static final String PF_5_193_STR = "5.193";
-    /** Additional <code>String</code> representations of 5.193 value. */
-    static final String PF_5_193_STR_NEXT[] = {"5.193.0"};
-    /**  A <code>String</code> representation of PF_5_194 value. */
-    static final String PF_5_194_STR = "5.194";
-    /** Additional <code>String</code> representations of 5.194 value. */
-    static final String PF_5_194_STR_NEXT[] = {"5.194.0"};
-    /**  A <code>String</code> representation of PF_5_201 value. */
-    static final String PF_5_201_STR = "5.201";
-    /** Additional <code>String</code> representations of 5.201 value. */
-    static final String PF_5_201_STR_NEXT[] = {"5.201.0"};
-    /**  A <code>String</code> representation of PF_5_202 value. */
-    static final String PF_5_202_STR = "5.202";
-    /** Additional <code>String</code> representations of 5.202 value. */
-    static final String PF_5_202_STR_NEXT[] = {"5.202.0"};
-
+public class PayaraVersion implements Comparable<PayaraVersion> {

Review comment:
       To keep compatibility one would have to:
   * keep the `public enum PayaraVersion`
   * make it implement `Comparable`
   * Introduce new (package private) `class PayaraVersionImproved`
   * extract common functionality into `interface PayaraVersionApi`
   * make both `enum` and "improved" `class` implement the API interface

##########
File path: java/maven.embedder/nbproject/project.xml
##########
@@ -169,6 +169,7 @@
                 <friend>org.netbeans.modules.android.maven</friend>
                 <!-- danis@netbeans.org -->
                 <friend>org.vaadin.netbeans.maven</friend>
+                <friend>org.netbeans.modules.payara.tooling</friend>

Review comment:
       Expanding list of friends, constitutes an API change and has to be properly versioned. See [friend dependencies](http://wiki.apidesign.org/wiki/FriendDependencies) essay.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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