-
Notifications
You must be signed in to change notification settings - Fork 7
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
Creating synthetic classes for unsolved FieldAccessExpr #61
Conversation
Professor, This PR adds the codes and tests for unsolved Please take a look. Thank you. |
src/test/resources/unsolvednonstaticfield/expected/org/sampling/OrgSamplingBazCalType.java
Show resolved
Hide resolved
// this check is not very comprehensive, since a class can be in lowercase, and a method or | ||
// field can be in uppercase. But since this is without the jar paths, this is the best we can | ||
// do. | ||
return Character.isUpperCase(field.getScope().toString().charAt(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand why being uppercase tells us whether the field is unsolved. Is there some other invariant here that I'm missing, such as that unsolved fields always are static and need to be accessed via a class name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Professor, I will rename it. We know the field is unsolved because in the visit method for FieldAccessExpr
, we check to see if the field is solved first before coming to this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please neglect my earlier response. Before that line, we have a try-catch block to see if the field is solvable. The uppercase check is for the caller of this field. Since we don't have jar paths, we simply assume that if a symbol is capital, then that capital is a class name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not fully happy with this, but I'll let it go for now as tech debt given the need to move quickly
Professor, I have updated the codes based on your suggestions. Please take a look. Thank you. |
// this check is not very comprehensive, since a class can be in lowercase, and a method or | ||
// field can be in uppercase. But since this is without the jar paths, this is the best we can | ||
// do. | ||
return Character.isUpperCase(field.getScope().toString().charAt(0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not fully happy with this, but I'll let it go for now as tech debt given the need to move quickly
No description provided.