小编Ser*_*ace的帖子

Lint 在读取 Kotlin 对象的 Java 类上崩溃

我有一个 Kotlin 数据类:

data class InterviewCreation(
    val candidateId: String,
    val offerId: String,
    val startingDateTime: Long,
    val duration: Long,
    val location: String,
    val description: String?
    )
Run Code Online (Sandbox Code Playgroud)

和一个像这样开始的 Mapper 类(在 Java 中):

public InterviewCreationViewModel toViewModel(InterviewCreation newInterview, String candidateName, String candidatePhotoUrl) {
    String description = newInterview.getDescription();
    String location = newInterview.getLocation();
    long duration = newInterview.getDuration();
    ...
}
Run Code Online (Sandbox Code Playgroud)

运行 Lint 时,它在 Mapper 类中崩溃

 ECJ compiler crashed processing .../InterviewCreationViewModelMapper.java
java.lang.NullPointerException
        at org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:138)
        at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:89)
        at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:125)
        at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:739)
        at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:263)
        at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:118)
        at com.android.tools.lint.EcjParser$NonGeneratingCompiler.process(EcjParser.java:1521)
        at org.eclipse.jdt.internal.compiler.Compiler.processCompiledUnits(Compiler.java:550) …
Run Code Online (Sandbox Code Playgroud)

android lint lombok kotlin retrolambda

3
推荐指数
1
解决办法
245
查看次数

标签 统计

android ×1

kotlin ×1

lint ×1

lombok ×1

retrolambda ×1