Por que aparece mensagem The expression of type List needs unchecked conversion to conform to

1 resposta
P

Olá,

o que fazer pra tirar essa mensagem de warning fora usar @SuppressWarnings(“unchecked”).

abs

Multiple markers at this line
	- Type safety: The expression of type List needs unchecked conversion to conform to 
	 List<Conta>
	- Line breakpoint:ContaDAOHibernate [line: 46] - listar(Usuario)
public List<Conta> listar(Usuario usuario) {
		// TODO Auto-generated method stub
		Criteria criteria = this.session.createCriteria(Conta.class);
		criteria.add(Restrictions.eq("usuario", usuario));
		
		List<Conta> list = criteria.list();   //nessa linha !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
		return list;
	}

1 Resposta

drigo.angelo
List<Conta> list = (List<Conta>) criteria.list();
Criado 7 de fevereiro de 2011
Ultima resposta 7 de fev. de 2011
Respostas 1
Participantes 2