[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 Wed, 30 May 2012 10:27:27 +0000
with message-id <E1SZg7j-0006Zu-Jz@franck.debian.org>
and subject line Bug#674991: Removed package(s) from 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

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


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: 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.4.7-1+rm

Dear submitter,

as the package gcj-4.4 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see http://bugs.debian.org/674991

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing

Debian distribution maintenance software
Alexander Reichle-Schmehl (the ftpmaster behind the curtain)

--- End Message ---

Reply to: