From joe.darcy at oracle.com Thu May 1 04:50:51 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 30 Apr 2014 21:50:51 -0700 Subject: JDK 9 RFR of JDK-8042256: Fix raw and unchecked lint warnings in com.sun.media.sound Message-ID: <5361D2AB.7040007@oracle.com> Hello, Please review this change to address the raw and unchecked warnings in com.sun.media.sound: JDK-8042256: Fix raw and unchecked lint warnings in com.sun.media.sound http://cr.openjdk.java.net/~darcy/8042256.0/ Patch below. Thanks, -Joe --- old/src/share/classes/com/sun/media/sound/AbstractLine.java 2014-04-30 18:30:06.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/AbstractLine.java 2014-04-30 18:30:06.000000000 -0700 @@ -48,7 +48,7 @@ protected Control[] controls; AbstractMixer mixer; private boolean open = false; - private final Vector listeners = new Vector(); + private final Vector listeners = new Vector<>(); /** * Contains event dispatcher per thread group. --- old/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java 2014-04-30 18:30:07.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java 2014-04-30 18:30:07.000000000 -0700 @@ -70,7 +70,7 @@ /** List of Receivers and Transmitters that opened the device implicitely. */ - private List openKeepingObjects; + private List openKeepingObjects; /** * This is the device handle returned from native code @@ -284,6 +284,7 @@ } + @SuppressWarnings("unchecked") // Cast of result of clone public final List getReceivers() { List recs; synchronized (traRecLock) { @@ -313,6 +314,7 @@ } + @SuppressWarnings("unchecked") // Cast of result of clone public final List getTransmitters() { List tras; synchronized (traRecLock) { @@ -372,9 +374,9 @@ /** Return the list of objects that have opened the device implicitely. */ - private synchronized List getOpenKeepingObjects() { + private synchronized List getOpenKeepingObjects() { if (openKeepingObjects == null) { - openKeepingObjects = new ArrayList(); + openKeepingObjects = new ArrayList<>(); } return openKeepingObjects; } --- old/src/share/classes/com/sun/media/sound/AbstractMixer.java 2014-04-30 18:30:07.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/AbstractMixer.java 2014-04-30 18:30:07.000000000 -0700 @@ -90,13 +90,13 @@ /** * Source lines (ports) currently open */ - private final Vector sourceLines = new Vector(); + private final Vector sourceLines = new Vector<>(); /** * Target lines currently open. */ - private final Vector targetLines = new Vector(); + private final Vector targetLines = new Vector<>(); /** @@ -151,7 +151,7 @@ public final Line.Info[] getSourceLineInfo(Line.Info info) { int i; - Vector vec = new Vector(); + Vector vec = new Vector<>(); for (i = 0; i < sourceLineInfo.length; i++) { @@ -162,7 +162,7 @@ Line.Info[] returnedArray = new Line.Info[vec.size()]; for (i = 0; i < returnedArray.length; i++) { - returnedArray[i] = (Line.Info)vec.elementAt(i); + returnedArray[i] = vec.elementAt(i); } return returnedArray; @@ -172,7 +172,7 @@ public final Line.Info[] getTargetLineInfo(Line.Info info) { int i; - Vector vec = new Vector(); + Vector vec = new Vector<>(); for (i = 0; i < targetLineInfo.length; i++) { @@ -183,7 +183,7 @@ Line.Info[] returnedArray = new Line.Info[vec.size()]; for (i = 0; i < returnedArray.length; i++) { - returnedArray[i] = (Line.Info)vec.elementAt(i); + returnedArray[i] = vec.elementAt(i); } return returnedArray; @@ -231,7 +231,7 @@ localLines = new Line[sourceLines.size()]; for (int i = 0; i < localLines.length; i++) { - localLines[i] = (Line)sourceLines.elementAt(i); + localLines[i] = sourceLines.elementAt(i); } } @@ -248,7 +248,7 @@ localLines = new Line[targetLines.size()]; for (int i = 0; i < localLines.length; i++) { - localLines[i] = (Line)targetLines.elementAt(i); + localLines[i] = targetLines.elementAt(i); } } @@ -453,7 +453,8 @@ return; } - Vector localSourceLines = (Vector)sourceLines.clone(); + @SuppressWarnings("unchecked") + Vector localSourceLines = (Vector)sourceLines.clone(); for (int i = 0; i < localSourceLines.size(); i++) { // if any other open line is running, return @@ -468,7 +469,8 @@ } } - Vector localTargetLines = (Vector)targetLines.clone(); + @SuppressWarnings("unchecked") + Vector localTargetLines = (Vector)targetLines.clone(); for (int i = 0; i < localTargetLines.size(); i++) { // if any other open line is running, return --- old/src/share/classes/com/sun/media/sound/AlawCodec.java 2014-04-30 18:30:08.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/AlawCodec.java 2014-04-30 18:30:08.000000000 -0700 @@ -213,7 +213,7 @@ private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { - Vector formats = new Vector(); + Vector formats = new Vector<>(); AudioFormat format; if ( AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) { @@ -248,7 +248,7 @@ AudioFormat[] formatArray = new AudioFormat[formats.size()]; for (int i = 0; i < formatArray.length; i++) { - formatArray[i] = (AudioFormat)(formats.elementAt(i)); + formatArray[i] = formats.elementAt(i); } return formatArray; } --- old/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java 2014-04-30 18:30:08.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java 2014-04-30 18:30:08.000000000 -0700 @@ -68,7 +68,7 @@ * The valueClass field specifies class * used in value field. */ - public Class valueClass = null; + public Class valueClass = null; /** * An array of possible values if the value for the field * AudioSynthesizerPropertyInfo.value may be selected --- old/src/share/classes/com/sun/media/sound/DirectAudioDevice.java 2014-04-30 18:30:09.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/DirectAudioDevice.java 2014-04-30 18:30:09.000000000 -0700 @@ -94,7 +94,7 @@ } private DirectDLI createDataLineInfo(boolean isSource) { - Vector formats = new Vector(); + Vector formats = new Vector<>(); AudioFormat[] hardwareFormatArray = null; AudioFormat[] formatArray = null; @@ -107,7 +107,7 @@ int formatArraySize = size; hardwareFormatArray = new AudioFormat[size]; for (int i = 0; i < size; i++) { - AudioFormat format = (AudioFormat)formats.elementAt(i); + AudioFormat format = formats.elementAt(i); hardwareFormatArray[i] = format; int bits = format.getSampleSizeInBits(); boolean isSigned = format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED); @@ -265,7 +265,7 @@ return ((DirectAudioDeviceProvider.DirectAudioDeviceInfo) getMixerInfo()).getMaxSimulLines(); } - private static void addFormat(Vector v, int bits, int frameSizeInBytes, int channels, float sampleRate, + private static void addFormat(Vector v, int bits, int frameSizeInBytes, int channels, float sampleRate, int encoding, boolean signed, boolean bigEndian) { AudioFormat.Encoding enc = null; switch (encoding) { @@ -338,7 +338,7 @@ private static final class DirectDLI extends DataLine.Info { final AudioFormat[] hardwareFormats; - private DirectDLI(Class clazz, AudioFormat[] formatArray, + private DirectDLI(Class clazz, AudioFormat[] formatArray, AudioFormat[] hardwareFormatArray, int minBuffer, int maxBuffer) { super(clazz, formatArray, minBuffer, maxBuffer); @@ -1457,7 +1457,7 @@ } // class DirectBAOS - + @SuppressWarnings("rawtypes") private static native void nGetFormats(int mixerIndex, int deviceID, boolean isSource, Vector formats); --- old/src/share/classes/com/sun/media/sound/EventDispatcher.java 2014-04-30 18:30:09.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/EventDispatcher.java 2014-04-30 18:30:09.000000000 -0700 @@ -57,7 +57,7 @@ /** * List of events */ - private final ArrayList eventQueue = new ArrayList(); + private final ArrayList eventQueue = new ArrayList<>(); /** @@ -186,7 +186,7 @@ } if (eventQueue.size() > 0) { // Remove the event from the queue and dispatch it to the listeners. - eventInfo = (EventInfo) eventQueue.remove(0); + eventInfo = eventQueue.remove(0); } } // end of synchronized @@ -230,7 +230,7 @@ /** * Send audio and MIDI events. */ - void sendAudioEvents(Object event, List listeners) { + void sendAudioEvents(Object event, List listeners) { if ((listeners == null) || (listeners.size() == 0)) { // nothing to do @@ -392,7 +392,7 @@ * @param event the event to be dispatched * @param listeners listener list; will be copied */ - EventInfo(Object event, List listeners) { + EventInfo(Object event, List listeners) { this.event = event; this.listeners = listeners.toArray(); } --- old/src/share/classes/com/sun/media/sound/JDK13Services.java 2014-04-30 18:30:10.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/JDK13Services.java 2014-04-30 18:30:09.000000000 -0700 @@ -118,7 +118,7 @@ (the part before the hash sign), if available. If the property is not set or the value has no provider class name part, null is returned. */ - public static synchronized String getDefaultProviderClassName(Class typeClass) { + public static synchronized String getDefaultProviderClassName(Class typeClass) { String value = null; String defaultProviderSpec = getDefaultProvider(typeClass); if (defaultProviderSpec != null) { @@ -144,7 +144,7 @@ part after the hash sign), if available. If the property is not set or the value has no instance name part, null is returned. */ - public static synchronized String getDefaultInstanceName(Class typeClass) { + public static synchronized String getDefaultInstanceName(Class typeClass) { String value = null; String defaultProviderSpec = getDefaultProvider(typeClass); if (defaultProviderSpec != null) { @@ -165,7 +165,7 @@ @return The complete value of the property, if available. If the property is not set, null is returned. */ - private static synchronized String getDefaultProvider(Class typeClass) { + private static synchronized String getDefaultProvider(Class typeClass) { if (!SourceDataLine.class.equals(typeClass) && !TargetDataLine.class.equals(typeClass) && !Clip.class.equals(typeClass) --- old/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java 2014-04-30 18:30:10.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java 2014-04-30 18:30:10.000000000 -0700 @@ -106,9 +106,9 @@ * the new instance will not reflect that state... */ static final class MidiInDeviceInfo extends AbstractMidiDeviceProvider.Info { - private final Class providerClass; + private final Class providerClass; - private MidiInDeviceInfo(int index, Class providerClass) { + private MidiInDeviceInfo(int index, Class providerClass) { super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index); this.providerClass = providerClass; } --- old/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java 2014-04-30 18:30:10.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java 2014-04-30 18:30:10.000000000 -0700 @@ -104,9 +104,9 @@ * the new instance will not reflect that state... */ static final class MidiOutDeviceInfo extends AbstractMidiDeviceProvider.Info { - private final Class providerClass; + private final Class providerClass; - private MidiOutDeviceInfo(int index, Class providerClass) { + private MidiOutDeviceInfo(int index, Class providerClass) { super(nGetName(index), nGetVendor(index), nGetDescription(index), nGetVersion(index), index); this.providerClass = providerClass; } --- old/src/share/classes/com/sun/media/sound/MidiUtils.java 2014-04-30 18:30:11.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/MidiUtils.java 2014-04-30 18:30:11.000000000 -0700 @@ -295,7 +295,7 @@ public synchronized void refresh(Sequence seq) { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList<>(); Track[] tracks = seq.getTracks(); if (tracks.length > 0) { // tempo events only occur in track 0 @@ -313,7 +313,7 @@ int size = list.size() + 1; firstTempoIsFake = true; if ((size > 1) - && (((MidiEvent) list.get(0)).getTick() == 0)) { + && (list.get(0).getTick() == 0)) { // do not need to add an initial tempo event at the beginning size--; firstTempoIsFake = false; @@ -328,7 +328,7 @@ e++; } for (int i = 0; i < list.size(); i++, e++) { - MidiEvent evt = (MidiEvent) list.get(i); + MidiEvent evt = list.get(i); ticks[e] = evt.getTick(); tempos[e] = getTempoMPQ(evt.getMessage()); } --- old/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java 2014-04-30 18:30:11.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java 2014-04-30 18:30:11.000000000 -0700 @@ -91,7 +91,7 @@ // filter out targetEncoding from the old getOutputFormats( sourceFormat ) method AudioFormat[] formats = getOutputFormats( sourceFormat ); - Vector newFormats = new Vector(); + Vector newFormats = new Vector<>(); for(int i=0; i formats = new Vector<>(); AudioFormat format; int sampleSize = inputFormat.getSampleSizeInBits(); @@ -335,7 +335,7 @@ for (int i = 0; i < formatArray.length; i++) { - formatArray[i] = (AudioFormat)(formats.elementAt(i)); + formatArray[i] = formats.elementAt(i); } } --- old/src/share/classes/com/sun/media/sound/PortMixer.java 2014-04-30 18:30:12.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/PortMixer.java 2014-04-30 18:30:12.000000000 -0700 @@ -253,12 +253,12 @@ long newID = ((PortMixer) mixer).getID(); if ((id == 0) || (newID != id) || (controls.length == 0)) { id = newID; - Vector vector = new Vector(); + Vector vector = new Vector<>(); synchronized (vector) { nGetControls(id, portIndex, vector); controls = new Control[vector.size()]; for (int i = 0; i < controls.length; i++) { - controls[i] = (Control) vector.elementAt(i); + controls[i] = vector.elementAt(i); } } } else { @@ -494,6 +494,7 @@ private static native String nGetPortName(long id, int portIndex); // fills the vector with the controls for this port + @SuppressWarnings("rawtypes") private static native void nGetControls(long id, int portIndex, Vector vector); // getters/setters for controls --- old/src/share/classes/com/sun/media/sound/RealTimeSequencer.java 2014-04-30 18:30:12.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/RealTimeSequencer.java 2014-04-30 18:30:12.000000000 -0700 @@ -122,7 +122,7 @@ /** * List of tracks to which we're recording */ - private final List recordingTracks = new ArrayList(); + private final List recordingTracks = new ArrayList<>(); private long loopStart = 0; @@ -133,13 +133,13 @@ /** * Meta event listeners */ - private final ArrayList metaEventListeners = new ArrayList(); + private final ArrayList metaEventListeners = new ArrayList<>(); /** * Control change listeners */ - private final ArrayList controllerEventListeners = new ArrayList(); + private final ArrayList controllerEventListeners = new ArrayList<>(); /** automatic connection support */ @@ -645,7 +645,7 @@ boolean flag = false; for(int i=0; i < controllerEventListeners.size(); i++) { - cve = (ControllerListElement) controllerEventListeners.get(i); + cve = controllerEventListeners.get(i); if (cve.listener.equals(listener)) { cve.addControllers(controllers); @@ -669,7 +669,7 @@ ControllerListElement cve = null; boolean flag = false; for (int i=0; i < controllerEventListeners.size(); i++) { - cve = (ControllerListElement) controllerEventListeners.get(i); + cve = controllerEventListeners.get(i); if (cve.listener.equals(listener)) { cve.removeControllers(controllers); flag = true; @@ -940,9 +940,9 @@ } ShortMessage msg = (ShortMessage) message; int controller = msg.getData1(); - List sendToListeners = new ArrayList(); + List sendToListeners = new ArrayList<>(); for (int i = 0; i < size; i++) { - ControllerListElement cve = (ControllerListElement) controllerEventListeners.get(i); + ControllerListElement cve = controllerEventListeners.get(i); for(int j = 0; j < cve.controllers.length; j++) { if (cve.controllers[j] == controller) { sendToListeners.add(cve.listener); @@ -1213,13 +1213,13 @@ this.channel = channel; } - static RecordingTrack get(List recordingTracks, Track track) { + static RecordingTrack get(List recordingTracks, Track track) { synchronized(recordingTracks) { int size = recordingTracks.size(); for (int i = 0; i < size; i++) { - RecordingTrack current = (RecordingTrack)recordingTracks.get(i); + RecordingTrack current = recordingTracks.get(i); if (current.track == track) { return current; } @@ -1228,12 +1228,12 @@ return null; } - static Track get(List recordingTracks, int channel) { + static Track get(List recordingTracks, int channel) { synchronized(recordingTracks) { int size = recordingTracks.size(); for (int i = 0; i < size; i++) { - RecordingTrack current = (RecordingTrack)recordingTracks.get(i); + RecordingTrack current = recordingTracks.get(i); if ((current.channel == channel) || (current.channel == -1)) { return current.track; } --- old/src/share/classes/com/sun/media/sound/SoftSynthesizer.java 2014-04-30 18:30:13.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/SoftSynthesizer.java 2014-04-30 18:30:13.000000000 -0700 @@ -949,7 +949,7 @@ Object v = (info == null) ? null : info.get(item2.name); v = (v != null) ? v : storedProperties.getProperty(item2.name); if (v != null) { - Class c = (item2.valueClass); + Class c = (item2.valueClass); if (c.isInstance(v)) item2.value = v; else if (v instanceof String) { --- old/src/share/classes/com/sun/media/sound/UlawCodec.java 2014-04-30 18:30:13.000000000 -0700 +++ new/src/share/classes/com/sun/media/sound/UlawCodec.java 2014-04-30 18:30:13.000000000 -0700 @@ -198,7 +198,7 @@ /* public AudioFormat[] getOutputFormats(AudioFormat inputFormat) { */ private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { - Vector formats = new Vector(); + Vector formats = new Vector<>(); AudioFormat format; if ((inputFormat.getSampleSizeInBits() == 16) @@ -235,7 +235,7 @@ AudioFormat[] formatArray = new AudioFormat[formats.size()]; for (int i = 0; i < formatArray.length; i++) { - formatArray[i] = (AudioFormat)(formats.elementAt(i)); + formatArray[i] = formats.elementAt(i); } return formatArray; } From joe.darcy at oracle.com Mon May 5 16:02:04 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 05 May 2014 09:02:04 -0700 Subject: JDK 9 RFR of JDK-8042256: Fix raw and unchecked lint warnings in com.sun.media.sound In-Reply-To: <5361D2AB.7040007@oracle.com> References: <5361D2AB.7040007@oracle.com> Message-ID: <5367B5FC.9090106@oracle.com> * ping* -Joe On 4/30/2014 9:50 PM, Joe Darcy wrote: > Hello, > > Please review this change to address the raw and unchecked warnings in > com.sun.media.sound: > > JDK-8042256: Fix raw and unchecked lint warnings in > com.sun.media.sound > http://cr.openjdk.java.net/~darcy/8042256.0/ > > Patch below. > > Thanks, > > -Joe > > --- old/src/share/classes/com/sun/media/sound/AbstractLine.java > 2014-04-30 18:30:06.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/AbstractLine.java > 2014-04-30 18:30:06.000000000 -0700 > @@ -48,7 +48,7 @@ > protected Control[] controls; > AbstractMixer mixer; > private boolean open = false; > - private final Vector listeners = new Vector(); > + private final Vector listeners = new Vector<>(); > > /** > * Contains event dispatcher per thread group. > --- old/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java > 2014-04-30 18:30:07.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java > 2014-04-30 18:30:07.000000000 -0700 > @@ -70,7 +70,7 @@ > > /** List of Receivers and Transmitters that opened the device > implicitely. > */ > - private List openKeepingObjects; > + private List openKeepingObjects; > > /** > * This is the device handle returned from native code > @@ -284,6 +284,7 @@ > } > > > + @SuppressWarnings("unchecked") // Cast of result of clone > public final List getReceivers() { > List recs; > synchronized (traRecLock) { > @@ -313,6 +314,7 @@ > } > > > + @SuppressWarnings("unchecked") // Cast of result of clone > public final List getTransmitters() { > List tras; > synchronized (traRecLock) { > @@ -372,9 +374,9 @@ > > /** Return the list of objects that have opened the device > implicitely. > */ > - private synchronized List getOpenKeepingObjects() { > + private synchronized List getOpenKeepingObjects() { > if (openKeepingObjects == null) { > - openKeepingObjects = new ArrayList(); > + openKeepingObjects = new ArrayList<>(); > } > return openKeepingObjects; > } > --- old/src/share/classes/com/sun/media/sound/AbstractMixer.java > 2014-04-30 18:30:07.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/AbstractMixer.java > 2014-04-30 18:30:07.000000000 -0700 > @@ -90,13 +90,13 @@ > /** > * Source lines (ports) currently open > */ > - private final Vector sourceLines = new Vector(); > + private final Vector sourceLines = new Vector<>(); > > > /** > * Target lines currently open. > */ > - private final Vector targetLines = new Vector(); > + private final Vector targetLines = new Vector<>(); > > > /** > @@ -151,7 +151,7 @@ > public final Line.Info[] getSourceLineInfo(Line.Info info) { > > int i; > - Vector vec = new Vector(); > + Vector vec = new Vector<>(); > > for (i = 0; i < sourceLineInfo.length; i++) { > > @@ -162,7 +162,7 @@ > > Line.Info[] returnedArray = new Line.Info[vec.size()]; > for (i = 0; i < returnedArray.length; i++) { > - returnedArray[i] = (Line.Info)vec.elementAt(i); > + returnedArray[i] = vec.elementAt(i); > } > > return returnedArray; > @@ -172,7 +172,7 @@ > public final Line.Info[] getTargetLineInfo(Line.Info info) { > > int i; > - Vector vec = new Vector(); > + Vector vec = new Vector<>(); > > for (i = 0; i < targetLineInfo.length; i++) { > > @@ -183,7 +183,7 @@ > > Line.Info[] returnedArray = new Line.Info[vec.size()]; > for (i = 0; i < returnedArray.length; i++) { > - returnedArray[i] = (Line.Info)vec.elementAt(i); > + returnedArray[i] = vec.elementAt(i); > } > > return returnedArray; > @@ -231,7 +231,7 @@ > localLines = new Line[sourceLines.size()]; > > for (int i = 0; i < localLines.length; i++) { > - localLines[i] = (Line)sourceLines.elementAt(i); > + localLines[i] = sourceLines.elementAt(i); > } > } > > @@ -248,7 +248,7 @@ > localLines = new Line[targetLines.size()]; > > for (int i = 0; i < localLines.length; i++) { > - localLines[i] = (Line)targetLines.elementAt(i); > + localLines[i] = targetLines.elementAt(i); > } > } > > @@ -453,7 +453,8 @@ > return; > } > > - Vector localSourceLines = (Vector)sourceLines.clone(); > + @SuppressWarnings("unchecked") > + Vector localSourceLines = > (Vector)sourceLines.clone(); > for (int i = 0; i < localSourceLines.size(); i++) { > > // if any other open line is running, return > @@ -468,7 +469,8 @@ > } > } > > - Vector localTargetLines = (Vector)targetLines.clone(); > + @SuppressWarnings("unchecked") > + Vector localTargetLines = > (Vector)targetLines.clone(); > for (int i = 0; i < localTargetLines.size(); i++) { > > // if any other open line is running, return > --- old/src/share/classes/com/sun/media/sound/AlawCodec.java > 2014-04-30 18:30:08.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/AlawCodec.java > 2014-04-30 18:30:08.000000000 -0700 > @@ -213,7 +213,7 @@ > private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { > > > - Vector formats = new Vector(); > + Vector formats = new Vector<>(); > AudioFormat format; > > if ( > AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) { > @@ -248,7 +248,7 @@ > > AudioFormat[] formatArray = new AudioFormat[formats.size()]; > for (int i = 0; i < formatArray.length; i++) { > - formatArray[i] = (AudioFormat)(formats.elementAt(i)); > + formatArray[i] = formats.elementAt(i); > } > return formatArray; > } > --- > old/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java > 2014-04-30 18:30:08.000000000 -0700 > +++ > new/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java > 2014-04-30 18:30:08.000000000 -0700 > @@ -68,7 +68,7 @@ > * The valueClass field specifies class > * used in value field. > */ > - public Class valueClass = null; > + public Class valueClass = null; > /** > * An array of possible values if the value for the field > * AudioSynthesizerPropertyInfo.value may be selected > --- old/src/share/classes/com/sun/media/sound/DirectAudioDevice.java > 2014-04-30 18:30:09.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/DirectAudioDevice.java > 2014-04-30 18:30:09.000000000 -0700 > @@ -94,7 +94,7 @@ > } > > private DirectDLI createDataLineInfo(boolean isSource) { > - Vector formats = new Vector(); > + Vector formats = new Vector<>(); > AudioFormat[] hardwareFormatArray = null; > AudioFormat[] formatArray = null; > > @@ -107,7 +107,7 @@ > int formatArraySize = size; > hardwareFormatArray = new AudioFormat[size]; > for (int i = 0; i < size; i++) { > - AudioFormat format = > (AudioFormat)formats.elementAt(i); > + AudioFormat format = formats.elementAt(i); > hardwareFormatArray[i] = format; > int bits = format.getSampleSizeInBits(); > boolean isSigned = > format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED); > @@ -265,7 +265,7 @@ > return ((DirectAudioDeviceProvider.DirectAudioDeviceInfo) > getMixerInfo()).getMaxSimulLines(); > } > > - private static void addFormat(Vector v, int bits, int > frameSizeInBytes, int channels, float sampleRate, > + private static void addFormat(Vector v, int bits, > int frameSizeInBytes, int channels, float sampleRate, > int encoding, boolean signed, > boolean bigEndian) { > AudioFormat.Encoding enc = null; > switch (encoding) { > @@ -338,7 +338,7 @@ > private static final class DirectDLI extends DataLine.Info { > final AudioFormat[] hardwareFormats; > > - private DirectDLI(Class clazz, AudioFormat[] formatArray, > + private DirectDLI(Class clazz, AudioFormat[] formatArray, > AudioFormat[] hardwareFormatArray, > int minBuffer, int maxBuffer) { > super(clazz, formatArray, minBuffer, maxBuffer); > @@ -1457,7 +1457,7 @@ > > } // class DirectBAOS > > - > + @SuppressWarnings("rawtypes") > private static native void nGetFormats(int mixerIndex, int deviceID, > boolean isSource, Vector > formats); > > --- old/src/share/classes/com/sun/media/sound/EventDispatcher.java > 2014-04-30 18:30:09.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/EventDispatcher.java > 2014-04-30 18:30:09.000000000 -0700 > @@ -57,7 +57,7 @@ > /** > * List of events > */ > - private final ArrayList eventQueue = new ArrayList(); > + private final ArrayList eventQueue = new ArrayList<>(); > > > /** > @@ -186,7 +186,7 @@ > } > if (eventQueue.size() > 0) { > // Remove the event from the queue and dispatch it to > the listeners. > - eventInfo = (EventInfo) eventQueue.remove(0); > + eventInfo = eventQueue.remove(0); > } > > } // end of synchronized > @@ -230,7 +230,7 @@ > /** > * Send audio and MIDI events. > */ > - void sendAudioEvents(Object event, List listeners) { > + void sendAudioEvents(Object event, List listeners) { > if ((listeners == null) > || (listeners.size() == 0)) { > // nothing to do > @@ -392,7 +392,7 @@ > * @param event the event to be dispatched > * @param listeners listener list; will be copied > */ > - EventInfo(Object event, List listeners) { > + EventInfo(Object event, List listeners) { > this.event = event; > this.listeners = listeners.toArray(); > } > --- old/src/share/classes/com/sun/media/sound/JDK13Services.java > 2014-04-30 18:30:10.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/JDK13Services.java > 2014-04-30 18:30:09.000000000 -0700 > @@ -118,7 +118,7 @@ > (the part before the hash sign), if available. If the > property is > not set or the value has no provider class name part, null is > returned. > */ > - public static synchronized String > getDefaultProviderClassName(Class typeClass) { > + public static synchronized String > getDefaultProviderClassName(Class typeClass) { > String value = null; > String defaultProviderSpec = getDefaultProvider(typeClass); > if (defaultProviderSpec != null) { > @@ -144,7 +144,7 @@ > part after the hash sign), if available. If the property is > not set > or the value has no instance name part, null is returned. > */ > - public static synchronized String getDefaultInstanceName(Class > typeClass) { > + public static synchronized String getDefaultInstanceName(Class > typeClass) { > String value = null; > String defaultProviderSpec = getDefaultProvider(typeClass); > if (defaultProviderSpec != null) { > @@ -165,7 +165,7 @@ > @return The complete value of the property, if available. > If the property is not set, null is returned. > */ > - private static synchronized String getDefaultProvider(Class > typeClass) { > + private static synchronized String getDefaultProvider(Class > typeClass) { > if (!SourceDataLine.class.equals(typeClass) > && !TargetDataLine.class.equals(typeClass) > && !Clip.class.equals(typeClass) > --- > old/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java > 2014-04-30 18:30:10.000000000 -0700 > +++ > new/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java > 2014-04-30 18:30:10.000000000 -0700 > @@ -106,9 +106,9 @@ > * the new instance will not reflect that state... > */ > static final class MidiInDeviceInfo extends > AbstractMidiDeviceProvider.Info { > - private final Class providerClass; > + private final Class providerClass; > > - private MidiInDeviceInfo(int index, Class providerClass) { > + private MidiInDeviceInfo(int index, Class providerClass) { > super(nGetName(index), nGetVendor(index), > nGetDescription(index), nGetVersion(index), index); > this.providerClass = providerClass; > } > --- > old/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java > 2014-04-30 18:30:10.000000000 -0700 > +++ > new/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java > 2014-04-30 18:30:10.000000000 -0700 > @@ -104,9 +104,9 @@ > * the new instance will not reflect that state... > */ > static final class MidiOutDeviceInfo extends > AbstractMidiDeviceProvider.Info { > - private final Class providerClass; > + private final Class providerClass; > > - private MidiOutDeviceInfo(int index, Class providerClass) { > + private MidiOutDeviceInfo(int index, Class providerClass) { > super(nGetName(index), nGetVendor(index), > nGetDescription(index), nGetVersion(index), index); > this.providerClass = providerClass; > } > --- old/src/share/classes/com/sun/media/sound/MidiUtils.java > 2014-04-30 18:30:11.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/MidiUtils.java > 2014-04-30 18:30:11.000000000 -0700 > @@ -295,7 +295,7 @@ > > > public synchronized void refresh(Sequence seq) { > - ArrayList list = new ArrayList(); > + ArrayList list = new ArrayList<>(); > Track[] tracks = seq.getTracks(); > if (tracks.length > 0) { > // tempo events only occur in track 0 > @@ -313,7 +313,7 @@ > int size = list.size() + 1; > firstTempoIsFake = true; > if ((size > 1) > - && (((MidiEvent) list.get(0)).getTick() == 0)) { > + && (list.get(0).getTick() == 0)) { > // do not need to add an initial tempo event at the > beginning > size--; > firstTempoIsFake = false; > @@ -328,7 +328,7 @@ > e++; > } > for (int i = 0; i < list.size(); i++, e++) { > - MidiEvent evt = (MidiEvent) list.get(i); > + MidiEvent evt = list.get(i); > ticks[e] = evt.getTick(); > tempos[e] = getTempoMPQ(evt.getMessage()); > } > --- old/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java > 2014-04-30 18:30:11.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java > 2014-04-30 18:30:11.000000000 -0700 > @@ -91,7 +91,7 @@ > // filter out targetEncoding from the old getOutputFormats( > sourceFormat ) method > > AudioFormat[] formats = getOutputFormats( sourceFormat ); > - Vector newFormats = new Vector(); > + Vector newFormats = new Vector<>(); > for(int i=0; i if( formats[i].getEncoding().equals( targetEncoding ) ) { > newFormats.addElement( formats[i] ); > @@ -101,7 +101,7 @@ > AudioFormat[] formatArray = new AudioFormat[newFormats.size()]; > > for (int i = 0; i < formatArray.length; i++) { > - formatArray[i] = (AudioFormat)(newFormats.elementAt(i)); > + formatArray[i] = newFormats.elementAt(i); > } > > return formatArray; > @@ -181,7 +181,7 @@ > /* public AudioFormat[] getOutputFormats(AudioFormat > inputFormat) { */ > private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { > > - Vector formats = new Vector(); > + Vector formats = new Vector<>(); > AudioFormat format; > > int sampleSize = inputFormat.getSampleSizeInBits(); > @@ -335,7 +335,7 @@ > > for (int i = 0; i < formatArray.length; i++) { > > - formatArray[i] = (AudioFormat)(formats.elementAt(i)); > + formatArray[i] = formats.elementAt(i); > } > } > > --- old/src/share/classes/com/sun/media/sound/PortMixer.java > 2014-04-30 18:30:12.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/PortMixer.java > 2014-04-30 18:30:12.000000000 -0700 > @@ -253,12 +253,12 @@ > long newID = ((PortMixer) mixer).getID(); > if ((id == 0) || (newID != id) || (controls.length == 0)) { > id = newID; > - Vector vector = new Vector(); > + Vector vector = new Vector<>(); > synchronized (vector) { > nGetControls(id, portIndex, vector); > controls = new Control[vector.size()]; > for (int i = 0; i < controls.length; i++) { > - controls[i] = (Control) vector.elementAt(i); > + controls[i] = vector.elementAt(i); > } > } > } else { > @@ -494,6 +494,7 @@ > private static native String nGetPortName(long id, int portIndex); > > // fills the vector with the controls for this port > + @SuppressWarnings("rawtypes") > private static native void nGetControls(long id, int portIndex, > Vector vector); > > // getters/setters for controls > --- old/src/share/classes/com/sun/media/sound/RealTimeSequencer.java > 2014-04-30 18:30:12.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/RealTimeSequencer.java > 2014-04-30 18:30:12.000000000 -0700 > @@ -122,7 +122,7 @@ > /** > * List of tracks to which we're recording > */ > - private final List recordingTracks = new ArrayList(); > + private final List recordingTracks = new > ArrayList<>(); > > > private long loopStart = 0; > @@ -133,13 +133,13 @@ > /** > * Meta event listeners > */ > - private final ArrayList metaEventListeners = new ArrayList(); > + private final ArrayList metaEventListeners = new > ArrayList<>(); > > > /** > * Control change listeners > */ > - private final ArrayList controllerEventListeners = new ArrayList(); > + private final ArrayList > controllerEventListeners = new ArrayList<>(); > > > /** automatic connection support */ > @@ -645,7 +645,7 @@ > boolean flag = false; > for(int i=0; i < controllerEventListeners.size(); i++) { > > - cve = (ControllerListElement) > controllerEventListeners.get(i); > + cve = controllerEventListeners.get(i); > > if (cve.listener.equals(listener)) { > cve.addControllers(controllers); > @@ -669,7 +669,7 @@ > ControllerListElement cve = null; > boolean flag = false; > for (int i=0; i < controllerEventListeners.size(); i++) { > - cve = (ControllerListElement) > controllerEventListeners.get(i); > + cve = controllerEventListeners.get(i); > if (cve.listener.equals(listener)) { > cve.removeControllers(controllers); > flag = true; > @@ -940,9 +940,9 @@ > } > ShortMessage msg = (ShortMessage) message; > int controller = msg.getData1(); > - List sendToListeners = new ArrayList(); > + List sendToListeners = new ArrayList<>(); > for (int i = 0; i < size; i++) { > - ControllerListElement cve = (ControllerListElement) > controllerEventListeners.get(i); > + ControllerListElement cve = controllerEventListeners.get(i); > for(int j = 0; j < cve.controllers.length; j++) { > if (cve.controllers[j] == controller) { > sendToListeners.add(cve.listener); > @@ -1213,13 +1213,13 @@ > this.channel = channel; > } > > - static RecordingTrack get(List recordingTracks, Track track) { > + static RecordingTrack get(List > recordingTracks, Track track) { > > synchronized(recordingTracks) { > int size = recordingTracks.size(); > > for (int i = 0; i < size; i++) { > - RecordingTrack current = > (RecordingTrack)recordingTracks.get(i); > + RecordingTrack current = recordingTracks.get(i); > if (current.track == track) { > return current; > } > @@ -1228,12 +1228,12 @@ > return null; > } > > - static Track get(List recordingTracks, int channel) { > + static Track get(List recordingTracks, int > channel) { > > synchronized(recordingTracks) { > int size = recordingTracks.size(); > for (int i = 0; i < size; i++) { > - RecordingTrack current = > (RecordingTrack)recordingTracks.get(i); > + RecordingTrack current = recordingTracks.get(i); > if ((current.channel == channel) || > (current.channel == -1)) { > return current.track; > } > --- old/src/share/classes/com/sun/media/sound/SoftSynthesizer.java > 2014-04-30 18:30:13.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/SoftSynthesizer.java > 2014-04-30 18:30:13.000000000 -0700 > @@ -949,7 +949,7 @@ > Object v = (info == null) ? null : info.get(item2.name); > v = (v != null) ? v : > storedProperties.getProperty(item2.name); > if (v != null) { > - Class c = (item2.valueClass); > + Class c = (item2.valueClass); > if (c.isInstance(v)) > item2.value = v; > else if (v instanceof String) { > --- old/src/share/classes/com/sun/media/sound/UlawCodec.java > 2014-04-30 18:30:13.000000000 -0700 > +++ new/src/share/classes/com/sun/media/sound/UlawCodec.java > 2014-04-30 18:30:13.000000000 -0700 > @@ -198,7 +198,7 @@ > /* public AudioFormat[] getOutputFormats(AudioFormat > inputFormat) { */ > private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { > > - Vector formats = new Vector(); > + Vector formats = new Vector<>(); > AudioFormat format; > > if ((inputFormat.getSampleSizeInBits() == 16) > @@ -235,7 +235,7 @@ > > AudioFormat[] formatArray = new AudioFormat[formats.size()]; > for (int i = 0; i < formatArray.length; i++) { > - formatArray[i] = (AudioFormat)(formats.elementAt(i)); > + formatArray[i] = formats.elementAt(i); > } > return formatArray; > } > From philip.race at oracle.com Mon May 5 16:39:48 2014 From: philip.race at oracle.com (Phil Race) Date: Mon, 05 May 2014 09:39:48 -0700 Subject: JDK 9 RFR of JDK-8042256: Fix raw and unchecked lint warnings in com.sun.media.sound In-Reply-To: <5367B5FC.9090106@oracle.com> References: <5361D2AB.7040007@oracle.com> <5367B5FC.9090106@oracle.com> Message-ID: <5367BED4.7000905@oracle.com> All looks OK to me .. -phil. On 5/5/2014 9:02 AM, Joe Darcy wrote: > * ping* > > -Joe > > On 4/30/2014 9:50 PM, Joe Darcy wrote: >> Hello, >> >> Please review this change to address the raw and unchecked warnings >> in com.sun.media.sound: >> >> JDK-8042256: Fix raw and unchecked lint warnings in >> com.sun.media.sound >> http://cr.openjdk.java.net/~darcy/8042256.0/ >> >> Patch below. >> >> Thanks, >> >> -Joe >> >> --- old/src/share/classes/com/sun/media/sound/AbstractLine.java >> 2014-04-30 18:30:06.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/AbstractLine.java >> 2014-04-30 18:30:06.000000000 -0700 >> @@ -48,7 +48,7 @@ >> protected Control[] controls; >> AbstractMixer mixer; >> private boolean open = false; >> - private final Vector listeners = new Vector(); >> + private final Vector listeners = new Vector<>(); >> >> /** >> * Contains event dispatcher per thread group. >> --- old/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java >> 2014-04-30 18:30:07.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java >> 2014-04-30 18:30:07.000000000 -0700 >> @@ -70,7 +70,7 @@ >> >> /** List of Receivers and Transmitters that opened the device >> implicitely. >> */ >> - private List openKeepingObjects; >> + private List openKeepingObjects; >> >> /** >> * This is the device handle returned from native code >> @@ -284,6 +284,7 @@ >> } >> >> >> + @SuppressWarnings("unchecked") // Cast of result of clone >> public final List getReceivers() { >> List recs; >> synchronized (traRecLock) { >> @@ -313,6 +314,7 @@ >> } >> >> >> + @SuppressWarnings("unchecked") // Cast of result of clone >> public final List getTransmitters() { >> List tras; >> synchronized (traRecLock) { >> @@ -372,9 +374,9 @@ >> >> /** Return the list of objects that have opened the device >> implicitely. >> */ >> - private synchronized List getOpenKeepingObjects() { >> + private synchronized List getOpenKeepingObjects() { >> if (openKeepingObjects == null) { >> - openKeepingObjects = new ArrayList(); >> + openKeepingObjects = new ArrayList<>(); >> } >> return openKeepingObjects; >> } >> --- old/src/share/classes/com/sun/media/sound/AbstractMixer.java >> 2014-04-30 18:30:07.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/AbstractMixer.java >> 2014-04-30 18:30:07.000000000 -0700 >> @@ -90,13 +90,13 @@ >> /** >> * Source lines (ports) currently open >> */ >> - private final Vector sourceLines = new Vector(); >> + private final Vector sourceLines = new Vector<>(); >> >> >> /** >> * Target lines currently open. >> */ >> - private final Vector targetLines = new Vector(); >> + private final Vector targetLines = new Vector<>(); >> >> >> /** >> @@ -151,7 +151,7 @@ >> public final Line.Info[] getSourceLineInfo(Line.Info info) { >> >> int i; >> - Vector vec = new Vector(); >> + Vector vec = new Vector<>(); >> >> for (i = 0; i < sourceLineInfo.length; i++) { >> >> @@ -162,7 +162,7 @@ >> >> Line.Info[] returnedArray = new Line.Info[vec.size()]; >> for (i = 0; i < returnedArray.length; i++) { >> - returnedArray[i] = (Line.Info)vec.elementAt(i); >> + returnedArray[i] = vec.elementAt(i); >> } >> >> return returnedArray; >> @@ -172,7 +172,7 @@ >> public final Line.Info[] getTargetLineInfo(Line.Info info) { >> >> int i; >> - Vector vec = new Vector(); >> + Vector vec = new Vector<>(); >> >> for (i = 0; i < targetLineInfo.length; i++) { >> >> @@ -183,7 +183,7 @@ >> >> Line.Info[] returnedArray = new Line.Info[vec.size()]; >> for (i = 0; i < returnedArray.length; i++) { >> - returnedArray[i] = (Line.Info)vec.elementAt(i); >> + returnedArray[i] = vec.elementAt(i); >> } >> >> return returnedArray; >> @@ -231,7 +231,7 @@ >> localLines = new Line[sourceLines.size()]; >> >> for (int i = 0; i < localLines.length; i++) { >> - localLines[i] = (Line)sourceLines.elementAt(i); >> + localLines[i] = sourceLines.elementAt(i); >> } >> } >> >> @@ -248,7 +248,7 @@ >> localLines = new Line[targetLines.size()]; >> >> for (int i = 0; i < localLines.length; i++) { >> - localLines[i] = (Line)targetLines.elementAt(i); >> + localLines[i] = targetLines.elementAt(i); >> } >> } >> >> @@ -453,7 +453,8 @@ >> return; >> } >> >> - Vector localSourceLines = (Vector)sourceLines.clone(); >> + @SuppressWarnings("unchecked") >> + Vector localSourceLines = >> (Vector)sourceLines.clone(); >> for (int i = 0; i < localSourceLines.size(); i++) { >> >> // if any other open line is running, return >> @@ -468,7 +469,8 @@ >> } >> } >> >> - Vector localTargetLines = (Vector)targetLines.clone(); >> + @SuppressWarnings("unchecked") >> + Vector localTargetLines = >> (Vector)targetLines.clone(); >> for (int i = 0; i < localTargetLines.size(); i++) { >> >> // if any other open line is running, return >> --- old/src/share/classes/com/sun/media/sound/AlawCodec.java >> 2014-04-30 18:30:08.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/AlawCodec.java >> 2014-04-30 18:30:08.000000000 -0700 >> @@ -213,7 +213,7 @@ >> private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { >> >> >> - Vector formats = new Vector(); >> + Vector formats = new Vector<>(); >> AudioFormat format; >> >> if ( >> AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) { >> @@ -248,7 +248,7 @@ >> >> AudioFormat[] formatArray = new AudioFormat[formats.size()]; >> for (int i = 0; i < formatArray.length; i++) { >> - formatArray[i] = (AudioFormat)(formats.elementAt(i)); >> + formatArray[i] = formats.elementAt(i); >> } >> return formatArray; >> } >> --- >> old/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java >> 2014-04-30 18:30:08.000000000 -0700 >> +++ >> new/src/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java >> 2014-04-30 18:30:08.000000000 -0700 >> @@ -68,7 +68,7 @@ >> * The valueClass field specifies class >> * used in value field. >> */ >> - public Class valueClass = null; >> + public Class valueClass = null; >> /** >> * An array of possible values if the value for the field >> * AudioSynthesizerPropertyInfo.value may be selected >> --- old/src/share/classes/com/sun/media/sound/DirectAudioDevice.java >> 2014-04-30 18:30:09.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/DirectAudioDevice.java >> 2014-04-30 18:30:09.000000000 -0700 >> @@ -94,7 +94,7 @@ >> } >> >> private DirectDLI createDataLineInfo(boolean isSource) { >> - Vector formats = new Vector(); >> + Vector formats = new Vector<>(); >> AudioFormat[] hardwareFormatArray = null; >> AudioFormat[] formatArray = null; >> >> @@ -107,7 +107,7 @@ >> int formatArraySize = size; >> hardwareFormatArray = new AudioFormat[size]; >> for (int i = 0; i < size; i++) { >> - AudioFormat format = >> (AudioFormat)formats.elementAt(i); >> + AudioFormat format = formats.elementAt(i); >> hardwareFormatArray[i] = format; >> int bits = format.getSampleSizeInBits(); >> boolean isSigned = >> format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED); >> @@ -265,7 +265,7 @@ >> return ((DirectAudioDeviceProvider.DirectAudioDeviceInfo) >> getMixerInfo()).getMaxSimulLines(); >> } >> >> - private static void addFormat(Vector v, int bits, int >> frameSizeInBytes, int channels, float sampleRate, >> + private static void addFormat(Vector v, int bits, >> int frameSizeInBytes, int channels, float sampleRate, >> int encoding, boolean signed, >> boolean bigEndian) { >> AudioFormat.Encoding enc = null; >> switch (encoding) { >> @@ -338,7 +338,7 @@ >> private static final class DirectDLI extends DataLine.Info { >> final AudioFormat[] hardwareFormats; >> >> - private DirectDLI(Class clazz, AudioFormat[] formatArray, >> + private DirectDLI(Class clazz, AudioFormat[] formatArray, >> AudioFormat[] hardwareFormatArray, >> int minBuffer, int maxBuffer) { >> super(clazz, formatArray, minBuffer, maxBuffer); >> @@ -1457,7 +1457,7 @@ >> >> } // class DirectBAOS >> >> - >> + @SuppressWarnings("rawtypes") >> private static native void nGetFormats(int mixerIndex, int >> deviceID, >> boolean isSource, Vector >> formats); >> >> --- old/src/share/classes/com/sun/media/sound/EventDispatcher.java >> 2014-04-30 18:30:09.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/EventDispatcher.java >> 2014-04-30 18:30:09.000000000 -0700 >> @@ -57,7 +57,7 @@ >> /** >> * List of events >> */ >> - private final ArrayList eventQueue = new ArrayList(); >> + private final ArrayList eventQueue = new ArrayList<>(); >> >> >> /** >> @@ -186,7 +186,7 @@ >> } >> if (eventQueue.size() > 0) { >> // Remove the event from the queue and dispatch it >> to the listeners. >> - eventInfo = (EventInfo) eventQueue.remove(0); >> + eventInfo = eventQueue.remove(0); >> } >> >> } // end of synchronized >> @@ -230,7 +230,7 @@ >> /** >> * Send audio and MIDI events. >> */ >> - void sendAudioEvents(Object event, List listeners) { >> + void sendAudioEvents(Object event, List listeners) { >> if ((listeners == null) >> || (listeners.size() == 0)) { >> // nothing to do >> @@ -392,7 +392,7 @@ >> * @param event the event to be dispatched >> * @param listeners listener list; will be copied >> */ >> - EventInfo(Object event, List listeners) { >> + EventInfo(Object event, List listeners) { >> this.event = event; >> this.listeners = listeners.toArray(); >> } >> --- old/src/share/classes/com/sun/media/sound/JDK13Services.java >> 2014-04-30 18:30:10.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/JDK13Services.java >> 2014-04-30 18:30:09.000000000 -0700 >> @@ -118,7 +118,7 @@ >> (the part before the hash sign), if available. If the >> property is >> not set or the value has no provider class name part, null >> is returned. >> */ >> - public static synchronized String >> getDefaultProviderClassName(Class typeClass) { >> + public static synchronized String >> getDefaultProviderClassName(Class typeClass) { >> String value = null; >> String defaultProviderSpec = getDefaultProvider(typeClass); >> if (defaultProviderSpec != null) { >> @@ -144,7 +144,7 @@ >> part after the hash sign), if available. If the property is >> not set >> or the value has no instance name part, null is returned. >> */ >> - public static synchronized String getDefaultInstanceName(Class >> typeClass) { >> + public static synchronized String >> getDefaultInstanceName(Class typeClass) { >> String value = null; >> String defaultProviderSpec = getDefaultProvider(typeClass); >> if (defaultProviderSpec != null) { >> @@ -165,7 +165,7 @@ >> @return The complete value of the property, if available. >> If the property is not set, null is returned. >> */ >> - private static synchronized String getDefaultProvider(Class >> typeClass) { >> + private static synchronized String getDefaultProvider(Class >> typeClass) { >> if (!SourceDataLine.class.equals(typeClass) >> && !TargetDataLine.class.equals(typeClass) >> && !Clip.class.equals(typeClass) >> --- >> old/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java >> 2014-04-30 18:30:10.000000000 -0700 >> +++ >> new/src/share/classes/com/sun/media/sound/MidiInDeviceProvider.java >> 2014-04-30 18:30:10.000000000 -0700 >> @@ -106,9 +106,9 @@ >> * the new instance will not reflect that state... >> */ >> static final class MidiInDeviceInfo extends >> AbstractMidiDeviceProvider.Info { >> - private final Class providerClass; >> + private final Class providerClass; >> >> - private MidiInDeviceInfo(int index, Class providerClass) { >> + private MidiInDeviceInfo(int index, Class providerClass) { >> super(nGetName(index), nGetVendor(index), >> nGetDescription(index), nGetVersion(index), index); >> this.providerClass = providerClass; >> } >> --- >> old/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java >> 2014-04-30 18:30:10.000000000 -0700 >> +++ >> new/src/share/classes/com/sun/media/sound/MidiOutDeviceProvider.java >> 2014-04-30 18:30:10.000000000 -0700 >> @@ -104,9 +104,9 @@ >> * the new instance will not reflect that state... >> */ >> static final class MidiOutDeviceInfo extends >> AbstractMidiDeviceProvider.Info { >> - private final Class providerClass; >> + private final Class providerClass; >> >> - private MidiOutDeviceInfo(int index, Class providerClass) { >> + private MidiOutDeviceInfo(int index, Class providerClass) { >> super(nGetName(index), nGetVendor(index), >> nGetDescription(index), nGetVersion(index), index); >> this.providerClass = providerClass; >> } >> --- old/src/share/classes/com/sun/media/sound/MidiUtils.java >> 2014-04-30 18:30:11.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/MidiUtils.java >> 2014-04-30 18:30:11.000000000 -0700 >> @@ -295,7 +295,7 @@ >> >> >> public synchronized void refresh(Sequence seq) { >> - ArrayList list = new ArrayList(); >> + ArrayList list = new ArrayList<>(); >> Track[] tracks = seq.getTracks(); >> if (tracks.length > 0) { >> // tempo events only occur in track 0 >> @@ -313,7 +313,7 @@ >> int size = list.size() + 1; >> firstTempoIsFake = true; >> if ((size > 1) >> - && (((MidiEvent) list.get(0)).getTick() == 0)) { >> + && (list.get(0).getTick() == 0)) { >> // do not need to add an initial tempo event at the >> beginning >> size--; >> firstTempoIsFake = false; >> @@ -328,7 +328,7 @@ >> e++; >> } >> for (int i = 0; i < list.size(); i++, e++) { >> - MidiEvent evt = (MidiEvent) list.get(i); >> + MidiEvent evt = list.get(i); >> ticks[e] = evt.getTick(); >> tempos[e] = getTempoMPQ(evt.getMessage()); >> } >> --- old/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java >> 2014-04-30 18:30:11.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/PCMtoPCMCodec.java >> 2014-04-30 18:30:11.000000000 -0700 >> @@ -91,7 +91,7 @@ >> // filter out targetEncoding from the old getOutputFormats( >> sourceFormat ) method >> >> AudioFormat[] formats = getOutputFormats( sourceFormat ); >> - Vector newFormats = new Vector(); >> + Vector newFormats = new Vector<>(); >> for(int i=0; i> if( formats[i].getEncoding().equals( targetEncoding ) ) { >> newFormats.addElement( formats[i] ); >> @@ -101,7 +101,7 @@ >> AudioFormat[] formatArray = new AudioFormat[newFormats.size()]; >> >> for (int i = 0; i < formatArray.length; i++) { >> - formatArray[i] = (AudioFormat)(newFormats.elementAt(i)); >> + formatArray[i] = newFormats.elementAt(i); >> } >> >> return formatArray; >> @@ -181,7 +181,7 @@ >> /* public AudioFormat[] getOutputFormats(AudioFormat >> inputFormat) { */ >> private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { >> >> - Vector formats = new Vector(); >> + Vector formats = new Vector<>(); >> AudioFormat format; >> >> int sampleSize = inputFormat.getSampleSizeInBits(); >> @@ -335,7 +335,7 @@ >> >> for (int i = 0; i < formatArray.length; i++) { >> >> - formatArray[i] = (AudioFormat)(formats.elementAt(i)); >> + formatArray[i] = formats.elementAt(i); >> } >> } >> >> --- old/src/share/classes/com/sun/media/sound/PortMixer.java >> 2014-04-30 18:30:12.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/PortMixer.java >> 2014-04-30 18:30:12.000000000 -0700 >> @@ -253,12 +253,12 @@ >> long newID = ((PortMixer) mixer).getID(); >> if ((id == 0) || (newID != id) || (controls.length == 0)) { >> id = newID; >> - Vector vector = new Vector(); >> + Vector vector = new Vector<>(); >> synchronized (vector) { >> nGetControls(id, portIndex, vector); >> controls = new Control[vector.size()]; >> for (int i = 0; i < controls.length; i++) { >> - controls[i] = (Control) vector.elementAt(i); >> + controls[i] = vector.elementAt(i); >> } >> } >> } else { >> @@ -494,6 +494,7 @@ >> private static native String nGetPortName(long id, int portIndex); >> >> // fills the vector with the controls for this port >> + @SuppressWarnings("rawtypes") >> private static native void nGetControls(long id, int portIndex, >> Vector vector); >> >> // getters/setters for controls >> --- old/src/share/classes/com/sun/media/sound/RealTimeSequencer.java >> 2014-04-30 18:30:12.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/RealTimeSequencer.java >> 2014-04-30 18:30:12.000000000 -0700 >> @@ -122,7 +122,7 @@ >> /** >> * List of tracks to which we're recording >> */ >> - private final List recordingTracks = new ArrayList(); >> + private final List recordingTracks = new >> ArrayList<>(); >> >> >> private long loopStart = 0; >> @@ -133,13 +133,13 @@ >> /** >> * Meta event listeners >> */ >> - private final ArrayList metaEventListeners = new ArrayList(); >> + private final ArrayList metaEventListeners = new >> ArrayList<>(); >> >> >> /** >> * Control change listeners >> */ >> - private final ArrayList controllerEventListeners = new ArrayList(); >> + private final ArrayList >> controllerEventListeners = new ArrayList<>(); >> >> >> /** automatic connection support */ >> @@ -645,7 +645,7 @@ >> boolean flag = false; >> for(int i=0; i < controllerEventListeners.size(); i++) { >> >> - cve = (ControllerListElement) >> controllerEventListeners.get(i); >> + cve = controllerEventListeners.get(i); >> >> if (cve.listener.equals(listener)) { >> cve.addControllers(controllers); >> @@ -669,7 +669,7 @@ >> ControllerListElement cve = null; >> boolean flag = false; >> for (int i=0; i < controllerEventListeners.size(); i++) { >> - cve = (ControllerListElement) >> controllerEventListeners.get(i); >> + cve = controllerEventListeners.get(i); >> if (cve.listener.equals(listener)) { >> cve.removeControllers(controllers); >> flag = true; >> @@ -940,9 +940,9 @@ >> } >> ShortMessage msg = (ShortMessage) message; >> int controller = msg.getData1(); >> - List sendToListeners = new ArrayList(); >> + List sendToListeners = new ArrayList<>(); >> for (int i = 0; i < size; i++) { >> - ControllerListElement cve = (ControllerListElement) >> controllerEventListeners.get(i); >> + ControllerListElement cve = >> controllerEventListeners.get(i); >> for(int j = 0; j < cve.controllers.length; j++) { >> if (cve.controllers[j] == controller) { >> sendToListeners.add(cve.listener); >> @@ -1213,13 +1213,13 @@ >> this.channel = channel; >> } >> >> - static RecordingTrack get(List recordingTracks, Track track) { >> + static RecordingTrack get(List >> recordingTracks, Track track) { >> >> synchronized(recordingTracks) { >> int size = recordingTracks.size(); >> >> for (int i = 0; i < size; i++) { >> - RecordingTrack current = >> (RecordingTrack)recordingTracks.get(i); >> + RecordingTrack current = recordingTracks.get(i); >> if (current.track == track) { >> return current; >> } >> @@ -1228,12 +1228,12 @@ >> return null; >> } >> >> - static Track get(List recordingTracks, int channel) { >> + static Track get(List recordingTracks, int >> channel) { >> >> synchronized(recordingTracks) { >> int size = recordingTracks.size(); >> for (int i = 0; i < size; i++) { >> - RecordingTrack current = >> (RecordingTrack)recordingTracks.get(i); >> + RecordingTrack current = recordingTracks.get(i); >> if ((current.channel == channel) || >> (current.channel == -1)) { >> return current.track; >> } >> --- old/src/share/classes/com/sun/media/sound/SoftSynthesizer.java >> 2014-04-30 18:30:13.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/SoftSynthesizer.java >> 2014-04-30 18:30:13.000000000 -0700 >> @@ -949,7 +949,7 @@ >> Object v = (info == null) ? null : info.get(item2.name); >> v = (v != null) ? v : >> storedProperties.getProperty(item2.name); >> if (v != null) { >> - Class c = (item2.valueClass); >> + Class c = (item2.valueClass); >> if (c.isInstance(v)) >> item2.value = v; >> else if (v instanceof String) { >> --- old/src/share/classes/com/sun/media/sound/UlawCodec.java >> 2014-04-30 18:30:13.000000000 -0700 >> +++ new/src/share/classes/com/sun/media/sound/UlawCodec.java >> 2014-04-30 18:30:13.000000000 -0700 >> @@ -198,7 +198,7 @@ >> /* public AudioFormat[] getOutputFormats(AudioFormat >> inputFormat) { */ >> private AudioFormat[] getOutputFormats(AudioFormat inputFormat) { >> >> - Vector formats = new Vector(); >> + Vector formats = new Vector<>(); >> AudioFormat format; >> >> if ((inputFormat.getSampleSizeInBits() == 16) >> @@ -235,7 +235,7 @@ >> >> AudioFormat[] formatArray = new AudioFormat[formats.size()]; >> for (int i = 0; i < formatArray.length; i++) { >> - formatArray[i] = (AudioFormat)(formats.elementAt(i)); >> + formatArray[i] = formats.elementAt(i); >> } >> return formatArray; >> } >> > From Sergey.Bylokhov at oracle.com Thu May 8 12:20:50 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 08 May 2014 16:20:50 +0400 Subject: [9] Review Request: 8042007 Javadoc cleanup of javax.sound.sampled.spi package In-Reply-To: <535E82D2.4040101@oracle.com> References: <535E82D2.4040101@oracle.com> Message-ID: <536B76A2.2050102@oracle.com> Hello. Any volunteers? =) On 4/28/14 8:33 PM, Sergey Bylokhov wrote: > Hello. > Please review another one javadoc "weekend cleanup" in jdk 9 in sound > area. > - 80 column limit > - replaced to @tags > - empty line after description/before the first tag > - sets of spaces in the middle of text were deleted > - @param, @throws, @return now align, to be more readable > > Bug: https://bugs.openjdk.java.net/browse/JDK-8042007 > Webrev can be found at: > http://cr.openjdk.java.net/~serb/8042007/webrev.00 > -- Best regards, Sergey. From joe.darcy at oracle.com Thu May 15 06:08:25 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 14 May 2014 23:08:25 -0700 Subject: JDK 9 RFR of JDK-8042871: Fix raw and unchecked warnings in sun.audio Message-ID: <537459D9.3000900@oracle.com> Hello, Please review this fix for JDK-8042871: Fix raw and unchecked warnings in sun.audio http://cr.openjdk.java.net/~darcy/8042871.0/ Patch below. Thanks, -Joe --- old/src/share/classes/sun/audio/AudioDevice.java 2014-05-14 23:04:08.000000000 -0700 +++ new/src/share/classes/sun/audio/AudioDevice.java 2014-05-14 23:04:07.000000000 -0700 @@ -58,10 +58,7 @@ private boolean DEBUG = false /*true*/ ; - /** Hashtable of audio clips / input streams. */ - private Hashtable clipStreams; - - private Vector infos; + private Vector infos; /** Are we currently playing audio? */ private boolean playing = false; @@ -81,9 +78,7 @@ * Create an AudioDevice instance. */ private AudioDevice() { - - clipStreams = new Hashtable(); - infos = new Vector(); + infos = new Vector<>(); } @@ -161,7 +156,7 @@ // is this already playing? if so, then just return for(int i=0; i(); } /** --- old/src/share/classes/sun/audio/AudioPlayer.java 2014-05-14 23:04:08.000000000 -0700 +++ new/src/share/classes/sun/audio/AudioPlayer.java 2014-05-14 23:04:08.000000000 -0700 @@ -92,18 +92,16 @@ private static AudioPlayer getAudioPlayer() { if(DEBUG) { System.out.println("> AudioPlayer.getAudioPlayer()"); } - AudioPlayer audioPlayer; - PrivilegedAction action = new PrivilegedAction() { - public Object run() { - Thread t = new AudioPlayer(); + PrivilegedAction action = new PrivilegedAction() { + public AudioPlayer run() { + AudioPlayer t = new AudioPlayer(); t.setPriority(MAX_PRIORITY); t.setDaemon(true); t.start(); return t; } }; - audioPlayer = (AudioPlayer) AccessController.doPrivileged(action); - return audioPlayer; + return AccessController.doPrivileged(action); } /** --- old/src/share/classes/sun/audio/AudioStreamSequence.java 2014-05-14 23:04:09.000000000 -0700 +++ new/src/share/classes/sun/audio/AudioStreamSequence.java 2014-05-14 23:04:09.000000000 -0700 @@ -45,14 +45,14 @@ */ public final class AudioStreamSequence extends SequenceInputStream { - Enumeration e; + Enumeration e; InputStream in; /** * Create an AudioStreamSequence given an * enumeration of streams. */ - public AudioStreamSequence(Enumeration e) { + public AudioStreamSequence(Enumeration e) { super(e); } From Sergey.Bylokhov at oracle.com Thu May 15 19:16:28 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Thu, 15 May 2014 23:16:28 +0400 Subject: JDK 9 RFR of JDK-8042871: Fix raw and unchecked warnings in sun.audio In-Reply-To: <537459D9.3000900@oracle.com> References: <537459D9.3000900@oracle.com> Message-ID: <5375128C.9000806@oracle.com> Hi. Joe. It seems to me "Enumeration e" in AudioStreamSequence can be removed too. On 5/15/14 10:08 AM, Joe Darcy wrote: > Hello, > > Please review this fix for > > JDK-8042871: Fix raw and unchecked warnings in sun.audio > http://cr.openjdk.java.net/~darcy/8042871.0/ > > Patch below. > > Thanks, > > -Joe > > --- old/src/share/classes/sun/audio/AudioDevice.java 2014-05-14 > 23:04:08.000000000 -0700 > +++ new/src/share/classes/sun/audio/AudioDevice.java 2014-05-14 > 23:04:07.000000000 -0700 > @@ -58,10 +58,7 @@ > > private boolean DEBUG = false /*true*/ ; > > - /** Hashtable of audio clips / input streams. */ > - private Hashtable clipStreams; > - > - private Vector infos; > + private Vector infos; > > /** Are we currently playing audio? */ > private boolean playing = false; > @@ -81,9 +78,7 @@ > * Create an AudioDevice instance. > */ > private AudioDevice() { > - > - clipStreams = new Hashtable(); > - infos = new Vector(); > + infos = new Vector<>(); > } > > > @@ -161,7 +156,7 @@ > > // is this already playing? if so, then just return > for(int i=0; i - info = (AudioDevice.Info)infos.elementAt(i); > + info = infos.elementAt(i); > if( info.in == in ) { > > return; > @@ -290,7 +285,7 @@ > > for(int i=0; i > - info = (AudioDevice.Info)infos.elementAt(i); > + info = infos.elementAt(i); > > if( info.in == in ) { > > @@ -355,7 +350,7 @@ > > for(int i=0; i > - info = (AudioDevice.Info)infos.elementAt(i); > + info = infos.elementAt(i); > > if( info.sequencer != null ) { > > @@ -375,8 +370,7 @@ > System.err.println("Audio Device: Streams all closed."); > } > // Empty the hash table. > - clipStreams = new Hashtable(); > - infos = new Vector(); > + infos = new Vector<>(); > } > > /** > --- old/src/share/classes/sun/audio/AudioPlayer.java 2014-05-14 > 23:04:08.000000000 -0700 > +++ new/src/share/classes/sun/audio/AudioPlayer.java 2014-05-14 > 23:04:08.000000000 -0700 > @@ -92,18 +92,16 @@ > private static AudioPlayer getAudioPlayer() { > > if(DEBUG) { System.out.println("> > AudioPlayer.getAudioPlayer()"); } > - AudioPlayer audioPlayer; > - PrivilegedAction action = new PrivilegedAction() { > - public Object run() { > - Thread t = new AudioPlayer(); > + PrivilegedAction action = new > PrivilegedAction() { > + public AudioPlayer run() { > + AudioPlayer t = new AudioPlayer(); > t.setPriority(MAX_PRIORITY); > t.setDaemon(true); > t.start(); > return t; > } > }; > - audioPlayer = (AudioPlayer) > AccessController.doPrivileged(action); > - return audioPlayer; > + return AccessController.doPrivileged(action); > } > > /** > --- old/src/share/classes/sun/audio/AudioStreamSequence.java > 2014-05-14 23:04:09.000000000 -0700 > +++ new/src/share/classes/sun/audio/AudioStreamSequence.java > 2014-05-14 23:04:09.000000000 -0700 > @@ -45,14 +45,14 @@ > */ > public final class AudioStreamSequence extends SequenceInputStream { > > - Enumeration e; > + Enumeration e; > InputStream in; > > /** > * Create an AudioStreamSequence given an > * enumeration of streams. > */ > - public AudioStreamSequence(Enumeration e) { > + public AudioStreamSequence(Enumeration > e) { > super(e); > } > > > -- Best regards, Sergey. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.darcy at oracle.com Fri May 16 16:46:58 2014 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 16 May 2014 09:46:58 -0700 Subject: JDK 9 RFR of JDK-8042871: Fix raw and unchecked warnings in sun.audio In-Reply-To: <5375128C.9000806@oracle.com> References: <537459D9.3000900@oracle.com> <5375128C.9000806@oracle.com> Message-ID: <53764102.8060600@oracle.com> On 05/15/2014 12:16 PM, Sergey Bylokhov wrote: > Hi. Joe. > It seems to me "Enumeration e" in AudioStreamSequence can be removed too. Hi Sergey, Actually it seems both variables in the class can be removed: --- a/src/share/classes/sun/audio/AudioStreamSequence.java Wed May 14 18:19:14 2014 +0400 +++ b/src/share/classes/sun/audio/AudioStreamSequence.java Fri May 16 09:44:17 2014 -0700 @@ -44,16 +44,11 @@ * @author Arthur van Hoff */ public final class AudioStreamSequence extends SequenceInputStream { - - Enumeration e; - InputStream in; - /** * Create an AudioStreamSequence given an * enumeration of streams. */ - public AudioStreamSequence(Enumeration e) { + public AudioStreamSequence(Enumeration e) { super(e); } - - } +} Updated webrev http://cr.openjdk.java.net/~darcy/8042871.1/ Thanks, -Joe > > On 5/15/14 10:08 AM, Joe Darcy wrote: >> Hello, >> >> Please review this fix for >> >> JDK-8042871: Fix raw and unchecked warnings in sun.audio >> http://cr.openjdk.java.net/~darcy/8042871.0/ >> >> Patch below. >> >> Thanks, >> >> -Joe >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sergey.Bylokhov at oracle.com Mon May 19 10:10:16 2014 From: Sergey.Bylokhov at oracle.com (Sergey Bylokhov) Date: Mon, 19 May 2014 14:10:16 +0400 Subject: JDK 9 RFR of JDK-8042871: Fix raw and unchecked warnings in sun.audio In-Reply-To: <53764102.8060600@oracle.com> References: <537459D9.3000900@oracle.com> <5375128C.9000806@oracle.com> <53764102.8060600@oracle.com> Message-ID: <5379D888.7060302@oracle.com> Hi, Joe. The fix looks good. On 16.05.2014 20:46, Joe Darcy wrote: > On 05/15/2014 12:16 PM, Sergey Bylokhov wrote: >> Hi. Joe. >> It seems to me "Enumeration e" in AudioStreamSequence can be removed too. > > Hi Sergey, > > Actually it seems both variables in the class can be removed: > > --- a/src/share/classes/sun/audio/AudioStreamSequence.java Wed May > 14 18:19:14 2014 +0400 > +++ b/src/share/classes/sun/audio/AudioStreamSequence.java Fri May > 16 09:44:17 2014 -0700 > @@ -44,16 +44,11 @@ > * @author Arthur van Hoff > */ > public final class AudioStreamSequence extends SequenceInputStream { > - > - Enumeration e; > - InputStream in; > - > /** > * Create an AudioStreamSequence given an > * enumeration of streams. > */ > - public AudioStreamSequence(Enumeration e) { > + public AudioStreamSequence(Enumeration > e) { > super(e); > } > - > - } > +} > > Updated webrev > > http://cr.openjdk.java.net/~darcy/8042871.1/ > > Thanks, > > -Joe > >> >> On 5/15/14 10:08 AM, Joe Darcy wrote: >>> Hello, >>> >>> Please review this fix for >>> >>> JDK-8042871: Fix raw and unchecked warnings in sun.audio >>> http://cr.openjdk.java.net/~darcy/8042871.0/ >>> >>> Patch below. >>> >>> Thanks, >>> >>> -Joe >>> > -- Best regards, Sergey. -------------- next part -------------- An HTML attachment was scrubbed... URL: