Hi Pavel!

> Your patch looks good. I've only one notice: we don't use "TAB"
> characters in our sources. Can you remove all TABs from your fix?

Yes, of course! I wonder in which step I changed them to TABs!? I send you 
here the same patch but without the TABs.

-Florian

Am Freitag, 11. Januar 2008 schrieb Pavel Porvatov:
> Hi Florian,
>
> > Hi Pavel!
> >
> > As you remember I'm working on adding generics to the Swing-framework. To
> > see if I introduce new warnings while working on this task (especially
> > unchecked and cast warnings) I need to reduce the number of warnings in
> > the Swing-project first.
> >
> > I cloned the following repository:
> > http://hg.openjdk.java.net/jdk7/jdk7/jdk Is this correct?
>
> Yes.
>
> > When compiling with
> > -Xlint -J-Xms80m -J-Xmx256m -Xlint:-serial -Xlint:-deprecation
> > -Xlint:-fallthrough -Xmaxwarns 2300
> > this patch reduces the number of reported warnings from 1277 to 1262.
>
> Your patch looks good. I've only one notice: we don't use "TAB"
> characters in our sources. Can you remove all TABs from your fix?
>
> > The basis of this patch is  the changeset 99a06bc7fdb5. It has been
> > created with 'hg diff'. NetBeans' 'Tools->Apply Diff Patch' does not work
> > unfortunatly but 'hg import' should work.
> >
> > And now: Happy New Year! :-)
>
> Thanks. Our holidays finished a couple days ago. Sorry for delay...
>
> Pavel.


diff -r 99a06bc7fdb5 src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java	Tue Dec 04 16:28:33 2007 -0800
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java	Sat Jan 19 18:10:02 2008 +0100
@@ -225,15 +225,15 @@ public class MotifGraphicsUtils implemen
         if(b.getIcon() != null) {
             Icon icon;
             if(!model.isEnabled()) {
-                icon = (Icon) b.getDisabledIcon();
+                icon = b.getDisabledIcon();
             } else if(model.isPressed() && model.isArmed()) {
-                icon = (Icon) b.getPressedIcon();
+                icon = b.getPressedIcon();
                 if(icon == null) {
                     // Use default icon
-                    icon = (Icon) b.getIcon();
+                    icon = b.getIcon();
                 }
             } else {
-                icon = (Icon) b.getIcon();
+                icon = b.getIcon();
             }
 
             if (icon!=null) {
diff -r 99a06bc7fdb5 src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java	Tue Dec 04 16:28:33 2007 -0800
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java	Sat Jan 19 18:10:02 2008 +0100
@@ -86,18 +86,18 @@ public class MotifInternalFrameTitlePane
 
     protected void assembleSystemMenu() {
         systemMenu = new JPopupMenu();
-        JMenuItem mi = (JMenuItem)systemMenu.add(new JMenuItem(restoreAction));
+        JMenuItem mi = systemMenu.add(new JMenuItem(restoreAction));
         mi.setMnemonic('R');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(moveAction));
+        mi = systemMenu.add(new JMenuItem(moveAction));
         mi.setMnemonic('M');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(sizeAction));
+        mi = systemMenu.add(new JMenuItem(sizeAction));
         mi.setMnemonic('S');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(iconifyAction));
+        mi = systemMenu.add(new JMenuItem(iconifyAction));
         mi.setMnemonic('n');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(maximizeAction));
+        mi = systemMenu.add(new JMenuItem(maximizeAction));
         mi.setMnemonic('x');
         systemMenu.add(new JSeparator());
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(closeAction));
+        mi = systemMenu.add(new JMenuItem(closeAction));
         mi.setMnemonic('C');
 
         systemButton = new SystemButton();
@@ -157,7 +157,7 @@ public class MotifInternalFrameTitlePane
     }
 
     public void propertyChange(PropertyChangeEvent evt) {
-        String prop = (String)evt.getPropertyName();
+        String prop = evt.getPropertyName();
         JInternalFrame f = (JInternalFrame)evt.getSource();
         boolean value = false;
         if (JInternalFrame.IS_SELECTED_PROPERTY.equals(prop)) {
diff -r 99a06bc7fdb5 src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Tue Dec 04 16:28:33 2007 -0800
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Sat Jan 19 18:10:02 2008 +0100
@@ -290,7 +290,7 @@ public class MotifLookAndFeel extends Ba
 
         Object unselectedTabBackground = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("control");
+                Color c = table.getColor("control");
                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
                                            Math.max((int)(c.getGreen()*.85),0),
                                            Math.max((int)(c.getBlue()*.85),0));
@@ -299,7 +299,7 @@ public class MotifLookAndFeel extends Ba
 
         Object unselectedTabForeground = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("controlText");
+                Color c = table.getColor("controlText");
                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
                                            Math.max((int)(c.getGreen()*.85),0),
                                            Math.max((int)(c.getBlue()*.85),0));
@@ -308,7 +308,7 @@ public class MotifLookAndFeel extends Ba
 
         Object unselectedTabShadow = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("control");
+                Color c = table.getColor("control");
                 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
                                        Math.max((int)(c.getGreen()*.85),0),
                                        Math.max((int)(c.getBlue()*.85),0));
@@ -318,7 +318,7 @@ public class MotifLookAndFeel extends Ba
 
         Object unselectedTabHighlight = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("control");
+                Color c = table.getColor("control");
                 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
                                        Math.max((int)(c.getGreen()*.85),0),
                                        Math.max((int)(c.getBlue()*.85),0));

Reply via email to