-
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
Minimize type parameters #103
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kelloggm
requested changes
Feb 5, 2024
src/test/java/org/checkerframework/specimin/UnusedTypeParameterBoundTest.java
Show resolved
Hide resolved
Professor, I have updated the test case to remove one generic type bound and preserve the other type bound. |
kelloggm
approved these changes
Feb 6, 2024
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.
Thanks for the new test case. LGTM!
kelloggm
pushed a commit
that referenced
this pull request
Jul 25, 2024
This PR addresses an issue I found in [NullAway issue #103](uber/NullAway#103), where compile-time errors were caused by missing methods and types. The missing methods were caused by the following: **1) Methods not preserved** Foo extends (abstract) Bar extends [Some JDK interface] If Bar contains an abstract method also present in the JDK interface, those implementations in Foo were removed while the abstract definition was maintained in Bar, causing compile-time errors. A check was added to ensure that all super abstract methods did not contain anything that needed to be preserved (i.e. when in Foo, instead of just checking Bar, we check Bar and the JDK interface). **2. Classes not preserved** If a non-target class needs its method implementations to be preserved, and some of its return/parameter types are solvable but were untracked so far by `usedTypeElements`, their ancestors were not preserved. For example, if a method visited by `MustImplementMethodsVisitor` is of type `PeekingIterator<E>` which extends `Iterator<E>`, the `extends Iterator<E>` portion is kept in the original definition but its import statement was removed, leading to compile-time errors. The new approach to this is, if a type element was not previously in `usedTypeElements`, all of its ancestors (interfaces and super classes) would also be marked for preservation. A test case can be found in `Issue103Test`. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Professor,
This is the PR to remove unused type bounds of type parameters in the declaration of a class. After this PR and #101 are merged, Specimin will be able to minimize AnalysisResult.java.