mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
Cleanup (warnings)
GitOrigin-RevId: 5f1a0f7ffc1f12b25675b8cf88238184fff2108a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
19dde982dc
commit
670100b6b5
+11
-11
@@ -127,21 +127,21 @@ public abstract class NotNullVerifyingInstrumenterTest {
|
||||
@Test
|
||||
public void testConstructorParam() throws Exception {
|
||||
Class<?> testClass = prepareTest();
|
||||
Constructor method = testClass.getConstructor(Object.class);
|
||||
Constructor<?> method = testClass.getConstructor(Object.class);
|
||||
verifyCallThrowsException("Argument 0 for @NotNull parameter of ConstructorParam.<init> must not be null", null, method, (Object)null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructorParamWithMessage() throws Exception {
|
||||
Class<?> testClass = prepareTest();
|
||||
Constructor method = testClass.getConstructor(Object.class);
|
||||
Constructor<?> method = testClass.getConstructor(Object.class);
|
||||
verifyCallThrowsException("ConstructorParam.ConstructorParam.o cant be null", null, method, (Object)null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUseParameterNames() throws Exception {
|
||||
Class<?> testClass = prepareTest(true, AnnotationUtil.NOT_NULL);
|
||||
Constructor constructor = testClass.getConstructor(Object.class, Object.class);
|
||||
Constructor<?> constructor = testClass.getConstructor(Object.class, Object.class);
|
||||
verifyCallThrowsException("Argument for @NotNull parameter 'obj2' of UseParameterNames.<init> must not be null",
|
||||
null, constructor, null, null);
|
||||
|
||||
@@ -173,7 +173,7 @@ public abstract class NotNullVerifyingInstrumenterTest {
|
||||
|
||||
@Test
|
||||
public void testEnumConstructor() throws Exception {
|
||||
Class testClass = prepareTest();
|
||||
Class<?> testClass = prepareTest();
|
||||
assertNotNull(testClass.getField("Value").get(null));
|
||||
}
|
||||
|
||||
@@ -192,19 +192,19 @@ public abstract class NotNullVerifyingInstrumenterTest {
|
||||
|
||||
@Test
|
||||
public void testEnumConstructorSecondParam() throws Exception {
|
||||
Class testClass = prepareTest();
|
||||
Class<?> testClass = prepareTest();
|
||||
assertNotNull(testClass.getField("Value").get(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGroovyEnum() throws Exception {
|
||||
Class testClass = prepareTest();
|
||||
Class<?> testClass = prepareTest();
|
||||
assertNotNull(testClass.getField("Value").get(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStaticInnerClass() throws Exception {
|
||||
Class aClass = prepareTest();
|
||||
Class<?> aClass = prepareTest();
|
||||
assertNotNull(aClass.newInstance());
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ public abstract class NotNullVerifyingInstrumenterTest {
|
||||
String exceptionText = null;
|
||||
try {
|
||||
if (member instanceof Constructor) {
|
||||
((Constructor)member).newInstance(args);
|
||||
((Constructor<?>)member).newInstance(args);
|
||||
}
|
||||
else {
|
||||
((Method)member).invoke(instance, args);
|
||||
@@ -424,14 +424,14 @@ public abstract class NotNullVerifyingInstrumenterTest {
|
||||
Arrays.sort(files, (o1, o2) -> o1.getName().compareToIgnoreCase(o2.getName()));
|
||||
boolean modified = false;
|
||||
MyClassLoader classLoader = new MyClassLoader(getClass().getClassLoader());
|
||||
Class mainClass = null;
|
||||
Class<?> mainClass = null;
|
||||
for (File file: files) {
|
||||
FailSafeClassReader reader = new FailSafeClassReader(FileUtil.loadFileBytes(file));
|
||||
int flags = InstrumenterClassWriter.getAsmClassWriterFlags(InstrumenterClassWriter.getClassFileVersion(reader));
|
||||
ClassWriter writer = new ClassWriter(reader, flags);
|
||||
modified |= NotNullVerifyingInstrumenter.processClassFile(reader, writer, notNullAnnotations);
|
||||
String className = FileUtilRt.getNameWithoutExtension(file.getName());
|
||||
Class aClass = classLoader.doDefineClass(className, writer.toByteArray());
|
||||
Class<?> aClass = classLoader.doDefineClass(className, writer.toByteArray());
|
||||
if (className.equals(testName)) {
|
||||
mainClass = aClass;
|
||||
}
|
||||
@@ -451,7 +451,7 @@ public abstract class NotNullVerifyingInstrumenterTest {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
public Class doDefineClass(String name, byte[] data) {
|
||||
public Class<?> doDefineClass(String name, byte[] data) {
|
||||
return defineClass(name, data, 0, data.length);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user