1
public class UserHeaderRepository<TEntity>{

  private final CollectionReference collectionReference;

  private final Class<TEntity> entityClass;

  public static UserHeaderRepository getInstance()
  {          

     return new UserHeaderRepository(UserHeader.class);
  }

  public UserHeaderRepository ( Class < TEntity > entityClass ) {

    this.entityClass = entityClass;
    FirebaseFirestore db = FirebaseFirestore.getInstance();
    this.collectionReference = db.collection("global_community");
 }

I don't know why I got the below error:

unchecked call to  UserHeaderRepository(Class<TEntity>)  row type 'as a member of raw type  '../appRepository/UserHeaderRepository'
Sandeep Kumar
  • 2,397
  • 5
  • 30
  • 37

1 Answers1

1

You are using raw types where you were supposed to use the parameterized type, change the getInstance method to this,

public static UserHeaderRepository<UserHeader> getInstance() {
    return new UserHeaderRepository<>(UserHeader.class);
}

Also it should not be an error it should be warning from the compiler.

Adwait Kumar
  • 1,552
  • 10
  • 25