src/share/classes/com/sun/media/sound/AbstractMidiDevice.java

Print this page

        

@@ -68,11 +68,11 @@
     private boolean open          = false;
     private int openRefCount;
 
     /** List of Receivers and Transmitters that opened the device implicitely.
      */
-    private List openKeepingObjects;
+    private List<Object> openKeepingObjects;
 
     /**
      * This is the device handle returned from native code
      */
     protected long id                   = 0;

@@ -282,10 +282,11 @@
         }
         return receiver;
     }
 
 
+    @SuppressWarnings("unchecked") // Cast of result of clone
     public final List<Receiver> getReceivers() {
         List<Receiver> recs;
         synchronized (traRecLock) {
             if (receiverList == null) {
                 recs = Collections.unmodifiableList(new ArrayList<Receiver>(0));

@@ -311,10 +312,11 @@
         }
         return transmitter;
     }
 
 
+    @SuppressWarnings("unchecked") // Cast of result of clone
     public final List<Transmitter> getTransmitters() {
         List<Transmitter> tras;
         synchronized (traRecLock) {
             if (transmitterList == null
                 || transmitterList.transmitters.size() == 0) {

@@ -370,13 +372,13 @@
     }
 
 
     /** Return the list of objects that have opened the device implicitely.
      */
-    private synchronized List getOpenKeepingObjects() {
+    private synchronized List<Object> getOpenKeepingObjects() {
         if (openKeepingObjects == null) {
-            openKeepingObjects = new ArrayList();
+            openKeepingObjects = new ArrayList<>();
         }
         return openKeepingObjects;
     }