renamed all modules
This commit is contained in:
37
testdata/src/main/java/system/Eight.java
vendored
Normal file
37
testdata/src/main/java/system/Eight.java
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package system;
|
||||
|
||||
/**
|
||||
* This test class represents a class in the system set for the VM. These classes cannot have their reflective calls directly
|
||||
* intercepted because we cannot introduce dependencies on types in a lower classloader, so we have to call the reflective
|
||||
* interceptor reflectively!
|
||||
*/
|
||||
public class Eight {
|
||||
|
||||
public Eight() {
|
||||
}
|
||||
|
||||
public Eight(String s) {
|
||||
}
|
||||
|
||||
public String runIt() throws Exception {
|
||||
StringBuilder data = new StringBuilder();
|
||||
int mods = m(Eight.class);
|
||||
data.append("mods?" + mods + " ");
|
||||
mods = m(DefaultVis.class);
|
||||
data.append("mods?" + mods + " ");
|
||||
mods = m(Inner.class);
|
||||
data.append("mods?" + mods + " ");
|
||||
return "complete:" + data.toString().trim();
|
||||
}
|
||||
|
||||
public int m(Class<?> clazz) {
|
||||
return clazz.getModifiers();
|
||||
}
|
||||
|
||||
private class Inner {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class DefaultVis {
|
||||
}
|
||||
30
testdata/src/main/java/system/Five.java
vendored
Normal file
30
testdata/src/main/java/system/Five.java
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package system;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* This test class represents a class in the system set for the VM. These classes cannot have their reflective calls directly
|
||||
* intercepted because we cannot introduce dependencies on types in a lower classloader, so we have to call the reflective
|
||||
* interceptor reflectively!
|
||||
*/
|
||||
public class Five {
|
||||
|
||||
String s;
|
||||
|
||||
public String runIt() throws Exception {
|
||||
StringBuilder data = new StringBuilder();
|
||||
Method method = m("runIt");
|
||||
data.append("method?" + method + " ");
|
||||
try {
|
||||
m("foobar");
|
||||
data.append("unexpectedly_didn't_fail");
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
data.append("nsme");
|
||||
}
|
||||
return "complete:" + data.toString().trim();
|
||||
}
|
||||
|
||||
public Method m(String name) throws NoSuchMethodException {
|
||||
return this.getClass().getDeclaredMethod(name);
|
||||
}
|
||||
}
|
||||
25
testdata/src/main/java/system/Four.java
vendored
Normal file
25
testdata/src/main/java/system/Four.java
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package system;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* This test class represents a class in the system set for the VM. These classes cannot have their reflective calls directly
|
||||
* intercepted because we cannot introduce dependencies on types in a lower classloader, so we have to call the reflective
|
||||
* interceptor reflectively!
|
||||
*/
|
||||
public class Four {
|
||||
|
||||
public String runIt() {
|
||||
StringBuilder data = new StringBuilder();
|
||||
Method[] methods = ms();
|
||||
data.append("methods:null?" + (methods == null) + " ");
|
||||
if (methods != null) {
|
||||
data.append("methods:size=" + methods.length + " ");
|
||||
}
|
||||
return "complete:" + data.toString().trim();
|
||||
}
|
||||
|
||||
public Method[] ms() {
|
||||
return this.getClass().getDeclaredMethods();
|
||||
}
|
||||
}
|
||||
25
testdata/src/main/java/system/Nine.java
vendored
Normal file
25
testdata/src/main/java/system/Nine.java
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package system;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* This test class represents a class in the system set for the VM. These classes cannot have their reflective calls directly
|
||||
* intercepted because we cannot introduce dependencies on types in a lower classloader, so we have to call the reflective
|
||||
* interceptor reflectively!
|
||||
*/
|
||||
public class Nine {
|
||||
|
||||
public String runIt() {
|
||||
StringBuilder data = new StringBuilder();
|
||||
Method[] methods = ms();
|
||||
data.append("methods:null?" + (methods == null) + " ");
|
||||
if (methods != null) {
|
||||
data.append("methods:size=" + methods.length + " ");
|
||||
}
|
||||
return "complete:" + data.toString().trim();
|
||||
}
|
||||
|
||||
public Method[] ms() {
|
||||
return this.getClass().getMethods();
|
||||
}
|
||||
}
|
||||
25
testdata/src/main/java/system/One.java
vendored
Normal file
25
testdata/src/main/java/system/One.java
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package system;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* This test class represents a class in the system set for the VM. These classes cannot have their reflective calls directly
|
||||
* intercepted because we cannot introduce dependencies on types in a lower classloader, so we have to call the reflective
|
||||
* interceptor reflectively!
|
||||
*/
|
||||
public class One {
|
||||
|
||||
public String runIt() {
|
||||
StringBuilder data = new StringBuilder();
|
||||
Field[] fields = fs();
|
||||
data.append("fields:null?" + (fields == null) + " ");
|
||||
if (fields != null) {
|
||||
data.append("fields:size=" + fields.length + " ");
|
||||
}
|
||||
return "complete:" + data.toString().trim();
|
||||
}
|
||||
|
||||
public Field[] fs() {
|
||||
return this.getClass().getDeclaredFields();
|
||||
}
|
||||
}
|
||||
36
testdata/src/main/java/system/Seven.java
vendored
Normal file
36
testdata/src/main/java/system/Seven.java
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
package system;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
/**
|
||||
* This test class represents a class in the system set for the VM. These classes cannot have their reflective calls directly
|
||||
* intercepted because we cannot introduce dependencies on types in a lower classloader, so we have to call the reflective
|
||||
* interceptor reflectively!
|
||||
*/
|
||||
public class Seven {
|
||||
|
||||
public Seven() {
|
||||
}
|
||||
|
||||
public Seven(String s) {
|
||||
}
|
||||
|
||||
public String runIt() throws Exception {
|
||||
StringBuilder data = new StringBuilder();
|
||||
Constructor<?> ctor = m();
|
||||
data.append("defaultctor?" + ctor + " ");
|
||||
ctor = m(String.class);
|
||||
data.append("stringctor?" + ctor + " ");
|
||||
try {
|
||||
m(Integer.class);
|
||||
data.append("unexpectedly_didn't_fail");
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
data.append("nsme");
|
||||
}
|
||||
return "complete:" + data.toString().trim();
|
||||
}
|
||||
|
||||
public Constructor<?> m(Class<?>... params) throws NoSuchMethodException {
|
||||
return this.getClass().getDeclaredConstructor(params);
|
||||
}
|
||||
}
|
||||
30
testdata/src/main/java/system/Six.java
vendored
Normal file
30
testdata/src/main/java/system/Six.java
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package system;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* This test class represents a class in the system set for the VM. These classes cannot have their reflective calls directly
|
||||
* intercepted because we cannot introduce dependencies on types in a lower classloader, so we have to call the reflective
|
||||
* interceptor reflectively!
|
||||
*/
|
||||
public class Six {
|
||||
|
||||
public String s;
|
||||
|
||||
public String runIt() throws Exception {
|
||||
StringBuilder data = new StringBuilder();
|
||||
Method method = m("runIt");
|
||||
data.append("method?" + method + " ");
|
||||
try {
|
||||
m("foo");
|
||||
data.append("unexpectedly_didn't_fail");
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
data.append("nsme");
|
||||
}
|
||||
return "complete:" + data.toString().trim();
|
||||
}
|
||||
|
||||
public Method m(String name) throws NoSuchMethodException {
|
||||
return this.getClass().getMethod(name);
|
||||
}
|
||||
}
|
||||
30
testdata/src/main/java/system/Three.java
vendored
Normal file
30
testdata/src/main/java/system/Three.java
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package system;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* This test class represents a class in the system set for the VM. These classes cannot have their reflective calls directly
|
||||
* intercepted because we cannot introduce dependencies on types in a lower classloader, so we have to call the reflective
|
||||
* interceptor reflectively!
|
||||
*/
|
||||
public class Three {
|
||||
|
||||
public String s;
|
||||
|
||||
public String runIt() throws Exception {
|
||||
StringBuilder data = new StringBuilder();
|
||||
Field field = f("s");
|
||||
data.append("field?" + field + " ");
|
||||
try {
|
||||
f("foo");
|
||||
data.append("unexpectedly_didn't_fail");
|
||||
} catch (NoSuchFieldException nsfe) {
|
||||
data.append("nsfe");
|
||||
}
|
||||
return "complete:" + data.toString().trim();
|
||||
}
|
||||
|
||||
public Field f(String name) throws NoSuchFieldException {
|
||||
return this.getClass().getField(name);
|
||||
}
|
||||
}
|
||||
30
testdata/src/main/java/system/Two.java
vendored
Normal file
30
testdata/src/main/java/system/Two.java
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package system;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* This test class represents a class in the system set for the VM. These classes cannot have their reflective calls directly
|
||||
* intercepted because we cannot introduce dependencies on types in a lower classloader, so we have to call the reflective
|
||||
* interceptor reflectively!
|
||||
*/
|
||||
public class Two {
|
||||
|
||||
String s;
|
||||
|
||||
public String runIt() throws Exception {
|
||||
StringBuilder data = new StringBuilder();
|
||||
Field field = f("s");
|
||||
data.append("field?" + field + " ");
|
||||
try {
|
||||
f("foo");
|
||||
data.append("unexpectedly_didn't_fail");
|
||||
} catch (NoSuchFieldException nsfe) {
|
||||
data.append("nsfe");
|
||||
}
|
||||
return "complete:" + data.toString().trim();
|
||||
}
|
||||
|
||||
public Field f(String name) throws NoSuchFieldException {
|
||||
return this.getClass().getDeclaredField(name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user