Community
Participate
Working Groups
If you do a create method on an inner class, the method in the text is actually added to the outer class, though the model thinks it is in the inner class. Take class: public class TestChangesClass { public static class InnerTestChangesClass { } } and do: IType type = jProject.findType("TestChangesClass.InnerTestChangesClass"); type.createMethod("public boolean isNew() {}", null, true, monitor); and the saved text file becomes: public class TestChangesClass { public static class InnerTestChangesClass { } public boolean isNew() {}} But, if you go against the IType type right after you did the create, "isNew" will be a method within the inner class. Thanks, Rich Kulp
Never mind, I just saw what I did wrong. Everything is correct.
What was it ?
Really stupid! :-) I was looking at the wrong class. I had two classes that were almost identical and I didn't notice the name was slightly different!