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 2018/05/22 06:49:59 UTC

[GitHub] JaroslavTulach closed pull request #554: Bringing Editor Hints SPI up-to-date

JaroslavTulach closed pull request #554: Bringing Editor Hints SPI up-to-date
URL: https://github.com/apache/incubator-netbeans/pull/554
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/spi.editor.hints/apichanges.xml b/spi.editor.hints/apichanges.xml
index a24bfafc8..ee5b74724 100644
--- a/spi.editor.hints/apichanges.xml
+++ b/spi.editor.hints/apichanges.xml
@@ -168,6 +168,34 @@ is the proper place.
              </description>
              <issue number="254375"/>
         </change>
+        
+        <change id="multiple-annotation-type">
+             <api name="EditorHintsSPI"/>
+             <summary>Support multiple ranges for ErrorDescriptor</summary>
+             <version major="1" minor="42" subsubminor="0"/>
+             <date day="17" month="7" year="2017"/>
+             <author login="mromashova"/>
+             <compatibility addition="yes" binary="compatible" deletion="no" deprecation="no" modification="no" semantic="compatible" source="compatible"/>
+             <description>
+                 Added support for multiple ranges for error/warning. New field added to ErrorDescription  as well as corresponding getter method and new constructor 
+                 in order to be able to provide multiple ranges support for highlight  particular hint. Added new factory method to
+                 ErrorDescriptionFactory which uses new ErrorDescription constructor.
+             </description>
+             <issue number="271070"/>
+        </change>   
+        
+        <change id="fixable-annotation-default-action">
+             <api name="EditorHintsSPI"/>
+             <summary>Provide a way to have fixable annotation with default action</summary>
+             <version major="1" minor="43" subsubminor="0"/>
+             <date day="24" month="7" year="2017"/>
+             <author login="mromashova"/>
+             <compatibility addition="no" binary="compatible" deletion="no" deprecation="no" modification="no" semantic="compatible" source="compatible"/>
+             <description>
+                 For custom type of annotations will dynamically register this annotation type as fixable, so Fix action (click on the icon) will work for it
+             </description>
+             <issue number="271069"/>
+        </change>                    
 
     </changes>
 
diff --git a/spi.editor.hints/nbproject/project.properties b/spi.editor.hints/nbproject/project.properties
index 2b229db1e..3044e4fcf 100644
--- a/spi.editor.hints/nbproject/project.properties
+++ b/spi.editor.hints/nbproject/project.properties
@@ -18,6 +18,6 @@ javac.compilerargs=-Xlint:unchecked
 javac.source=1.7
 javadoc.arch=${basedir}/arch.xml
 javadoc.apichanges=${basedir}/apichanges.xml
