[ http://issues.apache.org/jira/browse/DERBY-826?page=all ]

Andrew McIntyre updated DERBY-826:
----------------------------------

    Attachment: derby-826-v4.diff

Good catch, Bryan!

I'm attaching derby-826-v4.diff, which includes your changes plus the following:

- removes the check for z == null in the second loop of mergeZips(). We already 
checked that elements being added to the vector are not null in the first loop.

- catches possible NullPointerExceptions if loadZipFromResource() returns a 
null array. This is unlikely, but possible, if somehow sysinfo is able to run 
but is isolated from the info properties files so that it cannot load them 
using getResourceAsStream() or they don't exist. The corresponding diff in 
getAllInfo() is:

+        // No info properties files found, but here we are in sysinfo.
+        // Avoid an NPE in mergeZips by creating a ZipInfoProperties array
+        // with the location of the sysinfo that is currently executing.
+        if (zips == null)
+        {
+            zips = new ZipInfoProperties[1];
+            ZipInfoProperties zip = new 
ZipInfoProperties(ProductVersionHolder.getProductVersionHolderFromMyEnv(org.apache.derby.tools.sysinfo.TOOLS));
+            zip.setLocation(getFileWhichLoadedClass(new Main().getClass()));
+            zips[0] = zip;
+        }

This is looking pretty airtight. Do you see any other potential problems?

> sysinfo does not report the version of derby.jar if the class does not 
> explictly contain it.
> --------------------------------------------------------------------------------------------
>
>          Key: DERBY-826
>          URL: http://issues.apache.org/jira/browse/DERBY-826
>      Project: Derby
>         Type: Bug

>   Components: Tools
>     Versions: 10.2.0.0
>     Reporter: Daniel John Debrunner
>     Assignee: Andrew McIntyre
>     Priority: Minor
>  Attachments: derby-826-v3.diff, derby-826-v4.diff, derby-826.diff, 
> derby-826_v2.diff
>
> derby.jar is in the classpath here indirectly because derbynet.jar includes 
> it through a manifest entry.
> java -cp jars/sane/derbynet.jar org.apache.derby.tools.sysinfo
> ------------------ Java Information ------------------
> Java Version:    1.4.2
> Java Vendor:     IBM Corporation
> Java home:       C:\Program Files\IBM\Java142\jre
> Java classpath:  jars/sane/derbynet.jar
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  djd
> Java user home:  C:\Documents and Settings\Administrator
> Java user dir:   c:\_work\svn_clean2\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\_work\svn_clean2\trunk\jars\sane\derbynet.jar] 10.2.0.0 alpha - (370500M)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.2.0.0 alpha - (370500M)
> Found support for locale: [es]
>          version: 10.2.0.0 alpha - (370500M)
> Found support for locale: [fr]
>          version: 10.2.0.0 alpha - (370500M)
> Found support for locale: [it]
>          version: 10.2.0.0 alpha - (370500M)
> Found support for locale: [ja_JP]
>          version: 10.2.0.0 alpha - (370500M)
> Found support for locale: [ko_KR]
>          version: 10.2.0.0 alpha - (370500M)
> Found support for locale: [pt_BR]
>          version: 10.2.0.0 alpha - (370500M)
> Found support for locale: [zh_CN]
>          version: 10.2.0.0 alpha - (370500M)
> Found support for locale: [zh_TW]
>          version: 10.2.0.0 alpha - (370500M)
> ------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to