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

Better document relation with Factory10 interface and UnsupportedMessageException #191

Closed
ldaynes opened this issue Jul 1, 2016 · 6 comments
Labels

Comments

@ldaynes
Copy link
Member

ldaynes commented Jul 1, 2016

The documentation for the Factory10 interface at the moment says that the accessXXX messages can return null if the message is not supported. However, example in SL shows that this is not done that way. Instead, the SL implementation always raise an UnsupportedMessageException (i.e., doing UnsupportedMessageException.raise(Message.XXX); )

Can you clarify in the documentation why is there two ways to do this and which one is the recommended one ?

@grimmerm
Copy link
Contributor

grimmerm commented Jul 4, 2016

Where does SL throw such an exception?
AFAIK, SL is using Interop-DSL, which generates a Factory10 implementation (which throws an UnsupportedMessageException).

@jtulach returning null is not a good idea - I think the JavaDoc of Factory10 is wrong.
One has to raise an UnsupportedMessageException (i.e., doing UnsupportedMessageException.raise(Message.XXX); ).

@ldaynes
Copy link
Member Author

ldaynes commented Jul 4, 2016

@grimmerm you can see throwing of these exception in the com.oracle.truffle.sl.runtime.SLxxxxMessageResolutionForeign classes. It's not clear that these are generated automatically -- nothing in the source indicate that, there's no @GeneratedBy or header comment telling so.

@woess
Copy link
Member

woess commented Jul 4, 2016

Indeed, we should add a @GeneratedBy annotation. This also helps with navigating from the generated class to the source class in an IDE.

@chumer
Copy link
Member

chumer commented Jul 18, 2016

@grimmerm please fix this.

@jtulach
Copy link
Contributor

jtulach commented Jul 22, 2016

Using @GeneratedBy is OK. Other option is to generate Javadoc and include @link references. Those are good for navigation as well.

dougxc pushed a commit that referenced this issue Sep 6, 2016
…ruffle:fix_warnings to master

* commit '514d19bc55be3b82f76b7b3cddfe27b34d245348':
  Fix warning: declared exception IOException is not actually thrown
@chumer chumer added the truffle label Jan 9, 2018
@chumer
Copy link
Member

chumer commented Jan 9, 2018

There are currently no plans to fix this minor issue.

@chumer chumer closed this as completed Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants