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

parameter with more than one annotation creates compilation error #61

Closed
lesaint opened this issue Feb 9, 2015 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@lesaint
Copy link
Owner

lesaint commented Feb 9, 2015

Whenever I write a Mapper which mapper method has a parameter with more than one annotation, I get a compilation error.

For example:

@Mapper
public class MultipleAnnotationOnParameter {
  public Integer map(@Nonnull @ParamAnnot String a) {
    return null; // content doesn't matter
  }
}

Raises the following compilation errors;

[ERROR] [...]/MultipleAnnotationOnParameterMapper.java:[8,25] illegal start of type
[ERROR] [...]/MultipleAnnotationOnParameterMapper.java:[8,26] ')' expected
[ERROR] [...]/MultipleAnnotationOnParameterMapper.java:[8,28] ';' expected
[ERROR] [...]/MultipleAnnotationOnParameterMapper.java:[8,47] = expected
[ERROR] [...]/MultipleAnnotationOnParameterMapperImpl.java:[10,32] illegal start of type
[ERROR] [...]/MultipleAnnotationOnParameterMapperImpl.java:[10,33] ')' expected
[ERROR] [...]/MultipleAnnotationOnParameterMapperImpl.java:[10,35] ';' expected
[ERROR] [...]/MultipleAnnotationOnParameterMapperImpl.java:[10,54] ';' expected

And the generated content is the following:

@javax.annotation.Generated("fr.javatronic.damapping.processor.DAAnnotationProcessor")
public interface MultipleAnnotationOnParameterMapper {

    Integer map(@Nonnull, @ParamAnnot String a);
}
@javax.annotation.Generated("fr.javatronic.damapping.processor.DAAnnotationProcessor")
public class MultipleAnnotationOnParameterMapperImpl implements MultipleAnnotationOnParameterMapper {
    private final MultipleAnnotationOnParameter dedicatedInstance = new MultipleAnnotationOnParameter();

    @Override
    public Integer map(@Nonnull, @ParamAnnot String a) {
        return this.dedicatedInstance.map(a);
    }
}

Clearly there shouldn't be a , between the annotations of a parameter.

@lesaint lesaint added the bug label Feb 9, 2015
@lesaint lesaint self-assigned this Feb 9, 2015
@lesaint lesaint added this to the 0.7.0 milestone Feb 9, 2015
lesaint added a commit that referenced this issue Feb 9, 2015
CommonsMethodImpl.appendInlineAnnotations added a ',' between each annotation, most likely a copy/paste error and this case had no unit test
add unit test for DAClassMethodWriter and DAInterfaceMethodWriter
add integration test MultipleAnnotationOnParameter in module mapper-constructor
@lesaint
Copy link
Owner Author

lesaint commented Feb 9, 2015

solved and commit to master

@lesaint lesaint closed this as completed Feb 9, 2015
lesaint added a commit that referenced this issue Feb 9, 2015
CommonsMethodImpl.appendInlineAnnotations added a ',' between each annotation, most likely a copy/paste error and this case had no unit test
add unit test for DAClassMethodWriter and DAInterfaceMethodWriter
add integration test MultipleAnnotationOnParameter in module mapper-constructor
@lesaint lesaint modified the milestones: 0.6.1, 0.7.0 Feb 9, 2015
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

1 participant