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

Comments

Projects
None yet
2 participants
@ArnaudPiroelle

ArnaudPiroelle commented Nov 13, 2014

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

This comment has been minimized.

Show comment
Hide comment
@slemesle

slemesle Nov 13, 2014

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

slemesle commented Nov 13, 2014

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

@slemesle slemesle closed this Nov 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment