harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r446605 - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common: java/awt/ java/awt/font/ java/awt/im/ java/awt/image/ java/awt/image/renderable/ org/apache/harmony/awt/
Date Fri, 15 Sep 2006 13:18:20 GMT
Author: hindessm
Date: Fri Sep 15 06:18:18 2006
New Revision: 446605

URL: http://svn.apache.org/viewvc?view=rev&rev=446605
Log:
Applied patch from "[#HARMONY-1463] [classlib][awt] Generification of the
awt module".

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Button.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Checkbox.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/CheckboxMenuItem.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Choice.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Container.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Graphics2D.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/KeyboardFocusManager.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/List.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MenuItem.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Scrollbar.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextComponent.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextField.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/im/InputMethodHighlight.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ImageConsumer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/MemoryImageSource.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RenderedImage.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/ParameterBlock.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImage.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageOp.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ListenerList.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEvent.java
Fri Sep 15 06:18:18 2006
@@ -21,6 +21,7 @@
 
 import java.util.EventObject;
 import java.util.Hashtable;
+import java.util.EventListener;
 
 import java.awt.event.*;
 
@@ -266,9 +267,9 @@
 
         final long eventMask;
 
-        final Class<?> listenerType;
+        final Class<? extends EventListener> listenerType;
 
-        EventDescriptor(long eventMask, Class<?> listenerType) {
+        EventDescriptor(long eventMask, Class<? extends EventListener> listenerType)
{
             this.eventMask = eventMask;
             this.listenerType = listenerType;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/AWTEventMulticaster.java
Fri Sep 15 06:18:18 2006
@@ -26,6 +26,7 @@
 
 import java.util.EventListener;
 import java.util.LinkedList;
+import java.lang.reflect.Array;
 
 public class AWTEventMulticaster implements
         ComponentListener, ContainerListener, FocusListener, KeyListener,
@@ -65,16 +66,16 @@
         s.writeObject(l);
     }
 
-    public static EventListener[] getListeners(EventListener l, Class<?> listenerType)
+    public static <T extends EventListener> T[] getListeners(EventListener l, Class<T>
listenerType)
             throws ClassCastException {
         if (l == null) {
-            return new EventListener[0];
+            return (T[]) java.lang.reflect.Array.newInstance(listenerType, 0);
         }
-        return addListeners(l, listenerType, new LinkedList<EventListener>()).toArray(
-                (EventListener[]) java.lang.reflect.Array.newInstance(listenerType, 0));
+        return addListeners(l, listenerType, new LinkedList<T>()).toArray(
+                (T[]) java.lang.reflect.Array.newInstance(listenerType, 0));
     }
 
-    private static LinkedList<EventListener> addListeners(EventListener l, Class<?>
listenerType, LinkedList<EventListener> list) {
+    private static <T extends EventListener> LinkedList<T> addListeners(EventListener
l, Class<T> listenerType, LinkedList<T> list) {
         if (l instanceof AWTEventMulticaster) {
             AWTEventMulticaster ml = (AWTEventMulticaster) l;
 
@@ -82,7 +83,7 @@
             addListeners(ml.b, listenerType, list);
         } else {
             if (l.getClass().isAssignableFrom(listenerType)) {
-                list.add(l);
+                list.add((T)l);
             }
         }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Button.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Button.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Button.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Button.java
Fri Sep 15 06:18:18 2006
@@ -226,9 +226,9 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         if (ActionListener.class.isAssignableFrom(listenerType)) {
-            return getActionListeners();
+            return (T[]) getActionListeners();
         }
         return super.getListeners(listenerType);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Checkbox.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Checkbox.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Checkbox.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Checkbox.java
Fri Sep 15 06:18:18 2006
@@ -369,11 +369,11 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         toolkit.lockAWT();
         try {
             if (ItemListener.class.isAssignableFrom(listenerType)) {
-                return getItemListeners();
+                return (T[]) getItemListeners();
             }
             return super.getListeners(listenerType);
         } finally {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/CheckboxMenuItem.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/CheckboxMenuItem.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/CheckboxMenuItem.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/CheckboxMenuItem.java
Fri Sep 15 06:18:18 2006
@@ -178,9 +178,9 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         if (ItemListener.class.isAssignableFrom(listenerType)) {
-            return getItemListeners();
+            return (T[]) getItemListeners();
         }
         return super.getListeners(listenerType);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Choice.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Choice.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Choice.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Choice.java
Fri Sep 15 06:18:18 2006
@@ -494,9 +494,9 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         if (ItemListener.class.isAssignableFrom(listenerType)) {
-            return getItemListeners();
+            return (T[]) getItemListeners();
         }
         return super.getListeners(listenerType);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
Fri Sep 15 06:18:18 2006
@@ -1854,12 +1854,12 @@
         }
     }
 
-    public Set getFocusTraversalKeys(int id) {
+    public Set<AWTKeyStroke> getFocusTraversalKeys(int id) {
         toolkit.lockAWT();
         try {
             Integer kId = new Integer(id);
             KeyboardFocusManager.checkTraversalKeysID(traversalKeys, kId);
-            Set<?> keys = null;
+            Set<AWTKeyStroke> keys = null;
             Object value = traversalKeys.get(kId);
             keys = value instanceof Set ? (Set) value :
                 parent != null ? parent.getFocusTraversalKeys(id) : null;
@@ -3837,30 +3837,30 @@
         }
     }
 
-    public EventListener[] getListeners(Class<?> listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         if (ComponentListener.class.isAssignableFrom(listenerType)) {
-            return getComponentListeners();
+            return (T[]) getComponentListeners();
         } else if (FocusListener.class.isAssignableFrom(listenerType)) {
-            return getFocusListeners();
+            return (T[]) getFocusListeners();
         } else if (HierarchyBoundsListener.class.isAssignableFrom(listenerType)) {
-            return getHierarchyBoundsListeners();
+            return (T[]) getHierarchyBoundsListeners();
         } else if (HierarchyListener.class.isAssignableFrom(listenerType)) {
-            return getHierarchyListeners();
+            return (T[]) getHierarchyListeners();
         } else if (InputMethodListener.class.isAssignableFrom(listenerType)) {
-            return getInputMethodListeners();
+            return (T[]) getInputMethodListeners();
         } else if (KeyListener.class.isAssignableFrom(listenerType)) {
-            return getKeyListeners();
+            return (T[]) getKeyListeners();
         } else if (MouseWheelListener.class.isAssignableFrom(listenerType)) {
-            return getMouseWheelListeners();
+            return (T[]) getMouseWheelListeners();
         } else if (MouseMotionListener.class.isAssignableFrom(listenerType)) {
-            return getMouseMotionListeners();
+            return (T[]) getMouseMotionListeners();
         } else if (MouseListener.class.isAssignableFrom(listenerType)) {
-            return getMouseListeners();
+            return (T[]) getMouseListeners();
         } else if (PropertyChangeListener.class.isAssignableFrom(listenerType)) {
-            return getPropertyChangeListeners();
+            return (T[]) getPropertyChangeListeners();
         }
 
-        return new EventListener[0];
+        return (T[]) java.lang.reflect.Array.newInstance(listenerType, 0);
     }
 
     private void processPaintEvent(PaintEvent event) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Container.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Container.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Container.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Container.java
Fri Sep 15 06:18:18 2006
@@ -646,7 +646,7 @@
     }
 
     @Override
-    public Set<?> getFocusTraversalKeys(int id) {
+    public Set<AWTKeyStroke> getFocusTraversalKeys(int id) {
         toolkit.lockAWT();
         try {
             return super.getFocusTraversalKeys(id);
@@ -1033,7 +1033,7 @@
     }
 
     @Override
-    public void setFocusTraversalKeys(int id, Set keystrokes) {
+    public void setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)
{
         toolkit.lockAWT();
         try {
             super.setFocusTraversalKeys(id, keystrokes);
@@ -1258,11 +1258,11 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class<?> listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
 //        toolkit.lockAWT();
 //        try {
             if (ContainerListener.class.isAssignableFrom(listenerType)) {
-                return getContainerListeners();
+                return (T[]) getContainerListeners();
             }
             return super.getListeners(listenerType);
 //        } finally {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java
Fri Sep 15 06:18:18 2006
@@ -525,8 +525,8 @@
     }
 
     @SuppressWarnings("unchecked")
-    public Map<TextAttribute, Object> getAttributes() {
-        return (Map<TextAttribute, Object>)fRequestedAttributes.clone();
+    public Map<TextAttribute, ?> getAttributes() {
+        return (Map<TextAttribute, ?>)fRequestedAttributes.clone();
     }
 
     public Attribute[] getAvailableAttributes() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Graphics2D.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Graphics2D.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Graphics2D.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Graphics2D.java
Fri Sep 15 06:18:18 2006
@@ -38,7 +38,7 @@
 
     // Abstract methods
 
-    public abstract void addRenderingHints(Map hints);
+    public abstract void addRenderingHints(Map<?,?> hints);
 
     public abstract void clip(Shape s);
 
@@ -100,7 +100,7 @@
 
     public abstract void setRenderingHint(RenderingHints.Key key, Object value);
 
-    public abstract void setRenderingHints(Map hints);
+    public abstract void setRenderingHints(Map<?,?> hints);
 
     public abstract void setStroke(Stroke s);
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/KeyboardFocusManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/KeyboardFocusManager.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/KeyboardFocusManager.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/KeyboardFocusManager.java
Fri Sep 15 06:18:18 2006
@@ -84,9 +84,9 @@
 
     private static Window prevFocusedWindow;
 
-    final ListenerList keyEventDispatchers = new ListenerList();
+    final ListenerList<KeyEventDispatcher> keyEventDispatchers = new ListenerList<KeyEventDispatcher>();
 
-    final ListenerList keyEventPostProcessors = new ListenerList();
+    final ListenerList<KeyEventPostProcessor> keyEventPostProcessors = new ListenerList<KeyEventPostProcessor>();
 
     private PropertyChangeSupport propertyChangeSupport;
 
@@ -202,7 +202,7 @@
         }
     }
 
-    public Set<?> getDefaultFocusTraversalKeys(int id) {
+    public Set<AWTKeyStroke> getDefaultFocusTraversalKeys(int id) {
         Integer kId = Integer.valueOf(id);
         checkTraversalKeysID(defaultFocusTraversalKeys, kId);
         return defaultFocusTraversalKeys.get(kId);
@@ -272,11 +272,11 @@
         return permanentFocusOwner;
     }
 
-    protected List<?> getKeyEventDispatchers() {
+    protected List<KeyEventDispatcher> getKeyEventDispatchers() {
         return keyEventDispatchers.getUserListeners();
     }
 
-    protected List<?> getKeyEventPostProcessors() {
+    protected List<KeyEventPostProcessor> getKeyEventPostProcessors() {
         return keyEventPostProcessors.getUserListeners();
     }
 
@@ -367,13 +367,13 @@
         newManager.firePropertyChange(propName, Boolean.FALSE, Boolean.TRUE);
     }
 
-    public void setDefaultFocusTraversalKeys(int id, Set<AWTKeyStroke> keystrokes)
{
+    public void setDefaultFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)
{
         Integer kId = Integer.valueOf(id);
         Set<AWTKeyStroke> oldKeyStrokes = defaultFocusTraversalKeys.get(kId);
         checkTraversalKeysID(defaultFocusTraversalKeys, kId);
         checkKeyStrokes(contTraversalIDs, defaultFocusTraversalKeys, kId,
-                        keystrokes);
-        defaultFocusTraversalKeys.put(kId, keystrokes);
+                        (Set<AWTKeyStroke>) keystrokes);
+        defaultFocusTraversalKeys.put(kId, (Set<AWTKeyStroke>) keystrokes);
         String propName = null;
         switch (id) {
         case FORWARD_TRAVERSAL_KEYS:

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/List.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/List.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/List.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/List.java
Fri Sep 15 06:18:18 2006
@@ -1332,11 +1332,11 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class<?> listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         if (ActionListener.class.isAssignableFrom(listenerType)) {
-            return getActionListeners();
+            return (T[]) getActionListeners();
         } else if (ItemListener.class.isAssignableFrom(listenerType)) {
-            return getItemListeners();
+            return (T[]) getItemListeners();
         } else {
             return super.getListeners(listenerType);
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MenuItem.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MenuItem.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MenuItem.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/MenuItem.java
Fri Sep 15 06:18:18 2006
@@ -244,13 +244,13 @@
         }
     }
 
-    public EventListener[] getListeners(Class listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         toolkit.lockAWT();
         try {
             if (ActionListener.class.isAssignableFrom(listenerType)) {
-                return getActionListeners();
+                return (T[]) getActionListeners();
             }
-            return new EventListener[0];
+            return (T[]) java.lang.reflect.Array.newInstance(listenerType, 0);
         } finally {
             toolkit.unlockAWT();
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Scrollbar.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Scrollbar.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Scrollbar.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Scrollbar.java
Fri Sep 15 06:18:18 2006
@@ -577,9 +577,9 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         if (AdjustmentListener.class.isAssignableFrom(listenerType)) {
-            return getAdjustmentListeners();
+            return (T[]) getAdjustmentListeners();
         }
         return super.getListeners(listenerType);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextComponent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextComponent.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextComponent.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextComponent.java
Fri Sep 15 06:18:18 2006
@@ -878,9 +878,9 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class<?> listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         if (TextListener.class.isAssignableFrom(listenerType)) {
-            return getTextListeners();
+            return (T[]) getTextListeners();
         }
         return super.getListeners(listenerType);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextField.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextField.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextField.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/TextField.java
Fri Sep 15 06:18:18 2006
@@ -402,9 +402,9 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         if (ActionListener.class.isAssignableFrom(listenerType)) {
-            return getActionListeners();
+            return (T[]) getActionListeners();
         }
         return super.getListeners(listenerType);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
Fri Sep 15 06:18:18 2006
@@ -644,7 +644,7 @@
 
     protected abstract EventQueue getSystemEventQueueImpl();
 
-    public abstract Map<?, ?> mapInputMethodHighlight(InputMethodHighlight highlight)
throws HeadlessException;
+    public abstract Map<java.awt.font.TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight
highlight) throws HeadlessException;
 
     Map<?, ?> mapInputMethodHighlightImpl(InputMethodHighlight highlight)
             throws HeadlessException {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java
Fri Sep 15 06:18:18 2006
@@ -382,7 +382,7 @@
     }
 
     @Override
-    public Set<?> getFocusTraversalKeys(int id) {
+    public Set<AWTKeyStroke> getFocusTraversalKeys(int id) {
         //why override?
         toolkit.lockAWT();
         try {
@@ -1071,13 +1071,13 @@
     }
 
     @Override
-    public EventListener[] getListeners(Class<?> listenerType) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenerType)
{
         if (WindowFocusListener.class.isAssignableFrom(listenerType)) {
-            return getWindowFocusListeners();
+            return (T[]) getWindowFocusListeners();
         } else if (WindowStateListener.class.isAssignableFrom(listenerType)) {
-            return getWindowStateListeners();
+            return (T[]) getWindowStateListeners();
         } else if (WindowListener.class.isAssignableFrom(listenerType)) {
-            return getWindowListeners();
+            return (T[]) getWindowListeners();
         } else {
             return super.getListeners(listenerType);
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/font/TextLayout.java
Fri Sep 15 06:18:18 2006
@@ -76,7 +76,11 @@
         caretManager = new CaretManager(breaker);
     }
 
-    public TextLayout(String string, Map attributes, FontRenderContext frc) {
+    public TextLayout(
+            String string,
+            Map<? extends java.text.AttributedCharacterIterator.Attribute, ?> attributes,
+            FontRenderContext frc
+    ) {
         AttributedString as = new AttributedString(string);
         as.addAttributes(attributes, 0, string.length());
         this.breaker = new TextRunBreaker(as.getIterator(), frc);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/im/InputMethodHighlight.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/im/InputMethodHighlight.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/im/InputMethodHighlight.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/im/InputMethodHighlight.java
Fri Sep 15 06:18:18 2006
@@ -20,6 +20,7 @@
 package java.awt.im;
 
 import java.util.Map;
+import java.awt.font.TextAttribute;
 
 public class InputMethodHighlight {
 
@@ -44,14 +45,14 @@
     private boolean selected;
     private int state;
     private int variation;
-    private Map style; // Map<TextAttribute,?>
+    private Map<TextAttribute,?> style;
 
     public InputMethodHighlight(boolean selected, int state, int variation) {
         this(selected, state, variation, null);
     }
 
     public InputMethodHighlight(boolean selected, int state,
-                                int variation, Map style) {
+                                int variation, Map<java.awt.font.TextAttribute, ?>
style) {
         if ((state != RAW_TEXT) && (state != CONVERTED_TEXT)) {
             throw new IllegalArgumentException("unknown input method" +
                     " highlight state");
@@ -70,7 +71,7 @@
         return state;
     }
 
-    public Map getStyle() {
+    public Map<java.awt.font.TextAttribute, ?> getStyle() {
         return style;
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/BufferedImage.java
Fri Sep 15 06:18:18 2006
@@ -110,7 +110,7 @@
     private final ImageSurface imageSurf;
 
     public BufferedImage(ColorModel cm, WritableRaster raster,
-            boolean isRasterPremultiplied, Hashtable properties) {
+            boolean isRasterPremultiplied, Hashtable<?, ?> properties) {
         if (!cm.isCompatibleRaster(raster))
             throw new IllegalArgumentException("The raster is" +
                     " incompatible with this ColorModel");
@@ -121,6 +121,7 @@
 
         this.cm  = cm;
         this.raster = raster;
+        this.properties = properties;
 
         coerceData(isRasterPremultiplied);
 
@@ -404,7 +405,7 @@
         return outr;
     }
 
-    public Vector getSources() {
+    public Vector<RenderedImage> getSources() {
         return null;
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ImageConsumer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ImageConsumer.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ImageConsumer.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/ImageConsumer.java
Fri Sep 15 06:18:18 2006
@@ -41,7 +41,7 @@
 
     public static final int IMAGEABORTED = 4;
 
-    public void setProperties(Hashtable props);
+    public void setProperties(Hashtable<?, ?> props);
 
     public void setColorModel(ColorModel model);
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/MemoryImageSource.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/MemoryImageSource.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/MemoryImageSource.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/MemoryImageSource.java
Fri Sep 15 06:18:18 2006
@@ -31,7 +31,7 @@
     int iData[];
     int offset;
     int scanline;
-    Hashtable properties;
+    Hashtable<?, ?> properties;
     Vector consumers;
     boolean animated;
     boolean fullbuffers;
@@ -41,17 +41,17 @@
     static final int DATA_TYPE_INT = 1;
 
     public MemoryImageSource(int w, int h, ColorModel cm, int pix[],
-            int off, int scan, Hashtable props) {
+            int off, int scan, Hashtable<?, ?> props) {
         init(w, h, cm, pix, off, scan, props);
     }
 
     public MemoryImageSource(int w, int h, ColorModel cm, byte pix[],
-            int off, int scan, Hashtable props) {
+            int off, int scan, Hashtable<?, ?> props) {
         init(w, h, cm, pix, off, scan, props);
     }
 
     public MemoryImageSource(int w, int h, int pix[], int off, int scan,
-            Hashtable props) {
+            Hashtable<?, ?> props) {
         init(w, h, ColorModel.getRGBdefault(), pix, off, scan, props);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RenderedImage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RenderedImage.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RenderedImage.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/RenderedImage.java
Fri Sep 15 06:18:18 2006
@@ -30,7 +30,7 @@
 
     public Raster getData(Rectangle rect);
 
-    public Vector getSources();
+    public Vector<RenderedImage> getSources();
 
     public String[] getPropertyNames();
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/ParameterBlock.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/ParameterBlock.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/ParameterBlock.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/ParameterBlock.java
Fri Sep 15 06:18:18 2006
@@ -28,16 +28,16 @@
 
     private static final long serialVersionUID = -7577115551785240750L;
 
-    protected Vector sources = new Vector();
+    protected Vector<Object> sources = new Vector<Object>();
 
-    protected Vector parameters = new Vector();
+    protected Vector<Object> parameters = new Vector<Object>();
 
-    public ParameterBlock(Vector sources, Vector parameters) {
+    public ParameterBlock(Vector<Object> sources, Vector<Object> parameters)
{
         setSources(sources);
         setParameters(parameters);
     }
 
-    public ParameterBlock(Vector sources) {
+    public ParameterBlock(Vector<Object> sources) {
         setSources(sources);
     }
 
@@ -69,19 +69,19 @@
         return this;
     }
 
-    public void setSources(Vector sources) {
+    public void setSources(Vector<Object> sources) {
         this.sources = sources;
     }
 
-    public void setParameters(Vector parameters) {
+    public void setParameters(Vector<Object> parameters) {
         this.parameters = parameters;
     }
 
-    public Vector getSources() {
+    public Vector<Object> getSources() {
         return sources;
     }
 
-    public Vector getParameters() {
+    public Vector<Object> getParameters() {
         return parameters;
     }
 
@@ -109,10 +109,10 @@
             return null;
         }
         if(sources != null){
-            replica.setSources((Vector)(sources.clone()));
+            replica.setSources((Vector<Object>)(sources.clone()));
         }
         if(parameters != null){
-            replica.setParameters((Vector)(parameters.clone()));
+            replica.setParameters((Vector<Object>)(parameters.clone()));
         }
         return replica;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImage.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImage.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImage.java
Fri Sep 15 06:18:18 2006
@@ -33,7 +33,7 @@
 
     public RenderedImage createScaledRendering(int w, int h, RenderingHints hints);
 
-    public Vector getSources();
+    public Vector<RenderableImage> getSources();
 
     public String[] getPropertyNames();
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageOp.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageOp.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageOp.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/image/renderable/RenderableImageOp.java
Fri Sep 15 06:18:18 2006
@@ -57,7 +57,7 @@
         ParameterBlock rdParam = (ParameterBlock) paramBlock.clone();
 
         if(sources != null){
-            Vector rdSources = new Vector();
+            Vector<Object> rdSources = new Vector<Object>();
             int i = 0;
             while(i < sources.size()){
                 RenderContext newContext = CRIF.mapRenderContext(i, renderContext,
@@ -94,14 +94,14 @@
         return createRendering(context);
     }
 
-    public Vector getSources() {
+    public Vector<RenderableImage> getSources() {
         if(paramBlock.getNumSources() == 0) return null;
-        Vector v = new Vector();
+        Vector<RenderableImage> v = new Vector<RenderableImage>();
         int  i = 0;
         while(i < paramBlock.getNumSources()){
             Object o = paramBlock.getSource(i);
             if(o instanceof RenderableImage){
-                v.addElement(o);
+                v.addElement((RenderableImage) o);
             }
             i++;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ListenerList.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ListenerList.java?view=diff&rev=446605&r1=446604&r2=446605
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ListenerList.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/ListenerList.java
Fri Sep 15 06:18:18 2006
@@ -34,13 +34,13 @@
  * 2. To ensure call for all listeners as atomic operation
  * 3. To support system listeners that are needed for built-in AWT components
  */
-public class ListenerList implements Serializable {
+public class ListenerList<T> implements Serializable {
     private static final long serialVersionUID = 9180703263299648154L;
 
     private static final Iterator dummyIterator = new ArrayList().iterator();
 
     private transient ArrayList systemList = null;
-    private transient ArrayList userList = null;
+    private transient ArrayList<T> userList = null;
 
     /**
      * Adds system listener to this list.
@@ -59,18 +59,18 @@
      *
      * @param listener - listener to be added.
      */
-    public void addUserListener(Object listener) {
+    public void addUserListener(T listener) {
         if (listener == null) {
             return;
         }
         // transactionally replace old list
         synchronized (this) {
             if (userList == null) {
-                userList = new ArrayList();
+                userList = new ArrayList<T>();
                 userList.add(listener);
                 return;
             }
-            ArrayList newList = new ArrayList(userList);
+            ArrayList<T> newList = new ArrayList<T>(userList);
             newList.add(listener);
             userList = newList;
         }
@@ -90,7 +90,7 @@
             if (userList == null || !userList.contains(listener)) {
                 return;
             }
-            ArrayList newList = new ArrayList(userList);
+            ArrayList<T> newList = new ArrayList<T>(userList);
             newList.remove(listener);
             userList = (newList.size() > 0 ? newList : null);
         }
@@ -115,9 +115,9 @@
      *
      * @return list of all user listeners.
      */
-    public List getUserListeners() {
+    public List<T> getUserListeners() {
         synchronized (this) {
-            return new ArrayList(userList);
+            return new ArrayList<T>(userList);
         }
     }
 
@@ -175,7 +175,7 @@
         stream.defaultReadObject();
 
         systemList = (ArrayList)stream.readObject();
-        userList = (ArrayList)stream.readObject();
+        userList = (ArrayList<T>)stream.readObject();
     }
 
 }



Mime
View raw message