< prev index next >

src/java.management/share/classes/java/lang/management/ManagementFactory.java

Print this page
rev 14279 : [mq]: 8140281-deprecation-optional.get

*** 941,951 **** .stream() .filter(pc -> pc.mbeanInterfaceNames().contains(name)) .findFirst(); if (op.isPresent()) { ! return op.get(); } else { return null; } } --- 941,951 ---- .stream() .filter(pc -> pc.mbeanInterfaceNames().contains(name)) .findFirst(); if (op.isPresent()) { ! return op.getWhenPresent(); } else { return null; } }
*** 964,974 **** } else { return p1; } }); ! PlatformComponent<?> singleton = op.isPresent() ? op.get() : null; if (singleton == null) { throw new IllegalArgumentException(mbeanIntf.getName() + " is not a platform management interface"); } if (!singleton.isSingleton()) { --- 964,974 ---- } else { return p1; } }); ! PlatformComponent<?> singleton = op.isPresent() ? op.getWhenPresent() : null; if (singleton == null) { throw new IllegalArgumentException(mbeanIntf.getName() + " is not a platform management interface"); } if (!singleton.isSingleton()) {
< prev index next >