Skip to content
This repository has been archived by the owner. It is now read-only.

8270916: Update java.lang.annotation.Target for changes in JLS 9.6.4.1 #256

Closed
wants to merge 1 commit into from

Conversation

@jddarcy
Copy link
Member

@jddarcy jddarcy commented Jul 19, 2021

Given changes in JLS 9.6.4.1, JDK-8261610 in Java SE 17, the statements about annotation applicability made in java.lang.annotation.Target need to be updated to match.

Please also review the corresponding CSR: https://bugs.openjdk.java.net/browse/JDK-8270917


Progress

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

Issue

  • JDK-8270916: Update java.lang.annotation.Target for changes in JLS 9.6.4.1

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 256

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

Using diff file

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

@jddarcy
Copy link
Member Author

@jddarcy jddarcy commented Jul 19, 2021

/csr

Loading

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 19, 2021

👋 Welcome back darcy! 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
Copy link

@openjdk openjdk bot commented Jul 19, 2021

@jddarcy this pull request will not be integrated until the CSR request JDK-8270917 for issue JDK-8270916 has been approved.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jul 19, 2021

@jddarcy The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs label Jul 19, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 19, 2021

Webrevs

Loading

@openjdk openjdk bot removed the csr label Jul 22, 2021
@jddarcy
Copy link
Member Author

@jddarcy jddarcy commented Jul 22, 2021

CSR now approved.

Loading

bplb
bplb approved these changes Jul 22, 2021
naotoj
naotoj approved these changes Jul 22, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 22, 2021

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

8270916: Update java.lang.annotation.Target for changes in JLS 9.6.4.1

Reviewed-by: bpb, naoto

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

  • 4812e53: 8271094: runtime/duplAttributes/DuplAttributesTest.java doesn't check exit code
  • 6a9ab6a: 8271093: remove deadcode from runtime/Thread/TestThreadDumpSMRInfo.java test
  • e7f9009: 8270085: Suspend during block transition may deadlock if lock held
  • 39b486d: 8271126: ProblemList runtime/InvocationTests/invokevirtualTests.java
  • 4119a52: 8270461: ZGC: Invalid oop passed to ZBarrierSetRuntime::load_barrier_on_oop_array
  • 89f7998: 8266347: assert(Dependencies::is_concrete_root_method(fm, ctxk) == Dependencies::is_concrete_method(m, ctxk)) failed: mismatch
  • e1051ae: 8264066: Enhance compiler validation
  • add995b: 8265201: JarFile.getInputStream not validating invalid signed jars
  • ca6b222: 8258432: Improve File Transfers
  • a3acce5: 8264079: Improve abstractions
  • ... and 18 more: https://git.openjdk.java.net/jdk17/compare/c1304519b56e44d1d4e380d0b9839a8b09385e6d...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 Jul 22, 2021
@jddarcy
Copy link
Member Author

@jddarcy jddarcy commented Jul 22, 2021

/integrate

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jul 22, 2021

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

  • 4812e53: 8271094: runtime/duplAttributes/DuplAttributesTest.java doesn't check exit code
  • 6a9ab6a: 8271093: remove deadcode from runtime/Thread/TestThreadDumpSMRInfo.java test
  • e7f9009: 8270085: Suspend during block transition may deadlock if lock held
  • 39b486d: 8271126: ProblemList runtime/InvocationTests/invokevirtualTests.java
  • 4119a52: 8270461: ZGC: Invalid oop passed to ZBarrierSetRuntime::load_barrier_on_oop_array
  • 89f7998: 8266347: assert(Dependencies::is_concrete_root_method(fm, ctxk) == Dependencies::is_concrete_method(m, ctxk)) failed: mismatch
  • e1051ae: 8264066: Enhance compiler validation
  • add995b: 8265201: JarFile.getInputStream not validating invalid signed jars
  • ca6b222: 8258432: Improve File Transfers
  • a3acce5: 8264079: Improve abstractions
  • ... and 18 more: https://git.openjdk.java.net/jdk17/compare/c1304519b56e44d1d4e380d0b9839a8b09385e6d...master

Your commit was automatically rebased without conflicts.

Loading

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

@openjdk openjdk bot commented Jul 22, 2021

@jddarcy Pushed as commit ecc37b0.

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

Loading

@lgxbslgx
Copy link
Member

@lgxbslgx lgxbslgx commented Aug 20, 2021

Hi @jddarcy,

Sorry for the delay.

I notice the current javac code(shown below) doesn't meet the JLS 9.6.4.1 .
The code doesn't mark TYPE_PARAMETER as the default target.
Because the PR openjdk/jdk#622 and openjdk/jdk#2412 , which tried to fix this problem, is earlier than the JDK-8261610, JDK-8270916, and JDK-8270917.

According to the new JLS 9.6.4.1, the javac compiler should be adjusted to add TYPE_PARAMETER as the default target.
Should we fix the compiler issue in JDK17? But it seems too late to do that.
Maybe JDK18 is a good place. What do you think about it? Any ideas are appreciated.

// com.sun.tools.javac.comp.Check.java
    private Name[] dfltTargetMeta;
    private Name[] defaultTargetMetaInfo() {
        if (dfltTargetMeta == null) {
            ArrayList<Name> defaultTargets = new ArrayList<>();
            defaultTargets.add(names.PACKAGE);
            defaultTargets.add(names.TYPE);
            defaultTargets.add(names.FIELD);
            defaultTargets.add(names.METHOD);
            defaultTargets.add(names.CONSTRUCTOR);
            defaultTargets.add(names.ANNOTATION_TYPE);
            defaultTargets.add(names.LOCAL_VARIABLE);
            defaultTargets.add(names.PARAMETER);
            if (allowRecords) {
              defaultTargets.add(names.RECORD_COMPONENT);
            }
            if (allowModules) {
              defaultTargets.add(names.MODULE);
            }
            dfltTargetMeta = defaultTargets.toArray(new Name[0]);
        }
        return dfltTargetMeta;
    }

Best Regards,
-- Guoxiong

Loading

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants