Skip to content
AlexanderR edited this page Apr 19, 2016 · 19 revisions

Limitations/Known Issues

  • JDK 6 may work, but isn't supported, since it is no longer supported by it's creator and developers of Javapoet.

  • Passing invalid expressions as annotation parameters may not be correctly detected during validation step and results in runtime exception during compilation with Javac.

    Example:

    // will fail to compile with ugly message, asking you to send a bug report :(
    @AIDL(SomeNonExistingType.DESCRIPTOR)

    This is due to limitations of Javac, which converts erroneous "types" to strings before passing them to AnnotationValueVisitor. This also happens with other annotation processors, such as ButterKnife.

  • Generated implementations of interfaces, containing intersection types, may fail to compile with source versions before Java 8.

    // this will fail to compile with JDK 7
    <T extends Parcelable & Runnable> void methodWithIntersectionArgument(T param);

    This is because implementing those requires support for either advanced type inference or casts to intersection, both of which didn't exist until Java 8.

  • Some of generated files may contain redundant casts. This is due to limitation of Java compilers, which sometimes fail to correctly tell annotation processors whether a cast is needed (this tends to happen when generics are involved).

  • Nonsential intersection types like Boolean & Runnable aren't detected. I believe, that those should be handled by the compiler.

Clone this wiki locally