This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 223723
Collapse All | Expand All

(-)a/spi.java.hints/apichanges.xml (+17 lines)
Lines 1-4 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
2
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
4
4
Copyright 2012 Oracle and/or its affiliates. All rights reserved.
5
Copyright 2012 Oracle and/or its affiliates. All rights reserved.
Lines 45-50 Link Here
45
        <apidef name="JavaHintsSPI">Java Hints SPI</apidef>
46
        <apidef name="JavaHintsSPI">Java Hints SPI</apidef>
46
    </apidefs>
47
    </apidefs>
47
    <changes>
48
    <changes>
49
        <change id="ErrorDescriptionFactory.forSpan">
50
            <api name="JavaHintsSPI"/>
51
            <summary>Introducing ErrorDescriptionFactory.forSpan.</summary>
52
            <version major="1" minor="9"/>
53
            <date day="19" month="12" year="2012"/>
54
            <author login="jlahoda"/>
55
            <compatibility addition="yes"/>
56
            <description>
57
                <p>
58
                    Added ErrorDescriptionFactory.forSpan to create the correct
59
                    Java-enhanced ErrorDescription from a span.
60
                </p>    
61
            </description>
62
            <class package="org.netbeans.spi.java.hints" name="ErrorDescriptionFactory"/>
63
            <issue number="223723"/>
64
        </change>
48
        <change id="TransformationSupport">
65
        <change id="TransformationSupport">
49
            <api name="JavaHintsSPI"/>
66
            <api name="JavaHintsSPI"/>
50
            <summary>Added support for using jackpot patterns from other modules (e.g. refactoring).</summary>
67
            <summary>Added support for using jackpot patterns from other modules (e.g. refactoring).</summary>
(-)a/spi.java.hints/nbproject/project.properties (-1 / +2 lines)
Lines 1-6 Link Here
1
is.autoload=true
1
is.autoload=true
2
javac.source=1.6
2
javac.source=1.6
3
javac.compilerargs=-Xlint -Xlint:-serial
3
javac.compilerargs=-Xlint -Xlint:-serial
4
spec.version.base=1.8.0
4
spec.version.base=1.9.0
5
requires.nb.javac=true
5
requires.nb.javac=true
6
javadoc.arch=${basedir}/arch.xml
6
javadoc.arch=${basedir}/arch.xml
7
javadoc.apichanges=${basedir}/apichanges.xml
(-)a/spi.java.hints/src/org/netbeans/spi/java/hints/ErrorDescriptionFactory.java (+25 lines)
Lines 129-134 Link Here
129
        return null;
129
        return null;
130
    }
130
    }
131
    
131
    
132
    /**Create a new {@link ErrorDescription}. Severity is automatically inferred from the {@link HintContext},
133
     * and the {@link ErrorDescription} is created to be consistent with {@link ErrorDescription}s created
134
     * by the other factory methods in this class.
135
     * 
136
     * @param context from which the {@link Severity} and other properties are inferred.
137
     * @param start start of the warning
138
     * @param end end of the warning
139
     * @param text the warning text
140
     * @param fixes one or more {@link Fix}es to show shown to the user.
141
     * @return a standard {@link ErrorDescription} for use in Java source
142
     * @since 1.9
143
     */
144
    public static ErrorDescription forSpan(HintContext context, int start, int end, String text, Fix... fixes) {
145
        if (context.getHintMetadata().kind != Hint.Kind.INSPECTION) {
146
            start = end = context.getCaretLocation();
147
        }
148
149
        if (start != (-1) && end != (-1)) {
150
            LazyFixList fixesForED = org.netbeans.spi.editor.hints.ErrorDescriptionFactory.lazyListForFixes(resolveDefaultFixes(context, fixes));
151
            return org.netbeans.spi.editor.hints.ErrorDescriptionFactory.createErrorDescription("text/x-java:" + context.getHintMetadata().id, context.getSeverity(), text, context.getHintMetadata().description, fixesForED, context.getInfo().getFileObject(), start, end);
152
        }
153
154
        return null;
155
    }
156
    
132
    public static ErrorDescription forName(HintContext context, TreePath tree, String text, Fix... fixes) {
157
    public static ErrorDescription forName(HintContext context, TreePath tree, String text, Fix... fixes) {
133
        return forName(context, tree.getLeaf(), text, fixes);
158
        return forName(context, tree.getLeaf(), text, fixes);
134
    }
159
    }

Return to bug 223723