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

Fix issue689 #18

Merged
merged 1 commit into from
Mar 10, 2024
Merged

Fix issue689 #18

merged 1 commit into from
Mar 10, 2024

Conversation

LoiNguyenCS
Copy link
Collaborator

Dear @tahiat,

This PR is not ready for merge. We also need to change the .json file somehow so that the target method signature will be: java.util.SubList#listIterator(int). SubList is a class inside AbstractList.java, but it is not an inner class. I don't know how to change the .json file to reflect that fact.

Thank you for your time.

@kelloggm
Copy link
Collaborator

kelloggm commented Mar 6, 2024

This PR is not ready for merge. We also need to change the .json file somehow so that the target method signature will be: java.util.SubList#listIterator(int). SubList is a class inside AbstractList.java, but it is not an inner class. I don't know how to change the .json file to reflect that fact.

This is a tricky case! The signature should not be java.util.SubList#listIterator(int), because the fully-qualified name of the SubList class inside AbstractList is not java.util.SubList. In fact, that class (and other "local" classes) do not have fully-qualified names (according to the JLS). The class' name is SubList, but it is only accessible (and its methods only callable) from within AbstractList.java.

We probably need an alternative syntax for this case (which will require special support in Specimin). I would suggest something like java.util.AbstractList$SubList#listIterator(int), as if it were an inner class, since the class name needs to be unique in the file (so this won't be ambiguous).

@LoiNguyenCS
Copy link
Collaborator Author

We probably need an alternative syntax for this case (which will require special support in Specimin). I would suggest something like java.util.AbstractList$SubList#listIterator(int), as if it were an inner class, since the class name needs to be unique in the file (so this won't be ambiguous).

I can do this. Thank you very much for your clarification.

@tahiat
Copy link
Owner

tahiat commented Mar 6, 2024

@LoiNguyenCS , If we are using the full qualified name for SubList as java.util.AbstractList$SubLis then I am going the change the target method signature as java.util.AbstractList$SubList#listIterator(int) in the script file.

@LoiNguyenCS
Copy link
Collaborator Author

Professor,

For some reasons JavaParser still returns the fully qualified name for SubList, while their documentation says that they don't return qualified names for local classes. So I have been looking up the documentation of Oracle. They declares a local class as

classes that are defined in a block, which is a group of zero or more statements between balanced braces

Given this declaration, I don't think SubList is a local class. Could you help me double-check? Thank you.

@LoiNguyenCS
Copy link
Collaborator Author

We have merged the PR to solve this issue into Specimin. Basically, the signatures of non-primary classes should be the package names and the names of those classes only. That is to say, the signature of the target method for this issue will be java.util.SubList#listIterator(int).

@tahiat tahiat self-requested a review March 10, 2024 18:35
Copy link
Owner

@tahiat tahiat left a comment

Choose a reason for hiding this comment

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

Looks good

@tahiat tahiat merged commit bfafa3e into tahiat:main Mar 10, 2024
1 check passed
@LoiNguyenCS
Copy link
Collaborator Author

Hello @tahiat, this PR is not actually correct. The target method signature needs to be java.util.SubList#listIterator(int). Currently, the target method signature is java.util.AbstractList.SubList#listIterator(int).

@tahiat
Copy link
Owner

tahiat commented Mar 10, 2024

@LoiNguyenCS , This PR will fix this. Please review this

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.

3 participants