Java method getEntry in class ZipFile calls a native method which return null (it should not since Jar file contains the entry !)

Bug #795914 reported by dag
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

There is a problem with the Java native method:

private static native long getEntry(long jzfile, String name,
                                        boolean addSlash);

it returns null although I pass name of a class file which I know for sure is located in the Jar file (the ZipFile).

This native method is called from the method : public ZipEntry getEntry(String name)
which is in the class java.util.zip.ZipFile;

This method looks like:

 /**
     * Returns the zip file entry for the specified name, or null
     * if not found.
     *
     * @param name the name of the entry
     * @return the zip file entry, or null if not found
     * @throws IllegalStateException if the zip file has been closed
     */
    public ZipEntry getEntry(String name) {
        if (name == null) {
            throw new NullPointerException("name");
        }
        long jzentry = 0;
        synchronized (this) {
            ensureOpen();
            jzentry = getEntry(jzfile, name, true);
            if (jzentry != 0) {
                ZipEntry ze = new ZipEntry(name, jzentry);
                freeEntry(jzfile, jzentry);
                return ze;
            }
        }
        return null;
    }

I tried different jdks but all have this problem:

1. java-6-openjdk
2. jdk1.6.0_26
3. j2sdk1.4.1_07

I believe that since this is a native problem then it must be an Ubuntu problem and not java's "fault"

Please advise:

thanks

Dag

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: openjdk-6-jdk 6b20-1.9.7-0ubuntu1~10.04.1
ProcVersionSignature: Ubuntu 2.6.32-32.62-generic 2.6.32.38+drm33.16
Uname: Linux 2.6.32-32-generic i686
Architecture: i386
Date: Sat Jun 11 14:57:32 2011
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release i386 (20100816.1)
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: openjdk-6

Revision history for this message
dag (jer1117) wrote :
Revision history for this message
dag (jer1117) wrote :

I found the problem and fixed it.
Please remove this bug report

Dag

Revision history for this message
dino99 (9d9) wrote :

Closing that outdated report as EOL has been reached long time ago

Changed in openjdk-6 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.