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

review: fix: issue #2237 reject invalid names #3189

Merged
merged 12 commits into from
Dec 15, 2019
Merged

Conversation

MartinWitt
Copy link
Collaborator

@MartinWitt MartinWitt commented Dec 9, 2019

fix #2237

this should fix issue #2237. But a lot of Code uses CtReferenceImpl::setSimpleName for creating illegal references. This code must be changed for this small issue. Like CodeFactory::createClassAccess creates a fieldReference with simpleName "class", which is a illegal identifier.

@monperrus
Copy link
Collaborator

nice!

@monperrus monperrus changed the title WIP: fix: issue #2237 reject invalide names WIP: fix: issue #2237 reject invalid names Dec 11, 2019
@monperrus
Copy link
Collaborator

Hi @MartinWitt, how does it go with the failing test cases?

JDT and spoon does not allow to follow jls 100%, so there are some minor deviation made from jls to be compatible.
@MartinWitt
Copy link
Collaborator Author

MartinWitt commented Dec 12, 2019

still working on, but tests still failing

@monperrus
Copy link
Collaborator

monperrus commented Dec 12, 2019 via email

@MartinWitt
Copy link
Collaborator Author

I wouldn´t change the jdt name. I the current solution all correct identifier and empty, starting with number and follow the format $identifier@$Number identfier are allowed.

  • Starting with number is syntax for local classes.
  • $identifier@$Number is used for reference objects instances.
    Now spoon should catch almost all wrong identifier and having some wrong passing is fine for me.

@MartinWitt MartinWitt changed the title WIP: fix: issue #2237 reject invalid names review: fix: issue #2237 reject invalid names Dec 12, 2019
@monperrus
Copy link
Collaborator

Now spoon should catch almost all wrong identifier and having some wrong passing is fine for me.

I agree.

Thanks a lot for the test updates, LGTM.

@monperrus monperrus merged commit 9db3f61 into INRIA:master Dec 15, 2019
@monperrus
Copy link
Collaborator

Thanks a lot, that's very nice!

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

Successfully merging this pull request may close these issues.

bug: should reject invalid names according to the Java specification
2 participants