Skip to content

Inner classes incorrectly referenced in mappers #39

Description

@koral--

Trying to compile project with static inner class Foo:

    @ObjectMappable
    public static class Foo {
        public Foo() {
        }

        @Column("id")
        public void setId(final long id) {

        }
    }

results in compilation error: Error:(11, 87) error: cannot find symbol class Foo
Relevant part of generated mapper:

import android.content.ContentValues;
import android.database.Cursor;
import rx.functions.Func1;

/**
 * Generated class to work with Cursors and ContentValues for MediaStoreManager.Foo
 */
public final class FooMapper {
  public static final Func1<Cursor, MediaStoreManager.Foo> MAPPER = new Func1<Cursor, Foo>() {
    @Override public Foo call(Cursor cursor) {
      int idIndex = cursor.getColumnIndexOrThrow("id");
      MediaStoreManager.Foo item = new MediaStoreManager.Foo();
      if (idIndex >= 0) {
        item.setId( cursor.getLong( idIndex ) );
      }
      return item;
    }
  };

  private FooMapper() {
  }

There is proper enclosing class in variable declaration and javadoc but it is missing in type parameter and return value.
Dependencies versions:

    apt 'com.hannesdorfmann.sqlbrite:object-mapper:0.6.0'
    compile 'com.hannesdorfmann.sqlbrite:annotations:0.6.0'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

BTW is it intended that there is checking whether column index >=0 in case when getColumnIndexOrThrow() is used? According to javadoc exception will be thrown in such case and condition is never false.
BTW2 javadoc may use `{@link MediaStoreManager.Foo}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions