# HG changeset patch # User rfield # Date 1483998645 28800 # Node ID 6a5c69926e60b8f6e1b8d6a5d6fe54e9425165bd # Parent 7769e4891d5e980eba61f10ed50fb7f4fad3856f 8172255: JShell API: ExecutionControl/LoaderDelegate: Remove unused/unimplemented setClassPath Reviewed-by: jlahoda diff -r 7769e4891d5e -r 6a5c69926e60 langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DefaultLoaderDelegate.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) { diff -r 7769e4891d5e -r 6a5c69926e60 langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DirectExecutionControl.java --- 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} *

diff -r 7769e4891d5e -r 6a5c69926e60 langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/ExecutionControlForwarder.java --- 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 { diff -r 7769e4891d5e -r 6a5c69926e60 langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/LoaderDelegate.java --- 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 diff -r 7769e4891d5e -r 6a5c69926e60 langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteCodes.java --- 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"; diff -r 7769e4891d5e -r 6a5c69926e60 langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/StreamingExecutionControl.java --- 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 { diff -r 7769e4891d5e -r 6a5c69926e60 langtools/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java --- 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 diff -r 7769e4891d5e -r 6a5c69926e60 langtools/test/jdk/jshell/KullaTesting.java --- 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 idToSnippet = new LinkedHashMap<>(); private Set allSnippets = new LinkedHashSet<>(); - private List 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) {