I'm writing a code in Kotlin language (of JetBrains) using IntelliJ and i'm facing a error on compiler where the compiler cannot find the correct parameter type of a function, always saying that the function receve a Nothing parameter.
Someone have any idea of what is the problem?
Print Screen showing the error on IntelliJ IDE
In the image, the console show the compiler error, but a help on center of the screen shows that IntelliJ can find the correct parameter type of the function, but compiler not.
==== Edited ==========================================
The Java code is:
@Transactional
public int deletar(BuscaInfo info) {
// ---- Criando a busca ao banco:
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaDelete query = cb.createCriteriaDelete( info.classe );
Root root = query.from( info.classe );
// Cláusula WHERE do banco:
Predicate[] preds = WhereBuilder.build(cb, root, info.where);
if (preds.length < 1) {
throw new MsgException(JsonResponse.ERROR_EXCECAO,null,"Os parâmetros de filtragem da QueryString não são válidos.");
}
query.where(preds);
// A busca ao banco:
int qtd = em.createQuery(query).executeUpdate();
return qtd;
}
and info.classe is of type Class<?>.
Using Hibernate 5.x and JPA 2.1 api to compile.
That code works on WildFly 9.x and 10.x.