-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix #867: perf shadow #898
Conversation
b06e104
to
2a06d46
Compare
return new JavaReflectionTreeBuilder(createFactory()).scan((Class<T>) cl); | ||
final CtType<T> shadowClass = (CtType<T>) this.shadowCache.get(cl); | ||
if (shadowClass == null) { | ||
final CtType<T> newShadowClass = new JavaReflectionTreeBuilder(createFactory()).scan((Class<T>) cl); |
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.
contract:
shadowCtClass.getFactory().get(shadowCtClass.getActualClass()) == shadowCtClass
2a06d46
to
4910909
Compare
if (super.matches(element)) { | ||
element.setFactory(factory); | ||
} | ||
return true; |
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.
You can simplify by
element.setFactory(factory);
return false; // create an empty list
4910909
to
b7736a7
Compare
if (shadowClass == null) { | ||
final CtType<T> newShadowClass = new JavaReflectionTreeBuilder(createFactory()).scan((Class<T>) cl); | ||
newShadowClass.setFactory(factory); | ||
newShadowClass.getElements(new TypeFilter<CtElement>(CtElement.class) { |
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.
use accept instead of getElements
b7736a7
to
ec75ba8
Compare
No description provided.