mbien commented on code in PR #4278:
URL: https://github.com/apache/netbeans/pull/4278#discussion_r905408279
##########
java/java.hints/src/org/netbeans/modules/java/hints/suggestions/Tiny.java:
##########
@@ -400,4 +402,83 @@ protected void performRewrite(final TransformationContext
ctx) {
}
+ @Hint(displayName =
"#DN_org.netbeans.modules.java.hints.suggestions.Tiny.inlineRedundantVar",
description =
"#DESC_org.netbeans.modules.java.hints.suggestions.Tiny.inlineRedundantVar",
category="suggestions", hintKind=Kind.ACTION, severity=Severity.HINT)
Review Comment:
nitpick: I believe it would improve readability (esp for future diffs) if
this wouldn't be a single line, but this is consistent with the rest of the
file so its not really a complaint - just my opinion
##########
java/java.hints/src/org/netbeans/modules/java/hints/suggestions/Tiny.java:
##########
@@ -400,4 +402,83 @@ protected void performRewrite(final TransformationContext
ctx) {
}
+ @Hint(displayName =
"#DN_org.netbeans.modules.java.hints.suggestions.Tiny.inlineRedundantVar",
description =
"#DESC_org.netbeans.modules.java.hints.suggestions.Tiny.inlineRedundantVar",
category="suggestions", hintKind=Kind.ACTION, severity=Severity.HINT)
+ @TriggerPattern(value="$type $var = $init; $statements$ return $var;")
Review Comment:
the trigger seems to be a bit greedy. The hint is active even before the
variable is declared.

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