You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/05/10 16:25:16 UTC

[GitHub] [netbeans] lkishalmi opened a new pull request #2944: [NETBEANS-5668] Fix slipping
-s in the Project Problem Dialog

lkishalmi opened a new pull request #2944:
URL: https://github.com/apache/netbeans/pull/2944


   Well it not just fix the <br/>-s slipping into the Gradle Project Problem Dialog, but also makes some errors more in a more readable form.


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

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


[GitHub] [netbeans] sdedic commented on a change in pull request #2944: [NETBEANS-5668] Fix slipping
-s in the Project Problem Dialog

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #2944:
URL: https://github.com/apache/netbeans/pull/2944#discussion_r629559199



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/loaders/LegacyProjectLoader.java
##########
@@ -142,38 +144,40 @@ private static GradleProject loadGradleProject(ReloadContext ctx, CancellationTo
             errors.clear();
             info = retrieveProjectInfo(goOnline, pconn, cmd, token, pl);
 
+            if (!info.getProblems().isEmpty()) {
+                errors.openNotification(
+                        TIT_LOAD_ISSUES(base.getProjectDir().getName()),
+                        TIT_LOAD_ISSUES(base.getProjectDir().getName()),
+                        GradleProjectErrorNotifications.bulletedList(info.getProblems()));                
+            }
             if (!info.hasException()) {
                 if (!info.getProblems().isEmpty()) {
                     // If we do not have exception, but seen some problems the we mark the quality as SIMPLE
                     quality = SIMPLE;
-                    errors.openNotification(
-                            TIT_LOAD_ISSUES(base.getProjectDir().getName()),
-                            TIT_LOAD_ISSUES(base.getProjectDir().getName()),
-                            GradleProjectErrorNotifications.bulletedList(info.getProblems()));
-
                 } else {
                     quality = ctx.aim;
                 }
             } else {
-                String problem = info.getGradleException();
-                String[] lines = problem.split("\n");
-                LOG.log(INFO, "Failed to retrieve project information for: {0}\nReason: {1}", new Object[] {base.getProjectDir(), problem}); //NOI18N
-                errors.openNotification(TIT_LOAD_FAILED(base.getProjectDir().getName()), lines[0], problem);
-                return ctx.previous.invalidate(problem);
+                if (info.getProblems().isEmpty()) {
+                    String problem = info.getGradleException();
+                    String[] lines = problem.split("\n");
+                    LOG.log(INFO, "Failed to retrieve project information for: {0}\nReason: {1}", new Object[] {base.getProjectDir(), problem}); //NOI18N
+                    errors.openNotification(TIT_LOAD_FAILED(base.getProjectDir().getName()), lines[0], problem);
+                    return ctx.previous.invalidate(problem);
+                } else {
+                    return ctx.previous.invalidate(info.getProblems().toArray(new String[0]));
+                }
             }
         } catch (GradleConnectionException | IllegalStateException ex) {
             LOG.log(FINE, "Failed to retrieve project information for: " + base.getProjectDir(), ex);
-            StringBuilder sb = new StringBuilder();
+            List<String> problems = new ArrayList<>();
             Throwable th = ex;
-            String separator = "";
             while (th != null) {
-                sb.insert(0, separator);
-                sb.insert(0, th.getMessage());
+                problems.add(th.getMessage());
                 th = th.getCause();
-                separator = "<br/>";
             }
-            errors.openNotification(TIT_LOAD_FAILED(base.getProjectDir()), ex.getMessage(), sb.toString());
-            return ctx.previous.invalidate(sb.toString());
+            errors.openNotification(TIT_LOAD_FAILED(base.getProjectDir()), ex.getMessage(), GradleProjectErrorNotifications.bulletedList(problems));

Review comment:
       The problems list is already html-format, so no newlines inside ... so further newline-split in `openNotification` has no effect. Good.




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

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


[GitHub] [netbeans] lkishalmi merged pull request #2944: [NETBEANS-5668] Fix slipping
-s in the Project Problem Dialog

Posted by GitBox <gi...@apache.org>.
lkishalmi merged pull request #2944:
URL: https://github.com/apache/netbeans/pull/2944


   


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

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