mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
extract contract checking to a separatate inspection
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Foo {
|
||||
@Contract(<warning descr="A contract clause must be in form arg1, ..., argN -> return-value">"a"</warning>)
|
||||
void malformedContract() {}
|
||||
|
||||
@Contract(<warning descr="Method takes 2 parameters, while contract clause number 1 expects 1">"null -> _"</warning>)
|
||||
void wrongParameterCount(Object a, boolean b) {}
|
||||
|
||||
@Contract(pure=<warning descr="Pure methods must return something, void is not allowed as a return type">true</warning>)
|
||||
void voidPureMethod() {}
|
||||
|
||||
}
|
||||
@@ -41,12 +41,4 @@ class AssertIsNotNull {
|
||||
|
||||
Object call() {return new Object();}
|
||||
|
||||
@Contract(<warning descr="A contract clause must be in form arg1, ..., argN -> return-value">"a"</warning>)
|
||||
void malformedContract() {}
|
||||
|
||||
@Contract(<warning descr="Method takes 2 parameters, while contract clause number 1 expects 1">"null -> _"</warning>)
|
||||
void wrongParameterCount(Object a, boolean b) {}
|
||||
|
||||
@Contract(pure=<warning descr="Pure methods must return something, void is not allowed as a return type">true</warning>)
|
||||
void voidPureMethod() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user