Skip to content
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

Exception when reopening included file saved in separate window #2123

Open
brandesNW opened this issue Jul 7, 2023 · 1 comment
Open

Exception when reopening included file saved in separate window #2123

brandesNW opened this issue Jul 7, 2023 · 1 comment

Comments

@brandesNW
Copy link
Contributor

  1. Open a model with an included file
  2. Go to the Code tab.
  3. Click checkbox to open Code Tab in separate window.
  4. Open a tab for an included file.
  5. Make changes in the file buffer.
  6. Close the separate window (on MacOS click the upper left-hand red button)

An exception occurs

Truncated stack trace:
java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 3
at java.base/jdk.internal.util.Preconditions.outOfBounds(Unknown Source)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Unknown Source)
at java.base/jdk.internal.util.Preconditions.checkIndex(Unknown Source)
at java.base/java.util.Objects.checkIndex(Unknown Source)
at java.base/java.util.ArrayList.get(Unknown Source)
at java.desktop/javax.swing.JTabbedPane.setForegroundAt(Unknown Source)
at org.nlogo.app.Tabs.clearForeground$1(Tabs.scala:204)
at org.nlogo.app.Tabs.$anonfun$handle$4(Tabs.scala:209)
at org.nlogo.app.Tabs.$anonfun$handle$4$adapted(Tabs.scala:209)
at scala.collection.mutable.HashSet.foreach(HashSet.scala:79)
at org.nlogo.app.Tabs.forAllCodeTabs(Tabs.scala:328)
at org.nlogo.app.Tabs.clearErrors$1(Tabs.scala:209)
at org.nlogo.app.Tabs.handle(Tabs.scala:233)
at org.nlogo.window.Events$CompiledEvent.beHandledBy(Events.java:223)
at org.nlogo.window.Event.doRaise(Event.java:206)
at org.nlogo.window.Event.raise(Event.java:122)
at org.nlogo.window.CompilerManager$.$anonfun$$lessinit$greater$default$4$1(CompilerManager.scala:20)
at org.nlogo.window.CompilerManager$.$anonfun$$lessinit$greater$default$4$1$adapted(CompilerManager.scala:20)
at org.nlogo.window.CompilerManager.raiseEvent(CompilerManager.scala:34)
at org.nlogo.window.CompilerManager.compileProcedures(CompilerManager.scala:221)
at org.nlogo.window.CompilerManager.compileAll(CompilerManager.scala:173)
at org.nlogo.window.CompilerManager.handle(CompilerManager.scala:137)
at org.nlogo.window.Events$CompileAllEvent.beHandledBy(Events.java:185)
at org.nlogo.window.Event.doRaise(Event.java:206)
at org.nlogo.window.Event.raise(Event.java:122)
at org.nlogo.app.codetab.CodeTab.compile(CodeTab.scala:163)
at org.nlogo.app.codetab.CodeTab.handle(CodeTab.scala:144)
at org.nlogo.app.codetab.TemporaryCodeTab.handle(TemporaryCodeTab.scala:130)
at org.nlogo.app.common.Events$SwitchedTabsEvent.beHandledBy(Events.java:41)
at org.nlogo.window.Event.doRaise(Event.java:206)
at org.nlogo.window.Event.raise(Event.java:122)
at org.nlogo.app.CodeTabsPanel.stateChanged(CodeTabsPanel.scala:105)
at java.desktop/javax.swing.JTabbedPane.fireStateChanged(Unknown Source)
at java.desktop/javax.swing.JTabbedPane$ModelListener.stateChanged(Unknown Source)
at java.desktop/javax.swing.DefaultSingleSelectionModel.fireStateChanged(Unknown Source)
at java.desktop/javax.swing.DefaultSingleSelectionModel.setSelectedIndex(Unknown Source)
at java.desktop/javax.swing.JTabbedPane.setSelectedIndexImpl(Unknown Source)
at java.desktop/javax.swing.JTabbedPane.removeTabAt(Unknown Source)
at java.desktop/javax.swing.JTabbedPane.remove(Unknown Source)
at java.desktop/java.awt.Container.addImpl(Unknown Source)
at java.desktop/javax.swing.JTabbedPane.insertTab(Unknown Source)
at java.desktop/javax.swing.JTabbedPane.addTab(Unknown Source)
at java.desktop/javax.swing.JTabbedPane.add(Unknown Source)
at org.nlogo.app.AppTabManager.$anonfun$switchToNoSeparateCodeWindow$1(AppTabManager.scala:258)
at org.nlogo.app.AppTabManager.$anonfun$switchToNoSeparateCodeWindow$1$adapted(AppTabManager.scala:257)
at scala.collection.immutable.Range.foreach(Range.scala:158)
at org.nlogo.app.AppTabManager.switchToNoSeparateCodeWindow(AppTabManager.scala:257)
at org.nlogo.app.CodeTabsPanel$$anon$2.windowClosing(CodeTabsPanel.scala:86)

@LaCuneta
Copy link
Contributor

This looks like slightly different steps to produce #2104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants