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

classifiable's self class checked twice #212

Closed
gMan1990 opened this issue Aug 4, 2020 · 0 comments
Closed

classifiable's self class checked twice #212

gMan1990 opened this issue Aug 4, 2020 · 0 comments
Milestone

Comments

@gMan1990
Copy link

gMan1990 commented Aug 4, 2020

for (Class<?> cls = exceptionClass; !cls.equals(Object.class) && value == null; cls = cls.getSuperclass()) {

// ★ first check for classifiable
Class<? extends T> exceptionClass = (Class<? extends T>) classifiable.getClass();
if (this.classified.containsKey(exceptionClass)) {
    return this.classified.get(exceptionClass);
}

// check for subclasses
C value = null;
// ★ second check for classifiable by first loop
for (Class<?> cls = exceptionClass; !cls.equals(Object.class) && value == null; cls = cls.getSuperclass()) {
    value = this.classified.get(cls);
}
@artembilan artembilan added this to the 2.0.5 milestone Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants