Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-6286

trying to indent throws java.lang.NoSuchMethodError exception

    XMLWordPrintableJSON

Details

    Description

      I opened an existing project and hit Enter to start a new line, which threw an error. Unexpectedly the new line did not have the indentation level of the previous line.

      I hit Tab to indent the line, and the line did not indent, instead throwing the error again.

      I went to Tools > Options > Editor > Formatting to check my Tabs and Indents settings, which threw the error again as I opened the Formatting tab.

      I tried again in other class files and even making a new project. I closed and reopened the project, and closed and reopened NetBeans. Attempting to indent lines seems to never work and always throw this error. I am only able to indent lines of code by manually hitting the spacebar, copypasting space characters, or using the Source > Format menu option.

      I have even tried deleting my "userdir" at %appdata%\NetBeans\12.6 which did not fix the issue.

      Needless to say, creating and indenting new lines of code is something a developer must do often, so I consider this a nontrivial issue and it significantly slows my workflow.

      A message in the IDE each time encouraged me to report this issue here, so here I am. I hope I have submitted this issue correctly, but I am new to JIRA, so please forgive mistakes.

      Here is a stack trace:

      java.lang.NoSuchMethodError: java.nio.CharBuffer.flip()Ljava/nio/CharBuffer;
          at org.netbeans.modules.java.source.parsing.FileObjects.memoryFileObject(FileObjects.java:516)
          at org.netbeans.modules.java.source.parsing.FileObjects.memoryFileObject(FileObjects.java:490)
          at org.netbeans.modules.java.source.save.Reindenter.initRegionData(Reindenter.java:268)
          at org.netbeans.modules.java.source.save.Reindenter.reindent(Reindenter.java:121)
          at org.netbeans.modules.editor.indent.TaskHandler$MimeItem.runTask(TaskHandler.java:548)
          at org.netbeans.modules.editor.indent.TaskHandler.runTasks(TaskHandler.java:309)
          at org.netbeans.modules.editor.indent.IndentImpl.reindent(IndentImpl.java:282)
          at org.netbeans.modules.editor.indent.api.Indent.reindent(Indent.java:146)
          at org.netbeans.modules.editor.indent.api.Indent.reindent(Indent.java:130)
          at org.netbeans.editor.BaseKit$InsertBreakAction.performLineBreakInsertion(BaseKit.java:1624)
          at org.netbeans.editor.BaseKit$InsertBreakAction.access$400(BaseKit.java:1439)
          at org.netbeans.editor.BaseKit$InsertBreakAction$2.run(BaseKit.java:1529)
          at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:333)
          at org.netbeans.editor.BaseKit$InsertBreakAction.actionPerformed(BaseKit.java:1520)
          at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:322)
          at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1663)
          at javax.swing.JComponent.processKeyBinding(JComponent.java:2882)
          at javax.swing.JComponent.processKeyBindings(JComponent.java:2929)
          at javax.swing.JComponent.processKeyEvent(JComponent.java:2845)
          at java.awt.Component.processEvent(Component.java:6310)
          at java.awt.Container.processEvent(Container.java:2236)
          at java.awt.Component.dispatchEventImpl(Component.java:4889)
          at java.awt.Container.dispatchEventImpl(Container.java:2294)
          at java.awt.Component.dispatchEvent(Component.java:4711)
          at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
          at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
          at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
          at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
          at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
          at java.awt.Component.dispatchEventImpl(Component.java:4760)
          at java.awt.Container.dispatchEventImpl(Container.java:2294)
          at java.awt.Window.dispatchEventImpl(Window.java:2746)
          at java.awt.Component.dispatchEvent(Component.java:4711)
          at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
          at java.awt.EventQueue.access$500(EventQueue.java:97)
          at java.awt.EventQueue$3.run(EventQueue.java:709)
          at java.awt.EventQueue$3.run(EventQueue.java:703)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
          at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
          at java.awt.EventQueue$4.run(EventQueue.java:731)
          at java.awt.EventQueue$4.run(EventQueue.java:729)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
          at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
          at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
      [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
          at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
          at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
          at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

      Attachments

        1. messages-2.log
          193 kB
          Jason Mayeaux

        Issue Links

          Activity

            People

              Unassigned Unassigned
              JasonMayeaux Jason Mayeaux
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: