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

Compilation error when fields have no getter #41

Closed
ArnaudPiroelle opened this issue Nov 13, 2014 · 1 comment
Closed

Compilation error when fields have no getter #41

ArnaudPiroelle opened this issue Nov 13, 2014 · 1 comment
Labels
Milestone

Comments

@ArnaudPiroelle
Copy link

Unexpected compilation errors occurs when two beans have the same private area and have no getter.

Errors:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project test-selma: Compilation failure: Compilation failure:
[ERROR] \test-selma\target\classes\com\arnaudpiroelle\selma\MyMapperSelmaGeneratedClass.java:[23,22] error: <identifier> expected
[ERROR] \test-selma\target\classes\com\arnaudpiroelle\selma\MyMapperSelmaGeneratedClass.java:[23,26] error: ';' expected
[ERROR] \test-selma\target\classes\com\arnaudpiroelle\selma\MyMapperSelmaGeneratedClass.java:[23,27] error: illegal start of expression
[ERROR] \test-selma\target\classes\com\arnaudpiroelle\selma\MyMapperSelmaGeneratedClass.java:[23,28] error: ';' expected

Generated sources:

@Override
  public final A from(B in) {
    com.arnaudpiroelle.selma.A out = null;
    if (in != null) {
      out = new com.arnaudpiroelle.selma.A();
      out.setField(in.null());
    }
    return out;
  }

Bean A:

public class A {
    private String field;

    public void setField(String field) {
        this.field = field;
    }
}

Bean B:

public class B {
    private String field;

    public void setField(String field) {
        this.field = field;
    }
}

Mapper:

@Mapper
public interface MyMapper {
    A from(B b);
}
@slemesle slemesle added bug and removed bug labels Nov 13, 2014
@slemesle slemesle added this to the 0.10 milestone Nov 13, 2014
slemesle added a commit that referenced this issue Nov 13, 2014
@slemesle
Copy link
Collaborator

There was a test for missing property in source bean, but not for missing getter in source bean.
Should be now available in SNAPSHOTS.

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

2 participants