Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4758978

NoClassDefFoundError at (int[])_array.clone()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.4.0
    • hotspot
    • x86
    • windows_2000



      Name: gm110360 Date: 10/07/2002


      FULL PRODUCT VERSION :
      java version "1.4.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
      Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)


      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      In the implementation of the table model row sorter
      (shuttle sort), an attempt to clone() an array of integers
      throws a "java.lang.ClassDefNotFoundError: int[]". This
      popped up after development of unrelated code within the
      same package. The call was never the cause of an error in
      the past, and no change in the JRE preceded the bug. The
      identical bug also occurred on a different JRE, and a
      different OS when using the same package of code.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.NoClassDefFoundError: int[]
      at sagespace.plugins.sage.LibraryLoader.<init>(LibraryLoader.java:39)
      at sagespace.plugins.sage.SAGEToolBar.menu__actionPerformed
      (SAGEToolbar.java:749)
      at sagespace.plugins.sage.SAGEToolBar.access$1(SAGEToolbar.java:70)
      at sagespace.plugins.sage.SAGEToolBar$3.actionPerformed
      (SAGEToolbar.java:420)
      at javax.swing.AbstractButton.fireActionPerformed
      (AbstractButton.java:1767)
      at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed
      (AbstractButton.java:1820)
      at javax.swing.DefaultButtonModel.fireActionPerformed
      (DefaultButtonModel.java:419)
      at javax.swing.DefaultButtonModel.setPressed
      (DefaultButtonModel.java:257)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased
      (BasicButtonListener.java:258)
      at java.awt.AWTEventMulticaster.mouseReleased
      (AWTEventMulticaster.java:227)
      at java.awt.Component.processMouseEvent(Component.java:5021)
      at java.awt.Component.processEvent(Component.java:4818)
      at java.awt.Container.processEvent(Container.java:1525)
      at java.awt.Component.dispatchEventImpl(Component.java:3526)
      at java.awt.Container.dispatchEventImpl(Container.java:1582)
      at java.awt.Component.dispatchEvent(Component.java:3367)
      at java.awt.LightweightDispatcher.retargetMouseEvent
      (Container.java:3359)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3074)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3004)
      at java.awt.Container.dispatchEventImpl(Container.java:1568)
      at java.awt.Window.dispatchEventImpl(Window.java:1581)
      at java.awt.Component.dispatchEvent(Component.java:3367)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy
      (EventDispatchThread.java:191)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy
      (EventDispatchThread.java:144)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)



      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Isolated the problem as follows: in the above stack trace, the LibraryLoader
      object contains:

      public class LibraryLoader extends JInternalFrame {
        private MyDataSet _dataset = new MyDataSet( Library.class );
      }

      which, when removed, stops the error. Within MyDataSet, the following, is the
      source of the error:

      public class MyDataSet implements TableModel {
        private int[] _indexes;
        private void sort() {
          checkModel();
          _compares = 0;
          shuttlesort( (int[])_indexes.clone(), _indexes, 0, _indexes.length );
        }
      }

      The specific problem is the (int[])_indexes.clone() call. The stack trace was
      never specific in identifying this as the problem.
      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      Replacing:
      shuttlesort( (int[])_indexes.clone(), _indexes, 0,
      _indexes.length );

      with:
      int[] from = new int[_indexes.length];
      System.arraycopy( _indexes, 0, from, 0, from.length );
      shuttlesort( from, _indexes, 0, _indexes.length );

      solves the problem.
      (Review ID: 165461)
      ======================================================================

            collins Gary Collins (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: