Skip to content

IllegalStateException is thrown in IDEA together with notification that file exceeds configured limit #1295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alisevych opened this issue Nov 2, 2022 · 0 comments · Fixed by #1311
Assignees
Labels
ctg-bug Issue is a bug priority-top-focus Top priority chosen by dev team

Comments

@alisevych
Copy link
Member

alisevych commented Nov 2, 2022

Description

IllegalStateException thrown in IDEA together with notification that generated file exceeds configured limit.
It is about UtUtils.java exceeds configured limit.

To Reproduce

  1. In ~/.utbot/settings.properties: set maxTestFileSize=1000
  2. Install latest build from main into IDEA 2022.2.3
  3. Open UTBotJava project
  4. 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

@alisevych alisevych added the ctg-bug Issue is a bug label Nov 2, 2022
@korifey korifey moved this to Todo in UTBot Java Nov 2, 2022
@alisevych alisevych added this to the 2022.11 Release milestone Nov 2, 2022
@alisevych alisevych changed the title IllegalStateException about UtUtils.java exceeds configured limit is thrown in IDEA IllegalStateException is thrown in IDEA together with notification that file exceeds configured limit Nov 2, 2022
@Vassiliy-Kudryashov Vassiliy-Kudryashov moved this from Todo to In Progress in UTBot Java Nov 3, 2022
Vassiliy-Kudryashov added a commit that referenced this issue Nov 3, 2022
Vassiliy-Kudryashov added a commit that referenced this issue Nov 8, 2022
#1311)

IllegalStateException is thrown in IDEA together with notification that file exceeds configured limit #1295
Repository owner moved this from In Progress to Done in UTBot Java Nov 8, 2022
@alisevych alisevych added the priority-top-focus Top priority chosen by dev team label Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-bug Issue is a bug priority-top-focus Top priority chosen by dev team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants