This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 121292

Summary: NullPointerException while capturing a dbschema file
Product: db Reporter: Andrei Badea <abadea>
Component: DB schemaAssignee: Andrei Badea <abadea>
Status: RESOLVED FIXED    
Severity: blocker CC: pjiricka
Priority: P1 Keywords: REGRESSION
Version: 6.x   
Hardware: All   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Attachments: Stack trace
Fix

Description Andrei Badea 2007-11-06 14:33:07 UTC
When running NetBeans with netbeans.debug.exception=true the attached exception in printed to the log.
Comment 1 Andrei Badea 2007-11-06 14:33:39 UTC
Created attachment 52602 [details]
Stack trace
Comment 2 Andrei Badea 2007-11-06 14:36:05 UTC
Caused by the fix of issue 105724. Fixed.

Checking in TableElementImpl.java;
/cvs/db/model/src/org/netbeans/modules/dbschema/jdbcimpl/TableElementImpl.java,v  <--  TableElementImpl.java
new revision: 1.8; previous revision: 1.7
done
Comment 3 Andrei Badea 2007-11-07 14:58:21 UTC
This issue caused a larger regression, described at 

http://www.netbeans.org/servlets/ReadMsg?list=nbj2ee&msgNo=7214

Would be good to fix this for 6.0.
Comment 4 Andrei Badea 2007-11-07 15:00:07 UTC
Created attachment 52660 [details]
Fix
Comment 5 Andrei Badea 2007-11-07 15:07:58 UTC
The issue was caused by dereferencing a reference which could have been null. The fix is trivial: check for null before
dereferencing. 

QE, please test the Entity Classes from DB and Capture Schema (File > New File > Persistence > Database Schema) wizards
on Oracle for regressions. You can't verify if the problem described by the reporter on nbj2ee, because I couldn't
reproduce it. The reporter confirmed by private e-mail that the fix solved the problem. I will ask him to confirm again
here.
Comment 6 David Vancouvering 2007-11-07 15:46:53 UTC
Reviewed, this looks good, and a very simple fix.
Comment 7 freddiefishcake 2007-11-07 15:54:29 UTC
Confirm that the issue is fixed. I tested against an Oracle Enterprise db with >450 tables in the schema. All tables
(except those without a primary key) showed up as available in the Available Tables column of the generate Entity
wizard, and table generation was successful.
Comment 8 Jan Horvath 2007-11-08 13:46:49 UTC
tested in the build 200711080000, looks like there are no regressions 
Comment 9 Andrei Badea 2007-11-12 13:29:37 UTC
Fixed in release60.

Checking in db/model/src/org/netbeans/modules/dbschema/jdbcimpl/TableElementImpl.java;
/cvs/db/model/src/org/netbeans/modules/dbschema/jdbcimpl/TableElementImpl.java,v  <--  TableElementImpl.java
new revision: 1.7.4.1; previous revision: 1.7
done