Summary
-------
Add explicit constructors to some classes in Java Sound APIs which using default constructors.
Problem
-------
Default constructors are not recommended for formal API classes.
Solution
--------
Add the public constructors to the public/non-abstract classes, and protected constructors to the public/abstract classes.
Specification
-------------
src/java.desktop/share/classes/javax/sound/midi/VoiceStatus.java
public int volume = 0;
+
+ /**
+ * Constructs a {@code VoiceStatus}.
+ */
+ public VoiceStatus() {}
}
src/java.desktop/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java
public abstract class MidiDeviceProvider {
+ /**
+ * Constructs a {@code MidiDeviceProvider}.
+ */
+ protected MidiDeviceProvider() {}
src/java.desktop/share/classes/javax/sound/midi/spi/MidiFileReader.java
public abstract class MidiFileReader {
+ /**
+ * Constructs a {@code MidiFileReader}.
+ */
+ protected MidiFileReader() {}
src/java.desktop/share/classes/javax/sound/midi/spi/MidiFileWriter.java
public abstract class MidiFileWriter {
+ /**
+ * Constructs a {@code MidiFileWriter}.
+ */
+ protected MidiFileWriter() {}
src/java.desktop/share/classes/javax/sound/midi/spi/SoundbankReader.java
public abstract class SoundbankReader {
+ /**
+ * Constructs a {@code SoundbankReader}.
+ */
+ protected SoundbankReader() {}
src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileReader.java
public abstract class AudioFileReader {
+ /**
+ * Constructs a {@code AudioFileReader}.
+ */
+ protected AudioFileReader() {}
src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileWriter.java
public abstract class AudioFileWriter {
+ /**
+ * Constructs a {@code AudioFileWriter}.
+ */
+ protected AudioFileWriter() {}
src/java.desktop/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java
public abstract class FormatConversionProvider {
+ /**
+ * Constructs a {@code FormatConversionProvider}.
+ */
+ protected FormatConversionProvider() {}
src/java.desktop/share/classes/javax/sound/sampled/spi/MixerProvider.java
public abstract class MixerProvider {
+ /**
+ * Constructs a {@code MixerProvider}.
+ */
+ protected MixerProvider() {}
Link for convenience:
http://cr.openjdk.java.net/~serb/8250858/webrev.00/