One question, ``` fun findAll(pageable: Pageable)...
# spring
s
One question,
Copy code
fun findAll(pageable: Pageable): Page<AuditEvent> {
        return persistenceAuditEventRepository.findAll(pageable)
            .map{ auditEventConverter.convertToAuditEvent(it) }
}
Copy code
return userByEmailFromDatabase
                    .map { createSpringSecurityUser(login, it) }
                    .orElseThrow { UsernameNotFoundException("User with email " + login + " was not found in the database") }
What is wrong with the above 2 snippets? Strangely it is working on the IntelliJ but in terminal it fails with the following
Copy code
kotlin/main/com/mycompany/myapp/service/AuditEventService$findAll$1.class
    undeclared type variable: U
    Please remove or make sure it appears in the correct subdirectory of the classpath.
Any idea or suggestions?
l
what you mean "in termnal"?
s
running
.gradlew
in a terminal (command line)
l
does IDEA use gradle wrapper too?
s
yeah
Oops I am wrong here, Actually in IntelliJ I just run the Spring boot's main function But the gradlew script is not working when we mix Java and Kotlin. Is there any special configuration that we need to do in build.gradle when mixing java and kotlin
l
no
s
This is super interesting (as well as annoying) why does JavaCompile step worries about Kotlin’s compiled class ? If I split the code with an if … else it is working.