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 25824

Summary: Change ugly CloneableTopComponent.Ref#getAnyComponent() method
Product: platform Reporter: Peter Zavadsky <pzavadsky>
Component: Window SystemAssignee: Peter Zavadsky <pzavadsky>
Severity: blocker Keywords: API
Priority: P4    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Peter Zavadsky 2002-07-19 13:23:34 UTC
The method returns any component, but in case
there is no component in the Ref instance it
throws runtime exception (NoSuchElementException).
That's ugly and wrong API, should be replaced by
similar method, but which in that case simply
returns null.
Comment 1 Jaroslav Tulach 2002-07-19 14:56:14 UTC
P9? This will just add one new method to the API. But ok, maybe
boolean hasAnyComponents ()?
Comment 2 Marek Grummich 2002-07-22 11:31:01 UTC
Set target milestone to TBD
Comment 3 Marek Grummich 2002-07-22 11:32:59 UTC
Set target milestone to TBD
Comment 4 Jaroslav Tulach 2002-08-28 10:34:20 UTC
What about: anyComponent ()?
Comment 5 Peter Zavadsky 2002-08-28 13:29:51 UTC
Not hasAnyComponent, needed is just the method for retrieving the
"any" component without use of try-catch block.

I would prefer name starting with get, e.g. getOneComponent?
getArbitraryComponent? getSomeComponent?. Well the good name seems to
be already used.
Comment 6 Marian Mirilovic 2003-01-06 10:57:02 UTC
I have changed version from 4.0 dev to S1S 4.2 (Nevada).
Comment 7 Peter Zavadsky 2003-02-26 17:22:07 UTC
After talk with english native (Tim), I'm going to put there the name
Comment 8 Peter Zavadsky 2003-02-27 10:58:31 UTC
Fixed in [trunk] (also the usages of getAnyComponent method)

org/openide/windows/ 1.23
org/openide/windows/ 1.17
org/openide/text/ 1.80
openide/ 1.106
openide/api/doc/changes/apichanges.xml 1.143
Comment 9 Marian Mirilovic 2003-03-18 17:23:25 UTC
verified in source code