sdedic commented on code in PR #9112:
URL: https://github.com/apache/netbeans/pull/9112#discussion_r2675148900
##########
extide/gradle/src/org/netbeans/modules/gradle/GradleProject.java:
##########
@@ -105,6 +105,12 @@ public String toString() {
return "GradleProject{" + "quality=" + quality + ", baseProject=" +
baseProject + '}';
}
+ public boolean betterThan(GradleProject prj) {
+ return prj == null
+ || quality.betterThan(prj.quality)
+ || ((quality == prj.quality) && getProblems().size() >
prj.getProblems().size());
Review Comment:
possible refinement: it may be more stable to compare only problems that
have error+exception severity.
##########
extide/gradle/src/org/netbeans/modules/gradle/loaders/LegacyProjectLoader.java:
##########
@@ -293,22 +286,20 @@ private static GradleProject
loadGradleProject(ReloadContext ctx, CancellationTo
for (String s : info.getProblems()) {
reps.add(GradleProject.createGradleReport(f == null ?
null : f.toPath(), s));
}
- return ctx.previous.invalidate(reps.toArray(new
GradleReport[0]));
+ return
ctx.previous.invalidate(reps.toArray(GradleReport[]::new));
}
}
} catch (GradleConnectionException | IllegalStateException ex) {
LOG.log(FINE, "Failed to retrieve project information for: " +
base.getProjectDir(), ex);
List<GradleReport> problems =
exceptionsToProblems(ctx.project.getGradleFiles().getBuildScript(), ex);
errors.openNotification(TIT_LOAD_FAILED(base.getProjectDir()),
ex.getMessage(), GradleProjectErrorNotifications.bulletedList(problems));
- return ctx.previous.invalidate(problems.toArray(new
GradleReport[0]));
- } catch (ThreadDeath td) {
Review Comment:
I'd suggest to rethrow ThreadDeath here
--
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