< prev index next >

src/java.desktop/share/classes/com/sun/media/sound/ModelAbstractOscillator.java

Print this page

        

@@ -135,14 +135,12 @@
 
     @Override
     public ModelOscillatorStream open(float samplerate) {
         ModelAbstractOscillator oscs;
         try {
-            oscs = this.getClass().newInstance();
-        } catch (InstantiationException e) {
-            throw new IllegalArgumentException(e);
-        } catch (IllegalAccessException e) {
+            oscs = this.getClass().getDeclaredConstructor().newInstance();
+        } catch (ReflectiveOperationException e) {
             throw new IllegalArgumentException(e);
         }
         oscs.setSampleRate(samplerate);
         oscs.init();
         return oscs;
< prev index next >