add "pure" attribute to @Contract (IDEA-107864)

This commit is contained in:
peter
2013-11-02 20:41:17 +01:00
parent 612c075886
commit f92ce9af06
8 changed files with 56 additions and 17 deletions
@@ -46,4 +46,7 @@ public class AssertIsNotNull {
@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() {}
}
@@ -39,12 +39,6 @@ public class DataFlowInspectionTest extends LightCodeInsightFixtureTestCase {
return JAVA_1_7;
}
@Override
protected void setUp() throws Exception {
super.setUp();
myFixture.addClass("package org.jetbrains.annotations; public @interface Contract { String value(); }");
}
@Override
protected String getTestDataPath() {
return JavaTestUtil.getJavaTestDataPath() + "/inspection/dataFlow/fixture/";