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

CODETOOLS-7903317: Fix code to compile extra property definitions #122

Conversation

jonathan-gibbons
Copy link
Collaborator

@jonathan-gibbons jonathan-gibbons commented Sep 16, 2022

Please review a fairly simple update to eliminate false positives in comments when looking for the name of the class in a Java source file.

The fix addresses a performance issue when running tests, because the "extra property definition" files were compiled every time jtreg was run, instead of as needed, which is the intent.

The fix is to ignore comments in the source code. The code to do this is copied from equivalent functionality in the langtools ToolBox class, which has been in use for many years.

The existing tests for "extra property definition" files have been extended with a test case to ensure that the false positives no longer occur and that the files are not recompiled unnecessarily.

Minor style issues in the main source file have also been fixed.


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

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 122

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jtreg/pull/122.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 16, 2022

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

openjdk bot commented Sep 16, 2022

@jonathan-gibbons this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout jtreg.7903317.compile-extra-prop-defns
git fetch https://git.openjdk.org/jtreg master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch rfr Pull request is ready for review labels Sep 16, 2022
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Sep 16, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 16, 2022

Webrevs

test/extra-props/comments/TEST.ROOT Outdated Show resolved Hide resolved
test/extra-props/comments/Test1.java Show resolved Hide resolved
// this test should be executed
}
}

Copy link
Member

Choose a reason for hiding this comment

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

extra trailing space

@openjdk
Copy link

openjdk bot commented Sep 17, 2022

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

7903317: Fix code to compile extra property definitions

Reviewed-by: iris, djelinski

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 Sep 17, 2022
@@ -221,6 +223,9 @@ private List<String> compile(JDK jdk, Path classDir, SearchPath classpath,
}

if (needCompilation) {
if (trace) {
System.err.println("Compiling extra property definition files: " + javacArgs);
Copy link
Member

Choose a reason for hiding this comment

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

Could you also log why the compilation was needed? i.e. when setting needCompilation, log sf and cf.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will investigate, as a separate RFE

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jonathan-gibbons
Copy link
Collaborator Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 21, 2022

Going to push as commit 77650ff.

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

openjdk bot commented Sep 21, 2022

@jonathan-gibbons Pushed as commit 77650ff.

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

@jonathan-gibbons jonathan-gibbons deleted the jtreg.7903317.compile-extra-prop-defns branch September 22, 2022 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants