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

Constructor GapContent(int i) throws NPE when i = 1

XMLWordPrintable

    • 1.2.2
    • sparc
    • solaris_2.5



      Name: vsC58871 Date: 08/21/98


      com.sun.java.swing.text.GapContent constuctor GapContent(int i)
      throws NullPointerException when i = 1.

      Here is the example demonstrating the bug:
      ----------------Test.java---------------------
      import com.sun.java.swing.text.*;

      public class Test {
          public static void main(String[] args){
      try {
      GapContent gc = new GapContent(1);
      } catch (Throwable e) {
      e.printStackTrace();
      }
          }
      }

      -- The output ----------------
      #>java -version
      java version "1.2fcs"
      Classic VM (build JDK-1.2fcs-G, green threads, sunwjit)
      [vvs@knight:483] -- << ~/work/BugExamples/GapContent >>
      #>java Test
      java.lang.NullPointerException
              at com.sun.java.swing.text.GapContent.findMarkAdjustIndex(Compiled
      Code)
              at com.sun.java.swing.text.GapContent.shiftEnd(Compiled Code)
              at com.sun.java.swing.text.GapVector.open(Compiled Code)
              at com.sun.java.swing.text.GapVector.replace(Compiled Code)
              at com.sun.java.swing.text.GapContent.<init>(Compiled Code)
              at Test.main(Compiled Code)
      ------------------------------

      ======================================================================

            tprinzing Tim Prinzing (Inactive)
            vsizikov Vladimir Sizikov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: