google / google/j2objc

Annotation type and annotation's creation method (create_XXXX) are missing

Open
#815 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6k
Forks
999
Avg merge
19h 20m
Merged PRs (30d)
14

Description

We use the translated jackson-annotation and it seems that the translated code of the inner annotation does not generated correctly. (It was ok in earlier release) All inner annotation types becomes missing in translated code (in below example, value and name are missing from translated code). Also, the create_XXXX method (in this case, create_ComFasterxmlJacksonAnnotationJsonSubTypes_Type) also went missing. Here is a java file you can try to see the problem. (It is a modified version of original file from jackson-annotation lib to allow translation as single file) Also, I have attached a translated .h and .m translated with older release (with _old suffix) and the latest j2objc code (with _new suffix).

import java.lang.annotation.ElementType;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.FIELD,
ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface JsonSubTypes {
public Type[] value();

public @interface Type {
public Class value();
public String name() default "";
}
}

[JsonSubType.zip](https://github.com/google/j2objc/files/578233/JsonSubType.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.