mbien commented on code in PR #7548:
URL: https://github.com/apache/netbeans/pull/7548#discussion_r1688816208
##########
java/java.hints/src/org/netbeans/modules/java/hints/bugs/Unused.java:
##########
@@ -52,7 +52,12 @@ public class Unused {
@BooleanOption(displayName="#LBL_UnusedPackagePrivate",
tooltip="#TP_UnusedPackagePrivate",
defaultValue=DETECT_UNUSED_PACKAGE_PRIVATE_DEFAULT)
public static final String DETECT_UNUSED_PACKAGE_PRIVATE =
"detect.unused.package.private";
- @TriggerTreeKind(Kind.COMPILATION_UNIT)
+ @TriggerTreeKind({
+ //class-like kinds:
+ Kind.ANNOTATION_TYPE, Kind.CLASS, Kind.ENUM, Kind.INTERFACE,
Kind.RECORD,
+ Kind.VARIABLE,
+ Kind.METHOD
+ })
public static List<ErrorDescription> unused(HintContext ctx) {
Review Comment:
it turns out that reading values from Preferences in hot code causes
performance problems due to the need of a read lock. This is the reason why the
fast path made things so much faster in the not-unused case.
here a commit with more changes:
https://github.com/mbien/netbeans/commit/eb1dc47da1f17adcf88fc03af4bf4369c83ed5f1
feel free to squash with your PR
--
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