< prev index next >

src/java.base/share/classes/java/lang/reflect/Layer.java

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

*** 360,370 **** private void checkConfiguration(Configuration cf) { Objects.requireNonNull(cf); Optional<Configuration> oparent = cf.parent(); ! if (!oparent.isPresent() || oparent.get() != this.configuration()) { throw new IllegalArgumentException( "Parent of configuration != configuration of this Layer"); } } --- 360,370 ---- private void checkConfiguration(Configuration cf) { Objects.requireNonNull(cf); Optional<Configuration> oparent = cf.parent(); ! if (!oparent.isPresent() || oparent.getWhenPresent() != this.configuration()) { throw new IllegalArgumentException( "Parent of configuration != configuration of this Layer"); } }
*** 518,528 **** Module m = nameToModule.get(Objects.requireNonNull(name)); if (m != null) return m.getClassLoader(); Optional<Layer> ol = parent(); if (ol.isPresent()) ! return ol.get().findLoader(name); throw new IllegalArgumentException("Module " + name + " not known to this layer"); } --- 518,528 ---- Module m = nameToModule.get(Objects.requireNonNull(name)); if (m != null) return m.getClassLoader(); Optional<Layer> ol = parent(); if (ol.isPresent()) ! return ol.getWhenPresent().findLoader(name); throw new IllegalArgumentException("Module " + name + " not known to this layer"); }
< prev index next >