changeset 26202:6f45f1d6688a

8043981: Remove the JPDA demo Reviewed-by: alanb
author sla
date Tue, 26 Aug 2014 07:57:03 +0200
parents 40a873d21081
children 0030579ec361
files jdk/make/CompileDemos.gmk jdk/src/demo/share/jpda/com/sun/tools/example/README jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/AccessWatchpointSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/AmbiguousMethodException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/BreakpointSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ChildSession.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/EvaluationException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/EventRequestSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/EventRequestSpecList.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ExceptionSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ExecutionManager.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/FrameIndexOutOfBoundsException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/InputListener.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/JDIEventSource.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/LineNotFoundException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/MalformedMemberNameException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/MethodNotFoundException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ModificationWatchpointSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/NoSessionException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/NoThreadException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/OutputListener.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ParseException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/PatternReferenceTypeSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ReferenceTypeSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/Session.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SessionListener.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SourceNameReferenceTypeSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SpecErrorEvent.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SpecEvent.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SpecListener.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ThreadInfo.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ThreadIterator.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/Utils.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/VMLaunchFailureException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/VMNotInterruptedException.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/WatchpointSpec.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/AbstractEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/AccessWatchpointEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ClassPrepareEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ClassUnloadEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ExceptionEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/JDIAdapter.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/JDIListener.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/LocatableEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/LocationTriggerEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ModificationWatchpointEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ThreadDeathEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ThreadStartEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/VMDeathEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/VMDisconnectEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/VMStartEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/WatchpointEventSet.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/expr/Expr.jj jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ApplicationTool.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ClassManager.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ClassTreeTool.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/CommandInterpreter.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/CommandTool.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ContextListener.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ContextManager.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/CurrentFrameChangedEvent.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/Environment.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/GUI.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/Icons.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/JDBFileFilter.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/JDBMenuBar.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/JDBToolBar.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/LaunchTool.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/MonitorListModel.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/MonitorTool.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/OutputSink.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/SearchPath.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/SingleLeafTreeSelectionModel.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/SourceListener.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/SourceManager.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/SourceModel.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/SourceTool.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/SourceTreeTool.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/SourcepathChangedEvent.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/StackTraceTool.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ThreadTreeTool.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/TypeScript.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/TypeScriptOutputListener.java jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/TypeScriptWriter.java jdk/src/demo/share/jpda/com/sun/tools/example/doc/index.html jdk/src/demo/share/jpda/com/sun/tools/example/doc/javadt.html jdk/src/demo/share/jpda/com/sun/tools/example/doc/jdb.html jdk/src/demo/share/jpda/com/sun/tools/example/doc/trace.html jdk/src/demo/share/jpda/com/sun/tools/example/trace/EventThread.java jdk/src/demo/share/jpda/com/sun/tools/example/trace/StreamRedirectThread.java jdk/src/demo/share/jpda/com/sun/tools/example/trace/Trace.java jdk/src/jdk.jdi/share/classes/com/sun/tools/example/debug/expr/Expr.jj
diffstat 95 files changed, 724 insertions(+), 14047 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/make/CompileDemos.gmk	Tue Aug 26 07:55:08 2014 +0200
+++ b/jdk/make/CompileDemos.gmk	Tue Aug 26 07:57:03 2014 +0200
@@ -321,34 +321,6 @@
 
 ##################################################################################################
 
