-
Notifications
You must be signed in to change notification settings - Fork 273
[TG-3694] Parse and store inner class information #2493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
457bac9
c336455
b28562b
1930aef
c0c1029
6ce7b13
9ba55e2
5350133
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
public class InnerClasses { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a non-public class to this file (in case that means there are two inner class attributes?) Unless that isn't true, in which case might not be worth it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a non-public outer class 👍 |
||
public class PublicInnerClass { | ||
public int i; | ||
public PublicInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
class DefaultInnerClass { | ||
int i; | ||
DefaultInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
protected class ProtectedInnerClass { | ||
protected int i; | ||
protected ProtectedInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
private class PrivateInnerClass { | ||
private int i; | ||
private PrivateInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you extend this test with some Inner Inner class examples, to show that things still work when the classes are nested an additional layer deep? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also extend this with an anonymous class and a local class? |
||
} | ||
|
||
class InnerClassesDefault { | ||
public class PublicInnerClass { | ||
public int i; | ||
public PublicInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
class DefaultInnerClass { | ||
int i; | ||
DefaultInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
protected class ProtectedInnerClass { | ||
protected int i; | ||
protected ProtectedInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
private class PrivateInnerClass { | ||
private int i; | ||
private PrivateInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
} | ||
|
||
class InnerClassesDeeplyNested { | ||
class SinglyNestedClass { | ||
int i; | ||
SinglyNestedClass(int i) { | ||
this.i = i; | ||
} | ||
public class PublicDoublyNestedInnerClass { | ||
public int i; | ||
public PublicDoublyNestedInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
class DefaultDoublyNestedInnerClass { | ||
int i; | ||
DefaultDoublyNestedInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
protected class ProtectedDoublyNestedInnerClass { | ||
protected int i; | ||
protected ProtectedDoublyNestedInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
private class PrivateDoublyNestedInnerClass { | ||
private int i; | ||
private PrivateDoublyNestedInnerClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
} | ||
} | ||
|
||
class ContainsAnonymousClass { | ||
interface InnerInterface { | ||
int i = 0; | ||
} | ||
public InnerInterface anonymousPublic = new InnerInterface() { | ||
int i = 1; | ||
}; | ||
InnerInterface anonymousDefault = new InnerInterface() { | ||
int i = 2; | ||
}; | ||
protected InnerInterface anonymousProtected = new InnerInterface() { | ||
int i = 3; | ||
}; | ||
private InnerInterface anonymousPrivate = new InnerInterface() { | ||
int i = 4; | ||
}; | ||
} | ||
|
||
class ContainsLocalClass { | ||
public void test() { | ||
class LocalClass { | ||
int i = 55; | ||
LocalClass(int i) { | ||
this.i = i; | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section should be moved into a new function/method, to avoid
rclass_attribute
getting too long.