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

8268148: unchecked warnings handle ? and ? extends Object differently #5224

Closed

Conversation

@vicente-romero-oracle
Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle commented Aug 23, 2021

Please review this PR. Currently javac handles differently ? and ? extends Object when reporting unchecked warnings when according to the spec they should be handled the same way. This PR is fixing this.

TIA


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8268148: unchecked warnings handle ? and ? extends Object differently

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5224/head:pull/5224
$ git checkout pull/5224

Update a local copy of the PR:
$ git checkout pull/5224
$ git pull https://git.openjdk.java.net/jdk pull/5224/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5224

View PR using the GUI difftool:
$ git pr show -t 5224

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5224.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 23, 2021

👋 Welcome back vromero! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

Loading

@openjdk openjdk bot added the rfr label Aug 23, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 23, 2021

@vicente-romero-oracle The following label will be automatically applied to this pull request:

  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

Loading

@openjdk openjdk bot added the compiler label Aug 23, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Aug 23, 2021

Webrevs

Loading

@vicente-romero-oracle
Copy link
Contributor Author

@vicente-romero-oracle vicente-romero-oracle commented Aug 30, 2021

ping

Loading

Copy link
Contributor

@lahodaj lahodaj left a comment

Overall, looks reasonable. A few questions/comments inline.

Loading

* @test
* @bug 8268148
* @summary unchecked warnings handle ? and ? extends Object differently
* @compile -Xlint:all UnboundAndBoundByObjectTest.java
Copy link
Contributor

@lahodaj lahodaj Sep 3, 2021

Choose a reason for hiding this comment

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

Should there be a verification of the output? Possibly -Werror?

Loading

return kind == UNBOUND;
// is it `?` or `? extends Object`?
return kind == UNBOUND ||
(kind == EXTENDS && type.hasTag(CLASS) && ((ClassType)type).supertype_field == Type.noType);
Copy link
Contributor

@lahodaj lahodaj Sep 3, 2021

Choose a reason for hiding this comment

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

For the test on whether type is j.l.Object, would something like this work better?

Suggested change
(kind == EXTENDS && type.hasTag(CLASS) && ((ClassType)type).supertype_field == Type.noType);
(kind == EXTENDS && type.tsym.flatName() == type.tsym.name.table.names.java_lang_Object);

Just an idea. (Sadly, we can't use Symtab here, that would be ideal.)

Loading

lahodaj
lahodaj approved these changes Sep 3, 2021
Copy link
Contributor

@lahodaj lahodaj left a comment

Looks good, thanks!

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 3, 2021

@vicente-romero-oracle This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8268148: unchecked warnings handle ? and ? extends Object differently

Reviewed-by: jlahoda

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 123 new commits pushed to the master branch:

  • 8c37909: 8273234: extended 'for' with expression of type tvar causes the compiler to crash
  • 28ba78e: 8244675: assert(IncrementalInline || (_late_inlines.length() == 0 && !has_mh_late_inlines()))
  • d05494f: 8266239: Some duplicated javac command-line options have repeated effect
  • 93eec9a: 8272776: NullPointerException not reported
  • 7b023a3: 8273257: jshell doesn't compile a sealed hierarchy with a sealed interface and a non-sealed leaf
  • f17ee0c: 8273263: Incorrect recovery attribution of record component type when j.l.Record is unavailable
  • fa9c865: 8273112: -Xloggc: should override -verbose:gc
  • dd87181: 8214761: Bug in parallel Kahan summation implementation
  • 7fff22a: 8272805: Avoid looking up standard charsets
  • 92b05fe: 8273251: Call check_possible_safepoint() from SafepointMechanism::process_if_requested()
  • ... and 113 more: https://git.openjdk.java.net/jdk/compare/b690f29699180149d33b6a83de10697790587a87...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

Loading

@openjdk openjdk bot added the ready label Sep 3, 2021
@vicente-romero-oracle
Copy link
Contributor Author

@vicente-romero-oracle vicente-romero-oracle commented Sep 3, 2021

Looks good, thanks!

thanks for the review

Loading

@vicente-romero-oracle
Copy link
Contributor Author

@vicente-romero-oracle vicente-romero-oracle commented Sep 3, 2021

/integrate

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 3, 2021

Going to push as commit ff4018b.
Since your change was applied there have been 123 commits pushed to the master branch:

  • 8c37909: 8273234: extended 'for' with expression of type tvar causes the compiler to crash
  • 28ba78e: 8244675: assert(IncrementalInline || (_late_inlines.length() == 0 && !has_mh_late_inlines()))
  • d05494f: 8266239: Some duplicated javac command-line options have repeated effect
  • 93eec9a: 8272776: NullPointerException not reported
  • 7b023a3: 8273257: jshell doesn't compile a sealed hierarchy with a sealed interface and a non-sealed leaf
  • f17ee0c: 8273263: Incorrect recovery attribution of record component type when j.l.Record is unavailable
  • fa9c865: 8273112: -Xloggc: should override -verbose:gc
  • dd87181: 8214761: Bug in parallel Kahan summation implementation
  • 7fff22a: 8272805: Avoid looking up standard charsets
  • 92b05fe: 8273251: Call check_possible_safepoint() from SafepointMechanism::process_if_requested()
  • ... and 113 more: https://git.openjdk.java.net/jdk/compare/b690f29699180149d33b6a83de10697790587a87...master

Your commit was automatically rebased without conflicts.

Loading

@openjdk openjdk bot closed this Sep 3, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Sep 3, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Sep 3, 2021

@vicente-romero-oracle Pushed as commit ff4018b.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants