8172255: JShell API: ExecutionControl/LoaderDelegate: Remove unused/unimplemented setClassPath
authorrfield
Mon, 09 Jan 2017 13:50:45 -0800
changeset 43132 6a5c69926e60
parent 43131 7769e4891d5e
child 43133 08a858022ea6
8172255: JShell API: ExecutionControl/LoaderDelegate: Remove unused/unimplemented setClassPath Reviewed-by: jlahoda
langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DefaultLoaderDelegate.java
langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java
langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java
langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LoaderDelegate.java
langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteCodes.java
langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java
langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java
langtools/test/jdk/jshell/KullaTesting.java
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DefaultLoaderDelegate.java	Mon Jan 09 16:44:45 2017 +0100
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DefaultLoaderDelegate.java	Mon Jan 09 13:50:45 2017 -0800
@@ -115,12 +115,6 @@
     }
 
     @Override
-    public void setClasspath(String path)
-            throws EngineTerminationException, InternalException {
-        throw new NotImplementedException("setClasspath: Not supported yet.");
-    }
-
-    @Override
     public Class<?> findClass(String name) throws ClassNotFoundException {
         Class<?> klass = klasses.get(name);
         if (klass == null) {
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java	Mon Jan 09 16:44:45 2017 +0100
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java	Mon Jan 09 13:50:45 2017 -0800
@@ -131,12 +131,6 @@
         loaderDelegate.addToClasspath(cp);
     }
 
-    @Override
-    public void setClasspath(String path)
-            throws EngineTerminationException, InternalException {
-        loaderDelegate.setClasspath(path);
-    }
-
     /**
      * {@inheritDoc}
      * <p>
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java	Mon Jan 09 16:44:45 2017 +0100
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java	Mon Jan 09 13:50:45 2017 -0800
@@ -147,12 +147,6 @@
                     ec.addToClasspath(cp);
                     return writeSuccess();
                 }
-                case CMD_SET_CLASSPATH: {
-                    // Set the claspath
-                    String cp = in.readUTF();
-                    ec.setClasspath(cp);
-                    return writeSuccess();
-                }
                 case CMD_STOP: {
                     // Stop the current execution
                     try {
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LoaderDelegate.java	Mon Jan 09 16:44:45 2017 +0100
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LoaderDelegate.java	Mon Jan 09 13:50:45 2017 -0800
@@ -60,16 +60,6 @@
             throws EngineTerminationException, InternalException;
 
     /**
-     * Sets the execution class path to the specified path.
-     *
-     * @param path the path to add
-     * @throws EngineTerminationException the execution engine has terminated
-     * @throws InternalException an internal problem occurred
-     */
-    void setClasspath(String path)
-            throws EngineTerminationException, InternalException;
-
-    /**
      * Finds the class with the specified binary name.
      *
      * @param name the binary name of the class
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteCodes.java	Mon Jan 09 16:44:45 2017 +0100
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteCodes.java	Mon Jan 09 13:50:45 2017 -0800
@@ -66,10 +66,6 @@
      */
     static final String CMD_ADD_CLASSPATH  = "CMD_ADD_CLASSPATH";
     /**
-     * Set the class-path.
-     */
-    static final String CMD_SET_CLASSPATH  = "CMD_SET_CLASSPATH";
-    /**
      * Stop an invoke.
      */
     static final String CMD_STOP           = "CMD_STOP";
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java	Mon Jan 09 16:44:45 2017 +0100
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java	Mon Jan 09 13:50:45 2017 -0800
@@ -137,21 +137,6 @@
     }
 
     @Override
-    public void setClasspath(String path)
-            throws EngineTerminationException, InternalException {
-        try {
-            // Send the classpath addition command to the remote agent.
-            writeCommand(CMD_SET_CLASSPATH);
-            out.writeUTF(path);
-            out.flush();
-            // Retrieve and report results from the remote agent.
-            readAndReportClassSimpleResult();
-        } catch (IOException ex) {
-            throw new EngineTerminationException("Exception writing remote set classpath: " + ex);
-        }
-    }
-
-    @Override
     public void stop()
             throws EngineTerminationException, InternalException {
         try {
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java	Mon Jan 09 16:44:45 2017 +0100
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java	Mon Jan 09 13:50:45 2017 -0800
@@ -118,16 +118,6 @@
             throws EngineTerminationException, InternalException;
 
     /**
-     * Sets the execution class path to the specified path.
-     *
-     * @param path the path to add
-     * @throws EngineTerminationException the execution engine has terminated
-     * @throws InternalException an internal problem occurred
-     */
-    void setClasspath(String path)
-            throws EngineTerminationException, InternalException;
-
-    /**
      * Interrupts a running invoke.
      *
      * @throws EngineTerminationException the execution engine has terminated
--- a/langtools/test/jdk/jshell/KullaTesting.java	Mon Jan 09 16:44:45 2017 +0100
+++ b/langtools/test/jdk/jshell/KullaTesting.java	Mon Jan 09 13:50:45 2017 -0800
@@ -99,7 +99,6 @@
 
     private Map<String, Snippet> idToSnippet = new LinkedHashMap<>();
     private Set<Snippet> allSnippets = new LinkedHashSet<>();
-    private List<String> classpath;
 
     static {
         JShell js = JShell.create();
@@ -159,7 +158,6 @@
     }
 
     public void addToClasspath(String path) {
-        classpath.add(path);
         getState().addToClasspath(path);
     }
 
@@ -200,7 +198,6 @@
         state = builder.build();
         allSnippets = new LinkedHashSet<>();
         idToSnippet = new LinkedHashMap<>();
-        classpath = new ArrayList<>();
     }
 
     @AfterMethod
@@ -210,7 +207,6 @@
         analysis = null;
         allSnippets = null;
         idToSnippet = null;
-        classpath = null;
     }
 
     public ClassLoader createAndRunFromModule(String moduleName, Path modPath) {