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

Uncatched null pointer in URLConnection.getContent()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-libs
    • x86
    • windows_nt



      Name: skT45625 Date: 08/09/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      java.lang.NullPointerException
              at java.net.URLConnection.stripOffParameters(URLConnection.java:1016)
              at java.net.URLConnection.getContentHandler(URLConnection.java:984)
              at java.net.URLConnection.getContent(URLConnection.java:559)

      The code at 984 is:
      String contentType = stripOffParameters(getContentType());
      ContentHandler handler = null;
      if (contentType == null) // <=== SIGH! Too late
      throw new UnknownServiceException("no content-type");
      stripOffParameters goes:
              int index = contentType.indexOf(';');
      which throws the NULLPointerException
      (Review ID: 108152)
      ======================================================================

            michaelm Michael McMahon
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: