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 - Change ugly CloneableTopComponent.Ref#getAnyComponent() method
Summary: Change ugly CloneableTopComponent.Ref#getAnyComponent() method
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: Peter Zavadsky
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2002-07-19 13:23 UTC by Peter Zavadsky
Modified: 2008-12-22 18:48 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 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
getArbitraryComponent().
Comment 8 Peter Zavadsky 2003-02-27 10:58:31 UTC
Fixed in [trunk] (also the usages of getAnyComponent method)

org/openide/windows/CloneableTopComponent.java 1.23
org/openide/windows/CloneableOpenSupport.java 1.17
org/openide/text/CloneableEditorSupport.java 1.80
openide/openide-spec-vers.properties 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