JNI support

This is perhaps a rare case, but we use JNI.
There are some areas in which IDEA assist dealing with this refactoring-unfriendly technology...

First, if there are native methods, there may be some side effects during refactoring. One can easily rename a class... but as a JNI function name created from a native method is fully qualified, this will lead to compilation problems.
Idea could warn that a class contains native methods during refactoring.

Second, there are cases when java code is called from native code. These are not marked "native". To mark them ,we have a special
public @interface UsedFromNativeCode {
String files() default "not specified";

that is attached to methods, classes..
It would be cool if the presense of some annotation would warn user during refactoring -
perhaps something like @WarnDuringRefactoring("Think twice!")

What do you think?

Comment actions Permalink

To generalize I will vote for @Used annotation with some sort of description message/reference to referencing class/method/whatsoever

Comment actions Permalink

The name of annotation can be anything.
Another use case: if class if used via Class.forName (), it can be not referenced at all, but its name should not be changed. @Used would be very useful in this case to prevent occasional renames...


Please sign in to leave a comment.