Monday 28 October 2013

Reified Type Parameters Using Java Annotations

My GPCE talk about @reify is over. One of the questions asked during Q&A was how is it possible to override the object's getClass() method to return correct information. If an instance is available and obj.getClass() is invoked (where obj is declared as T where T is generic type), then by employing only our proposed generation scheme getClass() won't provide the full type information. getClass() cannot be overriden and the answer to this is that method invocations of getClass() may also need to be rewritten in the AST level. Additionally, generic type information must be stored in the object instance level to make full reflection support possible to be provided. The class literal (.class syntax) on the other hand is valid only on types right now. With @reify if we get to write T.class where T is abstract, due to the .class expression that evaluates to the T class statically we can generate the proper code as we showed in the paper.

Thank you all for attending and also thank you for your comments.


And the poster that I presented in the SPLASH Poster Session (in pdf format):

2 comments:

  1. I've not had fortune gogling an implementation. Where can I find source?

    ReplyDelete
  2. Hi Brian! There isn't an implementation yet. This paper was a design proposal and our goal is to provide bits that work with openjdk's javac.

    ReplyDelete