We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
MaybeUsesImport
This bug has been observed, but so far we haven't had any time to reproduce it yet. It appears that the MaybeUsesImport visitor can get caught in an endless loop on some Kotlin sources. The loop in question is this one: https://github.com/openrewrite/rewrite/blob/19c73502d29abe475cb4360f293fbe2e7b3d0027/rewrite-java/src/main/java/org/openrewrite/java/search/MaybeUsesImport.java#L57-L76
for (Expression expr = i.getQualid(); expr != prior; ) { if (expr instanceof J.Identifier) { // this can only be the first segment prior = expr; if (!((J.Identifier) expr).getSimpleName().equals(segment)) { return false; } } else if (expr instanceof J.FieldAccess) { J.FieldAccess fa = (J.FieldAccess) expr; if (fa.getTarget() == prior) { String simpleName = fa.getSimpleName(); if (!"*".equals(segment) && !simpleName.equals(segment) && !"*".equals(simpleName)) { return false; } prior = fa; continue; } expr = fa.getTarget(); } }
The text was updated successfully, but these errors were encountered:
Prevent endless loop in MaybeUsesImport visitor
ce7bb44
See: openrewrite/rewrite-kotlin#601
No branches or pull requests
This bug has been observed, but so far we haven't had any time to reproduce it yet. It appears that the
MaybeUsesImport
visitor can get caught in an endless loop on some Kotlin sources. The loop in question is this one: https://github.com/openrewrite/rewrite/blob/19c73502d29abe475cb4360f293fbe2e7b3d0027/rewrite-java/src/main/java/org/openrewrite/java/search/MaybeUsesImport.java#L57-L76The text was updated successfully, but these errors were encountered: