我有一个 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)