--- old/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java 2016-04-25 14:51:01.000000000 -0700 +++ new/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java 2016-04-25 14:51:01.000000000 -0700 @@ -263,7 +263,7 @@ name); } - URI uri = omref.get().location().get(); + URI uri = omref.getWhenPresent().location().getWhenPresent(); modPaths.put(name, Paths.get(uri)); } @@ -346,21 +346,21 @@ Optional mc = md.mainClass(); if (mc.isPresent()) - sb.append("\n main-class " + mc.get()); + sb.append("\n main-class " + mc.getWhenPresent()); Optional osname = md.osName(); if (osname.isPresent()) - sb.append("\n operating-system-name " + osname.get()); + sb.append("\n operating-system-name " + osname.getWhenPresent()); Optional osarch = md.osArch(); if (osarch.isPresent()) - sb.append("\n operating-system-architecture " + osarch.get()); + sb.append("\n operating-system-architecture " + osarch.getWhenPresent()); Optional osversion = md.osVersion(); if (osversion.isPresent()) - sb.append("\n operating-system-version " + osversion.get()); + sb.append("\n operating-system-version " + osversion.getWhenPresent()); try { Method m = ModuleDescriptor.class.getDeclaredMethod("hashes"); @@ -370,7 +370,7 @@ (Optional) m.invoke(md); if (optHashes.isPresent()) { - Hasher.DependencyHashes hashes = optHashes.get(); + Hasher.DependencyHashes hashes = optHashes.getWhenPresent(); hashes.names().stream().forEach(mod -> sb.append("\n hashes ").append(mod).append(" ") .append(hashes.algorithm()).append(" ") @@ -580,7 +580,7 @@ + " dependencies, unable to find module " + dn + " on module path"); } - descriptors.add(omref.get().descriptor()); + descriptors.add(omref.getWhenPresent().descriptor()); } catch (FindException x) { throw new IOException("error reading module path", x); }