Closed
Description
Description
IllegalStateException thrown in IDEA together with notification that generated file exceeds configured limit.
It is about UtUtils.java exceeds configured limit.
To Reproduce
- In
~/.utbot/settings.properties
: setmaxTestFileSize=1000
- Install latest build from main into IDEA 2022.2.3
- Open UTBotJava project
- Generate tests with 95% Symbolic execution for
StringExamples
Expected behavior
Only notification should be displayed for the user.
No exception should be thrown to IDEA.
Actual behavior
Together with notification
java.lang.IllegalStateException: Size of UtUtils.java exceeds configured limit (100 bytes), reformatting was skipped. The limit can be configured in '{HOME_DIR}/.utbot/settings.properties' with 'maxTestFileSize' property
Visual proofs (screenshots, logs, images)
The following exception is thrown:
java.lang.IllegalStateException: Size of UtUtils.java exceeds configured limit (100 bytes), reformatting was skipped. The limit can be configured in '{HOME_DIR}/.utbot/settings.properties' with 'maxTestFileSize' property
at org.utbot.intellij.plugin.ui.ErrorNotifier.notify(Notifications.kt:52)
at org.utbot.intellij.plugin.ui.Notifier.notify$default(Notifications.kt:28)
at org.utbot.intellij.plugin.generator.CodeGenerationController.reformat(CodeGenerationController.kt:755)
at org.utbot.intellij.plugin.generator.CodeGenerationController.access$reformat(CodeGenerationController.kt:100)
at org.utbot.intellij.plugin.generator.CodeGenerationController$createOrUpdateUtilClass$1.run(CodeGenerationController.kt:338)
at com.intellij.openapi.command.WriteCommandAction.lambda$runWriteCommandAction$4(WriteCommandAction.java:362)
at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$1(WriteCommandAction.java:150)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1023)
at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$2(WriteCommandAction.java:148)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:184)
at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.doRunWriteCommandAction(WriteCommandAction.java:157)
at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:124)
at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:362)
at org.utbot.intellij.plugin.generator.CodeGenerationController.createOrUpdateUtilClass(CodeGenerationController.kt:337)
at org.utbot.intellij.plugin.generator.CodeGenerationController.createUtilityClassIfNeed(CodeGenerationController.kt:246)
at org.utbot.intellij.plugin.generator.CodeGenerationController.access$createUtilityClassIfNeed(CodeGenerationController.kt:100)
at org.utbot.intellij.plugin.generator.CodeGenerationController$generateTests$2$1$1$1.run(CodeGenerationController.kt:170)
at org.utbot.intellij.plugin.util.IntelliJApiHelper$run$wrapper$1.run(IntelliJApiHelper.kt:31)
at org.utbot.intellij.plugin.util.IntelliJApiHelper$run$$inlined$runWriteAction$1.compute(actions.kt:60)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runWriteAction$13(ApplicationImpl.java:1032)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:1011)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1032)
at org.utbot.intellij.plugin.util.IntelliJApiHelper.run(IntelliJApiHelper.kt:67)
at org.utbot.intellij.plugin.generator.CodeGenerationController$generateTests$2$1$1.run(CodeGenerationController.kt:169)
at org.utbot.intellij.plugin.util.IntelliJApiHelper$run$wrapper$1.run(IntelliJApiHelper.kt:31)
at org.utbot.intellij.plugin.util.IntelliJApiHelper$run$$inlined$invokeLater$1.run(ApplicationUtils.kt:94)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:513)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:75)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:118)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:918)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:766)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:450)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:449)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:624)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:447)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Environment
Windows 10 Pro
IntelliJ IDEA 2022.2.3
Metadata
Metadata
Assignees
Type
Projects
Status
Done