You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "lbownik (via GitHub)" <gi...@apache.org> on 2023/04/06 09:47:46 UTC
[GitHub] [netbeans] lbownik commented on a diff in pull request #5781: Force refresh of live subprojects when parent recovers from broken.
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: 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