MartinBalin commented on code in PR #9650:
URL: https://github.com/apache/netbeans/pull/9650#discussion_r4158840929


##########
ide/projectapi.nb/src/org/netbeans/modules/projectapi/nb/NbProjectManager.java:
##########
@@ -250,11 +261,17 @@ public Project run() throws IOException {
                         assert !LoadStatus.LOADING_PROJECT.is(o);
                         wasSomeSuchProject = 
LoadStatus.SOME_SUCH_PROJECT.is(o);
                         if (LoadStatus.NO_SUCH_PROJECT.is(o)) {
-                            if (LOG.isLoggable(Level.FINE)) {
-                                LOG.log(Level.FINE, "findProject({0}) in {1}: 
NO_SUCH_PROJECT", new Object[] {projectDirectory, 
Thread.currentThread().getName()});
+                            if (fallback) {
+                                // treat a not checked project yet
+                                o = null;
+                            } else {
+                                if (LOG.isLoggable(Level.FINE)) {
+                                    LOG.log(Level.FINE, "findProject({0}) in 
{1}: NO_SUCH_PROJECT", new Object[]{projectDirectory, 
Thread.currentThread().getName()});
+                                }
+                                return null;
                             }
-                            return null;
-                        } else if (o != null && 
!LoadStatus.SOME_SUCH_PROJECT.is(o)) {
+                        }
+                        if (o != null && !LoadStatus.SOME_SUCH_PROJECT.is(o)) {

Review Comment:
   **Fallbacks break existing project recognition consumers**
   Once cached, a fallback is returned by ordinary findProject(). Consequently, 
FileOwnerQuery assigns previously unowned Java files to it, disabling 
single-file Run/Debug and classpath support, which require a null owner. It 
also makes ProjectGenerator.createProject() reject the folder as already 
containing a project. Preserve these existing consumers’ behavior before 
exposing fallbacks through the ordinary cache.



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