-spec.version.base=1.41.0
+spec.version.base=1.43.0
 
 test.config.stableBTD.includes=**/*Test.class
diff --git a/spi.editor.hints/src/org/netbeans/modules/editor/hints/AnnotationHolder.java b/spi.editor.hints/src/org/netbeans/modules/editor/hints/AnnotationHolder.java
index e528e7e6a..8e2f3da7f 100644
--- a/spi.editor.hints/src/org/netbeans/modules/editor/hints/AnnotationHolder.java
+++ b/spi.editor.hints/src/org/netbeans/modules/editor/hints/AnnotationHolder.java
@@ -880,46 +880,9 @@ static OffsetsBag computeHighlights(Document doc, List<ErrorDescription> errorDe
             List<int[]> currentHighlights = new ArrayList<int[]>();
 
             for (ErrorDescription e : filteredDescriptions) {
-                int beginOffset = e.getRange().getBegin().getPosition().getOffset();
-                int endOffset   = e.getRange().getEnd().getPosition().getOffset();
-
-                if (endOffset < beginOffset) {
-                    //see issue #112566
-                    int swap = endOffset;
-
-                    endOffset = beginOffset;
-                    beginOffset = swap;
-
-                    LOG.log(Level.WARNING, "Incorrect highlight in ErrorDescription, attach your messages.log to issue #112566: {0}", e.toString()); //NOI18N
-                }
-
-                int[] h = new int[] {beginOffset, endOffset};
-
-                OUT: for (Iterator<int[]> it = currentHighlights.iterator(); it.hasNext() && h != null; ) {
-                    int[] hl = it.next();
-
-                    switch (detectCollisions(hl, h)) {
-                        case 0:
-                            break;
-                        case 1:
-                            it.remove();
-                            break;
-                        case 2:
-                            h = null; //nothing to add, hl is bigger:
-                            break OUT;
-                        case 4:
-                        case 3:
-                            int start = Math.min(hl[0], h[0]);
-                            int end = Math.max(hl[1], h[1]);
-
-                                h = new int[] {start, end};
-                                it.remove();
-                            break;
-                    }
-                }
-
-                if (h != null) {
-                    currentHighlights.add(h);
+                addHighlights(currentHighlights, e.getRange());
+                for (PositionBounds positionBounds : e.getRangeTail()) {
+                    addHighlights(currentHighlights, positionBounds);
                 }
             }
 
@@ -956,6 +919,51 @@ static OffsetsBag computeHighlights(Document doc, List<ErrorDescription> errorDe
         return bag;
     }
 
+    private static void addHighlights(List<int[]> currentHighlights, PositionBounds pos) throws IOException {
+        int beginOffset = pos.getBegin().getPosition().getOffset();
+        int endOffset = pos.getEnd().getPosition().getOffset();
+
+        if (endOffset < beginOffset) {
+            //see issue #112566
+            int swap = endOffset;
+
+            endOffset = beginOffset;
+            beginOffset = swap;
+
+            LOG.log(Level.WARNING, "Incorrect highlight in ErrorDescription, attach your messages.log to issue #112566: {0}", pos.toString()); //NOI18N
+        }
+
+        int[] h = new int[]{beginOffset, endOffset};
+
+        OUT:
+        for (Iterator<int[]> it = currentHighlights.iterator(); it.hasNext() && h != null;) {
+            int[] hl = it.next();
+
+            switch (detectCollisions(hl, h)) {
+                case 0:
+                    break;
+                case 1:
+                    it.remove();
+                    break;
+                case 2:
+                    h = null; //nothing to add, hl is bigger:
+                    break OUT;
+                case 4:
+                case 3:
+                    int start = Math.min(hl[0], h[0]);
+                    int end = Math.max(hl[1], h[1]);
+
+                    h = new int[]{start, end};
+                    it.remove();
+                    break;
+            }
+        }
+
+        if (h != null) {
+            currentHighlights.add(h);
+        }        
+    }
+
     static AttributeSet getColoring(Severity s, Document d) {
         final String mimeType = DocumentUtilities.getMimeType(d);
         Map<Severity, AttributeSet> coloring = COLORINGS.get(mimeType);
diff --git a/spi.editor.hints/src/org/netbeans/modules/editor/hints/FixAction.java b/spi.editor.hints/src/org/netbeans/modules/editor/hints/FixAction.java
index 7349486e2..bf0c58bcf 100644
--- a/spi.editor.hints/src/org/netbeans/modules/editor/hints/FixAction.java
+++ b/spi.editor.hints/src/org/netbeans/modules/editor/hints/FixAction.java
@@ -19,6 +19,9 @@
 package org.netbeans.modules.editor.hints;
 
 import java.awt.event.ActionEvent;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
 import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.text.JTextComponent;
@@ -34,16 +37,34 @@
  */
 public class FixAction extends AbstractAction {
     
+    private static final Set<String> fixableAnnotations = new HashSet<>();
+    static {
+        fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_err_fixable"); // NOI18N
+        fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_hint_fixable"); // NOI18N
+        fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_verifier_fixable"); // NOI18N
+        fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_warn_fixable"); // NOI18N
+    }
+
     public FixAction() {
         putValue(NAME, NbBundle.getMessage(FixAction.class, "NM_FixAction"));
-        putValue("supported-annotation-types", new String[] {
-            "org-netbeans-spi-editor-hints-parser_annotation_err_fixable",
-            "org-netbeans-spi-editor-hints-parser_annotation_warn_fixable",
-            "org-netbeans-spi-editor-hints-parser_annotation_verifier_fixable",
-            "org-netbeans-spi-editor-hints-parser_annotation_hint_fixable"
-        });
     }
-    
+
+    /*package*/ static void addFixableAnnotationType(String fixableAnnotation) {
+        fixableAnnotations.add(fixableAnnotation);
+    }
+
+    /*package*/ static  Set<String> getFixableAnnotationTypes() {
+        return Collections.unmodifiableSet(fixableAnnotations);
+    }
+
+    @Override
+    public Object getValue(String key) {
+        if ("supported-annotation-types".equals(key)) {//NOI18N
+            return fixableAnnotations.toArray(new String[0]);
+        }
+        return super.getValue(key);
+    }
+
     public void actionPerformed(ActionEvent e) {
         if (!HintsUI.getDefault().invokeDefaultAction(true)) {
             Object source = e.getSource();
diff --git a/spi.editor.hints/src/org/netbeans/modules/editor/hints/HintsUI.java b/spi.editor.hints/src/org/netbeans/modules/editor/hints/HintsUI.java
index 704a14ad8..d512faa22 100644
--- a/spi.editor.hints/src/org/netbeans/modules/editor/hints/HintsUI.java
+++ b/spi.editor.hints/src/org/netbeans/modules/editor/hints/HintsUI.java
@@ -26,7 +26,6 @@
 import java.awt.Container;
 import java.awt.Cursor;
 import java.awt.Dimension;
-import java.awt.GraphicsConfiguration;
 import java.awt.GraphicsDevice;
 import java.awt.GraphicsEnvironment;
 import java.awt.HeadlessException;
@@ -48,11 +47,9 @@
 import java.lang.ref.WeakReference;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
@@ -130,20 +127,11 @@
     //-J-Dorg.netbeans.modules.editor.hints.HintsUI.always.show.error=true
     private static final boolean ALWAYS_SHOW_ERROR_MESSAGE = Boolean.getBoolean(HintsUI.class.getName() + ".always.show.error");
     private static HintsUI INSTANCE;
-    private static final Set<String> fixableAnnotations;
     private static final String POPUP_NAME = "hintsPopup"; // NOI18N
     private static final String SUB_POPUP_NAME = "subHintsPopup"; // NOI18N
     private static final int POPUP_VERTICAL_OFFSET = 5;
     private static final RequestProcessor WORKER = new RequestProcessor(HintsUI.class.getName(), 1, false, false);
 
-    static {
-        fixableAnnotations = new HashSet<String>(3);
-
-        fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_err_fixable"); // NOI18N
-        fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_hint_fixable"); // NOI18N
-        fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_verifier_fixable"); // NOI18N
-        fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_warn_fixable"); // NOI18N
-    }
 
     public static synchronized HintsUI getDefault() {
         if (INSTANCE == null)
@@ -656,7 +644,7 @@ boolean invokeDefaultAction(boolean onlyActive) {
                         return false;
                     }
                     String type = activeAnnotation.getAnnotationType();
-                    if (!fixableAnnotations.contains(type) && onlyActive) {
+                    if (!FixAction.getFixableAnnotationTypes().contains(type) && onlyActive) {
                         return false;
                     }
                     if (onlyActive) {
diff --git a/spi.editor.hints/src/org/netbeans/modules/editor/hints/ParseErrorAnnotation.java b/spi.editor.hints/src/org/netbeans/modules/editor/hints/ParseErrorAnnotation.java
index 401958dd5..17ea6bae7 100644
--- a/spi.editor.hints/src/org/netbeans/modules/editor/hints/ParseErrorAnnotation.java
+++ b/spi.editor.hints/src/org/netbeans/modules/editor/hints/ParseErrorAnnotation.java
@@ -103,6 +103,10 @@ public String getAnnotationType() {
                     throw new IllegalArgumentException(String.valueOf(severity));
             }
         } else {
+            if (hasFixes) {
+                //dynamically register this annotation type as fixable, so Fix action (click on the icon) will work for it
+                FixAction.addFixableAnnotationType(customType);
+            }
             return customType;
         }
     }
diff --git a/spi.editor.hints/src/org/netbeans/spi/editor/hints/ErrorDescription.java b/spi.editor.hints/src/org/netbeans/spi/editor/hints/ErrorDescription.java
index 65a328d50..a0f88faff 100644
--- a/spi.editor.hints/src/org/netbeans/spi/editor/hints/ErrorDescription.java
+++ b/spi.editor.hints/src/org/netbeans/spi/editor/hints/ErrorDescription.java
@@ -19,6 +19,7 @@
 package org.netbeans.spi.editor.hints;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import org.netbeans.api.annotations.common.CheckForNull;
 import org.openide.filesystems.FileObject;
 import org.openide.text.PositionBounds;
@@ -39,6 +40,7 @@
     private final String customType;
     private final LazyFixList fixes;
     private final PositionBounds span;
+    private final ArrayList<PositionBounds> spanTail = new ArrayList<>();
     private final FileObject file;
 
     /**
@@ -56,6 +58,21 @@
         this.file        = file;
     }
     
+    
+    ErrorDescription(FileObject file, String id, String description, CharSequence details, Severity severity, String customType, LazyFixList fixes, 
+            PositionBounds span, ArrayList<PositionBounds> spanTail) {
+        this.id = id;
+        this.description = description;
+        this.details = details;
+        this.severity    = severity;
+        this.customType = customType;
+        this.fixes       = fixes;
+        this.span        = span;
+        this.spanTail.clear();
+        this.spanTail.addAll(spanTail);
+        this.file        = file;
+    }
+    
     /**
      * The constructor is intentionally not public. Use 
      * {@link ErrorDescriptionFactory} when you need an instance of this class.
@@ -126,6 +143,15 @@ public LazyFixList getFixes() {
     public PositionBounds getRange() {
         return span;
     }
+    
+    /**
+     *  Return range tail: to support multiple ranges for error/warning
+     * @return 
+     * @since 1.42
+     */
+    public ArrayList<PositionBounds> getRangeTail() {
+        return spanTail;
+    }
 
     /**
      * @return associated file or <code>null</code> if there is none
diff --git a/spi.editor.hints/src/org/netbeans/spi/editor/hints/ErrorDescriptionFactory.java b/spi.editor.hints/src/org/netbeans/spi/editor/hints/ErrorDescriptionFactory.java
index d52148f64..113667a02 100644
--- a/spi.editor.hints/src/org/netbeans/spi/editor/hints/ErrorDescriptionFactory.java
+++ b/spi.editor.hints/src/org/netbeans/spi/editor/hints/ErrorDescriptionFactory.java
@@ -18,7 +18,10 @@
  */
 package org.netbeans.spi.editor.hints;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.swing.text.Document;
 import javax.swing.text.Position;
 import org.netbeans.api.annotations.common.NonNull;
@@ -242,6 +245,51 @@ private ErrorDescriptionFactory() {
         return new ErrorDescription(file, id, description, details, severity, fixes, HintsControllerImpl.linePart(file, start, end));
     }
     
+ /**Create a new {@link ErrorDescription} with the given parameters.
+     *
+     * Should be called inside document read lock to assure consistency
+     *
+     * @param id an optional ID of the {@link ErrorDescription}. Should represent a "type" of an error/warning.
+     *           It is recommended that providers prefix the ID with their unique prefix.
+     * @param severity the desired {@link Severity}
+     * @param customType
+     * @param description the text of the error/warning
+     * @param details optional "more details" describing the error/warning
+     * @param fixes a collection of {@link Fix}es that should be shown for the error/warning
+     * @param file for which the {@link ErrorDescription} should be created
+     * @param starts the array of start offsets for error/warning
+     * @param ends the array of end offsets for error/warning
+     * @return a newly created {@link ErrorDescription} based on the given parameters
+     * @since 1.42
+     */
+    public static @NonNull ErrorDescription createErrorDescription(@NullAllowed String id, @NonNull Severity severity, 
+            @NullAllowed String customType, @NonNull String description, @NullAllowed CharSequence details, @NonNull LazyFixList fixes, 
+            @NonNull FileObject file, int[] starts, int[] ends) {
+        Parameters.notNull("severity", severity);
+        Parameters.notNull("description", description);
+        Parameters.notNull("fixes", fixes);
+        Parameters.notNull("file", file);
+        Parameters.notNull("starts", starts);
+        Parameters.notNull("ends", ends);        
+        if (starts.length == 0 || starts[0] < 0) throw new IndexOutOfBoundsException("start < 0 (" + starts + " < 0)");;//NOI18N
+        if ( ends.length == 0 || ends[0] < 0) throw new IndexOutOfBoundsException("end < 0 (" + ends + " < 0)");;//NOI18N
+        if (ends.length != starts.length) throw new IndexOutOfBoundsException("starts lentgh:" + starts.length + " != " + ends.length + " ends length");//NOI18N
+        PositionBounds span = HintsControllerImpl.linePart(file, starts[0], ends[0]);
+        ArrayList<PositionBounds> spanTail = new ArrayList<>();
+        if (starts.length > 1) {
+            for (int i = 1; i < starts.length; i++) {
+                //just skip if starts greater or equals to end, no need to throw exception
+                if (starts[i] >= ends[i]) {
+                    //log and continue
+                    Logger.getLogger(ErrorDescriptionFactory.class.getName()).log(Level.INFO, "Incorrect span,  start=" + starts[i] + ", end=" + ends[i], new Exception());;//NOI18N
+                    continue;
+                }
+                spanTail.add(HintsControllerImpl.linePart(file, starts[i], ends[i]));
+            }
+        }
+        return new ErrorDescription(file, id, description, details, severity, customType, fixes, span, spanTail);
+    }    
+    
     /**Create a new {@link ErrorDescription} with the given parameters.
      *
      * @param id an optional ID of the {@link ErrorDescription}. Should represent a "type" of an error/warning.
@@ -291,6 +339,52 @@ private ErrorDescriptionFactory() {
         
         return new ErrorDescription(file, id, description, details, severity, customType, new StaticFixList(fixes), HintsControllerImpl.linePart(doc, start, end));
     }
+    
+    /**Create a new {@link ErrorDescription} with the given parameters.
+     *
+     * @param id an optional ID of the {@link ErrorDescription}. Should represent a "type" of an error/warning.
+     *           It is recommended that providers prefix the ID with their unique prefix.
+     * @param severity the desired {@link Severity}
+     * @param customType custom annotation type
+     * @param description the text of the error/warning
+     * @param details optional "more details" describing the error/warning
+     * @param fixes a collection of {@link Fix}es that should be shown for the error/warning
+     * @param doc document for which the {@link ErrorDescription} should be created
+     * @param starts the array of start offsets for error/warning
+     * @param ends the array of end offsets for error/warning
+     * @return a newly created {@link ErrorDescription} based on the given parameters
+     * @since 1.42
+     */
+    public static @NonNull ErrorDescription createErrorDescription(@NullAllowed String id, @NonNull Severity severity, 
+            @NullAllowed String customType, @NonNull String description, @NullAllowed CharSequence details,  @NonNull List<Fix> fixes, 
+            @NonNull Document doc, int[] starts, int[] ends) {
+        Parameters.notNull("severity", severity);
+        Parameters.notNull("description", description);
+        Parameters.notNull("fixes", fixes);
+        Parameters.notNull("doc", doc);
+        Parameters.notNull("starts", starts);
+        Parameters.notNull("ends", ends);                
+        DataObject od = (DataObject) doc.getProperty(Document.StreamDescriptionProperty);
+        FileObject file = od != null ? od.getPrimaryFile() : null;
+        if (starts.length == 0 || starts[0] < 0) throw new IndexOutOfBoundsException("start < 0 (" + starts + " < 0)");;//NOI18N
+        if ( ends.length == 0 || ends[0] < 0) throw new IndexOutOfBoundsException("end < 0 (" + ends + " < 0)");;//NOI18N
+        if (ends.length != starts.length) throw new IndexOutOfBoundsException("starts lentgh:" + starts.length + " != " + ends.length + " ends length");//NOI18N
+        PositionBounds span = HintsControllerImpl.linePart(file, starts[0], ends[0]);
+        ArrayList<PositionBounds> spanTail = new ArrayList<>();
+        if (starts.length > 1) {
+            for (int i = 1; i < starts.length; i++) {
+                //just skip if starts greater or equals to end
+                if (starts[i] >= ends[i]) {
+                    //log and continue
+                    Logger.getLogger(ErrorDescriptionFactory.class.getName()).log(Level.INFO, "Incorrect span,  start=" + starts[i] + ", end=" + ends[i], new Exception());;//NOI18N
+                    continue;
+                }
+                spanTail.add(HintsControllerImpl.linePart(file, starts[i], ends[i]));
+            }
+        }
+        return new ErrorDescription(file, id, description, details, severity, customType, new StaticFixList(fixes), 
+                span, spanTail);
+    }
 
     /**
      * Converts "normal" list of {@link Fix}es into {@link LazyFixList}
diff --git a/spi.editor.hints/test/unit/src/org/netbeans/modules/editor/hints/AnnotationHolderTest.java b/spi.editor.hints/test/unit/src/org/netbeans/modules/editor/hints/AnnotationHolderTest.java
index 27e966ff9..3d4345aaf 100644
--- a/spi.editor.hints/test/unit/src/org/netbeans/modules/editor/hints/AnnotationHolderTest.java
+++ b/spi.editor.hints/test/unit/src/org/netbeans/modules/editor/hints/AnnotationHolderTest.java
@@ -21,6 +21,7 @@
 
 import java.io.OutputStream;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import javax.swing.text.AttributeSet;
 import javax.swing.text.BadLocationException;
@@ -46,11 +47,11 @@
 import org.openide.filesystems.FileSystem;
 import org.openide.filesystems.FileUtil;
 import org.openide.loaders.DataObject;
-import org.openide.text.Annotation;
 import org.openide.util.Lookup;
 import org.openide.util.lookup.Lookups;
 
 import static org.netbeans.modules.editor.hints.AnnotationHolder.*;
+import org.netbeans.spi.editor.hints.Fix;
 import static org.netbeans.spi.editor.hints.Severity.*;
 
 /**
@@ -83,6 +84,22 @@ protected void setUp() throws Exception {
         doc = ec.openDocument();
     }
     
+    public void testMultiLineErrors() throws Exception {
+        ErrorDescription ed1 = ErrorDescriptionFactory.createErrorDescription(null, Severity.ERROR, "clank-diagnostics-error", "1", null, 
+                ErrorDescriptionFactory.lazyListForFixes(Collections.<Fix>emptyList()), file, new int[] {33 - 30, 55 - 30 - 1}, 
+                new int[] {40 - 30, 58 - 30 -1});
+        ErrorDescription ed2 = ErrorDescriptionFactory.createErrorDescription(null, Severity.WARNING, "clank-diagnostics-warning", "1", null, 
+                ErrorDescriptionFactory.lazyListForFixes(Collections.<Fix>emptyList()), file, new int[] {55 - 30 - 1, 69 - 30 - 2}, 
+                new int[] {58 - 30 - 1, 75 - 30 - 2});
+        
+        List<ErrorDescription> errors = Arrays.asList(ed1, ed2);
+        final OffsetsBag bag = AnnotationHolder.computeHighlights(doc, errors);
+        assertHighlights("",bag, new int[] {33 - 30, 40 - 30, 55 - 30 - 1, 58 - 30 - 1, 69 - 30 -2, 75 - 30 - 2}, 
+                new AttributeSet[] {AnnotationHolder.getColoring(ERROR, doc), 
+                    AnnotationHolder.getColoring(ERROR, doc), 
+                    AnnotationHolder.getColoring(WARNING, doc)});
+    }    
+    
     public void testComputeHighlightsOneLayer1() throws Exception {
         ErrorDescription ed1 = ErrorDescriptionFactory.createErrorDescription(Severity.ERROR, "1", file, 1, 3);
         ErrorDescription ed2 = ErrorDescriptionFactory.createErrorDescription(Severity.ERROR, "2", file, 5, 6);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

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