Java code refactoring inside annotation's string value (e.g. to support Google's Cofoja)

Hello,

Please consider the following snippet:

public class ClassA {

  private int count = 0;

  @Requires({

    "this.count > 0",

    "p1 != null",

    "p2 > 0"

  })

  public String method1(String p1, long p2) {

    // ...

  }

}

Is it possible to tell IDEA that java code in @Requires annotation should be treated in context of annotated method to get it participate in refactoring (e.g. renaming of count or p2)?
IntelliLang can support it for syntax highlighting, but that's all it can.

Is it technically possible to create respective plugin? Or it needs something like a "dedicated support of Cofoja framework"?

Maybe there is something around working on this or similar question.

Thanks in advance for any comment/suggestion.

Please sign in to leave a comment.