Title: Concrete execution exceptions for Collection
Open Graph Title: Concrete execution exceptions for Collection
X Title: Concrete execution exceptions for Collection
Description: Description NoSuchElementException and NullPointerException are thrown from concrete executions by symbolic engine of a method with Collection
Open Graph Description: Description NoSuchElementException and NullPointerException are thrown from concrete executions by symbolic engine of a method with Collection
X Description: Description NoSuchElementException and NullPointerException are thrown from concrete executions by symbolic engine of a method with Collection<Collection> as input. To Reproduce Install one o...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/1020
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Concrete execution exceptions for Collection\u003cCollection\u003cDouble\u003e\u003e","articleBody":"**Description**\r\n\r\nNoSuchElementException and NullPointerException are thrown from concrete executions by symbolic engine of a method with Collection\u003cCollection\u003cDouble\u003e\u003e as input.\r\n\r\n**To Reproduce**\r\n\r\n1. Install one of the latest plugin build from main on IntelliJ Idea 2022.1.4\r\n2. Symbolic execution is on\r\n3. Add the following method to a Java class:\r\n\r\n```java\r\npublic static boolean isDiagonal(Collection\u003cCollection\u003cDouble\u003e\u003e matrix) {\r\n int cols = matrix.size();\r\n if (cols \u003c= 1) {\r\n return false;\r\n }\r\n int i = 0;\r\n for (Collection\u003cDouble\u003e col : matrix) {\r\n if (col.size() != cols) {\r\n return false;\r\n }\r\n int j = 0;\r\n for (Double value : col) {\r\n if (i == j \u0026\u0026 value == 0.0) return false;\r\n if (i != j \u0026\u0026 value != 0.0) return false;\r\n j++;\r\n }\r\n i++;\r\n }\r\n return true;\r\n }\r\n\r\n```\r\n4. Generate tests with UTBot symbolic execution\r\n\r\n**Expected behavior**\r\n\r\nTests are supposed to be generated.\r\n\r\n**Actual behavior**\r\n\r\nAn error test is generated with information about errors in the concrete executor.\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eExceptions in concrete execution logs\u003c/summary\u003e\r\n\r\n```java\r\n18:18:25.437 ERROR| java.util.NoSuchElementException\r\n\tat java.base/java.util.Vector$Itr.next(Vector.java:1280)\r\n\tat java.base/java.util.AbstractList.hashCode(AbstractList.java:566)\r\n\tat java.base/java.util.Vector.hashCode(Vector.java:1106)\r\n\tat java.base/java.util.HashMap.hash(HashMap.java:340)\r\n\tat java.base/java.util.HashMap.put(HashMap.java:608)\r\n\tat java.base/java.util.HashSet.add(HashSet.java:220)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\r\n\tat org.utbot.common.KClassUtilKt.invokeCatching(KClassUtil.kt:10)\r\n\tat org.utbot.framework.concrete.MockValueConstructor$call$1.invoke(MockValueConstructor.kt:478)\r\n\tat org.utbot.framework.concrete.MockValueConstructor$call$1.invoke(MockValueConstructor.kt:477)\r\n\tat org.utbot.instrumentation.process.SecurityKt$runSandbox$1$1.invoke(Security.kt:38)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$1.invoke(Security.kt:61)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$2.invoke(Security.kt:77)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$3.invoke(Security.kt:82)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$4.run(Security.kt:88)\r\n\tat java.base/java.security.AccessController.doPrivileged(Native Method)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:88)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:82)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:77)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:61)\r\n\tat org.utbot.instrumentation.process.SecurityKt.runSandbox(Security.kt:38)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.call(MockValueConstructor.kt:477)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.updateWithExecutableCallModel(MockValueConstructor.kt:420)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.constructFromAssembleModel(MockValueConstructor.kt:370)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.construct(MockValueConstructor.kt:132)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.constructMethodParameters(MockValueConstructor.kt:107)\r\n\tat org.utbot.framework.concrete.UtExecutionInstrumentation.invoke(UtExecutionInstrumentation.kt:156)\r\n\tat org.utbot.framework.concrete.UtExecutionInstrumentation.invoke(UtExecutionInstrumentation.kt:118)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$setup$2.invoke(ChildProcess.kt:211)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$setup$2.invoke(ChildProcess.kt:208)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$2$1$1.invoke(ChildProcess.kt:190)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$1.invokeSuspend(ChildProcess.kt:174)\r\n\tat kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)\r\n\tat kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)\r\n\tat kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)\r\n\tat kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)\r\n\tat kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)\r\n\tat kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)\r\n\tat kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)\r\n\tat kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt.measureExecutionForTermination(ChildProcess.kt:171)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt.access$measureExecutionForTermination(ChildProcess.kt:1)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$2$1.invokeSuspend(ChildProcess.kt:188)\r\n\tat kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)\r\n\tat kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)\r\n\tat kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)\r\n\tat kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)\r\n\tat kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)\r\n\tat kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)\r\n\tat kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)\r\n\tat kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$2.invoke(ChildProcess.kt:187)\r\n\tat com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182)\r\n\tat com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182)\r\n\tat com.jetbrains.rd.framework.impl.RdCall.onWireReceived(RdTask.kt:360)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:57)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:56)\r\n\tat com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:148)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:56)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:54)\r\n\tat com.jetbrains.rd.util.threading.SingleThreadSchedulerBase.queue$lambda-3(SingleThreadScheduler.kt:41)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\r\n\tat java.base/java.lang.Thread.run(Thread.java:829)\r\nWARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users/lWX1182794/AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.9.368.jar) to field java.util.Vector.elementData\r\nWARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users/lWX1182794/AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.9.368.jar) to field java.util.Vector.elementCount\r\nWARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users/lWX1182794/AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.9.368.jar) to field java.util.Vector.capacityIncrement\r\nWARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users/lWX1182794/AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.9.368.jar) to field java.util.AbstractList.modCount\r\nWARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users/lWX1182794/AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.9.368.jar) to field java.util.IdentityHashMap$Values.this$0\r\nWARNING: Illegal reflective access by org.utbot.framework.concrete.UtModelConstructor (file:/C:/Users/lWX1182794/AppData/Roaming/JetBrains/IntelliJIdea2022.1/plugins/utbot-intellij/lib/utbot-framework-2022.9.368.jar) to field java.lang.ProcessEnvironment$CheckedValues.c\r\n18:18:25.515 ERROR| java.lang.NullPointerException\r\n\tat java.base/java.util.Vector.elementData(Vector.java:762)\r\n\tat java.base/java.util.Vector$Itr.next(Vector.java:1282)\r\n\tat java.base/java.util.AbstractList.hashCode(AbstractList.java:566)\r\n\tat java.base/java.util.Vector.hashCode(Vector.java:1106)\r\n\tat java.base/java.util.HashMap.hash(HashMap.java:340)\r\n\tat java.base/java.util.HashMap.put(HashMap.java:608)\r\n\tat java.base/java.util.HashSet.add(HashSet.java:220)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\r\n\tat org.utbot.common.KClassUtilKt.invokeCatching(KClassUtil.kt:10)\r\n\tat org.utbot.framework.concrete.MockValueConstructor$call$1.invoke(MockValueConstructor.kt:478)\r\n\tat org.utbot.framework.concrete.MockValueConstructor$call$1.invoke(MockValueConstructor.kt:477)\r\n\tat org.utbot.instrumentation.process.SecurityKt$runSandbox$1$1.invoke(Security.kt:38)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$1.invoke(Security.kt:61)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$2.invoke(Security.kt:77)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$3.invoke(Security.kt:82)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$4.run(Security.kt:88)\r\n\tat java.base/java.security.AccessController.doPrivileged(Native Method)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:88)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:82)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:77)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:61)\r\n\tat org.utbot.instrumentation.process.SecurityKt.runSandbox(Security.kt:38)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.call(MockValueConstructor.kt:477)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.updateWithExecutableCallModel(MockValueConstructor.kt:420)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.constructFromAssembleModel(MockValueConstructor.kt:370)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.construct(MockValueConstructor.kt:132)\r\n\tat org.utbot.framework.concrete.MockValueConstructor.constructMethodParameters(MockValueConstructor.kt:107)\r\n\tat org.utbot.framework.concrete.UtExecutionInstrumentation.invoke(UtExecutionInstrumentation.kt:156)\r\n\tat org.utbot.framework.concrete.UtExecutionInstrumentation.invoke(UtExecutionInstrumentation.kt:118)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$setup$2.invoke(ChildProcess.kt:211)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$setup$2.invoke(ChildProcess.kt:208)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$2$1$1.invoke(ChildProcess.kt:190)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$1.invokeSuspend(ChildProcess.kt:174)\r\n\tat kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)\r\n\tat kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)\r\n\tat kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)\r\n\tat kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)\r\n\tat kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)\r\n\tat kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)\r\n\tat kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)\r\n\tat kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt.measureExecutionForTermination(ChildProcess.kt:171)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt.access$measureExecutionForTermination(ChildProcess.kt:1)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$2$1.invokeSuspend(ChildProcess.kt:188)\r\n\tat kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)\r\n\tat kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)\r\n\tat kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)\r\n\tat kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)\r\n\tat kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)\r\n\tat kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)\r\n\tat kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)\r\n\tat kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)\r\n\tat org.utbot.instrumentation.process.ChildProcessKt$measureExecutionForTermination$2.invoke(ChildProcess.kt:187)\r\n\tat com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182)\r\n\tat com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182)\r\n\tat com.jetbrains.rd.framework.impl.RdCall.onWireReceived(RdTask.kt:360)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:57)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:56)\r\n\tat com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:148)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:56)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:54)\r\n\tat com.jetbrains.rd.util.threading.SingleThreadSchedulerBase.queue$lambda-3(SingleThreadScheduler.kt:41)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\r\n\tat java.base/java.lang.Thread.run(Thread.java:829)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n**Visual proofs (screenshots, logs, images)**\r\n\r\n~~~java\r\n///region Errors report for isDiagonal\r\n\r\n public void testIsDiagonal_errors() {\r\n // Couldn't generate some tests. List of errors:\r\n // \r\n // 4 occurrences of:\r\n // Concrete execution failed\r\n\r\n }\r\n ///endregion\r\n~~~\r\n\r\n**Environment**\r\n\r\nWindows 10 Pro\r\nJDK 11\r\nGradle\r\n\r\n**Additional context**\r\n\r\nIn Fuzzing only mode correct tests are generated without concrete executions issues.\r\n\r\nFound on testing #988 ","author":{"url":"https://github.com/alisevych","@type":"Person","name":"alisevych"},"datePublished":"2022-09-27T15:53:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1020/UTBotJava/issues/1020"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:922c96ee-1d16-dbf2-5f2f-07c464e17179 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B4C:C2946:9FE93:D6E06:698E4434 |
| html-safe-nonce | 4c90a734ecc90aa368c282b6e6c78f6c5be8a87a3a6ea1dd454c0589f505e810 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjRDOkMyOTQ2OjlGRTkzOkQ2RTA2OjY5OEU0NDM0IiwidmlzaXRvcl9pZCI6IjIyNzU3NjU0MzIzMjAxNDg1MzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 050540bfdcf815be992b989ab37b39daf7b56dfabfa455f31a96b9bbce538b16 |
| hovercard-subject-tag | issue:1387991587 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/UnitTestBot/UTBotJava/1020/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b2a62dd95811fbc813d5732b32186868d33a39f16f9998b55ee161b5e7f97450/UnitTestBot/UTBotJava/issues/1020 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b2a62dd95811fbc813d5732b32186868d33a39f16f9998b55ee161b5e7f97450/UnitTestBot/UTBotJava/issues/1020 |
| og:image:alt | Description NoSuchElementException and NullPointerException are thrown from concrete executions by symbolic engine of a method with Collection |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alisevych |
| hostname | github.com |
| expected-hostname | github.com |
| None | a5632af64f7fed7bff1d6a428d1aca1b94fa7a48f760de2d39d9b1effdbf0082 |
| turbo-cache-control | no-preview |
| go-import | github.com/UnitTestBot/UTBotJava git https://github.com/UnitTestBot/UTBotJava.git |
| octolytics-dimension-user_id | 87413538 |
| octolytics-dimension-user_login | UnitTestBot |
| octolytics-dimension-repository_id | 480810501 |
| octolytics-dimension-repository_nwo | UnitTestBot/UTBotJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 480810501 |
| octolytics-dimension-repository_network_root_nwo | UnitTestBot/UTBotJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3dda52e29a416820ced574e74040033b820613a2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width