This document lists changes made to the Java Hints SPI.
Fuller descriptions of all changes can be found below (follow links).
Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.
These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled 1.20, your manifest should contain in its main attributes the line:
OpenIDE-Module-Module-Dependencies: $codebase > 1.20
org.netbeans.spi.java.hints.ErrorDescriptionFactory
org.netbeans.spi.java.hints.Hint
org.netbeans.spi.java.hints.IntegerOption
org.netbeans.spi.java.hints.support.TransformationSupport
The utility method JavaFixUtilities.isPrimary() was added. This API checks whether a specified tree can be used in places where a Primary expression is required.
Hints triggered by Tree.Kind are not invoked for Trees which are protected from editing (i.e. Form Builder guarded blocks). Hint implementor can opt to be triggered even for such code, in order to e.g. collect data.
Certain hints generate source code following newer language specifications.
A hint may declare minSourceVersion
in its @Hint
annotation to specify a minimum source version. Such hint will be never
invoked for files configured for earlier source level.
Adding to new constructors to JavaFix
to define
the sort text for the fix.
Defining Project/hints/java-based
folder, where provider for
hints customizers for Java-based projects should be stored.
IntegerOption
Hint
; made by: sdedic; issues:
#227822
#227959
Added declarative support for integer options. @IntegerOption
can
be used with option name field, similar to @BooleanOption
.
An option was added to Hint.Options
, so that hint can declare
to be only shown in Inspect & transform dialog. Useful for computation-intensive
hints, which should only run on demand.
ErrorDescriptionFactory
; made by: jlahoda; issues:
#223723
Added ErrorDescriptionFactory.forSpan to create the correct Java-enhanced ErrorDescription from a span.
TransformationSupport
; made by: jbecicka; issues:
#210262
Added support for using jackpot patterns from other modules (e.g. refactoring).