Skip to content

ContestEstimator fails with java.lang.NullPointerException #558

Closed
@volivan239

Description

@volivan239

Description

ContestEstimator throws unexpected java.lang.NullPointerException and generates empty test class on enums

To Reproduce

Launch contestEstimator with methodFilter = "com.google.common.base.CaseFormat.*" and projectFilter = null and 120s time limit

Expected behavior

Tests generated

Actual behavior

java.lang.NullPointerException is thrown and empty test class is generated

Visual proofs (screenshots, logs, images)

Generated test file:

package com.google.common.base;

public class CaseFormatTest {
}

From console:

Exception in thread "SymbolicExecution" java.lang.NullPointerException: classId.jClass.enumConstants must not be null
	at org.utbot.fuzzer.providers.EnumModelProvider$generate$1.invokeSuspend(EnumModelProvider.kt:18)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:140)
	at org.utbot.fuzzer.ModelProvider$Combined$generate$1.invokeSuspend(ModelProvider.kt:143)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:140)
	at org.utbot.fuzzer.FuzzerKt.fuzz(Fuzzer.kt:76)
	at org.utbot.fuzzer.providers.ObjectModelProvider$Companion.fuzzParameters(ObjectModelProvider.kt:173)
	at org.utbot.fuzzer.providers.ObjectModelProvider$Companion.access$fuzzParameters(ObjectModelProvider.kt:145)
	at org.utbot.fuzzer.providers.ObjectModelProvider$generate$1.invokeSuspend(ObjectModelProvider.kt:82)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:140)
	at org.utbot.fuzzer.ModelProvider$Combined$generate$1.invokeSuspend(ModelProvider.kt:143)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:140)
	at org.utbot.fuzzer.FuzzerKt.fuzz(Fuzzer.kt:76)
	at org.utbot.engine.UtBotSymbolicEngine$fuzzing$2.invokeSuspend(UtBotSymbolicEngine.kt:426)
	at org.utbot.engine.UtBotSymbolicEngine$fuzzing$2.invoke(UtBotSymbolicEngine.kt)
	at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
	at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:212)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$flattenConcat$$inlined$unsafeFlow$1$lambda$1.emit(Collect.kt:134)
	at kotlinx.coroutines.flow.FlowKt__BuildersKt$flowOf$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:114)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$flattenConcat$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:114)
	at org.utbot.contest.ContestKt$runGeneration$1$invokeSuspend$$inlined$bracket$lambda$1$1.invokeSuspend(Contest.kt:519)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)

Additional context

Was working ok in main on 11.07.2022

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-fuzzingIssue is related to the fuzzingctg-bugIssue is a bug

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions