jdk/src/share/classes/com/sun/media/sound/JDK13Services.java
changeset 26030 576ffa819e23
parent 24548 9c007a986347
equal deleted inserted replaced
26029:730f9bc4b85e 26030:576ffa819e23
     1 /*
     1 /*
     2  * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package com.sun.media.sound;
    26 package com.sun.media.sound;
    27 
    27 
       
    28 import java.security.AccessController;
       
    29 import java.security.PrivilegedAction;
    28 import java.util.ArrayList;
    30 import java.util.ArrayList;
    29 import java.util.Collections;
    31 import java.util.Collections;
    30 import java.util.List;
    32 import java.util.List;
    31 import java.util.Properties;
    33 import java.util.Properties;
    32 
    34 
   174                 && !Transmitter.class.equals(typeClass)
   176                 && !Transmitter.class.equals(typeClass)
   175                 && !Synthesizer.class.equals(typeClass)
   177                 && !Synthesizer.class.equals(typeClass)
   176                 && !Sequencer.class.equals(typeClass)) {
   178                 && !Sequencer.class.equals(typeClass)) {
   177             return null;
   179             return null;
   178         }
   180         }
   179         String value;
   181         String name = typeClass.getName();
   180         String propertyName = typeClass.getName();
   182         String value = AccessController.doPrivileged(
   181         value = JSSecurityManager.getProperty(propertyName);
   183                 (PrivilegedAction<String>) () -> System.getProperty(name));
   182         if (value == null) {
   184         if (value == null) {
   183             value = getProperties().getProperty(propertyName);
   185             value = getProperties().getProperty(name);
   184         }
   186         }
   185         if ("".equals(value)) {
   187         if ("".equals(value)) {
   186             value = null;
   188             value = null;
   187         }
   189         }
   188         return value;
   190         return value;