String src =
"public void sampleMethod() throws Exception {"
+ "java.util.Properties props = new java.util.Properties();"
- + "java.rmi.activation.ActivationGroupDesc.CommandEnvironment ace "
- + " = null;"
- + "java.rmi.activation.ActivationGroupDesc agd "
- + " = new java.rmi.activation.ActivationGroupDesc(props,ace);}";
+ + "test2.Inner2.Child ace = null;"
+ + "test2.Inner2 agd = new test2.Inner2(props, ace);}";
CtMethod newmethod = CtNewMethod.make(src, target);
target.addMethod(newmethod);
public class Inner {
public void sample() throws Exception {
java.util.Properties props = new java.util.Properties();
- java.rmi.activation.ActivationGroupDesc.CommandEnvironment ace = null;
- java.rmi.activation.ActivationGroupDesc agd = new
- java.rmi.activation.ActivationGroupDesc(props,ace);
+ test2.Inner2.Child ace = null;
+ test2.Inner2 agd = new test2.Inner2(props, ace);
}
public static void main(String args[]) {
System.out.println("Inner");
--- /dev/null
+package test2;
+
+/**
+ * Used by test2.Inner
+ */
+public class Inner2 {
+ public static class Child {
+ public int value;
+ }
+
+ private java.util.Properties p;
+ private Child c;
+
+ public Inner2(java.util.Properties props, Child child) {
+ p = props;
+ c = child;
+ }
+
+ public void print() {
+ System.out.println(p);
+ System.out.println(c);
+ }
+}