harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r465981 [1/3] - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java: common/org/apache/harmony/awt/im/ common/org/apache/harmony/awt/nativebridge/ common/org/apache/harmony/awt/state/ common/org/apache/harmony/awt/text/ ...
Date Fri, 20 Oct 2006 04:23:24 GMT
Author: ndbeyer
Date: Thu Oct 19 21:23:21 2006
New Revision: 465981

URL: http://svn.apache.org/viewvc?view=rev&rev=465981
Log:
Code cleanup
* add missing annotations
* add if/else braces
* add type variables
* etc

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/CompositionWindow.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMJFrame.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMWindow.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/ByteBase.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/CLongPointer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/DoublePointer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/FloatPointer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int16Pointer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int32Pointer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int64Pointer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int8Pointer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/NativeBridge.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/PointerPointer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/state/MenuState.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/ActionSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/InputMethodRequestsImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextUtils.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultButton.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenu.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenuBar.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultScrollbar.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventQueue.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventThread.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeIM.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/ShutdownThread.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/Synchronizer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/SystemProperties.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinClipboard.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDTK.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDragSource.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDropTarget.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/NativeFont.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/WinFontManager.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/WinFontProperty.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/WinGlyph.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/font/WindowsFont.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/BitmapSurface.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/GDIBlitter.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/GDIPTextRenderer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/GDISurface.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/GDITextRenderer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphics2DFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphicsConfiguration.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphicsDevice.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphicsEnvironment.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinVolatileImage.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/Win32.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WinDataTransfer.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/theme/windows/WinCheckbox.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/theme/windows/WinFileDialog.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/theme/windows/WinTheme.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinCursor.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinCursorFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEventQueue.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinIM.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinRobot.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinSystemProperties.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWTK.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindow.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindowFactory.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/CompositionWindow.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/CompositionWindow.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/CompositionWindow.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/CompositionWindow.java Thu Oct 19 21:23:21 2006
@@ -61,6 +61,7 @@
             caret.setBlinkRate(0);
             caret.setVisible(true);
             imRequests = new InputMethodRequestsImpl(textKit) {
+                @Override
                 public TextHitInfo getLocationOffset(int x, int y) {
                     if (!isShowing()) {
                         return null;
@@ -69,6 +70,7 @@
                 }
             };
             imListener = new InputMethodListenerImpl(textKit) {
+                @Override
                 public void inputMethodTextChanged(InputMethodEvent ime) {                   
                     super.inputMethodTextChanged(ime);
                     // create KEY_TYPED event for each committed char
@@ -121,10 +123,12 @@
             
         }
 
+        @Override
         public InputMethodRequests getInputMethodRequests() {
             return imRequests;
         }
         
+        @Override
         public void paint(Graphics g) {
             caret.paint(g);
         }
@@ -132,7 +136,7 @@
     }
     
     private Component client;
-    private ActiveClient activeClient;
+    private final ActiveClient activeClient;
 
     public CompositionWindow(Component client) {
         setClient(client);
@@ -150,6 +154,7 @@
         return Toolkit.getDefaultToolkit().getScreenSize();
     }
     
+    @Override
     public InputMethodRequests getInputMethodRequests() {
         return getActiveClient().getInputMethodRequests();
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMJFrame.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMJFrame.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMJFrame.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMJFrame.java Thu Oct 19 21:23:21 2006
@@ -36,11 +36,13 @@
         this("Input Window", null);
     }
     
+    @Override
     public void addNotify() {
         super.addNotify();
         IMManager.makeIMWindow(this);
     }
     
+    @Override
     public InputContext getInputContext() {
         if (inputContext != null) {
             return inputContext;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java Thu Oct 19 21:23:21 2006
@@ -85,6 +85,7 @@
                 return locale;
             }
     
+            @Override
             public String paramString() {
                 return super.paramString() + ",desc=" + 
                 getDesc() + ",locale=" + locale;
@@ -104,6 +105,7 @@
                 return desc;
             }
     
+            @Override
             public String paramString() {
                 return super.paramString() + ",desc=" + desc;
             }
@@ -111,8 +113,8 @@
             private void addLocales() {
                 try {
                     Locale[] locs = desc.getAvailableLocales();
-                    for (int j = 0; j < locs.length; j++) {
-                        addMenuItem(locs[j]);
+                    for (Locale element : locs) {
+                        addMenuItem(element);
                     }
                 } catch (AWTException e) {
                     e.printStackTrace();
@@ -132,7 +134,6 @@
                         item.setState(item.getLocale().equals(imContext.getLocale()));
                         // TODO: also check input method descriptor
                     } catch (Exception e) {
-                        // TODO Auto-generated catch block
                         e.printStackTrace();
                     }
                 }
@@ -142,7 +143,7 @@
         InputMethodContext imContext;
         
         public IMSelection() {            
-            Iterator it = getIMDescriptors().iterator();
+            Iterator<InputMethodDescriptor> it = getIMDescriptors().iterator();
             // native IM is always first
             addNativeIM(it);
             while (it.hasNext()) {
@@ -150,13 +151,13 @@
             }
         }
 
-        private void addIM(Iterator it) {
-            InputMethodDescriptor desc = (InputMethodDescriptor) it.next();
+        private void addIM(Iterator<InputMethodDescriptor> it) {
+            InputMethodDescriptor desc = it.next();
             IMSubmenu subMenu = new IMSubmenu(desc);
             add(subMenu);
         }
     
-        private void addNativeIM(Iterator it) {
+        private void addNativeIM(Iterator<InputMethodDescriptor> it) {
             if (it.hasNext()) {
                 addIM(it);
             }
@@ -199,14 +200,14 @@
         }        
     }
     
-    private static List imd; // available IM descriptors
+    private static List<InputMethodDescriptor> imd; // available IM descriptors
     private static IMSelection imPopup; // IM selection popup menu
     //  only 1 composition window is visible even if there're several InputContexts
     private static Window curCompositionWindow;
     // last InputMethodContext which had an active IM
     private static InputMethodContext lastActiveIMC;
     
-    static List getIMDescriptors() {
+    static List<InputMethodDescriptor> getIMDescriptors() {
         if (imd == null) {
             imd = loadIMDescriptors();
         }
@@ -220,20 +221,18 @@
      * Service.providers(InputMethodDescriptor.class)
      * @return list of input method descriptors
      */
-    private static List loadIMDescriptors() {
+    private static List<InputMethodDescriptor> loadIMDescriptors() {
         String nm = SERVICES + InputMethodDescriptor.class.getName();
-        Enumeration en;
-        LinkedList imdList = new LinkedList();
+        Enumeration<URL> en;
+        LinkedList<InputMethodDescriptor> imdList = new LinkedList<InputMethodDescriptor>();
         // first add native IM descriptor(is always present)
-        NativeIM nativeIM = ContextStorage.getNativeIM(); 
-        if (nativeIM instanceof InputMethodDescriptor) {
-            imdList.add(nativeIM);
-        }
+        NativeIM nativeIM = ContextStorage.getNativeIM();
+        imdList.add(nativeIM);
         try {
             en = ClassLoader.getSystemResources(nm);
             ClassLoader cl = ClassLoader.getSystemClassLoader();
             while (en.hasMoreElements()) {
-                URL url = (URL) en.nextElement();
+                URL url = en.nextElement();
                 InputStreamReader isr = new InputStreamReader(url.openStream(),
                                                               "UTF-8");
                 BufferedReader br = new BufferedReader(isr);
@@ -246,7 +245,7 @@
                         str = str.substring(0, comPos);
                     }
                     if (str.length() > 0) {
-                        imdList.add(cl.loadClass(str).newInstance());
+                        imdList.add((InputMethodDescriptor)cl.loadClass(str).newInstance());
                     }
                     str = br.readLine();
                 }
@@ -259,7 +258,7 @@
     }
     
     private static void showIMPopup(InputMethodContext imc, Window parent) {
-        List descriptors = getIMDescriptors();
+        List<InputMethodDescriptor> descriptors = getIMDescriptors();
         if ((descriptors == null) || descriptors.isEmpty()) {
             // show menu only if some non-native IMs are present
             return;
@@ -301,6 +300,7 @@
         }
     }
     
+    @SuppressWarnings("deprecation")
     static void showCompositionWindow(Window w) {
         
         if (curCompositionWindow != null) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMWindow.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMWindow.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMWindow.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMWindow.java Thu Oct 19 21:23:21 2006
@@ -35,11 +35,13 @@
         this("Input Window", null);
     }
     
+    @Override
     public void addNotify() {
         super.addNotify();
         IMManager.makeIMWindow(this);
     }
     
+    @Override
     public InputContext getInputContext() {
         if (inputContext != null) {
             return inputContext;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java Thu Oct 19 21:23:21 2006
@@ -59,9 +59,9 @@
     private InputMethod inputMethod; // current IM
     private Component client; // current "active" client component
     private CompositionWindow composeWindow; // composition Window    
-    private Map imInstances; // Map<InputMethodDescriptor, InputMethod>
-    private Map localeIM; // Map<Locale, InputMethod> last user-selected IM for locale
-    private Set notifyIM; // set of IMs to notify of client window bounds changes
+    private final Map<InputMethodDescriptor, InputMethod> imInstances; // Map<InputMethodDescriptor, InputMethod>
+    private final Map<Locale, InputMethod> localeIM; // Map<Locale, InputMethod> last user-selected IM for locale
+    private final Set<InputMethod> notifyIM; // set of IMs to notify of client window bounds changes
     /**
      * a flag indicating that IM should be notified of client window
      * position/visibility changes as soon as it is activated(new client
@@ -69,19 +69,20 @@
      */    
     private boolean pendingClientNotify;
     private Component nextComp; // component to gain focus after endComposition()
-    private Set imWindows; // set of all IM windows created by this instance
+    private final Set<Window> imWindows; // set of all IM windows created by this instance
     private final NativeIM nativeIM;
     
 
     public InputMethodContext() {
-        notifyIM = new HashSet();
-        imWindows = new HashSet();
-        imInstances = new HashMap();
-        localeIM = new HashMap();
+        notifyIM = new HashSet<InputMethod>();
+        imWindows = new HashSet<Window>();
+        imInstances = new HashMap<InputMethodDescriptor, InputMethod>();
+        localeIM = new HashMap<Locale, InputMethod>();
         selectInputMethod(Locale.US); // not default?
         nativeIM = (NativeIM) inputMethod;
     }
 
+    @Override
     public void dispatchEvent(AWTEvent event) {
         int id = event.getID(); 
         if ((id >= FocusEvent.FOCUS_FIRST) && (id <=FocusEvent.FOCUS_LAST)) {
@@ -165,6 +166,7 @@
         IMManager.setLastActiveIMC(this);
     }
 
+    @SuppressWarnings("deprecation")
     private void hideWindows() {
         if (inputMethod != null) {
             inputMethod.hideWindows();
@@ -219,6 +221,7 @@
         return getIMRequests();
     }
     
+    @Override
     public void dispose() {
         if (inputMethod != null) {
             closeIM(inputMethod);
@@ -228,6 +231,7 @@
         super.dispose();
     }
 
+    @Override
     public void endComposition() {
         if (inputMethod != null) {
             inputMethod.endComposition();
@@ -235,6 +239,7 @@
         super.endComposition();
     }
 
+    @Override
     public Object getInputMethodControlObject() {
         if (inputMethod != null) {
             return inputMethod.getControlObject();
@@ -242,6 +247,7 @@
         return super.getInputMethodControlObject();
     }
 
+    @Override
     public Locale getLocale() {
         if (inputMethod != null) {
             return inputMethod.getLocale();
@@ -249,6 +255,7 @@
         return super.getLocale();
     }
 
+    @Override
     public boolean isCompositionEnabled() {
         if (inputMethod != null) {
             return inputMethod.isCompositionEnabled();
@@ -256,6 +263,7 @@
         return super.isCompositionEnabled();
     }
 
+    @Override
     public void reconvert() {
         if (inputMethod != null) {
             inputMethod.reconvert();
@@ -263,6 +271,7 @@
         super.reconvert();
     }
 
+    @Override
     public void removeNotify(Component client) {
         if ((inputMethod != null) && (client == this.client)) {
             inputMethod.removeNotify();
@@ -275,29 +284,29 @@
         super.removeNotify(client);
     }
 
+    @Override
     public boolean selectInputMethod(Locale locale) {        
         
         if ((inputMethod != null) && inputMethod.setLocale(locale)) {
             return true;
-        } else {
-            // first
-            // take last user-selected IM for locale            
-            InputMethod newIM = (InputMethod) localeIM.get(locale);
-            
-            // if not found search through IM descriptors
-            // and take already created instance if exists
-            // or create, store new IM instance in descriptor->instance map
-            if (newIM == null) {
-                try {
-                    newIM = getIMInstance(IMManager.getIMDescriptors().iterator(),
-                                          locale);
-                } catch (Exception e) {
-                    // ignore exceptions - just return false
-                }
+        }
+        // first
+        // take last user-selected IM for locale            
+        InputMethod newIM = localeIM.get(locale);
+        
+        // if not found search through IM descriptors
+        // and take already created instance if exists
+        // or create, store new IM instance in descriptor->instance map
+        if (newIM == null) {
+            try {
+                newIM = getIMInstance(IMManager.getIMDescriptors().iterator(),
+                                      locale);
+            } catch (Exception e) {
+                // ignore exceptions - just return false
             }
-            
-            return switchToIM(locale, newIM);
         }
+        
+        return switchToIM(locale, newIM);
     }
 
     private boolean switchToIM(Locale locale, InputMethod newIM) {
@@ -332,13 +341,13 @@
      * @return input method instance
      * @throws Exception
      */
-    private InputMethod getIMInstance(Iterator descriptors,
+    private InputMethod getIMInstance(Iterator<InputMethodDescriptor> descriptors,
                                       Locale locale) throws Exception {
         while (descriptors.hasNext()) {
-            InputMethodDescriptor desc = (InputMethodDescriptor) descriptors.next();
+            InputMethodDescriptor desc = descriptors.next();
             Locale[] locs = desc.getAvailableLocales();
-            for (int j = 0; j < locs.length; j++) {
-                if (locale.equals(locs[j])) {
+            for (Locale element : locs) {
+                if (locale.equals(element)) {
                     return getIMInstance(desc);
                 }
             }
@@ -347,7 +356,7 @@
     }
 
     private InputMethod getIMInstance(InputMethodDescriptor imd) throws Exception {
-        InputMethod im = (InputMethod) imInstances.get(imd);
+        InputMethod im = imInstances.get(imd);
         if (im == null) {
             im = imd.createInputMethod();
             im.setInputMethodContext(this);
@@ -385,6 +394,7 @@
         
     }
     
+    @Override
     public void setCharacterSubsets(Subset[] subsets) {
         if (inputMethod != null) {
             inputMethod.setCharacterSubsets(subsets);
@@ -392,6 +402,7 @@
         super.setCharacterSubsets(subsets);
     }
 
+    @Override
     public void setCompositionEnabled(boolean enable) {
         if (inputMethod != null) {
             inputMethod.setCompositionEnabled(enable);
@@ -413,6 +424,7 @@
         return w;
     }
 
+    @SuppressWarnings("deprecation")
     public void dispatchInputMethodEvent(int id,
                                          AttributedCharacterIterator text,
                                          int committedCharacterCount,

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/ByteBase.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/ByteBase.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/ByteBase.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/ByteBase.java Thu Oct 19 21:23:21 2006
@@ -96,9 +96,8 @@
                 lock = arac.lockArrayLong(array);
             }
             return lock.getAddress() + offset;
-        } else {
-            return addr;
         }
+        return addr;
     }
 
     /**
@@ -110,9 +109,8 @@
                 lock = arac.lockArrayShort(array);
             }
             return lock.getAddress() + offset;
-        } else {
-            return addr;
         }
+        return addr;
     }
 
     void unlock() {
@@ -151,10 +149,9 @@
     public byte get(int index) {
         if (addr == 0) { // throws ArrayIndexOutofBounds
             return array[offset + index];
-        } else {
-            checkIndex(index, 1);
-            return macc.getByte(addr + index);
         }
+        checkIndex(index, 1);
+        return macc.getByte(addr + index);
     }
 
     /**
@@ -253,10 +250,9 @@
     public char getChar(int index) {
         if(addr == 0){
             return getCharFromArray(index);
-        } else {
-            checkIndex(index, 2);
-            return macc.getChar(addr + index);
         }
+        checkIndex(index, 2);
+        return macc.getChar(addr + index);
     }
 
     /**
@@ -335,10 +331,9 @@
     public short getInt16(int index) {
         if(addr == 0){
             return getInt16FromArray(index);
-        } else {
-            checkIndex(index, 2);
-            return macc.getShort(addr + index);
         }
+        checkIndex(index, 2);
+        return macc.getShort(addr + index);
     }
 
     /**
@@ -418,10 +413,9 @@
     public float getFloat(int index) {
         if(addr == 0) {
             return Float.intBitsToFloat(getInt32FromArray(index));
-        } else {
-            checkIndex(index, 4);
-            return macc.getFloat(addr + index);
         }
+        checkIndex(index, 4);
+        return macc.getFloat(addr + index);
     }
 
 
@@ -453,10 +447,9 @@
     public double getDouble(int index) {
         if(addr == 0) {
             return Double.longBitsToDouble(getInt64FromArray(index));
-        } else {
-            checkIndex(index, 8);
-            return macc.getDouble(addr + index);
         }
+        checkIndex(index, 8);
+        return macc.getDouble(addr + index);
     }
 
     /**
@@ -584,10 +577,9 @@
     public int getInt32(int index) {
         if(addr == 0) {
             return getInt32FromArray(index);
-        } else {
-            checkIndex(index, 4);
-            return macc.getInt(addr + index);
         }
+        checkIndex(index, 4);
+        return macc.getInt(addr + index);
     }
 
     /**
@@ -666,10 +658,9 @@
     public long getInt64(int index) {
         if(addr == 0) {
             return getInt64FromArray(index);
-        } else {
-            checkIndex(index, 8);
-            return macc.getLong(addr + index);
         }
+        checkIndex(index, 8);
+        return macc.getLong(addr + index);
     }
 
     /**
@@ -750,12 +741,12 @@
             return CLONG_SIZE == 8
                     ? getInt64FromArray(index)
                     : getInt32FromArray(index) & 0x00000000ffffffffL;
-        } else { // native
-            checkIndex(index, CLONG_SIZE == 8 ? 8 : 4);
-            return CLONG_SIZE == 8
-                    ? macc.getLong(addr + index)
-                    : macc.getInt(addr + index) & 0x00000000ffffffffL;
         }
+        // native
+        checkIndex(index, CLONG_SIZE == 8 ? 8 : 4);
+        return CLONG_SIZE == 8
+                ? macc.getLong(addr + index)
+                : macc.getInt(addr + index) & 0x00000000ffffffffL;
     }
 
     /**
@@ -832,11 +823,10 @@
         if(addr != 0) {
             checkIndex(index, POINTER_SIZE == 8 ? 8 : 4);
             return macc.getPointer(addr + index);
-        } else {
-            return POINTER_SIZE == 8
-                    ? getInt64FromArray(index)
-                    : getInt32FromArray(index);
         }
+        return POINTER_SIZE == 8
+                ? getInt64FromArray(index)
+                : getInt32FromArray(index);
     }
 
     /**
@@ -908,9 +898,8 @@
                 max = (int) strlen;
             }
             return getStringFromArray(max);
-        } else {
-            return stac.createString(addr, strlen);
         }
+        return stac.createString(addr, strlen);
     }
 
     /**
@@ -1011,12 +1000,11 @@
                     + ((array[index++] & 0xff) << 16)
                     + ((array[index++] & 0xff) << 8)
                     + array[index];
-        } else {
-            return (array[index++] & 0xff)
-                    + ((array[index++] & 0xff) << 8)
-                    + ((array[index++] & 0xff) << 16)
-                    + (array[index] << 24);
         }
+        return (array[index++] & 0xff)
+                + ((array[index++] & 0xff) << 8)
+                + ((array[index++] & 0xff) << 16)
+                + (array[index] << 24);
     }
 
     void setInt32InArray(int index, int value) {
@@ -1046,17 +1034,15 @@
                     + ((array[index++] & 0xffl) << 16)
                     + ((array[index++] & 0xffl) << 8)
                     + array[index];
-        } else {
-            return (array[index++] & 0xffl)
-                    + ((array[index++] & 0xffl) << 8)
-                    + ((array[index++] & 0xffl) << 16)
-                    + ((array[index++] & 0xffl) << 24)
-                    + ((array[index++] & 0xffl) << 32)
-                    + ((array[index++] & 0xffl) << 40)
-                    + ((array[index++] & 0xffl) << 48)
-                    + ((array[index] & 0xffl) << 56);
-
         }
+        return (array[index++] & 0xffl)
+                + ((array[index++] & 0xffl) << 8)
+                + ((array[index++] & 0xffl) << 16)
+                + ((array[index++] & 0xffl) << 24)
+                + ((array[index++] & 0xffl) << 32)
+                + ((array[index++] & 0xffl) << 40)
+                + ((array[index++] & 0xffl) << 48)
+                + ((array[index] & 0xffl) << 56);
     }
 
     void setInt64InArray(int index, long value) {
@@ -1100,9 +1086,9 @@
     void setStringInArray(String str) {
         char[] chars = str.toCharArray();
         int index = offset;
-        for (int i = 0; i < chars.length; i++) {
-            array[index++] = (byte) chars[i];
-            array[index++] = (byte) (chars[i] >> 8);
+        for (char element : chars) {
+            array[index++] = (byte) element;
+            array[index++] = (byte) (element >> 8);
         }
         //-- 2 null value are terminated the string
         array[index++] = 0;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/CLongPointer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/CLongPointer.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/CLongPointer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/CLongPointer.java Thu Oct 19 21:23:21 2006
@@ -22,7 +22,7 @@
 
 public class CLongPointer extends VoidPointer {
 
-    private static int CLONG_SIZE_FACTOR = ByteBase.CLONG_SIZE;
+    private static final int CLONG_SIZE_FACTOR = ByteBase.CLONG_SIZE;
 
     CLongPointer(int size, boolean direct) {
         super(size * CLONG_SIZE_FACTOR, direct);
@@ -41,6 +41,7 @@
     }
 
     /** returns the number of elements in array referenced by this object. If size is unknown returns -1.  */
+    @Override
     public int size() {
         return byteBase.size() / CLONG_SIZE_FACTOR;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/DoublePointer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/DoublePointer.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/DoublePointer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/DoublePointer.java Thu Oct 19 21:23:21 2006
@@ -22,7 +22,7 @@
 
 public class DoublePointer extends VoidPointer {
 
-    private static int DOUBLE_SIZE_FACTOR = 8;
+    private static final int DOUBLE_SIZE_FACTOR = 8;
 
     DoublePointer(int size, boolean direct) {
         super(size * DOUBLE_SIZE_FACTOR, direct);
@@ -97,6 +97,7 @@
         }
     }
 
+    @Override
     public int size() {
         return byteBase.size() / DOUBLE_SIZE_FACTOR;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/FloatPointer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/FloatPointer.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/FloatPointer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/FloatPointer.java Thu Oct 19 21:23:21 2006
@@ -22,7 +22,7 @@
 
 public class FloatPointer extends VoidPointer {
 
-    private static int FLOAT_SIZE_FACTOR = 4;
+    private static final int FLOAT_SIZE_FACTOR = 4;
 
     FloatPointer(int size, boolean direct) {
         super(size * FLOAT_SIZE_FACTOR, direct);
@@ -91,6 +91,7 @@
         return new FloatPointer(byteBase.getBytesBaseElementPointer(index * FLOAT_SIZE_FACTOR, FLOAT_SIZE_FACTOR));
     }
 
+    @Override
     public int size() {
         return byteBase.size() / FLOAT_SIZE_FACTOR;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int16Pointer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int16Pointer.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int16Pointer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int16Pointer.java Thu Oct 19 21:23:21 2006
@@ -26,7 +26,7 @@
  */
 public class Int16Pointer extends VoidPointer {
 
-    private static int INT16_SIZE_FACTOR = 2;
+    private static final int INT16_SIZE_FACTOR = 2;
 
     //-- TODO: char array support is unimplemented yet
     private char[] array;
@@ -63,6 +63,7 @@
      * returns the number of elements in array referenced by this object.
      * If size is unknown returns -1.
      */
+    @Override
     public int size() {
         return byteBase.size() / INT16_SIZE_FACTOR;
     }
@@ -176,6 +177,7 @@
     /**
      * @see VoidPointer#isDirect()
      */
+    @Override
     public boolean isDirect() {
         return byteBase != null ? byteBase.isDirect() : false;
     }
@@ -184,18 +186,16 @@
     public String getString(){
         if(byteBase != null) {
             return byteBase.getString();
-        } else {
-            throw new UnsupportedOperationException("not inmplemented");
         }
+        throw new UnsupportedOperationException("not implemented");
     }
 
     /** convert UTF16 bytes to String */
     public String getString(long strlen){
         if(byteBase != null) {
             return byteBase.getString(strlen);
-        } else {
-            throw new UnsupportedOperationException("not inmplemented");
         }
+        throw new UnsupportedOperationException("not implemented");
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int32Pointer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int32Pointer.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int32Pointer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int32Pointer.java Thu Oct 19 21:23:21 2006
@@ -22,7 +22,7 @@
 
 public class Int32Pointer extends VoidPointer {
 
-    private static int INT32_SIZE_FACTOR = 4;
+    private static final int INT32_SIZE_FACTOR = 4;
 
     Int32Pointer(int size, boolean direct) {
         super(size * INT32_SIZE_FACTOR, direct);
@@ -41,6 +41,7 @@
     }
 
     /** returns the number of elements in array referenced by this object. If size is unknown returns -1.  */
+    @Override
     public int size() {
          return byteBase.size() / INT32_SIZE_FACTOR;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int64Pointer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int64Pointer.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int64Pointer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int64Pointer.java Thu Oct 19 21:23:21 2006
@@ -22,7 +22,7 @@
 
 public class Int64Pointer extends VoidPointer {
 
-    private static int INT64_SIZE_FACTOR = 8;
+    private static final int INT64_SIZE_FACTOR = 8;
 
     Int64Pointer(int size, boolean direct) {
         super(size * INT64_SIZE_FACTOR, direct);
@@ -41,6 +41,7 @@
     }
 
     /** returns the number of elements in array referenced by this object. If size is unknown returns -1.  */
+    @Override
     public int size() {
         return byteBase.size() / INT64_SIZE_FACTOR;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int8Pointer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int8Pointer.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int8Pointer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/Int8Pointer.java Thu Oct 19 21:23:21 2006
@@ -51,6 +51,7 @@
         super(base);
     }
 
+    @Override
     public int size() {
         return byteBase.size();
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/NativeBridge.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/NativeBridge.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/NativeBridge.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/NativeBridge.java Thu Oct 19 21:23:21 2006
@@ -28,7 +28,7 @@
     private NativeBridge() {
     }
 
-    private static NativeBridge instance = new NativeBridge();
+    private static final NativeBridge instance = new NativeBridge();
     private static final MemoryAccessor memAccess = AccessorFactory.getMemoryAccessor();
     public static final int ptrSize = memAccess.getPointerSize();
     public static final boolean is64 = (ptrSize == 8);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/PointerPointer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/PointerPointer.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/PointerPointer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/PointerPointer.java Thu Oct 19 21:23:21 2006
@@ -22,7 +22,7 @@
 
 public class PointerPointer extends VoidPointer {
 
-    private static int PP_SIZE_FACTOR = ByteBase.POINTER_SIZE;
+    private static final int PP_SIZE_FACTOR = ByteBase.POINTER_SIZE;
 
     PointerPointer(int size, boolean direct) {
         super(size * PP_SIZE_FACTOR, direct);
@@ -52,6 +52,7 @@
     }
 
     /** returns the number of elements in array referenced by this object. If size is unknown returns -1.  */
+    @Override
     public int size() {
     int tmp = byteBase.size();
         return  tmp == -1 ? -1 : tmp / PP_SIZE_FACTOR;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/state/MenuState.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/state/MenuState.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/state/MenuState.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/state/MenuState.java Thu Oct 19 21:23:21 2006
@@ -20,7 +20,6 @@
  */
 package org.apache.harmony.awt.state;
 
-import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.FontMetrics;
 import java.awt.Point;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/ActionSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/ActionSet.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/ActionSet.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/ActionSet.java Thu Oct 19 21:23:21 2006
@@ -47,6 +47,7 @@
         public InsertBreakAction() {
             isEditAction = true;
         }
+        @Override
         public void internalPerformAction(final TextKit tk) {
             tk.replaceSelectedText("\n");
         }
@@ -56,6 +57,7 @@
         public InsertTabAction() {
             isEditAction = true;
         }
+        @Override
         public void internalPerformAction(final TextKit tk) {
             tk.replaceSelectedText("\t");
         }
@@ -66,12 +68,14 @@
             isEditAction = true;
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             TextUtils.cut(tk);
         }
     }
 
     private static class CopyAction extends AWTTextAction {
+        @Override
         public void internalPerformAction(final TextKit tk) {
             TextUtils.copy(tk);
         }
@@ -82,18 +86,21 @@
             isEditAction = true;
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             TextUtils.paste(tk);
         }
     }
 
     private static class BeepAction extends AWTTextAction {
+        @Override
         public void internalPerformAction(final TextKit tk) {
             Toolkit.getDefaultToolkit().beep();
         }
     }
 
     private static class SelectAllAction extends AWTTextAction {
+        @Override
         public void internalPerformAction(final TextKit tk) {
             TextCaret caret = tk.getCaret();
             int length = tk.getDocument().getLength();
@@ -103,6 +110,7 @@
     }
 
     private static class DumpModelAction extends AWTTextAction {
+        @Override
         public void internalPerformAction(final TextKit tk) {
             Document doc = tk.getDocument();
             if (doc instanceof AbstractDocument) {
@@ -116,6 +124,7 @@
             isEditAction = true;
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             TextCaret caret = tk.getCaret();
             int curPos = caret.getDot();
@@ -146,6 +155,7 @@
                 selectionPreviousWordAction.equals(name);
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             try {
                 int oldPos = tk.getCaret().getDot();
@@ -166,7 +176,7 @@
 
         private boolean isMovingCaret;
 
-        private static Position.Bias[] auxBiasArray = new Position.Bias[1];
+        private static final Position.Bias[] auxBiasArray = new Position.Bias[1];
 
         public NextVisualPositionAction(final String name) {
             if (backwardAction.equals(name)) {
@@ -196,6 +206,7 @@
             }
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             TextCaret caret = tk.getCaret();
             int oldPos = caret.getDot();
@@ -223,6 +234,7 @@
         public DeleteNextCharAction() {
             isEditAction = true;
         }
+        @Override
         public void internalPerformAction(final TextKit tk) {
              TextCaret caret = tk.getCaret();
              int curPos = caret.getDot();
@@ -246,11 +258,12 @@
     }
 
     private static class EndAction extends AWTTextAction {
-        private boolean isMovingCaret;
+        private final boolean isMovingCaret;
         public EndAction(final String name) {
             isMovingCaret = selectionEndAction.equals(name);
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
                 int length = tk.getDocument().getLength();
                 TextUtils.changeCaretPosition(tk, length, isMovingCaret);
@@ -260,11 +273,12 @@
     }
 
     private static class EndLineAction extends AWTTextAction {
-        private boolean isMovingCaret;
+        private final boolean isMovingCaret;
         public EndLineAction(final String name) {
             isMovingCaret = selectionEndLineAction.equals(name);
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             try {
                 TextCaret caret = tk.getCaret();
@@ -279,11 +293,12 @@
     }
 
     private static class EndParagraphAction extends AWTTextAction {
-        private boolean isMovingCaret;
+        private final boolean isMovingCaret;
         public EndParagraphAction(final String name) {
             isMovingCaret = selectionEndParagraphAction.equals(name);
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             Document doc = tk.getDocument();
             int curPos = tk.getCaret().getDot();
@@ -298,11 +313,12 @@
 
 
     private static class BeginAction extends AWTTextAction {
-        private boolean isMovingCaret;
+        private final boolean isMovingCaret;
         public BeginAction(final String name) {
             isMovingCaret = (selectionBeginAction.equals(name));
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
                 TextUtils.changeCaretPosition(tk, 0, isMovingCaret);
                 TextUtils.setCurrentPositionAsMagic(tk);
@@ -311,11 +327,12 @@
     }
 
     private static class BeginLineAction extends AWTTextAction {
-        private boolean isMovingCaret;
+        private final boolean isMovingCaret;
         public BeginLineAction(final String name) {
             isMovingCaret = selectionBeginLineAction.equals(name);
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             try {
                TextCaret caret = tk.getCaret();
@@ -330,11 +347,12 @@
     }
 
     private static class BeginParagraphAction extends AWTTextAction {
-        private boolean isMovingCaret;
+        private final boolean isMovingCaret;
         public BeginParagraphAction(final String name) {
             isMovingCaret =  selectionBeginParagraphAction.equals(name);
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             Document doc = tk.getDocument();
             int curPos = tk.getCaret().getDot();
@@ -346,11 +364,12 @@
     }
 
     private static class BeginWordAction extends AWTTextAction {
-        private boolean isMovingCaret;
+        private final boolean isMovingCaret;
         public BeginWordAction(final String name) {
             isMovingCaret = selectionBeginWordAction.equals(name);
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             try {
                 int oldPos = tk.getCaret().getDot();
@@ -363,11 +382,12 @@
     }
 
     private static class EndWordAction extends AWTTextAction {
-        private boolean isMovingCaret;
+        private final boolean isMovingCaret;
         public EndWordAction(final String name) {
             isMovingCaret = selectionEndWordAction.equals(name);
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             try {
                 int oldPos = tk.getCaret().getDot();
@@ -385,11 +405,12 @@
 
 
     private static class NextWordAction extends AWTTextAction {
-        private boolean isMovingCaret;
+        private final boolean isMovingCaret;
         public NextWordAction(final String name) {
              isMovingCaret = selectionNextWordAction.equals(name);
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             try {
                 int oldPos = tk.getCaret().getDot();
@@ -444,6 +465,7 @@
         }
 
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             try {
                 TextCaret caret = tk.getCaret();
@@ -488,6 +510,7 @@
     }
 
     private static class SelectLineAction extends AWTTextAction {
+        @Override
         public void internalPerformAction(final TextKit tk) {
             TextCaret caret = tk.getCaret();
             int curPos = caret.getDot();
@@ -503,6 +526,7 @@
     }
 
     private static class SelectParagraphAction extends AWTTextAction {
+        @Override
         public void internalPerformAction(final TextKit tk) {
             Document doc = tk.getDocument();
             TextCaret caret = tk.getCaret();
@@ -520,6 +544,7 @@
     }
 
     private static class SelectWordAction extends AWTTextAction {
+        @Override
         public void internalPerformAction(final TextKit tk) {
             TextCaret caret = tk.getCaret();
             int curPos = caret.getDot();
@@ -538,6 +563,7 @@
     }
 
     private static class UnselectAction extends AWTTextAction {
+        @Override
         public void internalPerformAction(final TextKit tk) {
             TextCaret caret = tk.getCaret();
             caret.setDot(caret.getDot(),
@@ -547,6 +573,7 @@
 
     private static class ToggleComponentOrientationAction
         extends AWTTextAction {
+        @Override
         public void internalPerformAction(final TextKit tk) {
             Component component = tk.getComponent();
             if (component.getComponentOrientation().isLeftToRight()) {
@@ -562,7 +589,7 @@
     private static class PageAction extends AWTTextAction {
         protected int direction = 0;
 
-        private static Position.Bias[] biasRet = new Position.Bias[1];
+        private static final Position.Bias[] biasRet = new Position.Bias[1];
 
         public PageAction(final String name) {
             if (selectionPageLeftAction.equals(name)) {
@@ -572,6 +599,7 @@
             }
         }
 
+        @Override
         public void internalPerformAction(final TextKit tk) {
             Rectangle rect = tk.getVisibleRect();
             Point pt;
@@ -599,9 +627,9 @@
         return root.getElement(root.getElementIndex(offset));
     }
 
-    public static HashMap actionMap;
+    public static HashMap<String, AWTTextAction> actionMap;
     static {
-        actionMap = new HashMap();
+        actionMap = new HashMap<String, AWTTextAction>();
         actionMap.put(deletePrevCharAction,  new DeletePrevCharAction());
         actionMap.put(insertBreakAction, new InsertBreakAction());
         actionMap.put(previousWordAction, new PreviousWordAction(previousWordAction));

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/InputMethodRequestsImpl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/InputMethodRequestsImpl.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/InputMethodRequestsImpl.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/InputMethodRequestsImpl.java Thu Oct 19 21:23:21 2006
@@ -86,6 +86,7 @@
             return changeIndex(start);
         }
 
+        @Override
         public Object clone() {
             try {
                 IteratorConcatination newIterator = (IteratorConcatination)
@@ -96,9 +97,9 @@
             }
         }
 
-        public Set getAllAttributeKeys() {
-            HashSet attributeKeys = new HashSet(first.
-                                                getAllAttributeKeys());
+        public Set<Attribute> getAllAttributeKeys() {
+            HashSet<Attribute> attributeKeys = new HashSet<Attribute>(first
+                    .getAllAttributeKeys());
             attributeKeys.addAll(second.getAllAttributeKeys());
             return attributeKeys;
         }
@@ -107,7 +108,7 @@
             return iterator.getAttribute(attribute);
         }
 
-        public Map getAttributes() {
+        public Map<Attribute, Object> getAttributes() {
             return iterator.getAttributes();
         }
 
@@ -131,7 +132,7 @@
             return iterator.getRunLimit(attribute);
         }
 
-        public int getRunLimit(final Set set) {
+        public int getRunLimit(final Set<? extends Attribute> set) {
             return iterator.getRunLimit(set);
         }
 
@@ -143,7 +144,7 @@
             return iterator.getRunStart(attribute);
         }
 
-        public int getRunStart(final Set set) {
+        public int getRunStart(final Set<? extends Attribute> set) {
             return iterator.getRunStart(set);
         }
 
@@ -306,7 +307,7 @@
         AttributedString attributedString = new AttributedString(s);
         for (int i = start; i < end; i++) {
             AttributeSet ass = getAttributeSet(i);
-            Enumeration names;
+            Enumeration<?> names;
             for (names = ass.getAttributeNames();
                  names.hasMoreElements();) {
                 Object key = names.nextElement();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextFactory.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextFactory.java Thu Oct 19 21:23:21 2006
@@ -40,15 +40,15 @@
     }
 
     private static TextFactory createTextFactory() {
-        PrivilegedAction createAction = new PrivilegedAction() {
-            public Object run() {
+        PrivilegedAction<TextFactory> createAction = new PrivilegedAction<TextFactory>() {
+            public TextFactory run() {
                 try {
-                    Class factoryImplClass = Class
+                    Class<?> factoryImplClass = Class
                         .forName(FACTORY_IMPL_CLS_NAME);
-                    Constructor defConstr =
+                    Constructor<?> defConstr =
                         factoryImplClass.getDeclaredConstructor(new Class[0]);
                     defConstr.setAccessible(true);
-                    return defConstr.newInstance(new Object[0]);
+                    return (TextFactory)defConstr.newInstance(new Object[0]);
                 } catch (ClassNotFoundException e) {
                     e.printStackTrace();
 
@@ -67,10 +67,7 @@
             }
         };
 
-        TextFactory factory =
-            (TextFactory)AccessController.doPrivileged(createAction);
-
-        return factory;
+        return AccessController.doPrivileged(createAction);
     }
 
     public abstract RootViewContext createRootView(final Element element);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextUtils.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextUtils.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextUtils.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/text/TextUtils.java Thu Oct 19 21:23:21 2006
@@ -332,7 +332,7 @@
         if (pos < 0 || pos > length) {
             throwException("No word at " + pos, pos);
         }
-        String content = content = doc.getText(0, doc.getLength());
+        String content = doc.getText(0, doc.getLength());
         bi.setText(content);
         return (pos < bi.last()) ? bi.following(pos) : pos;
    }
@@ -579,19 +579,18 @@
         if (direction == SwingConstants.WEST
                 || direction == SwingConstants.EAST) {
             return getNextVisualPosition(v, pos, bias, direction, biasRet);
-        } else {
-            Point pt = textKit.getCaret().getMagicCaretPosition();
-            if (direction == SwingConstants.NORTH) {
-                return TextUtils.getPositionAbove(textKit, pos,
-                                                  pt != null ? pt.x
-                        : v.modelToView(pos, shape, bias).getBounds().x);
-            } else if (direction == SwingConstants.SOUTH) {
-                return TextUtils.getPositionBelow(textKit, pos, pt != null ? pt.x
-                        : v.modelToView(pos, shape, bias).getBounds().x);
-            }
-
-            throw new IllegalArgumentException("Invalid direction");
         }
+        Point pt = textKit.getCaret().getMagicCaretPosition();
+        if (direction == SwingConstants.NORTH) {
+            return TextUtils.getPositionAbove(textKit, pos,
+                                              pt != null ? pt.x
+                    : v.modelToView(pos, shape, bias).getBounds().x);
+        } else if (direction == SwingConstants.SOUTH) {
+            return TextUtils.getPositionBelow(textKit, pos, pt != null ? pt.x
+                    : v.modelToView(pos, shape, bias).getBounds().x);
+        }
+
+        throw new IllegalArgumentException("Invalid direction");
     }
 
 
@@ -668,13 +667,12 @@
             return pos;
         }
         if (b0 == forward && pos == endParagraph) {
-            if (nextIsLTR) {
-                return pos + 1;
-            } else {
+                if (nextIsLTR) {
+                    return pos + 1;
+                }
                 biasRet[0] = backward;
                 return neighboringElement.getEndOffset();
             }
-            }
         }
         return -1;
     }
@@ -692,18 +690,16 @@
         if (pos == end && direction && b0 == forward) {
             biasRet[0] = backward;
             return pos + 1;
-        } else if (pos == start + 1 && pos <= end  && !direction) {
+        } else if (pos == start + 1 && pos <= end && !direction) {
             return pos - 1;
         } else if (pos == start) {
             if (direction) {
                 return (b0 == forward) ? pos + 1 : pos - 1;
-            } else {
-                biasRet[0] = b0;
-                return neighbouringElement.getStartOffset();
             }
+            biasRet[0] = b0;
+            return neighbouringElement.getStartOffset();
         } else {
-            return getTrivialVisualPosition(toWest, pos, b0, length, biasRet,
-                                            isLTR);
+            return getTrivialVisualPosition(toWest, pos, b0, length, biasRet, isLTR);
         }
     }
 
@@ -734,7 +730,7 @@
         int alignment = tfk.getHorizontalAlignment();
         boolean toLeft = isToLeft(orientation, alignment);
         int offset = 0;
-        if (alignment == View.CENTER) {
+        if (alignment == SwingConstants.CENTER) {
             offset = diff / 2;
         } else {
             offset = toLeft ? 0 : diff;
@@ -771,7 +767,7 @@
         }
         Shape result = null;
         try {
-            result = (Rectangle)view.modelToView(Math.min(p0, p1),
+            result = view.modelToView(Math.min(p0, p1),
                                                    Position.Bias.Forward,
                                                    Math.max(p0, p1),
                                                    Position.Bias.Backward,
@@ -899,14 +895,12 @@
         }
         DataFlavor[] flavors = t.getTransferDataFlavors();
         DataFlavor flavor = null;
-        for (int i = 0; i < flavors.length; i++) {
-            flavor = flavors[0];
-            if (String.class.isAssignableFrom(flavor
-                                              .getRepresentationClass())) {
+        for (DataFlavor element : flavors) {
+            flavor = element;
+            if (String.class.isAssignableFrom(flavor.getRepresentationClass())) {
                 break;
-            } else {
-                flavor = null;
             }
+            flavor = null;
         }
         if (flavor != null) {
             try {
@@ -1048,7 +1042,7 @@
 
     public static int getCalendarField(final JFormattedTextField textField) {
         DateFormatter formatter = (DateFormatter)textField.getFormatter();
-        Field[] fields = fields = formatter.getFields(textField.getCaretPosition());
+        Field[] fields = formatter.getFields(textField.getCaretPosition());
 
         for (int i = textField.getCaretPosition(); fields.length == 0 || i < 0; i--) {
             fields = formatter.getFields(i);
@@ -1085,7 +1079,7 @@
 
     public static Object getNextValue(final Date value,
                                       final int calendarField,
-                                      final Comparable end) {
+                                      final Comparable<Date> end) {
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(value);
         calendar.add(calendarField, 1);
@@ -1096,7 +1090,7 @@
 
     public static Object getPreviousValue(final Date value,
                                           final int calendarField,
-                                          final Comparable start) {
+                                          final Comparable<Date> start) {
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(value);
         calendar.add(calendarField, -1);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultButton.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultButton.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultButton.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultButton.java Thu Oct 19 21:23:21 2006
@@ -79,7 +79,6 @@
     }
 
     public static void drawText(Graphics g, ButtonState s) {
-        Rectangle rect = s.getBounds();
         String text = s.getText();
         boolean pressed = s.isPressed();
         Color foreColor = s.isTextColorSet() ?

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java Thu Oct 19 21:23:21 2006
@@ -60,6 +60,7 @@
     class Separator extends Canvas {
         private static final long serialVersionUID = -9191946485695242726L;
 
+        @Override
         public void paint(Graphics g) {
             g.setColor(SystemColor.controlDkShadow);
             g.drawLine(0, 0, getWidth(), 0);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenu.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenu.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenu.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenu.java Thu Oct 19 21:23:21 2006
@@ -216,7 +216,6 @@
         int margin = spacing + itemHeight/4;
 
         Point location = s.getLocation();
-        Dimension itemSize = s.getItem(index).getMenuSize();
         Point result = new Point(location);
         result.translate(s.getWidth() - margin, y - spacing);
         // TODO: ajust position according to sumbenu size

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenuBar.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenuBar.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenuBar.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultMenuBar.java Thu Oct 19 21:23:21 2006
@@ -116,8 +116,9 @@
         for (int i=0; i<s.getItemCount(); i++) {
             MenuItemState is = s.getItem(i);
             Rectangle bounds = is.getItemBounds();
-            if (bounds.contains(p))
+            if (bounds.contains(p)) {
                 return i;
+            }
         }
 
         return -1;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultScrollbar.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultScrollbar.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultScrollbar.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultScrollbar.java Thu Oct 19 21:23:21 2006
@@ -44,9 +44,9 @@
     static final int SOUTH = 5;
     static final int WEST = 7;
 
-    private static Color trackHighlightColor = SystemColor.controlDkShadow;;
-    private static Color arrowColor = Color.BLACK;
-    private static Color focusColor = SystemColor.controlDkShadow;
+    private static final Color trackHighlightColor = SystemColor.controlDkShadow;;
+    private static final Color arrowColor = Color.BLACK;
+    private static final Color focusColor = SystemColor.controlDkShadow;
 
     public static void draw(Graphics g, ScrollbarState s) {
         Dimension size = s.getSize();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/GraphicsFactory.java Thu Oct 19 21:23:21 2006
@@ -25,10 +25,8 @@
 import java.awt.Graphics2D;
 import java.awt.GraphicsEnvironment;
 import java.awt.peer.FontPeer;
-
 import org.apache.harmony.awt.gl.MultiRectArea;
 import org.apache.harmony.awt.gl.font.FontManager;
-import org.apache.harmony.awt.gl.font.FontProperty;
 
 
 /**
@@ -48,6 +46,7 @@
      * @return New Graphics2D instance for specified native window
      * @deprecated
      */
+    @Deprecated
     Graphics2D getGraphics2D(NativeWindow win, int translateX, int translateY, MultiRectArea clip);
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventQueue.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventQueue.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventQueue.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventQueue.java Thu Oct 19 21:23:21 2006
@@ -35,7 +35,7 @@
     private ShutdownWatchdog shutdownWatchdog;
     private class EventMonitor {}
     private final Object eventMonitor = new EventMonitor();
-    private final LinkedList eventQueue = new LinkedList();
+    private final LinkedList<NativeEvent> eventQueue = new LinkedList<NativeEvent>();
 
     public static abstract class Task {
         public volatile Object returnValue;
@@ -72,7 +72,7 @@
                 shutdownWatchdog.setNativeQueueEmpty(true);
                 return null;
             }
-            return (NativeEvent)eventQueue.remove(0);
+            return eventQueue.remove(0);
         }
     }
     

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventThread.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventThread.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventThread.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeEventThread.java Thu Oct 19 21:23:21 2006
@@ -40,6 +40,7 @@
         setDaemon(true);
     }
 
+    @Override
     public void run() {
         synchronized (this) {
             try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeIM.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeIM.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeIM.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/NativeIM.java Thu Oct 19 21:23:21 2006
@@ -30,11 +30,9 @@
 import java.lang.Character.Subset;
 import java.util.Locale;
 
-import org.apache.harmony.awt.ContextStorage;
-
 /**
  * A cross-platform interface for native input
- * method subsysem functionality.
+ * method sub-system functionality.
  */
 public abstract class NativeIM implements InputMethod, InputMethodDescriptor {
     protected InputMethodContext imc;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/ShutdownThread.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/ShutdownThread.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/ShutdownThread.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/ShutdownThread.java Thu Oct 19 21:23:21 2006
@@ -32,6 +32,7 @@
     
     private boolean shouldStop = false;
 
+    @Override
     public void run() {
         synchronized (this) {
             notifyAll(); // synchronize the startup
@@ -50,6 +51,7 @@
         }
     }
 
+    @Override
     public void start() {
         synchronized (this) {
             super.start();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/Synchronizer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/Synchronizer.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/Synchronizer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/Synchronizer.java Thu Oct 19 21:23:21 2006
@@ -41,28 +41,28 @@
      * To free synchronizer unlock method must be called $acquestCounter times.
      * Equals to 0 when synchronizer is free.
      */
-    protected int acquestCounter = 0;
+    protected int acquestCounter;
 
     /**
      * This field holds the owner of synchronizer.
-     * Owner of synchronizer is a last thread that succesfully locked synchronizer and
+     * Owner of synchronizer is a last thread that successfully locked synchronizer and
      * still havn't freed it. Equals to null when synchronizer is free.
      */
-    protected Thread owner = null;
+    protected Thread owner;
 
     /**
      * This field holds the wait queue.
      * Wait queue is a queue where thread wait for synchronizer access.
      * Empty when synchronizer is free.
      */
-    protected final LinkedList waitQueue = new LinkedList();
+    protected final LinkedList<Thread> waitQueue = new LinkedList<Thread>();
 
     /**
      * The event dispatch thread
      */
-    protected Thread dispatchThread = null;
+    protected Thread dispatchThread;
 
-    private final Hashtable storedStates = new Hashtable();
+    private final Hashtable<Thread, Integer> storedStates = new Hashtable<Thread, Integer>();
 
     /**
      * Acquire the lock for this synchronizer. Nested lock is supported.
@@ -119,7 +119,7 @@
             if (acquestCounter == 0) {
                 if (waitQueue.size() > 0) {
                     acquestCounter = 1;
-                    owner = (Thread) waitQueue.removeFirst();
+                    owner = waitQueue.removeFirst();
                     owner.interrupt();
                 } else {
                     owner = null;
@@ -170,7 +170,7 @@
             }
 
             lock();
-            acquestCounter = ((Integer) storedStates.get(curThread)).intValue();
+            acquestCounter = storedStates.get(curThread).intValue();
             storedStates.remove(curThread);
         }
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/SystemProperties.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/SystemProperties.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/SystemProperties.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/wtk/SystemProperties.java Thu Oct 19 21:23:21 2006
@@ -21,6 +21,7 @@
 package org.apache.harmony.awt.wtk;
 
 import java.awt.Font;
+import java.awt.font.TextAttribute;
 import java.awt.im.InputMethodHighlight;
 import java.util.Map;
 
@@ -46,7 +47,7 @@
     /**
      * Fill the given Map with system properties
      */
-    void init(Map desktopProperties);
+    void init(Map<String, ?> desktopProperties);
 
     /**
      * Fills the given map with system-dependent visual text
@@ -54,5 +55,5 @@
      * of the given input method highlight
      * @see java.awt.Toolkit.mapInputMethodHighlight()
      */
-    void mapInputMethodHighlight(InputMethodHighlight highlight, Map map);
+    void mapInputMethodHighlight(InputMethodHighlight highlight, Map<TextAttribute, ?> map);
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinClipboard.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinClipboard.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinClipboard.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinClipboard.java Thu Oct 19 21:23:21 2006
@@ -45,17 +45,21 @@
         winEventQueue.addPreprocessor(this);
     }
 
+    @Override
     public void onShutdown() {
     }
 
+    @Override
     public void onRestart() {
     }
 
+    @Override
     public void setContents(Transferable contents, ClipboardOwner owner) {
         DataSource dc = new DataSource(contents);
         final DataSnapshot snapshot = new DataSnapshot(dc);
 
         WinEventQueue.Task task = new WinEventQueue.Task() {
+            @Override
             public void perform() {
                 WinDataTransfer.setClipboardContents(snapshot);
             }
@@ -64,13 +68,16 @@
         // TODO: fire flavor change events
     }
 
+    @Override
     public Object getData(DataFlavor flavor)
             throws UnsupportedFlavorException, IOException {
         return getContents(this).getTransferData(flavor);
     }
 
+    @Override
     public Transferable getContents(Object requestor) {
         WinEventQueue.Task task = new WinEventQueue.Task() {
+            @Override
             public void perform() {
                 WinDataTransfer.IDataObject dataObject = 
                         WinDataTransfer.getClipboardContents();
@@ -83,6 +90,7 @@
         return (DataProxy)task.returnValue;
     }
     
+    @Override
     public DataFlavor[] getAvailableDataFlavors() {
         Transferable t = getContents(this);
         return (t != null) ? 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDTK.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDTK.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDTK.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDTK.java Thu Oct 19 21:23:21 2006
@@ -49,14 +49,17 @@
     private static final String windowClass = 
         "org.apache.harmony.awt.datatransfer.window";
 
+    @Override
     protected NativeClipboard newNativeClipboard() {
         return new WinClipboard();
     }
 
+    @Override
     protected NativeClipboard newNativeSelection() {
         return null;
     }
 
+    @Override
     public void initDragAndDrop() {
         WinDataTransfer.init();
         
@@ -70,6 +73,7 @@
                 WindowsDefs.HWND_MESSAGE, 0, 0, null);
     }
     
+    @Override
     public void runEventLoop() {
         Win32.MSG msg = win32.createMSG(false);
         while (win32.GetMessageW(msg, 0, 0, 0) != 0) {
@@ -77,16 +81,19 @@
         }
     }
 
+    @Override
     public DropTargetContextPeer createDropTargetContextPeer(
             DropTargetContext context) {
         return new WinDropTarget(this, context);
     }
 
+    @Override
     public DragSourceContextPeer createDragSourceContextPeer(
             DragGestureEvent dge) {
         return new WinDragSource();
     }
     
+    @Override
     public String getDefaultCharset() {
         return "utf-16le";
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDragSource.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDragSource.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDragSource.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDragSource.java Thu Oct 19 21:23:21 2006
@@ -76,6 +76,7 @@
         final int srcActions = getWinActions(context.getSourceActions());
 
         WinEventQueue.Task task = new WinEventQueue.Task() {
+            @Override
             public void perform() {
                 WinDataTransfer.startDrag(snapshot, 
                         WinDragSource.this, srcActions);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDropTarget.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDropTarget.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDropTarget.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/datatransfer/windows/WinDropTarget.java Thu Oct 19 21:23:21 2006
@@ -83,6 +83,7 @@
     
     private long registerDropTarget() {
         Task task = new Task() {
+            @Override
             public void perform() {
                 long ret = WinDataTransfer.registerDropTarget(
                         hwnd, WinDropTarget.this);



Mime
View raw message