< prev index next >

src/java.management/share/classes/javax/management/monitor/Monitor.java

Print this page
*** 1500,16 ***
--- 1500,18 ---
              // System.getSecurityManager() is used, else the group of the thread
              // instantiating this MonitorTask, i.e. the group of the thread that
              // calls "Monitor.start()".
              @SuppressWarnings("removal")
              SecurityManager s = System.getSecurityManager();
+             @SuppressWarnings("deprecation")
              ThreadGroup group = (s != null) ? s.getThreadGroup() :
                  Thread.currentThread().getThreadGroup();
              synchronized (executorsLock) {
                  for (ThreadPoolExecutor e : executors.keySet()) {
                      DaemonThreadFactory tf =
                              (DaemonThreadFactory) e.getThreadFactory();
+                     @SuppressWarnings("deprecation")
                      ThreadGroup tg = tf.getThreadGroup();
                      if (tg == group) {
                          executor = e;
                          break;
                      }

*** 1595,12 ***
          final ThreadGroup group;
          final AtomicInteger threadNumber = new AtomicInteger(1);
          final String namePrefix;
          static final String nameSuffix = "]";
  
          public DaemonThreadFactory(String poolName) {
-             @SuppressWarnings("removal")
              SecurityManager s = System.getSecurityManager();
              group = (s != null) ? s.getThreadGroup() :
                                    Thread.currentThread().getThreadGroup();
              namePrefix = "JMX Monitor " + poolName + " Pool [Thread-";
          }
--- 1597,12 ---
          final ThreadGroup group;
          final AtomicInteger threadNumber = new AtomicInteger(1);
          final String namePrefix;
          static final String nameSuffix = "]";
  
+         @SuppressWarnings({"deprecation", "removal"})
          public DaemonThreadFactory(String poolName) {
              SecurityManager s = System.getSecurityManager();
              group = (s != null) ? s.getThreadGroup() :
                                    Thread.currentThread().getThreadGroup();
              namePrefix = "JMX Monitor " + poolName + " Pool [Thread-";
          }
< prev index next >