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

8295058: test/langtools/tools/javac 116 test classes uses com.sun.tools.classfile library #14874

Closed
wants to merge 20 commits into from

Conversation

xqoasis
Copy link
Contributor

@xqoasis xqoasis commented Jul 13, 2023

Modified 116 tests with new Class-File API, and migrate helper methods to test/langtools/tools/javac/annotations/typeAnnotations/classfile/CombinationsTargetTest3.java while keep using old Class-File API


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-8295058: test/langtools/tools/javac 116 test classes uses com.sun.tools.classfile library (Sub-task - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14874

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Jul 13, 2023
@bridgekeeper
Copy link

bridgekeeper bot commented Jul 13, 2023

Hi @xqoasis, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user xqoasis" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link

openjdk bot commented Jul 13, 2023

@xqoasis 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 Jul 13, 2023
@asotona
Copy link
Member

asotona commented Jul 14, 2023

I would suggest to minimise footprint of the patch and do not change unrelated code.
Any unnecessary reformat can cause conflicts when merging into or from another project or when backporting and requires to review also reformatted-only code.

@asotona
Copy link
Member

asotona commented Jul 14, 2023

There are also missing new lines at the end of each modified source.

@bridgekeeper bridgekeeper bot removed the oca Needs verification of OCA signatory status label Jul 17, 2023
@xqoasis xqoasis changed the title 8295058: test/langtools/tools/javac 226 tests classes use com.sun.tools.classfile library 8295058: test/langtools/tools/javac 116 tests classes use com.sun.tools.classfile library Jul 31, 2023
@xqoasis xqoasis marked this pull request as ready for review July 31, 2023 16:56
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 31, 2023
@mlbridge
Copy link

mlbridge bot commented Jul 31, 2023

Webrevs

Copy link
Member

@asotona asotona left a comment

Choose a reason for hiding this comment

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

This is great amount of work well done.

return new File(path.substring(0, path.length() - 5) + ".class");
}

/************ Helper annotations counting methods ******************/
Copy link
Member

Choose a reason for hiding this comment

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

Arn't these test methods duplicated in the ClassfileTestHelper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified in the latest commit. I keep extending the ClassfileTestHelper, and only migrate the Test methods.

int all;
int visibles;
int invisibles;
}
Copy link
Member

Choose a reason for hiding this comment

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

Missing new line at the end

@@ -57,4 +62,4 @@ public void run() throws Exception {

@Target({ElementType.TYPE_USE})
@interface UniqueInner { };
}
}
Copy link
Member

Choose a reason for hiding this comment

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

missing new line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified in the latest commit

public void testLength(TestResult testCase, AnnotationDefaultAttribute attr) {
// need API to return unknown AnnotationValue's length
// testCase.checkEquals(((BoundAttribute<?>)attr).payloadLen(), 1 + attr.defaultValue().payloadLen(),
// "attribute_length");
Copy link
Member

Choose a reason for hiding this comment

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

Is there still a problem with casting to BoundAttribute that the test is commented out?

(sizeOfTag + ev.length() / ev.num_values) * ev.num_values, "attribute_length");
// need ev.length() api to check length
// testCase.checkEquals(((BoundAttribute<?>)attr).payloadLen(), 1 + 2 +
// (sizeOfTag + ev.length() / ev.values().size()) * ev.values().size(), "attribute_length");
Copy link
Member

Choose a reason for hiding this comment

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

The same as above.

Copy link
Member

Choose a reason for hiding this comment

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

This is probably a mistake, I see content of EnumTest replaced with Driver class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified in the latest commit

…le/TestAnonInnerClasses.java

Co-authored-by: Andrey Turbanov <turbanoff@gmail.com>
Copy link
Member

@asotona asotona left a comment

Choose a reason for hiding this comment

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

It looks good.
I think it can go in if you sync PR title "116 tests classes" with bug title "116 test classes".
Thanks for the work.

@xqoasis xqoasis changed the title 8295058: test/langtools/tools/javac 116 tests classes use com.sun.tools.classfile library 8295058: test/langtools/tools/javac 116 test classes uses com.sun.tools.classfile library Aug 7, 2023
@openjdk
Copy link

openjdk bot commented Aug 7, 2023

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

8295058: test/langtools/tools/javac 116 test classes uses com.sun.tools.classfile library

Reviewed-by: asotona

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

  • 4726960: 8313779: RISC-V: use andn / orn in the MD5 instrinsic
  • bbbfa21: 8313880: Incorrect copyright header in jdk/java/foreign/TestFree.java after JDK-8310643
  • 0bb6af3: 8313791: Fix just zPage.inline.hpp and xPage.inline.hpp
  • 4b192a8: 8313676: Amend TestLoadIndexedMismatch test to target intrinsic directly
  • 0b4387e: 8310643: Misformatted copyright messages in FFM
  • 538f955: 8313701: GHA: RISC-V should use the official repository for bootstrap
  • 226cdc6: 8312585: Rename DisableTHPStackMitigation flag to THPStackMitigation
  • dc01604: 8305636: Expand and clean up predicate classes and move them into separate files
  • a38fdaf: 8166900: If you wrap a JTable in a JLayer, the cursor is moved to the last row of table by you press the page down key.
  • c1f4595: 8311160: [macOS, Accessibility] VoiceOver: No announcements on JRadioButtonMenuItem and JCheckBoxMenuItem
  • ... and 242 more: https://git.openjdk.org/jdk/compare/8c9d091f19760deece8daf3e57add85482b9f2a7...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@asotona) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 7, 2023
@turbanoff
Copy link
Member

Modified 12 of 226 test/langtools/tools/javac test classes to replace com.sun.tools.classfile library.

Is this is still actual number? I mean 12.

@xqoasis
Copy link
Contributor Author

xqoasis commented Aug 7, 2023

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Aug 7, 2023
@openjdk
Copy link

openjdk bot commented Aug 7, 2023

@xqoasis
Your change (at version df9c205) is now ready to be sponsored by a Committer.

@asotona
Copy link
Member

asotona commented Aug 7, 2023

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 7, 2023

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

  • 4726960: 8313779: RISC-V: use andn / orn in the MD5 instrinsic
  • bbbfa21: 8313880: Incorrect copyright header in jdk/java/foreign/TestFree.java after JDK-8310643
  • 0bb6af3: 8313791: Fix just zPage.inline.hpp and xPage.inline.hpp
  • 4b192a8: 8313676: Amend TestLoadIndexedMismatch test to target intrinsic directly
  • 0b4387e: 8310643: Misformatted copyright messages in FFM
  • 538f955: 8313701: GHA: RISC-V should use the official repository for bootstrap
  • 226cdc6: 8312585: Rename DisableTHPStackMitigation flag to THPStackMitigation
  • dc01604: 8305636: Expand and clean up predicate classes and move them into separate files
  • a38fdaf: 8166900: If you wrap a JTable in a JLayer, the cursor is moved to the last row of table by you press the page down key.
  • c1f4595: 8311160: [macOS, Accessibility] VoiceOver: No announcements on JRadioButtonMenuItem and JCheckBoxMenuItem
  • ... and 242 more: https://git.openjdk.org/jdk/compare/8c9d091f19760deece8daf3e57add85482b9f2a7...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Aug 7, 2023

@asotona @xqoasis Pushed as commit 380418f.

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