renamed all modules
This commit is contained in:
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