Skip to content
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

Bug in CtType#getUsedTypes for types in root package #650

Closed
seintur opened this issue May 8, 2016 · 0 comments
Closed

Bug in CtType#getUsedTypes for types in root package #650

seintur opened this issue May 8, 2016 · 0 comments

Comments

@seintur
Copy link
Contributor

seintur commented May 8, 2016

CtType#getUsedTypes fails with a NPE when invoked for a type declared in the root package (i.e. no package).

The following branch contains a test that exhibits the issue: https://github.com/seintur/spoon/tree/getUsedTypes_rootPackage_bug

The reason why I'm still wondering about a potential fix is that I'd like the contract of CtType#getPackage() to be clarified.

For types in the root package, should CtType#getPackage() return:

  • null
  • or CtRootPackage (defined in CtModelImpl)?

Same question, asked differently: What is the condition to check to assess whether a type is defined in the root package or not?

Cheers,
Lionel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant