lbownik commented on code in PR #5781:
URL: https://github.com/apache/netbeans/pull/5781#discussion_r1159556946


##########
java/maven/src/org/netbeans/modules/maven/modelcache/MavenProjectCache.java:
##########
@@ -350,6 +359,44 @@ private static boolean 
isLifecycleParticipatnIgnored(AbstractMavenLifecycleParti
         }
         return newproject;
     }
+
+    private static final String CONTEXT_PARTIAL_PROJECT = 
"org.netbeans.modules.maven.partialProject"; // NOI18N
+    private static final String CONTEXT_FALLBACK_PROJECT = 
"org.netbeans.modules.maven.fallbackProject"; // NOI18N
+    
+    /**
+     * Create a fallback project, but patch the incomplete project from the 
building result into it.
+     * The method will eventually start to return the partial project but 
still flagged as a fallback - see {@link 
#isFallbackproject(org.apache.maven.project.MavenProject)}.
+     * 
+     * @param result the maven execution / project building result.
+     * @param projectFile the project file.
+     * @return fallback project
+     * @throws AssertionError 
+     */
+    public static MavenProject getFallbackProject(MavenExecutionResult result, 
File projectFile) throws AssertionError {
+        MavenProject toReturn = getFallbackProject(projectFile);
+        if (result == null) {
+            return toReturn;

Review Comment:
   this is strange tactics. shouldn't this 
   if (result == null)
   be executed by a call site and then 
   getFallbackProject(MavenExecutionResult result, File projectFile)
   be called only when result is not nulll ??
   
   withi this approach short circuit approach methods mean 
"meybeExecuteSomething" :/



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