mbien commented on code in PR #4331:
URL: https://github.com/apache/netbeans/pull/4331#discussion_r914227842


##########
enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java:
##########
@@ -151,9 +149,9 @@ public void run() {
     
     /** Transforms ErrosInfo to Annotation
      */
-    private Collection getAnnotations(ErrorInfo[] errors, StyledDocument 
document) {
+    private Collection<LineSetAnnotation> getAnnotations(ErrorInfo[] errors, 
StyledDocument document) {
         BaseDocument doc = (BaseDocument) document;
-        HashMap map = new HashMap(errors.length);
+        Map<Integer, LineSetAnnotation>  map = new HashMap(errors.length);

Review Comment:
   i overlooked this one first round. Diamond on the right.



##########
enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java:
##########
@@ -128,16 +129,13 @@ public void annotate(ErrorInfo[] errors){
         if (!added.isEmpty()) {
             final List finalAdded = added;
             final DataObject doJsp2 = doJsp;
-            Runnable docRenderer = new Runnable() {
-                @Override
-                public void run() {
-                    LineCookie cookie = 
(LineCookie)doJsp2.getCookie(LineCookie.class);
-                    Line.Set lines = cookie.getLineSet();
-
-                    for (Iterator i=finalAdded.iterator();i.hasNext();) {
-                        LineSetAnnotation ann=(LineSetAnnotation)i.next();
-                        ann.attachToLineSet(lines);
-                    }
+            Runnable docRenderer = () -> {
+                LineCookie cookie = 
(LineCookie)doJsp2.getCookie(LineCookie.class);
+                Line.Set lines = cookie.getLineSet();
+                
+                for (Iterator i=finalAdded.iterator();i.hasNext();) {
+                    LineSetAnnotation ann=(LineSetAnnotation)i.next();
+                    ann.attachToLineSet(lines);
                 }
             };

Review Comment:
   `final List finalAdded = added;`
   ->
   `final List<LineSetAnnotation> = added;`
   
   after that you can change the for loop to:
   ```
   for (LineSetAnnotation ann : finalAdded) {
       ann.attachToLineSet(lines);
   }
   ```
   



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