GithubHelp home page GithubHelp logo

chdir / aidl2 Goto Github PK

View Code? Open in Web Editor NEW
41.0 41.0 8.0 646 KB

Annotation processor, generating AIDL proxy/stub from Java interface definition

License: GNU General Public License v2.0

Java 99.93% Prolog 0.07%

aidl2's People

Contributors

alexander-- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aidl2's Issues

Jack compatibility

This issue is supposed to serve as reference for all Jack bugs, that makes it incompatible with AIDL2 (those are actually bugs in Jack/ECJ, not in AIDL2, hence no need to create separate issues).

Squash multiple ObjectXXXStream blocks in one

Right now a method with N Serializable/Externalizable parameters will create and immediately throw away N ObjectXXXStream instances during each transaction. Instead it should be possible to reuse those.

Proper support for type annotations

In ideal world the following snippet would both compile and be inspectable from annotation processors:

void methodWithListParameter(List<@NonNull ? extends CustomParcelable>);

In reality ECJ does not appear to recognize type annotations as anything, but opaque source code tokens, and so does Javac.

Current situation

There is a way to make introspection on type annotations "work" in Javac:

  1. Postpone your compilation until type analysis completes using Oracle-proprietary JavacTask API
  2. Obtain the annotated type using Oracle proprietary Trees.getTypeMirror API.

Unfortunately, as of Javac 1.8.0_112 doing this requires significant effort (manually walking trees using tree API) and does not really work for any types, only for simple, non-composite types. The following TreePath will have no annotations:

List<@NonNull ? extends CustomParcelable>

You will have to cast it to parametrized tree and walk down to

@NonNull ? extends CustomParcelable

For which Trees.getTypeMirror will finally produce correctly annotated WildcardType.

The alternative is to use non-documented Javac classes, which will likely become unavailable in Java 9. And that still does not guarantee correct outcome.

Oncoming improvements

Javac have had a major injection of code to actually support type annotations. That code isn't included in Java 8 and will be available in Java 9 only.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.