Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 190157 - A few potential possibilities of NullPointerException have been found in BIRT CORE projects.
Summary: A few potential possibilities of NullPointerException have been found in BIRT...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.2.0 RC3   Edit
Assignee: Wei Wang CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-31 04:59 EDT by Roman Arkhangelskiy CLA
Modified: 2009-05-27 14:20 EDT (History)
2 users (show)

See Also:
bjorn.freeman-benson: iplog+
wenfeng.fwd: pmc_approved+


Attachments
NP1 (128.68 KB, image/jpeg)
2007-05-31 05:00 EDT, Roman Arkhangelskiy CLA
no flags Details
NP2 (120.57 KB, image/jpeg)
2007-05-31 05:00 EDT, Roman Arkhangelskiy CLA
no flags Details
NP3 (110.30 KB, image/jpeg)
2007-05-31 05:01 EDT, Roman Arkhangelskiy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Arkhangelskiy CLA 2007-05-31 04:59:36 EDT
Build ID: 2.1.2

Steps To Reproduce:
I have been running Jtest's BugDetective feature on BIRT source code and it reported a few possible dangerous places where a NullPoiterException may be thrown under some circumstances.

The attached screenshots from BugDetective will help to understand the exact flow which may lead to the exception.

org.eclipse.birt.core.archive.compound.ArchiveFile:
At line 146 if the excetion is thrown at line 125 (Screenshot NP1).

org.eclipse.birt.core.script.NativeDateTimeSpan:
Lines 108,116,124,132,140,148 all are dangerous from this point of view because the variable 'startDate' may be null if toDate(String) method is not able to parse its argument throwing ParseException. Since all these violations have the same origin, only one screenshot that depicts the problem (NP2) is attached.

org.eclipse.birt.core.ui.utils.UIHelper:
At line 136 since getURL may return null if MalformedURLException occurs (see NP3).

Please let me know if this is a real problem or BugDetective is mistaken.

Thank you!

More information:
Comment 1 Roman Arkhangelskiy CLA 2007-05-31 05:00:07 EDT
Created attachment 69483 [details]
NP1
Comment 2 Roman Arkhangelskiy CLA 2007-05-31 05:00:35 EDT
Created attachment 69484 [details]
NP2
Comment 3 Roman Arkhangelskiy CLA 2007-05-31 05:01:09 EDT
Created attachment 69485 [details]
NP3
Comment 4 Yulin Wang CLA 2007-06-06 06:10:34 EDT
Fixed in chart plug-ins.
Reassign to report engine team for birt.core issues.
Comment 5 Wei Wang CLA 2007-06-07 05:26:40 EDT
engine should checkin these modification in head and v2.1.3

for NP1:
the potential possibilities of NPE doesnot exist because the code in Screenshot NP1 has been modified in the newest code in head and v2.1.3 by someone else.

for NP2:
engine accepts both two relationships between startDate and endDate:
a. startDate <= endDate
b. startDate > endDate
remove the assert processes in methods jsStaticFunction_years(), jsStaticFunction_months(), jsStaticFunction_days(), jsStaticFunction_hours(), jsStaticFunction_minutes(), jsStaticFunction_seconds().
and merge DateTimeSpan.java between head and v2.1.3

for NP3:
Chart Team has fixed it.
Comment 6 Bjorn Freeman-Benson CLA 2008-06-18 15:54:45 EDT
adding iplog+ as per Ganymede IP log