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 9056 - inconsistent exception throwing
Summary: inconsistent exception throwing
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All Windows ME/2000
: P4 normal (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-01-10 13:01 UTC by Martin Matula
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Matula 2001-01-10 13:01:18 UTC
When I try to parse invalid type name using Type.parse (e.g. I can pass "." as
a parameter, which means I call Type.parse(".")) and get a valid Type object.
But after I try to call .compareTo, I will get an IllegalArgumentException.
This bug is related to bug http://www.netbeans.org/bugs-cgi/show_bug.cgi?id=8605
Comment 1 Tomas Hurka 2001-01-12 13:03:59 UTC
I suggest to correct this bug with this patch:

Index: openide/src/org/openide/src/Type.java
===================================================================
RCS file: /cvs/openide/src/org/openide/src/Type.java,v
retrieving revision 1.16
diff -r1.16 Type.java
227c227,229
<                         while (tok2.hasMoreTokens()) {
---
>                         if (!tok2.hasMoreTokens())
>                           throw new
IllegalArgumentException();
>                       do {
231c233
<                         }
---
>                         }while (tok2.hasMoreTokens());
Comment 2 Svata Dedic 2001-01-15 14:38:59 UTC
The second attempt worked fine, Tomas ;-) Thanks a lot.
Comment 3 Jan Becicka 2001-02-22 11:20:00 UTC
[010221_2] Verified
Comment 4 Quality Engineering 2003-07-01 13:16:28 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.