-$(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README: \
-    $(JDK_TOPDIR)/src/demo/share/jpda/com/sun/tools/example/README
-	$(call install-file)
-	$(CHMOD) -f ug+w $@
-
-$(eval $(call SetupArchive,JPDA_JAR, \
-    $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README, \
-    SRCS := $(JDK_TOPDIR)/src/demo/share/jpda \
-        $(JDK_TOPDIR)/src/jdk.jdi/share/classes \
-        $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example, \
-    INCLUDES := com/sun/tools/example README, \
-    SUFFIXES := .java .html .jj README, \
-    JAR := $(JDK_OUTPUTDIR)/demo/jpda/examples.jar, \
-    MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
-    EXTRA_MANIFEST_ATTR := Main-Class:$$(SPACE), \
-    SKIP_METAINF := true))
-
-$(eval $(call SetupZipArchive,JPDA_ZIP, \
-    SRC := $(JDK_TOPDIR)/src/demo/share/jpda \
-        $(JDK_TOPDIR)/src/jdk.jdi/share/classes, \
-    INCLUDES := com/sun/tools/example, \
-    SUFFIXES := .java .html .jj README, \
-    ZIP := $(JDK_OUTPUTDIR)/demo/jpda/src.zip))
-
-BUILD_DEMOS += $(JPDA_JAR) $(JPDA_ZIP)
-
-##################################################################################################
-
 $(JDK_OUTPUTDIR)/demo/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
 	$(call install-file)
 	$(CHMOD) -f ug+w $@
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/README	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-Please refer to the documentation in:
-
-	doc/index.html
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/AccessWatchpointSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-
-public class AccessWatchpointSpec extends WatchpointSpec {
-
-    AccessWatchpointSpec(EventRequestSpecList specs,
-                         ReferenceTypeSpec refSpec, String fieldId) {
-        super(specs, refSpec,  fieldId);
-    }
-
-    /**
-     * The 'refType' is known to match.
-     */
-   @Override
-    void resolve(ReferenceType refType) throws InvalidTypeException,
-                                             NoSuchFieldException {
-        if (!(refType instanceof ClassType)) {
-            throw new InvalidTypeException();
-        }
-        Field field = refType.fieldByName(fieldId);
-        if (field == null) {
-            throw new NoSuchFieldException(fieldId);
-        }
-        setRequest(refType.virtualMachine().eventRequestManager()
-                   .createAccessWatchpointRequest(field));
-    }
-
-   @Override
-    public boolean equals(Object obj) {
-        return (obj instanceof AccessWatchpointSpec) && super.equals(obj);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/AmbiguousMethodException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class AmbiguousMethodException extends Exception
-{
-
-    private static final long serialVersionUID = 7793370943251707514L;
-
-    public AmbiguousMethodException()
-    {
-        super();
-    }
-
-    public AmbiguousMethodException(String s)
-    {
-        super(s);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/BreakpointSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public abstract class BreakpointSpec extends EventRequestSpec {
-
-    BreakpointSpec(EventRequestSpecList specs, ReferenceTypeSpec refSpec) {
-        super(specs, refSpec);
-    }
-
-    @Override
-    void notifySet(SpecListener listener, SpecEvent evt) {
-        listener.breakpointSet(evt);
-    }
-
-    @Override
-    void notifyDeferred(SpecListener listener, SpecEvent evt) {
-        listener.breakpointDeferred(evt);
-    }
-
-    @Override
-    void notifyResolved(SpecListener listener, SpecEvent evt) {
-        listener.breakpointResolved(evt);
-    }
-
-    @Override
-    void notifyDeleted(SpecListener listener, SpecEvent evt) {
-        listener.breakpointDeleted(evt);
-    }
-
-    @Override
-    void notifyError(SpecListener listener, SpecErrorEvent evt) {
-        listener.breakpointError(evt);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ChildSession.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,309 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-import com.sun.jdi.connect.LaunchingConnector;
-import com.sun.jdi.connect.Connector;
-import com.sun.jdi.connect.VMStartException;
-import com.sun.jdi.connect.IllegalConnectorArgumentsException;
-import java.io.*;
-import java.util.Map;
-import javax.swing.SwingUtilities;
-
-
-class ChildSession extends Session {
-
-    private Process process;
-
-    private PrintWriter in;
-    private BufferedReader out;
-    private BufferedReader err;
-
-    private InputListener input;
-    private OutputListener output;
-    private OutputListener error;
-
-    public ChildSession(ExecutionManager runtime,
-                        String userVMArgs, String cmdLine,
-                        InputListener input,
-                        OutputListener output,
-                        OutputListener error,
-                        OutputListener diagnostics) {
-        this(runtime, getVM(diagnostics, userVMArgs, cmdLine),
-             input, output, error, diagnostics);
-    }
-
-    public ChildSession(ExecutionManager runtime,
-                        LaunchingConnector connector,
-                        Map<String, Connector.Argument> arguments,
-                        InputListener input,
-                        OutputListener output,
-                        OutputListener error,
-                        OutputListener diagnostics) {
-        this(runtime, generalGetVM(diagnostics, connector, arguments),
-             input, output, error, diagnostics);
-    }
-
-    private ChildSession(ExecutionManager runtime,
-                        VirtualMachine vm,
-                        InputListener input,
-                        OutputListener output,
-                        OutputListener error,
-                        OutputListener diagnostics) {
-        super(vm, runtime, diagnostics);
-        this.input = input;
-        this.output = output;
-        this.error = error;
-    }
-
-    @Override
-    public boolean attach() {
-
-        if (!connectToVMProcess()) {
-            diagnostics.putString("Could not launch VM");
-            return false;
-        }
-
-        /*
-         * Create a Thread that will retrieve and display any output.
-         * Needs to be high priority, else debugger may exit before
-         * it can be displayed.
-         */
-
-        //### Rename InputWriter and OutputReader classes
-        //### Thread priorities cribbed from ttydebug.  Think about them.
-
-        OutputReader outputReader =
-            new OutputReader("output reader", "output",
-                             out, output, diagnostics);
-        outputReader.setPriority(Thread.MAX_PRIORITY-1);
-        outputReader.start();
-
-        OutputReader errorReader =
-            new OutputReader("error reader", "error",
-                             err, error, diagnostics);
-        errorReader.setPriority(Thread.MAX_PRIORITY-1);
-        errorReader.start();
-
-        InputWriter inputWriter =
-            new InputWriter("input writer", in, input);
-        inputWriter.setPriority(Thread.MAX_PRIORITY-1);
-        inputWriter.start();
-
-        if (!super.attach()) {
-            if (process != null) {
-                process.destroy();
-                process = null;
-            }
-            return false;
-        }
-
-        //### debug
-        //System.out.println("IO after attach: "+ inputWriter + " " + outputReader + " "+ errorReader);
-
-        return true;
-    }
-
-    @Override
-    public void detach() {
-
-        //### debug
-        //System.out.println("IO before detach: "+ inputWriter + " " + outputReader + " "+ errorReader);
-
-        super.detach();
-
-        /*
-        inputWriter.quit();
-        outputReader.quit();
-        errorReader.quit();
-        */
-
-        if (process != null) {
-            process.destroy();
-            process = null;
-        }
-
-    }
-
-    /**
-     * Launch child java interpreter, return host:port
-     */
-
-    static private void dumpStream(OutputListener diagnostics,
-                                   InputStream stream) throws IOException {
-        BufferedReader in =
-            new BufferedReader(new InputStreamReader(stream));
-        String line;
-        while ((line = in.readLine()) != null) {
-            diagnostics.putString(line);
-        }
-    }
-
-    static private void dumpFailedLaunchInfo(OutputListener diagnostics,
-                                             Process process) {
-        try {
-            dumpStream(diagnostics, process.getErrorStream());
-            dumpStream(diagnostics, process.getInputStream());
-        } catch (IOException e) {
-            diagnostics.putString("Unable to display process output: " +
-                                  e.getMessage());
-        }
-    }
-
-    static private VirtualMachine getVM(OutputListener diagnostics,
-                                        String userVMArgs,
-                                        String cmdLine) {
-        VirtualMachineManager manager = Bootstrap.virtualMachineManager();
-        LaunchingConnector connector = manager.defaultConnector();
-        Map<String, Connector.Argument> arguments = connector.defaultArguments();
-        arguments.get("options").setValue(userVMArgs);
-        arguments.get("main").setValue(cmdLine);
-        return generalGetVM(diagnostics, connector, arguments);
-    }
-
-    static private VirtualMachine generalGetVM(OutputListener diagnostics,
-                                               LaunchingConnector connector,
-                                               Map<String, Connector.Argument> arguments) {
-        VirtualMachine vm = null;
-        try {
-            diagnostics.putString("Starting child.");
-            vm = connector.launch(arguments);
-        } catch (IOException ioe) {
-            diagnostics.putString("Unable to start child: " + ioe.getMessage());
-        } catch (IllegalConnectorArgumentsException icae) {
-            diagnostics.putString("Unable to start child: " + icae.getMessage());
-        } catch (VMStartException vmse) {
-            diagnostics.putString("Unable to start child: " + vmse.getMessage() + '\n');
-            dumpFailedLaunchInfo(diagnostics, vmse.process());
-        }
-        return vm;
-    }
-
-    private boolean connectToVMProcess() {
-        if (vm == null) {
-            return false;
-        }
-        process = vm.process();
-        in = new PrintWriter(new OutputStreamWriter(process.getOutputStream()));
-        //### Note small buffer sizes!
-        out = new BufferedReader(new InputStreamReader(process.getInputStream()), 1);
-        err = new BufferedReader(new InputStreamReader(process.getErrorStream()), 1);
-        return true;
-    }
-
-    /**
-     *  Threads to handle application input/output.
-     */
-
-    private static class OutputReader extends Thread {
-
-        private String streamName;
-        private BufferedReader stream;
-        private OutputListener output;
-        private OutputListener diagnostics;
-        private boolean running = true;
-        private char[] buffer = new char[512];
-
-        OutputReader(String threadName,
-                     String streamName,
-                     BufferedReader stream,
-                     OutputListener output,
-                     OutputListener diagnostics) {
-            super(threadName);
-            this.streamName = streamName;
-            this.stream = stream;
-            this.output = output;
-            this.diagnostics = diagnostics;
-        }
-
-        @Override
-        public void run() {
-            try {
-                int count;
-                while (running && (count = stream.read(buffer, 0, 512)) != -1) {
-                    if (count > 0) {
-                        // Run in Swing event dispatcher thread.
-                        final String chars = new String(buffer, 0, count);
-                        SwingUtilities.invokeLater(new Runnable() {
-                            @Override
-                            public void run() {
-                                output.putString(chars);
-                            }
-                        });
-                    }
-                    //### Should we sleep briefly here?
-                }
-            } catch (IOException e) {
-                // Run in Swing event dispatcher thread.
-                SwingUtilities.invokeLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        diagnostics.putString("IO error reading " +
-                                              streamName +
-                                              " stream of child java interpreter");
-                    }
-                });
-            }
-        }
-    }
-
-    private static class InputWriter extends Thread {
-
-        private PrintWriter stream;
-        private InputListener input;
-        private boolean running = true;
-
-        InputWriter(String threadName,
-                    PrintWriter stream,
-                    InputListener input) {
-            super(threadName);
-            this.stream = stream;
-            this.input = input;
-        }
-
-        @Override
-        public void run() {
-            String line;
-            while (running) {
-                line = input.getLine();
-                stream.println(line);
-                // Should not be needed for println above!
-                stream.flush();
-            }
-        }
-    }
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/EvaluationException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class EvaluationException extends Exception {
-
-    private static final long serialVersionUID = 4947109680354951694L;
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/EventRequestSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-import com.sun.jdi.request.EventRequest;
-
-abstract public class EventRequestSpec {
-
-    static final int STATUS_UNRESOLVED = 1;
-    static final int STATUS_RESOLVED = 2;
-    static final int STATUS_ERROR = 3;
-
-    static final Object specPropertyKey = "spec";
-
-    final EventRequestSpecList specs;
-    final ReferenceTypeSpec refSpec;
-    EventRequest request = null;
-
-    int status = STATUS_UNRESOLVED;
-
-    EventRequestSpec(EventRequestSpecList specs, ReferenceTypeSpec refSpec) {
-        this.specs = specs;
-        this.refSpec = refSpec;
-    }
-
-    void setRequest(EventRequest request) {
-        this.request = request;
-        request.putProperty(specPropertyKey, this);
-        request.enable();
-    }
-
-    /**
-     * The 'refType' is known to match.
-     */
-    abstract void resolve(ReferenceType refType) throws Exception;
-
-    abstract void notifySet(SpecListener listener, SpecEvent evt);
-    abstract void notifyDeferred(SpecListener listener, SpecEvent evt);
-    abstract void notifyResolved(SpecListener listener, SpecEvent evt);
-    abstract void notifyDeleted(SpecListener listener, SpecEvent evt);
-    abstract void notifyError(SpecListener listener, SpecErrorEvent evt);
-
-    /**
-     * The 'refType' is known to match.
-     */
-    void resolveNotify(ReferenceType refType) {
-        try {
-            resolve(refType);
-            status = STATUS_RESOLVED;
-            specs.notifyResolved(this);
-        } catch(Exception exc) {
-            status = STATUS_ERROR;
-            specs.notifyError(this, exc);
-        }
-    }
-
-    /**
-     * See if 'refType' matches and resolve.
-     */
-    void attemptResolve(ReferenceType refType) {
-        if (!isResolved() && refSpec.matches(refType)) {
-            resolveNotify(refType);
-        }
-    }
-
-    void attemptImmediateResolve(VirtualMachine vm) {
-        // try to resolve immediately
-        for (ReferenceType refType : vm.allClasses()) {
-            if (refSpec.matches(refType)) {
-                try {
-                    resolve(refType);
-                    status = STATUS_RESOLVED;
-                    specs.notifySet(this);
-                } catch(Exception exc) {
-                    status = STATUS_ERROR;
-                    specs.notifyError(this, exc);
-                }
-                return;
-            }
-        }
-        specs.notifyDeferred(this);
-    }
-
-    public EventRequest getEventRequest() {
-        return request;
-    }
-
-    /**
-     * @return true if this spec has been resolved.
-     */
-    public boolean isResolved() {
-        return status == STATUS_RESOLVED;
-    }
-
-    /**
-     * @return true if this spec has not yet been resolved.
-     */
-    public boolean isUnresolved() {
-        return status == STATUS_UNRESOLVED;
-    }
-
-    /**
-     * @return true if this spec is unresolvable due to error.
-     */
-    public boolean isErroneous() {
-        return status == STATUS_ERROR;
-    }
-
-    public String getStatusString() {
-        switch (status) {
-            case STATUS_RESOLVED:
-                return "resolved";
-            case STATUS_UNRESOLVED:
-                return "deferred";
-            case STATUS_ERROR:
-                return "erroneous";
-        }
-        return "unknown";
-    }
-
-    boolean isJavaIdentifier(String s) {
-        return Utils.isJavaIdentifier(s);
-    }
-
-    public String errorMessageFor(Exception e) {
-        if (e instanceof IllegalArgumentException) {
-            return ("Invalid command syntax");
-        } else if (e instanceof RuntimeException) {
-            // A runtime exception that we were not expecting
-            throw (RuntimeException)e;
-        } else {
-            return ("Internal error; unable to set" + this);
-        }
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/EventRequestSpecList.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-import com.sun.jdi.request.*;
-
-import java.util.*;
-
-class EventRequestSpecList {
-
-    // all specs
-    private List<EventRequestSpec> eventRequestSpecs = Collections.synchronizedList(
-                                                  new ArrayList<EventRequestSpec>());
-
-    final ExecutionManager runtime;
-
-    EventRequestSpecList(ExecutionManager runtime) {
-        this.runtime = runtime;
-    }
-
-    /**
-     * Resolve all deferred eventRequests waiting for 'refType'.
-     */
-    void resolve(ReferenceType refType) {
-        synchronized(eventRequestSpecs) {
-            for (EventRequestSpec spec : eventRequestSpecs) {
-                spec.attemptResolve(refType);
-             }
-        }
-    }
-
-    void install(EventRequestSpec ers, VirtualMachine vm) {
-        synchronized (eventRequestSpecs) {
-            eventRequestSpecs.add(ers);
-        }
-        if (vm != null) {
-            ers.attemptImmediateResolve(vm);
-        }
-    }
-
-    BreakpointSpec
-    createClassLineBreakpoint(String classPattern, int line) {
-        ReferenceTypeSpec refSpec =
-            new PatternReferenceTypeSpec(classPattern);
-        return new LineBreakpointSpec(this, refSpec, line);
-    }
-
-    BreakpointSpec
-    createSourceLineBreakpoint(String sourceName, int line) {
-        ReferenceTypeSpec refSpec =
-            new SourceNameReferenceTypeSpec(sourceName, line);
-        return new LineBreakpointSpec(this, refSpec, line);
-    }
-
-    BreakpointSpec
-    createMethodBreakpoint(String classPattern,
-                           String methodId, List<String> methodArgs) {
-        ReferenceTypeSpec refSpec =
-            new PatternReferenceTypeSpec(classPattern);
-        return new MethodBreakpointSpec(this, refSpec,
-                                        methodId, methodArgs);
-    }
-
-    ExceptionSpec
-    createExceptionIntercept(String classPattern,
-                             boolean notifyCaught,
-                             boolean notifyUncaught) {
-        ReferenceTypeSpec refSpec =
-            new PatternReferenceTypeSpec(classPattern);
-        return new ExceptionSpec(this, refSpec,
-                                 notifyCaught, notifyUncaught);
-    }
-
-    AccessWatchpointSpec
-    createAccessWatchpoint(String classPattern, String fieldId) {
-        ReferenceTypeSpec refSpec =
-            new PatternReferenceTypeSpec(classPattern);
-        return new AccessWatchpointSpec(this, refSpec, fieldId);
-    }
-
-    ModificationWatchpointSpec
-    createModificationWatchpoint(String classPattern, String fieldId) {
-        ReferenceTypeSpec refSpec =
-            new PatternReferenceTypeSpec(classPattern);
-        return new ModificationWatchpointSpec(this, refSpec, fieldId);
-    }
-
-    void delete(EventRequestSpec ers) {
-        EventRequest request = ers.getEventRequest();
-        synchronized (eventRequestSpecs) {
-            eventRequestSpecs.remove(ers);
-        }
-        if (request != null) {
-            request.virtualMachine().eventRequestManager()
-                .deleteEventRequest(request);
-        }
-        notifyDeleted(ers);
-        //### notify delete - here?
-    }
-
-    List<EventRequestSpec> eventRequestSpecs() {
-        // We need to make a copy to avoid synchronization problems
-        synchronized (eventRequestSpecs) {
-            return new ArrayList<EventRequestSpec>(eventRequestSpecs);
-        }
-    }
-
-    // --------  notify routines --------------------
-
-    @SuppressWarnings("unchecked")
-    private Vector<SpecListener> specListeners() {
-        return (Vector<SpecListener>)runtime.specListeners.clone();
-    }
-
-    void notifySet(EventRequestSpec spec) {
-        Vector<SpecListener> l = specListeners();
-        SpecEvent evt = new SpecEvent(spec);
-        for (int i = 0; i < l.size(); i++) {
-            spec.notifySet(l.elementAt(i), evt);
-        }
-    }
-
-    void notifyDeferred(EventRequestSpec spec) {
-        Vector<SpecListener> l = specListeners();
-        SpecEvent evt = new SpecEvent(spec);
-        for (int i = 0; i < l.size(); i++) {
-            spec.notifyDeferred(l.elementAt(i), evt);
-        }
-    }
-
-    void notifyDeleted(EventRequestSpec spec) {
-        Vector<SpecListener> l = specListeners();
-        SpecEvent evt = new SpecEvent(spec);
-        for (int i = 0; i < l.size(); i++) {
-            spec.notifyDeleted(l.elementAt(i), evt);
-        }
-    }
-
-    void notifyResolved(EventRequestSpec spec) {
-        Vector<SpecListener> l = specListeners();
-        SpecEvent evt = new SpecEvent(spec);
-        for (int i = 0; i < l.size(); i++) {
-            spec.notifyResolved(l.elementAt(i), evt);
-        }
-    }
-
-    void notifyError(EventRequestSpec spec, Exception exc) {
-        Vector<SpecListener> l = specListeners();
-        SpecErrorEvent evt = new SpecErrorEvent(spec, exc);
-        for (int i = 0; i < l.size(); i++) {
-            spec.notifyError(l.elementAt(i), evt);
-        }
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ExceptionSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.ReferenceType;
-
-public class ExceptionSpec extends EventRequestSpec {
-
-    boolean notifyCaught;
-    boolean notifyUncaught;
-
-    ExceptionSpec(EventRequestSpecList specs, ReferenceTypeSpec refSpec,
-                  boolean notifyCaught, boolean notifyUncaught)
-    {
-        super(specs, refSpec);
-        this.notifyCaught = notifyCaught;
-        this.notifyUncaught = notifyUncaught;
-    }
-
-    @Override
-    void notifySet(SpecListener listener, SpecEvent evt) {
-        listener.exceptionInterceptSet(evt);
-    }
-
-    @Override
-    void notifyDeferred(SpecListener listener, SpecEvent evt) {
-        listener.exceptionInterceptDeferred(evt);
-    }
-
-    @Override
-    void notifyResolved(SpecListener listener, SpecEvent evt) {
-        listener.exceptionInterceptResolved(evt);
-    }
-
-    @Override
-    void notifyDeleted(SpecListener listener, SpecEvent evt) {
-        listener.exceptionInterceptDeleted(evt);
-    }
-
-    @Override
-    void notifyError(SpecListener listener, SpecErrorEvent evt) {
-        listener.exceptionInterceptError(evt);
-    }
-
-    /**
-     * The 'refType' is known to match.
-     */
-    @Override
-    void resolve(ReferenceType refType) {
-        setRequest(refType.virtualMachine().eventRequestManager()
-                   .createExceptionRequest(refType,
-                                           notifyCaught, notifyUncaught));
-    }
-
-    @Override
-    public int hashCode() {
-        return refSpec.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof ExceptionSpec) {
-            ExceptionSpec es = (ExceptionSpec)obj;
-
-            return refSpec.equals(es.refSpec);
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder("exception catch ");
-        sb.append(refSpec.toString());
-        return sb.toString();
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ExecutionManager.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,824 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-import com.sun.jdi.request.*;
-import com.sun.jdi.connect.*;
-import com.sun.tools.example.debug.expr.ExpressionParser;
-import com.sun.tools.example.debug.expr.ParseException;
-
-import java.io.*;
-import java.util.*;
-
-import com.sun.tools.example.debug.event.*;
-
-import javax.swing.SwingUtilities;
-
-/**
- * Move this towards being only state and functionality
- * that spans across Sessions (and thus VMs).
- */
-public class ExecutionManager {
-
-    private Session session;
-
-    /**
-     * Get/set JDI trace mode.
-     */
-    int traceMode = VirtualMachine.TRACE_NONE;
-
-  //////////////////    Listener registration    //////////////////
-
-  // Session Listeners
-
-    ArrayList<SessionListener> sessionListeners = new ArrayList<SessionListener>();
-
-    public void addSessionListener(SessionListener listener) {
-        sessionListeners.add(listener);
-    }
-
-    public void removeSessionListener(SessionListener listener) {
-        sessionListeners.remove(listener);
-    }
-
-  // Spec Listeners
-
-  ArrayList<SpecListener> specListeners = new ArrayList<SpecListener>();
-
-    public void addSpecListener(SpecListener cl) {
-        specListeners.add(cl);
-    }
-
-    public void removeSpecListener(SpecListener cl) {
-        specListeners.remove(cl);
-    }
-
-    // JDI Listeners
-
-    ArrayList<JDIListener> jdiListeners = new ArrayList<JDIListener>();
-
-    /**
-     * Adds a JDIListener
-     */
-    public void addJDIListener(JDIListener jl) {
-        jdiListeners.add(jl);
-    }
-
-    /**
-     * Adds a JDIListener - at the specified position
-     */
-    public void addJDIListener(int index, JDIListener jl) {
-        jdiListeners.add(index, jl);
-    }
-
-    /**
-     * Removes a JDIListener
-     */
-    public void removeJDIListener(JDIListener jl) {
-        jdiListeners.remove(jl);
-    }
-
-  // App Echo Listeners
-
-    private ArrayList<OutputListener> appEchoListeners = new ArrayList<OutputListener>();
-
-    public void addApplicationEchoListener(OutputListener l) {
-        appEchoListeners.add(l);
-    }
-
-    public void removeApplicationEchoListener(OutputListener l) {
-        appEchoListeners.remove(l);
-    }
-
-  // App Output Listeners
-
-    private ArrayList<OutputListener> appOutputListeners = new ArrayList<OutputListener>();
-
-    public void addApplicationOutputListener(OutputListener l) {
-        appOutputListeners.add(l);
-    }
-
-    public void removeApplicationOutputListener(OutputListener l) {
-        appOutputListeners.remove(l);
-    }
-
-  // App Error Listeners
-
-    private ArrayList<OutputListener> appErrorListeners = new ArrayList<OutputListener>();
-
-    public void addApplicationErrorListener(OutputListener l) {
-        appErrorListeners.add(l);
-    }
-
-    public void removeApplicationErrorListener(OutputListener l) {
-        appErrorListeners.remove(l);
-    }
-
-  // Diagnostic Listeners
-
-    private ArrayList<OutputListener> diagnosticsListeners = new ArrayList<OutputListener>();
-
-    public void addDiagnosticsListener(OutputListener l) {
-        diagnosticsListeners.add(l);
-    }
-
-    public void removeDiagnosticsListener(OutputListener l) {
-        diagnosticsListeners.remove(l);
-    }
-
-  ///////////    End Listener Registration    //////////////
-
-    //### We probably don't want this public
-    public VirtualMachine vm() {
-        return session == null ? null : session.vm;
-    }
-
-    void ensureActiveSession() throws NoSessionException {
-        if (session == null) {
-         throw new NoSessionException();
-      }
-    }
-
-    public EventRequestManager eventRequestManager() {
-        return vm() == null ? null : vm().eventRequestManager();
-    }
-
-    /**
-     * Get JDI trace mode.
-     */
-    public int getTraceMode(int mode) {
-        return traceMode;
-    }
-
-    /**
-     * Set JDI trace mode.
-     */
-    public void setTraceMode(int mode) {
-        traceMode = mode;
-        if (session != null) {
-            session.setTraceMode(mode);
-        }
-    }
-
-    /**
-     * Determine if VM is interrupted, i.e, present and not running.
-     */
-    public boolean isInterrupted() /* should: throws NoSessionException */ {
-//      ensureActiveSession();
-        return session.interrupted;
-    }
-
-    /**
-     * Return a list of ReferenceType objects for all
-     * currently loaded classes and interfaces.
-     * Array types are not returned.
-     */
-    public List<ReferenceType> allClasses() throws NoSessionException {
-        ensureActiveSession();
-        return vm().allClasses();
-    }
-
-    /**
-     * Return a ReferenceType object for the currently
-     * loaded class or interface whose fully-qualified
-     * class name is specified, else return null if there
-     * is none.
-     *
-     * In general, we must return a list of types, because
-     * multiple class loaders could have loaded a class
-     * with the same fully-qualified name.
-     */
-    public List<ReferenceType> findClassesByName(String name) throws NoSessionException {
-        ensureActiveSession();
-        return vm().classesByName(name);
-    }
-
-    /**
-     * Return a list of ReferenceType objects for all
-     * currently loaded classes and interfaces whose name
-     * matches the given pattern.  The pattern syntax is
-     * open to some future revision, but currently consists
-     * of a fully-qualified class name in which the first
-     * component may optionally be a "*" character, designating
-     * an arbitrary prefix.
-     */
-    public List<ReferenceType> findClassesMatchingPattern(String pattern)
-                                                throws NoSessionException {
-        ensureActiveSession();
-        List<ReferenceType> result = new ArrayList<ReferenceType>();  //### Is default size OK?
-        if (pattern.startsWith("*.")) {
-            // Wildcard matches any leading package name.
-            pattern = pattern.substring(1);
-            for (ReferenceType type : vm().allClasses()) {
-                if (type.name().endsWith(pattern)) {
-                    result.add(type);
-                }
-            }
-            return result;
-        } else {
-            // It's a class name.
-            return vm().classesByName(pattern);
-        }
-    }
-
-    /*
-     * Return a list of ThreadReference objects corresponding
-     * to the threads that are currently active in the VM.
-     * A thread is removed from the list just before the
-     * thread terminates.
-     */
-
-    public List<ThreadReference> allThreads() throws NoSessionException {
-        ensureActiveSession();
-        return vm().allThreads();
-    }
-
-    /*
-     * Return a list of ThreadGroupReference objects corresponding
-     * to the top-level threadgroups that are currently active in the VM.
-     * Note that a thread group may be empty, or contain no threads as
-     * descendents.
-     */
-
-    public List<ThreadGroupReference> topLevelThreadGroups() throws NoSessionException {
-        ensureActiveSession();
-        return vm().topLevelThreadGroups();
-    }
-
-    /*
-     * Return the system threadgroup.
-     */
-
-    public ThreadGroupReference systemThreadGroup()
-                                                throws NoSessionException {
-        ensureActiveSession();
-        return vm().topLevelThreadGroups().get(0);
-    }
-
-    /*
-     * Evaluate an expression.
-     */
-
-    public Value evaluate(final StackFrame f, String expr)
-        throws ParseException,
-                                            InvocationException,
-                                            InvalidTypeException,
-                                            ClassNotLoadedException,
-                                            NoSessionException,
-                                            IncompatibleThreadStateException {
-        ExpressionParser.GetFrame frameGetter = null;
-        ensureActiveSession();
-        if (f != null) {
-            frameGetter = new ExpressionParser.GetFrame() {
-                @Override
-                public StackFrame get() /* throws IncompatibleThreadStateException */ {
-                    return f;
-                }
-            };
-        }
-        return ExpressionParser.evaluate(expr, vm(), frameGetter);
-    }
-
-
-    /*
-     * Start a new VM.
-     */
-
-    public void run(boolean suspended,
-                    String vmArgs,
-                    String className,
-                    String args) throws VMLaunchFailureException {
-
-        endSession();
-
-        //### Set a breakpoint on 'main' method.
-        //### Would be cleaner if we could just bring up VM already suspended.
-        if (suspended) {
-            //### Set breakpoint at 'main(java.lang.String[])'.
-            List<String> argList = new ArrayList<String>(1);
-            argList.add("java.lang.String[]");
-            createMethodBreakpoint(className, "main", argList);
-        }
-
-        String cmdLine = className + " " + args;
-
-        startSession(new ChildSession(this, vmArgs, cmdLine,
-                                      appInput, appOutput, appError,
-                                      diagnostics));
-    }
-
-    /*
-     * Attach to an existing VM.
-     */
-    public void attach(String portName) throws VMLaunchFailureException {
-        endSession();
-
-        //### Changes made here for connectors have broken the
-        //### the 'Session' abstraction.  The 'Session.attach()'
-        //### method is intended to encapsulate all of the various
-        //### ways in which session start-up can fail. (maddox 12/18/98)
-
-        /*
-         * Now that attaches and launches both go through Connectors,
-         * it may be worth creating a new subclass of Session for
-         * attach sessions.
-         */
-        VirtualMachineManager mgr = Bootstrap.virtualMachineManager();
-        AttachingConnector connector = mgr.attachingConnectors().get(0);
-        Map<String, Connector.Argument> arguments = connector.defaultArguments();
-        arguments.get("port").setValue(portName);
-
-        Session newSession = internalAttach(connector, arguments);
-        if (newSession != null) {
-            startSession(newSession);
-        }
-    }
-
-    private Session internalAttach(AttachingConnector connector,
-                                   Map<String, Connector.Argument> arguments) {
-        try {
-            VirtualMachine vm = connector.attach(arguments);
-            return new Session(vm, this, diagnostics);
-        } catch (IOException ioe) {
-            diagnostics.putString("\n Unable to attach to target VM: " +
-                                  ioe.getMessage());
-        } catch (IllegalConnectorArgumentsException icae) {
-            diagnostics.putString("\n Invalid connector arguments: " +
-                                  icae.getMessage());
-        }
-        return null;
-    }
-
-    private Session internalListen(ListeningConnector connector,
-                                   Map<String, Connector.Argument> arguments) {
-        try {
-            VirtualMachine vm = connector.accept(arguments);
-            return new Session(vm, this, diagnostics);
-        } catch (IOException ioe) {
-            diagnostics.putString(
-                  "\n Unable to accept connection to target VM: " +
-                                  ioe.getMessage());
-        } catch (IllegalConnectorArgumentsException icae) {
-            diagnostics.putString("\n Invalid connector arguments: " +
-                                  icae.getMessage());
-        }
-        return null;
-    }
-
-    /*
-     * Connect via user specified arguments
-     * @return true on success
-     */
-    public boolean explictStart(Connector connector, Map<String, Connector.Argument> arguments)
-                                           throws VMLaunchFailureException {
-        Session newSession = null;
-
-        endSession();
-
-        if (connector instanceof LaunchingConnector) {
-            // we were launched, use ChildSession
-            newSession = new ChildSession(this, (LaunchingConnector)connector,
-                                          arguments,
-                                          appInput, appOutput, appError,
-                                          diagnostics);
-        } else if (connector instanceof AttachingConnector) {
-            newSession = internalAttach((AttachingConnector)connector,
-                                        arguments);
-        } else if (connector instanceof ListeningConnector) {
-            newSession = internalListen((ListeningConnector)connector,
-                                        arguments);
-        } else {
-            diagnostics.putString("\n Unknown connector: " + connector);
-        }
-        if (newSession != null) {
-            startSession(newSession);
-        }
-        return newSession != null;
-    }
-
-    /*
-     * Detach from VM.  If VM was started by debugger, terminate it.
-     */
-    public void detach() throws NoSessionException {
-        ensureActiveSession();
-        endSession();
-    }
-
-    private void startSession(Session s) throws VMLaunchFailureException {
-        if (!s.attach()) {
-            throw new VMLaunchFailureException();
-        }
-        session = s;
-        EventRequestManager em = vm().eventRequestManager();
-        ClassPrepareRequest classPrepareRequest = em.createClassPrepareRequest();
-        //### We must allow the deferred breakpoints to be resolved before
-        //### we continue executing the class.  We could optimize if there
-        //### were no deferred breakpoints outstanding for a particular class.
-        //### Can we do this with JDI?
-        classPrepareRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
-        classPrepareRequest.enable();
-        ClassUnloadRequest classUnloadRequest = em.createClassUnloadRequest();
-        classUnloadRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
-        classUnloadRequest.enable();
-        ThreadStartRequest threadStartRequest = em.createThreadStartRequest();
-        threadStartRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
-        threadStartRequest.enable();
-        ThreadDeathRequest threadDeathRequest = em.createThreadDeathRequest();
-        threadDeathRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
-        threadDeathRequest.enable();
-        ExceptionRequest exceptionRequest =
-                                em.createExceptionRequest(null, false, true);
-        exceptionRequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
-        exceptionRequest.enable();
-        validateThreadInfo();
-        session.interrupted = true;
-        notifySessionStart();
-    }
-
-    void endSession() {
-        if (session != null) {
-            session.detach();
-            session = null;
-            invalidateThreadInfo();
-            notifySessionDeath();
-        }
-    }
-
-    /*
-     * Suspend all VM activity.
-     */
-
-    public void interrupt() throws NoSessionException {
-        ensureActiveSession();
-        vm().suspend();
-        //### Is it guaranteed that the interrupt has happened?
-        validateThreadInfo();
-        session.interrupted = true;
-        notifyInterrupted();
-    }
-
-    /*
-     * Resume interrupted VM.
-     */
-
-    public void go() throws NoSessionException, VMNotInterruptedException {
-        ensureActiveSession();
-        invalidateThreadInfo();
-        session.interrupted = false;
-        notifyContinued();
-        vm().resume();
-    }
-
-    /*
-     * Stepping.
-     */
-    void clearPreviousStep(ThreadReference thread) {
-        /*
-         * A previous step may not have completed on this thread;
-         * if so, it gets removed here.
-         */
-         EventRequestManager mgr = vm().eventRequestManager();
-         for (StepRequest request : mgr.stepRequests()) {
-             if (request.thread().equals(thread)) {
-                 mgr.deleteEventRequest(request);
-                 break;
-             }
-         }
-    }
-
-    private void generalStep(ThreadReference thread, int size, int depth)
-                        throws NoSessionException {
-        ensureActiveSession();
-        invalidateThreadInfo();
-        session.interrupted = false;
-        notifyContinued();
-
-        clearPreviousStep(thread);
-        EventRequestManager reqMgr = vm().eventRequestManager();
-        StepRequest request = reqMgr.createStepRequest(thread,
-                                                       size, depth);
-        // We want just the next step event and no others
-        request.addCountFilter(1);
-        request.enable();
-        vm().resume();
-    }
-
-    public void stepIntoInstruction(ThreadReference thread)
-                        throws NoSessionException {
-        generalStep(thread, StepRequest.STEP_MIN, StepRequest.STEP_INTO);
-    }
-
-    public void stepOverInstruction(ThreadReference thread)
-                        throws NoSessionException {
-        generalStep(thread, StepRequest.STEP_MIN, StepRequest.STEP_OVER);
-    }
-
-    public void stepIntoLine(ThreadReference thread)
-                        throws NoSessionException,
-                        AbsentInformationException {
-        generalStep(thread, StepRequest.STEP_LINE, StepRequest.STEP_INTO);
-    }
-
-    public void stepOverLine(ThreadReference thread)
-                        throws NoSessionException,
-                        AbsentInformationException {
-        generalStep(thread, StepRequest.STEP_LINE, StepRequest.STEP_OVER);
-    }
-
-    public void stepOut(ThreadReference thread)
-                        throws NoSessionException {
-        generalStep(thread, StepRequest.STEP_MIN, StepRequest.STEP_OUT);
-    }
-
-    /*
-     * Thread control.
-     */
-
-    public void suspendThread(ThreadReference thread) throws NoSessionException {
-        ensureActiveSession();
-        thread.suspend();
-    }
-
-    public void resumeThread(ThreadReference thread) throws NoSessionException {
-        ensureActiveSession();
-        thread.resume();
-    }
-
-    public void stopThread(ThreadReference thread) throws NoSessionException {
-        ensureActiveSession();
-        //### Need an exception now.  Which one to use?
-        //thread.stop();
-    }
-
-    /*
-     * ThreadInfo objects -- Allow query of thread status and stack.
-     */
-
-    private List<ThreadInfo> threadInfoList = new LinkedList<ThreadInfo>();
-    //### Should be weak! (in the value, not the key)
-    private HashMap<ThreadReference, ThreadInfo> threadInfoMap = new HashMap<ThreadReference, ThreadInfo>();
-
-    public ThreadInfo threadInfo(ThreadReference thread) {
-        if (session == null || thread == null) {
-            return null;
-        }
-        ThreadInfo info = threadInfoMap.get(thread);
-        if (info == null) {
-            //### Should not hardcode initial frame count and prefetch here!
-            //info = new ThreadInfo(thread, 10, 10);
-            info = new ThreadInfo(thread);
-            if (session.interrupted) {
-                info.validate();
-            }
-            threadInfoList.add(info);
-            threadInfoMap.put(thread, info);
-        }
-        return info;
-    }
-
-     void validateThreadInfo() {
-        session.interrupted = true;
-        for (ThreadInfo threadInfo : threadInfoList) {
-            threadInfo.validate();
-            }
-    }
-
-    private void invalidateThreadInfo() {
-        if (session != null) {
-            session.interrupted = false;
-            for (ThreadInfo threadInfo : threadInfoList) {
-                threadInfo.invalidate();
-            }
-        }
-    }
-
-    void removeThreadInfo(ThreadReference thread) {
-        ThreadInfo info = threadInfoMap.get(thread);
-        if (info != null) {
-            info.invalidate();
-            threadInfoMap.remove(thread);
-            threadInfoList.remove(info);
-        }
-    }
-
-    /*
-     * Listen for Session control events.
-     */
-
-    private void notifyInterrupted() {
-      ArrayList<SessionListener> l = new ArrayList<SessionListener>(sessionListeners);
-        EventObject evt = new EventObject(this);
-        for (int i = 0; i < l.size(); i++) {
-            l.get(i).sessionInterrupt(evt);
-        }
-    }
-
-    private void notifyContinued() {
-        ArrayList<SessionListener> l = new ArrayList<SessionListener>(sessionListeners);
-        EventObject evt = new EventObject(this);
-        for (int i = 0; i < l.size(); i++) {
-            l.get(i).sessionContinue(evt);
-        }
-    }
-
-    private void notifySessionStart() {
-        ArrayList<SessionListener> l = new ArrayList<SessionListener>(sessionListeners);
-        EventObject evt = new EventObject(this);
-        for (int i = 0; i < l.size(); i++) {
-            l.get(i).sessionStart(evt);
-        }
-    }
-
-    private void notifySessionDeath() {
-/*** noop for now
-        ArrayList<SessionListener> l = new ArrayList<SessionListener>(sessionListeners);
-        EventObject evt = new EventObject(this);
-        for (int i = 0; i < l.size(); i++) {
-            ((SessionListener)l.get(i)).sessionDeath(evt);
-        }
-****/
-    }
-
-    /*
-     * Listen for input and output requests from the application
-     * being debugged.  These are generated only when the debuggee
-     * is spawned as a child of the debugger.
-     */
-
-    private Object inputLock = new Object();
-    private LinkedList<String> inputBuffer = new LinkedList<String>();
-
-    private void resetInputBuffer() {
-        synchronized (inputLock) {
-            inputBuffer = new LinkedList<String>();
-        }
-    }
-
-    public void sendLineToApplication(String line) {
-        synchronized (inputLock) {
-            inputBuffer.addFirst(line);
-            inputLock.notifyAll();
-        }
-    }
-
-    private InputListener appInput = new InputListener() {
-        @Override
-        public String getLine() {
-            // Don't allow reader to be interrupted -- catch and retry.
-            String line = null;
-            while (line == null) {
-                synchronized (inputLock) {
-                    try {
-                        while (inputBuffer.size() < 1) {
-                            inputLock.wait();
-                        }
-                        line = inputBuffer.removeLast();
-                    } catch (InterruptedException e) {}
-                }
-            }
-            // We must not be holding inputLock here, as the listener
-            // that we call to echo a line might call us re-entrantly
-            // to provide another line of input.
-            // Run in Swing event dispatcher thread.
-            final String input = line;
-            SwingUtilities.invokeLater(new Runnable() {
-                @Override
-                public void run() {
-                    echoInputLine(input);
-                }
-            });
-            return line;
-        }
-    };
-
-    private static String newline = System.getProperty("line.separator");
-
-    private void echoInputLine(String line) {
-        ArrayList<OutputListener> l = new ArrayList<OutputListener>(appEchoListeners);
-        for (int i = 0; i < l.size(); i++) {
-            OutputListener ol = l.get(i);
-            ol.putString(line);
-            ol.putString(newline);
-        }
-    }
-
-    private OutputListener appOutput = new OutputListener() {
-      @Override
-        public void putString(String string) {
-            ArrayList<OutputListener> l = new ArrayList<OutputListener>(appEchoListeners);
-            for (int i = 0; i < l.size(); i++) {
-                l.get(i).putString(string);
-            }
-        }
-    };
-
-    private OutputListener appError = new OutputListener() {
-      @Override
-        public void putString(String string) {
-            ArrayList<OutputListener> l = new ArrayList<OutputListener>(appEchoListeners);
-            for (int i = 0; i < l.size(); i++) {
-                l.get(i).putString(string);
-            }
-        }
-    };
-
-   private OutputListener diagnostics = new OutputListener() {
-      @Override
-        public void putString(String string) {
-            ArrayList<OutputListener> l = new ArrayList<OutputListener>(diagnosticsListeners);
-            for (int i = 0; i < l.size(); i++) {
-                l.get(i).putString(string);
-            }
-        }
-   };
-
-  /////////////    Spec Request Creation/Deletion/Query   ///////////
-
-    private EventRequestSpecList specList = new EventRequestSpecList(this);
-
-    public BreakpointSpec
-    createSourceLineBreakpoint(String sourceName, int line) {
-        return specList.createSourceLineBreakpoint(sourceName, line);
-    }
-
-    public BreakpointSpec
-    createClassLineBreakpoint(String classPattern, int line) {
-        return specList.createClassLineBreakpoint(classPattern, line);
-    }
-
-    public BreakpointSpec
-    createMethodBreakpoint(String classPattern,
-                           String methodId, List<String> methodArgs) {
-        return specList.createMethodBreakpoint(classPattern,
-                                                 methodId, methodArgs);
-    }
-
-    public ExceptionSpec
-    createExceptionIntercept(String classPattern,
-                             boolean notifyCaught,
-                             boolean notifyUncaught) {
-        return specList.createExceptionIntercept(classPattern,
-                                                   notifyCaught,
-                                                   notifyUncaught);
-    }
-
-    public AccessWatchpointSpec
-    createAccessWatchpoint(String classPattern, String fieldId) {
-        return specList.createAccessWatchpoint(classPattern, fieldId);
-    }
-
-    public ModificationWatchpointSpec
-    createModificationWatchpoint(String classPattern, String fieldId) {
-        return specList.createModificationWatchpoint(classPattern,
-                                                       fieldId);
-    }
-
-    public void delete(EventRequestSpec spec) {
-        specList.delete(spec);
-    }
-
-    void resolve(ReferenceType refType) {
-        specList.resolve(refType);
-    }
-
-    public void install(EventRequestSpec spec) {
-        specList.install(spec, vm());
-    }
-
-    public List<EventRequestSpec> eventRequestSpecs() {
-        return specList.eventRequestSpecs();
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/FrameIndexOutOfBoundsException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class FrameIndexOutOfBoundsException extends IndexOutOfBoundsException {
-
-    private static final long serialVersionUID = -4870148107027371437L;
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/InputListener.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public interface InputListener {
-    String getLine();
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/JDIEventSource.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-import com.sun.tools.example.debug.event.*;
-
-import javax.swing.SwingUtilities;
-
-/**
- */
-class JDIEventSource extends Thread {
-
-    private /*final*/ EventQueue queue;
-    private /*final*/ Session session;
-    private /*final*/ ExecutionManager runtime;
-    private final JDIListener firstListener = new FirstListener();
-
-    private boolean wantInterrupt;  //### Hack
-
-    /**
-     * Create event source.
-     */
-    JDIEventSource(Session session) {
-        super("JDI Event Set Dispatcher");
-        this.session = session;
-        this.runtime = session.runtime;
-        this.queue = session.vm.eventQueue();
-    }
-
-    @Override
-    public void run() {
-        try {
-            runLoop();
-        } catch (Exception exc) {
-            //### Do something different for InterruptedException???
-            // just exit
-        }
-        session.running = false;
-    }
-
-    private void runLoop() throws InterruptedException {
-        AbstractEventSet es;
-        do {
-            EventSet jdiEventSet = queue.remove();
-            es = AbstractEventSet.toSpecificEventSet(jdiEventSet);
-            session.interrupted = es.suspendedAll();
-            dispatchEventSet(es);
-        } while(!(es instanceof VMDisconnectEventSet));
-    }
-
-    //### Gross foul hackery!
-    private void dispatchEventSet(final AbstractEventSet es) {
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                boolean interrupted = es.suspendedAll();
-                es.notify(firstListener);
-                boolean wantInterrupt = JDIEventSource.this.wantInterrupt;
-                for (JDIListener jl : session.runtime.jdiListeners) {
-                    es.notify(jl);
-                }
-                if (interrupted && !wantInterrupt) {
-                    session.interrupted = false;
-                    //### Catch here is a hack
-                    try {
-                        session.vm.resume();
-                    } catch (VMDisconnectedException ee) {}
-                }
-                if (es instanceof ThreadDeathEventSet) {
-                    ThreadReference t = ((ThreadDeathEventSet)es).getThread();
-                    session.runtime.removeThreadInfo(t);
-                }
-            }
-        });
-    }
-
-    private void finalizeEventSet(AbstractEventSet es) {
-        if (session.interrupted && !wantInterrupt) {
-            session.interrupted = false;
-            //### Catch here is a hack
-            try {
-                session.vm.resume();
-            } catch (VMDisconnectedException ee) {}
-        }
-        if (es instanceof ThreadDeathEventSet) {
-            ThreadReference t = ((ThreadDeathEventSet)es).getThread();
-            session.runtime.removeThreadInfo(t);
-        }
-    }
-
-    //### This is a Hack, deal with it
-    private class FirstListener implements JDIListener {
-
-        @Override
-        public void accessWatchpoint(AccessWatchpointEventSet e) {
-            session.runtime.validateThreadInfo();
-            wantInterrupt = true;
-        }
-
-        @Override
-        public void classPrepare(ClassPrepareEventSet e)  {
-            wantInterrupt = false;
-            runtime.resolve(e.getReferenceType());
-        }
-
-        @Override
-        public void classUnload(ClassUnloadEventSet e)  {
-            wantInterrupt = false;
-        }
-
-        @Override
-        public void exception(ExceptionEventSet e)  {
-            wantInterrupt = true;
-        }
-
-        @Override
-        public void locationTrigger(LocationTriggerEventSet e)  {
-            session.runtime.validateThreadInfo();
-            wantInterrupt = true;
-        }
-
-        @Override
-        public void modificationWatchpoint(ModificationWatchpointEventSet e)  {
-            session.runtime.validateThreadInfo();
-            wantInterrupt = true;
-        }
-
-        @Override
-        public void threadDeath(ThreadDeathEventSet e)  {
-            wantInterrupt = false;
-        }
-
-        @Override
-        public void threadStart(ThreadStartEventSet e)  {
-            wantInterrupt = false;
-        }
-
-        @Override
-        public void vmDeath(VMDeathEventSet e)  {
-            //### Should have some way to notify user
-            //### that VM died before the session ended.
-            wantInterrupt = false;
-        }
-
-        @Override
-        public void vmDisconnect(VMDisconnectEventSet e)  {
-            //### Notify user?
-            wantInterrupt = false;
-            session.runtime.endSession();
-        }
-
-        @Override
-        public void vmStart(VMStartEventSet e)  {
-            //### Do we need to do anything with it?
-            wantInterrupt = false;
-        }
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-import java.util.List;
-
-public class LineBreakpointSpec extends BreakpointSpec {
-    int lineNumber;
-
-    LineBreakpointSpec(EventRequestSpecList specs,
-                       ReferenceTypeSpec refSpec, int lineNumber) {
-        super(specs, refSpec);
-        this.lineNumber = lineNumber;
-    }
-
-    /**
-     * The 'refType' is known to match.
-     */
-    @Override
-    void resolve(ReferenceType refType) throws InvalidTypeException,
-                                             LineNotFoundException {
-        if (!(refType instanceof ClassType)) {
-            throw new InvalidTypeException();
-        }
-        Location location = location((ClassType)refType);
-        setRequest(refType.virtualMachine().eventRequestManager()
-                   .createBreakpointRequest(location));
-    }
-
-    private Location location(ClassType clazz) throws
-                                            LineNotFoundException {
-        Location location = null;
-        try {
-            List<Location> locs = clazz.locationsOfLine(lineNumber());
-            if (locs.size() == 0) {
-                throw new LineNotFoundException();
-            }
-            // TODO handle multiple locations
-            location = locs.get(0);
-            if (location.method() == null) {
-                throw new LineNotFoundException();
-            }
-        } catch (AbsentInformationException e) {
-            /*
-             * TO DO: throw something more specific, or allow
-             * AbsentInfo exception to pass through.
-             */
-            throw new LineNotFoundException();
-        }
-        return location;
-    }
-
-    public int lineNumber() {
-        return lineNumber;
-    }
-
-    @Override
-    public int hashCode() {
-        return refSpec.hashCode() + lineNumber;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof LineBreakpointSpec) {
-            LineBreakpointSpec breakpoint = (LineBreakpointSpec)obj;
-
-            return refSpec.equals(breakpoint.refSpec) &&
-                   (lineNumber == breakpoint.lineNumber);
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public String errorMessageFor(Exception e) {
-        if (e instanceof LineNotFoundException) {
-            return ("No code at line " + lineNumber() + " in " + refSpec);
-        } else if (e instanceof InvalidTypeException) {
-            return ("Breakpoints can be located only in classes. " +
-                        refSpec + " is an interface or array");
-        } else {
-            return super.errorMessageFor( e);
-        }
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder("breakpoint ");
-        sb.append(refSpec.toString());
-        sb.append(':');
-        sb.append(lineNumber);
-        sb.append(" (");
-        sb.append(getStatusString());
-        sb.append(')');
-        return sb.toString();
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/LineNotFoundException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class LineNotFoundException extends Exception
-{
-
-    private static final long serialVersionUID = -5630418117861587582L;
-
-    public LineNotFoundException()
-    {
-        super();
-    }
-
-    public LineNotFoundException(String s)
-    {
-        super(s);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/MalformedMemberNameException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-class MalformedMemberNameException extends Exception {
-
-    private static final long serialVersionUID = -7726664097374844485L;
-
-    public MalformedMemberNameException() {
-        super();
-    }
-
-    public MalformedMemberNameException(String s) {
-        super(s);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,346 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-import java.util.ArrayList;
-import java.util.List;
-
-public class MethodBreakpointSpec extends BreakpointSpec {
-    String methodId;
-    List<String> methodArgs;
-
-    MethodBreakpointSpec(EventRequestSpecList specs,
-                         ReferenceTypeSpec refSpec,
-                         String methodId, List<String> methodArgs) {
-        super(specs, refSpec);
-        this.methodId = methodId;
-        this.methodArgs = methodArgs;
-    }
-
-    /**
-     * The 'refType' is known to match.
-     */
-    @Override
-    void resolve(ReferenceType refType) throws MalformedMemberNameException,
-                                             AmbiguousMethodException,
-                                             InvalidTypeException,
-                                             NoSuchMethodException,
-                                             NoSessionException {
-        if (!isValidMethodName(methodId)) {
-            throw new MalformedMemberNameException(methodId);
-        }
-        if (!(refType instanceof ClassType)) {
-            throw new InvalidTypeException();
-        }
-        Location location = location((ClassType)refType);
-        setRequest(refType.virtualMachine().eventRequestManager()
-                   .createBreakpointRequest(location));
-    }
-
-    private Location location(ClassType clazz) throws
-                                               AmbiguousMethodException,
-                                               NoSuchMethodException,
-                                               NoSessionException {
-        Method method = findMatchingMethod(clazz);
-        Location location = method.location();
-        return location;
-    }
-
-    public String methodName() {
-        return methodId;
-    }
-
-    public List<String> methodArgs() {
-        return methodArgs;
-    }
-
-    @Override
-    public int hashCode() {
-        return refSpec.hashCode() +
-            ((methodId != null) ? methodId.hashCode() : 0) +
-            ((methodArgs != null) ? methodArgs.hashCode() : 0);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof MethodBreakpointSpec) {
-            MethodBreakpointSpec breakpoint = (MethodBreakpointSpec)obj;
-
-            return methodId.equals(breakpoint.methodId) &&
-                   methodArgs.equals(breakpoint.methodArgs) &&
-                   refSpec.equals(breakpoint.refSpec);
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public String errorMessageFor(Exception e) {
-        if (e instanceof AmbiguousMethodException) {
-            return ("Method " + methodName() + " is overloaded; specify arguments");
-            /*
-             * TO DO: list the methods here
-             */
-        } else if (e instanceof NoSuchMethodException) {
-            return ("No method " + methodName() + " in " + refSpec);
-        } else if (e instanceof InvalidTypeException) {
-            return ("Breakpoints can be located only in classes. " +
-                        refSpec + " is an interface or array");
-        } else {
-            return super.errorMessageFor( e);
-        }
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder("breakpoint ");
-        sb.append(refSpec.toString());
-        sb.append('.');
-        sb.append(methodId);
-        if (methodArgs != null) {
-            boolean first = true;
-            sb.append('(');
-            for (String name : methodArgs) {
-                if (!first) {
-                    sb.append(',');
-                }
-                sb.append(name);
-                first = false;
-            }
-            sb.append(")");
-        }
-        sb.append(" (");
-        sb.append(getStatusString());
-        sb.append(')');
-        return sb.toString();
-    }
-
-    private boolean isValidMethodName(String s) {
-        return isJavaIdentifier(s) ||
-               s.equals("<init>") ||
-               s.equals("<clinit>");
-    }
-
-    /*
-     * Compare a method's argument types with a Vector of type names.
-     * Return true if each argument type has a name identical to the
-     * corresponding string in the vector (allowing for varargs)
-     * and if the number of arguments in the method matches the
-     * number of names passed
-     */
-    private boolean compareArgTypes(Method method, List<String> nameList) {
-        List<String> argTypeNames = method.argumentTypeNames();
-
-        // If argument counts differ, we can stop here
-        if (argTypeNames.size() != nameList.size()) {
-            return false;
-        }
-
-        // Compare each argument type's name
-        int nTypes = argTypeNames.size();
-        for (int i = 0; i < nTypes; ++i) {
-            String comp1 = argTypeNames.get(i);
-            String comp2 = nameList.get(i);
-            if (! comp1.equals(comp2)) {
-                /*
-                 * We have to handle varargs.  EG, the
-                 * method's last arg type is xxx[]
-                 * while the nameList contains xxx...
-                 * Note that the nameList can also contain
-                 * xxx[] in which case we don't get here.
-                 */
-                if (i != nTypes - 1 ||
-                    !method.isVarArgs()  ||
-                    !comp2.endsWith("...")) {
-                    return false;
-                }
-                /*
-                 * The last types differ, it is a varargs
-                 * method and the nameList item is varargs.
-                 * We just have to compare the type names, eg,
-                 * make sure we don't have xxx[] for the method
-                 * arg type and yyy... for the nameList item.
-                 */
-                int comp1Length = comp1.length();
-                if (comp1Length + 1 != comp2.length()) {
-                    // The type names are different lengths
-                    return false;
-                }
-                // We know the two type names are the same length
-                if (!comp1.regionMatches(0, comp2, 0, comp1Length - 2)) {
-                    return false;
-                }
-                // We do have xxx[] and xxx... as the last param type
-                return true;
-            }
-        }
-
-        return true;
-    }
-
-  private VirtualMachine vm() {
-    return request.virtualMachine();
-  }
-
-  /**
-     * Remove unneeded spaces and expand class names to fully
-     * qualified names, if necessary and possible.
-     */
-    private String normalizeArgTypeName(String name) throws NoSessionException {
-        /*
-         * Separate the type name from any array modifiers,
-         * stripping whitespace after the name ends.
-         */
-        int i = 0;
-        StringBuilder typePart = new StringBuilder();
-        StringBuilder arrayPart = new StringBuilder();
-        name = name.trim();
-        int nameLength = name.length();
-        /*
-         * For varargs, there can be spaces before the ... but not
-         * within the ...  So, we will just ignore the ...
-         * while stripping blanks.
-         */
-        boolean isVarArgs = name.endsWith("...");
-        if (isVarArgs) {
-            nameLength -= 3;
-        }
-
-        while (i < nameLength) {
-            char c = name.charAt(i);
-            if (Character.isWhitespace(c) || c == '[') {
-                break;      // name is complete
-            }
-            typePart.append(c);
-            i++;
-        }
-        while (i < nameLength) {
-            char c = name.charAt(i);
-            if ( (c == '[') || (c == ']')) {
-                arrayPart.append(c);
-            } else if (!Character.isWhitespace(c)) {
-                throw new IllegalArgumentException(
-                                                "Invalid argument type name");
-
-            }
-            i++;
-        }
-
-        name = typePart.toString();
-
-        /*
-         * When there's no sign of a package name already,
-         * try to expand the
-         * the name to a fully qualified class name
-         */
-        if ((name.indexOf('.') == -1) || name.startsWith("*.")) {
-            try {
-                List<?> refs = specs.runtime.findClassesMatchingPattern(name);
-                if (refs.size() > 0) {  //### ambiguity???
-                    name = ((ReferenceType)(refs.get(0))).name();
-                }
-            } catch (IllegalArgumentException e) {
-                // We'll try the name as is
-            }
-        }
-        name += arrayPart.toString();
-        if (isVarArgs) {
-            name += "...";
-        }
-        return name;
-    }
-
-    /*
-     * Attempt an unambiguous match of the method name and
-     * argument specification to a method. If no arguments
-     * are specified, the method must not be overloaded.
-     * Otherwise, the argument types much match exactly
-     */
-    private Method findMatchingMethod(ClassType clazz)
-                                        throws AmbiguousMethodException,
-                                               NoSuchMethodException,
-                                               NoSessionException  {
-
-        // Normalize the argument string once before looping below.
-        List<String> argTypeNames = null;
-        if (methodArgs() != null) {
-            argTypeNames = new ArrayList<String>(methodArgs().size());
-            for (String name : methodArgs()) {
-                name = normalizeArgTypeName(name);
-                argTypeNames.add(name);
-            }
-        }
-
-        // Check each method in the class for matches
-        Method firstMatch = null;  // first method with matching name
-        Method exactMatch = null;  // (only) method with same name & sig
-        int matchCount = 0;        // > 1 implies overload
-        for (Method candidate : clazz.methods()) {
-            if (candidate.name().equals(methodName())) {
-                matchCount++;
-
-                // Remember the first match in case it is the only one
-                if (matchCount == 1) {
-                    firstMatch = candidate;
-                }
-
-                // If argument types were specified, check against candidate
-                if ((argTypeNames != null)
-                        && compareArgTypes(candidate, argTypeNames) == true) {
-                    exactMatch = candidate;
-                    break;
-                }
-            }
-        }
-
-        // Determine method for breakpoint
-        Method method = null;
-        if (exactMatch != null) {
-            // Name and signature match
-            method = exactMatch;
-        } else if ((argTypeNames == null) && (matchCount > 0)) {
-            // At least one name matched and no arg types were specified
-            if (matchCount == 1) {
-                method = firstMatch;       // Only one match; safe to use it
-            } else {
-                throw new AmbiguousMethodException();
-            }
-        } else {
-            throw new NoSuchMethodException(methodName());
-        }
-        return method;
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/MethodNotFoundException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class MethodNotFoundException extends Exception
-{
-    private static final long serialVersionUID = -2064968107599632609L;
-
-    public MethodNotFoundException()
-    {
-        super();
-    }
-
-    public MethodNotFoundException(String s)
-    {
-        super(s);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ModificationWatchpointSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-
-public class ModificationWatchpointSpec extends WatchpointSpec {
-
-    ModificationWatchpointSpec(EventRequestSpecList specs,
-                         ReferenceTypeSpec refSpec, String fieldId) {
-        super(specs, refSpec,  fieldId);
-    }
-
-    /**
-     * The 'refType' is known to match.
-     */
-    @Override
-    void resolve(ReferenceType refType) throws InvalidTypeException,
-                                             NoSuchFieldException {
-        if (!(refType instanceof ClassType)) {
-            throw new InvalidTypeException();
-        }
-        Field field = refType.fieldByName(fieldId);
-        if (field == null) {
-            throw new NoSuchFieldException(fieldId);
-        }
-        setRequest(refType.virtualMachine().eventRequestManager()
-                   .createModificationWatchpointRequest(field));
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        return (obj instanceof ModificationWatchpointSpec) &&
-            super.equals(obj);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/NoSessionException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class NoSessionException extends Exception {
-
-    private static final long serialVersionUID = -7324357828115128603L;
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/NoThreadException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class NoThreadException extends Exception {
-
-    private static final long serialVersionUID = 1846613539928921998L;
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/OutputListener.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public interface OutputListener {
-    void putString(String str);
-    //void putLine(String line);
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ParseException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-// dummy placeholder for javaCC-generated code.
-
-public class ParseException extends Exception {}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/PatternReferenceTypeSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-import java.util.StringTokenizer;
-
-class PatternReferenceTypeSpec implements ReferenceTypeSpec {
-    final boolean isWild;
-    final String classId;
-
-    PatternReferenceTypeSpec(String classId)
-//                             throws ClassNotFoundException
-    {
-//        checkClassName(classId);
-        isWild = classId.startsWith("*.");
-        if (isWild) {
-            this.classId = classId.substring(1);
-        } else {
-            this.classId = classId;
-        }
-    }
-
-    /**
-     * Does the specified ReferenceType match this spec.
-     */
-    @Override
-    public boolean matches(ReferenceType refType) {
-        if (isWild) {
-            return refType.name().endsWith(classId);
-        } else {
-            return refType.name().equals(classId);
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        return classId.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof PatternReferenceTypeSpec) {
-            PatternReferenceTypeSpec spec = (PatternReferenceTypeSpec)obj;
-
-            return classId.equals(spec.classId) && (isWild == spec.isWild);
-        } else {
-            return false;
-        }
-    }
-
-    private void checkClassName(String className) throws ClassNotFoundException {
-        // Do stricter checking of class name validity on deferred
-        //  because if the name is invalid, it will
-        // never match a future loaded class, and we'll be silent
-        // about it.
-        StringTokenizer tokenizer = new StringTokenizer(className, ".");
-        boolean first = true;
-        while (tokenizer.hasMoreTokens()) {
-            String token = tokenizer.nextToken();
-            // Each dot-separated piece must be a valid identifier
-            // and the first token can also be "*". (Note that
-            // numeric class ids are not permitted. They must
-            // match a loaded class.)
-            if (!Utils.isJavaIdentifier(token) && !(first && token.equals("*"))) {
-                throw new ClassNotFoundException();
-            }
-            first = false;
-        }
-    }
-
-    @Override
-    public String toString() {
-        return isWild? "*" + classId : classId;
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ReferenceTypeSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-
-interface ReferenceTypeSpec {
-    /**
-     * Does the specified ReferenceType match this spec.
-     */
-    boolean matches(ReferenceType refType);
-
-    @Override
-    int hashCode();
-
-    @Override
-    boolean equals(Object obj);
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/Session.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.VirtualMachine;
-import com.sun.jdi.VMDisconnectedException;
-
-/**
- * Our repository of what we know about the state of one
- * running VM.
- */
-class Session {
-
-    final VirtualMachine vm;
-    final ExecutionManager runtime;
-    final OutputListener diagnostics;
-
-    boolean running = true;  // Set false by JDIEventSource
-    boolean interrupted = false;  // Set false by JDIEventSource
-
-    private JDIEventSource eventSourceThread = null;
-    private int traceFlags;
-    private boolean dead = false;
-
-    public Session(VirtualMachine vm, ExecutionManager runtime,
-                   OutputListener diagnostics) {
-        this.vm = vm;
-        this.runtime = runtime;
-        this.diagnostics = diagnostics;
-        this.traceFlags = VirtualMachine.TRACE_NONE;
-    }
-
-    /**
-     * Determine if VM is interrupted, i.e, present and not running.
-     */
-    public boolean isInterrupted() {
-        return interrupted;
-    }
-
-    public void setTraceMode(int traceFlags) {
-        this.traceFlags = traceFlags;
-        if (!dead) {
-            vm.setDebugTraceMode(traceFlags);
-        }
-    }
-
-    public boolean attach() {
-        vm.setDebugTraceMode(traceFlags);
-        diagnostics.putString("Connected to VM");
-        eventSourceThread = new JDIEventSource(this);
-        eventSourceThread.start();
-        return true;
-    }
-
-    public void detach() {
-        if (!dead) {
-            eventSourceThread.interrupt();
-            eventSourceThread = null;
-            //### The VM may already be disconnected
-            //### if the debuggee did a System.exit().
-            //### Exception handler here is a kludge,
-            //### Rather, there are many other places
-            //### where we need to handle this exception,
-            //### and initiate a detach due to an error
-            //### condition, e.g., connection failure.
-            try {
-                vm.dispose();
-            } catch (VMDisconnectedException ee) {}
-            dead = true;
-            diagnostics.putString("Disconnected from VM");
-        }
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SessionListener.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import java.util.EventObject;
-import java.util.EventListener;
-
-public interface SessionListener extends EventListener {
-
-    void sessionStart(EventObject e);
-
-    void sessionInterrupt(EventObject e);
-    void sessionContinue(EventObject e);
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SourceNameReferenceTypeSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-
-class SourceNameReferenceTypeSpec implements ReferenceTypeSpec {
-    final String sourceName;
-    final int linenumber;
-
-    SourceNameReferenceTypeSpec(String sourceName, int linenumber) {
-        this.sourceName = sourceName;
-        this.linenumber = linenumber;
-    }
-
-    /**
-     * Does the specified ReferenceType match this spec.
-     */
-    @Override
-    public boolean matches(ReferenceType refType) {
-        try {
-            if (refType.sourceName().equals(sourceName)) {
-                try {
-                    refType.locationsOfLine(linenumber);
-                    // if we don't throw an exception then it was found
-                    return true;
-                } catch(AbsentInformationException exc) {
-                } catch(ObjectCollectedException  exc) {
-                }
-            }
-        } catch(AbsentInformationException exc) {
-            // for sourceName(), fall through
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return sourceName.hashCode() + linenumber;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof SourceNameReferenceTypeSpec) {
-            SourceNameReferenceTypeSpec spec = (SourceNameReferenceTypeSpec)obj;
-
-            return sourceName.equals(spec.sourceName) &&
-                              (linenumber == spec.linenumber);
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public String toString() {
-        return sourceName + "@" + linenumber;
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SpecErrorEvent.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class SpecErrorEvent extends SpecEvent {
-
-    private static final long serialVersionUID = 8162634387866409578L;
-    private Exception reason;
-
-    public SpecErrorEvent(EventRequestSpec eventRequestSpec,
-                                 Exception reason) {
-        super(eventRequestSpec);
-        this.reason = reason;
-    }
-
-    public Exception getReason() {
-        return reason;
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SpecEvent.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import java.util.EventObject;
-
-import com.sun.jdi.request.EventRequest;
-
-public class SpecEvent extends EventObject {
-
-    private static final long serialVersionUID = 4820735456787276230L;
-    private EventRequestSpec eventRequestSpec;
-
-    public SpecEvent(EventRequestSpec eventRequestSpec) {
-        super(eventRequestSpec.specs);
-        this.eventRequestSpec = eventRequestSpec;
-    }
-
-    public EventRequestSpec getEventRequestSpec() {
-        return eventRequestSpec;
-    }
-
-    public EventRequest getEventRequest() {
-        return eventRequestSpec.getEventRequest();
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/SpecListener.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import java.util.EventListener;
-
-public interface SpecListener extends EventListener {
-
-    void breakpointSet(SpecEvent e);
-    void breakpointDeferred(SpecEvent e);
-    void breakpointDeleted(SpecEvent e);
-    void breakpointResolved(SpecEvent e);
-    void breakpointError(SpecErrorEvent e);
-
-    void watchpointSet(SpecEvent e);
-    void watchpointDeferred(SpecEvent e);
-    void watchpointDeleted(SpecEvent e);
-    void watchpointResolved(SpecEvent e);
-    void watchpointError(SpecErrorEvent e);
-
-    void exceptionInterceptSet(SpecEvent e);
-    void exceptionInterceptDeferred(SpecEvent e);
-    void exceptionInterceptDeleted(SpecEvent e);
-    void exceptionInterceptResolved(SpecEvent e);
-    void exceptionInterceptError(SpecErrorEvent e);
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.ThreadGroupReference;
-import java.util.List;
-import java.util.Stack;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * Descend the tree of thread groups.
- * @author Robert G. Field
- */
-public class ThreadGroupIterator implements Iterator<ThreadGroupReference> {
-    private final Stack<Iterator<ThreadGroupReference>> stack
-                        = new Stack<Iterator<ThreadGroupReference>>();
-
-    public ThreadGroupIterator(List<ThreadGroupReference> tgl) {
-        push(tgl);
-    }
-
-    public ThreadGroupIterator(ThreadGroupReference tg) {
-        List<ThreadGroupReference> tgl = new ArrayList<ThreadGroupReference>();
-        tgl.add(tg);
-        push(tgl);
-    }
-
-/*
-    ThreadGroupIterator() {
-        this(Env.vm().topLevelThreadGroups());
-    }
-*/
-
-    private Iterator<ThreadGroupReference> top() {
-        return stack.peek();
-    }
-
-    /**
-     * The invariant in this class is that the top iterator
-     * on the stack has more elements.  If the stack is
-     * empty, there is no top.  This method assures
-     * this invariant.
-     */
-    private void push(List<ThreadGroupReference> tgl) {
-        stack.push(tgl.iterator());
-        while (!stack.isEmpty() && !top().hasNext()) {
-            stack.pop();
-        }
-    }
-
-    @Override
-    public boolean hasNext() {
-        return !stack.isEmpty();
-    }
-
-    @Override
-    public ThreadGroupReference next() {
-        return nextThreadGroup();
-    }
-
-    public ThreadGroupReference nextThreadGroup() {
-        ThreadGroupReference tg = top().next();
-        push(tg.threadGroups());
-        return tg;
-    }
-
-    @Override
-    public void remove() {
-        throw new UnsupportedOperationException();
-    }
-
-/*
-    static ThreadGroupReference find(String name) {
-        ThreadGroupIterator tgi = new ThreadGroupIterator();
-        while (tgi.hasNext()) {
-            ThreadGroupReference tg = tgi.nextThreadGroup();
-            if (tg.name().equals(name)) {
-                return tg;
-            }
-        }
-        return null;
-    }
-*/
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ThreadInfo.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.*;
-
-//### Should handle target VM death or connection failure cleanly.
-
-public class ThreadInfo {
-
-    private ThreadReference thread;
-    private int status;
-
-    private int frameCount;
-
-    Object userObject;  // User-supplied annotation.
-
-    private boolean interrupted = false;
-
-    private void assureInterrupted() throws VMNotInterruptedException {
-        if (!interrupted) {
-            throw new VMNotInterruptedException();
-        }
-    }
-
-    ThreadInfo (ThreadReference thread) {
-        this.thread = thread;
-        this.frameCount = -1;
-    }
-
-    public ThreadReference thread() {
-        return thread;
-    }
-
-    public int getStatus() throws VMNotInterruptedException {
-        assureInterrupted();
-        update();
-        return status;
-    }
-
-    public int getFrameCount() throws VMNotInterruptedException {
-        assureInterrupted();
-        update();
-        return frameCount;
-    }
-
-    public StackFrame getFrame(int index) throws VMNotInterruptedException {
-        assureInterrupted();
-        update();
-        try {
-            return thread.frame(index);
-        } catch (IncompatibleThreadStateException e) {
-            // Should not happen
-            interrupted = false;
-            throw new VMNotInterruptedException();
-        }
-    }
-
-    public Object getUserObject() {
-        return userObject;
-    }
-
-    public void setUserObject(Object obj) {
-        userObject = obj;
-    }
-
-    // Refresh upon first access after cache is cleared.
-
-    void update() throws VMNotInterruptedException {
-        if (frameCount == -1) {
-            try {
-                status = thread.status();
-                frameCount = thread.frameCount();
-            } catch (IncompatibleThreadStateException e) {
-                // Should not happen
-                interrupted = false;
-                throw new VMNotInterruptedException();
-            }
-        }
-    }
-
-    // Called from 'ExecutionManager'.
-
-    void validate() {
-        interrupted = true;
-    }
-
-    void invalidate() {
-        interrupted = false;
-        frameCount = -1;
-        status = ThreadReference.THREAD_STATUS_UNKNOWN;
-    }
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/ThreadIterator.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-import com.sun.jdi.ThreadGroupReference;
-import com.sun.jdi.ThreadReference;
-import java.util.List;
-import java.util.Iterator;
-
-public class ThreadIterator implements Iterator<ThreadReference> {
-    Iterator<ThreadReference> it = null;
-    ThreadGroupIterator tgi;
-
-    public ThreadIterator(ThreadGroupReference tg) {
-        tgi = new ThreadGroupIterator(tg);
-    }
-
-    //### make this package access only?
-    public ThreadIterator(List<ThreadGroupReference> tgl) {
-        tgi = new ThreadGroupIterator(tgl);
-    }
-
-    @Override
-    public boolean hasNext() {
-        while (it == null || !it.hasNext()) {
-            if (!tgi.hasNext()) {
-                return false; // no more
-            }
-            it = tgi.nextThreadGroup().threads().iterator();
-        }
-        return true;
-    }
-
-    @Override
-    public ThreadReference next() {
-        return it.next();
-    }
-
-    public ThreadReference nextThread() {
-        return next();
-    }
-
-    @Override
-    public void remove() {
-        throw new UnsupportedOperationException();
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/Utils.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;   //### does it belong here?
-
-import com.sun.jdi.*;
-
-public class Utils {
-
-    /**
-     * Return the thread status description.
-     */
-    public static String getStatus(ThreadReference thr) {
-        int status = thr.status();
-        String result;
-        switch (status) {
-          case ThreadReference.THREAD_STATUS_UNKNOWN:
-            result = "unknown status";
-            break;
-          case ThreadReference.THREAD_STATUS_ZOMBIE:
-            result = "zombie";
-            break;
-          case ThreadReference.THREAD_STATUS_RUNNING:
-            result = "running";
-            break;
-          case ThreadReference.THREAD_STATUS_SLEEPING:
-            result = "sleeping";
-            break;
-          case ThreadReference.THREAD_STATUS_MONITOR:
-            result = "waiting to acquire a monitor lock";
-            break;
-          case ThreadReference.THREAD_STATUS_WAIT:
-            result = "waiting on a condition";
-            break;
-          default:
-            result = "<invalid thread status>";
-        }
-        if (thr.isSuspended()) {
-            result += " (suspended)";
-        }
-        return result;
-    }
-
-    /**
-     * Return a description of an object.
-     */
-    public static String description(ObjectReference ref) {
-        ReferenceType clazz = ref.referenceType();
-        long id = ref.uniqueID();  //### TODO use real id
-        if (clazz == null) {
-            return toHex(id);
-        } else {
-            return "(" + clazz.name() + ")" + toHex(id);
-        }
-    }
-
-    /**
-     * Convert a long to a hexadecimal string.
-     */
-    public static String toHex(long n) {
-        char s1[] = new char[16];
-        char s2[] = new char[18];
-
-        // Store digits in reverse order.
-        int i = 0;
-        do {
-            long d = n & 0xf;
-            s1[i++] = (char)((d < 10) ? ('0' + d) : ('a' + d - 10));
-        } while ((n >>>= 4) > 0);
-
-        // Now reverse the array.
-        s2[0] = '0';
-        s2[1] = 'x';
-        int j = 2;
-        while (--i >= 0) {
-            s2[j++] = s1[i];
-        }
-        return new String(s2, 0, j);
-    }
-
-    /**
-     * Convert hexadecimal strings to longs.
-     */
-    public static long fromHex(String hexStr) {
-        String str = hexStr.startsWith("0x") ?
-            hexStr.substring(2).toLowerCase() : hexStr.toLowerCase();
-        if (hexStr.length() == 0) {
-            throw new NumberFormatException();
-        }
-
-        long ret = 0;
-        for (int i = 0; i < str.length(); i++) {
-            int c = str.charAt(i);
-            if (c >= '0' && c <= '9') {
-                ret = (ret * 16) + (c - '0');
-            } else if (c >= 'a' && c <= 'f') {
-                ret = (ret * 16) + (c - 'a' + 10);
-            } else {
-                throw new NumberFormatException();
-            }
-        }
-        return ret;
-    }
-
-
-    /*
-     * The next two methods are used by this class and by EventHandler
-     * to print consistent locations and error messages.
-     */
-    public static String locationString(Location loc) {
-        return  loc.declaringType().name() +
-            "." + loc.method().name() + "(), line=" +
-            loc.lineNumber();
-    }
-
-//### UNUSED.
-/************************
-    private String typedName(Method method) {
-        // TO DO: Use method.signature() instead of method.arguments() so that
-        // we get sensible results for classes without debugging info
-        StringBuffer buf = new StringBuffer();
-        buf.append(method.name());
-        buf.append("(");
-        Iterator it = method.arguments().iterator();
-        while (it.hasNext()) {
-            buf.append(((LocalVariable)it.next()).typeName());
-            if (it.hasNext()) {
-                buf.append(",");
-            }
-        }
-        buf.append(")");
-        return buf.toString();
-    }
-************************/
-
-    public static boolean isValidMethodName(String s) {
-        return isJavaIdentifier(s) ||
-               s.equals("<init>") ||
-               s.equals("<clinit>");
-    }
-
-    public static boolean isJavaIdentifier(String s) {
-        if (s.length() == 0) {
-            return false;
-        }
-        int cp = s.codePointAt(0);
-        if (! Character.isJavaIdentifierStart(cp)) {
-            return false;
-        }
-        for (int i = Character.charCount(cp); i < s.length(); i += Character.charCount(cp)) {
-            cp = s.codePointAt(i);
-            if (! Character.isJavaIdentifierPart(cp)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/VMLaunchFailureException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class VMLaunchFailureException extends Exception {
-
-    private static final long serialVersionUID = -2439646729274310108L;
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/VMNotInterruptedException.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public class VMNotInterruptedException extends Exception {
-
-    private static final long serialVersionUID = 8111074582188765600L;
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/bdi/WatchpointSpec.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.bdi;
-
-public abstract class WatchpointSpec extends EventRequestSpec {
-    final String fieldId;
-
-    WatchpointSpec(EventRequestSpecList specs,
-                   ReferenceTypeSpec refSpec, String fieldId) {
-        super(specs, refSpec);
-        this.fieldId = fieldId;
-//        if (!isJavaIdentifier(fieldId)) {
-//            throw new MalformedMemberNameException(fieldId);
-//        }
-    }
-
-    @Override
-    void notifySet(SpecListener listener, SpecEvent evt) {
-        listener.watchpointSet(evt);
-    }
-
-    @Override
-    void notifyDeferred(SpecListener listener, SpecEvent evt) {
-        listener.watchpointDeferred(evt);
-    }
-
-    @Override
-    void notifyResolved(SpecListener listener, SpecEvent evt) {
-        listener.watchpointResolved(evt);
-    }
-
-    @Override
-    void notifyDeleted(SpecListener listener, SpecEvent evt) {
-        listener.watchpointDeleted(evt);
-    }
-
-    @Override
-    void notifyError(SpecListener listener, SpecErrorEvent evt) {
-        listener.watchpointError(evt);
-    }
-
-    @Override
-    public int hashCode() {
-        return refSpec.hashCode() + fieldId.hashCode() +
-            getClass().hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof WatchpointSpec) {
-            WatchpointSpec watchpoint = (WatchpointSpec)obj;
-
-            return fieldId.equals(watchpoint.fieldId) &&
-                   refSpec.equals(watchpoint.refSpec) &&
-                   getClass().equals(watchpoint.getClass());
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public String errorMessageFor(Exception e) {
-        if (e instanceof NoSuchFieldException) {
-            return ("No field " + fieldId + " in " + refSpec);
-        } else {
-            return super.errorMessageFor(e);
-        }
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/AbstractEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,272 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-import com.sun.jdi.request.*;
-
-import java.util.*;
-
-public abstract class AbstractEventSet extends EventObject implements EventSet {
-
-    private static final long serialVersionUID = 2772717574222076977L;
-    private final EventSet jdiEventSet;
-    final Event oneEvent;
-
-    /**
-     */
-    AbstractEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet.virtualMachine());
-        this.jdiEventSet = jdiEventSet;
-        this.oneEvent = eventIterator().nextEvent();
-    }
-
-    public static AbstractEventSet toSpecificEventSet(EventSet jdiEventSet) {
-        Event evt = jdiEventSet.eventIterator().nextEvent();
-        if (evt instanceof LocatableEvent) {
-            if (evt instanceof ExceptionEvent) {
-                return new ExceptionEventSet(jdiEventSet);
-            } else if (evt instanceof WatchpointEvent) {
-                if (evt instanceof AccessWatchpointEvent) {
-                    return new AccessWatchpointEventSet(jdiEventSet);
-                } else {
-                    return new ModificationWatchpointEventSet(jdiEventSet);
-                }
-            } else {
-                return new LocationTriggerEventSet(jdiEventSet);
-            }
-        } else if (evt instanceof ClassPrepareEvent) {
-            return new ClassPrepareEventSet(jdiEventSet);
-        } else if (evt instanceof ClassUnloadEvent) {
-            return new ClassUnloadEventSet(jdiEventSet);
-        } else if (evt instanceof ThreadDeathEvent) {
-            return new ThreadDeathEventSet(jdiEventSet);
-        } else if (evt instanceof ThreadStartEvent) {
-            return new ThreadStartEventSet(jdiEventSet);
-        } else if (evt instanceof VMDeathEvent) {
-            return new VMDeathEventSet(jdiEventSet);
-        } else if (evt instanceof VMDisconnectEvent) {
-            return new VMDisconnectEventSet(jdiEventSet);
-        } else if (evt instanceof VMStartEvent) {
-            return new VMStartEventSet(jdiEventSet);
-        } else {
-            throw new IllegalArgumentException("Unknown event " + evt);
-        }
-    }
-
-    public abstract void notify(JDIListener listener);
-
-    // Implement Mirror
-
-    @Override
-    public VirtualMachine virtualMachine() {
-        return jdiEventSet.virtualMachine();
-    }
-
-    public VirtualMachine getVirtualMachine() {
-        return jdiEventSet.virtualMachine();
-    }
-
-    // Implement EventSet
-
-    /**
-     * Returns the policy used to suspend threads in the target VM
-     * for this event set. This policy is selected from the suspend
-     * policies for each event's request. The one that suspends the
-     * most threads is chosen when the event occurs in the target VM
-     * and that policy is returned here. See
-     * com.sun.jdi.request.EventRequest for the possible policy values.
-     *
-     * @return the integer suspendPolicy
-     */
-    public int getSuspendPolicy() {
-        return jdiEventSet.suspendPolicy();
-    }
-
-    @Override
-    public void resume() {
-        jdiEventSet.resume();
-    }
-
-    @Override
-    public int suspendPolicy() {
-        return jdiEventSet.suspendPolicy();
-    }
-
-    public boolean suspendedAll() {
-        return jdiEventSet.suspendPolicy() == EventRequest.SUSPEND_ALL;
-    }
-
-    public boolean suspendedEventThread() {
-        return jdiEventSet.suspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD;
-    }
-
-    public boolean suspendedNone() {
-        return jdiEventSet.suspendPolicy() == EventRequest.SUSPEND_NONE;
-    }
-
-    /**
-     * Return an iterator specific to {@link Event} objects.
-     */
-    @Override
-    public EventIterator eventIterator() {
-        return jdiEventSet.eventIterator();
-    }
-
-
-    // Implement java.util.Set (by pass through)
-
-    /**
-     * Returns the number of elements in this set (its cardinality).  If this
-     * set contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
-     * <tt>Integer.MAX_VALUE</tt>.
-     *
-     * @return the number of elements in this set (its cardinality).
-     */
-    @Override
-    public int size() {
-        return jdiEventSet.size();
-    }
-
-    /**
-     * Returns <tt>true</tt> if this set contains no elements.
-     *
-     * @return <tt>true</tt> if this set contains no elements.
-     */
-    @Override
-    public boolean isEmpty() {
-        return jdiEventSet.isEmpty();
-    }
-
-    /**
-     * Returns <tt>true</tt> if this set contains the specified element.  More
-     * formally, returns <tt>true</tt> if and only if this set contains an
-     * element <code>e</code> such that <code>(o==null ? e==null :
-     * o.equals(e))</code>.
-     *
-     * @return <tt>true</tt> if this set contains the specified element.
-     */
-    @Override
-    public boolean contains(Object o) {
-        return jdiEventSet.contains(o);
-    }
-
-    /**
-     * Returns an iterator over the elements in this set.  The elements are
-     * returned in no particular order (unless this set is an instance of some
-     * class that provides a guarantee).
-     *
-     * @return an iterator over the elements in this set.
-     */
-    @Override
-    public Iterator<Event> iterator() {
-        return jdiEventSet.iterator();
-    }
-
-    /**
-     * Returns an array containing all of the elements in this set.
-     * Obeys the general contract of the <tt>Collection.toArray</tt> method.
-     *
-     * @return an array containing all of the elements in this set.
-     */
-    @Override
-    public Object[] toArray() {
-        return jdiEventSet.toArray();
-    }
-
-    /**
-     * Returns an array containing all of the elements in this set whose
-     * runtime type is that of the specified array.  Obeys the general
-     * contract of the <tt>Collection.toArray(Object[])</tt> method.
-     *
-     * @param a the array into which the elements of this set are to
-     *          be stored, if it is big enough {
-        return jdiEventSet.XXX();
-    } otherwise, a new array of the
-     *          same runtime type is allocated for this purpose.
-     * @return an array containing the elements of this set.
-     * @throws    ArrayStoreException the runtime type of a is not a supertype
-     * of the runtime type of every element in this set.
-     */
-    @Override
-    public <T> T[] toArray(T a[]) {
-        return jdiEventSet.toArray(a);
-    }
-
-    // Bulk Operations
-
-    /**
-     * Returns <tt>true</tt> if this set contains all of the elements of the
-     * specified collection.  If the specified collection is also a set, this
-     * method returns <tt>true</tt> if it is a <i>subset</i> of this set.
-     *
-     * @param c collection to be checked for containment in this set.
-     * @return <tt>true</tt> if this set contains all of the elements of the
-     *         specified collection.
-     */
-    @Override
-    public boolean containsAll(Collection<?> c) {
-        return jdiEventSet.containsAll(c);
-    }
-
-
-    // Make the rest of Set unmodifiable
-
-    @Override
-    public boolean add(Event e){
-        throw new UnsupportedOperationException();
-    }
-    @Override
-    public boolean remove(Object o) {
-        throw new UnsupportedOperationException();
-    }
-    @Override
-    public boolean addAll(Collection<? extends Event> coll) {
-        throw new UnsupportedOperationException();
-    }
-    @Override
-    public boolean removeAll(Collection<?> coll) {
-        throw new UnsupportedOperationException();
-    }
-    @Override
-    public boolean retainAll(Collection<?> coll) {
-        throw new UnsupportedOperationException();
-    }
-    @Override
-    public void clear() {
-        throw new UnsupportedOperationException();
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/AccessWatchpointEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.event.*;
-
-public class AccessWatchpointEventSet extends WatchpointEventSet {
-
-    private static final long serialVersionUID = -2620394219156607673L;
-
-    AccessWatchpointEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    @Override
-    public void notify(JDIListener listener) {
-        listener.accessWatchpoint(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ClassPrepareEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-public class ClassPrepareEventSet extends AbstractEventSet {
-
-    private static final long serialVersionUID = 5958493423581010491L;
-
-    ClassPrepareEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    /**
-     * Returns the thread in which this event has occurred.
-     *
-     * @return a {@link ThreadReference} which mirrors the event's thread in
-     * the target VM.
-     */
-    public ThreadReference getThread() {
-        return ((ClassPrepareEvent)oneEvent).thread();
-    }
-
-
-    /**
-     * Returns the reference type for which this event was generated.
-     *
-     * @return a {@link ReferenceType} which mirrors the class, interface, or
-     * array which has been linked.
-     */
-    public ReferenceType getReferenceType() {
-        return ((ClassPrepareEvent)oneEvent).referenceType();
-    }
-
-    @Override
-    public void notify(JDIListener listener) {
-        listener.classPrepare(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ClassUnloadEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.event.*;
-
-public class ClassUnloadEventSet extends AbstractEventSet {
-
-    private static final long serialVersionUID = 8370341450345835866L;
-
-    ClassUnloadEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    /**
-     * Returns the name of the class that has been unloaded.
-     */
-    public String getClassName() {
-        return ((ClassUnloadEvent)oneEvent).className();
-    }
-
-    /**
-     * Returns the JNI-style signature of the class that has been unloaded.
-     */
-    public String getClassSignature() {
-        return ((ClassUnloadEvent)oneEvent).classSignature();
-    }
-
-    @Override
-    public void notify(JDIListener listener) {
-        listener.classUnload(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ExceptionEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-public class ExceptionEventSet extends LocatableEventSet {
-
-    private static final long serialVersionUID = 5328140167954640711L;
-
-    ExceptionEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    /**
-     * Gets the thrown exception object. The exception object is
-     * an instance of java.lang.Throwable or a subclass in the
-     * target VM.
-     *
-     * @return an {@link ObjectReference} which mirrors the thrown object in
-     * the target VM.
-     */
-    public ObjectReference getException() {
-        return ((ExceptionEvent)oneEvent).exception();
-    }
-
-    /**
-     * Gets the location where the exception will be caught. An exception
-     * is considered to be caught if, at the point of the throw, the
-     * current location is dynamically enclosed in a try statement that
-     * handles the exception. (See the JVM specification for details).
-     * If there is such a try statement, the catch location is the
-     * first code index of the appropriate catch clause.
-     * <p>
-     * If there are native methods in the call stack at the time of the
-     * exception, there are important restrictions to note about the
-     * returned catch location. In such cases,
-     * it is not possible to predict whether an exception will be handled
-     * by some native method on the call stack.
-     * Thus, it is possible that exceptions considered uncaught
-     * here will, in fact, be handled by a native method and not cause
-     * termination of the target VM. Also, it cannot be assumed that the
-     * catch location returned here will ever be reached by the throwing
-     * thread. If there is
-     * a native frame between the current location and the catch location,
-     * the exception might be handled and cleared in that native method
-     * instead.
-     *
-     * @return the {@link Location} where the exception will be caught or null if
-     * the exception is uncaught.
-     */
-    public Location getCatchLocation() {
-        return ((ExceptionEvent)oneEvent).catchLocation();
-    }
-
-    @Override
-    public void notify(JDIListener listener) {
-        listener.exception(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/JDIAdapter.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-/**
- * The adapter which receives JDI event sets. The methods in this
- * class are empty; this class is provided as a convenience for
- * easily creating listeners by extending this class and overriding
- * only the methods of interest.
- */
-public class JDIAdapter implements JDIListener {
-
-    @Override
-    public void accessWatchpoint(AccessWatchpointEventSet e) {
-    }
-
-    @Override
-    public void classPrepare(ClassPrepareEventSet e)  {
-    }
-
-    @Override
-    public void classUnload(ClassUnloadEventSet e)  {
-    }
-
-    @Override
-    public void exception(ExceptionEventSet e)  {
-    }
-
-    @Override
-    public void locationTrigger(LocationTriggerEventSet e)  {
-    }
-
-    @Override
-    public void modificationWatchpoint(ModificationWatchpointEventSet e)  {
-    }
-
-    @Override
-    public void threadDeath(ThreadDeathEventSet e)  {
-    }
-
-    @Override
-    public void threadStart(ThreadStartEventSet e)  {
-    }
-
-    @Override
-    public void vmDeath(VMDeathEventSet e)  {
-    }
-
-    @Override
-    public void vmDisconnect(VMDisconnectEventSet e)  {
-    }
-
-    @Override
-    public void vmStart(VMStartEventSet e)  {
-    }
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/JDIListener.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import java.util.EventListener;
-
-public interface JDIListener extends EventListener {
-    void accessWatchpoint(AccessWatchpointEventSet e);
-    void classPrepare(ClassPrepareEventSet e);
-    void classUnload(ClassUnloadEventSet e);
-    void exception(ExceptionEventSet e);
-    void locationTrigger(LocationTriggerEventSet e);
-    void modificationWatchpoint(ModificationWatchpointEventSet e);
-    void threadDeath(ThreadDeathEventSet e);
-    void threadStart(ThreadStartEventSet e);
-    void vmDeath(VMDeathEventSet e);
-    void vmDisconnect(VMDisconnectEventSet e);
-    void vmStart(VMStartEventSet e);
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/LocatableEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-/**
- * Abstract event set for events with location and thread.
- */
-public abstract class LocatableEventSet extends AbstractEventSet {
-
-    private static final long serialVersionUID = 1027131209997915620L;
-
-    LocatableEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    /**
-     * Returns the {@link Location} of this mirror. Depending on context
-     * and on available debug information, this location will have
-     * varying precision.
-     *
-     * @return the {@link Location} of this mirror.
-     */
-    public Location getLocation() {
-        return ((LocatableEvent)oneEvent).location();
-    }
-
-    /**
-     * Returns the thread in which this event has occurred.
-     *
-     * @return a {@link ThreadReference} which mirrors the event's thread in
-     * the target VM.
-     */
-    public ThreadReference getThread() {
-        return ((LocatableEvent)oneEvent).thread();
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/LocationTriggerEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.event.*;
-
-public class LocationTriggerEventSet extends LocatableEventSet {
-
-    private static final long serialVersionUID = -3674631710485872487L;
-
-    LocationTriggerEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    @Override
-    public void notify(JDIListener listener) {
-        listener.locationTrigger(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ModificationWatchpointEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-public class ModificationWatchpointEventSet extends WatchpointEventSet {
-
-    private static final long serialVersionUID = -680889300856154719L;
-
-    ModificationWatchpointEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    /**
-     * Value that will be assigned to the field when the instruction
-     * completes.
-     */
-    public Value getValueToBe() {
-        return ((ModificationWatchpointEvent)oneEvent).valueToBe();
-    }
-
-    @Override
-    public void notify(JDIListener listener) {
-        listener.modificationWatchpoint(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ThreadDeathEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-public class ThreadDeathEventSet extends AbstractEventSet {
-
-    private static final long serialVersionUID = -8801604712308151331L;
-
-    ThreadDeathEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    /**
-     * Returns the thread which is terminating.
-     *
-     * @return a {@link ThreadReference} which mirrors the event's thread in
-     * the target VM.
-     */
-    public ThreadReference getThread() {
-        return ((ThreadDeathEvent)oneEvent).thread();
-    }
-
-    @Override
-    public void notify(JDIListener listener) {
-        listener.threadDeath(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/ThreadStartEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-public class ThreadStartEventSet extends AbstractEventSet {
-
-    private static final long serialVersionUID = -3802096132294933502L;
-
-    ThreadStartEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    /**
-     * Returns the thread which has started.
-     *
-     * @return a {@link ThreadReference} which mirrors the event's thread in
-     * the target VM.
-     */
-    public ThreadReference getThread() {
-        return ((ThreadStartEvent)oneEvent).thread();
-    }
-
-    @Override
-    public void notify(JDIListener listener) {
-        listener.threadStart(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/VMDeathEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.event.*;
-
-public class VMDeathEventSet extends AbstractEventSet {
-
-    private static final long serialVersionUID = 1163097303940092229L;
-
-    VMDeathEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-   @Override
-    public void notify(JDIListener listener) {
-        listener.vmDeath(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/VMDisconnectEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.event.*;
-
-public class VMDisconnectEventSet extends AbstractEventSet {
-
-    private static final long serialVersionUID = 7968123152344675342L;
-
-    VMDisconnectEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-   @Override
-    public void notify(JDIListener listener) {
-        listener.vmDisconnect(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/VMStartEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-public class VMStartEventSet extends AbstractEventSet {
-
-    private static final long serialVersionUID = -3384957227835478191L;
-
-    VMStartEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    /**
-     * Returns the initial thread of the VM which has started.
-     *
-     * @return a {@link ThreadReference} which mirrors the event's
-     * thread in the target VM.
-     */
-    public ThreadReference getThread() {
-        return ((VMStartEvent)oneEvent).thread();
-    }
-
-   @Override
-    public void notify(JDIListener listener) {
-        listener.vmStart(this);
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/event/WatchpointEventSet.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.event;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-public abstract class WatchpointEventSet extends LocatableEventSet {
-
-    private static final long serialVersionUID = 5606285209703845409L;
-
-    WatchpointEventSet(EventSet jdiEventSet) {
-        super(jdiEventSet);
-    }
-
-    /**
-     * Returns the field that is about to be accessed/modified.
-     *
-     * @return a {@link Field} which mirrors the field
-     * in the target VM.
-     */
-    public Field getField() {
-        return ((WatchpointEvent)oneEvent).field();
-    }
-
-    /**
-     * Returns the object whose field is about to be accessed/modified.
-     * Return null is the access is to a static field.
-     *
-     * @return a {@link ObjectReference} which mirrors the event's
-     * object in the target VM.
-     */
-    public ObjectReference getObject() {
-        return ((WatchpointEvent)oneEvent).object();
-    }
-
-    /**
-     * Current value of the field.
-     */
-    public Value getValueCurrent() {
-        return ((WatchpointEvent)oneEvent).valueCurrent();
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/expr/Expr.jj	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,724 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-options {
-  JAVA_UNICODE_ESCAPE = true;
-  STATIC = false;
-}
-
-PARSER_BEGIN(ExpressionParser)
-
-package com.sun.tools.example.debug.expr;
-
-import com.sun.jdi.*;
-import java.util.Stack;
-import java.util.List;
-import java.util.ArrayList;
-
-public class ExpressionParser {    
-
-  Stack stack = new Stack();    
-  VirtualMachine vm = null;
-  GetFrame frameGetter = null;
-  private static GetFrame lastFrameGetter;
-  private static LValue lastLValue;
-
-  LValue peek() {
-    return (LValue)stack.peek();
-  }
-
-  LValue pop() {
-    return (LValue)stack.pop();
-  }
-
-  void push(LValue lval) {
-    stack.push(lval);
-  }
-
-  public static Value getMassagedValue() throws ParseException {
-        return lastLValue.getMassagedValue(lastFrameGetter);
-  }
-
-  public interface GetFrame {
-        StackFrame get() throws IncompatibleThreadStateException;
-  }
-
-  public static Value evaluate(String expr, VirtualMachine vm, 
-                               GetFrame frameGetter) throws ParseException,
-                                            InvocationException, 
-					    InvalidTypeException,
-					    ClassNotLoadedException,
-					    IncompatibleThreadStateException {
-        // TODO StringBufferInputStream is deprecated.
-        java.io.InputStream in = new java.io.StringBufferInputStream(expr);
-        ExpressionParser parser = new ExpressionParser(in);
-        parser.vm = vm;
-        parser.frameGetter = frameGetter;
-	Value value = null;
-        parser.Expression();
-	lastFrameGetter = frameGetter;
-	lastLValue = parser.pop();
-	return lastLValue.getValue();
-  }
-
-  public static void main(String args[]) {
-    ExpressionParser parser;
-    System.out.print("Java Expression Parser:  ");
-    if (args.length == 0) {
-      System.out.println("Reading from standard input . . .");
-      parser = new ExpressionParser(System.in);
-    } else if (args.length == 1) {
-      System.out.println("Reading from file " + args[0] + " . . .");
-      try {
-        parser = new ExpressionParser(new java.io.FileInputStream(args[0]));
-      } catch (java.io.FileNotFoundException e) {
-        System.out.println("Java Parser Version 1.0.2:  File " + 
-                           args[0] + " not found.");
-        return;
-      }
-    } else {
-      System.out.println("Usage is one of:");
-      System.out.println("         java ExpressionParser < inputfile");
-      System.out.println("OR");
-      System.out.println("         java ExpressionParser inputfile");
-      return;
-    }
-    try {
-        parser.Expression();
-        System.out.print("Java Expression Parser:  ");
-        System.out.println("Java program parsed successfully.");
-    } catch (ParseException e) {
-        System.out.print("Java Expression Parser:  ");
-        System.out.println("Encountered errors during parse.");
-    }
-  }
-
-}
-
-PARSER_END(ExpressionParser)
-
-
-SKIP : /* WHITE SPACE */
-{
-  " "
-| "\t"
-| "\n"
-| "\r"
-| "\f"
-}
-
-SPECIAL_TOKEN : /* COMMENTS */
-{
-  <SINGLE_LINE_COMMENT: "//" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
-| <FORMAL_COMMENT: "/**" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
-| <MULTI_LINE_COMMENT: "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
-}
-
-TOKEN : /* RESERVED WORDS AND LITERALS */
-{
-  < ABSTRACT: "abstract" >
-| < BOOLEAN: "boolean" >
-| < BREAK: "break" >
-| < BYTE: "byte" >
-| < CASE: "case" >
-| < CATCH: "catch" >
-| < CHAR: "char" >
-| < CLASS: "class" >
-| < CONST: "const" >
-| < CONTINUE: "continue" >
-| < _DEFAULT: "default" >
-| < DO: "do" >
-| < DOUBLE: "double" >
-| < ELSE: "else" >
-| < EXTENDS: "extends" >
-| < FALSE: "false" >
-| < FINAL: "final" >
-| < FINALLY: "finally" >
-| < FLOAT: "float" >
-| < FOR: "for" >
-| < GOTO: "goto" >
-| < IF: "if" >
-| < IMPLEMENTS: "implements" >
-| < IMPORT: "import" >
-| < INSTANCEOF: "instanceof" >
-| < INT: "int" >
-| < INTERFACE: "interface" >
-| < LONG: "long" >
-| < NATIVE: "native" >
-| < NEW: "new" >
-| < NULL: "null" >
-| < PACKAGE: "package">
-| < PRIVATE: "private" >
-| < PROTECTED: "protected" >
-| < PUBLIC: "public" >
-| < RETURN: "return" >
-| < SHORT: "short" >
-| < STATIC: "static" >
-| < SUPER: "super" >
-| < SWITCH: "switch" >
-| < SYNCHRONIZED: "synchronized" >
-| < THIS: "this" >
-| < THROW: "throw" >
-| < THROWS: "throws" >
-| < TRANSIENT: "transient" >
-| < TRUE: "true" >
-| < TRY: "try" >
-| < VOID: "void" >
-| < VOLATILE: "volatile" >
-| < WHILE: "while" >
-}
-
-TOKEN : /* LITERALS */
-{
-  <
-    INTEGER_LITERAL:
-        <DECIMAL_LITERAL> (["l","L"])?
-      | <HEX_LITERAL> (["l","L"])?
-      | <OCTAL_LITERAL> (["l","L"])?
-  >
-|
-  < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
-|
-  < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
-|
-  < #OCTAL_LITERAL: "0" (["0"-"7"])* >
-|
-  < FLOATING_POINT_LITERAL:
-        (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
-      | "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
-      | (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])?
-      | (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]
-  >
-|
-  < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
-|
-  < CHARACTER_LITERAL:
-      "'"
-      (   (~["'","\\","\n","\r"])
-        | ("\\"
-            ( ["n","t","b","r","f","\\","'","\""]
-            | ["0"-"7"] ( ["0"-"7"] )?
-            | ["0"-"3"] ["0"-"7"] ["0"-"7"]
-            )
-          )
-      )
-      "'"
-  >
-|
-  < STRING_LITERAL:
-      "\""
-      (   (~["\"","\\","\n","\r"])
-        | ("\\"
-            ( ["n","t","b","r","f","\\","'","\""]
-            | ["0"-"7"] ( ["0"-"7"] )?
-            | ["0"-"3"] ["0"-"7"] ["0"-"7"]
-            )
-          )
-      )*
-      "\""
-  >
-}
-
-TOKEN : /* IDENTIFIERS */
-{
-  < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
-|
-  < #LETTER:
-      [
-       "\u0024",
-       "\u0041"-"\u005a",
-       "\u005f",
-       "\u0061"-"\u007a",
-       "\u00c0"-"\u00d6",
-       "\u00d8"-"\u00f6",
-       "\u00f8"-"\u00ff",
-       "\u0100"-"\u1fff",
-       "\u3040"-"\u318f",
-       "\u3300"-"\u337f",
-       "\u3400"-"\u3d2d",
-       "\u4e00"-"\u9fff",
-       "\uf900"-"\ufaff"
-      ]
-  >
-|
-  < #DIGIT:
-      [
-       "\u0030"-"\u0039",
-       "\u0660"-"\u0669",
-       "\u06f0"-"\u06f9",
-       "\u0966"-"\u096f",
-       "\u09e6"-"\u09ef",
-       "\u0a66"-"\u0a6f",
-       "\u0ae6"-"\u0aef",
-       "\u0b66"-"\u0b6f",
-       "\u0be7"-"\u0bef",
-       "\u0c66"-"\u0c6f",
-       "\u0ce6"-"\u0cef",
-       "\u0d66"-"\u0d6f",
-       "\u0e50"-"\u0e59",
-       "\u0ed0"-"\u0ed9",
-       "\u1040"-"\u1049"
-      ]
-  >
-}
-
-TOKEN : /* SEPARATORS */
-{
-  < LPAREN: "(" >
-| < RPAREN: ")" >
-| < LBRACE: "{" >
-| < RBRACE: "}" >
-| < LBRACKET: "[" >
-| < RBRACKET: "]" >
-| < SEMICOLON: ";" >
-| < COMMA: "," >
-| < DOT: "." >
-}
-
-TOKEN : /* OPERATORS */
-{
-  < ASSIGN: "=" >
-| < GT: ">" >
-| < LT: "<" >
-| < BANG: "!" >
-| < TILDE: "~" >
-| < HOOK: "?" >
-| < COLON: ":" >
-| < EQ: "==" >
-| < LE: "<=" >
-| < GE: ">=" >
-| < NE: "!=" >
-| < SC_OR: "||" >
-| < SC_AND: "&&" >
-| < INCR: "++" >
-| < DECR: "--" >
-| < PLUS: "+" >
-| < MINUS: "-" >
-| < STAR: "*" >
-| < SLASH: "/" >
-| < BIT_AND: "&" >
-| < BIT_OR: "|" >
-| < XOR: "^" >
-| < REM: "%" >
-| < LSHIFT: "<<" >
-| < RSIGNEDSHIFT: ">>" >
-| < RUNSIGNEDSHIFT: ">>>" >
-| < PLUSASSIGN: "+=" >
-| < MINUSASSIGN: "-=" >
-| < STARASSIGN: "*=" >
-| < SLASHASSIGN: "/=" >
-| < ANDASSIGN: "&=" >
-| < ORASSIGN: "|=" >
-| < XORASSIGN: "^=" >
-| < REMASSIGN: "%=" >
-| < LSHIFTASSIGN: "<<=" >
-| < RSIGNEDSHIFTASSIGN: ">>=" >
-| < RUNSIGNEDSHIFTASSIGN: ">>>=" >
-}
-
-
-/*****************************************
- * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
- *****************************************/
-
-/*
- * Type, name and expression syntax follows.
- */
-
-void Type() :
-{}
-{
-  ( PrimitiveType() | Name() ) ( "[" "]" )*
-}
-
-void PrimitiveType() :
-{}
-{
-  "boolean"
-|
-  "char"
-|
-  "byte"
-|
-  "short"
-|
-  "int"
-|
-  "long"
-|
-  "float"
-|
-  "double"
-}
-
-
-String Name() :
-{StringBuffer sb = new StringBuffer();}
-{
-  <IDENTIFIER> { sb.append(token); }
-  ( LOOKAHEAD(2) "." <IDENTIFIER> { sb.append('.'); sb.append(token); }
-  )*
-        { return sb.toString(); }
-}
-
-void NameList() :
-{}
-{
-  Name()
-  ( "," Name()
-  )*
-}
-
-
-/*
- * Expression syntax follows.
- */
-
-void Expression() :
-{}
-{
-  LOOKAHEAD( PrimaryExpression() AssignmentOperator() )
-  Assignment()
-|
-  ConditionalExpression()
-}
-
-void Assignment() :
-{}
-{
-  PrimaryExpression() AssignmentOperator() Expression()
-        { LValue exprVal = pop(); pop().setValue(exprVal); push(exprVal);}
-}
-
-void AssignmentOperator() :
-{}
-{
-  "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|="
-}
-
-void ConditionalExpression() :
-{}
-{
-  ConditionalOrExpression() 
-        [ "?" Expression() ":" ConditionalExpression() 
-                { LValue falseBranch = pop(); LValue trueBranch = pop(); 
-                  Value cond = pop().interiorGetValue();
-                  if (cond instanceof BooleanValue) {
-                        push(((BooleanValue)cond).booleanValue()? 
-                                        trueBranch : falseBranch);
-                  } else {
-                        throw new ParseException("Condition must be boolean");
-                  }
-                }
-        ]
-}
-
-void ConditionalOrExpression() :
-{}
-{
-  ConditionalAndExpression() 
-        ( "||" ConditionalAndExpression() 
-                        { throw new ParseException("operation not yet supported"); }
-        )*
-}
-
-void ConditionalAndExpression() :
-{}
-{
-  InclusiveOrExpression() 
-        ( "&&" InclusiveOrExpression() 
-                        { throw new ParseException("operation not yet supported"); }
-        )*
-}
-
-void InclusiveOrExpression() :
-{}
-{
-  ExclusiveOrExpression() 
-        ( "|" ExclusiveOrExpression() 
-                        { throw new ParseException("operation not yet supported"); }
-        )*
-}
-
-void ExclusiveOrExpression() :
-{}
-{
-  AndExpression() 
-        ( "^" AndExpression() 
-                        { throw new ParseException("operation not yet supported"); }
-        )*
-}
-
-void AndExpression() :
-{}
-{
-  EqualityExpression() 
-        ( "&" EqualityExpression() 
-                        { throw new ParseException("operation not yet supported"); }
-        )*
-}
-
-void EqualityExpression() :
-{Token tok;}
-{
-  InstanceOfExpression() 
-        ( ( tok = "==" | tok = "!=" ) InstanceOfExpression() 
-                { LValue left = pop(); 
-                  push( LValue.booleanOperation(vm, tok, pop(), left) ); }
-        )*
-}
-
-void InstanceOfExpression() :
-{}
-{
-  RelationalExpression() 
-        [ "instanceof" Type() 
-                        { throw new ParseException("operation not yet supported"); }
-        ]
-}
-
-void RelationalExpression() :
-{Token tok;}
-{
-  ShiftExpression() 
-        ( ( tok = "<" | tok = ">" | tok = "<=" | tok = ">=" ) ShiftExpression()
-                { LValue left = pop(); 
-                  push( LValue.booleanOperation(vm, tok, pop(), left) ); }
-         )*
-}
-
-void ShiftExpression() :
-{}
-{
-  AdditiveExpression() 
-        ( ( "<<" | ">>" | ">>>" ) AdditiveExpression() 
-                        { throw new ParseException("operation not yet supported"); }
-        )*
-}
-
-void AdditiveExpression() :
-{Token tok;}
-{
-  MultiplicativeExpression() 
-        ( ( tok = "+" | tok = "-" ) MultiplicativeExpression() 
-                { LValue left = pop(); 
-                  push( LValue.operation(vm, tok, pop(), left, frameGetter) ); }
-        )*
-}
-
-void MultiplicativeExpression() :
-{Token tok;}
-{
-  UnaryExpression() 
-        ( ( tok = "*" | tok = "/" | tok = "%" ) UnaryExpression()
-                { LValue left = pop(); 
-                  push( LValue.operation(vm, tok, pop(), left, frameGetter) ); }
-        )*
-}
-
-void UnaryExpression() :
-{Token tok;}
-{
-  ( tok = "+" | tok = "-" ) UnaryExpression()
-                { push( LValue.operation(vm, tok, pop(), frameGetter) ); }
-|
-  PreIncrementExpression()
-|
-  PreDecrementExpression()
-|
-  UnaryExpressionNotPlusMinus()
-}
-
-void PreIncrementExpression() :
-{}
-{
-  "++" PrimaryExpression()
-                        { throw new ParseException("operation not yet supported"); }
-}
-
-void PreDecrementExpression() :
-{}
-{
-  "--" PrimaryExpression()
-                        { throw new ParseException("operation not yet supported"); }
-}
-
-void UnaryExpressionNotPlusMinus() :
-{Token tok;}
-{
-  ( tok = "~" | tok = "!" ) UnaryExpression()
-                { push( LValue.operation(vm, tok, pop(), frameGetter) ); }
-|
-  LOOKAHEAD( CastLookahead() )
-  CastExpression()
-|
-  PostfixExpression()
-}
-
-// This production is to determine lookahead only.  The LOOKAHEAD specifications
-// below are not used, but they are there just to indicate that we know about
-// this.
-void CastLookahead() :
-{}
-{
-  LOOKAHEAD(2)
-  "(" PrimitiveType()
-|
-  LOOKAHEAD("(" Name() "[")
-  "(" Name() "[" "]"
-|
-  "(" Name() ")" ( "~" | "!" | "(" | <IDENTIFIER> | "this" | "super" | "new" | Literal() )
-}
-
-void PostfixExpression() :
-{}
-{
-  PrimaryExpression() 
-        [ "++" | "--" 
-                        { throw new ParseException("operation not yet supported"); }
-        ]
-}
-
-void CastExpression() :
-{}
-{
-  LOOKAHEAD(2)
-  "(" PrimitiveType() ( "[" "]" )* ")" UnaryExpression()
-|
-  "(" Name() ( "[" "]" )* ")" UnaryExpressionNotPlusMinus()
-}
-
-void PrimaryExpression() :
-{}
-{
-  PrimaryPrefix() ( PrimarySuffix() )*
-}
-
-void PrimaryPrefix() :
-{String name;}
-{
-  Literal()
-|
-  name = Name()
-                        { push(LValue.makeName(vm, frameGetter, name)); }
-|
-  "this"
-                        { push(LValue.makeThisObject(vm, frameGetter, token)); }
-|
-  "super" "." <IDENTIFIER>
-                        { throw new ParseException("operation not yet supported"); }
-|
-  "(" Expression() ")"
-|
-  AllocationExpression()
-}
-
-void PrimarySuffix() :
-{List argList;}
-{
-  "[" Expression() "]"  
-                        { LValue index = pop();
-                          push(pop().arrayElementLValue(index)); }
-|
-  "." <IDENTIFIER>
-                        { push(pop().memberLValue(frameGetter, token.image)); }
-|
-  argList = Arguments()
-                        { peek().invokeWith(argList); }
-}
-
-void Literal() :
-{}
-{
-  <INTEGER_LITERAL>
-                        { push(LValue.makeInteger(vm, token)); }
-|
-  <FLOATING_POINT_LITERAL>
-                        { push(LValue.makeFloat(vm, token)); }
-|
-  <CHARACTER_LITERAL>
-                        { push(LValue.makeCharacter(vm, token)); }
-|
-  <STRING_LITERAL>
-                        { push(LValue.makeString(vm, token)); }
-|
-  BooleanLiteral()
-                        { push(LValue.makeBoolean(vm, token)); }
-|
-  NullLiteral()
-                        { push(LValue.makeNull(vm, token)); }
-}
-
-void BooleanLiteral() :
-{}
-{
-  "true" 
-|
-  "false"
-}
-
-void NullLiteral() :
-{}
-{
-  "null"
-}
-
-List Arguments() :
-{List argList = new ArrayList();}
-{
-  "(" [ ArgumentList(argList) ] ")"
-  { return argList; }
-}
-
-void ArgumentList(List argList) :
-{}
-{
-  Expression() {argList.add(pop().interiorGetValue());}
-  ( "," Expression() {argList.add(pop().interiorGetValue());} )*
-}
-
-void AllocationExpression() :
-{List argList; String className;}
-{
-  LOOKAHEAD(2)
-  "new" PrimitiveType() ArrayDimensions()
-|
-  "new" className = Name() ( argList = Arguments() 
-                        { push(LValue.makeNewObject(vm, frameGetter, className, argList)); }
-                           | ArrayDimensions() 
-                        { throw new ParseException("operation not yet supported"); }
-			   )
-}
-
-/*
- * The second LOOKAHEAD specification below is to parse to PrimarySuffix
- * if there is an expression between the "[...]".
- */
-void ArrayDimensions() :
-{}
-{
-  ( LOOKAHEAD(2) "[" Expression() "]" )+ ( LOOKAHEAD(2) "[" "]" )*
-}
-
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ApplicationTool.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.*;
-
-import com.sun.tools.example.debug.bdi.*;
-
-public class ApplicationTool extends JPanel {
-
-    private static final long serialVersionUID = 310966063293205714L;
-
-    private ExecutionManager runtime;
-
-    private TypeScript script;
-
-    private static final String PROMPT = "Input:";
-
-    public ApplicationTool(Environment env) {
-
-        super(new BorderLayout());
-
-        this.runtime = env.getExecutionManager();
-
-        this.script = new TypeScript(PROMPT, false); // No implicit echo.
-        this.add(script);
-
-        script.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                runtime.sendLineToApplication(script.readln());
-            }
-        });
-
-        runtime.addApplicationEchoListener(new TypeScriptOutputListener(script));
-        runtime.addApplicationOutputListener(new TypeScriptOutputListener(script));
-        runtime.addApplicationErrorListener(new TypeScriptOutputListener(script));
-
-        //### should clean up on exit!
-
-    }
-
-    /******
-    public void setFont(Font f) {
-        script.setFont(f);
-    }
-    ******/
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ClassManager.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-public class ClassManager {
-
-    // This class is provided primarily for symmetry with
-    // SourceManager.  Currently, it does very little.
-    // If we add facilities in the future that require that
-    // class files be read outside of the VM, for example, to
-    // provide a disassembled view of a class for bytecode-level
-    // debugging, the required class file management will be done
-    // here.
-
-    private SearchPath classPath;
-
-    public ClassManager(Environment env) {
-        this.classPath = new SearchPath("");
-    }
-
-    public ClassManager(SearchPath classPath) {
-        this.classPath = classPath;
-    }
-
-    /*
-     * Set path for access to class files.
-     */
-
-    public void setClassPath(SearchPath sp) {
-        classPath = sp;
-    }
-
-    /*
-     * Get path for access to class files.
-     */
-
-    public SearchPath getClassPath() {
-        return classPath;
-    }
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ClassTreeTool.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,287 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-import java.util.*;
-
-import javax.swing.*;
-import javax.swing.tree.*;
-import java.awt.*;
-import java.awt.event.*;
-
-import com.sun.jdi.*;
-import com.sun.tools.example.debug.event.*;
-import com.sun.tools.example.debug.bdi.*;
-
-public class ClassTreeTool extends JPanel {
-
-    private static final long serialVersionUID = 526178912591739259L;
-
-    private Environment env;
-
-    private ExecutionManager runtime;
-    private SourceManager sourceManager;
-    private ClassManager classManager;
-
-    private JTree tree;
-    private DefaultTreeModel treeModel;
-    private ClassTreeNode root;
-//    private SearchPath sourcePath;
-
-    private CommandInterpreter interpreter;
-
-    private static String HEADING = "CLASSES";
-
-    public ClassTreeTool(Environment env) {
-
-        super(new BorderLayout());
-
-        this.env = env;
-        this.runtime = env.getExecutionManager();
-        this.sourceManager = env.getSourceManager();
-
-        this.interpreter = new CommandInterpreter(env);
-
-        root = createClassTree(HEADING);
-        treeModel = new DefaultTreeModel(root);
-
-        // Create a tree that allows one selection at a time.
-
-        tree = new JTree(treeModel);
-        tree.setSelectionModel(new SingleLeafTreeSelectionModel());
-
-        /******
-        // Listen for when the selection changes.
-        tree.addTreeSelectionListener(new TreeSelectionListener() {
-            public void valueChanged(TreeSelectionEvent e) {
-                ClassTreeNode node = (ClassTreeNode)
-                    (e.getPath().getLastPathComponent());
-                if (node != null) {
-                    interpreter.executeCommand("view " + node.getReferenceTypeName());
-                }
-            }
-        });
-        ******/
-
-        MouseListener ml = new MouseAdapter() {
-            @Override
-            public void mouseClicked(MouseEvent e) {
-                int selRow = tree.getRowForLocation(e.getX(), e.getY());
-                TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());
-                if(selRow != -1) {
-                    if(e.getClickCount() == 1) {
-                        ClassTreeNode node =
-                            (ClassTreeNode)selPath.getLastPathComponent();
-                        // If user clicks on leaf, select it, and issue 'view' command.
-                        if (node.isLeaf()) {
-                            tree.setSelectionPath(selPath);
-                            interpreter.executeCommand("view " + node.getReferenceTypeName());
-                        }
-                    }
-                }
-            }
-        };
-        tree.addMouseListener(ml);
-
-        JScrollPane treeView = new JScrollPane(tree);
-        add(treeView);
-
-        // Create listener.
-        ClassTreeToolListener listener = new ClassTreeToolListener();
-        runtime.addJDIListener(listener);
-        runtime.addSessionListener(listener);
-
-        //### remove listeners on exit!
-    }
-
-    private class ClassTreeToolListener extends JDIAdapter
-                       implements JDIListener, SessionListener {
-
-        // SessionListener
-
-        @Override
-        public void sessionStart(EventObject e) {
-            // Get system classes and any others loaded before attaching.
-            try {
-                for (ReferenceType type : runtime.allClasses()) {
-                    root.addClass(type);
-                }
-            } catch (VMDisconnectedException ee) {
-                // VM terminated unexpectedly.
-            } catch (NoSessionException ee) {
-                // Ignore.  Should not happen.
-            }
-        }
-
-        @Override
-        public void sessionInterrupt(EventObject e) {}
-        @Override
-        public void sessionContinue(EventObject e) {}
-
-        // JDIListener
-
-        @Override
-        public void classPrepare(ClassPrepareEventSet e) {
-            root.addClass(e.getReferenceType());
-        }
-
-        @Override
-        public void classUnload(ClassUnloadEventSet e) {
-            root.removeClass(e.getClassName());
-        }
-
-        @Override
-        public void vmDisconnect(VMDisconnectEventSet e) {
-            // Clear contents of this view.
-            root = createClassTree(HEADING);
-            treeModel = new DefaultTreeModel(root);
-            tree.setModel(treeModel);
-        }
-    }
-
-    ClassTreeNode createClassTree(String label) {
-        return new ClassTreeNode(label, null);
-    }
-
-    class ClassTreeNode extends DefaultMutableTreeNode {
-
-        private String name;
-        private ReferenceType refTy;  // null for package
-
-        ClassTreeNode(String name, ReferenceType refTy) {
-            this.name = name;
-            this.refTy = refTy;
-        }
-
-        @Override
-        public String toString() {
-            return name;
-        }
-
-        public ReferenceType getReferenceType() {
-            return refTy;
-        }
-
-        public String getReferenceTypeName() {
-            return refTy.name();
-        }
-
-        private boolean isPackage() {
-            return (refTy == null);
-        }
-
-        @Override
-        public boolean isLeaf() {
-            return !isPackage();
-        }
-
-        public void addClass(ReferenceType refTy) {
-            addClass(refTy.name(), refTy);
-        }
-
-        private void addClass(String className, ReferenceType refTy) {
-            if (className.equals("")) {
-                return;
-            }
-            int pos = className.indexOf('.');
-            if (pos < 0) {
-                insertNode(className, refTy);
-            } else {
-                String head = className.substring(0, pos);
-                String tail = className.substring(pos + 1);
-                ClassTreeNode child = insertNode(head, null);
-                child.addClass(tail, refTy);
-            }
-        }
-
-        private ClassTreeNode insertNode(String name, ReferenceType refTy) {
-            for (int i = 0; i < getChildCount(); i++) {
-                ClassTreeNode child = (ClassTreeNode)getChildAt(i);
-                int cmp = name.compareTo(child.toString());
-                if (cmp == 0) {
-                    // like-named node already exists
-                    return child;
-                } else if (cmp < 0) {
-                    // insert new node before the child
-                    ClassTreeNode newChild = new ClassTreeNode(name, refTy);
-                    treeModel.insertNodeInto(newChild, this, i);
-                    return newChild;
-                }
-            }
-            // insert new node after last child
-            ClassTreeNode newChild = new ClassTreeNode(name, refTy);
-            treeModel.insertNodeInto(newChild, this, getChildCount());
-            return newChild;
-        }
-
-        public void removeClass(String className) {
-            if (className.equals("")) {
-                return;
-            }
-            int pos = className.indexOf('.');
-            if (pos < 0) {
-                ClassTreeNode child = findNode(className);
-                if (!isPackage()) {
-                    treeModel.removeNodeFromParent(child);
-                }
-            } else {
-                String head = className.substring(0, pos);
-                String tail = className.substring(pos + 1);
-                ClassTreeNode child = findNode(head);
-                child.removeClass(tail);
-                if (isPackage() && child.getChildCount() < 1) {
-                    // Prune non-leaf nodes with no children.
-                    treeModel.removeNodeFromParent(child);
-                }
-            }
-        }
-
-        private ClassTreeNode findNode(String name) {
-            for (int i = 0; i < getChildCount(); i++) {
-                ClassTreeNode child = (ClassTreeNode)getChildAt(i);
-                int cmp = name.compareTo(child.toString());
-                if (cmp == 0) {
-                    return child;
-                } else if (cmp > 0) {
-                    // not found, since children are sorted
-                    return null;
-                }
-            }
-            return null;
-        }
-
-    }
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/CommandInterpreter.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1468 +0,0 @@
-/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-import java.io.*;
-import java.util.*;
-
-import com.sun.jdi.*;
-import com.sun.tools.example.debug.bdi.*;
-
-public class CommandInterpreter {
-
-    boolean echo;
-
-    Environment env;
-
-    private ContextManager context;
-    private ExecutionManager runtime;
-    private ClassManager classManager;
-    private SourceManager sourceManager;
-
-    private OutputSink out; //### Hack!  Should be local in each method used.
-    private String lastCommand = "help";
-
-    public CommandInterpreter(Environment env) {
-        this(env, true);
-    }
-
-    public CommandInterpreter(Environment env, boolean echo) {
-        this.env = env;
-        this.echo = echo;
-        this.runtime = env.getExecutionManager();
-        this.context = env.getContextManager();
-        this.classManager = env.getClassManager();
-        this.sourceManager = env.getSourceManager();
-    }
-
-    private ThreadReference[] threads = null;
-
-    /*
-     * The numbering of threads is relative to the current set of threads,
-     * and may be affected by the creation and termination of new threads.
-     * Commands issued using such thread ids will only give reliable behavior
-     * relative to what was shown earlier in 'list' commands if the VM is interrupted.
-     * We need a better scheme.
-     */
-
-    private ThreadReference[] threads() throws NoSessionException {
-        if (threads == null) {
-            ThreadIterator ti = new ThreadIterator(getDefaultThreadGroup());
-            List<ThreadReference> tlist = new ArrayList<ThreadReference>();
-            while (ti.hasNext()) {
-                tlist.add(ti.nextThread());
-            }
-            threads = tlist.toArray(new ThreadReference[tlist.size()]);
-        }
-        return threads;
-    }
-
-    private ThreadReference findThread(String idToken) throws NoSessionException {
-        String id;
-        ThreadReference thread = null;
-        if (idToken.startsWith("t@")) {
-            id = idToken.substring(2);
-        } else {
-            id = idToken;
-        }
-        try {
-            ThreadReference[] threads = threads();
-            long threadID = Long.parseLong(id, 16);
-            for (ThreadReference thread2 : threads) {
-                if (thread2.uniqueID() == threadID) {
-                    thread = thread2;
-                    break;
-                }
-            }
-            if (thread == null) {
-                //env.failure("No thread for id \"" + idToken + "\"");
-                env.failure("\"" + idToken + "\" is not a valid thread id.");
-            }
-        } catch (NumberFormatException e) {
-            env.error("Thread id \"" + idToken + "\" is ill-formed.");
-            thread = null;
-        }
-        return thread;
-    }
-
-    private ThreadIterator allThreads() throws NoSessionException {
-        threads = null;
-        //### Why not use runtime.allThreads().iterator() ?
-        return new ThreadIterator(runtime.topLevelThreadGroups());
-    }
-
-    private ThreadIterator currentThreadGroupThreads() throws NoSessionException {
-        threads = null;
-        return new ThreadIterator(getDefaultThreadGroup());
-    }
-
-    private ThreadGroupIterator allThreadGroups() throws NoSessionException {
-        threads = null;
-        return new ThreadGroupIterator(runtime.topLevelThreadGroups());
-    }
-
-    private ThreadGroupReference defaultThreadGroup;
-
-    private ThreadGroupReference getDefaultThreadGroup() throws NoSessionException {
-        if (defaultThreadGroup == null) {
-            defaultThreadGroup = runtime.systemThreadGroup();
-        }
-        return defaultThreadGroup;
-    }
-
-    private void setDefaultThreadGroup(ThreadGroupReference tg) {
-        defaultThreadGroup = tg;
-    }
-
-    /*
-     * Command handlers.
-     */
-
-    // Command: classes
-
-    private void commandClasses() throws NoSessionException {
-        OutputSink out = env.getOutputSink();
-        //out.println("** classes list **");
-        for (ReferenceType refType : runtime.allClasses()) {
-            out.println(refType.name());
-        }
-        out.show();
-    }
-
-
-    // Command: methods
-
-    private void commandMethods(StringTokenizer t) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            env.error("No class specified.");
-            return;
-        }
-        String idClass = t.nextToken();
-        ReferenceType cls = findClass(idClass);
-        if (cls != null) {
-            List<Method> methods = cls.allMethods();
-            OutputSink out = env.getOutputSink();
-            for (int i = 0; i < methods.size(); i++) {
-                Method method = methods.get(i);
-                out.print(method.declaringType().name() + " " +
-                            method.name() + "(");
-                Iterator<String> it = method.argumentTypeNames().iterator();
-                if (it.hasNext()) {
-                    while (true) {
-                        out.print(it.next());
-                        if (!it.hasNext()) {
-                            break;
-                        }
-                        out.print(", ");
-                    }
-                }
-                out.println(")");
-            }
-            out.show();
-        } else {
-            //### Should validate class name syntax.
-            env.failure("\"" + idClass + "\" is not a valid id or class name.");
-        }
-    }
-
-    private ReferenceType findClass(String pattern) throws NoSessionException {
-        List<ReferenceType> results = runtime.findClassesMatchingPattern(pattern);
-        if (results.size() > 0) {
-            //### Should handle multiple results sensibly.
-            return results.get(0);
-        }
-        return null;
-    }
-
-    // Command: threads
-
-    private void commandThreads(StringTokenizer t) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            OutputSink out = env.getOutputSink();
-            printThreadGroup(out, getDefaultThreadGroup(), 0);
-            out.show();
-            return;
-        }
-        String name = t.nextToken();
-        ThreadGroupReference tg = findThreadGroup(name);
-        if (tg == null) {
-            env.failure(name + " is not a valid threadgroup name.");
-        } else {
-            OutputSink out = env.getOutputSink();
-            printThreadGroup(out, tg, 0);
-            out.show();
-        }
-    }
-
-    private ThreadGroupReference findThreadGroup(String name) throws NoSessionException {
-        //### Issue: Uniqueness of thread group names is not enforced.
-        ThreadGroupIterator tgi = allThreadGroups();
-        while (tgi.hasNext()) {
-            ThreadGroupReference tg = tgi.nextThreadGroup();
-            if (tg.name().equals(name)) {
-                return tg;
-            }
-        }
-        return null;
-    }
-
-    private int printThreadGroup(OutputSink out, ThreadGroupReference tg, int iThread) {
-        out.println("Group " + tg.name() + ":");
-        List<ThreadReference> tlist = tg.threads();
-        int maxId = 0;
-        int maxName = 0;
-        for (int i = 0 ; i < tlist.size() ; i++) {
-            ThreadReference thr = tlist.get(i);
-            int len = Utils.description(thr).length();
-            if (len > maxId) {
-                maxId = len;
-            }
-            String name = thr.name();
-            int iDot = name.lastIndexOf('.');
-            if (iDot >= 0 && name.length() > iDot) {
-                name = name.substring(iDot + 1);
-            }
-            if (name.length() > maxName) {
-                maxName = name.length();
-        }
-        }
-        String maxNumString = String.valueOf(iThread + tlist.size());
-        int maxNumDigits = maxNumString.length();
-        for (int i = 0 ; i < tlist.size() ; i++) {
-            ThreadReference thr = tlist.get(i);
-            char buf[] = new char[80];
-            for (int j = 0; j < 79; j++) {
-                buf[j] = ' ';
-            }
-            buf[79] = '\0';
-            StringBuilder sbOut = new StringBuilder();
-            sbOut.append(buf);
-
-            // Right-justify the thread number at start of output string
-            String numString = String.valueOf(iThread + i + 1);
-            sbOut.insert(maxNumDigits - numString.length(),
-                         numString);
-            sbOut.insert(maxNumDigits, ".");
-
-            int iBuf = maxNumDigits + 2;
-            sbOut.insert(iBuf, Utils.description(thr));
-            iBuf += maxId + 1;
-            String name = thr.name();
-            int iDot = name.lastIndexOf('.');
-            if (iDot >= 0 && name.length() > iDot) {
-                name = name.substring(iDot + 1);
-            }
-            sbOut.insert(iBuf, name);
-            iBuf += maxName + 1;
-            sbOut.insert(iBuf, Utils.getStatus(thr));
-            sbOut.setLength(79);
-            out.println(sbOut.toString());
-        }
-        for (ThreadGroupReference tg0 : tg.threadGroups()) {
-            if (!tg.equals(tg0)) {  // TODO ref mgt
-                iThread += printThreadGroup(out, tg0, iThread + tlist.size());
-            }
-        }
-        return tlist.size();
-    }
-
-    // Command: threadgroups
-
-    private void commandThreadGroups() throws NoSessionException {
-        ThreadGroupIterator it = allThreadGroups();
-        int cnt = 0;
-        OutputSink out = env.getOutputSink();
-        while (it.hasNext()) {
-            ThreadGroupReference tg = it.nextThreadGroup();
-            ++cnt;
-            out.println("" + cnt + ". " + Utils.description(tg) + " " + tg.name());
-        }
-        out.show();
-    }
-
-    // Command: thread
-
-    private void commandThread(StringTokenizer t) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            env.error("Thread number not specified.");
-            return;
-        }
-        ThreadReference thread = findThread(t.nextToken());
-        if (thread != null) {
-            //### Should notify user.
-            context.setCurrentThread(thread);
-        }
-    }
-
-    // Command: threadgroup
-
-    private void commandThreadGroup(StringTokenizer t) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            env.error("Threadgroup name not specified.");
-            return;
-        }
-        String name = t.nextToken();
-        ThreadGroupReference tg = findThreadGroup(name);
-        if (tg == null) {
-            env.failure(name + " is not a valid threadgroup name.");
-        } else {
-            //### Should notify user.
-            setDefaultThreadGroup(tg);
-        }
-    }
-
-    // Command: run
-
-    private void commandRun(StringTokenizer t) throws NoSessionException {
-        if (doLoad(false, t)) {
-            env.notice("Running ...");
-        }
-    }
-
-    // Command: load
-
-    private void commandLoad(StringTokenizer t) throws NoSessionException {
-        if (doLoad(true, t)) {}
-    }
-
-    private boolean doLoad(boolean suspended,
-                           StringTokenizer t) throws NoSessionException {
-
-        String clname;
-
-        if (!t.hasMoreTokens()) {
-            clname = context.getMainClassName();
-            if (!clname.equals("")) {
-                // Run from prevously-set class name.
-                try {
-                    String vmArgs = context.getVmArguments();
-                    runtime.run(suspended,
-                                vmArgs,
-                                clname,
-                                context.getProgramArguments());
-                    return true;
-                } catch (VMLaunchFailureException e) {
-                    env.failure("Attempt to launch main class \"" + clname + "\" failed.");
-                }
-            } else {
-                env.failure("No main class specified and no current default defined.");
-            }
-        } else {
-            clname = t.nextToken();
-            StringBuilder str = new StringBuilder();
-            // Allow VM arguments to be specified here?
-            while (t.hasMoreTokens()) {
-                String tok = t.nextToken();
-                str.append(tok);
-                if (t.hasMoreTokens()) {
-                    str.append(' ');
-                }
-            }
-            String args = str.toString();
-            try {
-                String vmArgs = context.getVmArguments();
-                runtime.run(suspended, vmArgs, clname, args);
-                context.setMainClassName(clname);
-                //context.setVmArguments(vmArgs);
-                context.setProgramArguments(args);
-                return true;
-            } catch (VMLaunchFailureException e) {
-                env.failure("Attempt to launch main class \"" + clname + "\" failed.");
-            }
-        }
-        return false;
-    }
-
-    // Command: connect
-
-    private void commandConnect(StringTokenizer t) {
-        try {
-            LaunchTool.queryAndLaunchVM(runtime);
-        } catch (VMLaunchFailureException e) {
-            env.failure("Attempt to connect failed.");
-        }
-    }
-
-    // Command: attach
-
-    private void commandAttach(StringTokenizer t) {
-        String portName;
-        if (!t.hasMoreTokens()) {
-            portName = context.getRemotePort();
-            if (!portName.equals("")) {
-                try {
-                    runtime.attach(portName);
-                } catch (VMLaunchFailureException e) {
-                    env.failure("Attempt to attach to port \"" + portName + "\" failed.");
-                }
-            } else {
-                env.failure("No port specified and no current default defined.");
-            }
-        } else {
-            portName = t.nextToken();
-            try {
-                runtime.attach(portName);
-            } catch (VMLaunchFailureException e) {
-                env.failure("Attempt to attach to port \"" + portName + "\" failed.");
-            }
-            context.setRemotePort(portName);
-        }
-    }
-
-    // Command: detach
-
-    private void commandDetach(StringTokenizer t) throws NoSessionException {
-        runtime.detach();
-    }
-
-    // Command: interrupt
-
-    private void commandInterrupt(StringTokenizer t) throws NoSessionException {
-        runtime.interrupt();
-    }
-
-    // Command: suspend
-
-    private void commandSuspend(StringTokenizer t) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            // Suspend all threads in the current thread group.
-            //### Issue: help message says default is all threads.
-            //### Behavior here agrees with 'jdb', however.
-            ThreadIterator ti = currentThreadGroupThreads();
-            while (ti.hasNext()) {
-                // TODO - don't suspend debugger threads
-                ti.nextThread().suspend();
-            }
-            env.notice("All (non-system) threads suspended.");
-        } else {
-            while (t.hasMoreTokens()) {
-                ThreadReference thread = findThread(t.nextToken());
-                if (thread != null) {
-                    //thread.suspend();
-                    runtime.suspendThread(thread);
-                }
-            }
-        }
-    }
-
-    // Command: resume
-
-    private void commandResume(StringTokenizer t) throws NoSessionException {
-         if (!t.hasMoreTokens()) {
-            // Suspend all threads in the current thread group.
-            //### Issue: help message says default is all threads.
-            //### Behavior here agrees with 'jdb', however.
-            ThreadIterator ti = currentThreadGroupThreads();
-            while (ti.hasNext()) {
-                // TODO - don't suspend debugger threads
-                ti.nextThread().resume();
-            }
-            env.notice("All threads resumed.");
-         } else {
-             while (t.hasMoreTokens()) {
-                ThreadReference thread = findThread(t.nextToken());
-                if (thread != null) {
-                    //thread.resume();
-                    runtime.resumeThread(thread);
-                }
-             }
-         }
-    }
-
-    // Command: cont
-
-    private void commandCont() throws NoSessionException {
-        try {
-            runtime.go();
-        } catch (VMNotInterruptedException e) {
-            //### failure?
-            env.notice("Target VM is already running.");
-        }
-    }
-
-    // Command: step
-
-    private void commandStep(StringTokenizer t) throws NoSessionException{
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.failure("No current thread.");
-            return;
-        }
-        try {
-            if (t.hasMoreTokens() &&
-                t.nextToken().toLowerCase().equals("up")) {
-                runtime.stepOut(current);
-            } else {
-                runtime.stepIntoLine(current);
-            }
-        } catch (AbsentInformationException e) {
-            env.failure("No linenumber information available -- " +
-                            "Try \"stepi\" to step by instructions.");
-        }
-    }
-
-    // Command: stepi
-
-    private void commandStepi() throws NoSessionException {
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.failure("No current thread.");
-            return;
-        }
-        runtime.stepIntoInstruction(current);
-    }
-
-    // Command: next
-
-    private void commandNext() throws NoSessionException {
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.failure("No current thread.");
-            return;
-        }
-        try {
-            runtime.stepOverLine(current);
-        } catch (AbsentInformationException e) {
-            env.failure("No linenumber information available -- " +
-                            "Try \"nexti\" to step by instructions.");
-        }
-    }
-
-    // Command: nexti  (NEW)
-
-    private void commandNexti() throws NoSessionException {
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.failure("No current thread.");
-            return;
-        }
-        runtime.stepOverInstruction(current);
-    }
-
-    // Command: kill
-
-    private void commandKill(StringTokenizer t) throws NoSessionException {
-        //### Should change the way in which thread ids and threadgroup names
-        //### are distinguished.
-         if (!t.hasMoreTokens()) {
-            env.error("Usage: kill <threadgroup name> or <thread id>");
-            return;
-        }
-        while (t.hasMoreTokens()) {
-            String idToken = t.nextToken();
-            ThreadReference thread = findThread(idToken);
-            if (thread != null) {
-                runtime.stopThread(thread);
-                env.notice("Thread " + thread.name() + " killed.");
-                return;
-            } else {
-                /* Check for threadgroup name, NOT skipping "system". */
-                //### Should skip "system"?  Classic 'jdb' does this.
-                //### Should deal with possible non-uniqueness of threadgroup names.
-                ThreadGroupIterator itg = allThreadGroups();
-                while (itg.hasNext()) {
-                    ThreadGroupReference tg = itg.nextThreadGroup();
-                    if (tg.name().equals(idToken)) {
-                        ThreadIterator it = new ThreadIterator(tg);
-                        while (it.hasNext()) {
-                            runtime.stopThread(it.nextThread());
-                        }
-                        env.notice("Threadgroup " + tg.name() + "killed.");
-                        return;
-                    }
-                }
-                env.failure("\"" + idToken +
-                            "\" is not a valid threadgroup or id.");
-            }
-        }
-    }
-
-
-    /*************
-    // TODO
-    private void commandCatchException(StringTokenizer t) throws NoSessionException {}
-    // TODO
-    private void commandIgnoreException(StringTokenizer t) throws NoSessionException {}
-    *************/
-
-    // Command: up
-
-    //### Print current frame after command?
-
-    int readCount(StringTokenizer t) {
-        int cnt = 1;
-        if (t.hasMoreTokens()) {
-            String idToken = t.nextToken();
-            try {
-                cnt = Integer.valueOf(idToken).intValue();
-            } catch (NumberFormatException e) {
-                cnt = -1;
-            }
-        }
-        return cnt;
-    }
-
-    void commandUp(StringTokenizer t) throws NoSessionException {
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.failure("No current thread.");
-            return;
-        }
-        int nLevels = readCount(t);
-        if (nLevels <= 0) {
-            env.error("usage: up [n frames]");
-            return;
-        }
-        try {
-            int delta = context.moveCurrentFrameIndex(current, -nLevels);
-            if (delta == 0) {
-                env.notice("Already at top of stack.");
-            } else if (-delta < nLevels) {
-                env.notice("Moved up " + delta + " frames to top of stack.");
-            }
-        } catch (VMNotInterruptedException e) {
-            env.failure("Target VM must be in interrupted state.");
-        }
-    }
-
-    private void commandDown(StringTokenizer t) throws NoSessionException {
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.failure("No current thread.");
-            return;
-        }
-        int nLevels = readCount(t);
-        if (nLevels <= 0) {
-            env.error("usage: down [n frames]");
-            return;
-        }
-        try {
-            int delta = context.moveCurrentFrameIndex(current, nLevels);
-            if (delta == 0) {
-                env.notice("Already at bottom of stack.");
-            } else if (delta < nLevels) {
-                env.notice("Moved down " + delta + " frames to bottom of stack.");
-            }
-        } catch (VMNotInterruptedException e) {
-            env.failure("Target VM must be in interrupted state.");
-        }
-    }
-
-    // Command: frame
-
-    private void commandFrame(StringTokenizer t) throws NoSessionException {
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.failure("No current thread.");
-            return;
-        }
-        if (!t.hasMoreTokens()) {
-            env.error("usage: frame <frame-index>");
-            return;
-        }
-        String idToken = t.nextToken();
-        int n;
-        try {
-            n = Integer.valueOf(idToken).intValue();
-        } catch (NumberFormatException e) {
-            n = 0;
-        }
-        if (n <= 0) {
-            env.error("use positive frame index");
-            return;
-        }
-        try {
-            int delta = context.setCurrentFrameIndex(current, n);
-            if (delta == 0) {
-                env.notice("Frame unchanged.");
-            } else if (delta < 0) {
-                env.notice("Moved up " + -delta + " frames.");
-            } else {
-                env.notice("Moved down " + delta + " frames.");
-            }
-        } catch (VMNotInterruptedException e) {
-            env.failure("Target VM must be in interrupted state.");
-        }
-    }
-
-    // Command: where
-
-    //### Should we insist that VM be interrupted here?
-    //### There is an inconsistency between the 'where' command
-    //### and 'up' and 'down' in this respect.
-
-    private void commandWhere(StringTokenizer t, boolean showPC)
-                                                throws NoSessionException {
-        ThreadReference current = context.getCurrentThread();
-        if (!t.hasMoreTokens()) {
-            if (current == null) {
-                env.error("No thread specified.");
-                return;
-            }
-            dumpStack(current, showPC);
-        } else {
-            String token = t.nextToken();
-            if (token.toLowerCase().equals("all")) {
-                ThreadIterator it = allThreads();
-                while (it.hasNext()) {
-                    ThreadReference thread = it.next();
-                    out.println(thread.name() + ": ");
-                    dumpStack(thread, showPC);
-                }
-            } else {
-                ThreadReference thread = findThread(t.nextToken());
-                //### Do we want to set current thread here?
-                //### Should notify user of change.
-                if (thread != null) {
-                    context.setCurrentThread(thread);
-                }
-                dumpStack(thread, showPC);
-            }
-        }
-    }
-
-    private void dumpStack(ThreadReference thread, boolean showPC) {
-        //### Check for these.
-        //env.failure("Thread no longer exists.");
-        //env.failure("Target VM must be in interrupted state.");
-        //env.failure("Current thread isn't suspended.");
-        //### Should handle extremely long stack traces sensibly for user.
-        List<StackFrame> stack = null;
-        try {
-            stack = thread.frames();
-        } catch (IncompatibleThreadStateException e) {
-            env.failure("Thread is not suspended.");
-        }
-        //### Fix this!
-        //### Previously mishandled cases where thread was not current.
-        //### Now, prints all of the stack regardless of current frame.
-        int frameIndex = 0;
-        //int frameIndex = context.getCurrentFrameIndex();
-        if (stack == null) {
-            env.failure("Thread is not running (no stack).");
-        } else {
-            OutputSink out = env.getOutputSink();
-            int nFrames = stack.size();
-            for (int i = frameIndex; i < nFrames; i++) {
-                StackFrame frame = stack.get(i);
-                Location loc = frame.location();
-                Method meth = loc.method();
-                out.print("  [" + (i + 1) + "] ");
-                out.print(meth.declaringType().name());
-                out.print('.');
-                out.print(meth.name());
-                out.print(" (");
-                if (meth.isNative()) {
-                    out.print("native method");
-                } else if (loc.lineNumber() != -1) {
-                    try {
-                        out.print(loc.sourceName());
-                    } catch (AbsentInformationException e) {
-                        out.print("<unknown>");
-                    }
-                    out.print(':');
-                    out.print(loc.lineNumber());
-                }
-                out.print(')');
-                if (showPC) {
-                    long pc = loc.codeIndex();
-                    if (pc != -1) {
-                        out.print(", pc = " + pc);
-                    }
-                }
-                out.println();
-            }
-            out.show();
-        }
-    }
-
-    private void listEventRequests() throws NoSessionException {
-        // Print set breakpoints
-        List<EventRequestSpec> specs = runtime.eventRequestSpecs();
-        if (specs.isEmpty()) {
-            env.notice("No breakpoints/watchpoints/exceptions set.");
-        } else {
-            OutputSink out = env.getOutputSink();
-            out.println("Current breakpoints/watchpoints/exceptions set:");
-            for (EventRequestSpec bp : specs) {
-                out.println("\t" + bp);
-            }
-            out.show();
-        }
-    }
-
-    private BreakpointSpec parseBreakpointSpec(String bptSpec) {
-        StringTokenizer t = new StringTokenizer(bptSpec);
-        BreakpointSpec bpSpec = null;
-//        try {
-            String token = t.nextToken("@:( \t\n\r");
-            // We can't use hasMoreTokens here because it will cause any leading
-            // paren to be lost.
-            String rest;
-            try {
-                rest = t.nextToken("").trim();
-            } catch (NoSuchElementException e) {
-                rest = null;
-            }
-            if ((rest != null) && rest.startsWith("@")) {
-                t = new StringTokenizer(rest.substring(1));
-                String sourceName = token;
-                String lineToken = t.nextToken();
-                int lineNumber = Integer.valueOf(lineToken).intValue();
-                if (t.hasMoreTokens()) {
-                    return null;
-                }
-                bpSpec = runtime.createSourceLineBreakpoint(sourceName,
-                                                            lineNumber);
-            } else if ((rest != null) && rest.startsWith(":")) {
-                t = new StringTokenizer(rest.substring(1));
-                String classId = token;
-                String lineToken = t.nextToken();
-                int lineNumber = Integer.valueOf(lineToken).intValue();
-                if (t.hasMoreTokens()) {
-                    return null;
-                }
-                bpSpec = runtime.createClassLineBreakpoint(classId, lineNumber);
-            } else {
-                // Try stripping method from class.method token.
-                int idot = token.lastIndexOf('.');
-                if ( (idot <= 0) ||        /* No dot or dot in first char */
-                     (idot >= token.length() - 1) ) { /* dot in last char */
-                    return null;
-                }
-                String methodName = token.substring(idot + 1);
-                String classId = token.substring(0, idot);
-                List<String> argumentList = null;
-                if (rest != null) {
-                    if (!rest.startsWith("(") || !rest.endsWith(")")) {
-                        //### Should throw exception with error message
-                        //out.println("Invalid method specification: "
-                        //            + methodName + rest);
-                        return null;
-                    }
-                    // Trim the parens
-                    //### What about spaces in arglist?
-                    rest = rest.substring(1, rest.length() - 1);
-                    argumentList = new ArrayList<String>();
-                    t = new StringTokenizer(rest, ",");
-                    while (t.hasMoreTokens()) {
-                        argumentList.add(t.nextToken());
-                    }
-                }
-                bpSpec = runtime.createMethodBreakpoint(classId,
-                                                       methodName,
-                                                       argumentList);
-            }
-//        } catch (Exception e) {
-//            env.error("Exception attempting to create breakpoint: " + e);
-//            return null;
-//        }
-        return bpSpec;
-    }
-
-    private void commandStop(StringTokenizer t) throws NoSessionException {
-        String token;
-
-        if (!t.hasMoreTokens()) {
-            listEventRequests();
-        } else {
-            token = t.nextToken();
-            // Ignore optional "at" or "in" token.
-            // Allowed for backward compatibility.
-            if (token.equals("at") || token.equals("in")) {
-                if (t.hasMoreTokens()) {
-                    token = t.nextToken();
-                } else {
-                    env.error("Missing breakpoint specification.");
-                    return;
-                }
-            }
-            BreakpointSpec bpSpec = parseBreakpointSpec(token);
-            if (bpSpec != null) {
-                //### Add sanity-checks for deferred breakpoint.
-                runtime.install(bpSpec);
-            } else {
-                env.error("Ill-formed breakpoint specification.");
-            }
-        }
-    }
-
-    private void commandClear(StringTokenizer t) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            // Print set breakpoints
-            listEventRequests();
-            return;
-        }
-        //### need 'clear all'
-        BreakpointSpec bpSpec = parseBreakpointSpec(t.nextToken());
-        if (bpSpec != null) {
-            List<EventRequestSpec> specs = runtime.eventRequestSpecs();
-
-            if (specs.isEmpty()) {
-                env.notice("No breakpoints set.");
-            } else {
-                List<EventRequestSpec> toDelete = new ArrayList<EventRequestSpec>();
-                for (EventRequestSpec spec : specs) {
-                    if (spec.equals(bpSpec)) {
-                        toDelete.add(spec);
-                    }
-                }
-                // The request used for matching should be found
-                if (toDelete.size() <= 1) {
-                    env.notice("No matching breakpoint set.");
-                }
-                for (EventRequestSpec spec : toDelete) {
-                    runtime.delete(spec);
-                }
-            }
-        } else {
-            env.error("Ill-formed breakpoint specification.");
-        }
-    }
-
-    // Command: list
-
-    private void commandList(StringTokenizer t) throws NoSessionException {
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.error("No thread specified.");
-            return;
-        }
-        Location loc;
-        try {
-            StackFrame frame = context.getCurrentFrame(current);
-            if (frame == null) {
-                env.failure("Thread has not yet begun execution.");
-                return;
-            }
-            loc = frame.location();
-        } catch (VMNotInterruptedException e) {
-            env.failure("Target VM must be in interrupted state.");
-            return;
-        }
-        SourceModel source = sourceManager.sourceForLocation(loc);
-        if (source == null) {
-            if (loc.method().isNative()) {
-                env.failure("Current method is native.");
-                return;
-            }
-            env.failure("No source available for " + Utils.locationString(loc) + ".");
-            return;
-        }
-        ReferenceType refType = loc.declaringType();
-        int lineno = loc.lineNumber();
-        if (t.hasMoreTokens()) {
-            String id = t.nextToken();
-            // See if token is a line number.
-            try {
-                lineno = Integer.valueOf(id).intValue();
-            } catch (NumberFormatException nfe) {
-                // It isn't -- see if it's a method name.
-                List<Method> meths = refType.methodsByName(id);
-                if (meths == null || meths.size() == 0) {
-                    env.failure(id +
-                                " is not a valid line number or " +
-                                "method name for class " +
-                                refType.name());
-                    return;
-                } else if (meths.size() > 1) {
-                    env.failure(id +
-                                " is an ambiguous method name in" +
-                                refType.name());
-                    return;
-                }
-                loc = meths.get(0).location();
-                lineno = loc.lineNumber();
-            }
-        }
-        int startLine = (lineno > 4) ? lineno - 4 : 1;
-        int endLine = startLine + 9;
-        String sourceLine = source.sourceLine(lineno);
-        if (sourceLine == null) {
-            env.failure("" +
-                        lineno +
-                        " is an invalid line number for " +
-                        refType.name());
-        } else {
-            OutputSink out = env.getOutputSink();
-            for (int i = startLine; i <= endLine; i++) {
-                sourceLine = source.sourceLine(i);
-                if (sourceLine == null) {
-                    break;
-                }
-                out.print(i);
-                out.print("\t");
-                if (i == lineno) {
-                    out.print("=> ");
-                } else {
-                    out.print("   ");
-                }
-                out.println(sourceLine);
-            }
-            out.show();
-        }
-    }
-
-    // Command: use
-    // Get or set the source file path list.
-
-    private void commandUse(StringTokenizer t) {
-        if (!t.hasMoreTokens()) {
-            out.println(sourceManager.getSourcePath().asString());
-        } else {
-            //### Should throw exception for invalid path.
-            //### E.g., vetoable property change.
-            sourceManager.setSourcePath(new SearchPath(t.nextToken()));
-        }
-    }
-
-    // Command: sourcepath
-    // Get or set the source file path list.  (Alternate to 'use'.)
-
-    private void commandSourcepath(StringTokenizer t) {
-        if (!t.hasMoreTokens()) {
-            out.println(sourceManager.getSourcePath().asString());
-        } else {
-            //### Should throw exception for invalid path.
-            //### E.g., vetoable property change.
-            sourceManager.setSourcePath(new SearchPath(t.nextToken()));
-        }
-    }
-
-    // Command: classpath
-    // Get or set the class file path list.
-
-    private void commandClasspath(StringTokenizer t) {
-        if (!t.hasMoreTokens()) {
-            out.println(classManager.getClassPath().asString());
-        } else {
-            //### Should throw exception for invalid path.
-            //### E.g., vetoable property change.
-            classManager.setClassPath(new SearchPath(t.nextToken()));
-        }
-    }
-
-    // Command: view
-    // Display source for source file or class.
-
-    private void commandView(StringTokenizer t) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            env.error("Argument required");
-        } else {
-            String name = t.nextToken();
-            if (name.endsWith(".java") ||
-                name.indexOf(File.separatorChar) >= 0) {
-                env.viewSource(name);
-            } else {
-                //### JDI crashes taking line number for class.
-                /*****
-                ReferenceType cls = findClass(name);
-                if (cls != null) {
-                    env.viewLocation(cls.location());
-                } else {
-                    env.failure("No such class");
-                }
-                *****/
-                String fileName = name.replace('.', File.separatorChar) + ".java";
-                env.viewSource(fileName);
-            }
-        }
-    }
-
-    // Command: locals
-    // Print all local variables in current stack frame.
-
-    private void commandLocals() throws NoSessionException {
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.failure("No default thread specified: " +
-                        "use the \"thread\" command first.");
-            return;
-        }
-        StackFrame frame;
-        try {
-            frame = context.getCurrentFrame(current);
-            if (frame == null) {
-                env.failure("Thread has not yet created any stack frames.");
-                return;
-            }
-        } catch (VMNotInterruptedException e) {
-            env.failure("Target VM must be in interrupted state.");
-            return;
-        }
-
-        List<LocalVariable> vars;
-        try {
-            vars = frame.visibleVariables();
-            if (vars == null || vars.size() == 0) {
-                env.failure("No local variables");
-                return;
-            }
-        } catch (AbsentInformationException e) {
-            env.failure("Local variable information not available." +
-                        " Compile with -g to generate variable information");
-            return;
-        }
-
-        OutputSink out = env.getOutputSink();
-        out.println("Method arguments:");
-        for (LocalVariable var : vars) {
-            if (var.isArgument()) {
-                printVar(out, var, frame);
-            }
-        }
-        out.println("Local variables:");
-        for (LocalVariable var : vars) {
-            if (!var.isArgument()) {
-                printVar(out, var, frame);
-            }
-        }
-        out.show();
-        return;
-    }
-
-    /**
-     * Command: monitor
-     * Monitor an expression
-     */
-    private void commandMonitor(StringTokenizer t) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            env.error("Argument required");
-        } else {
-            env.getMonitorListModel().add(t.nextToken(""));
-        }
-    }
-
-    /**
-     * Command: unmonitor
-     * Unmonitor an expression
-     */
-    private void commandUnmonitor(StringTokenizer t) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            env.error("Argument required");
-        } else {
-            env.getMonitorListModel().remove(t.nextToken(""));
-        }
-    }
-
-    // Print a stack variable.
-
-    private void printVar(OutputSink out, LocalVariable var, StackFrame frame) {
-        out.print("  " + var.name());
-        if (var.isVisible(frame)) {
-            Value val = frame.getValue(var);
-            out.println(" = " + val.toString());
-        } else {
-            out.println(" is not in scope");
-        }
-    }
-
-    // Command: print
-    // Evaluate an expression.
-
-    private void commandPrint(StringTokenizer t, boolean dumpObject) throws NoSessionException {
-        if (!t.hasMoreTokens()) {
-            //### Probably confused if expresion contains whitespace.
-            env.error("No expression specified.");
-            return;
-        }
-        ThreadReference current = context.getCurrentThread();
-        if (current == null) {
-            env.failure("No default thread specified: " +
-                        "use the \"thread\" command first.");
-            return;
-        }
-        StackFrame frame;
-        try {
-            frame = context.getCurrentFrame(current);
-            if (frame == null) {
-                env.failure("Thread has not yet created any stack frames.");
-                return;
-            }
-        } catch (VMNotInterruptedException e) {
-            env.failure("Target VM must be in interrupted state.");
-            return;
-        }
-        while (t.hasMoreTokens()) {
-            String expr = t.nextToken("");
-            Value val = null;
-            try {
-                val = runtime.evaluate(frame, expr);
-            } catch(Exception e) {
-                env.error("Exception: " + e);
-                //### Fix this!
-            }
-            if (val == null) {
-                return;  // Error message already printed
-            }
-            OutputSink out = env.getOutputSink();
-            if (dumpObject && (val instanceof ObjectReference) &&
-                                 !(val instanceof StringReference)) {
-                ObjectReference obj = (ObjectReference)val;
-                ReferenceType refType = obj.referenceType();
-                out.println(expr + " = " + val.toString() + " {");
-                dump(out, obj, refType, refType);
-                out.println("}");
-            } else {
-                out.println(expr + " = " + val.toString());
-            }
-            out.show();
-        }
-    }
-
-    private void dump(OutputSink out,
-                      ObjectReference obj, ReferenceType refType,
-                      ReferenceType refTypeBase) {
-        for (Field field : refType.fields()) {
-            out.print("    ");
-            if (!refType.equals(refTypeBase)) {
-                out.print(refType.name() + ".");
-            }
-            out.print(field.name() + ": ");
-            Object o = obj.getValue(field);
-            out.println((o == null) ? "null" : o.toString()); // Bug ID 4374471
-        }
-        if (refType instanceof ClassType) {
-            ClassType sup = ((ClassType)refType).superclass();
-            if (sup != null) {
-                dump(out, obj, sup, refTypeBase);
-            }
-        } else if (refType instanceof InterfaceType) {
-            for (InterfaceType sup : ((InterfaceType)refType).superinterfaces()) {
-                dump(out, obj, sup, refTypeBase);
-            }
-        }
-    }
-
-    /*
-     * Display help message.
-     */
-
-    private void help() {
-        out.println("** command list **");
-        out.println("threads [threadgroup]     -- list threads");
-        out.println("thread <thread id>        -- set default thread");
-        out.println("suspend [thread id(s)]    -- suspend threads (default: all)");
-        out.println("resume [thread id(s)]     -- resume threads (default: all)");
-        out.println("where [thread id] | all   -- dump a thread's stack");
-        out.println("wherei [thread id] | all  -- dump a thread's stack, with pc info");
-        out.println("threadgroups              -- list threadgroups");
-        out.println("threadgroup <name>        -- set current threadgroup\n");
-//      out.println("print <expression>        -- print value of expression");
-        out.println("dump <expression>         -- print all object information\n");
-//      out.println("eval <expression>         -- evaluate expression (same as print)");
-        out.println("locals                    -- print all local variables in current stack frame\n");
-        out.println("classes                   -- list currently known classes");
-        out.println("methods <class id>        -- list a class's methods\n");
-        out.println("stop [in] <class id>.<method>[(argument_type,...)] -- set a breakpoint in a method");
-        out.println("stop [at] <class id>:<line> -- set a breakpoint at a line");
-        out.println("up [n frames]             -- move up a thread's stack");
-        out.println("down [n frames]           -- move down a thread's stack");
-        out.println("frame <frame-id>           -- to a frame");
-        out.println("clear <class id>.<method>[(argument_type,...)]   -- clear a breakpoint in a method");
-        out.println("clear <class id>:<line>   -- clear a breakpoint at a line");
-        out.println("clear                     -- list breakpoints");
-        out.println("step                      -- execute current line");
-        out.println("step up                   -- execute until the current method returns to its caller");
-        out.println("stepi                     -- execute current instruction");
-        out.println("next                      -- step one line (step OVER calls)");
-        out.println("nexti                     -- step one instruction (step OVER calls)");
-        out.println("cont                      -- continue execution from breakpoint\n");
-//      out.println("catch <class id>          -- break for the specified exception");
-//      out.println("ignore <class id>         -- ignore when the specified exception\n");
-        out.println("view classname|filename   -- display source file");
-        out.println("list [line number|method] -- print source code context at line or method");
-        out.println("use <source file path>    -- display or change the source path\n");
-//### new
-        out.println("sourcepath <source file path>    -- display or change the source path\n");
-//### new
-        out.println("classpath <class file path>    -- display or change the class path\n");
-        out.println("monitor <expression>      -- evaluate an expression each time the program stops\n");
-        out.println("unmonitor <monitor#>      -- delete a monitor\n");
-        out.println("read <filename>           -- read and execute a command file\n");
-//      out.println("memory                    -- report memory usage");
-//      out.println("gc                        -- free unused objects\n");
-        out.println("run <class> [args]        -- start execution of a Java class");
-        out.println("run                       -- re-execute last class run");
-        out.println("load <class> [args]       -- start execution of a Java class, initially suspended");
-        out.println("load                      -- re-execute last class run, initially suspended");
-        out.println("attach <portname>         -- debug existing process\n");
-        out.println("detach                    -- detach from debuggee process\n");
-        out.println("kill <thread(group)>      -- kill a thread or threadgroup\n");
-        out.println("!!                        -- repeat last command");
-        out.println("help (or ?)               -- list commands");
-        out.println("exit (or quit)            -- exit debugger");
-    }
-
-    /*
-     * Execute a command.
-     */
-
-    public void executeCommand(String command) {
-        //### Treatment of 'out' here is dirty...
-        out = env.getOutputSink();
-        if (echo) {
-            out.println(">>> " + command);
-        }
-        StringTokenizer t = new StringTokenizer(command);
-        try {
-            String cmd;
-            if (t.hasMoreTokens()) {
-                cmd = t.nextToken().toLowerCase();
-                lastCommand = cmd;
-            } else {
-                cmd = lastCommand;
-            }
-            if (cmd.equals("print")) {
-                commandPrint(t, false);
-            } else if (cmd.equals("eval")) {
-                commandPrint(t, false);
-            } else if (cmd.equals("dump")) {
-                commandPrint(t, true);
-            } else if (cmd.equals("locals")) {
-                commandLocals();
-            } else if (cmd.equals("classes")) {
-                commandClasses();
-            } else if (cmd.equals("methods")) {
-                commandMethods(t);
-            } else if (cmd.equals("threads")) {
-                commandThreads(t);
-            } else if (cmd.equals("thread")) {
-                commandThread(t);
-            } else if (cmd.equals("suspend")) {
-                commandSuspend(t);
-            } else if (cmd.equals("resume")) {
-                commandResume(t);
-            } else if (cmd.equals("cont")) {
-                commandCont();
-            } else if (cmd.equals("threadgroups")) {
-                commandThreadGroups();
-            } else if (cmd.equals("threadgroup")) {
-                commandThreadGroup(t);
-            } else if (cmd.equals("run")) {
-                commandRun(t);
-            } else if (cmd.equals("load")) {
-                commandLoad(t);
-            } else if (cmd.equals("connect")) {
-                commandConnect(t);
-            } else if (cmd.equals("attach")) {
-                commandAttach(t);
-            } else if (cmd.equals("detach")) {
-                commandDetach(t);
-            } else if (cmd.equals("interrupt")) {
-                commandInterrupt(t);
-//### Not implemented.
-//          } else if (cmd.equals("catch")) {
-//              commandCatchException(t);
-//### Not implemented.
-//          } else if (cmd.equals("ignore")) {
-//              commandIgnoreException(t);
-            } else if (cmd.equals("step")) {
-                commandStep(t);
-            } else if (cmd.equals("stepi")) {
-                commandStepi();
-            } else if (cmd.equals("next")) {
-                commandNext();
-            } else if (cmd.equals("nexti")) {
-                commandNexti();
-            } else if (cmd.equals("kill")) {
-                commandKill(t);
-            } else if (cmd.equals("where")) {
-                commandWhere(t, false);
-            } else if (cmd.equals("wherei")) {
-                commandWhere(t, true);
-            } else if (cmd.equals("up")) {
-                commandUp(t);
-            } else if (cmd.equals("down")) {
-                commandDown(t);
-            } else if (cmd.equals("frame")) {
-                commandFrame(t);
-            } else if (cmd.equals("stop")) {
-                commandStop(t);
-            } else if (cmd.equals("clear")) {
-                commandClear(t);
-            } else if (cmd.equals("list")) {
-                commandList(t);
-            } else if (cmd.equals("use")) {
-                commandUse(t);
-            } else if (cmd.equals("sourcepath")) {
-                commandSourcepath(t);
-            } else if (cmd.equals("classpath")) {
-                commandClasspath(t);
-            } else if (cmd.equals("monitor")) {
-                commandMonitor(t);
-            } else if (cmd.equals("unmonitor")) {
-                commandUnmonitor(t);
-            } else if (cmd.equals("view")) {
-                commandView(t);
-//          } else if (cmd.equals("read")) {
-//              readCommand(t);
-            } else if (cmd.equals("help") || cmd.equals("?")) {
-                help();
-            } else if (cmd.equals("quit") || cmd.equals("exit")) {
-                try {
-                    runtime.detach();
-                } catch (NoSessionException e) {
-                    // ignore
-                }
-                env.terminate();
-            } else {
-                //### Dubious repeat-count feature inherited from 'jdb'
-                if (t.hasMoreTokens()) {
-                    try {
-                        int repeat = Integer.parseInt(cmd);
-                        String subcom = t.nextToken("");
-                        while (repeat-- > 0) {
-                            executeCommand(subcom);
-                        }
-                        return;
-                    } catch (NumberFormatException exc) {
-                    }
-                }
-                out.println("huh? Try help...");
-                out.flush();
-            }
-        } catch (NoSessionException e) {
-            out.println("There is no currently attached VM session.");
-            out.flush();
-        } catch (Exception e) {
-            out.println("Internal exception: " + e.toString());
-            out.flush();
-            System.out.println("JDB internal exception: " + e.toString());
-            e.printStackTrace();
-        }
-        out.show();
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/CommandTool.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-import java.io.*;
-import java.util.*;
-
-import javax.swing.*;
-import java.awt.BorderLayout;
-import java.awt.event.*;
-
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-
-import com.sun.tools.example.debug.bdi.*;
-import com.sun.tools.example.debug.event.*;
-
-public class CommandTool extends JPanel {
-
-    private static final long serialVersionUID = 8613516856378346415L;
-
-    private Environment env;
-
-    private ContextManager context;
-    private ExecutionManager runtime;
-    private SourceManager sourceManager;
-
-    private TypeScript script;
-
-    private static final String DEFAULT_CMD_PROMPT = "Command:";
-
-    public CommandTool(Environment env) {
-
-        super(new BorderLayout());
-
-        this.env = env;
-        this.context = env.getContextManager();
-        this.runtime = env.getExecutionManager();
-        this.sourceManager = env.getSourceManager();
-
-        script = new TypeScript(DEFAULT_CMD_PROMPT, false); //no echo
-        this.add(script);
-
-        final CommandInterpreter interpreter =
-            new CommandInterpreter(env);
-
-        // Establish handler for incoming commands.
-
-        script.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                interpreter.executeCommand(script.readln());
-            }
-        });
-
-        // Establish ourselves as the listener for VM diagnostics.
-
-        OutputListener diagnosticsListener =
-            new TypeScriptOutputListener(script, true);
-        runtime.addDiagnosticsListener(diagnosticsListener);
-
-        // Establish ourselves as the shared debugger typescript.
-
-        env.setTypeScript(new PrintWriter(new TypeScriptWriter(script)));
-
-        // Handle VM events.
-
-        TTYDebugListener listener = new TTYDebugListener(diagnosticsListener);
-
-        runtime.addJDIListener(listener);
-        runtime.addSessionListener(listener);
-        runtime.addSpecListener(listener);
-        context.addContextListener(listener);
-
-        //### remove listeners on exit!
-
-    }
-
-    private class TTYDebugListener implements
-            JDIListener, SessionListener, SpecListener, ContextListener {
-
-        private OutputListener diagnostics;
-
-        TTYDebugListener(OutputListener diagnostics) {
-            this.diagnostics = diagnostics;
-        }
-
-        // JDIListener
-
-        @Override
-        public void accessWatchpoint(AccessWatchpointEventSet e) {
-            setThread(e);
-            for (EventIterator it = e.eventIterator(); it.hasNext(); ) {
-                it.nextEvent();
-                diagnostics.putString("Watchpoint hit: " +
-                                      locationString(e));
-            }
-        }
-
-        @Override
-        public void classPrepare(ClassPrepareEventSet e) {
-            if (context.getVerboseFlag()) {
-                String name = e.getReferenceType().name();
-                diagnostics.putString("Class " + name + " loaded");
-            }
-        }
-
-        @Override
-        public void classUnload(ClassUnloadEventSet e) {
-            if (context.getVerboseFlag()) {
-                diagnostics.putString("Class " + e.getClassName() +
-                                      " unloaded.");
-            }
-        }
-
-        @Override
-        public void exception(ExceptionEventSet e) {
-            setThread(e);
-            String name = e.getException().referenceType().name();
-            diagnostics.putString("Exception: " + name);
-        }
-
-        @Override
-        public void locationTrigger(LocationTriggerEventSet e) {
-            String locString = locationString(e);
-            setThread(e);
-            for (EventIterator it = e.eventIterator(); it.hasNext(); ) {
-                Event evt = it.nextEvent();
-                if (evt instanceof BreakpointEvent) {
-                    diagnostics.putString("Breakpoint hit: " + locString);
-                } else if (evt instanceof StepEvent) {
-                    diagnostics.putString("Step completed: " + locString);
-                } else if (evt instanceof MethodEntryEvent) {
-                    diagnostics.putString("Method entered: " + locString);
-                } else if (evt instanceof MethodExitEvent) {
-                    diagnostics.putString("Method exited: " + locString);
-                } else {
-                    diagnostics.putString("UNKNOWN event: " + e);
-                }
-            }
-        }
-
-        @Override
-        public void modificationWatchpoint(ModificationWatchpointEventSet e) {
-            setThread(e);
-            for (EventIterator it = e.eventIterator(); it.hasNext(); ) {
-                it.nextEvent();
-                diagnostics.putString("Watchpoint hit: " +
-                                      locationString(e));
-            }
-        }
-
-        @Override
-        public void threadDeath(ThreadDeathEventSet e) {
-            if (context.getVerboseFlag()) {
-                diagnostics.putString("Thread " + e.getThread() +
-                                      " ended.");
-            }
-        }
-
-        @Override
-        public void threadStart(ThreadStartEventSet e) {
-            if (context.getVerboseFlag()) {
-                diagnostics.putString("Thread " + e.getThread() +
-                                      " started.");
-            }
-        }
-
-        @Override
-        public void vmDeath(VMDeathEventSet e) {
-            script.setPrompt(DEFAULT_CMD_PROMPT);
-            diagnostics.putString("VM exited");
-        }
-
-        @Override
-        public void vmDisconnect(VMDisconnectEventSet e) {
-            script.setPrompt(DEFAULT_CMD_PROMPT);
-            diagnostics.putString("Disconnected from VM");
-        }
-
-        @Override
-        public void vmStart(VMStartEventSet e) {
-            script.setPrompt(DEFAULT_CMD_PROMPT);
-            diagnostics.putString("VM started");
-        }
-
-        // SessionListener
-
-        @Override
-        public void sessionStart(EventObject e) {}
-
-        @Override
-        public void sessionInterrupt(EventObject e) {
-            Thread.yield();  // fetch output
-            diagnostics.putString("VM interrupted by user.");
-            script.setPrompt(DEFAULT_CMD_PROMPT);
-        }
-
-        @Override
-        public void sessionContinue(EventObject e) {
-            diagnostics.putString("Execution resumed.");
-            script.setPrompt(DEFAULT_CMD_PROMPT);
-        }
-
-        // SpecListener
-
-        @Override
-        public void breakpointSet(SpecEvent e) {
-            EventRequestSpec spec = e.getEventRequestSpec();
-            diagnostics.putString("Breakpoint set at " + spec + ".");
-        }
-        @Override
-        public void breakpointDeferred(SpecEvent e) {
-            EventRequestSpec spec = e.getEventRequestSpec();
-            diagnostics.putString("Breakpoint will be set at " +
-                                  spec + " when its class is loaded.");
-        }
-        @Override
-        public void breakpointDeleted(SpecEvent e) {
-            EventRequestSpec spec = e.getEventRequestSpec();
-            diagnostics.putString("Breakpoint at " + spec.toString() + " deleted.");
-        }
-        @Override
-        public void breakpointResolved(SpecEvent e) {
-            EventRequestSpec spec = e.getEventRequestSpec();
-            diagnostics.putString("Breakpoint resolved to " + spec.toString() + ".");
-        }
-        @Override
-        public void breakpointError(SpecErrorEvent e) {
-            EventRequestSpec spec = e.getEventRequestSpec();
-            diagnostics.putString("Deferred breakpoint at " +
-                                  spec + " could not be resolved:" +
-                                  e.getReason());
-        }
-
-//### Add info for watchpoints and exceptions
-
-        @Override
-        public void watchpointSet(SpecEvent e) {
-        }
-        @Override
-        public void watchpointDeferred(SpecEvent e) {
-        }
-        @Override
-        public void watchpointDeleted(SpecEvent e) {
-        }
-        @Override
-        public void watchpointResolved(SpecEvent e) {
-        }
-        @Override
-        public void watchpointError(SpecErrorEvent e) {
-        }
-
-        @Override
-        public void exceptionInterceptSet(SpecEvent e) {
-        }
-        @Override
-        public void exceptionInterceptDeferred(SpecEvent e) {
-        }
-        @Override
-        public void exceptionInterceptDeleted(SpecEvent e) {
-        }
-        @Override
-        public void exceptionInterceptResolved(SpecEvent e) {
-        }
-        @Override
-        public void exceptionInterceptError(SpecErrorEvent e) {
-        }
-
-
-        // ContextListener.
-
-        // If the user selects a new current thread or frame, update prompt.
-
-        @Override
-        public void currentFrameChanged(CurrentFrameChangedEvent e) {
-            // Update prompt only if affect thread is current.
-            ThreadReference thread = e.getThread();
-            if (thread == context.getCurrentThread()) {
-                script.setPrompt(promptString(thread, e.getIndex()));
-            }
-        }
-
-    }
-
-    private String locationString(LocatableEventSet e) {
-        Location loc = e.getLocation();
-        return "thread=\"" + e.getThread().name() +
-            "\", " + Utils.locationString(loc);
-    }
-
-    private void setThread(LocatableEventSet e) {
-        if (!e.suspendedNone()) {
-            Thread.yield();  // fetch output
-            script.setPrompt(promptString(e.getThread(), 0));
-            //### Current thread should be set elsewhere, e.g.,
-            //### in ContextManager
-            //### context.setCurrentThread(thread);
-        }
-    }
-
-    private String promptString(ThreadReference thread, int frameIndex) {
-        if (thread == null) {
-            return DEFAULT_CMD_PROMPT;
-        } else {
-            // Frame indices are presented to user as indexed from 1.
-            return (thread.name() + "[" + (frameIndex + 1) + "]:");
-        }
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ContextListener.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-public interface ContextListener {
-    void currentFrameChanged(CurrentFrameChangedEvent e);
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/ContextManager.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,362 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-import java.io.*;
-import java.util.*;
-
-import com.sun.jdi.*;
-import com.sun.tools.example.debug.event.*;
-import com.sun.tools.example.debug.bdi.*;
-
-public class ContextManager {
-
-    private ClassManager classManager;
-    private ExecutionManager runtime;
-
-    private String mainClassName;
-    private String vmArguments;
-    private String commandArguments;
-    private String remotePort;
-
-    private ThreadReference currentThread;
-
-    private boolean verbose;
-
-    private ArrayList<ContextListener> contextListeners = new ArrayList<ContextListener>();
-
-    public ContextManager(Environment env) {
-        classManager = env.getClassManager();
-        runtime = env.getExecutionManager();
-        mainClassName = "";
-        vmArguments = "";
-        commandArguments = "";
-        currentThread = null;
-
-        ContextManagerListener listener = new ContextManagerListener();
-        runtime.addJDIListener(listener);
-        runtime.addSessionListener(listener);
-    }
-
-    // Program execution defaults.
-
-    //### Should there be change listeners for these?
-    //### They would be needed if we expected a dialog to be
-    //### synchronized with command input while it was open.
-
-    public String getMainClassName() {
-        return mainClassName;
-    }
-
-    public void setMainClassName(String mainClassName) {
-        this.mainClassName = mainClassName;
-    }
-
-    public String getVmArguments() {
-        return processClasspathDefaults(vmArguments);
-    }
-
-    public void setVmArguments(String vmArguments) {
-        this.vmArguments = vmArguments;
-    }
-
-    public String getProgramArguments() {
-        return commandArguments;
-    }
-
-    public void setProgramArguments(String commandArguments) {
-        this.commandArguments = commandArguments;
-    }
-
-    public String getRemotePort() {
-        return remotePort;
-    }
-
-    public void setRemotePort(String remotePort) {
-        this.remotePort = remotePort;
-
-    }
-
-
-    // Miscellaneous debugger session preferences.
-
-    public boolean getVerboseFlag() {
-        return verbose;
-    }
-
-    public void setVerboseFlag(boolean verbose) {
-        this.verbose = verbose;
-    }
-
-
-    // Thread focus.
-
-    public ThreadReference getCurrentThread() {
-        return currentThread;
-    }
-
-    public void setCurrentThread(ThreadReference t) {
-        if (t != currentThread) {
-            currentThread = t;
-            notifyCurrentThreadChanged(t);
-        }
-    }
-
-    public void setCurrentThreadInvalidate(ThreadReference t) {
-        currentThread = t;
-        notifyCurrentFrameChanged(runtime.threadInfo(t),
-                                  0, true);
-    }
-
-    public void invalidateCurrentThread() {
-        notifyCurrentFrameChanged(null, 0, true);
-    }
-
-
-    // If a view is displaying the current thread, it may
-    // choose to indicate which frame is current in the
-    // sense of the command-line UI.  It may also "warp" the
-    // selection to that frame when changed by an 'up' or 'down'
-    // command. Hence, a notifier is provided.
-
-    /******
-    public int getCurrentFrameIndex() {
-        return getCurrentFrameIndex(currentThreadInfo);
-    }
-    ******/
-
-    public int getCurrentFrameIndex(ThreadReference t) {
-        return getCurrentFrameIndex(runtime.threadInfo(t));
-    }
-
-    //### Used in StackTraceTool.
-    public int getCurrentFrameIndex(ThreadInfo tinfo) {
-        if (tinfo == null) {
-            return 0;
-        }
-        Integer currentFrame = (Integer)tinfo.getUserObject();
-        if (currentFrame == null) {
-            return 0;
-        } else {
-            return currentFrame.intValue();
-        }
-    }
-
-    public int moveCurrentFrameIndex(ThreadReference t, int count) throws VMNotInterruptedException {
-        return setCurrentFrameIndex(t,count, true);
-    }
-
-    public int setCurrentFrameIndex(ThreadReference t, int newIndex) throws VMNotInterruptedException {
-        return setCurrentFrameIndex(t, newIndex, false);
-    }
-
-    public int setCurrentFrameIndex(int newIndex) throws VMNotInterruptedException {
-        if (currentThread == null) {
-            return 0;
-        } else {
-            return setCurrentFrameIndex(currentThread, newIndex, false);
-        }
-    }
-
-    private int setCurrentFrameIndex(ThreadReference t, int x, boolean relative) throws VMNotInterruptedException {
-        boolean sameThread = t.equals(currentThread);
-        ThreadInfo tinfo = runtime.threadInfo(t);
-        if (tinfo == null) {
-            return 0;
-        }
-        int maxIndex = tinfo.getFrameCount()-1;
-        int oldIndex = getCurrentFrameIndex(tinfo);
-        int newIndex = relative? oldIndex + x : x;
-        if (newIndex > maxIndex) {
-            newIndex = maxIndex;
-        } else  if (newIndex < 0) {
-            newIndex = 0;
-        }
-        if (!sameThread || newIndex != oldIndex) {  // don't recurse
-            setCurrentFrameIndex(tinfo, newIndex);
-        }
-        return newIndex - oldIndex;
-    }
-
-    private void setCurrentFrameIndex(ThreadInfo tinfo, int index) {
-        tinfo.setUserObject(index);
-        //### In fact, the value may not have changed at this point.
-        //### We need to signal that the user attempted to change it,
-        //### however, so that the selection can be "warped" to the
-        //### current location.
-        notifyCurrentFrameChanged(tinfo.thread(), index);
-    }
-
-    public StackFrame getCurrentFrame() throws VMNotInterruptedException {
-        return getCurrentFrame(runtime.threadInfo(currentThread));
-    }
-
-    public StackFrame getCurrentFrame(ThreadReference t) throws VMNotInterruptedException {
-        return getCurrentFrame(runtime.threadInfo(t));
-    }
-
-    public StackFrame getCurrentFrame(ThreadInfo tinfo) throws VMNotInterruptedException {
-        int index = getCurrentFrameIndex(tinfo);
-        try {
-            // It is possible, though unlikely, that the VM was interrupted
-            // before the thread created its Java stack.
-            return tinfo.getFrame(index);
-        } catch (FrameIndexOutOfBoundsException e) {
-            return null;
-        }
-    }
-
-    public void addContextListener(ContextListener cl) {
-        contextListeners.add(cl);
-    }
-
-    public void removeContextListener(ContextListener cl) {
-        contextListeners.remove(cl);
-    }
-
-    //### These notifiers are fired only in response to USER-INITIATED changes
-    //### to the current thread and current frame.  When the current thread is set automatically
-    //### after a breakpoint hit or step completion, no event is generated.  Instead,
-    //### interested parties are expected to listen for the BreakpointHit and StepCompleted
-    //### events.  This convention is unclean, and I believe that it reflects a defect in
-    //### in the current architecture.  Unfortunately, however, we cannot guarantee the
-    //### order in which various listeners receive a given event, and the handlers for
-    //### the very same events that cause automatic changes to the current thread may also
-    //### need to know the current thread.
-
-    private void notifyCurrentThreadChanged(ThreadReference t) {
-        ThreadInfo tinfo = null;
-        int index = 0;
-        if (t != null) {
-            tinfo = runtime.threadInfo(t);
-            index = getCurrentFrameIndex(tinfo);
-        }
-        notifyCurrentFrameChanged(tinfo, index, false);
-    }
-
-    private void notifyCurrentFrameChanged(ThreadReference t, int index) {
-        notifyCurrentFrameChanged(runtime.threadInfo(t),
-                                  index, false);
-    }
-
-    private void notifyCurrentFrameChanged(ThreadInfo tinfo, int index,
-                                           boolean invalidate) {
-        ArrayList<ContextListener> l =  new ArrayList<ContextListener>(contextListeners);
-        CurrentFrameChangedEvent evt =
-            new CurrentFrameChangedEvent(this, tinfo, index, invalidate);
-        for (int i = 0; i < l.size(); i++) {
-            l.get(i).currentFrameChanged(evt);
-        }
-    }
-
-    private class ContextManagerListener extends JDIAdapter
-                       implements SessionListener, JDIListener {
-
-        // SessionListener
-
-        @Override
-        public void sessionStart(EventObject e) {
-            invalidateCurrentThread();
-        }
-
-        @Override
-        public void sessionInterrupt(EventObject e) {
-            setCurrentThreadInvalidate(currentThread);
-        }
-
-        @Override
-        public void sessionContinue(EventObject e) {
-            invalidateCurrentThread();
-        }
-
-        // JDIListener
-
-        @Override
-        public void locationTrigger(LocationTriggerEventSet e) {
-            setCurrentThreadInvalidate(e.getThread());
-        }
-
-        @Override
-        public void exception(ExceptionEventSet e) {
-            setCurrentThreadInvalidate(e.getThread());
-        }
-
-        @Override
-        public void vmDisconnect(VMDisconnectEventSet e) {
-            invalidateCurrentThread();
-        }
-
-    }
-
-
-    /**
-     * Add a -classpath argument to the arguments passed to the exec'ed
-     * VM with the contents of CLASSPATH environment variable,
-     * if -classpath was not already specified.
-     *
-     * @param javaArgs the arguments to the VM being exec'd that
-     *                 potentially has a user specified -classpath argument.
-     * @return a javaArgs whose -classpath option has been added
-     */
-
-    private String processClasspathDefaults(String javaArgs) {
-        if (javaArgs.indexOf("-classpath ") == -1) {
-            StringBuilder munged = new StringBuilder(javaArgs);
-            SearchPath classpath = classManager.getClassPath();
-            if (classpath.isEmpty()) {
-                String envcp = System.getProperty("env.class.path");
-                if ((envcp != null) && (envcp.length() > 0)) {
-                    munged.append(" -classpath " + envcp);
-                }
-            } else {
-                munged.append(" -classpath " + classpath.asString());
-            }
-            return munged.toString();
-        } else {
-            return javaArgs;
-        }
-    }
-
-    private String appendPath(String path1, String path2) {
-        if (path1 == null || path1.length() == 0) {
-            return path2 == null ? "." : path2;
-        } else if (path2 == null || path2.length() == 0) {
-            return path1;
-        } else {
-            return path1  + File.pathSeparator + path2;
-        }
-    }
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/CurrentFrameChangedEvent.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-import com.sun.jdi.*;
-import com.sun.tools.example.debug.bdi.*;
-import java.util.EventObject;
-
-public class CurrentFrameChangedEvent extends EventObject {
-
-    private static final long serialVersionUID = 4214479486546762179L;
-    private ThreadInfo tinfo;
-    private int index;
-    private boolean invalidate;
-
-    public CurrentFrameChangedEvent(Object source, ThreadInfo tinfo,
-                                    int index, boolean invalidate) {
-        super(source);
-        this.tinfo = tinfo;
-        this.index = index;
-        this.invalidate = invalidate;
-    }
-
-    public ThreadReference getThread() {
-        return tinfo == null? null : tinfo.thread();
-    }
-
-    public ThreadInfo getThreadInfo() {
-        return tinfo;
-    }
-
-    public int getIndex() {
-        return index;
-    }
-
-    public boolean getInvalidate() {
-        return invalidate;
-    }
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/Environment.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-import java.io.*;
-import com.sun.jdi.*;
-import com.sun.tools.example.debug.bdi.*;
-
-public class Environment {
-
-    private SourceManager sourceManager;
-    private ClassManager classManager;
-    private ContextManager contextManager;
-    private MonitorListModel monitorListModel;
-    private ExecutionManager runtime;
-
-    private PrintWriter typeScript;
-
-    private boolean verbose;
-
-    public Environment() {
-        this.classManager = new ClassManager(this);
-        //### Order of the next three lines is important!  (FIX THIS)
-        this.runtime = new ExecutionManager();
-        this.sourceManager = new SourceManager(this);
-        this.contextManager = new ContextManager(this);
-        this.monitorListModel = new MonitorListModel(this);
-    }
-
-    // Services used by debugging tools.
-
-    public SourceManager getSourceManager() {
-        return sourceManager;
-    }
-
-    public ClassManager getClassManager() {
-        return classManager;
-    }
-
-    public ContextManager getContextManager() {
-        return contextManager;
-    }
-
-    public MonitorListModel getMonitorListModel() {
-        return monitorListModel;
-    }
-
-    public ExecutionManager getExecutionManager() {
-        return runtime;
-    }
-
-    //### TODO:
-    //### Tools should attach/detach from environment
-    //### via a property, which should call an 'addTool'
-    //### method when set to maintain a registry of
-    //### tools for exit-time cleanup, etc.  Tool
-    //### class constructors should be argument-free, so
-    //### that they may be instantiated by bean builders.
-    //### Will also need 'removeTool' in case property
-    //### value is changed.
-    //
-    // public void addTool(Tool t);
-    // public void removeTool(Tool t);
-
-     public void terminate() {
-         System.exit(0);
-     }
-
-    // public void refresh();    // notify all tools to refresh their views
-
-
-    // public void addStatusListener(StatusListener l);
-    // public void removeStatusListener(StatusListener l);
-
-    // public void addOutputListener(OutputListener l);
-    // public void removeOutputListener(OutputListener l);
-
-    public void setTypeScript(PrintWriter writer) {
-        typeScript = writer;
-    }
-
-    public void error(String message) {
-        if (typeScript != null) {
-            typeScript.println(message);
-        } else {
-            System.out.println(message);
-        }
-    }
-
-    public void failure(String message) {
-        if (typeScript != null) {
-            typeScript.println(message);
-        } else {
-            System.out.println(message);
-        }
-    }
-
-    public void notice(String message) {
-        if (typeScript != null) {
-            typeScript.println(message);
-        } else {
-            System.out.println(message);
-        }
-    }
-
-    public OutputSink getOutputSink() {
-        return new OutputSink(typeScript);
-    }
-
-    public void viewSource(String fileName) {
-        //### HACK ###
-        //### Should use listener here.
-        com.sun.tools.example.debug.gui.GUI.srcTool.showSourceFile(fileName);
-    }
-
-    public void viewLocation(Location locn) {
-        //### HACK ###
-        //### Should use listener here.
-        //### Should we use sourceForLocation here?
-        com.sun.tools.example.debug.gui.GUI.srcTool.showSourceForLocation(locn);
-    }
-
-    //### Also in 'ContextManager'.  Do we need both?
-
-    public boolean getVerboseFlag() {
-        return verbose;
-    }
-
-    public void setVerboseFlag(boolean verbose) {
-        this.verbose = verbose;
-    }
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/GUI.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-import java.io.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
-import java.awt.event.*;
-
-import com.sun.jdi.*;
-import com.sun.tools.example.debug.bdi.*;
-
-public class GUI extends JPanel {
-
-    private static final long serialVersionUID = 3292463234530679091L;
-    private CommandTool cmdTool;
-    private ApplicationTool appTool;
-    //###HACK##
-    //### There is currently dirty code in Environment that
-    //### accesses this directly.
-    //private SourceTool srcTool;
-    public static SourceTool srcTool;
-
-    private SourceTreeTool sourceTreeTool;
-    private ClassTreeTool classTreeTool;
-    private ThreadTreeTool threadTreeTool;
-    private StackTraceTool stackTool;
-    private MonitorTool monitorTool;
-
-    public static final String progname = "javadt";
-    public static final String version = "1.0Beta";  //### FIX ME.
-    public static final String windowBanner = "Java(tm) platform Debug Tool";
-
-    private Font fixedFont = new Font("monospaced", Font.PLAIN, 10);
-
-    private GUI(Environment env) {
-        setLayout(new BorderLayout());
-
-        setBorder(new EmptyBorder(5, 5, 5, 5));
-
-        add(new JDBToolBar(env), BorderLayout.NORTH);
-
-        srcTool = new SourceTool(env);
-        srcTool.setPreferredSize(new java.awt.Dimension(500, 300));
-        srcTool.setTextFont(fixedFont);
-
-        stackTool = new StackTraceTool(env);
-        stackTool.setPreferredSize(new java.awt.Dimension(500, 100));
-
-        monitorTool = new MonitorTool(env);
-        monitorTool.setPreferredSize(new java.awt.Dimension(500, 50));
-
-        JSplitPane right = new JSplitPane(JSplitPane.VERTICAL_SPLIT, srcTool,
-            new JSplitPane(JSplitPane.VERTICAL_SPLIT, stackTool, monitorTool));
-
-        sourceTreeTool = new SourceTreeTool(env);
-        sourceTreeTool.setPreferredSize(new java.awt.Dimension(200, 450));
-
-        classTreeTool = new ClassTreeTool(env);
-        classTreeTool.setPreferredSize(new java.awt.Dimension(200, 450));
-
-        threadTreeTool = new ThreadTreeTool(env);
-        threadTreeTool.setPreferredSize(new java.awt.Dimension(200, 450));
-
-        JTabbedPane treePane = new JTabbedPane(SwingConstants.BOTTOM);
-        treePane.addTab("Source", null, sourceTreeTool);
-        treePane.addTab("Classes", null, classTreeTool);
-        treePane.addTab("Threads", null, threadTreeTool);
-
-        JSplitPane centerTop = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treePane, right);
-
-        cmdTool = new CommandTool(env);
-        cmdTool.setPreferredSize(new java.awt.Dimension(700, 150));
-
-        appTool = new ApplicationTool(env);
-        appTool.setPreferredSize(new java.awt.Dimension(700, 200));
-
-        JSplitPane centerBottom = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cmdTool, appTool);
-        //        centerBottom.setPreferredSize(new java.awt.Dimension(700, 350));
-
-        JSplitPane center = new JSplitPane(JSplitPane.VERTICAL_SPLIT, centerTop, centerBottom);
-
-        add(center, BorderLayout.CENTER);
-
-
-    }
-
-    private static void usage() {
-        String separator = File.pathSeparator;
-        System.out.println("Usage: " + progname + " <options> <class> <arguments>");
-        System.out.println();
-        System.out.println("where options include:");
-        System.out.println("    -help             print out this message and exit");
-        System.out.println("    -sourcepath <directories separated by \"" +
-                           separator + "\">");
-        System.out.println("                      list directories in which to look for source files");
-        System.out.println("    -remote <hostname>:<port-number>");
-        System.out.println("                      host machine and port number of interpreter to attach to");
-        System.out.println("    -dbgtrace [flags] print info for debugging " + progname);
-        System.out.println();
-        System.out.println("options forwarded to debuggee process:");
-        System.out.println("    -v -verbose[:class|gc|jni]");
-        System.out.println("                      turn on verbose mode");
-        System.out.println("    -D<name>=<value>  set a system property");
-        System.out.println("    -classpath <directories separated by \"" +
-                           separator + "\">");
-        System.out.println("                      list directories in which to look for classes");
-        System.out.println("    -X<option>        non-standard debuggee VM option");
-        System.out.println();
-        System.out.println("<class> is the name of the class to begin debugging");
-        System.out.println("<arguments> are the arguments passed to the main() method of <class>");
-        System.out.println();
-        System.out.println("For command help type 'help' at " + progname + " prompt");
-    }
-
-    public static void main(String argv[]) {
-        String clsName = "";
-        String progArgs = "";
-        String javaArgs = "";
-        final Environment env = new Environment();
-
-        JPanel mainPanel = new GUI(env);
-
-        ContextManager context = env.getContextManager();
-        ExecutionManager runtime = env.getExecutionManager();
-
-        for (int i = 0; i < argv.length; i++) {
-            String token = argv[i];
-            if (token.equals("-dbgtrace")) {
-            if ((i == argv.length - 1) ||
-                ! Character.isDigit(argv[i+1].charAt(0))) {
-                runtime.setTraceMode(VirtualMachine.TRACE_ALL);
-            } else {
-                String flagStr = argv[++i];
-                runtime.setTraceMode(Integer.decode(flagStr).intValue());
-            }
-        } else if (token.equals("-X")) {
-                System.out.println(
-                       "Use 'java -X' to see the available non-standard options");
-                System.out.println();
-                usage();
-                System.exit(1);
-            } else if (
-                   // Standard VM options passed on
-                   token.equals("-v") || token.startsWith("-v:") ||  // -v[:...]
-                   token.startsWith("-verbose") ||                  // -verbose[:...]
-                   token.startsWith("-D") ||
-                   // NonStandard options passed on
-                   token.startsWith("-X") ||
-                   // Old-style options
-                   // (These should remain in place as long as the standard VM accepts them)
-                   token.equals("-noasyncgc") || token.equals("-prof") ||
-                   token.equals("-verify") || token.equals("-noverify") ||
-                   token.equals("-verifyremote") ||
-                   token.equals("-verbosegc") ||
-                   token.startsWith("-ms") || token.startsWith("-mx") ||
-                   token.startsWith("-ss") || token.startsWith("-oss") ) {
-                javaArgs += token + " ";
-            } else if (token.equals("-sourcepath")) {
-                if (i == (argv.length - 1)) {
-                    System.out.println("No sourcepath specified.");
-                    usage();
-                    System.exit(1);
-                }
-                env.getSourceManager().setSourcePath(new SearchPath(argv[++i]));
-            } else if (token.equals("-classpath")) {
-                if (i == (argv.length - 1)) {
-                    System.out.println("No classpath specified.");
-                    usage();
-                    System.exit(1);
-                }
-                env.getClassManager().setClassPath(new SearchPath(argv[++i]));
-            } else if (token.equals("-remote")) {
-                if (i == (argv.length - 1)) {
-                    System.out.println("No remote specified.");
-                    usage();
-                    System.exit(1);
-                }
-                env.getContextManager().setRemotePort(argv[++i]);
-            } else if (token.equals("-help")) {
-                usage();
-                System.exit(0);
-            } else if (token.equals("-version")) {
-                System.out.println(progname + " version " + version);
-                System.exit(0);
-            } else if (token.startsWith("-")) {
-                System.out.println("invalid option: " + token);
-                usage();
-                System.exit(1);
-            } else {
-                // Everything from here is part of the command line
-                clsName = token;
-                for (i++; i < argv.length; i++) {
-                    progArgs += argv[i] + " ";
-                }
-                break;
-            }
-        }
-
-        context.setMainClassName(clsName);
-        context.setProgramArguments(progArgs);
-        context.setVmArguments(javaArgs);
-
-        // Force Cross Platform L&F
-        try {
-            UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
-            // If you want the System L&F instead, comment out the above line and
-            // uncomment the following:
-            // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (Exception exc) {
-            System.err.println("Error loading L&F: " + exc);
-        }
-
-        JFrame frame = new JFrame();
-        frame.setBackground(Color.lightGray);
-        frame.setTitle(windowBanner);
-        frame.setJMenuBar(new JDBMenuBar(env));
-        frame.setContentPane(mainPanel);
-
-        frame.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowClosing(WindowEvent e) {
-                env.terminate();
-            }
-        });
-
-        frame.pack();
-        frame.setVisible(true);
-
-    }
-
-}
--- a/jdk/src/demo/share/jpda/com/sun/tools/example/debug/gui/Icons.java	Tue Aug 26 07:55:08 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This source code is provided to illustrate the usage of a given feature
- * or technique and has been deliberately simplified. Additional steps
- * required for a production-quality application, such as security checks,
- * input validation and proper error handling, might not be present in
- * this sample code.
- */
-
-
-package com.sun.tools.example.debug.gui;
-
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-
-class Icons {
-
-    private static int[]  exec  = {
-  0xffd8ffe0, 0x00104a46, 0x49460001, 0x01020000
-, 0x00000000, 0xffdb0043, 0x00020101, 0x01010102
-, 0x01010102, 0x02020202, 0x04030202, 0x02020504
-, 0x04030406, 0x05060606, 0x05060606, 0x07090806
-, 0x07090706, 0x06080b08, 0x090a0a0a, 0x0a0a0608
-, 0x0b0c0b0a, 0x0c090a0a, 0x0affdb00, 0x43010202
-, 0x02020202, 0x05030305, 0x0a070607, 0x0a0a0a0a
-, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a
-, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a
-, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0affc0
-, 0x00110800, 0x0c000c03, 0x01220002, 0x11010311
-, 0x01ffc400, 0x1f000001, 0x05010101, 0x01010100
-, 0x00000000, 0x00000001, 0x02030405, 0x06070809
-, 0x0a0bffc4, 0x00b51000, 0x02010303, 0x02040305
-, 0x05040400, 0x00017d01, 0x02030004, 0x11051221
-, 0x31410613, 0x51610722, 0x71143281, 0x91a10823
-, 0x42b1c115, 0x52d1f024, 0x33627282, 0x090a1617
-, 0x18191a25, 0x26272829, 0x2a343536, 0x3738393a
-, 0x43444546, 0x4748494a, 0x53545556, 0x5758595a
-, 0x63646566, 0x6768696a, 0x73747576, 0x7778797a
-, 0x83848586, 0x8788898a, 0x92939495, 0x96979899
-, 0x9aa2a3a4, 0xa5a6a7a8, 0xa9aab2b3, 0xb4b5b6b7
-, 0xb8b9bac2, 0xc3c4c5c6, 0xc7c8c9ca, 0xd2d3d4d5
-, 0xd6d7d8d9, 0xdae1e2e3, 0xe4e5e6e7, 0xe8e9eaf1
-, 0xf2f3f4f5, 0xf6f7f8f9, 0xfaffc400, 0x1f010003
-, 0x01010101, 0x01010101, 0x01000000, 0x00000001
-, 0x02030405, 0x06070809, 0x0a0bffc4, 0x00b51100
-, 0x02010204, 0x04030407, 0x05040400, 0x01027700
-, 0x01020311, 0x04052131, 0x06124151, 0x07617113
-, 0x22328108, 0x144291a1, 0xb1c10923, 0x3352f015
-, 0x6272d10a, 0x162434e1, 0x25f11718, 0x191a2627
-, 0x28292a35, 0x36373839, 0x3a434445, 0x46474849
-, 0x4a535455, 0x56575859, 0x5a636465, 0x66676869
-, 0x6a737475, 0x76777879, 0x7a828384, 0x85868788
-, 0x898a9293, 0x94959697, 0x98999aa2, 0xa3a4a5a6
-, 0xa7a8a9aa, 0xb2b3b4b5, 0xb6b7b8b9, 0xbac2c3c4
-, 0xc5c6c7c8, 0xc9cad2d3, 0xd4d5d6d7, 0xd8d9dae2
-, 0xe3e4e5e6, 0xe7e8e9ea, 0xf2f3f4f5, 0xf6f7f8f9
-, 0xfaffda00, 0x0c030100, 0x02110311, 0x003f00fd
-, 0xbafda27e, 0x35ea1f03, 0x346f0ef8, 0x86cfc2d3
-, 0x6b31ea9e, 0x2ab7d2ee, 0xf4fb38cb, 0x5cc91cb0
-, 0xce4790a0, 0xfcd2ef44, 0xc29e1f95, 0xf94b065f
-, 0x42a86eb4, 0xed3ef67b, 0x7b9bcb18, 0x6692ce63
-, 0x35a492c4, 0x19a090a3, 0x465d09fb, 0xadb1dd72
-, 0x39daec3a, 0x13535706, 0x1f0f8ca7, 0x8dad56a5
-, 0x5e6a72e5, 0xe485be0b, 0x2b49df77, 0xcceda6ca
-, 0xda6ece3a, 0x147150c5, 0xd5a93a97, 0x84b97963
-, 0x6f86cbde, 0x77ddf33b, 0x69b2b69b, 0xb3ffd900
-
-    };
-    private static int[]  blank  = {
-  0xffd8ffe0, 0x00104a46, 0x49460001, 0x01020000
-, 0x00000000, 0xffdb0043, 0x00020101, 0x01010102
-, 0x01010102, 0x02020202, 0x04030202, 0x02020504
-, 0x04030406, 0x05060606, 0x05060606, 0x07090806
-, 0x07090706, 0x