[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#508643: marked as done (libgcj9-0: URI.equals() fails with NullPointerException)



Your message dated 
with message-id <20100713184531.10815.63133.mass-bugs-close@merkel.debian.org>
and subject line gcj-4.3 removed from Debian unstable
has caused the Debian Bug report #508643,
regarding libgcj9-0: URI.equals() fails with NullPointerException
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
508643: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508643
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libgcj9-0
Version: 4.3.2-2
Severity: normal

Hi,

import java.net.URI;

public class Test
{
    public static void main(String arg[])
      throws Exception
    {
        String a = "http://example.org/path";;
        String b = "http://example.org/path?q=query";;

        URI ua = new URI(a);
        URI ub = new URI(b);

        System.out.println( ua.equals(ub) );
    }
}

% javac Test.java && java Test
Exception in thread "main" java.lang.NullPointerException
   at java.net.URI.equals(URI.java:1215)
   at Test.main(Test.java:14)

I think the problem is in these lines:

    else if (!opaqueThis && !opaqueObj)
      {
        boolean common = rawPath.equalsIgnoreCase(uriObj.getRawPath())
->        && ((rawQuery == null && uriObj.getRawQuery() == null)
->            || rawQuery.equalsIgnoreCase(uriObj.getRawQuery()));
        if (rawAuthority == null && uriObj.getRawAuthority() == null)
          return common;

In ua.rawQuery is null but ub.rawQuery is not, so the expression in the
brace evaluates to false and the righthand side gets evaluated with
dereferences ua.rawQuery and this causes the NullPointerException. I
think you have to write something like this:

          && (rawQuery == uriObj.getRawQuery()
              || (rawQuery != null
                  && rawQuery.equalsIgnoreCase(uriObj.getRawQuery())));

Bye, Jörg.

-- System Information:
Debian Release: unstable/experimental
  APT prefers unstable
  APT policy: (900, 'unstable'), (700, 'experimental')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.28-rc7
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to de_DE.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libgcj9-0 depends on:
ii  gcj-4.3-base           4.3.2-2           The GNU Compiler Collection (gcj b
ii  libasound2             1.0.16-2          ALSA library
ii  libc6                  2.7-16            GNU C Library: Shared libraries
ii  libgcc1                1:4.3.2-1         GCC support library
ii  libgcj-common          1:4.3.2-2         Java runtime library (common files
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

Versions of packages libgcj9-0 recommends:
ii  libgcj9-0-awt                 4.3.2-2    AWT peer runtime libraries for use
ii  libgcj9-jar                   4.3.2-2    Java runtime library for use with 

Versions of packages libgcj9-0 suggests:
ii  libgcj9-dbg                   4.3.2-2    Debugging symbols for libraries pr

-- no debconf information

Attachment: signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


--- End Message ---
--- Begin Message ---
Version: 4.3.4-4+rm

gcj-4.3 has been removed from Debian unstable: http://bugs.debian.org/577262

Closing its bugs with a Version higher than the last unstable upload.

More information about this script at:
  http://git.debian.org/?p=users/morph/mass-bugs-close.git;a=blob_plain;f=README;hb=HEAD


--- End Message ---

Reply to: