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

Arquillian initialization ends in infinite loop when a test class has a parent #696

Closed
jpechane opened this Issue May 15, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@jpechane
Contributor

jpechane commented May 15, 2017

As a reproducer please try this project - https://github.com/jpechane/arquillian-cube-standalone-example

The problem is located in Reflectionutil.isClassWithAnnotation. When this method is called there is a line in loop - nextSource = source.getSuperclass(). When the test class has a parent then the first iteration returns Parent2 class and subsequent iterations return the very same class! thus ending in infinite loop.

IMHO the should code would be

                Class<?> nextSource = source;
                while (nextSource != Object.class) {
                    if (nextSource.isAnnotationPresent(annotationClass)) {
                        return true;
                    }
                    nextSource = nextSource.getSuperclass();  // Move up in hierarchy
                }
@bartoszmajsak

This comment has been minimized.

Show comment
Hide comment
@bartoszmajsak

bartoszmajsak May 15, 2017

Member

Thanks for reporting and detailed analysis. Would you be interested in sending PR with these changes?

Member

bartoszmajsak commented May 15, 2017

Thanks for reporting and detailed analysis. Would you be interested in sending PR with these changes?

@jpechane

This comment has been minimized.

Show comment
Hide comment
@jpechane

jpechane May 15, 2017

Contributor

Done in #697

Contributor

jpechane commented May 15, 2017

Done in #697

@lordofthejars lordofthejars added the bug label May 17, 2017

@lordofthejars lordofthejars added this to the 1.3.2 milestone May 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment