diff --git a/jdk/make/common/shared/Defs-java.gmk b/jdk/make/common/shared/Defs-java.gmk index eb63179f6d3..f9ed6353131 100644 --- a/jdk/make/common/shared/Defs-java.gmk +++ b/jdk/make/common/shared/Defs-java.gmk @@ -165,11 +165,6 @@ else JAVADOC_CMD = $(JAVA_TOOLS_DIR)/javadoc $(JAVA_TOOLS_FLAGS:%=-J%) endif -#always use the bootstrap javah until bug-ID 6889255 is fixed. These -#five lines should be removed as part of that fix: -JAVAH_CMD = $(JAVA_TOOLS_DIR)/javah \ - $(JAVAHFLAGS) - # Override of what javac to use (see deploy workspace) ifdef JAVAC JAVAC_CMD = $(JAVAC) diff --git a/jdk/make/java/java/FILES_java.gmk b/jdk/make/java/java/FILES_java.gmk index 2ad599cbe23..d9b7e153d72 100644 --- a/jdk/make/java/java/FILES_java.gmk +++ b/jdk/make/java/java/FILES_java.gmk @@ -258,6 +258,7 @@ JAVA_JAVA_java = \ java/util/ServiceConfigurationError.java \ java/util/Timer.java \ java/util/TimerTask.java \ + java/util/Objects.java \ java/util/UUID.java \ java/util/concurrent/AbstractExecutorService.java \ java/util/concurrent/ArrayBlockingQueue.java \ diff --git a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java index d02faa63cba..ec46bfdf2c0 100644 --- a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java +++ b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java @@ -25,11 +25,12 @@ package com.sun.naming.internal; -import java.applet.Applet; import java.io.InputStream; import java.io.IOException; import java.net.URL; import java.lang.ref.WeakReference; +import java.lang.reflect.Method; +import java.lang.reflect.InvocationTargetException; import java.util.Enumeration; import java.util.HashMap; import java.util.Hashtable; @@ -112,6 +113,52 @@ public final class ResourceManager { private static final WeakHashMap urlFactoryCache = new WeakHashMap(11); private static final WeakReference NO_FACTORY = new WeakReference(null); + /** + * A class to allow JNDI properties be specified as applet parameters + * without creating a static dependency on java.applet. + */ + private static class AppletParameter { + private static final Class clazz = getClass("java.applet.Applet"); + private static final Method getMethod = + getMethod(clazz, "getParameter", String.class); + private static Class getClass(String name) { + try { + return Class.forName(name, true, null); + } catch (ClassNotFoundException e) { + return null; + } + } + private static Method getMethod(Class clazz, + String name, + Class... paramTypes) + { + if (clazz != null) { + try { + return clazz.getMethod(name, paramTypes); + } catch (NoSuchMethodException e) { + throw new AssertionError(e); + } + } else { + return null; + } + } + + /** + * Returns the value of the applet's named parameter. + */ + static Object get(Object applet, String name) { + // if clazz is null then applet cannot be an Applet. + if (clazz == null || !clazz.isInstance(applet)) + throw new ClassCastException(applet.getClass().getName()); + try { + return getMethod.invoke(applet, name); + } catch (InvocationTargetException e) { + throw new AssertionError(e); + } catch (IllegalAccessException iae) { + throw new AssertionError(iae); + } + } + } // There should be no instances of this class. private ResourceManager() { @@ -143,7 +190,7 @@ public final class ResourceManager { if (env == null) { env = new Hashtable(11); } - Applet applet = (Applet)env.get(Context.APPLET); + Object applet = env.get(Context.APPLET); // Merge property values from env param, applet params, and system // properties. The first value wins: there's no concatenation of @@ -157,7 +204,7 @@ public final class ResourceManager { Object val = env.get(props[i]); if (val == null) { if (applet != null) { - val = applet.getParameter(props[i]); + val = AppletParameter.get(applet, props[i]); } if (val == null) { // Read system property. diff --git a/jdk/src/share/classes/java/io/FilePermission.java b/jdk/src/share/classes/java/io/FilePermission.java index 88c98fbddf3..aeab68b7907 100644 --- a/jdk/src/share/classes/java/io/FilePermission.java +++ b/jdk/src/share/classes/java/io/FilePermission.java @@ -209,7 +209,17 @@ public final class FilePermission extends Permission implements Serializable { cpath = AccessController.doPrivileged(new PrivilegedAction() { public String run() { try { - return sun.security.provider.PolicyFile.canonPath(cpath); + String path = cpath; + if (cpath.endsWith("*")) { + // call getCanonicalPath with a path with wildcard character + // replaced to avoid calling it with paths that are + // intended to match all entries in a directory + path = path.substring(0, path.length()-1) + "-"; + path = new File(path).getCanonicalPath(); + return path.substring(0, path.length()-1) + "*"; + } else { + return new File(path).getCanonicalPath(); + } } catch (IOException ioe) { return cpath; } diff --git a/jdk/src/share/classes/java/lang/Enum.java b/jdk/src/share/classes/java/lang/Enum.java index 5df8146c1d4..30ae3d8697b 100644 --- a/jdk/src/share/classes/java/lang/Enum.java +++ b/jdk/src/share/classes/java/lang/Enum.java @@ -40,10 +40,17 @@ import java.io.ObjectStreamException; * Edition, §8.9. * + *

Note that when using an enumeration type as the type of a set + * or as the type of the keys in a map, specialized and efficient + * {@linkplain java.util.EnumSet set} and {@linkplain + * java.util.EnumMap map} implementations are available. + * * @param The enum type subclass * @author Josh Bloch * @author Neal Gafter * @see Class#getEnumConstants() + * @see java.util.EnumSet + * @see java.util.EnumMap * @since 1.5 */ public abstract class Enum> diff --git a/jdk/src/share/classes/java/lang/reflect/AccessibleObject.java b/jdk/src/share/classes/java/lang/reflect/AccessibleObject.java index 1f94a4c5a15..a48f6b19867 100644 --- a/jdk/src/share/classes/java/lang/reflect/AccessibleObject.java +++ b/jdk/src/share/classes/java/lang/reflect/AccessibleObject.java @@ -44,6 +44,8 @@ import java.lang.annotation.Annotation; * as Java Object Serialization or other persistence mechanisms, to * manipulate objects in a manner that would normally be prohibited. * + *

By default, a reflected object is not accessible. + * * @see Field * @see Method * @see Constructor diff --git a/jdk/src/share/classes/java/nio/file/Path.java b/jdk/src/share/classes/java/nio/file/Path.java index d9ba6de7835..8aa970c1364 100644 --- a/jdk/src/share/classes/java/nio/file/Path.java +++ b/jdk/src/share/classes/java/nio/file/Path.java @@ -412,7 +412,7 @@ public abstract class Path * dependent if {@code "a/b/../x"} would locate the same file as {@code "/a/x"}. * * @param other - * the resulting path + * the path to relativize against this path * * @return the resulting relative path, or {@code null} if both paths are * equal @@ -1615,23 +1615,23 @@ public abstract class Path * Tests if the file referenced by this object is the same file referenced * by another object. * - *

If this {@code FileRef} and the given {@code FileRef} are {@link + *

If this {@code Path} and the given {@code Path} are {@link * #equals(Object) equal} then this method returns {@code true} without checking - * if the file exists. If the {@code FileRef} and the given {@code FileRef} - * are associated with different providers, or the given {@code FileRef} is + * if the file exists. If the {@code Path} and the given {@code Path} + * are associated with different providers, or the given {@code Path} is * {@code null} then this method returns {@code false}. Otherwise, this method - * checks if both {@code FileRefs} locate the same file, and depending on the + * checks if both {@code Paths} locate the same file, and depending on the * implementation, may require to open or access both files. * *

If the file system and files remain static, then this method implements - * an equivalence relation for non-null {@code FileRefs}. + * an equivalence relation for non-null {@code Paths}. *