Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 25824 - Change ugly CloneableTopComponent.Ref#getAnyComponent() method
Change ugly CloneableTopComponent.Ref#getAnyComponent() method
Product: platform
Classification: Unclassified
Component: Window System
All All
: P4 (vote)
: 3.x
Assigned To: Peter Zavadsky
Depends on:
  Show dependency treegraph
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


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
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

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo