sdedic commented on code in PR #6691:
URL: https://github.com/apache/netbeans/pull/6691#discussion_r1392313342


##########
extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java:
##########
@@ -226,15 +240,13 @@ public NbProjectInfo buildAll() {
         // introspection is only allowed for gradle 7.4 and above.
         // TODO: investigate if some of the instrospection could be done for 
earlier Gradles.
         sinceGradle("7.0", () -> {
+            initIntrospection();

Review Comment:
   Rearranging exception handling code uncovered an exception from 
`detectTaskProperties` silently ignored in NB19-20. Adding task properties to 
the conditional block for >= 7.0



##########
extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java:
##########
@@ -539,19 +553,53 @@ private static boolean isPrimitiveOrString(Class c) {
      * @param propertyTypes
      * @param defaultValues 
      */
+    private void startInspectObjectAndValues(Class clazz, Object object, 
String prefix, Map<String, Map<String, String>> globalTypes, Map<String, 
String> propertyTypes, Map<String, Object> defaultValues) {

Review Comment:
   Just force-reset depth at the start of the inspection (top-level object).



##########
extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java:
##########
@@ -789,8 +837,8 @@ private boolean dumpValue(Object value, String prefix, 
Map<String, String> prope
                 Object v = m.get(k);
                 if (v == null) {
                     defaultValues.put(prefix + "." + k, null); // NOI18N
-                } else {
-                    defaultValues.put(prefix + "." + k, Objects.toString(v)); 
// NOI18N
+                } else if (!v.equals(value)) {
+                    defaultValues.put(prefix + "." + k, objectToString(v)); // 
NOI18N

Review Comment:
   toString itself can cause StackOverflow with recursive structures.



##########
extide/gradle/src/org/netbeans/modules/gradle/loaders/LegacyProjectLoader.java:
##########
@@ -420,10 +454,30 @@ private static GradleReport createReport(Throwable e) {
         } else {
             reported = e;
         }
+        String cn = e.getClass().getName();
+        if (cn.contains("GradleScriptException") || 
cn.contains("ResolutionException")) {

Review Comment:
   These are common exception classes for failures reported by the build system 
itself, mark as 'user' or expected exceptions.



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