--- old/src/java.desktop/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java 2018-06-20 18:27:41.000000000 -0700 +++ new/src/java.desktop/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java 2018-06-20 18:27:41.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package javax.sound.midi.spi; import java.util.Arrays; -import java.util.Objects; import javax.sound.midi.MidiDevice; @@ -50,8 +49,7 @@ * @throws NullPointerException if {@code info} is {@code null} */ public boolean isDeviceSupported(final MidiDevice.Info info) { - Objects.requireNonNull(info); - return Arrays.asList(getDeviceInfo()).contains(info); + return Arrays.stream(getDeviceInfo()).anyMatch(info::equals); } /** --- old/src/java.desktop/share/classes/javax/sound/midi/spi/MidiFileWriter.java 2018-06-20 18:27:43.000000000 -0700 +++ new/src/java.desktop/share/classes/javax/sound/midi/spi/MidiFileWriter.java 2018-06-20 18:27:42.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.util.Arrays; import javax.sound.midi.Sequence; @@ -69,15 +70,9 @@ * @return {@code true} if the file type is supported, otherwise * {@code false} */ - public boolean isFileTypeSupported(int fileType) { - - int types[] = getMidiFileTypes(); - for(int i=0; i fileType == type); } /** @@ -90,15 +85,10 @@ * otherwise {@code false} * @throws NullPointerException if {@code sequence} is {@code null} */ - public boolean isFileTypeSupported(int fileType, Sequence sequence) { - - int types[] = getMidiFileTypes( sequence ); - for(int i=0; i fileType == type); } /** --- old/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java 2018-06-20 18:27:44.000000000 -0700 +++ new/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java 2018-06-20 18:27:44.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -267,7 +267,6 @@ * @see Encoding#ALAW */ public Encoding getEncoding() { - return encoding; } @@ -288,7 +287,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public float getSampleRate() { - return sampleRate; } @@ -309,7 +307,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public int getSampleSizeInBits() { - return sampleSizeInBits; } @@ -326,7 +323,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public int getChannels() { - return channels; } @@ -345,7 +341,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public int getFrameSize() { - return frameSize; } @@ -365,7 +360,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public float getFrameRate() { - return frameRate; } @@ -378,7 +372,6 @@ * {@code false} if little-endian */ public boolean isBigEndian() { - return bigEndian; } --- old/src/java.desktop/share/classes/javax/sound/sampled/CompoundControl.java 2018-06-20 18:27:46.000000000 -0700 +++ new/src/java.desktop/share/classes/javax/sound/sampled/CompoundControl.java 2018-06-20 18:27:46.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,13 +57,7 @@ * @return the set of member controls */ public Control[] getMemberControls() { - Control[] localArray = new Control[controls.length]; - - for (int i = 0; i < controls.length; i++) { - localArray[i] = controls[i]; - } - - return localArray; + return controls.clone(); } /** --- old/src/java.desktop/share/classes/javax/sound/sampled/EnumControl.java 2018-06-20 18:27:48.000000000 -0700 +++ new/src/java.desktop/share/classes/javax/sound/sampled/EnumControl.java 2018-06-20 18:27:48.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,14 +107,7 @@ * @return the set of possible values */ public Object[] getValues() { - - Object[] localArray = new Object[values.length]; - - for (int i = 0; i < values.length; i++) { - localArray[i] = values[i]; - } - - return localArray; + return values.clone(); } /** @@ -164,7 +157,7 @@ * {@link EnumControl#getValues} on an enumerated control of type * {@code REVERB}.) */ - public static final Type REVERB = new Type("Reverb"); + public static final Type REVERB = new Type("Reverb"); /** * Constructs a new enumerated control type. --- old/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java 2018-06-20 18:27:50.000000000 -0700 +++ new/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java 2018-06-20 18:27:50.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -100,7 +100,6 @@ * @return the line responsible for this event */ public final Line getLine() { - return (Line)getSource(); } @@ -111,7 +110,6 @@ * {@link Type#START}, or {@link Type#STOP}) */ public final Type getType() { - return type; } @@ -137,7 +135,6 @@ * which is a reasonable definition.... */ public final long getFramePosition() { - return position; } --- old/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileWriter.java 2018-06-20 18:27:52.000000000 -0700 +++ new/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileWriter.java 2018-06-20 18:27:51.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; -import java.util.Objects; +import java.util.Arrays; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; @@ -63,17 +63,8 @@ * {@code false} * @throws NullPointerException if {@code fileType} is {@code null} */ - public boolean isFileTypeSupported(Type fileType) { - Objects.requireNonNull(fileType); - - Type types[] = getAudioFileTypes(); - - for(int i=0; i