Browse Source

Check startsWith (see if setter) like the original tried

Toni Helenius 5 years ago
parent
commit
a3e8809ff2

+ 2 - 2
jme3-code-check/src/com/jme3/gde/codecheck/hints/ReadOnlyPrimitiveHint.java

@@ -39,8 +39,8 @@ public class ReadOnlyPrimitiveHint {
             Tree t = treePath.getLeaf();
             Tree t = treePath.getLeaf();
             Element el = info.getTrees().getElement(info.getTrees().getPath(info.getCompilationUnit(), t));
             Element el = info.getTrees().getElement(info.getTrees().getPath(info.getCompilationUnit(), t));
 
 
-            //TODO: add more checks
-            if ("set".equals(el.getSimpleName().toString())) {
+            // TODO: add more checks
+            if (el.getSimpleName().toString().startsWith("set")) {
                 Fix fix = new ReadOnlyPrimitiveHint.FixImpl(ctx.getInfo(), ctx.getPath()).toEditorFix();
                 Fix fix = new ReadOnlyPrimitiveHint.FixImpl(ctx.getInfo(), ctx.getPath()).toEditorFix();
                 return ErrorDescriptionFactory.forName(
                 return ErrorDescriptionFactory.forName(
                         ctx,
                         ctx,