sid-srini commented on code in PR #9263:
URL: https://github.com/apache/netbeans/pull/9263#discussion_r3242120317


##########
extide/gradle/src/org/netbeans/modules/gradle/NbGradleProjectFactory.java:
##########
@@ -57,23 +54,23 @@ public boolean isProject(FileObject dir) {
     }
 
     static boolean isProjectCheck(FileObject dir, final boolean preferMaven) {
-        if (dir == null || FileUtil.toFile(dir) == null) {
+        File suspect = dir == null ? null : FileUtil.toFile(dir);
+        if (suspect == null) {
             return false;
         }
-        FileObject pom = dir.getFileObject("pom.xml"); //NOI18N
-        if (pom != null && pom.isData()) {
+        File pom = GradleFiles.Searcher.searchPath(suspect, "pom.xml");    
//NOI18N
+        if (pom != null && pom.isFile()) {
             if (preferMaven) {
                 return false;
             }
-            final FileObject parent = dir.getParent();
-            if (parent != null && parent.getFileObject("pom.xml") != null) { 
// NOI18N
-                return isProjectCheck(parent, preferMaven);
+            FileObject parent = dir.getParent();
+            if (parent != null && 
GradleFiles.Searcher.searchPath(FileUtil.toFile(parent), "pom.xml") != null) { 
// NOI18N
+                return isProjectCheck(parent, false);

Review Comment:
   Thanks for noticing this. 
   Yes. The NetBeans IDE prompted me to replace `preferMaven` with `false` 
since it will always be so inside this block after the pre-emptive return on 
`true` at 
[`NbGradleProjectFactory.java:65`](https://github.com/apache/netbeans/pull/9263/changes#diff-3708009dc29956e954ac6a49d3c989dae4a20270ff57ecaf2a13d1dd0c3d1bf3L65).
 :)
   
   I can revert it to refer to `preferMaven` itself here too. Please let me 
know. Thanks.



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