Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8345406

Remove javax.naming.Context.APPLET

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 24
    • core-libs
    • None
    • source, binary
    • minimal
    • If the `Context.APPLET` environment property is specified - it is ignored when creating an `InitialContext` JNDI context. Removing this constant shouldn't pose any behaviourial change or compatibility risk.
    • Java API
    • SE

      Summary

      Applets are obsolete, and the javax.naming.Context.APPLET constant has been deprecated for removal since Java 9.

      The time has come to remove this constant.

      Problem

      JNDI dependency on the java.applet.Applet has been removed in JDK9 with JDK-8051422. It made the Context.APPLET environment property obsolete and to be ignored when javax.naming.InitialContext is created.

      The javax.naming.Context.APPLET constant can now be removed.

      Solution

      Remove the APPLET constant from the javax.naming.Context class.

      Specification

      src/java.naming/share/classes/javax/naming/Context.java:

      @@ -1061,27 +1061,4 @@ public Object removeFromEnvironment(String propName)
            * @see #removeFromEnvironment(String)
            */
           String LANGUAGE = "java.naming.language";
      -
      -    /**
      -     * @deprecated An environment property with this name is ignored
      -     *             while constructing an initial context.
      -     * This constant was originally used as a property name to specify an
      -     * {@code Applet} to retrieve parameters from, when creating an initial
      -     * context. Currently any applet properties that need to be passed to an
      -     * initial context should be copied into the environment hashtable:
      -     * <pre>{@code
      -     *     Hashtable env = new Hashtable();
      -     *     env.put(Context.INITIAL_CONTEXT_FACTORY,
      -     *       ((Applet) this).getParameter(Context.INITIAL_CONTEXT_FACTORY));
      -     *     env.put(Context.PROVIDER_URL,
      -     *       ((Applet) this).getParameter(Context.PROVIDER_URL));
      -     *     // ... other properties ...
      -     *
      -     *     Context ctx = new InitialContext(env);
      -     * }</pre>
      -     *
      -     * @since 1.3
      -     */
      -    @Deprecated(since = "9", forRemoval = true)
      -    String APPLET = "java.naming.applet";

            aefimov Aleksej Efimov
            alanb Alan Bateman
            Alan Bateman, Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: