1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
Description: Update TriggerableProperties and Property to enable generics API
(those were commented out in upstream source code)
Author: Damien Raude-Morvan <drazzib@debian.org>
Last-Update: 2009-12-13
Forwarded: no
--- a/src/org/eigenbase/util/property/Property.java
+++ b/src/org/eigenbase/util/property/Property.java
@@ -262,10 +262,10 @@
// this is the object to add to list
Object o =
(trigger.isPersistent()) ? trigger
- : (Object) new WeakReference /*<Trigger>*/(trigger);
+ : (Object) new WeakReference<Trigger>(trigger);
// Add a Trigger in the correct group of phases in the list
- for (ListIterator /*<Object>*/ it = listIterator(); it.hasNext();) {
+ for (ListIterator<Object> it = listIterator(); it.hasNext();) {
Trigger t = convert(it.next());
if (t == null) {
@@ -324,9 +324,9 @@
// a clone) so that we can remove any WeakReference whose
// content has become null. Synchronize, per the locking strategy,
// while the copy is being made.
- List /*<Trigger>*/ l = new ArrayList /*<Trigger>*/();
+ List<Trigger> l = new ArrayList <Trigger>();
synchronized (property) {
- for (Iterator /*<Object>*/ it = iterator(); it.hasNext();) {
+ for (Iterator<Object> it = iterator(); it.hasNext();) {
Trigger t = convert(it.next());
if (t == null) {
it.remove();
--- a/src/org/eigenbase/util/property/TriggerableProperties.java
+++ b/src/org/eigenbase/util/property/TriggerableProperties.java
@@ -43,8 +43,8 @@
//~ Instance fields --------------------------------------------------------
protected final Map triggers = new HashMap();
- protected final Map /*<String, Property>*/ properties =
- new HashMap /*<String, Property>*/();
+ protected final Map<String, Property> properties =
+ new HashMap <String, Property>();
//~ Constructors -----------------------------------------------------------
@@ -121,7 +121,7 @@
*/
public Property getPropertyDefinition(String path)
{
- final List /*<Property>*/ propertyList = getPropertyList();
+ final List<Property> propertyList = getPropertyList();
for (int i = 0; i < propertyList.size(); i++) {
Property property = (Property) propertyList.get(i);
if (property.getPath().equals(path)) {
@@ -166,7 +166,7 @@
*
* @return registered properties
*/
- public Collection /*<Property>*/ getProperties()
+ public Collection<Property> getProperties()
{
return Collections.unmodifiableCollection(properties.values());
}
@@ -176,10 +176,10 @@
*
* @return List of properties
*/
- public List /*<Property>*/ getPropertyList()
+ public List<Property> getPropertyList()
{
Field [] fields = getClass().getFields();
- List /*<Property>*/ list = new ArrayList /*<Property>*/();
+ List<Property> list = new ArrayList<Property>();
for (int i = 0; i < fields.length; i++) {
Field field = fields[i];
if (!Modifier.isStatic(field.getModifiers())
|