Open glassfishrobot opened 8 years ago
Reported by dschulten
dschulten said: I have added this issue here although the jaxb project might seem more appropriate, because the jaxb jira gives me an error "Assignee: The default assignee does NOT have ASSIGNABLE permission OR Unassigned issues are turned off."
When that problem is resolved, I can gladly re-create this issue in the jaxb jira.
dschulten said: I was able to create https://java.net/jira/browse/JAXB-1114. This can be closed.
This issue was imported from java.net JIRA JAX_WS-1187
CClassInfo has the below constructor which takes a JCodeModel and a fullName. The fullName parameter should be the FQCN of the class. However, if the fullName starts with a package having more than one name segment (like "com.example" which has two segments), the following code fails, because it puts the resulting CClassInfo into the package that is the first segment.
Assuming a fullName "com.example.MyClass", the code below will find that the indexOf '.' is 3, and from there everything goes wrong.
The constructor sets this.parent to the package "com" and it will use fullName.substring(idx+1) to determine the shortName, i.e. he shortName ends up being "example.MyClass".
The line int idx = fullName.indexOf('.');
should be
int idx = fullName.lastIndexOf('.');