Skip to content

Make generated Interop classes public #192

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

Closed
wants to merge 1 commit into from

Conversation

smarr
Copy link
Contributor

@smarr smarr commented Jul 1, 2016

The classes generated by the other DSL processors are public.
This change makes the Interop DSL consistent with that and avoids requiring strange workarounds or putting undesirable restrictions on how to divide code into packages.

This is consistent with all other generated classes.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
@jtulach
Copy link
Contributor

jtulach commented Jul 1, 2016

I do rely on the classes being non-public in my HTML/Java codebase. All the implementation classes are non-public and I certainly don't want the annotation processor to generate anything public in my case.

Some kind of hint or configuration is needed to support both scenarios, in my opinion.

@smarr
Copy link
Contributor Author

smarr commented Jul 2, 2016

The current behavior is inconsistent compared to the other annotation processors, so Truffle itself already sets another expectation. (Note also that I only made the classes public that need to be accessible, there are true implementation classes that are not made public.)

@eregon
Copy link
Member

eregon commented Jul 2, 2016

@jtulach This is unreasonable. It's generated code, there is no point to see that in documentation or ever be checked-in in a repository. It should be made convenient, like the DSL generated nodes.
JavaObject can remain package-private of course.

@eregon
Copy link
Member

eregon commented Jul 2, 2016

One compromise could be to generate a package-private class if the source class is package-private.
But it would neither be very intuitive, nor particularly simple for the user.
I value (as probably most users) those much more than trying to hide classes.
Simplicity is also important in the implementation (so introducing e.g. a new annotation to specify visibility would not be worth it IMO).

@eregon eregon changed the title Make generate Interop classes public Make generated Interop classes public Jul 2, 2016
@woess
Copy link
Member

woess commented Jul 3, 2016

One compromise could be to generate a package-private class if the source class is package-private.

Sounds reasonable to me.
If the source class is public, the generated class should definitely be public.

@smarr
Copy link
Contributor Author

smarr commented Jul 4, 2016

@jtulach why do you generate JavaDoc for generated code? There aren't any comments anyway?

@jtulach
Copy link
Contributor

jtulach commented Jul 5, 2016

Good start: pkg prvt leads to pkg prvt gen classes.otherwise gen publici
More cntrl needed: add an attribute
Motto: make common easy + complex possible

@graalvmbot
Copy link
Collaborator

Warning: some required labels were not added by the current assignee @grimmerm. In a normal review process, the assignee is responsible for adding labels to the pull request.

Contentious labels: accept

dougxc pushed a commit that referenced this pull request Sep 13, 2016
…master

* commit 'fffe60032dd9ed1ffa69b14548be2e7c6ec94705':
  Use targets and capabilities in the hocon file.
  Deploy binaries on post-merge.
@smarr
Copy link
Contributor Author

smarr commented Nov 23, 2016

I think this one was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants