You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although it's not usually best practice to do so, it is legal in Java to declare a class InnerClass as such:
class MainClass {
public foo () {
class InnerClass {}
// method body that initializes and uses objects of type InnerClass
}
}
However, when generating a CtClass object via the Core() factory, the type seems to default to MainClass.InnerClass which is incorrect if InnerClass is inserted into the method foo. The create method of the Class() factory (meant to create inner classes) also requires a declaring class and thus also only seems to support code of the structure:
class MainClass {
class InnerClass {}
public foo () {
// method body
}
}
The text was updated successfully, but these errors were encountered:
Although it's not usually best practice to do so, it is legal in Java to declare a class
InnerClass
as such:However, when generating a CtClass object via the
Core()
factory, the type seems to default toMainClass.InnerClass
which is incorrect ifInnerClass
is inserted into the methodfoo
. Thecreate
method of theClass()
factory (meant to create inner classes) also requires a declaring class and thus also only seems to support code of the structure:The text was updated successfully, but these errors were encountered: