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

8316470: Incorrect error location for "invalid permits clause" depending on file order #16221

Closed
wants to merge 1 commit into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Oct 17, 2023

Consider code like (in two different files, but accessible through source path):

class Main extends C {}
sealed class C {} //does not permit Main

and a javac process that will start attribution with Main. As part of Main attribution, its superclasses will be attributed, hence C will be attributed. And there will be a sealing error reported for C (missing permitted). But, the source in the logger will still be set to Main, and hence the report will be reported at a weird place in Main, not in C.

The proposed solution is simple: move the code to set the source to logger (and related code) before the sealed checks. The diff looks scary, but it is movement of several lines up, and whitespace changes.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8316470: Incorrect error location for "invalid permits clause" depending on file order (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16221/head:pull/16221
$ git checkout pull/16221

Update a local copy of the PR:
$ git checkout pull/16221
$ git pull https://git.openjdk.org/jdk.git pull/16221/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16221

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16221.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 17, 2023

👋 Welcome back jlahoda! 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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 17, 2023
@openjdk
Copy link

openjdk bot commented Oct 17, 2023

@lahodaj 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.

@openjdk openjdk bot added the compiler compiler-dev@openjdk.org label Oct 17, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 17, 2023

Webrevs

JavaFileObject prev = log.useSource(c.sourcefile);
ResultInfo prevReturnRes = env.info.returnResult;

try {
Copy link
Member

@biboudis biboudis Oct 18, 2023

Choose a reason for hiding this comment

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

Previously this try block didn't include this code. Is, the new position of try, intentional?

Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle left a comment

Choose a reason for hiding this comment

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

lgtm

@openjdk
Copy link

openjdk bot commented Oct 23, 2023

@lahodaj 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:

8316470: Incorrect error location for "invalid permits clause" depending on file order

Reviewed-by: vromero

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 486 new commits pushed to the master branch:

  • 8d9a4b4: 8317678: Fix up hashCode() for ZipFile.Source.Key
  • 69c0ae2: 8318124: JFR: Rewrite instrumentation to use Class-File API
  • c1aeac7: 8318445: More broken bailout chains in C2
  • d888b26: 8318071: IgnoreUnrecognizedVMOptions flag still causes failure in ArchiveHeapTestClass
  • bea2d48: 8312475: org.jline.util.PumpReader signed byte problem
  • 9f767aa: 8318109: Writing JFR records while a CHT has taken its lock asserts in rank checking
  • bd22d23: 8318027: Support alternative name to jdk.internal.vm.compiler
  • c2efd77: 8295795: hsdis does not build with binutils 2.39+
  • 99de9bb: 8317807: JAVA_FLAGS removed from jtreg running in JDK-8317039
  • 704c6ea: 8303525: Refactor/cleanup open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.java
  • ... and 476 more: https://git.openjdk.org/jdk/compare/fbc766ee21ff7e6d414bd7d2c8bd7c9e1889a8af...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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 23, 2023
@lahodaj
Copy link
Contributor Author

lahodaj commented Oct 24, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Oct 24, 2023

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

  • 5224e97: 8293713: java/net/httpclient/BufferingSubscriberTest.java fails in timeout, blocked in submission publisher
  • 9bfa082: 8318646: Integer#parseInt("") throws empty NumberFormatException message
  • 3f446c5: 8318528: Rename TestUnstructuredLocking test
  • 0baa9ec: 8318474: Fix memory reporter for thread_count
  • 4a16d11: 8318455: Fix the compiler/sharedstubs/SharedTrampolineTest.java and SharedStubToInterpTest.java
  • a644670: 8318609: Upcall stubs should be smaller
  • e6f23a9: 8315024: Vector API FP reduction tests should not test for exact equality
  • fd332da: 8317289: javadoc fails with -sourcepath if module-info.java contains import statements
  • 6d3cb45: 8318591: avoid leaks in loadlib_aix.cpp reload_table()
  • cb383c0: 8318587: refresh libraries cache on AIX in print_vm_info
  • ... and 492 more: https://git.openjdk.org/jdk/compare/fbc766ee21ff7e6d414bd7d2c8bd7c9e1889a8af...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 24, 2023
@openjdk openjdk bot closed this Oct 24, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 24, 2023
@openjdk
Copy link

openjdk bot commented Oct 24, 2023

@lahodaj Pushed as commit bf1a14e.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants