harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r449567 - in /incubator/harmony/enhanced/classlib/trunk/modules/sound: META-INF/ src/main/java/javax/sound/midi/ src/main/java/javax/sound/midi/spi/ src/main/java/javax/sound/sampled/ src/main/java/javax/sound/sampled/spi/ src/main/java/org...
Date Mon, 25 Sep 2006 04:08:25 GMT
Author: ndbeyer
Date: Sun Sep 24 21:08:23 2006
New Revision: 449567

URL: http://svn.apache.org/viewvc?view=rev&rev=449567
Log:
Code cleanup for sound module (source and test):
* Add braces around if/else statements
* Remove unused code
* Fix spelling errors
* Add annotations for Override
* Eliminate compiler warnings

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiDeviceProvider.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiFileWriter.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioFileFormat.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/AudioFileWriter.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/FormatConversionProvider.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/MixerProvider.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/internal/nls/Messages.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/utils/ProviderService.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SequenceTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SoundbankResourceTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/TrackTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/META-INF/MANIFEST.MF Sun Sep 24 21:08:23 2006
@@ -7,6 +7,7 @@
 Eclipse-JREBundle: true
 Import-Package: java.io,
  java.lang,
+ java.lang.annotation,
  java.net,
  java.security,
  java.util,

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MetaMessage.java Sun Sep 24 21:08:23 2006
@@ -36,12 +36,14 @@
         }
         if (super.length > 3) {
             int n = 3;
-            while ((n <= super.length) && (super.data[n - 1] < 0))
+            while ((n <= super.length) && (super.data[n - 1] < 0)) {
                 n++;
+            }
             dsp = n;
         }
     }
 
+    @Override
     public Object clone() {
         return new MetaMessage(this.getMessage());
     }
@@ -53,17 +55,15 @@
                 bt[i - dsp] = super.data[i];
             }
             return bt;
-        } else {
-            return new byte[0];
         }
+        return new byte[0];
     }
 
     public int getType() {
         if ((super.data != null) && (super.length >= 2)) {
             return super.data[1] & 0xFF;
-        } else {
-            return 0;
         }
+        return 0;
     }
 
     public void setMessage(int type, byte[] data, int length) throws InvalidMidiDataException {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiDevice.java Sun Sep 24 21:08:23 2006
@@ -40,6 +40,7 @@
          * 
          * @see java.lang.Object#equals(java.lang.Object)
          */
+        @Override
         public final boolean equals(Object obj) {
             return this == obj;
         }
@@ -60,6 +61,7 @@
             return version;
         }
 
+        @Override
         public final int hashCode() {
             final int PRIME = 31;
             int result = super.hashCode();
@@ -70,6 +72,7 @@
             return result;
         }
 
+        @Override
         public final String toString() {
             return name;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiMessage.java Sun Sep 24 21:08:23 2006
@@ -33,6 +33,7 @@
         }
     }
 
+    @Override
     public abstract Object clone();
 
     public int getLength() {
@@ -49,9 +50,8 @@
     public int getStatus() {
         if ((data == null) || (length == 0)) {
             return 0;
-        } else {
-            return data[0] & 0xFF;
         }
+        return data[0] & 0xFF;
     }
 
     protected void setMessage(byte[] data, int length) throws InvalidMidiDataException {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/MidiSystem.java Sun Sep 24 21:08:23 2006
@@ -25,6 +25,7 @@
 import java.io.OutputStream;
 import java.net.URL;
 
+import javax.sound.midi.MidiDevice.Info;
 import javax.sound.midi.spi.MidiDeviceProvider;
 import javax.sound.midi.spi.MidiFileReader;
 import javax.sound.midi.spi.MidiFileWriter;
@@ -72,14 +73,14 @@
         /* 
          * obtain the list of MidiDeviceProviders
          */
-        List deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
+        List<?> deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
         /*
-         * find device that describes by parametr info and return it
+         * find device that describes by parameter info and return it
          */
         for (int i = 0; i < deviceProviders.size(); i++) {
             MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-            for (int j = 0; j < deviceInfo.length; j++) {
-                if (deviceInfo[j].equals(info)) {
+            for (Info element : deviceInfo) {
+                if (element.equals(info)) {
                     return ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(info);
                 }
             }
@@ -94,7 +95,7 @@
         /*
          * obtain the list of MidiDeviceProviders
          */
-        List deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
+        List<?> deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
         //variable to save MidiDevice.Info
         List<MidiDevice.Info> infos = new ArrayList<MidiDevice.Info>();
         /*
@@ -102,8 +103,8 @@
          */
         for (int i = 0; i < deviceProviders.size(); i++) {
             MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-            for (int j = 0; j < deviceInfo.length; j++) {
-                infos.add(deviceInfo[j]);
+            for (Info element : deviceInfo) {
+                infos.add(element);
             }
         }
         
@@ -116,7 +117,7 @@
         /*
          * obtain the list of MidiFileReaderProviders
          */
-        List fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
+        List<?> fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
         if (fileReaderProviders.size() == 0) {
             //FIXME
             /*
@@ -138,7 +139,7 @@
         /*
          * obtain the list of MidiFileReaderProviders
          */
-        List fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
+        List<?> fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
         if (fileReaderProviders.size() == 0) {
             //FIXME
             /*
@@ -160,7 +161,7 @@
         /*
          * obtain the list of MidiFileReaderProviders
          */
-        List fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
+        List<?> fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
         if (fileReaderProviders.size() == 0) {
             //FIXME
             /*
@@ -181,7 +182,7 @@
         /*
          * obtain the list of MidiFileWriterProviders
          */
-        List fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
+        List<?> fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
         if (fileWriterProviders.size() == 0) {
             //FIXME
             /*
@@ -202,7 +203,7 @@
         /*
          * obtain the list of MidiFileWriterProviders
          */
-        List fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
+        List<?> fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
         if (fileWriterProviders.size() == 0) {
             //FIXME
             /*
@@ -227,7 +228,7 @@
         /*
          * obtain the list of MidiDeviceProviders
          */
-        List deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
+        List<?> deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
         String provName;
         int deviceNum = -1;
         /*
@@ -250,19 +251,16 @@
              */
             if (deviceNum != -1) {
                 MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDeviceInfo();
-                for (int i = 0; i < deviceInfo.length; i++) {
-                    if (deviceInfo[i].getName().equals(defaultDevice.get(1))) {
+                for (Info element : deviceInfo) {
+                    if (element.getName().equals(defaultDevice.get(1))) {
                         try {
-                            return ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]).getReceiver();
+                            return ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element).getReceiver();
                         } catch (MidiUnavailableException e) {}
                     }
                 }
-            /*
-             * if we don't find the same provider and name, find any receiver describe by provider
-             */
-                for (int i = 0; i < deviceInfo.length; i++) {
+            for (Info element : deviceInfo) {
                     try {
-                        return ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]).getReceiver();
+                        return ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element).getReceiver();
                     } catch (MidiUnavailableException e) {}
                 }
             }
@@ -271,10 +269,10 @@
              */
             for (int i = 0; i < deviceProviders.size(); i++) {
                 MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-                for (int j = 0; j < deviceInfo.length; j++) {
-                    if (deviceInfo[j].getName().equals(defaultDevice.get(1))) {
+                for (Info element : deviceInfo) {
+                    if (element.getName().equals(defaultDevice.get(1))) {
                         try {
-                            return ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]).getReceiver();
+                            return ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element).getReceiver();
                         } catch (MidiUnavailableException e) {}
                     }
                 }
@@ -285,9 +283,9 @@
          */
         for (int i = 0; i < deviceProviders.size(); i++) {
             MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-            for (int j = 0; j < deviceInfo.length; j++) {
+            for (Info element : deviceInfo) {
                 try {
-                    return ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]).getReceiver();
+                    return ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element).getReceiver();
                 } catch (MidiUnavailableException e) {}
             }
         }
@@ -301,7 +299,7 @@
         /*
          * obtain the list of MidiFileReaderProviders
          */
-        List fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
+        List<?> fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
         if (fileReaderProviders.size() == 0) {
             //FIXME
             /*
@@ -323,7 +321,7 @@
         /*
          * obtain the list of MidiFileReaderProviders
          */
-        List fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
+        List<?> fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
         if (fileReaderProviders.size() == 0) {
             //FIXME
             /*
@@ -344,7 +342,7 @@
         /*
          * obtain the list of MidiFileReaderProviders
          */
-        List fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
+        List<?> fileReaderProviders = ProviderService.getProviders(midiFileReaderPath);
         if (fileReaderProviders.size() == 0) {
             //FIXME
             /*
@@ -376,7 +374,7 @@
         /*
          * obtain the list of MidiDeviceProviders
          */
-        List  deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
+        List<?>  deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
         
         Sequencer sequencer;
         Transmitter seqTrans;
@@ -404,11 +402,11 @@
              */
             if (deviceNum != -1) {
                 MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDeviceInfo();
-                for (int i = 0; i < deviceInfo.length; i++) {
-                    if (deviceInfo[i].getName().equals(defaultDevice.get(1))) {
-                        if (((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]) instanceof Sequencer) {
+                for (Info element : deviceInfo) {
+                    if (element.getName().equals(defaultDevice.get(1))) {
+                        if (((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element) instanceof Sequencer) {
                             if (connected) {
-                                sequencer = (Sequencer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]);
+                                sequencer = (Sequencer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element);
                                 seqTrans = sequencer.getTransmitter();
                                 try {
                                     synth = MidiSystem.getSynthesizer();
@@ -422,17 +420,14 @@
                                 seqTrans.setReceiver(recv);
                                 return sequencer;
                             }
-                            return (Sequencer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]);
+                            return (Sequencer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element);
                         }
                     }
                 }
-                /*
-                 * if we don't find the same provider and name, find any receiver describe by provider
-                 */
-                for (int i = 0; i < deviceInfo.length; i++) {
-                    if (((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]) instanceof Sequencer) {
+                for (Info element : deviceInfo) {
+                    if (((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element) instanceof Sequencer) {
                         if (connected) {
-                            sequencer = (Sequencer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]);
+                            sequencer = (Sequencer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element);
                             seqTrans = sequencer.getTransmitter();
                             try {
                                 synth = MidiSystem.getSynthesizer();
@@ -446,7 +441,7 @@
                             seqTrans.setReceiver(recv);
                             return sequencer;
                         }
-                        return (Sequencer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]);
+                        return (Sequencer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element);
                     }
                 }
             }
@@ -455,11 +450,11 @@
              */
             for (int i = 0; i < deviceProviders.size(); i++) {
                 MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-                for (int j = 0; j < deviceInfo.length; j++) {
-                    if (deviceInfo[j].getName().equals(defaultDevice.get(1))) {
-                        if (((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]) instanceof Sequencer) {
+                for (Info element : deviceInfo) {
+                    if (element.getName().equals(defaultDevice.get(1))) {
+                        if (((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element) instanceof Sequencer) {
                             if (connected) {
-                                sequencer = (Sequencer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]);
+                                sequencer = (Sequencer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element);
                                 seqTrans = sequencer.getTransmitter();
                                 try {
                                     synth = MidiSystem.getSynthesizer();
@@ -473,7 +468,7 @@
                                 seqTrans.setReceiver(recv);
                                 return sequencer;
                             }
-                            return (Sequencer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]);
+                            return (Sequencer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element);
                         }
                     }
                 }
@@ -484,10 +479,10 @@
          */
         for (int i = 0; i < deviceProviders.size(); i++) {
             MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-            for (int j = 0; j < deviceInfo.length; j++) {
-                if (((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]) instanceof Sequencer) {
+            for (Info element : deviceInfo) {
+                if (((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element) instanceof Sequencer) {
                     if (connected) {
-                        sequencer = (Sequencer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]);
+                        sequencer = (Sequencer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element);
                         seqTrans = sequencer.getTransmitter();
                         try {
                             synth = MidiSystem.getSynthesizer();
@@ -501,7 +496,7 @@
                         seqTrans.setReceiver(recv);
                         return sequencer;
                     }
-                    return (Sequencer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]);
+                    return (Sequencer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element);
                 }
             }
         }
@@ -516,7 +511,7 @@
         /*
          * obtain the list of SoundbankReaderProviders
          */
-        List soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
+        List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
         if (soundbankReaderProviders.size() == 0) {
             //FIXME
             /*
@@ -537,7 +532,7 @@
         /*
          * obtain the list of SoundbankReaderProviders
          */
-        List soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
+        List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
         if (soundbankReaderProviders.size() == 0) {
             //FIXME
             /*
@@ -558,7 +553,7 @@
         /*
          * obtain the list of SoundbankReaderProviders
          */
-        List soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
+        List<?> soundbankReaderProviders = ProviderService.getProviders(soundbankReaderPath);
         if (soundbankReaderProviders.size() == 0) {
             //FIXME
             /*
@@ -583,7 +578,7 @@
         /*
          * obtain the list of MidiDeviceProviders
          */
-        List deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
+        List<?> deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
         String provName;
         int deviceNum = -1;
         
@@ -607,19 +602,16 @@
              */
             if (deviceNum != -1) {
                 MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDeviceInfo();
-                for (int i = 0; i < deviceInfo.length; i++) {
-                    if (deviceInfo[i].getName().equals(defaultDevice.get(1))) {
-                        if (((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]) instanceof Synthesizer) {
-                            return (Synthesizer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]);
+                for (Info element : deviceInfo) {
+                    if (element.getName().equals(defaultDevice.get(1))) {
+                        if (((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element) instanceof Synthesizer) {
+                            return (Synthesizer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element);
                         }
                     }
                 }
-                /*
-                 * if we don't find the same provider and name, find any receiver describe by provider
-                 */
-                for (int i = 0; i < deviceInfo.length; i++) {
-                    if (((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]) instanceof Synthesizer) {
-                        return (Synthesizer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]);
+                for (Info element : deviceInfo) {
+                    if (((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element) instanceof Synthesizer) {
+                        return (Synthesizer) ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element);
                     }
                 }
             }
@@ -628,10 +620,10 @@
              */
             for (int i = 0; i < deviceProviders.size(); i++) {
                 MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-                for (int j = 0; j < deviceInfo.length; j++) {
-                    if (deviceInfo[j].getName().equals(defaultDevice.get(1))) {
-                        if (((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]) instanceof Synthesizer) {
-                            return (Synthesizer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]);
+                for (Info element : deviceInfo) {
+                    if (element.getName().equals(defaultDevice.get(1))) {
+                        if (((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element) instanceof Synthesizer) {
+                            return (Synthesizer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element);
                         }
                     }
                 }
@@ -642,9 +634,9 @@
          */
         for (int i = 0; i < deviceProviders.size(); i++) {
             MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-            for (int j = 0; j < deviceInfo.length; j++) {
-                if (((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]) instanceof Synthesizer) {
-                    return (Synthesizer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]);
+            for (Info element : deviceInfo) {
+                if (((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element) instanceof Synthesizer) {
+                    return (Synthesizer) ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element);
                 }
             }
         }
@@ -662,7 +654,7 @@
         /*
          * obtain the list of MidiDeviceProviders
          */
-        List deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
+        List<?> deviceProviders = ProviderService.getProviders(midiDeviceProviderPath);
         String provName;
         int deviceNum = -1;
         /*
@@ -685,19 +677,16 @@
              */
             if (deviceNum != -1) {
                 MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDeviceInfo();
-                for (int i = 0; i < deviceInfo.length; i++) {
-                    if (deviceInfo[i].getName().equals(defaultDevice.get(1))) {
+                for (Info element : deviceInfo) {
+                    if (element.getName().equals(defaultDevice.get(1))) {
                         try {
-                            return ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]).getTransmitter();
+                            return ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element).getTransmitter();
                         } catch (MidiUnavailableException e) {}
                     }
                 }
-                /*
-                 * if we don't find the same provider and name, find any receiver describe by provider
-                 */
-                for (int i = 0; i < deviceInfo.length; i++) {
+                for (Info element : deviceInfo) {
                     try {
-                        return ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(deviceInfo[i]).getTransmitter();
+                        return ((MidiDeviceProvider) deviceProviders.get(deviceNum)).getDevice(element).getTransmitter();
                     } catch (MidiUnavailableException e) {}
                 }
             }
@@ -706,10 +695,10 @@
              */
             for (int i = 0; i < deviceProviders.size(); i++) {
                 MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-                for (int j = 0; j < deviceInfo.length; j++) {
-                    if (deviceInfo[j].getName().equals(defaultDevice.get(1))) {
+                for (Info element : deviceInfo) {
+                    if (element.getName().equals(defaultDevice.get(1))) {
                         try {
-                            return ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]).getTransmitter();
+                            return ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element).getTransmitter();
                         } catch (MidiUnavailableException e) {}
                     }
                 }
@@ -720,9 +709,9 @@
          */
         for (int i = 0; i < deviceProviders.size(); i++) {
             MidiDevice.Info[] deviceInfo = ((MidiDeviceProvider) deviceProviders.get(i)).getDeviceInfo();
-            for (int j = 0; j < deviceInfo.length; j++) {
+            for (Info element : deviceInfo) {
                 try {
-                    return ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(deviceInfo[j]).getTransmitter();
+                    return ((MidiDeviceProvider) deviceProviders.get(i)).getDevice(element).getTransmitter();
                 } catch (MidiUnavailableException e) {}
             }
         }
@@ -737,7 +726,7 @@
          * obtain the list of MidiFileWriterProviders;
          * if we already obtain the list of providers, we don't obtain it again
          */
-        List fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
+        List<?> fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
         if (fileWriterProviders.size() == 0) {
             //FIXME
             /*
@@ -758,7 +747,7 @@
         /*
          * obtain the list of MidiFileWriterProviders
          */
-        List fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
+        List<?> fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
         if (fileWriterProviders.size() == 0) {
             //FIXME
             /*
@@ -779,7 +768,7 @@
         /*
          * obtain the list of MidiFileWriterProviders
          */
-        List  fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
+        List<?>  fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
         if (fileWriterProviders.size() == 0) {
             //FIXME
             /*
@@ -800,7 +789,7 @@
         /*
          * obtain the list of MidiFileWriterProviders
          */
-        List  fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
+        List<?>  fileWriterProviders = ProviderService.getProviders(midiFileWriterPath);
         if (fileWriterProviders.size() == 0) {
             //FIXME
             /*

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Sequencer.java Sun Sep 24 21:08:23 2006
@@ -37,22 +37,29 @@
             this.name = name;
         }
 
+        @Override
         public final boolean equals(Object obj) {
-            if (this == obj)
+            if (this == obj) {
                 return true;
-            if (!super.equals(obj))
+            }
+            if (!super.equals(obj)) {
                 return false;
-            if (getClass() != obj.getClass())
+            }
+            if (getClass() != obj.getClass()) {
                 return false;
+            }
             final SyncMode other = (SyncMode) obj;
             if (name == null) {
-                if (other.name != null)
+                if (other.name != null) {
                     return false;
-            } else if (!name.equals(other.name))
+                }
+            } else if (!name.equals(other.name)) {
                 return false;
+            }
             return true;
         }
 
+        @Override
         public final int hashCode() {
             final int PRIME = 31;
             int result = super.hashCode();
@@ -60,6 +67,7 @@
             return result;
         }
 
+        @Override
         public final String toString() {
             return name;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/ShortMessage.java Sun Sep 24 21:08:23 2006
@@ -64,6 +64,7 @@
         super(data);
     }
 
+    @Override
     public Object clone() {
         return new ShortMessage(this.getMessage());
     }
@@ -74,9 +75,8 @@
          */
         if ((data == null) || (data.length == 0)) {
             return 0;
-        } else {
-            return data[0] & 0x0F;
         }
+        return data[0] & 0x0F;
     }
 
     public int getCommand() {
@@ -85,9 +85,8 @@
         */
         if ((data == null) || (data.length == 0)) {
             return 0;
-        } else {
-            return (data[0] & 0xFF) - getChannel();
         }
+        return (data[0] & 0xFF) - getChannel();
     }
 
     public int getData1() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/SysexMessage.java Sun Sep 24 21:08:23 2006
@@ -31,6 +31,7 @@
         super(data);
     }
 
+    @Override
     public Object clone() {
         return new SysexMessage(this.getMessage());
     }
@@ -43,6 +44,7 @@
         return bt;
     }
 
+    @Override
     public void setMessage(byte[] data, int length) throws InvalidMidiDataException {
         //FIXME
         /*

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/Track.java Sun Sep 24 21:08:23 2006
@@ -74,11 +74,10 @@
                 event.getMessage().getMessage()[2] == 0 ) {
             if (events.size() == 0) {
                 return events.add(event);
-            } else {
-                byte[] bt = events.get(events.size() - 1).getMessage().getMessage();
-                if ((bt[0] != -1) && (bt[1] != 47) && (bt[2] != 0)) {
-                    return events.add(event);
-                }
+            }
+            byte[] bt = events.get(events.size() - 1).getMessage().getMessage();
+            if ((bt[0] != -1) && (bt[1] != 47) && (bt[2] != 0)) {
+                return events.add(event);
             }         
             return true;
         }
@@ -92,11 +91,10 @@
             badEvent = event;
             // sounds.01=-1
             throw new ArrayIndexOutOfBoundsException(Messages.getString("sound.01")); //$NON-NLS-1$
-        } else {
-            byte[] bt = events.get(events.size() - 1).getMessage().getMessage();
-            if ((bt[0] != -1) && (bt[1] != 47) && (bt[2] != 0)) {
-                events.add(new MidiEvent(new MetaMessage(new byte[] {-1, 47, 0}), 0));
-            }
+        }
+        byte[] bt = events.get(events.size() - 1).getMessage().getMessage();
+        if ((bt[0] != -1) && (bt[1] != 47) && (bt[2] != 0)) {
+            events.add(new MidiEvent(new MetaMessage(new byte[] {-1, 47, 0}), 0));
         }
         
         if (events.contains(event)) {
@@ -112,10 +110,9 @@
         for (int i = 0; i < events.size() - 1; i++ ) {
             if (events.get(i).getTick() <= event.getTick()) {
                 continue;
-            } else {
-                events.add(i, event);
-                break;
             }
+            events.add(i, event);
+            break;
         }
         /*
          * method Track.ticks() return the biggest value of tick of all events

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiDeviceProvider.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiDeviceProvider.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiDeviceProvider.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiDeviceProvider.java Sun Sep 24 21:08:23 2006
@@ -17,6 +17,7 @@
 package javax.sound.midi.spi;
 
 import javax.sound.midi.MidiDevice;
+import javax.sound.midi.MidiDevice.Info;
 
 public abstract class MidiDeviceProvider {
 
@@ -26,8 +27,8 @@
 
     public boolean isDeviceSupported(MidiDevice.Info info) {
         MidiDevice.Info[] devices = getDeviceInfo();
-        for (int i = 0; i < devices.length; i++) {
-            if (info.equals(devices[i])) {
+        for (Info element : devices) {
+            if (info.equals(element)) {
                 return true;
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiFileWriter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiFileWriter.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiFileWriter.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/midi/spi/MidiFileWriter.java Sun Sep 24 21:08:23 2006
@@ -30,8 +30,8 @@
 
     public boolean isFileTypeSupported(int fileType) {
         int[] supported = getMidiFileTypes();
-        for (int i = 0; i < supported.length; i++) {
-            if (fileType == supported[i]) {
+        for (int element : supported) {
+            if (fileType == element) {
                 return true;
             }
         }
@@ -40,8 +40,8 @@
 
     public boolean isFileTypeSupported(int fileType, Sequence sequence) {
         int[] supported = getMidiFileTypes(sequence);
-        for (int i = 0; i < supported.length; i++) {
-            if (fileType == supported[i]) {
+        for (int element : supported) {
+            if (fileType == element) {
                 return true;
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioFileFormat.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioFileFormat.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioFileFormat.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/AudioFileFormat.java Sun Sep 24 21:08:23 2006
@@ -35,6 +35,7 @@
          * 
          * @see java.lang.Object#equals(java.lang.Object)
          */
+        @Override
         public final boolean equals(Object another) {
             if (this == another) {
                 return true;
@@ -54,10 +55,12 @@
             return extension;
         }
 
+        @Override
         public final int hashCode() {
             return name.hashCode() + extension.hashCode();
         }
 
+        @Override
         public final String toString() {
             throw new Error("not yet implemented");
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/DataLine.java Sun Sep 24 21:08:23 2006
@@ -63,10 +63,12 @@
             return maxBufferSize;
         }
 
+        @Override
         public boolean matches(Line.Info info) {
             throw new Error("not yet implemented");
         }
         
+        @Override
         public String toString() {
             throw new Error("not yet implemented");
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Line.java Sun Sep 24 21:08:23 2006
@@ -33,6 +33,7 @@
             throw new Error("not yet implemented");
         }
         
+        @Override
         public String toString() {
             throw new Error("not yet implemented");
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/Mixer.java Sun Sep 24 21:08:23 2006
@@ -30,6 +30,7 @@
             this.version = version;
         }
         
+        @Override
         public final boolean equals(Object another) {
             return this == another;
         }
@@ -50,10 +51,12 @@
             return version;
         }
         
+        @Override
         public final int hashCode() {
             return name.hashCode() + vendor.hashCode() + description.hashCode() + version.hashCode();
         }
         
+        @Override
         public String toString() {
             throw new Error("not yet implemented");
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/AudioFileWriter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/AudioFileWriter.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/AudioFileWriter.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/AudioFileWriter.java Sun Sep 24 21:08:23 2006
@@ -22,6 +22,7 @@
 
 import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFileFormat.Type;
 
 public abstract class AudioFileWriter {
 
@@ -31,8 +32,8 @@
 
     public boolean isFileTypeSupported(AudioFileFormat.Type fileType) {
         AudioFileFormat.Type[] supported = getAudioFileTypes();
-        for (int i = 0; i < supported.length; i++) {
-            if (fileType.equals(supported[i])) {
+        for (Type element : supported) {
+            if (fileType.equals(element)) {
                 return true;
             }
         }
@@ -41,8 +42,8 @@
 
     public boolean isFileTypeSupported(AudioFileFormat.Type fileType, AudioInputStream stream) {
         AudioFileFormat.Type[] supported = getAudioFileTypes(stream);
-        for (int i = 0; i < supported.length; i++) {
-            if (fileType.equals(supported[i])) {
+        for (Type element : supported) {
+            if (fileType.equals(element)) {
                 return true;
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/FormatConversionProvider.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/FormatConversionProvider.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/FormatConversionProvider.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/FormatConversionProvider.java Sun Sep 24 21:08:23 2006
@@ -18,6 +18,7 @@
 
 import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioFormat.Encoding;
 
 public abstract class FormatConversionProvider {
 
@@ -33,8 +34,8 @@
     public boolean isConversionSupported(AudioFormat.Encoding targetEncoding,
             AudioFormat sourceFormat) {
         AudioFormat.Encoding[] encodings = getTargetEncodings(sourceFormat);
-        for (int i = 0; i < encodings.length; i++) {
-            if (targetEncoding.equals(encodings[i])) {
+        for (Encoding element : encodings) {
+            if (targetEncoding.equals(element)) {
                 return true;
             }
         }
@@ -48,8 +49,8 @@
             AudioFormat sourceFormat) {
         AudioFormat[] formats = getTargetFormats(targetFormat.getEncoding(),
                 sourceFormat);
-        for (int i = 0; i < formats.length; i++) {
-            if (targetFormat.equals(formats[i])) {
+        for (AudioFormat element : formats) {
+            if (targetFormat.equals(element)) {
                 return true;
             }
         }
@@ -60,8 +61,8 @@
 
     public boolean isSourceEncodingSupported(AudioFormat.Encoding sourceEncoding) {
         AudioFormat.Encoding[] encodings = getSourceEncodings();
-        for (int i = 0; i < encodings.length; i++) {
-            if (sourceEncoding.equals(encodings[i])) {
+        for (Encoding element : encodings) {
+            if (sourceEncoding.equals(element)) {
                 return true;
             }
         }
@@ -72,8 +73,8 @@
 
     public boolean isTargetEncodingSupported(AudioFormat.Encoding targetEncoding) {
         AudioFormat.Encoding[] encodings = getTargetEncodings();
-        for (int i = 0; i < encodings.length; i++) {
-            if (targetEncoding.equals(encodings[i])) {
+        for (Encoding element : encodings) {
+            if (targetEncoding.equals(element)) {
                 return true;
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/MixerProvider.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/MixerProvider.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/MixerProvider.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/javax/sound/sampled/spi/MixerProvider.java Sun Sep 24 21:08:23 2006
@@ -17,6 +17,7 @@
 package javax.sound.sampled.spi;
 
 import javax.sound.sampled.Mixer;
+import javax.sound.sampled.Mixer.Info;
 
 public abstract class MixerProvider {
 
@@ -26,8 +27,8 @@
 
     public boolean isMixerSupported(Mixer.Info info) {
         Mixer.Info[] devices = getMixerInfo();
-        for (int i = 0; i < devices.length; i++) {
-            if (info.equals(devices[i])) {
+        for (Info element : devices) {
+            if (info.equals(element)) {
                 return true;
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/internal/nls/Messages.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/internal/nls/Messages.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/internal/nls/Messages.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/internal/nls/Messages.java Sun Sep 24 21:08:23 2006
@@ -57,8 +57,9 @@
      * @return String the message for that key in the system message bundle.
      */
     static public String getString(String msg) {
-        if (bundle == null)
+        if (bundle == null) {
             return msg;
+        }
         try {
             return bundle.getString(msg);
         } catch (MissingResourceException e) {
@@ -163,18 +164,20 @@
                 + (args.length * 20));
         String[] argStrings = new String[args.length];
         for (int i = 0; i < args.length; ++i) {
-            if (args[i] == null)
+            if (args[i] == null) {
                 argStrings[i] = "<null>";	//$NON-NLS-1$
-            else
+            } else {
                 argStrings[i] = args[i].toString();
+            }
         }
         int lastI = 0;
         for (int i = format.indexOf('{', 0); i >= 0; i = format.indexOf('{',
                 lastI)) {
             if (i != 0 && format.charAt(i - 1) == '\\') {
                 // It's escaped, just print and loop.
-                if (i != 1)
+                if (i != 1) {
                     answer.append(format.substring(lastI, i - 1));
+                }
                 answer.append('{');
                 lastI = i + 1;
             } else {
@@ -193,17 +196,19 @@
                     } else {
                         // Got a good one!
                         answer.append(format.substring(lastI, i));
-                        if (argnum >= argStrings.length)
+                        if (argnum >= argStrings.length) {
                             answer.append("<missing argument>");	//$NON-NLS-1$
-                        else
+                        } else {
                             answer.append(argStrings[argnum]);
+                        }
 						lastI = i + 3;
                     }
                 }
             }
         }
-        if (lastI < format.length())
+        if (lastI < format.length()) {
             answer.append(format.substring(lastI, format.length()));
+        }
         return answer.toString();
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/utils/ProviderService.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/utils/ProviderService.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/utils/ProviderService.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/main/java/org/apache/harmony/sound/utils/ProviderService.java Sun Sep 24 21:08:23 2006
@@ -172,11 +172,8 @@
          * Obtain the list of files that contains in the directory 'parent'
          */
         String[] listFiles = parent.list();
-        /*
-         * look through all file names
-         */
-        for (int i = 0; i < listFiles.length; i++) {
-            File file = new File(parent, listFiles[i]);
+        for (String element : listFiles) {
+            File file = new File(parent, element);
             /*
              * if new file is directory, than recursively go in it...
              */
@@ -187,8 +184,8 @@
                  * else if it's file, we check up that it's jar-file. If it's true
                  * we save it
                  */
-                if (listFiles[i].endsWith(".jar")) {
-                    jarFiles.add(parent.toString() + File.separator + listFiles[i]);
+                if (element.endsWith(".jar")) {
+                    jarFiles.add(parent.toString() + File.separator + element);
                 }
             }
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/InstrumentTest.java Sun Sep 24 21:08:23 2006
@@ -67,6 +67,7 @@
             super(soundbank, patch, name, dataClass);
         }
 
+        @Override
         public Object getData() {
             return null;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiEventTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiEventTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiEventTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiEventTest.java Sun Sep 24 21:08:23 2006
@@ -64,6 +64,7 @@
             super(data);
         }
         
+        @Override
         public Object clone() {
             return null;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/MidiMessageTest.java Sun Sep 24 21:08:23 2006
@@ -251,10 +251,12 @@
             super(data);
         }
 
+        @Override
         public Object clone() {
             return null;
         }
 
+        @Override
         public void setMessage(byte[] data, int length)
                 throws InvalidMidiDataException {
             super.setMessage(data, length);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SequenceTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SequenceTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SequenceTest.java Sun Sep 24 21:08:23 2006
@@ -22,8 +22,6 @@
 import javax.sound.midi.Sequence;
 import javax.sound.midi.Track;
 
-import org.apache.harmony.sound.tests.javax.sound.midi.TrackTest.MidiMessage1;
-
 import junit.framework.TestCase;
 
 public class SequenceTest extends TestCase {
@@ -31,11 +29,11 @@
      * test constants
      */
     public void test_constants() {
-        assertEquals(0.0f, Sequence.PPQ);
-        assertEquals(24.0f, Sequence.SMPTE_24);
-        assertEquals(25.0f, Sequence.SMPTE_25);
-        assertEquals(30.0f, Sequence.SMPTE_30);
-        assertEquals(29.969999313354492f, Sequence.SMPTE_30DROP);
+        assertEquals(0.0f, Sequence.PPQ, 0f);
+        assertEquals(24.0f, Sequence.SMPTE_24, 0f);
+        assertEquals(25.0f, Sequence.SMPTE_25, 0f);
+        assertEquals(30.0f, Sequence.SMPTE_30, 0f);
+        assertEquals(29.969999313354492f, Sequence.SMPTE_30DROP, 0f);
     }
     /**
      * test constructor Sequence(float, int)
@@ -45,18 +43,18 @@
         Sequence seq0 = new Sequence(Sequence.PPQ, 10, 2);
         seq0.getTracks();
         
-        Sequence seq1 = new Sequence(Sequence.PPQ, 10);
+        new Sequence(Sequence.PPQ, 10);
         Sequence seq2 = new Sequence(Sequence.SMPTE_24, -10);
-        Sequence seq3 = new Sequence(Sequence.SMPTE_25, 9854);
-        Sequence seq4 = new Sequence(Sequence.SMPTE_30, -82534);
-        Sequence seq5 = new Sequence(Sequence.SMPTE_30DROP, 0);
+        new Sequence(Sequence.SMPTE_25, 9854);
+        new Sequence(Sequence.SMPTE_30, -82534);
+        new Sequence(Sequence.SMPTE_30DROP, 0);
         
         try {
-            Sequence test = new Sequence(32.0f, 16);
+            new Sequence(32.0f, 16);
             fail("InvalidMidiDataException expected");
         } catch (InvalidMidiDataException e) {}
         
-        assertEquals(24.0f, seq2.getDivisionType());
+        assertEquals(24.0f, seq2.getDivisionType(), 0f);
         assertEquals(0, seq2.getMicrosecondLength());
         assertEquals(-10, seq2.getResolution());
         assertEquals(0, seq2.getTickLength());
@@ -68,18 +66,18 @@
      * test constructor Sequence(float, int, int)
      */
     public void test_constructor2() throws Exception {
-        Sequence seq1 = new Sequence(Sequence.PPQ, 10, 0);
+        new Sequence(Sequence.PPQ, 10, 0);
         Sequence seq2 = new Sequence(Sequence.SMPTE_24, -10, 8762);
         Sequence seq3 = new Sequence(Sequence.SMPTE_25, 9854, -18);
-        Sequence seq4 = new Sequence(Sequence.SMPTE_30, -82534, 34);
+        new Sequence(Sequence.SMPTE_30, -82534, 34);
         Sequence seq5 = new Sequence(Sequence.SMPTE_30DROP, 0);
         
         try {
-            Sequence test = new Sequence(-9.1f, 16, 54);
+            new Sequence(-9.1f, 16, 54);
             fail("InvalidMidiDataException expected");
         } catch (InvalidMidiDataException e) {}
         
-        assertEquals(25.0f, seq3.getDivisionType());
+        assertEquals(25.0f, seq3.getDivisionType(), 0f);
         assertEquals(0, seq3.getMicrosecondLength());
         assertEquals(9854, seq3.getResolution());
         assertEquals(0, seq3.getTickLength());
@@ -288,7 +286,7 @@
      */
     public void test_getTracks() throws Exception {
         Sequence seq = new Sequence(Sequence.SMPTE_24, 67, 9);
-        Track tr = seq.createTrack();
+        seq.createTrack();
         Track tr1 = seq.createTrack();
         
         Track[] tracks = seq.getTracks();
@@ -315,6 +313,7 @@
             super(data);
         }
         
+        @Override
         public Object clone() {
             return null;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SoundbankResourceTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SoundbankResourceTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SoundbankResourceTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/SoundbankResourceTest.java Sun Sep 24 21:08:23 2006
@@ -59,6 +59,7 @@
             super( soundbank, name, dataClass );
         }
         
+        @Override
         public Object getData()
         {
             return null;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/TrackTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/TrackTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/TrackTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/TrackTest.java Sun Sep 24 21:08:23 2006
@@ -280,6 +280,7 @@
             super(data);
         }
         
+        @Override
         public Object clone() {
             return null;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiDeviceProviderTest.java Sun Sep 24 21:08:23 2006
@@ -31,11 +31,13 @@
     public void testIsDeviceSupported() {
         MidiDeviceProvider myProvider = new MidiDeviceProvider() {
 
+            @Override
             public MidiDevice getDevice(MidiDevice.Info info) {
                 fail("what are doing here?");
                 return null;
             }
 
+            @Override
             public MidiDevice.Info[] getDeviceInfo() {
                 return recorded;
             }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/midi/spi/MidiFileWriterTest.java Sun Sep 24 21:08:23 2006
@@ -34,20 +34,24 @@
     public void testIsFileTypeSupported1() {
         MidiFileWriter writer = new MidiFileWriter() {
 
+            @Override
             public int[] getMidiFileTypes() {
                 return recorded;
             }
 
+            @Override
             public int[] getMidiFileTypes(Sequence sequence) {
                 fail("what are doing here?");
                 return null;
             }
 
+            @Override
             public int write(Sequence in, int fileType, File out) {
                 fail("what are doing here?");
                 return 0;
             }
 
+            @Override
             public int write(Sequence in, int fileType, OutputStream out) {
                 fail("what are doing here?");
                 return 0;
@@ -73,20 +77,24 @@
     public void testIsFileTypeSupported2() {
         MidiFileWriter writer = new MidiFileWriter() {
 
+            @Override
             public int[] getMidiFileTypes() {
                 fail("what are doing here?");
                 return null;
             }
 
+            @Override
             public int[] getMidiFileTypes(Sequence sequence) {
                 return recorded;
             }
 
+            @Override
             public int write(Sequence in, int fileType, File out) {
                 fail("what are doing here?");
                 return 0;
             }
 
+            @Override
             public int write(Sequence in, int fileType, OutputStream out) {
                 fail("what are doing here?");
                 return 0;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/AudioFileWriterTest.java Sun Sep 24 21:08:23 2006
@@ -35,22 +35,26 @@
     public void testIsFileTypeSupported1() {
         AudioFileWriter writer = new AudioFileWriter() {
 
+            @Override
             public AudioFileFormat.Type[] getAudioFileTypes() {
                 return recorded;
             }
 
+            @Override
             public AudioFileFormat.Type[] getAudioFileTypes(
                     AudioInputStream stream) {
                 fail("what are doing here?");
                 return null;
             }
 
+            @Override
             public int write(AudioInputStream stream,
                     AudioFileFormat.Type fileType, File out) {
                 fail("what are doing here?");
                 return 0;
             }
 
+            @Override
             public int write(AudioInputStream stream,
                     AudioFileFormat.Type fileType, OutputStream out) {
                 fail("what are doing here?");
@@ -84,22 +88,26 @@
     public void testIsFileTypeSupported2() {
         AudioFileWriter writer = new AudioFileWriter() {
 
+            @Override
             public AudioFileFormat.Type[] getAudioFileTypes() {
                 fail("what are doing here?");
                 return null;
             }
 
+            @Override
             public AudioFileFormat.Type[] getAudioFileTypes(
                     AudioInputStream stream) {
                 return recorded;
             }
 
+            @Override
             public int write(AudioInputStream stream,
                     AudioFileFormat.Type fileType, File out) {
                 fail("what are doing here?");
                 return 0;
             }
 
+            @Override
             public int write(AudioInputStream stream,
                     AudioFileFormat.Type fileType, OutputStream out) {
                 fail("what are doing here?");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java?view=diff&rev=449567&r1=449566&r2=449567
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sound/src/test/java/org/apache/harmony/sound/tests/javax/sound/sampled/spi/MixerProviderTest.java Sun Sep 24 21:08:23 2006
@@ -31,11 +31,13 @@
     public void testIsMixerSupported() {
         MixerProvider myProvider = new MixerProvider() {
 
+            @Override
             public Mixer getMixer(Mixer.Info info) {
                 fail("what are doing here?");
                 return null;
             }
 
+            @Override
             public Mixer.Info[] getMixerInfo() {
                 return recorded;
             }



Mime
View raw message