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

In some edge cases, log of exception stack trace is emitted by JavaParser which is used by Butterfly JavaMatch #357

Open
jessicadeery opened this issue Apr 22, 2020 · 1 comment

Comments

@jessicadeery
Copy link
Contributor

Butterfly version 3.0.0 uses javaparser com.github.javaparser:javaparser-core:3.15.14. JavaParser is currently used by the Butterfly JavaMatch condition.

In some edge cases, this JavaParser emits a log of an exception stack trace when parsing javadocs. The log looks like this:
com.github.javadocparser.ParseException: Encountered " <ENTER_JAVADOC_COMMENT> "/** "" at line 2, column 5. Was expecting: "*/" ... at com.github.javadocparser.GeneratedJavaDocParser.generateParseException(GeneratedJavaDocParser.java:505) at com.github.javadocparser.GeneratedJavaDocParser.jj_consume_token(GeneratedJavaDocParser.java:376) at com.github.javadocparser.GeneratedJavaDocParser.JavaDocLine(GeneratedJavaDocParser.java:34) at com.github.javadocparser.GeneratedJavaDocParser.Start(GeneratedJavaDocParser.java:14) at com.github.javadocparser.GeneratedJavaDocParser.parse(GeneratedJavaDocParser.java:8) at com.github.javaparser.GeneratedJavaParserTokenManager.CommonTokenAction(GeneratedJavaParserTokenManager.java:113) at com.github.javaparser.GeneratedJavaParserTokenManager.getNextToken(GeneratedJavaParserTokenManager.java:2968) at com.github.javaparser.GeneratedJavaParser.jj_ntk_f(GeneratedJavaParser.java:10577) at com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceBody(GeneratedJavaParser.java:765) at com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceDeclaration(GeneratedJavaParser.java:410) at com.github.javaparser.GeneratedJavaParser.CompilationUnit(GeneratedJavaParser.java:156) at com.github.javaparser.JavaParser.parse(JavaParser.java:123) at com.github.javaparser.JavaParser.parse(JavaParser.java:198) at

It does not actually throw an exception in this case. Nor does it cause the parsing of the file to fail. It mainly just creates noise in the Butterfly CLI.

This is appears to be a known issue in Java Parser, and may be fixed in a later version. To resolve this issue, it should be confirmed in which version of the JavaParser this is fixed. Then butterfly should move to this later version.

In order to pick up other JavaParser fixes, it may be worth updating the JavaParser dependency version on a more periodic cadence.

@fabiocarvalho777
Copy link
Member

Thank you very much for opening this issue!!

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

2 participants