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

8263432: javac may report an invalid package/class clash on case insensitive filesystems #3069

Closed
wants to merge 1 commit into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Mar 18, 2021

To implement the package/class clash check as per JLS 7.1, javac creates "phantom" packages with the same names as the classes and checks if these packages exist (implemented as a check if it has seen a source or class file in the corresponding directory). Every package created (phantom or not) gets registered to its enclosing ModuleSymbol, and when ModuleSymbol.getEnclosedElements() is called, the package is completed (i.e. its directory is listed).

This can cause an invalid package/class clash error to be reported in specific cases if there is a package and a class with names differing only in letter cases (like org.jruby.runtime.callsite and org.jruby.runtime.CallSite). What happens here is: the phantom package for the org.jruby.runtime.CallSite package is created, the package/class clash check is performed and passes (no errors). Then annotation processing calls ModuleSymbol.getEnclosedElements(), the phantom package's directory (org/jruby/runtime/CallSite) is listed from the filesystem, and contains some source files, so appears non-empty/existing (due to the case insensitive filesystem, the content of org/jruby/runtime/callsite directory is listed in fact). Then another round of annotation processing happens, and the package/class clash check is performed again. This time, the package appears to exist, and hence the check fails.

The proposal here is to avoid creating of the phantom packages (and hence registering them into ModuleSymbol) for the package/class clash check. That should prevent listing the package with the wrong name unnecessarily/unintentionally.


Progress

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

Issue

  • JDK-8263432: javac may report an invalid package/class clash on case insensitive filesystems

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3069

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 18, 2021

👋 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 Mar 18, 2021
@openjdk
Copy link

openjdk bot commented Mar 18, 2021

@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 Mar 18, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 18, 2021

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 21, 2021

@lahodaj This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@lahodaj
Copy link
Contributor Author

lahodaj commented Apr 21, 2021

Any comments on this?

Copy link
Contributor

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

looks good to me

@openjdk
Copy link

openjdk bot commented Apr 23, 2021

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

8263432: javac may report an invalid package/class clash on case insensitive filesystems

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

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 Apr 23, 2021
@lahodaj
Copy link
Contributor Author

lahodaj commented Apr 27, 2021

/integrate

@openjdk openjdk bot closed this Apr 27, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 27, 2021
@openjdk
Copy link

openjdk bot commented Apr 27, 2021

@lahodaj Since your change was applied there have been 720 commits pushed to the master branch:

  • 82b3719: 8265967: Unused NullCheckNode forward declaration in node.hpp
  • 468c847: 8234020: Remove FullGCCount_lock
  • 4785e11: 8264806: Remove the experimental JIT compiler
  • 7db9330: 8196300: java/awt/TextArea/TextAreaScrolling/TextAreaScrolling.java times out
  • 694aced: 8264805: Remove the experimental Ahead-of-Time Compiler
  • 15d4787: 8265496: improve null check in DeflaterOutputStream/InflaterInputStream
  • 1d37b98: 8265972: Remove declarations with no implementations in javaClasses.hpp
  • cb29b19: 8184134: HeapRegion::LogOfHRGrainWords is unused
  • 41daa88: 8265899: Use pattern matching for instanceof at module jdk.compiler(part 1)
  • a6f2863: 8266003: ProblemList sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java on macosx-all
  • ... and 710 more: https://git.openjdk.java.net/jdk/compare/a9b4f033ddfb2e7ea36ecdf2f076fc374fe54cac...master

Your commit was automatically rebased without conflicts.

Pushed as commit 0a4c338.

💡 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
2 participants