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 2022/12/30 05:05:34 UTC

[GitHub] [netbeans] jtulach commented on a diff in pull request #5157: Recognize nbjrt: protocol and locate JDK9+ src.zip

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


##########
java/java.platform/src/org/netbeans/modules/java/platform/queries/PlatformSourceForBinaryQuery.java:
##########
@@ -94,24 +94,46 @@ public SourceForBinaryQueryImplementation2.Result findSourceRoots2(URL binaryRoo
             this.cache.put (binaryRoot, res);
             return res;
         }
-        String binaryRootS = binaryRoot.toExternalForm();
-        if (binaryRootS.startsWith(JAR_FILE)) {
-            if (binaryRootS.endsWith(RTJAR_PATH)) {
-                //Unregistered platform
-                String srcZipS = binaryRootS.substring(4,binaryRootS.length() - RTJAR_PATH.length()) + SRC_ZIP;
-                try {
-                    URL srcZip = FileUtil.getArchiveRoot(new URL(srcZipS));
-                    FileObject fo = URLMapper.findFileObject(srcZip);
-                    if (fo != null) {
-                        return new UnregisteredPlatformResult (fo);
-                    }
-                } catch (MalformedURLException mue) {
-                    Exceptions.printStackTrace(mue);
-                }
-            }
+        return searchUnregisteredPlatform(binaryRoot.toExternalForm());
+    }
+
+  static SourceForBinaryQueryImplementation2.Result searchUnregisteredPlatform(String binaryRootS) {
+    String srcZipS = null;
+    String srcZipIn = null;
+    if (binaryRootS.startsWith(JAR_FILE)) {
+      if (binaryRootS.endsWith(RTJAR_PATH)) {

Review Comment:
   It would help if NetBeans apisupport projects specified the proper indentation settings. Otherwise the source gets formatted by my _global defaults_ (which are set to Google Java standards, not Sun/Oracle now).
   
   Reformatted in [5b0d432](https://github.com/apache/netbeans/pull/5157/commits/5b0d432b4d1e0b87ad92486b56e90cfe80c8d1f2)



-- 
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-unsubscribe@netbeans.apache.org

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