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

8224922: Access JavaFileObject from Element(s) #5038

Closed
wants to merge 43 commits into from

Conversation

jddarcy
Copy link
Member

@jddarcy jddarcy commented Aug 6, 2021

Initial review to get some comments on the shape of the API. Tests are needed of course, as well as some tuning of the spec to better describe differences in behavior when class files rather than source files are the backing file type.


Progress

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

Issue

Reviewers

Contributors

  • Jan Lahoda <jlahoda@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5038

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 6, 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.

@jddarcy
Copy link
Member Author

@jddarcy jddarcy commented Aug 6, 2021

/csr needed

@openjdk openjdk bot added rfr csr labels Aug 6, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 6, 2021

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

@openjdk
Copy link

@openjdk openjdk bot commented Aug 6, 2021

@jddarcy 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 label Aug 6, 2021
@lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Aug 10, 2021

Seems useful to me. A possible conversion from Element to FileObject is needed elsewhere as well, I've tried to write it here:

private JavaFileObject[] originatingFiles(Element[] originatingElements) {

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 7, 2021

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

@jddarcy
Copy link
Member Author

@jddarcy jddarcy commented Sep 7, 2021

Keep-alive.

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 6, 2021

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

@jddarcy
Copy link
Member Author

@jddarcy jddarcy commented Oct 6, 2021

Still keep-alive.

@openjdk
Copy link

@openjdk openjdk bot commented Nov 2, 2021

⚠️ @jddarcy This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk openjdk bot removed the csr label Nov 17, 2021
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons left a comment

Nice to see at least partial cleanup of the Symbol.classfile field.

@@ -36,7 +36,7 @@
* appearing inside method bodies, such as local variables and
* anonymous classes.
*
* <p>When used in the context of annotation processing, an accurate
* <p><a id="accurate_model">When used in the context of annotation processing, an accurate
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Nov 18, 2021

Choose a reason for hiding this comment

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

It would be more correct to just put the id on the <p> tag and drop the <a>.

Copy link
Member Author

@jddarcy jddarcy Nov 21, 2021

Choose a reason for hiding this comment

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

Fixed.

* (implicitly) created during an annotation processing run from
* the creation of source or class files in that package. An
* {@linkplain PackageElement#isUnnamed unnamed package} will have
* a null file since it cannot be declared in a compilation unit.
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Nov 18, 2021

Choose a reason for hiding this comment

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

{@code } around null ??

Copy link
Member Author

@jddarcy jddarcy Nov 21, 2021

Choose a reason for hiding this comment

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

I'll fix these before pushing and do a follow-up pass over the API for consistent "null" vs "{@code null}" treatment.

*
* <p>If it has a file object, the file object for a module will
* be a {@code module-info} file. An {@linkplain
* ModuleElement#isUnnamed unnamed module} will have a null file
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Nov 18, 2021

Choose a reason for hiding this comment

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

another null.

* ModuleElement#isUnnamed unnamed module} will have a null file
* since it cannot be declared in a compilation unit. An
* {@linkplain #isAutomaticModule automatic module} will have a
* null file since it is implicitly declared.
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Nov 18, 2021

Choose a reason for hiding this comment

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

I guess you're consistent!

@openjdk
Copy link

@openjdk openjdk bot commented Nov 18, 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:

8224922: Access JavaFileObject from Element(s)

Co-authored-by: Jan Lahoda <jlahoda@openjdk.org>
Reviewed-by: jjg

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 label Nov 18, 2021
@jddarcy
Copy link
Member Author

@jddarcy jddarcy commented Nov 21, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Nov 21, 2021

Going to push as commit 4ff4301.

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

@openjdk openjdk bot commented Nov 21, 2021

@jddarcy Pushed as commit 4ff4301.

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

@jddarcy jddarcy deleted the JDK-8224922 branch Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler integrated
3 participants