Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij - 15 NotNull Instrumentation errors for code that has been inspected when nothing suspicious is found

I have a little app I started putting together under Intellij-14. It compiled and ran there. When I updated to 15, I started getting NotNull Instrumentation errors for all of the classes. The error message simply states that the class failed -- there is no indication of a specific method, member, or variable. I have add annotations to the project library and changed the compile options to point to them. I have run "infer nullity" and "run inspection by name" trying to find out where I have gone wrong to no avail. Since this is my first attempt at using GUI elements, I am probably making some very basic mistakes. For example:

public class lguiException extends Exception {

private String msg = " ";

public String GetLearnGUIMsg(){
        return(msg);
}

public void SetLearnGUIMsg(String instr){
        msg = instr;
    }

public void HandleLearnGUIExceps(){

    System.out.println(msg);
}

}

produces the error:

Error:NotNull instrumentation: @NotNull instrumentation failed for lguiException.java: com.intellij.compiler.notNullVerification.NotNullVerifyingInstrumenter.processClassFile(Lorg/jetbrains/org/objectweb/asm/ClassReader;Lorg/jetbrains/org/objectweb/asm/ClassVisitor;)Z

The infer nullity preview says there is nothing to be annotated here and the code inspection comes up clean. So where do I start?

like image 260
GEM Avatar asked Oct 27 '25 13:10

GEM


1 Answers

Edit: The actions below did not fix every issue I had so I ended up deleting the old installation directory and re-extracting, and that got rid of every problem I had. Moral: don't upgrade IDEA by extracting into old installation directories.

I ran into the same issue after upgrading from 14 to 15. For me the fix was to go into settings -> compiler and disable the add @NotNull assertions checkmark.

like image 161
Daan Reid Avatar answered Oct 30 '25 15:10

Daan Reid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!