-
Notifications
You must be signed in to change notification settings - Fork 27
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
JBLOGGING-189 Include originating element when creating files with Filer #119
JBLOGGING-189 Include originating element when creating files with Filer #119
Conversation
335199a
to
3896e0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome - left some minor, optional suggestions.
(It's not my place to approve)
private final Filer filer; | ||
|
||
private JFilerOriginatingElementAware(Element originatingElement, Filer filer) { | ||
this.originatingElement = originatingElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd check here for these elements to not be null?
Otherwise it fails later and it would get trickier to narrow down
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to propose this to happen slightly differently. I'd propose throwing a ProcessingException
as it can take the element as an argument and potentially fail with a better message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 😃, so maybe something like this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect. I know these are highly unlikely, but may as well have as much information as possible if they are thrown :)
@@ -362,4 +368,26 @@ private JExpr determineLocale(final String locale, final JType localeType) { | |||
|
|||
return initializer; | |||
} | |||
|
|||
private static class JFilerOriginatingElementAware extends JFiler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to add a little javadoc, or some comments, to explain to other maintainers why this is useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look and for the suggestions 😃🎉
Applied the changes and pushed an updated version 😃
3896e0a
to
ee6374d
Compare
ee6374d
to
8bd9467
Compare
Hey @jamezp 👋🏻 😃 Any chance you could do another release for jboss-logging-tools including the patch from this PR? We'd want to use it in ORM to improve (hopefully) the incremental builds. Thanks! |
@marko-bekhta I guess I'm not as caught up from PTO as I thought :) Yes, next week I will get a release out. |
Thanks 😃 🎉 |
Sorry for the delay @marko-bekhta, but done https://github.com/jboss-logging/jboss-logging-tools/releases/tag/3.0.2.Final |
Thanks, James! 😃 |
https://issues.redhat.com/browse/JBLOGGING-189
and here's an example based on Hibernate ORM build:
Without the patch:
With the patch: