sdedic commented on code in PR #5781:
URL: https://github.com/apache/netbeans/pull/5781#discussion_r1159762426
##########
java/maven/src/org/netbeans/modules/maven/NbMavenProjectImpl.java:
##########
@@ -552,6 +555,53 @@ public RequestProcessor.Task fireProjectReload() {
}
return reloadTask;
}
+
+ private void reloadPossibleBrokenModules(MavenProject preceding,
MavenProject p) {
+ // restrict to just poms that were marked as broken/incomplete.
+ if (!(MavenProjectCache.isFallbackproject(preceding) ||
+
preceding.getContextValue("org.netbeans.modules.maven.problems.primingNotDone")
!= Boolean.TRUE)) {
+ return;
+ }
+ // but do not cascade from projects, which are themselves broken.
+ if (MavenProjectCache.isFallbackproject(p)) {
+ return;
+ }
+ File basePOMFile = p.getFile().getParentFile();
+ for (String modName : p.getModules()) {
+ File modPom = new File(new File(basePOMFile, modName), "pom.xml");
+ if (!modPom.exists() && modPom.isFile()) {
+ LOG.log(Level.FINE, "POM file {0} for module {1} does not
exist", new Object[] { modPom, modName });
+ continue;
+ }
+ MavenProject child = MavenProjectCache.getMavenProject(modPom,
true, false);
+ if (child == null) {
+ continue;
+ }
+ // the project may have more problems, more subtle, but now repair
just total breakage
+ if (!MavenProjectCache.isFallbackproject(child)) {
+ LOG.log(Level.FINE, "Project for module {0} is not a fallback,
skipping", modName);
Review Comment:
Unit tests are fine, but when you try to analyse some weird behaviour either
with timing dependency or on-site (e.g. on colleague's computer, or in the
datacenter), logs are **very** useful.
--
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