Reputation: 25391
Using the Copy existing template...
I found the structural search for loops:
for ($Type$ $Variable$ : $Expression$) {
$Statement$;
}
I want to enhance it so that it does only find for loops where the variable is not final.
It should find:
for (String string : strings) {
// Statements
}
However not:
for (final String string : strings) {
// Statements
}
Right now it obviously finds both since there's no differentiation between final and non-final. How can I add this extra check?
Upvotes: 2
Views: 663
Reputation: 26462
!__context__.hasModifierProperty("final")
.Click OK and Find and you should get your desired result. See also the existing template static fields that are not final for an example.
Upvotes: 7