瀏覽代碼

Check startsWith (see if setter) like the original tried

Toni Helenius 5 年之前
父節點
當前提交
a3e8809ff2
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      jme3-code-check/src/com/jme3/gde/codecheck/hints/ReadOnlyPrimitiveHint.java

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

@@ -39,8 +39,8 @@ public class ReadOnlyPrimitiveHint {
             Tree t = treePath.getLeaf();
             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();
                 return ErrorDescriptionFactory.forName(
                         ctx,