You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java 11 feature
Test generation for method Collection.toArray(T[] a) fails with RuntimeException: at soot.Scene.getSootClass
To Reproduce
Steps to reproduce the behavior:
Define JDK-11 as primary (Path, JAVA_HOME)
Open IntelliJ IDEA
Plugin is installed
A Maven project is opened with SDK 11 used
Add a class using Collection.toArray(T[] a) - with NON-empty array, like that:
import java.util.List;
public class CollectionToArrayExample {
public void method() {
List<String> list = List.of("uno", "trez", "quatro");
Object[] strings1 = list.toArray();
String[] strings2a = list.toArray(new String[list.size()]);
String[] strings2b = list.toArray(new String[0]);
for (Object str : strings2a) {
System.out.println(str);
}
}
}
Expected behavior
Tests are supposed to be generated.
Actual behavior
The following exception is thrown and displayed as error in IDE:
java.lang.RuntimeException:
Aborting: can't find classfile java.lang.Object
at soot.Scene.getSootClass(Scene.java:1176)
at org.utbot.engine.TypeResolverKt.getOBJECT_TYPE(TypeResolver.kt:316)
at org.utbot.engine.ExtensionsKt.isJavaLangObject(Extensions.kt:134)
at org.utbot.engine.pc.Z3TranslatorVisitor.filterInappropriateTypes(Z3TranslatorVisitor.kt:210)
at org.utbot.engine.pc.Z3TranslatorVisitor.visit(Z3TranslatorVisitor.kt:165)
at org.utbot.engine.pc.Z3TranslatorVisitor.visit(Z3TranslatorVisitor.kt:35)
at org.utbot.engine.pc.UtIsExpression.accept(UtExpression.kt:349)
at org.utbot.engine.pc.Z3TranslatorVisitor.translate(Z3TranslatorVisitor.kt:49)
at org.utbot.engine.pc.UtSolver.check(UtSolver.kt:228)
at org.utbot.engine.selectors.BasePathSelector.checkUnsat(BasePathSelector.kt:64)
at org.utbot.engine.selectors.BasePathSelector.checkUnsatIfFork(BasePathSelector.kt:70)
at org.utbot.engine.selectors.BasePathSelector.poll(BasePathSelector.kt:83)
at org.utbot.engine.UtBotSymbolicEngine$traverseImpl$1.invokeSuspend(UtBotSymbolicEngine.kt:509)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at org.utbot.common.ConcurrencyKt.runBlockingWithCancellationPredicate(Concurrency.kt:38)
at org.utbot.framework.plugin.api.UtBotTestCaseGenerator$generateForSeveralMethods$4.invoke(UtBotTestCaseGenerator.kt:279)
at org.utbot.framework.plugin.api.UtBotTestCaseGenerator$generateForSeveralMethods$4.invoke(UtBotTestCaseGenerator.kt:56)
at org.utbot.common.ConcurrencyKt.runIgnoringCancellationException(Concurrency.kt:47)
at org.utbot.framework.plugin.api.UtBotTestCaseGenerator.generateForSeveralMethods(UtBotTestCaseGenerator.kt:278)
at org.utbot.framework.plugin.api.UtBotTestCaseGenerator.generateForSeveralMethods$default(UtBotTestCaseGenerator.kt:265)
at org.utbot.intellij.plugin.generator.CodeGenerator.generateForSeveralMethods(CodeGenerator.kt:55)
at org.utbot.intellij.plugin.ui.UtTestsDialogProcessor$createTests$2$1.run(UtTestsDialogProcessor.kt:174)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Additional context
Only the first run of the test generation crashes.
The text was updated successfully, but these errors were encountered:
Cannot reproduce the error but another bug is discovered - no executions are generated because List#of returns real List instead of UT wrapper UtArrayList. Fixed in #400
Description
Java 11 feature
Test generation for method Collection.toArray(T[] a) fails with RuntimeException: at soot.Scene.getSootClass
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Tests are supposed to be generated.
Actual behavior
The following exception is thrown and displayed as error in IDE:
Additional context
Only the first run of the test generation crashes.
The text was updated successfully, but these errors were encountered: