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

Fixed a problem with the begin and end position of a MultiTypeParameter #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jfrchicanog
Copy link

There was a problem in the begin and end position of a MultiTypeParameter. Their values were the same as in the CathClause.

in CatchClause (it was not correctly computed).
@rpau
Copy link
Owner

rpau commented Dec 9, 2018

Thanks :) ! But notice that the build is failing because of a compilation issue

@jfrchicanog
Copy link
Author

I had the same problem, but it was solved after deleting ASTParser.java in src/main/java/org/walkmod/javalang . Javacc should generate ASTParser.java in target/generated-sources/javacc/org/walkmod/javalang . This will be added to the classpath by maven and the rest of the compilation will work properly. I'll update my pull request with the elimination of ASTParser.java

Copy link
Owner

@rpau rpau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion. After that, 👍

final VariableDeclaratorId exceptId, final BlockStmt catchBlock) {
super(beginLine, beginColumn, endLine, endColumn);
setExcept(new MultiTypeParameter(beginLine, beginColumn, endLine, endColumn, exceptModifier, exceptAnnotations,
setExcept(new MultiTypeParameter((modifierBeginLine!=-1)?modifierBeginLine:exceptTypes.get(0).getBeginLine(), (modifierBeginColumn!=-1)?modifierBeginColumn:exceptTypes.get(0).getBeginColumn(), exceptId.getEndLine(), exceptId.getEndColumn(), exceptModifier, exceptAnnotations,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it makes more sense in this case, just add the MultiTypeParameter as argument instead of exposing the internal properties of this class?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't get your point. MultiTypeParameter is already an argument in this piece of code.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the delayed response. My point is if it can be an argument of the CatchClause constructor, instead of setting the except to avoid exposing the stucture of MultitypeParameter in the constructor.

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

Successfully merging this pull request may close these issues.

2 participants