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

Test wildcards in stub files. Fix unbounded wildcards in stub files. #251

Merged
merged 3 commits into from
Jun 1, 2022

Conversation

wmdietl
Copy link
Member

@wmdietl wmdietl commented Jun 1, 2022

This should fix typetools issue 3236.

@wmdietl
Copy link
Member Author

wmdietl commented Jun 1, 2022

@cpovirk FYI. Using <?> in .astub files now has the same meaning as in .java files - no extra restrictions. If the underlying bytecode had a restriction, it is removed.
Please let me know if this doesn't work as expected.

@cpovirk
Copy link

cpovirk commented Jun 1, 2022

Thanks! I imagine this was prompted by collection-object-parameters-may-be-null.astub, as the original issue said. I don't remember what originally brought that to my attention, but I'll try out a real-world demo after we pull in the next upgrade.

@wmdietl wmdietl merged commit 3a1615e into master Jun 1, 2022
@wmdietl wmdietl deleted the fix-typetools-3236 branch June 1, 2022 23:44
@cpovirk
Copy link

cpovirk commented Aug 30, 2022

I'm a little confused because I can't seem to reproduce the problem with collection-object-parameters-may-be-null.astub under 3.21.4-eisop1, which is before this fix:

ArrayBlockingQueue<String> l = new ArrayBlockingQueue<>(1);
List<@Nullable Object> other = Arrays.asList((Object) null);
boolean b = l.removeAll(other); // surprisingly no error

I seem to recall that JDK stubs are somehow "special"; maybe that explains why they were working before other stubs were?

Anyway, the fact that it's working is still good news. And it continues to work under 3.23.0-eisop2.

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.

2 participants