User: scop
Date: 06/03/03 21:42:57
Added: packages/xemacs-packages/jde/doc/html/jdb-ug
jdb-ug-frame.html jdb-ug-toc.html jdb-ug.html
packages/xemacs-packages/jde/doc/html/jdb-ug/images
breakpoint.gif debug_cursor.gif display_locals.gif
display_obj.gif display_var1.gif display_var2.gif
set_var1.gif set_var2.gif set_var3.gif set_var4.gif
packages/xemacs-packages/jde/doc/html/jde-ug/images
keybindings.gif
packages/xemacs-packages/jde/doc/html/jdebug-ug/images
source_path.gif
packages/xemacs-packages/jde/doc/src/jdb-ug
jdb-ug-frame.html jdb-ug.xml
packages/xemacs-packages/jde/doc/src/jdb-ug/images
debug1.gif debug2.gif debug_cursor.gif
display_locals.gif display_obj.gif display_var1.gif
display_var2.gif set_var1.gif set_var2.gif
set_var3.gif set_var4.gif
packages/xemacs-packages/jde/doc/src/jde-ug/images
keybindings.gif
packages/xemacs-packages/jde/doc/tli_rbl/txt jdb-ug-toc.txt
packages/xemacs-packages/jde/java/bsh-commands/bsh/commands
beanInfoMaker.bsh exploreClass.bsh
packages/xemacs-packages/jde/java/lib LICENSE.apache
RIGHTS.antlr sun_checks.xml
packages/xemacs-packages/jde/java/src/jde/debugger
Debugger.java DisplayableValue.java JDEbug.java
SessionManager.java VMUtil.java
packages/xemacs-packages/jde/java/src/jde/debugger/command
ArrayModel.java GUI.java LVTreeNode.java
LocalVariableDisplay.java NullModel.java
ObjectModel.java PrimitiveTreeNode.java
ReferenceModel.java ReferenceTreeNode.java
packages/xemacs-packages/jde/java/src/jde/wizards
SignatureContainer.java SignatureVisitor.java
packages/xemacs-packages/jde/lisp ChangeLog.upstream
efc-xemacs.el jde-class.el jde-plugins.el
jde-xemacs.el
packages/xemacs-packages/jde/plugins README.txt
Removed: packages/xemacs-packages/jde/doc/html/jdb-ug jdb-guide.html
packages/xemacs-packages/jde/doc/html/jde-ug/images
KeyBindings.gif
packages/xemacs-packages/jde/doc/src/jde-ug/images
KeyBindings.gif
packages/xemacs-packages/jde/java/bsh-commands/bsh/commands
browseClassName.bsh
packages/xemacs-packages/jde/java/src/jde/debugger
Debug.java DebuggeeProcess.java Jdebug.java
LispForm.java
packages/xemacs-packages/jde/java/src/jde/debugger/command
DebugApplicationCommand.java Makefile
packages/xemacs-packages/jde/java/src/jde/debugger/expr
Makefile
packages/xemacs-packages/jde/java/src/jde/parser Java1.1.jj
Log:
Sync with upstream 2.3.3.
Revision Changes Path
1.55 +4 -0 XEmacs/packages/xemacs-packages/jde/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/ChangeLog,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -p -r1.54 -r1.55
--- ChangeLog 2006/02/20 07:27:03 1.54
+++ ChangeLog 2006/03/03 20:40:25 1.55
@@ -1,3 +1,7 @@
+2006-03-03 Ville Skyttä <scop(a)xemacs.org>
+
+ * Sync with upstream 2.3.3.
+
2006-02-20 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.49 released.
1.75 +21 -11 XEmacs/packages/xemacs-packages/jde/Makefile
Index: Makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/Makefile,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -p -r1.74 -r1.75
--- Makefile 2006/02/20 07:27:03 1.74
+++ Makefile 2006/03/03 20:40:25 1.75
@@ -18,7 +18,7 @@
# Boston, MA 02111-1307, USA.
VERSION = 1.49
-AUTHOR_VERSION = 2.3.2
+AUTHOR_VERSION = 2.3.3
MAINTAINER = Andy Piper <andy(a)xemacs.org>
AUTHOR = Paul Kinnucan <paulk(a)mathworks.com>
PACKAGE = jde
@@ -35,6 +35,7 @@ CATEGORY = standard
EARLY_ELCS = \
lisp/beanshell.elc \
lisp/efc.elc \
+ lisp/efc-xemacs.elc \
lisp/jde-parse.elc \
lisp/jde-db.elc \
lisp/jde-dbo.elc \
@@ -48,6 +49,7 @@ ELCS = $(EARLY_ELCS) \
lisp/jde-ant.elc \
lisp/jde-bug.elc \
lisp/jde-checkstyle.elc \
+ lisp/jde-class.elc \
lisp/jde-compile.elc \
lisp/jde-complete.elc \
lisp/jde-gen.elc \
@@ -62,6 +64,7 @@ ELCS = $(EARLY_ELCS) \
lisp/jde-make.elc \
lisp/jde-open-source.elc \
lisp/jde-package.elc \
+ lisp/jde-plugins.elc \
lisp/jde-parse-class.elc \
lisp/jde-run.elc \
lisp/jde-setnu.elc \
@@ -71,30 +74,32 @@ ELCS = $(EARLY_ELCS) \
lisp/jde-widgets.elc \
lisp/jde-wiz.elc \
lisp/jde-ejb.elc \
+ lisp/jde-xemacs.elc \
lisp/jde-xref.elc \
lisp/tree-widget.elc \
$(LATE_ELCS)
-EXTRA_SOURCES =
+EXTRA_SOURCES = lisp/ChangeLog.upstream
-#INFO_FILES = $(PACKAGE).htm *.gif
DATA_1_FILES = lisp/ReleaseNotes.txt
DATA_1_DEST = jde/doc
-DATA_4_FILES = $(wildcard java/lib/*.jar)
+DATA_2_FILES = $(wildcard java/bsh-commands/bsh/commands/*.bsh)
+DATA_2_DEST = jde/java/bsh-commands/bsh/commands
+DATA_3_FILES = plugins/README.txt
+DATA_3_DEST = jde/plugins
+DATA_4_FILES = $(wildcard java/lib/*.jar) java/lib/LICENSE.apache \
+ java/lib/RIGHTS.antlr java/lib/sun_checks.xml
DATA_4_DEST = jde/java/lib
DATA_8_FILES = $(wildcard java/src/jde/wizards/*.java)
DATA_8_DEST = jde/java/src/jde/wizards
-DATA_9_FILES = $(wildcard java/src/jde/debugger/*.java) \
- $(wildcard java/src/jde/debugger/Makefile*)
+DATA_9_FILES = $(wildcard java/src/jde/debugger/*.java)
DATA_9_DEST = jde/java/src/jde/debugger
DATA_13_FILES = $(wildcard java/src/jde/debugger/spec/*.java)
DATA_13_DEST = jde/java/src/jde/debugger/spec
DATA_14_FILES = $(wildcard java/src/jde/debugger/expr/*.java) \
- $(wildcard java/src/jde/debugger/expr/*.jj) \
- java/src/jde/debugger/expr/Makefile
+ $(wildcard java/src/jde/debugger/expr/*.jj)
DATA_14_DEST = jde/java/src/jde/debugger/expr
-DATA_15_FILES = $(wildcard java/src/jde/debugger/command/*.java) \
- java/src/jde/debugger/command/Makefile
+DATA_15_FILES = $(wildcard java/src/jde/debugger/command/*.java)
DATA_15_DEST = jde/java/src/jde/debugger/command
DATA_18_FILES = $(wildcard doc/tli_rbl/*.jar)
DATA_18_DEST = jde/doc/tli_rbl
@@ -124,7 +129,7 @@ DATA_30_FILES = $(wildcard doc/src/jde-u
DATA_30_DEST = jde/doc/src/jde-ug/images
DATA_31_FILES = $(wildcard doc/src/jde-ug/*.xml) \
$(wildcard doc/src/jde-ug/*.html)
-DATA_31_DEST = jde/doc/src/jde-ug/
+DATA_31_DEST = jde/doc/src/jde-ug
DATA_32_FILES = $(wildcard doc/src/styles/html/*.xsl)
DATA_32_DEST = jde/doc/src/styles/html
DATA_33_FILES = $(wildcard doc/tli_rbl/au/*.au)
@@ -133,6 +138,11 @@ DATA_34_FILES = $(wildcard doc/tli_rbl/i
DATA_34_DEST = jde/doc/tli_rbl/img
DATA_35_FILES = $(wildcard doc/tli_rbl/txt/*.txt)
DATA_35_DEST = jde/doc/tli_rbl/txt
+DATA_36_FILES = $(wildcard doc/src/jdb-ug/images/*.gif)
+DATA_36_DEST = jde/doc/src/jdb-ug/images
+DATA_37_FILES = $(wildcard doc/src/jdb-ug/*.xml) \
+ $(wildcard doc/src/jdb-ug/*.html)
+DATA_37_DEST = jde/doc/src/jdb-ug
AUTOLOAD_PATH = lisp
1.5 +1 -1 XEmacs/packages/xemacs-packages/jde/package-info.in
Index: package-info.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/package-info.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- package-info.in 2003/01/19 16:47:52 1.4
+++ package-info.in 2006/03/03 20:40:25 1.5
@@ -13,7 +13,7 @@
filename FILENAME
md5sum MD5SUM
size SIZE
- provides (beanshell efc jde-ant jde-bug jde-checkstyle jde-compat jde-compile
jde-complete jde-db jde-dbo jde-dbs jde-ejb jde-gen jde-help jde-imenu jde-import
jde-java-font-lock jde-java-grammar jde-javadoc-gen jde-javadoc jde-jdb jde-make
jde-open-source jde-package jde-parse-class jde-parse jde-run jde-setnu jde-stat jde-util
jde-which-method jde-widgets jde-wiz jde-xref jde tree-widget)
+ provides (beanshell efc efc-xemacs jde-ant jde-bug jde-checkstyle jde-class jde-compat
jde-compile jde-complete jde-db jde-dbo jde-dbs jde-ejb jde-gen jde-help jde-imenu
jde-import jde-java-font-lock jde-java-grammar jde-javadoc-gen jde-javadoc jde-jdb
jde-make jde-open-source jde-package jde-parse-class jde-parse jde-plugins jde-run
jde-setnu jde-stat jde-util jde-which-method jde-widgets jde-wiz jde-xemacs jde-xref jde
tree-widget)
requires (REQUIRES)
type regular
))
1.4 +8 -4 XEmacs/packages/xemacs-packages/jde/doc/html/css/jde_style.css
Index: jde_style.css
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/doc/html/css/jde_style.css,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- jde_style.css 2002/09/14 03:20:01 1.3
+++ jde_style.css 2006/03/03 20:40:31 1.4
@@ -4,17 +4,21 @@ h1 { font-family: "Arial", Helvetica, sa
h2 { font-family: "Arial", Helvetica, sans-serif;
font-size: 18pt;
margin-top: .5in;
- color: maroon;
+ color: maroon
}
-h3 { font-family: "Arial", Helvetica, sans-serif;
- font-size: 14pt;
+h3 { font-family: "New Times Roman", Times, serif;
+ font-size: 12pt;
margin-top: .4in}
h4 { font-family: "Arial", Helvetica, sans-serif;
+ font-size: 14pt;
+ margin-top: .3in; }
+h5 { font-family: "Arial", Helvetica, sans-serif;
font-size: 12pt;
margin-top: .3in }
-h5 { font-family: "Arial", Helvetica, serif;
+h6 { font-family: "Arial", Helvetica, sans-serif;
font-size: 10pt;
margin-top: .3in }
+
body { margin-left: .2in
background: white }
ul { margin-left: .4in}
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/jdb-ug-frame.html
Index: jdb-ug-frame.html
===================================================================
<html>
<head>
<title>JDB User's Guide</title>
</title>
<frameset cols="25%,75%" frameborder="yes">
<frame src="jdb-ug-toc.html" name="toc" marginwidth="3"
marginheight="3" scrolling="no">
<frame src="jdb-ug.html" name="content" marginwidth="5"
marginheight="0" scrolling="auto">
<noframes>
<body>
<p>
<A HREF="jdb-ug-toc.html">JDE Topics</A>
</p>
</body>
</noframes>
</frameset>
</html>
1.1 XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/jdb-ug-toc.html
Index: jdb-ug-toc.html
===================================================================
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
<link rel="StyleSheet" href="../css/jde_style.css"
TYPE="text/css">
</head>
<body bgcolor="#FFF7C8">
<h2>Contents</h2><applet codebase="../../tli_rbl"
archive="tli_rbl.jar" code="tli_rbl.class" width="200"
height="400">
<param name="file" value="./txt/jdb-ug-toc.txt">
<param name="target" value="content">
<param name="csep" value=";">
<param name="bImg" value="../tli_rbl/img/icon3.gif">
<param name="bgcolor" value="16775112">
<param name="v0" value="http://www.javaside.com">
<param name="v1" value="_top">
<param name="font0" value="Arial, 0, 12, 0, -255">
<param name="font1" value="Times, 0, 12, 0, 12000">
<param name="font2" value="Arial, 2, 14, 255, -255">
<param name="font3" value="Arial, 3, 14, 55, 1255">
<table border="0" width="100%" cols="1">
<tbody>
<tr>
<td><a href="jdb-ug.html#Intro"
target="content">Debugger Setup</a></td>
</tr>
<tr>
<td><a href="jdb-ug.html#RunningDebugger"
target="content">Running the Debugger</a></td>
</tr>
<tr>
<td><a href="jdb-ug.html#SettingBreakpoints"
target="content">Setting Breakpoints</a></td>
</tr>
<tr>
<td><a href="jdb-ug.html#SettingSourcePath"
target="content">Setting the Source Path</a></td>
</tr>
<tr>
<td><a href="jdb-ug.html#DisplayingVariables"
target="content">Displaying Variables</a></td>
</tr>
<tr>
<td><a href="jdb-ug.html#SettingVariables"
target="content">Setting Variables</a></td>
</tr>
<tr>
<td><a href="jdb-ug.html#DebugExternalProcesses"
target="content">Debugging External Processes</a></td>
</tr>
<tr>
<td><a href="jdb-ug.html#DebugOptions"
target="content">Debug Options</a></td>
</tr>
</tbody>
</table></applet></body>
</html>
1.1 XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/jdb-ug.html
Index: jdb-ug.html
===================================================================
<html><link rel="StyleSheet" href="../css/jde_style.css"
TYPE="text/css"><head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<title>Debugging with jdb</title><meta name="generator"
content="DocBook XSL Stylesheets V1.49"></head><body
bgcolor="white" text="black" link="#0000FF"
vlink="#840084" alink="#0000FF"><div
class="book"><div class="titlepage"><div><h1
class="title"><a name="d0e2"></a>Debugging with
jdb</h1></div><div><p class="releaseinfo">
<i>
Revised for JDEE 2.3.3
</i>
</p></div><div><p class="copyright">Copyright
© 1997, 1998, 1999, 2000, 2001, 2002, 2003 Paul
Kinnucan</p></div><hr></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e31"></a><a
name="Intro"></a>Debugger
Setup</h2></div></div><p>You should perform the following steps
before attempting to use jdb.</p><div class="itemizedlist"><ul
type="disc"><li><p>Set the configuration variable
<tt>jde-debugger</tt> to <tt>jdb</tt> if
you are using version 1.3 (or later) of the Windows or
Solaris versions of the JDK or version 1.2.2 (or later) of
the Linux version of the JDK. Set
<tt>jde-debugger</tt> to <tt>oldjdb</tt>
if you are using older versions of the JDK.</p></li><li><p>
Use <tt>jde-sourcepath</tt> to specify the paths
of any source code that you expect to visit while
debugging your application (see <a href="#SettingSourcePath">
Setting the Source Path</a>). If you suspect that a
problem is occurring in the Java API, you should include
the API source files in your source path.
</p></li><li><p>
Set <tt>jde-compile-option-debug</tt> on
(see
<a
href="../jde-ug/jde-ug-content.html#CompilingJavaPrograms">Compiling
Java Programs</a>). This causes the compiler to insert
information needed by the debugger into your
application's class files.
</p></li><li><p>Specify the app's main class either by
setting the
<tt>jde-run-application-class</tt> variable or by starting the
debugger from the buffer that contains the source file for
the main class.
</p></li></ul></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e77"></a><a
name="RunningDebugger"></a>Running the
Debugger</h2></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e81"></a><a
name="StartingDebugger"></a>Starting the
Debugger</h4></div></div><p>To debug a program with
<tt>jdb</tt>,
first select a buffer containing the source of the program you
want to debug (or a source buffer containing the program's
main class if you have not set
<tt>jde-run-application-class</tt>). Then execute
the JDEE's <b>jde-debug</b> command. You can execute
this command by:
</p><div class="itemizedlist"><ul
type="disc"><li><p>Selecting
JDE->Debug App
</p></li><li><p>
Entering the key combination
<b>C</b>-<b>c</b> <b>C</b>-<b>v</b>
<b>C</b>-<b>d</b>
</p></li><li><p>Entering
<b>M</b>-<b>x</b>
<b>jde-debug</b></p></li></ul></div><p>The JDEE
launches jdb, passing to it the name of the main
class of the program in the current source buffer and any
debug options that you have specified via the JDEE's debugger
option variables (see <a href="#SettingDebugOptions">Setting Debug
Options</a>.
jdb in turn launches a virtual machine to run the debuggee
program and stops the virtual machine before the main method
of the program's main class. Meanwhile the JDEE splits the
source window into two windows.
</p><div class="screenshot"><div
class="mediaobject"><img
src="images/debug1.gif"></div></div><p>
The upper window shows the source buffer. The menu bar
of the source buffer displays a menu (Jdb)
of debug commands. The lower window shows the debugger
interaction buffer.
</p><p>At this point, you can set breakpoints, run to a breakpoint that
you set before you started the debugger, or step into the main method
of your program.</p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e154"></a><a
name="SettingDebugOptions"></a>Setting Debug
Options</h5></div></div><p>The <b>jde-jdb</b> command
(selected by
JDE->Debug App when jdb
is the debugger for the current project) can optionally pass
command-line arguments that specify various debug options to
jdb when starting jdb. The JDEE provides two ways to specify
these options: via customization variables or in the
minibuffer when you run the <b>jde-jdb</b>
command.</p><p>The <b>jde-jdb</b> command passes any
options that you specify via customization variables to jdb.
In addition, if you set the customization variable
<tt>jde-db-read-vm-args</tt> to a non-nil value,
the <b>jde-jdb</b> command prompts you to enter
debugger options in the minibuffer. It appends the options
that you enter to the options specified via customization
variables. The JDEE saves the arguments that you enter in a
minibuffer history list. You can recall previously entered
options by pressing the up or down arrows on your keyboard.
</p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e183"></a><a
name="SettingAppArguments"></a>Setting App
Arguments</h5></div></div><p>You can use the customization
variable
<tt>jde-db-option-application-args</tt> to specify
arguments to be passed to the application launched by jdb.
The <b>jde-jdb</b> command inserts the specified
arguments on the command-line that it constructs to run
jdb.</p><p>In addition, if you set the customization variable
<tt>jde-db-read-app-args</tt> to a
non-<tt>nil</tt> value, the
<b>jde-jdb</b> command prompts you to enter the
application arguments in the minibuffer. It appends the
options that you enter to the arguments specified via
<tt>jde-db-option-application-args</tt>. The JDEE
saves the arguments that you enter in a minibuffer history
list. You can recall previously entered options by pressing
the up or down arrows on your keyboard. </p></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e209"></a><a
name="EnteringCommands"></a>Entering Debug
Commands</h4></div></div><p>The JDE lets you enter commands from
either the current source
buffer or from the debugger command-line interaction buffer.
You can enter all debugger commands from the debugger
buffer. You can enter only a subset of debugger commands
from the current source buffer. </p><p> To enter a debugger command
from the current source buffer, select the command from the
jdb menu or type the shortcut key for the command. The Jdb
menu lists the shortcut keys
for debugger commands. </p><p>To enter a command in the debugger
interaction window, type the
command at the debugger prompt and press the <b>Enter</b>
key. To see a list of debugger commands, enter the command
<b>help</b>.
</p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e228"></a><a
name="SteppingProgram"></a>Stepping Through a
Program</h4></div></div><p>
Jdb provides a set of command-line commands that advance a
program to the next line or the next breakpoint. The JDEE's
jdb interface provides Emacs commands that invoke the jdb's
step commands from a source buffer and move a debug cursor to
the next line to be executed in the source buffer. If you
prefer, you can enter jdb's step commands directly in the jdb
buffer.
</p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e234"></a><a name="StepCommands"></a>Step
Commands</h5></div></div><p> The following table lists the jdb
step commands
supported by the JDEE.
</p><div class="table"><p><b>Table 1. Step
Commands</b></p><table summary="Step Commands"
border="1"><colgroup><col><col><col><col></colgroup><thead><tr><th>Jdb
Menu Item</th><th>Emacs Command</th><th>jdb
Command</th><th>Description</th></tr></thead><tbody><tr><td>Step
Over</td><td>jde-bug-step-over</td><td>next</td><td><p>Advance
to the next line in the current
method, stepping over any lines that invoke other
methods.</p></td></tr><tr><td>Step
Into</td><td>jde-debug-step-into</td><td>step</td><td><p>Advance
to the next line in the
program.</p></td></tr><tr><td>Step
Out</td><td>jde-debug-step-out</td><td>step
up</td><td><p>Advance to the next line in the method
that invoked the current
method.</p></td></tr><tr><td>Continue</td><td>jde-debug-cont</td><td>cont</td><td><p>Advance
to the next breakpoint or to the
end of the program, whichever comes
first.</p></td></tr></tbody></table></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e295"></a><a
name="DebugCursor"></a>Debug
Cursor</h5></div></div><p>The JDEE uses an arrow, called the debug
cursor, to
indicate the next line to be executed as the result of a
step or continue command. The debug cursor appears in the
left gutter of the source window containing the next line to
be executed.</p><div class="screenshot"><div
class="mediaobject"><img
src="images/debug_cursor.gif"></div></div><p>If the step or
continue command advances the
program to a line that is not displayed in the current
source window, the JDEE opens the source file containing the
line, if necessary, and displays the source buffer in the
current source window, with the window scrolled to show the
line at which the program has halted.</p><div class="note"
style="margin-left: 0.5in; margin-right: 0.5in;"><h3
class="title">Note</h3><p>A blank source buffer indicates that
the debugger
cannot find the source file into which you have stepped.
You should check your source path setting (see <a
href="#SettingSourcePath">Setting the Source
Path</a>) to ensure that it includes all source
files in the execution path of your program.
</p></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e313"></a><a
name="SettingBreakpoints"></a>Setting
Breakpoints</h2></div></div><p>To set a breakpoint on any
executable line in the current
source buffer, click on the line and select Jdb->Set Breakpoint
(<b>C</b>-<b>c</b><b>C</b>-<b>a</b>
<b>C</b>-<b>b</b>). The JDEE highlights the
current line to indicate that a breakpoint is to be set at that
line. </p><div class="screenshot"><div
class="mediaobject"><img
src="images/breakpoint.gif"></div></div><p>
If the debugger is
running, the JDEE issues a command to the debugger to set a
breakpoint at the highlighted line. If not, the JDEE issues the
breakpoint command as soon as you start the debugger. If the
class in which the breakpoint is to be set is currently in memory
and the breakpoint is valid, the debugger sets the breakpoint.
If the class in which the breakpoint is set is not in memory,
the debugger puts it on a list of pending breakpoints. If the
class is subsequently loades, the debugger sets the breakpoint
in the class.
</p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e348"></a><a
name="BreakpointColors"></a>Breakpoint
Colors</h4></div></div><p>
The color of a breakpoint highlight indicates the status of the breakpoint
as follows.
</p><div class="table"><p><b>Table 1. Breakpoint
Colors</b></p><table summary="Breakpoint Colors"
border="1"><colgroup><col><col></colgroup><thead><tr><th>Color</th><th>Description</th></tr></thead><tbody><tr><td>Green</td><td>The
JDEE has not yet issued a command to the
debugger to set the
breakpoint.</td></tr><tr><td>Yellow</td><td>The
breakpoint is pending loading of the class in which it
is to be set.</td></tr><tr><td>Red</td><td>The
breakpoint has been
set.</td></tr></tbody></table></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e380"></a><a
name="ClearingBreakpoints"></a>Clearing
Breakpoints</h4></div></div><p>
To clear a breakpoint from a line in the current buffer, click
on the line and select Jdb->Toggle Breakpoint
(<b>C</b>-<b>c</b>
<b>C</b>-<b>a</b>
<b>C</b>-<b>b</b>).
</p><p>To clear all breakpoints set in the current session,
select Jdb->Clear
Breakpoints.
</p><div class="note" style="margin-left: 0.5in;
margin-right: 0.5in;"><h3
class="title">Note</h3><p>You can also set and clear breakpoints
by entering jdb
breakpoint commands in the jdb interaction buffer. See the
jdb documentation for information on using the jdb
breakpoint commands.</p></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e421"></a><a
name="SettingSourcePath"></a>Setting the Source
Path</h2></div></div><p>The <tt>jde-sourcepath</tt>
variable specifies the
directories the JDEE should search for source for classes
visited by the debugger as you step through your program.
</p><p>To set this variable, enter <b>M-x customize-variable
jde-sourcepath</b>.
The customization buffer for jde-sourcepath appears. The buffer shows the current
source path as a list of paths.</p><div
class="screenshot"><div class="mediaobject"><img
src="images/debug2.gif"></div></div><p>To add a path, click
the INS button
corresponding to the position in the list and enter the path in
the resulting edit field. To delete a path, click the DEL button
corresponding to the path. You can use environment variables in paths and
use dot notation to specify paths relative to the project file for the
project to which this sourcepath applies. When you are done editing the buffer,
press the State button to set the
variable.</p><p>To avoid having to specify the sourcepath every time
you
start a session, save the setting of
<tt>jde-db-sourcepath</tt> in your
<tt>prj.el</tt> file (see <a
href="../jde-ug/jde-ug-content.html#SavingProjSettings">Saving
Project Settings</a>) To save the setting in your project
file, select
JDE->Project->Project File->Save
(<b>C</b>-<b>c</b>
<b>C</b>-<b>v</b>
<b>C</b>-<b>p</b>
). </p><p>
You must specify the paths of the top-level directories of any
source code that you might visit while debugging your
application. The source code directory structure must mirror
your application's package structure. For example, suppose that your
application includes a set of classes packaged in the
<tt>myapp</tt> directory. Then, the source for those classes
must be reside in a directory named <tt>myapp</tt> and you must
specify the path of <tt>myapp</tt>'s parent directory.
</p><p>If you want to step through the JDK source code,
select the source code install option when you install the JDK
and set the <tt>jde-sourcepath</tt> variable
to the top-level directory containing the source code.
The JDE will use the JDK's package structure to find the
source code in the subdirectories. </p></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e505"></a><a
name="DisplayingVariables"></a>Displaying
Variables</h2></div></div><p>This section shows you how to display
the values of variables
(or expressions).</p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e511"></a><a
name="DisplayingExpressions"></a>Displaying
Expressions</h4></div></div><p>When the debuggee program is
stopped, the debugger lets
you display the value of any valid Java expression composed of
variables currently in scope. For example, to display the
value of a local, in-scope variable whose source is displayed
in a Java source buffer, put the point on the variable and
select
Jdb->Display->Expression. The JDEE prompts you to enter an expression
to be
evaluated and displayed in the minibuffer.</p><div
class="screenshot"><div class="mediaobject"><img
src="images/display_var1.gif"></div></div><p> The default
expression is the variable at point in the
source buffer. Edit the displayed expression and press
<b>Enter</b>. The JDEE issues a command to the
debugger to display the variable in the jdb buffer.</p><div
class="screenshot"><div class="mediaobject"><img
src="images/display_var2.gif"></div></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e538"></a><a
name="DisplayingObjects"></a>Displaying
Objects</h4></div></div><p>To display the values of the fields of
an object
referenced by an in-scope variable in the current source
buffer, and select
Jdb->Display->Object. The JDEE prompts you to enter the name of the
variable in the minibuffer. The default is the variable at
point in the source buffer. Press <b>Enter</b>. The
JDEE issues a <b>dump</b> command to the debugger
to display the field values of the object referenced by the
variable you entered.</p><div class="screenshot"><div
class="mediaobject"><img
src="images/display_obj.gif"></div></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e562"></a><a
name="DisplayingLocals"></a>Displaying Locals
</h4></div></div><p>To display the values of all in-scope
local variables,
including the values of the arguments of the method in which
the program is halted, select
Jdb->Display->Locals. The JDEE issues a <b>locals</b>
command to the debugger to display the local variable
values.</p><div class="screenshot"><div
class="mediaobject"><img
src="images/display_locals.gif"></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e583"></a><a
name="SettingVariables"></a>Setting
Variables</h2></div></div><p>Jdb allows you to change the values
of variables that are
in scope. To change the value of a variable via the JDEE's jdb
interface:</p><div class="orderedlist"><ol
type="1"><li><p>Position point on the variable you want to
change.</p></li><li><p>Select Jdb->Set Variable.
</p><p>The JDEE prompts you to enter a left expression that
represents the variable whose value you want to change. The
default is the variable at point in the source buffer.
</p><div class="screenshot"><div
class="mediaobject"><img
src="images/set_var1.gif"></div></div><div
class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Note</h3><p>Edit the
expression if necessary. For example, to set
the value of an array element at point, edit the
expression to include the index of the
element.</p></div></li><li><p>Press
<b>Enter</b>.</p><p>The JDEE prompts you to enter the new value of
the
variable.</p><div class="screenshot"><div
class="mediaobject"><img
src="images/set_var2.gif"></div></div></li><li><p>Enter
the new value at the prompt in the minibuffer.</p><div
class="screenshot"><div class="mediaobject"><img
src="images/set_var3.gif"></div></div></li><li><p>Press
<b>Enter</b>.</p><p>The JDEE issues a <b>set</b>
command to the
debugger to set the specified variable to the new
value.</p><div class="screenshot"><div
class="mediaobject"><img
src="images/set_var4.gif"></div></div></li></ol></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e645"></a><a
name="DebugExternalProcesses"></a>Debugging External
Processes</h2></div></div><p>Normally jdb launches the application
that it debugs.
However, you can use jdb to debug processes that are not
launched by jdb itself. This is useful, for example, if you need
to debug a process running on a remote computer or a Java
process launched by a nonJava process.</p><p>Jdb provides two
modes for debugging external processes: attach mode and listen
mode. When started in attach mode, jdb connects itself to the
external process. When started in listen mode, jdb waits for an
external process to connect itself to jdb. Each mode has
advantages. Attach mode allows you to debug an external process
anytime after it has started. Listen mode allows you to debug
the startup of a Java process launched by a nonJava process.</p><p>
The following sections explain how to use the JDEE's jdb
interface to run jdb in attach and listen mode.</p><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e655"></a><a
name="AttachingProcesses"></a>Attaching
Processes</h4></div></div><p>To attach jdb to an external process,
you must ensure that the
external process is started in debug server mode. You must then
start jdb in attach mode.</p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e661"></a><a
name="DebugServerMode"></a>Starting the External
Process in Debug Server Mode</h5></div></div><p>To start an
external process in debug server mode, you
must start the vm that runs the process with the following
command-line options:</p><div class="itemizedlist"><ul
type="disc"><li><p><tt>-Xdebug</tt></p></li><li><p>
<tt>-Xrunjdwp:transport=<b>TRANSPORT</b>,address=<b>ADDRESS</b>,server=y,suspend=<b>SUSPEND</b></tt>
</p><p>where</p><div class="itemizedlist"><ul
type="round"><li><p><tt><b>TRANSPORT</b></tt>
is
the type of communications channel between jdb and
the debuggee process, either
<tt>dt_socket</tt> (socket) or
<tt>dt_shmem</tt> (shared memory, valid
only for Windows
systems)</p></li><li><p><tt><b>ADDRESS</b></tt>
is
the address of the socket port or shared memory area
used by the debuggee process to listen for a jdb
connection.</p></li><li><p><tt><b>SUSPEND</b></tt>
is
either <tt>y</tt> (suspend the debuggee
process at startup, i.e., to wait for jdb to start,
a useful option when you need to debug an
application's startup code) or <tt>n</tt>
(do not suspend the debuggee
process)</p></li></ul></div></li></ul></div><div
class="example"><p><b>Example 1. Specifying Socket
Transport</b></p><p><tt>-Xdebug
-Xrunjdwp:transport=dt_socket,address=4444,server=y,suspend=n</tt></p></div><div
class="example"><p><b>Example 2. Specifying Shared Memory
Transport (MS Windows only)</b></p><p><tt>-Xdebug
-Xrunjdwp:transport=dt_shmem,address=javadebug,server=y,suspend=n</tt></p></div><p>The
JDEE customization variable, <tt>jde-run-option-debug</tt>, causes
the JDEE to generate these arguments automatically when launching a vm to run a Java
application. Thus, if you plan to launch the debuggee process from the JDEE, you
should set this variable to the desired options.</p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e736"></a><a
name="AttachMode"></a>Starting jdb in Attach
Mode</h5></div></div><p>To attach jdb to an existing process
via a socket,
select Jdb->External Process->Attach Via Socket from the Emacs menu bar.
By default,
the JDEE uses the socket address specified by
the customization variable <tt>jde-db-option-connect-socket</tt>.
If you set this variable to Prompt (nil), the JDEE
prompts you to enter a socket address in the minibuffer.
</p><div class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Note</h3><p>The default
socket address specified by
<tt>jde-db-option-connect-socket</tt>
is the same as the default socket address specified
by <tt>jde-run-option-debug</tt>. Thus, if you
want to attach jdb to a process started by the JDEE, the
only variable you have to set is
<tt>jde-run-option-debug</tt> (to run
the debuggee process in socket attach mode).</p></div><p>To attach
jdb to an existing process via a shared memory
connection (Windows platforms only),
select Jdb->External Process->Attach Via Shared Memory from the Emacs
menu bar. By default,
the JDEE uses the shared memory transport name specified by
the customization variable
<tt>jde-db-option-connect-shared-memory-name</tt>.
If you set this variable to Prompt (nil), the JDEE
prompts you to enter a shared-memory name in the minibuffer.
</p><div class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Note</h3><p>The default
shared memory name specified by
<tt>jde-db-option-connect-shared-memory-name</tt>
is the same as the default shared memory name specified
by <tt>jde-run-option-debug</tt>. Thus, if you
want to attach jdb to a process started by the JDEE, the
only variable you have to set is
<tt>jde-run-option-debug</tt> (to run
the debuggee process in shared memory attach
mode).</p></div></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e790"></a><a
name="ListeningForProcesses"></a>Listening for
Processes</h4></div></div><p>To connect an external process to a
jdb instance running in listener
mode:</p><div class="orderedlist"><ol
type="1"><li><p>Start jdb in listener mode (see <a
href="#ListenMode">Starting
jdb in Listen Mode</a>)</p></li><li><p>Start the
debuggee process in debug client
mode(see <a href="#DebugClientMode">Starting
the External Process in Debug Client
Mode</a>)</p></li></ol></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e809"></a><a
name="ListenMode"></a>Starting jdb in Listen
Mode</h5></div></div><p>To start jdb in listen mode, select
Jdb->External Process->Listen For from the Emacs menu bar. By default, the
JDEE prompts you to enter the address of the process to
be debugged in the minibuffer. The JDEE customization variable
jde-db-option-listen-address allows you to specify a default
debuggee address. If you set this variable, the JDEE does not
prompt you to enter an address.
</p><p>To start jdb listening for existing process via a socket,
select Jdb->External Process->Listen Via Socket from the Emacs menu bar.
By default,
the JDEE uses the socket address specified by
the customization variable <tt>jde-db-option-connect-socket</tt>.
If you set this variable to Prompt (nil), the JDEE
prompts you to enter a socket address in the minibuffer.
</p><div class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Note</h3><p>The default
socket address specified by
<tt>jde-db-option-connect-socket</tt>
is the same as the default socket address specified
by <tt>jde-run-option-debug</tt>. Thus, if you
want jdb to listen for a process started by the JDEE, the
only variable you have to set is
<tt>jde-run-option-debug</tt>, i.e., to run
the debuggee process in socket listen (client) mode.</p></div><p>To
start jdb listening for a process via a shared memory
connection (Windows platforms only),
select Jdb->External Process->Listen Via Shared Memory from the Emacs
menu bar. By default,
the JDEE uses the shared memory transport name specified by
the customization variable
<tt>jde-db-option-connect-shared-memory-name</tt>.
If you set this variable to Prompt (nil), the JDEE
prompts you to enter a shared-memory name in the minibuffer.
</p><div class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Note</h3><p>The default
shared memory name specified by
<tt>jde-db-option-connect-shared-memory-name</tt>
is the same as the default shared memory name specified
by <tt>jde-run-option-debug</tt>. Thus, if you
want jdb to listen for a process started by the JDEE, the
only variable you have to set is
<tt>jde-run-option-debug</tt>, i.e., to run
the debuggee process in shared memory listen (client)
mode.</p></div></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e873"></a><a
name="DebugClientMode"></a>Starting the External
Process in Debug Client Mode</h5></div></div><p>To start an
external process in debug client mode, you
must start the vm that runs the process with the following
command-line options:</p><div class="itemizedlist"><ul
type="disc"><li><p><tt>-Xdebug</tt></p></li><li><p>
<tt>-Xrunjdwp:transport=<b>TRANSPORT</b>,address=<b>ADDRESS</b>,server=n,suspend=<b>SUSPEND</b></tt>
</p><p>where</p><div class="itemizedlist"><ul
type="round"><li><p><tt><b>TRANSPORT</b></tt>
is
the type of communications channel between jdb and
the debuggee process, either
<tt>dt_socket</tt> (socket) or
<tt>dt_shmem</tt> (shared memory, valid
only for Windows
systems)</p></li><li><p><tt><b>ADDRESS</b></tt>
is
the address of the socket port or shared memory area
used by jdb to listen for a debuggee process
connection.</p></li><li><p><tt><b>SUSPEND</b></tt>
is
either <tt>y</tt> (suspend the debuggee
process when the connection occurs,
a useful option when you need to debug an
application's startup code) or <tt>n</tt>
(do not suspend the debuggee
process)</p></li></ul></div></li></ul></div><div
class="example"><p><b>Example 3. Specifying Socket
Transport</b></p><p><tt>-Xdebug
-Xrunjdwp:transport=dt_socket,address=4444,server=n,suspend=n</tt></p></div><div
class="example"><p><b>Example 4. Specifying Shared Memory
Transport (MS Windows only)</b></p><p><tt>-Xdebug
-Xrunjdwp:transport=dt_shmem,address=javadebug,server=n,suspend=n</tt></p></div><p>The
JDEE customization variable, <tt>jde-run-option-debug</tt>, causes
the JDEE to generate these arguments automatically when launching a vm to run a Java
application. Thus, if you plan to launch the debuggee process from the JDEE, you
should set this variable to the desired
options.</p></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e948"></a><a
name="DebugOptions"></a>Debug
Options</h2></div></div><p>The JDEE allows you to specify debug
options by setting JDEE
configuration variables. You can use the Emacs customization
feature to set debug variables interactively. To use the
customization feature, select Project->Options->Debug from the
JDE menu. (See <a
href="../jde-ug/jde-ug-content.html#ConfiguringJDE">Configuring
the JDEE</a> for more information on using the
customization feature). To save the compilation settings in the
project file (see <a
href="../jde-ug/jde-ug-content.html#UsingProjectFiles">Using
Project Files</a> for the current source buffer, select
Project->Project File->Save from the
JDE menu.</p><p>The following table lists the jdb customization
variables.</p><div class="table"><p><b>Table 1. Jdb
Customization Variables</b></p><table summary="Jdb Customization
Variables"
border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Variable</th><th>Group</th><th>Usage</th></tr></thead><tbody><tr><td
valign="top"><tt>jde-debugger</tt></td><td
valign="top">Project</td><td valign="top">Specify which
debugger to use to debug the current project.</td></tr><tr><td
valign="top"><tt>jde-sourcepath</tt></td><td
valign="top">Project</td><td valign="top">Specify
location(s) of source files that
can be visited while stepping through a
program.</td></tr><tr><td
valign="top"><tt>jde-db-mode-hook</tt></td><td
valign="top">Project</td><td valign="top">Customization
hook for jde-db inferior
mode.</td></tr><tr><td
valign="top"><tt>jde-global-classpath</tt></td><td
valign="top">Project</td><td valign="top">Specify class
paths for compile, run,
and debug commands.</td></tr><tr><td
valign="top"><tt>jde-db-read-vm-args</tt></td><td
valign="top">Project</td><td>Specifies whether to read debugger
VM arguments from
the minibuffer.</td></tr><tr><td
valign="top"><tt>jde-db-read-app-args</tt></td><td
valign="top">Project</td><td>Specifies whether to read
command-line application
arguments from the minibuffer.</td></tr><tr><td
valign="top"><tt>jde-db-option-classpath</tt></td><td
valign="top">Debug</td><td valign="top">Specifies the
classpath for the
Java interpreter. This option overrides the
jde-global-classpath option.</td></tr><tr><td
valign="top"><tt>jde-db-option-verbose</tt></td><td
valign="top">Debug</td><td valign="top">Print messages
about the running
process.</td></tr><tr><td
valign="top"><tt>jde-db-option-properties</tt></td><td
valign="top">Debug</td><td valign="top">Specify
property values.</td></tr><tr><td
valign="top"><tt>jde-db-option-heap-size</tt></td><td
valign="top">Debug</td><td valign="top">Specify the
initial and maximum size of
the interpreter heap.</td></tr><tr><td
valign="top"><tt>jde-db-option-stack-size</tt></td><td
valign="top">Debug</td><td valign="top">Specify size of
the C and Java stacks.</td></tr><tr><td
valign="top"><tt>jde-db-option-garbage-</tt><tt>collection</tt></td><td
valign="top">Debug</td><td valign="top">Specify garbage
collection
options.</td></tr><tr><td
valign="top"><tt>jde-db-option-java-profile</tt></td><td
valign="top">Debug</td><td valign="top">Enable Java
profiling.</td></tr><tr><td
valign="top"><tt>jde-db-option-heap-profile</tt></td><td
valign="top">Debug</td><td valign="top">Output heap
profiling data.</td></tr><tr><td
valign="top"><tt>jde-db-option-verify</tt></td><td
valign="top">Debug</td><td valign="top">Verify
classes.</td></tr><tr><td
valign="top"><tt>jde-db-option-vm-args</tt></td><td
valign="top">Debug</td><td valign="top">Specify
command-line arguments to be
passed to the Java VM.</td></tr><tr><td
valign="top"><tt>jde-db-option-application-args</tt></td><td
valign="top">Debug</td><td valign="top">Specify
command-line arguments to pass
to the application.</td></tr><tr><td
valign="top"><tt>jde-db-option-connect-socket</tt></td><td
valign="top">Debug</td><td valign="top">Specify socket
address of a running process
to which you want to connect the debugger, using a
debugger attach or listen command.</td></tr><tr><td
valign="top"><tt>jde-db-option-connect-shared-memory-name</tt></td><td
valign="top">Debug</td><td valign="top">Specify shared
memory name used by the debugger
to attach or listen for debuggee processes to
debug.</td></tr><tr><td
valign="top"><tt>jde-db-option-host</tt></td><td
valign="top">Debug</td><td valign="top">Host of a
remote process to which you
wish to attach the debugger. This option is invalid for JDK verions
greater than JDK
1.1.x.</td></tr></tbody></table></div></div></div></body></html>
1.2 +126 -61
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/debug1.gif
<<Binary file>>
1.2 +98 -50
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/debug2.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/breakpoint.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/debug_cursor.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/display_locals.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/display_obj.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/display_var1.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/display_var2.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/set_var1.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/set_var2.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/set_var3.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdb-ug/images/set_var4.gif
<<Binary file>>
1.5 +438 -193
XEmacs/packages/xemacs-packages/jde/doc/html/jde-ug/jde-ug-content.html
Index: jde-ug-content.html
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/doc/html/jde-ug/jde-ug-content.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- jde-ug-content.html 2002/11/14 05:18:31 1.4
+++ jde-ug-content.html 2006/03/03 20:40:42 1.5
@@ -2,14 +2,14 @@
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<title>JDEE User's Guide</title><meta name="generator"
content="DocBook XSL Stylesheets V1.49"></head><body
bgcolor="white" text="black" link="#0000FF"
vlink="#840084" alink="#0000FF"><div
class="book"><div class="titlepage"><div><h1
class="title"><a name="d0e3"></a>JDEE User's
Guide</h1></div><div><p class="releaseinfo">
<i>
- Revised for JDEE 2.2.9
+ Revised for JDEE 2.3.3
</i>
- </p></div><div><p class="copyright">Copyright
© 1997, 1998, 1999, 2000, 2001, 2002 Paul
Kinnucan</p></div><hr></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e30"></a><a
name="Intro"></a>Introduction</h2></div></div><p>Welcome
to the <span class="emphasis"><i>JDEE User's
Guide</i></span>. This
+ </p></div><div><p class="copyright">Copyright
© 1997, 1998, 1999, 2000, 2001, 2002, 2003 Paul
Kinnucan</p></div><hr></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e32"></a><a
name="Intro"></a>Introduction</h2></div></div><p>Welcome
to the <span class="emphasis"><i>JDEE User's
Guide</i></span>. This
guide explains how to use the JDEE to develop Java applications and
applets. The guide assumes that you are familiar with Emacs, the
Java programming language, and the Java development tools provided
with the Java Development Kit (JDK) from Sun Microsystems,
- Inc. and compatible tools provided by other vendors.</p><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e39"></a><a
name="AboutJDE"></a>About the
JDEE</h4></div></div><p>The Java Development Environment for Emacs
(JDEE) is an
+ Inc. and compatible tools provided by other vendors.</p><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e41"></a><a
name="AboutJDE"></a>About the
JDEE</h4></div></div><p>The Java Development Environment for Emacs
(JDEE) is an
Emacs Lisp package that interfaces Emacs to third-party Java
application development tools, such as those provided by Sun
Microsystems as part of its JDK. The result is an integrated
@@ -39,7 +39,7 @@
easily and infinitely customizable
</p></li><li><p>
works with FSF Emacs and XEmacs
- </p></li></ul></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e82"></a><a
name="JDERequirements"></a>JDE
Requirements</h4></div></div><p>The JDE requires the following
software: </p><div class="itemizedlist"><ul
type="disc"><li><p><a
href="http://www.gnu.org/">FSF Emacs</a> or
+ </p></li></ul></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e84"></a><a
name="JDERequirements"></a>JDE
Requirements</h4></div></div><p>The JDE requires the following
software: </p><div class="itemizedlist"><ul
type="disc"><li><p><a
href="http://www.gnu.org/">FSF Emacs</a> or
<a
href="http://www.xemacs.org/">XEmacs</a> on Unix
platforms; the 20.6.1 version (or later) of
<a
href="ftp://ftp.gnu.org/gnu/windows/emacs/latest">NT/Emacs&l... on
@@ -65,7 +65,7 @@
recommended for Windows95/NT environments. The <a
href="http://sources.redhat.com/cygwin">cygwin</a>
Unix emulation package for Windows from Red Hat includes
<b>bash</b>.
- </p></li></ul></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e142"></a><a
name="JDEComponents"></a>JDEE
Components</h4></div></div><p>
+ </p></li></ul></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e144"></a><a
name="JDEComponents"></a>JDEE
Components</h4></div></div><p>
The JDEE distribution includes the following files:
</p><div class="itemizedlist"><ul
type="disc"><li><p>
@@ -119,14 +119,14 @@
</p></li><li><p>
<a
href="../../../lisp/jtags.csh"><tt>jtags.csh</tt></a>
is a c shell script that tags Java source heierarchies.
- </p></li></ul></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e264"></a><a
name="LatestVersion"></a>Latest
Version</h4></div></div><p>See <a
href="http://jdee.sunsite.dk/rootpage.html#Downloading">
+ </p></li></ul></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e266"></a><a
name="LatestVersion"></a>Latest
Version</h4></div></div><p>See <a
href="http://jdee.sunsite.dk/rootpage.html#Downloading">
Downloading the JDE</a> on the JDE website for instructions on
downloading the most recent version of the JDE.
- </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e273"></a><a
name="InstallingJDE"></a>Installing the
JDE</h4></div></div><p>See the <a
href="http://jdee.sunsite.dk/install.html">
+ </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e275"></a><a
name="InstallingJDE"></a>Installing the
JDE</h4></div></div><p>See the <a
href="http://jdee.sunsite.dk/install.html">
JDE Installation Guide</a> on the JDE website for information
- on installing the JDE on your system.</p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e282"></a><a
name="ContactingAuthor"></a>Contacting the
Author</h4></div></div><p>Please send bug reports and enhancement
suggestions to
+ on installing the JDE on your system.</p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e284"></a><a
name="ContactingAuthor"></a>Contacting the
Author</h4></div></div><p>Please send bug reports and enhancement
suggestions to
<a href="mailto:pkinnucan@attbi.com">Paul Kinnucan</a>.
- </p></div></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e291"></a><a
name="RegisterSelectJDK"></a>Registering and Selecting a
JDK</h2></div></div><p>The JDEE relies on command-line Java
development tools, such
+ </p></div></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e293"></a><a
name="RegisterSelectJDK"></a>Registering and Selecting a
JDK</h2></div></div><p>The JDEE relies on command-line Java
development tools, such
as those supplied by Sun Microsystems as part of its Java
Software Development Kit (SDK) also known as a Java Development
Kit (JDK). Before you can use the JDEE to compile, debug, or run
@@ -139,7 +139,8 @@
located on the system command path or have different names, you
must tell the JDEE where they are located. The JDEE provides
customization variables for specifying the locations of
- individual tools.</p><p>
+ individual tools.
+ </p><p>
However, if you are using one or more versions of Sun's JDK or a
clone of the Sun JDK, the easiest way to specify the location of
the external development tools is to register the version of the
@@ -148,7 +149,8 @@
JDK. The reason? Registering each version of the JDK allows you
to change JDKs by changing a single customization variable. The
following sections explain how to register and select
- JDKs.</p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e308"></a><a
name="RegisterJDK"></a>Registering a
JDK</h4></div></div><p>To register a version of the JDK with the
JDEE:</p><div class="orderedlist"><ol
type="1"><li><p>Start
Emacs.</p></li><li><p>Type <b>M-x
customize-variable</b> and
+ JDKs.
+ </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e310"></a><a
name="RegisterJDK"></a>Registering a
JDK</h4></div></div><p>To register a version of the JDK with the
JDEE:</p><div class="orderedlist"><ol
type="1"><li><p>Start
Emacs.</p></li><li><p>Type <b>M-x
customize-variable</b> and
press <b>Enter</b></p><p>Emacs prompts you to enter the name
of a variable
to customize.</p></li><li><p>Enter
<tt>jde-jdk-registry</tt> and
press <b>Enter</b>.</p><p>The
<tt>jde-jdk-registry</tt> customization
@@ -156,7 +158,7 @@
in which the JDK is installed.</p></li><li><p>Repeat the
preceding steps until you have entered the versions and
paths of all versions of the JDK that you wish to use with the JDEE.</p><div
class="screenshot"><div class="mediaobject"><img
src="images/regjdk3.gif"></div></div></li><li><p>Click
the <b>State</b> button.</p><p>The <b>State</b> menu
appears.</p></li><li><p>Select <b>Save for Future
Sessions</b> from
the <b>State</b> menu.</p></li><li><p>Click the
<b>Finish</b> button to dismiss
- the customization
buffer.</p></li></ol></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e394"></a><a
name="SelectingJDK"></a>Selecting a
JDK</h4></div></div><p>To select a JDK:</p><div
class="orderedlist"><ol type="1"><li><p>Type
<b>M-x customize-variable</b> and
+ the customization
buffer.</p></li></ol></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e396"></a><a
name="SelectingJDK"></a>Selecting a
JDK</h4></div></div><p>To select a JDK:</p><div
class="orderedlist"><ol type="1"><li><p>Type
<b>M-x customize-variable</b> and
press <b>Enter</b></p><p>Emacs prompts you to enter the name
of a variable
to customize.</p></li><li><p>Enter
<tt>jde-jdk</tt> and
press <b>Enter</b>.</p><p>The <tt>jde-jdk</tt>
customization
@@ -169,7 +171,7 @@
projects. You can configure the JDEE to use different JDKs
for different projects by saving your customization in a
project file. See <a href="#UsingProjectFiles">Using
- Project Files</a> or more
information.</p></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e472"></a><a
name="EditingJavaSourceFiles"></a>Editing Java Source
Files</h2></div></div><p>
+ Project Files</a> or more
information.</p></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e474"></a><a
name="EditingJavaSourceFiles"></a>Editing Java Source
Files</h2></div></div><p>
To edit an existing Java source file, load it into an Emacs
buffer by executing <b>C-x C-f</b>. Loading a Java source file
into a buffer causes the buffer to enter into <tt>jde-mode</tt>,
@@ -182,13 +184,13 @@
menu that <tt>jde-mode</tt> displays on the Emacs menu bar or by
typing the commands in the Emacs minibuffer.
</p><p>
- </p><div class="screenshot"><div
class="mediaobject"><img src="images/jdemenu.gif"
height="350" width="544"
longdesc="ld-d0e505.html"><div class="longdesc-link"
align="right"><br clear="all"><span style="font-size:
8pt;">[<a href="ld-d0e505.html"
target="longdesc">D</a>]</span></div></div></div><p>
- </p></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e511"></a><a
name="DocumentingCode"></a>Documenting
Code</h2></div></div><p>
+ </p><div class="screenshot"><div
class="mediaobject"><img src="images/jdemenu.gif"
height="350" width="544" alt="Screenshot showing the JDE
menu."></div></div><p>
+ </p></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e514"></a><a
name="DocumentingCode"></a>Documenting
Code</h2></div></div><p>
The JDE provides complete support for generating HTML
documentation for Java classes from comments inserted into the
source code for those classes.
</p><p>See also</p><p><a
href="#DisplayingDoc">Displaying Java
- Documentation</a></p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e522"></a><a
name="InsertingComments"></a>Inserting Javadoc
+ Documentation</a></p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e525"></a><a
name="InsertingComments"></a>Inserting Javadoc
Comments</h4></div></div><p>
To insert a skeleton javadoc comment for a class or method,
position point in the first line of the method or class and
@@ -202,7 +204,7 @@
to <a href="mailto:david@dponce.com">David Ponce</a>
for developing the JDE's javadoc comment generation
facility.
- </p></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e547"></a><a
name="GeneratingJavadoc"></a>Generating the
+ </p></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e550"></a><a
name="GeneratingJavadoc"></a>Generating the
Documentation</h4></div></div><p>
To generate documentation for the current project, open any
source file in the project and select Make
@@ -235,11 +237,11 @@
Thanks to <a href="mailto:sakliban@cs.wustl.edu">Sergey A
Klibanov </a> for developing the JDE's javadoc
generation facility.
- </p></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e614"></a><a
name="Abbrevs"></a>Abbreviations</h2></div></div><p>
+ </p></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e617"></a><a
name="Abbrevs"></a>Abbreviations</h2></div></div><p>
The JDEE allows you to use abbreviations for Java keywords and
control flow constructs. The following sections explain how to
use these abbreviations.
- </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e620"></a><a
name="KeywordAbbrevs"></a>Keyword
+ </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e623"></a><a
name="KeywordAbbrevs"></a>Keyword
Abbreviations</h4></div></div><p>The JDEE defines a set of
abbreviations for Java keywords.
When you type one of these abbreviations followed by a space
in a Java source buffer, the JDE optionally expands the
@@ -255,7 +257,7 @@
<tt>jde-mode-abbreviations</tt> in the project
customization buffer.</p><div class="note" style="margin-left:
0.5in; margin-right: 0.5in;"><h3
class="title">Note</h3><p>The JDE's Java keyword expansion
facility is based
on the Emacs <tt>abbrev-mode</tt> facility. For
- more information, see the Emacs user manual.</p></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e654"></a><a
name="ControlFlowAbbrevs"></a>Control Flow
+ more information, see the Emacs user manual.</p></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e657"></a><a
name="ControlFlowAbbrevs"></a>Control Flow
Abbreviations</h4></div></div><p>The JDEE defines abbreviations
for Java control flow
structures, such as if-then-else. When you enter the
abbreviation followed by a space, the JDE expands the
@@ -264,23 +266,23 @@
ife
</pre><p>expands to the control flow structure</p><pre
class="programlisting">
if ( ) { } // end of if () else } // end of if ()else
- </pre></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e671"></a>Control Flow
Abbreviations</h5></div></div><p>The JDE defines the following
abbreviations for control
+ </pre></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e674"></a>Control Flow
Abbreviations</h5></div></div><p>The JDE defines the following
abbreviations for control
structures.</p><div class="table"><p><b>Table 1.
Control Flow Abbreviations</b></p><table summary="Control Flow
Abbreviations"
border="1"><colgroup><col><col></colgroup><thead><tr><th>Statement</th><th>Abbreviation</th></tr></thead><tbody><tr><td><tt>if-then</tt></td><td><tt>if</tt></td></tr><tr><td><tt>else</tt></td><td><tt>else</tt></td></tr><tr><td><tt>if-then-else</tt></td><td><tt>ife</tt></td></tr><tr><td><tt>else-if</tt></td><td><tt>eif</tt></td></tr><tr><td><tt>while</tt></td><td><tt>while</tt></td></tr><tr><td><tt>for</tt></td><td><tt>for</tt></td></tr><tr><td><tt>for
(int
I=0;I<UL;I++)</tt></td><td><tt>fori</tt></td></tr><tr><td><tt>for
(Iterator i = c.iterator();
i.hasNext();)</tt></td><td><tt>foriter</tt></td></tr><tr><td><tt>main
method</tt></td><td><tt>main</tt></td></tr><tr><td><tt>switch</tt></td><td><tt>switch</tt></td></tr><tr><td><tt>case</tt></td><td><tt>case</tt></td></tr><tr><td><tt>try</tt></td><td><tt>try</tt></td></tr><tr><td><tt>catch</tt></td><td><tt>catch</tt></td></tr><tr><td><tt>try
finally</tt></td><td><tt>tryf</tt></td></tr><tr><td><tt>finally</tt></td><td><tt>finally</tt></td></tr></tbody></table></div><div
class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Note</h3><p>
You must enable the JDE's Java keyword abbreviation mode
to use the control flow abbreviations. See <a
href="#JavaKeywordCompletion">Java Keyword
Completion</a> for more information.
- </p></div></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e800"></a>Left Brace
Placement</h5></div></div><p>
+ </p></div></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e803"></a>Left Brace
Placement</h5></div></div><p>
The JDE's Java control flow templates support two options
for opening brace placement: placement on the first line of
the template (Kerningham & Ritchie Style, the default)
and placement on a separate line. Type <b>M-x
customize-variable jde-gen-k&r</b> to specify
the style you prefer.
- </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e808"></a>Customizing the Control Flow
Templates</h5></div></div><p>You can customize the templates to
suit any indentation
+ </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e811"></a>Customizing the Control Flow
Templates</h5></div></div><p>You can customize the templates to
suit any indentation
style. To customize the templates, select
- Project->Options->Autocode from the JDE
menu.</p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e821"></a>Adding Your Own Control Flow
Templates</h5></div></div><p>
+ Project->Options->Autocode from the JDE
menu.</p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e824"></a>Adding Your Own Control Flow
Templates</h5></div></div><p>
Use the <tt>jde-gen-define-abbrev-template</tt>
function to define your own control flow abbreviation in
your <tt>.emacs</tt> file. For example, the
@@ -342,13 +344,13 @@
<tt>'(l foo bar)</tt>, the elements after
<tt>'l</tt> will be inserted according to
the usual rules. This makes it possible to return
- several elements from one
expression.</td></tr></tbody></table></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1020"></a>Enabling Variable
Content</h5></div></div><p>Some templates optionally prompt you
for items to insert
+ several elements from one
expression.</td></tr></tbody></table></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1023"></a>Enabling Variable
Content</h5></div></div><p>Some templates optionally prompt you
for items to insert
into the template. To enable prompting, set the variable
<tt>tempo-interactive</tt> to a
non-<tt>nil</tt> value in your
- <tt>.emacs</tt> file.</p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1034"></a>Disabling the
Control Flow Abbreviations</h5></div></div><p>To disable the
control flow abbreviations, set the
+ <tt>.emacs</tt> file.</p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1037"></a>Disabling the
Control Flow Abbreviations</h5></div></div><p>To disable the
control flow abbreviations, set the
variable <tt>jde-gen-cflow-enable</tt> off.</p><div
class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Thanks to...</h3><p>Thanks
to Eric D. Friedman &gt;friedman(a)lmi.net&lt;
- for contributing the control flow
templates.</p></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e1047"></a><a
name="CodeCompletion"></a>Completing
Expressions</h2></div></div><p>
+ for contributing the control flow
templates.</p></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e1050"></a><a
name="CodeCompletion"></a>Completing
Expressions</h2></div></div><p>
Both Emacs and the JDEE provide commands for completing incomplete
expressions. Emacs provides commands that work for any expression
but only if the completions exist in an open buffer. The JDEE
@@ -357,7 +359,7 @@
The following sections explain how to use completion facilities
supplied by the JDEE and by Emacs itself.
- </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e1056"></a><a
name="FieldAndMethodCompletion"></a>Completing Method
+ </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e1059"></a><a
name="FieldAndMethodCompletion"></a>Completing Method
and Field Names</h4></div></div><p>
The JDEE provides comamnds that can complete an incomplete
field or method name. All the methods determine the set of
@@ -400,7 +402,9 @@
noticeable delay in completion the first time it is used in a
session. The response can also be slow for classes containing
many methods and fields.
- </p><p>
+ </p><div class="note" style="margin-left: 0.5in;
margin-right: 0.5in;"><h3
class="title">Note</h3><p>See <a
href="#SpeedingUpCompletion">Speeding Up Completion</a>
+ for some tips on how you can dramatically speed up field and
+ method completion.</p></div><p>
Completion works only for compiled classes that reside in the
classpath defined by <tt>jde-global-classpath</tt>,
if set, otherwise by the <tt>CLASSPATH</tt>
@@ -443,7 +447,7 @@
For example, this command completes
</p><pre class="programlisting">
void setColor(String color) { color.get ^ }
- </pre></li></ul></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1175"></a><a
name="SelectStdCompletionMethod"></a> Selecting a
+ </pre></li></ul></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1184"></a><a
name="SelectStdCompletionMethod"></a> Selecting a
Completion Method</h5></div></div><p>The JDEE's generic
completion command,
<b>jde-complete</b> delegates completion to one
of several specific completion commands supplied by the JDEE
@@ -458,7 +462,7 @@
(<tt>ignore</tt> by default.).
</p></li><li><p>Save your selection in your
<tt>.emacs</tt> or project file.
- </p></li></ol></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1218"></a><a
name="MenuCompletion"></a>Using Menu-Based
+ </p></li></ol></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1227"></a><a
name="MenuCompletion"></a>Using Menu-Based
Completion</h5></div></div><p>The
<b>jde-complete-menu</b> displays a
popup menu of completions for the method or field name at
point. Selecting a completion from the menu causes the
@@ -467,9 +471,8 @@
<b>jde-complete-menu</b> as your standard
completion command.
</p><p>To select completions from a menu:</p><div
class="orderedlist"><ol type="1"><li><p>Position
point immediately following the partially
- complete field or method name.</p><div
class="screenshot"><div class="mediaobject"><img
src="./images/completion_menu1.gif"></div></div></li><li><p>Type
the <b>C-c C-v
- C-.</b> key combination.</p><p>A menu of
completions pops up.</p><div class="screenshot"><div
class="mediaobject"><img
src="./images/completion_menu2.gif"></div></div></li><li><p>Select
the desired completion from the menu.</p><p>The JDEE inserts the completion at
point in the
- buffer.</p><div class="screenshot"><div
class="mediaobject"><img
src="./images/completion_menu3.gif"></div></div></li></ol></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1261"></a><a
name="InLineCompletion"></a>Using In-Line
+ complete field or method name.</p><div
class="screenshot"><div class="mediaobject"><img
src="./images/completion_menu1.gif"></div></div></li><li><p>Type
the <b>C-c C-v C-.</b> key combination.</p><p>A menu of
completions pops up.</p><div class="screenshot"><div
class="mediaobject"><img
src="./images/completion_menu2.gif"></div></div></li><li><p>Select
the desired completion from the menu.</p><p>The JDEE inserts the completion at
point in the
+ buffer.</p><div class="screenshot"><div
class="mediaobject"><img
src="./images/completion_menu3.gif"></div></div></li></ol></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1270"></a><a
name="InLineCompletion"></a>Using In-Line
Completion</h5></div></div><p>
The <b>jde-complete-in-line</b> command allows
you to select completions at the point of insertion in the
@@ -486,7 +489,7 @@
combination to invoke the command or <b>C-c C-v
C-.</b>, if you have selected this command as your
preferred completion method. The following examples use the
- <b>C-c C-v .</b> combination.
+ <b>C-c C-v .</b> combination.
</p><div class="example"><p><b>Example 1. Completing a
String Method Name</b></p><p>
Typing
C-c-C-v-.
@@ -500,7 +503,25 @@
</pre><p>in the minibuffer. Repeatedly typing
C-c-C-v-.
cycles through all the other get methods for the Java
- <tt>String</tt>
class.</p></div></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e1320"></a><a
name="DynamicKeywordCompletion"></a>Dynamic Keyword
Completion</h4></div></div><p>Emacs provides dynamic completion
commands that attempt
+ <tt>String</tt> class.</p></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1329"></a><a
name="SpeedingUpCompletion"></a>Speeding Up
Completion</h5></div></div><p>Here are two ways you can
significantly speed up field
+ and method completion:
+ </p><div class="itemizedlist"><ul
type="disc"><li><p>Byte-compile the eieio and JDEE
packages.</p><p>The beanshell package, the Emacs interface to the
+ BeanShell, is based on the eieio object-oriented Lisp
+ package for Emacs. Completion uses the BeanShell heavily
+ to determine the class of the field or method at point.
+ Thus compiling eieio and beanshell.el improves
+ completion's performance, dramatically in my tests.
+ </p></li><li><p>Import by class, not by package, in your
Java files.
+ </p><p>Every package import, e.g.,
+ <tt>java.util.*</tt>, requires invoking the
+ BeanShell to determine the fully qualified name of the
+ class at point (see
+ <tt>jde-parse-get-qualified-name</tt>).
+ A Beanshell invocation is by far the most time-consuming
+ operation required for completion. Thus eliminating the
+ use of package-level imports can significantly
+ speed up completion.
+ </p></li></ul></div></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e1352"></a><a
name="DynamicKeywordCompletion"></a>Dynamic Keyword
Completion</h4></div></div><p>Emacs provides dynamic completion
commands that attempt
to find completions for the word at point in the current
buffer or other buffers.
</p><div class="example"><p><b>Example 2. Using
Dynamic Completion</b></p><p>
@@ -518,7 +539,7 @@
<tt>Container</tt>. In this way, you can cycle
through all the possible completions for
<tt>Co</tt> in the current buffer.
- </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1369"></a>Dynamic Completion
Commands</h5></div></div><p>Emacs provides two dynamic completion
commands.</p><p>
+ </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1401"></a>Dynamic Completion
Commands</h5></div></div><p>Emacs provides two dynamic completion
commands.</p><p>
The <b>dabbrev-expand</b> command is bound to
the key combination
<b>M</b>-<b>/</b>
@@ -531,7 +552,7 @@
The <b>hippie-expand</b> command provides more
extensive search capabilities. See the docstrings for these
functions for more information.
- </p></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e1390"></a><a
name="GeneratingCode"></a>Generating
Code</h2></div></div><p>The JDE provides the following code
generation capabilities.</p><div class="itemizedlist"><ul
type="disc"><li><p>Code
wizards</p></li><li><p>Code
templates</p></li></ul></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e1403"></a><a
name="CodeWizards"></a>Code
Wizards</h4></div></div><p>
+ </p></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e1422"></a><a
name="GeneratingCode"></a>Generating
Code</h2></div></div><p>The JDE provides the following code
generation capabilities.</p><div class="itemizedlist"><ul
type="disc"><li><p>Code
wizards</p></li><li><p>Code
templates</p></li></ul></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e1435"></a><a
name="CodeWizards"></a>Code
Wizards</h4></div></div><p>
The JDE provides a set of procedural code generators called
code wizards. They include:
</p><div class="table"><p><b>Table 1. Code
Wizards</b></p><table summary="Code Wizards"
border="1"><colgroup><col><col></colgroup><thead><tr><th><p>Wizard</p></th><th><p>Generates...</p></th></tr></thead><tbody><tr><td><p><a
href="#ImportWizard">Import
@@ -551,7 +572,7 @@
wizard starts the Beanshell interpreter if it is not already
running. Thus, you may experience a slight delay when
invoking a wizard for the first time in a session.
- </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1473"></a><a
name="ImportWizard"></a>Import
Wizard</h5></div></div><p>
+ </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1505"></a><a
name="ImportWizard"></a>Import
Wizard</h5></div></div><p>
The import wizard generates an import statement for the
class name at point if an import statement does not already
exist for that class. The wizard generates the import
@@ -579,7 +600,9 @@
the import wizard finds any classes on the classpath that
belong to the list of prohibited packages, it removes them
from the list of classes considered for import.
- </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1510"></a><a
name="MethodOverrideWizard"></a>Method Override
+ </p><div class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Thanks to ...</h3><p><a
href="mailto:trigg@cs.waikato.ac.nz">Len
+ Trigg</a> for contributing the initial
+ implementation of the import wizard.</p></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1549"></a><a
name="MethodOverrideWizard"></a>Method Override
Wizard</h5></div></div><p>
The method override wizard generates a skeleton method that
overrides a similarly named method defined by a superclass.
@@ -596,8 +619,7 @@
Wizards->Override
Method from the
JDE menu or enter
- <b>M</b>-<b>x</b>
- <tt>jde-wiz-overrided-method</tt>.
+ <b>M</b>-<b>x</b>
<tt>jde-wiz-overrided-method</tt>.
</p><p>
</p><div class="screenshot"><div
class="mediaobject"><img src="images/OverrideMeth2.gif"
alt="Screen shot showing
 Wizards
menu."></div></div><p>
</p><p>
@@ -655,7 +677,7 @@
BeanShell. Thus, if the BeanShell is not already
running, you may experience a short pause the first
time you override a method.
- </p></div></li></ol></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1636"></a><a
name="InterfaceWizard"></a>Interface
Wizard</h5></div></div><p>
+ </p></div></li></ol></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1675"></a><a
name="InterfaceWizard"></a>Interface
Wizard</h5></div></div><p>
This wizard creates a skeleton implementation of any
interface defined on the classpath specified by
<tt>jde-global-classpath</tt>.
@@ -670,7 +692,7 @@
Select
JDE->Wizards->Implement Interface or enter
<b>M</b>-<b>x
- </b> <tt>jde-wiz-implement-interface</tt>.
+ </b><tt>jde-wiz-implement-interface</tt>.
@@ -693,7 +715,11 @@
interface implementation. If the BeanShell is not
currently running, it starts the BeanShell. Thus, if the
BeanShell is not already running, you may experience a
- short pause the first time you use the wizard.
</p></div></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1687"></a><a
name="DelegateWizard"></a>Delegate
Wizard</h5></div></div><p>
+ short pause the first time you use the wizard. </p></div><div
class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Thanks to ...</h3><p><a
href="mailto:friedman@lmi.net">Eric
+ Friedman</a> for creating the framework for the
+ interface, method override, and abstract class wizards and
+ for contributing the initial implementation of the
+ interface wizard.</p></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1732"></a><a
name="DelegateWizard"></a>Delegate
Wizard</h5></div></div><p>
This wizard generates methods that delegate calls to a class
in the current buffer to an attribute of the class, i.e., to
an object that is a field of the current class. For example,
@@ -707,7 +733,7 @@
</p><div class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Thanks to...</h3><p>
<a href="mailto:cfhart@Z-TEL.com">Charles Hart</a>
for contributing this wizard.
- </p></div></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1722"></a><a
name="GetSetWizard"></a>Get/Set
Wizard</h5></div></div><p>
+ </p></div></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1767"></a><a
name="GetSetWizard"></a>Get/Set
Wizard</h5></div></div><p>
This wizard generates get and set methods for the private
fields of the class at point, but only if the fields do not
already have get or set methods. To generate the methods,
@@ -715,13 +741,13 @@
and set methods to appear. Then select
JDE->Code
Generation->Wizards->Generate Get/Set Methods... or enter
- <b>M</b>-<b>x </b>
+ <b>M</b>-<b>x </b>
<tt>jde-wiz-get-set-methods</tt>
</p><div class="note" style="margin-left: 0.5in; margin-right:
0.5in;"><h3 class="title">Thanks to...</h3><p>
<a href="mailto:jslopez@forumsys.com">Javier
Lopez</a> and <a
href="mailto:sandip.chitale@brokat.com">Sandip
Chitale</a> for contributing this wizard.
- </p></div></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e1758"></a><a
name="CodeTemplates"></a>Code
Templates</h4></div></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1762"></a><a
name="BufferTemplates"></a>Buffer
Templates</h5></div></div><p>These commands create buffers
containing a skeleton Java class.
+ </p></div></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e1803"></a><a
name="CodeTemplates"></a>Code
Templates</h4></div></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e1807"></a><a
name="BufferTemplates"></a>Buffer
Templates</h5></div></div><p>These commands create buffers
containing a skeleton Java class.
Each command prompts you to enter the path to a new Java source
file. They then create a buffer for the new file and insert a
template for a class of the same name as the newly created file.
@@ -739,7 +765,7 @@
(<b>C</b>-<b>x</b> f) and
entering the path for a new file whose root name is the same as
the class you want to create and whose extension is <tt>.java.</tt>
- </p><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e1822"></a>Specifying Boilerplate
Text</h6></div></div><p>
+ </p><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e1867"></a>Specifying Boilerplate
Text</h6></div></div><p>
You can specify boilerplate text (for example, a copyright
notice) to be inserted at the head of class source files
created by the JDE. The JDE provides two ways to specify
@@ -760,7 +786,7 @@
By saving the values of boilerplate variables in project
files, you can specify different boilerplate text for each
project.
- </p></div><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e1839"></a>Customization
Variables</h6></div></div><p>The following JDE customization
variables control creation of
+ </p></div><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e1884"></a>Customization
Variables</h6></div></div><p>The following JDE customization
variables control creation of
autocoded Java source buffers:
</p><div class="table"><p><b>Table 2.
</b></p><table summary=""
border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Variable</th><th>Group</th><th>Usage</th></tr></thead><tbody><tr><td><tt>jde-gen-class-buffer-template</tt></td><td>Autocode</td><td>Template
for a generic public class
buffer.</td></tr><tr><td><tt>jde-gen-console-buffer-template</tt></td><td>Autocode</td><td>Template
for a console application
buffer.</td></tr><tr><td><tt>jde-gen-jfc-app-buffer-template</tt></td><td>Autocode</td><td>Template
for a JFC (Swing)
application.</td></tr><tr><td><tt>jde-gen-junit-test-class-buffer-template</tt></td><td>Autocode</td><td>Template
for a JUnit test case class. This template requires
the <a href="http://www.junit.org">JUnit</a> test
framework.</td></tr><tr><td><tt>jde-gen-buffer-templates</tt></td><td>Autocode</td><td>Specifies
templates available to create
@@ -771,7 +797,7 @@
the value of
<tt>jde-gen-buffer-boilerplate</tt>.</td></tr></tbody></table></div><p>
See <a href="#CustomizingTemplates">Customizing
Templates</a> for information on how to customize
- the class creation templates. </p></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1929"></a><a
name="PointTemplates"></a>Point
Templates</h5></div></div><p>The following commands insert
templates at the current
+ the class creation templates. </p></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e1974"></a><a
name="PointTemplates"></a>Point
Templates</h5></div></div><p>The following commands insert
templates at the current
point in the buffer: </p><div class="itemizedlist"><ul
type="disc"><li><p>
JDE->Generate->Get/Set Pair
generates an instance variable and a get and set method .
@@ -811,7 +837,7 @@
<a href="#CreatingTemplates">Creating
Templates</a> for information on how to create
templates from scratch.
- </p></li></ul></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e2089"></a><a
name="CustomizingTemplates"></a>Customizing
+ </p></li></ul></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e2134"></a><a
name="CustomizingTemplates"></a>Customizing
Templates</h5></div></div><p>You can customize the JDE's
standard code templates,
using the Emacs customization feature. </p><p>To customize an autocode
template: </p><div class="orderedlist"><ol
type="1"><li><p>Select
JDE->Options->Autocode</p><p>The JDE displays a customization
buffer containing
the autocode templates. </p></li><li><p>Edit the template
to suit your needs.</p><p>The JDE uses the template format defined by
@@ -834,7 +860,7 @@
Session. Then select
JDE->Options->Save Project
to save your changes in the current project's project
- file.</p></li></ol></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e2150"></a><a
name="CreatingTemplates"></a>Creating
Templates</h5></div></div><p>The JDE considers any command
(interactive function) that
+ file.</p></li></ol></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e2195"></a><a
name="CreatingTemplates"></a>Creating
Templates</h5></div></div><p>The JDE considers any command
(interactive function) that
inserts code into a buffer at point to be a template. The JDE
uses the Emacs tempo library to create built-in templates.
You can use tempo to create your own, add-on templates (see below
@@ -858,7 +884,7 @@
sections for more information: </p><div
class="itemizedlist"><ul type="disc"><li><p><a
href="#DefiningTemplate">Defining a Template and
Template Insertion Function</a></p></li><li><p><a
href="#RegisterTemplate">Registering Custom
Templates</a></p></li><li><p><a
href="#AssignKeyToTemplate">Assigning Keys To
- emplates</a></p></li></ul></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e2194"></a><a
name="DefiningTemplate"></a>Defining a Template
+ emplates</a></p></li></ul></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e2239"></a><a
name="DefiningTemplate"></a>Defining a Template
and Template Insertion Function</h6></div></div><p>The
<tt>tempo-define-template</tt> macro
enables you to define a template and a function that
inserts that template at the current point in the current
@@ -919,7 +945,7 @@
<tt>tempo-define-template</tt> (type
<b>c</b>-<b>h</b> f
<tt>tempo-define-template</tt>) for more
- information on creating templates. </p></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e2272"></a><a
name="RegisterTemplate"></a>Registering Custom
+ information on creating templates. </p></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e2317"></a><a
name="RegisterTemplate"></a>Registering Custom
Templates</h6></div></div><p>You can register templates that
you create with the
JDE. When you register a template with the JDE, it appears
among the list of templates that you can select when you
@@ -942,7 +968,7 @@
list of templates in a completion buffer: </p><p>
</p><div class="screenshot"><div
class="mediaobject"><img src="images/TemplateList.gif"
alt="Screenshot showing template
completion
 buffer."></div></div><p>
</p><p>Select the template you want by double-clicking
- its name.</p></li></ol></div></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e2353"></a><a
name="AssignKeyToTemplate"></a>Assigning Keys to
+ its name.</p></li></ol></div></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e2398"></a><a
name="AssignKeyToTemplate"></a>Assigning Keys to
Templates</h6></div></div><p>You can assign templates to
keyboard keys to speed use
of frequently used templates. For example, insert this
form </p><pre class="programlisting">
@@ -950,14 +976,14 @@
</pre><p>in your <tt>.emacs</tt> file to assign the
<b>F9</b> function key to the JDE template that
generates a skeleton <tt>toString</tt> method.
- </p></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e2372"></a><a
name="CheckStyle"></a>Checking Coding
Style</h2></div></div><p>The JDE->Check Style command (M-x
<b>jde-checkstyle</b>) command checks
+ </p></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e2417"></a><a
name="CheckStyle"></a>Checking Coding
Style</h2></div></div><p>The JDE->Check Style command (M-x
<b>jde-checkstyle</b>) command checks
the current buffer for conformity to a Java coding standard. The
default standard is that specified by Sun Microsystems. Execute
<b>jde-checkstyle-customize</b> to customize the
command to support your own coding standard.
</p><p>The command displays a list of stylistic faults in a popup
buffer. Click the error message to display the line that violates
- the standard.</p></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e2398"></a><a
name="CompilingJavaPrograms"></a>Compiling Java
Programs</h2></div></div><p>To compile the source file in the
current buffer, select
+ the standard.</p></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e2443"></a><a
name="CompilingJavaPrograms"></a>Compiling Java
Programs</h2></div></div><p>To compile the source file in the
current buffer, select
JDE->Compile, type
<b>C</b>-<b>c</b>-<b>C</b>-<b>v</b>-<b>C</b>-<b>c</b>,
or execute <b>M-x jde-compile</b>. The compiler uses
@@ -967,7 +993,7 @@
compiler for the current project or all projects (see <a
href="#SpecifyingCompiler">Specifying a Compiler</a>). The
JDEE also allows you to configure the JDEE to invoke the
compiler with various <a href="#CompilationOptions">compilation
options</a>.
- </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e2439"></a><a
name="CompileBuffer"></a>Compilation
Buffer</h4></div></div><p>
+ </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e2484"></a><a
name="CompileBuffer"></a>Compilation
Buffer</h4></div></div><p>
The compile command displays the output of the compiler in a
separate compilation buffer.
</p><div class="screenshot"><div
class="mediaobject"><img src="images/compile_buffer.gif"
alt="Image showing compilation buffer with

errors."></div></div><p>
@@ -979,7 +1005,7 @@
in the Java source code. For example, to find the line that
cause a compilation error, simply click the error message in
the compilation buffer.
- </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e2457"></a><a
name="SpecifyingCompiler"></a>Specifying a
Compiler</h4></div></div><p>The JDEE supports the following Java
compilers.</p><div class="itemizedlist"><ul
type="disc"><li><p><tt>javac</tt></p><p>
+ </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e2502"></a><a
name="SpecifyingCompiler"></a>Specifying a
Compiler</h4></div></div><p>The JDEE supports the following Java
compilers.</p><div class="itemizedlist"><ul
type="disc"><li><p><tt>javac</tt></p><p>
This is the compiler that comes with Sun's JDK and the
JDK's clones. Note that <tt>javac</tt>
compiler is itself implemented in Java. The
@@ -1020,7 +1046,7 @@
customization buffer.</p></li><li><p>If you want the selection
to apply to the current
project, select <b>Project->Project
File->Save</b> from the <b>JDE</b>
- menu.</p></li></ol></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e2559"></a><a
name="CompilationOptions"></a>Compilation
Options</h4></div></div><p>The JDEE allows you to specify
compilation options by
+ menu.</p></li></ol></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e2604"></a><a
name="CompilationOptions"></a>Compilation
Options</h4></div></div><p>The JDEE allows you to specify
compilation options by
setting compilation variables. You must use the Emacs
customization feature. To use the customization feature,
select JDE->Options->Compile. (See
@@ -1029,7 +1055,7 @@
the compilation settings in the project file
(see <a href="#UsingProjectFiles">Using Project Files</a>)
for the current source buffer, select JDE->Options->Update Project.
- </p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e2587"></a><a
name="SetCompileOptionsInteractively"></a> Setting
+ </p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e2632"></a><a
name="SetCompileOptionsInteractively"></a> Setting
Compile Options Interactively</h5></div></div><p>If you set
the customization variable
<tt>jde-read-compile-args</tt> to a
non-<tt>nil</tt> value, the JDEE compile command
@@ -1050,7 +1076,7 @@
as that specified by <tt>javac</tt> or jikes,
you must use the variable
<tt>jde-compile-option-command-line-args</tt> to
- select the option.</p></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e2614"></a><a
name="CompilerCustomizationVariables"></a>
+ select the option.</p></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e2659"></a><a
name="CompilerCustomizationVariables"></a>
Compiler Customization Variables</h5></div></div><p>The
following table lists the JDEE compilation variables and
the functions used to set them.</p><div
class="table"><p><b>Table 1. </b></p><table
summary="" border="1"><colgroup><col
align="left"><col align="left"><col
align="left"></colgroup><thead><tr><th
align="left"><p>Name</p></th><th
align="left"><p>Group</p></th><th
align="left"><p>Usage</p></th></tr></thead><tbody
valign="top"><tr><td
align="left"><p><tt>jde-compiler</tt></p></td><td
align="left">Project</td><td
align="left"><p>Specifies the compiler (javac server, by default)
to use to compile the code in the current source buffer.
@@ -1074,12 +1100,12 @@
file encoding name, such as
EUCJIS\SJIS. </td></tr><tr><td
align="left"><tt>jde-compile-option-target</tt></td><td
align="left">Compile</td><td align="left">Generate code
compatible with a
specified vm version.</td></tr><tr><td
align="left"><tt>jde-compile-option-bootclasspath</tt></td><td
align="left">Compile</td><td align="left">Specify
classpath of standard
libraries for target vm.</td></tr><tr><td
align="left"><tt>jde-compile-option-bootclasspath</tt></td><td
align="left">Compile</td><td align="left">Specify path
of directories
- containing extensions for target
vm.</td></tr></tbody></table></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e2814"></a><a
name="BuildingJavaApplications"></a>Building Java
Applications</h2></div></div><p>The JDE->Build
+ containing extensions for target
vm.</td></tr></tbody></table></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e2859"></a><a
name="BuildingJavaApplications"></a>Building Java
Applications</h2></div></div><p>The JDE->Build
command builds an application. By default this command invokes the
Unix-style make utility to build the application. You can configure
the build command to invoke the Ant build system or a custom build
function.
- </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e2826"></a><a
name="SelectBuildMethod"></a>Selecting a Build
Method</h4></div></div><p>To select a build
method:</p><div class="orderedlist"><ol
type="1"><li><p>Type <b>M-x customize-variable</b>
and
+ </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e2871"></a><a
name="SelectBuildMethod"></a>Selecting a Build
Method</h4></div></div><p>To select a build
method:</p><div class="orderedlist"><ol
type="1"><li><p>Type <b>M-x customize-variable</b>
and
press <b>Enter</b></p><p>Emacs prompts you to enter the name
of a variable
to customize.</p></li><li><p>Enter
<tt>jde-build-function</tt> and
press <b>Enter</b>.</p><p>The
<tt>jde-build-function</tt> customization
@@ -1090,7 +1116,7 @@
customization buffer.</p></li><li><p>If you want the selection
to apply to the current
project, select <b>Project->Project
File->Save</b> from the <b>JDE</b>
- menu.</p></li></ol></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e2891"></a><a
name="BuildWithMake"></a>Building with
Make</h4></div></div><p>
+ menu.</p></li></ol></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e2936"></a><a
name="BuildWithMake"></a>Building with
Make</h4></div></div><p>
The <b>jde-make</b> command uses a make utility,
such as GNU make, to rebuild a project. You must supply the
makefiles used to build your projects. See <a
href="#SampleMakefile">Sample Makefile</a> for an example
@@ -1102,7 +1128,7 @@
JMaker recursively creates makefiles for all the Java packages
in a project plus a toplevel makefile that invokes the other
makefiles to build the entire project.
- </p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e2906"></a><a name="MakeOptions"></a>Make
Options</h5></div></div><p>
+ </p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e2951"></a><a name="MakeOptions"></a>Make
Options</h5></div></div><p>
The following customization variables allow you to specify
various <b>jde-make</b> options:
</p><div class="table"><p><b>Table 1.
</b></p><table summary=""
border="1"><colgroup><col align="left"><col
align="left"><col align="left"><col
align="left"></colgroup><thead><tr><th
align="left">Name</th><th
align="left">Group</th><th
align="left">Default</th><th
align="left">Usage</th></tr></thead><tbody><tr><td
align="left"
valign="top"><tt>jde-make-program</tt></td><td
align="left" valign="top">Project</td><td
align="left">make</td><td
align="left"><p>Specifies the pathname on your system of the
@@ -1118,7 +1144,7 @@
<tt>jde-make-args</tt> to the make
utility. </p></td></tr><tr><td align="left"
valign="top"><tt>jde-make-working-directory</tt></td><td
align="left" valign="top">Project</td><td
align="left"> </td><td align="left"><p>
Specifies the directory from which
<b>jde-make</b> runs the make utility.
-
</p></td></tr></tbody></table></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e2994"></a><a
name="SampleMakefile"></a>Sample
Makefile</h5></div></div><p>The following is a sample makefile
that you can use as a
+
</p></td></tr></tbody></table></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e3039"></a><a
name="SampleMakefile"></a>Sample
Makefile</h5></div></div><p>The following is a sample makefile
that you can use as a
model for creating makefiles to build Java projects. </p><pre
class="programlisting">
JDK = d:/jdk1.2/lib/classes.zip
JMATH = d:/jmath/src
@@ -1142,7 +1168,7 @@
# Implicit rule for making Java class files from Java
# source files.
.java.class: $(COMPILER) $(COPTIONS) -classpath "$(CLASSPATH)" $?
- </pre></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3002"></a><a
name="BuildWithAnt"></a>Building with
Ant</h4></div></div><p>
+ </pre></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3047"></a><a
name="BuildWithAnt"></a>Building with
Ant</h4></div></div><p>
The <b>jde-ant-build</b> command uses the <a
href="http://jakarta.apache.org/ant/">Apache Ant</a>
build tool to build a Java project.
</p><p>The following variables allow you to control the build
@@ -1189,7 +1215,7 @@
Ant build files.</p></td></tr><tr><td
align="left"
valign="top"><tt>jde-ant-build-hook</tt></td><td
align="left" valign="top">Ant</td><td
align="left"><p>nil</p></td><td
align="left"><p>List of hook functions run by
<b>jde-ant-build</b> (see
<tt>run-hooks</tt> in the Emacs
- documentation for more
information).</p></td></tr></tbody></table></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e3248"></a><a
name="RunningJavaApps"></a>Running Java
+ documentation for more
information).</p></td></tr></tbody></table></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e3293"></a><a
name="RunningJavaApps"></a>Running Java
Applications</h2></div></div><p>The JDE allows you to run a
Java application as an Emacs
subprocess. You can run multiple applications concurrently, but
only one instance of each application at a time. The JDE
@@ -1203,7 +1229,7 @@
enter </p><pre class="programlisting">
M-x jde-run
</pre><p>or select Java->Run App from the Emacs
- menubar or type
<b>C</b>-<b>c</b> <b>C</b>-<b>v</b> <b>C</b>-<b>r</b>.
</p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3291"></a><a
name="SpecifyingMainClass"></a>Specifying the
+ menubar or type
<b>C</b>-<b>c</b> <b>C</b>-<b>v</b> <b>C</b>-<b>r</b>.
</p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3336"></a><a
name="SpecifyingMainClass"></a>Specifying the
Application's Main Class</h4></div></div><p>The term
<span class="emphasis"><i>main class</i></span> refers
to the
class that contains the application's main method. The JDE's
Run App command assumes by default that the class in the
@@ -1216,10 +1242,11 @@
<span class="emphasis"><i>fully qualified
name</i></span> of the application's
main class.</p><p>You can temporarily override the setting of
<tt>jde-run-application-class</tt> by typing
- <tt>C-u</tt> before executing the <b>jde-run</b> command, for
example, by
- typing <tt>C-u C-c C-r</tt>. This causes the JDE to
+ <tt>C-u -</tt> before executing the <b>jde-run</b> command, for
example, by
+ typing <tt>C-u - C-c C-r</tt>. This causes the JDE to
prompt you to enter the <span class="emphasis"><i>fully qualified
- name</i></span> of the application's main
class.</p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3323"></a><a
name="SpecifyingStartupDirectory"></a>Specifying a
+ name</i></span> of the application's main class (as well
+ application arguments if any).</p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3368"></a><a
name="SpecifyingStartupDirectory"></a>Specifying a
Startup Directory</h4></div></div><p>The JDE can start an
application from any directory that
you specify. By default, the JDE starts an application from
the default directory of the current source buffer. The
@@ -1245,7 +1272,7 @@
project has a project file. To save the new settings in
your project file, switch to a source buffer and choose
JDE->Options->Save
- Project.</p></li></ol></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3405"></a><a
name="RunVMArgs"></a> Setting VM Command-Line
+ Project.</p></li></ol></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3450"></a><a
name="RunVMArgs"></a> Setting VM Command-Line
Arguments</h4></div></div><p>If you set the customization
variable
<tt>jde-run-read-vm-args</tt> to a
non-<tt>nil</tt> value, the JDE compile command
@@ -1254,26 +1281,31 @@
options specified via customization variables. The JDE saves
the arguments that you enter in a minibuffer history list.
You can recall previously entered options by pressing the up
- or down arrows on your keyboard. </p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3417"></a><a
name="RunAppArgs"></a> Setting Command-Line
- Application Arguments</h4></div></div><p>If you set the
customization variable
- <tt>jde-run-read-app-args</tt> to a
- non-<tt>nil</tt> value, the JDE compile command
- prompts you to enter command-line application arguments in the
- minibuffer. It appends the options that you enter to the
+ or down arrows on your keyboard. </p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3462"></a><a
name="RunAppArgs"></a> Setting Command-Line
+ Application Arguments</h4></div></div><p>Specifying a prefix
argument before the
+ <b>jde-run</b>, e.g., <tt>C-u C-c C-v
+ C-r</tt> causes the command to prompt you to enter
+ arguments to be passed to the application's main
+ method. The command appends the options that you enter to the
arguments specified via the customization variable
<tt>jde-run-option-application-args</tt>. The JDE
saves the arguments that you enter in a minibuffer history
list. You can recall previously entered options by pressing
- the up or down arrows on your keyboard. </p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3432"></a><a
name="NavigatingExceptionTraces"></a>Navigating
+ the up or down arrows on your keyboard. </p><p>If you set the customization
variable
+ <tt>jde-run-read-app-args</tt> to a
+ non-<tt>nil</tt> value, the JDE run command
+ prompts you to enter command-line application arguments
+ by default, i.e., you do not have to specify a prefix
+ argument each time you execute the command.</p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3485"></a><a
name="NavigatingExceptionTraces"></a>Navigating
Exception Traces</h4></div></div><p>If an exception occurs while
your program is running, the
Java vm outputs an exception trace. This trace appears in the
run buffer for the application.</p><p>
- </p><div class="screenshot"><div
class="mediaobject"><img src="images/excepttrace.gif"
longdesc="ld-d0e3441.html"><div class="longdesc-link"
align="right"><br clear="all"><span style="font-size:
8pt;">[<a href="ld-d0e3441.html"
target="longdesc">D</a>]</span></div></div></div><p>
+ </p><div class="screenshot"><div
class="mediaobject"><img src="images/excepttrace.gif"
alt="Screenshot showing an exception trace in the
 JDE's run
buffer."></div></div><p>
</p></div><p>To view the source line corresponding to a point in
the
exception stack trace, right-click the corresponding stack trace
line in the run buffer. You can move up and down the stack trace
by typing the key combinations <tt>C-c C-v C-[</tt> or
- <tt>C-c C-v C-]</tt>.</p><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3455"></a><a
name="RunOptions"></a>Run Customization Variables
+ <tt>C-c C-v C-]</tt>.</p><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3509"></a><a
name="RunOptions"></a>Run Customization Variables
</h4></div></div><p>The JDE allows you to specify run-time
options by setting
run variables.You can use the Emacs customization feature to
set run-time variables interactively. To use the customization
@@ -1317,8 +1349,8 @@
variable. </td></tr><tr><td
valign="top"><tt>jde-run-option-application-args</tt></td><td
valign="top">Run </td><td valign="top">Specify
command-line arguments to
pass to the application. The command
<tt>jde-run-set-app-args </tt>sets the
- buffer-local value of this
variable. </td></tr></tbody></table></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e3677"></a><a
name="WorkingWithApplets"></a> Working with
Applets</h2></div></div><p>The JDE provides specialized commands
for running and
- debugging applets.</p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3683"></a><a
name="RunningApplets"></a>Running
Applets</h4></div></div><p>To run an applet:</p><div
class="procedure"><p><b>Procedure 1. </b></p><ol
type="1"><li><p>Open the applet's source file in a buffer.
</p></li><li><p>Choose JDE->Run
+ buffer-local value of this
variable. </td></tr></tbody></table></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e3731"></a><a
name="WorkingWithApplets"></a> Working with
Applets</h2></div></div><p>The JDE provides specialized commands
for running and
+ debugging applets.</p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3737"></a><a
name="RunningApplets"></a>Running
Applets</h4></div></div><p>To run an applet:</p><div
class="procedure"><p><b>Procedure 1. </b></p><ol
type="1"><li><p>Open the applet's source file in a buffer.
</p></li><li><p>Choose JDE->Run
Applet. </p><p>The JDE searches for an html file in the directory
containing the applet source file and displays the first
file it finds, using your system's default browser. If
@@ -1345,7 +1377,7 @@
applet doc in your system's default browser. Otherwise, the
menu command uses comint to launch the viewer (e.g.,
appletviewer) specified by
- <tt>jde-run-applet-viewer</tt>.</p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3744"></a><a
name="DebuggingApplets"></a>Debugging
Applets</h4></div></div><p>To debug an applet:</p><div
class="procedure"><p><b>Procedure 2. </b></p><ol
type="1"><li><p>Open the applet's source file in a
buffer.</p></li><li><p>Choose JDE->Debug
+ <tt>jde-run-applet-viewer</tt>.</p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3798"></a><a
name="DebuggingApplets"></a>Debugging
Applets</h4></div></div><p>To debug an applet:</p><div
class="procedure"><p><b>Procedure 2. </b></p><ol
type="1"><li><p>Open the applet's source file in a
buffer.</p></li><li><p>Choose JDE->Debug
Applet.</p><p>The JDE searches for an html file in the directory
containing the applet source file. If the JDE cannot find
an html page in the applet's source file directory, it
@@ -1359,7 +1391,7 @@
information.</p><p>If you want to specify the document to be used to test
the
applet, customize the variable jde-run-applet-doc or execute
<tt>M-x jde-db-applet</tt>. This command prompts you
- to enter the test document's name.</p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3777"></a><a
name="AppletOptions"></a>Applet Customization
+ to enter the test document's name.</p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e3831"></a><a
name="AppletOptions"></a>Applet Customization
Variables</h4></div></div><p>The JDE allows you to specify
run-time options for applets
by setting JDE configuration variables.You must use the Emacs
customization feature to set applet run-time variables . To
@@ -1378,15 +1410,15 @@
buffer-local value of this variable. </td></tr><tr><td
valign="top"><tt>jde-run-applet-doc</tt></td><td
valign="top">Project </td><td
valign="top">Specify name of document containing
applet to be viewed. The command
<tt>jde-run-set-applet-doc</tt> sets the
- buffer-local value of this
variable. </td></tr></tbody></table></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e3841"></a><a
name="DebuggingApps"></a>Debugging
Applications</h2></div></div><p>The JDE provides two options for
debugging Java applications.</p><div class="itemizedlist"><ul
type="disc"><li><p>An Emacs interface to <b>jdb</b>,
the command-line
- debugger that comes with the JDK. See <a href="../jdb-ug/jdb-guide.html"
target="jdb-guide">Debugging with jdb</a> for more
+ buffer-local value of this
variable. </td></tr></tbody></table></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e3895"></a><a
name="DebuggingApps"></a>Debugging
Applications</h2></div></div><p>The JDE provides two options for
debugging Java applications.</p><div class="itemizedlist"><ul
type="disc"><li><p>An Emacs interface to <b>jdb</b>,
the command-line
+ debugger that comes with the JDK. See <a
href="../jdb-ug/jdb-ug-frame.html" target="jdb-ug">Debugging with
jdb</a> for more
information. </p></li><li><p>
JDEbug, a Java debugger developed specifically for use with the JDE.
See <a href="../jdebug-ug/jdebug-ug.html"
target="jdebug-ug">JDEbug
User's Guide</a> for more information</p>.
</li></ul></div><p>JDEbug provides more debugging features
but requires a JDK 1.2
or higher vm. You must use <b>jdb</b> to debug applications
- running on earlier vms.</p></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e3869"></a><a
name="SpecifyingClasspaths"></a>Specifying
+ running on earlier vms.</p></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e3923"></a><a
name="SpecifyingClasspaths"></a>Specifying
Classpaths</h2></div></div><p>The JDE provides
customization variables that permit you to
specify a classpath for the JDE's compile, run, debug,
Beanshell, and other commands. The following table lists these
@@ -1401,7 +1433,7 @@
Typically you want to use the same classpath to compile, run,
and debug an application. So typically
<tt>jde-global-classpath</tt> is the only variable you
- need to set.</p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3935"></a><a
name="SettingClasspathVar"></a>Setting a Classpath
+ need to set.</p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3989"></a><a
name="SettingClasspathVar"></a>Setting a Classpath
Variable</h4></div></div><p>As with other JDE customization
variables, you must use
Emacs' <b>customize-variable</b>
command to set the JDE's classpath variables. You can use
@@ -1425,7 +1457,7 @@
[INS] [DEL] Path: c:/jde-dev/jmath/src
[INS]
[State]: this option has been set and saved.
- </pre></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e3959"></a><a
name="ClassLibraries"></a>Including Class
+ </pre></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4013"></a><a
name="ClassLibraries"></a>Including Class
Libraries</h4></div></div><p>
If you store your class libraries as jar or zip files in
separate directory, you need specify only the path of the
@@ -1465,13 +1497,13 @@
<tt>libraries</tt>, etc. However, you can
customize <tt>jde-lib-directory-names</tt> to
reflect any library naming scheme you prefer.
- </p></div></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e4026"></a><a
name="UsingProjectFiles"></a>Using Project
Files</h2></div></div><p>A project file is a Lisp file that the
JDE loads and evaluates
+ </p></div></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e4080"></a><a
name="UsingProjectFiles"></a>Using Project
Files</h2></div></div><p>A project file is a Lisp file that the
JDE loads and evaluates
whenever you open a Java source file belonging to a specific
project. Project files allow you to save and restore project-specific
JDE configurations. For example, you can use a project file to
set the value of the <tt>jde-global-classpath</tt> variable to a
project-specific classpath automatically whenever you load a file
- belonging to that project. </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4035"></a><a
name="FindingProjectFiles"></a> How the JDE Finds Project
Files</h4></div></div><p>To simplify the task of finding project
files, the JDE makes
+ belonging to that project. </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4089"></a><a
name="FindingProjectFiles"></a> How the JDE Finds Project
Files</h4></div></div><p>To simplify the task of finding project
files, the JDE makes
two assumptions. First, it assumes that all Java source files
relating to a particular project live in a single directory tree.
Second, it assumes that all project files have the same file name.
@@ -1498,7 +1530,7 @@
directory tree containing the projects, settings common to
each project at the top of the directory containing each
projects, and so on.
- </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4062"></a><a
name="ProjectFileContents"></a> Project File
+ </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4116"></a><a
name="ProjectFileContents"></a> Project File
Contents</h4></div></div><p>A project file can contain any Lisp
code that can be
evaluated correctly as the last step in creating a Java source
buffer. For example, a project file can contain code that sets
@@ -1506,7 +1538,7 @@
project file can contain any code that could be implemented
as a <tt>jde-mode</tt> hook function. In fact, you
can think of a project file as a project-specific
- <tt>jde-mode</tt> hook function. </p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4074"></a><a
name="CreatingProjectFiles"></a>Creating a Project
+ <tt>jde-mode</tt> hook function. </p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4128"></a><a
name="CreatingProjectFiles"></a>Creating a Project
File</h4></div></div><p>The easiest way to create a project file
is to use the
<tt>jde-save-project </tt> command (JDE->Project->Project
File->Save
@@ -1540,7 +1572,7 @@
the command to update configuration variable settings without
disturbing any other configuration code that you have inserted
manually into the project file.
- </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4133"></a><a
name="CreatingPortableProjects"></a>Creating Portable
Projects</h4></div></div><p>
+ </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4187"></a><a
name="CreatingPortableProjects"></a>Creating Portable
Projects</h4></div></div><p>
You can use relative paths and environment variables to
construct portable project files. For example, suppose your
project directory has the following structure:
@@ -1578,7 +1610,7 @@
used any absolute paths in creating your project file. This
means you can move your project anywhere without having to update
the project file.
- </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4169"></a><a
name="DisablingContextSwitching"></a>Disabling Context
Switching</h4></div></div><p>When you select a buffer that belongs
to another
+ </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4223"></a><a
name="DisablingContextSwitching"></a>Disabling Context
Switching</h4></div></div><p>When you select a buffer that belongs
to another
project, the JDE loads the project file for that project
and may update the class list for the project. This
causes a slight delay before you can begin using the
@@ -1602,14 +1634,14 @@
JDE->Project->Auto Switch</b> or enter
<tt>M-x jde-toggle-project-context-switching</tt>. To reenable
context-switching, execute the same command again.
- </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4197"></a><a
name="ProjectHooks"></a>Project Hook
Functions</h4></div></div><p>The variable
<tt>jde-project-hooks</tt> lists
+ </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4251"></a><a
name="ProjectHooks"></a>Project Hook
Functions</h4></div></div><p>The variable
<tt>jde-project-hooks</tt> lists
functions that execute after the JDEE loads a project file. By
writing hook functions and adding them to this list, you can
specify actions to be taken every time the JDEE switches from
- one project to another.</p></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e4206"></a><a
name="DisplayingDoc"></a> Displaying Java
Documentation</h2></div></div><p>
+ one project to another.</p></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e4260"></a><a
name="DisplayingDoc"></a> Displaying Java
Documentation</h2></div></div><p>
The JDE provides commands for displaying the JDK API documentation
and context-sensitive help for classes.
- </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4212"></a><a name="BrowsingJDKDoc"></a>
Browsing JDK
+ </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4266"></a><a name="BrowsingJDKDoc"></a>
Browsing JDK
Documentation</h4></div></div><p>The
<tt>jde-browse-jdk-doc</tt> command
(JDE->Help->JDK, <b>C</b>-<b>c</b>
<b>C</b>-<b>v</b> <b>C</b>-<b>n</b>)
opens the
@@ -1617,7 +1649,7 @@
displays the JDK documentation page at JavaSoft's web site. To
display a different copy, set the variable
<tt>jde-jdk-doc-url</tt> to the url of the index
- page of the copy you want to be displayed. </p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4250"></a><a
name="ClassHelp"></a> Context-Sensitive Class
+ page of the copy you want to be displayed. </p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4304"></a><a
name="ClassHelp"></a> Context-Sensitive Class
Help</h4></div></div><p>The JDK provides context-sensitive help
for Java classes.
To use this facility, you must first customize the variable
<tt>jde-help-docsets</tt> to specify the location of
@@ -1626,7 +1658,7 @@
works with other types of documentation as well.</p><p>Once you have
specified the location of class
documentation on your system, you can get help for the class
at point in the current buffer by selecting JDE->Help->Symbol
- at Point . </p></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e4269"></a><a
name="BrowsingSourceCode"></a>Browsing Source
Code</h2></div></div><p>The JDE provides the following facilities
for browsing Java source code:</p><div class="itemizedlist"><ul
type="disc"><li><p><a href="#ClassesMenu">Classes
index menu</a></p></li><li><p><a
href="#Speedbar">Speedbar</a></p></li><li><p><a
href="#Tags">Etags</a></p></li></ul></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4288"></a><a
name="ClassesMenu"></a> Classes Index
Menu</h4></div></div><p>The Classes
+ at Point . </p></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e4323"></a><a
name="BrowsingSourceCode"></a>Browsing Source
Code</h2></div></div><p>The JDE provides the following facilities
for browsing Java source code:</p><div class="itemizedlist"><ul
type="disc"><li><p><a href="#ClassesMenu">Classes
index menu</a></p></li><li><p><a
href="#Speedbar">Speedbar</a></p></li><li><p><a
href="#Tags">Etags</a></p></li></ul></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4342"></a><a
name="ClassesMenu"></a> Classes Index
Menu</h4></div></div><p>The Classes
index menu appears by default in the Emacs menubar whenever a
Java source buffer is active. The menu consists of a cascading
list of all classes, methods, fields, and imports defined in
@@ -1642,7 +1674,7 @@
and so on. Selecting the
imports entry on
the top-level menu displays a submenu listing all the classes
- and packages imported by the active buffer.</p><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4313"></a><a
name="SpecialIndexEntries"></a> Special Index
+ and packages imported by the active buffer.</p><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4367"></a><a
name="SpecialIndexEntries"></a> Special Index
Entries</h5></div></div><p>The index menu includes the
following special index
entries:</p><div class="itemizedlist"><ul
type="disc"><li><p>*Rescan*</p><p>Selecting this item
causes the JDE to rebuild the
index menu. You should rebuild the menu whenever you
@@ -1652,14 +1684,14 @@
definition of the class on whose submenu it appears.
Turn the variable
<tt>jde-imenu-include-classdef</tt> off to
- suppress inclusion of these items in the menu.
</p></li></ul></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4337"></a><a
name="AlphabetClassesMenu"></a>Alphabetizing the
+ suppress inclusion of these items in the menu.
</p></li></ul></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4391"></a><a
name="AlphabetClassesMenu"></a>Alphabetizing the
Classes Menu</h5></div></div><p>By default the
Classes menu
lists methods and fields in the order in which the active
buffer defines them. Use the variable
<tt>jde-imenu-sort</tt> to customize the menu to
list methods and fields alphabetically in either ascending
- or descending order.</p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4350"></a><a
name="SuppressingSignatures"></a>Suppressing Method
+ or descending order.</p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4404"></a><a
name="SuppressingSignatures"></a>Suppressing Method
Signatures and Field Types</h5></div></div><p>By default the
Classes menu
displays the signatures of methods and the types of fields
@@ -1668,12 +1700,12 @@
also display the names of methods and fields without
signatures and types. Use the variable
<tt>jde-imenu-include-signature</tt> to turn
- signature and type display off or on. </p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4363"></a><a
name="DisablingClassesMenu"></a>Disabling the
+ signature and type display off or on. </p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4417"></a><a
name="DisablingClassesMenu"></a>Disabling the
Classes Menu</h5></div></div><p>Set the variable
<tt>jde-imenu-enable</tt> off
to disable the
Classes menu.
When disabled, the menu does not appear in the Emacs
- menubar.</p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4376"></a>Using the Keyboard to Navigate the Classes
Menu</h5></div></div><p>
+ menubar.</p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4430"></a>Using the Keyboard to Navigate the Classes
Menu</h5></div></div><p>
Execute <b>M-x imenu</b> to use the keyboard
to navigate the Classes menu. Emacs displays the
top-level items on the Classes menu in a buffer and
@@ -1685,7 +1717,7 @@
you to enter a selection in the keyboard. If you
select an index entry, Emacs scrolls the buffer
to the indexed point in the buffer.
- </p></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4384"></a><a name="Speedbar"></a> Using
the Speedbar</h4></div></div><p>To display the speedbar, select
JDE-> Speedbar. The
+ </p></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4438"></a><a name="Speedbar"></a> Using
the Speedbar</h4></div></div><p>To display the speedbar, select
JDE-> Speedbar. The
speedbar opens in a separate frame.</p><p></p><div
class="screenshot"><div class="mediaobject"><img
src="images/speedbar1.gif" alt="Screenshot showing the
speedbar."></div></div><p>
</p><p>The speedbar displays a list of the files and
subdirectories in the directory containing the file displayed
@@ -1694,14 +1726,14 @@
node for the file expands</p><p>
</p><div class="screenshot"><div
class="mediaobject"><img src="images/speedbar2.gif"
alt="Screenshot showing a speedbar entry."></div></div><p>
</p><p>to show up to three entries, depending on the contents of
- the source file. </p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4421"></a><a
name="Package"></a>Package</h5></div></div><p>
+ the source file. </p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4475"></a><a
name="Package"></a>Package</h5></div></div><p>
This item expands to show the package to which the file
belongs.
</p><p></p><div class="screenshot"><div
class="mediaobject"><img src="images/speedbar3.gif"
alt="Screenshot showing a speedbar entry."></div></div><p>
</p><p>
Clicking on the package scrolls the buffer to the
corresponding package declaration.
- </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4438"></a><a
name="Types"></a>Types</h5></div></div><p>
+ </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4492"></a><a
name="Types"></a>Types</h5></div></div><p>
This item expands to show the classes in the selected file.
</p><p></p><div class="screenshot"><div
class="mediaobject"><img src="images/speedbar4.gif"
alt="Screenshot showing a speedbar entry."></div></div><p>
</p><p>
@@ -1714,13 +1746,13 @@
</p><p>
Clicking on any class, inner class, method, constructor, or
field scrolls the buffer to show that item.
- </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4457"></a><a
name="Dependencies"></a>Dependencies</h5></div></div>
+ </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4511"></a><a
name="Dependencies"></a>Dependencies</h5></div></div>
This item expands to show the classes and packages imported by the current source file.
<p></p><div class="screenshot"><div
class="mediaobject"><img src="images/speedbar5.gif"
alt="Screenshot showing a speedbar entry."></div></div><p>
</p><p>Click on class or package to scroll the buffer to the
- corresponding import statement.</p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4473"></a><a
name="UpdatingSpeedbar"></a>Updating the
+ corresponding import statement.</p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4527"></a><a
name="UpdatingSpeedbar"></a>Updating the
Speedbar</h5></div></div><p>If you make changes to a source
buffer, you must update
the speedbar view to reflect the changes. To update the
speedbar view of a buffer:</p><div
class="procedure"><p><b>Procedure 1. </b></p><ol
type="1"><li><p>
@@ -1731,7 +1763,7 @@
(-) next to the buffer's file name in the speedbar view.
</p></li><li><p>Hold the shift key down while clicking the
expand
button (+) next to the buffer's name in the speedbar
- view.
</p></li></ol></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e4488"></a><a
name="SearchSource"></a>Searching Source
Code</h2></div></div><p>The JDEE provides commands that enable you
to find</p><div class="itemizedlist"><ul
type="disc"><li><p>
+ view.
</p></li></ol></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e4542"></a><a
name="SearchSource"></a>Searching Source
Code</h2></div></div><p>The JDEE provides commands that enable you
to find</p><div class="itemizedlist"><ul
type="disc"><li><p>
All occurences of strings matching a regular expression anywhere
in your project's source path (see <a
href="#FindExpressions">Finding
Expressions</a>)
@@ -1740,7 +1772,8 @@
or other symbol at point (see <a href="#FindSymbolDef">Finding
Symbol Definitions</a>)
</p></li><li><p>Source code for the class at point (see <a
href="#FindClasses">Finding
- Classes</a>)</p></li><li><p>Source for the parent of the
class at point</p></li><li><p>Source for an interface implemented
by esthe class at point</p></li></ul></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4519"></a><a
name="FindExpressions"></a>Finding
Expressions</h4></div></div><p>The JDEE provides two commands for
finding occurrences of strings
+ Classes</a>)</p></li><li><p>Source for the parent of the
class at point</p></li><li><p>Source for an interface implemented
by the class at point</p></li><li><p>All methods that invoke a
specifed method (see <a href="#Xref">Cross-Referencing
+ Classes</a>)</p></li></ul></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4579"></a><a
name="FindExpressions"></a>Finding
Expressions</h4></div></div><p>The JDEE provides two commands for
finding occurrences of strings
in Java source and other types of text files:</p><div
class="itemizedlist"><ul
type="disc"><li><p><b>JDE->Find->Expression</b>
(<tt>jde-find</tt>)</p><p>
This command uses the minibuffer to prompt you for the
@@ -1784,7 +1817,7 @@
Windows <b>find</b> command in your system
command path or use the <tt>find-program</tt>
variable to specify the Unix-style command's location.
- </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4605"></a><a
name="FindExpressionMinibuf"></a>Using the
+ </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4665"></a><a
name="FindExpressionMinibuf"></a>Using the
Minibuffer-Based Find (jde-find) Command</h5></div></div><p>To
find an expression with the minibuffer-based find
command:</p><div class="orderedlist"><ol
type="1"><li><p>
Select
@@ -1805,7 +1838,7 @@
of the text in which the match occurred.
</p><p>To visit the file containing the match, click the
match message in the grep buffer with the middle mouse button
- or move point to the message and press
<b>Enter</b></p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4701"></a><a
name="FindExpressionCustomize"></a>Customizing the
+ or move point to the message and press
<b>Enter</b></p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4761"></a><a
name="FindExpressionCustomize"></a>Customizing the
Minibuffer-Based Find Command</h5></div></div><p>
The following variables allow you to customize the
minibuffer-based search command:
@@ -1820,7 +1853,7 @@
files to be searched. You can use any regular
expression supported by the <tt>-name</tt>
option of the GNU <b>find</b>
-
command.</td></tr></tbody></table></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4769"></a><a
name="FindExpressionDlg"></a>Using the Dialog-Based Find (jde-find-dlg)
Command</h5></div></div><p>To find an expression with the
dialog-based find command:</p><div class="orderedlist"><ol
type="1"><li><p>
+
command.</td></tr></tbody></table></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4829"></a><a
name="FindExpressionDlg"></a>Using the Dialog-Based Find (jde-find-dlg)
Command</h5></div></div><p>To find an expression with the
dialog-based find command:</p><div class="orderedlist"><ol
type="1"><li><p>
Select
Find->Expression...
from the JDE menu
@@ -1830,7 +1863,7 @@
<b>find</b> and <b>grep</b> commands
with the options you specified and displays the results in a
buffer.
- </p></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4829"></a><a
name="FindSymbolDef"></a>Finding Symbol
Definitions</h4></div></div><p>To find the source code that
defines the class, interface,
+ </p></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4889"></a><a
name="FindSymbolDef"></a>Finding Symbol
Definitions</h4></div></div><p>To find the source code that
defines the class, interface,
method, or field at point, select
Find->Symbol Definition (<b>C-c
C-v
@@ -1844,7 +1877,7 @@
<tt>jde-global-classpath</tt>. The command uses
the beanshell to determine the fully qualified name of the
class referenced at point. If the beanshell is not running,
- it launches the beanshell.</p></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4880"></a><a
name="FindClasses"></a>Finding
Classes</h4></div></div><p>The
<tt>jde-open-class-source</tt> command
+ it launches the beanshell.</p></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e4940"></a><a
name="FindClasses"></a>Finding
Classes</h4></div></div><p>The
<tt>jde-open-class-source</tt> command
finds and opens the Java source file for the class whose
qualified or unqualified name appears at point.</p><div class="note"
style="margin-left: 0.5in; margin-right: 0.5in;"><h3
class="title">Note</h3><p>The JDE uses Java reflection to
determine the fully
qualified name of the class at point. Therefore, the class
@@ -1859,30 +1892,139 @@
Beanshell to determine the fully qualified name of the class
to be found. It starts the Beanshell if necessary. Thus, the
command may respond somewhat slowly the first time you it in a
- session. </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4906"></a><a
name="Tags"></a>Tags</h4></div></div><p>To use
the <tt>etags</tt> facility, you must
+ session. </p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4966"></a><a
name="Xref"></a>Cross-Referencing
Classes</h4></div></div><p>JDE includes a facility for creating
and utilizing a
+ cross-referencing database to enable you to quickly locate all
+ the callers of any particular function. This functionality is
+ very useful for quickly figuring how unfamiliar code works,
+ and useful for doing certain tasks such as renaming functions.
+ Be advised that this only finds direct callers, and cannot
+ detect calls via Java's reflection mechanism. The
+ cross-reference database must be kept in sync with the project
+ code, however the database generation is generally quick. The
+ remainder of this section explains how to configure and use
+ the cross-referencer.</p><div class="note" style="margin-left:
0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>The
JDEE's cross-referencing facility was developed by Andrew Hyatt.</div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4974"></a><a
name="ConfigXRef"></a>Configuring the
Cross-Referencer</h5></div></div><p>JDE's cross-referencing
database is built by examining
+ class files for a particular project. To this end, JDE
+ needs to know where the built class files for a project
+ live. This is usually a subset of the classpath.
+ </p><p>Then select JDE->Options->Project->General, and
go to
+ the "Jde Built Class Path" option. Insert one path for each
+ place where built classes wind up. You can add both
+ directories and zip files (jar/bar/etc). Any file entered
+ will be assumed to be a zip file.</p><p>Now that you have the built class
path defined, you can
+ configure the cross-referencer that uses it. Type M-x
+ jde-xref-customize. The following are a list the variables
+ that can be set, and what they do:
+ </p><div class="itemizedlist"><ul
type="disc"><li><p><tt>jde-xref-db-base-directory</tt></p><p>The
cross-referencer creates a database to
+ store the cross-reference information. This variable
+ defines a directory where that information resides. It
+ might, for example, be at the base of your project tree,
+ in a directory called xrefdb
+
</p></li><li><p><tt>jde-xref-store-prefixes</tt></p><p>To
reduce database size,
+ it's useful to ignore all information that doesn't refer
+ to code you care about. For example, most people don't
+ need to know who calls java.lang.System.out.println. To
+ not store this information, insert a package prefix for
+ each package you are interested in. Typically, this may
+ be just one string, for example "com.mycompany", to
+ store only code that references com.mycompany
+
classes.</p></li><li><p><tt>jde-xref-cache-size</tt></p><p>The
caller database can be quite large. However, it
+ is useful for efficiency reasons to keep part of it in
+ memory. This variable deterines how many packages to
+ keep in memory simulatenously. The higher this is, the
+ faster things will be, but also the more memory will be
+ taken up by the cross-reference information.
+ </p></li></ul></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5003"></a><a
name="BuildingXRefDB"></a>Building the Cross-Reference
Database</h5></div></div><p>The next step into getting the
cross-reference
+ functionality working is to build the cross-reference
+ database. The project must be fully built for this to work,
+ since it takes cross-reference information directly from the
+ built classes.
+ </p><p>To build the database, type <b>M-x
jde-xref-make-xref-db</b></p><p>If all the settings are properly
configured, JDE will go
+ off and create the cross-reference database. This can take
+ from a few seconds to several minutes depending on the size
+ of your project. Large class files may take long to parse,
+ so if it seems to be "stuck", please give it time.
+ </p><p>When it is done, it will save the database in the base
+ directory specified in the jde-xref customization group.
+ </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5017"></a><a
name="UsingXRefDB"></a>Using the Cross-Reference
Database</h5></div></div><p>There are several basic operations
that use the
+ cross-reference database:
+ </p><div class="itemizedlist"><ul
type="disc"><li><p><b>M-x jde-xref-first-caller (C-c C-v
a)</b>
+ </p><p> If your cursor is in the body of a function, then
+ this will go to the first in a sequence of callers to
+ this function. If there are no callers, there will be a
+ message saying so.
+ </p></li><li><p><b>M-x jde-xref-next-caller (C-c C-v
n)</b></p><p> After calling <b>jde-xref-first-caller</b>,
you can go to
+ each of the callers in sequence with this function. The
+ first caller function creates a list of callers and goes
+ to the first one. This navigates to the next caller on
+ the list. You can keep calling this until there are no
+ more callers, in which case there will be a message
+ saying so.
+ </p></li><li><p><b>M-x
jde-xref-display-call-tree</b>
+ </p><p>This displays an interactive tree view of the
+ function you are in, and it's callers. Each level down
+ will show you who calls the parent function. In this
+ way you can quickly get an overview of the context in
+ which the current function is used in. Each item in the
+ tree will take you to it's definition if it is clicked
+ on.
+ </p></li><li><p><b>M-x
jde-xref-list-uncalled-functions</b></p><p> Called from a java file,
this lists all the
+ functions in the file that have no apparent callers.
+ It's important to remember that because of Java
+ reflection, there is no guarantee that the functions are
+ truly uncalled. It only means they are not called
+ directly.
+ </p></li></ul></div><p>All of these functions have two
modes, a strict and
+ non-strict mode. In non-strict mode, the default, more
+ potential callers are treated as callers, including those
+ that call an interface that the function implements, or who
+ call a superclass's function you are overriding. For
+ example, if you are in Foo.doSomething(), and foo implements
+ IFoo, and a caller calls IFoo.doSomething(), then this is
+ treated as a caller in non-strict mode. Also, if you are in
+ Foo.doSomething, and Foo's superclass is Bar, and there is a
+ Bar.doSomething(), then Bar.doSomething() is treated as a
+ caller in non-strict mode. In strict mode, however, the
+ caller must specify the function directly for it to be
+ considered a hit. To run these functions with strict mode,
+ type C-u M-x and then the function-name. So C-u M-x
+ jde-xref-list-uncalled-functions will list only functions
+ that are uncalled directly.
+ </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5055"></a><a
name="UpdatingXRefDB"></a>Updating the Cross-Reference
Database</h5></div></div><p>As the code changes, the
cross-referencer must be kept
+ up to date, or else the jde-xref functions will start taking
+ you to incorrect places in files, and the callers list
+ itself will become incorrect. As you change the code, you
+ can call M-x jde-xref-update after a recompile, and it will
+ go through and recompute just the part of the database you
+ have changed.
+ </p><p>Another, easier way to update, for those of us who leave
+ their emacs running all the time, is to add a line such as
+ this in their .emacs
+ </p><pre class="programlisting">
+ (run-at-time "11:00pm" 86400 'jde-xref-make-xref-db)
+ </pre></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e5065"></a><a
name="Tags"></a>Tags</h4></div></div><p>To use
the <tt>etags</tt> facility, you must
first construct a TAGS file that indexes every symbol in your
source code. The JDE package contains two shell scripts that
you can use to tag your source code, one for
<b>csh</b> shells and the other for
<b>bash</b>. The <b>bash</b> version
is called <b>jtags</b>; the <b>csh</b>
- version, <b>jtags.csh</b>. </p><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e4933"></a><a
name="TaggingCode"></a> Tagging Java Source
Code</h5></div></div><p>To tag your source code, first copy the
appropriate shell
+ version, <b>jtags.csh</b>. </p><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5092"></a><a
name="TaggingCode"></a> Tagging Java Source
Code</h5></div></div><p>To tag your source code, first copy the
appropriate shell
script to a directory in your Emacs path. Then start a shell
(<b>M</b>-<b>x</b>
shell). Change to the top-level directory containing your
source code and then enter <b>jtags</b>. The <b>jtags</b>
script tags every <tt>.java</tt> file in the current directory
and in all descendants of the current directory, storing the
result in a file called <tt>TAGS</tt> in the top-level directory.
- </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e4957"></a><a
name="FindingSymbols"></a>Finding the Definition of a
Symbol</h5></div></div><p>To find the definition of a symbol, put
your cursor anywhere
+ </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5116"></a><a
name="FindingSymbols"></a>Finding the Definition of a
Symbol</h5></div></div><p>To find the definition of a symbol, put
your cursor anywhere
in the symbol and enter
<b>M</b>-<b>.</b>. Emacs
responds by locating
and opening (if necessary) the file containing the definition and
positioning the point at the definition. (The first time you type
<b>M</b>-<b>.</b>, Emacs
- prompts you to load the <tt>TAGS</tt> file.)
</p></div></div></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e4978"></a><a
name="CustomizingJDE"></a>Customizing the
JDE</h2></div></div><p>
+ prompts you to load the <tt>TAGS</tt> file.)
</p></div></div></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e5137"></a><a
name="CustomizingJDE"></a>Customizing the
JDE</h2></div></div><p>
This section describes various ways you can customize the JDE.
- </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e4984"></a><a
name="CustomizationVariables"></a>Customization
Variables</h4></div></div><p>
+ </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e5143"></a><a
name="CustomizationVariables"></a>Customization
Variables</h4></div></div><p>
JDE customization variables allow you to specify compile, run, debug,
and other JDE options. </p><div class="note" style="margin-left:
0.5in; margin-right: 0.5in;"><h3
class="title">Note</h3><p> The traditional way of customizing
Emacs is to use
<tt>setq</tt> forms to set the values of customization
@@ -1897,10 +2039,10 @@
projects.
</p></div><p> The following section explains how to use the Emacs
customization feature to set the value of a JDE customization
- variable.</p></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e5007"></a><a name="SettingVariable"></a>
Setting a Variable</h4></div></div><p>
- To set a JDE customization variable:
- </p><div class="procedure"><p><b>Procedure 1.
</b></p><ol type="1"><li><p>Determine the name of
the variable you want to customize.</p><p> Refer to the section of this guide
that documents the feature
- you want to customize for the name of the corresponding variable. Or
+ variable.</p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5166"></a><a name="SettingVariable"></a>
Setting a Variable</h5></div></div><p>
+ To set a JDE customization variable:
+ </p><div class="procedure"><p><b>Procedure 1.
</b></p><ol type="1"><li><p>Determine the name of
the variable you want to customize.</p><p> Refer to the section of this guide
that documents the feature
+ you want to customize for the name of the corresponding variable. Or
type <b>C</b>-<b>h</b>
v followed by the JDE group prefix
(<tt>jde-</tt>) or subgroup prefix (e.g.,
@@ -1909,7 +2051,7 @@
Emacs displays all variables belonging to the JDE group or subgroup. You
can then browse this list, using Emacs search, completion, and
documentation display command, to find the applicable variable.
- </p></li><li><p>Display a customization buffer for the
variable. </p><p> If you know the name of the variable, the easiest way to
+ </p></li><li><p>Display a customization buffer for the
variable. </p><p> If you know the name of the variable, the easiest way to
display a customization buffer for the variable is to select
Help->Customize->Specific Option... from the
Emacs menubar or type
<b>M</b>-<b>x</b> <tt>customize-variable</tt>.
@@ -1942,29 +2084,38 @@
project, the JDE will prompt you to enter a name for the project. It
then creates a project file for the project with the name that you
enter.
- </p></div></li></ol></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e5137"></a><a
name="SpecifyingPaths"></a>Specifying
Paths</h4></div></div><p>You can use paths containing environment
variables and
- or a tilde (~), cygwin paths, and relative paths as a
- value of any JDE customization variable
- that requires a path.</p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5143"></a><a
name="EnvVarsInPaths"></a>Environment
Variables</h5></div></div><p>The JDE accepts paths that contain
envirnoment variables, for
- example, </p><p>
- <pre class="programlisting">
- $JDK_HOME/src
- </pre>
- </p><p>
- The JDE replaces the environment variables with their actual
- values before passing the paths to commands (e.g., javac) that
- require them. You must use Unix notation (i.e.,
- <tt>$VARNAME</tt> or <tt>${VARNAME}</tt>)
- to specify an environment variable in a path even on Windows.
- </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5162"></a><a
name="TildeNotation"></a>Tilde (~)
Notation</h5></div></div><p>The JDE accepts paths that begin with
a tilde, for example,
- <tt>~/myproj/classes</tt>. The JDE replaces the tilde
- with the path to your home directory.</p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5171"></a><a
name="RelativePaths"></a>Relative
Paths</h5></div></div><p>A relative path is a path that begins
with a period, for
+ </p></div></li></ol></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5296"></a><a
name="SpecifyingPaths"></a>Specifying
Paths</h5></div></div><p>You can use paths containing environment
variables and
+ or a tilde (~), cygwin paths, and relative paths as a value
+ of any JDE customization variable that requires a
+ path.</p><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e5302"></a><a
name="EnvVarsInPaths"></a>Environment
Variables</h6></div></div><p>The JDE accepts paths that contain
envirnoment variables, for
+ example, </p><p>
+ <pre class="programlisting">
+ $JDK_HOME/src
+ </pre>
+ </p><p>
+ The JDE replaces the environment variables with their
+ actual values before passing the paths to commands (e.g.,
+ javac) that require them. You must use Unix notation
+ (i.e., <tt>$VARNAME</tt> or
+ <tt>${VARNAME}</tt>) to specify an environment
+ variable in a path even on Windows.
+ </p></div><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e5321"></a><a
name="TildeNotation"></a>Tilde (~)
Notation</h6></div></div><p>The JDE accepts paths that begin with
a tilde, for example,
+ <tt>~/myproj/classes</tt>. The JDE replaces the tilde
+ with the path to your home directory.</p></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e5330"></a><a
name="RelativePaths"></a>Relative
Paths</h6></div></div><p>A relative path is a path that begins
with a period, for
example, <tt>./src</tt>. If
<tt>jde-resolve-relative-paths</tt> is
set to a non-nil value (the default), the JDE converts a relative
path to an absolute path by appending the relative path to the
path of the project file that set the path variable, or if no such
- file exists, to the path of the current Java source
buffer.</p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5183"></a><a
name="CygwinPaths"></a>Cygwin
Paths</h5></div></div><p>You can use cygwin style paths in JDE
classpath variables
+ file exists, to the path of the current Java source buffer.</p><p>
+ You can use your <tt>.emacs</tt> file to
+ specify default relative paths for projects. For example,
+ setting <tt>jde-global-classpath</tt> to
+ <tt>./classes</tt> in your
+ <tt>.emacs</tt> file specifies that the
+ default location of class files is in a subdirectory of
+ the project file directory named <tt>classes</tt>.
+ </p></div><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e5359"></a><a
name="CygwinPaths"></a>Cygwin
Paths</h6></div></div><p>You can use cygwin style paths in JDE
classpath variables
on Windows. The JDE converts such paths to DOS paths before
using them, using a conversion function that you can specify.</p><p>The
jde-cgywin-path-converter variable allows you
to choose the path conversion function used by the JDE.</p><div
class="itemizedlist"><ul
type="disc"><li><p><tt>
@@ -1973,19 +2124,23 @@
or <tt>//cygdrive/[a-z]/</tt> to the corresponding DOS form. For
example it converts <tt>/c/jde/java/classes</tt> to
<tt>c:/jde/java/classes</tt>.
-
</p></li><li><p><tt>jde-cygwin-path-converter-cygpath</tt></p><p>This
function invokes the cygwin <tt>cygpath</tt> utility to
- perform the path conversion. The advantage is that the cygwin path utility can
- recognize and convert Unix style paths that represent mount points in the cygwin
- mount table. For example, suppose that you have mounted
- <tt>d:/javadev</tt> as <tt>/javadev</tt> in
- the cygwin mount table. Then choosing
- <tt>jde-cygwin-path-converter-cygpath</tt>
- allows you to use paths beginning with <tt>/javadev</tt> in JDE
classpaths. The
- drawback is that the conversion is slow as it requires running the cygwin utility
- for each Unix-style path to be converted.</p></li><li><p>A
custom conversion function that you
supply.</p></li></ul></div></div></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e5234"></a><a
name="JDECustomizationGroups"></a> JDE Customization
Groups</h4></div></div><p>The JDE defines a top-level
customization group, the JDE Group,
- for JDE customization variables. The JDE Group itself contains
- the following subgroups:</p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5240"></a><a
name="CompileOptionGroup"></a> Compile Option
- Group</h5></div></div><p>Specifies compile options
corresponding to the
+
</p></li><li><p><tt>jde-cygwin-path-converter-cygpath</tt></p><p>This
function invokes the cygwin
+ <tt>cygpath</tt> utility to perform the
+ path conversion. The advantage is that the cygwin path
+ utility can recognize and convert Unix style paths
+ that represent mount points in the cygwin mount table.
+ For example, suppose that you have mounted
+ <tt>d:/javadev</tt> as
+ <tt>/javadev</tt> in the cygwin mount table.
+ Then choosing <tt>jde-cygwin-path-converter-cygpath</tt>
+ allows you to use paths beginning with
+ <tt>/javadev</tt> in JDE classpaths. The
+ drawback is that the conversion is slow as it requires
+ running the cygwin utility for each Unix-style path to
+ be converted.</p></li><li><p>A custom conversion function that
you supply.</p></li></ul></div></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5410"></a><a
name="JDECustomizationGroups"></a> JDE Customization
Groups</h5></div></div><p>The JDE defines a top-level
customization group, the JDE
+ Group, for JDE customization variables. The JDE Group itself
+ contains the following subgroups:</p><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e5416"></a><a
name="CompileOptionGroup"></a> Compile Option
+ Group</h6></div></div><p>Specifies compile options
corresponding to the
command-line arguments (e.g., -d) accepted by the JDK
compiler, javac. When you execute the JDE compile command,
the JDE uses the settings of this group to construct a list
@@ -1999,22 +2154,21 @@
Compile Option Group by selecting
JDE->
Project->Options->Compile from the
- Emacs™ menubar. </p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5263"></a><a
name="CompileOptionGroup"></a>Run Option
- Group</h5></div></div><p>Specifies run-time options
corresponding to the
- command-line arguments (for example, -classpath) accepted by
- the JDK virtual machine, java. When you execute the JDE Run
- command, the JDE uses the settings of this group to
- construct a list of command-line arguments that it passes to
- the Java interpreter used by the JDE to run applications.
- This group also contains options for specifying non-java
- command-line arguments (in case you want to use a VM that
- accepts a different set of arguments than java does) and for
- specifying arguments to be passed to the application (as
- opposed to the virtual machine interpreting the
- application.) You can display the customization buffer for
- the Run Option Group by selecting
- JDE->Project->Options->Run
- from the Emacs™ menubar. </p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5283"></a><a
name="DebugOptionGroup"></a> Debug Option
Group</h5></div></div><p>Specifies run-time options corresponding
to the command-line
+ Emacs™ menubar. </p></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e5439"></a><a
name="CompileOptionGroup"></a>Run Option
Group</h6></div></div><p>Specifies run-time options corresponding
to the
+ command-line arguments (for example, -classpath) accepted
+ by the JDK virtual machine, java. When you execute the JDE
+ Run command, the JDE uses the settings of this group
+ to construct a list of command-line arguments that it
+ passes to the Java interpreter used by the JDE to run
+ applications. This group also contains options for
+ specifying non-java command-line arguments (in case you
+ want to use a VM that accepts a different set of arguments
+ than java does) and for specifying arguments to be passed
+ to the application (as opposed to the virtual machine
+ interpreting the application.) You can display the
+ customization buffer for the Run Option Group by selecting
+ JDE->Project->Options->Run from the
+ Emacs™ menubar. </p></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e5459"></a><a
name="DebugOptionGroup"></a>Debug Option
Group</h6></div></div><p>Specifies run-time options corresponding
to the command-line
arguments (for example, -classpath) accepted by the JDK debugger,
jdb. jdb accepts the same command-line arguments as java. However,
the JDE maintains two parallel sets of configuration variables
@@ -2026,20 +2180,21 @@
by the JDE to run applications in debug mode. You can display the
customization buffer for the Debug Option Group by selecting
JDE->Project->Options->Debug
- from the Emacs™ menubar. </p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5303"></a> <a
name="AutocodeGroup"></a>Autocode
Group</h5></div></div><p>Specifies templates used to generate code
automatically. </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5310"></a><a name="GeneralGroup"></a>
General Options Group</h5></div></div><p>Specify all other JDE
options. You can display the
+ from the Emacs™ menubar. </p></div><div
class="sect5"><div class="titlepage"><div><h6
class="title"><a name="d0e5479"></a> <a
name="AutocodeGroup"></a>Autocode
Group</h6></div></div><p>Specifies templates used to generate code
automatically. </p></div><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e5486"></a><a name="GeneralGroup"></a>
General Options Group</h6></div></div><p>Specify all other JDE
options. You can display the
customization buffer for the General Option Group by selecting
JDE->Project->Options->General
- from the Emacs™ menubar.
</p></div></div></div><div class="chapter"><div
class="titlepage"><div><h2 class="title"><a
name="d0e5330"></a><a
name="Customizingjde_mode"></a> Customizing
jde-mode</h2></div></div><p>The JDE defines a major mode, named
jde-mode, for editing Java
- source files. This mode derives from the standard Emacs Java
- source editing mode java-mode. In particular, it inherits all the
- functions and customization variables defined by java-mode and
- adds its own customization variables. When you load a Java source
- file, Emacs runs a JDE mode initialization function called jde-mode.
- The jde-mode function in turn calls the Java mode intialization
- function, java-mode. The last thing that jde-mode does before
- returning is to call a JDE mode function, if it exists. You can
- customize the JDE by defining a JDE mode hook function in your .emacs
- file. The following is an example of how to do this: </p><pre
class="programlisting">
+ from the Emacs™ menubar.
</p></div></div></div><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e5506"></a><a
name="Customizingjde_mode"></a> Customizing
jde-mode</h4></div></div><p>The JDE defines a major mode, named
jde-mode, for editing
+ Java source files. This mode derives from the standard Emacs
+ Java source editing mode java-mode. In particular, it inherits
+ all the functions and customization variables defined by
+ java-mode and adds its own customization variables. When you
+ load a Java source file, Emacs runs a JDE mode initialization
+ function called jde-mode. The jde-mode function in turn calls
+ the Java mode intialization function, java-mode. The last
+ thing that jde-mode does before returning is to call a JDE
+ mode function, if it exists. You can customize the JDE by
+ defining a JDE mode hook function in your .emacs file. The
+ following is an example of how to do this: </p><pre
class="programlisting">
(defun my-jde-mode-hook ()
(message "my-jde-mode-hook function executed"))
(add-hook 'jde-mode-hook 'my-jde-mode-hook)
@@ -2049,14 +2204,14 @@
you open a Java source file, jde-mode invokes the function my-jde-mode-hook.
Of course, the hook function defined in this example is trivial.
A real-world example might do something more useful, such as
- setting a custom indentation style. </p><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e5340"></a><a
name="Keybindings"></a> Customizing Key
Bindings</h4></div></div><p>A key binding establishes an
equivalence between a keystroke
+ setting a custom indentation style. </p><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5516"></a><a
name="Keybindings"></a> Customizing Key
Bindings</h5></div></div><p>A key binding establishes an
equivalence between a keystroke
or a sequence of keystrokes and an interactive Lisp function. The
keystroke or keystroke combination causes Emacs to execute the
function to which the keystroke (combination) is bound. For
example, the JDE by default binds the keystroke
<b>C</b>-<b>c</b> <b>C</b>-<b>v</b> <b>C</b>-<b>c</b>
to the function <tt>jde-compile</tt>. You can use the JDE
customization facility to change the standard JDE bindings or
- create bindings for functions that do not have default bindings. </p><p>To
customize key bindings: </p><div
class="procedure"><p><b>Procedure 1. </b></p><ol
type="1"><li><p>Open a buffer on the JDE customization variable
<tt>jde-key-bindings</tt>.</p><p>You can do this by typing
+ create bindings for functions that do not have default bindings. </p><p>To
customize key bindings: </p><div
class="procedure"><p><b>Procedure 2. </b></p><ol
type="1"><li><p>Open a buffer on the JDE customization variable
<tt>jde-key-bindings</tt>.</p><p>You can do this by typing
<b>M</b>-<b>x</b> <tt>customize-variable</tt>
<tt>jde-key-bindings</tt> or by selecting
JDE->Options->Project and searching the
resulting JDE project customization buffer for
@@ -2073,4 +2228,94 @@
you project file if your project has a project file. To save the new
settings in your project file, switch to a source buffer and choose
JDE-> Options->Save Project from the Emacs menubar.
-
</p></li></ol></div></div></div></div></body></html>
\ No newline at end of file
+
</p></li></ol></div></div></div></div><div
class="chapter"><div class="titlepage"><div><h2
class="title"><a name="d0e5626"></a><a
name="Plugins"></a>Creating and Installing
Plugins</h2></div></div><p>Plugins are independently developed
applications intended
+ for use with the JDEE and distributed in the form of a (g)zip or
+ jar file. The following sections explain how to create and install
+ plugins.
+ </p><div class="sect3"><div
class="titlepage"><div><h4 class="title"><a
name="d0e5632"></a><a
name="InstallingPlugins"></a>Installing a
Plugin</h4></div></div><p>To install a plugin:</p><div
class="orderedlist"><ol type="1"><li><p>Copy the
zip or jar file containing the plugin in to
+ the JDEE's plugins directory.</p><div class="note"
style="margin-left: 0.5in; margin-right: 0.5in;"><h3
class="title">Note</h3><p>By default the JDEE plugin directory is
a
+ subdirectory of the JDEE directory named
+ <tt>plugins</tt>. If you want to keep your
+ plugins in another directory, set
+ <tt>jde-plugins-directory</tt> to the path of
+ that directory.</p></div></li><li><p>Execute
<b>M-h jde-pi-install-plugins</b>.</p><p>This command installs any
plugins at the top level of the plugins
+ directory in the plugins
directory.</p></li></ol></div><p>If the plugin adds any menu
items to the JDEE's plugins menu
+ (named JDEpi), you should now be able to see the
+ items on the plugins menu.</p></div><div
class="sect3"><div class="titlepage"><div><h4
class="title"><a name="d0e5664"></a><a
name="CreatingPlugins"></a>Creating a
Plugin</h4></div></div><p>The following sections explain how to
create a JDEE plugin.</p><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5670"></a><a
name="PluginRequirements"></a>Plugin
Requirements</h5></div></div><p>A JDEE plugin must meet the
following requirements:</p><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e5676"></a>Packaging</h6></div></div><p>The
plugin must be distributed as a compressed file that can be
+ decompressed by Java's jar program. Compressed file formats that meet this
+ requirement include zip, gzip, and jar.
+ </p></div><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e5681"></a>Directory
Structure</h6></div></div><p>Decompressing the plugin should
create a subdirectory in the
+ current directory whose name is the plugin's name and that contains
+ at least one directory named <tt>lisp</tt>. The
+ plugin directory can contain any number of other directories.
+ The other directories can have any names. However, it would be
+ nice if plugins standardized on the following directory structure
+ and names.
+ </p><pre class="programlisting">
+
+ plugin
+ bsh
+ doc
+ scripts
+ help
+ info
+ html
+ src (e.g., xml files used to generate info and html)
+ java
+ class
+ doc
+ lib (e.g, jar files)
+ src
+ lisp
+ </pre></div><div class="sect5"><div
class="titlepage"><div><h6 class="title"><a
name="d0e5691"></a>Bootstrap
File</h6></div></div><p>The plugin's lisp directory must
contain a Lisp file
+ named <tt>jde-PLUGIN.el </tt>where PLUGIN is
+ the same as the plugin's toplevel directory name. This
+ file is called a bootstrap file because it is the only
+ file directly loaded by the JDEE. It is responsible for
+ registering the plugin with the JDEE and loading any other
+ Lisp files required by the plugin.</p></div></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5699"></a><a
name="RegisteringPlugin"></a>Registering a
Plugin</h5></div></div><p>A plugin's bootstrap file must
register the plugin with
+ the JDEE when it is loaded. The bootstrap file should do
+ this by invoking the JDEE's
+ <tt>jde-pi-register</tt> function. This function
+ takes a single argument: an instance of
+ <tt>jde-plugin</tt> class that optionally
+ specifies the plugin's menu and its contribution to the
+ classpath of the instance of the BeanShell run by the
+ JDEE. </p></div><div class="sect4"><div
class="titlepage"><div><h5 class="title"><a
name="d0e5711"></a>Running Java Code from a
Plugin</h5></div></div><p>A plugin can use the JDEE's instance
of the BeanShell to
+ invoke Java methods and display their output in an Emacs
+ buffer. The JDEE provides the following functions for this
+ purpose:</p><div class="itemizedlist"><ul
type="disc"><li><p><tt>jde-jeval</tt></p><p>Evaluate
a Java statement in the JDEE's BeanShell
+ instance and return the resulting BeanShell
+
output.</p></li><li><p><tt>jde-jeval-r</tt></p><p>Evaluate
a Java statement in the JDEE's BeanShell
+ instance, use the Emacs Lisp interpreter to evaluate the
+ resulting BeanShell output, and return the result. This
+ function assumes that the Java statement emits Emacs
+ Lisp code, i.e., that the Java code was developed
+ specifically to cause Emacs to do something.
+
</p></li><li><p><tt>jde-jeval-cm</tt></p><p>Evaluate
a Java statement in the JDEE's BeanShell
+ instance and display the resulting BeanShell output in
+ an Emacs compilation buffer. This function is intended
+ to run Java applications, such as style checkers, that
+ output error messages keyed to specific lines in a
+ source file.
+ </p></li></ul></div><p>See the doc strings for these
functions for more information.</p></div><div
class="sect4"><div class="titlepage"><div><h5
class="title"><a name="d0e5737"></a><a
name="BootstrapExample"></a>Bootstrap File
Example</h5></div></div><p>
+ The following is an example of the bootstrap file
+ for a plugin named pi1.</p><pre class="programlisting">
+
+ ;; jde-pi1.el
+ (defun jde-pi1-cmd ()
+ (interactive)
+ (message "plugin 1"))
+
+ (jde-pi-register
+ (jde-plugin
+ "pi1"
+:bsh-cp (list
+ (expand-file-name "lib/lib1.jar" (jde-pi-get-plugin-dir "pi1"))
+ (expand-file-name "lib/lib2.jar" (jde-pi-get-plugin-dir "pi1")))
+:menu-spec (list (list "Pi1" ["cmd" jde-pi1-cmd :active t]))))
+
+
+ (provide 'jde-pi1)
+
+ </pre></div></div></div></div></body></html>
\ No newline at end of file
1.4 +20 -20 XEmacs/packages/xemacs-packages/jde/doc/html/jde-ug/jde-ug-toc.html
Index: jde-ug-toc.html
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/doc/html/jde-ug/jde-ug-toc.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- jde-ug-toc.html 2002/09/14 03:20:07 1.3
+++ jde-ug-toc.html 2006/03/03 20:40:42 1.4
@@ -20,66 +20,66 @@
<table border="0" width="100%" cols="1">
<tbody>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Introduction</a></td>
+ <td><a href="jde-ug-content.html#Intro"
target="content">Introduction</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Registering and Selecting a JDK</a></td>
+ <td><a href="jde-ug-content.html#RegisterSelectJDK"
target="content">Registering and Selecting a JDK</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Editing Java Source Files</a></td>
+ <td><a
href="jde-ug-content.html#EditingJavaSourceFiles"
target="content">Editing Java Source Files</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Documenting Code</a></td>
+ <td><a href="jde-ug-content.html#DocumentingCode"
target="content">Documenting Code</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Abbreviations</a></td>
+ <td><a href="jde-ug-content.html#Abbrevs"
target="content">Abbreviations</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Completing Expressions</a></td>
+ <td><a href="jde-ug-content.html#CodeCompletion"
target="content">Completing Expressions</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Generating Code</a></td>
+ <td><a href="jde-ug-content.html#GeneratingCode"
target="content">Generating Code</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Checking Coding Style</a></td>
+ <td><a href="jde-ug-content.html#CheckStyle"
target="content">Checking Coding Style</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Compiling Java Programs</a></td>
+ <td><a
href="jde-ug-content.html#CompilingJavaPrograms"
target="content">Compiling Java Programs</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Building Java Applications</a></td>
+ <td><a
href="jde-ug-content.html#BuildingJavaApplications"
target="content">Building Java Applications</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Running Java
+ <td><a href="jde-ug-content.html#RunningJavaApps"
target="content">Running Java
Applications</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content"> Working with Applets</a></td>
+ <td><a href="jde-ug-content.html#WorkingWithApplets"
target="content"> Working with Applets</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Debugging Applications</a></td>
+ <td><a href="jde-ug-content.html#DebuggingApps"
target="content">Debugging Applications</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Specifying
+ <td><a
href="jde-ug-content.html#SpecifyingClasspaths"
target="content">Specifying
Classpaths</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Using Project Files</a></td>
+ <td><a href="jde-ug-content.html#UsingProjectFiles"
target="content">Using Project Files</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content"> Displaying Java Documentation</a></td>
+ <td><a href="jde-ug-content.html#DisplayingDoc"
target="content"> Displaying Java Documentation</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Browsing Source Code</a></td>
+ <td><a href="jde-ug-content.html#BrowsingSourceCode"
target="content">Browsing Source Code</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Searching Source Code</a></td>
+ <td><a href="jde-ug-content.html#SearchSource"
target="content">Searching Source Code</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content">Customizing the JDE</a></td>
+ <td><a href="jde-ug-content.html#CustomizingJDE"
target="content">Customizing the JDE</a></td>
</tr>
<tr>
- <td><a href="jde-ug-content.html#"
target="content"> Customizing jde-mode</a></td>
+ <td><a href="jde-ug-content.html#Plugins"
target="content">Creating and Installing Plugins</a></td>
</tr>
</tbody>
</table></applet></body>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jde-ug/images/keybindings.gif
<<Binary file>>
1.2 +25 -28
XEmacs/packages/xemacs-packages/jde/doc/html/jdebug-ug/jdebug-ug-content.html
Index: jdebug-ug-content.html
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/doc/html/jdebug-ug/jdebug-ug-content.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- jdebug-ug-content.html 2001/02/16 04:57:40 1.1
+++ jdebug-ug-content.html 2006/03/03 20:40:46 1.2
@@ -79,7 +79,7 @@ JDEbug features include:</p>
specifications of the <a
href="http://java.sun.com/products/jpda/" target="content">Java
Debug Platform Architecture</a> (JPDA) defined by Sun
-Microsystems. The vm shipped with Sun's Java SDK 1.3 for Windows and Solaris conform
to the JPDA specification.</p>
+Microsystems. Starting with version 1.3, the vm shipped with Sun's Java SDK for
Windows and Solaris conform to the JPDA specification.</p>
<p>In addition, JPDA backward compatibility packages are
available for Sun's Java SDK 1.2.2 for Windows and Linux platforms, respectively, and
for the Reference Version of the SDK 1.2.2 for the Solaris platform.</p>
@@ -143,17 +143,17 @@ Setting up JDEbug entails the following
<p>The JDE is configured by default to serve as a source-level
debugger front-end to jdb, the command-line debugger that comes
with Sun's Java SDK. To use JDEbug, you must set the value of the
-JDE customization variable <code>jde-db-debugger</code> to
+JDE customization variable <code>jde-debugger</code> to
specify JDEBug. To do this,</p>
<ol>
<li>Type <code>M-x customize-variable</code>.
<p style="margin-left: 0em">
- Emacs isplays a customization buffer for <code>jde-db-debugger.</code>
+ Emacs displays a customization buffer for <code>jde-debugger.</code>
</p>
<p style="margin-left: 0em">
- <img src="images/enable_jdebug.gif" width="648"
height="270">
+ <img src="images/enable_jdebug.gif" width="572"
height="149">
</p>
</li>
<li>
@@ -173,7 +173,7 @@ specify JDEBug. To do this,</p>
in the Emacs menubar.</p>
<p>
-<img src="images/jdebug_menu.gif" width="560"
height="430"></p>
+<img src="images/jdebug_menu.gif"></p>
<a name="SpecifyingJPDALocation">
<h3>Specifying the Location of the JPDA Libraries</h3>
@@ -302,7 +302,7 @@ in the Emacs menubar.</p>
</a>
<p>
-To display the current location in the program you are debugging, JDEBug needs to be able
to find the source files from which the program was compile. The JDEbug looks for the
files in the source directories specified by the JDE variable
<code>jde-db-source-directories</code>. Therefore, before starting a debugging
session, you must ensure that this variable specifies all the source files that you may
step through during the debugging session.
+To display the current location in the program you are debugging, JDEBug needs to be able
to find the source files from which the program was compile. The JDEbug looks for the
files in the source directories specified by the JDE variable
<code>jde-sourcepath</code>. Therefore, before starting a debugging session,
you must ensure that this variable specifies all the source files that you may step
through during the debugging session.
</p>
<p>
@@ -318,18 +318,13 @@ To set this variable:
<li>
Edit the buffer to reflect the location of Java source files on your system.
<p style="margin-left: 0em">
- <strong>Note</strong> You should specify only the root directory of the
top-level packages you
- may need to visit during a debugging session. For example, suppose the top-level
packages for
- your current project reside in <code>c:/java/projects/prj1/src</code>
and the Java SDK source
- lives in <code>c:/java/jdk1.3/src</code>. Then the customization buffer
should appear as follows:
- <p><code>jde-db-source-directories: [Hide]</code><br>
- <code>[INS] [DEL] Path: c:/java/projects/prj1/src</code><br>
- <code>[INS] [DEL] Path: c:/java/jdk1.3/src/</code><br>
- <code>[INS]</code><br>
- <code>[State]: you have edited the value as text, but you have not set the
option.</code><br>
- <code>List of source directory paths. [More]</code><br>
- <code>Parent groups: [jde-project]</code><br>
- </p>
+ <strong>Note</strong> You should specify only the root directories of
the top-level packages you
+ may need to visit during a debugging session. For example, suppose the source files
for
+ your current project reside in a subdirectory of the project directory named
+ <code>src</code> and the Java SDK source lives in
<code>c:/java/j2sdk1.4.1/src</code>. Then
+ the customization buffer should appear as follows:
+
+ <p><img src="images/source_path.gif"></p>
</p>
</li>
<li>
@@ -434,26 +429,27 @@ application. JDEBug provides two command
</ul>
<p>Issuing either of these commands cause JDEBug to split your
-Emacs frame into three windows.</p>
+Emacs frame into two windows and to display a separate
+local variables frame.</p>
-<p>.<img src="images/window_config.gif" width="498"
height="395"></p>
+<p>.<img src="images/window_config.gif"></p>
-<p>The top window displays a Java source buffer. The source
+<p>The top Emacs window displays a Java source buffer. The source
buffer displays either the source buffer where you launched the
application or, if you used the <strong>Debug App</strong>
command, the source buffer containing the first breakpoint hit
after the application was launched.</p>
-<p>The middle window displays the application process's local
-variables buffer. The buffer displays the local variables in the
-stack frame of the initial breakpoint hit when you launched the
-application. If your application does not hit a breakpoint at
-startup, the local variables buffer displays nothing.</p>
-
<p>The bottom window contains the debugger messages buffer for
the process that was just launched. This buffer displays messages
regarding the status of the process being debugged.</p>
+<p>The local variables frame displays the application process's local
+variables. Initially, the frame displays the local variables in the
+stack frame of the breakpoint hit when you launched the
+application. If your application does not hit a breakpoint at
+startup, the local variables buffer displays nothing.</p>
+
<p>At this point, if the process was launched successfully and
did not run to completion, you can begin debugging your
application.</p>
@@ -861,7 +857,8 @@ debug during a debugger session. </p>
<td>
Displays the values of local variables and the
fields of the object on which the current method
- was invoked (the implicit this object).
+ was invoked (the implicit this object). This buffer
+ is off by default.
</td>
</tr>
<tr>
1.2 +12 -22
XEmacs/packages/xemacs-packages/jde/doc/html/jdebug-ug/images/enable_jdebug.gif
<<Binary file>>
1.2 +142 -65
XEmacs/packages/xemacs-packages/jde/doc/html/jdebug-ug/images/jdebug_menu.gif
<<Binary file>>
1.2 +186 -142
XEmacs/packages/xemacs-packages/jde/doc/html/jdebug-ug/images/window_config.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/html/jdebug-ug/images/source_path.gif
<<Binary file>>
1.4 +8 -4 XEmacs/packages/xemacs-packages/jde/doc/src/css/jde_style.css
Index: jde_style.css
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/doc/src/css/jde_style.css,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- jde_style.css 2002/09/14 03:20:15 1.3
+++ jde_style.css 2006/03/03 20:40:52 1.4
@@ -4,17 +4,21 @@ h1 { font-family: "Arial", Helvetica, sa
h2 { font-family: "Arial", Helvetica, sans-serif;
font-size: 18pt;
margin-top: .5in;
- color: maroon;
+ color: maroon
}
-h3 { font-family: "Arial", Helvetica, sans-serif;
- font-size: 14pt;
+h3 { font-family: "New Times Roman", Times, serif;
+ font-size: 12pt;
margin-top: .4in}
h4 { font-family: "Arial", Helvetica, sans-serif;
+ font-size: 14pt;
+ margin-top: .3in; }
+h5 { font-family: "Arial", Helvetica, sans-serif;
font-size: 12pt;
margin-top: .3in }
-h5 { font-family: "Arial", Helvetica, serif;
+h6 { font-family: "Arial", Helvetica, sans-serif;
font-size: 10pt;
margin-top: .3in }
+
body { margin-left: .2in
background: white }
ul { margin-left: .4in}
1.1 XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/jdb-ug-frame.html
Index: jdb-ug-frame.html
===================================================================
<html>
<head>
<title>JDB User's Guide</title>
</title>
<frameset cols="25%,75%" frameborder="yes">
<frame src="jdb-ug-toc.html" name="toc" marginwidth="3"
marginheight="3" scrolling="no">
<frame src="jdb-ug.html" name="content" marginwidth="5"
marginheight="0" scrolling="auto">
<noframes>
<body>
<p>
<A HREF="jdb-ug-toc.html">JDE Topics</A>
</p>
</body>
</noframes>
</frameset>
</html>
1.1 XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/jdb-ug.xml
Index: jdb-ug.xml
===================================================================
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBk XML V4.1.2//EN"
"file:///c:/Applications/cygwin/home/xae-dev/xae/doctypes/docbook/docbookx.dtd"
[]>
<?xml-stylesheet
href="file:///c:/Applications/cygwin/home/jde-dev/jde/doc/src/styles/html/jdebook.xsl"
type="text/xsl" ?>
<book>
<title>Debugging with jdb</title>
<bookinfo>
<releaseinfo>
<remark>
Revised for JDEE <productnumber>2.3.3</productnumber>
</remark>
</releaseinfo>
<copyright>
<year>1997</year>
<year>1998</year>
<year>1999</year>
<year>2000</year>
<year>2001</year>
<year>2002</year>
<year>2003</year>
<holder>Paul Kinnucan</holder>
</copyright>
</bookinfo>
<chapter>
<title><anchor id="Intro"/>Debugger Setup</title>
<para>You should perform the following steps before attempting to use
jdb.</para>
<itemizedlist>
<listitem>
<para>Set the configuration variable
<varname>jde-debugger</varname> to <option>jdb</option> if
you are using version 1.3 (or later) of the Windows or
Solaris versions of the JDK or version 1.2.2 (or later) of
the Linux version of the JDK. Set
<varname>jde-debugger</varname> to <option>oldjdb</option>
if you are using older versions of the JDK.</para>
</listitem>
<listitem>
<para>
Use <varname>jde-sourcepath</varname> to specify the paths
of any source code that you expect to visit while
debugging your application (see <ulink
url="#SettingSourcePath">
Setting the Source Path</ulink>). If you suspect that a
problem is occurring in the Java API, you should include
the API source files in your source path.
</para>
</listitem>
<listitem>
<para>
Set <varname>jde-compile-option-debug</varname> on
(see
<ulink
url="../jde-ug/jde-ug-content.html#CompilingJavaPrograms">Compiling
Java Programs</ulink>). This causes the compiler to insert
information needed by the debugger into your
application's class files.
</para>
</listitem>
<listitem>
<para>Specify the app's main class either by setting the
<varname>jde-run-application-class</varname> variable or by starting
the
debugger from the buffer that contains the source file for
the main class.
</para>
</listitem>
</itemizedlist>
</chapter>
<chapter>
<title><anchor id="RunningDebugger"/>Running the
Debugger</title>
<sect3>
<title><anchor id="StartingDebugger"/>Starting the
Debugger</title>
<para>To debug a program with <filename>jdb</filename>,
first select a buffer containing the source of the program you
want to debug (or a source buffer containing the program's
main class if you have not set
<varname>jde-run-application-class</varname>). Then execute
the JDEE's <command>jde-debug</command> command. You can execute
this command by:
</para>
<itemizedlist>
<listitem>
<para>Selecting
<menuchoice>
<guimenu>JDE</guimenu>
<guimenuitem>Debug App</guimenuitem></menuchoice>
</para>
</listitem>
<listitem>
<para>
Entering the key combination
<keycombo>
<keycap>C</keycap>
<keycap>c</keycap>
</keycombo> <keycombo>
<keycap>C</keycap>
<keycap>v</keycap></keycombo> <keycombo>
<keycap>C</keycap>
<keycap>d</keycap></keycombo>
</para>
</listitem>
<listitem>
<para>Entering <keycombo>
<keycap>M</keycap>
<keycap>x</keycap></keycombo>
<command>jde-debug</command></para>
</listitem>
</itemizedlist>
<para>The JDEE launches jdb, passing to it the name of the main
class of the program in the current source buffer and any
debug options that you have specified via the JDEE's debugger
option variables (see <ulink
url="#SettingDebugOptions">Setting Debug Options</ulink>.
jdb in turn launches a virtual machine to run the debuggee
program and stops the virtual machine before the main method
of the program's main class. Meanwhile the JDEE splits the
source window into two windows.
</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/debug1.gif"/>
</imageobject>
</mediaobject>
</screenshot>
<para>
The upper window shows the source buffer. The menu bar
of the source buffer displays a menu (<guimenu>Jdb</guimenu>)
of debug commands. The lower window shows the debugger
interaction buffer.
</para>
<para>At this point, you can set breakpoints, run to a breakpoint that
you set before you started the debugger, or step into the main method
of your program.</para>
<sect4>
<title><anchor id="SettingDebugOptions"/>Setting Debug
Options</title>
<para>The <command>jde-jdb</command> command (selected by
<menuchoice>
<guimenu>JDE</guimenu>
<guimenuitem>Debug App</guimenuitem></menuchoice> when jdb
is the debugger for the current project) can optionally pass
command-line arguments that specify various debug options to
jdb when starting jdb. The JDEE provides two ways to specify
these options: via customization variables or in the
minibuffer when you run the <command>jde-jdb</command>
command.</para>
<para>The <command>jde-jdb</command> command passes any
options that you specify via customization variables to jdb.
In addition, if you set the customization variable
<varname>jde-db-read-vm-args</varname> to a non-nil value,
the <command>jde-jdb</command> command prompts you to enter
debugger options in the minibuffer. It appends the options
that you enter to the options specified via customization
variables. The JDEE saves the arguments that you enter in a
minibuffer history list. You can recall previously entered
options by pressing the up or down arrows on your keyboard.
</para>
</sect4>
<sect4>
<title><anchor id="SettingAppArguments"/>Setting App
Arguments</title>
<para>You can use the customization variable
<varname>jde-db-option-application-args</varname> to specify
arguments to be passed to the application launched by jdb.
The <command>jde-jdb</command> command inserts the specified
arguments on the command-line that it constructs to run
jdb.</para>
<para>In addition, if you set the customization variable
<varname>jde-db-read-app-args</varname> to a
non-<option>nil</option> value, the
<command>jde-jdb</command> command prompts you to enter the
application arguments in the minibuffer. It appends the
options that you enter to the arguments specified via
<varname>jde-db-option-application-args</varname>. The JDEE
saves the arguments that you enter in a minibuffer history
list. You can recall previously entered options by pressing
the up or down arrows on your keyboard. </para>
</sect4>
</sect3>
<sect3>
<title><anchor id="EnteringCommands"/>Entering Debug
Commands</title>
<para>The JDE lets you enter commands from either the current source
buffer or from the debugger command-line interaction buffer.
You can enter all debugger commands from the debugger
buffer. You can enter only a subset of debugger commands
from the current source buffer. </para>
<para> To enter a debugger command
from the current source buffer, select the command from the
jdb menu or type the shortcut key for the command. The
<guimenu>Jdb</guimenu>
menu lists the shortcut keys
for debugger commands. </para>
<para>To enter a command in the debugger interaction window, type the
command at the debugger prompt and press the <keycap>Enter</keycap>
key. To see a list of debugger commands, enter the command
<command>help</command>.
</para>
</sect3>
<sect3>
<title><anchor id="SteppingProgram"/>Stepping Through a
Program</title>
<para>
Jdb provides a set of command-line commands that advance a
program to the next line or the next breakpoint. The JDEE's
jdb interface provides Emacs commands that invoke the jdb's
step commands from a source buffer and move a debug cursor to
the next line to be executed in the source buffer. If you
prefer, you can enter jdb's step commands directly in the jdb
buffer.
</para>
<sect4>
<title><anchor id="StepCommands"/>Step Commands</title>
<para> The following table lists the jdb step commands
supported by the JDEE.
</para>
<table>
<title>Step Commands</title>
<tgroup cols="4">
<thead>
<row>
<entry>Jdb Menu Item</entry>
<entry>Emacs Command</entry>
<entry>jdb Command</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>Step Over</entry>
<entry>jde-bug-step-over</entry>
<entry>next</entry>
<entry><para>Advance to the next line in the current
method, stepping over any lines that invoke other
methods.</para></entry>
</row>
<row>
<entry>Step Into</entry>
<entry>jde-debug-step-into</entry>
<entry>step</entry>
<entry><para>Advance to the next line in the
program.</para></entry>
</row>
<row>
<entry>Step Out</entry>
<entry>jde-debug-step-out</entry>
<entry>step up</entry>
<entry><para>Advance to the next line in the method
that invoked the current method.</para></entry>
</row>
<row>
<entry>Continue</entry>
<entry>jde-debug-cont</entry>
<entry>cont</entry>
<entry><para>Advance to the next breakpoint or to the
end of the program, whichever comes
first.</para></entry>
</row>
</tbody>
</tgroup>
</table>
</sect4>
<sect4>
<title><anchor id="DebugCursor"/>Debug Cursor</title>
<para>The JDEE uses an arrow, called the debug cursor, to
indicate the next line to be executed as the result of a
step or continue command. The debug cursor appears in the
left gutter of the source window containing the next line to
be executed.</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/debug_cursor.gif"/>
</imageobject>
</mediaobject>
</screenshot>
<para>If the step or continue command advances the
program to a line that is not displayed in the current
source window, the JDEE opens the source file containing the
line, if necessary, and displays the source buffer in the
current source window, with the window scrolled to show the
line at which the program has halted.</para>
<note>
<para>A blank source buffer indicates that the debugger
cannot find the source file into which you have stepped.
You should check your source path setting (see <ulink
url="#SettingSourcePath">Setting the Source
Path</ulink>) to ensure that it includes all source
files in the execution path of your program.
</para>
</note>
</sect4>
</sect3>
</chapter>
<chapter>
<title><anchor id="SettingBreakpoints"/>Setting
Breakpoints</title>
<para>To set a breakpoint on any executable line in the current
source buffer, click on the line and select <menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>Set Breakpoint</guimenuitem></menuchoice>
(<keycombo>
<keycap>C</keycap>
<keycap>c</keycap></keycombo><keycombo>
<keycap>C</keycap>
<keycap>a</keycap></keycombo>
<keycombo>
<keycap>C</keycap>
<keycap>b</keycap></keycombo>). The JDEE highlights the
current line to indicate that a breakpoint is to be set at that
line. </para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/breakpoint.gif"/>
</imageobject>
</mediaobject>
</screenshot>
<para>
If the debugger is
running, the JDEE issues a command to the debugger to set a
breakpoint at the highlighted line. If not, the JDEE issues the
breakpoint command as soon as you start the debugger. If the
class in which the breakpoint is to be set is currently in memory
and the breakpoint is valid, the debugger sets the breakpoint.
If the class in which the breakpoint is set is not in memory,
the debugger puts it on a list of pending breakpoints. If the
class is subsequently loades, the debugger sets the breakpoint
in the class.
</para>
<sect3>
<title><anchor id="BreakpointColors"/>Breakpoint
Colors</title>
<para>
The color of a breakpoint highlight indicates the status of the breakpoint
as follows.
</para>
<table>
<title>Breakpoint Colors</title>
<tgroup cols="2">
<thead>
<row>
<entry>Color</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>Green</entry>
<entry>The JDEE has not yet issued a command to the
debugger to set the breakpoint.</entry>
</row>
<row>
<entry>Yellow</entry>
<entry>The breakpoint is pending loading of the class in which it
is to be set.</entry>
</row>
<row>
<entry>Red</entry>
<entry>The breakpoint has been set.</entry>
</row>
</tbody>
</tgroup>
</table>
</sect3>
<sect3>
<title><anchor id="ClearingBreakpoints"/>Clearing
Breakpoints</title>
<para>
To clear a breakpoint from a line in the current buffer, click
on the line and select <menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>Toggle Breakpoint</guimenuitem></menuchoice>
(<keycombo>
<keycap>C</keycap>
<keycap>c</keycap></keycombo>
<keycombo>
<keycap>C</keycap>
<keycap>a</keycap></keycombo>
<keycombo>
<keycap>C</keycap>
<keycap>b</keycap></keycombo>).
</para>
<para>To clear all breakpoints set in the current session,
select <menuchoice><guimenu>Jdb</guimenu> <guimenuitem>Clear
Breakpoints</guimenuitem></menuchoice>.
</para>
<note>
<para>You can also set and clear breakpoints by entering jdb
breakpoint commands in the jdb interaction buffer. See the
jdb documentation for information on using the jdb
breakpoint commands.</para>
</note>
</sect3>
</chapter>
<chapter>
<title><anchor id="SettingSourcePath"/>Setting the Source
Path</title>
<para>The <varname>jde-sourcepath</varname> variable specifies the
directories the JDEE should search for source for classes
visited by the debugger as you step through your program.
</para>
<para>To set this variable, enter <command>M-x customize-variable
jde-sourcepath</command>.
The customization buffer for jde-sourcepath appears. The buffer shows the current
source path as a list of paths.</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/debug2.gif"/>
</imageobject>
</mediaobject>
</screenshot>
<para>To add a path, click the <guibutton>INS</guibutton> button
corresponding to the position in the list and enter the path in
the resulting edit field. To delete a path, click the
<guibutton>DEL</guibutton> button
corresponding to the path. You can use environment variables in paths and
use dot notation to specify paths relative to the project file for the
project to which this sourcepath applies. When you are done editing the buffer,
press the <guibutton>State</guibutton> button to set the
variable.</para>
<para>To avoid having to specify the sourcepath every time you
start a session, save the setting of
<varname>jde-db-sourcepath</varname> in your
<filename>prj.el</filename> file (see <ulink
url="../jde-ug/jde-ug-content.html#SavingProjSettings">Saving
Project Settings</ulink>) To save the setting in your project
file, select
<menuchoice>
<guimenu>JDE</guimenu>
<guimenuitem>Project</guimenuitem><guimenuitem>Project
File</guimenuitem>
<guimenuitem>Save</guimenuitem></menuchoice> (<keycombo>
<keycap>C</keycap>
<keycap>c</keycap>
</keycombo>
<keycombo>
<keycap>C</keycap>
<keycap>v</keycap>
</keycombo>
<keycombo>
<keycap>C</keycap>
<keycap>p</keycap>
</keycombo>
). </para>
<para>
You must specify the paths of the top-level directories of any
source code that you might visit while debugging your
application. The source code directory structure must mirror
your application's package structure. For example, suppose that your
application includes a set of classes packaged in the
<filename>myapp</filename> directory. Then, the source for those
classes
must be reside in a directory named <filename>myapp</filename> and you
must
specify the path of <filename>myapp</filename>'s parent directory.
</para>
<para>If you want to step through the JDK source code,
select the source code install option when you install the JDK
and set the <varname>jde-sourcepath</varname> variable
to the top-level directory containing the source code.
The JDE will use the JDK's package structure to find the
source code in the subdirectories. </para>
</chapter>
<chapter>
<title><anchor id="DisplayingVariables"/>Displaying
Variables</title>
<para>This section shows you how to display the values of variables
(or expressions).</para>
<sect3>
<title><anchor id="DisplayingExpressions"/>Displaying
Expressions</title>
<para>When the debuggee program is stopped, the debugger lets
you display the value of any valid Java expression composed of
variables currently in scope. For example, to display the
value of a local, in-scope variable whose source is displayed
in a Java source buffer, put the point on the variable and
select
<menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>Display</guimenuitem>
<guimenuitem>Expression</guimenuitem>
</menuchoice>. The JDEE prompts you to enter an expression to be
evaluated and displayed in the minibuffer.</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/display_var1.gif"/>
</imageobject>
</mediaobject>
</screenshot>
<para> The default expression is the variable at point in the
source buffer. Edit the displayed expression and press
<keycap>Enter</keycap>. The JDEE issues a command to the
debugger to display the variable in the jdb buffer.</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/display_var2.gif"/>
</imageobject>
</mediaobject>
</screenshot>
</sect3>
<sect3>
<title><anchor id="DisplayingObjects"/>Displaying
Objects</title>
<para>To display the values of the fields of an object
referenced by an in-scope variable in the current source
buffer, and select
<menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>Display</guimenuitem>
<guimenuitem>Object</guimenuitem>
</menuchoice>. The JDEE prompts you to enter the name of the
variable in the minibuffer. The default is the variable at
point in the source buffer. Press <keycap>Enter</keycap>. The
JDEE issues a <command>dump</command> command to the debugger
to display the field values of the object referenced by the
variable you entered.</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/display_obj.gif"/>
</imageobject>
</mediaobject>
</screenshot>
</sect3>
<sect3>
<title><anchor id="DisplayingLocals"/>Displaying Locals
</title>
<para>To display the values of all in-scope local variables,
including the values of the arguments of the method in which
the program is halted, select
<menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>Display</guimenuitem>
<guimenuitem>Locals</guimenuitem>
</menuchoice>. The JDEE issues a <command>locals</command>
command to the debugger to display the local variable
values.</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/display_locals.gif"/>
</imageobject>
</mediaobject>
</screenshot>
</sect3>
</chapter>
<chapter>
<title><anchor id="SettingVariables"/>Setting
Variables</title>
<para>Jdb allows you to change the values of variables that are
in scope. To change the value of a variable via the JDEE's jdb
interface:</para>
<orderedlist>
<listitem>
<para>Position point on the variable you want to change.</para>
</listitem>
<listitem>
<para>Select <menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>Set Variable</guimenuitem>
</menuchoice>.
</para>
<para>The JDEE prompts you to enter a left expression that
represents the variable whose value you want to change. The
default is the variable at point in the source buffer.
</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/set_var1.gif"/>
</imageobject>
</mediaobject>
</screenshot>
<note>
<para>Edit the expression if necessary. For example, to set
the value of an array element at point, edit the
expression to include the index of the element.</para>
</note>
</listitem>
<listitem>
<para>Press <keycap>Enter</keycap>.</para>
<para>The JDEE prompts you to enter the new value of the
variable.</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/set_var2.gif"/>
</imageobject>
</mediaobject>
</screenshot>
</listitem>
<listitem>
<para>Enter the new value at the prompt in the minibuffer.</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/set_var3.gif"/>
</imageobject>
</mediaobject>
</screenshot>
</listitem>
<listitem>
<para>Press <keycap>Enter</keycap>.</para>
<para>The JDEE issues a <command>set</command> command to the
debugger to set the specified variable to the new
value.</para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata fileref="images/set_var4.gif"/>
</imageobject>
</mediaobject>
</screenshot>
</listitem>
</orderedlist>
</chapter>
<chapter>
<title><anchor id="DebugExternalProcesses"/>Debugging External
Processes</title>
<para>Normally jdb launches the application that it debugs.
However, you can use jdb to debug processes that are not
launched by jdb itself. This is useful, for example, if you need
to debug a process running on a remote computer or a Java
process launched by a nonJava process.</para>
<para>Jdb provides two
modes for debugging external processes: attach mode and listen
mode. When started in attach mode, jdb connects itself to the
external process. When started in listen mode, jdb waits for an
external process to connect itself to jdb. Each mode has
advantages. Attach mode allows you to debug an external process
anytime after it has started. Listen mode allows you to debug
the startup of a Java process launched by a nonJava process.</para>
<para>
The following sections explain how to use the JDEE's jdb
interface to run jdb in attach and listen mode.</para>
<sect3>
<title><anchor id="AttachingProcesses"/>Attaching
Processes</title>
<para>To attach jdb to an external process, you must ensure that the
external process is started in debug server mode. You must then
start jdb in attach mode.</para>
<sect4>
<title><anchor id="DebugServerMode"/>Starting the External
Process in Debug Server Mode</title>
<para>To start an external process in debug server mode, you
must start the vm that runs the process with the following
command-line options:</para>
<itemizedlist>
<listitem>
<para><literal>-Xdebug</literal></para>
</listitem>
<listitem>
<para>
<literal>-Xrunjdwp:transport=<keycap>TRANSPORT</keycap>,address=<keycap>ADDRESS</keycap>,server=y,suspend=<keycap>SUSPEND</keycap></literal>
</para>
<para>where</para>
<itemizedlist>
<listitem>
<para><literal><keycap>TRANSPORT</keycap></literal> is
the type of communications channel between jdb and
the debuggee process, either
<literal>dt_socket</literal> (socket) or
<literal>dt_shmem</literal> (shared memory, valid
only for Windows systems)</para>
</listitem>
<listitem>
<para><literal><keycap>ADDRESS</keycap></literal> is
the address of the socket port or shared memory area
used by the debuggee process to listen for a jdb
connection.</para>
</listitem>
<listitem>
<para><literal><keycap>SUSPEND</keycap></literal> is
either <literal>y</literal> (suspend the debuggee
process at startup, i.e., to wait for jdb to start,
a useful option when you need to debug an
application's startup code) or <literal>n</literal>
(do not suspend the debuggee process)</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<example>
<title>Specifying Socket Transport</title>
<para><literal>-Xdebug
-Xrunjdwp:transport=dt_socket,address=4444,server=y,suspend=n</literal></para>
</example>
<example>
<title>Specifying Shared Memory Transport (MS Windows only)</title>
<para><literal>-Xdebug
-Xrunjdwp:transport=dt_shmem,address=javadebug,server=y,suspend=n</literal></para>
</example>
<para>The JDEE customization variable,
<varname>jde-run-option-debug</varname>, causes
the JDEE to generate these arguments automatically when launching a vm to run a Java
application. Thus, if you plan to launch the debuggee process from the JDEE, you
should set this variable to the desired options.</para>
</sect4>
<sect4>
<title><anchor id="AttachMode"/>Starting jdb in Attach
Mode</title>
<para>To attach jdb to an existing process via a socket,
select <menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>External Process</guimenuitem>
<guimenuitem>Attach Via Socket</guimenuitem>
</menuchoice> from the Emacs menu bar. By default,
the JDEE uses the socket address specified by
the customization variable <varname>jde-db-option-connect-socket</varname>.
If you set this variable to Prompt (nil), the JDEE
prompts you to enter a socket address in the minibuffer.
</para>
<note>
<para>The default socket address specified by
<varname>jde-db-option-connect-socket</varname>
is the same as the default socket address specified
by <varname>jde-run-option-debug</varname>. Thus, if you
want to attach jdb to a process started by the JDEE, the
only variable you have to set is
<varname>jde-run-option-debug</varname> (to run
the debuggee process in socket attach mode).</para>
</note>
<para>To attach jdb to an existing process via a shared memory
connection (Windows platforms only),
select <menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>External Process</guimenuitem>
<guimenuitem>Attach Via Shared Memory</guimenuitem>
</menuchoice> from the Emacs menu bar. By default,
the JDEE uses the shared memory transport name specified by
the customization variable
<varname>jde-db-option-connect-shared-memory-name</varname>.
If you set this variable to Prompt (nil), the JDEE
prompts you to enter a shared-memory name in the minibuffer.
</para>
<note>
<para>The default shared memory name specified by
<varname>jde-db-option-connect-shared-memory-name</varname>
is the same as the default shared memory name specified
by <varname>jde-run-option-debug</varname>. Thus, if you
want to attach jdb to a process started by the JDEE, the
only variable you have to set is
<varname>jde-run-option-debug</varname> (to run
the debuggee process in shared memory attach mode).</para>
</note>
</sect4>
</sect3>
<sect3>
<title><anchor id="ListeningForProcesses"/>Listening for
Processes</title>
<para>To connect an external process to a jdb instance running in listener
mode:</para>
<orderedlist>
<listitem>
<para>Start jdb in listener mode (see <ulink
url="#ListenMode">Starting
jdb in Listen Mode</ulink>)</para>
</listitem>
<listitem>
<para>Start the debuggee process in debug client
mode(see <ulink url="#DebugClientMode">Starting
the External Process in Debug Client Mode</ulink>)</para>
</listitem>
</orderedlist>
<sect4>
<title><anchor id="ListenMode"/>Starting jdb in Listen
Mode</title>
<para>To start jdb in listen mode, select <menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>External Process</guimenuitem>
<guimenuitem>Listen For</guimenuitem>
</menuchoice> from the Emacs menu bar. By default, the
JDEE prompts you to enter the address of the process to
be debugged in the minibuffer. The JDEE customization variable
jde-db-option-listen-address allows you to specify a default
debuggee address. If you set this variable, the JDEE does not
prompt you to enter an address.
</para>
<para>To start jdb listening for existing process via a socket,
select <menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>External Process</guimenuitem>
<guimenuitem>Listen Via Socket</guimenuitem>
</menuchoice> from the Emacs menu bar. By default,
the JDEE uses the socket address specified by
the customization variable <varname>jde-db-option-connect-socket</varname>.
If you set this variable to Prompt (nil), the JDEE
prompts you to enter a socket address in the minibuffer.
</para>
<note>
<para>The default socket address specified by
<varname>jde-db-option-connect-socket</varname>
is the same as the default socket address specified
by <varname>jde-run-option-debug</varname>. Thus, if you
want jdb to listen for a process started by the JDEE, the
only variable you have to set is
<varname>jde-run-option-debug</varname>, i.e., to run
the debuggee process in socket listen (client) mode.</para>
</note>
<para>To start jdb listening for a process via a shared memory
connection (Windows platforms only),
select <menuchoice>
<guimenu>Jdb</guimenu>
<guimenuitem>External Process</guimenuitem>
<guimenuitem>Listen Via Shared Memory</guimenuitem>
</menuchoice> from the Emacs menu bar. By default,
the JDEE uses the shared memory transport name specified by
the customization variable
<varname>jde-db-option-connect-shared-memory-name</varname>.
If you set this variable to Prompt (nil), the JDEE
prompts you to enter a shared-memory name in the minibuffer.
</para>
<note>
<para>The default shared memory name specified by
<varname>jde-db-option-connect-shared-memory-name</varname>
is the same as the default shared memory name specified
by <varname>jde-run-option-debug</varname>. Thus, if you
want jdb to listen for a process started by the JDEE, the
only variable you have to set is
<varname>jde-run-option-debug</varname>, i.e., to run
the debuggee process in shared memory listen (client) mode.</para>
</note>
</sect4>
<sect4>
<title><anchor id="DebugClientMode"/>Starting the External
Process in Debug Client Mode</title>
<para>To start an external process in debug client mode, you
must start the vm that runs the process with the following
command-line options:</para>
<itemizedlist>
<listitem>
<para><literal>-Xdebug</literal></para>
</listitem>
<listitem>
<para>
<literal>-Xrunjdwp:transport=<keycap>TRANSPORT</keycap>,address=<keycap>ADDRESS</keycap>,server=n,suspend=<keycap>SUSPEND</keycap></literal>
</para>
<para>where</para>
<itemizedlist>
<listitem>
<para><literal><keycap>TRANSPORT</keycap></literal> is
the type of communications channel between jdb and
the debuggee process, either
<literal>dt_socket</literal> (socket) or
<literal>dt_shmem</literal> (shared memory, valid
only for Windows systems)</para>
</listitem>
<listitem>
<para><literal><keycap>ADDRESS</keycap></literal> is
the address of the socket port or shared memory area
used by jdb to listen for a debuggee process
connection.</para>
</listitem>
<listitem>
<para><literal><keycap>SUSPEND</keycap></literal> is
either <literal>y</literal> (suspend the debuggee
process when the connection occurs,
a useful option when you need to debug an
application's startup code) or <literal>n</literal>
(do not suspend the debuggee process)</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<example>
<title>Specifying Socket Transport</title>
<para><literal>-Xdebug
-Xrunjdwp:transport=dt_socket,address=4444,server=n,suspend=n</literal></para>
</example>
<example>
<title>Specifying Shared Memory Transport (MS Windows only)</title>
<para><literal>-Xdebug
-Xrunjdwp:transport=dt_shmem,address=javadebug,server=n,suspend=n</literal></para>
</example>
<para>The JDEE customization variable,
<varname>jde-run-option-debug</varname>, causes
the JDEE to generate these arguments automatically when launching a vm to run a Java
application. Thus, if you plan to launch the debuggee process from the JDEE, you
should set this variable to the desired options.</para>
</sect4>
</sect3>
</chapter>
<chapter>
<title><anchor id="DebugOptions"/>Debug Options</title>
<para>The JDEE allows you to specify debug options by setting JDEE
configuration variables. You can use the Emacs customization
feature to set debug variables interactively. To use the
customization feature, select <menuchoice>
<guimenu>Project</guimenu>
<guimenuitem>Options</guimenuitem>
<guimenuitem>Debug</guimenuitem></menuchoice> from the
<guimenu>JDE</guimenu> menu. (See <ulink
url="../jde-ug/jde-ug-content.html#ConfiguringJDE">Configuring
the JDEE</ulink> for more information on using the
customization feature). To save the compilation settings in the
project file (see <ulink
url="../jde-ug/jde-ug-content.html#UsingProjectFiles">Using
Project Files</ulink> for the current source buffer, select
<menuchoice>
<guimenu>Project</guimenu>
<guimenuitem>Project File</guimenuitem>
<guimenuitem>Save</guimenuitem></menuchoice> from the
<guimenu>JDE</guimenu> menu.</para>
<para>The following table lists the jdb customization variables.</para>
<table>
<title>Jdb Customization Variables</title>
<tgroup cols="3">
<thead>
<row>
<entry>Variable</entry>
<entry>Group</entry>
<entry>Usage</entry>
</row>
</thead>
<tbody>
<row>
<entry
valign="top"><varname>jde-debugger</varname></entry>
<entry valign="top">Project</entry>
<entry valign="top">Specify which debugger to use to debug the
current project.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-sourcepath</varname></entry>
<entry valign="top">Project</entry>
<entry valign="top">Specify location(s) of source files that
can be visited while stepping through a program.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-mode-hook</varname></entry>
<entry valign="top">Project</entry>
<entry valign="top">Customization hook for jde-db inferior
mode.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-global-classpath</varname></entry>
<entry valign="top">Project</entry>
<entry valign="top">Specify class paths for compile, run,
and debug commands.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-read-vm-args</varname></entry>
<entry valign="top">Project</entry>
<entry>Specifies whether to read debugger VM arguments from
the minibuffer.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-read-app-args</varname></entry>
<entry valign="top">Project</entry>
<entry>Specifies whether to read command-line application
arguments from the minibuffer.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-classpath</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Specifies the classpath for the
Java interpreter. This option overrides the
jde-global-classpath option.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-verbose</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Print messages about the running
process.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-properties</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Specify property values.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-heap-size</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Specify the initial and maximum size of
the interpreter heap.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-stack-size</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Specify size of the C and Java
stacks.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-garbage-</varname>
<varname>collection</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Specify garbage collection
options.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-java-profile</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Enable Java profiling.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-heap-profile</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Output heap profiling data.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-verify</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Verify classes.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-vm-args</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Specify command-line arguments to be
passed to the Java VM.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-application-args</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Specify command-line arguments to pass
to the application.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-connect-socket</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Specify socket address of a running process
to which you want to connect the debugger, using a
debugger attach or listen command.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-connect-shared-memory-name</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Specify shared memory name used by the debugger
to attach or listen for debuggee processes to debug.</entry>
</row>
<row>
<entry
valign="top"><varname>jde-db-option-host</varname></entry>
<entry valign="top">Debug</entry>
<entry valign="top">Host of a remote process to which you
wish to attach the debugger. This option is invalid for JDK verions
greater than JDK 1.1.x.</entry>
</row>
</tbody>
</tgroup>
</table>
</chapter>
</book>
<!--
Local Variables:
mode: xae
sgml-indent-step: 2
sgml-indent-data: t
sgml-set-face: t
sgml-insert-missing-element-comment: nil
End:
-->
1.1 XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/debug1.gif
<<Binary file>>
1.1 XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/debug2.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/debug_cursor.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/display_locals.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/display_obj.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/display_var1.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/display_var2.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/set_var1.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/set_var2.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/set_var3.gif
<<Binary file>>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jdb-ug/images/set_var4.gif
<<Binary file>>
1.6 +695 -160
XEmacs/packages/xemacs-packages/jde/doc/src/jde-ug/jde-ug-content.xml
Index: jde-ug-content.xml
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/doc/src/jde-ug/jde-ug-content.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- jde-ug-content.xml 2002/11/14 05:18:35 1.5
+++ jde-ug-content.xml 2006/03/03 20:41:10 1.6
@@ -20,7 +20,7 @@
<releaseinfo>
<remark>
- Revised for JDEE <productnumber>2.2.9</productnumber>
+ Revised for JDEE <productnumber>2.3.3</productnumber>
</remark>
</releaseinfo>
@@ -31,6 +31,7 @@
<year>2000</year>
<year>2001</year>
<year>2002</year>
+ <year>2003</year>
<holder>Paul Kinnucan</holder>
</copyright>
</bookinfo>
@@ -354,7 +355,8 @@
located on the system command path or have different names, you
must tell the JDEE where they are located. The JDEE provides
customization variables for specifying the locations of
- individual tools.</para>
+ individual tools.
+ </para>
<para>
However, if you are using one or more versions of Sun's JDK or a
@@ -365,9 +367,11 @@
JDK. The reason? Registering each version of the JDK allows you
to change JDKs by changing a single customization variable. The
following sections explain how to register and select
- JDKs.</para>
+ JDKs.
+ </para>
<sect3>
+
<title><anchor id="RegisterJDK"/>Registering a
JDK</title>
<para>To register a version of the JDK with the JDEE:</para>
@@ -518,7 +522,7 @@
<imagedata fileref="images/jdemenu.gif" width="544"
depth="350"/>
</imageobject>
<textobject>
- Screenshot showing the JDE menu.
+ <phrase>Screenshot showing the JDE menu.</phrase>
</textobject>
</mediaobject>
</screenshot>
@@ -526,6 +530,7 @@
</chapter>
+
<chapter>
@@ -1079,6 +1084,12 @@
many methods and fields.
</para>
+ <note>
+ <para>See <ulink url="#SpeedingUpCompletion">Speeding Up
Completion</ulink>
+ for some tips on how you can dramatically speed up field and
+ method completion.</para>
+ </note>
+
<para>
Completion works only for compiled classes that reside in the
classpath defined by <varname>jde-global-classpath</varname>,
@@ -1246,8 +1257,7 @@
</listitem>
<listitem>
- <para>Type the <command>C-c C-v
- C-.</command> key combination.</para>
+ <para>Type the <command>C-c C-v C-.</command> key
combination.</para>
<para>A menu of completions pops up.</para>
@@ -1305,7 +1315,7 @@
combination to invoke the command or <command>C-c C-v
C-.</command>, if you have selected this command as your
preferred completion method. The following examples use the
- <command>C-c C-v .</command> combination.
+ <command>C-c C-v .</command> combination.
</para>
@@ -1341,6 +1351,49 @@
</sect4>
+ <sect4>
+ <title><anchor id="SpeedingUpCompletion"/>Speeding Up
Completion</title>
+
+ <para>Here are two ways you can significantly speed up field
+ and method completion:
+ </para>
+ <itemizedlist>
+
+ <listitem>
+ <para>Byte-compile the eieio and JDEE packages.</para>
+
+ <para>The beanshell package, the Emacs interface to the
+ BeanShell, is based on the eieio object-oriented Lisp
+ package for Emacs. Completion uses the BeanShell heavily
+ to determine the class of the field or method at point.
+ Thus compiling eieio and beanshell.el improves
+ completion's performance, dramatically in my tests.
+ </para>
+
+ </listitem>
+
+ <listitem>
+ <para>Import by class, not by package, in your Java files.
+ </para>
+
+ <para>Every package import, e.g.,
+ <filename>java.util.*</filename>, requires invoking the
+ BeanShell to determine the fully qualified name of the
+ class at point (see
+ <function>jde-parse-get-qualified-name</function>).
+ A Beanshell invocation is by far the most time-consuming
+ operation required for completion. Thus eliminating the
+ use of package-level imports can significantly
+ speed up completion.
+ </para>
+
+ </listitem>
+
+ </itemizedlist>
+
+ </sect4>
+
+
</sect3>
<sect3>
@@ -1553,6 +1606,14 @@
from the list of classes considered for import.
</para>
+ <note>
+ <title>Thanks to ...</title>
+ <para><ulink url="mailto:trigg@cs.waikato.ac.nz">Len
+ Trigg</ulink> for contributing the initial
+ implementation of the import wizard.</para>
+ </note>
+
+
</sect4>
<sect4>
@@ -1604,8 +1665,7 @@
<menuchoice><guimenu>JDE</guimenu>
</menuchoice> menu or enter
<keycombo><keycap>M</keycap><keycap>x</keycap>
- </keycombo>
- <varname>jde-wiz-overrided-method</varname>.
+ </keycombo> <varname>jde-wiz-overrided-method</varname>.
</para>
<para>
<screenshot>
@@ -1765,7 +1825,7 @@
<guimenuitem>Implement Interface</guimenuitem>
</menuchoice> or enter
<keycombo><keycap>M</keycap><keycap>x
- </keycap></keycombo> <varname>jde-wiz-implement-interface</varname>.
+ </keycap></keycombo><varname>jde-wiz-implement-interface</varname>.
@@ -1800,6 +1860,14 @@
short pause the first time you use the wizard. </para>
</note>
+ <note>
+ <title>Thanks to ...</title>
+ <para><ulink url="mailto:friedman@lmi.net">Eric
+ Friedman</ulink> for creating the framework for the
+ interface, method override, and abstract class wizards and
+ for contributing the initial implementation of the
+ interface wizard.</para>
+ </note>
</sect4>
@@ -1845,7 +1913,7 @@
<guisubmenu>Wizards</guisubmenu>
<guimenuitem>Generate Get/Set Methods...</guimenuitem>
</menuchoice> or enter
- <keycombo><keycap>M</keycap><keycap>x
</keycap></keycombo>
+ <keycombo><keycap>M</keycap><keycap>x
</keycap></keycombo>
<varname>jde-wiz-get-set-methods</varname>
</para>
@@ -3329,11 +3397,12 @@
<para>You can temporarily override the setting of
<varname>jde-run-application-class</varname> by typing
- <varname>C-u</varname> before executing the <command
+ <varname>C-u -</varname> before executing the <command
moreinfo="none">jde-run</command> command, for example, by
- typing <varname>C-u C-c C-r</varname>. This causes the JDE to
+ typing <varname>C-u - C-c C-r</varname>. This causes the JDE to
prompt you to enter the <emphasis>fully qualified
- name</emphasis> of the application's main class.</para>
+ name</emphasis> of the application's main class (as well
+ application arguments if any).</para>
</sect3>
@@ -3438,17 +3507,23 @@
<title><anchor id="RunAppArgs"/> Setting Command-Line
Application Arguments</title>
-
- <para>If you set the customization variable
- <varname>jde-run-read-app-args</varname> to a
- non-<varname>nil</varname> value, the JDE compile command
- prompts you to enter command-line application arguments in the
- minibuffer. It appends the options that you enter to the
+ <para>Specifying a prefix argument before the
+ <command>jde-run</command>, e.g., <varname>C-u C-c C-v
+ C-r</varname> causes the command to prompt you to enter
+ arguments to be passed to the application's main
+ method. The command appends the options that you enter to the
arguments specified via the customization variable
<varname>jde-run-option-application-args</varname>. The JDE
saves the arguments that you enter in a minibuffer history
list. You can recall previously entered options by pressing
the up or down arrows on your keyboard. </para>
+
+ <para>If you set the customization variable
+ <varname>jde-run-read-app-args</varname> to a
+ non-<varname>nil</varname> value, the JDE run command
+ prompts you to enter command-line application arguments
+ by default, i.e., you do not have to specify a prefix
+ argument each time you execute the command.</para>
</sect3>
<sect3>
@@ -3466,8 +3541,8 @@
<imagedata fileref="images/excepttrace.gif"/>
</imageobject>
<textobject>
- Screenshot showing an exception trace in the
- JDE's run buffer.
+ <phrase>Screenshot showing an exception trace in the
+ JDE's run buffer.</phrase>
</textobject>
</mediaobject>
</screenshot>
@@ -3850,8 +3925,8 @@
<itemizedlist>
<listitem>
<para>An Emacs interface to <command>jdb</command>, the command-line
- debugger that comes with the JDK. See <ulink
url="../jdb-ug/jdb-guide.html"
- type="jdb-guide">Debugging with jdb</ulink> for more
+ debugger that comes with the JDK. See <ulink
url="../jdb-ug/jdb-ug-frame.html"
+ type="jdb-ug">Debugging with jdb</ulink> for more
information. </para>
</listitem>
@@ -4657,8 +4732,12 @@
<listitem>
<para>Source for the parent of the class at point</para>
</listitem>
+ <listitem>
+ <para>Source for an interface implemented by the class at point</para>
+ </listitem>
<listitem>
- <para>Source for an interface implemented by esthe class at point</para>
+ <para>All methods that invoke a specifed method (see <ulink
url="#Xref">Cross-Referencing
+ Classes</ulink>)</para>
</listitem>
</itemizedlist>
@@ -4991,6 +5070,231 @@
</sect3>
+
+ <sect3>
+ <title><anchor id="Xref"/>Cross-Referencing
Classes</title>
+
+
+ <para>JDE includes a facility for creating and utilizing a
+ cross-referencing database to enable you to quickly locate all
+ the callers of any particular function. This functionality is
+ very useful for quickly figuring how unfamiliar code works,
+ and useful for doing certain tasks such as renaming functions.
+ Be advised that this only finds direct callers, and cannot
+ detect calls via Java's reflection mechanism. The
+ cross-reference database must be kept in sync with the project
+ code, however the database generation is generally quick. The
+ remainder of this section explains how to configure and use
+ the cross-referencer.</para>
+
+ <note>The JDEE's cross-referencing facility was developed by Andrew
Hyatt.</note>
+
+
+ <sect4>
+ <title><anchor id="ConfigXRef"/>Configuring the
Cross-Referencer</title>
+
+ <para>JDE's cross-referencing database is built by examining
+ class files for a particular project. To this end, JDE
+ needs to know where the built class files for a project
+ live. This is usually a subset of the classpath.
+ </para>
+
+ <para>Then select JDE->Options->Project->General, and go to
+ the "Jde Built Class Path" option. Insert one path for each
+ place where built classes wind up. You can add both
+ directories and zip files (jar/bar/etc). Any file entered
+ will be assumed to be a zip file.</para>
+
+ <para>Now that you have the built class path defined, you can
+ configure the cross-referencer that uses it. Type M-x
+ jde-xref-customize. The following are a list the variables
+ that can be set, and what they do:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para><varname>jde-xref-db-base-directory</varname></para>
+
+ <para>The cross-referencer creates a database to
+ store the cross-reference information. This variable
+ defines a directory where that information resides. It
+ might, for example, be at the base of your project tree,
+ in a directory called xrefdb
+ </para>
+ </listitem>
+
+ <listitem>
+ <para><varname>jde-xref-store-prefixes</varname></para>
+
+ <para>To reduce database size,
+ it's useful to ignore all information that doesn't refer
+ to code you care about. For example, most people don't
+ need to know who calls java.lang.System.out.println. To
+ not store this information, insert a package prefix for
+ each package you are interested in. Typically, this may
+ be just one string, for example "com.mycompany", to
+ store only code that references com.mycompany
+ classes.</para>
+ </listitem>
+
+ <listitem>
+ <para><varname>jde-xref-cache-size</varname></para>
+ <para>The caller database can be quite large. However, it
+ is useful for efficiency reasons to keep part of it in
+ memory. This variable deterines how many packages to
+ keep in memory simulatenously. The higher this is, the
+ faster things will be, but also the more memory will be
+ taken up by the cross-reference information.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </sect4>
+
+ <sect4>
+
+ <title><anchor id="BuildingXRefDB"/>Building the Cross-Reference
Database</title>
+
+
+ <para>The next step into getting the cross-reference
+ functionality working is to build the cross-reference
+ database. The project must be fully built for this to work,
+ since it takes cross-reference information directly from the
+ built classes.
+ </para>
+
+ <para>To build the database, type <command>M-x
jde-xref-make-xref-db</command></para>
+
+ <para>If all the settings are properly configured, JDE will go
+ off and create the cross-reference database. This can take
+ from a few seconds to several minutes depending on the size
+ of your project. Large class files may take long to parse,
+ so if it seems to be "stuck", please give it time.
+ </para>
+
+ <para>When it is done, it will save the database in the base
+ directory specified in the jde-xref customization group.
+ </para>
+
+ </sect4>
+
+ <sect4>
+
+ <title><anchor id="UsingXRefDB"/>Using the Cross-Reference
Database</title>
+
+
+ <para>There are several basic operations that use the
+ cross-reference database:
+ </para>
+
+
+ <itemizedlist>
+
+ <listitem>
+
+ <para><command>M-x jde-xref-first-caller (C-c C-v a)</command>
+ </para>
+
+ <para> If your cursor is in the body of a function, then
+ this will go to the first in a sequence of callers to
+ this function. If there are no callers, there will be a
+ message saying so.
+ </para>
+
+ </listitem>
+
+
+ <listitem>
+ <para><command>M-x jde-xref-next-caller (C-c C-v
n)</command></para>
+
+ <para> After calling <command>jde-xref-first-caller</command>, you
can go to
+ each of the callers in sequence with this function. The
+ first caller function creates a list of callers and goes
+ to the first one. This navigates to the next caller on
+ the list. You can keep calling this until there are no
+ more callers, in which case there will be a message
+ saying so.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para><command>M-x jde-xref-display-call-tree</command>
+ </para>
+
+ <para>This displays an interactive tree view of the
+ function you are in, and it's callers. Each level down
+ will show you who calls the parent function. In this
+ way you can quickly get an overview of the context in
+ which the current function is used in. Each item in the
+ tree will take you to it's definition if it is clicked
+ on.
+ </para></listitem>
+
+ <listitem>
+
+ <para><command>M-x
jde-xref-list-uncalled-functions</command></para>
+
+ <para> Called from a java file, this lists all the
+ functions in the file that have no apparent callers.
+ It's important to remember that because of Java
+ reflection, there is no guarantee that the functions are
+ truly uncalled. It only means they are not called
+ directly.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>All of these functions have two modes, a strict and
+ non-strict mode. In non-strict mode, the default, more
+ potential callers are treated as callers, including those
+ that call an interface that the function implements, or who
+ call a superclass's function you are overriding. For
+ example, if you are in Foo.doSomething(), and foo implements
+ IFoo, and a caller calls IFoo.doSomething(), then this is
+ treated as a caller in non-strict mode. Also, if you are in
+ Foo.doSomething, and Foo's superclass is Bar, and there is a
+ Bar.doSomething(), then Bar.doSomething() is treated as a
+ caller in non-strict mode. In strict mode, however, the
+ caller must specify the function directly for it to be
+ considered a hit. To run these functions with strict mode,
+ type C-u M-x and then the function-name. So C-u M-x
+ jde-xref-list-uncalled-functions will list only functions
+ that are uncalled directly.
+ </para>
+
+ </sect4>
+
+
+ <sect4>
+
+ <title><anchor id="UpdatingXRefDB"/>Updating the Cross-Reference
Database</title>
+
+
+ <para>As the code changes, the cross-referencer must be kept
+ up to date, or else the jde-xref functions will start taking
+ you to incorrect places in files, and the callers list
+ itself will become incorrect. As you change the code, you
+ can call M-x jde-xref-update after a recompile, and it will
+ go through and recompute just the part of the database you
+ have changed.
+ </para>
+
+ <para>Another, easier way to update, for those of us who leave
+ their emacs running all the time, is to add a line such as
+ this in their .emacs
+ </para>
+
+ <programlisting>
+ (run-at-time "11:00pm" 86400 'jde-xref-make-xref-db)
+ </programlisting>
+
+ </sect4>
+
+
+ </sect3>
+
+
<sect3>
@@ -5080,24 +5384,22 @@
<para> The following section explains how to use the Emacs
customization feature to set the value of a JDE customization
variable.</para>
-
- </sect3>
- <sect3>
+ <sect4>
<title><anchor id="SettingVariable"/> Setting a
Variable</title>
- <para>
- To set a JDE customization variable:
- </para>
+ <para>
+ To set a JDE customization variable:
+ </para>
- <procedure>
- <step>
- <para>Determine the name of the variable you want to customize.</para>
- <para> Refer to the section of this guide that documents the feature
- you want to customize for the name of the corresponding variable. Or
+ <procedure>
+ <step>
+ <para>Determine the name of the variable you want to customize.</para>
+ <para> Refer to the section of this guide that documents the feature
+ you want to customize for the name of the corresponding variable. Or
type
<keycombo><keycap>C</keycap><keycap>h</keycap></keycombo>
<keysym>v</keysym> followed by the JDE group prefix
(<varname>jde-</varname>) or subgroup prefix (e.g.,
@@ -5106,10 +5408,10 @@
Emacs displays all variables belonging to the JDE group or subgroup. You
can then browse this list, using Emacs search, completion, and
documentation display command, to find the applicable variable.
- </para>
- </step>
+ </para>
+ </step>
- <step>
+ <step>
<para>Display a customization buffer for the variable. </para>
<para> If you know the name of the variable, the easiest way to
display a customization buffer for the variable is to select
@@ -5165,118 +5467,133 @@
</para>
</note>
</step>
- </procedure>
+ </procedure>
- </sect3>
-
- <sect3>
- <title><anchor id="SpecifyingPaths"/>Specifying
Paths</title>
- <para>You can use paths containing environment variables and
- or a tilde (~), cygwin paths, and relative paths as a
- value of any JDE customization variable
- that requires a path.</para>
+ </sect4>
<sect4>
- <title><anchor id="EnvVarsInPaths"/>Environment
Variables</title>
- <para>The JDE accepts paths that contain envirnoment variables, for
- example, </para>
+ <title><anchor id="SpecifyingPaths"/>Specifying
Paths</title>
+ <para>You can use paths containing environment variables and
+ or a tilde (~), cygwin paths, and relative paths as a value
+ of any JDE customization variable that requires a
+ path.</para>
- <para>
- <programlisting format="linespecific">
- $JDK_HOME/src
- </programlisting>
- </para>
+ <sect5>
+ <title><anchor id="EnvVarsInPaths"/>Environment
Variables</title>
+ <para>The JDE accepts paths that contain envirnoment variables, for
+ example, </para>
- <para>
- The JDE replaces the environment variables with their actual
- values before passing the paths to commands (e.g., javac) that
- require them. You must use Unix notation (i.e.,
- <varname>$VARNAME</varname> or <varname>${VARNAME}</varname>)
- to specify an environment variable in a path even on Windows.
+ <para>
+ <programlisting format="linespecific">
+ $JDK_HOME/src
+ </programlisting>
+ </para>
+
+ <para>
+ The JDE replaces the environment variables with their
+ actual values before passing the paths to commands (e.g.,
+ javac) that require them. You must use Unix notation
+ (i.e., <varname>$VARNAME</varname> or
+ <varname>${VARNAME}</varname>) to specify an environment
+ variable in a path even on Windows.
</para>
- </sect4>
+ </sect5>
- <sect4>
- <title><anchor id="TildeNotation"/>Tilde (~)
Notation</title>
- <para>The JDE accepts paths that begin with a tilde, for example,
- <filename>~/myproj/classes</filename>. The JDE replaces the tilde
- with the path to your home directory.</para>
- </sect4>
+ <sect5>
+ <title><anchor id="TildeNotation"/>Tilde (~)
Notation</title>
+ <para>The JDE accepts paths that begin with a tilde, for example,
+ <filename>~/myproj/classes</filename>. The JDE replaces the tilde
+ with the path to your home directory.</para>
+ </sect5>
- <sect4>
- <title><anchor id="RelativePaths"/>Relative Paths</title>
- <para>A relative path is a path that begins with a period, for
+ <sect5>
+ <title><anchor id="RelativePaths"/>Relative Paths</title>
+ <para>A relative path is a path that begins with a period, for
example, <filename>./src</filename>. If
<varname>jde-resolve-relative-paths</varname> is
set to a non-nil value (the default), the JDE converts a relative
path to an absolute path by appending the relative path to the
path of the project file that set the path variable, or if no such
file exists, to the path of the current Java source buffer.</para>
- </sect4>
- <sect4>
- <title><anchor id="CygwinPaths"/>Cygwin Paths</title>
- <para>You can use cygwin style paths in JDE classpath variables
+ <para>
+ You can use your <filename>.emacs</filename> file to
+ specify default relative paths for projects. For example,
+ setting <varname>jde-global-classpath</varname> to
+ <filename>./classes</filename> in your
+ <filename>.emacs</filename> file specifies that the
+ default location of class files is in a subdirectory of
+ the project file directory named <filename>classes</filename>.
+ </para>
+ </sect5>
+
+ <sect5>
+ <title><anchor id="CygwinPaths"/>Cygwin Paths</title>
+ <para>You can use cygwin style paths in JDE classpath variables
on Windows. The JDE converts such paths to DOS paths before
using them, using a conversion function that you can specify.</para>
- <para>The jde-cgywin-path-converter variable allows you
+ <para>The jde-cgywin-path-converter variable allows you
to choose the path conversion function used by the JDE.</para>
- <itemizedlist>
- <listitem>
- <para><function moreinfo="none">
+ <itemizedlist>
+ <listitem>
+ <para><function moreinfo="none">
jde-cygwin-path-converter-internal</function></para>
- <para>This is the default path conversion function used by
+ <para>This is the default path conversion function used by
the JDE. It converts any paths of the form
<varname>//[a-z]/</varname>
or <varname>//cygdrive/[a-z]/</varname> to the corresponding DOS form.
For
example it converts <varname>/c/jde/java/classes</varname> to
<varname>c:/jde/java/classes</varname>.
- </para>
- </listitem>
- <listitem>
- <para><function
moreinfo="none">jde-cygwin-path-converter-cygpath</function></para>
- <para>This function invokes the cygwin
<function>cygpath</function> utility to
- perform the path conversion. The advantage is that the cygwin path utility can
- recognize and convert Unix style paths that represent mount points in the cygwin
- mount table. For example, suppose that you have mounted
- <varname>d:/javadev</varname> as
<varname>/javadev</varname> in
- the cygwin mount table. Then choosing
- <function
moreinfo="none">jde-cygwin-path-converter-cygpath</function>
- allows you to use paths beginning with <varname>/javadev</varname> in
JDE classpaths. The
- drawback is that the conversion is slow as it requires running the cygwin utility
- for each Unix-style path to be converted.</para>
- </listitem>
- <listitem>
- <para>A custom conversion function that you supply.</para>
- </listitem>
- </itemizedlist>
-
- </sect4>
+ </para>
+ </listitem>
+ <listitem>
+ <para><function
moreinfo="none">jde-cygwin-path-converter-cygpath</function></para>
+ <para>This function invokes the cygwin
+ <function>cygpath</function> utility to perform the
+ path conversion. The advantage is that the cygwin path
+ utility can recognize and convert Unix style paths
+ that represent mount points in the cygwin mount table.
+ For example, suppose that you have mounted
+ <varname>d:/javadev</varname> as
+ <varname>/javadev</varname> in the cygwin mount table.
+ Then choosing <function
+ moreinfo="none">jde-cygwin-path-converter-cygpath</function>
+ allows you to use paths beginning with
+ <varname>/javadev</varname> in JDE classpaths. The
+ drawback is that the conversion is slow as it requires
+ running the cygwin utility for each Unix-style path to
+ be converted.</para>
+ </listitem>
+ <listitem>
+ <para>A custom conversion function that you supply.</para>
+ </listitem>
+ </itemizedlist>
+ </sect5>
- </sect3>
+ </sect4>
- <sect3>
+ <sect4>
<title><anchor id="JDECustomizationGroups"/> JDE Customization
Groups</title>
- <para>The JDE defines a top-level customization group, the JDE Group,
- for JDE customization variables. The JDE Group itself contains
- the following subgroups:</para>
+ <para>The JDE defines a top-level customization group, the JDE
+ Group, for JDE customization variables. The JDE Group itself
+ contains the following subgroups:</para>
- <sect4>
+ <sect5>
- <title><anchor id="CompileOptionGroup"/> Compile Option
- Group</title>
+ <title><anchor id="CompileOptionGroup"/> Compile Option
+ Group</title>
- <para>Specifies compile options corresponding to the
+ <para>Specifies compile options corresponding to the
command-line arguments (e.g., -d) accepted by the JDK
compiler, javac. When you execute the JDE compile command,
the JDE uses the settings of this group to construct a list
@@ -5292,41 +5609,38 @@
Project</guisubmenu>-<guisubmenu>Options</guisubmenu>
<guimenuitem>Compile</guimenuitem></menuchoice> from the
<productname>Emacs</productname> menubar. </para>
- </sect4>
+ </sect5>
- <sect4>
+ <sect5>
- <title><anchor id="CompileOptionGroup"/>Run Option
- Group</title>
+ <title><anchor id="CompileOptionGroup"/>Run Option
Group</title>
- <para>Specifies run-time options corresponding to the
- command-line arguments (for example, -classpath) accepted by
- the JDK virtual machine, java. When you execute the JDE Run
- command, the JDE uses the settings of this group to
- construct a list of command-line arguments that it passes to
- the Java interpreter used by the JDE to run applications.
- This group also contains options for specifying non-java
- command-line arguments (in case you want to use a VM that
- accepts a different set of arguments than java does) and for
- specifying arguments to be passed to the application (as
- opposed to the virtual machine interpreting the
- application.) You can display the customization buffer for
- the Run Option Group by selecting
- <menuchoice><guimenu>JDE</guimenu>
-
<guisubmenu>Project</guisubmenu>-<guisubmenu>Options</guisubmenu>
- <guimenuitem>Run</guimenuitem></menuchoice>
- from the <productname>Emacs</productname> menubar. </para>
- </sect4>
-
- <sect4>
-
+ <para>Specifies run-time options corresponding to the
+ command-line arguments (for example, -classpath) accepted
+ by the JDK virtual machine, java. When you execute the JDE
+ Run command, the JDE uses the settings of this group
+ to construct a list of command-line arguments that it
+ passes to the Java interpreter used by the JDE to run
+ applications. This group also contains options for
+ specifying non-java command-line arguments (in case you
+ want to use a VM that accepts a different set of arguments
+ than java does) and for specifying arguments to be passed
+ to the application (as opposed to the virtual machine
+ interpreting the application.) You can display the
+ customization buffer for the Run Option Group by selecting
+ <menuchoice><guimenu>JDE</guimenu>
+
<guisubmenu>Project</guisubmenu>-<guisubmenu>Options</guisubmenu>
+ <guimenuitem>Run</guimenuitem></menuchoice> from the
+ <productname>Emacs</productname> menubar. </para>
+ </sect5>
+ <sect5>
- <title><anchor id="DebugOptionGroup"/> Debug Option
Group</title>
+ <title><anchor id="DebugOptionGroup"/>Debug Option
Group</title>
- <para>Specifies run-time options corresponding to the command-line
+ <para>Specifies run-time options corresponding to the command-line
arguments (for example, -classpath) accepted by the JDK debugger,
jdb. jdb accepts the same command-line arguments as java. However,
the JDE maintains two parallel sets of configuration variables
@@ -5341,18 +5655,18 @@
<guisubmenu>Project</guisubmenu>-<guisubmenu>Options</guisubmenu>
<guimenuitem>Debug</guimenuitem></menuchoice>
from the <productname>Emacs</productname> menubar. </para>
- </sect4>
+ </sect5>
- <sect4>
+ <sect5>
<title> <anchor id="AutocodeGroup"/>Autocode
Group</title>
- <para>Specifies templates used to generate code automatically. </para>
- </sect4>
+ <para>Specifies templates used to generate code automatically. </para>
+ </sect5>
- <sect4>
+ <sect5>
<title><anchor id="GeneralGroup"/> General Options
Group</title>
@@ -5364,27 +5678,29 @@
<guisubmenu>Project</guisubmenu>-<guisubmenu>Options</guisubmenu>
<guimenuitem>General</guimenuitem></menuchoice>
from the <productname>Emacs</productname> menubar. </para>
+ </sect5>
+
</sect4>
- </sect3>
- </chapter>
- <chapter>
+ </sect3>
+ <sect3>
<title><anchor id="Customizingjde_mode"/> Customizing
jde-mode</title>
- <para>The JDE defines a major mode, named jde-mode, for editing Java
- source files. This mode derives from the standard Emacs Java
- source editing mode java-mode. In particular, it inherits all the
- functions and customization variables defined by java-mode and
- adds its own customization variables. When you load a Java source
- file, Emacs runs a JDE mode initialization function called jde-mode.
- The jde-mode function in turn calls the Java mode intialization
- function, java-mode. The last thing that jde-mode does before
- returning is to call a JDE mode function, if it exists. You can
- customize the JDE by defining a JDE mode hook function in your .emacs
- file. The following is an example of how to do this: </para>
+ <para>The JDE defines a major mode, named jde-mode, for editing
+ Java source files. This mode derives from the standard Emacs
+ Java source editing mode java-mode. In particular, it inherits
+ all the functions and customization variables defined by
+ java-mode and adds its own customization variables. When you
+ load a Java source file, Emacs runs a JDE mode initialization
+ function called jde-mode. The jde-mode function in turn calls
+ the Java mode intialization function, java-mode. The last
+ thing that jde-mode does before returning is to call a JDE
+ mode function, if it exists. You can customize the JDE by
+ defining a JDE mode hook function in your .emacs file. The
+ following is an example of how to do this: </para>
<programlisting>
@@ -5402,7 +5718,7 @@
setting a custom indentation style. </para>
- <sect3>
+ <sect4>
<title><anchor id="Keybindings"/> Customizing Key
Bindings</title>
@@ -5465,9 +5781,228 @@
settings in your project file, switch to a source buffer and choose
<menuchoice><guimenu>JDE</guimenu><guisubmenu>
Options</guisubmenu><guimenuitem>Save
Project</guimenuitem></menuchoice> from the Emacs menubar.
</para>
- </step>
- </procedure>
+ </step>
+ </procedure>
+ </sect4>
+ </sect3>
+
+ </chapter>
+
+ <chapter>
+ <title><anchor id="Plugins"/>Creating and Installing
Plugins</title>
+
+ <para>Plugins are independently developed applications intended
+ for use with the JDEE and distributed in the form of a (g)zip or
+ jar file. The following sections explain how to create and install
+ plugins.
+ </para>
+
+ <sect3>
+
+ <title><anchor id="InstallingPlugins"/>Installing a
Plugin</title>
+
+ <para>To install a plugin:</para>
+
+ <orderedlist>
+ <listitem>
+ <para>Copy the zip or jar file containing the plugin in to
+ the JDEE's plugins directory.</para>
+
+ <note>
+ <para>By default the JDEE plugin directory is a
+ subdirectory of the JDEE directory named
+ <filename>plugins</filename>. If you want to keep your
+ plugins in another directory, set
+ <varname>jde-plugins-directory</varname> to the path of
+ that directory.</para>
+ </note>
+
+ </listitem>
+
+ <listitem>
+
+ <para>Execute <command>M-h
jde-pi-install-plugins</command>.</para>
+ <para>This command installs any plugins at the top level of the plugins
+ directory in the plugins directory.</para>
+
+ </listitem>
+
+ </orderedlist>
+
+ <para>If the plugin adds any menu items to the JDEE's plugins menu
+ (named <guimenu>JDEpi</guimenu>), you should now be able to see the
+ items on the plugins menu.</para>
+
</sect3>
+
+ <sect3>
+
+ <title><anchor id="CreatingPlugins"/>Creating a
Plugin</title>
+
+ <para>The following sections explain how to create a JDEE
plugin.</para>
+
+ <sect4>
+
+ <title><anchor id="PluginRequirements"/>Plugin
Requirements</title>
+
+ <para>A JDEE plugin must meet the following requirements:</para>
+
+ <sect5>
+
+ <title>Packaging</title>
+
+ <para>The plugin must be distributed as a compressed file that can be
+ decompressed by Java's jar program. Compressed file formats that meet this
+ requirement include zip, gzip, and jar.
+ </para>
+
+ </sect5>
+
+ <sect5>
+
+ <title>Directory Structure</title>
+
+ <para>Decompressing the plugin should create a subdirectory in the
+ current directory whose name is the plugin's name and that contains
+ at least one directory named <filename>lisp</filename>. The
+ plugin directory can contain any number of other directories.
+ The other directories can have any names. However, it would be
+ nice if plugins standardized on the following directory structure
+ and names.
+ </para>
+
+ <programlisting>
+
+ plugin
+ bsh
+ doc
+ scripts
+ help
+ info
+ html
+ src (e.g., xml files used to generate info and html)
+ java
+ class
+ doc
+ lib (e.g, jar files)
+ src
+ lisp
+ </programlisting>
+
+
+ </sect5>
+
+ <sect5>
+
+ <title>Bootstrap File</title>
+
+ <para>The plugin's lisp directory must contain a Lisp file
+ named <filename>jde-PLUGIN.el </filename>where PLUGIN is
+ the same as the plugin's toplevel directory name. This
+ file is called a bootstrap file because it is the only
+ file directly loaded by the JDEE. It is responsible for
+ registering the plugin with the JDEE and loading any other
+ Lisp files required by the plugin.</para>
+
+ </sect5>
+
+ </sect4>
+
+ <sect4>
+
+ <title><anchor id="RegisteringPlugin"/>Registering a
Plugin</title>
+
+ <para>A plugin's bootstrap file must register the plugin with
+ the JDEE when it is loaded. The bootstrap file should do
+ this by invoking the JDEE's
+ <function>jde-pi-register</function> function. This function
+ takes a single argument: an instance of
+ <varname>jde-plugin</varname> class that optionally
+ specifies the plugin's menu and its contribution to the
+ classpath of the instance of the BeanShell run by the
+ JDEE. </para>
+
+ </sect4>
+
+ <sect4>
+ <title>Running Java Code from a Plugin</title>
+
+ <para>A plugin can use the JDEE's instance of the BeanShell to
+ invoke Java methods and display their output in an Emacs
+ buffer. The JDEE provides the following functions for this
+ purpose:</para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para><function>jde-jeval</function></para>
+ <para>Evaluate a Java statement in the JDEE's BeanShell
+ instance and return the resulting BeanShell
+ output.</para>
+ </listitem>
+
+ <listitem>
+ <para><function>jde-jeval-r</function></para>
+ <para>Evaluate a Java statement in the JDEE's BeanShell
+ instance, use the Emacs Lisp interpreter to evaluate the
+ resulting BeanShell output, and return the result. This
+ function assumes that the Java statement emits Emacs
+ Lisp code, i.e., that the Java code was developed
+ specifically to cause Emacs to do something.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para><function>jde-jeval-cm</function></para>
+ <para>Evaluate a Java statement in the JDEE's BeanShell
+ instance and display the resulting BeanShell output in
+ an Emacs compilation buffer. This function is intended
+ to run Java applications, such as style checkers, that
+ output error messages keyed to specific lines in a
+ source file.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>See the doc strings for these functions for more information.</para>
+
+
+ </sect4>
+
+
+ <sect4>
+
+ <title><anchor id="BootstrapExample"/>Bootstrap File
Example</title>
+
+ <para>
+ The following is an example of the bootstrap file
+ for a plugin named pi1.</para>
+
+ <programlisting>
+
+ ;; jde-pi1.el
+ (defun jde-pi1-cmd ()
+ (interactive)
+ (message "plugin 1"))
+
+ (jde-pi-register
+ (jde-plugin
+ "pi1"
+:bsh-cp (list
+ (expand-file-name "lib/lib1.jar" (jde-pi-get-plugin-dir "pi1"))
+ (expand-file-name "lib/lib2.jar" (jde-pi-get-plugin-dir "pi1")))
+:menu-spec (list (list "Pi1" ["cmd" jde-pi1-cmd :active t]))))
+
+
+ (provide 'jde-pi1)
+
+ </programlisting>
+
+ </sect4>
+
+ </sect3>
+
</chapter>
</book>
1.1
XEmacs/packages/xemacs-packages/jde/doc/src/jde-ug/images/keybindings.gif
<<Binary file>>
1.2 +1 -1
XEmacs/packages/xemacs-packages/jde/doc/src/styles/html/jdebook_html_toc.xsl
Index: jdebook_html_toc.xsl
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/doc/src/styles/html/jdebook_html_toc.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- jdebook_html_toc.xsl 2001/02/16 05:53:44 1.1
+++ jdebook_html_toc.xsl 2006/03/03 20:41:19 1.2
@@ -45,7 +45,7 @@
<td>
<a>
<xsl:attribute name="href">
-<xsl:text>jde-ug-content.html#</xsl:text><xsl:value-of
select="anchor/@id"/>
+<xsl:text>jde-ug-content.html#</xsl:text><xsl:value-of
select="title/anchor/@id"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>content</xsl:text>
1.3 +1 -1
XEmacs/packages/xemacs-packages/jde/doc/src/styles/html/jdebook_toc.xsl
Index: jdebook_toc.xsl
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/doc/src/styles/html/jdebook_toc.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- jdebook_toc.xsl 2002/09/14 03:20:23 1.2
+++ jdebook_toc.xsl 2006/03/03 20:41:19 1.3
@@ -10,7 +10,7 @@
<xsl:template match="/">
-<xsl:text>0 ; JDE Website ; 14 ; 3 ;
http://sunsite.auc.dk/jde/
; _top
+<xsl:text>0 ; JDEE Website ; 14 ; 3 ;
http://jdee.sunsite.dk ;
_top
</xsl:text>
<xsl:for-each select="book/chapter">
<xsl:text>0 ; </xsl:text><xsl:value-of
select="normalize-space(title)"/><xsl:text> ; 0 ;
../html/jde-ug/jde-ug-content.html#</xsl:text><xsl:value-of
select="title/anchor/@id"/><xsl:text>
1.5 +20 -16 XEmacs/packages/xemacs-packages/jde/doc/tli_rbl/txt/jde-ug-toc.txt
Index: jde-ug-toc.txt
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/doc/tli_rbl/txt/jde-ug-toc.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- jde-ug-toc.txt 2002/09/14 03:20:24 1.4
+++ jde-ug-toc.txt 2006/03/03 20:41:23 1.5
@@ -1,4 +1,4 @@
-0 ; JDE Website ; 14 ; 3 ;
http://sunsite.auc.dk/jde/ ; _top
+0 ; JDEE Website ; 14 ; 3 ;
http://jdee.sunsite.dk ; _top
0 ; Introduction ; 0 ; ../html/jde-ug/jde-ug-content.html#Intro
1 ; About the JDEE ; 3 ; ../html/jde-ug/jde-ug-content.html#AboutJDE
1 ; JDE Requirements ; 3 ; ../html/jde-ug/jde-ug-content.html#JDERequirements
@@ -27,6 +27,7 @@
2 ; Selecting a Completion Method ; 3 ;
../html/jde-ug/jde-ug-content.html#SelectStdCompletionMethod
2 ; Using Menu-Based Completion ; 3 ; ../html/jde-ug/jde-ug-content.html#MenuCompletion
2 ; Using In-Line Completion ; 3 ; ../html/jde-ug/jde-ug-content.html#InLineCompletion
+2 ; Speeding Up Completion ; 3 ; ../html/jde-ug/jde-ug-content.html#SpeedingUpCompletion
1 ; Dynamic Keyword Completion ; 0 ;
../html/jde-ug/jde-ug-content.html#DynamicKeywordCompletion
2 ; Dynamic Completion Commands ; 3 ; ../html/jde-ug/jde-ug-content.html#
0 ; Generating Code ; 0 ; ../html/jde-ug/jde-ug-content.html#GeneratingCode
@@ -98,22 +99,25 @@
2 ; Using the Dialog-Based Find (jde-find-dlg) Command ; 3 ;
../html/jde-ug/jde-ug-content.html#FindExpressionDlg
1 ; Finding Symbol Definitions ; 3 ; ../html/jde-ug/jde-ug-content.html#FindSymbolDef
1 ; Finding Classes ; 3 ; ../html/jde-ug/jde-ug-content.html#FindClasses
+1 ; Cross-Referencing Classes ; 0 ; ../html/jde-ug/jde-ug-content.html#Xref
+2 ; Configuring the Cross-Referencer ; 3 ; ../html/jde-ug/jde-ug-content.html#ConfigXRef
+2 ; Building the Cross-Reference Database ; 3 ;
../html/jde-ug/jde-ug-content.html#BuildingXRefDB
+2 ; Using the Cross-Reference Database ; 3 ;
../html/jde-ug/jde-ug-content.html#UsingXRefDB
+2 ; Updating the Cross-Reference Database ; 3 ;
../html/jde-ug/jde-ug-content.html#UpdatingXRefDB
1 ; Tags ; 0 ; ../html/jde-ug/jde-ug-content.html#Tags
2 ; Tagging Java Source Code ; 3 ; ../html/jde-ug/jde-ug-content.html#TaggingCode
2 ; Finding the Definition of a Symbol ; 3 ;
../html/jde-ug/jde-ug-content.html#FindingSymbols
0 ; Customizing the JDE ; 0 ; ../html/jde-ug/jde-ug-content.html#CustomizingJDE
-1 ; Customization Variables ; 3 ;
../html/jde-ug/jde-ug-content.html#CustomizationVariables
-1 ; Setting a Variable ; 3 ; ../html/jde-ug/jde-ug-content.html#SettingVariable
-1 ; Specifying Paths ; 0 ; ../html/jde-ug/jde-ug-content.html#SpecifyingPaths
-2 ; Environment Variables ; 3 ; ../html/jde-ug/jde-ug-content.html#EnvVarsInPaths
-2 ; Tilde (~) Notation ; 3 ; ../html/jde-ug/jde-ug-content.html#TildeNotation
-2 ; Relative Paths ; 3 ; ../html/jde-ug/jde-ug-content.html#RelativePaths
-2 ; Cygwin Paths ; 3 ; ../html/jde-ug/jde-ug-content.html#CygwinPaths
-1 ; JDE Customization Groups ; 0 ;
../html/jde-ug/jde-ug-content.html#JDECustomizationGroups
-2 ; Compile Option Group ; 3 ; ../html/jde-ug/jde-ug-content.html#CompileOptionGroup
-2 ; Run Option Group ; 3 ; ../html/jde-ug/jde-ug-content.html#CompileOptionGroup
-2 ; Debug Option Group ; 3 ; ../html/jde-ug/jde-ug-content.html#DebugOptionGroup
-2 ; Autocode Group ; 3 ; ../html/jde-ug/jde-ug-content.html#AutocodeGroup
-2 ; General Options Group ; 3 ; ../html/jde-ug/jde-ug-content.html#GeneralGroup
-0 ; Customizing jde-mode ; 0 ; ../html/jde-ug/jde-ug-content.html#Customizingjde_mode
-1 ; Customizing Key Bindings ; 3 ; ../html/jde-ug/jde-ug-content.html#Keybindings
+1 ; Customization Variables ; 0 ;
../html/jde-ug/jde-ug-content.html#CustomizationVariables
+2 ; Setting a Variable ; 3 ; ../html/jde-ug/jde-ug-content.html#SettingVariable
+2 ; Specifying Paths ; 3 ; ../html/jde-ug/jde-ug-content.html#SpecifyingPaths
+2 ; JDE Customization Groups ; 3 ;
../html/jde-ug/jde-ug-content.html#JDECustomizationGroups
+1 ; Customizing jde-mode ; 0 ; ../html/jde-ug/jde-ug-content.html#Customizingjde_mode
+2 ; Customizing Key Bindings ; 3 ; ../html/jde-ug/jde-ug-content.html#Keybindings
+0 ; Creating and Installing Plugins ; 0 ; ../html/jde-ug/jde-ug-content.html#Plugins
+1 ; Installing a Plugin ; 3 ; ../html/jde-ug/jde-ug-content.html#InstallingPlugins
+1 ; Creating a Plugin ; 0 ; ../html/jde-ug/jde-ug-content.html#CreatingPlugins
+2 ; Plugin Requirements ; 3 ; ../html/jde-ug/jde-ug-content.html#PluginRequirements
+2 ; Registering a Plugin ; 3 ; ../html/jde-ug/jde-ug-content.html#RegisteringPlugin
+2 ; Running Java Code from a Plugin ; 3 ; ../html/jde-ug/jde-ug-content.html#
+2 ; Bootstrap File Example ; 3 ; ../html/jde-ug/jde-ug-content.html#BootstrapExample
1.1 XEmacs/packages/xemacs-packages/jde/doc/tli_rbl/txt/jdb-ug-toc.txt
Index: jdb-ug-toc.txt
===================================================================
0 ; JDEE Website ; 14 ; 3 ;
http://jdee.sunsite.dk ; _top
0 ; Debugger Setup ; 0 ; ../html/jdb-ug/jdb-ug.html#Intro
0 ; Running the Debugger ; 0 ; ../html/jdb-ug/jdb-ug.html#RunningDebugger
1 ; Starting the Debugger ; 0 ; ../html/jdb-ug/jdb-ug.html#StartingDebugger
2 ; Setting Debug Options ; 3 ; ../html/jdb-ug/jdb-ug.html#SettingDebugOptions
2 ; Setting App Arguments ; 3 ; ../html/jdb-ug/jdb-ug.html#SettingAppArguments
1 ; Entering Debug Commands ; 3 ; ../html/jdb-ug/jdb-ug.html#EnteringCommands
1 ; Stepping Through a Program ; 0 ; ../html/jdb-ug/jdb-ug.html#SteppingProgram
2 ; Step Commands ; 3 ; ../html/jdb-ug/jdb-ug.html#StepCommands
2 ; Debug Cursor ; 3 ; ../html/jdb-ug/jdb-ug.html#DebugCursor
0 ; Setting Breakpoints ; 0 ; ../html/jdb-ug/jdb-ug.html#SettingBreakpoints
1 ; Breakpoint Colors ; 3 ; ../html/jdb-ug/jdb-ug.html#BreakpointColors
1 ; Clearing Breakpoints ; 3 ; ../html/jdb-ug/jdb-ug.html#ClearingBreakpoints
0 ; Setting the Source Path ; 0 ; ../html/jdb-ug/jdb-ug.html#SettingSourcePath
0 ; Displaying Variables ; 0 ; ../html/jdb-ug/jdb-ug.html#DisplayingVariables
1 ; Displaying Expressions ; 3 ; ../html/jdb-ug/jdb-ug.html#DisplayingExpressions
1 ; Displaying Objects ; 3 ; ../html/jdb-ug/jdb-ug.html#DisplayingObjects
1 ; Displaying Locals ; 3 ; ../html/jdb-ug/jdb-ug.html#DisplayingLocals
0 ; Setting Variables ; 0 ; ../html/jdb-ug/jdb-ug.html#SettingVariables
0 ; Debugging External Processes ; 0 ; ../html/jdb-ug/jdb-ug.html#DebugExternalProcesses
1 ; Attaching Processes ; 0 ; ../html/jdb-ug/jdb-ug.html#AttachingProcesses
2 ; Starting the External Process in Debug Server Mode ; 3 ;
../html/jdb-ug/jdb-ug.html#DebugServerMode
2 ; Starting jdb in Attach Mode ; 3 ; ../html/jdb-ug/jdb-ug.html#AttachMode
1 ; Listening for Processes ; 0 ; ../html/jdb-ug/jdb-ug.html#ListeningForProcesses
2 ; Starting jdb in Listen Mode ; 3 ; ../html/jdb-ug/jdb-ug.html#ListenMode
2 ; Starting the External Process in Debug Client Mode ; 3 ;
../html/jdb-ug/jdb-ug.html#DebugClientMode
0 ; Debug Options ; 0 ; ../html/jdb-ug/jdb-ug.html#DebugOptions
1.1
XEmacs/packages/xemacs-packages/jde/java/bsh-commands/bsh/commands/beanInfoMaker.bsh
Index: beanInfoMaker.bsh
===================================================================
// JTEM - Java Tools for Experimental Mathematics
// GPL Copyright (C) 2002 JTEM-Group
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// any later version.
//
// This program 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 for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
String beanInfoMaker(){ return beanInfoMaker(self);}
String beanInfoMaker(String fullClassName){
import java.beans.BeanInfo;
import java.beans.MethodDescriptor;
import java.beans.PropertyDescriptor;
import java.beans.Introspector;
final int lastP = fullClassName.lastIndexOf('.');
final String packageName = fullClassName.substring(0,lastP);
final String myClassName = fullClassName.substring
(lastP+((lastP==0)?0:1));
// final String myclassName = myClassName.substring(0,1).toLowerCase()
// + myClassName.substring(1);
final BeanInfo bI= Introspector.getBeanInfo
(Class.forName(fullClassName));
// final MethodDescriptor[] mDA = bI.getMethodDescriptors();
final PropertyDescriptor[] pDA = bI.getPropertyDescriptors();
final StringBuffer pDS = new StringBuffer(500*pDA.length);
for (int i=0; i<pDA.length; i++) {
final PropertyDescriptor pDAi = pDA[i];
final String mGetName = pDAi.getReadMethod().getName();
// final java.lang.reflect.Method mSetMethod = pDAig.getWriteMethod();
// final String mSetName = (mSetMethod==null)?"":mSetMethod.getName();
final String pName = mGetName.substring(3);
final String pname = pName.substring(0,1).toLowerCase()
+ pName.substring(1);
// final String pTypeUnreadable = pDAi.getPropertyType().getName();
pDS.append
("\n"+
" pD=new
PropertyDescriptor(\""+pname+"\",myClass);\n"+
" pD.setDisplayName(\""+pName+"\");\n"+
" pD.setPropertyEditorClass("+pName+"Editor.class);\n"+
" pD.setBound(false);\n"+
" pD.setConstrained(false);\n"+
" pD.setHidden(false);\n"+
" pD.setPreferred(true);\n"+
" pD.setShortDescription(\""+pName+"\");\n"+
" pD.setExpert(false);\n"+
" properties[i++]=pD;\n");
}
return (// Sorry not to respect usual identation here.
"// Brought to you by JTEM - JavaTtools for Experimental Mathematics\n"+
"//
http://www.jtem.de\n"+
"// BeanInfo Maker GPL Copyright (C) 2002 JTEM-Group\n"+
"//\n"+
"// This program is free software; you can redistribute it and/or modify\n"+
"// it under the terms of the GNU General Public License as published by\n"+
"// the Free Software Foundation; either version 2 of the License, or\n"+
"// any later version.\n"+
"//\n"+
"// This program is distributed in the hope that it will be useful,\n"+
"// but WITHOUT ANY WARRANTY; without even the implied warranty of\n"+
"// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"+
"// GNU General Public License for more details.\n"+
"//\n"+
"// You should have received a copy of the GNU General Public License\n"+
"// along with this program; if not, write to the Free Software\n"+
"// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA\n"+
"\n"+
((packageName=="")?"": // Unknown package.
"package "+packageName+";\n")+
"\n"+
"\n"+
"import java.beans.*;\n"+
"\n"+
"/**\n"+
" * Bean support class for {@link "+myClassName+"}\n"+
" * components.\n"+
" * @see BeanInfo\n"+
" */\n"+
"public class "+myClassName+"BeanInfo implements BeanInfo\n"+
"{\n"+
" private static final BeanDescriptor BD\n"+
" =new
BeanDescriptor("+myClassName+".class);\n"+
" private static final PropertyDescriptor[] properties\n"+
" =new PropertyDescriptor["+pDA.length+"];\n"+
" private static IntrospectionException initialError=null;\n"+
" static\n"+
" {\n"+
" try\n"+
" {\n"+
" Class myClass="+myClassName+".class;\n"+
" BD.setDisplayName(\""+myClassName+" nice
name\");\n"+
" PropertyDescriptor pD;\n"+
" int i=0;\n"+
pDS+
" }\n"+
" catch(IntrospectionException ex)\n"+
" {\n"+
" initialError=ex;\n"+
" ex.printStackTrace();\n"+
" }\n"+
" }\n"+
" public "+myClassName+"BeanInfo() throws
IntrospectionException\n"+
" {\n"+
" if(initialError!=null) throw initialError;\n"+
" }\n"+
" public BeanDescriptor getBeanDescriptor()\n"+
" {\n"+
" return BD;\n"+
" }\n"+
" public EventSetDescriptor[] getEventSetDescriptors()\n"+
" {\n"+
" return null;\n"+
" }\n"+
" public int getDefaultEventIndex()\n"+
" {\n"+
" return -1;\n"+
" }\n"+
" public PropertyDescriptor[] getPropertyDescriptors()\n"+
" {\n"+
"// System.out.println(\"providing good PropertyDescriptors\");\n"+
" return properties;\n"+
" }\n"+
" public int getDefaultPropertyIndex()\n"+
" {\n"+
" return -1;\n"+
" }\n"+
" public MethodDescriptor[] getMethodDescriptors()\n"+
" {\n"+
" return null;\n"+
" }\n"+
" public BeanInfo[] getAdditionalBeanInfo()\n"+
" {\n"+
" return null;\n"+
" }\n"+
" public java.awt.Image getIcon(int iconKind)\n"+
" {\n"+
" return null;\n"+
" }\n"+
"}\n"
);
}
String beanInfoMaker(Object o){
final String fullClassName;
if (o.getClass()==Class) {
fullClassName = o.getName();
} else {
fullClassName = o.getClass().getName();
}
return beanInfoMaker(fullClassName);
}
void beanInfoMaker(Object o, String fileName) // throws IOException
{
File outputFile = new File(fileName);
FileWriter out = new FileWriter(outputFile);
out.write( beanInfoMaker(o));
if (!fileName.endsWith("BeanInfo.java")) {
System.out.println("Name it \"MyClassBeanInfo.java\"");
}
out.close();
}
1.1
XEmacs/packages/xemacs-packages/jde/java/bsh-commands/bsh/commands/exploreClass.bsh
Index: exploreClass.bsh
===================================================================
/*
* Browse the specified class.
*/
import bsh.util.ClassBrowser;
void exploreClass(String classname) {
if (global.classBrowser == void) {
global.classBrowser = new ClassBrowser();
global.classBrowser.init();
global.classBrowserFrame = new javax.swing.JFrame("BeanShell Class
Browser");
global.classBrowser.setFrame(global.classBrowserFrame);
global.classBrowserFrame.getContentPane().add("Center",
global.classBrowser);
global.classBrowserFrame.pack();
}
global.classBrowser.driveToClass(classname);
global.classBrowserFrame.show();
global.classBrowserFrame.toFront();
}
1.2 +3877 -843 XEmacs/packages/xemacs-packages/jde/java/lib/checkstyle-all.jar
<<Binary file>>
1.8 +735 -596 XEmacs/packages/xemacs-packages/jde/java/lib/jde.jar
<<Binary file>>
1.1 XEmacs/packages/xemacs-packages/jde/java/lib/LICENSE.apache
Index: LICENSE.apache
===================================================================
/*
* $Header: /cvsroot/checkstyle/checkstyle/LICENSE.apache,v 1.2 2002/02/04 12:40:53 oburn
Exp $
* $Revision: 1.2 $
* $Date: 2002/02/04 12:40:53 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (
http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Jakarta-Regexp", and
"Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache(a)apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <
http://www.apache.org/>.
*
*/
1.1 XEmacs/packages/xemacs-packages/jde/java/lib/RIGHTS.antlr
Index: RIGHTS.antlr
===================================================================
SOFTWARE RIGHTS
$Id: RIGHTS.antlr,v 1.1 2001/06/22 13:11:01 oburn Exp $
ANTLR 1989-2000 Developed by
jGuru.com (MageLang Institute),
http://www.ANTLR.org and
http://www.jGuru.com
We reserve no legal rights to the ANTLR--it is fully in the
public domain. An individual or company may do whatever
they wish with source code distributed with ANTLR or the
code generated by ANTLR, including the incorporation of
ANTLR, or its output, into commerical software.
We encourage users to develop software with ANTLR. However,
we do ask that credit is given to us for developing
ANTLR. By "credit", we mean that if you use ANTLR or
incorporate any source code into one of your programs
(commercial product, research project, or otherwise) that
you acknowledge this fact somewhere in the documentation,
research report, etc... If you like ANTLR and have
developed a nice tool with the output, please mention that
you developed it using ANTLR. In addition, we ask that the
headers remain intact in our source code. As long as these
guidelines are kept, we expect to continue enhancing this
system and expect to make other tools available as they are
completed.
The primary ANTLR guy:
Terence Parr
http://www.jGuru.com
parrt(a)jguru.com
1.1 XEmacs/packages/xemacs-packages/jde/java/lib/sun_checks.xml
Index: sun_checks.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.1//EN"
"http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
http://java.sun.com/docs/books/jls/second_edition/html/index.html
- the Sun Code Conventions at
http://java.sun.com/docs/codeconv/
- the Javadoc guidelines at
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
- the JDK Api documentation
http://java.sun.com/j2se/docs/api/index.html
- some best practices
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.sf.net (or in your downloaded distribution).
Most Checks are configurable, be sure to consult the documentation.
To completely disable a check, just comment it out or delete it from the file.
Finally, it is worth reading the documentation.
-->
<module name="Checker">
<!-- Checks that a package.html file exists for each package. -->
<!-- See
http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
<module name="PackageHtml"/>
<!-- Checks whether files end with a new line. -->
<!-- See
http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>
<!-- Checks that property files contain the same keys. -->
<!-- See
http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>
<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See
http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocMethod"/>
<module name="JavadocType"/>
<module name="JavadocVariable"/>
<!-- Checks for Naming Conventions. -->
<!-- See
http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Checks for Headers -->
<!-- See
http://checkstyle.sf.net/config_header.html -->
<!-- <module name="Header"> -->
<!-- The follow property value demonstrates the ability -->
<!-- to have access to ANT properties. In this case it uses -->
<!-- the ${basedir} property to allow Checkstyle to be run -->
<!-- from any directory within a project. -->
<!-- <property name="headerFile"
value="${basedir}/java.header"/> -->
<!-- </module> -->
<!-- Following interprets the header file as regular expressions. -->
<!-- <module name="RegexpHeader"/>
-->
<!-- Checks for imports -->
<!-- See
http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages
-->
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Checks for Size Violations. -->
<!-- See
http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength"/>
<module name="LineLength"/>
<module name="MethodLength"/>
<module name="ParameterNumber"/>
<!-- Checks for whitespace -->
<!-- See
http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad">
<property name="option" value="nospace"/>
</module>
<module name="TabCharacter"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<!-- Modifier Checks -->
<!-- See
http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Checks for blocks. You know, those {}'s -->
<!-- See
http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<!-- Checks for common coding problems -->
<!-- See
http://checkstyle.sf.net/config_coding.html -->
<module name="AvoidInlineConditionals"/>
<module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE
-->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField"/>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber"/>
<module name="MissingSwitchDefault"/>
<module name="RedundantThrows"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<!-- Checks for class design -->
<!-- See
http://checkstyle.sf.net/config_design.html -->
<module name="DesignForExtension"/>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>
<!-- Miscellaneous other checks. -->
<!-- See
http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="FinalParameters"/>
<module name="GenericIllegalRegexp">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing
spaces."/>
</module>
<module name="TodoComment"/>
<module name="UpperEll"/>
</module>
</module>
1.2 +130 -30
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/CommandStream.java
Index: CommandStream.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/CommandStream.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- CommandStream.java 2001/08/16 03:28:57 1.1
+++ CommandStream.java 2006/03/03 20:41:38 1.2
@@ -1,13 +1,19 @@
package jde.debugger;
import java.io.StreamTokenizer;
import java.io.BufferedReader;
-import java.util.List;
-import java.util.ArrayList;
import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.StreamTokenizer;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* CommandStream.java
*
@@ -15,55 +21,56 @@ import java.io.InputStreamReader;
* Created: Tue Feb 13 15:40:34 2001
*
* @author <a href="mailto: "</a>
- * @version
+ * @version 1.0
*/
-public class CommandStream extends StreamTokenizer {
+public class CommandStream extends StreamTokenizer implements Protocol {
public CommandStream (BufferedReader in){
-
+
super(in);
+ m_reader = in;
setSyntax();
}
public List nextCommand() {
-
+
List commandLine = new ArrayList();
-
+
try {
int token = nextToken();
-
+
while (token != TT_EOL) {
switch (token) {
- case TT_EOF :
+ case TT_EOF :
throw new IOException("EOF occurred reading command stream.");
-
+
case TT_WORD :
- case '"' :
- case '\'':
+ case '"' :
+ case '\'':
commandLine.add(sval);
break;
-
+
default:
- commandLine.add(String.valueOf((char)token));
+ commandLine.add(String.valueOf((char)token));
break;
- } // end of switch ()
-
+ } // end of switch ()
+
token = nextToken();
}
if (commandLine.size() < 3) {
- if (commandLine.size() > 0)
- JDE.getJDE().signalCommandError(Jdebug.debuggerID, new Integer(-1), "Malformed
command");
- commandLine = nextCommand();
+ if (commandLine.size() > 0)
+ JDE.commandResult(new Integer(-1), "Malformed command", CMD_NOK,
QUOTE);
+ commandLine = nextCommand();
}
}
catch (IOException ex) {
commandLine = null;
- } // end of catch
+ } // end of catch
return commandLine;
}
@@ -78,7 +85,7 @@ public class CommandStream extends Strea
whitespaceChars('\u0000', '\u0020');
wordChars('\u0021', '\u00ff');
quoteChar('"');
- }
+ }
public static void main (String[] args) {
@@ -93,19 +100,112 @@ public class CommandStream extends Strea
int n = command.size();
for (int i = 0; i<n; i++) {
- out.println(command.get(i));
+ out.println(command.get(i));
} // end of for ()
-
+
out.print("> ");
out.flush();
- command = commandStream.nextCommand();
+ command = commandStream.nextCommand();
} // end of while ()
-
-
} // end of main ()
-
-
-
+
+ private final Reader m_reader;
+
+ // ----------------------------------------
+ // Fix for bug 4809647
+ // ----------------------------------------
+ static {
+ try {
+ StdIn.fix();
+ } catch (IOException exc) {
+ throw new ExceptionInInitializerError(exc);
+ }
+ };
+
+ /**
+ * You must call <code>StdIn.fix()</code> once before using
+ <code>System.in</code>.
+ */
+ private static final class StdIn
+ {
+ private static InputStream in;
+ private static PipedInputStream pis;
+ private static PipedOutputStream pos;
+
+ private static Thread pump = new Thread("StdIn Pump")
+ {
+ public void run()
+ {
+
+ byte[] buf = new byte[5120];
+
+ try {
+ while (true) {
+ int available = in.available();
+
+ if (available == 0) {
+ Thread.sleep(50);
+ continue;
+ }
+
+ int howMany = Math.min(buf.length, available);
+
+ //This works because we asked how many are there
+ in.read(buf, 0, howMany);
+ pos.write(buf, 0, howMany);
+
+ }
+ }
+ catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ };
+
+ /**
+ * Nobody can create an instance of this class
+ */
+ private StdIn() {}
+
+ /**
+ * This method replaces System.in and workarounds bug
+ #4809647
+ */
+ public synchronized static void fix()
+ throws IOException
+ {
+ if (in != null) {
+ return;
+ }
+
+ in = System.in;
+ pos = new PipedOutputStream();
+ pis = new PipedInputStream(pos);
+ System.setIn(pis);
+ pump.setDaemon(true);
+ pump.setPriority(Thread.MIN_PRIORITY);
+ pump.start();
+ }
+ }
+ // ----------------------------------------
+ // End Fix for bug 4809647
+ // ----------------------------------------
+
}// CommandStream
+/*
+ * $Log: CommandStream.java,v $
+ * Revision 1.4 2003/04/29 16:51:56 troy
+ * Initial version of GUI. Includes display of local variables.
+ *
+ * Revision 1.3 2003/01/08 07:03:08 paulk
+ * Remove carriage returns.
+ *
+ * Revision 1.2 2003/01/08 06:53:38 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
+
+// End of CommandStream.java
1.2 +174 -149
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/DebuggeeSIO.java
Index: DebuggeeSIO.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/DebuggeeSIO.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- DebuggeeSIO.java 2001/08/16 03:28:58 1.1
+++ DebuggeeSIO.java 2006/03/03 20:41:39 1.2
@@ -1,31 +1,52 @@
package jde.debugger;
-import java.io.OutputStream;
-import java.io.PrintStream;
+
import java.io.BufferedReader;
-import java.net.Socket;
import java.io.BufferedWriter;
+import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.net.ServerSocket;
-import java.io.IOException;
+import java.io.OutputStream;
import java.io.OutputStreamWriter;
-import java.io.InterruptedIOException;
+import java.io.PrintStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+
/**
- * DebuggeeSIO.java
- *
+ * Connects standard input/output/error from a debuggee process to
+ * Emacs. This is done using four threads: a first thread started by
+ * the {@link #initConnect initConnect} method, which waits for Emacs
+ * to connect to a specified port. When that connection is
+ * established, three threads for stdin, stdout and stderr are created
+ * and started. The threads continue until the {@link #shutdown
+ * shutdown} method is called.
*
* Created: Sun Feb 18 01:24:09 2001
*
- * @author <a href="mailto: "</a>
- * @version
+ * @author Paul Kinnucan
+ * @version $Revision: 1.7 $
*/
public class DebuggeeSIO implements Protocol {
+
+ Integer procID;
+
+ /** Socket connection to do i/o */
+ Socket m_sioSocket = null;
+
+
+ Thread standardIOConnectThread;
+ StandardInputProcessor standardInputProcessor;
+ StandardOutputProcessor standardOutputProcessor;
+ StandardErrorProcessor standardErrorProcessor;
+ StandardOutputWriter standardOutputWriter;
+
- public DebuggeeSIO (DebuggeeProcess proc){
- this.proc = proc;
- procID = proc.getId();
+ private Debugger m_debugger;
+
+ public DebuggeeSIO(Debugger debugger){
+ m_debugger = debugger;
+ procID = debugger.getProcID();
}
/**
@@ -40,9 +61,9 @@ public class DebuggeeSIO implements Prot
* @exception JDEException if an error occurs
*/
public int initConnect(final Integer cmdId) throws JDEException {
-
- jde.signal(procID, MESSAGE, "initSIOConnect: starting standard I/O
handshake.");
-
+
+ JDE.signal(procID, MESSAGE, "initSIOConnect: starting standard I/O
handshake.", QUOTE);
+
ServerSocket ss = null;
try {
ss = new ServerSocket(0);
@@ -54,33 +75,31 @@ public class DebuggeeSIO implements Prot
final int port = ss.getLocalPort();
standardIOConnectThread = new Thread("Standard I/O Thread for App
#"+procID) {
- public void run() {
- try {
- sstmp.setSoTimeout(15000);
+ public void run() {
+ try {
+ sstmp.setSoTimeout(15000);
// Note!!! Added to solve initial hang up problem
- jde.signalCommandResult(procID, cmdId, new Integer(port));
-
- jde.signal(procID, MESSAGE, "Debugger waiting for Emacs to connect to app SIO
port " +
- port + ".");
-
- sioSocket = sstmp.accept();
- sstmp.close();
- initTransport();
- } catch (IOException ex) {
- jde.signal(procID, ERROR, "Gave up waiting for Emacs to connect to SIO port:
" + port);
- // proc.shutdown();
- } catch (SecurityException ex1) {
- jde.signal(procID, ERROR, "Security exception occurred while connecting to app
SIO port " +
- port);
- }
- }
+ JDE.commandResult(cmdId, String.valueOf(port), CMD_OK, NOQUOTE);
+
+ JDE.signal(procID, MESSAGE, "Debugger waiting for Emacs to connect to
app SIO port " +
+ port + ".", QUOTE);
+
+ m_sioSocket = sstmp.accept();
+ sstmp.close();
+ initTransport();
+ } catch (IOException ex) {
+ JDE.signal(procID, ERROR, "Gave up waiting for Emacs to connect to SIO
port: " + port, QUOTE);
+ } catch (SecurityException ex1) {
+ JDE.signal(procID, ERROR, "Security exception occurred while connecting
to app SIO port " +
+ port, QUOTE);
+ }
+ }
};
- jde.signal(procID, MESSAGE, "initSIOConnect: starting SIO connect
thread.");
+ JDE.signal(procID, MESSAGE, "initSIOConnect: starting SIO connect thread.",
QUOTE);
standardIOConnectThread.start();
return port;
-
}
/**
@@ -88,29 +107,29 @@ public class DebuggeeSIO implements Prot
*
*/
public void initTransport() {
+ JDE.signal(procID, MESSAGE, "Debugger connected to standard I/O socket.",
QUOTE);
- jde.signal(procID, MESSAGE, "Debugger connected to standard I/O
socket.");
+ final Process process = m_debugger.getVM().process();
+ standardInputProcessor = new StandardInputProcessor(process.getOutputStream());
+ standardInputProcessor.start();
+ standardOutputWriter = new StandardOutputWriter(m_sioSocket);
+ standardOutputWriter.println("*** Process Standard I/O ***");
- final Process process = proc.getVM().process();
- standardInputProcessor = new StandardInputProcessor(process.getOutputStream());
- standardInputProcessor.start();
+ standardOutputProcessor = new StandardOutputProcessor(process.getInputStream());
+ standardOutputProcessor.start();
- standardOutputWriter = new StandardOutputWriter(sioSocket);
- standardOutputWriter.println("*** Process Standard I/O ***");
+ standardErrorProcessor = new StandardErrorProcessor(process.getErrorStream());
+ standardErrorProcessor.start();
- standardOutputProcessor = new StandardOutputProcessor(process.getInputStream());
- standardOutputProcessor.start();
-
- standardErrorProcessor = new StandardErrorProcessor(process.getErrorStream());
- standardErrorProcessor.start();
-
}
public void shutdown() {
try {
- sioSocket.close();
+ if (m_sioSocket != null) {
+ m_sioSocket.close();
+ }
} catch (IOException e) {
} // end of try-catch
@@ -128,16 +147,16 @@ public class DebuggeeSIO implements Prot
private class StandardInputProcessor extends Thread {
public StandardInputProcessor(final OutputStream toVmStream) {
- super("Input Processor for App #"+procID);
+ super("Input Processor for App #"+m_debugger.getProcID());
toVM = new PrintStream(toVmStream, true);
try {
- fromEmacs =
- new BufferedReader(new InputStreamReader(sioSocket.getInputStream()));
+ fromEmacs =
+ new BufferedReader(new InputStreamReader(m_sioSocket.getInputStream()));
}
catch (IOException ex1) {
- jde.signal(procID, ERROR, "Could not get standard input stream from Emacs.");
+ JDE.signal(procID, ERROR, "Could not get standard input stream from
Emacs.", QUOTE);
}
// setPriority(Thread.MAX_PRIORITY-1);
@@ -149,30 +168,34 @@ public class DebuggeeSIO implements Prot
if (fromEmacs == null) return;
try {
- String line;
- while ((line = fromEmacs.readLine()) != null) {
- toVM.println(line);
- toVM.flush();
- }
-
- if (!proc.isShuttingDown()) {
- try {
- // sioSocket.close();
- jde.signal(procID, MESSAGE, "Process closed its standard input.");
- } catch (Exception ex) {
- jde.signal(procID, MESSAGE, "Couldn't close socket to standard
input.");
- }
- }
+ String line;
+ while ((line = fromEmacs.readLine()) != null) {
+ toVM.println(line);
+ toVM.flush();
+ }
+
+ /* XXX - Petter: handle this later? it seems to already be taken out...
+ if (!proc.isShuttingDown()) {
+ try {
+ // m_sioSocket.close();
+ JDE.signal(procID, MESSAGE, "Process closed its standard input.");
+ } catch (Exception ex) {
+ JDE.signal(procID, MESSAGE, "Couldn't close socket to standard
input.");
+ }
+ }
+ */
} catch (IOException ex) {
- if (!proc.isShuttingDown()) {
- try {
- // sioSocket.close();
- jde.signal(procID, ERROR, "Input error; application I/O closed");
- } catch (Exception e) {
- jde.signal(procID, ERROR, "Input error; couldn't close application
I/O");
- }
- }
+ /* XXX - Petter: handle this later? it seems to already be taken out...
+ if (!proc.isShuttingDown()) {
+ try {
+ // m_sioSocket.close();
+ JDE.signal(procID, ERROR, "Input error; application I/O closed");
+ } catch (Exception e) {
+ JDE.signal(procID, ERROR, "Input error; couldn't close application
I/O");
+ }
+ }
+ */
}
}
@@ -197,25 +220,25 @@ public class DebuggeeSIO implements Prot
*/
private class StandardOutputWriter {
- public StandardOutputWriter(Socket sioSocket) {
- if (sioSocket == null) {
- jde.signal(procID, ERROR, "Could not transport app output. " +
- "Transport socket does not exist.");
- return;
+ public StandardOutputWriter(Socket m_sioSocket) {
+ if (m_sioSocket == null) {
+ JDE.signal(procID, ERROR, "Could not transport app output. " +
+ "Transport socket does not exist.", QUOTE);
+ return;
}
OutputStream toEmacsStream;
try {
- toEmacsStream = sioSocket.getOutputStream();
- if (toEmacsStream == null) {
- jde.signal(procID, ERROR, "Could not transport app output. Transport socket
closed.");
- return;
- }
+ toEmacsStream = m_sioSocket.getOutputStream();
+ if (toEmacsStream == null) {
+ JDE.signal(procID, ERROR, "Could not transport app output. Transport
socket closed.", QUOTE);
+ return;
+ }
}
catch (IOException ex1) {
- jde.signal(procID, ERROR, "Could not transport app output. Transport socket
closed.");
- return;
+ JDE.signal(procID, ERROR, "Could not transport app output. Transport socket
closed.", QUOTE);
+ return;
}
toEmacs = new BufferedWriter(new OutputStreamWriter(toEmacsStream));
@@ -223,22 +246,22 @@ public class DebuggeeSIO implements Prot
public void write(char[] cbuf, int len) {
if (toEmacs != null) {
- try {
- toEmacs.write(cbuf, 0, len);
- toEmacs.flush();
- }
- catch (IOException ex1) {
- jde.signal(procID, ERROR, "I/O error: cannot write process output to
Emacs.");
- }
+ try {
+ toEmacs.write(cbuf, 0, len);
+ toEmacs.flush();
+ }
+ catch (IOException ex1) {
+ JDE.signal(procID, ERROR, "I/O error: cannot write process output to
Emacs.", QUOTE);
+ }
}
}
public void println(String line) {
try {
- toEmacs.write(line);
- toEmacs.newLine();
+ toEmacs.write(line);
+ toEmacs.newLine();
} catch (IOException e) {
- jde.signal(procID, ERROR, "I/O error: cannot write process output to
Emacs.");
+ JDE.signal(procID, ERROR, "I/O error: cannot write process output to
Emacs.", QUOTE);
} // end of try-catch
}
@@ -257,7 +280,7 @@ public class DebuggeeSIO implements Prot
*/
private class StandardOutputProcessor extends Thread {
- public StandardOutputProcessor(InputStream fromVMStream) {
+ public StandardOutputProcessor(InputStream fromVMStream) {
fromVM = new BufferedReader(new InputStreamReader(fromVMStream));
setPriority(Thread.MAX_PRIORITY-1);
}
@@ -267,27 +290,29 @@ public class DebuggeeSIO implements Prot
String line;
try {
- char[] cbuf = new char[256];
- int len;
- while ((len = fromVM.read(cbuf, 0, 256)) != -1) {
- synchronized (standardOutputWriter) {
- if (standardOutputWriter != null) {
- standardOutputWriter.write(cbuf, len);
- } // end of if ()
- }
- }
+ char[] cbuf = new char[256];
+ int len;
+ while ((len = fromVM.read(cbuf, 0, 256)) != -1) {
+ synchronized (standardOutputWriter) {
+ if (standardOutputWriter != null) {
+ standardOutputWriter.write(cbuf, len);
+ } // end of if ()
+ }
+ }
}
catch (IOException ex) {
}
- if (!proc.isShuttingDown()) {
- try {
- // sioSocket.close();
- jde.signal(procID, MESSAGE, "Closed transport for application's standard
output.");
- } catch (Exception ex) {
- jde.signal(procID, ERROR, "Could not close application standard output
transport.");
- }
- }
+ /* XXX - Petter: handle this later? it seems to already be taken out...
+ if (!proc.isShuttingDown()) {
+ try {
+ // m_sioSocket.close();
+ JDE.signal(procID, MESSAGE, "Closed transport for application's
standard output.");
+ } catch (Exception ex) {
+ JDE.signal(procID, ERROR, "Could not close application standard output
transport.");
+ }
+ }
+ */
}
BufferedReader fromVM;
@@ -316,49 +341,49 @@ public class DebuggeeSIO implements Prot
String line;
try {
- char[] cbuf = new char[256];
- int len;
- while ((len = fromVM.read(cbuf, 0, 256)) != -1) {
- synchronized (standardOutputWriter) {
- if (standardOutputWriter != null) {
- standardOutputWriter.write(cbuf, len);
- } // end of if ()
- }
- }
+ char[] cbuf = new char[256];
+ int len;
+ while ((len = fromVM.read(cbuf, 0, 256)) != -1) {
+ synchronized (standardOutputWriter) {
+ if (standardOutputWriter != null) {
+ standardOutputWriter.write(cbuf, len);
+ } // end of if ()
+ }
+ }
}
catch (IOException ex) {
}
- if (!proc.isShuttingDown()) {
- try {
- // sioSocket.close();
- jde.signal(procID, MESSAGE, "Closed transport for application's standard
error output.");
- } catch (Exception ex) {
- jde.signal(procID, ERROR, "Could not close application standard error output
transport.");
- }
- }
+ /* XXX - Petter: handle this later? it seems to already be taken out...
+ if (!proc.isShuttingDown()) {
+ try {
+ // m_sioSocket.close();
+ JDE.signal(procID, MESSAGE, "Closed transport for application's
standard error output.");
+ } catch (Exception ex) {
+ JDE.signal(procID, ERROR, "Could not close application standard error
output transport.");
+ }
+ }
+ */
}
BufferedReader fromVM;
}
- DebuggeeProcess proc;
-
- Integer procID;
-
- JDE jde = JDE.getJDE();
-
- /** Socket connection to do i/o */
- Socket sioSocket = null;
-
-
- Thread standardIOConnectThread;
- StandardInputProcessor standardInputProcessor;
- StandardOutputProcessor standardOutputProcessor;
- StandardErrorProcessor standardErrorProcessor;
- StandardOutputWriter standardOutputWriter;
+}// DebuggerSIO
+/*
+ * $Log: DebuggeeSIO.java,v $
+ * Revision 1.7 2003/01/15 05:49:22 paulk
+ * Add Petter's changes.
+ *
+ * Revision 1.6 2003/01/08 07:03:08 paulk
+ * Remove carriage returns.
+ *
+ * Revision 1.5 2003/01/08 06:53:38 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
-}// DebuggeeSIO
+// End of DebuggerSIO.java
1.3 +438 -425 XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/Etc.java
Index: Etc.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/Etc.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- Etc.java 2001/08/16 03:28:58 1.2
+++ Etc.java 2006/03/03 20:41:39 1.3
@@ -1,12 +1,15 @@
-
package jde.debugger;
-import jde.debugger.expr.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
import com.sun.jdi.*;
import com.sun.jdi.request.*;
+import jde.debugger.expr.*;
-import java.util.*;
/**
* Etc.java
@@ -17,452 +20,462 @@ import java.util.*;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.3 $
*/
public class Etc {
+
+ /**
+ * dump a particular object, in whatever way seems appropriate
+ * @param obj The object to dump
+ */
+ public static void dump(Object obj) {
+ if (obj instanceof Collection) {
+ Iterator it = ((Collection)obj).iterator();
+ while (it.hasNext()) {
+ System.out.println(it.next());
+ }
+ } else if (obj instanceof Object[]) {
+ Object[] k = (Object[])obj;
+ for (int i=0; i<k.length; i++)
+ dump(k[i]);
+ } else {
+ System.out.println(obj);
+ }
+ }
+
+
+ /**
+ * Safely convert to a Long, raising an appropriate
+ * JDENumberFormatException if required
+ *
+ * @param obj The object to convert. The .toString() is used.
+ * @param type The type of long: used in the exception string if required
+ * @return the Long, or raises exception.
+ */
+ public static Long safeGetLong(Object obj, String type)
+ throws JDEException {
+ try {
+ return new Long(obj.toString());
+ } catch (NumberFormatException ex) {
+ throw new JDENumberFormatException(type);
+ }
+ }
+
+
+ /**
+ * Safely convert to an int, raising an appropriate
+ * JDENumberFormatException if required
+ *
+ * @param obj The object to convert. The .toString() is used.
+ * @param type The type of int: used in the exception string if required
+ * @return the Integer, or raises exception.
+ */
+ public static int safeGetint(Object obj, String type)
+ throws JDEException {
+ try {
+ return Integer.parseInt(obj.toString());
+ } catch (NumberFormatException ex) {
+ throw new JDENumberFormatException(type);
+ }
+ }
+
- /**
- * dump a particular object, in whatever way seems appropriate
- * @param obj The object to dump
- */
- public static void dump(Object obj) {
- if (obj instanceof Collection) {
- Iterator it = ((Collection)obj).iterator();
- while (it.hasNext()) {
- System.out.println(it.next());
- }
- } else if (obj instanceof Object[]) {
- Object[] k = (Object[])obj;
- for (int i=0; i<k.length; i++)
- dump(k[i]);
- } else {
- System.out.println(obj);
- }
- }
-
-
- /**
- * Safely convert to a Long, raising an appropriate
- * JDENumberFormatException if required
- *
- * @param obj The object to convert. The .toString() is used.
- * @param type The type of long: used in the exception string if required
- * @return the Long, or raises exception.
- */
- public static Long safeGetLong(Object obj, String type)
- throws JDEException {
- try {
- return new Long(obj.toString());
- } catch (NumberFormatException ex) {
- throw new JDENumberFormatException(type);
- }
- }
-
-
- /**
- * Safely convert to an int, raising an appropriate
- * JDENumberFormatException if required
- *
- * @param obj The object to convert. The .toString() is used.
- * @param type The type of int: used in the exception string if required
- * @return the Integer, or raises exception.
- */
- public static int safeGetint(Object obj, String type)
- throws JDEException {
- try {
- return Integer.parseInt(obj.toString());
- } catch (NumberFormatException ex) {
- throw new JDENumberFormatException(type);
- }
- }
-
-
- /**
- * Evaluate an expression, given a context
- * <p>
- * @param expr The expression to evaluate
- * @param frame The stackframe that defines the context
- * @return a {@link Rep#getValueRep(Value, ObjectStore) value}
- */
- public static Value evaluate(String expr, final StackFrame frame)
- throws JDEException {
- // System.out.println(expr);
- try {
- ExpressionParser.GetFrame frameGetter = null;
- frameGetter = new ExpressionParser.GetFrame() {
- public StackFrame get()
- throws IncompatibleThreadStateException {
- return frame;
- }
- };
- return ExpressionParser.evaluate(expr, frame.virtualMachine(),
- frameGetter);
- } catch (NativeMethodException ex) {
- throw new JDEException("Can't access local variables in native
methods");
- } catch (ParseException ex) {
- throw new JDEException(ex.toString());
- } catch (InvocationException ex) {
- throw new JDEException("Exception in expression:
"+ex.exception().referenceType().name());
- } catch (InvalidTypeException ite) {
- throw new JDEException("Expression contains invalid type");
- } catch (IncompatibleThreadStateException itse) {
- throw new JDEException("This expression cannot be evaluated at an arbitrary
location");
- } catch (ClassNotLoadedException tnle) {
- throw new JDEException("A required class for the evaluation hasn't been
loaded");
- }
+ /**
+ * Evaluate an expression, given a context
+ * <p>
+ * @param expr The expression to evaluate
+ * @param frame The stackframe that defines the context
+ * @return a {@link Rep#getValueRep(Value) value}
+ */
+ public static Value evaluate(String expr, final StackFrame frame)
+ throws JDEException {
+ // System.out.println(expr);
+ try {
+ ExpressionParser.GetFrame frameGetter = null;
+ frameGetter = new ExpressionParser.GetFrame() {
+ public StackFrame get()
+ throws IncompatibleThreadStateException {
+ return frame;
+ }
+ };
+ return ExpressionParser.evaluate(expr, frame.virtualMachine(),
+ frameGetter);
+ } catch (NativeMethodException ex) {
+ throw new JDEException("Can't access local variables in native
methods");
+ } catch (ParseException ex) {
+ throw new JDEException(ex.toString());
+ } catch (InvocationException ex) {
+ throw new JDEException("Exception in expression:
"+ex.exception().referenceType().name());
+ } catch (InvalidTypeException ite) {
+ throw new JDEException("Expression contains invalid type");
+ } catch (IncompatibleThreadStateException itse) {
+ throw new JDEException("This expression cannot be evaluated at an arbitrary
location");
+ } catch (ClassNotLoadedException tnle) {
+ throw new JDEException("A required class for the evaluation hasn't been
loaded");
}
+ }
- /**
- * Parses the list of arguments for thread information.
- * <pre>
- * on_thread_id threadID
- * on_thread_name "threadName"
- * </pre>
- * Note that the exception is <b>not</b> raised if the tags are
- * not present: only if what follows the tag is incorrect.
- * <p>
- * Commands having this argument will raise events only if the event
- * thread matches the specification. More details in EventHandler.
- * <p>
- * Shortcuts: <u>-tid</u> and <u>-tname</u>
- * <p>
- * @return a Long corresponding to the threadID, or the string
- * "threadName"
- * @exception JDEException If the information cannot be resolved
- */
- public static Object getThreadFromArgs(List args)
- throws JDEException {
-
- String threadArg = null;
- int threadIndex = -1;
- for (int i = 0; i < args.size(); i++) {
- String arg = args.get(i).toString().toLowerCase();
- if (arg.equals("on_thread_id") || arg.equals("on_thread_name")
- || arg.equals("-tid") || arg.equals("-tname")) {
- threadIndex = i;
- threadArg = args.remove(threadIndex).toString();
- break;
- }
- }
- // at this point, either threadArg = null, or on_thread_id/name. in
- // that case, threadIndex should now have the index of the argument
- if (threadArg == null) {
- return null;
- } else {
- if (threadArg.equals("on_thread_id")
- || threadArg.equals("-tid")) {
- if (threadIndex == args.size()) {
- // ie missing argument
- throw new JDEException("Missing argument to 'on_thread_id'");
- } else {
- try {
- return new Long(args.remove(threadIndex).toString());
- } catch (NumberFormatException ex) {
- throw new JDENumberFormatException("'on_thread_id' argument");
- }
- }
- } else if (threadArg.equals("on_thread_name")
- || threadArg.equals("-tname")) {
- if (threadIndex == args.size()) {
- throw new JDEException("Missing argument to 'on_thread_name'");
- } else {
- return args.remove(threadIndex).toString();
- }
- } else {
- throw new JDEException("Should not happen! Contact maintainer");
- }
- }
+ /**
+ * Parses the list of arguments for thread information.
+ * <pre>
+ * on_thread_id threadID
+ * on_thread_name "threadName"
+ * </pre>
+ * Note that the exception is <b>not</b> raised if the tags are
+ * not present: only if what follows the tag is incorrect.
+ * <p>
+ * Commands having this argument will raise events only if the event
+ * thread matches the specification. More details in EventHandler.
+ * <p>
+ * Shortcuts: <u>-tid</u> and <u>-tname</u>
+ * <p>
+ * @return a Long corresponding to the threadID, or the string
+ * "threadName"
+ * @exception JDEException If the information cannot be resolved
+ */
+ public static Object getThreadFromArgs(List args)
+ throws JDEException {
+
+ String threadArg = null;
+ int threadIndex = -1;
+ for (int i = 0; i < args.size(); i++) {
+ String arg = args.get(i).toString().toLowerCase();
+ if (arg.equals("on_thread_id") || arg.equals("on_thread_name")
+ || arg.equals("-tid") || arg.equals("-tname")) {
+ threadIndex = i;
+ threadArg = args.remove(threadIndex).toString();
+ break;
+ }
}
+ // at this point, either threadArg = null, or on_thread_id/name. in
+ // that case, threadIndex should now have the index of the argument
+ if (threadArg == null) {
+ return null;
+ } else {
+ if (threadArg.equals("on_thread_id")
+ || threadArg.equals("-tid")) {
+ if (threadIndex == args.size()) {
+ // ie missing argument
+ throw new JDEException("Missing argument to
'on_thread_id'");
+ } else {
+ try {
+ return new Long(args.remove(threadIndex).toString());
+ } catch (NumberFormatException ex) {
+ throw new JDENumberFormatException("'on_thread_id'
argument");
+ }
+ }
+ } else if (threadArg.equals("on_thread_name")
+ || threadArg.equals("-tname")) {
+ if (threadIndex == args.size()) {
+ throw new JDEException("Missing argument to
'on_thread_name'");
+ } else {
+ return args.remove(threadIndex).toString();
+ }
+ } else {
+ throw new JDEException("Should not happen! Contact maintainer");
+ }
+ }
+ }
- /**
- * Parses the list of arguments for expression information.
- * <pre>
- * if "expression"
- * </pre>
- * Note that the exception is <b>not</b> raised if the tag isn't
- * present: only if what follows the tag is incorrect.
- * <p>
- * When used, the expression is evaluated at the time of the event,
- * and the event passed to jde if the expression evaluates to "true".
- * <p>
- * Shortcut: <u>-e</u>
- * <p>
- * @return string corresponding to the expression
- * @exception JDEException If the information cannot be resolved
- */
- public static String getExprFromArgs(List args)
- throws JDEException {
+ /**
+ * Parses the list of arguments for expression information.
+ * <pre>
+ * if "expression"
+ * </pre>
+ * Note that the exception is <b>not</b> raised if the tag isn't
+ * present: only if what follows the tag is incorrect.
+ * <p>
+ * When used, the expression is evaluated at the time of the event,
+ * and the event passed to jde if the expression evaluates to "true".
+ * <p>
+ * Shortcut: <u>-e</u>
+ * <p>
+ * @return string corresponding to the expression
+ * @exception JDEException If the information cannot be resolved
+ */
+ public static String getExprFromArgs(List args)
+ throws JDEException {
- String exprArg = null;
- int exprIndex = -1;
- for (int i = 0; i < args.size(); i++) {
- String arg = args.get(i).toString().toLowerCase();
- if (arg.equals("if") || arg.equals("-e")) {
- exprIndex = i;
- exprArg = args.remove(exprIndex).toString();
- break;
- }
- }
- // at this point, either exprArg = null, or "if". in
- // that case, exprIndex should now have the index of the argument
- if (exprArg == null) {
- return null;
- } else {
- if (exprArg.equals("if") || exprArg.equals("-e")) {
- if (exprIndex == args.size()) {
- // ie missing argument
- throw new JDEException("Missing argument to 'if'");
- } else {
- return args.remove(exprIndex).toString();
- }
- } else {
- throw new JDEException("Should not happen! Contact maintainer");
- }
- }
- }
-
-
- /**
- * Parses the list of arguments for class filter information.
- * <pre>
- * class_filters "classPatternList"
- * </pre>
- * Note that the exception is <b>not</b> raised if the tag isn't
- * present: only if what follows the tag is incorrect.
- * <p>
- * the classPatternList should be a list of class patterns, using
- * space or comma as delimiter.
- * <p>
- * Shortcut: <u>-cf</u>
- * <p>
- * This constraint is used to add class filters to events. To quote
- * JDI documentation:
- * <p>
- * Restricts the events generated by this request to those whose
- * location is in a class whose name matches a restricted regular
- * expression. Regular expressions are limited to exact matches
- * and patterns that begin with '*' or end with '*'; for example,
- * "*.Foo" or "java.*".
- * <p>
- * @return a List of all the class filters.
- * @exception JDEException If the information cannot be resolved
- */
- public static List getClassFiltersFromArgs(List args)
- throws JDEException {
-
- String filterArg = null;
- int filterIndex = -1;
- for (int i = 0; i < args.size(); i++) {
- String arg = args.get(i).toString().toLowerCase();
- if (arg.equals("class_filters") || arg.equals("-cf")) {
- filterIndex = i;
- filterArg = args.remove(filterIndex).toString();
- break;
- }
- }
- // at this point, either filterArg = null, or "if". in
- // that case, filterIndex should now have the index of the argument
- if (filterArg == null) {
- return null;
- } else {
- if (filterArg.equals("class_filters")
- || filterArg.equals("-cf")) {
- if (filterIndex == args.size()) {
- // ie missing argument
- throw new JDEException("Missing argument to 'class_filters'");
- } else {
- List filters = new ArrayList();
- StringTokenizer tokens = new StringTokenizer(args.remove(filterIndex).toString(),
" \t\n\r\f,");
- while (tokens.hasMoreTokens()) {
- filters.add(tokens.nextToken());
- }
- return filters;
- }
- } else {
- throw new JDEException("Should not happen! Contact maintainer");
- }
- }
+ String exprArg = null;
+ int exprIndex = -1;
+ for (int i = 0; i < args.size(); i++) {
+ String arg = args.get(i).toString().toLowerCase();
+ if (arg.equals("if") || arg.equals("-e")) {
+ exprIndex = i;
+ exprArg = args.remove(exprIndex).toString();
+ break;
+ }
+ }
+ // at this point, either exprArg = null, or "if". in
+ // that case, exprIndex should now have the index of the argument
+ if (exprArg == null) {
+ return null;
+ } else {
+ if (exprArg.equals("if") || exprArg.equals("-e")) {
+ if (exprIndex == args.size()) {
+ // ie missing argument
+ throw new JDEException("Missing argument to 'if'");
+ } else {
+ return args.remove(exprIndex).toString();
+ }
+ } else {
+ throw new JDEException("Should not happen! Contact maintainer");
+ }
+ }
+ }
+
+
+ /**
+ * Parses the list of arguments for class filter information.
+ * <pre>
+ * class_filters "classPatternList"
+ * </pre>
+ * Note that the exception is <b>not</b> raised if the tag isn't
+ * present: only if what follows the tag is incorrect.
+ * <p>
+ * the classPatternList should be a list of class patterns, using
+ * space or comma as delimiter.
+ * <p>
+ * Shortcut: <u>-cf</u>
+ * <p>
+ * This constraint is used to add class filters to events. To quote
+ * JDI documentation:
+ * <p>
+ * Restricts the events generated by this request to those whose
+ * location is in a class whose name matches a restricted regular
+ * expression. Regular expressions are limited to exact matches
+ * and patterns that begin with '*' or end with '*'; for example,
+ * "*.Foo" or "java.*".
+ * <p>
+ * @return a List of all the class filters.
+ * @exception JDEException If the information cannot be resolved
+ */
+ public static List getClassFiltersFromArgs(List args)
+ throws JDEException {
+
+ String filterArg = null;
+ int filterIndex = -1;
+ for (int i = 0; i < args.size(); i++) {
+ String arg = args.get(i).toString().toLowerCase();
+ if (arg.equals("class_filters") || arg.equals("-cf")) {
+ filterIndex = i;
+ filterArg = args.remove(filterIndex).toString();
+ break;
+ }
+ }
+ // at this point, either filterArg = null, or "if". in
+ // that case, filterIndex should now have the index of the argument
+ if (filterArg == null) {
+ return null;
+ } else {
+ if (filterArg.equals("class_filters")
+ || filterArg.equals("-cf")) {
+ if (filterIndex == args.size()) {
+ // ie missing argument
+ throw new JDEException("Missing argument to
'class_filters'");
+ } else {
+ List filters = new ArrayList();
+ StringTokenizer tokens = new
StringTokenizer(args.remove(filterIndex).toString(), " \t\n\r\f,");
+ while (tokens.hasMoreTokens()) {
+ filters.add(tokens.nextToken());
+ }
+ return filters;
+ }
+ } else {
+ throw new JDEException("Should not happen! Contact maintainer");
+ }
}
+ }
- /**
- * Parses the list of arguments for class exclusion filter information.
- * <pre>
- * class_exclusion_filters "classPatternList"
- * </pre>
- * Note that the exception is <b>not</b> raised if the tag isn't
- * present: only if what follows the tag is incorrect.
- * <p>
- * the classPatternList should be a list of class patterns, using
- * space or comma as delimiter.
- * <p>
- * Shortcut: <u>-cef</u>
- * <p>
- * This is used to add class exclusion filters to events. To quote
- * JDI documentation:
- * <p>
- * Restricts the events generated by this request to those whose
- * location is in a class whose name does <b>not</b> match this
- * restricted
- * regular expression. Regular expressions are limited to exact matches
- * and patterns that begin with '*' or end with '*'; for example,
- * "*.Foo" or "java.*".
- * <p>
- * @return a List of all the class exclusion filters.
- * @exception JDEException If the information cannot be resolved
- */
- public static List getClassExFiltersFromArgs(List args)
- throws JDEException {
+ /**
+ * Parses the list of arguments for class exclusion filter information.
+ * <pre>
+ * class_exclusion_filters "classPatternList"
+ * </pre>
+ * Note that the exception is <b>not</b> raised if the tag isn't
+ * present: only if what follows the tag is incorrect.
+ * <p>
+ * the classPatternList should be a list of class patterns, using
+ * space or comma as delimiter.
+ * <p>
+ * Shortcut: <u>-cef</u>
+ * <p>
+ * This is used to add class exclusion filters to events. To quote
+ * JDI documentation:
+ * <p>
+ * Restricts the events generated by this request to those whose
+ * location is in a class whose name does <b>not</b> match this
+ * restricted
+ * regular expression. Regular expressions are limited to exact matches
+ * and patterns that begin with '*' or end with '*'; for example,
+ * "*.Foo" or "java.*".
+ * <p>
+ * @return a List of all the class exclusion filters.
+ * @exception JDEException If the information cannot be resolved
+ */
+ public static List getClassExFiltersFromArgs(List args)
+ throws JDEException {
- String filterArg = null;
- int filterIndex = -1;
- for (int i = 0; i < args.size(); i++) {
- String arg = args.get(i).toString().toLowerCase();
- if (arg.equals("class_exclusion_filters")
- || arg.equals("-cef")) {
- filterIndex = i;
- filterArg = args.remove(filterIndex).toString();
- break;
- }
- }
- // at this point, either filterArg = null, or "if". in
- // that case, filterIndex should now have the index of the argument
- if (filterArg == null) {
- return null;
- } else {
- if (filterArg.equals("class_exclusion_filters")
- || filterArg.equals("-cef")) {
- if (filterIndex == args.size()) {
- // ie missing argument
- throw new JDEException("Missing argument to
'class_exclusion_filters'");
- } else {
- List filters = new ArrayList();
- StringTokenizer tokens = new StringTokenizer(args.remove(filterIndex).toString(),
" \t\n\r\f,");
- while (tokens.hasMoreTokens()) {
- filters.add(tokens.nextToken());
- }
- return filters;
- }
- } else {
- throw new JDEException("Should not happen! Contact maintainer");
- }
- }
+ String filterArg = null;
+ int filterIndex = -1;
+ for (int i = 0; i < args.size(); i++) {
+ String arg = args.get(i).toString().toLowerCase();
+ if (arg.equals("class_exclusion_filters")
+ || arg.equals("-cef")) {
+ filterIndex = i;
+ filterArg = args.remove(filterIndex).toString();
+ break;
+ }
}
+ // at this point, either filterArg = null, or "if". in
+ // that case, filterIndex should now have the index of the argument
+ if (filterArg == null) {
+ return null;
+ } else {
+ if (filterArg.equals("class_exclusion_filters")
+ || filterArg.equals("-cef")) {
+ if (filterIndex == args.size()) {
+ // ie missing argument
+ throw new JDEException("Missing argument to
'class_exclusion_filters'");
+ } else {
+ List filters = new ArrayList();
+ StringTokenizer tokens = new
StringTokenizer(args.remove(filterIndex).toString(), " \t\n\r\f,");
+ while (tokens.hasMoreTokens()) {
+ filters.add(tokens.nextToken());
+ }
+ return filters;
+ }
+ } else {
+ throw new JDEException("Should not happen! Contact maintainer");
+ }
+ }
+ }
- /**
- * Parses the list of arguments for suspend policy information.
- * <pre>
- * using_suspend_policy policy
- * </pre>
- * Note that the exception is <b>not</b> raised if the tags are
- * not present: only if what follows the tag is incorrect.
- * <p>
- * <i>policy</i> is one of "all", "thread", or
"none". "all" means the
- * entire
- * VM is suspended when the event occurs, "thread" indicates only the
- * thread on which the event occurs is suspended (only for events
- * associated with threads), while "none" means nothing is suspended
- * when the event occurs.
- * <p>
- * Shortcut: <u>-sp</u>
- * <p>
- * @return a valid int indicating the suspend policy
- * @exception JDEException If the information cannot be resolved
- */
- public static int getSuspendPolicyFromArgs(List args)
- throws JDEException {
+ /**
+ * Parses the list of arguments for suspend policy information.
+ * <pre>
+ * using_suspend_policy policy
+ * </pre>
+ * Note that the exception is <b>not</b> raised if the tags are
+ * not present: only if what follows the tag is incorrect.
+ * <p>
+ * <i>policy</i> is one of "all", "thread", or
"none". "all" means the
+ * entire
+ * VM is suspended when the event occurs, "thread" indicates only the
+ * thread on which the event occurs is suspended (only for events
+ * associated with threads), while "none" means nothing is suspended
+ * when the event occurs.
+ * <p>
+ * Shortcut: <u>-sp</u>
+ * <p>
+ * @return a valid int indicating the suspend policy
+ * @exception JDEException If the information cannot be resolved
+ */
+ public static int getSuspendPolicyFromArgs(List args)
+ throws JDEException {
- String suspendPolicyArg = null;
- int suspendPolicyIndex = -1;
- for (int i = 0; i < args.size(); i++) {
- String arg = args.get(i).toString().toLowerCase();
- if (arg.equals("using_suspend_policy") || arg.equals("-sp")) {
- suspendPolicyIndex = i;
- suspendPolicyArg =args.remove(suspendPolicyIndex).toString();
- break;
- }
- }
- // at this point, either suspendPolicyArg = null, or "if". in
- // that case, suspendPolicyIndex should now have the index of the
- // argument
- if (suspendPolicyArg == null) {
- return EventRequest.SUSPEND_ALL;
- } else {
- if (suspendPolicyArg.equals("using_suspend_policy")
- || suspendPolicyArg.equals("-sp")) {
- if (suspendPolicyIndex == args.size()) {
- // ie missing argument
- throw new JDEException("Missing argument to
'using_suspend_policy'");
- } else {
- String policy = args.remove(suspendPolicyIndex).toString().toLowerCase();
- if (policy.equals("all")) {
- return EventRequest.SUSPEND_ALL;
- } else if (policy.equals("thread")) {
- return EventRequest.SUSPEND_EVENT_THREAD;
- } else if (policy.equals("none")) {
- return EventRequest.SUSPEND_NONE;
- } else {
- throw new JDEException("Invalid suspend policy
'"+policy+"'");
- }
+ String suspendPolicyArg = null;
+ int suspendPolicyIndex = -1;
+ for (int i = 0; i < args.size(); i++) {
+ String arg = args.get(i).toString().toLowerCase();
+ if (arg.equals("using_suspend_policy") || arg.equals("-sp")) {
+ suspendPolicyIndex = i;
+ suspendPolicyArg =args.remove(suspendPolicyIndex).toString();
+ break;
+ }
+ }
+ // at this point, either suspendPolicyArg = null, or "if". in
+ // that case, suspendPolicyIndex should now have the index of the
+ // argument
+ if (suspendPolicyArg == null) {
+ return EventRequest.SUSPEND_ALL;
+ } else {
+ if (suspendPolicyArg.equals("using_suspend_policy")
+ || suspendPolicyArg.equals("-sp")) {
+ if (suspendPolicyIndex == args.size()) {
+ // ie missing argument
+ throw new JDEException("Missing argument to
'using_suspend_policy'");
+ } else {
+ String policy = args.remove(suspendPolicyIndex).toString().toLowerCase();
+ if (policy.equals("all")) {
+ return EventRequest.SUSPEND_ALL;
+ } else if (policy.equals("thread")) {
+ return EventRequest.SUSPEND_EVENT_THREAD;
+ } else if (policy.equals("none")) {
+ return EventRequest.SUSPEND_NONE;
+ } else {
+ throw new JDEException("Invalid suspend policy
'"+policy+"'");
+ }
- }
- } else {
- throw new JDEException("Should not happen! Contact maintainer");
- }
- }
+ }
+ } else {
+ throw new JDEException("Should not happen! Contact maintainer");
+ }
}
+ }
- /**
- * Parses the list of arguments for object ID information.
- * <pre>
- * if_object_id objectID
- * </pre>
- * Note that the exception is <b>not</b> raised if the tag isn't
- * present: only if what follows the tag is incorrect.
- * <p>
- * Shortcut: <u>-oid</u>
- * <p>
- * @return a Long corresponding to the object ID.
- * @exception JDEException If the information cannot be resolved
- */
- public static Long getObjectIDFromArgs(List args)
- throws JDEException {
+ /**
+ * Parses the list of arguments for object ID information.
+ * <pre>
+ * if_object_id objectID
+ * </pre>
+ * Note that the exception is <b>not</b> raised if the tag isn't
+ * present: only if what follows the tag is incorrect.
+ * <p>
+ * Shortcut: <u>-oid</u>
+ * <p>
+ * @return a Long corresponding to the object ID.
+ * @exception JDEException If the information cannot be resolved
+ */
+ public static Long getObjectIDFromArgs(List args)
+ throws JDEException {
- String idArg = null;
- int idIndex = -1;
- for (int i = 0; i < args.size(); i++) {
- String arg = args.get(i).toString().toLowerCase();
- if (arg.equals("if_object_id") || arg.equals("-oid")) {
- idIndex = i;
- idArg = args.remove(idIndex).toString();
- break;
- }
- }
- // at this point, either idArg = null, or "if". in
- // that case, idIndex should now have the index of the argument
- if (idArg == null) {
- return null;
- } else {
- if (idArg.equals("if_object_id")
- || idArg.equals("-oid")) {
- if (idIndex == args.size()) {
- // ie missing argument
- throw new JDEException("Missing argument to 'if_object_id'");
- } else {
- try {
- return new Long(args.remove(idIndex).toString());
- } catch (NumberFormatException ex) {
- throw new JDENumberFormatException("'if_object_id' argument");
- }
- }
- } else {
- throw new JDEException("Should not happen! Contact maintainer");
- }
- }
+ String idArg = null;
+ int idIndex = -1;
+ for (int i = 0; i < args.size(); i++) {
+ String arg = args.get(i).toString().toLowerCase();
+ if (arg.equals("if_object_id") || arg.equals("-oid")) {
+ idIndex = i;
+ idArg = args.remove(idIndex).toString();
+ break;
+ }
+ }
+ // at this point, either idArg = null, or "if". in
+ // that case, idIndex should now have the index of the argument
+ if (idArg == null) {
+ return null;
+ } else {
+ if (idArg.equals("if_object_id")
+ || idArg.equals("-oid")) {
+ if (idIndex == args.size()) {
+ // ie missing argument
+ throw new JDEException("Missing argument to
'if_object_id'");
+ } else {
+ try {
+ return new Long(args.remove(idIndex).toString());
+ } catch (NumberFormatException ex) {
+ throw new JDENumberFormatException("'if_object_id'
argument");
+ }
+ }
+ } else {
+ throw new JDEException("Should not happen! Contact maintainer");
+ }
}
+ }
} // Etc
+
+/*
+ * $Log: Etc.java,v $
+ * Revision 1.3 2003/01/08 06:53:38 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
+
+// End of Etc.java
1.5 +510 -307
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/EventHandler.java
Index: EventHandler.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/EventHandler.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- EventHandler.java 2001/08/16 03:28:58 1.4
+++ EventHandler.java 2006/03/03 20:41:39 1.5
@@ -1,21 +1,47 @@
-
package jde.debugger;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.sun.jdi.BooleanValue;
+import com.sun.jdi.StackFrame;
+import com.sun.jdi.ThreadReference;
+import com.sun.jdi.VMDisconnectedException;
+import com.sun.jdi.Value;
+import com.sun.jdi.event.BreakpointEvent;
+import com.sun.jdi.event.ClassPrepareEvent;
+import com.sun.jdi.event.ClassUnloadEvent;
+import com.sun.jdi.event.Event;
+import com.sun.jdi.event.EventIterator;
+import com.sun.jdi.event.EventQueue;
+import com.sun.jdi.event.EventSet;
+import com.sun.jdi.event.ExceptionEvent;
+import com.sun.jdi.event.LocatableEvent;
+import com.sun.jdi.event.MethodEntryEvent;
+import com.sun.jdi.event.MethodExitEvent;
+import com.sun.jdi.event.StepEvent;
+import com.sun.jdi.event.ThreadDeathEvent;
+import com.sun.jdi.event.ThreadStartEvent;
+import com.sun.jdi.event.VMDeathEvent;
+import com.sun.jdi.event.VMDisconnectEvent;
+import com.sun.jdi.event.VMStartEvent;
+import com.sun.jdi.event.WatchpointEvent;
+import com.sun.jdi.request.EventRequest;
+import com.sun.jdi.request.ExceptionRequest;
+import jde.debugger.Debugger;
+import jde.debugger.EventSetEvent;
+import jde.debugger.spec.EventRequestSpec;
+import jde.debugger.spec.WatchpointSpec;
-import jde.debugger.spec.*;
-import java.util.*;
-import com.sun.jdi.*;
-import com.sun.jdi.event.*;
-import com.sun.jdi.request.*;
-import com.sun.jdi.connect.*;
-import jde.debugger.LispForm;
+
/**
- * EventHandler.java
- * <p>
- * Each debugee VM has an event handler thread on the jdebug side
- * associated with it that receive all the events from the debugee
+ * Each Debugger has an event handler thread on the jdebug side
+ * associated with it that receives all the events from the debugee
* vm. In turn, the event handler thread passes the events on to the
* jde, indicating if the vm/current thread was suspended.
* <p>
@@ -23,102 +49,67 @@ import jde.debugger.LispForm;
*
* @author Amit Kumar
* @since 0.1
+ * @see Debugger
+ * @version $Revision: 1.6 $
*/
-public class EventHandler implements Runnable, Protocol {
+public class EventHandler extends Thread implements Protocol {
+ /** milliseconds to wait for a new event from the VM before timing out */
+ static final int EVTQ_TIMEOUT = 2000;
/** Are we connected to the VM? */
- boolean connected = true;
-
- /** The process for which we're the event handler */
- final DebuggeeProcess proc;
+ private boolean m_connected = true;
- /** The ID of the process */
- final Integer procID;
+ /** The debugger for which we're the event handler */
+ private final Debugger m_debugger;
- final JDE jde = JDE.getJDE();
-
- /**
- * My own thread. Used when we want to suspend ourselves or some such
- * weird stuff :-)
- */
- final Thread thread;
-
/** Keeping track of if the thread is over yet or not */
- boolean completed = false;
+ boolean m_stopRequested = false;
/**
* Used by the event handlers to indicate if the app should be
* resumed after the event occured.
*/
boolean resumeApp;
+
+ /** List of EventSetListeners to notify */
+ private final Collection m_eventSetListeners;
+
+ public EventHandler(Debugger debugger) {
+ super("Event Handler for process " + debugger.getProcID());
- public EventHandler(DebuggeeProcess proc) {
- /* the q gets all the events from the vm */
- this.proc = proc;
- this.procID = proc.getId();
- this.thread = new Thread(this, "Event Handler for App #"+procID);
- this.thread.start();
+ m_debugger = debugger;
+ m_eventSetListeners = new LinkedList();
+ addEventSetListener(new EvtListener());
}
+ /**
+ * Indicates that the thread executing the event handling should
+ * stop as the first opportunity.
+ */
public void shutdown() {
- connected = false;
- thread.interrupt();
- while (!completed) {
- try {wait();} catch (InterruptedException ex) {}
- }
+ m_stopRequested = true;
+ // XXX - if the event queue timeout is increased beyond the
+ // 500 msecs that it is set to at the moment, it's a good idea
+ // to interrupt the thread in some way. Otherwise, the
+ // shutdown could be a bit sluggish
}
/**
- * The thread reads an eventset at a time from the application queue,
- * and processes it. Essentially, one by one, each event of the eventset
- * is sent to the corresponding "handler", and if at least one of them
- * returns a non-null value, we pass on the eventset (and the values
- * returned by the handlers) to jde. Otherwise, we just resume the vm
- * (regardless of the suspend policy) and wait for the next eventset.
- * <p>
- * This is the syntax of the event set:
- * <pre>
- * (JDE_BUG_EVENTSET <u>suspend-state</u> <u>thread</u>
[<u>event-string</u>]+)
- * </pre>
- *
- * <ul>
- * <li> <u>suspend-state</u> is one of "all",
"none" and "thread"
- * <li> <u>thread</u> is either nil, or the thread corresponding to
the
- * event set.
- * <li> <u>event-string</u> is the reply from a handler method. See
the
- * individual handler methods.
- * <li> The suspend policy is as follows. Some of the commands (see
- * the {@link Protocol protocol}) allow for specifying the suspend
- * policy for the corresponding event. For example, we might specify
- * that the vm resume automatically after a method entry event is
- * reported.
- * <p>
- * Firstly, when multiple events are sent (in an event-set), the
- * suspend policy of the entire event set is the one that would
- * suspend the most threads. So, if a breakpoint-hit is sent with
- * the method-entry event, and the breakpoint-hit wants to suspend
- * the vm, while method-entry wants to resume, overall, the event
- * set suspend policy will be to suspend
- * <p>
- * Further, some of the events might occur that haven't been
- * explicitly requested, and hence we haven't set their suspend
- * policy anyway. In these cases, and even otherwise, another
- * decision is made at the time of handling of events regarding the
- * suspension/resumption of the vm.
- * <p>
- * So, when an event set is received, each event is handled (via
- * it's handler method). Each event ANDs to a variable resumeApp
- * what it thinks should be done to the app: for example, the
- * vmDeathEvent handler wants to resume, so it does
- * <code>resumeApp &= true;</code>. In the same way, when a
- * breakpoint is hit (and matches the constraints), it does a
- * <code>resumeApp &= false:</code>.
- * <p>
- * After all events have been handled, we check the value of
- * resumeApp. If it's true, we resume the vm. If not, we check
- * the suspend-policy of the event set, and take appropriate action.
- * <p>
+ * The thread reads an eventset at a time from the application
+ * queue, and processes it.<p>
+ *
+ * First, it notifies all <code>EventSetListener</code> that an
+ * event set has arrived. The listeners can set a flag in the event
+ * to indicate if the JVM should be resumed. The old method of
+ * setting the resumeApp variable is also supported for the old
+ * code.<p>
+ *
+ * Next, all listeners are again notified whether we are suspending
+ * or resuming the JVM. If we are resuming the JVM, the listener
+ * registered in this class' constructor does the resume, so all
+ * other listeners will be notified after the JVM has been resumed.
+ *
* This two-tier suspend-policy handling might be simplified to
* some extent once all commands support setting of a suspend
* policy, with that and that alone being used to decide on what
@@ -130,111 +121,95 @@ public class EventHandler implements Run
* not interesting if it doesn't occur on the "right" thread), the
* latter approach might not work well at all.
* </ul>
- */
+ */
public void run() {
- EventQueue queue = proc.getEventQueue();
- /* only need to run while we're connected */
- while (connected) {
- try {
- EventSet eventSet = queue.remove();
+ EventQueue queue = m_debugger.getVM().eventQueue();
- resumeApp = true;
-
- List events = new ArrayList();
- EventIterator it = eventSet.eventIterator();
-
- // System.out.println("Suspend policy of eventset:
"+((eventSet.suspendPolicy() == EventRequest.SUSPEND_NONE)?"none":"not
none"));
-
- while (it.hasNext()) {
- // System.out.println("An event");
- LispForm sendLispForm = handleEvent(it.nextEvent());
- // if the handler thinks the user doesn't <i>deserve</i>
- // the event, it'll return null. another microsoftism
- // in the code... :-(
- if (sendLispForm != null) {
- events.add(sendLispForm);
- }
- }
-
- // if no event wants to inform itself to the user, what
- // are we doing anyway?
- if (events.size() == 0) {
- eventSet.resume();
- continue;
- }
-
- String suspendStateString;
- if (resumeApp) {
- // this resume does a vm resume or a thread resume
- // depending on how it was suspended
- suspendStateString = "none";
- eventSet.resume();
- } else {
- switch(eventSet.suspendPolicy()) {
- case EventRequest.SUSPEND_ALL: {
- suspendStateString = "all";
- break;
- }
- case EventRequest.SUSPEND_EVENT_THREAD: {
- suspendStateString = "thread";
- break;
- }
- case EventRequest.SUSPEND_NONE: {
- suspendStateString = "none";
- eventSet.resume();
- break;
- }
- default: {
- suspendStateString = "invalid";
- break;
- }
- }
- }
+ while (!m_stopRequested && m_connected) {
+ try {
+ EventSet eventSet = queue.remove(EVTQ_TIMEOUT);
- String eventSetString = "\""+suspendStateString+"\"";
+ // eventSet is null if the remove() operation timed out.
+ if (eventSet == null) {
+ JDE.debug(FRAMEWORK, "EventHandler " + m_debugger.getProcID() +
" timed out");
+ continue;
+ }
+
+ // OK, we have a real event set, so process it.
+ resumeApp = true;
+
+ // Notify all listeners that we got an event set.
+ ThreadReference eventThread = getCurrentThread(eventSet);
+ EventSetEvent event = new EventSetEvent(eventSet,
+ eventThread,
+ !resumeApp);
+ JDE.debug(FRAMEWORK, "EventHandler: sending event " + event);
+
+ for (Iterator iter = m_eventSetListeners.iterator();
+ iter.hasNext();
+ /* */) {
+ EventSetListener listener = (EventSetListener) iter.next();
+ listener.eventSetReceived(event);
+ } // for each EventSetListener
+
+ if (resumeApp) {
+ // Notify all listeners that we'll be resuming the VM
+ for (Iterator iter = m_eventSetListeners.iterator();
+ iter.hasNext();
+ /* */) {
+ EventSetListener listener = (EventSetListener) iter.next();
+ JDE.debug(FRAMEWORK, "EventHandler: sending resume event to " +
listener);
+ try {
+ listener.debuggerResumed(event);
+ } catch (RuntimeException exc) {
+ JDE.signalException(exc);
+ }
+ } // for each EventSetListener
+ JDE.debug(FRAMEWORK, "EventHandler: VM resumed");
+ } else {
+
+ JDE.debug(FRAMEWORK, "EventHandler: VM not resumed");
+ // Notify all listeners that we'll be suspending the VM
+ // and not restarting it
+ for (Iterator iter = m_eventSetListeners.iterator();
+ iter.hasNext();
+ /* */) {
+ EventSetListener listener = (EventSetListener) iter.next();
+ JDE.debug(FRAMEWORK,
+ "EventHandler: sending suspended event to " +
+ listener);
+ listener.debuggerSuspended(event);
+ } // for each EventSetListener
+ }
- ThreadReference eventThread = getCurrentThread(eventSet);
- if (eventThread == null) {
- eventSetString += " nil";
- } else {
- eventSetString += BR +
- Rep.getThreadRep(eventThread, proc.getStore());
- }
-
- Iterator iter = events.iterator();
- while (iter.hasNext()) {
- eventSetString += BR +iter.next();
- }
-
- // finally, we send the events to The Man. (or woman...)
- jde.signal(procID, EVENTSET, new LispForm(eventSetString));
-
} catch (InterruptedException ex) {
- // Debug.printIf(ex);
- // used by shutdown
+ // should not happen...
+ JDE.debug(EXCEPTION, ex.toString());
} catch (VMDisconnectedException ex) {
- Debug.printIf(ex);
- handleDisconnectedException();
+ // this should also not happen, unless there's a bug in the
+ // JDEbug Java implementation
+ JDE.debug(EXCEPTION, ex.toString());
+ handleDisconnectedException(queue);
+ } catch (RuntimeException ex) {
+ JDE.debug(EXCEPTION, ex.toString());
+ ex.printStackTrace();
}
- }
- synchronized (this) {
- completed = true;
- notifyAll();
}
+ JDE.debug(FRAMEWORK, "event handler: " + m_debugger.getProcID() + "
terminated");
}
+
/**
* Handles the events that happened
*
* @param event One of the events in the event set.
- * @return A LispForm that indicates what should be sent to jde. This
+ * @return A String that should be sent to jde. This
* should be of the form "(list jde-dbo-EVENT-event [args])". Each
- * of the functions called herein should return a LispForm of the above
- * form.
+ * of the functions called herein returns that type of string.
*/
- private LispForm handleEvent(Event event) {
+ private String handleEvent(Event event) {
if (event instanceof BreakpointEvent) {
return breakpointEvent((BreakpointEvent)event);
} else if (event instanceof StepEvent) {
@@ -272,34 +247,59 @@ public class EventHandler implements Run
* Duh... we don't recognize this event... or, we choose not to do
* anything about it
*/
- private LispForm otherEvent(Event event) {
+ private String otherEvent(Event event) {
resumeApp &= true;
- return new LispForm("(list '"+EVENT_OTHER+")");
+ return "(list '"+EVENT_OTHER+")";
}
/**
* What we should do if we get disconnected while we're doing something
* else.
*/
- private void handleDisconnectedException() {
+ private void handleDisconnectedException(EventQueue queue) {
// disconnected while handling some other event. flush queue
// and deal with disconnectEvent and deathEvents
- EventQueue queue = proc.getEventQueue();
- while (connected) {
+
+ int numberOfTimeoutsBeforeQuit = 5;
+ int currentNumberOfTimeouts = 0;
+
+ JDE.debug(FRAMEWORK, "handling disconnected exception");
+
+ while (m_connected) {
try {
- EventSet eventSet = queue.remove();
- EventIterator iter = eventSet.eventIterator();
- while (iter.hasNext()) {
- Event evt = (Event)iter.next();
- if (evt instanceof VMDeathEvent) {
- vmDeathEvent(evt);
- } else if (evt instanceof VMDisconnectEvent) {
- vmDisconnectEvent(evt);
- }
- }
+ JDE.debug(FRAMEWORK, "handling disconnected exception loop");
+ EventSet eventSet = queue.remove(EVTQ_TIMEOUT);
+
+ if (eventSet == null) {
+ currentNumberOfTimeouts++;
+ // this could be problematic if there's no vmDisconnectEvent in the
+ // queue.. I guess it shouldn't happen, but.. / Petter
+ if (currentNumberOfTimeouts >= numberOfTimeoutsBeforeQuit) {
+ JDE.signal(m_debugger.getProcID(), ERROR,
+ "no vmDisconnectEvent found in handleDisconnectedException
after " +
+ currentNumberOfTimeouts +
+ " timeouts, terminating anyway!", QUOTE);
+ m_connected = false;
+ }
+ // we did not get any event set, so try for another one (or quit, if we've
tried
+ // too many times)
+ continue;
+ }
+
+ JDE.debug(FRAMEWORK, "disc. exc: got an event set");
+
+ EventIterator iter = eventSet.eventIterator();
+ while (iter.hasNext()) {
+ Event evt = (Event)iter.next();
+ if (evt instanceof VMDeathEvent) {
+ vmDeathEvent(evt);
+ } else if (evt instanceof VMDisconnectEvent) {
+ vmDisconnectEvent(evt);
+ }
+ }
} catch (InterruptedException ex) {
- Debug.printIf(ex);
- // ignore
+ JDE.debug(EXCEPTION, ex.toString());
+ // ignore
}
}
}
@@ -309,7 +309,7 @@ public class EventHandler implements Run
* an event set to have a thread associated with it: in those cases
* just return null.
*
- * @param eventSet The event set that occured
+ * @param eventSet The event set that occurred
* @return <code>null</code> if there is no thread associated, otherwise
* the ThreadReference of the Thread
*/
@@ -317,8 +317,8 @@ public class EventHandler implements Run
ThreadReference thread;
if (eventSet.size() > 0) {
/*
- * If any event in the set has a thread associated with it,
- * they all will, so just grab the first one.
+ * If any event in the set has a thread associated with it,
+ * they all will, so just grab the first one.
*/
Event event = (Event)eventSet.iterator().next(); // Is there a better way?
thread = getEventThread(event);
@@ -328,6 +328,7 @@ public class EventHandler implements Run
return thread;
}
+
/**
* Black magic to divine the ThreadReference of the
* event. Question: can we use "Black magic" and "divine" in the
same
@@ -384,20 +385,20 @@ public class EventHandler implements Run
} else if (thread instanceof Long) {
ThreadReference t = getEventThread(event);
if (t.uniqueID() == ((Long)thread).longValue()) {
- return "(list \"on_thread_id\" "+t.uniqueID()+")";
+ return "(list \"on_thread_id\" "+t.uniqueID()+")";
} else {
- return null;
+ return null;
}
} else if (thread instanceof String) {
ThreadReference tRef =
- proc.getThread(thread.toString());
+ m_debugger.getThreadReference(thread.toString());
ThreadReference t = getEventThread(event);
-
+
if (t.equals(tRef)) {
- return "(list \"on_thread_name\""
- +" \""+thread.toString()+"\")";
+ return "(list \"on_thread_name\""
+ +" \""+thread.toString()+"\")";
} else {
- return null;
+ return null;
}
} else {
return "\"Error matching thread\"";
@@ -433,21 +434,21 @@ public class EventHandler implements Run
if (exprObject != null) {
String expr = exprObject.toString();
try {
- StackFrame frame = getEventThread(event).frame(0);
- Value val = Etc.evaluate(expr, frame);
- if (!val.type().name().equals("boolean")) {
- return "\"Expression evaluates to non-boolean\"";
- } else {
- BooleanValue boolValue = (BooleanValue)val;
- if (boolValue.value() == true) {
- return "(list \""+expr+"\")";
- } else {
- return null;
- }
- }
+ StackFrame frame = getEventThread(event).frame(0);
+ Value val = Etc.evaluate(expr, frame);
+ if (!val.type().name().equals("boolean")) {
+ return "\"Expression evaluates to non-boolean\"";
+ } else {
+ BooleanValue boolValue = (BooleanValue)val;
+ if (boolValue.value() == true) {
+ return "(list \""+expr+"\")";
+ } else {
+ return null;
+ }
+ }
} catch (Exception ex) {
- Debug.printIf(ex);
- return "\"Expression didn't evaluate correctly\"";
+ JDE.debug(EXCEPTION, ex.toString());
+ return "\"Expression didn't evaluate correctly\"";
}
}
return "nil";
@@ -485,18 +486,18 @@ public class EventHandler implements Run
} else if (idObject instanceof Long) {
Long id = (Long)idObject;
if (event.object() == null) {
- return "(list "+id+")";
+ return "(list "+id+")";
} else if (event.object().uniqueID() == id.longValue()) {
- return "(list "+id+")";
+ return "(list "+id+")";
} else {
- return null;
+ return null;
}
} else {
return "\"Object ID was not a Long\"";
}
- }
+ }
-
+
/**
* A Breakpoint was hit. We check (based on information in the event
* request; put in when the spec was resolved; that's sent along with
@@ -516,17 +517,25 @@ public class EventHandler implements Run
* that the user is not interested in the event of this event :-)
* </ul>
*/
- private LispForm breakpointEvent(BreakpointEvent event) {
+ private String breakpointEvent(BreakpointEvent event) {
+ JDE.debug(EVENTS, "got a BreakpointEvent");
Long specID =
((EventRequestSpec)event.request().getProperty(EventRequestSpec.specPropertyKey)).getID();
+ // Keep track of this thread, since the debugger will ask for more info about it.
+ ThreadReference thread = event.thread();
+
+ if (thread != null) {
+ m_debugger.getStore().put(thread);
+ }
+
// check if the current thread is ok.
String threadString = threadMatch(event);
if (threadString == null) {
resumeApp &= true;
return null;
}
-
+
// check if the expression matches
String exprString = expressionSuccess(event);
if (exprString == null) {
@@ -535,11 +544,11 @@ public class EventHandler implements Run
}
resumeApp &= false;
- return new LispForm("(list '"+EVENT_BREAKPOINT_HIT
- +" "+specID
- + BR +Rep.getLocationRep(event.location())
- +" "+threadString
- +" "+exprString+")");
+ return "(list '"+EVENT_BREAKPOINT_HIT
+ +" "+specID
+ + BR +Rep.getLocationRep(event.location())
+ +" "+threadString
+ +" "+exprString+")";
}
@@ -553,12 +562,14 @@ public class EventHandler implements Run
* (list {@link Protocol#EVENT_STEP_COMPLETED step-function} {@link
Rep#getLocationRep(Location) location-string})
* </pre>
*/
- private LispForm stepEvent(StepEvent event) {
+ private String stepEvent(StepEvent event) {
+ JDE.debug(EVENTS, "got a STEP event");
+
resumeApp &= false;
- return new LispForm("(list '"
- +EVENT_STEP_COMPLETED
- +" "+Rep.getLocationRep(event.location())
- +")");
+ return "(list '"
+ +EVENT_STEP_COMPLETED
+ +" "+Rep.getLocationRep(event.location())
+ +")";
}
/**
@@ -570,7 +581,7 @@ public class EventHandler implements Run
*
* <b>Syntax:</b>
* <pre>
- * (list {@link Protocol#EVENT_WATCHPOINT_HIT watchpoint-hit-function} specID {@link
Rep#getObjectRep(ObjectReference,ObjectStore) object-on-which-hit} {@link
Rep#getFieldValueRep(Field, Value, ObjectStore) field-and-value} {@link
Rep#getLocationRep(Location) location}
+ * (list {@link Protocol#EVENT_WATCHPOINT_HIT watchpoint-hit-function} specID {@link
Rep#getObjectRep(ObjectReference) object-on-which-hit} {@link Rep#getFieldValueRep(Field,
Value) field-and-value} {@link Rep#getLocationRep(Location) location}
* {@link #objectIDMatches object-id-string} {@link #threadMatch thread-string}
{@link #expressionSuccess expression-string})
* </pre>
*
@@ -581,7 +592,8 @@ public class EventHandler implements Run
* that the user is not interested in the event of this event :-)
* </ul>
*/
- private LispForm watchpointEvent(WatchpointEvent event) {
+ private String watchpointEvent(WatchpointEvent event) {
+ JDE.debug(EVENTS, "got a WATCHPOINT event");
Long specID =
((EventRequestSpec)event.request().getProperty(EventRequestSpec.specPropertyKey)).getID();
@@ -593,7 +605,7 @@ public class EventHandler implements Run
resumeApp &= true;
return null;
}
-
+
// check if the expression matches
String exprString = expressionSuccess(event);
if (exprString == null) {
@@ -607,23 +619,19 @@ public class EventHandler implements Run
resumeApp &= true;
return null;
}
-
- String fieldValueString =
- Rep.getFieldValueRep(event.field(), event.valueCurrent(),
- proc.getStore()).toString();
- String objectString = Rep.getObjectRep(event.object(),
- proc.getStore()).toString();
+ String fieldValueString = Rep.getFieldValueRep(event.field(), event.valueCurrent());
+ String objectString = Rep.getObjectRep(event.object());
resumeApp &= false;
- return new LispForm("(list '"+EVENT_WATCHPOINT_HIT
- +" "+specID
- + BR +objectString
- + BR +fieldValueString
- + BR +Rep.getLocationRep(event.location())
- + BR +objectIDString
- +" "+threadString
- +" "+exprString+")");
+ return "(list '"+EVENT_WATCHPOINT_HIT
+ +" "+specID
+ + BR +objectString
+ + BR +fieldValueString
+ + BR +Rep.getLocationRep(event.location())
+ + BR +objectIDString
+ +" "+threadString
+ +" "+exprString+")";
}
@@ -635,7 +643,7 @@ public class EventHandler implements Run
*
* <b>Syntax:</b>
* <pre>
- * (list {@link Protocol#EVENT_EXCEPTION exception-function} specID {@link
Rep#getObjectRep(ObjectReference,ObjectStore) exception} {@link #threadMatch
thread-string})
+ * (list {@link Protocol#EVENT_EXCEPTION exception-function} specID {@link
Rep#getObjectRep(ObjectReference) exception} {@link #threadMatch thread-string})
* </pre>
*
* <b>Comments:</b>
@@ -645,15 +653,16 @@ public class EventHandler implements Run
* that the user is not interested in the event of this event :-)
* </ul>
*/
- private LispForm exceptionEvent(ExceptionEvent event) {
+ private String exceptionEvent(ExceptionEvent event) {
+ JDE.debug(EVENTS, "got an EXCEPTION event");
if (event.request() == null) {
resumeApp &= true;
return null;
}
-
+
Long specID =
((EventRequestSpec)event.request().getProperty(EventRequestSpec.specPropertyKey)).getID();
-
+
ExceptionRequest request =
(ExceptionRequest)event.request();
@@ -663,14 +672,13 @@ public class EventHandler implements Run
resumeApp &= true;
return null;
}
-
+
resumeApp &= false;
- return new LispForm("(list '"
- +EVENT_EXCEPTION
- +" "+specID
- + BR +Rep.getObjectRep(event.exception(),
- proc.getStore())
- + BR +threadString+")");
+ return "(list '"
+ +EVENT_EXCEPTION
+ +" "+specID
+ + BR +Rep.getObjectRep(event.exception())
+ + BR +threadString+")";
}
@@ -683,14 +691,16 @@ public class EventHandler implements Run
* (list {@link Protocol#EVENT_METHOD_ENTRY method-entry-function} {@link
Rep#getMethodRep method})
* </pre>
*/
- private LispForm methodEntryEvent(MethodEntryEvent event) {
+ private String methodEntryEvent(MethodEntryEvent event) {
+ JDE.debug(EVENTS, "got a METHOD ENTRY event");
+
resumeApp &= false;
- return new LispForm("(list '"
- + EVENT_METHOD_ENTRY
- + BR +Rep.getMethodRep(event.method())
- +")");
+ return "(list '"
+ + EVENT_METHOD_ENTRY
+ + BR +Rep.getMethodRep(event.method())
+ +")";
}
-
+
/**
* A method was exit.
* <p>
@@ -700,14 +710,16 @@ public class EventHandler implements Run
* (list {@link Protocol#EVENT_METHOD_EXIT method-exit-function} {@link
Rep#getMethodRep method})
* </pre>
*/
- private LispForm methodExitEvent(MethodExitEvent event) {
+ private String methodExitEvent(MethodExitEvent event) {
+ JDE.debug(EVENTS, "got a METHOD EXIT event");
+
resumeApp &= false;
- return new LispForm("(list '"
- + EVENT_METHOD_EXIT
- + BR +Rep.getMethodRep(event.method())
- +")");
+ return "(list '"
+ + EVENT_METHOD_EXIT
+ + BR +Rep.getMethodRep(event.method())
+ +")";
}
-
+
/**
* A thread started
@@ -718,15 +730,19 @@ public class EventHandler implements Run
* (list {@link Protocol#EVENT_THREAD_START thread-start-function} {@link
Rep#getThreadRep thread})
* </pre>
*/
- private LispForm threadStartEvent(ThreadStartEvent event) {
+ private String threadStartEvent(ThreadStartEvent event) {
+ JDE.debug(EVENTS, "got a THREAD START event");
+
+ // Keep track of this thread for future reference
+ m_debugger.getStore().put(event.thread());
+
resumeApp &= false;
- return new LispForm("(list '"
- + EVENT_THREAD_START
- + BR +Rep.getThreadRep(event.thread(),
- proc.getStore())
- +")");
+ return "(list '"
+ + EVENT_THREAD_START
+ + BR +Rep.getThreadRep(event.thread())
+ +")";
}
-
+
/**
* A thread died.
* <p>
@@ -736,19 +752,20 @@ public class EventHandler implements Run
* (list {@link Protocol#EVENT_THREAD_DEATH thread-death-function} {@link
Rep#getThreadRep thread})
* </pre>
*/
- private LispForm threadDeathEvent(ThreadDeathEvent event) {
+ private String threadDeathEvent(ThreadDeathEvent event) {
+ JDE.debug(EVENTS, "got a THREAD DEATH event");
+
resumeApp &= false;
- return new LispForm("(list '"
- + EVENT_THREAD_DEATH
- + BR +Rep.getThreadRep(event.thread(),
- proc.getStore())
- +")");
+ return "(list '"
+ + EVENT_THREAD_DEATH
+ + BR +Rep.getThreadRep(event.thread())
+ +")";
}
-
+
/**
* A class was prepared. The user might not have even requested for
- * this event: we set it up by default in {@link Application#Application}
+ * this event: we set it up by default in {@link Debugger#start}
* because we need it for resolution of specs.
* <p>
* If a user also requests for this event, a particular property is
@@ -761,17 +778,24 @@ public class EventHandler implements Run
* (list {@link Protocol#EVENT_CLASS_PREPARE class-prepare-function} reference-type)
* </pre>
*/
- private LispForm classPrepareEvent(ClassPrepareEvent event) {
- proc.resolve(event.referenceType());
+ private String classPrepareEvent(ClassPrepareEvent event) {
+ // XXX - too many of these. JDE.debug(EVENTS, "got a CLASS PREPARE
event");
+
+ m_debugger.getEventRequestSpecList().resolve(event.referenceType());
// now find out if this event was also requested by the user.
// it will be, if the "default" property does NOT exists in the
- // corresponding request.
+ // corresponding request.
EventRequest request = event.request();
if (request.getProperty("default") == null) {
+ // Event was requested by the user
+
resumeApp &= false;
- return new LispForm("(list '"+EVENT_CLASS_PREPARE
- +" \""+event.referenceType().name()+"\")");
+ return "(list '"+EVENT_CLASS_PREPARE
+ +" \""+event.referenceType().name()+"\")";
} else {
+ // Not requested by the user, so don't return anything, but do
+ // make sure the application is resumed.
+
resumeApp &= true;
return null;
}
@@ -786,27 +810,206 @@ public class EventHandler implements Run
* (list {@link Protocol#EVENT_CLASS_UNLOAD class-unload-function} reference-type)
* </pre>
*/
- private LispForm classUnloadEvent(ClassUnloadEvent event) {
+ private String classUnloadEvent(ClassUnloadEvent event) {
+ JDE.debug(EVENTS, "got a CLASS UNLOAD event");
+
resumeApp &= false;
- return new LispForm("(list '"+EVENT_CLASS_UNLOAD
- +" \""+event.className()+"\")");
+ return "(list '"+EVENT_CLASS_UNLOAD
+ +" \""+event.className()+"\")";
}
-
- private LispForm vmStartEvent(Event event) {
+
+ private String vmStartEvent(Event event) {
+ JDE.debug(EVENTS, "got a VM START event");
+
+ // Make sure that we keep track of the main thread. Other threads
+ // will be tracked by the threadStart events (?? - may have to
+ // subscribe to those events first... Otherwise, an approach is the
+ // old one, of always writing the thread that reports an event to the
+ // object store, but that's sooo ugly) / Petter
+ ThreadReference thread = getEventThread(event);
+ m_debugger.getStore().put(thread);
+
resumeApp &= false;
- return new LispForm("(list '"+EVENT_VM_START+")");
+ return "(list '"+EVENT_VM_START+")";
}
-
- private LispForm vmDeathEvent(Event event) {
+
+ private String vmDeathEvent(Event event) {
+ JDE.debug(EVENTS, "got a VM DEATH event");
+
resumeApp &= true;
- return new LispForm("(list '"+EVENT_VM_DEATH+")");
+ return "(list '"+EVENT_VM_DEATH+")";
}
+
+ private String vmDisconnectEvent(Event event) {
+ JDE.debug(EVENTS, "got a VM DISCONNECT event");
- private LispForm vmDisconnectEvent(Event event) {
- connected = false;
+ m_connected = false;
resumeApp &= true;
- proc.shutdown();
- return new LispForm("(list '"+EVENT_VM_DISCONNECT+")");
+ try {
+ m_debugger.shutdown();
+ }
+ catch (JDEException e) {
+ JDE.signal(m_debugger.getProcID(), ERROR, "EventHandler.vmDisconnectEvent()
caught exception: " + e, QUOTE);
+ }
+ return "(list '"+EVENT_VM_DISCONNECT+")";
+ }
+
+ /** Add an EventSetListener. If the listener is already in the
+ * list, nothing is done */
+ void addEventSetListener(EventSetListener listener) {
+ if (m_eventSetListeners.contains(listener))
+ return;
+ m_eventSetListeners.add(listener);
+ }
+
+ /** Remove an EventSetListener. If the listener is already in the
+ * list, nothing is done */
+ void removeEventSetListener(EventSetListener listener) {
+ m_eventSetListeners.remove(listener);
+ }
+
+ /** This class determines whether to suspend the JVM based on the
+ * event, and send the appropriate message to JDEE. It used to be
+ * the bulk of the { @link #run } method in this class. <p>
+ *
+ * Essentially, one by one, each event of the eventset
+ * is sent to the corresponding "handler", and if at least one of them
+ * returns a non-null value, we pass on the eventset (and the values
+ * returned by the handlers) to jde. Otherwise, we just resume the vm
+ * (regardless of the suspend policy) and wait for the next eventset.
+ * <p>
+ * This is the syntax of the event set:
+ * <pre>
+ * (JDE_BUG_EVENTSET <u>suspend-state</u> <u>thread</u>
[<u>event-string</u>]+)
+ * </pre>
+ *
+ * <ul>
+ * <li> <u>suspend-state</u> is one of "all",
"none" and "thread"
+ * <li> <u>thread</u> is either nil, or the thread corresponding to
the
+ * event set.
+ * <li> <u>event-string</u> is the reply from a handler method. See
the
+ * individual handler methods.
+ * <li> The suspend policy is as follows. Some of the commands (see
+ * the {@link Protocol protocol}) allow for specifying the suspend
+ * policy for the corresponding event. For example, we might specify
+ * that the vm resume automatically after a method entry event is
+ * reported.
+ * <p>
+ * Firstly, when multiple events are sent (in an event-set), the
+ * suspend policy of the entire event set is the one that would
+ * suspend the most threads. So, if a breakpoint-hit is sent with
+ * the method-entry event, and the breakpoint-hit wants to suspend
+ * the vm, while method-entry wants to resume, overall, the event
+ * set suspend policy will be to suspend
+ * <p>
+ * Further, some of the events might occur that haven't been
+ * explicitly requested, and hence we haven't set their suspend
+ * policy anyway. In these cases, and even otherwise, another
+ * decision is made at the time of handling of events regarding the
+ * suspension/resumption of the vm.
+ * <p>
+ * So, when an event set is received, each event is handled (via
+ * it's handler method). Each event ANDs to a variable resumeApp
+ * what it thinks should be done to the app: for example, the
+ * vmDeathEvent handler wants to resume, so it does
+ * <code>resumeApp &= true;</code>. In the same way, when a
+ * breakpoint is hit (and matches the constraints), it does a
+ * <code>resumeApp &= false:</code>.
+ * <p>
+ * After all events have been handled, we check the value of
+ * resumeApp. If it's true, we resume the vm. If not, we check
+ * the suspend-policy of the event set, and take appropriate action.
+ * <p>
+ */
+ private class EvtListener implements EventSetListener {
+ // XXX changed from ArrayList, since LinkedList should be faster with
+ // no indexed access needed. / Petter
+ private final List events = new LinkedList();
+ private String suspendStateString;
+
+ public void eventSetReceived(EventSetEvent evt) {
+ events.clear();
+ EventIterator it = evt.getEventSet().eventIterator();
+
+ while (it.hasNext()) {
+ String eventLispDescription = handleEvent(it.nextEvent());
+ // if the handler thinks the user doesn't <i>deserve</i>
+ // the event, it'll return null. another microsoftism
+ // in the code... :-(
+ if (eventLispDescription != null) {
+ events.add(eventLispDescription);
+ }
+ }
+ } // eventSetReceived
+
+ public void debuggerSuspended(EventSetEvent evt) {
+ switch(evt.getEventSet().suspendPolicy()) {
+ case EventRequest.SUSPEND_ALL:
+ suspendStateString = "all";
+ break;
+
+ case EventRequest.SUSPEND_EVENT_THREAD:
+ suspendStateString = "thread";
+ break;
+
+ case EventRequest.SUSPEND_NONE:
+ suspendStateString = "none";
+ evt.getEventSet().resume();
+ break;
+
+ default:
+ suspendStateString = "invalid";
+ break;
+ }
+ finishEventSet(evt);
+ } // debuggerSuspended
+
+ public void debuggerResumed(EventSetEvent evt) {
+ // this resume does a vm resume or a thread resume
+ // depending on how it was suspended
+ suspendStateString = "none";
+ finishEventSet(evt);
+ evt.getEventSet().resume();
+ JDE.debug(FRAMEWORK, "EventHandler: VM resumed");
+ }
+
+ private void finishEventSet(EventSetEvent evt) {
+ StringBuffer eventSetString = new StringBuffer("\"");
+ eventSetString.append(suspendStateString);
+ eventSetString.append("\"");
+
+ ThreadReference eventThread = evt.getThreadReference();
+ if (eventThread == null) {
+ eventSetString.append(" nil");
+ } else {
+ eventSetString.append(BR);
+ eventSetString.append(Rep.getThreadRep(eventThread));
+ }
+
+ Iterator iter = events.iterator();
+ while (iter.hasNext()) {
+ eventSetString.append(BR);
+ eventSetString.append(iter.next().toString());
+ }
+
+ // finally, we send the events to The Man. (or woman...)
+ JDE.signal(m_debugger.getProcID(),
+ EVENTSET,
+ eventSetString.toString(),
+ NOQUOTE);
+ }
}
-
+
} // EventHandler
+
+/*
+ * $Log: EventHandler.java,v $
+ * Revision 1.6 2003/04/29 16:51:56 troy
+ * Initial version of GUI. Includes display of local variables.
+ *
+ * Revision 1.5 2003/01/08 06:53:38 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
+
+// End of EventHandler.java
1.3 +183 -126 XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/JDE.java
Index: JDE.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/JDE.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- JDE.java 2001/08/16 03:28:58 1.2
+++ JDE.java 2006/03/03 20:41:39 1.3
@@ -1,9 +1,11 @@
package jde.debugger;
-import java.io.BufferedReader;
+
+import java.io.OutputStream;
import java.io.PrintWriter;
-import java.io.InputStreamReader;
-import java.util.List;
-import java.util.Iterator;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.text.DateFormat;
+import java.util.Date;
/**
* JDE.java
@@ -11,169 +13,224 @@ import java.util.Iterator;
*
* Created: Thu Feb 15 12:58:59 2001
*
- * @author <a href="mailto: "</a>
- * @version
+ * @author Paul Kinnucan
+ * @version $Revision: 1.7 $
*/
public class JDE implements Protocol {
-
- private JDE (){}
-
+ /**
+ * The single instance of this class.
+ *
+ */
+ private static JDE s_jde = new JDE(System.out);
- public void init() {
+ /**
+ * Writes command responses, messages, and event notifications to
+ * JDE.
+ */
+ private PrintWriter m_out;
+
+ /** logical OR of the debug flags that should be used in this particular session */
+ private int m_debugFlags
+ = APP_IO
+ | JDE_PIPE
+ | EVENTS
+ | EXCEPTION
+ | FRAMEWORK
+ | COMMANDS
+ | GUI
+ ;
- // The debugger uses standard out to sent command responses, error
- // messages and event notifications to the JDE.
- out = new PrintWriter(System.out);
+ /**
+ * Buffer used to store messages to be sent
+ * via stdout to Emacs.
+ *
+ */
+ private StringBuffer msgbuf = new StringBuffer(256);
- // The debugger uses standard int to read commands from the JDE.
- in = new BufferedReader(new InputStreamReader(System.in));
+ private JDE(OutputStream out) {
+ m_out = new PrintWriter(out, true);
- commandStream = new CommandStream(in);
-
}
- public List nextCommand() {
- return commandStream.nextCommand();
- }
-
/*
- *
- * FUNCTIONS FOR SENDING INFORMATION OVER TO THE JDE SIDE
- *
+ * Private methods ----------------------------------------------------
*/
- /**
- * Returns a string representation of the object. Here is the logic:
- * <ul>
- * <li> If the object is null, return an empty string
- * <li> If the object is string, quote it within quotation marks.
- * <li> If the object is a list, recursively call stringRep, appending
- * a space.
- * <li> If it's any other kind of object, return the .toString()
- * </ul>
- */
- public String stringRep(Object obj) {
- if (obj == null) {
- return "";
- } else if (obj instanceof String) {
- return "\""+obj.toString()+"\"";
- } else if (obj instanceof List) {
- StringBuffer returnString = new StringBuffer("");
- Iterator it = ((List)obj).iterator();
- while (it.hasNext()) {
- returnString.append(stringRep(it.next())+" ");
- }
- return BR +returnString.toString().trim();
- } else {
- return obj.toString();
+ private synchronized void p_transmit(String type, String message) {
+ m_out.println("(" + JDE_BUG + type + " " + message +
")");
+ }
+
+ private void p_setDebugFlags(int flags) {
+ m_debugFlags = flags;
+ }
+
+ private void p_debug(int flag, String message) {
+ if ((m_debugFlags & flag) != 0) {
+ p_transmit(DEBUG, " \"" +
+ DateFormat.getTimeInstance(DateFormat.MEDIUM).format(new Date()) +
": " +
+ message + "\"");
}
}
+ /*
+ * Public, static interface --------------------------------------------------
+ */
/**
- * Send an arbitrary lisp function across.
+ * To indicate which of the debugging flags should be set. If a
+ * flag is set, it means that calls to <code>JDE.debug()</code>
+ * with that flag will actually be printed.
*
- * @param app_id The application ID
- * @param type The function name. JDE_BUG gets added to
- * its beginning
- * @param obj An arbitrary object. If a string, it's just printed out,
- * if a list, each of its elements is printed out, with a space after
- * each.
- */
- synchronized public void signal(Integer app_id, String type,
- Object obj) {
- String strRep = stringRep(obj);
- if (strRep.equals("")) {
- System.out.println(BR+"("+JDE_BUG+type+"
"+app_id+")"+BR);
- } else {
- String temp="("+JDE_BUG+type+ BR +app_id+"
"+stringRep(obj)+")";
- if (temp.length() <= 80)
- System.out.println(BR+"("+JDE_BUG+type+" "+app_id+" "+
- stringRep(obj)+")"+BR);
- else
- System.out.println( BR +temp+ BR );
- }
- System.out.flush();
+ * @param flags an <code>int</code> value with a bitwise OR of the
+ * types of information that are desired.
+ * @see Protocol#NONE
+ */
+ public static void setDebugFlags(int flags) {
+ s_jde.p_setDebugFlags(flags);
}
/**
- * Signal a reply: a result or an error
- */
- synchronized private void signalReply(Integer app_id, Integer cmd_id,
- Object obj, String type) {
- String strRep = stringRep(obj);
- if (strRep.equals("")) {
- System.out.println(BR+"("+type+" "+cmd_id+")"+BR);
- } else {
- String temp = "("+type+ BR +cmd_id+" "+strRep+")";
- if (temp.length() <= 80)
- System.out.println(BR+"("+type+" "+cmd_id+"
"+strRep+")"+BR);
- else
- System.out.println( BR +temp+ BR );
- }
- System.out.flush();
+ * Send a debugging message to Emacs, for display in the
+ * <code>*JDEbug*</code> buffer. The message will only be printed
+ * if the flag that is passed in the first argument is set. The
+ * current time is prepended to the message string.
+ *
+ * @param flag an <code>int</code> value
+ * @param message a <code>String</code> value
+ * @see Protocol
+ * @see #setDebugFlags
+ */
+ public static void debug(int flag, String message) {
+ s_jde.p_debug(flag, message);
}
-
/**
- * send the result of a command. indicates a positive completion of
- * the command. this could of course be provisional: eg. in case of
- * provisional breakpoints
- */
- public void signalCommandResult(Integer app_id, Integer cmd_id) {
- signalCommandResult(app_id, cmd_id, null);
+ * Sends the result of executing a debugger command to
+ * Emacs. Depending on wether the command was successful or not,
+ * different lisp code will be generated. If the
+ * <code>quote</code> argument is set ({@link Protocol#QUOTE}),
+ * double quotes will be added around the message string. The idea
+ * is that if the command result should be a Lisp string, you
+ * should set the <code>quote</code> argument to get the double
+ * quotes, and otherwise not.
+ *
+ * @param cmdID the ID of the command
+ * @param message a <code>String</code> value
+ * @param success indicates what to generate, {@link
+ * Protocol#COMMAND_RESULT} or {@link Protocol#COMMAND_ERROR}
+ * @param quote a <code>boolean</code> value
+ */
+ public static void commandResult(Integer cmdID, String message, boolean success,
boolean quote) {
+ String type = success ? COMMAND_RESULT : COMMAND_ERROR;
+
+ StringBuffer messageBuffer = new StringBuffer(cmdID.toString());
+
+ if (message != null && message.length() > 0) {
+ messageBuffer.append(" ");
+ if (quote) {
+ messageBuffer.append("\"");
+ }
+ messageBuffer.append(message);
+ if (quote) {
+ messageBuffer.append("\"");
+ }
+ }
+
+ s_jde.p_transmit(type, messageBuffer.toString());
}
- public void signalDebug(String msg) {
- signal(Jdebug.debuggerID, MESSAGE, msg);
- }
/**
+ * Equivalent to calling {@link #commandResult(Integer,
+ * String, boolean, boolean)} with the <code>quote</code> argument
+ * set to {@link Protocol#NOQUOTE}.
*
- * the result of a command. if it's a string, just send it across, else
- * it should be a list. each element is sent across, just doing a
- * toString() -> ie, if you want to send (... 23 "some string" 45), you
- * need to put in the quotes (ie "") yourself: else what will be sent
- * will be (... 23 some string 45), obviously wrong.
+ * @param cmdID an <code>Integer</code> value
+ * @param message a <code>String</code> value
+ * @param success a <code>boolean</code> value
*/
- synchronized public void signalCommandResult(Integer app_id,
- Integer cmd_id, Object obj) {
- signalReply(app_id, cmd_id, obj, COMMAND_RESULT);
+ public static void commandResult(Integer cmdID, String message, boolean success) {
+ commandResult(cmdID, message, success, NOQUOTE);
}
-
/**
- * reply to a command with an error.
- * @param obj Is usually a string explaining what went wrong.
- */
- synchronized public void signalCommandError(Integer app_id,
- Integer cmd_id, Object obj) {
- signalReply(app_id, cmd_id, obj, COMMAND_ERROR);
+ * A method for sending more arbitrary information to Emacs. If
+ * the <code>quote</code> argument is set, double quotes will
+ * added around the message string.
+ *
+ * @param procID an <code>Integer</code> value
+ * @param type a <code>String</code> value indicating what Lisp
+ * command should be sent
+ * @param message a <code>String</code> value
+ * @param quote a <code>boolean</code> value
+ */
+ public static void signal(Integer procID, String type, String message, boolean quote)
{
+ StringBuffer messageBuffer = new StringBuffer(procID.toString());
+
+ if (message != null && message.length() > 0) {
+ messageBuffer.append(" ");
+ if (quote) {
+ messageBuffer.append("\"");
+ }
+ messageBuffer.append(message);
+ if (quote) {
+ messageBuffer.append("\"");
+ }
+ }
+
+ s_jde.p_transmit(type, messageBuffer.toString());
}
- public static JDE getJDE() {
- return jde;
+ /** A method for signaling JDEE that an exception occured. The
+ message displayed in Emacs will include the stack trace. */
+ public static void signalException(Throwable exc) {
+ s_jde.p_signalException(exc);
+ }
+
+ private void p_signalException(Throwable exc) {
+ if ((m_debugFlags & EXCEPTION) != 0) {
+ Writer writer = new StringWriter();
+ exc.printStackTrace(new PrintWriter(writer));
+ signal(new Integer(-1), ERROR,
+ "Exception during command execution: " +
+ writer.toString(),
+ QUOTE);
+ }
}
- /*
- * Reads commands from JDE.
- */
- BufferedReader in;
- /*
- * Writes command responses, messages, and event notifications to
- * JDE.
+ /**
+ * Equivalent to calling {@link #signal(Integer,
+ * String, String, boolean)} with the <code>quote</code> argument
+ * set to false.
+ *
+ * @param procID an <code>Integer</code> value
+ * @param type a <code>String</code> value
+ * @param message a <code>String</code> value
*/
- PrintWriter out;
-
-
- CommandStream commandStream;
-
- private static JDE jde = new JDE();
+ public static void signal(Integer procID, String type, String message) {
+ signal(procID, type, message, NOQUOTE);
+ }
+}// JDE
+/*
+ * $Log: JDE.java,v $
+ * Revision 1.7 2003/09/21 05:23:11 paulk
+ * Fix bug in setDebugFlags (it was calling itself).
+ *
+ * Revision 1.6 2003/04/29 16:51:56 troy
+ * Initial version of GUI. Includes display of local variables.
+ *
+ * Revision 1.5 2003/01/15 05:50:51 paulk
+ * Remove CRs.
+ *
+ * Revision 1.4 2003/01/08 06:53:38 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
-}// JDE
+// End of JDE.java
1.3 +16 -7
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/JDEException.java
Index: JDEException.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/JDEException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- JDEException.java 2001/08/16 03:28:58 1.2
+++ JDEException.java 2006/03/03 20:41:39 1.3
@@ -1,4 +1,3 @@
-
package jde.debugger;
/**
@@ -12,17 +11,27 @@ package jde.debugger;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.2 $
*/
public class JDEException extends Exception implements Protocol {
- final String message;
+ final String message;
- public JDEException(String str) {
- super(str);
- this.message = str;
- }
+ public JDEException(String str) {
+ super(str);
+ this.message = str;
+ }
- public String getMessage() { return message; }
+ public String getMessage() { return message; }
} // JDEException
+
+/*
+ * $Log: JDEException.java,v $
+ * Revision 1.2 2003/01/08 06:53:38 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
+
+// End of JDEException
1.3 +13 -4
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/JDENumberFormatException.java
Index: JDENumberFormatException.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/JDENumberFormatException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- JDENumberFormatException.java 2001/08/16 03:28:59 1.2
+++ JDENumberFormatException.java 2006/03/03 20:41:39 1.3
@@ -1,4 +1,3 @@
-
package jde.debugger;
/**
@@ -10,12 +9,22 @@ package jde.debugger;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.2 $
*/
public class JDENumberFormatException extends JDEException {
- public JDENumberFormatException(String str) {
- super("Non-numeric "+str);
- }
+ public JDENumberFormatException(String str) {
+ super("Non-numeric "+str);
+ }
} // JDENumberFormatException
+
+/*
+ * $Log: JDENumberFormatException.java,v $
+ * Revision 1.2 2003/01/08 06:53:37 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
+
+// end of JDENumberFormatException.java
1.3 +41 -23 XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/Main.java
Index: Main.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/Main.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- Main.java 2001/08/16 03:28:59 1.2
+++ Main.java 2006/03/03 20:41:40 1.3
@@ -1,4 +1,3 @@
-
package jde.debugger;
import java.io.*;
@@ -6,33 +5,52 @@ import java.net.*;
import java.util.*;
/**
- * Main class that has the "main" is called by jde.
- * <p>
- * Created: Wed Jul 7 21:02:39 1999
+ * Main class for JDEbug.
+ *
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.5 $
*/
-
public class Main implements Protocol {
- public static void main(String[] args) {
- if (args.length > 0) {
- System.out.println("Usage: java jde.debugger.Main");
- // Etc.dump(args);
- System.out.flush();
- System.exit(0);
- } else {
- System.out.println(BR+"(" + JDE_INIT_DEBUG_SESSION+")"+BR);
- System.out.flush();
- try {
- Jdebug.theDebugger.init();
- Jdebug.theDebugger.start();
- } catch (IOException ex) {
- System.out.println("I/O Error");
- System.exit(1);
- }
- }
+ /**
+ * Main method for the JDEbug application.
+ * This method starts the debugger command
+ * loop.
+ *
+ * @param args a <code>String[]</code> value
+ */
+ public static void main(String[] args) {
+ if (args.length > 0) {
+ System.out.println("Usage: java jde.debugger.Main");
+ System.out.flush();
+ System.exit(1);
+ } else {
+ System.out.println(BR+"(" + JDE_INIT_DEBUG_SESSION+")"+BR);
+ System.out.flush();
+ try {
+ JDE.setDebugFlags(0);
+ JDEbug.theDebugger.init();
+ JDEbug.theDebugger.start();
+ } catch (IOException ex) {
+ System.out.println("I/O Error");
+ System.exit(1);
+ }
}
+ }
-} // Main
+} // main
+
+/*
+ * $Log: Main.java,v $
+ * Revision 1.5 2003/09/21 05:29:51 paulk
+ * Turn off debug message flags.
+ *
+ * Revision 1.4 2003/01/15 05:53:28 paulk
+ * Updated some javadoc.
+ *
+ * Revision 1.3 2003/01/08 06:53:37 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
1.3 +80 -49
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/ObjectStore.java
Index: ObjectStore.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/ObjectStore.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- ObjectStore.java 2001/08/16 03:28:59 1.2
+++ ObjectStore.java 2006/03/03 20:41:40 1.3
@@ -1,7 +1,9 @@
-
package jde.debugger;
-import java.util.*;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import com.sun.jdi.*;
@@ -11,9 +13,17 @@ import com.sun.jdi.*;
*
* The main function of this class is to keep a store of all the currently
* referenced objects. Any time jdebug sends an object ID across, it stores
- * the ObjectReference itself in {@link #objectMap}, mapped to the id that
+ * the ObjectReference itself in {@link #m_objectMap}, mapped to the id that
* will identify this object. This id is the ObjectReference.uniqueID().
* <p>
+ * <i>
+ * XXX - I am not really sure if the below argumentation is really correct.
+ * The store is definitely needed to look up what object corresponds to a
+ * given unique id. And having a reference to the object stored there means
+ * it will not be garbage collected. But why make such a fuss about it?
+ * Something to think about, I could be missing something. / Petter
+ * </i>
+ * <p>
* We need to do this because if we don't keep a link to the ObjectReference
* <i>some</i>where, it might get garbage collected, and the id used to
* identify it (ie the uniqueID) reused. If the user then requests info
@@ -23,17 +33,23 @@ import com.sun.jdi.*;
* When jde wants to know more about the object, it sends across the id,
* which is used to reference the ObjectReference in the Map
* <p>
+ * <i>
+ * XXX The below stuff is another aspect of the ObjectStore that
+ * appears to be unnecessarily complicated. It is currently not
+ * active, since there is no call to the method {@link #trim}
+ * </i>
+ * <p>
* Since this is done with each object that's ever reported to jde, the list
* can get pretty huge, and needs to be refreshed from time to time. For
- * this purpose, we maintain the variable {@link #maximumLimit}.
+ * this purpose, we maintain the variable {@link #m_maximumLimit}.
* <p>
* Objects keep getting added to the list, until we
- * reach {@link #maximumLimit}. At this point, a notification is sent to the
+ * reach {@link #m_maximumLimit}. At this point, a notification is sent to the
* jde side requesting for a list of all the object references (ie, the ids)
* that it is currently interested in.
* <p>
- * When this list is obtained, the {@link #objectMap} is scanned and entries
- * <i>not</i> in this list removed. {@link #maximumLimit} is then set to
+ * When this list is obtained, the {@link #m_objectMap} is scanned and entries
+ * <i>not</i> in this list removed. {@link #m_maximumLimit} is then set to
* 2 times the current size of the list, or the old maximumLimit, whichever
* is larger. This is to ensure we don't keep sending the request over and
* over again very frequently.
@@ -54,76 +70,91 @@ import com.sun.jdi.*;
* Created: Thu Jul 29 10:38:06 1999
*
* @author Amit Kumar
+ * @author Paul Kinnucan
+ * @author Petter Mahlen
* @since 0.1
+ * @version $Revision: 1.3 $
*/
public class ObjectStore implements Protocol {
-
- /** my very own process! */
- final DebuggeeProcess proc;
-
- final Integer procID;
-
- JDE jde = JDE.getJDE();
-
- /** maps object_id -> ObjectReference */
- private Map objectMap;
+
+ private Debugger m_debugger;
+
+ /**
+ * Maps object_id -> ObjectReference. Not synchronized, since it is
+ * only accessed from synchronized methods in this class.
+ */
+ private Map m_objectMap;
/** maximum number of objects before we send a notification to jde */
- private long maximumLimit = 8;
+ private long m_maximumLimit = 100;
/** keep track of if our request has been met yet */
- private boolean requestPending = false;
+ private boolean m_requestPending = false;
/** Create a new object map for a new process. */
- public ObjectStore(DebuggeeProcess proc) {
- this.proc = proc;
- procID = proc.getId();
- objectMap = new HashMap();
+ public ObjectStore(Debugger debugger) {
+ m_debugger = debugger;
+ m_objectMap = new HashMap();
}
- /** Register that an object is being sent to the jde side */
- public void put(ObjectReference ref) {
- long size;
- synchronized (this) {
- objectMap.put(new Long(ref.uniqueID()), ref);
- size = objectMap.size();
- }
- if (size > maximumLimit) {
- if (!requestPending) {
- jde.signal(procID, REPORT_IDS_IN_USE, null);
- requestPending = true;
+ /**
+ * Register an object. Needs to be synchronized since both the event
+ * handler and command handler threads will be accessing the object
+ * store.
+ */
+ public synchronized void put(ObjectReference ref) {
+
+ // Debug.printIf(Debug.EVENTS, "storing object with reference number: " +
ref.uniqueID());
+
+ m_objectMap.put(new Long(ref.uniqueID()), ref);
+ long size = m_objectMap.size();
+
+ if (size > m_maximumLimit) {
+ if (!m_requestPending) {
+ JDE.signal(m_debugger.getProcID(), REPORT_IDS_IN_USE, null);
+ m_requestPending = true;
}
}
}
/**
* jde sent us a list of objects it is currently interested in. Trim
- * objectMap based on this list
+ * objectMap based on this list.
+ * <p>
+ * XXX - this method is never called, currently!
+ * Also, I would say it's unnecessary, since a debugging session is usually pretty
+ * short and involves less than a couple of hundred commands from Emacs. And that
+ * in term means that there won't be more than a couple of thousand objects or so
+ * in the map, which should be OK. / Petter
*/
- public void trim(List objectIDs) {
+ public synchronized void trim(List objectIDs) {
Map newMap = new HashMap();
Iterator it = objectIDs.iterator();
while (it.hasNext()) {
Long id = (Long)it.next();
- synchronized (this) {
- if (objectMap.containsKey(id)) {
- newMap.put(id, objectMap.get(id));
- }
+
+ if (m_objectMap.containsKey(id)) {
+ newMap.put(id, m_objectMap.get(id));
}
}
- maximumLimit = 2*newMap.size();
- synchronized (this) {
- objectMap = newMap;
- }
- requestPending = false;
+ m_maximumLimit = 2 * newMap.size();
+ m_objectMap = newMap;
+ m_requestPending = false;
}
/** Returns the object corresponding to the id, or null */
- public ObjectReference get(Object id) {
- synchronized (this) {
- return (ObjectReference)objectMap.get(id);
- }
+ public synchronized ObjectReference get(Object id) {
+ return (ObjectReference) m_objectMap.get(id);
}
} // ObjectStore
+
+/*
+ * $Log: ObjectStore.java,v $
+ * Revision 1.3 2003/01/08 06:53:37 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
+
+// End of ObjectStore.java
1.3 +72 -24
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/Protocol.java
Index: Protocol.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/Protocol.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- Protocol.java 2001/02/12 06:34:15 1.2
+++ Protocol.java 2006/03/03 20:41:40 1.3
@@ -1,4 +1,3 @@
-
package jde.debugger;
/**
@@ -103,6 +102,7 @@ package jde.debugger;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.3 $
*/
public interface Protocol {
@@ -160,53 +160,53 @@ public interface Protocol {
/** @see jde.debugger.command.Run */
public final static String RUN = "run";
- /** @see GeneralCommands#doFinish(Integer, List) */
+ /** @see jde.debugger.command.Finish */
public final static String FINISH = "finish";
- /** @see GeneralCommands#doTraceClasses(Integer, List) */
+ /** @see jde.debugger.command.TraceClasses */
public final static String TRACE_CLASSES = "trace_classes";
- /** @see GeneralCommands#doCancelTraceClasses(Integer, List) */
+ /** @see jde.debugger.command.CancelTraceClasses */
public final static String CANCEL_TRACE_CLASSES = "cancel_trace_classes";
- /** @see SpecCommands#doTraceExceptions(Integer, List) */
+ /** @see jde.debugger.command.TraceExceptions */
public final static String TRACE_EXCEPTIONS = "trace_exceptions";
- /** @see SpecCommands#doWatch(Integer, List) */
+ /** @see jde.debugger.command.Watch */
public final static String WATCH = "watch";
- /** @see SpecCommands#doBreak(Integer, List) */
+ /** @see jde.debugger.command.Break */
public final static String BREAK = "break";
- /** @see SpecCommands#doClear(Integer, List) */
+ /** @see jde.debugger.command.Clear */
public final static String CLEAR = "clear";
/** @see jde.debugger.command.Step */
public final static String STEP = "step";
- /** @see ThreadCommands#doSuspend(Integer, List) */
+ /** @see jde.debugger.command.Suspend */
public final static String SUSPEND = "suspend";
- /** @see ThreadCommands#doResume(Integer, List) */
+ /** @see jde.debugger.command.Resume */
public final static String RESUME = "resume";
- /** @see ThreadCommands#doInterrupt(Integer, List) */
+ /** @see jde.debugger.command.Interrupt */
public final static String INTERRUPT = "interrupt";
- /** @see ThreadCommands#doKillThread(Integer, List) */
+ /** @see jde.debugger.command.KillThread */
public final static String KILL_THREAD = "kill_thread";
- /** @see ThreadCommands#doGetThreads(Integer, List) */
+ /** @see jde.debugger.command.GetThreads */
public final static String GET_THREADS = "get_threads";
- /** @see ThreadCommands#doGetThread(Integer, List) */
+ /** @see jde.debugger.command.GetThread */
public final static String GET_THREAD = "get_thread";
- /** @see ThreadCommands#doGetObjectMonitors(Integer, List) */
+ /** @see jde.debugger.command.GetObjectMonitors */
public final static String GET_OBJECT_MONITORS = "get_object_monitors";
- /** @see ThreadCommands#doTraceThreads(Integer, List) */
+ /** @see jde.debugger.command.TraceThreads */
public final static String TRACE_THREADS = "trace_threads";
- /** @see ThreadCommands#doCancelTraceThreads(Integer, List) */
+ /** @see jde.debugger.command.CancelTraceThreads */
public final static String CANCEL_TRACE_THREADS = "cancel_trace_threads";
- /** @see GeneralCommands#doTraceMethods(Integer, List) */
+ /** @see jde.debugger.command.TraceMethods */
public final static String TRACE_METHODS = "trace_methods";
- /** @see GeneralCommands#doCancelTraceMethods(Integer, List) */
+ /** @see jde.debugger.command.CancelTraceMethods */
public final static String CANCEL_TRACE_METHODS = "cancel_trace_methods";
- /** @see GeneralCommands#doGetObject(Integer, List) */
+ /** @see jde.debugger.command.GetObject */
public final static String GET_OBJECT = "get_object";
/** @see jde.debugger.command.GetArray */
@@ -218,9 +218,9 @@ public interface Protocol {
/** @see jde.debugger.command.GetLocals */
public final static String GET_LOCALS = "get_locals";
- /** @see GeneralCommands#doGetLoadedClasses(Integer, List) */
+ /** @see jde.debugger.command.GetLoadedClasses */
public final static String GET_LOADED_CLASSES = "get_loaded_classes";
- /** @see GeneralCommands#doGetPathInformation(Integer, List) */
+ /** @see jde.debugger.command.GetPathInfo */
public final static String GET_PATH_INFORMATION = "get_path_information";
/** @see jde.debugger.command.EvaluateExpression */
@@ -250,10 +250,10 @@ public interface Protocol {
/** The command executed properly, returns the result */
public final static String COMMAND_RESULT =
- JDE_BUG+"command-result";
+ "command-result";
/** There was an error executing the command, returns the error */
public final static String COMMAND_ERROR =
- JDE_BUG+"command-error";
+ "command-error";
/** A message to be displayed on the JDE UI */
public final static String MESSAGE =
@@ -360,4 +360,52 @@ public interface Protocol {
*
*/
+ // Constants for signalling through the JDE class
+ public final static boolean QUOTE = true;
+ public final static boolean NOQUOTE = false;
+ public final static boolean CMD_OK = true;
+ public final static boolean CMD_NOK = false;
+
+
+ /**
+ * No trace output
+ */
+ public final static int NONE = 0;
+ /**
+ * Trace application I/O - CURRENTLY NOT USED
+ */
+ public final static int APP_IO = 1;
+ /**
+ * Trace pipe between Emacs and Java - CURRENTLY NOT USED
+ */
+ public final static int JDE_PIPE = 2;
+ /**
+ * Trace anything related to events.
+ */
+ public final static int EVENTS = 4;
+ /**
+ * Trace exceptions
+ */
+ public final static int EXCEPTION = 8;
+ /**
+ * Trace the functioning of the framework: debugging process
+ * administration, etc.
+ */
+ public final static int FRAMEWORK = 16;
+ /**
+ * Trace command execution
+ */
+ public final static int COMMANDS = 32;
+ /**
+ * Trace GUI
+ */
+ public final static int GUI = 64;
+
} // Protocol
+
+/*
+ * $Log: Protocol.java,v $
+ * Revision 1.3 2003/01/08 06:53:37 paulk
+ * Integrate Petter Mahlen's updates.
+ *
+ */
1.7 +721 -734 XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/Rep.java
Index: Rep.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/Rep.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- Rep.java 2003/01/18 05:48:34 1.6
+++ Rep.java 2006/03/03 20:41:40 1.7
@@ -1,9 +1,3 @@
-/*
- * Copyright (c) 2000, 2001, 2002 Paul Kinnucan
- *
- * $Revision: 1.17 $
- */
-
package jde.debugger;
import com.sun.jdi.*;
@@ -53,304 +47,297 @@ import java.util.*;
* is sent across, as against when it's treated as an object.
* <p>
* Created: Tue Aug 3 16:36:54 1999
+ *
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
*
+ *
* @author Amit Kumar
+ * @author Paul Kinnucan
* @since 0.1
+ * @version $Revision: 1.18 $
*/
public class Rep implements Protocol {
- /**
- * Returns a representation of a Location
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * (list "type-name" "sourcefile" lineNumber)
- * (list "type-name" nil lineNumber)
- * </pre>
- *
- * <b>Comments:</b>
- * <ul>
- * <li> lineNumber is -1 if that information is not available
- * </ul>
- */
- public static LispForm getLocationRep(Location loc) {
- String locationString = "(list
\""+loc.declaringType().name()+"\"";
- try {
- locationString += " \""+loc.sourceName()+"\"";
- } catch (AbsentInformationException ex) {
- locationString += " nil";
- }
- locationString += " "+loc.lineNumber()+")";
- return new LispForm(locationString);
- }
-
-
- /**
- * Returns a representation of a method
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * (list "name of method" return-type-name
- * (list [argument-type-name]*)
- * ["final"] ["static"] ["native"]
["constructor"] ["abstract"]
- * ["synchronized"] ["static_initializer"])
- * </pre>
- */
- static LispForm getMethodRep(Method m) {
- List l = m.argumentTypeNames();
- String argList = "(list";
- Iterator it = l.iterator();
- while (it.hasNext()) {
- argList += " \""+it.next().toString()+"\"";
- }
- argList += ")";
-
- return new LispForm("(list
\""+m.declaringType().name()+"\""
- +" \""+m.name()+"\""
- +" \""+m.returnTypeName()+"\""
- + BR +argList
- +(m.isFinal()?" \"final\"":"")
- +(m.isStatic()?" \"static\"":"")
- +(m.isNative()?" \"native\"":"")
- +(m.isConstructor()?" \"constructor\"":"")
- +(m.isAbstract()?" \"abstract\"":"")
- +(m.isSynchronized()?" \"synchronized\"":"")
- +(m.isStaticInitializer()
- ?" \"static_initializer\"":"")
- +")");
- }
-
-
-
- /**
- * Returns a representation of a local variable on a stack frame
- * <p>
- * <b>Syntax:</b>
- * <pre>
- * (list "name of variable" "type of variable")
- * </pre>
- */
- static public LispForm getLocalVariableRep(LocalVariable lv) {
- return new LispForm("(list"
- + " \""+lv.name()+"\""
- + " \""+lv.typeName()+"\")");
- }
-
- /**
- * Returns a representation of a (local variable, value) pair.
- * <p>
- * <b>Syntax:</b>
- * <pre>
- * ({@link #getLocalVariableRep local-variable} . {@link #getValueRep value})
- * </pre>
- */
- static public LispForm getLocalVariableValueRep(LocalVariable lv, Value v,
- ObjectStore s) {
- return new LispForm("(cons "+getLocalVariableRep(lv)
- +" "+getValueRep(v, s)+")");
- }
-
- /**
- * Returns a list of (local variable, value) pairs.
- * <p>
- * <b>Syntax:</b>
- * <pre>
- * (list [{@link #getLocalVariableValueRep (local variable, value) pair}]*)
- * </pre>
- */
- static public LispForm getLocalVariableValueMapRep(Map map, ObjectStore s) {
- String localVariablesValuesString = "(list ";
- Set keys = map.keySet();
- Iterator iter = keys.iterator();
- while (iter.hasNext()) {
- LocalVariable localVariable = (LocalVariable)iter.next();
- Value val = (Value)map.get(localVariable);
- localVariablesValuesString +=
- BR +getLocalVariableValueRep(localVariable, val, s);
- }
- localVariablesValuesString += ")";
- return new LispForm(localVariablesValuesString);
- }
-
-
- /**
- * Returns a representation of a field.
- * <p>
- * <b>Syntax:</b>
- * <pre>
- * (list "name of field" "type of field" ["transient"]
["volatile"]
- * ["final"] ["static"])
- * </pre>
- */
- static LispForm getFieldRep(Field f) {
- return new LispForm("(list"
- + " \""+f.name()+"\""
- + " \""+f.typeName()+"\""
- + (f.isTransient() ? " \"transient\"" : "")
- + (f.isVolatile() ? " \"volatile\"" : "")
- + (f.isFinal() ? " \"final\"" : "")
- + (f.isStatic() ? " \"static\"" : "")
- +")");
- }
-
- /**
- * Returns a representation of a (field, value) pair.
- * <p>
- * <b>Syntax:</b>
- * <pre>
- * ({@link #getFieldRep field} . {@link #getValueRep value})
- * </pre>
- */
- static LispForm getFieldValueRep(Field f, Value v, ObjectStore s) {
- return new LispForm("(cons "+getFieldRep(f)+" "+getValueRep(v,
s)+")");
- }
-
- /**
- * Returns a list of (field, value) pairs.
- * <p>
- * <b>Syntax:</b>
- * <pre>
- * (list [{@link #getFieldValueRep (field, value) pair}]*)
- * </pre>
- */
- static LispForm getFieldValueMapRep(Map map, ObjectStore s) {
- String fieldsValuesString = "(list ";
- Set keys = map.keySet();
- Iterator iter = keys.iterator();
- while (iter.hasNext()) {
- Field field = (Field)iter.next();
- Value val = (Value)map.get(field);
- fieldsValuesString += BR +getFieldValueRep(field, val, s);
- }
- fieldsValuesString += ")";
- return new LispForm(fieldsValuesString);
+ /**
+ * Returns a representation of a Location
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * (list "type-name" "sourcefile" lineNumber)
+ * (list "type-name" nil lineNumber)
+ * </pre>
+ *
+ * <b>Comments:</b>
+ * <ul>
+ * <li> lineNumber is -1 if that information is not available
+ * </ul>
+ */
+ public static String getLocationRep(Location loc) {
+ StringBuffer locationString = new StringBuffer();
+ locationString.append("(list \"");
+ locationString.append(loc.declaringType().name());
+ locationString.append("\"");
+ try {
+ locationString.append(" \"");
+ locationString.append(loc.sourceName());
+ locationString.append("\"");
+ } catch (AbsentInformationException ex) {
+ locationString.append(" nil"); // XXX - check if this is OK, or if we
need to remove the \".
+ }
+ locationString.append(" ");
+ locationString.append(loc.lineNumber());
+ locationString.append(")");
+ return locationString.toString();
+ }
+
+
+ /**
+ * Returns a representation of a method
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * (list "name of method" return-type-name
+ * (list [argument-type-name]*)
+ * ["final"] ["static"] ["native"]
["constructor"] ["abstract"]
+ * ["synchronized"] ["static_initializer"])
+ * </pre>
+ */
+ static String getMethodRep(Method m) {
+ List l = m.argumentTypeNames();
+ StringBuffer argList = new StringBuffer("(list");
+ Iterator it = l.iterator();
+ while (it.hasNext()) {
+ argList.append(" \"");
+ argList.append(it.next().toString());
+ argList.append("\"");
}
+ argList.append(")");
+ // The below code results in an extra StringBuffer being created, but I think
+ // that's OK from a performance perspective.
+ return "(list \""+m.declaringType().name()+"\""
+ +" \""+m.name()+"\""
+ +" \""+m.returnTypeName()+"\""
+ + BR + argList.toString()
+ +(m.isFinal()?" \"final\"":"")
+ +(m.isStatic()?" \"static\"":"")
+ +(m.isNative()?" \"native\"":"")
+ +(m.isConstructor()?" \"constructor\"":"")
+ +(m.isAbstract()?" \"abstract\"":"")
+ +(m.isSynchronized()?" \"synchronized\"":"")
+ +(m.isStaticInitializer()
+ ?" \"static_initializer\"":"")
+ +")";
+ }
+
+
+
+ /**
+ * Returns a representation of a local variable on a stack frame
+ * <p>
+ * <b>Syntax:</b>
+ * <pre>
+ * (list "name of variable" "type of variable")
+ * </pre>
+ */
+ static public String getLocalVariableRep(LocalVariable lv) {
+ return "(list" + " \""+lv.name()+"\"
\""+lv.typeName()+"\")";
+ }
+
+ /**
+ * Returns a representation of a (local variable, value) pair.
+ * <p>
+ * <b>Syntax:</b>
+ * <pre>
+ * ({@link #getLocalVariableRep local-variable} . {@link #getValueRep value})
+ * </pre>
+ */
+ static public String getLocalVariableValueRep(LocalVariable lv, Value v) {
+ return "(cons "+getLocalVariableRep(lv)
+ +" "+getValueRep(v)+")";
+ }
+
+ /**
+ * Returns a list of (local variable, value) pairs.
+ * <p>
+ * <b>Syntax:</b>
+ * <pre>
+ * (list [{@link #getLocalVariableValueRep (local variable, value) pair}]*)
+ * </pre>
+ */
+ static public String getLocalVariableValueMapRep(Map map) {
+ StringBuffer localVariablesValuesString = new StringBuffer("(list ");
+ Set keys = map.keySet();
+ Iterator iter = keys.iterator();
+ while (iter.hasNext()) {
+ LocalVariable localVariable = (LocalVariable)iter.next();
+ Value val = (Value)map.get(localVariable);
+ localVariablesValuesString.append(BR);
+ localVariablesValuesString.append(getLocalVariableValueRep(localVariable, val));
+ }
+ localVariablesValuesString.append(")");
+ return localVariablesValuesString.toString();
+ }
+
+
+ /**
+ * Returns a representation of a field.
+ * <p>
+ * <b>Syntax:</b>
+ * <pre>
+ * (list "name of field" "type of field" ["transient"]
["volatile"]
+ * ["final"] ["static"])
+ * </pre>
+ */
+ static String getFieldRep(Field f) {
+ return "(list"
+ + " \""+f.name()+"\""
+ + " \""+f.typeName()+"\""
+ + (f.isTransient() ? " \"transient\"" : "")
+ + (f.isVolatile() ? " \"volatile\"" : "")
+ + (f.isFinal() ? " \"final\"" : "")
+ + (f.isStatic() ? " \"static\"" : "")
+ +")";
+ }
+
+ /**
+ * Returns a representation of a (field, value) pair.
+ * <p>
+ * <b>Syntax:</b>
+ * <pre>
+ * ({@link #getFieldRep field} . {@link #getValueRep value})
+ * </pre>
+ */
+ static String getFieldValueRep(Field f, Value v) {
+ return "(cons "+getFieldRep(f)+" "+getValueRep(v)+")";
+ }
+
+ /**
+ * Returns a list of (field, value) pairs.
+ * <p>
+ * <b>Syntax:</b>
+ * <pre>
+ * (list [{@link #getFieldValueRep (field, value) pair}]*)
+ * </pre>
+ */
+ static String getFieldValueMapRep(Map map) {
+ StringBuffer fieldsValuesString = new StringBuffer("(list ");
+ Set keys = map.keySet();
+ Iterator iter = keys.iterator();
+ while (iter.hasNext()) {
+ Field field = (Field)iter.next();
+ Value val = (Value)map.get(field);
+ fieldsValuesString.append(BR);
+ fieldsValuesString.append(getFieldValueRep(field, val));
+ }
+ fieldsValuesString.append(")");
+ return fieldsValuesString.toString();
+ }
+
private static String filterFPValue(String fpValue) {
if (fpValue.equals("NaN"))
return "\"NaN\"";
- else
- if (fpValue.equals("-Infinity"))
- return "\"-Infinity\"";
- else
- if (fpValue.equals("Infinity"))
- return "\"Infinity\"";
- else
- return fpValue;
- }
-
-
-
- /**
- * Returns a representation of a 'value', that can be primitive
- * or an object reference, or void.
- * <p>
- * <b>Syntax:</b>
- * <pre>
- * (list "null")
- * (list "void")
- *
- * {@link #getObjectRep(ObjectReference,ObjectStore) object-rep}
- *
- * (list "boolean" "true") (list "boolean"
"false")
- * (list "byte" 'byte-value')
- * (list "char" 'char-value')
- * (list "double" double-value)
- * (list "float" float-value)
- * (list "int" int-value)
- * (list "long" long-value)
- * (list "short" short-value)
- * </pre>
- */
- static public LispForm getValueRep(Value value, ObjectStore store) {
- if (value == null) {
- return new LispForm("(list \"null\")");
- } else if (value instanceof VoidValue) {
- return new LispForm("(list \"void\")");
- } else if (value instanceof ObjectReference) {
- return getObjectRep((ObjectReference)value, store);
- } else {
- PrimitiveValue v = (PrimitiveValue)value;
- if (v instanceof BooleanValue) {
- return new LispForm("(list \"boolean\"
\""+v.booleanValue()+"\")");
- } else if (v instanceof ByteValue) {
- return new LispForm("(list \"byte\"
\""+v.byteValue()+"\")");
- } else if (v instanceof CharValue) {
- return new LispForm("(list \"char\" \""+
- escapeString(String.valueOf(v.charValue()))+"\")");
- } else if (v instanceof DoubleValue) {
- String sv = "" + v.doubleValue();
- return new LispForm("(list \"double\"
"+filterFPValue(sv)+")");
- } else if (v instanceof FloatValue) {
- String sv = "" + v.floatValue();
- return new LispForm("(list \"float\"
"+filterFPValue(sv)+")");
- } else if (v instanceof IntegerValue) {
- return new LispForm("(list \"int\"
\""+v.intValue()+"\")");
- } else if (v instanceof LongValue) {
- return new LispForm("(list \"long\"
\""+v.longValue()+"\")");
- } else if (v instanceof ShortValue) {
- return new LispForm("(list \"short\"
"+v.shortValue()+")");
- }
- }
- return null;
- }
-
- /**
- * Returns information about an array
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * "Error message"
- * (list "type name" uniqueID ['t|nil] length [element]*)
- * </pre>
- *
- * <b>Comments:</b>
- * <ul>
- * <li> The third argument (['t|nil]) indicates if the object has
- * been garbage collected in the debugee vm: it's nil if it hasn't.
- * <li> elements are only present if the index/length make sense. See
- * param list.
- * </ul>
- * <p>
- *
- * @param index if -1, represents the begin of index from where
- * elements are to be sent
- * @param length Number of elements to be sent
- */
- static public LispForm getArrayRep(ArrayReference a, ObjectStore store,
- int index, int length) {
- if (a == null) {
- return new LispForm("\"Error!\"");
- } else {
- store.put(a);
-
- String elementsString = "";
- try {
- if (index != -1) {
- List elements = a.getValues(index, length);
- Iterator it = elements.iterator();
- while (it.hasNext()) {
- elementsString += " "+getValueRep((Value)it.next(),
- store);
- }
- }
- } catch (IndexOutOfBoundsException ex) {
- elementsString = "\"Index out of bounds\"";
- } catch (ObjectCollectedException ex) {
- elementsString = "\"The object has already been collected\"";
- }
- return new LispForm("(list "
- + "\""+a.referenceType().name()+"\""
- + " " +a.uniqueID()
- + (a.isCollected() ? " 't":" nil")
- + " " + a.length()
- + elementsString + ")");
- }
+ else if (fpValue.equals("-Infinity"))
+ return "\"-Infinity\"";
+ else if (fpValue.equals("Infinity"))
+ return "\"Infinity\"";
+ else
+ return fpValue;
+ }
+
+
+
+ /**
+ * Returns a representation of a 'value', that can be primitive
+ * or an object reference, or void.
+ * <p>
+ * <b>Syntax:</b>
+ * <pre>
+ * (list "null")
+ * (list "void")
+ *
+ * {@link #getObjectRep(ObjectReference) object-rep}
+ *
+ * (list "boolean" "true") (list "boolean"
"false")
+ * (list "byte" 'byte-value')
+ * (list "char" 'char-value')
+ * (list "double" double-value)
+ * (list "float" float-value)
+ * (list "int" int-value)
+ * (list "long" long-value)
+ * (list "short" short-value)
+ * </pre>
+ */
+ static public String getValueRep(Value value) {
+ if (value == null) {
+ return "(list \"null\")";
+ } else if (value instanceof VoidValue) {
+ return "(list \"void\")";
+ } else if (value instanceof ObjectReference) {
+ return getObjectRep((ObjectReference)value);
+ } else {
+ PrimitiveValue v = (PrimitiveValue)value;
+ if (v instanceof BooleanValue) {
+ return "(list \"boolean\"
\""+v.booleanValue()+"\")";
+ } else if (v instanceof ByteValue) {
+ return "(list \"byte\"
\""+v.byteValue()+"\")";
+ } else if (v instanceof CharValue) {
+ return "(list \"char\" \""+
+ escapeString(String.valueOf(v.charValue()))+"\")";
+ } else if (v instanceof DoubleValue) {
+ return "(list \"double\" " +
filterFPValue(String.valueOf(v.doubleValue()))+")";
+ } else if (v instanceof FloatValue) {
+ return "(list \"float\"
"+filterFPValue(String.valueOf(v.floatValue()))+")";
+ } else if (v instanceof IntegerValue) {
+ return "(list \"int\"
\""+v.intValue()+"\")";
+ } else if (v instanceof LongValue) {
+ return "(list \"long\"
\""+v.longValue()+"\")";
+ } else if (v instanceof ShortValue) {
+ return "(list \"short\" "+v.shortValue()+")";
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns information about an array
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * "Error message"
+ * (list "type name" uniqueID ['t|nil] length [element]*)
+ * </pre>
+ *
+ * <b>Comments:</b>
+ * <ul>
+ * <li> The third argument (['t|nil]) indicates if the object has
+ * been garbage collected in the debugee vm: it's nil if it hasn't.
+ * <li> elements are only present if the index/length make sense. See
+ * param list.
+ * </ul>
+ * <p>
+ *
+ * @param String a description of the array elements
+ */
+ static public String getArrayRep(ArrayReference a, String elements) {
+ if (a == null) {
+ return "\"Error! null array reference in Rep.getArrayRep!\"";
+ } else {
+
+ return "(list "
+ + "\""+a.referenceType().name()+"\""
+ + " " +a.uniqueID()
+ + (a.isCollected() ? " 't":" nil")
+ + " " + a.length()
+ + elements + ")";
}
+ }
/**
@@ -369,477 +356,477 @@ public class Rep implements Protocol {
* @author David Dagon
*/
public static String escapeString (String str) {
-
+
if ( str.indexOf('\\') == -1 &&
- str.indexOf('"') == -1 )
+ str.indexOf('"') == -1 )
{
- return str;
+ return str;
}
else
{
- StringBuffer buf = new StringBuffer(str.length() + 16);
- for ( int i = 0; i < str.length(); i++ ) {
- char ch = str.charAt( i );
- switch ( ch ) {
- case '"': buf.append("\\\"" ); break;
- case '\\': buf.append("\\\\" ); break;
- default: buf.append( ch ); break;
- }
- }
- return buf.toString();
+ StringBuffer buf = new StringBuffer(str.length() + 16);
+ for ( int i = 0; i < str.length(); i++ ) {
+ char ch = str.charAt( i );
+ switch ( ch ) {
+ case '"': buf.append("\\\"" ); break;
+ case '\\': buf.append("\\\\" ); break;
+ default: buf.append( ch ); break;
+ }
+ }
+ return buf.toString();
}
}
-
-
+
+
- /**
- * Returns the value of a string
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * "Error message"
- * (list "java.lang.String" uniqueID ['t|nil]
"string-value")
- * </pre>
- * <b>Comments:</b>
- * <ul>
- * <li> The third argument (['t|nil]) indicates if the object has
- * been garbage collected in the debugee vm: it's nil if it hasn't.
- * </ul>
- * <p>
- */
- static public LispForm getStringRep(StringReference s, ObjectStore store) {
+ /**
+ * Returns the value of a string
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * "Error message"
+ * (list "java.lang.String" uniqueID ['t|nil] "string-value")
+ * </pre>
+ * <b>Comments:</b>
+ * <ul>
+ * <li> The third argument (['t|nil]) indicates if the object has
+ * been garbage collected in the debugee vm: it's nil if it hasn't.
+ * </ul>
+ * <p>
+ */
+ static public String getStringRep(StringReference s) {
if (s == null) {
- return new LispForm("\"Error!\"");
+ return "\"Error!\"";
} else {
- store.put(s);
-
- return new LispForm("(list "
- + "\""+s.referenceType().name()+"\""
- + " "+s.uniqueID()
- + (s.isCollected() ? " 't":" nil")
- + " \"" + escapeString(s.value()) + "\")");
+
+ return "(list "
+ + "\""+s.referenceType().name()+"\""
+ + " "+s.uniqueID()
+ + (s.isCollected() ? " 't":" nil")
+ + " \"" + escapeString(s.value()) + "\")";
}
}
- /**
- * Returns a non-detailed representation of an object.
- *
- * @see #getObjectRep(ObjectReference,ObjectStore,boolean)
- */
- static public LispForm getObjectRep(ObjectReference o, ObjectStore store) {
- return getObjectRep(o, store, false);
- }
-
- /**
- * Returns a canonical representation of an object.
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * "Error Message"
- * (list "null")
- * <i>Non-detailed</i>
- * (list "type of object" uniqueID ['t|nil])
- * <i>Detailed</i>
- * (list "type of object" uniqueID ['t|nil] {@link #getFieldValueMapRep
fields-values})
- * </pre>
- *
- * <b>Comments:</b>
- * <ul>
- * <li> The third argument (['t|nil]) indicates if the object has
- * been garbage collected in the debugee vm: it's nil if it hasn't.
- * </ul>
- */
- static public LispForm getObjectRep(ObjectReference o, ObjectStore store,
- boolean detailed) {
- if (o == null) {
- return new LispForm("(list \"null\")");
- } else {
- store.put(o);
- if (detailed) {
- // fields and values
- String fieldsValuesString;
- try {
- // XXX a more complete list is available using
- // allFields().... fyi
- fieldsValuesString =
getFieldValueMapRep(o.getValues(o.referenceType().visibleFields()), store).toString();
- } catch (ClassNotPreparedException ex) {
- fieldsValuesString = "\"The class isn't prepared\"";
- } catch (ObjectCollectedException ex) {
- fieldsValuesString = "\"The object has already been
collected\"";
- } catch (Exception ex) {
- fieldsValuesString = "\"Unable to access fields and values. Optimized
class?\"";
- }
+ /**
+ * Returns a non-detailed representation of an object.
+ *
+ * @see #getObjectRep(ObjectReference,boolean)
+ */
+ static public String getObjectRep(ObjectReference o) {
+ return getObjectRep(o, false);
+ }
+
+ /**
+ * Returns a canonical representation of an object.
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * "Error Message"
+ * (list "null")
+ * <i>Non-detailed</i>
+ * (list "type of object" uniqueID ['t|nil])
+ * <i>Detailed</i>
+ * (list "type of object" uniqueID ['t|nil] {@link #getFieldValueMapRep
fields-values})
+ * </pre>
+ *
+ * <b>Comments:</b>
+ * <ul>
+ * <li> The third argument (['t|nil]) indicates if the object has
+ * been garbage collected in the debugee vm: it's nil if it hasn't.
+ * </ul>
+ */
+ static public String getObjectRep(ObjectReference o, boolean detailed) {
+ if (o == null) {
+ return "(list \"null\")";
+ } else {
+ if (detailed) {
+ // fields and values
+ String fieldsValuesString;
+ try {
+ // XXX a more complete list is available using
+ // allFields().... fyi
+ fieldsValuesString =
getFieldValueMapRep(o.getValues(o.referenceType().visibleFields()));
+ } catch (ClassNotPreparedException ex) {
+ fieldsValuesString = "\"The class isn't prepared\"";
+ } catch (ObjectCollectedException ex) {
+ fieldsValuesString = "\"The object has already been
collected\"";
+ } catch (Exception ex) {
+ fieldsValuesString = "\"Unable to access fields and values. Optimized
class?\"";
+ }
- return new LispForm("(list "
- + "\""+o.referenceType().name()+"\""
- + " "+o.uniqueID()
- + (o.isCollected() ? " 't":" nil")+BR
- + fieldsValuesString+")");
- } else {
- return new LispForm("(list "
- + "\""+o.referenceType().name()+"\""
- + " "+o.uniqueID()
- + (o.isCollected() ? " 't":" nil")
- +")");
- }
- }
+ return "(list "
+ + "\""+o.referenceType().name()+"\""
+ + " "+o.uniqueID()
+ + (o.isCollected() ? " 't":" nil")+BR
+ + fieldsValuesString+")";
+ } else {
+ return "(list "
+ + "\""+o.referenceType().name()+"\""
+ + " "+o.uniqueID()
+ + (o.isCollected() ? " 't":" nil")
+ +")";
+ }
}
+ }
+
+ /*
+ * THREAD REPRESENTATIONS
+ */
+
+ /**
+ * Returns information about monitors of an object.
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * (list uniqueID "type of object" ['t|nil] {@link #getThreadRep
owning-thread} (list [{@link #getThreadRep waiting-thread}]*))
+ * </pre>
+ *
+ * <b>Comments:</b>
+ * <ul>
+ * <li> The third argument (['t|nil]) indicates if the object has
+ * been garbage collected in the debugee vm: it's nil if it hasn't.
+ * </ul>
+ */
+ static public String getObjectMonitorsRep(ObjectReference o) {
+ if (o == null) {
+ return "null";
+ } else {
- /*
- * THREAD REPRESENTATIONS
- */
-
- /**
- * Returns information about monitors of an object.
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * (list uniqueID "type of object" ['t|nil] {@link #getThreadRep
owning-thread} (list [{@link #getThreadRep waiting-thread}]*))
- * </pre>
- *
- * <b>Comments:</b>
- * <ul>
- * <li> The third argument (['t|nil]) indicates if the object has
- * been garbage collected in the debugee vm: it's nil if it hasn't.
- * </ul>
- */
- static public LispForm getObjectMonitorsRep(ObjectReference o, ObjectStore store) {
- if (o == null) {
- return new LispForm("null");
- } else {
- store.put(o);
-
- // owning thread
- String owningThread;
- try {
- ThreadReference t = o.owningThread();
- if (t == null) {
- owningThread = "nil";
- } else {
- owningThread = getThreadRep(t, store).toString();
- }
- } catch (IncompatibleThreadStateException ex) {
- owningThread = "\"Information Not Available\"";
- } catch (UnsupportedOperationException ex) {
- owningThread = "\"VM has no information\"";
- }
+ // owning thread
+ String owningThread;
+ try {
+ ThreadReference t = o.owningThread();
+ if (t == null) {
+ owningThread = "nil";
+ } else {
+ owningThread = getThreadRep(t);
+ }
+ } catch (IncompatibleThreadStateException ex) {
+ owningThread = "\"Information Not Available\"";
+ } catch (UnsupportedOperationException ex) {
+ owningThread = "\"VM has no information\"";
+ }
+
+ // waiting threads
+ StringBuffer waitingThreadsStringBuffer = new StringBuffer("(list");
+ String waitingThreadsString;
+ try {
+ List waitingThreads = o.waitingThreads();
+ Iterator it = waitingThreads.iterator();
+ while (it.hasNext()) {
+ waitingThreadsStringBuffer.append(BR);
+ waitingThreadsStringBuffer.append(getThreadRep((ThreadReference)it.next()));
+ }
+ waitingThreadsStringBuffer.append(")");
+ waitingThreadsString = waitingThreadsStringBuffer.toString();
+ } catch (IncompatibleThreadStateException ex) {
+ waitingThreadsString = "\"Information Not Available\"";
+ } catch (UnsupportedOperationException ex) {
+ waitingThreadsString = "\"VM has no information\"";
+ }
- // waiting threads
- String waitingThreadsString;
- try {
- waitingThreadsString = "(list";
- List waitingThreads = o.waitingThreads();
- Iterator it = waitingThreads.iterator();
- while (it.hasNext()) {
- waitingThreadsString += BR +getThreadRep((ThreadReference)it.next(), store);
- }
- waitingThreadsString += ")";
- } catch (IncompatibleThreadStateException ex) {
- waitingThreadsString = "\"Information Not Available\"";
- } catch (UnsupportedOperationException ex) {
- waitingThreadsString = "\"VM has no information\"";
- }
+
+ return "(list "+o.uniqueID()+" "
+ +"\""+o.referenceType().name()+"\""
+ + (o.isCollected() ? " 't":" nil")+BR
+ +owningThread+ BR
+ +waitingThreadsString+")";
+ }
+ }
+
+ /* thread information retrieval routines */
+
+
+ /**
+ * Returns a canonical representation of a given ThreadGroupReference.
+ * <p>
+ * <b>Syntax:</b>
+ * <pre>
+ * (list "ThreadGroup" uniqueID "name of threadgroup"
+ * (list [{@link #getThreadRep(ThreadReference) child thread}]*)
+ * (list [{@link #getThreadGroupRep child threadgroup}]*))
+ * </pre>
+ */
+ public static String getThreadGroupRep(ThreadGroupReference t) {
+ StringBuffer rep = new StringBuffer("(list \"ThreadGroup\" ");
+ rep.append(t.uniqueID());
+ rep.append(" \"");
+ rep.append(t.name());
+ rep.append("\" ");
+
+ List list = t.threads();
+ Iterator it = list.iterator();
+
+ rep.append(BR);
+ rep.append("(list");
+
+ while (it.hasNext()) {
+ rep.append(BR);
+ rep.append(getThreadRep((ThreadReference)it.next()));
+ }
+ rep.append(")");
+
+ list = t.threadGroups();
+ it = list.iterator();
+ rep.append(BR);
+ rep.append("(list");
+ while (it.hasNext()) {
+ rep.append(BR);
+ rep.append(getThreadGroupRep((ThreadGroupReference)it.next()));
+ }
+ rep.append("))");
+
+ return rep.toString();
+ }
+
+ /**
+ * Returns a detailed thread representation.
+ * @see #getThreadRep(ThreadReference, boolean)
+ */
+ static public String getThreadRep(ThreadReference t) {
+ return getThreadRep(t, true);
+ }
+
+ /**
+ * Returns a canonical representation of a given ThreadReference.
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * <i>Non-detailed</i>
+ * (list "Thread" uniqueID "name of thread"
<u>status</u> <u>currentState</u>)
+ * <i>Detailed</i>
+ * (list "Thread" uniqueID "name of thread" status currentState
+ * (list [{@link #getStackFrameRep stack-frame}]*)
+ * <u>owned-monitors-string</u>
+ * <u>current-contended-monitor-string</u>)
+ * </pre>
+ *
+ * <b>Comments:</b>
+ * <ul>
+ * <li> <u>status</u> is one of: "unknown", "waiting
on monitor",
+ * "not started", "runnable", "sleeping",
"waiting", and "zombie"
+ *
+ * <li> <u>currentState</u> is one of "normal",
"suspended by debugger",
+ * and "suspended at breakpoint"
+
+ * <li> <u>owned-monitors-string</u>:
+ * <pre>
+ * "Error Message"
+ * (list [{@link #getObjectRep(ObjectReference) owned monitor}]*)
+ * </pre>
+ * <li> <u>current-contended-monitor-string</u>:
+ * <pre>
+ * "Error Message"
+ * nil
+ * {@link #getObjectRep(ObjectReference) current contended monitor}
+ * </pre>
+ * <li>
+ * Examples:
+ * <pre>
+ * (list "Thread" 53 "Thread 1, continuous"
+ * "suspended by debugger" "waiting on monitor"
+ * (list
+ * (list 0 "test.Test" "Test.java" 45))
+ * (list)
+ * (list "java.lang.String" 55))
+ *
+ * (list "Thread" 54 "Thread 2"
+ * "suspended by debugger" "waiting on monitor"
+ * (list
+ * (list 0 "java.lang.Thread" "Thread.java" -1)
+ * (list 1 "test.Test" "Test.java" 47))
+ * (list
+ * (list "java.lang.String" 55)
+ * (list "java.lang.Integer" 61))
+ * (list))
+ * </pre>
+ * </ul>
+ *
+ * <p>
+ * @param detailed True if a more detailed representation is desired:
+ * includes the stackframe as well as information about the monitors.
+ */
+ static public String getThreadRep(ThreadReference t,
+ boolean detailed) {
+ int status = t.status();
+ String statusString = "unknown";
+ switch (status) {
+ case ThreadReference.THREAD_STATUS_MONITOR:
+ statusString = "waiting on monitor";
+ break;
+ case ThreadReference.THREAD_STATUS_NOT_STARTED:
+ statusString = "not started";
+ break;
+ case ThreadReference.THREAD_STATUS_RUNNING:
+ statusString = "runnable";
+ break;
+ case ThreadReference.THREAD_STATUS_SLEEPING:
+ statusString = "sleeping";
+ break;
+ case ThreadReference.THREAD_STATUS_WAIT:
+ statusString = "waiting";
+ break;
+ case ThreadReference.THREAD_STATUS_ZOMBIE:
+ statusString = "zombie";
+ break;
+ case ThreadReference.THREAD_STATUS_UNKNOWN:
+ statusString = "unknown";
+ break;
+ default:
+ break;
+ }
+
+ // note that the above status string refers to the state of the
+ // thread *before* a suspension, if there was a suspension.
+
+ /* Due to a bug in ThreadReference.isSuspended(), we need to
+ use suspendCount() */
+ String stateString = "normal";
+ if (t.isAtBreakpoint()) {
+ stateString = "suspended at breakpoint";
+ } else if (t.suspendCount() > 0) {
+ stateString = "suspended by debugger";
+ }
+
+ if (detailed) {
+
+ // info on the stack
+
+ StringBuffer stackStringBuffer = new StringBuffer("(list");
+ String stackString;
+ try {
+ // a list of the stackframes is also sent...
+ List stackFrames = t.frames();
+ Iterator it = stackFrames.iterator();
+ int index = 0;
+ while (it.hasNext()) {
+ stackStringBuffer.append(BR);
+ stackStringBuffer.append(getStackFrameRep((StackFrame)it.next(), index++));
+ }
+ stackStringBuffer.append(")");
+ stackString = stackStringBuffer.toString();
+ } catch (IncompatibleThreadStateException ex) {
+ stackString = "\"Information Not Available\"";
+ }
+
+ // info on the monitors
+
+ // owned monitors
+
+ StringBuffer ownedMonitorsStringBuffer = new StringBuffer("(list");
+ String ownedMonitorsString;
+ try {
+ List ownedMonitors = t.ownedMonitors();
+ Iterator it = ownedMonitors.iterator();
+ while (it.hasNext()) {
+ ownedMonitorsStringBuffer.append(BR);
+ ownedMonitorsStringBuffer.append(getObjectRep((ObjectReference)it.next()));
+ }
+ ownedMonitorsStringBuffer.append(")");
+ ownedMonitorsString = ownedMonitorsStringBuffer.toString();
+ } catch (IncompatibleThreadStateException ex) {
+ ownedMonitorsString = "\"Information Not Available\"";
+ } catch (UnsupportedOperationException ex) {
+ ownedMonitorsString = "\"VM has no information\"";
+ } catch (ObjectCollectedException ex) {
+ ownedMonitorsString = "\"The object has been collected\"";
+ }
- return new LispForm("(list "+o.uniqueID()+" "
- +"\""+o.referenceType().name()+"\""
- + (o.isCollected() ? " 't":" nil")+BR
- +owningThread+ BR
- +waitingThreadsString+")");
- }
- }
-
- /* thread information retrieval routines */
-
-
-
- /**
- * Returns a canonical representation of a given ThreadGroupReference.
- * <p>
- * <b>Syntax:</b>
- * <pre>
- * (list "ThreadGroup" uniqueID "name of threadgroup"
- * (list [{@link #getThreadRep(ThreadReference, ObjectStore)
child thread}]*)
- * (list [{@link #getThreadGroupRep child threadgroup}]*))
- * </pre>
- */
- static LispForm getThreadGroupRep(ThreadGroupReference t,
- ObjectStore store) {
- store.put(t);
- String rep = "(list \"ThreadGroup\" "+t.uniqueID()
- +" \""+t.name()+"\" ";
-
- List list = t.threads();
- Iterator it = list.iterator();
- rep += BR+"(list";
- while (it.hasNext()) {
- rep += BR +getThreadRep((ThreadReference)it.next(), store);
- }
- rep += ")";
-
- list = t.threadGroups();
- it = list.iterator();
- rep += BR+"(list";
- while (it.hasNext()) {
- rep += BR +getThreadGroupRep((ThreadGroupReference)it.next(), store);
- }
- rep += ")";
-
- rep += ")";
-
- return new LispForm(rep);
- }
-
- /**
- * Returns a detailed thread representation.
- * @see #getThreadRep(ThreadReference, ObjectStore, boolean)
- */
- static public LispForm getThreadRep(ThreadReference t, ObjectStore store) {
- return getThreadRep(t, store, true);
- }
-
- /**
- * Returns a canonical representation of a given ThreadReference.
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * <i>Non-detailed</i>
- * (list "Thread" uniqueID "name of thread"
<u>status</u> <u>currentState</u>)
- * <i>Detailed</i>
- * (list "Thread" uniqueID "name of thread" status currentState
- * (list [{@link #getStackFrameRep stack-frame}]*)
- * <u>owned-monitors-string</u>
- * <u>current-contended-monitor-string</u>)
- * </pre>
- *
- * <b>Comments:</b>
- * <ul>
- * <li> <u>status</u> is one of: "unknown", "waiting
on monitor",
- * "not started", "runnable", "sleeping",
"waiting", and "zombie"
- *
- * <li> <u>currentState</u> is one of "normal",
"suspended by debugger",
- * and "suspended at breakpoint"
-
- * <li> <u>owned-monitors-string</u>:
- * <pre>
- * "Error Message"
- * (list [{@link #getObjectRep(ObjectReference, ObjectStore) owned monitor}]*)
- * </pre>
- * <li> <u>current-contended-monitor-string</u>:
- * <pre>
- * "Error Message"
- * nil
- * {@link #getObjectRep(ObjectReference, ObjectStore) current contended monitor}
- * </pre>
- * <li>
- * Examples:
- * <pre>
- * (list "Thread" 53 "Thread 1, continuous"
- * "suspended by debugger" "waiting on monitor"
- * (list
- * (list 0 "test.Test" "Test.java" 45))
- * (list)
- * (list "java.lang.String" 55))
- *
- * (list "Thread" 54 "Thread 2"
- * "suspended by debugger" "waiting on monitor"
- * (list
- * (list 0 "java.lang.Thread" "Thread.java" -1)
- * (list 1 "test.Test" "Test.java" 47))
- * (list
- * (list "java.lang.String" 55)
- * (list "java.lang.Integer" 61))
- * (list))
- * </pre>
- * </ul>
- *
- * <p>
- * @param detailed True if a more detailed representation is desired:
- * includes the stackframe as well as information about the monitors.
- */
- static public LispForm getThreadRep(ThreadReference t, ObjectStore store,
- boolean detailed) {
- int status = t.status();
- String statusString = "unknown";
- switch (status) {
- case ThreadReference.THREAD_STATUS_MONITOR: {
- statusString = "waiting on monitor";
- break;
- }
- case ThreadReference.THREAD_STATUS_NOT_STARTED: {
- statusString = "not started";
- break;
- }
- case ThreadReference.THREAD_STATUS_RUNNING: {
- statusString = "runnable";
- break;
- }
- case ThreadReference.THREAD_STATUS_SLEEPING: {
- statusString = "sleeping";
- break;
- }
- case ThreadReference.THREAD_STATUS_WAIT: {
- statusString = "waiting";
- break;
- }
- case ThreadReference.THREAD_STATUS_ZOMBIE: {
- statusString = "zombie";
- break;
- }
- case ThreadReference.THREAD_STATUS_UNKNOWN: {
- statusString = "unknown";
- break;
- }
- default: {
- break;
- }
- }
-
- // note that the above status string refers to the state of the
- // thread *before* a suspension, if there was a suspension.
-
- /* Due to a bug in ThreadReference.isSuspended(), we need to
- use suspendCount() */
- String stateString = "normal";
- if (t.isAtBreakpoint()) {
- stateString = "suspended at breakpoint";
- } else if (t.suspendCount() > 0) {
- stateString = "suspended by debugger";
- }
-
- if (detailed) {
-
- // info on the stack
-
- String stackString;
- try {
- stackString = "(list";
- // a list of the stackframes is also sent...
- List stackFrames = t.frames();
- Iterator it = stackFrames.iterator();
- int index = 0;
- while (it.hasNext()) {
- stackString += BR + getStackFrameRep((StackFrame)it.next(), index++);
- }
- stackString += ")";
- } catch (IncompatibleThreadStateException ex) {
- stackString = "\"Information Not Available\"";
- }
-
- // info on the monitors
-
- // owned monitors
-
- String ownedMonitorsString;
- try {
- ownedMonitorsString = "(list";
- List ownedMonitors = t.ownedMonitors();
- Iterator it = ownedMonitors.iterator();
- while (it.hasNext()) {
- ownedMonitorsString += BR +getObjectRep((ObjectReference)it.next(), store);
- }
- ownedMonitorsString += ")";
- } catch (IncompatibleThreadStateException ex) {
- ownedMonitorsString = "\"Information Not Available\"";
- } catch (UnsupportedOperationException ex) {
- ownedMonitorsString = "\"VM has no information\"";
- } catch (ObjectCollectedException ex) {
- ownedMonitorsString = "\"The object has been collected\"";
- }
+ // current contended monitor
+ // note, however, from the jdi api:
+ // The thread can be waiting for a monitor through entry into a
+ // synchronized method, the synchronized statement, or
+ // Object.wait(). The status() method can be used to
+ // differentiate between the first two cases and the third.
- // current contended monitor
- // note, however, from the jdi api:
- // The thread can be waiting for a monitor through entry into a
- // synchronized method, the synchronized statement, or
- // Object.wait(). The status() method can be used to
- // differentiate between the first two cases and the third.
-
- String currentContendedMonitorString;
- try {
- ObjectReference o = t.currentContendedMonitor();
- if (o == null) {
- currentContendedMonitorString = "nil";
- } else {
- currentContendedMonitorString =
- getObjectRep(o, store).toString();
- }
- } catch (IncompatibleThreadStateException ex) {
- currentContendedMonitorString =
- "\"Information Not Available\"";
- } catch (UnsupportedOperationException ex) {
- currentContendedMonitorString =
- "\"VM has no information\"";
- } catch (ObjectCollectedException ex) {
- currentContendedMonitorString =
- "\"The object has been collected\"";
- }
-
- store.put(t);
- return new LispForm("(list \"Thread\""
- +" "+t.uniqueID()
- +" \""+t.name()+"\""
- +" \""+statusString+"\""
- +" \""+stateString+"\""
- + BR +stackString
- + BR +ownedMonitorsString
- + BR +currentContendedMonitorString
- +")");
- } else {
- store.put(t);
- return new LispForm("(list \"Thread\""
- +" "+t.uniqueID()
- +" \""+t.name()+"\""
- +" \""+statusString+"\""
- +" \""+stateString+"\")");
- }
- }
-
- /**
- * Returns a canonical representation of a given StackFrame.
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * (list "StackFrame" index "Information not available")
- * (list "StackFrame" index "type name" "source name"
lineNumber "method name")
- * </pre>
- *
- * <b>Comments:</b>
- * <ul>
- * <li> lineNumber is -1 for native methods
- * </ul>
- *
- * @param index Gives the index of this particular stack frame for
- * the thread. This basically goes into the string returned as a
- * convenience.
- */
- static LispForm getStackFrameRep(StackFrame s, int index) {
- try {
- Location loc = s.location();
- Method method = loc.method();
- return new LispForm("(list " + index + " "
- + "\""+loc.declaringType().name() + "\" "
- // Source file name can be a path with a backslash.
- // Need to escape the backslash.
- + "\"" + escapeString(loc.sourceName()) + "\" "
- + loc.lineNumber() + " "
- + "\"" + method.name() + "\")");
- } catch (AbsentInformationException ex) {
- return new LispForm("(list \"StackFrame\" "+index
- +" \"Information not available\")");
- }
+ String currentContendedMonitorString;
+ try {
+ ObjectReference o = t.currentContendedMonitor();
+ if (o == null) {
+ currentContendedMonitorString = "nil";
+ } else {
+ currentContendedMonitorString =
+ getObjectRep(o);
+ }
+ } catch (IncompatibleThreadStateException ex) {
+ currentContendedMonitorString =
+ "\"Information Not Available\"";
+ } catch (UnsupportedOperationException ex) {
+ currentContendedMonitorString =
+ "\"VM has no information\"";
+ } catch (ObjectCollectedException ex) {
+ currentContendedMonitorString =
+ "\"The object has been collected\"";
+ }
+
+ return "(list \"Thread\""
+ +" "+t.uniqueID()
+ +" \""+t.name()+"\""
+ +" \""+statusString+"\""
+ +" \""+stateString+"\""
+ + BR +stackString
+ + BR +ownedMonitorsString
+ + BR +currentContendedMonitorString
+ +")";
+ } else {
+ return "(list \"Thread\""
+ +" "+t.uniqueID()
+ +" \""+t.name()+"\""
+ +" \""+statusString+"\""
+ +" \""+stateString+"\")";
+ }
+ }
+
+ /**
+ * Returns a canonical representation of a given StackFrame.
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * (list "StackFrame" index "Information not available")
+ * (list "StackFrame" index "type name" "source name"
lineNumber "method name")
+ * </pre>
+ *
+ * <b>Comments:</b>
+ * <ul>
+ * <li> lineNumber is -1 for native methods
+ * </ul>
+ *
+ * @param index Gives the index of this particular stack frame for
+ * the thread. This basically goes into the string returned as a
+ * convenience.
+ */
+ static String getStackFrameRep(StackFrame s, int index) {
+ try {
+ Location loc = s.location();
+ Method method = loc.method();
+ return "(list "+index+" "
+ +"\""+loc.declaringType().name()+"\" "
+ // Source file name can be a path with a backslash.
+ // Need to escape the backslash.
+ + "\"" + escapeString(loc.sourceName()) + "\" "
+ +loc.lineNumber()+" "
+ +"\""+method.name()+"\")";
+ } catch (AbsentInformationException ex) {
+ return "(list \"StackFrame\" "+index
+ +" \"Information not available\")";
}
+ }
} // Rep
/*
* $Log: Rep.java,v $
+ * Revision 1.18 2003/01/08 06:53:37 paulk
+ * Integrate Petter Mahlen's updates.
+ *
* Revision 1.17 2002/10/23 05:54:05 paulk
* Updated the getStackFrameRep method to escape backslashes in the name of the source
file
* corresponding to a stack frame. The name of the source file can be a relative path in
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/Debugger.java
Index: Debugger.java
===================================================================
package jde.debugger;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.sun.jdi.ThreadReference;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.connect.AttachingConnector;
import com.sun.jdi.connect.Connector;
import com.sun.jdi.connect.IllegalConnectorArgumentsException;
import com.sun.jdi.connect.LaunchingConnector;
import com.sun.jdi.connect.ListeningConnector;
import com.sun.jdi.connect.VMStartException;
import com.sun.jdi.request.ClassPrepareRequest;
import com.sun.jdi.request.EventRequest;
import com.sun.jdi.request.EventRequestManager;
import jde.debugger.command.CommandHandler;
import jde.debugger.command.ProcessCommandHandler;
import jde.debugger.gui.GUI;
import jde.debugger.spec.EventRequestSpecList;
/**
* The main class for debugging a specific process. A Debugger instance
* handles the following tasks:
* <ul>
* <li>Executing commands sent from Emacs (through the
* ProcessCommandHandler in {@link #m_handler m_handler})</li>
* <li>Handling events from the VM (through the EventHandler in
* {@link #m_eventHandler m_eventHandler})</li>
* <li>Keeping track of requested event specifications that haven't
* yet been resolved ({@link #m_eventRequestSpecList m_eventRequestSpecList})</li>
* <li>Keeping track of objects and the ID that is used as a
* reference in the Emacs/Java communication. ({@link #m_objectStore
m_objectStore})</li>
* <li>Connecting the standard input/output/error streams of an
* application that was launched through the debugger to Emacs. This
* is done through {@link #m_sio m_sio}</li>
* </ul>
*
* Created: Tue Jan 08 12:24:36 2002
*
* @author Petter Måhlén
* @version $Revision: 1.3 $
*/
public class Debugger implements Protocol {
private ProcessCommandHandler m_handler;
private VirtualMachine m_vm;
private boolean m_vmAlive;
private EventRequestSpecList m_eventRequestSpecList;
private Integer m_procID;
private DebuggeeSIO m_sio;
private EventHandler m_eventHandler;
private ObjectStore m_objectStore;
private boolean m_useGUI;
private GUI m_gui;
/**
* This map stores the event requests that are NOT specs. storing
* it here allows the user to cancel them easily: they just specify the
* id, that gets reverse-looked up here, uniquely identifying the actual
* request.
* <p>
* Of course, the id is sent back to the user when the actual command is
* responded to, so that the handle is available to jde in the first
* place
*/
protected Map m_identifiableEventRequests;
/**
* Creates a new <code>Debugger</code> instance. Before the
* instance can be used, the following things must happen:
* <ul>
* <li>The VM connection must be set up. This is done through
* either {@link #launchVM launchVM()}, {@link #attachVMShmem
* attachVMShmem()}, {@link #attachVMSocket attachVMSocket()},
* {@link #listenShmem listenShmem()}, or {@link
* #listenSocket listenSocket()}.</li>
* <li>The Debugger instance must have been started. This is done
* through the {@link #start start} method.</li>
* </ul>
*
* @param procID an <code>Integer</code> value identifying this
* process in the communication with Emacs.
*/
public Debugger(Integer procID, boolean useGUI) {
JDE.debug(EVENTS, "creating debugger with id: " + procID);
m_procID = procID;
m_identifiableEventRequests = new HashMap();
m_handler = new ProcessCommandHandler(this);
m_eventRequestSpecList = new EventRequestSpecList(this);
m_sio = new DebuggeeSIO(this);
m_eventHandler = new EventHandler(this);
m_objectStore = new ObjectStore(this);
m_vmAlive = false;
m_useGUI = useGUI;
if (m_useGUI)
m_gui = new GUI(this);
else
m_gui = null;
}
/**
* Starts up the threads that make the debugger go. Also makes sure that
* a ClassPrepareRequest is sent to the VM, so that it's possible to resolve
* breakpoints, etc.
*
* @exception JDEException if an error occurs
*/
public void start() throws JDEException {
JDE.debug(EVENTS, "starting debugger: " + m_procID);
if (!m_vmAlive) {
throw new JDEException("INTERNAL ERROR: attempted to start debugger " +
m_procID + " without a VM");
}
m_handler.start();
m_eventHandler.start();
// we need to raise all class prepare events to
// make sure we resolve the corresponding specs.
ClassPrepareRequest cprequest =
m_vm.eventRequestManager().createClassPrepareRequest();
// this (hack?) is used to identify if the user itself specified
// a class prepare request, or the event was raised because of
// this request.
cprequest.putProperty("default", "default");
cprequest.setSuspendPolicy(EventRequest.SUSPEND_ALL);
// XXX we don't want to get ClassPrepareEvents for the standard
// java classes, since there's no point in debugging those. At least
// I don't think there is. / Petter
cprequest.addClassExclusionFilter("java.*");
cprequest.addClassExclusionFilter("javax.*");
cprequest.addClassExclusionFilter("sun.*");
cprequest.enable();
}
/**
* Tells the debugger to stop executing, meaning that the VM is shut down.
* The actual execution of the threads is not stopped until the shutdown()
* method is called, which is only done when a VM disconnect event is sent
* from the VM.
*
* @see EventHandler#vmDisconnectEvent
*/
public void stopExecution() {
VMUtil.shutdown(m_vm);
m_vmAlive = false;
}
/**
* Shuts the debugger down and deregisters it from the SessionManager.
*
* @exception JDEException if an error occurs
* @see SessionManager#deregisterDebugger
*/
public void shutdown() throws JDEException {
JDE.debug(EVENTS, "debugger " + m_procID + " shutting down");
if (m_vmAlive) {
// the VM will not have been properly shut down if the application runs
// to the end and the VM disconnects because of that. On the other hand,
// if the Emacs side issues a Finish command, the VM will be shut down,
// which is the reason for the m_vmAlive variable.
VMUtil.shutdown(m_vm);
m_vmAlive = false;
}
if (m_handler != null) {
m_handler.requestStop();
}
if (m_eventHandler != null) {
m_eventHandler.shutdown();
}
if (m_sio != null) {
m_sio.shutdown();
}
if (null != m_gui) {
m_gui.shutdown();
}
// XXX - stop the rest of the stuff as well, when that has been added.
// Invalidate this object
m_handler = null;
m_eventHandler = null;
m_vm = null;
m_sio = null;
m_gui = null;
// this debugger should no longer be available to the session manager
SessionManager.deregisterDebugger(this);
}
/**
* Launches a virtual machine for the process to be debugged, and
* sets up the standard in/out/err streams for the process.
*
* @param cmdID an <code>Integer</code> value used for setting up
* SIO streams.
* @param args a <code>List</code> value
* @exception JDEException if an error occurs
*/
public void launchVM(Integer cmdID, List args) throws JDEException {
// this is the connector that launches a debuggee vm
String connectSpec = "com.sun.jdi.CommandLineLaunch";
// check if this kind of connector is, indeed,
// available. if not, throw an exception.
LaunchingConnector connector = (LaunchingConnector) VMUtil.getConnector(connectSpec);
if (connector == null)
throw new JDEException("No such connector is available: "+connectSpec);
// first set up the argument map. a table that describes the
// different keys should be in the public jpda documentation.
Map argumentMap = connector.defaultArguments();
Connector.Argument mainArg =
(Connector.Argument)argumentMap.get("main");
// compose the command line
String commandLine = "";
String quote =((Connector.Argument)argumentMap.get("quote")).value();
// check if there are special launch options we need to process
if (args.size() == 0)
throw new JDEException("Insufficient arguments");
// XXX - not sure if it's a brilliant idea to hard-code the
// java executable name here, but that's the way it was
// done. Anyway, if it becomes a problem, it is now flagged. / Petter
String executable = "java";
// be careful with the loop here....
while ((args.size() >0)
&& args.get(0).toString().startsWith("-")) {
String origArg = args.remove(0).toString();
String arg = origArg.toLowerCase();
if (arg.equals("-vmexec")) {
if (args.size() == 0)
throw new JDEException("Missing argument to
'use_executable'");
executable = args.remove(0).toString();
Connector.Argument vmexecArg =
(Connector.Argument)argumentMap.get("vmexec");
vmexecArg.setValue(executable);
}
else if (arg.equals("-home")) {
if (args.size() == 0)
throw new JDEException("Missing argument to 'home'");
String home = args.remove(0).toString();
Connector.Argument homeArg = (Connector.Argument)
argumentMap.get("home");
homeArg.setValue(home);
continue;
}
else {
args.add(0, origArg);
break;
}
}
if (args.size() == 0)
throw new JDEException("Missing arguments: no class specified?");
// take care of spaces too! so quote everything.
Iterator iterator = args.iterator();
while(iterator.hasNext()) {
// commandLine += quote + iterator.next() + quote + " ";
String arg = (String)iterator.next();
if (arg.equalsIgnoreCase("-classic")) {
Connector.Argument optionsArg =
(Connector.Argument)argumentMap.get("options");
String options = optionsArg.value();
options = "-classic" + " " + options;
optionsArg.setValue(options);
JDE.signal(m_procID, MESSAGE, "VM options: '" + options +
"'", QUOTE);
}
else
commandLine += quote + arg + quote + " ";
}
mainArg.setValue(commandLine);
m_vm = null;
try {
m_vm = connector.launch(argumentMap);
JDE.signal(m_procID, MESSAGE, "Launched VM " + m_vm.description(),
QUOTE);
m_vmAlive = true;
// If we're launching the application, the standard in/out/err needs to be
connected
// to Emacs.
m_sio.initConnect(cmdID);
} catch (IOException ex) {
JDE.debug(EXCEPTION, "Exception launching VM: " + ex.toString());
throw new JDEException("Unable to launch: " +
ex.toString().replace('\\','/'));
} catch (IllegalConnectorArgumentsException ex) {
throw new JDEException("Invalid or inconsistent connector arguments for
connector '"+connector+"'");
} catch (VMStartException ex) {
throw new
JDEException(ex.getMessage().toString().replace('\\','/'));
}
}
/**
* Attaches to a currently running VM through shared memory. The
* JPDA framework currently only supports that on Windows systems.
*
* @param args a <code>List</code> value
* @exception JDEException if an error occurs
*/
public void attachVMShmem(List args) throws JDEException {
if (args.size() < 1)
throw new JDEException("Missing name");
// the attaching connector...
String connectSpec = null;
connectSpec = "com.sun.jdi.SharedMemoryAttach";
AttachingConnector connector = (AttachingConnector) VMUtil.getConnector(connectSpec);
if (connector == null)
throw new JDEException("No such connector is available: "+connectSpec);
try {
Map argumentMap = connector.defaultArguments();
Connector.Argument nameArg =
(Connector.Argument) argumentMap.get("name");
nameArg.setValue(args.remove(0).toString());
m_vm = connector.attach(argumentMap);
m_vmAlive = true;
JDE.signal(m_procID, MESSAGE, "Attached VM (shmem) " + m_vm.description(),
QUOTE);
} catch (IOException ex) {
JDE.debug(EXCEPTION, ex.toString());
throw new JDEException("Error attempting to attach to process via shared
memory.");
} catch (IllegalConnectorArgumentsException ex) {
throw new JDEException("Illegal connector arguments for connector
'"+connector);
}
}
/**
* Attaches to a currently running VM through socket
* communication. Works for all platforms, but is slower than
* shared memory.
*
* @param args a <code>List</code> value
* @exception JDEException if an error occurs
*/
public void attachVMSocket(List args) throws JDEException {
if (args.size() < 1)
throw new JDEException("Missing arguments: specify at least the port");
// the attaching connector...
String connectSpec = null;
connectSpec = "com.sun.jdi.SocketAttach";
AttachingConnector connector = (AttachingConnector) VMUtil.getConnector(connectSpec);
if (connector == null)
throw new JDEException("No such connector is available: " + connectSpec);
try {
Map argumentMap = connector.defaultArguments();
while ((args.size() > 0) &&
args.get(0).toString().startsWith("-")) {
String arg = args.remove(0).toString().toLowerCase();
if (arg.equals("-host")) {
if (args.size() == 0)
throw new JDEException("Missing argument to 'host'");
String host = args.remove(0).toString();
Connector.Argument hostArg =
(Connector.Argument)argumentMap.get("hostname");
hostArg.setValue(host);
} else if (arg.equals("-port")) {
if (args.size() == 0)
throw new JDEException("Missing argument to 'port'");
String port = args.remove(0).toString();
Connector.Argument portArg =
(Connector.Argument)argumentMap.get("port");
portArg.setValue(port);
} else {
args.add(0, arg);
break;
}
}
m_vm = connector.attach(argumentMap);
m_vmAlive = true;
JDE.signal(m_procID, MESSAGE, "Attached VM (socket) " +
m_vm.description(), QUOTE);
} catch (IOException ex) {
JDE.debug(EXCEPTION, ex.toString());
throw new JDEException("I/O error occurred while attempting to attach
process.");
} catch (IllegalConnectorArgumentsException ex) {
throw new JDEException("Illegal connector arguments for connector
'"+connector);
}
}
/**
* Starts a thread that waits for a VM to be launched and connect
* to a given address using shared memory. Executing this in a
* separate thread means that the command handler can go on
* waiting for new commands, without freezing up. The new thread
* dies as soon as the VM connects.
*
* @param address a <code>String</code> value
* @exception JDEException if an error occurs
*/
public void listenShmem(final String address) throws JDEException {
String connectSpec = "com.sun.jdi.SharedMemoryListen";
final ListeningConnector connector = (ListeningConnector)
VMUtil.getConnector(connectSpec);
final Debugger thisAsLocal = this;
if (connector == null)
throw new JDEException("No such connector is available: "+connectSpec);
Thread thread = new Thread("Listen on shared memory channel.") {
public void run() {
try {
Map argumentMap = connector.defaultArguments();
Connector.Argument nameArg =
(Connector.Argument)argumentMap.get("name");
nameArg.setValue(address);
connector.startListening(argumentMap);
m_vm = connector.accept(argumentMap);
connector.stopListening(argumentMap);
JDE.signal(m_procID, MESSAGE, "Attached VM (shmem) " +
m_vm.description(), QUOTE);
m_vmAlive = true;
thisAsLocal.start();
} catch (IOException ex) {
JDE.debug(EXCEPTION, ex.toString());
JDE.signal(m_procID, MESSAGE,
"I/O error occurred while listening at shared memory
address:"
+ address,
QUOTE);
try {
SessionManager.deregisterDebugger(thisAsLocal);
}
catch (JDEException e) { /* FALLTHROUGH */ }
} catch (IllegalConnectorArgumentsException ex) {
JDE.debug(EXCEPTION, ex.toString());
JDE.signal(m_procID, MESSAGE,
"Illegal argument error occurred while listening " +
"at shared memory address: " + address,
QUOTE);
try {
SessionManager.deregisterDebugger(thisAsLocal);
}
catch (JDEException e) { /* FALLTHROUGH */ }
} catch (JDEException ex) {
JDE.debug(EXCEPTION, ex.toString());
JDE.signal(m_procID, MESSAGE,
"Error starting up debugger: " + ex,
QUOTE);
try {
SessionManager.deregisterDebugger(thisAsLocal);
}
catch (JDEException e) { /* FALLTHROUGH */ }
}
}
};
JDE.signal(m_procID, MESSAGE,
"Listening at shared memory address: " + address,
QUOTE);
thread.start();
}
/**
* Starts a thread that waits for a VM to be launched and connect
* to a given address using socket communication. Executing this in a
* separate thread means that the command handler can go on
* waiting for new commands, without freezing up. The new thread
* dies as soon as the VM connects.
*
* @param address a <code>String</code> value
* @exception JDEException if an error occurs
*/
public void listenSocket(final String address) throws JDEException {
String connectSpec = "com.sun.jdi.SocketListen";
final ListeningConnector connector = (ListeningConnector)
VMUtil.getConnector(connectSpec);
final Debugger thisAsLocal = this;
if (connector == null)
throw new JDEException("No such connector is available: "+connectSpec);
Thread thread = new Thread("Listen on socket.") {
public void run() {
try {
Map argumentMap = connector.defaultArguments();
Connector.Argument portArg =
(Connector.Argument)argumentMap.get("port");
portArg.setValue(address);
connector.startListening(argumentMap);
m_vm = connector.accept(argumentMap);
connector.stopListening(argumentMap);
JDE.signal(m_procID, MESSAGE,
"Attached VM (socket) " + m_vm.description(),
QUOTE);
m_vmAlive = true;
thisAsLocal.start();
} catch (IOException ex) {
JDE.debug(EXCEPTION, ex.toString());
JDE.signal(m_procID, MESSAGE,
"Error occurred when listening on socket: " + ex,
QUOTE);
try {
SessionManager.deregisterDebugger(thisAsLocal);
}
catch (JDEException e) { /* FALLTHROUGH */ }
} catch(IllegalConnectorArgumentsException ex) {
JDE.signal(m_procID, MESSAGE,
"Illegal connector arguments for connector
'"+connector + " " + ex,
QUOTE);
try {
SessionManager.deregisterDebugger(thisAsLocal);
}
catch (JDEException e) { /* FALLTHROUGH */ }
} catch(JDEException ex) {
JDE.signal(m_procID, MESSAGE,
"Error starting up debugger: " + ex,
QUOTE);
try {
SessionManager.deregisterDebugger(thisAsLocal);
}
catch (JDEException e) { /* FALLTHROUGH */ }
}
}
};
JDE.signal(m_procID, MESSAGE,
"Listening at socket address: " + address, QUOTE);
thread.start();
}
public EventRequestSpecList getEventRequestSpecList() {
return m_eventRequestSpecList;
}
public CommandHandler getCommandHandler() {
return m_handler;
}
public Integer getProcID() {
return m_procID;
}
public ObjectStore getStore() {
return m_objectStore;
}
public void signalCommandResult(Integer cmdID, String message, boolean success) {
JDE.commandResult(cmdID, message, success, NOQUOTE);
}
public void signalCommandResult(Integer cmdID, String message, boolean success, boolean
quote) {
JDE.commandResult(cmdID, message, success, quote);
}
public VirtualMachine getVM() {
return m_vm;
}
public GUI getGUI() {
return m_gui;
}
/**
* Returns true if this is a valid debugger. A debugger is valid if
* the start() method has been called, but not the shutdown()
* method. XXX - actually not correct at the moment, but it
* doesn't matter. The method returns true from the moment the
* Debugger instance has been created until the shutdown() method
* is called.
*
* @return a <code>boolean</code> value
*/
public boolean isValid() {
// Am using the command handler to indicate whether this is a live
// debugger or not.
return m_handler != null;
}
/**
* Returns the thread corresponding to a given name, or null if
* there is no such thread.
*
* @param name
*/
public ThreadReference getThreadReference(String name) {
List list = m_vm.allThreads();
Iterator it = list.iterator();
ThreadReference thread;
while (it.hasNext()) {
thread = (ThreadReference)it.next();
if (thread.name().equals(name)) return thread;
}
return null;
}
/**
* Adds an event request to the identifiable events, for future
* reference. Also enables the event.
*
* @return an identifier for the request
*/
public Long addIdentifiableRequest(EventRequest e) {
Long id = SessionManager.generateObjectID();
synchronized (m_identifiableEventRequests) {
m_identifiableEventRequests.put(id, e);
}
e.enable();
return id;
}
/**
* Removes an event request. Also disables/deletes from the vm.
*/
public void deleteIdentifiableRequest(Long id) throws JDEException {
EventRequestManager erm = getVM().eventRequestManager();
synchronized (m_identifiableEventRequests) {
if (!m_identifiableEventRequests.containsKey(id)) {
throw new JDEException("Invalid request ID");
} else {
Object e = m_identifiableEventRequests.remove(id);
if (e == null) {
throw new JDEException("No such event request");
} else if (e instanceof EventRequest) {
((EventRequest)e).disable();
erm.deleteEventRequest((EventRequest)e);
} else {
throw new JDEException("INTERNAL ERROR: Not an event request : " +
e.toString());
}
}
}
}
/** Add an EventSetListener. If the listener is already in the
* list, nothing is done.<p>
*
* This is handled by the eventHandler, but there is no public
* access to that
*/
public void addEventSetListener(EventSetListener listener) {
m_eventHandler.addEventSetListener(listener);
}
/** Remove an EventSetListener. If the listener is already in the
* list, nothing is done */
public void removeEventSetListener(EventSetListener listener) {
m_eventHandler.removeEventSetListener(listener);
}
/** Add an CommandListener. If the listener is already in the
* list, nothing is done.<p>
*
*/
public void addCommandListener(CommandListener listener) {
m_handler.addCommandListener(listener);
}
/** Remove an CommandListener. If the listener is already in the
* list, nothing is done */
public void removeCommandListener(CommandListener listener) {
m_handler.removeCommandListener(listener);
}
}// Debugger
/*
* $Log: Debugger.java,v $
* Revision 1.3 2003/04/29 16:51:56 troy
* Initial version of GUI. Includes display of local variables.
*
* Revision 1.2 2003/01/15 05:50:51 paulk
* Remove CRs.
*
* Revision 1.1 2003/01/08 07:16:45 paulk
* Initial revision.
*
*/
// End of Debugger.java
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/DisplayableValue.java
Index: DisplayableValue.java
===================================================================
package jde.debugger;
import com.sun.jdi.Type;
import com.sun.jdi.LocalVariable;
import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.Value;
/**
* DisplayableValue.java
*
*
* Created: Fri Feb 01 12:02:55 2002
*
* @author <a href="mailto:petter.mahlen@chello.se">Petter
Måhlén</a>
* @version $Revision: 1.1 $
*/
public class DisplayableValue {
private Value m_value;
public DisplayableValue(Value value) {
m_value = value;
}
public Value getValue() {
return m_value;
}
public void setValue(Value value) {
m_value = value;
}
public String toString() {
if (m_value == null) {
return "null value";
}
return m_value.toString();
}
}// DisplayableValue
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/JDEbug.java
Index: JDEbug.java
===================================================================
package jde.debugger;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import jde.debugger.command.CommandHandler;
import jde.debugger.command.DebugCommand;
import jde.debugger.command.DebugCommandFactory;
/**
* Class of JDEbug debuggers.
* <p>
* This class defines methods for communicating with the JDE. It
* maintains a list of active applications. It passes application
* commands to the apps specified by the commands.
* <p>
* See {@link Protocol Protocol class} for command/response formats and
* {@link EventHandler EventHandler} for event set formats.
* <p>
* JDEbug responds to every command with either a result or error
* message.
* <p>
*
* @author Amit Kumar
* @since 0.1
* @author Paul Kinnucan
* @since 1.3
* @version $Revision: 1.13 $
*/
public class JDEbug extends Thread implements Protocol {
/**
* The ID of jdebug. This is used by jde when issuing commands that
* are not specific to any particular vm, for instance, 'quit', or
* the command used to launch new application/vms.<br>
* It is the Integer -1.
*/
public static final Integer debuggerID = new Integer(-1);
public static JDEbug theDebugger = new JDEbug();
private boolean m_shutdown = false;
private CommandStream m_commandStream;
/**
* Protected constructor, since this is a singleton class.
*/
protected JDEbug() {
}
public void init() throws IOException {
// The debugger uses standard in to read commands from Emacs.
m_commandStream = new CommandStream(new BufferedReader(new
InputStreamReader(System.in)));
}
/**
* Runs the debugger thread. This method reads and executes commands
* from the JDE.
*/
public void run() {
JDE.debug(FRAMEWORK, "Starting JDEbug main loop");
while (!m_shutdown) {
JDE.debug(FRAMEWORK, "JDEbug waiting for cmd");
List command = m_commandStream.nextCommand();
JDE.debug(FRAMEWORK, "JDEbug got cmd");
final Integer procID = Integer.valueOf(command.get(0).toString());
final Integer cmdID = Integer.valueOf(command.get(1).toString());
final String cmdName = command.get(2).toString().toLowerCase();
final List arguments = command.subList(3, command.size());
try {
CommandHandler handler = SessionManager.getCommandHandler(procID);
if (handler == null) {
throw new JDEException("no command handler found for debugger process:
" + procID);
}
JDE.debug(EVENTS, "JDEbug firing command event");
handler.fireCommandEvent(procID,
cmdID,
cmdName,
arguments);
}
catch (JDEException ex) {
JDE.commandResult(cmdID, "Error occurred while executing " + cmdName +
". Error: " + ex,
CMD_NOK, QUOTE);
}
}
JDE.debug(FRAMEWORK, "jdebug main loop terminating");
SessionManager.shutdown(); // Just in case no Quit command was issued
}
/**
* Sets a flag that terminates the main loop (implemented in the
* {@link #run} method).
*/
public void shutdown() {
m_shutdown = true;
}
} // JDEbug
/*
* $Log: JDEbug.java,v $
* Revision 1.13 2003/04/29 16:51:57 troy
* Initial version of GUI. Includes display of local variables.
*
* Revision 1.12 2003/01/16 05:38:28 paulk
* Cosmetic change
*
* Revision 1.11 2003/01/08 06:53:37 paulk
* Integrate Petter Mahlen's updates.
*
* Revision 1.10 2001/08/14 05:15:01 paulk
* Miscellaneous updates.
*
* Revision 1.9 2001/03/24 05:36:48 paulk
* Updated to reflect reorganization of debuggee code.
*
* Revision 1.8 2000/10/20 04:18:29 paulk
* *** empty log message ***
*
* Revision 1.7 2000/07/28 06:26:31 paulk
* Committing all modified files.
*
* Revision 1.6 2000/02/14 06:25:34 paulk
* Implemented workaround for JPDA bug that prevented setting of
* breakpoints in inner classes.
*
* Revision 1.5 2000/01/31 12:41:39 paulk
* * Continue converting commands from functional to OO implementation.
*
* Revision 1.4 2000/01/30 12:47:40 paulk
* Changed to a singleton class. Implemented support for object-oriented
* commands created by DebugCommandFactory. Reimplemented launch and
* listen commands as object-oriented commands.
*
* Revision 1.3 2000/01/28 04:24:55 paulk
* Threaded listen commands. Moved launch, attach, and listen commands
* from Application to Jdebug class. Did general cleanup of Jdebug and
* Application class, including using more specific names for some
* variables, moving fields to the end of files, rewriting comments.
*
*/
// End of JDEbug.java
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/SessionManager.java
Index: SessionManager.java
===================================================================
package jde.debugger;
import java.util.HashMap;
import java.util.Iterator;
import jde.debugger.command.CommandHandler;
import jde.debugger.command.SessionCommandHandler;
/**
* The session manager keeps track of which debugging sessions are
* currently active and handled by which debuggers. There is also a
* special debug command handler thread which is handled by the
* SessionManager ({@link #m_handler}). It's a singleton object that
* exposes only a set of static interface functions.
*
* <p>
* Created: Tue Jan 08 13:19:51 2002
*
* @author Petter Måhlén
* @version $Revision: 1.3 $
*/
public class SessionManager implements Protocol {
/**
* The mappings of process ID/debugger that are handled by JDEbug.
* Not synchronized, because it is only accessed from methods defined
* in this file, and these methods are (and must remain) synchronized.
*/
private HashMap m_debuggers;
private SessionCommandHandler m_handler;
private static SessionManager s_theManager = new SessionManager();
private static long s_nextObjectID = 0;
/**
* Creates a new <code>SessionManager</code> instance and starts
* up the {@link #m_handler} session command handler thread.
*
*/
private SessionManager() {
m_debuggers = new HashMap();
m_handler = new SessionCommandHandler();
m_handler.start();
}
private synchronized CommandHandler p_getCommandHandler(Integer procID)
throws JDEException {
// special hack for the session command handler
if (procID.equals(JDEbug.debuggerID)) {
return m_handler;
}
Debugger debugger = (Debugger) m_debuggers.get(procID);
if (debugger == null) {
throw new JDEException("No process with id " + procID + "
found");
}
return debugger.getCommandHandler();
}
private synchronized Debugger p_getDebugger(Integer procID)
throws JDEException {
Debugger debugger = (Debugger) m_debuggers.get(procID);
if (debugger == null) {
throw new JDEException("No debugger for process id " + procID + "
found");
}
return debugger;
}
private synchronized void p_registerDebugger(Debugger debugger) throws JDEException {
Integer procID = debugger.getProcID();
if (m_debuggers.containsKey(procID)) {
throw new JDEException("registerDebugger: A process with id " + procID +
" already exists!");
}
m_debuggers.put(procID, debugger);
JDE.debug(EVENTS, "registered debugger with procid: " + procID);
}
private synchronized void p_deregisterDebugger(Debugger debugger) throws JDEException {
Integer procID = debugger.getProcID();
if (null != m_debuggers) {
if (!m_debuggers.containsKey(procID)) {
// XXX - sort of doubtful whether I should really throw an exception here,
// but it's generally best to be strict with incorrect usage.
throw new JDEException("deregisterDebugger: No process with id " + procID +
" exists!");
}
if (debugger.isValid()) {
throw new JDEException("INTERNAL ERROR: an attempt was made at deregistering a valid
debugger. The debugger must be shut down first.");
}
m_debuggers.remove(procID);
}
JDE.debug(EVENTS, "removed debugger with procid: " + procID);
}
private synchronized void p_shutdown() {
if (m_handler != null) {
m_handler.requestStop();
}
if (m_debuggers != null) {
Iterator iter = m_debuggers.values().iterator();
while (iter.hasNext()) {
Debugger dbgr = (Debugger) iter.next();
try {
dbgr.shutdown();
}
catch (JDEException e) {
JDE.signal(dbgr.getProcID(), Protocol.ERROR,
"SessionManager.p_shutdown() caught exception when shutting down
debugger: " + e,
QUOTE);
}
}
}
// Invalidate the object
if (null != m_debuggers)
m_debuggers.clear();
m_debuggers = null;
m_handler = null;
}
/*
* PUBLIC, STATIC INTERFACE -----------------------------------------------------
*/
/**
* Returns the command handler for a given process ID. Note that
* it doesn't return the Debugger object, but its command handler.
*
* @param procID an <code>Integer</code> value
* @return a <code>CommandHandler</code> value
* @exception JDEException if there is no registered debugger for
* the given process ID
* @see jde.debugger.command.ProcessCommandHandler
* @see Debugger
*/
public static CommandHandler getCommandHandler(Integer procID) throws JDEException {
return s_theManager.p_getCommandHandler(procID);
}
/**
* Returns the Debugger object for a given process ID.
*
* @param procID an <code>Integer</code> value
* @return a <code>Debugger</code> value
* @exception JDEException if there is no registered debugger for
* the given process ID
* @see Debugger
*/
public static Debugger getDebugger(Integer procID) throws JDEException {
return s_theManager.p_getDebugger(procID);
}
/**
* Registers the given Debugger as active. When this is done, it
* is possible to retrieve the Debugger and its CommandHandler
* through the {@link #getDebugger} and {@link #getCommandHandler}
* methods.
*
* @param debugger a <code>Debugger</code> value
* @exception JDEException if there is already a registered
* debugger with the same process ID.
*/
public static void registerDebugger(Debugger debugger) throws JDEException {
s_theManager.p_registerDebugger(debugger);
}
/**
* Deregisters the given debugger.
*
* @param debugger a <code>Debugger</code> value
* @exception JDEException if the debugger hasn't been registered
* previously, or if the debugger is still valid, as indicated by
* the {@link Debugger#isValid} method.
*/
public static void deregisterDebugger(Debugger debugger) throws JDEException {
s_theManager.p_deregisterDebugger(debugger);
}
/**
* Shuts down the SessionManager, by first shutting down each
* registered Debugger, and then shutting down the session command
* handler. After the shutdown, this object is no longer possible
* to use.
*/
public static void shutdown() {
s_theManager.p_shutdown();
}
/**
* Generates a unique number with each call (unique for each time
* that this class is loaded, not in any wider sense).
*
* @return a <code>Long</code> value
*/
public static synchronized Long generateObjectID() {
return new Long(s_nextObjectID++);
}
}// SessionManager
/*
* $Log: SessionManager.java,v $
* Revision 1.3 2003/04/29 16:51:57 troy
* Initial version of GUI. Includes display of local variables.
*
* Revision 1.2 2003/01/15 05:50:51 paulk
* Remove CRs.
*
* Revision 1.1 2003/01/08 07:16:45 paulk
* Initial revision.
*
*/
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/VMUtil.java
Index: VMUtil.java
===================================================================
package jde.debugger;
import java.util.Iterator;
import java.util.List;
import com.sun.jdi.Bootstrap;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.connect.Connector;
import com.sun.jdi.VMDisconnectedException;
/**
* Contains a couple of static functions that simplify managing
* virtual machines. Some kind of rearrangement between this class and
* the {@link Debugger} class should probably be made - this class
* doesn't feel so meaningful at the moment, whereas the methods for
* launching/attaching/listening to VMs in the Debugger class are
* messy. Something for the future.
*
* <p>
* Created: Tue Jan 08 18:49:28 2002
*
* @author Petter Måhlén
* @version 1.0
*/
public class VMUtil {
private static List s_connectors = Bootstrap.virtualMachineManager().allConnectors();
private VMUtil() {
}
/**
* Gets a connector.
*
* @param type connector class name
*
*/
public static final Connector getConnector(String name) {
Iterator iter = s_connectors.iterator();
while (iter.hasNext()) {
Connector connector = (Connector)iter.next();
if (connector.name().equals(name)) {
return connector;
}
}
return null;
}
/**
* Shut down the indicated virtual machine.
*
* @param vm a <code>VirtualMachine</code> value
*/
public static void shutdown(VirtualMachine vm) {
/*
* taken from the original (Amit Kumar) DebuggeeProcess.shutdown()
*
* XXX
* As far as I can understand, vm.dispose() doesn't terminate the process
* that is being debugged. It seems to me as if doing so would be necessary
* (otherwise the VM process should be orphaned), so this needs to be
* analysed. / Petter
*/
// isolate the process first
Process process = null;
if (vm != null) {
try {
process = vm.process();
vm.dispose();
}
catch (VMDisconnectedException e) {
// If it's already disconnected, no problem, so just ignore it.
}
}
if (process != null) {
process.destroy();
// XXX sun's jdb implementation works a lot to make sure
// the stderr and stdout are dumped before killing
// things. i'm not sure how important it is, or even how
// well it works (given i can't test it)
// sooo, if the reader finds bugs with the output handling
// on finish, lemme know. (comment by Amit Kumar)
}
}
}// VMUtil
1.7 +25 -60
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/AttachShmem.java
Index: AttachShmem.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/AttachShmem.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- AttachShmem.java 2003/01/18 05:48:35 1.6
+++ AttachShmem.java 2006/03/03 20:41:49 1.7
@@ -1,20 +1,7 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.3 $
- */
-
package jde.debugger.command;
-import com.sun.jdi.connect.AttachingConnector;
import jde.debugger.JDEException;
-import java.util.Map;
-import com.sun.jdi.connect.Connector;
-import com.sun.jdi.VirtualMachine;
-import jde.debugger.DebuggeeProcess;
-import java.io.IOException;
-import com.sun.jdi.connect.IllegalConnectorArgumentsException;
-import jde.debugger.Jdebug;
-import jde.debugger.Debug;
+import jde.debugger.Debugger;
+import jde.debugger.SessionManager;
/**
@@ -33,65 +20,43 @@ import jde.debugger.Debug;
* JPDA documentation.
* </ul>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class AttachShmem extends DebugSessionCommand {
protected void doCommand() throws JDEException {
-
- // the attaching connector...
- String connectSpec = null;
- connectSpec = "com.sun.jdi.SharedMemoryAttach";
-
- AttachingConnector connector = (AttachingConnector) getConnector(connectSpec);
- if (connector == null)
- throw new JDEException("No such connector is available: "+connectSpec);
-
- if (args.size() < 1)
- throw new JDEException("Missing name");
-
+ // XXX - fix the 'true' here, and define a better way to determine
+ // whether to use a GUI or not.
+ Debugger debugger = new Debugger(m_targetProcessID, true);
+
+ SessionManager.registerDebugger(debugger);
+
try {
- Map argumentMap = connector.defaultArguments();
-
- Connector.Argument nameArg =
- (Connector.Argument)argumentMap.get("name");
- nameArg.setValue(args.remove(0).toString());
-
- VirtualMachine vm = connector.attach(argumentMap);
-
-
- // note that new process might raise a jdeexception.
- DebuggeeProcess proc = new DebuggeeProcess(procID, vm);
-
- if (procRegistry.processExists(procID)) {
- proc.shutdown();
- throw new JDEException("A process with the ID" + procID +
- " already exists.");
- }
-
- procRegistry.addProcess(procID, proc);
-
- jde.signalCommandResult(procID, cmdID);
-
- jde.signal(procID, MESSAGE, "Attached VM (shmem) " + vm.description());
-
- } catch (IOException ex) {
- Debug.printIf(ex);
- throw new JDEException("Error attempting to attach to process via shared
memory.");
- } catch (IllegalConnectorArgumentsException ex) {
- throw new JDEException("Illegal connector arguments for connector
'"+connector);
+ debugger.attachVMShmem(m_args);
+ debugger.start();
}
+ catch (JDEException e) {
+ SessionManager.deregisterDebugger(debugger);
+ throw e;
+ }
+
+ debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
-
+
public Object clone() {return new AttachShmem();}
-
-
+
+
} // AttachShmem
/*
* $Log: AttachShmem.java,v $
+ * Revision 1.4 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.3 2001/03/24 05:42:36 paulk
* Updated to reflect reorganization of debugger code.
*
1.7 +22 -72
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/AttachSocket.java
Index: AttachSocket.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/AttachSocket.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- AttachSocket.java 2003/01/18 05:48:35 1.6
+++ AttachSocket.java 2006/03/03 20:41:49 1.7
@@ -1,20 +1,14 @@
/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*/
package jde.debugger.command;
+
+import jde.debugger.Debugger;
import jde.debugger.JDEException;
-import com.sun.jdi.connect.AttachingConnector;
-import java.util.Map;
-import com.sun.jdi.connect.Connector;
-import com.sun.jdi.VirtualMachine;
-import jde.debugger.DebuggeeProcess;
-import jde.debugger.Jdebug;
-import java.io.IOException;
-import jde.debugger.Debug;
-import com.sun.jdi.connect.IllegalConnectorArgumentsException;
+import jde.debugger.SessionManager;
/**
@@ -34,7 +28,7 @@ import com.sun.jdi.connect.IllegalConnec
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class AttachSocket extends DebugSessionCommand {
@@ -43,69 +37,22 @@ public class AttachSocket extends DebugS
* @exception jde.debugger.JDEException <description>
*/
protected void doCommand() throws JDEException {
-
- // the attaching connector...
- String connectSpec = null;
- connectSpec = "com.sun.jdi.SocketAttach";
-
-
- AttachingConnector connector = (AttachingConnector) getConnector(connectSpec);
- if (connector == null)
- throw new JDEException("No such connector is available: "+connectSpec);
-
- if (args.size() < 1)
- throw new JDEException("Missing arguments: specify at least the port");
-
+ // XXX - fix the 'true' here, and define a better way to determine
+ // whether to use a GUI or not.
+ Debugger debugger = new Debugger(m_targetProcessID, true);
+
+ SessionManager.registerDebugger(debugger);
+
try {
- Map argumentMap = connector.defaultArguments();
-
- while ((args.size() > 0)
- && args.get(0).toString().startsWith("-")) {
- String arg = args.remove(0).toString().toLowerCase();
- if (arg.equals("-host")) {
- if (args.size() == 0)
- throw new JDEException("Missing argument to 'host'");
- String host = args.remove(0).toString();
- Connector.Argument hostArg =
- (Connector.Argument)argumentMap.get("hostname");
- hostArg.setValue(host);
- } else if (arg.equals("-port")) {
- if (args.size() == 0)
- throw new JDEException("Missing argument to 'port'");
- String port = args.remove(0).toString();
- Connector.Argument portArg =
- (Connector.Argument)argumentMap.get("port");
- portArg.setValue(port);
- } else {
- args.add(0, arg);
- break;
- }
- }
-
- VirtualMachine vm = connector.attach(argumentMap);
-
- // note that new process might raise a jdeexception.
- DebuggeeProcess proc = new DebuggeeProcess(procID, vm);
-
- if (procRegistry.processExists(procID)) {
- proc.shutdown();
- throw new JDEException("A process with the ID " + procID +
- " already exists.");
+ debugger.attachVMSocket(m_args);
+ debugger.start();
}
-
- procRegistry.addProcess(procID, proc);
-
- jde.signalCommandResult(procID, cmdID);
-
- jde.signal(procID, MESSAGE, "Attached VM (socket) " + vm.description());
-
- } catch (IOException ex) {
- Debug.printIf(ex);
- throw new JDEException("I/O error occurred while attempting to attach
process.");
- } catch (IllegalConnectorArgumentsException ex) {
- throw new JDEException("Illegal connector arguments for connector
'"+connector);
+ catch (JDEException e) {
+ SessionManager.deregisterDebugger(debugger);
+ throw e;
}
-
+
+ debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
public Object clone() {return new AttachSocket();}
@@ -116,6 +63,9 @@ public class AttachSocket extends DebugS
/*
* $Log: AttachSocket.java,v $
+ * Revision 1.5 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.4 2001/03/24 05:42:36 paulk
* Updated to reflect reorganization of debugger code.
*
1.6 +120 -115
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Break.java
Index: Break.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Break.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- Break.java 2003/01/18 05:48:35 1.5
+++ Break.java 2006/03/03 20:41:49 1.6
@@ -1,16 +1,12 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
import java.util.StringTokenizer;
-import jde.debugger.spec.EventRequestSpec;
+
import jde.debugger.Etc;
+import jde.debugger.JDE;
+import jde.debugger.JDEException;
+import jde.debugger.spec.EventRequestSpec;
import jde.debugger.spec.EventRequestSpecList;
@@ -50,10 +46,13 @@ import jde.debugger.spec.EventRequestSpe
* </ul>
*
* <p>
- * @see EventHandler#breakpointEvent(BreakpointEvent)
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
+ * @see jde.debugger.EventHandler#breakpointEvent(BreakpointEvent)
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
*/
public class Break extends DebugProcessCommand {
@@ -66,134 +65,140 @@ public class Break extends DebugProcessC
try {
// whatever function is called, should do a signalCommandResult
// during the execution.
- String type = args.remove(0).toString().toLowerCase();
+ String type = m_args.remove(0).toString().toLowerCase();
if (type.equals("in_method")) {
- doBreakInMethod(args);
+ doBreakInMethod(m_args);
} else if (type.equals("on_line")) {
- doBreakOnLine(args);
+ doBreakOnLine(m_args);
} else if (type.equals("absolute")) {
- doBreakAbsolute(args);
+ doBreakAbsolute(m_args);
} else
- throw new JDEException("Syntax error: expecting one of 'in_method',
'on_line', or 'absolute'; '"+type+"' is not
supported");
+ throw new JDEException("Syntax error: expecting one of 'in_method',
'on_line', or 'absolute'; '"+type+"' is not
supported");
} catch (UnsupportedOperationException ex) {
throw new JDEException("Unspecified Error occured");
} catch (IndexOutOfBoundsException ex) {
throw new JDEException("Syntax error: argument missing");
}
}
+
+
+ /**
+ * A break in a particular method.
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * break in_method class method [(arg1,arg2,...)]
+ * [{@link Etc#getThreadFromArgs(List) thread-restriction}]
+ * [{@link Etc#getExprFromArgs(List) expression-restriction}]
+ * [{@link Etc#getSuspendPolicyFromArgs(List) suspend-policy}]
+ * </pre>
+ *
+ * <b>Comments:</b>
+ * <ul>
+ * <li> There should be <b>no spaces</b> before or after the
','; when
+ * the arguments are supplied.
+ * <li> A void method should be indicated by <code>()</code>
+ * <li> A unique method doesn't need to supply the arguments. The
+ * <b>entire</b> argument list should be absent in this case.
+ * </ul>
+ */
+ public void doBreakInMethod(List args)
+ throws JDEException {
+ if (args.size() < 2)
+ throw new JDEException("Insufficient arguments");
+
+ String classPattern = args.remove(0).toString();
+ String method = args.remove(0).toString();
- /**
- * A break in a particular method.
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * break in_method class method [(arg1,arg2,...)]
- * [{@link Etc#getThreadFromArgs(List) thread-restriction}]
- * [{@link Etc#getExprFromArgs(List) expression-restriction}]
- * [{@link Etc#getSuspendPolicyFromArgs(List) suspend-policy}]
- * </pre>
- *
- * <b>Comments:</b>
- * <ul>
- * <li> There should be <b>no spaces</b> before or after the
','; when
- * the arguments are supplied.
- * <li> A void method should be indicated by <code>()</code>
- * <li> A unique method doesn't need to supply the arguments. The
- * <b>entire</b> argument list should be absent in this case.
- * </ul>
- */
- public void doBreakInMethod(List args)
- throws JDEException {
-
- if (args.size() < 2)
- throw new JDEException("Insufficient arguments");
-
- String classPattern = args.remove(0).toString();
- String method = args.remove(0).toString();
-
- // the argument list
- List argumentList = null;
-
- // see if more arguments are present
- if (args.size() > 0) {
-
- String arg = args.remove(0).toString();
-
- // see if any arglist was provided at all
- if (arg.startsWith("(")) {
- // apparently it was. double check.
- if (!arg.endsWith(")")) {
- throw new JDEException("The argument list seems to be corrupt");
- }
- // trim the parens
- arg = arg.substring(1, arg.length() - 1);
- argumentList = new ArrayList();
- StringTokenizer t = new StringTokenizer(arg, ",");
- while (t.hasMoreTokens()) {
- argumentList.add(t.nextToken());
- }
- }
- }
- EventRequestSpecList eventRequests = proc.getEventRequestSpecs();
- EventRequestSpec er = eventRequests.createMethodBreakpoint(classPattern, method,
argumentList);
- er.setThread(Etc.getThreadFromArgs(args));
- er.setExpression(Etc.getExprFromArgs(args));
- er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
- eventRequests.install(er);
+ // the argument list
+ List argumentList = null;
- jde.signalCommandResult(procID, cmdID, er.getID());
- }
+ // see if more arguments are present
+ if (args.size() > 0) {
- /** A break on a particular line of a class */
- public void doBreakOnLine(List args)
- throws JDEException {
-
- if (args.size() < 2)
- throw new JDEException("Insufficient arguments");
-
- String classPattern = args.remove(0).toString();
- int line = Etc.safeGetint(args.remove(0), "line number");
-
- EventRequestSpecList eventRequests = proc.getEventRequestSpecs();
- EventRequestSpec er =
- eventRequests.createClassLineBreakpoint(classPattern, line);
- er.setThread(Etc.getThreadFromArgs(args));
- er.setExpression(Etc.getExprFromArgs(args));
- er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
- eventRequests.install(er);
-
- jde.signalCommandResult(procID, cmdID, er.getID());
+ String arg = args.remove(0).toString();
+
+ // see if any arglist was provided at all
+ if (arg.startsWith("(")) {
+ // apparently it was. double check.
+ if (!arg.endsWith(")")) {
+ throw new JDEException("The argument list seems to be corrupt");
+ }
+ // trim the parens
+ arg = arg.substring(1, arg.length() - 1);
+ argumentList = new ArrayList();
+ StringTokenizer t = new StringTokenizer(arg, ",");
+ while (t.hasMoreTokens()) {
+ argumentList.add(t.nextToken());
+ }
+ }
}
+ EventRequestSpecList eventRequests = m_debugger.getEventRequestSpecList();
+ EventRequestSpec er = eventRequests.createMethodBreakpoint(classPattern, method,
argumentList);
+ er.setThread(Etc.getThreadFromArgs(args));
+ er.setExpression(Etc.getExprFromArgs(args));
+ er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
+ eventRequests.install(er);
+
+ m_debugger.signalCommandResult(m_cmdID, er.getID().toString(), CMD_OK, NOQUOTE);
+ }
+
+ /** A break on a particular line of a class */
+ public void doBreakOnLine(List args)
+ throws JDEException {
+
+ if (args.size() < 2)
+ throw new JDEException("Insufficient arguments");
+
+ String classPattern = args.remove(0).toString();
+ int line = Etc.safeGetint(args.remove(0), "line number");
+
+ EventRequestSpecList eventRequests = m_debugger.getEventRequestSpecList();
+ EventRequestSpec er =
+ eventRequests.createClassLineBreakpoint(classPattern, line);
+ er.setThread(Etc.getThreadFromArgs(args));
+ er.setExpression(Etc.getExprFromArgs(args));
+ er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
+ eventRequests.install(er);
+
+ m_debugger.signalCommandResult(m_cmdID, er.getID().toString(), CMD_OK, NOQUOTE);
+ }
- /** A break on a line of a given source file */
- public void doBreakAbsolute(List args)
- throws JDEException {
-
- if (args.size() < 2)
- throw new JDEException("Insufficient arguments");
-
- String file = args.remove(0).toString();
- int line = Etc.safeGetint(args.remove(0), "line number");
-
- EventRequestSpecList eventRequests = proc.getEventRequestSpecs();
- EventRequestSpec er =
- eventRequests.createSourceLineBreakpoint(file, line);
- er.setThread(Etc.getThreadFromArgs(args));
- er.setExpression(Etc.getExprFromArgs(args));
- er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
- eventRequests.install(er);
+ /** A break on a line of a given source file */
+ public void doBreakAbsolute(List args)
+ throws JDEException {
+
+ if (args.size() < 2)
+ throw new JDEException("Insufficient arguments");
+
+ String file = args.remove(0).toString();
+ int line = Etc.safeGetint(args.remove(0), "line number");
+
+ JDE.debug(EVENTS, "Doing an absolute break on file <" + file +
">, line: " + line);
+
+ EventRequestSpecList eventRequests = m_debugger.getEventRequestSpecList();
+ EventRequestSpec er =
+ eventRequests.createSourceLineBreakpoint(file, line);
+ er.setThread(Etc.getThreadFromArgs(args));
+ er.setExpression(Etc.getExprFromArgs(args));
+ er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
+ eventRequests.install(er);
- jde.signalCommandResult(procID, cmdID, er.getID());
- }
+ m_debugger.signalCommandResult(m_cmdID, er.getID().toString(), CMD_OK, NOQUOTE);
+ }
public Object clone() {return new Break();}
} // Break
+
/*
* $Log: Break.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:48:39 paulk
* Initial version.
*
1.6 +14 -12
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/CancelTraceClasses.java
Index: CancelTraceClasses.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/CancelTraceClasses.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- CancelTraceClasses.java 2003/01/18 05:48:35 1.5
+++ CancelTraceClasses.java 2006/03/03 20:41:50 1.6
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*/
package jde.debugger.command;
@@ -25,31 +25,33 @@ import jde.debugger.Etc;
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
*/
public class CancelTraceClasses extends DebugProcessCommand {
-
+
/**
*
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 1)
+ if (m_args.size() < 1)
throw new JDEException("Insufficient arguments");
-
- deleteIdentifiableRequest(Etc.safeGetLong
- (args.remove(0), "request ID"));
-
- jde.signalCommandResult(procID, cmdID);
+
+ m_debugger.deleteIdentifiableRequest(Etc.safeGetLong(m_args.remove(0), "request
ID"));
+
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
-
+
public Object clone() {return new CancelTraceClasses();}
-
+
} // CancelTraceClasses
/*
* $Log: CancelTraceClasses.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:48:39 paulk
* Initial version.
*
1.6 +14 -15
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/CancelTraceMethods.java
Index: CancelTraceMethods.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/CancelTraceMethods.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- CancelTraceMethods.java 2003/01/18 05:48:35 1.5
+++ CancelTraceMethods.java 2006/03/03 20:41:50 1.6
@@ -1,10 +1,5 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
+
import jde.debugger.JDEException;
import jde.debugger.Etc;
@@ -23,8 +18,10 @@ import jde.debugger.Etc;
* <li> <u>requestID</u> is returned in the trace methods reply
* </ul>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
*/
public class CancelTraceMethods extends DebugProcessCommand {
@@ -34,21 +31,23 @@ public class CancelTraceMethods extends
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 1)
+ if (m_args.size() < 1)
throw new JDEException("Insufficient arguments");
-
- deleteIdentifiableRequest(Etc.safeGetLong
- (args.remove(0), "request ID"));
-
- jde.signalCommandResult(procID, cmdID);
+
+ m_debugger.deleteIdentifiableRequest(Etc.safeGetLong(m_args.remove(0), "request
ID"));
+
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
-
+
public Object clone() {return new CancelTraceMethods();}
-
+
} // CancelTraceMethods
/*
* $Log: CancelTraceMethods.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:48:39 paulk
* Initial version.
*
1.6 +10 -12
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/CancelTraceThreads.java
Index: CancelTraceThreads.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/CancelTraceThreads.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- CancelTraceThreads.java 2003/01/18 05:48:35 1.5
+++ CancelTraceThreads.java 2006/03/03 20:41:50 1.6
@@ -1,9 +1,3 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
import jde.debugger.JDEException;
import jde.debugger.Etc;
@@ -18,13 +12,15 @@ import jde.debugger.Etc;
* cancel_trace_threads <u>requestID</u>
* </pre>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* <b>Comments:</b>
* <ul>
* <li> <u>requestID</u> is returned in the trace threads reply
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
*/
public class CancelTraceThreads extends DebugProcessCommand {
@@ -34,13 +30,12 @@ public class CancelTraceThreads extends
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 1)
- throw new JDEException("Insufficient arguments");
+ if (m_args.size() < 1)
+ throw new JDEException("Insufficient arguments");
- deleteIdentifiableRequest(Etc.safeGetLong
- (args.remove(0), "request ID"));
+ m_debugger.deleteIdentifiableRequest(Etc.safeGetLong(m_args.remove(0), "request
ID"));
- jde.signalCommandResult(procID, cmdID);
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
@@ -51,6 +46,9 @@ public class CancelTraceThreads extends
/*
* $Log: CancelTraceThreads.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:48:40 paulk
* Initial version.
*
1.6 +14 -13
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Clear.java
Index: Clear.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Clear.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- Clear.java 2003/01/18 05:48:35 1.5
+++ Clear.java 2006/03/03 20:41:50 1.6
@@ -1,15 +1,9 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
+
import jde.debugger.JDEException;
import jde.debugger.Etc;
-
/**
* 'clear' command. Clears a breakpoint, watchpoint or an exception
* intercept
@@ -20,6 +14,8 @@ import jde.debugger.Etc;
* clear specID
* </pre>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* <b>Comments:</b>
* <ul>
* <li> specIDs are returned in the
'break'/'watch'/'trace_exceptions'
@@ -27,7 +23,7 @@ import jde.debugger.Etc;
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
*/
public class Clear extends DebugProcessCommand {
@@ -37,18 +33,23 @@ public class Clear extends DebugProcessC
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 1)
+ if (m_args.size() < 1)
throw new JDEException("Insufficient arguments");
- Long specID = Etc.safeGetLong(args.remove(0), "spec ID");
- proc.getEventRequestSpecs().removeSpec(specID);
- jde.signalCommandResult(procID, cmdID); }
-
+
+ Long specID = Etc.safeGetLong(m_args.remove(0), "spec ID");
+ m_debugger.getEventRequestSpecList().removeSpec(specID);
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
+ }
+
public Object clone() {return new Clear();}
} // Clear
/*
* $Log: Clear.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:48:40 paulk
* Initial version.
*
1.7 +30 -76
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugCommand.java
Index: DebugCommand.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugCommand.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- DebugCommand.java 2003/01/18 05:48:35 1.6
+++ DebugCommand.java 2006/03/03 20:41:50 1.7
@@ -1,17 +1,7 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
import java.util.List;
import jde.debugger.JDEException;
import jde.debugger.Protocol;
-import jde.debugger.Jdebug;
-import jde.debugger.Debug;
-import jde.debugger.JDE;
-import jde.debugger.ProcessRegistry;
/**
@@ -21,88 +11,52 @@ import jde.debugger.ProcessRegistry;
*
* app_id cmd_id cmd_name [arg]*
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
-abstract public class DebugCommand extends Thread
- implements Protocol, Cloneable {
-
- public DebugCommand() {super("JDEbug command");}
-
- public void init(Integer procID, Integer cmdID,
- String cmdName, List args) throws JDEException {
- this.procID = procID;
- this.cmdID = cmdID;
- this.cmdName = cmdName;
- this.args = args;
+abstract public class DebugCommand implements Protocol, Cloneable {
- setName("JDEbug command(" + procID + " " + cmdID + " "
+ cmdName + ")");
+ Integer m_cmdID;
+ String m_cmdName;
+ List m_args;
+ public DebugCommand() { }
+
+ public void init(Integer cmdID, String cmdName, List args) throws JDEException {
+ m_cmdID = cmdID;
+ m_cmdName = cmdName;
+ m_args = args;
}
-
- abstract protected void doCommand() throws JDEException;
-
-
- public void run() {
-
- CommandRegistry commandRegistry = CommandRegistry.getTheRegistry();
- // see if there already is a command with this cmd_id. this
- // should never happen.
- if (commandRegistry.commandExists(cmdID)) {
- jde.signalCommandError(Jdebug.debuggerID,
- Jdebug.debuggerID,
- "Duplicate cmd_id '" + cmdID + "'");
- return;
- }
-
- // if not, add to pending commands.
- commandRegistry.addCommand(cmdID);
+ public Integer getID() {
+ return m_cmdID;
+ }
+ public String toString() {
+ return m_cmdID.toString() + " " + m_cmdName;
+ }
- try {
- doCommand();
- }
- catch (JDEException ex) {
- Debug.printIf(ex);
- // a jde exception was raised. the kind of error is already
- // in there.
- jde.signalCommandError(Jdebug.debuggerID, cmdID, ex.getMessage());
- return;
- }
- catch (Exception ex) {
- Debug.printIf(ex);
- jde.signalCommandError(Jdebug.debuggerID, cmdID, "Unspecified error:
"+ex.toString());
- return;
- }
- finally {
- commandRegistry.removeCommand(cmdID);
+ public boolean equals(Object o) {
+ if (!(o instanceof DebugCommand)) {
+ return false;
}
-
+
+ return m_cmdID.equals(((DebugCommand) o).getID());
}
-
- abstract public Object clone();
-
- Integer procID;
-
- Integer cmdID;
-
- String cmdName;
-
- List args;
-
- protected JDE jde = JDE.getJDE();
-
- protected Jdebug jdebug = Jdebug.getTheDebugger();
-
- protected ProcessRegistry procRegistry = ProcessRegistry.getRegistry();
-
+
+ abstract protected void doCommand() throws JDEException;
+ abstract public Object clone();
} // DebugCommand
/*
* $Log: DebugCommand.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/03/24 05:42:36 paulk
* Updated to reflect reorganization of debugger code.
*
1.8 +52 -52
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugCommandFactory.java
Index: DebugCommandFactory.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugCommandFactory.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- DebugCommandFactory.java 2003/01/18 05:48:35 1.7
+++ DebugCommandFactory.java 2006/03/03 20:41:50 1.8
@@ -1,16 +1,8 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.8 $
- */
-
package jde.debugger.command;
import java.util.HashMap;
import java.util.List;
-import java.lang.InstantiationException;
-import java.lang.ClassNotFoundException;
-import java.lang.IllegalAccessException;
+
import jde.debugger.JDEException;
@@ -21,75 +13,83 @@ import jde.debugger.JDEException;
*
* Created: Fri Jan 28 22:04:57 2000
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.10 $
*/
public class DebugCommandFactory {
-
- protected DebugCommandFactory() {
- prototypes.put("launch", new LaunchApplication());
- prototypes.put("attach_shmem", new AttachShmem());
- prototypes.put("attach_socket", new AttachSocket());
- prototypes.put("listen_shmem", new ListenShmem());
- prototypes.put("listen_socket", new ListenSocket());
- prototypes.put("quit", new Quit());
- prototypes.put("run", new Run());
- prototypes.put("finish", new Finish());
- prototypes.put("get_string", new GetString());
- prototypes.put("get_array", new GetArray());
- prototypes.put("get_locals", new GetLocals());
- prototypes.put("get_this", new GetThis());
- prototypes.put("get_object", new GetObject());
- prototypes.put("get_loaded_classes", new GetLoadedClasses());
- prototypes.put("get_path_information", new GetPathInfo());
- prototypes.put("trace_classes", new TraceClasses());
+ protected DebugCommandFactory() {
+ prototypes.put("attach_shmem", new AttachShmem());
+ prototypes.put("attach_socket", new AttachSocket());
+ prototypes.put("break", new Break());
prototypes.put("cancel_trace_classes", new CancelTraceClasses());
- prototypes.put("trace_exceptions", new TraceExceptions());
- prototypes.put("trace_methods", new TraceMethods());
prototypes.put("cancel_trace_methods", new CancelTraceMethods());
- prototypes.put("evaluate", new EvaluateExpression());
- prototypes.put("watch", new Watch());
- prototypes.put("break", new Break());
- prototypes.put("clear", new Clear());
- prototypes.put("step", new Step());
- prototypes.put("suspend", new Suspend());
- prototypes.put("resume", new Resume());
- prototypes.put("interrupt", new Interrupt());
- prototypes.put("kill_thread", new KillThread());
- prototypes.put("get_threads", new GetThreads());
- prototypes.put("get_thread", new GetThread());
- prototypes.put("get_object_monitors", new GetObjectMonitors());
- prototypes.put("trace_threads", new TraceThreads());
prototypes.put("cancel_trace_threads", new CancelTraceThreads());
- prototypes.put("debug_thread", new DebugThread());
+ prototypes.put("clear", new Clear());
+ prototypes.put("debug_thread", new DebugThread()); // XXX - does
not appear to be implemented on the lisp side
+ prototypes.put("evaluate", new EvaluateExpression());
+ prototypes.put("finish", new Finish());
+ prototypes.put("get_array", new GetArray());
+ prototypes.put("get_loaded_classes", new GetLoadedClasses());
+ prototypes.put("get_locals", new GetLocals());
+ prototypes.put("get_object", new GetObject());
+ prototypes.put("get_object_monitors", new GetObjectMonitors());
+ prototypes.put("get_path_information", new GetPathInfo());
+ prototypes.put("get_string", new GetString());
+ prototypes.put("get_this", new GetThis());
+ prototypes.put("get_thread", new GetThread());
+ prototypes.put("get_threads", new GetThreads());
+ prototypes.put("interrupt", new Interrupt());
+ prototypes.put("kill_thread", new KillThread());
+ prototypes.put("launch", new LaunchApplication());
+ prototypes.put("listen_shmem", new ListenShmem());
+ prototypes.put("listen_socket", new ListenSocket());
+ prototypes.put("quit", new Quit());
+ prototypes.put("resume", new Resume());
+ prototypes.put("run", new Run());
+ prototypes.put("stack_frame", new NullCommand());
+ prototypes.put("step", new Step());
+ prototypes.put("suspend", new Suspend());
+ prototypes.put("trace_classes", new TraceClasses());
+ prototypes.put("trace_exceptions", new TraceExceptions());
+ prototypes.put("trace_methods", new TraceMethods());
+ prototypes.put("trace_threads", new TraceThreads());
+ prototypes.put("watch", new Watch());
}
- public final DebugCommand createCommand(Integer procID, Integer cmdID,
- String cmdName, List args)
- throws JDEException {
+ public final DebugCommand createCommand(Integer cmdID,
+ String cmdName,
+ List args)
+ throws JDEException {
DebugCommand prototype = (DebugCommand) prototypes.get(cmdName);
if (prototype == null) return null;
DebugCommand cmd = (DebugCommand) prototype.clone();
- cmd.init(procID, cmdID, cmdName, args);
-
- return cmd;
+ cmd.init(cmdID, cmdName, args);
+ return cmd;
}
private HashMap prototypes = new HashMap();
-
+
public static DebugCommandFactory theFactory = new DebugCommandFactory();
-
+
} // DebugCommandFactory
/*
* $Log: DebugCommandFactory.java,v $
+ * Revision 1.10 2003/04/29 16:52:09 troy
+ * Initial version of GUI. Includes display of local variables.
+ *
+ * Revision 1.9 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.8 2001/07/06 02:05:51 paulk
* Makefile
*
1.6 +32 -82
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugProcessCommand.java
Index: DebugProcessCommand.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugProcessCommand.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- DebugProcessCommand.java 2003/01/18 05:48:35 1.5
+++ DebugProcessCommand.java 2006/03/03 20:41:50 1.6
@@ -1,19 +1,8 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
import java.util.List;
+
+import jde.debugger.Debugger;
import jde.debugger.JDEException;
-import jde.debugger.Jdebug;
-import jde.debugger.DebuggeeProcess;
-import com.sun.jdi.request.EventRequest;
-import java.util.Map;
-import com.sun.jdi.request.EventRequestManager;
-import java.util.HashMap;
-import java.util.Collections;
/**
@@ -22,87 +11,48 @@ import java.util.Collections;
*
* Created: Fri Jan 28 21:58:06 2000
*
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
abstract public class DebugProcessCommand extends DebugCommand {
-
- public void init(Integer procID, Integer cmdID,
- String cmdName, List args) throws JDEException {
- super.init(procID, cmdID, cmdName, args);
-
- // this app id should be valid.
- if (!procRegistry.processExists(procID))
- throw new JDEException("Application "+ procID + " does not exist");
+ protected Debugger m_debugger = null;
- proc = procRegistry.getProcess(procID);
-
+ public void init(Integer cmdID,
+ String cmdName, List args) throws JDEException {
+ super.init(cmdID, cmdName, args);
}
-
- /**
- * Adds an event request to the above map. Also enables the request.
- *
- * @return an identifier for the request
- */
- protected Long addIdentifiableRequest(EventRequest e) {
- Long id;
- synchronized (identifiableEventRequests) {
- id = proc.generateObjectID();
- identifiableEventRequests.put(id, e);
- }
- e.enable();
- return id;
- }
-
- /**
- * Removes an event request. Also disables/deletes from the vm.
- */
- protected void deleteIdentifiableRequest(Long id)
- throws JDEException {
-
- EventRequestManager erm = proc.getVM().eventRequestManager();
-
- synchronized (identifiableEventRequests) {
- if (!identifiableEventRequests.containsKey(id)) {
- throw new JDEException("Invalid request ID");
- } else {
- Object e = identifiableEventRequests.get(id);
- if (e == null) {
- throw new JDEException("No such event request");
- } else if (e instanceof EventRequest) {
- ((EventRequest)e).disable();
- erm.deleteEventRequest((EventRequest)e);
- } else {
- throw new JDEException("Not an event request");
- }
- }
- }
- }
-
-
- protected DebuggeeProcess proc;
-
- /**
- * This map stores the event requests that are NOT specs. storing
- * it here allows the user to cancel them easily: they just specify the
- * id, that gets reverse-looked up here, uniquely identifying the actual
- * request.
- * <p>
- * Of course, the id is sent back to the user when the actual command is
- * responded to, so that the handle is available to jde in the first
- * place
- */
- protected Map identifiableEventRequests =
- Collections.synchronizedMap(new HashMap());
+
+ /**
+ * Gets the value of debugger
+ *
+ * @return the value of debugger
+ */
+ public Debugger getDebugger() {
+ return this.m_debugger;
+ }
-
-} // DebugApplicationCommand
+ /**
+ * Sets the value of debugger
+ *
+ * @param debugger Value to assign to this.debugger
+ */
+ public void setDebugger(Debugger debugger){
+ this.m_debugger = debugger;
+ }
+
+} // DebugProcessCommand
/*
* $Log: DebugProcessCommand.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/07/06 02:05:51 paulk
* Makefile
*
1.7 +20 -52
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugSessionCommand.java
Index: DebugSessionCommand.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugSessionCommand.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- DebugSessionCommand.java 2003/01/18 05:48:35 1.6
+++ DebugSessionCommand.java 2006/03/03 20:41:50 1.7
@@ -1,18 +1,10 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.4 $
- */
-
package jde.debugger.command;
+
import java.util.List;
-import jde.debugger.JDEException;
+
import jde.debugger.Etc;
-import jde.debugger.Jdebug;
-import com.sun.jdi.connect.Connector;
-import com.sun.jdi.Bootstrap;
-import java.util.Iterator;
-import jde.debugger.ProcessRegistry;
+import jde.debugger.JDEException;
+import jde.debugger.JDEbug;
/**
@@ -22,69 +14,45 @@ import jde.debugger.ProcessRegistry;
* Created: Fri Jan 28 21:59:32 2000
*
* @author Paul Kinnucan
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
abstract public class DebugSessionCommand extends DebugCommand {
-
+ /**
+ * The process (debugger process) ID that this command is
+ * targeted at.
+ */
+ protected Integer m_targetProcessID;
+
public DebugSessionCommand() { }
- public void init(Integer debuggerID, Integer cmdID,
- String cmdName, List args) throws JDEException {
+ public void init(Integer cmdID, String cmdName, List args) throws JDEException {
- super.init(debuggerID, cmdID, cmdName, args);
+ super.init(cmdID, cmdName, args);
if (cmdName.equals("quit")) return;
if (args.size() < 1 )
throw new JDEException("Missing application ID");
-
+
// the app id with which it will be known.
// note that we remove the arguments as we consume them from the
// list.
- procID = new Integer(Etc.safeGetint(args.remove(0), "application ID"));
-
+ m_targetProcessID = new Integer(Etc.safeGetint(args.remove(0), "target process
ID"));
+
// the app id cannot be same as the debugger ID (-1)
- if (procID.equals(Jdebug.debuggerID)) {
+ if (m_targetProcessID.equals(JDEbug.debuggerID)) {
throw new JDEException("Invalid Application ID");
}
-
- // an app using this id is already present!
- // XXX make sure you dispose the id once done with the app
-
- if (procRegistry.processExists(procID)) {
- throw new JDEException("Application ID is duplicate");
- }
-
-
}
-
- /*
- * Gets a connector.
- *
- * @param type connector class name
- *
- */
- protected final Connector getConnector(String name) {
-
- Iterator iter = connectors.iterator();
- while (iter.hasNext()) {
- Connector connector = (Connector)iter.next();
- if (connector.name().equals(name)) {
- return connector;
- }
- }
- return null;
- }
-
- static List connectors = Bootstrap.virtualMachineManager().allConnectors();
-
-
} // DebugSessionCommand
/*
* $Log: DebugSessionCommand.java,v $
+ * Revision 1.5 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.4 2001/03/24 05:42:36 paulk
* Updated to reflect reorganization of debugger code.
*
1.4 +50 -58
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugThread.java
Index: DebugThread.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/DebugThread.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- DebugThread.java 2003/01/18 05:48:35 1.3
+++ DebugThread.java 2006/03/03 20:41:50 1.4
@@ -1,24 +1,12 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
+import com.sun.jdi.IncompatibleThreadStateException;
+import com.sun.jdi.ThreadReference;
import jde.debugger.Etc;
-import com.sun.jdi.ObjectReference;
+import jde.debugger.JDEException;
import jde.debugger.Rep;
-import com.sun.jdi.ThreadReference;
-import com.sun.jdi.StackFrame;
-import com.sun.jdi.IncompatibleThreadStateException;
-import com.sun.jdi.ObjectCollectedException;
-import jde.debugger.LispForm;
-import com.sun.jdi.AbsentInformationException;
-import com.sun.jdi.NativeMethodException;
-import jde.debugger.command.DebugProcessCommand;
+import jde.debugger.JDE;
@@ -31,60 +19,64 @@ import jde.debugger.command.DebugProcess
* debug_thread threadID
* </pre>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Raffael Herzog
* @author Paul Kinnucan
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class DebugThread extends DebugProcessCommand {
-
- /**
- *
- * @exception jde.debugger.JDEException <description>
- */
- public void doCommand() throws JDEException {
-
- if (args.size() < 1)
- throw new JDEException("Insufficient arguments");
-
- // find the thread to debug
- Long uniqueID = Etc.safeGetLong(args.remove(0), "thread ID");
-
- ThreadReference tRef = (ThreadReference) proc.getStore().get(uniqueID);
+
+ /**
+ *
+ * @exception jde.debugger.JDEException <description>
+ */
+ public void doCommand() throws JDEException {
+
+ if (m_args.size() < 1)
+ throw new JDEException("Insufficient arguments");
+
+ // find the thread to debug
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "thread ID");
+
+ ThreadReference tRef = (ThreadReference) m_debugger.getStore().get(uniqueID);
- // it should exist
- if (tRef == null) {
- throw new JDEException("Invalid thread ID or the thread is dead");
- }
-
- // suspend the whole vm
- proc.getVM().suspend();
-
- // simulate a step event
- try {
- final LispForm locationRep = Rep.getLocationRep(tRef.frame(0).location());
- final LispForm lispForm = new LispForm("(list '"
- +EVENT_STEP_COMPLETED
- +" "+locationRep
- +")");
-
- jde.signal(procID, EVENTSET,
- new LispForm("\"thread\" " +
- Rep.getThreadRep(tRef,
- proc.getStore()) + BR + lispForm));
- jde.signalCommandResult(procID, cmdID);
- }
- catch ( IncompatibleThreadStateException exc ) {
- // this should never happen...
- throw new JDEException(exc.toString());
- }
+ // it should exist
+ if (tRef == null) {
+ throw new JDEException("Invalid thread ID or the thread is dead");
}
+
+ // suspend the whole vm
+ m_debugger.getVM().suspend();
+
+ // simulate a step event
+ try {
+ final String locationRep = Rep.getLocationRep(tRef.frame(0).location());
+ final String lispForm = "(list '"
+ +EVENT_STEP_COMPLETED
+ +" "+locationRep
+ +")";
+
+ JDE.signal(m_debugger.getProcID(), EVENTSET,
+ "\"thread\" " +
+ Rep.getThreadRep(tRef) + BR + lispForm);
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
+ }
+ catch ( IncompatibleThreadStateException exc ) {
+ // this should never happen...
+ throw new JDEException(exc.toString());
+ }
+ }
- public Object clone() {return new DebugThread();}
+ public Object clone() {return new DebugThread();}
} // DebugThread
/*
* $Log: DebugThread.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/07/07 04:51:35 paulk
* Removed DOS line endings.
*
1.8 +87 -88
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/EvaluateExpression.java
Index: EvaluateExpression.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/EvaluateExpression.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- EvaluateExpression.java 2003/01/18 05:48:35 1.7
+++ EvaluateExpression.java 2006/03/03 20:41:50 1.8
@@ -1,108 +1,104 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
-import com.sun.jdi.AbsentInformationException;
import com.sun.jdi.IncompatibleThreadStateException;
-import com.sun.jdi.NativeMethodException;
import com.sun.jdi.ObjectCollectedException;
-import com.sun.jdi.ObjectReference;
import com.sun.jdi.StackFrame;
import com.sun.jdi.ThreadReference;
import com.sun.jdi.Value;
import jde.debugger.Etc;
import jde.debugger.JDEException;
-import jde.debugger.LispForm;
import jde.debugger.Rep;
- /**
- * 'evaluate' command.
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * evaluate threadID stackFrameIndex "expression"
- * </pre>
- *
- * <b>Returns:</b>
- * <pre>
- * (jde-dbo-command-result cmd_id {@link Rep#getValueRep(Value, ObjectStore) value})
- * </pre>
- *
- * <b>Comments:</b>
- * <ul>
- * <li> Note that stackFrameIndex = 0 corresponds to the
- * current stackframe.
- * <li> The threadID and stackFrameIndex can be got from the
- * 'get_threads' command. Note that many evaluations
- * might not be possible depending on the state of the thread
- * </ul>
- */
- public class EvaluateExpression extends DebugProcessCommand {
-
+/**
+ * 'evaluate' command.
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * evaluate threadID stackFrameIndex "expression"
+ * </pre>
+ *
+ * <b>Returns:</b>
+ * <pre>
+ * (jde-dbo-command-result cmd_id {@link Rep#getValueRep(Value) value})
+ * </pre>
+ *
+ * <b>Comments:</b>
+ * <ul>
+ * <li> Note that stackFrameIndex = 0 corresponds to the
+ * current stackframe.
+ * <li> The threadID and stackFrameIndex can be got from the
+ * 'get_threads' command. Note that many evaluations
+ * might not be possible depending on the state of the thread
+ * </ul>
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
+ * @author Paul Kinnucan
+ * @version $Revision: 1.3 $
+ *
+ */
+public class EvaluateExpression extends DebugProcessCommand {
+
/**
*
* @exception jde.debugger.JDEException <description>
*/
- public void doCommand() throws JDEException {
+ public void doCommand() throws JDEException {
- // we'll suspend the thread later on, but wanna resume it later
- // so keep track.
- boolean weSuspendedThread = false;
-
- if (args.size() < 3)
- throw new JDEException("Insufficient arguments");
-
- ThreadReference tRef = null;
-
- try {
-
- // need a valid thread to work in...
- Long uniqueID = Etc.safeGetLong(args.remove(0), "thread ID");
- int frameIndex = Etc.safeGetint(args.remove(0), "frame index");
-
- Object oRef = proc.getStore().get(uniqueID);
- if (oRef == null) {
- throw new JDEException("No such thread exists");
- } else if (!(oRef instanceof ThreadReference)) {
- throw new JDEException("Object is not a thread");
- }
-
- tRef = (ThreadReference)oRef;
-
- // suspend it on our own so that nothing funny happens during
- // the time we're trying to do expression evaluation
- tRef.suspend();
- weSuspendedThread = true;
-
- StackFrame frame = null;
- try {
- frame = tRef.frame(frameIndex);
- } catch (IncompatibleThreadStateException ex) {
- throw new JDEException("Thread is not suspended");
- } catch (IndexOutOfBoundsException ex) {
- throw new JDEException("Invalid frame");
- } catch (ObjectCollectedException ex) {
- throw new JDEException("The frame has already been garbage collected");
- }
- if (frame == null) {
- throw new JDEException("Error ascertaining frame");
- }
-
- String expr = args.remove(0).toString();
- Value val = Etc.evaluate(expr, frame);
-
- jde.signalCommandResult(procID, cmdID, Rep.getValueRep(val, proc.getStore()));
-
- } finally {
- if (weSuspendedThread && (tRef != null)) tRef.resume();
- }
+ // we'll suspend the thread later on, but wanna resume it later
+ // so keep track.
+ boolean weSuspendedThread = false;
+
+ if (m_args.size() < 3)
+ throw new JDEException("Insufficient arguments");
+
+ ThreadReference tRef = null;
+
+ try {
+
+ // need a valid thread to work in...
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "thread ID");
+ int frameIndex = Etc.safeGetint(m_args.remove(0), "frame index");
+ Object oRef = m_debugger.getStore().get(uniqueID);
+
+ if (oRef == null) {
+ throw new JDEException("No such thread exists");
+ } else if (!(oRef instanceof ThreadReference)) {
+ throw new JDEException("Object is not a thread");
+ }
+
+ tRef = (ThreadReference) oRef;
+
+ // suspend it on our own so that nothing funny happens during
+ // the time we're trying to do expression evaluation
+ tRef.suspend();
+ weSuspendedThread = true;
+
+ StackFrame frame = null;
+ try {
+ frame = tRef.frame(frameIndex);
+ } catch (IncompatibleThreadStateException ex) {
+ throw new JDEException("Thread is not suspended");
+ } catch (IndexOutOfBoundsException ex) {
+ throw new JDEException("Invalid frame");
+ } catch (ObjectCollectedException ex) {
+ throw new JDEException("The frame has already been garbage
collected");
+ }
+ if (frame == null) {
+ throw new JDEException("Error ascertaining frame");
+ }
+
+ String expr = m_args.remove(0).toString();
+ Value val = Etc.evaluate(expr, frame);
+
+ m_debugger.signalCommandResult(m_cmdID, Rep.getValueRep(val), CMD_OK, NOQUOTE);
+
+ } finally {
+ if (weSuspendedThread && (tRef != null)) tRef.resume();
+ }
- }
+ }
public Object clone() {return new EvaluateExpression();}
@@ -110,6 +106,9 @@ import jde.debugger.Rep;
/*
* $Log: EvaluateExpression.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/03/24 05:42:36 paulk
* Updated to reflect reorganization of debugger code.
*
1.6 +22 -14
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Finish.java
Index: Finish.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Finish.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- Finish.java 2003/01/18 05:48:35 1.5
+++ Finish.java 2006/03/03 20:41:50 1.6
@@ -1,16 +1,19 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
+
import jde.debugger.JDEException;
+import jde.debugger.SessionManager;
+import jde.debugger.JDE;
/**
- * 'finish' command.
+ * 'finish' command.
* <p>
+ * The way this is implemented, the finishing of a process is done in two
+ * steps: first, the debugger is told to stop running the VM handling
+ * the debuggee process. When the VM stops executing, it sends a VMDisconnected
+ * event, which means that the debugger shuts itself down properly. The Finish
+ * command handles only the first step, telling the debugger to stop executing
+ * the debuggee VM.
*
* <b>Syntax:</b>
* <pre>
@@ -24,26 +27,31 @@ import jde.debugger.JDEException;
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
*/
public class Finish extends DebugProcessCommand {
-
+
/**
- *
+ *
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- proc.shutdown();
- jde.signalCommandResult(procID, cmdID);
+ m_debugger.stopExecution();
+ JDE.commandResult(m_cmdID, "Shutting down process", CMD_OK, QUOTE);
}
-
+
public Object clone() {return new Finish();}
-
+
} // Finish
/*
* $Log: Finish.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:52:12 paulk
* Initial version.
*
1.7 +60 -21
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetArray.java
Index: GetArray.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetArray.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- GetArray.java 2003/01/18 05:48:35 1.6
+++ GetArray.java 2006/03/03 20:41:51 1.7
@@ -1,15 +1,15 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.Etc;
+
+import java.util.Iterator;
+import java.util.List;
+
+import com.sun.jdi.ArrayReference;
import com.sun.jdi.ObjectReference;
+import com.sun.jdi.Value;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
+import jde.debugger.JDE;
import jde.debugger.Rep;
-import com.sun.jdi.ArrayReference;
/**
* 'get_array' command. Information about a given array, and,
@@ -23,12 +23,16 @@ import com.sun.jdi.ArrayReference;
*
* <b>Returns:</b>
* <pre>
- * (jde-dbo-command-result cmd_id {@link Rep#getArrayRep(ArrayReference, ObjectStore,
int, int) array})
+ * (jde-dbo-command-result cmd_id {@link Rep#getArrayRep(ArrayReference, String) array})
* </pre>
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class GetArray extends DebugProcessCommand {
+ private static final int MAX_DISPLAY_ELEMENTS = 30;
/**
*
@@ -36,11 +40,11 @@ public class GetArray extends DebugProce
*/
public void doCommand() throws JDEException {
- if (args.size() < 1)
+ if (m_args.size() < 1)
throw new JDEException("Insufficient arguments");
- Long uniqueID = Etc.safeGetLong(args.remove(0), "object ID");
- ObjectReference oRef = proc.getStore().get(uniqueID);
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "object ID");
+ ObjectReference oRef = m_debugger.getStore().get(uniqueID);
if (oRef == null) {
throw new JDEException("No such object exists");
@@ -48,13 +52,45 @@ public class GetArray extends DebugProce
throw new JDEException("Object is not an array");
}
- if (args.size() == 0) {
- jde.signalCommandResult(procID, cmdID, Rep.getArrayRep((ArrayReference)oRef,
proc.getStore(), -1, -1));
- } else if (args.size() == 2) {
- int index = Etc.safeGetint(args.remove(0), "index");
- int length = Etc.safeGetint(args.remove(0), "length");
- jde.signalCommandResult(procID, cmdID, Rep.getArrayRep((ArrayReference)oRef,
- proc.getStore(), index, length));
+ // Keep track of this array for later reference.
+ m_debugger.getStore().put(oRef);
+
+ if (m_args.size() == 0) {
+ m_debugger.signalCommandResult(m_cmdID,
+ Rep.getArrayRep((ArrayReference)oRef,
""),
+ CMD_OK, NOQUOTE);
+ } else if (m_args.size() == 2) {
+ StringBuffer elements = new StringBuffer();
+
+ int index = Etc.safeGetint(m_args.remove(0), "index");
+ int length = Etc.safeGetint(m_args.remove(0), "length");
+
+ List elementList = ((ArrayReference) oRef).getValues(index, length);
+ Iterator it = elementList.iterator();
+ int numElements = 0;
+
+ while (it.hasNext() && numElements < MAX_DISPLAY_ELEMENTS) {
+ numElements++;
+ Value value = (Value) it.next();
+
+ // store the fields in this object that themselves are objects in the
+ // ObjectStore, since the user may query for more information about those.
+ if (value instanceof ObjectReference) {
+ m_debugger.getStore().put((ObjectReference) value);
+ }
+
+ elements.append(" ");
+ elements.append(Rep.getValueRep(value));
+ }
+
+ if (it.hasNext()) {
+ JDE.debug(EVENTS, "did not list all elements");
+ // XXX - should be a way to indicate to the debugger that there are more elts.
+ }
+
+ m_debugger.signalCommandResult(m_cmdID,
+ Rep.getArrayRep((ArrayReference)oRef,
elements.toString()),
+ CMD_OK, NOQUOTE);
} else {
throw new JDEException("Syntax error: Wrong number of arguments");
}
@@ -67,6 +103,9 @@ public class GetArray extends DebugProce
/*
* $Log: GetArray.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/03/24 05:42:36 paulk
* Updated to reflect reorganization of debugger code.
*
1.6 +27 -24
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetLoadedClasses.java
Index: GetLoadedClasses.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetLoadedClasses.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- GetLoadedClasses.java 2003/01/18 05:48:35 1.5
+++ GetLoadedClasses.java 2006/03/03 20:41:51 1.6
@@ -1,14 +1,8 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import com.sun.jdi.ReferenceType;
-import jde.debugger.LispForm;
+
import java.util.Iterator;
+import com.sun.jdi.ReferenceType;
+import jde.debugger.JDEException;
/**
@@ -25,32 +19,41 @@ import java.util.Iterator;
* (jde-dbo-command-result cmd_id (list ["type-name"]*))
* </pre>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
*/
public class GetLoadedClasses extends DebugProcessCommand {
- /**
- *
- * @exception jde.debugger.JDEException <description>
- */
- public void doCommand() throws JDEException {
- String typeNames = "(list";
- Iterator it = proc.getVM().allClasses().iterator();
- while (it.hasNext()) {
- typeNames += "
\""+((ReferenceType)it.next()).name()+"\"";
- }
- typeNames += ")";
- jde.signalCommandResult(procID, cmdID, new LispForm(typeNames));
- }
+ /**
+ *
+ * @exception jde.debugger.JDEException <description>
+ */
+ public void doCommand() throws JDEException {
+ StringBuffer typeNames = new StringBuffer("(list");
+
+ Iterator it = m_debugger.getVM().allClasses().iterator();
+ while (it.hasNext()) {
+ typeNames.append(" \"");
+ typeNames.append(((ReferenceType)it.next()).name());
+ typeNames.append("\"");
+ }
+ typeNames.append(")");
- public Object clone() {return new GetLoadedClasses();}
+ m_debugger.signalCommandResult(m_cmdID, typeNames.toString(), CMD_OK, NOQUOTE);
+ }
+
+ public Object clone() {return new GetLoadedClasses();}
} // GetLoadedClasses
/*
* $Log: GetLoadedClasses.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:52:13 paulk
* Initial version.
*
1.8 +99 -77
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetLocals.java
Index: GetLocals.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetLocals.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- GetLocals.java 2003/01/18 05:48:35 1.7
+++ GetLocals.java 2006/03/03 20:41:51 1.8
@@ -1,21 +1,20 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.3 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.Etc;
-import com.sun.jdi.ObjectReference;
-import jde.debugger.Rep;
-import com.sun.jdi.ThreadReference;
-import com.sun.jdi.StackFrame;
-import com.sun.jdi.IncompatibleThreadStateException;
-import com.sun.jdi.ObjectCollectedException;
-import jde.debugger.LispForm;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
import com.sun.jdi.AbsentInformationException;
+import com.sun.jdi.IncompatibleThreadStateException;
import com.sun.jdi.NativeMethodException;
+import com.sun.jdi.ObjectCollectedException;
+import com.sun.jdi.ObjectReference;
+import com.sun.jdi.StackFrame;
+import com.sun.jdi.ThreadReference;
+import com.sun.jdi.Value;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
+import jde.debugger.Rep;
@@ -30,7 +29,7 @@ import com.sun.jdi.NativeMethodException
*
* <b>Returns:</b>
* <pre>
- * (jde-dbo-command-result cmd_id {@link Rep#getLocalVariableValueMapRep(Map,
ObjectStore) local-variables-values})
+ * (jde-dbo-command-result cmd_id {@link Rep#getLocalVariableValueMapRep(Map)
local-variables-values})
* </pre>
*
* <b>Comments:</b>
@@ -42,83 +41,106 @@ import com.sun.jdi.NativeMethodException
* might not be possible depending on the state of the thread
* </ul>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Amit Kumar
* @author Paul Kinnucan
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.5 $
*/
- public class GetLocals extends DebugProcessCommand {
-
+public class GetLocals extends DebugProcessCommand {
+
/**
*
* @exception jde.debugger.JDEException <description>
*/
- public void doCommand() throws JDEException {
+ public void doCommand() throws JDEException {
+
+ boolean weSuspendedThread = false;
+ ThreadReference tRef = null;
- boolean weSuspendedThread = false;
- ThreadReference tRef = null;
+ if (m_args.size() != 2)
+ throw new JDEException("Insufficient arguments");
- if (args.size() != 2)
- throw new JDEException("Insufficient arguments");
+ try {
+
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "thread ID");
+ int frameIndex = Etc.safeGetint(m_args.remove(0), "frame index");
+
+ Object oRef = m_debugger.getStore().get(uniqueID);
+ if (oRef == null) {
+ throw new JDEException("No such thread exists");
+ } else if (!(oRef instanceof ThreadReference)) {
+ throw new JDEException("Object is not a thread");
+ }
+
+ tRef = (ThreadReference)oRef;
+
+ if (!tRef.isSuspended()) {
+ tRef.suspend();
+ weSuspendedThread = true;
+ }
+
+ StackFrame frame = null;
+ try {
+ frame = tRef.frame(frameIndex);
+ } catch (IncompatibleThreadStateException ex) {
+ throw new JDEException("Thread is not suspended");
+ } catch (IndexOutOfBoundsException ex) {
+ throw new JDEException("Invalid frame");
+ } catch (ObjectCollectedException ex) {
+ throw new JDEException("The frame has already been garbage
collected");
+ }
+
+ if (frame == null) {
+ throw new JDEException("Error ascertaining frame");
+ }
+
+ String resultString = null;
+
+ try {
+ List visibleVariables = frame.visibleVariables();
+ Map localVariableValues = frame.getValues(visibleVariables);
+
+ // make sure that we keep track of objects, since the user may query
+ // for more information about those.
+ Iterator iter = localVariableValues.values().iterator();
+ while (iter.hasNext()) {
+ Value value = (Value) iter.next();
+
+ if (value instanceof ObjectReference) {
+ m_debugger.getStore().put((ObjectReference) value);
+ }
+ }
+
+ // finally, produce the string to report back to emacs
+ resultString = Rep.getLocalVariableValueMapRep(localVariableValues);
+ } catch (AbsentInformationException ex) {
+ throw new JDEException("Local variable information not available: compile
with -g");
+ } catch (NativeMethodException ex) {
+ throw new JDEException("Can't access local variables in native
methods");
+ }
+
+ // send the command result without adding quotes
+ m_debugger.signalCommandResult(m_cmdID, resultString, CMD_OK, NOQUOTE);
+
+ } finally {
+ if (weSuspendedThread && (tRef != null)) tRef.resume();
+ }
- try {
-
- Long uniqueID = Etc.safeGetLong(args.remove(0), "thread ID");
- int frameIndex = Etc.safeGetint(args.remove(0), "frame index");
-
- Object oRef = proc.getStore().get(uniqueID);
- if (oRef == null) {
- throw new JDEException("No such thread exists");
- } else if (!(oRef instanceof ThreadReference)) {
- throw new JDEException("Object is not a thread");
- }
-
- tRef = (ThreadReference)oRef;
-
- if (!tRef.isSuspended()) {
- tRef.suspend();
- weSuspendedThread = true;
- }
-
- StackFrame frame = null;
- try {
- frame = tRef.frame(frameIndex);
- } catch (IncompatibleThreadStateException ex) {
- throw new JDEException("Thread is not suspended");
- } catch (IndexOutOfBoundsException ex) {
- throw new JDEException("Invalid frame");
- } catch (ObjectCollectedException ex) {
- throw new JDEException("The frame has already been garbage collected");
- }
-
- if (frame == null) {
- throw new JDEException("Error ascertaining frame");
- }
-
- LispForm localVariableValues = null;
- try {
- localVariableValues =
- Rep.getLocalVariableValueMapRep(frame.getValues(frame.visibleVariables()),
- proc.getStore());
- } catch (AbsentInformationException ex) {
- throw new JDEException("Local variable information not available: compile with
-g");
- } catch (NativeMethodException ex) {
- throw new JDEException("Can't access local variables in native
methods");
- }
-
- jde.signalCommandResult(procID, cmdID, localVariableValues);
-
- } finally {
- if (weSuspendedThread && (tRef != null)) tRef.resume();
- }
-
- }
+ }
public Object clone() {return new GetLocals();}
-
+
} // GetLocals
/*
* $Log: GetLocals.java,v $
+ * Revision 1.5 2003/04/29 16:52:10 troy
+ * Initial version of GUI. Includes display of local variables.
+ *
+ * Revision 1.4 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.3 2001/03/24 05:42:36 paulk
* Updated to reflect reorganization of debugger code.
*
1.6 +41 -19
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetObject.java
Index: GetObject.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetObject.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- GetObject.java 2003/01/18 05:48:35 1.5
+++ GetObject.java 2006/03/03 20:41:51 1.6
@@ -1,13 +1,12 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.Etc;
+
+import java.util.Iterator;
+import java.util.Map;
+
import com.sun.jdi.ObjectReference;
+import com.sun.jdi.Value;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
import jde.debugger.Rep;
@@ -22,39 +21,62 @@ import jde.debugger.Rep;
*
* <b>Returns:</b>
* <pre>
- * (jde-dbo-command-result cmd_id {@link Rep#getObjectRep(ObjectReference, ObjectStore)
detailed-object-info})
+ * (jde-dbo-command-result cmd_id {@link Rep#getObjectRep(ObjectReference)
detailed-object-info})
* </pre>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.3 $
*
*/
public class GetObject extends DebugProcessCommand {
-
+
/**
*
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
-
- if (args.size() < 1)
+
+ if (m_args.size() < 1)
throw new JDEException("Insufficient arguments");
- Long uniqueID = Etc.safeGetLong(args.remove(0), "object ID");
- ObjectReference oRef = proc.getStore().get(uniqueID);
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "object ID");
+ ObjectReference oRef = m_debugger.getStore().get(uniqueID);
- if (oRef == null)
+ if (oRef == null)
throw new JDEException("No such object exists");
- jde.signalCommandResult(procID, cmdID, Rep.getObjectRep(oRef, proc.getStore(),
true));
- }
+ // store the fields in this object that themselves are objects in the
+ // ObjectStore, since the user may query for more information about those.
+ Map fieldValues = oRef.getValues(oRef.referenceType().visibleFields());
+
+ Iterator iter = fieldValues.values().iterator();
+ while (iter.hasNext()) {
+ Value value = (Value) iter.next();
+
+ if (value instanceof ObjectReference) {
+ m_debugger.getStore().put((ObjectReference) value);
+ }
+ }
+
+ m_debugger.signalCommandResult(m_cmdID,
+ Rep.getObjectRep(oRef, true),
+ CMD_OK);
+ }
public Object clone() {return new GetObject();}
-
+
} // GetObject
/*
* $Log: GetObject.java,v $
+ * Revision 1.3 2003/04/29 16:52:10 troy
+ * Initial version of GUI. Includes display of local variables.
+ *
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:52:13 paulk
* Initial version.
*
1.6 +18 -22
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetObjectMonitors.java
Index: GetObjectMonitors.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetObjectMonitors.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- GetObjectMonitors.java 2003/01/18 05:48:35 1.5
+++ GetObjectMonitors.java 2006/03/03 20:41:51 1.6
@@ -1,16 +1,8 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.Etc;
import com.sun.jdi.ObjectReference;
-import com.sun.jdi.ThreadReference;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
import jde.debugger.Rep;
-import jde.debugger.ObjectStore;
/**
@@ -26,40 +18,44 @@ import jde.debugger.ObjectStore;
* <b>Returns:</b>
* <pre>
* (jde-dbo-command-result cmd_id
- * {@link Rep#getObjectMonitorsRep(ObjectReference, ObjectStore)
object-monitors-info})
+ * {@link Rep#getObjectMonitorsRep(ObjectReference) object-monitors-info})
* </pre>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
*/
public class GetObjectMonitors extends DebugProcessCommand {
-
+
/**
*
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() != 1)
+ if (m_args.size() != 1)
throw new JDEException("Insufficient arguments");
- Long uniqueID = Etc.safeGetLong(args.remove(0), "object ID");
- ObjectStore store = proc.getStore();
- ObjectReference oRef = store.get(uniqueID);
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "object ID");
+ ObjectReference oRef = m_debugger.getStore().get(uniqueID);
if (oRef == null)
throw new JDEException("No such object exists");
-
- jde.signalCommandResult(procID, cmdID, Rep.getObjectMonitorsRep(oRef,store));
+
+ m_debugger.signalCommandResult(m_cmdID, Rep.getObjectMonitorsRep(oRef), CMD_OK,
NOQUOTE);
}
-
-
-
+
+
+
public Object clone() {return new GetObjectMonitors();}
} // GetObjectMonitors
/*
* $Log: GetObjectMonitors.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:52:14 paulk
* Initial version.
*
1.6 +36 -34
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetPathInfo.java
Index: GetPathInfo.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetPathInfo.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- GetPathInfo.java 2003/01/18 05:48:35 1.5
+++ GetPathInfo.java 2006/03/03 20:41:51 1.6
@@ -1,14 +1,9 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import com.sun.jdi.PathSearchingVirtualMachine;
+
import java.util.Iterator;
-import jde.debugger.LispForm;
+
+import com.sun.jdi.PathSearchingVirtualMachine;
+import jde.debugger.JDEException;
@@ -28,55 +23,62 @@ import jde.debugger.LispForm;
* (jde-dbo-command-result cmd_id "base-directory" (list [boot-class-path
component]*) (list [class-path component]*))
* </pre>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
*/
public class GetPathInfo extends DebugProcessCommand {
-
+
/**
*
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (!(proc.getVM() instanceof PathSearchingVirtualMachine))
+ if (!(m_debugger.getVM() instanceof PathSearchingVirtualMachine))
throw new JDEException("VM doesn't search paths");
-
+
PathSearchingVirtualMachine vm =
- (PathSearchingVirtualMachine)proc.getVM();
-
- String bootClassPathString = "(list";
+ (PathSearchingVirtualMachine) m_debugger.getVM();
+
+ StringBuffer bootClassPathString = new StringBuffer("(list");
Iterator it = vm.bootClassPath().iterator();
while (it.hasNext()) {
- bootClassPathString += " \""+it.next()+"\"";
+ bootClassPathString.append(" \"");
+ bootClassPathString.append(it.next());
+ bootClassPathString.append("\"");
}
- bootClassPathString += ")";
-
- bootClassPathString = bootClassPathString.replace('\\', '/');
-
- String classPathString = "(list";
+ bootClassPathString.append(")");
+
+ String bcpRes = bootClassPathString.toString().replace('\\', '/');
+
+ StringBuffer classPathString = new StringBuffer("(list");
it = vm.classPath().iterator();
while (it.hasNext()) {
- classPathString += " \""+it.next()+"\"";
+ classPathString.append(" \"");
+ classPathString.append(it.next());
+ classPathString.append("\"");
}
- classPathString += ")";
-
- classPathString = classPathString.replace('\\', '/');
-
- jde.signalCommandResult(procID, cmdID,
- new LispForm("\""+vm.baseDirectory().replace('\\',
'/')+"\""
- + BR +bootClassPathString
- + BR +classPathString));
+ classPathString.append(")");
+
+ String cpRes = classPathString.toString().replace('\\', '/');
+
+ m_debugger.signalCommandResult(m_cmdID,
+
"\""+vm.baseDirectory().replace('\\',
'/')+"\""
+ + BR +bootClassPathString
+ + BR +classPathString, CMD_OK, NOQUOTE);
}
-
- public Object clone() {return new Finish();}
-
+
+ public Object clone() {return new GetPathInfo();}
} // GetPathInfo
/*
* $Log: GetPathInfo.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:52:14 paulk
* Initial version.
*
1.7 +25 -26
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetString.java
Index: GetString.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetString.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- GetString.java 2003/01/18 05:48:35 1.6
+++ GetString.java 2006/03/03 20:41:51 1.7
@@ -1,14 +1,9 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.Etc;
+
import com.sun.jdi.ObjectReference;
import com.sun.jdi.StringReference;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
import jde.debugger.Rep;
@@ -24,42 +19,46 @@ import jde.debugger.Rep;
*
* <b>Returns:</b>
* <pre>
- * (jde-dbo-command-result cmd_id {@link Rep#getStringRep(StringReference, ObjectStore)
string-representation})
+ * (jde-dbo-command-result cmd_id {@link Rep#getStringRep(StringReference)
string-representation})
* </pre>
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
- public class GetString extends DebugProcessCommand {
+public class GetString extends DebugProcessCommand {
/**
*
* @exception jde.debugger.JDEException <description>
*/
- public void doCommand() throws JDEException {
+ public void doCommand() throws JDEException {
- if (args.size() < 1)
- throw new JDEException("Insufficient arguments");
+ if (m_args.size() < 1)
+ throw new JDEException("Insufficient arguments");
- Long uniqueID = Etc.safeGetLong(args.remove(0), "object ID");
- ObjectReference oRef = proc.getStore().get(uniqueID);
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "object ID");
+ ObjectReference oRef = m_debugger.getStore().get(uniqueID);
- if (oRef == null) {
- throw new JDEException("No such object exists");
- } else if (!(oRef instanceof StringReference)) {
- throw new JDEException("Object is not a string");
- }
-
- jde.signalCommandResult(procID, cmdID, Rep.getStringRep((StringReference)oRef,
- proc.getStore()));
- }
-
+ if (oRef == null) {
+ throw new JDEException("No such object exists");
+ } else if (!(oRef instanceof StringReference)) {
+ throw new JDEException("Object is not a string");
+ }
+
+ m_debugger.signalCommandResult(m_cmdID, Rep.getStringRep((StringReference)oRef),
CMD_OK, NOQUOTE);
+ }
+
public Object clone() {return new GetString();}
} // Run
/*
* $Log: GetString.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/03/24 05:42:36 paulk
* Updated to reflect reorganization of debugger code.
*
1.8 +98 -73
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetThis.java
Index: GetThis.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetThis.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- GetThis.java 2003/01/18 05:48:35 1.7
+++ GetThis.java 2006/03/03 20:41:51 1.8
@@ -1,22 +1,17 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.3 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.Etc;
-import com.sun.jdi.ObjectReference;
-import jde.debugger.Rep;
-import com.sun.jdi.ThreadReference;
-import com.sun.jdi.StackFrame;
+import java.util.Iterator;
+import java.util.Map;
+
import com.sun.jdi.IncompatibleThreadStateException;
-import com.sun.jdi.ObjectCollectedException;
-import jde.debugger.LispForm;
-import com.sun.jdi.AbsentInformationException;
-import com.sun.jdi.NativeMethodException;
import com.sun.jdi.InvalidStackFrameException;
+import com.sun.jdi.ObjectCollectedException;
+import com.sun.jdi.ObjectReference;
+import com.sun.jdi.StackFrame;
+import com.sun.jdi.ThreadReference;
+import com.sun.jdi.Value;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
+import jde.debugger.Rep;
@@ -31,7 +26,7 @@ import com.sun.jdi.InvalidStackFrameExce
*
* <b>Returns:</b>
* <pre>
- * (jde-dbo-command-result cmd_id {@link Rep#getObjectRep(ObjectReference, ObjectStore)
detailed-object-info})
+ * (jde-dbo-command-result cmd_id {@link Rep#getObjectRep(ObjectReference)
detailed-object-info})
* </pre>
*
* <b>Comments:</b>
@@ -42,72 +37,99 @@ import com.sun.jdi.InvalidStackFrameExce
* 'get_threads' command.
* </ul>
*
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*/
- public class GetThis extends DebugProcessCommand {
+public class GetThis extends DebugProcessCommand {
/**
*
* @exception jde.debugger.JDEException <description>
*/
- public void doCommand() throws JDEException {
-
- boolean weSuspendedThread = false;
- ThreadReference tRef = null;
-
- if (args.size() != 2)
- throw new JDEException("Insufficient arguments");
-
- try {
-
- Long uniqueID = Etc.safeGetLong(args.remove(0), "thread ID");
- int frameIndex = Etc.safeGetint(args.remove(0), "frame index");
+ public void doCommand() throws JDEException {
+
+ boolean weSuspendedThread = false;
+ ThreadReference tRef = null;
+
+ if (m_args.size() != 2)
+ throw new JDEException("Insufficient arguments");
+
+ try {
+
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "thread ID");
+ int frameIndex = Etc.safeGetint(m_args.remove(0), "frame index");
+ Object oRef = m_debugger.getStore().get(uniqueID);
- Object oRef = proc.getStore().get(uniqueID);
- if (oRef == null) {
- throw new JDEException("No such thread exists");
- } else if (!(oRef instanceof ThreadReference)) {
- throw new JDEException("Object is not a thread");
- }
+ if (oRef == null) {
+ throw new JDEException("No such thread exists");
+ } else if (!(oRef instanceof ThreadReference)) {
+ throw new JDEException("Object is not a thread");
+ }
- tRef = (ThreadReference)oRef;
-
- if (!tRef.isSuspended()) {
- tRef.suspend();
- weSuspendedThread = true;
- }
-
-
- StackFrame frame = null;
- try {
- frame = tRef.frame(frameIndex);
- } catch (IncompatibleThreadStateException ex) {
- throw new JDEException("Thread is not suspended");
- } catch (IndexOutOfBoundsException ex) {
- throw new JDEException("Invalid frame");
- } catch (ObjectCollectedException ex) {
- throw new JDEException("The frame has already been garbage collected");
- }
-
- if (frame == null) {
- throw new JDEException("Error ascertaining frame");
- }
-
- ObjectReference thisObj = null;
- try {
- thisObj = frame.thisObject();
- } catch (InvalidStackFrameException ex) {
- throw new JDEException("Invalid stack frame.");
- }
-
- jde.signalCommandResult(procID, cmdID, Rep.getObjectRep(thisObj, proc.getStore(),
true));
-
- } finally {
- if (weSuspendedThread && (tRef != null)) tRef.resume();
- }
+ tRef = (ThreadReference) oRef;
+
+ if (!tRef.isSuspended()) {
+ tRef.suspend();
+ weSuspendedThread = true;
+ }
+
+ StackFrame frame = null;
+ try {
+ frame = tRef.frame(frameIndex);
+ } catch (IncompatibleThreadStateException ex) {
+ throw new JDEException("Thread is not suspended");
+ } catch (IndexOutOfBoundsException ex) {
+ throw new JDEException("Invalid frame");
+ } catch (ObjectCollectedException ex) {
+ throw new JDEException("The frame has already been garbage
collected");
+ }
+
+ if (frame == null) {
+ throw new JDEException("Error ascertaining frame");
+ }
+
+ ObjectReference thisObj = null;
+ try {
+ thisObj = frame.thisObject();
+ } catch (InvalidStackFrameException ex) {
+ throw new JDEException("Invalid stack frame.");
+ }
+
+ if (thisObj != null) {
+ // Keep track of this object, for future reference from the UI
+ m_debugger.getStore().put(thisObj);
+
+ // store the fields in this object that themselves are objects in the
+ // ObjectStore, since the user may query for more information about those.
+ Map fieldValues = thisObj.getValues(thisObj.referenceType().visibleFields());
+
+ Iterator iter = fieldValues.values().iterator();
+ while (iter.hasNext()) {
+ Value value = (Value) iter.next();
+
+ if (value instanceof ObjectReference) {
+ ObjectReference obj = (ObjectReference) value;
+
+ // Debug.printIf(Debug.EVENTS, "storing field with ID: " +
obj.uniqueID() +
+ // " of type: " + obj.referenceType().name());
+ m_debugger.getStore().put((ObjectReference) value);
+ }
+ }
+
+ // XXX - report 'this' to the GUI
+ }
+
+ m_debugger.signalCommandResult(m_cmdID,
+ Rep.getObjectRep(thisObj, true),
+ CMD_OK);
+
+ } finally {
+ if (weSuspendedThread && (tRef != null)) tRef.resume();
+ }
- }
+ }
public Object clone() {return new GetThis();}
@@ -115,6 +137,9 @@ import com.sun.jdi.InvalidStackFrameExce
/*
* $Log: GetThis.java,v $
+ * Revision 1.4 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.3 2001/03/24 05:42:36 paulk
* Updated to reflect reorganization of debugger code.
*
1.6 +23 -24
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetThread.java
Index: GetThread.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetThread.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- GetThread.java 2003/01/18 05:48:35 1.5
+++ GetThread.java 2006/03/03 20:41:51 1.6
@@ -1,14 +1,9 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.Etc;
+
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ThreadReference;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
import jde.debugger.Rep;
@@ -24,7 +19,7 @@ import jde.debugger.Rep;
* <b>Returns:</b>
* <pre>
* (jde-dbo-command-result cmd_id
- * {@link Rep#getThreadRep(ThreadReference, ObjectStore, boolean)
detailed-thread-info})
+ * {@link Rep#getThreadRep(ThreadReference, boolean) detailed-thread-info})
* </pre>
*
* <b>Comments:</b>
@@ -36,41 +31,45 @@ import jde.debugger.Rep;
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
*/
public class GetThread extends DebugProcessCommand {
-
+
/**
*
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 1)
+ if (m_args.size() < 1)
throw new JDEException("Insufficient arguments");
-
- Long uniqueID = Etc.safeGetLong(args.remove(0), "thread ID");
- ObjectReference tRef = proc.getStore().get(uniqueID);
-
+
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "thread ID");
+ ObjectReference tRef = m_debugger.getStore().get(uniqueID);
+
if (tRef == null) {
throw new JDEException("No such thread exists");
} else if (!(tRef instanceof ThreadReference)) {
throw new JDEException("No such thread exists (anymore?)");
}
-
- jde.signalCommandResult(procID, cmdID,
- Rep.getThreadRep((ThreadReference)tRef,
- proc.getStore(), true));
+
+ m_debugger.signalCommandResult(m_cmdID,
+ Rep.getThreadRep((ThreadReference)tRef, true),
+ CMD_OK, NOQUOTE);
}
-
-
-
+
+
+
public Object clone() {return new GetThread();}
-
+
} // GetThread
/*
* $Log: GetThread.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 05:52:14 paulk
* Initial version.
*
1.6 +69 -9
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetThreads.java
Index: GetThreads.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GetThreads.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- GetThreads.java 2003/01/18 05:48:35 1.5
+++ GetThreads.java 2006/03/03 20:41:51 1.6
@@ -1,11 +1,10 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
+
import jde.debugger.JDEException;
+import com.sun.jdi.ThreadGroupReference;
+import jde.debugger.Rep;
+import java.util.Iterator;
+import java.util.List;
/**
@@ -19,7 +18,7 @@ import jde.debugger.JDEException;
*
* <b>Returns:</b>
* <pre>
- * (jde-dbo-command-result cmd_id {@link #getAllThreadsInformation thread-info})
+ * (jde-dbo-command-result cmd_id {@link #doCommand thread-info})
* </pre>
*
* <b>Comments:</b>
@@ -47,17 +46,75 @@ import jde.debugger.JDEException;
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
*/
public class GetThreads extends DebugProcessCommand {
/**
+ * Returns a representation of all the threads and threadgroups
+ * in the VM. For example:
+ * <pre>
+ * ThreadGroup-1
+ * +- ThreadGroup-2
+ * | +- ThreadGroup-3
+ * | | \- Thread-1
+ * | +- ThreadGroup-4
+ * | | +- Thread-2
+ * | | \- Thread-3
+ * | \- Thread-4
+ * \- Thread-5
+ * ThreadGroup-5
+ * +- Thread-6
+ *
*
+ * (list
+ * (list "ThreadGroup" <tgID> "ThreadGroup-1"
+ * (list
+ * (list "Thread" <tID> "Thread-5" ...))
+ * (list
+ * (list "ThreadGroup" <tgID> "ThreadGroup-2"
+ * (list
+ * (list "Thread" <tID> "Thread-4"))
+ * (list
+ * (list "ThreadGroup" <tgID>
"ThreadGroup-3"
+ * (list)
+ * (list
+ * (list "Thread" <tID> "Thread-1"
...)))
+ * (list "ThreadGroup" <tgID>
"ThreadGroup-4"
+ * (list)
+ * (list
+ * (list "Thread" <tID> "Thread-2"
...)
+ * (list "Thread" <tID> "Thread-3"
...)))))))
+ * (list "ThreadGroup" <tgID> "ThreadGroup-5"
+ * (list)
+ * (list
+ * (list "Thread" <tID> "Thread-6" ...))))
+ * </pre>
+ * <b>Syntax:</b>
+ * <pre>
+ * (list [{@link Rep#getThreadGroupRep top-level thread group}]*)
+ * </pre>
+ *
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- jde.signalCommandResult(procID, cmdID, proc.getAllThreadsInformation());
+
+ List l = m_debugger.getVM().topLevelThreadGroups();
+ Iterator it = l.iterator();
+ StringBuffer result = new StringBuffer("(list ");
+
+ while (it.hasNext()) {
+ // XXX may have to populate the ObjectStore here.
+
+ result.append(BR);
+ result.append(Rep.getThreadGroupRep((ThreadGroupReference)it.next()));
+ }
+
+ result.append(")");
+
+ m_debugger.signalCommandResult(m_cmdID, result.toString(), CMD_OK, NOQUOTE);
}
@@ -68,6 +125,9 @@ public class GetThreads extends DebugPro
/*
* $Log: GetThreads.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:25 paulk
* Initial revision.
*
1.6 +19 -19
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Interrupt.java
Index: Interrupt.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Interrupt.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- Interrupt.java 2003/01/18 05:48:35 1.5
+++ Interrupt.java 2006/03/03 20:41:51 1.6
@@ -1,16 +1,12 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
+
import java.util.Iterator;
-import jde.debugger.Etc;
+
import com.sun.jdi.ObjectReference;
-import com.sun.jdi.ThreadReference;
import com.sun.jdi.ThreadGroupReference;
+import com.sun.jdi.ThreadReference;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
/**
@@ -29,7 +25,8 @@ import com.sun.jdi.ThreadGroupReference;
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
*/
public class Interrupt extends DebugProcessCommand {
@@ -39,23 +36,23 @@ public class Interrupt extends DebugProc
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 1)
+ if (m_args.size() < 1)
throw new JDEException("Insufficient arguments");
-
- Iterator it = args.iterator();
+
+ Iterator it = m_args.iterator();
while (it.hasNext()) {
Long uniqueID = Etc.safeGetLong(it.next(), "thread ID");
-
- ObjectReference oRef = (ObjectReference)proc.getStore().get(uniqueID);
+
+ ObjectReference oRef = (ObjectReference) m_debugger.getStore().get(uniqueID);
if (oRef == null) {
- throw new JDEException("Invalid ThreadID, or the thread is dead");
+ throw new JDEException("Invalid ThreadID, or the thread is dead");
} else if (oRef instanceof ThreadReference) {
- ((ThreadReference)oRef).interrupt();
+ ((ThreadReference) oRef).interrupt();
} else {
- throw new JDEException("The object is not a thread");
+ throw new JDEException("The object is not a thread");
}
}
- jde.signalCommandResult(procID, cmdID);
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
public Object clone() {return new Interrupt();}
@@ -64,6 +61,9 @@ public class Interrupt extends DebugProc
/*
* $Log: Interrupt.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:25 paulk
* Initial revision.
*
1.6 +24 -24
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/KillThread.java
Index: KillThread.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/KillThread.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- KillThread.java 2003/01/18 05:48:35 1.5
+++ KillThread.java 2006/03/03 20:41:51 1.6
@@ -1,17 +1,13 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
+
import java.util.Iterator;
-import jde.debugger.Etc;
+
+import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.ObjectReference;
-import com.sun.jdi.ThreadReference;
import com.sun.jdi.ThreadGroupReference;
-import com.sun.jdi.InvalidTypeException;
+import com.sun.jdi.ThreadReference;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
/**
@@ -32,7 +28,8 @@ import com.sun.jdi.InvalidTypeException;
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
*/
public class KillThread extends DebugProcessCommand {
@@ -42,40 +39,43 @@ public class KillThread extends DebugPro
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 2)
+ if (m_args.size() < 2)
throw new JDEException("Insufficient arguments");
- Long uniqueID = Etc.safeGetLong(args.remove(0), "thread ID");
-
- ObjectReference oRef = proc.getStore().get(uniqueID);
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "thread ID");
+
+ ObjectReference oRef = m_debugger.getStore().get(uniqueID);
if (oRef == null) {
throw new JDEException("No such thread exists");
} else if (!(oRef instanceof ThreadReference)) {
throw new JDEException("The ID doesn't correspond to a thread");
}
- ThreadReference tRef = (ThreadReference)oRef;
-
- uniqueID = Etc.safeGetLong(args.remove(0), "thread ID");
-
- oRef = proc.getStore().get(uniqueID);
+ ThreadReference tRef = (ThreadReference) oRef;
+
+ uniqueID = Etc.safeGetLong(m_args.remove(0), "thread ID");
+
+ oRef = m_debugger.getStore().get(uniqueID);
if (oRef == null) {
throw new JDEException("No such thread exists");
}
-
+
try {
tRef.stop(oRef);
} catch (InvalidTypeException ex) {
throw new JDEException("Object ID doesn't correspond to a Throwable
object");
}
- jde.signalCommandResult(procID, cmdID);
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
-
+
public Object clone() {return new KillThread();}
-
+
} // KillThread
/*
* $Log: KillThread.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:25 paulk
* Initial revision.
*
1.7 +18 -128
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/LaunchApplication.java
Index: LaunchApplication.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/LaunchApplication.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- LaunchApplication.java 2003/01/18 05:48:35 1.6
+++ LaunchApplication.java 2006/03/03 20:41:51 1.7
@@ -1,24 +1,8 @@
-/*
- * Copyright (c) 2000, 2001, 2002 Paul Kinnucan
- *
- * $Revision: 1.7 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import com.sun.jdi.connect.LaunchingConnector;
-import java.util.Map;
-import com.sun.jdi.connect.Connector;
-import java.util.Iterator;
-import com.sun.jdi.VirtualMachine;
-import java.io.IOException;
-import com.sun.jdi.connect.IllegalConnectorArgumentsException;
-import com.sun.jdi.connect.VMStartException;
-import jde.debugger.DebuggeeProcess;
-import jde.debugger.Jdebug;
-import jde.debugger.Debug;
-import jde.debugger.DebuggeeSIO;
+import jde.debugger.Debugger;
+import jde.debugger.JDEException;
+import jde.debugger.SessionManager;
/**
@@ -31,7 +15,8 @@ import jde.debugger.DebuggeeSIO;
* </pre>
*
* @author Paul Kinnucan
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*/
public class LaunchApplication extends DebugSessionCommand {
@@ -40,118 +25,20 @@ public class LaunchApplication extends D
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
-
- // this is the connector that launches a debuggee vm
- String connectSpec = "com.sun.jdi.CommandLineLaunch";
-
- // check if this kind of connector is, indeed,
- // available. if not, throw an exception.
- LaunchingConnector connector = (LaunchingConnector) getConnector(connectSpec);
- if (connector == null)
- throw new JDEException("No such connector is available: "+connectSpec);
-
-
- // first set up the argument map. a table that describes the
- // different keys should be in the public jpda documentation.
- // internally, it is at
- //
http://jbug/jbug/doc/conninv.html
- Map argumentMap = connector.defaultArguments();
+ // XXX - fix the 'true' here, and define a better way to determine
+ // whether to use a GUI or not.
+ Debugger debugger = new Debugger(m_targetProcessID, true);
- Connector.Argument mainArg =
- (Connector.Argument)argumentMap.get("main");
-
- // compose the command line
- String commandLine = "";
- String quote =((Connector.Argument)argumentMap.get("quote")).value();
-
- // check if there are special launch options we need to process
- if (args.size() == 0)
- throw new JDEException("Insufficient arguments");
+ SessionManager.registerDebugger(debugger);
- String executable = "java";
- // be careful with the loop here....
- while ((args.size() >0)
- && args.get(0).toString().startsWith("-")) {
- String origArg = args.remove(0).toString();
- String arg = origArg.toLowerCase();
- if (arg.equals("-vmexec")) {
- if (args.size() == 0)
- throw new JDEException("Missing argument to 'use_executable'");
- executable = args.remove(0).toString();
- Connector.Argument vmexecArg =
- (Connector.Argument)argumentMap.get("vmexec");
- vmexecArg.setValue(executable);
- }
- else if (arg.equals("-home")) {
- if (args.size() == 0)
- throw new JDEException("Missing argument to 'home'");
- String home = args.remove(0).toString();
- Connector.Argument homeArg = (Connector.Argument) argumentMap.get("home");
- homeArg.setValue(home);
- continue;
- }
- else {
- args.add(0, origArg);
- break;
- }
- }
-
- if (args.size() == 0)
- throw new JDEException("Missing arguments: no class specified?");
-
- // take care of spaces too! so quote everything.
- Iterator iterator = args.iterator();
- while(iterator.hasNext()) {
- // commandLine += quote + iterator.next() + quote + " ";
- String arg = (String)iterator.next();
- if (arg.equalsIgnoreCase("-classic")) {
- Connector.Argument optionsArg =
- (Connector.Argument)argumentMap.get("options");
- String options = optionsArg.value();
- options = "-classic" + " " + options;
- optionsArg.setValue(options);
- jde.signal(procID, MESSAGE, "VM options: '" + options +
"'");
- }
- else
- commandLine += quote + arg + quote + " ";
- }
- mainArg.setValue(commandLine);
-
- // signal(DEBUG, "Command line: '"+executable+"
"+commandLine+"'");
-
- VirtualMachine vm = null;
-
try {
- vm = connector.launch(argumentMap);
- jde.signal(procID, MESSAGE, "Launched VM " + vm.description());
- } catch (IOException ex) {
- Debug.printIf(ex);
- throw new JDEException("Unable to launch: " +
ex.toString().replace('\\','/'));
- } catch (IllegalConnectorArgumentsException ex) {
- throw new JDEException("Invalid or inconsistent connector arguments for
connector '"+connector+"'");
- } catch (VMStartException ex) {
- // dumpFailedAppStreams(ex.process());
- throw new
JDEException(ex.getMessage().toString().replace('\\','/'));
+ debugger.launchVM(m_cmdID, m_args);
+ debugger.start();
}
-
- // note that new debuggee process might raise a jdeexception.
- DebuggeeProcess proc = new DebuggeeProcess(procID, vm);
-
- if (procRegistry.processExists(procID)) {
- proc.shutdown();
- throw new JDEException("An application with the same ID exists.");
- }
-
- procRegistry.addProcess(procID, proc);
-
- DebuggeeSIO procSIO = proc.getSIO();
-
- // Create a socket for connecting the application's standard I/O
- // to Emacs and a thread that waits for Emacs to connect to the socket.
- int port = procSIO.initConnect(cmdID);
-
- // Tell Emacs the number of the standard I/O socket.
- // jde.signalCommandResult(procID, cmdID, new Integer(port));
+ catch (JDEException e) {
+ SessionManager.deregisterDebugger(debugger);
+ throw e;
+ }
}
public Object clone() {return new LaunchApplication();}
@@ -161,6 +48,9 @@ public class LaunchApplication extends D
/*
* $Log: LaunchApplication.java,v $
+ * Revision 1.8 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.7 2002/10/11 05:41:06 paulk
* Fixed bug where the debuggee application launcher was downcasing the first vm command
line argument. Thanks toEric W Brown <ewb(a)us.ibm.com> for this fix.
*
1.7 +20 -78
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/ListenShmem.java
Index: ListenShmem.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/ListenShmem.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- ListenShmem.java 2003/01/18 05:48:35 1.6
+++ ListenShmem.java 2006/03/03 20:41:52 1.7
@@ -1,20 +1,8 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.3 $
- */
-
package jde.debugger.command;
+
import jde.debugger.JDEException;
-import com.sun.jdi.connect.ListeningConnector;
-import java.util.Map;
-import com.sun.jdi.connect.Connector;
-import jde.debugger.Jdebug;
-import com.sun.jdi.VirtualMachine;
-import jde.debugger.DebuggeeProcess;
-import java.io.IOException;
-import jde.debugger.Debug;
-import com.sun.jdi.connect.IllegalConnectorArgumentsException;
+import jde.debugger.SessionManager;
+import jde.debugger.Debugger;
/**
@@ -28,83 +16,37 @@ import com.sun.jdi.connect.IllegalConnec
* </pre>
*
* @author Paul Kinnucan
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*/
public class ListenShmem extends DebugSessionCommand {
protected void doCommand() throws JDEException {
+ // XXX - fix the 'true' here, and define a better way to determine
+ // whether to use a GUI or not.
+ Debugger debugger = new Debugger(m_targetProcessID, true);
- if (args.size() < 1)
+ if (m_args.size() < 1)
throw new JDEException("Missing name");
-
- final String address = args.remove(0).toString();
-
- String connectSpec = "com.sun.jdi.SharedMemoryListen";
-
- final ListeningConnector connector = (ListeningConnector) getConnector(connectSpec);
-
- if (connector == null)
- throw new JDEException("No such connector is available: "+connectSpec);
- Thread thread = new Thread("Listen on shared memory channel.") {
-
- public void run() {
-
- try {
- Map argumentMap = connector.defaultArguments();
-
- Connector.Argument nameArg =
- (Connector.Argument)argumentMap.get("name");
- nameArg.setValue(address);
-
- jde.signalCommandResult(procID, cmdID);
- jde.signal(procID, MESSAGE,
- "Listening at shared memory address: " + address);
- connector.startListening(argumentMap);
- VirtualMachine vm = connector.accept(argumentMap);
- connector.stopListening(argumentMap);
-
- // note that new App might raise a jdeexception.
- DebuggeeProcess proc = new DebuggeeProcess(procID, vm);
-
-
- if (procRegistry.processExists(procID)) {
- proc.shutdown();
- jde.signal(procID, MESSAGE, "An application with the same ID already
exists.");
- }
-
- procRegistry.addProcess(procID, proc);
-
-
-
- jde.signal(procID, MESSAGE, "Attached VM (shmem) " + vm.description());
-
-
- } catch (IOException ex) {
- Debug.printIf(ex);
- jde.signal(procID, MESSAGE,
- "I/O error occured while listening at shared memory address:"
- + address);
- } catch (IllegalConnectorArgumentsException ex) {
- jde.signal(procID, MESSAGE,
- "Illegal argument error occurred while listening " +
- "at shared memory address: " + address);
- }
-
- }
- };
-
- thread.start();
-
- }
+ final String address = m_args.remove(0).toString();
+
+ SessionManager.registerDebugger(debugger);
+ debugger.listenShmem(address);
+
+ debugger.signalCommandResult(m_cmdID, null, CMD_OK);
+ }
public Object clone() {return new ListenShmem();}
-
+
} // ListenShmem
/*
* $Log: ListenShmem.java,v $
+ * Revision 1.4 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.3 2001/03/24 05:42:37 paulk
* Updated to reflect reorganization of debugger code.
*
1.7 +19 -72
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/ListenSocket.java
Index: ListenSocket.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/ListenSocket.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- ListenSocket.java 2003/01/18 05:48:35 1.6
+++ ListenSocket.java 2006/03/03 20:41:52 1.7
@@ -1,20 +1,7 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
import jde.debugger.JDEException;
-import com.sun.jdi.connect.ListeningConnector;
-import java.util.Map;
-import com.sun.jdi.connect.Connector;
-import com.sun.jdi.VirtualMachine;
-import jde.debugger.DebuggeeProcess;
-import com.sun.jdi.connect.IllegalConnectorArgumentsException;
-import jde.debugger.Jdebug;
-import java.io.IOException;
-import jde.debugger.Debug;
+import jde.debugger.Debugger;
+import jde.debugger.SessionManager;
/**
@@ -28,82 +15,42 @@ import jde.debugger.Debug;
* </pre>
*
* @author Paul Kinnucan
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*/
public class ListenSocket extends DebugSessionCommand {
public ListenSocket() {
-
}
-
+
protected void doCommand() throws JDEException {
+ // XXX - fix the 'true' here, and define a better way to determine
+ // whether to use a GUI or not.
+ Debugger debugger = new Debugger(m_targetProcessID, true);
- if (args.size() < 1)
+ if (m_args.size() < 1)
throw new JDEException("Missing name");
-
- final String address = args.remove(0).toString();
-
- String connectSpec = "com.sun.jdi.SocketListen";
-
- final ListeningConnector connector = (ListeningConnector) getConnector(connectSpec);
-
- if (connector == null)
- throw new JDEException("No such connector is available: "+connectSpec);
- Thread thread = new Thread("Listen on socket.") {
-
- public void run() {
- try {
-
- Map argumentMap = connector.defaultArguments();
-
- Connector.Argument portArg =
- (Connector.Argument)argumentMap.get("port");
- portArg.setValue(address);
-
- jde.signalCommandResult(procID, cmdID);
- jde.signal(procID, MESSAGE, "Listening at socket address: " + address);
- connector.startListening(argumentMap);
- VirtualMachine vm = connector.accept(argumentMap);
- connector.stopListening(argumentMap);
-
- // note that new process might raise a jdeexception.
- DebuggeeProcess proc = new DebuggeeProcess(procID, vm);
-
-
- if (procRegistry.processExists(procID)) {
- proc.shutdown();
- jde.signal(procID, MESSAGE, "Error: An application with the same ID
exists.");
- }
-
- procRegistry.addProcess(procID, proc);
+ final String address = m_args.remove(0).toString();
-
- jde.signal(procID, MESSAGE, "Attached VM (socket) " + vm.description());
-
-
- } catch (IOException ex) {
- Debug.printIf(ex);
- jde.signal(procID, MESSAGE, "Error occured listening on socket.");
- } catch(IllegalConnectorArgumentsException ex) {
- jde.signal(procID, MESSAGE,
- "Illegal connector arguments for connector '"+connector);
- }
- }
- };
-
- thread.start();
+ SessionManager.registerDebugger(debugger);
+ debugger.listenSocket(address);
+
+ debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
-
+
public Object clone() {return new ListenSocket();}
-
+
} // ListenSocket
/*
* $Log: ListenSocket.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/03/24 05:42:37 paulk
* Updated to reflect reorganization of debugger code.
*
1.7 +25 -18
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Quit.java
Index: Quit.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Quit.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- Quit.java 2003/01/18 05:48:35 1.6
+++ Quit.java 2006/03/03 20:41:53 1.7
@@ -1,12 +1,8 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
import jde.debugger.JDEException;
-import jde.debugger.Jdebug;
+import jde.debugger.JDEbug;
+import jde.debugger.SessionManager;
+import jde.debugger.JDE;
/**
@@ -19,27 +15,38 @@ import jde.debugger.Jdebug;
* </pre>
*
* @author Paul Kinnucan
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*/
public class Quit extends DebugSessionCommand {
-
+
protected void doCommand() throws JDEException {
- try {
- procRegistry.shutdownProcesses();
- } catch (Exception ex) {
- // do nothing
- }
- jde.signalCommandResult(Jdebug.debuggerID, cmdID);
+ JDE.debug(EVENTS, "shutting down debugger");
+ SessionManager.shutdown();
+
+ JDE.commandResult(m_cmdID, null, CMD_OK);
+ JDEbug.theDebugger.shutdown();
+
+ // XXX Petter:
+ // I would very much prefer not doing a System.exit() here, since
+ // that has a tendency to hide threading problems, locked threads, etc.
+ // But the main thread is normally blocked in CommandStream.nextToken(),
+ // and I know that there is/was a bug in the AWT thread management as
+ // well, meaning that they can only be terminated by exiting the whole
+ // process.
System.exit(0);
- }
-
+ }
+
public Object clone() {return new Quit();}
-
+
} // Quit
/*
* $Log: Quit.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/03/24 05:42:37 paulk
* Updated to reflect reorganization of debugger code.
*
1.6 +32 -27
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Resume.java
Index: Resume.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Resume.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- Resume.java 2003/01/18 05:48:35 1.5
+++ Resume.java 2006/03/03 20:41:53 1.6
@@ -1,16 +1,17 @@
/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*/
package jde.debugger.command;
-import jde.debugger.JDEException;
import java.util.Iterator;
-import jde.debugger.Etc;
+
import com.sun.jdi.ObjectReference;
-import com.sun.jdi.ThreadReference;
import com.sun.jdi.ThreadGroupReference;
+import com.sun.jdi.ThreadReference;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
/**
@@ -30,11 +31,12 @@ import com.sun.jdi.ThreadGroupReference;
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
+ * @copyright Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
*/
public class Resume extends DebugProcessCommand {
-
+
/**
*
* @exception jde.debugger.JDEException <description>
@@ -42,39 +44,42 @@ public class Resume extends DebugProcess
public void doCommand() throws JDEException {
// see if there are arguments (should be the thread id). if so, we
// resume the thread ids passed. else, resume the whole vm.
- if (args.size() > 0) {
- Iterator it = args.iterator();
+ if (m_args.size() > 0) {
+ Iterator it = m_args.iterator();
while (it.hasNext()) {
- Long uniqueID = Etc.safeGetLong(it.next(), "thread(group)");
-
- ObjectReference oRef = (ObjectReference)proc.getStore().get(uniqueID);
- if (oRef == null) {
- throw new JDEException("Invalid ThreadID, or the thread/threadgroup is
dead");
- } else if (oRef instanceof ThreadReference) {
- ((ThreadReference)oRef).resume();
- } else if (oRef instanceof ThreadGroupReference) {
- ((ThreadGroupReference)oRef).resume();
- } else {
- throw new JDEException("The object is not a thread or a threadgroup");
- }
+ Long uniqueID = Etc.safeGetLong(it.next(), "thread(group)");
+
+ ObjectReference oRef = (ObjectReference) m_debugger.getStore().get(uniqueID);
+ if (oRef == null) {
+ throw new JDEException("Invalid ThreadID, or the thread/threadgroup is
dead");
+ } else if (oRef instanceof ThreadReference) {
+ ((ThreadReference)oRef).resume();
+ } else if (oRef instanceof ThreadGroupReference) {
+ ((ThreadGroupReference)oRef).resume();
+ } else {
+ throw new JDEException("The object is not a thread or a
threadgroup");
+ }
}
- jde.signalCommandResult(procID, cmdID);
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
} else {
try {
- proc.getVM().resume();
- jde.signalCommandResult(procID, cmdID);
+ m_debugger.getVM().resume();
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
} catch (Exception ex) {
- throw new JDEException("Unable to resume the application");
+ throw new JDEException("Unable to resume the application");
}
}
}
-
+
public Object clone() {return new Resume();}
-
+
} // Resume
/*
* $Log: Resume.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:25 paulk
* Initial revision.
*
1.7 +12 -12
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Run.java
Index: Run.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Run.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- Run.java 2003/01/18 05:48:35 1.6
+++ Run.java 2006/03/03 20:41:53 1.7
@@ -1,14 +1,10 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
import jde.debugger.JDEException;
/**
+ *
+ *
* Runs an application.
* <p>
*
@@ -18,7 +14,10 @@ import jde.debugger.JDEException;
* </pre>
*
* @author Paul Kinnucan
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
*/
public class Run extends DebugProcessCommand {
@@ -27,14 +26,12 @@ public class Run extends DebugProcessCom
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
-
try {
- proc.getVM().resume();
+ m_debugger.getVM().resume();
} catch (Exception ex) {
- throw new JDEException("Unspecified Error occured: "+ex.toString());
+ throw new JDEException("Unspecified Error occurred: "+ex.toString());
}
- jde.signalCommandResult(procID, cmdID);
-
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
public Object clone() {return new Run();}
@@ -43,6 +40,9 @@ public class Run extends DebugProcessCom
/*
* $Log: Run.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/03/24 05:42:37 paulk
* Updated to reflect reorganization of debugger code.
*
1.7 +36 -37
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Step.java
Index: Step.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Step.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- Step.java 2003/01/18 05:48:35 1.6
+++ Step.java 2006/03/03 20:41:53 1.7
@@ -1,17 +1,12 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.2 $
- */
-
package jde.debugger.command;
-import com.sun.jdi.request.StepRequest;
-import jde.debugger.JDEException;
+import java.util.Iterator;
+import java.util.List;
+
import com.sun.jdi.ThreadReference;
-import jde.debugger.Etc;
import com.sun.jdi.request.EventRequestManager;
-import java.util.List;
-import java.util.Iterator;
+import com.sun.jdi.request.StepRequest;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
@@ -48,8 +43,11 @@ import java.util.Iterator;
* @see jde.debugger.EventHandler#stepEvent(StepEvent)
*
* @author Paul Kinnucan
- * @version $Revision: 1.2 $
-*/
+ * @version $Revision: 1.3 $
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
+ */
public class Step extends DebugProcessCommand {
/**
@@ -58,11 +56,11 @@ public class Step extends DebugProcessCo
*/
public void doCommand() throws JDEException {
- if (args.size() < 2)
+ if (m_args.size() < 2)
throw new JDEException("Insufficient arguments");
// ascertain the kind of step
- String arg = args.remove(0).toString().toLowerCase();
+ String arg = m_args.remove(0).toString().toLowerCase();
int depth;
boolean into_all = false;
if (arg.equals("over")) {
@@ -79,10 +77,10 @@ public class Step extends DebugProcessCo
}
// find the thread on which to step
- Long uniqueID = Etc.safeGetLong(args.remove(0), "thread ID");
-
- ThreadReference tRef = (ThreadReference) proc.getStore().get(uniqueID);
-
+ Long uniqueID = Etc.safeGetLong(m_args.remove(0), "thread ID");
+
+ ThreadReference tRef = (ThreadReference) m_debugger.getStore().get(uniqueID);
+
// it should exist
if (tRef == null) {
throw new JDEException("Invalid thread ID or the thread is dead");
@@ -98,18 +96,18 @@ public class Step extends DebugProcessCo
clearPreviousStep(tRef);
// set a new request!
- EventRequestManager erm = proc.getVM().eventRequestManager();
+ EventRequestManager erm = m_debugger.getVM().eventRequestManager();
StepRequest request =
erm.createStepRequest(tRef, StepRequest.STEP_LINE, depth);
- request.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
+ request.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
if (depth == StepRequest.STEP_INTO)
if (into_all) {
} else {
- request.addClassExclusionFilter("java.*");
- request.addClassExclusionFilter("javax.*");
- request.addClassExclusionFilter("sun.*");
+ request.addClassExclusionFilter("java.*");
+ request.addClassExclusionFilter("javax.*");
+ request.addClassExclusionFilter("sun.*");
}
// a single step event... will set it again if need be.
@@ -117,9 +115,9 @@ public class Step extends DebugProcessCo
request.enable();
// and now resume the vm. the thread suspended is resumed now.
- proc.getVM().resume();
+ m_debugger.getVM().resume();
- jde.signalCommandResult(procID, cmdID);
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
}
@@ -128,17 +126,15 @@ public class Step extends DebugProcessCo
* per thread
*/
private void clearPreviousStep(ThreadReference thread) {
- synchronized (proc) {
- EventRequestManager mgr = proc.getVM().eventRequestManager();
- List requests = mgr.stepRequests();
- Iterator iter = requests.iterator();
- while (iter.hasNext()) {
- StepRequest request = (StepRequest)iter.next();
- ThreadReference requestThread = request.thread();
- if (request.thread().equals(thread)) {
- mgr.deleteEventRequest(request);
- break;
- }
+ EventRequestManager mgr = m_debugger.getVM().eventRequestManager();
+ List requests = mgr.stepRequests();
+ Iterator iter = requests.iterator();
+ while (iter.hasNext()) {
+ StepRequest request = (StepRequest)iter.next();
+ ThreadReference requestThread = request.thread();
+ if (request.thread().equals(thread)) {
+ mgr.deleteEventRequest(request);
+ break;
}
}
}
@@ -149,6 +145,9 @@ public class Step extends DebugProcessCo
/*
* $Log: Step.java,v $
+ * Revision 1.3 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.2 2001/03/24 05:42:37 paulk
* Updated to reflect reorganization of debugger code.
*
1.6 +30 -30
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Suspend.java
Index: Suspend.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Suspend.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- Suspend.java 2003/01/18 05:48:35 1.5
+++ Suspend.java 2006/03/03 20:41:53 1.6
@@ -1,16 +1,11 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
import java.util.Iterator;
-import jde.debugger.Etc;
+
import com.sun.jdi.ObjectReference;
-import com.sun.jdi.ThreadReference;
import com.sun.jdi.ThreadGroupReference;
+import com.sun.jdi.ThreadReference;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
/**
@@ -31,7 +26,9 @@ import com.sun.jdi.ThreadGroupReference;
* </ul>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
*/
public class Suspend extends DebugProcessCommand {
@@ -43,40 +40,43 @@ public class Suspend extends DebugProces
public void doCommand() throws JDEException {
// see if there are arguments (should be the thread id). if so, we
// suspend the thread ids passed. else, suspend the whole vm.
- if (args.size() > 0) {
- Iterator it = args.iterator();
+ if (m_args.size() > 0) {
+ Iterator it = m_args.iterator();
while (it.hasNext()) {
- Long uniqueID = Etc.safeGetLong(it.next(), "thread(group)");
-
- ObjectReference oRef = (ObjectReference)proc.getStore().get(uniqueID);
- if (oRef == null) {
- throw new JDEException("Invalid ThreadID, or the thread/threadgroup is
dead");
- } else if (oRef instanceof ThreadReference) {
- ((ThreadReference)oRef).suspend();
- } else if (oRef instanceof ThreadGroupReference) {
- ((ThreadGroupReference)oRef).suspend();
- } else {
- throw new JDEException("The object is not a thread or a threadgroup");
- }
+ Long uniqueID = Etc.safeGetLong(it.next(), "thread(group)");
+
+ ObjectReference oRef = (ObjectReference) m_debugger.getStore().get(uniqueID);
+ if (oRef == null) {
+ throw new JDEException("Invalid ThreadID, or the thread/threadgroup is
dead");
+ } else if (oRef instanceof ThreadReference) {
+ ((ThreadReference) oRef).suspend();
+ } else if (oRef instanceof ThreadGroupReference) {
+ ((ThreadGroupReference) oRef).suspend();
+ } else {
+ throw new JDEException("The object is not a thread or a
threadgroup");
+ }
}
- jde.signalCommandResult(procID, cmdID);
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
} else {
try {
- proc.getVM().suspend();
- jde.signalCommandResult(procID, cmdID);
+ m_debugger.getVM().suspend();
+ m_debugger.signalCommandResult(m_cmdID, null, CMD_OK);
} catch (Exception ex) {
- throw new JDEException("Unable to suspend the application");
+ throw new JDEException("Unable to suspend the application");
}
}
}
-
+
public Object clone() {return new Suspend();}
-
+
} // Suspend
/*
* $Log: Suspend.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:25 paulk
* Initial revision.
*
1.6 +53 -51
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/TraceClasses.java
Index: TraceClasses.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/TraceClasses.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- TraceClasses.java 2003/01/18 05:48:35 1.5
+++ TraceClasses.java 2006/03/03 20:41:53 1.6
@@ -1,17 +1,12 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
+
+import java.util.Iterator;
import java.util.List;
-import jde.debugger.Etc;
-import com.sun.jdi.request.EventRequestManager;
import com.sun.jdi.request.ClassPrepareRequest;
-import java.util.Iterator;
import com.sun.jdi.request.ClassUnloadRequest;
+import com.sun.jdi.request.EventRequestManager;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
/**
@@ -38,80 +33,87 @@ import com.sun.jdi.request.ClassUnloadRe
* </ul>
*
* <p>
- * @see EventHandler#classPrepareEvent(ClassPrepareEvent)
- * @see EventHandler#classUnloadEvent(ClassUnloadEvent)
+ * @see jde.debugger.EventHandler#classPrepareEvent(ClassPrepareEvent)
+ * @see jde.debugger.EventHandler#classUnloadEvent(ClassUnloadEvent)
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
*/
public class TraceClasses extends DebugProcessCommand {
-
+
/**
*
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 1)
+ if (m_args.size() < 1)
throw new JDEException("Insufficient arguments");
-
- String type = args.remove(0).toString().toLowerCase();
-
+
+ String type = m_args.remove(0).toString().toLowerCase();
+
if (!(type.equals("preparation") || type.equals("unloading")))
throw new JDEException("Invalid type");
-
+
Long requestID = null;
-
- List classFilters = Etc.getClassFiltersFromArgs(args);
- List classExFilters = Etc.getClassExFiltersFromArgs(args);
-
- EventRequestManager em = proc.getVM().eventRequestManager();
-
+
+ List classFilters = Etc.getClassFiltersFromArgs(m_args);
+ List classExFilters = Etc.getClassExFiltersFromArgs(m_args);
+
+ EventRequestManager em = m_debugger.getVM().eventRequestManager();
+
if (type.equals("preparation")) {
-
+
ClassPrepareRequest cpr = em.createClassPrepareRequest();
-
- cpr.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
-
+
+ cpr.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
+
if (classFilters != null) {
- Iterator it = classFilters.iterator();
- while (it.hasNext())
- cpr.addClassFilter(it.next().toString());
+ Iterator it = classFilters.iterator();
+ while (it.hasNext())
+ cpr.addClassFilter(it.next().toString());
}
if (classExFilters != null) {
- Iterator it = classExFilters.iterator();
- while (it.hasNext())
- cpr.addClassExclusionFilter(it.next().toString());
+ Iterator it = classExFilters.iterator();
+ while (it.hasNext())
+ cpr.addClassExclusionFilter(it.next().toString());
}
- requestID = addIdentifiableRequest(cpr);
-
+ requestID = m_debugger.addIdentifiableRequest(cpr);
+
} else if (type.equals("unloading")) {
-
+
ClassUnloadRequest cur = em.createClassUnloadRequest();
-
- cur.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
-
+
+ cur.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
+
if (classFilters != null) {
- Iterator it = classFilters.iterator();
- while (it.hasNext())
- cur.addClassFilter(it.next().toString());
+ Iterator it = classFilters.iterator();
+ while (it.hasNext())
+ cur.addClassFilter(it.next().toString());
}
if (classExFilters != null) {
- Iterator it = classExFilters.iterator();
- while (it.hasNext())
- cur.addClassExclusionFilter(it.next().toString());
+ Iterator it = classExFilters.iterator();
+ while (it.hasNext())
+ cur.addClassExclusionFilter(it.next().toString());
}
- requestID = addIdentifiableRequest(cur);
+ requestID = m_debugger.addIdentifiableRequest(cur);
}
- jde.signalCommandResult(procID, cmdID, requestID);
- }
+
+ m_debugger.signalCommandResult(m_cmdID, requestID.toString(), CMD_OK);
+ }
+
public Object clone() {return new TraceClasses();}
-
+
} // TraceClasses
/*
* $Log: TraceClasses.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:25 paulk
* Initial revision.
*
1.6 +28 -28
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/TraceExceptions.java
Index: TraceExceptions.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/TraceExceptions.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- TraceExceptions.java 2003/01/18 05:48:35 1.5
+++ TraceExceptions.java 2006/03/03 20:41:53 1.6
@@ -1,14 +1,8 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
+import jde.debugger.Etc;
import jde.debugger.JDEException;
-import jde.debugger.spec.EventRequestSpecList;
import jde.debugger.spec.EventRequestSpec;
-import jde.debugger.Etc;
+import jde.debugger.spec.EventRequestSpecList;
@@ -40,7 +34,9 @@ import jde.debugger.Etc;
* <p>
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
*/
public class TraceExceptions extends DebugProcessCommand {
@@ -50,43 +46,47 @@ public class TraceExceptions extends Deb
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 2)
+ if (m_args.size() < 2)
throw new JDEException("Insufficient arguments");
-
- String classPattern = args.remove(0).toString();
- String type = args.remove(0).toString().toLowerCase();
-
- boolean caught = false;
+
+ String classPattern = m_args.remove(0).toString();
+ String type = m_args.remove(0).toString().toLowerCase();
+
+ boolean caught = false;
boolean uncaught = false;
+
if (type.equals("both")) {
- caught = true;
+ caught = true;
uncaught = true;
} else if (type.equals("caught")) {
- caught = true;
+ caught = true;
} else if (type.equals("uncaught")) {
uncaught = true;
} else {
throw new JDEException("'"+type+"' not understood");
}
-
- EventRequestSpecList eventRequests = proc.getEventRequestSpecs();
- EventRequestSpec er = eventRequests.createExceptionIntercept(classPattern, caught,
uncaught);
- er.setThread(Etc.getThreadFromArgs(args));
- er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
- er.setClassFilters(Etc.getClassFiltersFromArgs(args));
- er.setClassExFilters(Etc.getClassExFiltersFromArgs(args));
- eventRequests.install(er);
- jde.signalCommandResult(procID, cmdID, er.getID());
+ EventRequestSpecList eventRequests = m_debugger.getEventRequestSpecList();
+ EventRequestSpec er =
eventRequests.createExceptionIntercept(classPattern, caught, uncaught);
+ er.setThread(Etc.getThreadFromArgs(m_args));
+ er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
+ er.setClassFilters(Etc.getClassFiltersFromArgs(m_args));
+ er.setClassExFilters(Etc.getClassExFiltersFromArgs(m_args));
+ eventRequests.install(er);
+
+ m_debugger.signalCommandResult(m_cmdID, er.getID().toString(), CMD_OK, NOQUOTE);
}
-
+
public Object clone() {return new TraceExceptions();}
-
+
} // TraceExceptions
/*
* $Log: TraceExceptions.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:25 paulk
* Initial revision.
*
1.6 +86 -83
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/TraceMethods.java
Index: TraceMethods.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/TraceMethods.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- TraceMethods.java 2003/01/18 05:48:35 1.5
+++ TraceMethods.java 2006/03/03 20:41:53 1.6
@@ -1,140 +1,143 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.Etc;
+
+import java.util.Iterator;
+import java.util.List;
+
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ThreadReference;
-import java.util.List;
import com.sun.jdi.request.EventRequestManager;
import com.sun.jdi.request.MethodEntryRequest;
-import java.util.Iterator;
import com.sun.jdi.request.MethodExitRequest;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
- /**
- * 'trace_methods' command.
- * <p>
- *
- * <b>Syntax:</b>
- * <pre>
- * trace_methods <u>type</u>
- * [{@link Etc#getThreadFromArgs(List) thread-restriction}]
- * [{@link Etc#getSuspendPolicyFromArgs(List) suspend-policy}]
- * [{@link Etc#getClassFiltersFromArgs(List) class-filters}]
- * [{@link Etc#getClassExFiltersFromArgs(List) class-exclusion-filters}]
- * </pre>
- *
- * <b>Returns:</b>
- * <pre>
- * (jde-dbo-command-result cmd_id <u>requestID</u>)
- * </pre>
- *
- * <b>Comments:</b>
- * <ul>
- * <li> <u>type</u> is either "entry" or
"exit"
- * <li> Use <u>requestID</u> to cancel the trace request.
- * </ul>
- *
- * <p>
- * @see EventHandler#methodEntryEvent(MethodEntryEvent)
- * @see EventHandler#methodExitEvent(MethodExitEvent)
- *
+/**
+ * 'trace_methods' command.
+ * <p>
+ *
+ * <b>Syntax:</b>
+ * <pre>
+ * trace_methods <u>type</u>
+ * [{@link Etc#getThreadFromArgs(List) thread-restriction}]
+ * [{@link Etc#getSuspendPolicyFromArgs(List) suspend-policy}]
+ * [{@link Etc#getClassFiltersFromArgs(List) class-filters}]
+ * [{@link Etc#getClassExFiltersFromArgs(List) class-exclusion-filters}]
+ * </pre>
+ *
+ * <b>Returns:</b>
+ * <pre>
+ * (jde-dbo-command-result cmd_id <u>requestID</u>)
+ * </pre>
+ *
+ * <b>Comments:</b>
+ * <ul>
+ * <li> <u>type</u> is either "entry" or "exit"
+ * <li> Use <u>requestID</u> to cancel the trace request.
+ * </ul>
+ *
+ * <p>
+ * @see jde.debugger.EventHandler#methodEntryEvent(MethodEntryEvent)
+ * @see jde.debugger.EventHandler#methodExitEvent(MethodExitEvent)
+ *
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
+ *
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
*
*/
public class TraceMethods extends DebugProcessCommand {
-
+
/**
*
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 2)
+ if (m_args.size() < 2)
throw new JDEException("Insufficient arguments");
-
- String type = args.remove(0).toString().toLowerCase();
+
+ String type = m_args.remove(0).toString().toLowerCase();
if (!(type.equals("entry") || type.equals("exit")))
throw new JDEException("Invalid type");
+
+ Object thread = Etc.getThreadFromArgs(m_args);
+ ObjectReference tRef = null;
- Object thread = Etc.getThreadFromArgs(args);
- ObjectReference tRef = null;
if (thread == null) {
tRef = null;
} else if (thread instanceof Long) {
- tRef = (ObjectReference)proc.getStore().get(thread);
+ tRef = (ObjectReference) m_debugger.getStore().get(thread);
if (tRef == null) {
- throw new JDEException("No such thread exists");
+ throw new JDEException("No such thread exists");
} else if (!(tRef instanceof ThreadReference)) {
- throw new JDEException("No such thread exists (anymore?)");
+ throw new JDEException("No such thread exists (anymore?)");
}
} else if (thread instanceof String) {
- tRef = proc.getThread(thread.toString());
+ tRef = m_debugger.getThreadReference((String) thread);
}
-
- List classFilters = Etc.getClassFiltersFromArgs(args);
- List classExFilters = Etc.getClassExFiltersFromArgs(args);
-
- Long requestID = null;
- EventRequestManager em = proc.getVM().eventRequestManager();
-
+ List classFilters = Etc.getClassFiltersFromArgs(m_args);
+ List classExFilters = Etc.getClassExFiltersFromArgs(m_args);
+
+ Long requestID = null;
+
+ EventRequestManager em = m_debugger.getVM().eventRequestManager();
+
if (type.equals("entry")) {
-
+
MethodEntryRequest mer = em.createMethodEntryRequest();
-
+
if (tRef != null)
- mer.addThreadFilter((ThreadReference)tRef);
-
- mer.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
-
+ mer.addThreadFilter((ThreadReference) tRef);
+
+ mer.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
+
if (classFilters != null) {
- Iterator it = classFilters.iterator();
- while (it.hasNext())
- mer.addClassFilter(it.next().toString());
+ Iterator it = classFilters.iterator();
+ while (it.hasNext())
+ mer.addClassFilter(it.next().toString());
}
if (classExFilters != null) {
- Iterator it = classExFilters.iterator();
- while (it.hasNext())
- mer.addClassExclusionFilter(it.next().toString());
+ Iterator it = classExFilters.iterator();
+ while (it.hasNext())
+ mer.addClassExclusionFilter(it.next().toString());
}
- requestID = addIdentifiableRequest(mer);
+ requestID = m_debugger.addIdentifiableRequest(mer);
} else if (type.equals("exit")) {
-
+
MethodExitRequest mer = em.createMethodExitRequest();
-
+
if (tRef != null)
- mer.addThreadFilter((ThreadReference)tRef);
+ mer.addThreadFilter((ThreadReference) tRef);
- mer.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
+ mer.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
if (classFilters != null) {
- Iterator it = classFilters.iterator();
- while (it.hasNext())
- mer.addClassFilter(it.next().toString());
+ Iterator it = classFilters.iterator();
+ while (it.hasNext())
+ mer.addClassFilter(it.next().toString());
}
if (classExFilters != null) {
- Iterator it = classExFilters.iterator();
- while (it.hasNext())
- mer.addClassExclusionFilter(it.next().toString());
+ Iterator it = classExFilters.iterator();
+ while (it.hasNext())
+ mer.addClassExclusionFilter(it.next().toString());
}
- requestID = addIdentifiableRequest(mer);
+ requestID = m_debugger.addIdentifiableRequest(mer);
}
- jde.signalCommandResult(procID, cmdID, requestID);
+
+ m_debugger.signalCommandResult(m_cmdID, requestID.toString(), CMD_OK, NOQUOTE);
}
-
+
public Object clone() {return new TraceMethods();}
-
+
} // TraceMethods
/*
* $Log: TraceMethods.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:26 paulk
* Initial revision.
*
1.6 +59 -58
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/TraceThreads.java
Index: TraceThreads.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/TraceThreads.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- TraceThreads.java 2003/01/18 05:48:35 1.5
+++ TraceThreads.java 2006/03/03 20:41:53 1.6
@@ -1,20 +1,15 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.Etc;
+
+import java.util.List;
+
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ThreadReference;
-import jde.debugger.Rep;
-import jde.debugger.ObjectStore;
-import java.util.List;
import com.sun.jdi.request.EventRequestManager;
-import com.sun.jdi.request.ThreadStartRequest;
import com.sun.jdi.request.ThreadDeathRequest;
+import com.sun.jdi.request.ThreadStartRequest;
+import jde.debugger.Etc;
+import jde.debugger.JDEException;
+import jde.debugger.ObjectStore;
/**
@@ -35,12 +30,14 @@ import com.sun.jdi.request.ThreadDeathRe
* </ul>
*
* <p>
- * @see EventHandler#threadStartEvent(ThreadStartEvent)
- * @see EventHandler#threadDeathEvent(ThreadDeathEvent)
+ * @see jde.debugger.EventHandler#threadStartEvent(ThreadStartEvent)
+ * @see jde.debugger.EventHandler#threadDeathEvent(ThreadDeathEvent)
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
*/
public class TraceThreads extends DebugProcessCommand {
@@ -49,64 +46,65 @@ public class TraceThreads extends DebugP
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
- if (args.size() < 2)
+ if (m_args.size() < 2)
throw new JDEException("Insufficient arguments");
-
- String type = args.remove(0).toString().toLowerCase();
-
+
+ String type = m_args.remove(0).toString().toLowerCase();
+
if (!(type.equals("start") || type.equals("death")))
throw new JDEException("Invalid type");
-
- List classFilters = Etc.getClassFiltersFromArgs(args);
- List classExFilters = Etc.getClassExFiltersFromArgs(args);
-
- EventRequestManager em = proc.getVM().eventRequestManager();
- Long requestID = null;
- ObjectStore store = proc.getStore();
-
+ List classFilters = Etc.getClassFiltersFromArgs(m_args);
+ List classExFilters = Etc.getClassExFiltersFromArgs(m_args);
+
+ EventRequestManager em = m_debugger.getVM().eventRequestManager();
+
+ Long requestID = null;
+ ObjectStore store = m_debugger.getStore();
+
if (type.equals("start")) {
-
ThreadStartRequest ter = em.createThreadStartRequest();
-
- ter.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
-
- if (args.size() > 0) {
- Long threadID = Etc.safeGetLong(args.remove(0), "thread ID");
- ObjectReference tRef = store.get(threadID);
- if (tRef == null) {
- throw new JDEException("No such thread exists");
- } else if (!(tRef instanceof ThreadReference)) {
- throw new JDEException("No such thread exists (anymore?)");
- }
- ter.addThreadFilter((ThreadReference)tRef);
+
+ ter.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
+
+ if (m_args.size() > 0) {
+ Long threadID = Etc.safeGetLong(m_args.remove(0), "thread
ID");
+ ObjectReference tRef = store.get(threadID);
+ if (tRef == null) {
+ throw new JDEException("No such thread exists");
+ } else if (!(tRef instanceof ThreadReference)) {
+ throw new JDEException("No such thread exists (anymore?)");
+ }
+ ter.addThreadFilter((ThreadReference)tRef);
}
-
- requestID = addIdentifiableRequest(ter);
+ requestID = m_debugger.addIdentifiableRequest(ter);
+
} else if (type.equals("death")) {
-
+
ThreadDeathRequest ter = em.createThreadDeathRequest();
-
- ter.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
+
+ ter.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
- if (args.size() > 0) {
- Long threadID = Etc.safeGetLong(args.remove(0), "thread ID");
- ObjectReference tRef = store.get(threadID);
- if (tRef == null) {
- throw new JDEException("No such thread exists");
- } else if (!(tRef instanceof ThreadReference)) {
- throw new JDEException("No such thread exists (anymore?)");
- }
- ter.addThreadFilter((ThreadReference)tRef);
+ if (m_args.size() > 0) {
+ Long threadID = Etc.safeGetLong(m_args.remove(0), "thread
ID");
+ ObjectReference tRef = store.get(threadID);
+ if (tRef == null) {
+ throw new JDEException("No such thread exists");
+ } else if (!(tRef instanceof ThreadReference)) {
+ throw new JDEException("No such thread exists (anymore?)");
+ }
+ ter.addThreadFilter((ThreadReference)tRef);
}
- requestID = addIdentifiableRequest(ter);
+ requestID = m_debugger.addIdentifiableRequest(ter);
}
- jde.signalCommandResult(procID, cmdID, requestID);
- }
-
+
+ m_debugger.signalCommandResult(m_cmdID, requestID.toString(), CMD_OK);
+ }
+
+
public Object clone() {return new TraceThreads();}
@@ -114,6 +112,9 @@ public class TraceThreads extends DebugP
/*
* $Log: TraceThreads.java,v $
+ * Revision 1.2 2003/01/15 05:56:26 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:26 paulk
* Initial revision.
*
1.6 +32 -31
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Watch.java
Index: Watch.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/Watch.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- Watch.java 2003/01/18 05:48:35 1.5
+++ Watch.java 2006/03/03 20:41:53 1.6
@@ -1,14 +1,9 @@
-/*
- * Copyright (c) 2000, 2001 Paul Kinnucan
- *
- * $Revision: 1.1 $
- */
-
package jde.debugger.command;
-import jde.debugger.JDEException;
-import jde.debugger.spec.WatchpointSpec;
+
import jde.debugger.Etc;
+import jde.debugger.JDEException;
import jde.debugger.spec.EventRequestSpecList;
+import jde.debugger.spec.WatchpointSpec;
/**
@@ -42,11 +37,13 @@ import jde.debugger.spec.EventRequestSpe
* </ul>
*
* <p>
- * @see EventHandler#watchpointEvent(WatchpointEvent)
+ * @see jde.debugger.EventHandler#watchpointEvent(WatchpointEvent)
*
* @author Paul Kinnucan
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
*/
public class Watch extends DebugProcessCommand {
@@ -55,44 +52,48 @@ public class Watch extends DebugProcessC
* @exception jde.debugger.JDEException <description>
*/
public void doCommand() throws JDEException {
-
- if (args.size() < 3)
+
+ if (m_args.size() < 3)
throw new JDEException("Insufficient arguments");
-
- String classPattern = args.remove(0).toString();
- String methodName = args.remove(0).toString();
- String typeString = args.remove(0).toString().toLowerCase();
- EventRequestSpecList eventRequests = proc.getEventRequestSpecs();
+
+ String classPattern = m_args.remove(0).toString();
+ String methodName = m_args.remove(0).toString();
+ String typeString = m_args.remove(0).toString().toLowerCase();
+ EventRequestSpecList eventRequests = m_debugger.getEventRequestSpecList();
+
WatchpointSpec er = null;
if (typeString.equals("for_access")) {
- if (!proc.getVM().canWatchFieldAccess())
- throw new JDEException("This VM implementation cannot watch field accesses");
+ if (!m_debugger.getVM().canWatchFieldAccess())
+ throw new JDEException("This VM implementation cannot watch field
accesses");
er = eventRequests.createAccessWatchpoint(classPattern, methodName);
} else if (typeString.equals("for_modification")) {
- if (!proc.getVM().canWatchFieldModification())
- throw new JDEException("This VM implementation cannot watch field
modifications");
+ if (!m_debugger.getVM().canWatchFieldModification())
+ throw new JDEException("This VM implementation cannot watch field
modifications");
er = eventRequests.createModificationWatchpoint(classPattern, methodName);
} else {
throw new JDEException("'"+typeString+"' not understood: use
either 'for_access' or 'for_modification'");
}
- er.setThread(Etc.getThreadFromArgs(args));
- er.setExpression(Etc.getExprFromArgs(args));
- er.setObjectID(Etc.getObjectIDFromArgs(args));
- er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(args));
- er.setClassFilters(Etc.getClassFiltersFromArgs(args));
- er.setClassExFilters(Etc.getClassExFiltersFromArgs(args));
+ er.setThread(Etc.getThreadFromArgs(m_args));
+ er.setExpression(Etc.getExprFromArgs(m_args));
+ er.setObjectID(Etc.getObjectIDFromArgs(m_args));
+ er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
+ er.setClassFilters(Etc.getClassFiltersFromArgs(m_args));
+ er.setClassExFilters(Etc.getClassExFiltersFromArgs(m_args));
eventRequests.install(er);
-
- jde.signalCommandResult(procID, cmdID, er.getID());
+
+ m_debugger.signalCommandResult(m_cmdID, er.getID().toString(), CMD_OK, NOQUOTE);
}
-
+
public Object clone() {return new Watch();}
-
+
} // Watch
/*
* $Log: Watch.java,v $
+ * Revision 1.2 2003/01/15 05:56:25 paulk
+ * Add Petter Mahlen's changes.
+ *
* Revision 1.1 2001/03/24 13:35:26 paulk
* Initial revision.
*
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/ArrayModel.java
Index: ArrayModel.java
===================================================================
package jde.debugger.gui;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreeNode;
import com.sun.jdi.ArrayReference;
import com.sun.jdi.ArrayType;
import com.sun.jdi.Field;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.StringReference;
import com.sun.jdi.Value;
import jde.debugger.JDEException;
/** A TreeNode for array references.
* @author <a href="mailto:udalrich@carolingia.org">Troy
Daniels</a>
* @since 2.3.2
* @version $Revision: 1.1 $
*/
class ArrayModel extends ReferenceModel {
/** Constructor
*/
ArrayModel(ArrayReference value, DefaultTreeModel treeModel) {
super();
if (null == value)
throw new IllegalArgumentException("Null value in constructor.");
if (null == treeModel)
throw new IllegalArgumentException("Null tree model in constructor.");
m_value = value;
m_treeModel = treeModel;
}
/** Get the number of children.
* @return The number of fields that we should be displaying.
*/
int getChildCount() {
return m_value.length();
}
/** Returns if the node allows children */
boolean getAllowsChildren() { return true; }
/** Create a child at the given index.
* @return A tree node for the child at the given index */
MutableTreeNode createChildAt(int index) throws JDEException {
String name = getIndexName(index);
ArrayType arrayType = (ArrayType) m_value.type();
MutableTreeNode node =
LVTreeNode.makeTreeNode(name,
arrayType.componentTypeName(),
m_value.getValue(index),
m_treeModel);
return node;
}
/** Get a string to represent the value of the variable */
String getValue() {
return m_value.type().name() + "[" + m_value.length() + "]";
}
private static String getIndexName(int index) {
return "[" + index + "]";
}
/** Update the values in the children
* @param children The array of old child values
*/
void updateChildren(TreeNode[] children) {
// For the children that already exist, set the new value.
TreeNode reloadParent = null;
for (int index = 0;
(index < children.length) &&
(index < m_value.length());
++index) {
LVTreeNode child = asLVTreeNode(children[index]);
if ((null != child) &&
(child.getName().equals(getIndexName(index))))
child.setValue(m_value.getValue(index));
else {
// Different node. Reset it
if ((null != children[index]) &&
(null != children[index].getParent()))
reloadParent = children[index].getParent();
children[index] = null;
}
} // for each child
// Reload the model if we had significant changes
if (null != reloadParent)
m_treeModel.reload(reloadParent);
}
private final ArrayReference m_value;
private final DefaultTreeModel m_treeModel;
}
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/GUI.java
Index: GUI.java
===================================================================
package jde.debugger.gui;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import jde.debugger.Debugger;
import jde.debugger.JDE;
import jde.debugger.Protocol;
/**
* This is a first shot at trying to produce a GUI that displays debugging info from
* JDEbug. I recommend a redesign, either after studying this a bit more, or straight
* away, depending on the experience of the developer. The main things I am unhappy with
* are:
* <ul>
*
* <li>it feels unelegant to have the commands (GetLocals, etc) be
* aware of who is the recipient of their results. A better design
* would be to let the Debugger decide where to send certain events,
* command results, etc.</li>
*
* <li>this class itself is a hack - for instance, there's been very
* little thought on member variables are actually necessary, what
* JTree-related classes to use, and so on. I've been using it to
* learn more about JTree, but wasn't able to finish.</li>
*
* <li>there is (maybe was, now) a bug in the AWT threads, meaning
* that it hasn't been possible to shut them down in any other way
* than with a System.exit() command. The Quit command does that
* now, which is bad since it can hide other problems. Also, the
* whole shutdown sequence is a little messy, maybe due to an
* unclear division of labour between the SessionManager, Debugger
* and command classes.</li>
*
* </ul>
*
* <p>
* Created: Thu Jan 31 13:13:39 2002
*
* @author <a href="mailto:petter.mahlen@chello.se">Petter
Måhlén</a>
* @author <a href="mailto:udalrich@carolingia.org">Troy
Daniels</a>
* @version
*/
public class GUI implements Protocol {
private JFrame m_frame;
public GUI(final Debugger debugger) {
m_frame = new JFrame("JDEbug " + debugger.getProcID());
m_frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
// Set up the GUI stuff
JPanel basePanel = new JPanel();
basePanel.setLayout(new GridLayout(0, 1));
basePanel.add(new LocalVariableDisplay(debugger));
// Finally, add the base panel to the content pane of the frame.
m_frame.getContentPane().add(basePanel);
m_frame.pack();
m_frame.show();
JDE.debug(FRAMEWORK, "GUI constructor done");
}
/** Shutdown the GUI */
public synchronized void shutdown() {
if (null != m_frame)
m_frame.dispose();
}
protected void finalize() throws Throwable {
super.finalize();
shutdown();
}
}// GUI
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/LVTreeNode.java
Index: LVTreeNode.java
===================================================================
package jde.debugger.gui;
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
import javax.swing.SwingUtilities;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;
import com.sun.jdi.ArrayReference;
import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.Field;
import com.sun.jdi.LocalVariable;
import com.sun.jdi.ObjectCollectedException;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.PrimitiveValue;
import com.sun.jdi.Type;
import com.sun.jdi.Value;
import jde.debugger.JDE;
import jde.debugger.JDEException;
import jde.debugger.Protocol;
/** A TreeNode for displaying local variables. This class has no
* public constructors. Instead, it uses a factory method { @link
* #makeTreeNode } to create objects. This will probably return a
* subclass based on the type of variable we are displaying.<p>
*
* This class implements MutableTreeNode mainly because the
* DefaultTreeModel requires it. Most of the methods in that
* interface simply throw exceptions.
*
* @author <a href="mailto:udalrich@carolingia.org">Troy
Daniels</a>
* @since 2.3.2
* @version $Revision: 1.2 $
*/
abstract class LVTreeNode implements MutableTreeNode, Protocol {
/** LVTreeNode constructor for subclasses.
* @param localVar A reference to a local variable.
* @param val The value of localVar.
*/
protected LVTreeNode(String name,
String typeName,
Value val,
DefaultTreeModel model) {
m_name = name;
m_typeName = typeName;
m_model = model;
setValue(val, false);
}
/** Create a new LVTreeNode object. Based on the arguments,
* Different classes will be returned, customized to actual
* values.
* @param name The name of the variable
* @param type The Type of the variable
* @param val The value of the variable.
* @param model The tree model.
* @return A TreeNode for use in a JTree.
*/
public static MutableTreeNode makeTreeNode(String name,
String typeName,
Value val,
DefaultTreeModel model)
throws JDEException
{
if (val instanceof PrimitiveValue)
return new PrimitiveTreeNode(name, typeName, val, model);
else if ((val instanceof ObjectReference) ||
(val == null))
return new ReferenceTreeNode(name, typeName, val, model);
else
throw new JDEException("Unknown variable type " + val);
}
/** Create a new LVTreeNode object. Based on the arguments,
* different classes will be returned, customized to actual
* values.
* @param localVar A reference to a local variable.
* @param val The value of localVar.
* @param model The tree model.
* @return A TreeNode for use in a JTree.
*/
public static MutableTreeNode makeTreeNode(LocalVariable localVar,
Value val,
DefaultTreeModel model)
throws JDEException
{
// it appears that: localVar.type() returns a ClassType about the
// class, ObjectReference.referenceType returns the type of the
// value, which is what we want to use.
return makeTreeNode(localVar.name(),
localVar.typeName(),
val,
model);
}
/** Create a new LVTreeNode object. Based on the arguments,
* different classes will be returned, customized to actual
* values.
* @param field A field within an object
* @param val The value of the field.
* @return A TreeNode for use in a JTree.
*/
public static MutableTreeNode makeTreeNode(Field field,
Value val,
DefaultTreeModel model)
throws JDEException
{
return makeTreeNode(field.name(),
field.typeName(),
val,
model);
}
// Implementation of javax.swing.tree.TreeNode
/** Get the parent of this node */
public TreeNode getParent() {
return m_parent;
}
/** Set the parent of this node */
public void setParent(MutableTreeNode parent) {
m_parent = parent;
}
/**
* Describe <code>remove</code> method here.
*
* @param n an <code>int</code> value
*/
public void remove(int n) {
throw new IllegalArgumentException("Attempt to remove a node " +
"from the local variables tree");
}
/**
* Describe <code>remove</code> method here.
*
* @param mutableTreeNode a <code>MutableTreeNode</code> value
*/
public void remove(MutableTreeNode mutableTreeNode) {
throw new IllegalArgumentException("Attempt to remove a node " +
"from the local variables tree");
}
/**
* Describe <code>insert</code> method here.
*
* @param mutableTreeNode a <code>MutableTreeNode</code> value
* @param n an <code>int</code> value
*/
public void insert(MutableTreeNode mutableTreeNode, int n) {
throw new IllegalArgumentException("Attempt to insert a node " +
"from the local variables tree");
}
/**
* Describe <code>setUserObject</code> method here.
*
* @param object an <code>Object</code> value
*/
public void setUserObject(Object object) {
}
/**
* Describe <code>removeFromParent</code> method here.
*
*/
public void removeFromParent() {
throw new IllegalArgumentException("Attempt to remove a node from its parent
" +
"in the local variables tree");
}
/** Get the name of the variable */
String getName() {
return m_name;
}
/** Get the name of the type of the variable */
String getTypeName() {
return m_typeName;
}
/** Set the value of the object.
* @param val The new value
*/
public void setValue(Value val) {
setValue(val, true);
}
/** Set the value of the object.<p>
*
* In the constructor, we don't want to notify the model, since that
* can cause an infinite loop if the object refers to itself. Also,
* notification is intended for changes to existing nodes.
*
* @param val The new value
* @param notify Should we notify the tree model
*/
private void setValue(Value val, boolean notify) {
int oldNumChildren = getChildCount();
// Store the value and the type of the value
if (val != null)
m_type = val.type();
else
m_type = null;
valueChanged(val);
// Tell the TreeModel that we changed.
if (notify)
handleChildChange(oldNumChildren);
}
/** Called when the value has changed. Default implementation does nothing.
* @param oldValue The old value
* @param newValue THe new value
*/
abstract void valueChanged(Value newValue);
private void handleChildChange(int oldNumChildren) {
int numChildren = getChildCount();
JDE.debug(GUI, "handleChildChange: old=" + oldNumChildren +
",new=" + numChildren + ",name=" + getName());
if (numChildren == oldNumChildren) {
m_model.nodeChanged(this);
JDE.debug(GUI, "nodeChanged(" + getName() + ")");
} else if (numChildren > oldNumChildren) {
// } else if (numChildren > oldNumChildren) {
int added[] = new int[numChildren - oldNumChildren];
for (int index = 0; index < added.length; ++index)
added[index] = oldNumChildren + index;
m_model.nodesWereInserted(this, added);
JDE.debug(GUI, "nodesWereInserted(" + getName() + ")");
} else {
m_model.nodeStructureChanged(this);
// m_model.nodeChanged(this);
// int removed[] = new int[oldNumChildren - numChildren];
// for (int index = 0; index < removed.length; ++index)
// removed[index] = numChildren + index;
// m_model.nodesWereRemoved(this, removed);
JDE.debug(GUI, "nodeStructureChanged(" + getName() + ")");
}
}
/** Get the string to display the value of the variable */
abstract String getValue();
/** Get the TreeModel for this Node */
protected DefaultTreeModel getModel() {
return m_model;
}
public final String toString() {
return getClass().getName() + "[" + paramString() + "]";
}
protected String paramString() {
return "m_name=" + m_name + "," +
"m_typeName=" + m_typeName + "," +
"m_type=" + m_type + "," +
"m_model=" + m_model + "," +
"m_parent=" + m_parent;
}
protected final String m_name;
protected final String m_typeName;
protected Type m_type;
private DefaultTreeModel m_model;
private TreeNode m_parent;
}
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/LocalVariableDisplay.java
Index: LocalVariableDisplay.java
===================================================================
package jde.debugger.gui;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;
import com.sun.jdi.AbsentInformationException;
import com.sun.jdi.IncompatibleThreadStateException;
import com.sun.jdi.InconsistentDebugInfoException;
import com.sun.jdi.InvalidStackFrameException;
import com.sun.jdi.LocalVariable;
import com.sun.jdi.NativeMethodException;
import com.sun.jdi.ObjectCollectedException;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.StackFrame;
import com.sun.jdi.ThreadReference;
import jde.debugger.CommandEvent;
import jde.debugger.CommandListener;
import jde.debugger.Debugger;
import jde.debugger.Etc;
import jde.debugger.EventSetEvent;
import jde.debugger.EventSetListener;
import jde.debugger.JDE;
import jde.debugger.JDEException;
import jde.debugger.Protocol;
import java.util.Iterator;
import com.sun.jdi.Value;
/** A widget that displays the local variables
* @author <a href="mailto:udalrich@carolingia.org">Troy
Daniels</a>
* @since 2.3.2
* @version $Revision: 1.2 $
*/
class LocalVariableDisplay extends JPanel implements Protocol
{
/** Default LocalVariableDisplay constructor */
public LocalVariableDisplay(Debugger debugger ) {
super(new BorderLayout());
m_root = new DefaultMutableTreeNode();
m_tree = createJTree(m_root);
m_tree.setRootVisible(false);
m_debugger = debugger;
// These are the commands that require us to do something
m_interestingCommands = new HashSet();
m_interestingCommands.add("stack_frame");
JScrollPane scroll =
new JScrollPane(m_tree,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scroll.setColumnHeaderView(new JLabel("Local Variables",
SwingConstants.CENTER));
add(scroll, BorderLayout.CENTER);
m_message = new JLabel();
m_defaultLabelColor = m_message.getForeground();
add(m_message, BorderLayout.SOUTH);
// Add listeners for events we're interested in
debugger.addEventSetListener(new EventSetListener() {
public void eventSetReceived(EventSetEvent evt) {}
public void debuggerSuspended(EventSetEvent evt) {
updateVariables(evt);
}
public void debuggerResumed(EventSetEvent evt) {}
});
debugger.addCommandListener(new CommandListener() {
public void commandReceived(CommandEvent evt) {
updateVariables(evt);
}
});
JDE.debug(GUI, "LocalVariableDisplay registered EventSetListener.");
} // LocalVariableDisplay.java constructor
/** Update the display the local variables in the tree */
private void updateVariables(EventSetEvent evt) {
JDE.debug(GUI, "updateVariables()");
try {
p_message("");
// Get the thread. If there is none, we can't do anything.
ThreadReference tRef = evt.getThreadReference();
if (null == tRef) {
throw new JDEException("No thread with event");
}
updateVariables(tRef, 0);
} catch (JDEException exc) {
p_error(exc.getMessage());
}
}
/** Update the display the local variables in the tree in response
* to a set-frame-index command. */
private void updateVariables(CommandEvent evt) {
JDE.debug(GUI, "updateVariables(" + evt.getCmdName() + ")");
try {
p_message("");
// Verify that this is a command we have interest
if (!m_interestingCommands.contains(evt.getCmdName()))
return;
// Check argument count
if (evt.getArgs().size() != 2)
throw new JDEException("Incorrect number of arguments: " + evt);
// Get the thread. If there is none, we can't do anything.
Long uniqueID = Etc.safeGetLong(evt.getArgs().get(0), "thread ID");
int frameIndex = Etc.safeGetint(evt.getArgs().get(1), "frame index");
Object oRef = m_debugger.getStore().get(uniqueID);
if (oRef == null) {
throw new JDEException("No such thread exists");
} else if (!(oRef instanceof ThreadReference)) {
throw new JDEException("Object is not a thread");
}
ThreadReference tRef = (ThreadReference)oRef;
updateVariables(tRef, frameIndex);
} catch (JDEException exc) {
p_error(exc.getMessage());
}
}
/** Update the local variable display
* @param tRef The thread to display
* @param frameIndex The index in the stack frame for showing the variables
*/
private void updateVariables(ThreadReference tRef,
int frameIndex) throws JDEException {
// If the the thread isn't suspended, we can't do anything
if (!tRef.isSuspended()) {
throw new JDEException("Thread " + tRef + " not suspended");
}
StackFrame frame = null;
try {
frame = tRef.frame(frameIndex);
} catch (IncompatibleThreadStateException ex) {
throw new JDEException("Thread is not suspended");
} catch (IndexOutOfBoundsException ex) {
throw new JDEException("Invalid stack frame");
} catch (ObjectCollectedException ex) {
throw new JDEException("The frame has already been garbage collected");
}
if (frame == null) {
throw new JDEException("Error ascertaining frame");
}
try {
// Get this and local variables
final ObjectReference thisRef = frame.thisObject();
final List visibleVariables = frame.visibleVariables();
final Map localVariableValues = frame.getValues(visibleVariables);
// Update the variables. Do this on the swing thread since it
// will change the GUI.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// XXX Do we want to do invokeAndWait so that this thread
// block? Might that cause a deadlock? Troy
updateVariablesOnSwingThread(thisRef,
visibleVariables,
localVariableValues);
}
});
} catch (AbsentInformationException ex) {
throw new JDEException("Local variable information not available: compile
with -g");
} catch (NativeMethodException ex) {
throw new JDEException("Can't access local variables " +
"in native methods");
} catch (InvalidStackFrameException ex) {
throw new JDEException("Stack frame no longer valid");
} catch (InconsistentDebugInfoException ex) {
throw new JDEException("Inconsistent debug information: " +
ex.getMessage());
}
}
/** Update the variable values on the swing thread */
private void updateVariablesOnSwingThread(ObjectReference thisRef,
List visibleVariables,
Map localVariableValues) {
try {
boolean reload = false;
DefaultTreeModel model = (DefaultTreeModel) m_tree.getModel();
Collection updated = new HashSet();
int previousSize = m_root.getChildCount();
reload = previousSize == 0;
// Update or set this
try {
if (null != thisRef) {
LVTreeNode thisNode = getThisNode();
String thisType = thisRef.referenceType().name();
if ((null == thisNode) ||
!(thisNode.getTypeName().equals(thisType))) {
MutableTreeNode node =
LVTreeNode.makeTreeNode("this",
thisType,
thisRef,
model);
JDE.debug(GUI, "made this: isLeaf=" + node.isLeaf() +
", childCount=" + node.getChildCount() +
"\n\tnode=" + node);
model.insertNodeInto(node, m_root, 0);
++previousSize;
} else {
thisNode.setValue(thisRef);
}
updated.add(new Integer(0));
}
// Add the local variables
for (Iterator iter =
localVariableValues.entrySet().iterator();
iter.hasNext();
/* */) {
Map.Entry entry = (Map.Entry) iter.next();
LocalVariable localVariable = (LocalVariable) entry.getKey();
Value value = (Value) entry.getValue();
LVTreeNode node = getVariableNode(localVariable);
if (null == node) {
MutableTreeNode newNode =
LVTreeNode.makeTreeNode(localVariable,
value,
model);
model.insertNodeInto(newNode,
m_root,
m_root.getChildCount());
}else {
node.setValue(value);
updated.add(new Integer(m_root.getIndex(node)));
}
} // for each local variable
JDE.debug(GUI, "added values to tree, updated=" + updated);
// Remove the nodes which no longer correspond to a value. Do
// this backwards so that the indices we care about don't
// shift.
for (int index = previousSize - 1; index >= 0; --index)
if (!updated.contains(new Integer(index))) {
MutableTreeNode mutNode =
(MutableTreeNode) m_root.getChildAt(index);
model.removeNodeFromParent(mutNode);
}
} catch (InvalidStackFrameException ex) {
throw new JDEException("Stack frame no longer valid");
} catch (InconsistentDebugInfoException ex) {
throw new JDEException("Inconsistent debug information: " +
ex.getMessage());
} finally {
// Notify the tree that it needs to reload the model
if (reload)
model.reload();
}
} catch (JDEException exc) {
p_error(exc.getMessage());
}
}
/** Send an error message to the user */
private void p_error(final String msg) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
m_message.setText(msg);
m_message.setForeground(Color.red);
}
});
}
/** Send a message to the user */
private void p_message(final String msg) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
m_message.setText(msg);
m_message.setForeground(m_defaultLabelColor);
}
});
}
/** Get the TreeNode that has the information for "this".
* @return The LVTreeNode for this, or null if there is no node
* displaying that data */
private LVTreeNode getThisNode() {
// It will be the first node
if (m_root.getChildCount() == 0)
return null;
// It will be an LVTreeNode
Object node = m_root.getChildAt(0);
if (!(node instanceof LVTreeNode))
return null;
// It will be named "this"
LVTreeNode thisNode = (LVTreeNode) node;
if (thisNode.getName() != "this")
return null;
// Found it!
return thisNode;
}
/** Get the LVTreeNode corresponding to the local variable
* @return The LVTreeNode or null if there is no node for this variable.
*/
private LVTreeNode getVariableNode(LocalVariable local) {
// JDE.debug(GUI, "getVariableNode(" + local.name() + "):
m_root.size=" +
// m_root.getChildCount());
for (int index = 0; index < m_root.getChildCount(); ++index) {
// It will be an LVTreeNode
Object node = m_root.getChildAt(index);
if (!(node instanceof LVTreeNode))
continue;
// It will have the same name. XXX should we equals() instead?
// That requires us to store the old LocalVariable, and not all
// LVTreeNodes will have a LocalVariable. (Some are this or a
// field).
LVTreeNode varNode = (LVTreeNode) node;
if (!varNode.getName().equals(local.name()))
continue;
// Found it!
return varNode;
} // for each child
return null;
}
/** Create a JTree that properly renders LVTreeNodes. */
private JTree createJTree(DefaultMutableTreeNode root) {
// Override convertValueToText
JTree tree = new JTree(root) {
public String convertValueToText(Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
if (value instanceof LVTreeNode) {
LVTreeNode node = (LVTreeNode) value;
return node.getName() +
" (" + node.getTypeName() + ") " +
node.getValue();
} else
return super.convertValueToText(value,
selected,
expanded,
leaf,
row,
hasFocus);
}
};
tree.setLargeModel(true);
return tree;
}
private final JTree m_tree;
private final JLabel m_message;
private final DefaultMutableTreeNode m_root;
private final Color m_defaultLabelColor;
private final Debugger m_debugger;
private final Collection m_interestingCommands;
//
// Debug methods
//
// public static void main(String args[]) {
// JFrame frame = new JFrame("LV test");
// frame.getContentPane().add(new LocalVariableDisplay());
// frame.pack();
// frame.show();
// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// frame.list();
// }
private static void dumpTree(TreeNode node) {
JDE.debug(GUI, "tree dump");
dumpTree(node, "");
}
private static void dumpTree(TreeNode node, String prefix) {
if (node instanceof LVTreeNode) {
LVTreeNode lvt = (LVTreeNode) node;
JDE.debug(GUI, prefix + lvt.getName());
} else
JDE.debug(GUI, prefix + node.toString());
prefix += ".";
for (int index = 0;
node.getAllowsChildren() &&
(index < node.getChildCount());
++index)
dumpTree(node.getChildAt(index), prefix);
}
} // End of class LocalVariableDisplay.java
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/NullModel.java
Index: NullModel.java
===================================================================
package jde.debugger.gui;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;
import jde.debugger.JDEException;
/** A TreeNode for null object references.
* @author <a href="mailto:udalrich@carolingia.org">Troy
Daniels</a>
* @since 2.3.2
* @version $Revision: 1.1 $
*/
class NullModel extends ReferenceModel {
/** Constructor
*/
NullModel() {
super();
}
/** Get the number of children.
* @return The number of fields that we should be displaying.
*/
public int getChildCount() { return 0; }
/** Returns if the node allows children */
public boolean getAllowsChildren() { return false; }
/** Create a child at the given index.
* @return A tree node for the child at the given index */
MutableTreeNode createChildAt(int index) throws JDEException {
throw new JDEException(getClass().getName() + " does not allow children");
}
/** Get a string to represent the value of the variable */
String getValue() { return "null"; }
/** Update the values in the children
* @param children The array of old child values
*/
void updateChildren(TreeNode[] children) {}
}
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/ObjectModel.java
Index: ObjectModel.java
===================================================================
package jde.debugger.gui;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreeNode;
import com.sun.jdi.Field;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.StringReference;
import com.sun.jdi.Value;
import jde.debugger.JDEException;
/** A TreeNode for object references that aren't null or arrays.
* @author <a href="mailto:udalrich@carolingia.org">Troy
Daniels</a>
* @since 2.3.2
* @version $Revision: 1.1 $
*/
class ObjectModel extends ReferenceModel {
/** Constructor
*/
ObjectModel(ObjectReference value, DefaultTreeModel treeModel) {
super();
if (null == value)
throw new IllegalArgumentException("Null value in constructor.");
if (null == treeModel)
throw new IllegalArgumentException("Null tree model in constructor.");
m_value = value;
m_treeModel = treeModel;
}
/** Get the number of children.
* @return The number of fields that we should be displaying.
*/
int getChildCount() {
return getFields().size();
}
/** Returns if the node allows children */
boolean getAllowsChildren() { return true; }
/** Create a child at the given index.
* @return A tree node for the child at the given index */
MutableTreeNode createChildAt(int index) throws JDEException {
Field field = getFieldAt(index);
Value value = m_value.getValue(field);
MutableTreeNode node =
LVTreeNode.makeTreeNode(field, value, m_treeModel);
return node;
}
/** Get a string to represent the value of the variable */
String getValue() {
if (m_value instanceof StringReference) {
StringReference string = (StringReference) m_value;
return '"' + string.value() + '"';
} else {
return m_value.toString();
}
}
/** Get the fields that we wish to display */
private List getFields() {
ReferenceType refType = (ReferenceType) m_value.type();
Collection fields = new TreeSet(new Comparator() {
public int compare(Object o1, Object o2) {
Field field1 = (Field) o1;
Field field2 = (Field) o2;
return field1.name().compareTo(field2.name());
}
});
fields.addAll(refType.visibleFields());
return new ArrayList(fields);
}
/** Get the field that we wish to display
* @param index The index of the field
*/
private Field getFieldAt(int index) {
return (Field) getFields().get(index);
}
/** Update the values in the children
* @param children The array of old child values
*/
void updateChildren(TreeNode[] children) {
// For the children that already exist, set the new value.
//
// If the field name has changed, then this is an entirely
// different field and we need to create a new node.
TreeNode reloadParent = null;
int index = 0;
List fields = getFields();
for (Iterator iter = getFields().iterator();
iter.hasNext() && (index < children.length);
++index) {
Field field = (Field) iter.next();
LVTreeNode node = asLVTreeNode(children[index]);
if ((null != node) &&
(node.getName().equals(field.name()))) {
// Match found. Update the child.
node.setValue(m_value.getValue(field));
} else {
// Different node. Reset it
if ((null != children[index]) &&
(null != children[index].getParent()))
reloadParent = children[index].getParent();
children[index] = null;
}
} // for each field
// Reload the model if we had significant changes
if (null != reloadParent)
m_treeModel.reload(reloadParent);
}
public String toString() {
return getClass().getName() + "[" +
"m_value=" + m_value + "," +
"m_treeModel=" + m_treeModel + "]";
}
private final ObjectReference m_value;
private final DefaultTreeModel m_treeModel;
}
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/PrimitiveTreeNode.java
Index: PrimitiveTreeNode.java
===================================================================
package jde.debugger.gui;
import java.util.Enumeration;
import java.util.Vector;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeNode;
import com.sun.jdi.PrimitiveType;
import com.sun.jdi.PrimitiveValue;
import com.sun.jdi.Value;
import jde.debugger.JDEException;
/** A TreeNode for primitive variables.
* @author <a href="mailto:udalrich@carolingia.org">Troy
Daniels</a>
* @since 2.3.2
* @version $Revision: 1.2 $
*/
class PrimitiveTreeNode extends LVTreeNode {
/** Constructor
* @param name The name of the variable
* @param type The Type of the variable
* @param val The value of the variable.
* @param model The TreeModel.
*/
protected PrimitiveTreeNode(String name,
String typeName,
Value val,
DefaultTreeModel model) throws JDEException {
super(name, typeName, val, model);
if (!(m_type instanceof PrimitiveType))
throw new JDEException("PrimitiveTreeNode received non-primitive Type " +
m_type.name());
if (!(val instanceof PrimitiveValue))
throw new JDEException("PrimitiveTreeNode received non-primitive value " +
val.type().name());
m_value = val;
}
/** Get the number of children.
* @return Zero, since primitives do not have children.
*/
public int getChildCount() {
return 0;
}
/** Returns if the node allows children
* @return false, since primitives do not have children. */
public boolean getAllowsChildren() {
return false;
}
/** Get the child at the given index.
* @throws IllegalArgumentException since primitives do not have children. */
public TreeNode getChildAt(int index) {
throw new IllegalArgumentException("Attempt to create a child of a
Primitive");
}
/** Get the index of the tree node
* @return -1 since primitives do not have children */
public int getIndex(TreeNode node) { return -1; }
/** Get a string to represent the value of the variable */
String getValue() {
return m_value.toString();
}
/** Asks if the node is a leaf node */
public boolean isLeaf() { return true; }
/** Returns an enumeration of the children */
public Enumeration children() {
return new Vector().elements();
}
/** Called when the value changes
* @param val The new value
*/
void valueChanged(Value val) {
m_value = val;
}
private Value m_value;
}
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/ReferenceModel.java
Index: ReferenceModel.java
===================================================================
package jde.debugger.gui;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;
import jde.debugger.JDEException;
/** Base class for displaying different types of references */
abstract class ReferenceModel
{
/** Default ReferenceModel constructor */
ReferenceModel( ) {
} // ReferenceModel constructor
/** Get the number of children.
* @return The number of fields that we should be displaying.
*/
abstract int getChildCount();
/** Returns if the node allows children */
abstract boolean getAllowsChildren();
// * @throws ClassNotLoadedException If the class hasn't been loaded.
// * This shouldn't be possible, but the compiler doesn't know that.
// */
/** Create a child at the given index.
* @param childIndex index of child to create
* @return A tree node for the child at the given index
* @throws JDEException If an error occurs.
*/
abstract MutableTreeNode createChildAt(int index) throws JDEException;
/** Get a string to represent the value of the variable */
abstract String getValue();
/** Update the values in the children
* @param children The array of old child values
*/
abstract void updateChildren(TreeNode[] children);
/** Convert the TreeNode to an LVTreeNode.
* @param node The TreeNode to convert
* @return node cast to an LVTreeNode, or null if node is not an
* LVTreeNode
*/
protected static LVTreeNode asLVTreeNode(TreeNode node) {
if (node instanceof LVTreeNode)
return (LVTreeNode) node;
else
return null;
}
} // End of class ReferenceModel
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/command/ReferenceTreeNode.java
Index: ReferenceTreeNode.java
===================================================================
package jde.debugger.gui;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;
import com.sun.jdi.ArrayReference;
import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.Field;
import com.sun.jdi.ObjectCollectedException;
import com.sun.jdi.ObjectReference;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.StringReference;
import com.sun.jdi.Value;
import jde.debugger.JDE;
import jde.debugger.JDEException;
import jde.debugger.Protocol;
/** A TreeNode for object references.
* @author <a href="mailto:udalrich@carolingia.org">Troy
Daniels</a>
* @since 2.3.2
* @version $Revision: 1.2 $
*/
class ReferenceTreeNode extends LVTreeNode implements Protocol {
/** Constructor
* @param name The name of the variable
* @param type The Type of the variable
* @param val The value of the variable.
* @param model The tree model
*/
protected ReferenceTreeNode(String name,
String typeName,
Value val,
DefaultTreeModel model) throws JDEException {
super(name, typeName, val, model);
if (!((m_type instanceof ReferenceType) ||
(val == null)))
throw new JDEException("ReferenceTreeNode received non-object reference Type
" +
m_type.name());
if ((null != val) &&
!(val instanceof ObjectReference)) {
JDE.debug(GUI, "Incorrect Value type in ReferenceTreeNode constructor");
JDE.debug(GUI, "val=" + val);
JDE.debug(GUI, "val.type()=" + val.type());
throw new JDEException("ReferenceTreeNode received non-object reference value
" +
val.type().name());
}
}
/** Called when the value has changed. Updates the object which
* actually implements the public methods.
* @param oldValue The old value
* @param newValue THe new value
*/
protected void valueChanged(Value newValue) {
// Create the new model for displaying the value
if (null == newValue)
m_model = new NullModel();
else if (newValue instanceof ArrayReference)
m_model = new ArrayModel((ArrayReference) newValue, getModel());
else
m_model = new ObjectModel((ObjectReference) newValue, getModel());
// If we have children, update the values in them and resize the
// array
if (getAllowsChildren()) {
if (null == m_children)
m_children = new MutableTreeNode[m_model.getChildCount()];
else {
// Ensure that the child array is the correct size
if (m_children.length != m_model.getChildCount()) {
MutableTreeNode[] newChildren = new MutableTreeNode[m_model.getChildCount()];
System.arraycopy(m_children, 0,
newChildren, 0,
Math.min(m_children.length,
newChildren.length));
m_children = newChildren;
}
}
} else
m_children = null;
m_model.updateChildren(m_children);
}
/** Get the number of children.
* @return The number of fields that we should be displaying.
*/
public int getChildCount() {
if (null == m_children)
return 0;
else
return m_children.length;
}
/** Returns if the node allows children
* @return true if the value is not null. */
public boolean getAllowsChildren() {
return m_model.getAllowsChildren();
}
/** Get a string to represent the value of the variable */
String getValue() {
return m_model.getValue();
}
/**
* Returns the index of node in the receivers children.
*
* @param treeNode a <code>TreeNode</code> value
* @return the index of node in the receivers children. Returns -1
* if <code>treeNode</code> is not a child of this node.
*/
public int getIndex(TreeNode treeNode) {
for (int index = 0; index < m_children.length; ++index)
if (m_children[index] == treeNode)
return index;
return -1;
}
/**
* Returns the children of the reciever as an Enumeration.
*
* @return the children of the reciever as an Enumeration.
*/
public Enumeration children() {
return Collections.enumeration(Arrays.asList(m_children));
}
/**
* Returns the child TreeNode at index childIndex. The child is
* created if it doesn't exist.
*
* @param childIndex the index of the child
* @return the child TreeNode at index childIndex.
*/
public TreeNode getChildAt(int childIndex) {
try {
if (null == m_children[childIndex]) {
m_children[childIndex] = m_model.createChildAt(childIndex);
m_children[childIndex].setParent(this);
}
} catch (JDEException exc) {
m_children[childIndex] =
new DefaultMutableTreeNode("Error displaying data: " + exc.getMessage());
}
return m_children[childIndex];
}
/**
* Returns true if the receiver is a leaf.
*
* @return true if the receiver is a leaf.
*/
public boolean isLeaf() {
return (null == m_children) ||
(m_children.length == 0);
}
/**
* Returns the child TreeNode at index childIndex. The child is
* <b>not</b> created if it doesn't exist.
*
* @param childIndex the index of the child
* @return the child TreeNode at index childIndex or null if there
* is no child at that index yet, or the child is not an LVTreeNode.
*/
protected LVTreeNode getExistingChildAt(int childIndex) {
if ((null == m_children[childIndex]) ||
(!(m_children[childIndex] instanceof LVTreeNode)))
return null;
return (LVTreeNode) m_children[childIndex];
}
/** Get the current length of the children array. For use when updating values. */
protected int getExistingChildLength() {
return m_children.length;
}
protected String paramString() {
return super.paramString() +
",m_model=" + m_model +
",m_children=" + m_children +
((null == m_children)? "": ("[" + m_children.length +
"]"));
}
private ReferenceModel m_model;
private MutableTreeNode[] m_children;
}
1.3 +24 -16
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/AccessWatchpointSpec.java
Index: AccessWatchpointSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/AccessWatchpointSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- AccessWatchpointSpec.java 2001/08/16 03:29:09 1.2
+++ AccessWatchpointSpec.java 2006/03/03 20:42:20 1.3
@@ -1,10 +1,8 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
-
import com.sun.jdi.*;
import com.sun.jdi.request.*;
+import jde.debugger.JDEException;
/**
* AccessWatchpointSpec.java
@@ -15,23 +13,33 @@ import com.sun.jdi.request.*;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.3 $
*/
public class AccessWatchpointSpec extends WatchpointSpec {
- public AccessWatchpointSpec(DebuggeeProcess proc, ReferenceTypeSpec refSpec,
- String fieldName) {
- super(proc, refSpec, fieldName);
- }
-
- boolean resolve(ReferenceType refType) throws JDEException {
- Field field = refType.fieldByName(fieldName);
- if (field == null) {
- throw new JDEException("'"+fieldName+"' does not exist in the
class");
- }
- EventRequest er =
refType.virtualMachine().eventRequestManager().createAccessWatchpointRequest(field);
- setRequest(er);
- return true;
+ public AccessWatchpointSpec(ReferenceTypeSpec refSpec,
+ String fieldName) {
+ super(refSpec, fieldName);
+ }
+
+ boolean resolve(ReferenceType refType) throws JDEException {
+ Field field = refType.fieldByName(fieldName);
+ if (field == null) {
+ throw new JDEException("'"+fieldName+"' does not exist in
the class");
}
+ EventRequest er =
refType.virtualMachine().eventRequestManager().createAccessWatchpointRequest(field);
+ setRequest(er);
+ return true;
+ }
} // AccessWatchpointSpec
+
+/*
+ * $Log: AccessWatchpointSpec.java,v $
+ * Revision 1.3 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of AccessWatchpointSpec.java
1.3 +17 -10
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/BreakpointSpec.java
Index: BreakpointSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/BreakpointSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- BreakpointSpec.java 2001/08/16 03:29:09 1.2
+++ BreakpointSpec.java 2006/03/03 20:42:20 1.3
@@ -1,8 +1,5 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
-
import com.sun.jdi.*;
import com.sun.jdi.request.*;
@@ -15,16 +12,26 @@ import com.sun.jdi.request.*;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.3 $
*/
abstract public class BreakpointSpec extends EventRequestSpec {
- public BreakpointSpec(DebuggeeProcess proc, ReferenceTypeSpec spec) {
- super(proc, spec);
- }
-
- void setRequest(BreakpointRequest request) {
- super.setRequest(request);
- }
+ public BreakpointSpec(ReferenceTypeSpec spec) {
+ super(spec);
+ }
+
+ void setRequest(BreakpointRequest request) {
+ super.setRequest(request);
+ }
} // BreakpointSpec
+
+/*
+ * $Log: BreakpointSpec.java,v $
+ * Revision 1.3 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of BreakpointSpec.java
1.3 +51 -62
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/EventRequestSpec.java
Index: EventRequestSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/EventRequestSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- EventRequestSpec.java 2001/08/16 03:29:09 1.2
+++ EventRequestSpec.java 2006/03/03 20:42:20 1.3
@@ -1,13 +1,14 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
-
import com.sun.jdi.*;
import com.sun.jdi.event.*;
import com.sun.jdi.request.*;
import java.util.*;
+import jde.debugger.Protocol;
+import jde.debugger.JDE;
+import jde.debugger.JDEException;
+import jde.debugger.SessionManager;
/**
* EventRequestSpec.java
@@ -47,11 +48,13 @@ import java.util.*;
*
* @author Amit Kumar
* @since 0.1
+ * @version
*/
abstract public class EventRequestSpec implements Protocol {
+
+ private final Long m_ID;
- private final Long myID;
/**
* While setting some specs, the user is allowed to specify a boolean
@@ -63,6 +66,14 @@ abstract public class EventRequestSpec i
*/
public static final Object expressionKey = "expr";
private String expr = null;
+
+ public EventRequestSpec(ReferenceTypeSpec refSpec) {
+ this.refSpec = refSpec;
+
+ m_ID = SessionManager.generateObjectID();
+ }
+
+
public void setExpression(String expr) {
this.expr = expr;
if (request != null)
@@ -126,13 +137,13 @@ abstract public class EventRequestSpec i
while (iter.hasNext()) {
String f = iter.next().toString();
if (request instanceof ClassPrepareRequest) {
- ((ClassPrepareRequest)request).addClassFilter(f);
+ ((ClassPrepareRequest)request).addClassFilter(f);
} else if (request instanceof ClassUnloadRequest) {
- ((ClassUnloadRequest)request).addClassFilter(f);
+ ((ClassUnloadRequest)request).addClassFilter(f);
} else if (request instanceof ExceptionRequest) {
- ((ExceptionRequest)request).addClassFilter(f);
+ ((ExceptionRequest)request).addClassFilter(f);
} else if (request instanceof WatchpointRequest) {
- ((WatchpointRequest)request).addClassFilter(f);
+ ((WatchpointRequest)request).addClassFilter(f);
}
}
}
@@ -165,13 +176,13 @@ abstract public class EventRequestSpec i
while (iter.hasNext()) {
String f = iter.next().toString();
if (request instanceof ClassPrepareRequest) {
- ((ClassPrepareRequest)request).addClassExclusionFilter(f);
+ ((ClassPrepareRequest)request).addClassExclusionFilter(f);
} else if (request instanceof ClassUnloadRequest) {
- ((ClassUnloadRequest)request).addClassExclusionFilter(f);
+ ((ClassUnloadRequest)request).addClassExclusionFilter(f);
} else if (request instanceof ExceptionRequest) {
- ((ExceptionRequest)request).addClassExclusionFilter(f);
+ ((ExceptionRequest)request).addClassExclusionFilter(f);
} else if (request instanceof WatchpointRequest) {
- ((WatchpointRequest)request).addClassExclusionFilter(f);
+ ((WatchpointRequest)request).addClassExclusionFilter(f);
}
}
}
@@ -199,13 +210,6 @@ abstract public class EventRequestSpec i
*/
static public final Object specPropertyKey = "spec";
- /** The Process for which we're toiling so much */
- final DebuggeeProcess proc;
-
- final Integer procID;
-
- final JDE jde;
-
/**
* The reference type spec for this event request spec: this should
* match the ReferenceType for the spec to be
@@ -219,16 +223,8 @@ abstract public class EventRequestSpec i
*/
EventRequest request = null;
- public EventRequestSpec(DebuggeeProcess proc, ReferenceTypeSpec refSpec) {
- this.proc = proc;
- procID = proc.getId();
- jde = JDE.getJDE();
- this.refSpec = refSpec;
- myID = proc.generateObjectID();
- }
-
/** get the id corresponding to this spec */
- public Long getID() { return myID; }
+ public Long getID() { return m_ID; }
/**
* sets the request up. This is called when a resolve succedes.
@@ -246,8 +242,6 @@ abstract public class EventRequestSpec i
// System.out.println("YYY:"+((request.suspendPolicy() ==
EventRequest.SUSPEND_NONE)?"none":"not none"));
request.enable();
- proc.informJDEInstallSuccessful(this);
-
}
public EventRequest getEventRequest() { return request; }
@@ -257,10 +251,8 @@ abstract public class EventRequestSpec i
* the ReferenceType is known to match
* <p>
* if any errors occur at any time during resolution of the event-
- * requestspec, it's entry in the {@link EventRequestSpecList} is
- * removed, and jde
- * informed about it (through
- * {@link jde.debugger.Application#removeSpecAndInformJDE}
+ * requestspec, its entry in the {@link EventRequestSpecList} is
+ * removed, and jde informed about it
* <p>
* @return true if the resolution was successful
*/
@@ -272,22 +264,12 @@ abstract public class EventRequestSpec i
* handling is almost exactly the same as that in
* {@link #attemptImmediateResolve}
* <p>
- * <b>Important Note:</b> This method will <i>always</i> go
through
- * without raising any exceptions. As a result of trying to resolve,
- * an exception might be raised, but that'll only result in the
- * removal of the erring spec from the list, and possibly a message
- * to the jde.
*/
- public void attemptResolve(ReferenceType refType) {
+ public void attemptResolve(ReferenceType refType, Integer procID) throws JDEException
{
if (!isResolved() && refSpec.matches(refType)) {
- try {
- if (resolve(refType))
- setIsResolved();
- } catch (JDEException ex) {
- proc.removeSpecAndInformJDE(this, ex.getMessage());
- } catch (Exception ex) {
- Debug.printIf(ex);
- proc.removeSpecAndInformJDE(this, "Error resolving spec: "+ex.toString());
+ if (resolve(refType)) {
+ JDE.debug(EVENTS, "resolve succeeded: " + refType.name());
+ setIsResolved(procID);
}
}
}
@@ -309,20 +291,17 @@ abstract public class EventRequestSpec i
* removing the highlighting of a breakpoint)
* </ul>
*/
- void attemptImmediateResolve(VirtualMachine vm) {
+ void attemptImmediateResolve(VirtualMachine vm, Integer procID) throws JDEException {
Iterator iter = vm.allClasses().iterator();
- while (iter.hasNext()) {
+
+ // XXX - I added the !isResolved condition, to save some loop iterations.
+ // Since I don't fully understand it, it could be a bug, but I think not. /
Petter
+ while (iter.hasNext() && !isResolved) {
ReferenceType refType = (ReferenceType)iter.next();
if (refSpec.matches(refType)) {
- try {
- if (resolve(refType)) {
- setIsResolved();
- }
- } catch (JDEException ex) {
- proc.removeSpecAndInformJDE(this, ex.getMessage());
- } catch (Exception ex) {
- proc.removeSpecAndInformJDE(this, "Error resolving spec");
- }
+ if (resolve(refType)) {
+ setIsResolved(procID);
+ }
}
}
}
@@ -335,10 +314,11 @@ abstract public class EventRequestSpec i
}
/**
- * set resolved status
+ * set resolved status and notify Emacs.
*/
- public void setIsResolved() {
+ public void setIsResolved(Integer procID) {
isResolved = true;
+ JDE.signal(procID, SPEC_RESOLVED, m_ID.toString(), NOQUOTE);
}
boolean isJavaIdentifier(String s) {
@@ -352,7 +332,7 @@ abstract public class EventRequestSpec i
for (int i = 1; i < s.length(); i++) {
if (! Character.isJavaIdentifierPart(s.charAt(i))) {
- return false;
+ return false;
}
}
@@ -360,3 +340,12 @@ abstract public class EventRequestSpec i
}
} // EventRequestSpec
+
+/*
+ * $Log: EventRequestSpec.java,v $
+ * Revision 1.4 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of EventRequestSpec.java
1.3 +146 -125
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/EventRequestSpecList.java
Index: EventRequestSpecList.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/EventRequestSpecList.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- EventRequestSpecList.java 2001/08/16 03:29:09 1.2
+++ EventRequestSpecList.java 2006/03/03 20:42:20 1.3
@@ -1,18 +1,20 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
import com.sun.jdi.*;
import com.sun.jdi.event.*;
import com.sun.jdi.request.*;
import java.util.*;
+import jde.debugger.JDEException;
+import jde.debugger.JDE;
+import jde.debugger.Debugger;
+import jde.debugger.Protocol;
/**
* EventRequestSpecList.java
* <p>
- * Maintains a list of all the "specs", ie requests by the user for
+ * Maintains a list of all the "specs", i.e. requests by the user for
* notification of a particular type of event. Not all commands create
* specs: watchpoints, breakpoints, and exception catches do.
* <p>
@@ -23,133 +25,152 @@ import java.util.*;
* @author Amit Kumar
* @since 0.1
*/
-
-public class EventRequestSpecList {
-
- /**
- * a Hashmap of all the {@link EventRequestSpec}s for the application,
- * specID -> spec
- */
- private Map eventRequestSpecs =
- Collections.synchronizedMap(new HashMap());
-
- /** The process for which we're maintaining the specs */
- private final DebuggeeProcess proc;
-
- public EventRequestSpecList(DebuggeeProcess proc) {
- this.proc = proc;
- }
-
- // public void setupInitialRequests() {
-
- // ExceptionRequest erequest = em.createExceptionRequest(null, false, true);
- // erequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
- // erequest.enable();
- // }
-
- /**
- * Resolve all deferred eventRequests waiting for 'refType'. This is
- * called when a new reference type is prepared. We iterate through
- * all the requestspecs, calling their
- * {@link EventRequestSpec#attemptResolve(ReferenceType) attemptResolve}
- * methods.
- *
- * @param refType The reference type that was recently prepared
- */
- public void resolve(ReferenceType refType) {
- synchronized(eventRequestSpecs) {
- Iterator iter = eventRequestSpecs.values().iterator();
- while (iter.hasNext()) {
- ((EventRequestSpec)iter.next()).attemptResolve(refType);
- }
- }
- }
- /** Install a new event request spec */
- public void install(EventRequestSpec ers) {
- synchronized (eventRequestSpecs) {
- eventRequestSpecs.put(ers.getID(), ers);
- }
- if (proc.getVM() != null) {
- ers.attemptImmediateResolve(proc.getVM());
- }
- }
+public class EventRequestSpecList implements Protocol {
- /** Delete an existing event request spec */
- public void delete(EventRequestSpec ers) {
- EventRequest request = ers.getEventRequest();
- synchronized (eventRequestSpecs) {
- eventRequestSpecs.remove(ers.getID());
+ /**
+ * a Hashmap of all the {@link EventRequestSpec}s for the application,
+ * specID -> spec
+ */
+ private Map m_eventRequestSpecs;
+ private Debugger m_debugger;
+
+ public EventRequestSpecList(Debugger debugger) {
+ m_eventRequestSpecs = new HashMap();
+ m_debugger = debugger;
+ }
+
+ /**
+ * Resolve all deferred eventRequests waiting for 'refType'. This is
+ * called when a new reference type is prepared. We iterate through
+ * all the requestspecs, calling their
+ * {@link EventRequestSpec#attemptResolve attemptResolve}
+ * methods.
+ *
+ * @param refType The reference type that was recently prepared
+ */
+ public void resolve(ReferenceType refType) {
+ synchronized(m_eventRequestSpecs) {
+ Iterator iter = m_eventRequestSpecs.values().iterator();
+ while (iter.hasNext()) {
+ EventRequestSpec ers = (EventRequestSpec) iter.next();
+
+ try {
+ ers.attemptResolve(refType, m_debugger.getProcID());
}
- if (request != null) {
- request.virtualMachine().eventRequestManager()
- .deleteEventRequest(request);
+ catch (JDEException e) {
+ JDE.debug(EXCEPTION, e.toString());
+ // XXX should I do this:
+ m_eventRequestSpecs.remove(ers.getID());
+ // I think so.
}
+ }
}
-
- /** remove a spec based on its specID */
- public void removeSpec(Long specID)
- throws JDEException {
- synchronized (eventRequestSpecs) {
- if (!eventRequestSpecs.containsKey(specID))
- throw new JDEException("'"+specID+"' doesn't exist");
- delete((EventRequestSpec)eventRequestSpecs.get(specID));
- }
- }
-
- public EventRequestSpec createExceptionIntercept(String classPattern,
- boolean notifyCaught,
- boolean notifyUncaught){
- ReferenceTypeSpec refSpec =
- new PatternReferenceTypeSpec(classPattern);
- EventRequestSpec ers =
- new ExceptionSpec(proc, refSpec, notifyCaught, notifyUncaught);
- return ers;
- }
-
- public WatchpointSpec createAccessWatchpoint
- (String classPattern, String m) {
- ReferenceTypeSpec refSpec =
- new PatternReferenceTypeSpec(classPattern);
- WatchpointSpec ers =
- new AccessWatchpointSpec(proc, refSpec, m);
- return ers;
- }
-
- public WatchpointSpec createModificationWatchpoint
- (String classPattern, String m) {
- ReferenceTypeSpec refSpec =
- new PatternReferenceTypeSpec(classPattern);
- WatchpointSpec ers =
- new ModificationWatchpointSpec(proc, refSpec, m);
- return ers;
- }
-
- public EventRequestSpec createClassLineBreakpoint
- (String classPattern, int line) {
- ReferenceTypeSpec refSpec =
- new PatternReferenceTypeSpec(classPattern);
- EventRequestSpec ers =
- new LineBreakpointSpec(proc, refSpec, line);
- return ers;
- }
-
- public EventRequestSpec createSourceLineBreakpoint
- (String sourceName, int line) {
- ReferenceTypeSpec refSpec =
- new SourceNameReferenceTypeSpec(sourceName, line);
- EventRequestSpec ers =
- new LineBreakpointSpec(proc, refSpec, line);
- return ers;
- }
+ }
+
+ /** Install a new event request spec - XXX synchronize throughout!? */
+ public void install(EventRequestSpec ers) throws JDEException {
+ synchronized (m_eventRequestSpecs) {
+ m_eventRequestSpecs.put(ers.getID(), ers);
+ }
+
+ try {
+ ers.attemptImmediateResolve(m_debugger.getVM(), m_debugger.getProcID());
+ }
+ catch (JDEException e) {
+ synchronized (m_eventRequestSpecs) {
+ m_eventRequestSpecs.remove(ers.getID());
+ }
+ // and propagate the problem
+ throw e;
+ }
+ }
+
+ /** Delete an existing event request spec */
+ public void delete(EventRequestSpec ers) {
+ EventRequest request = ers.getEventRequest();
+ synchronized (m_eventRequestSpecs) {
+ m_eventRequestSpecs.remove(ers.getID());
+ }
+ // XXX - prolly want to change the below stuff
+ if (request != null) {
+ request.virtualMachine().eventRequestManager()
+ .deleteEventRequest(request);
+ }
+ }
+
+ /** remove a spec based on its specID */
+ public void removeSpec(Long specID)
+ throws JDEException {
+ synchronized (m_eventRequestSpecs) {
+ if (!m_eventRequestSpecs.containsKey(specID))
+ throw new JDEException("'"+specID+"' doesn't
exist");
+ delete((EventRequestSpec)m_eventRequestSpecs.get(specID));
+ }
+ }
+
+ public EventRequestSpec createExceptionIntercept(String classPattern,
+ boolean notifyCaught,
+ boolean notifyUncaught){
+ ReferenceTypeSpec refSpec =
+ new PatternReferenceTypeSpec(classPattern);
+ EventRequestSpec ers =
+ new ExceptionSpec(refSpec, notifyCaught, notifyUncaught);
+ return ers;
+ }
+
+ public WatchpointSpec createAccessWatchpoint
+ (String classPattern, String m) {
+ ReferenceTypeSpec refSpec =
+ new PatternReferenceTypeSpec(classPattern);
+ WatchpointSpec ers =
+ new AccessWatchpointSpec(refSpec, m);
+ return ers;
+ }
+
+ public WatchpointSpec createModificationWatchpoint
+ (String classPattern, String m) {
+ ReferenceTypeSpec refSpec =
+ new PatternReferenceTypeSpec(classPattern);
+ WatchpointSpec ers =
+ new ModificationWatchpointSpec(refSpec, m);
+ return ers;
+ }
+
+ public EventRequestSpec createClassLineBreakpoint
+ (String classPattern, int line) {
+ ReferenceTypeSpec refSpec =
+ new PatternReferenceTypeSpec(classPattern);
+ EventRequestSpec ers =
+ new LineBreakpointSpec(refSpec, line);
+ return ers;
+ }
+
+ public EventRequestSpec createSourceLineBreakpoint
+ (String sourceName, int line) {
+ ReferenceTypeSpec refSpec =
+ new SourceNameReferenceTypeSpec(sourceName, line);
+ EventRequestSpec ers =
+ new LineBreakpointSpec(refSpec, line);
+ return ers;
+ }
- public EventRequestSpec createMethodBreakpoint
- (String classPattern, String methodId, List methodArgs) {
- ReferenceTypeSpec refSpec =
- new PatternReferenceTypeSpec(classPattern);
- EventRequestSpec e =
- new MethodBreakpointSpec(proc, refSpec, methodId, methodArgs);
- return e;
- }
+ public EventRequestSpec createMethodBreakpoint
+ (String classPattern, String methodId, List methodArgs) {
+ ReferenceTypeSpec refSpec =
+ new PatternReferenceTypeSpec(classPattern);
+ EventRequestSpec e =
+ new MethodBreakpointSpec(refSpec, methodId, methodArgs);
+ return e;
+ }
} // EventRequestSpecList
+
+/*
+ * $Log: EventRequestSpecList.java,v $
+ * Revision 1.4 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of EventRequestSpecList.java
1.3 +27 -17
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/ExceptionSpec.java
Index: ExceptionSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/ExceptionSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- ExceptionSpec.java 2001/08/16 03:29:09 1.2
+++ ExceptionSpec.java 2006/03/03 20:42:20 1.3
@@ -1,8 +1,5 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
-
import com.sun.jdi.*;
import com.sun.jdi.request.*;
@@ -14,26 +11,39 @@ import com.sun.jdi.request.*;
* Created: Mon Aug 2 17:01:35 1999
*
* @author Amit Kumar
+ * @author Paul Kinnucan
* @since 0.1
+ * @version $Revision: 1.3 $
*/
public class ExceptionSpec extends EventRequestSpec {
- boolean notifyCaught;
+ boolean notifyCaught;
- boolean notifyUncaught;
+ boolean notifyUncaught;
- public ExceptionSpec(DebuggeeProcess proc, ReferenceTypeSpec spec,
- boolean notifyCaught, boolean notifyUncaught) {
- super(proc, spec);
- this.notifyCaught = notifyCaught;
- this.notifyUncaught = notifyUncaught;
- }
-
- public boolean resolve(ReferenceType refType) {
- ExceptionRequest er =
refType.virtualMachine().eventRequestManager().createExceptionRequest(refType,
notifyCaught, notifyUncaught);
- super.setRequest(er);
- return true;
- }
+ public ExceptionSpec(ReferenceTypeSpec spec,
+ boolean notifyCaught, boolean notifyUncaught) {
+ super(spec);
+ this.notifyCaught = notifyCaught;
+ this.notifyUncaught = notifyUncaught;
+ }
+
+ public boolean resolve(ReferenceType refType) {
+ ExceptionRequest er =
+ refType.virtualMachine().eventRequestManager().createExceptionRequest(refType,
notifyCaught, notifyUncaught);
+ super.setRequest(er);
+ return true;
+ }
} // ExceptionSpec
+
+/*
+ * $Log: ExceptionSpec.java,v $
+ * Revision 1.3 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of ExceptionSpec.java
+
1.3 +56 -48
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/LineBreakpointSpec.java
Index: LineBreakpointSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/LineBreakpointSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- LineBreakpointSpec.java 2001/08/16 03:29:09 1.2
+++ LineBreakpointSpec.java 2006/03/03 20:42:20 1.3
@@ -1,12 +1,10 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
-
import com.sun.jdi.*;
import com.sun.jdi.request.*;
import java.util.*;
+import jde.debugger.JDEException;
/**
* LineBreakpointSpec.java
@@ -17,59 +15,69 @@ import java.util.*;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.4 $
*/
public class LineBreakpointSpec extends BreakpointSpec {
- private int lineNumber;
+ private int lineNumber;
- public LineBreakpointSpec(DebuggeeProcess proc, ReferenceTypeSpec refSpec,
- int line) {
- super(proc, refSpec);
- this.lineNumber = line;
+ public LineBreakpointSpec(ReferenceTypeSpec refSpec,
+ int line) {
+ super(refSpec);
+ this.lineNumber = line;
+ }
+
+ boolean resolve(ReferenceType refType) throws JDEException {
+ if (!(refType instanceof ClassType)) {
+ // remove spec from list of current specs
+ throw new JDEException("'"+refType+"' is not a
Class");
}
-
- boolean resolve(ReferenceType refType) throws JDEException {
- if (!(refType instanceof ClassType)) {
- // remove spec from list of current specs
- throw new JDEException("'"+refType+"' is not a
Class");
- }
- Location location = getLocation((ClassType)refType);
- BreakpointRequest br =
refType.virtualMachine().eventRequestManager().createBreakpointRequest(location);
+ Location location = getLocation((ClassType)refType);
+ BreakpointRequest br =
refType.virtualMachine().eventRequestManager().createBreakpointRequest(location);
- setRequest(br);
- return true;
- }
-
- private Location getLocation(ClassType clazz) throws JDEException {
- Location location = null;
- try {
- List locs = null;
- try {
- locs = clazz.locationsOfLine(lineNumber);
- } catch (InvalidLineNumberException ex) {
- throw new JDEException("Line #"+lineNumber+" does not
exist in "+clazz+".");
- }
- if (locs.size() == 0) {
- // remove spec from list of current specs
- throw new JDEException("Line #"+lineNumber+" does not
exist int "+clazz+".");
- }
- // XXX handle multiple locations
- location = (Location)locs.get(0);
- if (location.method() == null) {
- // remove spec from list of current specs
- throw new JDEException("Line #"+lineNumber+" does not
correspond to a method in "+
- clazz + ".");
- }
- } catch (AbsentInformationException e) {
- // remove spec from list of current specs
- throw new JDEException("Line Information missing for Class
'"+clazz+"'");
- }
- return location;
+ setRequest(br);
+ return true;
+ }
+
+ private Location getLocation(ClassType clazz) throws JDEException {
+ Location location = null;
+ try {
+ List locs = null;
+ try {
+ locs = clazz.locationsOfLine(lineNumber);
+ } catch (InvalidLineNumberException ex) {
+ throw new JDEException("Line #"+lineNumber+" does not exist in
"+clazz+".");
+ }
+ if (locs.size() == 0) {
+ // remove spec from list of current specs
+ throw new JDEException("Line #"+lineNumber+" does not exist int
"+clazz+".");
+ }
+ // XXX handle multiple locations
+ location = (Location)locs.get(0);
+ if (location.method() == null) {
+ // remove spec from list of current specs
+ throw new JDEException("Line #"+lineNumber+" does not correspond
to a method in "+
+ clazz + ".");
+ }
+ } catch (AbsentInformationException e) {
+ // remove spec from list of current specs
+ throw new JDEException("Line Information missing for Class
'"+clazz+"'");
}
+ return location;
+ }
- public int getLineNumber() {
- return lineNumber;
- }
+ public int getLineNumber() {
+ return lineNumber;
+ }
} // LineBreakpointSpec
+
+/*
+ * $Log: LineBreakpointSpec.java,v $
+ * Revision 1.4 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of LineBreakpointSpec.java
1.3 +224 -215
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/MethodBreakpointSpec.java
Index: MethodBreakpointSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/MethodBreakpointSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- MethodBreakpointSpec.java 2001/08/16 03:29:09 1.2
+++ MethodBreakpointSpec.java 2006/03/03 20:42:20 1.3
@@ -1,12 +1,10 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
-
import com.sun.jdi.*;
import com.sun.jdi.request.*;
import java.util.*;
+import jde.debugger.JDEException;
/**
* MethodBreakpointSpec.java
@@ -19,227 +17,238 @@ import java.util.*;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.3 $
*/
public class MethodBreakpointSpec extends BreakpointSpec {
- String methodName;
- List methodArgs;
+ String methodName;
+ List methodArgs;
- public MethodBreakpointSpec(DebuggeeProcess proc, ReferenceTypeSpec refSpec,
- String methodName, List methodArgs) {
- super(proc, refSpec);
- this.methodName = methodName;
- this.methodArgs = methodArgs;
- }
-
- boolean resolve(ReferenceType refType) throws JDEException {
- if (!isValidMethodName(methodName)) {
- throw new JDEException("'"+methodName+"' is not a
valid method name.");
- }
- if (!(refType instanceof ClassType)) {
- throw new JDEException("'"+refType+"' is not a
Class");
- }
- Location location = getLocation((ClassType)refType);
- if (location == null) {
- throw new JDEException("Can't set breakpoint on an abstract/native
method");
- }
- BreakpointRequest br =
refType.virtualMachine().eventRequestManager().createBreakpointRequest(location);
-
- setRequest(br);
- return true;
- }
-
- private Location getLocation(ClassType clazz) throws JDEException {
- Method method = findMatchingMethod(clazz);
- Location location = method.location();
- return location;
- }
+ public MethodBreakpointSpec(ReferenceTypeSpec refSpec,
+ String methodName, List methodArgs) {
+ super(refSpec);
+ this.methodName = methodName;
+ this.methodArgs = methodArgs;
+ }
+
+ boolean resolve(ReferenceType refType) throws JDEException {
+ if (!isValidMethodName(methodName)) {
+ throw new JDEException("'"+methodName+"' is not a valid
method name.");
+ }
+ if (!(refType instanceof ClassType)) {
+ throw new JDEException("'"+refType+"' is not a Class");
+ }
+ Location location = getLocation((ClassType)refType);
+ if (location == null) {
+ throw new JDEException("Can't set breakpoint on an abstract/native
method");
+ }
+ BreakpointRequest br =
refType.virtualMachine().eventRequestManager().createBreakpointRequest(location);
+
+ setRequest(br);
+ return true;
+ }
+
+ private Location getLocation(ClassType clazz) throws JDEException {
+ Method method = findMatchingMethod(clazz);
+ Location location = method.location();
+ return location;
+ }
- public String getMethodName() {
- return methodName;
- }
-
- public List getMethodArgs() {
- return methodArgs;
- }
-
- public String toString() {
- StringBuffer buffer = new StringBuffer("break in_method ");
- if (refSpec instanceof SourceNameReferenceTypeSpec) {
- buffer.append(((SourceNameReferenceTypeSpec)refSpec).getSourceName());
- } else if (refSpec instanceof PatternReferenceTypeSpec) {
- buffer.append(((PatternReferenceTypeSpec)refSpec).getClassPattern());
- }
- buffer.append(" "+methodName+" ");
- if (methodArgs != null) {
- Iterator iter = methodArgs.iterator();
- boolean first = true;
- buffer.append('(');
- while (iter.hasNext()) {
- if (!first) {
- buffer.append(',');
- }
- buffer.append((String)iter.next());
- first = false;
- }
- buffer.append(")");
- }
- return buffer.toString();
- }
-
- private boolean isValidMethodName(String s) {
- return isJavaIdentifier(s) ||
- s.equals("<init>") ||
- s.equals("<clinit>");
- }
-
+ public String getMethodName() {
+ return methodName;
+ }
+
+ public List getMethodArgs() {
+ return methodArgs;
+ }
+
+ public String toString() {
+ StringBuffer buffer = new StringBuffer("break in_method ");
+ if (refSpec instanceof SourceNameReferenceTypeSpec) {
+ buffer.append(((SourceNameReferenceTypeSpec)refSpec).getSourceName());
+ } else if (refSpec instanceof PatternReferenceTypeSpec) {
+ buffer.append(((PatternReferenceTypeSpec)refSpec).getClassPattern());
+ }
+ buffer.append(" "+methodName+" ");
+ if (methodArgs != null) {
+ Iterator iter = methodArgs.iterator();
+ boolean first = true;
+ buffer.append('(');
+ while (iter.hasNext()) {
+ if (!first) {
+ buffer.append(',');
+ }
+ buffer.append((String)iter.next());
+ first = false;
+ }
+ buffer.append(")");
+ }
+ return buffer.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 and if the number of
+ * arguments in the method matches the number of names passed
+ */
+ private boolean compareArgTypes(Method method, List nameList) {
+ List argTypeNames = method.argumentTypeNames();
+
+
+ // If argument counts differ, we can stop here
+ if (argTypeNames.size() != nameList.size()) {
+ return false;
+ }
+
+ // Compare each argument type's name
+ for (int i=0; i<argTypeNames.size(); ++i) {
+ String comp1 = (String)argTypeNames.get(i);
+ String comp2 = (String)nameList.get(i);
+ if (! comp1.equals(comp2)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Remove unneeded spaces and expand class names to fully
+ * qualified names, if necessary and possible.
+ */
+ private String normalizeArgTypeName(String name)
+ throws JDEException {
/*
- * 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 and if the number of
- * arguments in the method matches the number of names passed
+ * Separate the type name from any array modifiers,
+ * stripping whitespace after the name ends
*/
- private boolean compareArgTypes(Method method, List nameList) {
- List argTypeNames = method.argumentTypeNames();
-
-
- // If argument counts differ, we can stop here
- if (argTypeNames.size() != nameList.size()) {
- return false;
- }
-
- // Compare each argument type's name
- for (int i=0; i<argTypeNames.size(); ++i) {
- String comp1 = (String)argTypeNames.get(i);
- String comp2 = (String)nameList.get(i);
- if (! comp1.equals(comp2)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Remove unneeded spaces and expand class names to fully
- * qualified names, if necessary and possible.
+ int i = 0;
+ StringBuffer typePart = new StringBuffer();
+ StringBuffer arrayPart = new StringBuffer();
+ name = name.trim();
+ while (i < name.length()) {
+ char c = name.charAt(i);
+ if (Character.isWhitespace(c) || c == '[') {
+ break; // name is complete
+ }
+ typePart.append(c);
+ i++;
+ }
+ while (i < name.length()) {
+ char c = name.charAt(i);
+ if ( (c == '[') || (c == ']') ) {
+ arrayPart.append(c);
+ } else if (!Character.isWhitespace(c)) {
+ throw new JDEException("At least one of the arguments of method
'"+methodName+"' is invalid.");
+ }
+ 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
*/
- private String normalizeArgTypeName(String name)
- throws JDEException {
- /*
- * Separate the type name from any array modifiers,
- * stripping whitespace after the name ends
- */
- int i = 0;
- StringBuffer typePart = new StringBuffer();
- StringBuffer arrayPart = new StringBuffer();
- name = name.trim();
- while (i < name.length()) {
- char c = name.charAt(i);
- if (Character.isWhitespace(c) || c == '[') {
- break; // name is complete
- }
- typePart.append(c);
- i++;
- }
- while (i < name.length()) {
- char c = name.charAt(i);
- if ( (c == '[') || (c == ']') ) {
- arrayPart.append(c);
- } else if (!Character.isWhitespace(c)) {
- throw new JDEException("At least one of the arguments of method
'"+methodName+"' is invalid.");
- }
- 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 = proc.findClassesMatchingPattern(name);
- // if more than one class match, take the first, but
- // inform anyways.
- if (refs.size() > 0) {
- name = ((ReferenceType)(refs.get(0))).name();
- // warn
- if (refs.size() > 1) {
- jde.signal(procID, WARNING, "(Method Breakpoint Warning) More than one classes
matched resolving an argument for method '"+methodName+"'. Defaulting to
the first match.");
- }
- }
- } catch (IllegalArgumentException e) {
- // We'll try the name as is
- }
- }
- name += arrayPart.toString();
- return name;
+ if ((name.indexOf('.') == -1) || name.startsWith("*.")) {
+ try {
+ List refs = new LinkedList(); // XXX to get it to compile
+ // List refs = proc.findClassesMatchingPattern(name);
+ // if more than one class match, take the first, but
+ // inform anyways.
+ if (refs.size() > 0) {
+ name = ((ReferenceType)(refs.get(0))).name();
+ // warn
+ if (refs.size() > 1) {
+ // jde.signal(procID, WARNING, "(Method Breakpoint Warning) More than
one classes matched resolving an argument for method '"+methodName+"'.
Defaulting to the first match.");
+ }
+ }
+ } catch (IllegalArgumentException e) {
+ // We'll try the name as is
+ }
+ }
+ name += arrayPart.toString();
+ 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 JDEException {
+
+ // Normalize the argument string once before looping below.
+ List argTypeNames = null;
+ if (methodArgs != null) {
+ argTypeNames = new ArrayList(methodArgs.size());
+ Iterator iter = methodArgs.iterator();
+ while (iter.hasNext()) {
+ String name = (String)iter.next();
+ name = normalizeArgTypeName(name);
+ argTypeNames.add(name);
+ }
+ }
+
+ // Check each method in the class for matches
+ Iterator iter = clazz.methods().iterator();
+ Method firstMatch = null; // first method with matching name
+ Method exactMatch = null; // (only) method with same name & sig
+ int matchCount = 0; // > 1 implies overload
+ while (iter.hasNext()) {
+ Method candidate = (Method)iter.next();
+
+ if (candidate.name().equals(getMethodName())) {
+ 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 JDEException("Ambiguous method '"+methodName+"'.
Specify arguments.");
+ }
+ } else {
+ throw new JDEException("No method named '"+methodName+"' in
class.");
}
-
- /*
- * 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 JDEException {
-
- // Normalize the argument string once before looping below.
- List argTypeNames = null;
- if (methodArgs != null) {
- argTypeNames = new ArrayList(methodArgs.size());
- Iterator iter = methodArgs.iterator();
- while (iter.hasNext()) {
- String name = (String)iter.next();
- name = normalizeArgTypeName(name);
- argTypeNames.add(name);
- }
- }
-
- // Check each method in the class for matches
- Iterator iter = clazz.methods().iterator();
- Method firstMatch = null; // first method with matching name
- Method exactMatch = null; // (only) method with same name & sig
- int matchCount = 0; // > 1 implies overload
- while (iter.hasNext()) {
- Method candidate = (Method)iter.next();
-
- if (candidate.name().equals(getMethodName())) {
- 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 JDEException("Ambiguous method
'"+methodName+"'. Specify arguments.");
- }
- } else {
- throw new JDEException("No method named
'"+methodName+"' in class.");
- }
- return method;
- }
+ return method;
+ }
} // MethodBreakpointSpec
+
+/*
+ * $Log: MethodBreakpointSpec.java,v $
+ * Revision 1.3 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of MethodBreakpointSpec.java
1.3 +23 -15
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/ModificationWatchpointSpec.java
Index: ModificationWatchpointSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/ModificationWatchpointSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- ModificationWatchpointSpec.java 2001/08/16 03:29:10 1.2
+++ ModificationWatchpointSpec.java 2006/03/03 20:42:21 1.3
@@ -1,10 +1,8 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
-
import com.sun.jdi.*;
import com.sun.jdi.request.*;
+import jde.debugger.JDEException;
/**
* ModificationWatchpointSpec.java
@@ -15,22 +13,32 @@ import com.sun.jdi.request.*;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.3 $
*/
public class ModificationWatchpointSpec extends WatchpointSpec {
-
- public ModificationWatchpointSpec(DebuggeeProcess proc, ReferenceTypeSpec refSpec,
String fieldName) {
- super(proc, refSpec, fieldName);
- }
- boolean resolve(ReferenceType refType) throws JDEException {
- Field field = refType.fieldByName(fieldName);
- if (field == null) {
- throw new JDEException("'"+fieldName+"' does not exist in the
class");
- }
- EventRequest er =
refType.virtualMachine().eventRequestManager().createModificationWatchpointRequest(field);
- setRequest(er);
- return true;
+ public ModificationWatchpointSpec(ReferenceTypeSpec refSpec, String fieldName) {
+ super(refSpec, fieldName);
+ }
+
+ boolean resolve(ReferenceType refType) throws JDEException {
+ Field field = refType.fieldByName(fieldName);
+ if (field == null) {
+ throw new JDEException("'"+fieldName+"' does not exist in
the class");
}
+ EventRequest er =
refType.virtualMachine().eventRequestManager().createModificationWatchpointRequest(field);
+ setRequest(er);
+ return true;
+ }
} // ModificationWatchpointSpec
+
+/*
+ * $Log: ModificationWatchpointSpec.java,v $
+ * Revision 1.3 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of ModificationWatchpointSpec.java
1.3 +11 -3
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/PatternReferenceTypeSpec.java
Index: PatternReferenceTypeSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/PatternReferenceTypeSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- PatternReferenceTypeSpec.java 2001/08/16 03:29:10 1.2
+++ PatternReferenceTypeSpec.java 2006/03/03 20:42:21 1.3
@@ -1,11 +1,9 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
-
import com.sun.jdi.*;
import java.util.*;
+import jde.debugger.JDEException;
/**
* PatternReferenceTypeSpec.java
@@ -15,6 +13,7 @@ import java.util.*;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.2 $
*/
public class PatternReferenceTypeSpec implements ReferenceTypeSpec {
@@ -83,3 +82,12 @@ public class PatternReferenceTypeSpec im
}
} // PatternReferenceTypeSpec
+
+/*
+ * $Log: PatternReferenceTypeSpec.java,v $
+ * Revision 1.2 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of PatternReferenceTypeSpec.java
1.3 +17 -4
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/ReferenceTypeSpec.java
Index: ReferenceTypeSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/ReferenceTypeSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- ReferenceTypeSpec.java 2001/08/16 03:29:10 1.2
+++ ReferenceTypeSpec.java 2006/03/03 20:42:21 1.3
@@ -1,7 +1,7 @@
-
package jde.debugger.spec;
import com.sun.jdi.*;
+import jde.debugger.Protocol;
/**
* ReferenceTypeSpec.java
@@ -9,15 +9,28 @@ import com.sun.jdi.*;
*
* Created: Mon Jul 19 13:19:23 1999
*
+ * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
+ *
+ *
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.2 $
*/
-public interface ReferenceTypeSpec {
+public interface ReferenceTypeSpec extends Protocol {
/**
* @return true if the ref type matches this spec
*/
- public boolean matches(ReferenceType refType);
+ public boolean matches(ReferenceType refType);
+
+}
+
+/*
+ * $Log: ReferenceTypeSpec.java,v $
+ * Revision 1.2 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
-} // ReferenceTypeSpec
+// End of ReferenceTypeSpec.java
1.3 +76 -32
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/SourceNameReferenceTypeSpec.java
Index: SourceNameReferenceTypeSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/SourceNameReferenceTypeSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- SourceNameReferenceTypeSpec.java 2001/08/16 03:29:10 1.2
+++ SourceNameReferenceTypeSpec.java 2006/03/03 20:42:21 1.3
@@ -1,11 +1,9 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
import com.sun.jdi.*;
-
import java.util.*;
+import jde.debugger.JDE;
/**
* SourceNameReferenceTypeSpec.java
@@ -15,50 +13,96 @@ import java.util.*;
*
* @author Amit Kumar
* @since 0.1
+ * @version $Revision: 1.3 $
*/
public class SourceNameReferenceTypeSpec implements ReferenceTypeSpec {
- final String sourceName;
- final int lineNumber;
+ final String m_sourceName;
+ final int m_lineNumber;
public SourceNameReferenceTypeSpec(String src, int line) {
- sourceName = src;
- lineNumber = line;
+ m_sourceName = src;
+ m_lineNumber = line;
}
-
+
public String getSourceName() {
- return sourceName;
+ return m_sourceName;
}
-
+
/**
* Does the specified ReferenceType match this spec.
*/
- public boolean matches(ReferenceType refType) {
- try {
- if (refType.sourceName().equals(sourceName)) {
+ public boolean matches(ReferenceType refType) {
try {
- // Jdebug.theDebugger.signalDebug("Matching " +
- // refType.sourceName() + ", " + lineNumber);
- List locs = refType.locationsOfLine(lineNumber);
- // Jdebug.theDebugger.signalDebug(" Matched");
- // if we don't throw an exception then it was found
-
- return (locs.size() > 0) ? true : false;
-
+ // Need to fix up the source name as indicated in the ReferenceType, due to
+ // the following bugs in the implementation of javac:
+ //
http://developer.java.sun.com/developer/bugParade/bugs/4241573.html
+ //
http://developer.java.sun.com/developer/bugParade/bugs/4404985.html
+ //
http://developer.java.sun.com/developer/bugParade/bugs/4334342.html
+ //
+ // what happens is that the compiler sometimes incorrectly includes path
+ // information in the SourceFile attribute of the class file. Also, the
+ // directory separator can be either forward or backward slash, independent
+ // of the system-wide file separator, so we need to check for both.
+
+ String sourceMaybeWithPath = refType.sourceName();
+ int directorySepIndex = sourceMaybeWithPath.lastIndexOf('/');
+
+ if (directorySepIndex == -1) {
+ directorySepIndex = sourceMaybeWithPath.lastIndexOf('\\');
+ }
+
+ String refSourceName = sourceMaybeWithPath;
+
+ if (directorySepIndex > -1) {
+ refSourceName = sourceMaybeWithPath.substring(directorySepIndex + 1);
+ }
+
+ /* Debug.printIf(Debug.EVENTS, "SourceNameRefTSpec.matches(): m_src
<" + m_sourceName + ">, " +
+ "refT.src <" + refType.sourceName() + ">, modified src
<" + refSourceName + ">");
+ */
+
+ if (refSourceName.equals(m_sourceName)) {
+ try {
+ List locs = refType.locationsOfLine(m_lineNumber);
+ // if we don't throw an exception then it was found
+ // XXX - here, I would like to identify "erroneous" breakpoints, that
is,
+ // breakpoints that don't map to any byte code location. They should be
+ // flagged in such a way that the UI can remove/highlight them as incorrect.
+
+ return locs.size() > 0;
+
+ } catch(Exception exc) {
+ /*
+ } catch(AbsentInformationException exc) {
+ } catch(ObjectCollectedException exc) {
+ } catch(InvalidLineNumberException exc) {
+ } catch(ClassNotPreparedException exc) {
+ */
+ // -- should not happen, so don't catch this ---
+ JDE.debug(EXCEPTION, exc.toString());
+ }
+ }
} catch(AbsentInformationException exc) {
- } catch(ObjectCollectedException exc) {
- } catch(InvalidLineNumberException exc) {
- } catch(ClassNotPreparedException exc) {
- // -- should not happen, so don't catch this ---
+ // for sourceName(), fall through, it happens a lot with uninteresting
+ // classes (standard classes compiled without -g, for instance).
}
- }
- } catch(AbsentInformationException exc) {
- // for sourceName(), fall through
+ return false;
}
- return false;
- }
-
-public String toString() { return sourceName+" "+lineNumber; }
+
+ public String toString() {
+ return m_sourceName + " " + m_lineNumber;
+ }
} // SourceNameReferenceTypeSpec
+
+
+/*
+ * $Log: SourceNameReferenceTypeSpec.java,v $
+ * Revision 1.3 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of SourceNameReferenceTypeSpec.java
1.3 +13 -5
XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/WatchpointSpec.java
Index: WatchpointSpec.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/debugger/spec/WatchpointSpec.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- WatchpointSpec.java 2001/08/16 03:29:10 1.2
+++ WatchpointSpec.java 2006/03/03 20:42:21 1.3
@@ -1,7 +1,5 @@
-
package jde.debugger.spec;
-import jde.debugger.*;
import com.sun.jdi.*;
import com.sun.jdi.request.*;
@@ -14,7 +12,8 @@ import com.sun.jdi.request.*;
* Created: Tue Aug 3 15:25:42 1999
*
* @author Amit Kumar
- * @since 0.1
+ * @since 0.1\
+ * @version $Revision: 1.3 $
*/
abstract public class WatchpointSpec extends EventRequestSpec {
@@ -33,9 +32,9 @@ abstract public class WatchpointSpec ext
String fieldName;
- public WatchpointSpec(DebuggeeProcess proc, ReferenceTypeSpec refSpec,
+ public WatchpointSpec(ReferenceTypeSpec refSpec,
String fieldName) {
- super(proc, refSpec);
+ super(refSpec);
this.fieldName = fieldName;
}
@@ -45,3 +44,12 @@ abstract public class WatchpointSpec ext
}
} // WatchpointSpec
+
+/*
+ * $Log: WatchpointSpec.java,v $
+ * Revision 1.3 2003/01/15 06:06:15 paulk
+ * Petter Mahlen's changes.
+ *
+ */
+
+// End of WatchpointSpec.java
1.4 +15 -2 XEmacs/packages/xemacs-packages/jde/java/src/jde/util/ClassInfo.java
Index: ClassInfo.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/util/ClassInfo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- ClassInfo.java 2003/01/18 05:48:39 1.3
+++ ClassInfo.java 2006/03/03 20:42:27 1.4
@@ -1,6 +1,6 @@
/*
* ClassInfo.java
- * Copyright (C) 2002 Rodrigo Reyes (reyes(a)chez.com),
+ * Copyright (C) 2002, 2003 Rodrigo Reyes (reyes(a)chez.com),
* Javier Lopez (jslopez(a)forumsys.com),
* Petter Måhlén (petter.mahlen(a)chello.se)
* Paul Kinnucan (pkinnucan(a)attbi.com)
@@ -504,7 +504,20 @@ public class ClassInfo {
} catch (IOException e) {
}
}
- } catch (Exception cnfe) {System.out.println(NIL);}
+ } catch (ClassNotFoundException e) {
+ System.out.println(NIL);
+ } catch (Exception e) {
+ System.out.println("(error \"Trying to load " + className +
+ " caused a Java exception: " + e + "\")");
+ } catch (UnsatisfiedLinkError e) {
+ // This occurs with classes that have native methods whose native
+ // implementations cannot be found.
+ System.out.println("(error \"Trying to load " + className +
+ " caused a Java UnsatisfiedLinkError: " + e + "\")");
+ } catch (LinkageError e) {
+ System.out.println("(error \"Trying to load " + className +
+ " caused a Java LinkageError: " + e + "\")");
+ }
}
1.4 +8 -6
XEmacs/packages/xemacs-packages/jde/java/src/jde/util/ClassPathDir.java
Index: ClassPathDir.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/util/ClassPathDir.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- ClassPathDir.java 2003/01/18 05:48:39 1.3
+++ ClassPathDir.java 2006/03/03 20:42:27 1.4
@@ -1,13 +1,12 @@
package jde.util;
-import java.io.*;
-import java.util.*;
+import java.io.File;
/**
- * A ClassPathEntry which represents a directory in which classes are
+ * A ClassPathEntry that represents a directory in which classes are
* stored. This is scanned recursively for classes at load time.
*
- * Copyright (C) 2001, 2002 Eric D. Friedman (eric(a)hfriedman.rdsl.lmi.net)
+ * Copyright (C) 2001, 2002, 2003 Eric D. Friedman (eric(a)hfriedman.rdsl.lmi.net)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,7 +25,7 @@ import java.util.*;
* Created: Tue Aug 14 19:46:52 2001
*
* @author Eric D. Friedman
- * @version $Id: ClassPathDir.java,v 1.3 2002/11/30 04:30:14 paulk Exp $
+ * @version $Id: ClassPathDir.java,v 1.4 2003/10/20 03:55:49 paulk Exp $
*/
class ClassPathDir extends ClassPathEntry {
@@ -123,7 +122,10 @@ class ClassPathDir extends ClassPathEntr
}// ClassPathDir
/*
- * $Log:$
+ * $Log: ClassPathDir.java,v $
+ * Revision 1.4 2003/10/20 03:55:49 paulk
+ * Fix to handle inner classes.
+ *
*
*
*/
1.4 +12 -2
XEmacs/packages/xemacs-packages/jde/java/src/jde/util/ClassPathEntry.java
Index: ClassPathEntry.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/util/ClassPathEntry.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- ClassPathEntry.java 2003/01/18 05:48:39 1.3
+++ ClassPathEntry.java 2006/03/03 20:42:28 1.4
@@ -38,7 +38,7 @@ import java.util.Map;
* Created: Tue Aug 14 19:28:04 2001
*
* @author Eric D. Friedman
- * @version $Id: ClassPathEntry.java,v 1.3 2001/10/17 04:09:33 paulk Exp $
+ * @version $Id: ClassPathEntry.java,v 1.4 2002/09/06 12:57:55 jslopez Exp $
*/
abstract class ClassPathEntry {
@@ -121,7 +121,12 @@ abstract class ClassPathEntry {
String unqualified;
int lastDot = qualifiedName.lastIndexOf('.');
- unqualified = qualifiedName.substring(lastDot + 1);
+ int innerClass = qualifiedName.indexOf('$');
+ if (innerClass < 0) {
+ unqualified = qualifiedName.substring(lastDot + 1);
+ } else {
+ unqualified = qualifiedName.substring(innerClass + 1);
+ }
nameToClassMap.put(unqualified, qualifiedName);
}
@@ -163,6 +168,11 @@ abstract class ClassPathEntry {
/*
* $Log: ClassPathEntry.java,v $
+ * Revision 1.4 2002/09/06 12:57:55 jslopez
+ * Fixes addClass method to handle inner classes in a friendlier manner.
+ * The key for an inner class such as jde.util.A$B was A$B.
+ * Now the key for such a class is only B.
+ *
* Revision 1.3 2001/10/17 04:09:33 paulk
* Cosmetic changes to fit JDE coding style.
*
1.7 +44 -5
XEmacs/packages/xemacs-packages/jde/java/src/jde/util/Completion.java
Index: Completion.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/util/Completion.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- Completion.java 2003/01/18 05:48:39 1.6
+++ Completion.java 2006/03/03 20:42:28 1.7
@@ -1,9 +1,9 @@
/*
*
* Completion.java
- * Copyright (C) 1999, 2001, 2002 Rodrigo Reyes (reyes(a)chez.com)
+ * Copyright (C) 1999, 2001, 2002, 2003 Rodrigo Reyes (reyes(a)chez.com)
*
- * $Revision: 1.20 $
+ * $Revision: 1.23 $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -527,7 +527,22 @@ public class Completion {
} catch (IOException e) {
}
}
- } catch (Exception cnfe) {System.out.println(NIL);}
+ } catch (ClassNotFoundException e) {
+ System.out.println(NIL);
+ } catch (Exception e) {
+ System.out.println("(error \"Trying to load " + className +
+ " caused a Java exception: " + e + "\")");
+ } catch (NoClassDefFoundError e) {
+ System.out.println(NIL);
+ } catch (UnsatisfiedLinkError e) {
+ // This occurs with classes that have native methods whose native
+ // implementations cannot be found.
+ System.out.println("(error \"Trying to load " + className +
+ " caused a Java UnsatisfiedLinkError: " + e + "\")");
+ } catch (LinkageError e) {
+ System.out.println("(error \"Trying to load " + className +
+ " caused a Java LinkageError: " + e + "\")");
+ }
}
/**
@@ -548,8 +563,22 @@ public class Completion {
if (c != null) {
getClassInfo(name);
}
- } catch (ClassNotFoundException cnfe) { }
-
+ } catch (ClassNotFoundException e) {
+ // try to find className in another package.
+ } catch (Exception e) {
+ System.out.println("(error \"Trying to load " + name +
+ " caused a Java exception: " + e + "\")");
+ } catch (NoClassDefFoundError e) {
+ System.out.println(NIL);
+ } catch (UnsatisfiedLinkError e) {
+ // This occurs with classes that have native methods whose native
+ // implementations cannot be found.
+ System.out.println("(error \"Trying to load " + name +
+ " caused a Java UnsatisfiedLinkError: " + e + "\")");
+ } catch (LinkageError e) {
+ System.out.println("(error \"Trying to load " + name +
+ " caused a Java LinkageError: " + e + "\")");
+ }
}
System.out.println(NIL);
}
@@ -582,6 +611,16 @@ public class Completion {
/*
* $Log: Completion.java,v $
+ * Revision 1.23 2003/07/25 04:40:54 paulk
+ * Return NIL for NoClassDefFoundError.
+ *
+ * Revision 1.22 2003/07/25 04:26:09 paulk
+ * Revert to outputting nil for class not found exception.
+ *
+ * Revision 1.21 2003/07/25 04:10:18 paulk
+ * Trigger a Lisp error if trying to load a class causes a Java error or
+ * exception.
+ *
* Revision 1.20 2002/02/21 12:23:57 jslopez
* Rollback to create a new instance of the
* DynamicClassLoader all the time.
1.8 +22 -8
XEmacs/packages/xemacs-packages/jde/java/src/jde/util/JdeUtilities.java
Index: JdeUtilities.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/util/JdeUtilities.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- JdeUtilities.java 2003/01/18 05:48:39 1.7
+++ JdeUtilities.java 2006/03/03 20:42:28 1.8
@@ -1,8 +1,8 @@
/*
* JdeUtilities.java
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * Copyright (C) 1999-2002 Len Trigg (trigg(a)cs.waikato.ac.nz)
+ * Copyright (C) 1999-2003 Len Trigg (trigg(a)cs.waikato.ac.nz)
* Copyright (C) 1999-2002 Paul Kinnucan (paulk(a)mathworks.com)
*
* This program is free software; you can redistribute it and/or modify
@@ -32,7 +32,7 @@ import java.util.*;
* @author Paul Kinnucan (paulk(a)mathworks.com)
* @author Matt Conway (Matt_Conway(a)i2.com )
* @author Eric D. Friedman (eric(a)hfriedman.rdsl.lmi.net)
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public class JdeUtilities {
@@ -108,11 +108,22 @@ public class JdeUtilities {
DynamicClassLoader dcl = new DynamicClassLoader();
dcl.loadClass( fqn );
System.out.println( T );
- } catch (NoClassDefFoundError ex1) {
- System.out.println( NIL );
- } catch(Exception ex2) {
- System.out.println( NIL );
- }//catch
+ } catch (ClassNotFoundException e) {
+ System.out.println(NIL);
+ } catch (Exception e) {
+ System.out.println("(error \"Trying to load " + fqn +
+ " caused a Java exception: " + e + "\")");
+ } catch (NoClassDefFoundError ex1) {
+ System.out.println( NIL );
+ } catch (UnsatisfiedLinkError e) {
+ // This occurs with classes that have native methods whose native
+ // implementations cannot be found.
+ System.out.println("(error \"Trying to load " + fqn +
+ " caused a Java UnsatisfiedLinkError: " + e + "\")");
+ } catch (LinkageError e) {
+ System.out.println("(error \"Trying to load " + fqn +
+ " caused a Java LinkageError: " + e + "\")");
+ }
}//met
/**
@@ -179,6 +190,9 @@ public class JdeUtilities {
/*
* $Log: JdeUtilities.java,v $
+ * Revision 1.11 2003/07/25 04:39:46 paulk
+ * More precisely catch exceptions and errors in classExists() method.
+ *
* Revision 1.10 2002/02/21 12:25:40 jslopez
* Adds method getCurrentClassPath.
* Update method classExists to use the DynamicClassLoader.
1.4 +123 -114
XEmacs/packages/xemacs-packages/jde/java/src/jde/util/ProjectClasses.java
Index: ProjectClasses.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/util/ProjectClasses.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- ProjectClasses.java 2003/01/18 05:48:39 1.3
+++ ProjectClasses.java 2006/03/03 20:42:28 1.4
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Eric D. Friedman (eric(a)hfriedman.rdsl.lmi.net)
+ * Copyright (C) 2001, 2003 Eric D. Friedman (eric(a)hfriedman.rdsl.lmi.net)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,135 +34,144 @@ import java.util.StringTokenizer;
* across projects and so are not loaded/copied more than once.
*
* @author Eric D. Friedman
- * @version $Id: ProjectClasses.java,v 1.5 2002/02/21 12:24:32 jslopez Exp $
+ * @version $Id: ProjectClasses.java,v 1.6 2003/06/18 10:12:53 paulk Exp $
*/
class ProjectClasses {
- private String classPath;
- // the boot classpath is loaded at startup.
- private static ArrayList bootClassPathEntries = new ArrayList();
- static {
- try {
- loadBootClassPathEntries();
- } catch (IOException e) {
- e.printStackTrace(System.err);
- } // end of try-catch
+ private String classPath;
+ // the boot classpath is loaded at startup.
+ private static ArrayList bootClassPathEntries = new ArrayList();
+ static {
+ try {
+ loadBootClassPathEntries();
+ } catch (IOException e) {
+ e.printStackTrace(System.err);
+ } // end of try-catch
+ }
+
+ // take a shallow clone of the boot classpath as the starting
+ // point for the project classpath.
+ private List classPathEntries = (List)bootClassPathEntries.clone();
+
+ /**
+ * Creates a new <code>ProjectClasses</code> instance.
+ *
+ * @param classPath the project classpath
+ * @exception IOException if an error occurs
+ */
+ ProjectClasses(String classPath) throws IOException {
+ this.classPath = classPath;
+
+ String classPathEntry;
+ File classPathFile;
+ StringTokenizer st = new StringTokenizer(classPath,
+ File.pathSeparator);
+
+ while (st.hasMoreTokens()) {
+ classPathEntry = st.nextToken();
+ classPathFile = new File(classPathEntry);
+ if (classPathFile.exists()) {
+ ClassPathEntry cpe = ClassPathEntry.instanceForEntry(classPathFile);
+ if (cpe != null) {
+ classPathEntries.add(cpe);
+ } // end of if (cpe != null)
+ }
+ }
+ }
+
+ void reloadClasses() throws IOException {
+ ClassPathEntry cpe;
+
+ for (Iterator i = classPathEntries.iterator(); i.hasNext();) {
+ cpe = (ClassPathEntry)i.next();
+ cpe.reload();
}
-
- // take a shallow clone of the boot classpath as the starting
- // point for the project classpath.
- private List classPathEntries = (List)bootClassPathEntries.clone();
-
- /**
- * Creates a new <code>ProjectClasses</code> instance.
- *
- * @param classPath the project classpath
- * @exception IOException if an error occurs
- */
- ProjectClasses(String classPath) throws IOException {
- this.classPath = classPath;
-
- String classPathEntry;
- File classPathFile;
- StringTokenizer st = new StringTokenizer(classPath,
- File.pathSeparator);
-
- while (st.hasMoreTokens()) {
- classPathEntry = st.nextToken();
- classPathFile = new File(classPathEntry);
- if (classPathFile.exists()) {
- classPathEntries.add(ClassPathEntry.instanceForEntry(classPathFile));
- }
- }
- }
-
- void reloadClasses() throws IOException {
- ClassPathEntry cpe;
-
- for (Iterator i = classPathEntries.iterator(); i.hasNext();) {
- cpe = (ClassPathEntry)i.next();
- cpe.reload();
- }
- }
+ }
- public String getClassPath() {
- return classPath;
- }
+ public String getClassPath() {
+ return classPath;
+ }
- /**
- * returns a list of fully qualified classnames matching an
- * unqualified name in all classpath entries for the project.
- *
- * @param unqualifiedName a <code>String</code> value
- * @return a <code>List</code> value
- * @exception IOException if an error occurs
- */
- List getClassNames(String unqualifiedName) throws IOException {
- List rv = new ArrayList();
- ClassPathEntry cpe;
- for (Iterator i = classPathEntries.iterator(); i.hasNext();) {
- cpe = (ClassPathEntry)i.next();
- rv.addAll(cpe.getClassNames(unqualifiedName));
- }
- return rv;
- }
-
- public String toString() {
- return classPathEntries.toString();
- }
-
- public static void main (String[] args) throws Exception {
- System.out.println(new
ProjectClasses(System.getProperty("java.class.path")).getClassNames(args[0]));
- }
+ /**
+ * returns a list of fully qualified classnames matching an
+ * unqualified name in all classpath entries for the project.
+ *
+ * @param unqualifiedName a <code>String</code> value
+ * @return a <code>List</code> value
+ * @exception IOException if an error occurs
+ */
+ List getClassNames(String unqualifiedName) throws IOException {
+ List rv = new ArrayList();
+ for (Iterator i = classPathEntries.iterator(); i.hasNext();) {
+
+ ClassPathEntry cpe = (ClassPathEntry) i.next();
+ rv.addAll(cpe.getClassNames(unqualifiedName));
+ }
+ return rv;
+ }
+
+ public String toString() {
+ return classPathEntries.toString();
+ }
+
+ public static void main (String[] args) throws Exception {
+ System.out.println(new
ProjectClasses(System.getProperty("java.class.path")).getClassNames(args[0]));
+ }
- /**
- * loads the boot classpath entries.
- *
- * @exception IOException if an error occurs
- */
- static void loadBootClassPathEntries() throws IOException {
- StringTokenizer st;
- File file;
- File[] extFiles;
+ /**
+ * loads the boot classpath entries.
+ *
+ * @exception IOException if an error occurs
+ */
+ static void loadBootClassPathEntries() throws IOException {
+ StringTokenizer st;
+ File file;
+ File[] extFiles;
- String bootClassPath = System.getProperty("sun.boot.class.path");
- String extDirs = System.getProperty("java.ext.dirs");
+ String bootClassPath = System.getProperty("sun.boot.class.path");
+ String extDirs = System.getProperty("java.ext.dirs");
- st = new StringTokenizer(bootClassPath,File.pathSeparator);
- while (st.hasMoreTokens()) {
- file = new File(st.nextToken());
- addToBootClassPath(file);
- }
+ st = new StringTokenizer(bootClassPath,File.pathSeparator);
+ while (st.hasMoreTokens()) {
+ file = new File(st.nextToken());
+ addToBootClassPath(file);
+ }
- if (extDirs != null) {
- st = new StringTokenizer(extDirs,File.pathSeparator);
+ if (extDirs != null) {
+ st = new StringTokenizer(extDirs,File.pathSeparator);
- // Iterate through extension directories
- while (st.hasMoreTokens()) {
- extFiles = new File(st.nextToken()).listFiles();
+ // Iterate through extension directories
+ while (st.hasMoreTokens()) {
+ extFiles = new File(st.nextToken()).listFiles();
- if (extFiles != null) {
- // Iterate through files added them to classPath
- for (int i = 0; i < extFiles.length; i++) {
- addToBootClassPath(extFiles[i]);
- }
- }
- }
- }
- }
-
- static void addToBootClassPath(File file) throws IOException {
- if (file.exists()) {
- ClassPathEntry entry = ClassPathEntry.instanceForEntry(file);
- if (null != entry) {
- bootClassPathEntries.add(new ImmutableClassPathEntry(entry));
- }
- } // end of if (file.exists())
- }
+ if (extFiles != null) {
+ // Iterate through files added them to classPath
+ for (int i = 0; i < extFiles.length; i++) {
+ addToBootClassPath(extFiles[i]);
+ }
+ }
+ }
+ }
+ }
+
+ static void addToBootClassPath(File file) throws IOException {
+ if (file.exists()) {
+ ClassPathEntry entry = ClassPathEntry.instanceForEntry(file);
+ if (null != entry) {
+ bootClassPathEntries.add(new ImmutableClassPathEntry(entry));
+ }
+ } // end of if (file.exists())
+ }
+
}// ProjectClasses
/*
* $Log: ProjectClasses.java,v $
+ * Revision 1.6 2003/06/18 10:12:53 paulk
+ * Fixed null pointer exception caused by insertion of null entries
+ * into classPathEntries for files that are not class files or zip or jar files.
+ * Thanks to Boyan Slavoff for reporting this problem.
+ *
* Revision 1.5 2002/02/21 12:24:32 jslopez
* Adds method getClassPath.
*
1.5 +27 -22
XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/AbstractClassFactory.java
Index: AbstractClassFactory.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/AbstractClassFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- AbstractClassFactory.java 2003/01/18 05:48:41 1.4
+++ AbstractClassFactory.java 2006/03/03 20:42:30 1.5
@@ -29,7 +29,7 @@ import java.util.Vector;
* Boston, MA 02111-1307, USA.
*
* @author Javier Lopez
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.7 $
*/
public class AbstractClassFactory extends InterfaceFactory {
@@ -101,32 +101,30 @@ public class AbstractClassFactory extend
* @return a <code>Methods[]</code> containing abstract methods
*/
private void getAbstractMethods(Class argClass, Vector abstractMethods) {
- Method[] methods = argClass.getDeclaredMethods();
+ Method[] methods = argClass.getMethods();
+ Method[] declaredMethods = argClass.getDeclaredMethods();
+ addMethods(methods, abstractMethods);
+ addMethods(declaredMethods, abstractMethods);
+ }
+
+ /**
+ * Adds the abstract methods in <code>methods</code> into
abstractMethods.
+ *
+ * @param methods a <code>Method[]</code> to be added
+ * @param abstractMethods a <code>Vector</code> to add abstract methods.
+ */
+ private void addMethods(Method[] methods, Vector abstractMethods) {
Method method;
int modifiers;
-
for (int i = 0; i < methods.length; i++) {
method = methods[i];
modifiers = method.getModifiers();
- // if the method is abstract and public or protected
- if ((Modifier.isAbstract(modifiers)) &&
- ((Modifier.isPublic(modifiers)) ||
- (Modifier.isProtected(modifiers)))) {
+
+ if (Modifier.isAbstract(modifiers)
+ && !abstractMethods.contains(method)) {
abstractMethods.add(method);
} // end of if (method)
} // end of for (int i = 0; i < methods.length; i++)
-
- //Check the super class.
- Class superClass = argClass.getSuperclass();
- if (superClass != null) {
- getAbstractMethods(superClass, abstractMethods);
- }
-
- //Adds methods defined in implemented interfaces.
- Class[] interfaces = argClass.getInterfaces();
- for (int i = 0; i < interfaces.length; i++) {
- getAbstractMethods(interfaces[i], abstractMethods);
- }
}
public static void getImportedClasses() {
@@ -182,10 +180,9 @@ public class AbstractClassFactory extend
}
public static void main(String[] args) {
-
AbstractClassFactory.makeAbstractClassExpression("java.net.SocketImpl",
- false);
+ AbstractClassFactory.makeAbstractClassExpression
+ ("javax.swing.AbstractAction", false);
}
-
}
class NotAnAbstractClassException extends NotAnInterfaceException {
@@ -196,6 +193,14 @@ class NotAnAbstractClassException extend
/*
* $Log: AbstractClassFactory.java,v $
+ * Revision 1.7 2003/10/19 14:45:30 jslopez
+ * Fixes getAbstractMethods to get the methods included by getDeclaredMethods and
+ * getMethods.
+ *
+ * Revision 1.6 2003/10/10 12:51:12 jslopez
+ * Fixes generating skeleton for all methods declared by superclass including
+ * those that the class or superclass provides an implementation.
+ *
* Revision 1.5 2002/12/04 07:16:38 paulk
* Cosmetic changes.
*
1.7 +183 -144
XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/DelegateFactory.java
Index: DelegateFactory.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/DelegateFactory.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- DelegateFactory.java 2003/01/18 05:48:41 1.6
+++ DelegateFactory.java 2006/03/03 20:42:30 1.7
@@ -3,8 +3,8 @@
* Copyright (c) Paul Kinnucan 2000. All Rights Reserved.
* Copyright (c) Charles Hart 2000. All Rights Reserved.
*
- * $Revision: 1.5 $
- * $Date: 2002/06/06 05:12:44 $
+ * $Revision: 1.6 $
+ * $Date: 2003/09/07 05:29:12 $
*
* DelegateFactory is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -26,176 +26,216 @@ package jde.wizards;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.io.PrintWriter;
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.Enumeration;
/**
- * Defines a factory for creating skeleton implementations of
- * Java interfaces. The factory can be invoked from the command line
- * or from another program. The factory can generate implementations for
- * multiple interfaces when invoked from the command line.
+ * Defines a factory for generating methods that delegate tasks
+ * to be performed by an instance of one class (the delegator)
+ * to an instance of another class (the delegee. The delegator
+ * must have a field that references the delegee.
*
* @author Charles Hart, Eric D. Friedman, and Paul Kinnucan
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
-public class DelegateFactory extends MethodFactory
-{
+public class DelegateFactory extends MethodFactory {
- /** A table w/ declaring classes as keys and vectors of method
- * signatures as values */
- private Hashtable interfaces = new Hashtable();
+ /** A container for the signatures of the delegation methods
+ * to be generated by this factory. */
+ private SignatureContainer signatures = new SignatureContainer();
- /** The interface factory. */
- static DelegateFactory delegateFactory;
+ /** The delegate factory. */
+ private static DelegateFactory delegateFactory;
+ /**
+ * Name of the delegator field that references the delegee.
+ *
+ */
private String delegee;
- public DelegateFactory() {}
+ /**
+ * Creates a new <code>DelegateFactory</code> instance.
+ *
+ */
+ public DelegateFactory() { }
/**
- * Creates an DelegateFactory that uses the specified NameFactory
+ * Creates a DelegateFactory that uses the specified NameFactory
* for generating parameter names
*
* @param factory Factory for generating parameter names
*/
- public DelegateFactory(NameFactory factory)
- {
+ public DelegateFactory(NameFactory factory) {
super(factory);
}
- /**
- * Adds a signature to the signature table.
- * The signatures are stored in Vectors with their declaring
- * Classes as keys in a hashtable. This allows them to be pulled
- * out in groups when we print, and keeping the declaring Class info
- * lets us put in comments about where the method (or method group)
- * comes from. Signatures are not added if they're already registered
- * because we do not want duplicate method implementations even though
- * a class might implement interfaces that inherit from some common
- * super-interface.
- *
- * @param sig Signature to be stored in the signature table.
- */
- private final void sortByDeclaringClass(Signature sig)
- {
- String declaring = sig.getDeclaringClass().getName();
- if (interfaces.containsKey( declaring ))
- {
- Vector v = (Vector)interfaces.get( declaring );
- if (! v.contains( sig ) ) // "There can be only one" - the Highlander
- v.addElement(sig);
- } // end of if (interfaces.containsKey( dec ))
- else
- {
- Vector v = new Vector();
- v.addElement(sig);
- interfaces.put( declaring, v );
- } // end of else
+
+ /**
+ * Gets a container containing the signatures of the delegation
+ * methods.
+ *
+ * @return the value of signatures
+ */
+ public SignatureContainer getSignatures() {
+ return this.signatures;
+ }
+
+ /**
+ * Specifies a container to hold the signatures of the
+ * delegator methods.
+ *
+ * @param argSignatures signature container
+ */
+ public void setSignatures(SignatureContainer argSignatures) {
+ this.signatures = argSignatures;
+ }
+
+ /**
+ * Gets the Delegate Factory
+ *
+ * @return the Delegate Factory
+ */
+ public static DelegateFactory getTheFactory() {
+ return DelegateFactory.delegateFactory;
+ }
+
+ /**
+ * Sets the Delegate Factory
+ *
+ * @param argDelegateFactory the Delegate Factory
+ */
+ public static void setTheFactory(DelegateFactory argDelegateFactory) {
+ DelegateFactory.delegateFactory = argDelegateFactory;
+ }
+
+ /**
+ * Gets the name of the delegator field that references the delegee.
+ *
+ * @return name of the delegee
+ */
+ public String getDelegee() {
+ return this.delegee;
+ }
+
+ /**
+ * Specifies the name of the delegator field that references the delegee.
+ *
+ * @param argDelegee the delegee
+ */
+ public void setDelegee(String argDelegee) {
+ this.delegee = argDelegee;
}
/**
- * Clears the import and interface hashtables for this factory so they
- * can be re-used to process a new set of interfaces.
+ * Clears the method signatures container.
*/
- public void flush()
- {
+ public void flush() {
super.flush();
- interfaces.clear();
+ signatures.clear();
}
/**
- * Generates signatures based on introspection of the specified interface.
- * Strips package specifiers from generated signatures.
+ * Generates method signatures based on introspection of the
+ * specified interface. Strips package specifiers from generated
+ * signatures.
*
- * @param name the interface to process for signatures.
- * @exception java.lang.ClassNotFoundException the requested class cannot be loaded
+ * @param interfaceName the interface to process for signatures.
+ * @exception ClassNotFoundException Cannot find interface
*/
public void process(String interfaceName)
- throws ClassNotFoundException
- {
+ throws ClassNotFoundException {
process(interfaceName, true);
}
/**
- * Generates signatures based on introspection of the specified class.
+ * Generates signatures for the public methods of the delegee
+ * class.
*
- * @param name the interface to process for signatures.
- * @param truncate toggles truncation of package specifiers in signatures..
+ * @param delegeeClassName name of the delegee's class
+ * @param truncate toggles truncation of package specifiers in signatures.
*
- * @exception java.lang.ClassNotFoundException the requested class cannot
+ * @exception ClassNotFoundException the requested class cannot
* be loaded
- */
- public void process(String name, boolean truncate)
- throws ClassNotFoundException
- {
- if (null == namefactory)
+ */
+ public void process(String delegeeClassName, boolean truncate)
+ throws ClassNotFoundException {
+
+ if (null == namefactory) {
namefactory = new DefaultNameFactory();
+ }
- Class aclass = Class.forName( name );
+ Class aclass = Class.forName(delegeeClassName);
Method[] methods = aclass.getMethods();
- for (int i = 0; i < methods.length; i++)
- sortByDeclaringClass( new Signature( methods[i], this, truncate, true ));
+ for (int i = 0; i < methods.length; i++) {
+ if
(!(methods[i].getDeclaringClass().getName().equals("java.lang.Object")
+ && Modifier.isFinal(methods[i].getModifiers()))) {
+ signatures.add(new Signature(methods[i], this, truncate, true));
+ }
+ }
}
-
/**
- * Makes an expression for generating the implementation of an
- * interface. This method delegates the creation of the
- * implementation to makeInterfaceInternal.
+ * Generate delegator methods.
*
- * @param name Name of interface to be implemented.
+ * @param delegeeFieldName Name of delagator field that reference
+ * the delegee.
+ * @param delegeeClassName Name of delegee class.
* @param truncate If <code>true</code>, truncate package specifier
* when generating code.
+ *
*/
- public static void makeDelegatesExpression(String attributeName,
- String className,
- boolean truncate) {
-
- if (delegateFactory == null)
- delegateFactory = new DelegateFactory();
+ private void makeDelegatorMethodsInternal(String delegeeFieldName,
+ String delegeeClassName,
+ boolean truncate) {
+ delegee = delegeeFieldName;
+
+ try {
+ process(delegeeClassName, truncate);
+ } catch (ClassNotFoundException e) {
+ println("(error \"Error: could not find class named: "
+ + delegeeClassName + ". "
+ + "Note: name must be qualified.\")");
+ return;
+ } catch (Exception e) {
+ println("(error \"Error: unknown type.\")");
+ return;
+ }
- delegateFactory.flush();
- delegateFactory.makeInterfaceExpressionInternal
- (attributeName, className, truncate);
+ outputMethods(new PrintWriter(System.out, true), truncate);
}
+
/**
- * Makes an expression for generating the implementation of an interface.
+ * Generates delegator methods.
*
- * @param name Name of interface to be implemented.
- * @param javadoc If <code>true</code> generate skeletal Javadoc for
- * the implementation.
+ * @param delegeeFieldName Name of delegator field that
+ * references the delegee.
+ * @param delegeeClassName Name of delegee's class.
* @param truncate If <code>true</code>, truncate package specifier
* when generating code.
- * @param newline If <code>true</code>, insert a newline after
- * opening brace.
- *
*/
- private void makeInterfaceExpressionInternal
- (String attributeName, String className, boolean truncate) {
- delegee = attributeName;
- try {
- process(className, truncate);
- }
- catch (ClassNotFoundException e) {
- println("(error \"Error: could not find class named: " + className +
". "
- + "Note: name must be qualified.\")");
- return;
- }
- catch (Exception e) {
- println("(error \"Error: unknown type.\")");
- return;
+ public static void makeDelegatorMethods(String delegeeFieldName,
+ String delegeeClassName,
+ boolean truncate) {
+
+ if (delegateFactory == null) {
+ delegateFactory = new DelegateFactory();
}
- dumpExpression(new PrintWriter(System.out, true), truncate);
+ delegateFactory.flush();
+ delegateFactory.makeDelegatorMethodsInternal(delegeeFieldName,
+ delegeeClassName,
+ truncate);
}
+
+ /**
+ * Describe <code>getImportedClasses</code> method here.
+ *
+ */
public static void getImportedClasses() {
println(delegateFactory.getImportsAsList());
}
@@ -213,46 +253,40 @@ public class DelegateFactory extends Met
String defBody = "";
defBody = delegee + "." + m.getName()
- + "(" + sig.getParameterNames() + ");";
- if (! cl.getName().equals("void")) {
+ + "(" + sig.getParameterNames() + ");";
+ if (!cl.getName().equals("void")) {
defBody = "return " + defBody;
}
return defBody;
}
- public void dumpExpression(PrintWriter out, boolean truncate)
- {
- StringBuffer buf = new StringBuffer
- ("(jde-wiz-gen-delegation-methods (list ");
-
- Enumeration declaring_classes = interfaces.keys();
- while (declaring_classes.hasMoreElements())
- {
- String interf = (String)declaring_classes.nextElement();
- Vector v = (Vector)interfaces.get(interf);
- Enumeration e = v.elements();
- boolean isFirst = true;
- while (e.hasMoreElements())
- {
- Signature sig = (Signature)e.nextElement();
- if (interf.equals ("java.lang.Object")
- && Modifier.isFinal(sig.getMethod().getModifiers())) {
- continue;
- }
- if (isFirst) {
- buf.append ("(quote ");
- buf.append("\"Code for delegation of ");
- buf.append(interf);
- buf.append(" methods to ");
- buf.append(delegee);
- buf.append("\")");
- isFirst = false;
- }
- buf.append ("(quote ");
- buf.append(getMethodSkeletonExpression(sig));
- buf.append (")");
- } // end of while (e.hasMoreElements())
- }
+ /**
+ * Prints delegator methods to the standard out of
+ * the current process, i.e., to Emacs.
+ *
+ * @param out a <code>PrintWriter</code> value
+ * @param truncate a <code>boolean</code> value
+ */
+ public void outputMethods(PrintWriter out, boolean truncate) {
+ final StringBuffer buf = new StringBuffer
+ ("(jde-wiz-gen-delegation-methods (list ");
+
+ signatures.visit(new SignatureVisitor() {
+ public void visit(Signature sig , boolean firstOfClass) {
+ if (firstOfClass) {
+ buf.append ("(quote ");
+ buf.append("\"Code for delegation of ");
+ buf.append(sig.getDeclaringClass().getName());
+ buf.append(" methods to ");
+ buf.append(delegee);
+ buf.append("\")");
+ }
+ buf.append ("(quote ");
+ buf.append(getMethodSkeletonExpression(sig));
+ buf.append (")");
+ }
+ });
+
buf.append("))");
println(buf.toString());
}
@@ -260,6 +294,10 @@ public class DelegateFactory extends Met
/*
* $Log: DelegateFactory.java,v $
+ * Revision 1.6 2003/09/07 05:29:12 paulk
+ * Check for duplicate methods defined by different classes or interfaces.
+ * Thanks to Martin Schwamberg.
+ *
* Revision 1.5 2002/06/06 05:12:44 paulk
* DefaultNameFactory now generates meaningful method parameter names based
* on the parameter type or the method name. Thanks to Ole Arndt.
@@ -271,7 +309,8 @@ public class DelegateFactory extends Met
* for proposing and implementing this improvement.
*
* Revision 1.3 2000/08/03 04:31:20 paulk
- * Add support for generating a see secton in the Javadoc comment for a method. Thanks to
raffael.herzog(a)comartis.com
+ * Add support for generating a see secton in the Javadoc comment for a method.
+ * Thanks to raffael.herzog(a)comartis.com
*
* Revision 1.2 2000/08/01 08:19:25 paulk
* Fixes bug in dump method .Thanks to eric(a)hfriedman.rdsl.lmi.net.
1.8 +154 -119
XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/InterfaceFactory.java
Index: InterfaceFactory.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/InterfaceFactory.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- InterfaceFactory.java 2003/01/18 05:48:41 1.7
+++ InterfaceFactory.java 2006/03/03 20:42:30 1.8
@@ -2,8 +2,8 @@
* Copyright (c) Eric D. Friedman 1998. All Rights Reserved.
* Copyright (c) Paul Kinnucan 1998. All Rights Reserved.
*
- * $Revision: 1.9 $
- * $Date: 2002/05/14 06:38:44 $
+ * $Revision: 1.10 $
+ * $Date: 2003/09/07 05:29:12 $
*
* InterfaceFactory is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -23,11 +23,7 @@
package jde.wizards;
import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
import java.io.PrintWriter;
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.Enumeration;
/**
* Defines a factory for creating skeleton implementations of
@@ -36,20 +32,22 @@ import java.util.Enumeration;
* multiple interfaces when invoked from the command line.
*
* @author Eric D. Friedman and Paul Kinnucan
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
*/
-public class InterfaceFactory extends MethodFactory
-{
+public class InterfaceFactory extends MethodFactory {
- /** A table w/ declaring classes as keys and vectors of method
- * signatures as values */
- protected Hashtable interfaces = new Hashtable();
+ /** A container for all methods to be generated */
+ private SignatureContainer signatures = new SignatureContainer();
/** The interface factory. */
- static InterfaceFactory interfaceFactory;
+ private static InterfaceFactory interfaceFactory;
- public InterfaceFactory() {}
+ /**
+ * Creates a new <code>InterfaceFactory</code> instance.
+ *
+ */
+ protected InterfaceFactory() { }
/**
* Creates an InterfaceFactory that uses the specified NameFactory
@@ -57,50 +55,65 @@ public class InterfaceFactory extends Me
*
* @param factory Factory for generating parameter names
*/
- public InterfaceFactory(NameFactory factory)
- {
+ public InterfaceFactory(NameFactory factory) {
super(factory);
}
+
+ /**
+ * Gets the value of signatures
+ *
+ * @return the value of signatures
+ */
+ public SignatureContainer getSignatures() {
+ return this.signatures;
+ }
+
+ /**
+ * Sets the value of signatures
+ *
+ * @param argSignatures Value to assign to this.signatures
+ */
+ public void setSignatures(SignatureContainer argSignatures) {
+ this.signatures = argSignatures;
+ }
+
+ /**
+ * Gets the value of interfaceFactory
+ *
+ * @return the value of interfaceFactory
+ */
+ public static InterfaceFactory getTheFactory() {
+ return InterfaceFactory.interfaceFactory;
+ }
+
+ /**
+ * Sets the value of interfaceFactory
+ *
+ * @param argInterfaceFactory Value to assign to this.interfaceFactory
+ */
+ public static void setTheFactory(InterfaceFactory argInterfaceFactory) {
+ InterfaceFactory.interfaceFactory = argInterfaceFactory;
+ }
+
+
+
/**
- * Adds a signature to the signature table.
- * The signatures are stored in Vectors with their declaring
- * Classes as keys in a hashtable. This allows them to be pulled
- * out in groups when we print, and keeping the declaring Class info
- * lets us put in comments about where the method (or method group)
- * comes from. Signatures are not added if they're already registered
- * because we do not want duplicate method implementations even though
- * a class might implement interfaces that inherit from some common
- * super-interface.
+ * Adds a signature to signature container.
*
* @param sig Signature to be stored in the signature table.
*/
- protected final void sortByDeclaringClass(Signature sig)
- {
- String declaring = sig.getDeclaringClass().getName();
- if (interfaces.containsKey( declaring ))
- {
- Vector v = (Vector)interfaces.get( declaring );
- if (! v.contains( sig ) ) // "There can be only one" - the Highlander
- v.addElement(sig);
- } // end of if (interfaces.containsKey( dec ))
- else
- {
- Vector v = new Vector();
- v.addElement(sig);
- interfaces.put( declaring, v );
- } // end of else
+ protected final void sortByDeclaringClass(Signature sig) {
+ signatures.add(sig);
}
-
/**
- * Clears the import and interface hashtables for this factory so they
+ * Clears import hashtable and interface container for this factory so they
* can be re-used to process a new set of interfaces.
*/
- public void flush()
- {
+ public void flush() {
super.flush();
- interfaces.clear();
+ signatures.clear();
}
@@ -108,14 +121,12 @@ public class InterfaceFactory extends Me
* Generates signatures based on introspection of the specified interface.
* Strips package specifiers from generated signatures.
*
- * @param name the interface to process for signatures.
- * @exception NotAnInterfaceException the requested class isn't an interface
- * @exception java.lang.ClassNotFoundException the requested class cannot
- be loaded
+ * @param interfaceName the interface to process for signatures.
+ * @exception ClassNotFoundException the requested interface cannot be found
+ * @exception NotAnInterfaceException the requested class is not an interface
*/
public void process(String interfaceName)
- throws ClassNotFoundException, NotAnInterfaceException
- {
+ throws ClassNotFoundException, NotAnInterfaceException {
process(interfaceName, true);
}
@@ -126,119 +137,143 @@ public class InterfaceFactory extends Me
* @param truncate toggles truncation of package specifiers in signatures..
*
* @exception NotAnInterfaceException the requested class isn't an interface
- * @exception java.lang.ClassNotFoundException the requested class cannot
- * be loaded
- */
+ * @exception ClassNotFoundException Cannot find requested class
+ */
public void process(String name, boolean truncate)
- throws ClassNotFoundException, NotAnInterfaceException
- {
- if (null == namefactory)
+ throws ClassNotFoundException, NotAnInterfaceException {
+
+ if (null == namefactory) {
namefactory = new DefaultNameFactory();
+ }
- Class aclass = Class.forName( name );
- if (false == aclass.isInterface())
+ Class aclass = Class.forName(name);
+ if (false == aclass.isInterface()) {
throw new NotAnInterfaceException(name);
+ }
Method[] methods = aclass.getMethods();
- for (int i = 0; i < methods.length; i++)
- sortByDeclaringClass( new Signature( methods[i], this, truncate ) );
+
+ for (int i = 0; i < methods.length; i++) {
+ sortByDeclaringClass(new Signature(methods[i], this, truncate));
+ }
}
/**
- * Makes an expression for generating the implementation of an
- * interface. This method delegates the creation of the
- * implementation to makeInterfaceExpressionInternal.
- *
- * @param name Name of interface to be implemented.
- * @param truncate If <code>true</code>, truncate package specifier
- * when generating code.
- */
-
- public static void makeInterfaceExpression
- (String name, boolean truncate) {
-
- if (interfaceFactory == null)
- interfaceFactory = new InterfaceFactory();
-
- interfaceFactory.flush();
- interfaceFactory.makeInterfaceExpressionInternal(name, truncate);
-
- }
-
- /**
* Makes an implementation of an interface.
*
* @param name Name of interface to be implemented.
* @param truncate If <code>true</code>, truncate package specifier
* when generating code.
*/
- protected void makeInterfaceExpressionInternal
- (String name, boolean truncate) {
+ protected void implementInterface(String name, boolean truncate) {
+
try {
process(name, truncate);
- }
- catch (ClassNotFoundException e) {
+ } catch (ClassNotFoundException e) {
println("(error \"Error: could not find interface named: " + name +
". "
- + "Note: name must be qualified.\")");
+ + "Note: name must be qualified.\")");
return;
- }
- catch (NotAnInterfaceException e) {
+ } catch (NotAnInterfaceException e) {
println("(error \"Error: " + name + " is not an
interface.\")");
return;
- }
- catch (Exception e) {
+ } catch (Exception e) {
println("(error \"Error: unknown type.\")");
return;
}
+
+ dumpExpression(new PrintWriter(System.out, true), truncate);
+ }
+
+ /**
+ * Makes an expression for generating the implementation of an
+ * interface. This method delegates the creation of the
+ * implementation to makeInterfaceExpressionInternal.
+ *
+ * @param name Name of interface to be implemented.
+ * @param truncate If <code>true</code>, truncate package specifier
+ * when generating code.
+ */
+ public static void makeInterfaceExpression(String name, boolean truncate) {
+
+ InterfaceFactory theFactory = getTheFactory();
+
+ if (theFactory == null) {
+ theFactory = new InterfaceFactory();
+ setTheFactory(theFactory);
+ }
+
+ theFactory.flush();
+ theFactory.implementInterface(name, truncate);
- dumpExpression(new PrintWriter( System.out, true), truncate);
}
+ /**
+ * Prints imported classes to standard out.
+ *
+ */
public static void getImportedClasses() {
println(interfaceFactory.getImportsAsList());
}
- public void dumpExpression(PrintWriter out, boolean truncate)
- {
- StringBuffer buf = new StringBuffer
- ("(jde-wiz-gen-implementation-methods (list ");
-
- Enumeration declaring_classes = interfaces.keys();
- while (declaring_classes.hasMoreElements())
- {
- String interf = (String)declaring_classes.nextElement();
- Vector v = (Vector)interfaces.get(interf);
- buf.append ("(quote ");
- buf.append("\"Implementation of ");
- buf.append(interf);
- buf.append("\")");
- Enumeration e = v.elements();
- while (e.hasMoreElements())
- {
- Signature sig = (Signature)e.nextElement();
- buf.append ("(quote ");
- buf.append(getMethodSkeletonExpression(sig));
- buf.append (")");
- } // end of while (e.hasMoreElements())
- }
+ /**
+ * Describe <code>dumpExpression</code> method here.
+ *
+ * @param out a <code>PrintWriter</code> value
+ * @param truncate a <code>boolean</code> value
+ */
+ public void dumpExpression(PrintWriter out, boolean truncate) {
+
+ final StringBuffer buf =
+ new StringBuffer("(jde-wiz-gen-implementation-methods (list ");
+
+ signatures.visit(new SignatureVisitor() {
+ public void visit(Signature sig , boolean firstOfClass) {
+ if (firstOfClass) {
+ buf.append ("(quote ");
+ buf.append("\"Implementation of ");
+ buf.append(sig.getDeclaringClass().getName());
+ buf.append("\")");
+ }
+ buf.append ("(quote ");
+ buf.append(getMethodSkeletonExpression(sig));
+ buf.append (")");
+ }
+ }
+ );
+
buf.append("))");
println(buf.toString());
}
+
} // SignatureFactory
-class NotAnInterfaceException extends Exception
-{
- NotAnInterfaceException (String name)
- {
+/**
+ * Thrown when the factory is asked to implement an object that is not an interface.
+ *
+ * @author <a href="mailto:paulk@mathworks.com">Paul Kinnucan</a>
+ * @version 1.0
+ */
+class NotAnInterfaceException extends Exception {
+
+ /**
+ * Creates a new <code>NotAnInterfaceException</code> instance.
+ *
+ * @param name a <code>String</code> value
+ */
+ NotAnInterfaceException (String name) {
super(name);
}
}
/*
* $Log: InterfaceFactory.java,v $
+ * Revision 1.10 2003/09/07 05:29:12 paulk
+ * Check for duplicate methods defined by different classes or interfaces.
+ * Thanks to Martin Schwamberg.
+ *
* Revision 1.9 2002/05/14 06:38:44 paulk
* Enhances code generation wizards for implementing interfaces, abstract
* classes, etc., to use customizable templates to generate skeleton methods
1.7 +10 -28
XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/MethodFactory.java
Index: MethodFactory.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/MethodFactory.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- MethodFactory.java 2003/01/18 05:48:41 1.6
+++ MethodFactory.java 2006/03/03 20:42:31 1.7
@@ -10,10 +10,10 @@ import java.util.Enumeration;
* or from another program. The factory can generate implementations for
* multiple interfaces when invoked from the command line.
*
- * Copyright (C) 1998-2002 Eric D. Friedman . All Rights Reserved.
+ * Copyright (C) 1998-2003 Eric D. Friedman . All Rights Reserved.
* Copyright (C) 1998-2002 Paul Kinnucan . All Rights Reserved.
*
- * $Date: 2002/12/04 07:16:37 $
+ * $Date: 2003/09/07 05:29:12 $
*
* InterfaceFactory is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -31,7 +31,7 @@ import java.util.Enumeration;
*
* @author Eric D. Friedman
* @author Paul Kinnucan
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class MethodFactory implements ClassRegistry {
@@ -151,35 +151,13 @@ public class MethodFactory implements Cl
/**
* Tests whether a specified class needs to be imported by the interface
* implementation generated by this factory.
- * We don't import primitives or classes from java.lang.* Since we do
- * have to import classes from java.lang.reflect (and whatever else
- * Javasoft may throw under java.lang.*, we have to study the package name
- * in more detail if it starts with java.lang
+ * We don't import primitives.
*
* @param c the <code>Class</code> object to be tested
* @return <code>true</code> if the class should be imported
*/
- private final boolean shouldImport(Class c) {
- if (c.isPrimitive()) { // do not import primitives
- return false;
- }
-
- String name = c.getName();
- if ((name.startsWith("java.lang"))) {
- char[] n = name.toCharArray();
-
- // Start at position ten, or after the final '.' in java.lang.
- for (int i = 10; i < n.length; i++) {
- if (n[i] == '.') {
- return true; // must import packages below java.lang
- }
- }
-
- return false; // but nothing in java.lang itself
-
- }
-
- return true; // import everything else
+ private final boolean shouldImport(Class c) {
+ return ! c.isPrimitive(); // import everything else
}
@@ -268,6 +246,10 @@ public class MethodFactory implements Cl
/*
* $Log: MethodFactory.java,v $
+ * Revision 1.8 2003/09/07 05:29:12 paulk
+ * Check for duplicate methods defined by different classes or interfaces.
+ * Thanks to Martin Schwamberg.
+ *
* Revision 1.7 2002/12/04 07:16:37 paulk
* Cosmetic changes.
*
1.7 +77 -10
XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/MethodOverrideFactory.java
Index: MethodOverrideFactory.java
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/MethodOverrideFactory.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- MethodOverrideFactory.java 2003/01/18 05:48:41 1.6
+++ MethodOverrideFactory.java 2006/03/03 20:42:31 1.7
@@ -1,15 +1,15 @@
/*
* Copyright (c) Paul Kinnucan 1998, 1999, 2000, 2001. All Rights Reserved.
*
- * $Revision: 1.8 $
- * $Date: 2002/06/03 18:12:27 $
+ * $Revision: 1.12 $
+ * $Date: 2003/10/20 05:39:24 $
*
* MethodOverrideFactory is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2, or (at
* your option) any later version.
*
- * InterfaceFactory is distributed in the hope that it will be useful,
+ * MethodOverrideFactory 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 for more details.
@@ -35,7 +35,7 @@ import jde.util.DynamicClassLoader;
* superclass.
*
* @author Paul Kinnucan
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.12 $
*/
public class MethodOverrideFactory extends MethodFactory
@@ -65,19 +65,45 @@ public class MethodOverrideFactory exten
public Vector getMethods(Class cl, String methodName) {
- Method [] methods = cl.getDeclaredMethods();
-
+ /*
+ * Note that before JDK 1.4, getDeclaredMethods() returned
+ * methods declared by an interface implemented by a class
+ * including methods defined by the interface but
+ * not implemented by the class. Starting with JDK 1.4,
+ * getDeclaredMethods() returns only the methods actually
+ * declared by a class. An example that illustrates the difference
+ * in behavior is AbstractAction. JDK 1.3 returns actionPerformed
+ * as one of the methods declared by AbstractAction even though
+ * AbstractAction does not actually implement this method.
+ */
+ // Method [] methods = cl.getDeclaredMethods();
+ Method [] methods = cl.getMethods();
+
Vector m = new Vector();
- for (int i = 0; i < methods.length; ++i)
+ for (int i = 0; i < methods.length; ++i) {
if (methods[i].getName().equals(methodName))
- m.addElement(methods[i]);
+ m.addElement(methods[i]);
+ }
return m;
}
+ /**
+ * Get a list of signatures for all methods of a specified name defined
+ * or inherited by a specified class. The signatures returned by this method
+ * including only the types of the method parameters as the generated names
+ * are unnecessary for signature matching. This method prints the signature
+ * list to standard out as a Lisp list form.
+ *
+ * @param baseClassName a <code>String</code> value that specifies the name
of
+ * the class that defines or inherits the methods whose signatures are to be
+ * returned.
+ * @param methodName a <code>String</code> value that specifies the name of
the
+ * methods whose signatures are to be returned.
+ */
public static void getCandidateSignatures(String baseClassName, String methodName) {
if (overrideFactory == null)
@@ -122,7 +148,7 @@ public class MethodOverrideFactory exten
String res = "(list ";
for (int i = 0; i < n; ++i) {
Signature s = (Signature) overrideFactory.candidates.elementAt(i);
- String p = s.getParameters(s.getMethod().getParameterTypes());
+ String p = s.getParameters(s.getMethod().getParameterTypes(), false);
res = res + "\"" + methodName + "(" + p + ")\"
";
}
res = res + ")";
@@ -176,9 +202,31 @@ public class MethodOverrideFactory exten
candidates.removeAllElements();
}
+ /**
+ * Gets the candidate signatures for the class and method
+ * passed as arguments on the command line.
+ *
+ * @param args a <code>String[]</code> value
+ */
public static void main (String[] args) {
+
+ String className = "javax.swing.AbstractAction";
+ String methodName = "actionPerformed";
+
+ if (args.length == 2) {
-
getCandidateSignatures("jde.ui.design.command.Command","getName");
+ className = args[0];
+ methodName = args[1];
+
+ }
+
+ System.out.println("Class: " + className);
+ System.out.println("Method: " + methodName);
+
+ getCandidateSignatures(className, methodName);
+
+
+
} // end of main ()
@@ -189,6 +237,25 @@ public class MethodOverrideFactory exten
/*
* $Log: MethodOverrideFactory.java,v $
+ * Revision 1.12 2003/10/20 05:39:24 paulk
+ * Update the getMethods() method to get all the methods of a class
+ * whether declared by the class or inherited by the class, including
+ * abstract methods.
+ *
+ * Revision 1.11 2003/07/23 04:40:07 paulk
+ * main method now accepts class and method name for testing purpose. Added comment
+ * noting the change in behavior of getDeclaredMethods from JDK 1.3 to JDK 1.4.
+ *
+ * Revision 1.10 2003/05/04 05:50:52 paulk
+ * Document the getCandidateSignatures method.
+ *
+ * Revision 1.9 2003/05/04 05:42:22 paulk
+ * Change getCandidateSignatures to return signatures with parameter
+ * types only (i.e., without parameter nams). This fixes a
+ * signature-matching bug on the Lisp side where the method override
+ * wizard was inadvertently trying to matching a signature without
+ * parameter names to a list of signatures with parameter names.
+ *
* Revision 1.8 2002/06/03 18:12:27 mnl
* Use DynamicClassLoader instead of simple Class.forName to avoid class
* resolving (linking).
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/SignatureContainer.java
Index: SignatureContainer.java
===================================================================
/*
* Copyright (c) Paul Kinnucan 2003. All Rights Reserved.
*
* $Revision: 1.2 $
* $Date: 2003/09/08 03:42:17 $
*
* SignatureContainer is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2, or (at
* your option) any later version.
*
* SignatureContainer 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 for more details.
*
* To obtain a copy of the GNU General Public License write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
package jde.wizards;
import java.util.Hashtable;
import java.util.Vector;
import java.util.Enumeration;
/**
* A container for method signatures. The signatures are stored in
* vectors with their declaring classes as keys in a hashtable. This
* allows them to be pulled out in groups when we print, and keeping
* the declaring class info lets us put in comments about where the
* method (or method group) comes from.
*
* @author <a href="mailto:mschw@web.de">Martin Schwamberger</a>
* @version $Revision: 1.2 $
*/
public class SignatureContainer {
/**
* A table with declaring classes as keys and vectors of method
* signatures as values
*/
private Hashtable classes = new Hashtable();
/**
* Adds a signature to the container. Signatures are not
* added if they're already registered because we do not want
* duplicate method implementations even though a class might
* implement interfaces that inherit from some common
* super-interface.
*
* @param sig Signature to be stored in the signature table.
*/
public final void add(Signature sig) {
// There can be only one, even though declaring classes differ.
if (!alreadyStored(sig)) {
String declaring = sig.getDeclaringClass().getName();
if (classes.containsKey(declaring)) {
((Vector) classes.get(declaring)).addElement(sig);
} else {
Vector v = new Vector();
v.addElement(sig);
classes.put(declaring, v);
}
}
}
/**
* Check whether container already contains signature.
*
* @param sig a <code>Signature</code> value
* @return a <code>boolean</code> value
*/
private final boolean alreadyStored(Signature sig) {
Enumeration declaringClasses = classes.keys();
boolean found = false;
while (declaringClasses.hasMoreElements() && !found) {
String interf = (String) declaringClasses.nextElement();
Vector v = (Vector) classes.get(interf);
found = v.contains(sig);
}
return found;
}
/**
* Clear the signature container.
*/
public void clear() {
classes.clear();
}
/**
* True if this container is empty of signatures.
*
* @return a <code>boolean</code> value
*/
public boolean isEmpty() {
return classes.isEmpty();
}
/**
* Visit each signature in the container.
*
* @param visitor the SignatureVisitor object visiting the signatures
*/
public void visit(SignatureVisitor visitor) {
Enumeration declaringClasses = classes.keys();
while (declaringClasses.hasMoreElements()) {
String className = (String) declaringClasses.nextElement();
Vector v = (Vector) classes.get(className);
boolean firstOfClass = true;
Enumeration e = v.elements();
while (e.hasMoreElements()) {
Signature sig = (Signature) e.nextElement();
visitor.visit(sig, firstOfClass);
firstOfClass = false;
}
}
}
}
/*
* $Log: SignatureContainer.java,v $
* Revision 1.2 2003/09/08 03:42:17 paulk
* Remove DOS line endings.
*
* Revision 1.1 2003/09/07 05:32:01 paulk
* Initial revision.
*
*/
// End of SignatureContainer.java
1.1
XEmacs/packages/xemacs-packages/jde/java/src/jde/wizards/SignatureVisitor.java
Index: SignatureVisitor.java
===================================================================
/*
* Copyright (c) Paul Kinnucan 2003. All Rights Reserved.
*
* $Revision: 1.2 $
* $Date: 2003/09/08 03:43:27 $
*
* SignatureHandler is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2, or (at
* your option) any later version.
*
* SignatureHandler 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 for more details.
*
* To obtain a copy of the GNU General Public License write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
package jde.wizards;
interface SignatureVisitor {
void visit(Signature sig, boolean firstOfClass);
}
/*
* $Log: SignatureVisitor.java,v $
* Revision 1.2 2003/09/08 03:43:27 paulk
* Remove DOS line endings.
*
* Revision 1.1 2003/09/07 05:32:01 paulk
* Initial revision.
*
*/
// End of SignatureVisitor.java
1.13 +0 -2689 XEmacs/packages/xemacs-packages/jde/lisp/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/ChangeLog,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- ChangeLog 2005/06/01 19:35:40 1.12
+++ ChangeLog 2006/03/03 20:42:35 1.13
@@ -42,2692 +42,3 @@
2002-11-29 Ben Wing <ben(a)xemacs.org>
* .cvsignore: Remove files now handled automatically by CVS.
-
-2001-02-22 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: JDE 2.2.7beta2 notes.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- The class, console app, and Swing app templates now prompt you to enter a package name.
The prompt includes a suggested package name based on the location of the current
directory in the classpath.
-
- * /pack/anoncvs/jde/lisp/jde-package.el:
- Removed require for jde to fix infinite recursion loading bug.
-
-2001-02-21 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-java-grammar.el:
- Added require for semantic package.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added require for new jde-package package.
-
- * /pack/anoncvs/jde/lisp/jde-package.el: Initial revision.
-
-2001-02-20 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-compile.el:
- You can now use environment variables, tilde notation, and cygwin syntax in
jde-compile-option-directory path.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- The JDE now expands paths that begin with a tilde but not a period (.).
-
-2001-02-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-compile.el:
- Added support for JDK 1.3 targets.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- - Fixed regression bug in context-switching that resulted from setting
- jde-current-project to the path of the current prj.el file.
-
- - No longer expand classpaths to avoid expanding relative path (.) notation.
-
-2001-02-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- - Fixed regression bug in context-switching that resulted from setting
- jde-current-project to the path of the current prj.el file.
-
- - No longer expand classpaths to avoid expanding relative path (.) notation.
-
-2001-02-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-widgets.el:
- Added (require 'cl) to enable batch compile.
-
-2001-02-09 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-java-font-lock.api: Initial revision.
-
-2001-02-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
-2001-02-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Changed declaration of customized variables to permit completion of paths.
-
-2001-02-03 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Changed declaration of customized variables to allow path completion.
- Now allows environment variables in jde-db-source-directories.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Changed declaration of customized variables so you can use completion on path
variables.
-
- * /pack/anoncvs/jde/lisp/jde-compile.el:
- Changed declarations of customized variables so that you can now use completion (M tab)
to complete path names.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Changed declarations for all path variables from string to file. This means that you can
now use completion (M tab) to complete paths in customization buffers.
-
- * /pack/anoncvs/jde/lisp/beanshell.el:
- Now uses jde-build-classpath to build BeanShell classpath. This allows enviromnent
variables in the classpath.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Made quote argument optional in jde-build-path-arg and jde-build-classpath-arg.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Now uses jde-build-classpath instead of jde-run-build-classpath to build classpath
argument.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Now uses generalized jde-build-classpath function to build classpath argument to
debugger.
-
-2001-02-01 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-run.el:
- *** empty log message ***
-
-2001-02-01 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-run.el:
- *** empty log message ***
-
-2001-01-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-javadoc-gen.el:
- No longer inserts -sourcepath argument twice in the javadoc command line.
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el: Enhancements from David Ponce:
-
- - Improved `jde-javadoc-start-tag-regexp' and
- `jde-javadoc-end-tag-regexp' regular expressions which fix little
- problems when parsing javadoc tags. These regexps enforce the
- following rule (from JDK 1.3 documentation "javadoc - The Java API
- Documentation Generator" - Chapter "DOCUMENTATION COMMENTS" -
- "Standard and in-line tags":
-
-
- "[...] a standard tag must appear at the beginning of a line,
- ignoring leading asterisks, white space and comment separator
- (/**). This means you can use the @ character elsewhere in the text
- and it will not be interpreted as the start of a tag. If you want to
- start a line with the @ character and not have it be interpreted,
- use the HTML entity @. [...]"
-
-
- - `jde-javadoc-checker-report-mode' now turns on `font-lock-mode'.
- This is useful in XEmacs which don't have a `global-font-lock-mode'.
-
-
- - Filling of messages in `jde-javadoc-checker-show-report' now works
- with XEmacs too.
-
-2001-01-25 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-java-grammar.el:
- Changed the definition of formal_parameter_list to improve performance (less
- backtracking) when parsing parameters in method and constructor
- declarations. Thanks to David Ponce.
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Updating for JDE 2.2.7
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Completion now asks user whether to import a class that it cannot find. Thanks to
Phillip Lord.
-
-2001-01-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Removed typo from jde-dbs-proc-set-find.
-
-2001-01-19 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Adds cflow expansions for try, catch, and finally. Thanks to Venkatesh Prasad Ranganath
<rvprasad(a)ksu.edu> for these expansions.
-
-2001-01-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-java-font-lock.el:
- Font-locking improvements from David Ponce
-
- - You can now fontify user-defined identifiers with the new
- jde-java-font-lock-api-face. These identifiers are read in the
- file specified by the `jde-java-font-lock-api-file' option.
-
- The JDE provides a default file "jde-java-font-lock.api" to fontify class
- names of the core 'java' and 'javax' packages (JDK 1.3) and servlet
- API (JSDK 2.0). To enable this fontification just put this file on
- your home directory, maybe modify it to suit your needs and execute
- the command:
-
- M-x jde-java-font-lock-setup-keywords (or restart Emacs).
-
- To improve reloading a cache file of regular expressions matching
- these names is created in the same directory (see the source for
- more details).
-
- - Because the 'const' and 'goto' keywords are reserved, but not
- currently used they are now fontified with `font-lock-warning-face'.
-
- - The 'default' keyword is now fontified with
- `font-lock-keyword-face'. This was suggested by Stephane Nicolas
- s.nicolas(a)videotron.ca>.
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Changed the definition of formal_parameter_list to improve performance (less
- backtracking) when parsing parameters in method and constructor
- declarations. Thanks to David Ponce.
-
-2001-01-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Adds jde-abbrev-mode and jde-show-abbrev commands. Thanks to s.nicolas(a)videotron.ca.
-
-2001-01-06 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jtags, /pack/anoncvs/jde/lisp/jtags.csh:
- Add "\." below to the definition of class_type so
- that methods whose return type included a period (e.g, Foo.Bar)
- were tagged:
-
- class_type="\<\([$capital][a-zA-Z_$digit\.]*\)\>"
-
- Thanks to Charles Rich <rich(a)merl.com>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Fixed regression bug caused by reimplementation of the cygpath conversion function.
-
-2001-01-05 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Removed old version of jde-parse-get-class-at-point.
-
-2001-01-03 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Fixes infinite recursion bug in jde-parse-update-after-parse when creating a new file.
-
-2000-12-25 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Adds jde-cygwin-path-converter variable.
-
- * Adds support for environment variable substitution in class and sourcepaths.
-
-2000-12-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jtags, /pack/anoncvs/jde/lisp/jtags.csh:
- (1) Added "-l none" to the etags arguments (all four calls) to
- eliminate the additional spurious tags that were coming from etags'
- default java parsing:
-
- ${etags_dir}etags -l none -a -o ${java_dir}/TAGS \
-
- (2) Added "\/" to the prohibited characters at the start of class2,
- method1 and method2 to prevent comment lines like
-
- // this is a nice interface for catching mice
-
- getting tagged:
-
-
class2="/^[^.*\/]*\($modifier$ws*\)*\<\(class\|interface\)\>$ws*$identifier/\7/"
-
- Thanks to Charles Rich <rich(a)merl.com> for these improvements.
-
-2000-12-21 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Changed jde-wiz-insert-imports to jde-import-insert-imports to reflect recent
repackaging scheme.
-
-2000-12-19 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/makefile:
- Adds a variable EMACS that lets you specify the path of the Emacs executable used to
- compile the JDE files. Thanks to Sam Steingold <sds(a)gnu.org>.
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Fixed popup completion menu to work on XEmacs. Thanks to David Ponce for providing this
fix.
-
-2000-12-18 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el, /pack/anoncvs/jde/lisp/jde-project.el,
/pack/anoncvs/jde/lisp/jde-widgets.el, /pack/anoncvs/jde/lisp/jde-wiz.el,
/pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/ReleaseNotes.txt,
/pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-db.el,
/pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-gen.el,
/pack/anoncvs/jde/lisp/jde-java-font-lock.el, /pack/anoncvs/jde/lisp/jde-javadoc.el:
- *** empty log message ***
-
-2000-12-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Added jde-compile-jde.
-
-2000-11-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-project.el: New file.
-
- * /pack/anoncvs/jde/lisp/jde-which-method.el, /pack/anoncvs/jde/lisp/jde-wiz.el,
/pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/jde-import.el,
/pack/anoncvs/jde/lisp/jde-javadoc.el, /pack/anoncvs/jde/lisp/jde-parse.el,
/pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-imenu.el:
- Miscellaneous bug fixes and minor enhancements.
-
- * /pack/anoncvs/jde/lisp/jde-widgets.el:
- Added an experimental jde-widget-option-tree widget.
-
-2000-11-20 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el, /pack/anoncvs/jde/lisp/jde.el,
/pack/anoncvs/jde/lisp/jde-import.el:
- Added jde-import-organize command. Moved all import-related code from
- jde-wiz.el to a new package named jde-import.el.
-
-2000-11-18 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el:
- Fixed bug in jde-bug-remove-breakpoint-highlight.
-
-2000-11-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- jde-wiz-update-class-list now uses the current jde-global-classpath when building the
class list. This eliminates the need to restart the beanshell when switching projects.
-
-2000-11-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Fixed problem in jde-sort-imports command. The problem was that jde-sort-imports
temporarily defined sort-fold-case just before invoking sort-lines. Invoking sort-lines
caused the sort package to be loaded. Since sort-fold-case is already defined, the sort
package did not bother to define it. Then sort-lines returns to jde-sort-lines which
proceeded to destroy the temporary copy of sort-fold-case. The fix is to have
jde-sort-lines require the sort package before invoking sort-lines.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Adds jde-wiz-kill-extra-imports command contributed by David Ponce.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el:
- Fixed bug that caused highlight not to be removed from breakpint.
-
-2000-10-25 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Changed jde-auto-parse-disable-threshold to jde-auto-parse-max-buffer-size.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Updated sort import function to reflect new bovinator syntax.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Moved code generated by the semantic bovinator to jde-java-grammar.el.
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Modified to reflect new location of generated files.
-
- * /pack/anoncvs/jde/lisp/jde-java-grammar.el: Initial revision.
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- David Ponce's fixes for various semantic-list matching
- problems. For example, this caused the parser to find a variable
- declaration for a method declaration like the following:
-
- [modifiers] type name(..., any_occurence_of[], ...);
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el: Enhancements from David Ponce:
-
- * It is now possible to check javadoc comments only for tokens with a
- specified access level. The new `jde-javadoc-checker-level' option
- defines the accessibility level to check.
-
- Only 'type, 'function or 'variable tokens with this level will be
- checked. The level is defined to be consistent with the javadoc show
- options. That is:
-
- - - public - check only public classes and members.
- - - protected - check only protected and public classes and
- members. This is the default.
- - - package - check only package, protected, and public classes
- and members.
- - - private - check all classes and members.
-
- If a token is included in other ones its access level is the lowest
- one found in the hierarchy.
-
- Using `jde-javadoc-checkdoc-at-line' it is always possible to check
- any token regardless of its access level.
-
- * Changed '[u]-update' action by more appropriate '[f]-try to fix' in
- the checker report dialog.
-
- * Changed message "Invalid tag order, must be ..." by
- "Recommended tag order is ...".
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added a new variable, jde-bug-sio-connect-delay.
-
- This variable specifies the length of time in seconds
- that the JDE waits before attempting to connect to the
- debuggee application's standard I/O. This delay
- is intended to give JDEbug time to create the
- SIO socket. Previously, the JDE would attempt to
- connect immediately, possibly before JDEbug had time
- to create a socket for the standard I/O. This might
- explain the launch command timeout failures that some users have
- experienced, especially on Windows/NT.
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Fixed bug where the completion function was completing symbols that it could not find
with the results of the previous completion.
-
-2000-10-22 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Add a Documentation submenu.
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el:
- Add menu enabler for javadoc commands.
-
-2000-10-20 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/jde-which-method.el:
- *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Fix that allows the JDE to be used with NT/XEmacs.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Now uses generalized version of classes menu shipped with
- semantic. Thanks to David Ponce and Eric Ludlam.
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el: Enhancements from David Ponce.
-
- * /pack/anoncvs/jde/lisp/jde-javadoc-gen.el, /pack/anoncvs/jde/lisp/jde-imenu.el:
- Initial version.
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Now uses semantic for some functions. Thanks to David Ponce.
-
- * /pack/anoncvs/jde/lisp/java.bnf: *** empty log message ***
-
-2000-10-12 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: *** empty log message ***
-
-2000-10-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-java-font-lock.el:
- Fixed some XEmacs compatibility problems.
-
- * /pack/anoncvs/jde/lisp/jde-which-method.el:
- Moved some which method customization variables into the which method customization
group.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed bug where selecting Other and Executable as the debugger results in the executable
name being inserted twice.
-
-2000-10-08 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/imenu.el, /pack/anoncvs/jde/lisp/jde.el,
/pack/anoncvs/jde/lisp/jde-complete.el, /pack/anoncvs/jde/lisp/jde-db.el,
/pack/anoncvs/jde/lisp/jde-help.el, /pack/anoncvs/jde/lisp/jde-javadoc.el,
/pack/anoncvs/jde/lisp/jde-parse.el, /pack/anoncvs/jde/lisp/jde-run.el,
/pack/anoncvs/jde/lisp/jde-which-method.el, /pack/anoncvs/jde/lisp/jde-wiz.el,
/pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/beanshell.el:
- *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-java-font-lock.el: Initial revision.
-
-2000-10-06 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-which-method.el:
- Now optionally truncates method name. Thanks to klaus.berndl(a)sdm.de. Also, moves method
name after point location display in mode line.
-
-2000-09-30 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Use imenu to display completion choices. Thanks to David Ponce.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Correct type in jde-gen-cflow-enable.
-
-2000-09-24 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Now sorts import list after adding an import. To disable this feature, set
jde-auto-sort-imports off. Thanks to "Jason Stell"
<Jason.Stell(a)globalone.net>
-
-2000-09-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el:
- Fixed bug in jde-bug-clear-breakpoint command where the command was off by a line.
Thanks to Stan Lanning <lanning(a)pobox.com> for providing this fix.
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el:
- Adds jde-javadoc-command-path and jde-javadoc-display-doc variables. Thanks to
"Jason Stell" <Jason.Stell(a)globalone.net> for providing the initial
version of these changes.
-
-2000-09-21 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Updates jde-run-applet to work with the appletviewer in JDK 1.3.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Now include jde-run.el when compiling to get the definition for save-w32-show-window
macro.
-
- * /pack/anoncvs/jde/lisp/jde-compile.el:
- Fixes bug in formatting jde-compile-option-vm-args for the command line.
-
-2000-09-12 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/makefile:
- Replaced old distributable makefile with new makefile for compiling
- JDE lisp files.
-
-2000-09-07 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Tweaked get-set pair template to indent correctly. Thanks to Lou Aloia
<xlxa(a)rims.com> for this fix.
-
-2000-09-05 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Bug fixes.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Fixed jde-dbs-debugger-display-message.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el: Bug fixes
-
- * /pack/anoncvs/jde/lisp/jde-which-method.el: Fixed a number of bugs.
-
-2000-09-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-which-method.el:
- Added test for existence of method map.
-
-2000-08-31 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- * Now creates a binary tree, jde-parse-method-map, listing the
- locations of all methods in the source buffer.
-
- * Now parses the source buffer 30 seconds after a change.
-
- * /pack/anoncvs/jde/lisp/jde-which-method.el: Initial revision.
-
- * /pack/anoncvs/jde/lisp/jde-widgets.el:
- Fixed bug on XEmacs where the Cancel button overwrote the OK button in the standard
dialog class.
-
-2000-08-19 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Flushes cache at end of compilation.
-
- * /pack/anoncvs/jde/lisp/jde-compile.el: Adds compile finish hook.
-
- * /pack/anoncvs/jde/lisp/jde-run.el: Changed variable name.
-
- * /pack/anoncvs/jde/lisp/jde-setnu.el: Initial revision.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Control flow abbreviations now optional.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Updated to handle JDK 1.3 version of jdb. Source pointer now moves to
- current location in current stack frame.
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el:
- Don't quote class names in javadoc command.
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Changed regular expressions for modifiers to match whole words.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Adds jde-gen-cflow-enable variable.
-
-2000-08-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Set case-fold-search to nil to ensure case sensitivity when parsing buffer.
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Changed regular expression for modifier to match only words.
-
-2000-08-14 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Adds support for Step Into All command.
-
-2000-08-12 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Fixed regression error in jde-help-symbol-at-point.
-
-2000-08-11 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Now flushes the classinfo cache at the end of a compilation.
-
- * /pack/anoncvs/jde/lisp/jde-compile.el:
- Added jde-compile-finish-hook variable.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Now refreshes speedbar at the end of a compilation.
-
-2000-08-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el:
- Now handles Lisp eval errors gracefully.
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Now handles primitive arrays correctly.
-
-2000-08-09 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-make.el:
- Added jde-make-working-directory variable. Thanks to Laurent Latil
<Laurent.Latil(a)france.sun.com>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Adds support for completion of array instances. Thanks to Steff.
-
-2000-08-08 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el:
- Fixed the doc for jde-javadoc-make.
-
-2000-08-07 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el:
- jde-javadoc-make now uses jde-db-source-directories as the sourcepath for generating
doc.
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el:
- Adds jde-javadoc-make command. Thanks to Sergey A Klibanov
<sakliban(a)cs.wustl.edu>.
-
- * /pack/anoncvs/jde/lisp/beanshell.el: Adds bsh-vm-args variable.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Fixes a couple of bugs in jde-parse-valid-declaration-at. Thanks to Lou Aloia
<xlxa(a)rims.com> and Stephane <s.nicolas(a)videotron.ca> for the fixes.
-
-2000-08-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el: Added bsh-eval-timeout variable.
-
-2000-08-03 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Restored use of the radio buttons by the import wizard. Somehow this functionality got
deleted.
-
-2000-08-01 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Now caches methods and fields for each class referenced in a session. Now completes
private and protected methods and fields. Thanks to Stephane
<s.nicolas(a)videotron.ca>.
-
-2000-07-30 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Updated doc for jde-complete-at-point and jde-complete-at-point-menu commands.
-
-2000-07-29 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Add support for line numbering via the setnu package.
-
-2000-07-28 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/jde-parse.el,
/pack/anoncvs/jde/lisp/jde-wiz.el, /pack/anoncvs/jde/lisp/jde-dbs.el,
/pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-bug.el:
- Committing all modified files.
-
- * /pack/anoncvs/jde/lisp/jde-stat.el:
- Initial revision. Thanks to Stephane Nicolas <s.nicolas(a)videotron.ca>
- for contributing the initial version of this package.
-
-2000-07-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Now completes object fields to any depth and completes variables declared in method
argument lists. Thanks to Stephane Nicolas <s.nicolas(a)videotron.ca>.
-
-2000-07-26 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Adds support for static fields and methods. Thanks to Stephane Nicolas
<s.nicolas(a)videotron.ca> for this enhancement.
-
-2000-07-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Templates now indent correctly when inserted in a buffer. Thanks to el mono
<mono(a)utp.edu.co> for this enhancement.
-
-2000-07-20 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Extended K&R coding style to all templates. Thanks to Stephane Nicolas
<s.nicolas(a)videotron.ca> for doing this.
-
-2000-07-14 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Adds a delegation wizard contributed by Charles Hart.
-
-2000-07-13 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- * You can now specify a list of packages to exclude from import
- into a source file. See jde-wiz-import-excluded-packages for
- more information. Thanks to "Jim Loverde" <loverde(a)str.com>
- for this enhancement.
-
- * Changed name of jde-wiz-insert-excluded-packages-regexp to
- jde-wiz-import-excluded-packages.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el, /pack/anoncvs/jde/lisp/jde.el,
/pack/anoncvs/jde/lisp/jde-dbo.el, /pack/anoncvs/jde/lisp/jde-javadoc.el,
/pack/anoncvs/jde/lisp/jde-parse.el, /pack/anoncvs/jde/lisp/jde-bug.el:
- *** empty log message ***
-
-2000-07-08 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el: Latest updates from David.
-
- * /pack/anoncvs/jde/lisp/java.bnf: Latest updates from David Ponce.
-
-2000-07-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Changes to reflect updates in semantic 1.2.
-
-2000-06-29 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Added sort option to Classes index menu. Thanks to David Ponce for this contribution.
-
-2000-06-28 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Reimplemented from scratch by David Ponce.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Get/set pair template now generates correct method name for getting the value of boolean
variables. Thanks to Stephane <s.nicolas(a)videotron.ca> for contributing this fix.
-
-2000-06-22 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Index menu now shows variable types and class definitions. Thanks to David Ponce for
these enhancments. Changed the name of jde-enable-index-menu to jde-imenu-enable and
jde-enable-full-method-signatures-index-menu to jde-imenu-include signature.
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el: Fix submitted by David Ponce.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- The import wizard dialog now uses radio buttons rather than check boxes to select
- the class to import. Thanks to Mark Gibson for this enhancement.
-
-2000-06-21 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Added rules for arithmetic and string expressions.
-
-2000-06-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Now handles arrays in field declarations.
-
-2000-06-12 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Now displays JDEbug menu when running XEmacs.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Now uses the value of jde-bug-debugger-host-address as the address of the socket for the
CLI channel.
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el:
- Now displays debug menu when running XEmacs.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el:
- Restored jde-bug-install-jdebug-menu for XEmacs compatibility.
- Added jde-bug-debugger-host-address variable.
-
- * /pack/anoncvs/jde/lisp/jde.el: Integrated David Ponce's jdok package.
-
- * /pack/anoncvs/jde/lisp/jde-javadoc.el: Initial revision.
-
-2000-06-09 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Classes index menu now shows full signatures of methods. Thanks to Ittay Freiman
<ittay(a)vigiltech.com> for suggesting this enhancement and to David Ponce
<david(a)dponce.com> for implementing it.
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Added volatile to list of variable modifiers. Thanks to David Ponce and Mike Bowler.
-
-2000-06-01 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Added control flow templates contributed by Eric D. Friedman <friedman(a)lmi.net>.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Added jde-sort-imports command. Thanks to David Ponce
<david_ponce(a)mail.schneider.fr>.
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Completion menu now works on XEmacs.
-
-2000-05-26 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el, /pack/anoncvs/jde/lisp/jde-bug.el:
- Added variable jde-bug-raise-frame-p to allow a user to specify
- whether the Emacs window should pop up when a breakpoint is hit.
-
- * /pack/anoncvs/jde/lisp/java.bnf, /pack/anoncvs/jde/lisp/jde-parse.el:
- Updated grammar to handle argument variables with modifiers and array arguments.
-
-2000-05-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/java.bnf, /pack/anoncvs/jde/lisp/jde-complete.el,
/pack/anoncvs/jde/lisp/jde-dbo.el:
- *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Adds a Classes index menu to the Emacs menubar.
-
-2000-05-11 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/java.bnf:
- Now handles native method declarations.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el: Updated bovinator grammar.
-
- * /pack/anoncvs/jde/lisp/java.bnf: Now parses constructors.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Added support for Eric Ludlam's semantic bovinator. Moved regular expression-based
imenu indexer to this file.
-
-2000-05-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el, /pack/anoncvs/jde/lisp/jde.el,
/pack/anoncvs/jde/lisp/jde-bug.el:
- The JDEbug menu now appears or disappears when you select or deselect JDEbug as the
current debugger.
-
-2000-05-02 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/java.bnf: Initial revision.
-
-2000-04-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Fixed some problems with the process launch command. Among others,
- the command now uses `system-name', instead of an absolute
- address (127.0.0.1) to refer to the local host when connecting to
- the port used to transport the debuggee process's standard I/O.
- This fixes the failure to start processes that occurs on some
- Windows networks.
-
-2000-04-20 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- User can now supply customized imenu regular expressions. See
`jde-imenu-regex-function'.
-
-2000-04-18 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Fixes a bug in the jde-dbs-cmd-failure-action method for jde-dbs-get-this and a bug in
the jde-dbs-cmd-success-action for jde-dbs-listen-for process.
-
-2000-04-14 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added option jde-imenu-recognize-tag-comments-p. When on, this option causes the imenu
symbol declaration indexer to recognize variables and method declarations witn prefixed
tag comments.
-
-2000-04-13 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Removed one stray reference to deleted function jde-proc-steppable-p.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added steppablep field to process object. Set whenever process hits a breakpoint or step
event.
- Modified jde-dbs-target-process-steppable-p to test steppablep field.
- This fixes menu enabling bug.
- Debugger lisp output parser now suspends paren balancing in strings. This fixes Lisp
eval error when a Java variable includes unbalanced parentheses.
-
-2000-04-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-compile.el:
- Compile command now supports Cygwin-style class paths.
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el:
- Local variables buffer now includes the this object for the corresponding stack frame.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added command to get the this object for a specified stack frame.
-
-2000-04-08 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el:
- The Emacs window now pops to the surface when JDEBug hits a breakpoint.
-
-2000-04-05 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Fixed thread-tree code to ignore No information Available threads.
-
-2000-03-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Now sets the working directory to jde-run-working-directory (if not null) before
starting the debugger.
-
-2000-03-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Display threads now includes the stack for each thread. Thanks to Paul Michael Reilly
<pmr(a)pajato.com> for implementing this.
-
-2000-03-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el, /pack/anoncvs/jde/lisp/jde-parse.el,
/pack/anoncvs/jde/lisp/jde-run.el:
- Miscellaneous small bug fixes and enhancements.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-db.el,
/pack/anoncvs/jde/lisp/jde.el:
- Added JDEbug option to jde-db-debugger.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Enabled interactive reading of vm and application arguments for JDEbug sessions. Thanks
to Steve Haflich <smh(a)franz.com> for this enhancement.
-
-2000-03-08 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- jde-db-format-command now signals an error it it cannot determine the containing class.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Fixed regular expression in jde-parse-get-innermost-class-at-point to handle more cases.
Thanks to Steve Haflich <smh(a)franz.com> for reporting the problem and providing a
starting point for the fix.
-
-2000-03-03 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el:
- Fixed bug where jde-bug-launch-process was returning t even when it failed.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Moved Browse JDK doc item to Help menu. Other cosmetic changes to the
- Help menu.
-
-2000-02-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el: Added key bindings for debugger.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed key bindings to show function keys on menu labels.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Fixed scrolling in process debug message window. Thanks to "Martin
- Dickau" <mdickau(a)byallaccounts.com> for this fix.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- jde-dbs-cmd now copies and then empties the pending event queue before
- processing the events. This fixes an infinite recursion bug that can
- occur when stepping through code.
-
-2000-02-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el:
- Implemented color customization for breakpoint marker.
- Implemented persistent breakpoints.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Implemented Cygwin/XEmacs compatiblity fixes provided by Fred Hart
- <cfhart(a)Z-TEL.com>.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el, /pack/anoncvs/jde/lisp/jde-run.el,
/pack/anoncvs/jde/lisp/jde.el:
- Implemented Cygwin/XEmacs compatiblity fixes provided by Fred Hart
- <cfhart(a)Z-TEL.com> in bsh-internal.
-
- * /pack/anoncvs/jde/lisp/beanshell.el:
- Implemented Cygwin/XEmacs compatiblity fix provided by Fred Hart
- <cfhart(a)Z-TEL.com> in bsh-internal.
-
- * /pack/anoncvs/jde/lisp/jde.el: *** empty log message ***
-
-2000-02-14 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Fixed XEmacs compatibility bug.
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: beta19 release
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Fixed find innermost class regular expression.
-
- * /pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/jde-dbo.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Implemented up and down stack commands.
-
-2000-02-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-bug.el:
- Fixed bug where Display->Threads command was not enabled when debugger
- was attached to a process.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Replaced jde expand file name function with expand-file-name.
-
-2000-02-09 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Added methods for parsing symbol at point.
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Replaced jde-help-class with jde-help-symbol method. The new method
- gets help for the symbol at point. The symbol may refer to a class,
- an object, or a method or field.
-
- * /pack/anoncvs/jde/lisp/jde-complete.el:
- Fixed "Wrong type argument: sequencep, 0" bug that occurs when using
- completion with XEmacs. Thanks to Dr. Volker Zell for reporting this
- bug.
-
- Now supports completion of fields declared at the end of a class as
- well as those declared at the beginning of a class.
-
- Adds current package to the import list for the current buffer. Thanks
- to harald(a)gliebe.de for providing this fix.
-
-2000-02-02 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: ReleaseNotes.txt
-
- * /pack/anoncvs/jde/lisp/beanshell.el: Expanded doc string.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el:
- Fixed bug in socket listen command.
-
-2000-02-01 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-bug.el:
- Added commands for listening for applications needing debug services.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Provide choice of coding styles for code generated by templates. Thanks to Jari Aalto
for this enhancement.
-
- * /pack/anoncvs/jde/lisp/jde-widgets.el, /pack/anoncvs/jde/lisp/jde-help.el,
/pack/anoncvs/jde/lisp/jde-run.el, /pack/anoncvs/jde/lisp/jde-dbs.el,
/pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-complete.el,
/pack/anoncvs/jde/lisp/jde-dbo.el, /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- ReleaseNotes.txt
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Fixed regular expression for classes to handle case where point is in
- a constructor. Thanks to Francois Cogne <cogne(a)col.bsf.alcatel.fr>.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Modified the Jdb->Set Breakpoint command (gud-break) to set breakpoints correctly
- in inner classes.
-
-2000-01-29 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- You can now use the notation [f1], [f2], etc., to specify function
- keys when customizing jde-key-bindings.
-
-2000-01-28 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el:
- Fixed startup timing bug that cause commands that use the beanshell to
- failt the first time on Unix systems.
-
-2000-01-18 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el, /pack/anoncvs/jde/lisp/jde.el,
/pack/anoncvs/jde/lisp/jde-help.el, /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- Added jde-show-class-source. Thanks to Phil Lord for the initial
- implementation of this command.
-
-2000-01-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-widgets.el, /pack/anoncvs/jde/lisp/jde-dbs.el,
/pack/anoncvs/jde/lisp/jde-dbo.el:
- Implemented array and object inspectors.
-
-2000-01-15 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Eliminated some globally bound symbols.
-
- * /pack/anoncvs/jde/lisp/jde-widgets.el:
- Implemented dynamic tree widget.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-bug.el:
- Added show buffer commands.
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el:
- Handler for breakpoint and step events now updates locals buffer automatically.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Reimplemented directory search functions.
-
- * /pack/anoncvs/jde/lisp/beanshell.el: Corrected typo.
-
-2000-01-02 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde.el:
- Added attach process commands.
-
-1999-12-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-run.el:
- Enhanced JDE->Run App command to run executables.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added show object monitors command.
-
-1999-12-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-dbo.el:
- Add the JDEbug buffer to buffers opened as the result of stepping,
- breakpoint, and watch events.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * jde-mode now defines underscore as a word constituent to allow
- variable names to start with underscores.
- * Added Project menu
- * Added Project Files->Load and Load All commands
- * Added jde-project-context-switching-enabled-p variable.
- * Context-switching now suspended when JDEbug is running a debuggee process.
-
-1999-12-20 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added cancel watchpoint command.
-
-1999-12-19 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Changed import wizard to use jde.util.JdeUtilities.getQualifiedName
- eliminated redundancy. Thanks to Len Trigg <len(a)intelligenesis.net>
- for this improvement.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Made buffer activation hook truly buffer local. Thanks to "Phillip
- Lord" <plord(a)hgmp.mrc.ac.uk> for this fix.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbo.el,
/pack/anoncvs/jde/lisp/jde-dbs.el:
- Added watch field command.
-
-1999-12-14 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Changed key binding for jde-help-class from C-c C-v C-h to C-c C-v C-w
- because C-h is a reserve binding. Thanks to Richard Y. Kim <ryk(a)coho.net> for
suggesing this change.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- JDE->Run Applet now looks in the current Java source directory for an
- html file having the same root name as the current Java source
- buffer. If it finds such a file, it runs it. Otherwise, it runs the first html file that
it encounters in the directory. Thanks to Richard Y. Kim <ryk(a)coho.net> for
providing a patch implementing this change.
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/jde-dbs.el:
- Added JDEbug->Processes->Remove Dead Processes command.
-
-1999-12-13 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/ReleaseNotes.txt,
/pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added jde-bug-vm-executable and jde-bug-jre-home variables.
- Fixed jde-dbs-launch-process command so that it fails gracefully.
-
-1999-12-03 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-run.el:
- Updated JDEbug to run under JDK 1.3beta.
-
-1999-11-30 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- Added JDEbug->Display->Path Info command.
-
-1999-11-29 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el,
/pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- Added JDEbug->Display->Loaded Classes Command.
-
-1999-11-28 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-complete.el,
/pack/anoncvs/jde/lisp/jde.el:
- Changed key binding for jde-complete-at-point to C-c C-v C-.
-
-1999-11-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/jde-dbo.el, /pack/anoncvs/jde/lisp/jde-dbs.el,
/pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- Added commands for tracing classes.
-
-1999-11-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-bug.el:
- Added Trace->Cancel command.
-
-1999-11-21 reyes <reyes@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-complete.el: *** empty log message ***
-
-1999-11-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jcomplete.el: Initial revision.
-
- * /pack/anoncvs/jde/lisp/jde-widgets.el, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/jde-db.el, /pack/anoncvs/jde/lisp/jde-dbo.el,
/pack/anoncvs/jde/lisp/jde-dbs.el:
- Added trace method commands and skeletons for trace class and cancel
- trace commands.
-
-1999-11-13 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el: *** empty log message ***
-
-1999-11-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el:
- Added class and method tracing command skeletons.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added trace-mode fields to jde-dbs-proc class. Needed to support trace mode.
- Added object-refs field to jde-dbs-proc class. Needed to support object reference
management.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Amended jde-db-make-qualified-class-name-regexp to permit package names to begin with
non-word characters, e.g., underscores. Contributed by "Patrick J. McNerthney"
<pat(a)mcnerthney.com>.
-
-1999-11-01 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el: No change.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Added jde-browse-class contributed by Rohit Namjoshi
<Rohit_Namjoshi(a)trilogy.com>.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added jde-submit-bug-report contributed by Phillip Lord.
-
-1999-10-28 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el,
/pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- Added interrupt and stop thread commands.
-
-1999-10-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Fixed a line in jde-wiz.el, where an int is concat'd with some
- strings. This is not allowed by XEmacs 21.1.
-
-1999-10-15 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- Fixed bugs in JDEbug->Exit Debugger.
-
-1999-10-14 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/jde-dbs.el:
- Added Resume Process and Resume Thread commands.
-
-1999-10-13 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added suspend process and suspend thread commands.
-
- * /pack/anoncvs/jde/lisp/jde-widgets.el, /pack/anoncvs/jde/lisp/ReleaseNotes.txt,
/pack/anoncvs/jde/lisp/jde-bug.el:
- Add JDEBug->Threads->Show Threads command
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el: Add JDEBug->Show Threads command
-
-1999-10-01 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added jde-wiz-update-class-list function to the Wizards menu.
- Added jde-help-class to the Help menu.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Added jde-wiz-update-class-list function contributed by Phillip Lord.
-
-1999-09-30 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Cache jde variables to speed switching between projects. Enhancement
- provide by David Biesack.
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Fixed typo spotted by David Biesack.
-
-1999-09-28 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-widgets.el: Initial revision.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- start debugger method now checks whether debugger actually started
- and returns nil if the debugger did not start.
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el:
- jde-dbo-init-debug-session now sets debugger's started-p field to true.
-
- * /pack/anoncvs/jde/lisp/jde-db.el, /pack/anoncvs/jde/lisp/jde-run.el:
- Supplied missing left parentheses.
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- JDE 2.1.6beta10 release notes
-
- * /pack/anoncvs/jde/lisp/jde-bug.el:
- Patched to use either gud-find-c-expr or find-c-expr.
-
-1999-09-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Added code templates implementing EJB EntityBean and SessionBean
- interfaces. Thanks to Brendan.Burns(a)tfsma-ims.tfn.com for contributing
- the templates.
-
-1999-09-18 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- Release notes for JDE-2.1.6beta9.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Fixed bug in the launch-process command where the command was failing
- to convert the application arguments from a list of arguments to a
- string of arguments. Thanks to "Matthew
- Weymar"<mweymar(a)hamilton-partners.com> for reporting the bug.
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Now prepends "file://" to doc file when invoking browse-url. Hopefully
- this will fix the problem reported by one user where the browser
- prepends
http://www to doc file path.
-
-1999-09-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el:
- Set comint-prompt-regexp to the beanshell prompt.
- Fixed bug where Emacs was querying user whether to kill the beanshell
- buffer on exit from Emacs.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Fixed regression error where the interface wizard was putting quotes
- around the code inserted into the source buffer.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed Wizards->Import Class menu item to invoke
- jde-wiz-find-and-import instead of jde-wiz-import.
-
-1999-09-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added get locals command.
-
-1999-09-13 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Enhanced get array command.
-
-1999-09-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Finished first cut at get_object command.
-
-1999-09-08 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/jde-dbo.el,
/pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-bug.el:
- Updated debugger code to take advantage of new unbound slot capability
- of eieio.
-
-1999-09-07 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-bug.el:
- Added get array command.
-
-1999-09-05 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed bug in jde-show-help function that prevented it from working
- with Internet Explorer on Windows/NT.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbo.el,
/pack/anoncvs/jde/lisp/jde-dbs.el:
- Added initial implementation of evaluate and display variable commands.
-
- * /pack/anoncvs/jde/lisp/jde-db.el, /pack/anoncvs/jde/lisp/jde-run.el:
- Added support for running vm in classic mode.
-
-1999-08-30 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbo.el,
/pack/anoncvs/jde/lisp/jde-dbs.el:
- Converted clear breakpoint command to OOPS.
-
-1999-08-29 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el, /pack/anoncvs/jde/lisp/jde-run.el,
/pack/anoncvs/jde/lisp/jde-wiz.el:
- Patches provided by Michael Ernst <mernst(a)alum.mit.edu>
-
-1999-08-28 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-dbs.el,
/pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbo.el:
- Improved multiple process handling, window configuration.
-
-1999-08-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde.el,
/pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbo.el:
- Provided initial support for multiple processes.
- Fixed jde-find-data-directory to work on XEmacs with a standard
- JDE distribution.
- Ported breakpoint highlighting code to XEmacs. Still has bugs though.
- Now includes jde-db-option options on vm command-line for process.
-
-1999-08-24 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde.el:
- Reimplemented the constructor for jde-dbs-proc the right way. Renamed
- jde-bug-counter to jde-bug-breakpoint-counter.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Fixed a couple of NT-related problems. In particular, add an extra
- line feed after debugger commands to force flushing of debugger output
- buffer and modified jde-dbs-process-runnable-p to recognize an
- "unknown" state as runnable if the process is suspended.
-
-1999-08-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el: Minor bug.
-
- * /pack/anoncvs/jde/lisp/imenu.el, /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- Required by XEmacs users.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbs.el:
- Added customization variable jde-bug-jpda-directory. Also check to
- ensure that this variable specifies a valid path.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Updated jde-show-help function to reflect new location of user's guide
- in the JDE help hierarchy.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Fixed regression bug in jde-wiz-implement-interface caused by recent
- change in jde-wiz-insert-imports.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-dbo.el,
/pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde.el:
- Updated to use Eric Ludlam's eieio object system.
-
-1999-08-20 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Added 2.1.6B5 release notes.
-
- * /pack/anoncvs/jde/lisp/makefile:
- Updated to include new debugger in distributable.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el:
- Added jde-parse-get-package-from-name function.
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Corrected spelling of Phillip Lord's name.
-
-1999-08-19 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jtags.csh:
- Added prune clause for CVS directories.
-
- * /pack/anoncvs/jde/lisp/jtags: Added prune clause for RCS.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el: *** empty log message ***
-
-1999-08-18 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el: Continuing implementation
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el, /pack/anoncvs/jde/lisp/jde-dbo.el:
- Continuing implementation.
-
-1999-08-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-bug.el: *** empty log message ***
-
-1999-08-15 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Provided support for initial implementation of JDEbug.
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el:
- Implemented additional functionality.
-
- * /pack/anoncvs/jde/lisp/jde-bug.el: Implemented more functionality.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Fixed classpath in debugger start function.
-
- * /pack/anoncvs/jde/lisp/jde-dbs.el:
- Implemented a lot of new functionality.
-
-1999-08-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-dbo.el, /pack/anoncvs/jde/lisp/jde-bug.el,
/pack/anoncvs/jde/lisp/jde-dbs.el:
- New file.
-
-1999-07-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Added jde-run-application-running-p predicate function.
-
-1999-06-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el: Changed release number to 2.1.6beta4.
-
-1999-06-26 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Kill project file buffer after saving to prevent cross-contamination of simultaneously
open project files.
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Type javadoc now sufficient to specify both Java 1 and Java 2 javadoc docsets.
-
-1999-06-25 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Enhanced to support doc collections of any type.
-
-1999-06-22 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/makefile: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Notes for JDE 2.1.6beta3
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added key binding for `jde-help-class'.
- Updated revision to 2.1.6beta3.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Added variable to filter out unwanted classes from the list of classes being
- considered for import command by jde-find-and-import. The jde-find-and-import
- command now prompts the user if more than one class matches the specified
- import name. Thanks to Phillip Lord <plord(a)hgmp.mrc.ac.uk> for these
enhancements.
-
-1999-06-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-help.el: Bug fix.
-
- * /pack/anoncvs/jde/lisp/jde-help.el:
- Eliminated separate customization group for help variables.
-
- * /pack/anoncvs/jde/lisp/jde-help.el: New file.
-
-1999-05-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Added require statement for jde-parse.
-
-1999-05-07 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Changed version number to 2.1.6beta1.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Changed jde-run-parse-args to accept any substring enclosed in single or double
- quotes or that does not contain white space as an arg.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Changed key binding C-c C-v C-z to invoke
- jde-wiz-find-and-import instead of jde-wiz-import.
-
- Changed jde-build to support interactive entry of make arguments.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el: Cosmetic change.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Added new command, jde-wiz-find-and-import, that, given an unqualified class
- name, generates and inserts an import statement for that class.
-
-1999-04-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/makefile: Include parser in distributable.
-
- * /pack/anoncvs/jde/lisp/jde-make.el:
- Updated to allow interactive entry of make arguments. Thanks to Yarek J. Kowalik
<jgk(a)klg.com> for providing this enhancement.
-
- * /pack/anoncvs/jde/lisp/jde-parse.el: New file.
-
-1999-03-12 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/makefile: Added removal of ^M characters.
-
-1999-03-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed in bug in jde-find-jde-data-directory
-
- * /pack/anoncvs/jde/lisp/jde.el: Changed version to 2.1.5.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed jde-db-find-file to return the current buffer if it cannot find a file and
- XEmacs is the editor.
-
-1999-03-06 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Changed default value of jde-db-source-directories to be nil.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Make sure that case-sensitive matching is used when extracting package names from
- debugger breakpoint messages.
-
-1999-02-26 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/makefile: New file.
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el: Version 2.1.5b4
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Catch non-existant directory errors when searching for source
- files and packages. Thanks to Thanh Nguyen <Thanh.Nguyen(a)Eng.Sun.COM>
- for finding and providing a fix for this bug.
-
-1999-02-25 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed jde-db-find-file so that it displays an error when it cannot find a file instead
of
- opening an empty source buffer.
-
- Provided a set-value function for jde-db-source-directories that appends a slash to
- the end of each path if the path does not already end in a slash.
-
- Defined a new command, jde-find-class-source, that finds and opens the source file
- for a specified class.
-
- Improved the regular expression used by jde-db-get-package to ignore tabs at the
- beginning of a line.
-
-1999-02-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el: 2.1.5b3 version number.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Provided more robust error handling for the interface wizard. The wizard
- no longer kills the bsh when it cannot create an interface and provides
- meaningfull error messages.
-
-1999-02-15 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el: Forgot to concatenate in last fix.
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated version number.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Fixed bug in jde-wiz-get-method-class that caused it to fail when the open bracket
- for the class was not on the same line as the class keyworkd. Thanks to
- P.Lord(a)mdx.ac.uk (Phillip Lord) for diagnosing this bug.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed bug in qualified-class-name-regexp.
-
-1999-02-12 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added menu item (Wizards->Import Class) for generating import statements.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el: Added jde-wiz-import function.
-
-1999-02-11 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Fixed bug in jde-wiz-update-implements-clause.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el: Corrected missing parentheses.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Updated the Swing application template to the JDK 1.2 Swing package
- scheme and expanded the template to provide a menu and scrollable
- canvas.
-
-1999-02-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Added support for appletviewer -encoding and -J options.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Added support for appletviewer options.
-
-1999-02-08 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- jde-db-applet now supports file completion and remembers the last path entered.
-
-1999-02-06 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed bug and generalized regular expression in
jde-db-make-qualified-class-name-regexp.
-
-1999-02-05 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Added file-completion and default-to-last-entry to jde-run-applet
- command.
-
-1999-02-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Provided a fix for ensuring that key bindings are always set. The fix is
- to do a custom-initialize-reset on the jde-key-bindings variable in the jde-mode
- function. The jde-mode-map is updated with the key bindings as a side effect of
- resetting the variable.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed some keybindings. Also backed out Matthew Moore's fix for ensuring
- that jde-mode-keymap gets set at startup since it seems to break
- java-mode. I'll try to come up with another fix later.
-
-1999-02-03 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed regular expression in jde-db-get-package to eliminate spurious hits, e.g.
- commented out package statements. Thanks to Frederic Baumann <baumann(a)ilog.fr>
- for reporting this bug.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Patched jde-db-get-app-args-from-user to remember arguments.
- Thanks to Brian Burton <brian(a)burton-computer.com>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed jde-db-make-qualified-class-name-regexp to handle packages with underscores.
- Thanks to Brian Burton <brian(a)burton-computer.com>.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Changed jde-db-make-qualified-class-name-regexp to handle inner classes.
- Thanks to Michael Lepore <lepore(a)process.com> for this fix.
-
- * /pack/anoncvs/jde/lisp/jde.el: Minor fix to debug applet item.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed jde-db-applet to check the current directory for the html file to run.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed a bug in the initialization code for jde-key-bindings.
- Thanks to Matthew Moore <matthew.moore(a)Schwab.COM> for this fix.
-
- Added a menu item for debugging applets.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Enhanced jde-run-applet to look in current directory for html file
- to display, if you do not specify a file in the minibuffer or via
- jde-run-applet-doc. Also fixed a bug in the minibuffer version of
- jde-run-applet that forced you always to specify the name of an
- html document.
-
-1999-02-02 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Added the jde-db-applet command. This command allows you to debug an applet, using
- appletviewer.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Removed unwanted space in -D (properties) debug option.
-
-1999-01-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-make.el:
- Removed two line feeds at the end of make command as they appeared to
- confuse GNU make for NT.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Now uses gud-find-c-expr or find-c-expr, whichever is bound.
-
-1999-01-15 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el:
- Added Andy Piper's NT/XEmacs compatibility changes.
-
- * /pack/anoncvs/jde/lisp/jde.el: Some XEmacs patches that I missed.
-
- * /pack/anoncvs/jde/lisp/jde-compile.el, /pack/anoncvs/jde/lisp/jde-run.el:
- Added Andy Piper's NT/XEmacs compatibility changes.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added XEmacs compatibility changes from Andy Piper.
-
-1999-01-13 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Added Andy Piper's NT/XEmacs 21 compatibility changes.
- Changed find-c-expr to gud-findc-expr
-
-1998-12-13 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el:
- Add check for chunked traffic between Emacs and the BeanShell.
-
-1998-12-09 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el:
- Added a startup message for beanshell.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Put jde-compile variables in a new file jde-compile.el.
-
-1998-12-07 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-compile.el:
- Updated compile options to reflect changes in command-line options
- accepted by javac.
-
-1998-12-06 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-compile.el: New file.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Fixed bug with jde-run-options-properties. (The bug was putting a space before the
- -D switch.)
-
-1998-11-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated JDE version number to 2.1.3.
-
- * /pack/anoncvs/jde/lisp/beanshell.el:
- Use CLASSPATH environment variable if jde-global-classpath is nil.
-
- * /pack/anoncvs/jde/lisp/jde-make.el:
- Changed to use compile mode as suggested by Robert Grace <rmg2768(a)draper.com>.
-
-1998-11-23 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
- Added note about BeanShell not running on Solaris.
-
-1998-11-22 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el: Fixed path separator bug.
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el: Fixed bug in interface wizard.
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Made comint-prompt-regexp and paragraph-start local variables.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added menu items for the BeanShell and method override and interface wizards.
-
- * /pack/anoncvs/jde/lisp/beanshell.el: Changed path to use jde.jar.
-
-1998-11-21 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el: Fixed bug.
- Added implements clause update function to interface implementation wizard.
-
-1998-11-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el:
- Added smart import insertion to interface wizard.
-
-1998-11-08 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-wiz.el: New file.
-
-1998-11-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Corrected verbiage in Jde Debugger Options description.
-
-1998-10-22 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/beanshell.el: New file.
-
-1998-09-16 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Added template for Java bean property change support.
-
-1998-09-13 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Release notes for 2.1.1
-
- * /pack/anoncvs/jde/lisp/jde.el: Fixed a small bug in key binding code.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added support for customization of JDE key bindings via the
- variable jde-key-bindings.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Added a template for generating a System.out.println statement.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added System.out.println template to the Generate menu.
-
-1998-09-12 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Debugger now runs application from directory specified by jde-run-working-directory.
-
-1998-09-11 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Added a jde-run-working-directory customization variable. If set to a valid
- path, the JDE starts the application from the directory specified by the
- path. If the value of this variable is the empty string (the default),
- the JDE starts the application from the default directory of the current
- source buffer. The default directory is usually the directory containing
- the source file.
-
-1998-09-07 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- This version includes the latest version of jde-gen.el, which was inadvertently
- replaced by an older version in the last release. This version also includes
- a newer version of speedbar.el that seems to work better with NT/Emacs 20.3.1
- than the one that comes with the 20.3.1 distribution.
-
-1998-08-28 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde.el:
- *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated version number.
-
- * /pack/anoncvs/jde/lisp/jde-run.el: Updated to support NT/Emacs 20.3
-
-1998-07-28 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el: Removed a diagnostic message.
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated version number to 2.0.9.
-
- * /pack/anoncvs/jde/lisp/jde.el: Fixed the following project file bugs:
-
- * JDE does not store the project name in the project file.
- * JDE does not save variables whose value is nil.
- * JDE does not reset variables to initial values when
- switching to a buffer that is not part of a project.
-
-1998-07-22 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Modified class buffer creation templates to use tempo-marks
- to mark initial position for user to insert code. Thanks
- to David Hull <david.hull(a)trw.com> for suggesting this.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Now requires cus-edit. This fixes custom-quote is void bug.
-
- Fixed bug in jde-set-variables that prevented loading of
- project files in the new format.
-
-1998-07-10 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Changed jde-save-variables to mark variables that have been customized\n in the current
session. Changed jde-set-variables to store the value\n of a customized variable in the
customized-value property of the\n variable. This enables Custom to recognize the variable
as customized.\n\n Added jde-convert-prj-file, a function that converts old project files
to \n \
- JDE-2.0.7 format.\n\n Fixed a bug in the function that finds the JDE documentation.
-
-1998-07-09 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Change the way that the JDE saves and restores project-specific values of
- customization variables to be compatible with custom. This fixes the bug
- that caused errors when loading customized JDE variables from a .emacs file.
-
-1998-07-06 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- class buffer template now prompts for super class and
- interface
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Added boilerlate to other buffer generation templates.
-
-1998-07-04 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Should have been does not turn on font-lock if XEmacs 21.0.
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Now does not turn on font-lock if XEmacs 20.1.
-
-1998-07-02 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Added $ to the set of characters recognized by the JDE as valid
- in vm and Java app command-line arguments.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed bugs in the jde-show-help function that prevented display
- of help on XEmacs and NT/Emacs.
-
-1998-07-01 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Added source file boilerplate support.
-
-1998-06-30 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Fixed jde-run-parse-args to recognize % as an argument
- character.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Added variables `jde-db-read-vm-args' and `jde-db-read-app-args'. The use of
- these variables is the same as the corresponding jde-run variables.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added the customization variable `jde-read-compile-args'. If non-nil,
- this variable causes the jde-compile command to read compilation options
- from the minibuffer and append them to the options specified by
- the `jde-compile-option group of customization' variables. The JDE
- maintains a history of compiler options entered in the minibuffer.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Added the variables `jde-run-read-vm-args' and `jde-run-read-app-args'.
- The first cause the jde-run command to read vm arguments from the
- minibuffer and append them to the vm arguments specified by
- the `jde-run-option' group of customization variables. The second
- causes jde-run to read arguments to be passed to the application
- from the minibuffer and append them to the arguments specified
- by `jde-run-applications-args'. The JDE maintains separate histories
- for both types of arguments.
-
-1998-06-29 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Use fboundp instead of Emacs version to determine whether
- easy-menu-create-menu is bound.
-
- * /pack/anoncvs/jde/lisp/jde-db.el: Fixed bug in marker filter.
-
-1998-06-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated release to 2.0.3
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed bug where the JDE was invoking global-font-lock-mode on XEmacs,
- where it is not defined.
-
- Updated JDE to call easy-menu-create-menu instead of easy-menu-create-keymaps
- on Emacs 20. (The former replaces the latter as of Emacs 20.x);
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Provided a hack to handle reordering of threaded messages on Solaris.
-
- Provided code to handle case where current class has no line number
- information.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Fixed capitalization on get-set method pair. Thanks to Jere_McDevitt(a)HomeDepot.COM
-
-1998-06-25 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Removed debug messages from jde-db-marker-filter.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Modified jde-db-marker-filter to accummulate debugger output
- in chunks. Fixes bug reported by Eric Prud'hommeaux (eric(a)w3.org).
-
-1998-06-22 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Added jde-db-startup-commands variable. This variable allows you to
- specify debugger commands to run when the debugger is started.
-
-1998-06-21 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated JDE version number to 2.0.2.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Changed buffer change code to reload a project file
- when a user changed jde-mode buffers, not just .java
- buffers. This allows using extensions other than .java
- for Java source code files.
-
- Made post-command-hook buffer local to improve performance.
-
- Thanks to David J. Biesack( sasdjb(a)unx.sas.com) for the above changes.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Added a customizable feature, jde-db-set-initial-breakpoint, that causes
- the JDE to set an initial breakpoint in an app's main routine and run
- to the breakpoint on debugger startup. The feature is enabled by default.
-
-1998-06-20 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Made jde-db-marker-regexp a custom variable to facilitate the use of the JDE
- with debuggers other than jdb.
-
- Changed the marker regular expression to detect only jdb breakpoint messages,
- i.e., messages of the form
-
- Breakpoint hit: qualified.class.name (class:line)
-
- This should eliminate the problem of spurious hits when exceptions occur and
- stack traces are printed.
-
-1998-06-18 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added XEmacs compatibility changes requested by
xemacs.org.
-
-1998-06-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Added support for abbreviations.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Fixed bug that caused jfc-app to be generated instead of console app.
- Added a mouse motion listener template.
- Added a toString method template.
-
-1998-05-29 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde-make.el:
- Added dummy function for jde-make-mode to facilitate autoloading.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added no-op function for jde-mode to facilitate autoloading.
- Thanks to Andy Piper <andyp(a)parallax.co.uk> for the suggestion.
-
-1998-05-27 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated JDE version number to 2.01.
-
- * /pack/anoncvs/jde/lisp/jde-db.el, /pack/anoncvs/jde/lisp/jde-make.el,
/pack/anoncvs/jde/lisp/jde-run.el, /pack/anoncvs/jde/lisp/jde-gen.el:
- Added autoload comments.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el: *** empty log message ***
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added autoload comments for JDE functions.
-
-1998-05-17 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Changed names of the Files->JDE New->Custom and JDE-Autocode->Custom
- to Other...
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Added templates for a Swing application and an inner class.
-
- Fixed a bug in jde-gen-buffer
-
-1998-04-19 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Updated for JDE 2.0
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated version number.
-
-1998-04-18 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- Fixes some bugs in the generated code.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Replace imenu--generic-function with jde-create-imenu-index
- as the indexing function for Java source buffers.
- jde-create-imenu-index is basically imenu--generic-function
- with a fix for a bug that generates multiple indexes for
- the same symbol.
-
-1998-04-10 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/ReleaseNotes.txt: New file.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el: * Updated some of the doc strings.
-
-1998-04-09 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Added menu items for inserting custom code templates in buffers.
- The items are:
-
- Files->JDE New->Custom
-
- JDE->Generate->Custom
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- * Added the capability to define your own custom autocode templates.
- The facility consists of the following items:
-
- - jde-gen-code-templates
-
- Defines a list of templates for code inserted at point. The
- list by default contains the templates defined by the JDE.
- You can define your own templates and add them to the list,
- using the Emacs customization feature. See tempo.el for
- information on creating templates.
-
- - jde-gen-buffer-templates
-
- Defines a list of templates for code to be inserted in a
- newly created Java buffer.
-
- - jde-gen-code (JDE->Generate->Custom)
-
- This command inserts a specified code template at point.
-
- - jde-gen-buffer (Files->JDE New->Custom)
-
- This command creates the specified buffer and inserts
- a specified template at the beginning of the buffer.
-
-1998-04-08 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Fixed jde-save-variables and jde-set-variables so that they
- operate more like the corresponding custom functions. This
- was necessary to support project-by-project customization
- of autocode templates.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- * Provided each template variable with a set function that regenerates
- the corresponding template command whenever the template is changed.
-
-1998-04-06 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Removed extraneous New option from JDE menu.
-
- * /pack/anoncvs/jde/lisp/jde-gen.el:
- * Added jde-gen-class-buffer and jde-gen-console-buffer functions.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Added JDE New submenu to the Emacs Files menu. The new submenu has
- commands for creating buffers with skeleton code for the following
- types of classes:
-
- - Generic class
- - Main class for a console application
-
-1998-04-01 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-gen.el: New file.
-
- * /pack/anoncvs/jde/lisp/jde.el: * Added code generation for
-
- - new Java source file
- - Get/set variable method pair
- - Action listener
- - Window listener
- - Mouse listener
-
-1998-03-30 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Fixed separator code in JDE menu definition.
-
- Thanks to Kai Grossjohann <grossjohann(a)ls6.cs.uni-dortmund.de>
- for providing this fix.
-
-1998-03-27 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/makefile.sample: New file.
-
- * /pack/anoncvs/jde/lisp/jde.el: Added the jde-build command.
-
- * /pack/anoncvs/jde/lisp/jde-make.el: New file.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed typo in the code that displays the jdb menu on XEmacs.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Modified jde-db-search-src-dirs to take current package as an
- argument rather than use a global variable. This allows
- it to be used by jde-java-build function.
-
-1998-03-23 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Set up to activate project tracking when the first Java buffer
- is loaded and deactivate project tracking when the last
- Java buffer is closed.
-
- * Removed update buffer command as it is no longer necessary
- because all customization variables are now global.
-
- * Changed save project command to prompt for a project name,
- which is required for automatic project tracking.
-
-1998-03-22 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Changed the way the JDE maintains project settings. Previously
- most JDE customization variables were buffer local. This was basically
- a way of letting Emacs manage project-dependent customization
- settings. However, this approach conflicts with the new (as of
- Emacs 20) Emacs customization feature. To avoid the conflict,
- the JDE now manages the task of keeping buffers up-to-date.
- In particular, all variables are global to permit easy
- customization. Whenever a user switches from one Java buffer to
- another, the JDE checks to see if the "to" buffer is part of the
- same project as the "from" buffer. If not the JDE loads the
- project file for the "to" buffer, thus updating the customization
- variables to the specific JDE settings for the "to" buffer's project.
-
- * Fixed bug that prevented jde-compile-option-command-line-args
- from working correctly.
-
-1998-03-19 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- - Fixed bug that prevented JDE->Options->Debug from working.
-
- - Updated version number.
-
-1998-03-18 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Changed jde-db-marker-regexp to account for inner classes.
- Thanks to Andreas Rasmusson <Andreas.Rasmusson(a)sics.se> for
- providing this fix.
-
-1998-03-05 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Made jde-db-source-directories non-global again to
- eliminate the problem of project files changing
- its value.
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated version number to 1.9.5
-
-1998-03-04 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Added test for jde-run-application-class = "" to jde-db
-
- * /pack/anoncvs/jde/lisp/jde-run.el: Fixed bug in jde-run.
-
-1998-03-03 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- - Fixed bug in imenu regexp for speedbar that falsely taggex
- method-like constructs in comments
-
- - Added file: prefix to path to User's Guide.
-
- - Fixed bug that caused setting jde-compile-option-vm-args to wipe
- out all other compile options.
-
-1998-02-27 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el: Changed copyright to Paul Kinnucan.
- Have not yet assigned rights to FSF.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Added support for Emacs customization feature.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- * Added support for Emacs customization feature.
-
-1998-02-25 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added jde-show-help command. This command displays the
- JDE User's Guide in a browser.
-
-1998-02-23 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Reorganized JDE menu. Eliminated the Compile Options item
- and added the following items:
-
- JDE->Options->Compile Shows Compile Options buffer
- JDE->Options->Run Shows Run Options Buffer
- JDE->Options->Debug Shows Debug Options Buffer
- JDE->Options->Project Show Project Options Buffer
- JDE->Options->Update Buffer Updates buffer to global options values
-
- * Added the jde-save-project command.
-
- This command saves the values of all local JDE options (i.e.,
- customization) variables in the project file. This provides
- an easy way of creating a project file for a project.
- Simply set the desired options, using the JDE Options menu.
- Then, save the results in the project file.
-
-1998-02-19 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jtags.csh: Updated to Bourne version.
-
- * /pack/anoncvs/jde/lisp/jtags: More edits to the comments.
-
- * /pack/anoncvs/jde/lisp/jtags: Cleaned up the comments.
-
- * /pack/anoncvs/jde/lisp/jtags:
- "Kent S. Gordon" <kgor(a)inetspace.com> contributed the following
- improvements
-
- - Change some .* expressions to [^.*] to prevent matches
- in source file comments and functions.
-
- - Removed . from class_type since declarations should never
- be for another package.
-
- Thanks Kent.
-
-1998-02-18 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Corrected some doc strings.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Added customization support by redefining all customization
- variables, using defcustom.
-
- * Defined two customization groups: jde and jde-compile-options.
-
- * Replaced the jde-classpath variable with jde-global-classpath.
-
- * Added customization option jde-quote-classpath.
-
- * Added variable jde-project-name.
-
- * Replace variable jde-compile-options with
- jde-compile-option-command-line-args.
-
- * Added the following compile option variables:
-
- jde-compile-option-classpath
- jde-compile-option-directory
- jde-compile-option-deprecation
- jde-compile-option-debug
- jde-compile-option-nodebug
- jde-compile-option-optimize
- jde-compile-option-optimize-interclass
- jde-compile-option-option-depend
- jde-compile-option-vm-args
- jde-compile-option-verbose
- jde-compile-option-nowarn
- jde-compile-option-encoding
-
- All of these variables are made buffer local.
-
- * Replaced jde-set-classpath function with
- jde-set-global-classpaht function.
-
- * Added the following functions
-
- jde-path-string-to-list
- jde-build-classpath-arg
- jde-build-compile-vm-args
- jde-get-compile-options
-
-1998-02-17 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed bug in jde-deb-set-source-paths that caused the last
- directory to not be normalized (i.e., slash appended).
-
-1998-02-13 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed so that the JDE menu appears in the XEmacs menu bar
- only when a Java buffer is active.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added jde-use-font-lock variable. If t (the default), jde turns on
- font-locking for java files.
-
-1998-02-12 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Advised imenu-default-create-index-function to set case-fold-search
- to nil (case-sensitive) when creating indexes.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Fixed some bugs in imenu regular expressions, including lack of a re
- for indexing primitive type variables. Thanks to
- David J. Biesack <sasdjb(a)unx.sas.com> for spotting some bugs.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added fix to bug that prevented fontlocking on Emacs 20.2
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Changed the jde-db-search-src-dirs to search the source directory list from
- front to back instead of back to front. The former search order did not allow newer
versions of the same class to shadow older versions. Thanks to "David J.
Biesack" <sasdjb(a)unx.sas.com> for supplying this fix.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed bug in jde-db-marker-filter that sometimes prevented the JDE from
- loading the correct source file. Thanks to David J. Biesack
- <sasdjb(a)unx.sas.com> for supplying the fix.
-
-1998-01-29 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Fixed typo.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Made various changes to ensure compatibility with XEmacs.
-
-1998-01-20 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Use browse-url instead of browse-url-of-file.
-
- * /pack/anoncvs/jde/lisp/jde.el: Require cc-mode.
-
-1998-01-20 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added code to set up andersl font locking. Necessary because
- andersl assumes that the buffer is in java-mode.
-
-1998-01-19 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- * Made JDE into a major mode (jde-mode) derived from java-mode.
- * The JDE now uses the browse-url package to display JDK documentation.
- * Deleted the variable jde-hook (it is replaced by jde-mode-hook).
- * Deleted the variables jde-web-browser and jde-doc-dir as they duplicate
- functionality provided by browse-url.
-
- * /pack/anoncvs/jde/lisp/jde.el: *** empty log message ***
-
-1997-12-03 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jtags:
- Divided tagging process into three passes
- through the source hierarchy to avoid overflowing
- the xargs bugger.
-
-1997-10-30 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Made configuration variables settable.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- 1) Made configuration variables settable.
- 2) Made jde-db-source-directories buffer local.
-
-1997-10-26 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Fixed bug where jde-run was incorrectly parsing command line arguments
- containing an equal (=) sign.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Applied Derek Young's patch to cause jde to qualify class names
- when setting a breakpoint.
-
-1997-10-20 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Removed reference to deleted function jde-db-massage-args
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Now requires andersl-java-font-lock only for Emacs versions < 20.
-
-1997-10-18 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- 1. Changed key bindings to use the two prefix keys C-c C-v.
-
- 2. Fixed infinite recursion bug in jde-find-project-file.
-
-1997-10-11 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed bug in jde-db-search-src-dirs discovered by Jonathan Payne.
-
-1997-10-07 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Required cl.
-
-1997-10-06 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed bugs in jde-db-set-debugger command.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Removed last usage of obsolete bashify function.
-
- * /pack/anoncvs/jde/lisp/jtags:
- Replaced existing regular expressions with a new set
- based on those contained in andersl-java-font-lock.el
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added jde-compiler variable and associated set command. Lets you
- configure the JDE to use the compiler of your choice on a buffer
- by buffer basis.
-
-1997-10-05 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Unquoted classpath as quotes are only necessary for compilation (because
- the JDE uses a shell to run the compiler).
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- 1. Added the variables jde-db-debugger and jde-db-debugger-is-executable
- and the associated setter function jde-db-set-debugger. These allow
- you to specify a custom debugger for the JDE>
-
- 2. Added jde-db-args and jde-db-app-args and the associated setter
- functions. These allow you to specify debugger and application
- command line arguments.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Added the function jde-run-set-app-args, which allows you to
- specify command line arguments for the application you are running.
-
- Also, changed the value of jde-run-args from a string to a list.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Fixed bug in print object menu item.
-
-1997-10-04 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: Added key bindings for menu commands.
-
-1997-10-03 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el: 1. Revamped imenu regular expressions.
- 2. Stopped quoting compile command arguments for bash under Win32.
-
-1997-10-01 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Changed name of JDE menu from "Java" to "JDE" to avoid conflict
- with cc-mode 5.18 menu, which is named "Java".
-
-1997-09-16 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Changed w32-start-process-show-window to win32-start-process-show-window
-
-1997-09-04 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Added jde-run-applet command, which runs a Java applet.
-
- * /pack/anoncvs/jde/lisp/jde.el: Updated version number.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- 1. Made jde configuration variables buffer local to support automatic
- loading of project files.
-
- 2. Added Run Applet command to the jde menu.
-
-1997-08-29 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el: Fixed bug in save-w32-show-window.
-
-1997-08-28 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Eliminated single quotes around path in jde-browse-jdk-doc.
-
-1997-08-26 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el: Fixed bug in check-source-path.
-
-1997-08-26 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/readme.txt: Updated for JDE 1.8 release.
-
- * /pack/anoncvs/jde/lisp/jtags: Added revision number.
-
- * /pack/anoncvs/jde/lisp/jtags.csh:
- 1. Exclude RCS (version control) directories from tags search.
- 2. Added pattern for recognizing abstract classes.
-
- * /pack/anoncvs/jde/lisp/jtags:
- 1. Exclude RCS directories from tags search.
- 2. Added regular expression for abstract classes.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Tweaked JDE Version number for JDE 1.8 release.
-
- * /pack/anoncvs/jde/lisp/jde.el:
- Added jde-set-classpath command, which lets you set the classpath for
- compiling and running applications.
-
- * /pack/anoncvs/jde/lisp/jde-run.el: Tweaked version number.
-
- * /pack/anoncvs/jde/lisp/jde-run.el: Deleted superfluous comments.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- 1. Ported jde-run onto comint mode.
-
- This allows you to interact with a Java application in the
- run buffer, if the application accepts command line input.
- You can use the comint history features to facilitate interaction
- with such an application.
-
- 2. Added the jde-run-set-java-vm and jde-run-set-java-vm-w
- commands, which let you specify the Java interpreter to use to
- run on non-Windows and Windows platforms, respectively.
-
- Note that you must use javaw on Windows platforms to avoid
- opening a superfluous command shell window.
-
- 3. Added the jde-run-set-args command and associated jde-run-args
- variable, which let you specify Java interpreter options via
- command-line arguments.
-
- jde-run passes the value of jde-classpath (defined in jde.el
- and set via the jde-set-classpath command) and jde-run-args
- to the Java interpreter.
-
- This means that you can use a common classpath definition for
- compiling and running applications, while passing other
- runtime arguments via jde-run-set-args.
-
-1997-07-05 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jtags.csh, /pack/anoncvs/jde/lisp/jtags,
/pack/anoncvs/jde/lisp/readme.txt:
- New file.
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- Modified jde-run command to derive the class name from the name of the file in
- the current buffer rather than the buffer name. This avoids an incorrect derivation
- when more than one buffer is open on the same source file.
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Updated make-jdb-command to run either the class previously specifed with
- the jde-run-set-app command or the class corresponding to the code in the
- current buffer.
-
-1997-06-29 kinnucan <kinnucan@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-run.el:
- 1. Added jde-run-set-app function, which lets you specify the application
- class to run.
-
- 2. Updated jde-run to run either the app specified by jde-run-set-app or
- the class whose source is in the current buffer. In the latter case,
- jde-run extracts the package of the app class from the source buffer.
-
-1997-06-18 paulk@PAULK_HOMEPC <paulk@PAULK_HOMEPC>
-
- * /pack/anoncvs/jde/lisp/jde-db.el:
- Added error-checking to jde-db-set-source-paths function. Now checks for
- existence of specified directories and appends a terminal slash to paths
- that lack it.
-
- * /pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/jde-run.el,
/pack/anoncvs/jde/lisp/jde-db.el:
- New file.
-
1.4 +362 -91 XEmacs/packages/xemacs-packages/jde/lisp/ReleaseNotes.txt
Index: ReleaseNotes.txt
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/ReleaseNotes.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- ReleaseNotes.txt 2003/01/18 05:48:43 1.3
+++ ReleaseNotes.txt 2006/03/03 20:42:36 1.4
@@ -1,4 +1,4 @@
-JDE 2.3.2
+JDE 2.3.3
***************************************************************
* PLEASE READ *
@@ -25,135 +25,406 @@ JDE 2.3.2
* *
***************************************************************
-* Fixes incompatibility between jde-ant-enable-find and
- jde-ant-read-buildfile. If both are enabled, the value for
- jde-ant-read-buildfile is used as a default if it is valid.
-
-* Fixes bug in the Java ant invocation method. Quoting the classpath
- with double quotes was not working in Windows systems.
+* In previous releases, if you typed a control flow
+ abbreviation in a comment or string, the JDEE would
+ replace any upper case letters in the abbreviation
+ with lower case letters, e.g., it would change "If" to
+ "if" in a comment or string. This release fixes the
+ problem.
+
+* The import wizard now restores your original window
+ configuration after displaying an import candidate chooser buffer.
+
+ Thanks to Jon Schewe for suggesting a fix for this problem.
+
+* Change abbreviation for throws from throw to thro to avoid
+ inadvertent completion of throw to throws.
+
+* Fix regression that was causing abbrev-mode to be enabled
+ for JDEE buffers even when jde-enable-abbrev-mode was set to
+ nil. Also, enable abbrev-mode in all open JDEE buffers for the
+ current project as a side effect of setting
+ jde-enable-abbrev-mode on.
+
+* Fixes problem where jde-ant-program was being normalized unless
+ it was set to ant or ant.bat. Now it only gets normalized if
+ it contains '/' or a '\'.
+
+* Revamps the JDEE's interface to the CheckStyle Java style
+ checking package to reflect major changes introduced in
+ version 3.1 of CheckStyle, in particular, the replacement
+ of command-line switches with the use of configuration
+ files to define coding styles. The changes to the JDEE
+ interface includes replacing all the jde-checkstyle-option
+ variables with two variables, jde-checkstyle-style and
+ jde-checkstyle-expanded properties, for defining
+ coding styles. This release also adds variables for
+ defining new CheckStyle options, such as checking
+ entire directories of source files. Execute
+ M-x jde-checkstyle-customize to display the revamped
+ list of CheckStyle customization variables.
+
+* Reduced time required to find all buffers belonging to a
+ given project. This should reduce the delay in project
+ switching time that occurs because of the requirement to
+ reinitialize the abbreviation table in each buffer belonging
+ to a project.
+
+* Fixes redisplay bug and error in jde-ant-filter.
+
+* Speed improvements to jde-xref.
+
+ Thanks to Suraj Acharya
+
+* Fixes jde-wiz-extend-abstract-class to avoid generating skeleton
+ for methods declared in interfaces or superclasses and a default
+ implementation is already provided.
+
+* Fixes several problems with jde-open-class-at-point. Including traversing
+ base classes.
+
+ Thanks to Jesse Byler
+
+JDE 2.3.3beta6
+
+* Now supports specification of project-relative paths in .emacs
+ files. Previously, if a relative path appeared in a variable, e.g.,
+ jde-global-path, that was set for the current project by the user's
+ .emacs file (as opposed to a project file), the JDEE would resolve
+ the variable relative to the source buffer directory. Now the JDEE
+ resolves it relative to the location of the nearest project file in
+ the source buffer directory tree. If the directory tree does not
+ contain a project file, the JDEE resolves the path relative to the
+ source buffer directory. The bottom line is that you can
+ now use project-relative paths as defaults for projects that
+ do not specify classpaths or sourcepaths. For example,
+ setting jde-global-classpath to ./classes in your .emacs
+ file specifies that the default location of class files
+ is in a subdirectory of the project file directory named classes.
+
+* Fixed inefficiencies in jde-xref-get-callers, enabled grouping of
+ callers by actual class.
+
+ Thanks to Suraj Acharya
+
+* Fix bug that was causing an extraneous space to be inserted
+ in the condition clause of control flow expansions, such as
+ if.
+
+ Thanks to Sandip Chitale.
+
+* Added a command to cause JDEbug to break on the occurrence
+ of a specified exception.
+
+ Thanks to Andy Hyatt.
+
+* Turned off messages used to debug JDEbug.
+
+* Update jde-make command to issue a cd to the default directory
+ before invoking make and to restore the original cwd afterwards.
+ This fixes a bug in the implementation of the
+ jde-make-working-directory variable.
+
+* Changed jde-run-option-debug to provide separate options for
+ shared memory name and socket host and port and to specify
+ defaults explicitly.
+
+* Fix bug that causes the interface implementation and
+ method delegation wizards to generate duplicate methods
+ in some cases.
+
+ Thanks to Martin Schwamberger.
+
+* Extend jde-import-excluded-classes to exclude classes that
+ belong to the same package as the importing class. Fix
+ interface, abstract class, and method delegation wizards
+ to observe jde-import-excluded-classes.
+
+ Thanks to Martin Schwamberger.
+
+* The JDEE's jde-javadoc-autodoc-at-line command now launches
+ the javadoc process directly instead of via a shell as in
+ previous releases. This avoids the need to quote command-line
+ arguments, a common source of bugs.
+
+* Adds a customization variable, jde-gen-method-javadoc-comment,
+ that enables you to specify the type of javadoc comment
+ that the jde-gen-method-template generates for a
+ skeleton method. The JDEE's interface, abstract class,
+ and method override wizards use the jde-gen-method-template
+ to generate skeleton methods. The new customizationv variable
+ thus allows you to control the type of javadoc comments
+ that these wizards generate for the skeleton methods.
+ Choices include the JDEE's javadoc template, a
+ comment that includes only javadoc's @inheritDoc tag,
+ or no comment.
+
+* Adds a Javadoc Reference item to the JDE->Documentation
+ submenu. The new item displays Sun's documentation for the
+ javadoc tool.
+
+* Prefixing the jde-run command (e.g., C-u C-c C-v C-r) now
+ causes the command to prompt you to enter application arguments.
+ Prefixing the command with a - (e.g., C-u - C-c C-v C-r)
+ causes the command to prompt you to enter the name of
+ the application's main class as well as application arguments.
+ In previous releases, prefixing the command caused it only
+ to prompt for the application main class.
+
+ Thanks to Robert Mecklenburg for suggesting this
+ enhancement.
+
+* Removed superfluous c-indent-function from control flow templates.
+
+* Add more precise error and exception handling for JDEE's
+ class loader, especially to catch LinkageErrors. Signal
+ a Lisp error when these exceptions occur.
+
+JDE 2.3.3beta5
+
+* Adds a jde-jeval-cm function. This function
+ is intended to be used by plugins to invoke Java development
+ utilities, such as source code style checkers, that emit
+ compiler-like error messages. Displaying the output in a
+ compilation-mode buffer enables the user to use compilation-mode's
+ error message navigation and hyperlinking capabilities.
+
+* As of version 5.30, cc-mode provides its own set of font lock
+ keywords and faces for Java: cc-fonts. The cc-fonts keywords
+ and faces are not as complete as those defined by the JDEE.
+ The JDEE now uses cc-fonts keywords and faces if defined while
+ defining and using others not defined by cc-fonts. Thanks to
+ David Ponce.
+
+* Adds help strings for items that appear on the Jdb menu. On Emacs,
+ the help strings appear in the minibuffer when you select a menu
+ item. (XEmacs does not support them).
+
+
+JDE 2.3.3beta4
+
+* Fixed jde-compile-jde and jde_root/lisp/makefile to compile
+ jde-xemacs.el only for XEmacs.
+
+ Thanks to Raul Acevedo for the makefile fix.
+
+* Fixed bug that caused noncompleting prompting for Ant
+ target to fail. Thanks to Christian Schmitt.
+
+* Now requires jde-autoload for XEmacs installations that use
+ the independently distributed version of the JDEE. The version that
+ comes with XEmacs has its own autoloads file. This change fixes
+ various problems caused by the failure of the independent
+ version to define autoloaded functions and commands.
+
+* Provides a workaround for a bug in file-exists-p in the cygwin
+ version of XEmacs that prevented the JDEE from finding project
+ files. The bug is that file-exists-p denies the existence of
+ files whose native Windows paths (file-truename) end in a slash.
+
+JDE 2.3.3beta3
+
+* Fix "unreadable object" error that occurred when XEmacs tried
+ to load beanshell.elc. The error occurred because of a bug
+ in the XEmacs byte compiler. This fix works around the
+ bug.
+
+* Fixed bug that caused customization variables defined
+ by an autoloaded package (e.g., jde-ant) to disappear from a
+ project file if the project file was saved before
+ the package was loaded.
+
+ Thanks to Martin Schamberger for reporting this bug and
+ supplying a fix.
+
+JDE 2.3.3beta2
+
+* Fixed null pointer exception when importing classes from a
+ classpath that includes nonclass files.
+
+ Thanks to Boyan Slavoff for reporting this problem.
+
+* Fixed failure to highlight syntax on XEmacs.
+
+JDE 2.3.3beta1
+
+* Adds a jde-javadoc-make-buffer command to generate doc only
+ for the source file in the current buffer, regardless of
+ the setting of the jde-javadoc-gen-packages variable.
+
+* Change the menu item JDE->Documentation->Generate to
+ Generate All to reflect the fact that the jde-javadoc-make
+ command is intended to generate all the doc for a project.
+
+* Add a JDE->Documentation->Generate Buffer menu item to
+ trigger the new jde-javadoc-make-buffer command.
+
+* The JDEE's javadoc generations commands (jde-javadoc-make
+ and jde-javadoc-make-buffer) now uses jde-get-jdk-dir to
+ determine the location of the javadoc executable.
+ Consequently, this release no longer defines the
+ jde-javadoc-command-path variable.
+
-* Fixes ant target history to be buildfile specific.
+* Add more precise check for existence of destination directory
+ defined by jde-javadoc-gen-destination-directory.
-* Fixes bug that caused the compile command to fail when jikes
- is the compiler and jde-compiler does not specify the path of the
- jikes executable.
+ Thanks to Dan Katz for bug report and fix.
-* Fixes bug that cause the interface wizard to incorrectly
- generate names of method parameters that are arrays of
- user-defined types.
+* Update autoloaded customization variables defined by
+ jde-javdoc-gen.el to the values defined by the current
+ project.
- Thanks to Alphonse Bendt for reporting this bug.
+ Thanks to Dan Katz for bug report.
-* Fixed bug in definition for
- jde-checkstyle-option-illegal-instantiations.
+* Turn jde-run-option-debug variable off by default, i.e.,
+ by default, the JDEE's run application command does not
+ enable connecting a debugger to the application by default.
- Thanks to Paul Krause.
-* Enhance the following code templates
+* This release introduces a cross-referencing tool that enables
+ you to find all callers of a specified method in a specified
+ classpath. This can be useful, for example, if you need to
+ change the name of a method. See "Cross-Referencing Classes"
+ in the JDEE User's Guide.
- - jde-gen-interface-buffer-template
- - jde-gen-console-buffer-template
- - jde-gen-jfc-app-buffer-template
- - jde-gen-junit-test-class-buffer-template
+ Thanks to Andy Hyatt for contributing this tool to the JDEE.
- to use the following javadoc templates instead of
- literal text
- - jde-javadoc-author-tag-template
- - jde-javadoc-version-tag-template
- - jde-javadoc-end-block-template
+* Fixes bug in method override wizard that prevented selection
+ of one of a set of overloaded methods.
- Thanks to Peter Dobratz.
+ Thanks to Joshua Spiewak for reporting this problem.
-* Fixes bug that caused inadvertent setting of transient mark mode
- on some user's systems when the user executes the JDE->Help->Symbol
- at Point command.
+* Adds jde-compile-jump-to-first-error option. This option
+ allows you to specify whether after compiling a source
+ buffer that has errors, the JDEE should move point to
+ the line that caused the first error.
- Thanks to James Cox.
+ Thanks to Sean Wellington.
-* Fixed a bug in the jde-project-update command caused by treating
- "." as a standard relative path character instead of a project
- file relative path character.
+* Simplified data type of jde-run-option-debug and set it off
+ by default. Valid values are now either nil or a list
+ of which the first item is the connect mode ("Server" or
"Client"),
+ the second is the transport type (socket or shared memory),
+ the third is the connect address (nil = default connect
+ address), and the fourth is whether to suspend the process
+ until the debugger connects (t = suspend).
-* Added the jde-update-package command to the JDEE's Code Generation
- menu as JDE->Code Generation->Wizards->Update Package Statement.
+* Fixes defadvice bug that disables eldoc-print-current-symbol-info
+ in all modes but emacs-lisp-mode and jde-mode.
-* The JDEE now loads the jde-package-update command on demand instead
- of at startup. This change is intended to help reduce the JDEE
- startup time.
+ Thanks to ABE Yasushi.
-* Project-relative paths now work for jde-javadoc-gen-destination-directory.
+* Fix bug that causes jde-import-organize to insert the
+ first import group name multiple times when called repeatedly.
-* Fix bug in generation of jde-checkstyle-option-lcurly-method option.
-
- Thanks to ABE Yasushi.
+ Thanks to Joshua Spiewak.
+
+* Adds a variable jde-checkstyle-configuration-file to
+ specify xml config file required by Checkstyle 3.0.
+
+ Thanks to Joshua Spiewak.
+
+* Adds two new commands: jde-gen-if-wrapper and jde-gen-if-else-wrapper.
+ Given a selected region these two commands will surround the region
+ with an if/else block.
+
+* Adds support to jde-ant-complete-target to complete multiple targets
+ i.e. clean,compile
+
+* Adds customization variable jde-compile-enable-kill-buffer.
+ If true the jde-compile-finish-kill-buffer hook will kill the
+ compilation buffer.
+
+* Refactors beanshell.el so that it supports but does not
+ require the JDEE. This allows beanshell.el to be used to
+ support other Emacs applications that want to use Java as an
+ extension language. See the package commentary for more information.
+
+* Adds jde-compile-option-source to compile 1.4 code with
+ the assert key word on it.
+
+* Adds assert as a keyword to be fontified.
+
+* Added check to ensure that the name argument to
+ jde-parse-class-exists is a string. This fixes bug where
+ jde-complete was passing a nil argument to
+ jde-parse-exists-class-exists when attempting to complete
+ an expression in a narrowed buffer.
+
+* Normalizes jde-ant-program.
+
+ Thanks to Ping Liang
-* The JDEE now comes with the latest version (1.2.7) of the BeanShell.
+* Adds jde-gen-change-listener-template. This provides a template to
+ generates a change listener.
-* The JDEE distribution now include jde-ejb.el, which was inadvertently
- omitted from the previous release.
+* Adds jde-browse-class-at-point command. This command displays
+ the class at point in the BeanShell class browser.
+* Replaces the JDE->Speedbar menu item with a JDE->Browse submenu
+ containing the items Browse->Source and
+ Browse->Class at Point. The first displays the
+ speedbar. The second invokes the
+ jde-browse-class-at-point command.
+* EJB wizard updated to reflect EJB 2.x.
-JDE 2.3.1
+ Thanks to Yoon Kyung Koo.
-* Normalizes jde-ant-buildfile before using it.
- Thanks to Luis Miguel Hernanz <luish(a)germinus.com>
+* Fixed typo in binding for jde-jdb-menu-debug-applet.
+ Thanks to Matt Watson.
-* Adds jde-ant-working-directory.
+* Fixed bug in jde-open-class-at-point method. The method was
+ unable to find method definitions in super classes, in some
+ instances.
-* Fixes infinite recursion bug when a project file specifies
- jde-ant-build as the jde-build-function.
+* Fixed bug in creating beanshell classpath. The ant jar files were
+ not being added when the beanshell was started before jde-ant being loaded.
-* Enhances interface wizard to support implementation of
- interfaces that reference inner classes.
+ Thanks to Martin Schwamberger for the patch.
-JDE 2.3.0
+* Fixed bug in jde-debug-step.*. When using jdb, a line number higher that 999
+ prints out with a ',', causing the debugger to step to the number before the
+ ','. i.e 1,023 it will step to line 1.
-* This release supports the correct vm command line arguments
- for the version of the JDK specified by the jde-jdk
- customization variable.
+* Adds items for displaying and setting variables to the jdb menu. Each
+ item takes the word at point and lets you edit it before sending it to
+ jdb.
-* Fixed bug wherein the JDEE was generating the wrong
- command line switch for the display classes option of the
- jde-run-option-verbose option for post JDK 1.1.x vms.
+* Fix bug in jde-bug-set-breakpoint, causing unbound slot messages.
-* The name of the jde-run-option-connect-to-debugger variable
- has changed to jde-run-option-debug.
+* Adds jde-bug-list-breakpoints. This command shows a list of all set
+ breakpoints, allowing the user to jump to the source of a given breakpoint
+ and to remove particular breakpoints from one screen.
-* Adds the following run application customization variables:
+* Import wizard changes:
- - jde-run-option-boot-classpath
- - jde-run-option-interpret-mode
- - jde-run-option-jar
- - jde-run-option-hotspot-type
- - jde-run-option-enable-assertions
- - jde-run-option-disable-assertions
- - jde-run-option-enable-system-assertions
- - jde-run-option-disable-system-assertions
+ - Fix import wizard so that it does not create an import statement
+ for a class whose package is already imported.
-* The JDEE now builds the class list used by its wizards
- to resolve unqualified class names from the CLASSPATH
- environment variable if jde-global-classpath for
- the current project is nil.
+ - When multiple classes with the same name appear on the classpath,
+ check whether import already exists AFTER the user selects the
+ import. This is to prevent the JDE from importing a class that
+ is already imported but from a different package.
-* Fixed regression introduced in JDEE 2.2.9.2 that
- caused symbols to be listed more than once in the
- jde-symbol-list variable under some circumstances. This in turn
- caused symbols to be set multiple times in a prj.el file.
+ - Display message when the buffer already imports the specified class.
-* Changes the default value for jde-gen-class-buffer-template to
- use the relevant tempo-template-jde-javadoc instead of literal
- text. This way jde-gen-class-buffer reflects, for example, a
- change to tempo-template-jde-javadoc-author-tag. Thanks to
- Peter Dobratz <dobratzp(a)ele.uri.edu>.
+* XEmacs changes:
-* Patched the class list code to change dollar signs ($) to
- periods (.) in converting class paths to class names.
- This is intended to fix a bug in the interface wizard.
+ - New efc support for XEmacs native widgets. This will be loaded
+ automatically if the version of XEmacs you are using supports native
+ widgets. The support is used for querying options via true dialogs
+ in various wizards.
- Thanks to Petter Mahlen.
+ - Support for the XEmacs debugging toolbar while using JDEbug. This
+ will be loaded automatically when JDEbug is activated.
+ - New mode jde-xemacs-bug-minor-mode which functions like gdbsrc in
+ that debugger motion commands can be entered via single keystrokes
+ while debugging. Source files are made readonly until the debugger
+ exits.
1.10 +820 -289 XEmacs/packages/xemacs-packages/jde/lisp/beanshell.el
Index: beanshell.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/beanshell.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- beanshell.el 2003/01/18 05:48:43 1.9
+++ beanshell.el 2006/03/03 20:42:36 1.10
@@ -1,11 +1,11 @@
;;; beanshell.el
-;; $Revision: 1.54 $
+;; $Revision: 1.68 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -22,7 +22,61 @@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
+;;; Commentary:
+
+;; This package is intended to serve as an interface between Emacs and
+;; Pat Neimeyer's BeanShell, a Java source code interpreter (see
+;;
http://www.beanshell.org/).
+
+;; This package is intended to serve both interactive users and Emacs
+;; applications that want to use Java as an extension language for
+;; Emacs. To facilitate this dual usage, this package implements the
+;; BeanShell interface as an eieio class named bsh. This class is
+;; intended to serve as a base class for classes tailored to specific
+;; applications. This class defines the following methods:
+;;
+;; bsh Constructs an instance of the bsh class.
+;; bsh-launch Launches the BeanShell and creates an Emacs buffer
+;; for interacting with the BeanShell.
+;; bsh-eval Sends a Java expression to the BeanShell for evaluation and
+;; waits for a response.
+;; bsh-eval-r Sends a Java expression to the BeanShell for evaluation
+;; and then evaluates the resulting BeanShell output
+;; as a Lisp expression.
+;; bsh-async-eval Sends a Java expression to the BeanShell for evaluation
+;; and sets a listener to evaluate the response as a Lisp
+;; expression
+;;
+;; bsh-eval and bsh-eval-r synchronous functions. After sending a Java
+;; expression to the BeanShell, they suspend Emacs until the BeanShell
+;; responds. bsh-async-eval does not suspend Emacs. It does, however,
+;; set a listener that evaluates any responses from the BeanShell as
+;; Lisp expressions.
+;;
+;; See bsh-demo-eval for an example of how to use bsh-async-eval to evaluate a
+;; Java expression.
+
+;;
+;; The bsh class also defines fields that specify the path of the
+;; BeanShell jar file, the Java vm used to run the BeanShell, a
+;; startup classpath and directory, vm arguments, etc. Emacs package
+;; developers can easily extend this base class to tailor the BeanShell
+;; to specific applications.
+;; This package provides one such derived class named
+;; bsh-standalone-bsh. This is a BeanShell implementation intended
+;; for use by interactive users.
+
+;; To use the standalone BeanShell, download the BeanShell jar file
+;; from
http://www.beanshell.org/ and install it on your system.
+;; Set bsh-jar to the path of the BeanShell jar. Set bsh-vm to
+;; the path of a Java vm on your system (this is necessary only
+;; if the java vm is not on your system's command path). Execute
+;; M-x bsh to start the BeanShell. To terminate the BeanShell,
+;; execute M-x bsh-exit.
+;;
+
(require 'eieio)
+(require 'comint)
(defgroup bsh nil
"Customizations for the Emacs inteface to Pat Neimeyer's Java
@@ -30,6 +84,28 @@ interpreter, the Beanshell."
:group 'tools
:prefix "bsh-")
+(defcustom bsh-jar "bsh.jar"
+ "Path to the jar file containing the BeanShell classes."
+:group 'bsh
+:type 'file)
+
+;; (makunbound 'bsh-vm)
+(defcustom bsh-vm nil
+ "Java vm to be used to run the standalone BeanShell. By default,
+bsh uses the first vm that it finds on the Emacs
+`exec-path' (usually the same as your system's command
+path). To specify a vm, select Path and enter the
+path to the vm. "
+:group 'bsh
+:type '(choice
+ (const :tag "Default" :value nil)
+ (file :tag "Path")))
+
+(defcustom bsh-classpath nil
+ "Startup classpath for the BeanShell."
+:group 'bsh
+:type '(repeat (file :tag "Path")))
+
;; (makunbound 'bsh-startup-timeout)
(defcustom bsh-startup-timeout 10
"*Length of time Emacs waits for the Beanshell to startup.
@@ -75,315 +151,701 @@ buffer."
:type 'directory)
-(defun bsh()
- "*Starts BeanShell, a Java interpreter developed by Pat Niemeyer."
- (interactive)
- (bsh-internal t))
+(defclass bsh-buffer ()
+ ((buffer-name :initarg :buffer-name
+:initform "*bsh*"
+ :type string
+ :documentation
+ "Name of buffer used to interact with BeanShell process.")
+ (buffer :initarg :buffer
+ :type buffer
+ :documentation
+ "Buffer used to interact with BeanShell process.")
+
+ (process :initarg :process
+ :documentation
+ "Beanshell process.")
+
+ (filter :initarg :filter
+ :type function
+ :documentation
+ "Function used to propcess buffer output."))
+ "Buffer that displays BeanShell output.")
+
+
+(defmethod initialize-instance ((this bsh-buffer) &rest fields)
+ "Constructor for BeanShell buffer instance."
+ (call-next-method)
+
+ (oset this buffer (get-buffer-create (oref this buffer-name))))
+
+(defmethod bsh-buffer-live-p ((this bsh-buffer))
+ "Return t if this buffer has not been killed."
+ (buffer-live-p (oref this buffer)))
+
+(defmethod bsh-buffer-display ((this bsh-buffer))
+ "Display this buffer."
+ (pop-to-buffer (oref this buffer-name)))
+
+
+(defclass bsh-comint-buffer (bsh-buffer)
+ ()
+ "BeanShell buffer that runs in `comint-mode'.")
+
+(defmethod initialize-instance ((this bsh-comint-buffer) &rest fields)
+ "Constructor for BeanShell buffer instance."
+ (call-next-method)
+ (with-current-buffer (oref this buffer)
+ (comint-mode)
+ (setq comint-prompt-regexp "bsh % ")))
+
+(defmethod bsh-comint-buffer-exec ((this bsh-comint-buffer) vm vm-args)
+ (let ((win32-start-process-show-window t)
+ (w32-start-process-show-window t)
+ (w32-quote-process-args ?\") ;; Emacs
+ (win32-quote-process-args ?\") ;; XEmacs
+ (windowed-process-io t)
+ ;; XEmacs addition
+ (coding-system-for-read
+ (if (or (member system-type '(cygwin32 cygwin))
+ (eq system-type 'windows-nt))
+ 'raw-text-dos)))
+ (comint-exec (oref this buffer) "bsh" vm nil vm-args))
+
+ (oset this process (get-buffer-process (oref this buffer)))
+ (oset this filter (process-filter (oref this process)))
+ (process-kill-without-query (oref this process))
+
+ (if (eq system-type 'windows-nt)
+ (accept-process-output (oref this process) bsh-startup-timeout 0)
+ (while (accept-process-output (oref this process) bsh-startup-timeout 0))))
+
+
+(defclass bsh-compilation-buffer (bsh-buffer)
+ ()
+ "Implements a `compilation-mode' buffer for BeanShell output.")
+
+(defmethod initialize-instance ((this bsh-compilation-buffer) &rest fields)
+ "Constructor for BeanShell compilation buffer instance."
+
+ (bsh-compilation-buffer-create-native-buffer this)
+
+ (oset
+ this
+ filter
+ (lexical-let ((this-buf this))
+ (lambda (process output)
+ (bsh-compilation-buffer-filter this-buf process output))))
+
+ ;; This buffer does not have its own process.
+ (oset this process nil)
+ (bsh-compilation-buffer-set-mode this))
+
+(defmethod bsh-compilation-buffer-create-native-buffer ((this bsh-compilation-buffer))
+ "Creates the native Emacs buffer encapsulated by this eieio object."
+ (oset this buffer-name "*bsh compilation*")
+ (oset this buffer (get-buffer-create (oref this buffer-name))))
+
+(defmethod bsh-compilation-buffer-set-mode ((this bsh-compilation-buffer))
+ "Define buffer mode."
+ (let ((thisdir default-directory))
+ (with-current-buffer (oref this buffer)
+ (let ((buf (oref this buffer))
+ (error-regexp-alist compilation-error-regexp-alist)
+ (enter-regexp-alist (if (not (featurep 'xemacs))
compilation-enter-directory-regexp-alist))
+ (leave-regexp-alist (if (not (featurep 'xemacs))
compilation-leave-directory-regexp-alist))
+ (file-regexp-alist (if (not (featurep 'xemacs)) compilation-file-regexp-alist))
+ (nomessage-regexp-alist (if (not (featurep 'xemacs))
compilation-nomessage-regexp-alist))
+ (parser compilation-parse-errors-function)
+ (error-message "No further errors"))
+
+ ;; In case the compilation buffer is current, make sure we get the global
+ ;; values of compilation-error-regexp-alist, etc.
+ (kill-all-local-variables)
+
+ ;; Clear out the compilation buffer and make it writable.
+ (setq buffer-read-only nil)
+ (buffer-disable-undo (current-buffer))
+ (erase-buffer)
+ (buffer-enable-undo (current-buffer))
+
+ (compilation-mode "Compilation")
+
+ (set (make-local-variable 'compilation-parse-errors-function) parser)
+ (set (make-local-variable 'compilation-error-message) error-message)
+ (set (make-local-variable 'compilation-error-regexp-alist)
+ error-regexp-alist)
+ (if (not (featurep 'xemacs))
+ (progn
+ (set (make-local-variable 'compilation-enter-directory-regexp-alist)
+ enter-regexp-alist)
+ (set (make-local-variable 'compilation-leave-directory-regexp-alist)
+ leave-regexp-alist)
+ (set (make-local-variable 'compilation-file-regexp-alist)
+ file-regexp-alist)
+ (set (make-local-variable 'compilation-nomessage-regexp-alist)
+ nomessage-regexp-alist)))
+ (setq default-directory thisdir)
+ (setq compilation-directory-stack (list default-directory))))))
+
+(defmethod bsh-compilation-buffer-filter ((this bsh-compilation-buffer) proc string)
+ "This filter prints out the result of the process without buffering.
+The result is inserted as it comes in the compilation buffer."
+ (with-current-buffer (oref this buffer)
+ (let ((end-of-result (string-match ".*bsh % " string))
+ (win (get-buffer-window (oref this buffer)))
+ output len (status " "))
+ (save-excursion
+ ;;Insert the text, advancing the process marker
+ (goto-char (point-max))
+ (if end-of-result
+ (progn
+ (setq output (substring string 0 end-of-result))
+ (set-buffer-modified-p nil)
+
+ ;;Searching backwards for the status code
+ (while (member status '(" " "\r" "\n"))
+ (setq len (length output))
+ (if (not (= len 0))
+ (progn
+ (setq status (substring output (- len 1)))
+ (setq output (substring output 0 (- len 1))))
+ (progn
+ (setq status (buffer-substring (- (point-max) 1)
+ (point-max)))
+ (delete-region (- (point-max) 1) (point-max)))))
+
+ (insert output)
+ (compilation-handle-exit
+ 'exit status
+ (if (string= "0" status)
+ "finished\n"
+ (format "exited abnormally with code %s\n"
+ status))))
+ (insert string)))
+ (if (not (featurep 'xemacs))
+ (if compilation-scroll-output
+ (save-selected-window
+ (if win
+ (progn
+ (select-window win)
+ (goto-char (point-max))))
+ (sit-for 0)))))))
+
+
+
+(defclass bsh ()
+ ((buffer :initarg :buffer
+ :type bsh-comint-buffer
+ :documentation
+ "Buffer used to interact with BeanShell process.")
+
+
+ (eval-buffer :initarg :eval-buffer
+ :type (or null bsh-buffer)
+ :initform nil
+ :documentation
+ "Buffer used to display evaluation result.")
+
+ (eval-filter :initarg :eval-filter
+ :type function
+ :documentation
+ "Function used to capture Lisp output from the BeanShell.")
+
+ (async-filter :initarg :async-filter
+ :type function
+ :documentation
+ "Function used to capture and evaluate BeanShell Lisp output.")
+
+ (redir-filter :initarg :redir-filter
+ :type function
+ :documentation
+ "Redirects BeanShell output to eval-buffer.")
+
+ (java-expr :initarg :java-expr
+:initform ""
+ :type string
+ :documentation
+ "Last Java expression evaluated in the BeanShell.")
+
+ (lisp-output :initarg :lisp-output
+:initform ""
+ :type string
+ :documentation
+ "Lisp output from the BeanShell.")
+
+
+ (vm :initarg :vm
+:initform "java"
+:type string
+:documentation
+ "Path of Java vm used to run the BeanShell.")
+
+ (vm-args :initarg :vm-args
+:initform nil
+:type list
+:documentation
+ "List of arguments to be passed to the Beanshell vm.")
+
+ (startup-dir :initarg :startup-dir
+:initform ""
+:type string
+:documentation
+ "Directory in which to start the BeanShell")
+
+ (cp :initarg :cp
+:type list
+:documentation
+ "Startup classpath for BeanShell")
+
+ (jar :initarg :jar
+:initform "bsh.jar"
+:type string
+:documentation
+ "Path of the BeanShell jar file.")
+
+ (class-name :initarg :class-name
+:initform "bsh.Interpreter"
+:type string
+:documentation
+ "Name of BeanShell class."))
+"Defines an instance of a BeanShell process.")
-(defun bsh-running-p ()
- "Returns t if the beanshell is running."
- (if (comint-check-proc "*bsh*") t))
-
-(defun bsh-internal (&optional display-buffer)
- (let ((bsh-buffer-name "*bsh*"))
- (if (not (comint-check-proc bsh-buffer-name))
- (let* ((bsh-buffer (get-buffer-create bsh-buffer-name))
- (ant-home (if (boundp 'jde-ant-home)
- (if (string= jde-ant-home "") (getenv "ANT_HOME")
- jde-ant-home)))
- (jde-java-directory
- (concat
- (jde-find-jde-data-directory)
- "java/"))
- (vm (oref (jde-run-get-vm) :path))
- (vm-args
- (list
- "-classpath"
- (jde-build-classpath
- (delq
- nil
- (append
- (list
- (expand-file-name "bsh-commands" jde-java-directory)
- (let ((tools (jde-get-tools-jar)))
- (if (file-exists-p tools)
- tools
- (error "Cannot find JDK's tools jar file (or
equivalent). See jde-get-jdk-dir.")))
- (if ant-home (expand-file-name "lib" ant-home))
- (expand-file-name "lib/checkstyle-all.jar" jde-java-directory)
- (expand-file-name "lib/jakarta-regexp.jar" jde-java-directory)
- (if jde-devel-debug
- (expand-file-name "classes" jde-java-directory)
- (expand-file-name "lib/jde.jar" jde-java-directory))
- (expand-file-name "lib/bsh.jar" jde-java-directory))
- (jde-get-global-classpath)))
- 'jde-global-classpath)))
- (dir (cond
- ((not (string= bsh-startup-directory ""))
- (jde-normalize-path 'bsh-startup-directory))
- ((buffer-file-name)
- (file-name-directory (buffer-file-name)))
- (t
- default-directory))))
+(defmethod initialize-instance ((this bsh) &rest fields)
+ "Constructor for BeanShell instance."
+
+ (call-next-method)
+ (bsh-create-buffer this)
+
+ (lexical-let ((this-bsh this))
+ ;; Filter for synchronous evaluations.
+ (oset
+ this eval-filter
+ (lambda (process output)
+ (with-current-buffer (process-buffer process)
+ (bsh-snag-lisp-output this-bsh process output))))
+
+ ;; Filter for asynchronous Java statement evaluations.
+ (oset
+ this async-filter
+ (lambda (process output)
+ (with-current-buffer (process-buffer process)
+ (bsh-snag-and-eval-lisp-output this-bsh process output))))
+
+ ;; Filter for redirecting result of evaluating an expression to the
+ ;; buffer specified by eval-buffer. This is typically used to
+ ;; redirect compiler like output to a compilation-mode buffer.
+ (oset
+ this redir-filter
+ (lambda (process output)
+ (with-current-buffer (process-buffer process)
+ (bsh-redirect-eval-output this-bsh process output))))))
+
+(defmethod bsh-create-buffer ((this bsh))
+ "Creates the buffer used by this beanshell instance."
+ (oset this buffer (bsh-comint-buffer "bsh main buffer")))
+
+
+(defmethod bsh-build-classpath-argument ((this bsh))
+ "Convert the list of classes specified by the cp slot
+to the string form required by the vm."
+ (mapconcat
+ 'identity
+ (append
+ (and (slot-boundp this 'cp) (oref this cp))
+ (list (oref this jar)))
+ path-separator))
+
+(defmethod bsh-running-p ((this bsh))
+ "Return t if this instance of a BeanShell is running; otherwise nil"
+ (let* ((buffer (oref this buffer))
+ (process
+ (if (slot-boundp buffer 'process)
+ (oref buffer process))))
+ (and
+ process
+ (processp process)
+ (eq (process-status process) 'run))))
+
+(defmethod bsh-get-process ((this bsh))
+ "Return the Lisp object representing the Beanshell process."
+ (if (bsh-running-p this)
+ (oref (oref this buffer) process)))
+
+
+(defmethod bsh-launch ((this bsh) &optional display-buffer)
+
+ (assert
+ (or (file-exists-p (oref this vm))
+ (executable-find (oref this vm)))
+ nil
+ (format "Specified vm does not exist: %s" (oref this vm)))
+
+ (assert
+ (file-exists-p (oref this jar))
+ nil
+ (format "Specified BeanShell jar filed does not exist: %s" (oref this
jar)))
+
+
+ (if (not (bsh-running-p this))
+ (let* ((dir
+ (cond
+ ((not (string= (oref this startup-dir) ""))
+ (expand-file-name (oref this startup-dir)))
+ ((buffer-file-name)
+ (file-name-directory (buffer-file-name)))
+ (t
+ default-directory)))
+ (vm-args (list "-classpath" (bsh-build-classpath-argument
this)))
+ (buffer
+ (let ((buf (oref this buffer)))
+ (if (bsh-buffer-live-p buf)
+ buf
+ (bsh-create-buffer this))))
+ (native-buff (oref buffer buffer)))
+
+
+ (setq vm-args (append vm-args (oref this vm-args)))
(setq vm-args (append vm-args bsh-vm-args))
- (setq vm-args (append vm-args (list "bsh.Interpreter")))
+ (setq vm-args (append vm-args (list (oref this class-name))))
- (save-excursion
- (set-buffer bsh-buffer)
- (erase-buffer)
+ (with-current-buffer native-buff
+ (erase-buffer)
(cd dir)
(insert (concat "cd " dir "\n"))
(insert
- (concat vm " "
+ (concat (oref this vm) " "
(mapconcat (lambda (x) x) vm-args " ") "\n\n"))
- (comint-mode)
- (setq comint-prompt-regexp "bsh % "))
+ (setq bsh-the-bsh this))
(message "%s" "Starting the BeanShell. Please wait...")
+ (bsh-comint-buffer-exec buffer (oref this vm) vm-args)
- (let ((win32-start-process-show-window t)
- (w32-start-process-show-window t)
- (w32-quote-process-args ?\") ;; Emacs
- (win32-quote-process-args ?\") ;; XEmacs
- (windowed-process-io t)
- ;; XEmacs addition
- (coding-system-for-read
- (if (or (member system-type '(cygwin32 cygwin))
- (eq system-type 'windows-nt))
- 'raw-text-dos)))
- (comint-exec bsh-buffer "bsh" vm nil vm-args))
-
- (let ((bsh-process (get-buffer-process bsh-buffer)))
- (process-kill-without-query bsh-process))
-
(if display-buffer
- (pop-to-buffer bsh-buffer-name)))
- (when display-buffer
- (message "The Java interpreter is already running.")
- (pop-to-buffer bsh-buffer-name)))))
-
-
-(setq bsh-tq-reply nil)
-
-(defun bsh-eval-filter (process result)
- (let ((end-of-result (string-match ".*bsh % " result)))
- ;; Check for case
- ;; %bsh\n...eval output...%bsh\n
- ;; This can happen because the beanshell outputs two or more
- ;; prompts after evaluating some expressions.
- ;; Thanks to Stephane Nicolas.
- ;; (if (eq end-of-result 0)
- ;; (accept-process-output process 0 5))
- (if end-of-result
- (setq bsh-tq-reply (concat bsh-tq-reply
- (substring result 0 end-of-result)))
- (setq bsh-tq-reply (concat bsh-tq-reply result))
- (accept-process-output process bsh-eval-timeout 5))))
-
-(defun bsh-get-process ()
- "Gets the beanshell process if it exists. If it does not, it creates one."
- (if (get-process "bsh")
- (get-process "bsh")
- (let (proc)
- (bsh-internal)
- (setq proc (get-process "bsh"))
- (if (eq system-type 'windows-nt)
- (accept-process-output proc bsh-startup-timeout 0)
- (while (accept-process-output proc bsh-startup-timeout 0)))
- proc)))
-
-(defun bsh-eval (expr &optional eval-return)
- "Uses the BeanShell Java interpreter to evaluate a Java statement. If
-the interpreter is not already running, this function starts the
-interpreter. This function returns any text output by the Java
-interpreter's standard out or standard error pipes. If the optional
-argument eval-return is non-nil, this function returns the result of
-evaluating the Java output as a Lisp expression."
- (let* ((bsh-process (bsh-get-process))
- (comint-filter (if bsh-process (process-filter bsh-process))))
- (when bsh-process
- (setq bsh-tq-reply nil)
- (set-process-filter bsh-process 'bsh-eval-filter)
- ;; (message "Evaluating: %s" expr)
- (process-send-string bsh-process (concat expr "\n"))
-
- (if (not (accept-process-output bsh-process bsh-eval-timeout))
- (progn
- (set-process-filter bsh-process comint-filter)
- (error "No reply from BeanShell")))
+ (bsh-buffer-display buffer)))
+ (when display-buffer
+ (message "The BeanShell is already running.")
+ (bsh-buffer-display (oref this buffer)))))
+
+(defvar bsh-the-bsh nil
+ "The BeanShell instance associated with the current BeanShell buffer.")
+(make-variable-buffer-local 'bsh-the-bsh)
+
+
+(defmethod bsh-snag-lisp-output ((this bsh) process output)
+ "Assemble Lisp OUTPUT from the BeanShell."
+ (let ((end-of-output (string-match ".*bsh % " output)))
+ ;; Check for case
+ ;; %bsh\n...eval output...%bsh\n
+ ;; This can happen because the beanshell outputs two or more
+ ;; prompts after evaluating some expressions.
+ ;; Thanks to Stephane Nicolas.
+ ;; (if (eq end-of-result 0)
+ ;; (accept-process-output process 0 5))
+ (if end-of-output
+ (oset
+ this
+ lisp-output
+ (concat (oref this lisp-output) (substring output 0 end-of-output)))
+ (oset this lisp-output (concat (oref this lisp-output) output))
+ (accept-process-output process bsh-eval-timeout 5))))
+
+(defmethod bsh-detect-java-eval-error ((this bsh) bsh-output)
+ (if (string-match "// Error:" bsh-output)
+ (progn
+ (message
+ "Beanshell expression evaluation error.\n Expression: %s\n Error:
%s"
+ (oref this java-expr) bsh-output)
+ (error "Beanshell eval error. See messages buffer for details."))))
+
+
+(defmethod bsh-eval-lisp-output ((this bsh))
+ (if (not (string= (oref this lisp-output) ""))
+ (flet ((format-error-msg (error-symbols)
+ (mapconcat (lambda (s) (symbol-name s)) error-symbols " ")))
+ (condition-case eval-error
+ (eval (read (oref this lisp-output)))
+ (error
+ (message "Error evaluating Lisp result of Java expression evaluation.")
+ (message " Java expression: %s." (oref this java-expr))
+ (message " Java evaluation result: %s." (oref this lisp-output))
+ ;; The following causes an unreadable object error on XEmacs when
+ ;; trying to load the byte-compiled file:
+ ;;
+ ;; (message " Error from evaluating result as Lisp: %s"
+ ;; (mapconcat (lambda (s) (symbol-name s)) eval-error " ")
+ (message " Error from evaluating result as Lisp: %s"
+ (format-error-msg eval-error))
+ (error "Error evaluating Java expresson. See *Messages* buffer."))))
+ (progn
+ (message "bsh-eval-r error: Beanshell result is null. Cannot evaluate.")
+ (message " Expression: %s" (oref this java-expr)))))
+
+(defmethod bsh-snag-and-eval-lisp-output ((this bsh) process output)
+ "Assemble and parse Lisp OUTPUT from the BeanShell PROCESS."
+ (bsh-snag-lisp-output this process output)
+ (bsh-detect-java-eval-error this output)
+ (bsh-eval-lisp-output this))
+
+
+(defmethod bsh-redirect-eval-output ((this bsh) process output)
+ (let ((eval-buffer (oref this eval-buffer)))
+ (assert eval-buffer)
+ (funcall (oref eval-buffer filter) process output)
+ (set-process-filter process (oref (oref this buffer) filter))
+ (oset this eval-buffer nil)))
+
+(defmethod bsh-eval ((this bsh) expr &optional eval-return)
+ "Uses the BeanShell Java interpreter to evaluate the Java expression
+EXPR. This function returns any text output by the Java interpreter's
+standard out or standard error pipes. If EVAL-RETURN is non-nil, this
+function returns the result of evaluating the Java output as a Lisp
+expression."
+
+ (unless (bsh-running-p this)
+ (bsh-launch this))
+
+ (when (bsh-running-p this)
+ (oset this java-expr expr)
+ (oset this lisp-output "")
+ (set-process-filter (oref (oref this buffer) process) (oref this eval-filter))
+ ;; (message "Evaluating: %s" expr)
+ (process-send-string (oref (oref this buffer) process) (concat expr "\n"))
+
+ (if (not (accept-process-output (oref (oref this buffer) process) bsh-eval-timeout))
+ (progn
+ (set-process-filter (oref (oref this buffer) process) (oref (oref this buffer)
filter))
+ (error "No reply from BeanShell")))
- (set-process-filter bsh-process comint-filter)
- (if (string-match "// Error:" bsh-tq-reply)
- (progn
- (message
- "Beanshell expression evaluation error.\n Expression: %s\n Error: %s"
- expr bsh-tq-reply)
- (error "Beanshell eval error. See messages buffer for details.")))
- ;; (if eval-return (message "Evaluating reply: %s" bsh-tq-reply))
- (if eval-return
- (if bsh-tq-reply
- (condition-case eval-error
- (eval (read bsh-tq-reply))
- (error
- (message "Error evaluating Lisp result of Java expression evaluation.")
- (message " Java expression: %s." expr)
- (message " Java evaluation result: %s." bsh-tq-reply)
- (error "Error evaluating Java expresson. See *Messages* buffer.")))
- (progn
- (message "bsh-eval-r error: Beanshell result is null. Cannot
evaluate.")
- (message " Expression: %s" expr)))
- bsh-tq-reply))))
+ (set-process-filter (oref (oref this buffer) process) (oref (oref this buffer)
filter))
-(defun bsh-eval-r(java-statement)
- "Convenience function for evaluating Java statements
+ (bsh-detect-java-eval-error this (oref this lisp-output))
+ ;; (if eval-return (message "Evaluating reply: %s" (oref this
lisp-output)))
+ (if eval-return
+ (bsh-eval-lisp-output this)
+ (oref this lisp-output))))
+
+(defmethod bsh-eval-r ((this bsh) java-statement)
+ "Convenience method for evaluating Java statements
that return Lisp expressions as output. This function
invokes bsh-eval with the evaluate-return option set to
t."
- (bsh-eval java-statement t))
-
+ (bsh-eval this java-statement t))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Beanshell commands
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
+(defmethod bsh-async-eval ((this bsh) expr)
+ "Send the Java statement EXPR to the BeanShell for
+evaluation. Do not wait for a response."
+ (unless (bsh-running-p this)
+ (bsh-launch this))
+
+ (oset this lisp-output "")
+ (oset this java-expr expr)
+ (set-process-filter (oref (oref this buffer) process) (oref this async-filter))
+
+ (when (bsh-running-p this)
+ (process-send-string (oref (oref this buffer) process) (concat expr
"\n"))))
+
+(defmethod bsh-buffer-eval ((this bsh) expr buffer)
+ "Evaluate EXPR and displays its output in BUFFER. BUFFER
+must be an instance of `bsh-buffer' class. A typical use for this
+method is to invoke a Java application whose output is compiler-like,
+e.g., javac, ant, or checkstyle. In this case, BUFFER would be
+an instance of a subclass of `bsh-compiler-buffer'."
+ (assert (typep expr 'string))
+ (assert (typep buffer 'bsh-buffer))
+ (unless (bsh-running-p this)
+ (bsh-launch this))
+ (let* ((comint-buffer (oref this buffer))
+ (bsh-process (oref comint-buffer process)))
+ (oset this eval-buffer buffer)
+ (set-process-filter bsh-process (oref this redir-filter))
+ (process-send-string bsh-process expr)))
+
+(defmethod bsh-kill-process ((this bsh))
+ "Terminates the BeanShell process."
+ (process-send-string (oref (oref this buffer) process) "exit();\n"))
+
+(defun get-bsh(buffer-name)
+ "Get the `bsh' object associated
+with the buffer named BUFFER-NAME."
+ (let (bsh-object
+ (buffer (get-buffer buffer-name)))
+ (if buffer
+ (save-excursion
+ (set-buffer buffer)
+ (setq bsh-object bsh-the-bsh)))
+ bsh-object))
+
+
+(defun bsh-demo-eval ()
+ "This command demonstrates use of the BeanShell to
+execute Java code. It assumes that
+`bsh-jar' points to the location of the BeanShell
+jar file on your system and that either `exec-path'
+or `bsh-vm' point to a Java vm on your system."
+ (interactive)
+
+ (assert
+ (file-exists-p (expand-file-name bsh-jar))
+ nil
+ (concat
+ "Cannot find the BeanShell jar file at "
+ (expand-file-name bsh-jar)
+ ". Type C-h bsh-jar for more info."))
+
+ (if bsh-vm
+ (assert
+ (or
+ (executable-find bsh-vm)
+ (file-exists-p bsh-vm))
+ nil
+ (format "The vm specified by bsh-vm does not exist: %s." bsh-vm))
+ (assert
+ (executable-find (if (eq system-type 'windows-nt) "javaw"
"java"))
+ nil
+ (format "Cannot find a Java vm on exec-path.")))
+
+
+ (let ((beanshell (get-bsh "*bsh demo*"))
+ (demo-script
+ (concat
+ "demo() {"
+ "name = JOptionPane.showInputDialog(\"Enter your
name.\");"
+ "print(\"(message \\\"Your name is \" + name +
\"\\\")\");"
+ "};")
+ ))
+
+ (if (not beanshell)
+ (progn
+
+ ;; Create a BeanShell wrapper object
+ (setq beanshell (bsh "BeanShell"))
+
+ (oset (oref beanshell buffer) buffer-name "*bsh demo*")
+
+ ;; Set the wrapper's jar slot (eieio/CLOS speak for field) to
+ ;; point to the location of the BeanShell on the user's
+ ;; system.
+ (oset beanshell jar (expand-file-name bsh-jar))
+
+ ;; Set the wrapper's vm slot to point to the location
+ ;; of a vm on the user's system. The wrapper's launch
+ ;; method (see below) uses the specified vm to launch
+ ;; the BeanShell.
+ (oset
+ beanshell
+ vm
+ (if bsh-vm
+ (or
+ (executable-find bsh-vm)
+ bsh-vm)
+ (executable-find (if (eq system-type 'windows-nt) "javaw"
"java"))))))
+
+ (unless (bsh-running-p beanshell)
+ (bsh-launch beanshell)
+ (bsh-async-eval beanshell demo-script))
+ (bsh-async-eval beanshell "demo();")))
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Standalone BeanShell ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defclass bsh-standalone-bsh (bsh)
+ ((the-bsh :type bsh-standalone-bsh
+:allocation :class
+:documentation
+ "The single instance of the standalone BeanShell."))
+ "BeanShell intended to be used independently of any other
+Emacs package.")
+
+(defmethod initialize-instance ((this bsh-standalone-bsh) &rest fields)
+ "Constructor for the standard bsh BeanShell instance."
+ (call-next-method)
+
+ (assert
+ (file-exists-p (expand-file-name bsh-jar))
+ nil
+ (concat
+ "Cannot find the BeanShell jar file at "
+ (expand-file-name bsh-jar)
+ ". Type C-h bsh-jar for more info."))
+
+ (if bsh-vm
+ (assert
+ (or
+ (executable-find bsh-vm)
+ (file-exists-p bsh-vm))
+ nil
+ (format "The vm specified by bsh-vm does not exist: %s." bsh-vm))
+ (assert
+ (executable-find (if (eq system-type 'windows-nt) "javaw"
"java"))
+ nil
+ (format "Cannot find a Java vm on exec-path.")))
+
+
+ (oset this jar (expand-file-name bsh-jar))
+
+ (oset
+ this
+ vm
+ (if bsh-vm
+ (or
+ (executable-find bsh-vm)
+ bsh-vm)
+ (executable-find (if (eq system-type 'windows-nt) "javaw"
"java"))))
+
+ (oset this cp bsh-classpath)
+
+ (oset this startup-dir bsh-startup-directory))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Beanshell commands ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun bsh-run()
+ "*Starts the standalone version of the BeanShell, a Java interpreter developed
+by Pat Niemeyer."
+ (interactive)
+ (oset-default 'bsh-standalone-bsh the-bsh (bsh-standalone-bsh "Standalone
BeanShell"))
+ (bsh-launch (oref bsh-standalone-bsh the-bsh) t))
(defun bsh-exit ()
- "Closes the existing beanshell process"
+ "Closes the standalone version of the BeanShell."
(interactive)
- (if (get-process "bsh")
- (if (and
- (boundp 'jde-ant-invocation-method) ;; ant package may not be loaded.
- (string= (car jde-ant-invocation-method) "Ant Server"))
- (process-send-string (get-process "bsh")
"jde.util.JdeUtilities.exit();\n")
- (process-send-string (get-process "bsh") "exit();\n"))
+ (if (bsh-running-p (oref 'bsh-standalone-bsh the-bsh))
+ (bsh-kill-process (oref 'bsh-standalone-bsh the-bsh))
(message "The beanshell is not running")))
-(defun bsh-open-class-browser ()
- "Opens the beanshell class browser"
- (interactive)
- (bsh-eval "browseClass(\"\");"))
-(defun bsh-open-desktop ()
- "Opens the beanshell desktop"
- (interactive)
- (bsh-eval "desktop();"))
-
-(defclass bsh-compiler ()
- ((buffer :initarg :buffer
- :type buffer
- :documentation
- "Compilation buffer")
- (window :initarg :window
- :type window
- :documentation
- "Window that displays the compilation buffer."))
- "Class of beanshell expressions that emit Emacs compiler-compatible
output.")
-
-(defmethod bsh-compiler-create-buffer ((this bsh-compiler))
- (save-excursion
- (let ((buf (get-buffer-create "*compilation*"))
- (error-regexp-alist compilation-error-regexp-alist)
- (enter-regexp-alist
- (if (not (featurep 'xemacs)) compilation-enter-directory-regexp-alist))
- (leave-regexp-alist
- (if (not (featurep 'xemacs)) compilation-leave-directory-regexp-alist))
- (file-regexp-alist
- (if (not (featurep 'xemacs)) compilation-file-regexp-alist))
- (nomessage-regexp-alist
- (if (not (featurep 'xemacs)) compilation-nomessage-regexp-alist))
- (parser compilation-parse-errors-function)
- (error-message "No further errors")
- (thisdir default-directory))
-
- (oset this :buffer buf)
-
- (set-buffer buf)
-
-
- ;; In case the compilation buffer is current, make sure we get the global
- ;; values of compilation-error-regexp-alist, etc.
- (kill-all-local-variables)
-
- ;; Clear out the compilation buffer and make it writable.
- (setq buffer-read-only nil)
- (buffer-disable-undo (current-buffer))
- (erase-buffer)
- (buffer-enable-undo (current-buffer))
-
- (compilation-mode "Compilation")
-
- (set (make-local-variable 'compilation-parse-errors-function) parser)
- (set (make-local-variable 'compilation-error-message) error-message)
- (set (make-local-variable 'compilation-error-regexp-alist)
- error-regexp-alist)
- (if (not (featurep 'xemacs))
+(defun bsh-find-bsh-data-directory ()
+ "Return the path of the bsh data directory.
+Returns the path of the directory containing the documentation directory; nil if the
+directory cannot be found. If XEmacs, returns the location of
+the data directory in the XEmacs distribution hierarchy. On all other Emacs versions,
+the bsh expects to find the documentation
+in the same directory that contains the bsh.el file."
+ (let ((directory-sep-char ?/)
+ dir)
+ (flet ((find-data-dir
+ ()
+ (expand-file-name
+ "../"
+ (file-name-directory (locate-library "beanshell")))))
+ (if (featurep 'xemacs)
(progn
- (set (make-local-variable 'compilation-enter-directory-regexp-alist)
- enter-regexp-alist)
- (set (make-local-variable 'compilation-leave-directory-regexp-alist)
- leave-regexp-alist)
- (set (make-local-variable 'compilation-file-regexp-alist)
- file-regexp-alist)
- (set (make-local-variable 'compilation-nomessage-regexp-alist)
- nomessage-regexp-alist)))
-; (set (make-local-variable 'compilation-arguments)
-; (list output error-message))
- (setq default-directory thisdir
- compilation-directory-stack (list default-directory)))))
-
-
-(defmethod bsh-compiler-compile ((this bsh-compiler) compiler-expr)
- "Evaluates COMPILER-EXPR."
- (bsh-compiler-create-buffer this)
-
- ;; Pop to compilation buffer.
- (let ((outwin (display-buffer (oref this :buffer))))
- (compilation-set-window-height outwin)
- (oset this :window outwin))
-
- (if (not (featurep 'xemacs))
- (if compilation-process-setup-function
- (funcall compilation-process-setup-function)))
-
+ (setq dir (locate-data-directory "beanshell"))
+ (if (not dir)
+ (setq dir (find-data-dir))))
+ (setq dir (find-data-dir))))
+ dir))
- (save-excursion
- (set-buffer (oref this :buffer))
- (insert (format "%s\n" compiler-expr))
-
- (if (not (bsh-running-p))
- (bsh-eval (jde-create-prj-values-str)))
-
- (let* ((output (bsh-eval
- compiler-expr
- nil
- ;; (buffer-name (oref this :buffer))
- ))
- (len (length output))
- (status "finished"
- ;; (substring output (- len 2) (- len 1))
- ))
-
- (delete-region (- (point-max) 2) (- (point-max) 1))
- (compilation-handle-exit
- 'exit status
- (if (string= "0" status)
- "finished\n"
- (format "exited abnormally with code %s\n"
- status)))
- (set-buffer-modified-p nil)
- (setq compilation-last-buffer (oref this :buffer)))))
-
-(defun bsh-test ()
- (interactive)
- (let* ((n1 (bsh-eval
"jde.util.JdeUtilities.getQualifiedName(\"String\");"))
- (n2 (bsh-eval
"jde.util.JdeUtilities.getQualifiedName(\"Class\");")))
- (message "n1 = %s, n2 = %s" n1 n2)))
-
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Beanshell mode ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -392,25 +854,30 @@ t."
bsh-script-mode java-mode "bsh script"
"Major mode for developing Beanshell scripts.
\\(bsh-script-mode-map)"
+
+ (set (make-local-variable 'font-lock-defaults)
+ (if (featurep 'xemacs)
+ (get 'java-mode 'font-lock-defaults)
+ (cdr (assq 'java-mode font-lock-defaults-alist))))
+ (set (make-local-variable 'font-lock-maximum-decoration) t)
+ (set (make-local-variable 'font-lock-multiline) t)
+ (turn-on-font-lock)
)
(add-to-list 'auto-mode-alist '("\\.bsh\\'" . bsh-script-mode))
-;; By default, enable extra fontification in `bsh-mode'.
-(add-hook 'bsh-script-mode-hook #'jde-setup-syntax-coloring)
-
;;;###autoload
(defun bsh-script-help ()
"Display BeanShell User's Guide."
(interactive)
- (let* ((jde-dir (jde-find-jde-doc-directory))
+ (let* ((bsh-dir (bsh-find-bsh-data-directory))
(bsh-help
- (if jde-dir
- (expand-file-name "doc/html/bsh-ug/bsh-ug.html" jde-dir))))
+ (if bsh-dir
+ (expand-file-name "bsh-ug.html" bsh-dir))))
(if (and
bsh-help
(file-exists-p bsh-help))
- (browse-url (concat "file://" (jde-convert-cygwin-path bsh-help))
+ (browse-url (concat "file://" bsh-help)
(if (boundp 'browse-url-new-window-flag)
'browse-url-new-window-flag
browse-url-new-window-p))
@@ -451,6 +918,70 @@ t."
(provide 'beanshell)
;; $Log: beanshell.el,v $
+;; Revision 1.68 2003/06/30 03:52:39 paulk
+;; Include bsh-vm-args in the command line that starts the BeanShell, thus fixing a
+;; regression error reported by TAKAHASHI Toru.
+;;
+;; Revision 1.67 2003/06/22 16:06:43 paulk
+;; Fix "unreadable object" error when XEmacs tries to load beanshell.elc.
+;;
+;; Revision 1.66 2003/05/07 04:29:37 paulk
+;; Include Lisp error in messages buffer when a Lisp error results from evaluating the
result of a Java evaluation as Lisp.
+;;
+;; Revision 1.65 2003/04/16 04:13:18 paulk
+;; Added a require statement for the comint package. This is not necessary for use with
the JDEE, which already requires comint, but may be necessary when beanshell.el is used
independently of the JDEE.
+;;
+;; Revision 1.64 2003/04/11 22:51:33 jslopez
+;; Fixes typo, orer to oref.
+;;
+;; Revision 1.63 2003/04/08 03:14:07 paulk
+;; Fixes bug that caused the working directory of the compilation buffer to be set
incorrectly. Also add methods to bsh-compilation-buffer class that simplify subclassing.
+;;
+;; Revision 1.62 2003/04/06 07:32:25 paulk
+;; Fixed bugs caused by not handling the case when the user has killed a
+;; Beanshell buffer. Also added a bsh-create-buffer method to allow
+;; derived classes to override the type of buffer used to interact
+;; with the BeanShell.
+;;
+;; Revision 1.61 2003/03/04 10:10:40 paulk
+;; Made the following changes to provide generalized support
+;; for displaying BeanShell output in a compilation-mode buffer.
+;;
+;; - Defined a new eieio class hierarchy that wraps Emacs buffers.
+;; The hierarchy contains three classes: bsh-buffer, the base,
+;; and bsh-comint-buffer and bsh-compilation-buffer class, which
+;; wrap comint-mode and compilation-mode buffers, respectively.
+;;
+;; - Added a bsh-buffer-eval method to the bsh class that displays
+;; the results of evaluating a Java expression in a specified
+;; bsh-buffer.
+;;
+;; Revision 1.60 2003/02/17 08:09:29 paulk
+;; Refactors beanshell.el so that it supports but does not require the
+;; JDEE. This allows beanshell.el to be used to support other Emacs
+;; applications that want to use Java as an extension language. See
+;; the package commentary for more information.
+;;
+;; Revision 1.59 2003/02/15 20:56:53 nsieger
+;; (bsh-eval): Add second optional IGNORE-EMPTY parameter which
+;; suppresses errors if evaluation produces no forms. Part of initial
+;; JUCI checkin, which necessitated this feature.
+;;
+;; Revision 1.58 2003/01/27 06:38:49 paulk
+;; Moved error-handling for when jde-get-tools-jar returns a nil value into
+;; jde-get-tools-jar itself.
+;;
+;; Revision 1.57 2003/01/20 04:43:47 paulk
+;; Slightly expanded error message for not being able to find the JDK tools jar file.
+;;
+;; Revision 1.56 2003/01/09 18:21:14 ahyatt
+;; Beanshell should be started with an expanded classpath
+;;
+;; Revision 1.55 2003/01/03 16:35:24 jslopez
+;; Fixes bug that was not adding the ant jar files to the beanshell classpath
+;; when jde-ant-home is not bound. This could happen because the jde-ant
+;; package has not been loaded.
+;;
;; Revision 1.54 2002/12/30 05:09:00 paulk
;; Define bsh-script-mode for editing BeanShell scripts.
;;
1.4 +179 -15 XEmacs/packages/xemacs-packages/jde/lisp/efc.el
Index: efc.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/efc.el,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- efc.el 2003/01/18 05:48:43 1.3
+++ efc.el 2006/03/03 20:42:36 1.4
@@ -1,11 +1,11 @@
;;; efc.el -- Emacs Foundation Classes
-;; $Revision: 1.9 $ $Date: 2002/03/29 12:40:27 $
+;; $Revision: 1.13 $ $Date: 2003/11/29 05:50:18 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: lisp, tools, classes
-;; Copyright (C) 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -36,6 +36,9 @@
(require 'eieio)
(require 'wid-edit)
+(defvar efc-query-options-function nil
+ "If non-nil the function to use for interactively querying options.
+If nil then the default efc custom-based dialogs will be used.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
@@ -168,8 +171,9 @@ this method invokes recursive-edit to em
dialog. This suspends the current command until the user has selected
an option or canceled the dialog. See `efc-dialog-ok' and
`efc-dialog-cancel' for more information."
- (call-next-method)
- (recursive-edit))
+ (save-window-excursion
+ (call-next-method)
+ (recursive-edit)))
(defmethod efc-dialog-ok ((this efc-option-dialog))
@@ -193,16 +197,17 @@ and then exits recursive edit mode."
(oset this selection nil)
(exit-recursive-edit))
-(defun efc-query-options (options &optional prompt)
+(defun efc-query-options (options &optional prompt title)
"Ask user to choose among a set of options."
- (let ((dialog
- (efc-option-dialog
- "option dialog"
- :text (if prompt prompt "Select option:")
- :options options)))
- (efc-dialog-show dialog)
- (oref dialog selection)))
-
+ (if efc-query-options-function
+ (funcall efc-query-options-function options prompt title)
+ (let ((dialog
+ (efc-option-dialog
+ (or title "option dialog")
+ :text (or prompt "Select option:")
+ :options options)))
+ (efc-dialog-show dialog)
+ (oref dialog selection))))
;; The following code is a patch that implements Richard Stallman's fix
;; for the following error that occurs only in Emacs 21.1.1.
@@ -225,8 +230,8 @@ and then exits recursive edit mode."
(if (and (not (featurep 'xemacs))
(or
- (string-match "21.1" (emacs-version))
- (string-match "21.2" (emacs-version))))
+ (string-match "21\\.1" (emacs-version))
+ (string-match "21\\.2" (emacs-version))))
(progn
;; Need to load wid-edit first to ensure that
;; it does not get loaded after this patch and
@@ -329,12 +334,171 @@ just refrain from switching to it."
(message "You clicked somewhere weird.")))
))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; Compiler Class ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defclass efc-compiler ()
+ ((name :initarg :name
+ :type string
+ :documentation "Compiler name.")
+ (buffer :initarg :buffer
+ :type buffer
+ :documentation
+ "Compilation buffer")
+ (window :initarg :window
+ :type window
+ :documentation
+ "Window that displays the compilation buffer.")
+ (exec-path :initarg :exec-path
+ :type string
+ :documentation "Path of compiler executable.")
+ (comp-finish-fcn :initarg :comp-finish-fcn
+ :type function
+ :documentation "Function to invoke at end of compilation."))
+ "Class of compiler-like applications.")
+
+(defmethod create-buffer ((this efc-compiler))
+ "Create a buffer to display the output of a compiler process."
+ (save-excursion
+ (let ((buf (get-buffer-create (format "*%s*" (oref this name))))
+ (error-regexp-alist compilation-error-regexp-alist)
+ (enter-regexp-alist (if (not jde-xemacsp) compilation-enter-directory-regexp-alist))
+ (leave-regexp-alist (if (not jde-xemacsp) compilation-leave-directory-regexp-alist))
+ (file-regexp-alist (if (not jde-xemacsp) compilation-file-regexp-alist))
+ (nomessage-regexp-alist (if (not jde-xemacsp) compilation-nomessage-regexp-alist))
+ (parser compilation-parse-errors-function)
+ (error-message "No further errors")
+ (thisdir default-directory))
+
+ (oset this :buffer buf)
+
+ (set-buffer buf)
+
+ ;; Make sure a compiler process is not
+ ;; already running.
+ (let ((compiler-proc (get-buffer-process (current-buffer))))
+ (if compiler-proc
+ (if (or (not (eq (process-status compiler-proc) 'run))
+ (yes-or-no-p
+ (format "A %s process is running; kill it?" (oref this name))))
+ (condition-case ()
+ (progn
+ (interrupt-process compiler-proc)
+ (sit-for 1)
+ (delete-process compiler-proc))
+ (error nil))
+ (error "Cannot have two processes in `%s' at once"
+ (buffer-name)))))
+
+ ;; In case the compiler buffer is current, make sure we get the global
+ ;; values of compilation-error-regexp-alist, etc.
+ (kill-all-local-variables)
+
+ ;; Clear out the compilation buffer and make it writable.
+ (setq buffer-read-only nil)
+ (buffer-disable-undo (current-buffer))
+ (erase-buffer)
+ (buffer-enable-undo (current-buffer))
+
+ (compilation-mode (oref this name))
+
+ (set (make-local-variable 'compilation-parse-errors-function) parser)
+ (set (make-local-variable 'compilation-error-message) error-message)
+ (set (make-local-variable 'compilation-error-regexp-alist)
+ error-regexp-alist)
+ (if (not jde-xemacsp)
+ (progn
+ (set (make-local-variable 'compilation-enter-directory-regexp-alist)
+ enter-regexp-alist)
+ (set (make-local-variable 'compilation-leave-directory-regexp-alist)
+ leave-regexp-alist)
+ (set (make-local-variable 'compilation-file-regexp-alist)
+ file-regexp-alist)
+ (set (make-local-variable 'compilation-nomessage-regexp-alist)
+ nomessage-regexp-alist)))
+
+ (if (slot-boundp this 'comp-finish-fcn)
+ (setq compilation-finish-function (oref this comp-finish-fcn)))
+
+ (setq default-directory thisdir
+ compilation-directory-stack (list default-directory)))))
+
+(defmethod get-args ((this efc-compiler))
+ "Get a list of command-line arguments to pass to the
+compiler process.")
+
+
+(defmethod exec ((this efc-compiler))
+ "Start the compiler process."
+
+ (create-buffer this)
+
+ ;; Pop to checker buffer.
+ (let ((outwin (display-buffer (oref this :buffer))))
+ (compilation-set-window-height outwin)
+ (oset this :window outwin))
+
+ (if (not (featurep 'xemacs))
+ (if compilation-process-setup-function
+ (funcall compilation-process-setup-function)))
+
+ (let* ((outbuf (oref this :buffer))
+ (executable-path (oref this exec-path))
+ (args (get-args this)))
+
+ (save-excursion
+ (set-buffer outbuf)
+
+ (insert (format "cd %s\n" default-directory))
+
+ (insert (concat
+ executable-path
+ " "
+ (mapconcat 'identity args " ")
+ "\n\n"))
+
+ (let* ((process-environment (cons "EMACS=t" process-environment))
+ (w32-quote-process-args ?\")
+ (win32-quote-process-args ?\") ;; XEmacs
+ (proc (apply 'start-process
+ (downcase mode-name)
+ outbuf
+ executable-path
+ args)))
+ (set-process-sentinel proc 'compilation-sentinel)
+ (set-process-filter proc 'compilation-filter)
+ (set-marker (process-mark proc) (point) outbuf)
+ (setq compilation-in-progress
+ (cons proc compilation-in-progress)))
+ (set-buffer-modified-p nil)
+ (setq compilation-last-buffer (oref this :buffer)))))
+
+
+
(provide 'efc)
;; Change History
;; $Log: efc.el,v $
+;; Revision 1.13 2003/11/29 05:50:18 paulk
+;; The efc-dialog-show method ofr efc-option-dialog now uses save-window-excursion
+;; to restore the user's original window conversion after showing the selection
+;; buffer.
+;;
+;; Revision 1.12 2003/08/25 04:57:30 paulk
+;; Adds efc-compiler class. This class implements an Emacs interface to an external
process
+;; that generates compiler-like output.
+;;
+;; Revision 1.11 2003/06/07 04:04:10 paulk
+;; Fix regexp for matching Emacs versions. Thanks to David Ponce.
+;;
+;; Revision 1.10 2003/03/28 05:33:29 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
;; Revision 1.9 2002/03/29 12:40:27 paulk
;; Adds efc-query-option function.
;;
1.7 +146 -69 XEmacs/packages/xemacs-packages/jde/lisp/jde-ant.el
Index: jde-ant.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-ant.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- jde-ant.el 2003/03/25 04:58:04 1.6
+++ jde-ant.el 2006/03/03 20:42:36 1.7
@@ -1,6 +1,6 @@
;; jde-ant.el --- Use Apache Ant to build your JDE projects
-;; $Revision: 1.4 $ $Date: 2003/01/18 05:48:43 $
+;; $Revision: 1.69 $ $Date: 2003/12/06 15:50:29 $
;;
;; Author: Jason Stell | jason.stell(a)globalone.net
@@ -172,8 +172,8 @@ non-nil, the jde-ant-build command promp
:group 'jde-ant
:type 'boolean)
-;; (defvar jde-ant-interactive-args-history nil
-;; "History of targets entered in the minibuffer.")
+(defvar jde-ant-interactive-args-history nil
+"History of targets entered in the minibuffer.")
(defvar jde-ant-buildfile-history nil
"History of targets entered in the minibuffer.")
@@ -246,15 +246,22 @@ variable ANT_HOME."
(setq buildfile jde-ant-buildfile))
(let* ((ant-home (jde-ant-get-ant-home))
- (delimiter (if (string= (car jde-ant-invocation-method) "Java")
+ (delimiter (if (or
+ (string= (car jde-ant-invocation-method) "Java")
+ (and (string= (car jde-ant-invocation-method)
+ "Script")
+ (not (featurep 'xemacs))))
"'"
"\""))
+ (ant-program (if (or (string-match "\\\\" jde-ant-program)
+ (string-match "/" jde-ant-program))
+ (jde-normalize-path jde-ant-program)
+ jde-ant-program))
(ant-command
(concat
- (if (string= (car jde-ant-invocation-method) "Script")
- jde-ant-program)
+ (if (string= (car jde-ant-invocation-method) "Script") ant-program)
(if (string= (car jde-ant-invocation-method) "Java")
- (concat
+ (concat
(jde-get-jdk-prog 'java)
" -classpath "
(if (and (or (eq system-type 'windows-nt)
@@ -309,10 +316,12 @@ classpath normalized with `jde-build-cla
(defun jde-ant-get-ant-home ()
"Calculate an appropriate ant home."
- (let ((ANT_HOME_ENV (getenv "ANT_HOME"))
- (if (string= "" jde-ant-home)
- (if ANT_HOME_ENV (jde-normalize-path ANT_HOME_ENV))
- (jde-normalize-path jde-ant-home)))))
+ (let ((ant-home
+ (if (string= jde-ant-home "")
+ (getenv "ANT_HOME")
+ jde-ant-home)))
+ (if ant-home
+ (jde-normalize-path ant-home))))
(defun jde-ant-interactive-get-buildfile ()
"Get a buildfile interactively. This is used so that code that needs to read
@@ -363,11 +372,11 @@ classpath normalized with `jde-build-cla
buildfile))
;;;###autoload
-(defun jde-ant-build (buildfile target &optional interactive-args)
+(defun jde-ant-build(buildfile target &optional interactive-args)
"Build the current project using Ant. If interactive, we try to prompt the
user for certain variables.."
(interactive
- (let (buildfile build-history target interactive-args)
+ (let (buildfile target build-history targets interactive-args)
;;build up the list of args we should use
@@ -380,22 +389,35 @@ classpath normalized with `jde-build-cla
;;get the target using completion.
(if jde-ant-read-target
(if jde-ant-complete-target
- (setq target (completing-read
- "Target to build: "
- (jde-ant-get-target-alist buildfile)
- nil
- t
- (car build-history)
- 'build-history))
+ (if (fboundp 'completing-read-multiple)
+ (setq targets (completing-read-multiple
+ "Target to build: "
+ (jde-ant-get-target-alist buildfile)
+ nil
+ nil
+ (car build-history)
+ 'build-history))
+ (setq targets (list (completing-read
+ "Target to build: "
+ (jde-ant-get-target-alist buildfile)
+ nil
+ t
+ (car build-history)
+ 'build-history))))
;;without using completion... read the target as a string.
- (setq target (read-from-minibuffer
- "Target to build: "
- (car build-history)
- nil
- nil
- 'build-history))))
-
+ (setq targets (list (read-from-minibuffer
+ "Target to build: "
+ (car build-history)
+ nil
+ nil
+ 'build-history)))))
+
+ (while targets
+ (progn
+ (setq target (concat target " " (car targets)))
+ (setq targets (cdr targets))))
+
;; Setting the history for future use
(jde-ant-add-to-history buildfile build-history)
@@ -498,9 +520,11 @@ and there are no more errors. "
(let* (proc (thisdir (jde-ant-get-default-directory)) outwin)
(save-excursion
;; Clear out the compilation buffer and make it writable.
- (if (not (bsh-running-p))
- (bsh-eval (jde-create-prj-values-str)))
- (setq proc (bsh-get-process))
+ (if (not (jde-bsh-running-p))
+ (progn
+ (bsh-launch (oref 'jde-bsh the-bsh))
+ (bsh-eval (oref 'jde-bsh the-bsh) (jde-create-prj-values-str))))
+ (setq proc (bsh-get-process (oref 'jde-bsh the-bsh)))
(set-buffer outbuf)
(compilation-mode)
(setq buffer-read-only nil)
@@ -552,49 +576,50 @@ and there are no more errors. "
(defun jde-ant-filter (proc string)
"This filter prints out the result of the process without buffering.
The result is inserted as it comes in the compilation buffer."
- (with-current-buffer (get-buffer "*compilation*")
- (let ((stack-trace (string-match "java.lang.SecurityException" string))
- (end-of-result (string-match ".*bsh % " string))
- (win (get-buffer-window "*compilation*"))
- )
+ (let ((compilation-buffer (get-buffer "*compilation*")))
+ (if (not (null compilation-buffer))
+ (with-current-buffer compilation-buffer
+ (let ((stack-trace
+ (string-match "java.lang.SecurityException" string))
+ (end-of-result (string-match ".*bsh % " string))
+ (win (get-buffer-window "*compilation*")))
- (save-excursion
- ;;Insert the text, advancing the process marker
- (goto-char (point-max))
-
- ;;if the security exception has been thrown set the
- ;;jde-ant-passed-security-exception flag and filter the stack trace out
- ;;of the ouput
- (if stack-trace
- (progn
- (setq jde-ant-passed-security-exception t)
- (insert (substring string 0 stack-trace))
- (set-buffer-modified-p nil)
- (compilation-mode "Compilation")
- (jde-ant-set-build-status (buffer-string))
- (jde-ant-handle-exit)))
+ (save-excursion
+ ;;Insert the text, advancing the process marker
+ (goto-char (point-max))
- (if end-of-result
- (progn
- (if (not jde-ant-passed-security-exception)
- (progn
- (insert (substring string 0 end-of-result))
+ ;;if the security exception has been thrown set the
+ ;;jde-ant-passed-security-exception flag and filter the stack
+ ;;trace out of the ouput
+ (if stack-trace
+ (progn
+ (setq jde-ant-passed-security-exception t)
+ (insert (substring string 0 stack-trace))
(set-buffer-modified-p nil)
(compilation-mode "Compilation")
(jde-ant-set-build-status (buffer-string))
(jde-ant-handle-exit)))
- (set-process-filter proc jde-ant-comint-filter)))
- (if (and (not end-of-result)
- (not jde-ant-passed-security-exception))
- (insert string)))
- (if (not jde-xemacsp)
- (if compilation-scroll-output
- (save-selected-window
- (if win
- (progn
- (select-window win)
- (goto-char (point-max))))
- (sit-for 0)))))))
+
+ (if end-of-result
+ (progn
+ (if (not jde-ant-passed-security-exception)
+ (progn
+ (insert (substring string 0 end-of-result))
+ (set-buffer-modified-p nil)
+ (compilation-mode "Compilation")
+ (jde-ant-set-build-status (buffer-string))
+ (jde-ant-handle-exit)))
+ (set-process-filter proc jde-ant-comint-filter)))
+ (if (and (not end-of-result)
+ (not jde-ant-passed-security-exception))
+ (insert string)))
+ (if (not jde-xemacsp)
+ (if compilation-scroll-output
+ (save-selected-window
+ (if win
+ (progn
+ (select-window win)
+ (goto-char (point-max))))))))))))
(defun jde-ant-handle-exit ()
"Handles the compilation exit"
@@ -704,8 +729,60 @@ Returns nil if it cannot find a project
;;
;; $Log: jde-ant.el,v $
-;; Revision 1.4 2003/01/18 05:48:43 andyp
-;; sync to jde 2.3.2
+;; Revision 1.69 2003/12/06 15:50:29 jslopez
+;; Fixes problem where jde-ant-program was being normalized unless it was set to
+;; ant or ant.bat. Now it only gets normalized if it contains '/' or a
'\'.
+;;
+;; Revision 1.68 2003/10/19 14:25:32 jslopez
+;; Removes sit-for from jde-ant-filter. It causes the tool-bar and menu bar to
+;; redisplay annoyingly, plus it is not needed.
+;;
+;; Revision 1.67 2003/10/19 14:19:34 jslopez
+;; Fixes error in the jde-ant-filter.
+;;
+;; Revision 1.66 2003/06/24 13:00:51 paulk
+;; Fixed bug that caused noncompleting prompting for target to fail. Thanks to Christian
Schmitt.
+;;
+;; Revision 1.65 2003/05/15 03:28:21 paulk
+;; Fix jde-ant-get-ant-home.
+;;
+;; Revision 1.64 2003/03/28 05:33:29 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
+;; Revision 1.63 2003/03/04 10:15:07 paulk
+;; Updated to use the new bsh-get-process method provided
+;; by bsh to get its process. This is necessary to insulate
+;; clients from the fact that bsh now uses a bsh-buffer
+;; object to wrap the Emacs Lisp buffer object that specifies
+;; the associated process.
+;;
+;; Revision 1.62 2003/02/28 15:33:54 jslopez
+;; Adds support to jde-ant-complete-target to complete multiple targets.
+;;
+;; Revision 1.61 2003/02/17 21:38:04 jslopez
+;; Fixes regression bug.
+;;
+;; Revision 1.60 2003/02/17 08:13:05 paulk
+;; Changes required to support new package-independent version of beanshell.el
+;;
+;; Revision 1.59 2003/01/31 21:58:31 jslopez
+;; Fixes regression bug for XEmacs. "'" Causes in XEmacs not to be able to
+;; find the buildfile.
+;;
+;; Revision 1.58 2003/01/23 02:45:26 jslopez
+;; Fixes bug when using ant.bat, double quotes seem to cause problems.
+;; Fix to use jde-normalize-path when jde-ant-program is not ant or ant.bat.
+;;
+;; Revision 1.57 2003/01/22 03:23:39 jslopez
+;; Normalizes jde-ant-program.
+;;
+;; Revision 1.56 2003/01/21 13:39:13 jslopez
+;; XEmacs compatibility fix, history seems to be a reserve word
+;; in XEmacs.
+;;
+;; Revision 1.55 2003/01/04 17:31:09 jslopez
+;; Fixes regression bug.
+;; Uncomments jde-ant-interactive-args-history definition.
;;
;; Revision 1.54 2002/12/14 18:37:36 jslopez
;; Fixes regression bug.
1.10 +47 -15 XEmacs/packages/xemacs-packages/jde/lisp/jde-bug.el
Index: jde-bug.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-bug.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- jde-bug.el 2003/03/11 05:45:42 1.9
+++ jde-bug.el 2006/03/03 20:42:37 1.10
@@ -1,11 +1,11 @@
;;; jde-bug.el -- JDEbug Interface
-;; $Revision: 1.8 $ $Date: 2003/01/18 05:48:43 $
+;; $Revision: 1.96 $ $Date: 2003/09/22 03:34:39 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -189,6 +189,8 @@ consuming and slows down stepping throug
:group 'jde-bug
:type 'boolean)
+(defvar jde-bug-minor-mode-hook nil
+ "Hook to run when entering or leaving jde-bug-minor-mode.")
(defvar jde-bug-menu-spec
(list "JDEbug"
@@ -229,9 +231,13 @@ consuming and slows down stepping throug
jde-bug-toggle-breakpoint t]
["Set Conditional Breakpoint"
jde-bug-set-conditional-breakpoint nil]
+ ["Break on exception"
+ jde-bug-break-on-exception
+ :active (and
+ (jde-dbs-debugger-running-p)
+ (jde-dbs-get-target-process))]
["Save Breakpoints"
jde-bug-save-breakpoints nil]
-
(list
"Watch for Field"
@@ -549,7 +555,7 @@ consuming and slows down stepping throug
(defun jde-bug-minor-mode (&optional arg)
"Toggle JDEbug minor mode.
-With prefix argument ARG, turn on if positive, otherwise off..
+With prefix argument ARG, turn on if positive, otherwise off.
\\{jde-bug-mode-map}"
(interactive
@@ -557,17 +563,11 @@ With prefix argument ARG, turn on if pos
(if jde-bug-minor-mode 0 1))))
(setq jde-bug-minor-mode
- (if arg
- (>
- (prefix-numeric-value arg)
- 0)
+ (if arg
+ (> (prefix-numeric-value arg) 0)
(not jde-bug-minor-mode)))
- (if jde-bug-minor-mode
- (if (featurep 'xemacs)
- (easy-menu-add jde-bug-menu-spec jde-bug-mode-map))
- (if (featurep 'xemacs)
- (easy-menu-remove jde-bug-menu-spec))))
+ (run-hook-with-args 'jde-bug-minor-mode-hook jde-bug-minor-mode))
(semantic-add-minor-mode 'jde-bug-minor-mode " JDEbug" jde-bug-mode-map)
@@ -717,6 +717,7 @@ You can use the notation [f1], [f2], etc
(proc (jde-dbs-get-target-process)))
(unless bp
(setq bp (jde-db-spec-breakpoint))
+ (oset bp line line)
(jde-db-breakpoints-add bp))
(if (and bp proc)
(let* ((set-breakpoint (jde-dbs-set-breakpoint
@@ -1179,6 +1180,20 @@ You can use the notation [f1], [f2], etc
(jde-dbs-cmd-exec cmd)
(call-next-method)))
+(defun jde-bug-break-on-exception (exception-class)
+ (interactive "sFully qualified exception: ")
+ (let* ((process (jde-dbs-get-target-process))
+ (request (jde-dbs-trace-exceptions-request
+ "break on exceptions request"
+:exception-class exception-class
+:trace-type "both"
+:suspend-policy "all"))
+ (cmd (jde-dbs-trace-exceptions
+ "break on exceptions command"
+:process process :trace-request request)))
+ (jde-dbs-cmd-exec cmd)
+ (jde-dbs-proc-display-debug-message process "Use JDEbug->Trace->Cancel to
remove this breakpoint")))
+
(defun jde-bug-trace-exceptions ()
"Displays the trace exceptions dialog."
@@ -2476,8 +2491,25 @@ of the variable `jde-bug-stack-info'"
(provide 'jde-bug)
;; $Log: jde-bug.el,v $
-;; Revision 1.8 2003/01/18 05:48:43 andyp
-;; sync to jde 2.3.2
+;; Revision 1.96 2003/09/22 03:34:39 paulk
+;; Move Break on Exception menu item.
+;;
+;; Revision 1.95 2003/09/21 04:56:25 paulk
+;; Enable Break on Exception menu item only when a debuggee process
+;; is running.
+;;
+;; Revision 1.94 2003/09/17 05:31:56 ahyatt
+;; Added message to help users remove exception breakpoint
+;;
+;; Revision 1.93 2003/09/17 05:12:24 ahyatt
+;; Added exception breakpoints
+;;
+;; Revision 1.92 2003/03/28 05:33:29 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
+;; Revision 1.91 2003/01/12 18:39:41 jslopez
+;; Fixes bug in jde-bug-set-breakpoint.
+;; The line number was not being set for new breakpoints with this method.
;;
;; Revision 1.90 2002/12/19 22:23:44 ahyatt
;; Should have used slot-boundp instead of slot-existsp
1.5 +155 -627 XEmacs/packages/xemacs-packages/jde/lisp/jde-checkstyle.el
Index: jde-checkstyle.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-checkstyle.el,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- jde-checkstyle.el 2003/01/18 05:48:43 1.4
+++ jde-checkstyle.el 2006/03/03 20:42:37 1.5
@@ -1,7 +1,7 @@
;;; JDE-CHECKSTYLE.EL --- Checkstyle interface for JDE
-;; $Revision: 1.9 $ $Date: 2002/12/21 09:06:22 $
+;; $Revision: 1.16 $ $Date: 2003/11/05 08:33:59 $
-;; Copyright (C) 2001, 2002 Markus Mohnen and Paul Kinnucan
+;; Copyright (C) 2001, 2002, 2003 Markus Mohnen and Paul Kinnucan
;; Authors: Markus Mohnen and Paul Kinnucan
;; Maintainers: Markus Mohnen and Paul Kinnucan
@@ -28,7 +28,7 @@
;; LCD Archive Entry:
;; jde-checkstyle|Markus Mohnen|
;; |Checkstyle interface for JDE
-;; |$Date: 2002/12/21 09:06:22 $|$Revision: 1.9 $|~/packages/jde-checkstyle.el
+;; |$Date: 2003/11/05 08:33:59 $|$Revision: 1.16 $|~/packages/jde-checkstyle.el
;;; Commentary:
@@ -58,18 +58,14 @@
(require 'jde-compile)
-(if (fboundp 'jde-build-classpath)
- nil
- (require 'jde-run)
- (defalias 'jde-build-classpath 'jde-run-build-classpath-arg)
- )
+(defconst jde-checkstyle-version "3.1")
-(defconst jde-checkstyle-version "2.3")
-
(defgroup jde-checkstyle nil
- "JDE Checkstyle Options"
-:group 'jde
-:prefix "jde-checkstyle-option-")
+ "This group specifies options for the JDEE's interface to the CheckStyle
+package (
http://checkstyle.sourceforge.net). The CheckStyle package
+checks Java source files for conformity to a specified coding
+style."
+:group 'jde)
(defcustom jde-checkstyle-class "com.puppycrawl.tools.checkstyle.Main"
"*Java checker class.
@@ -86,7 +82,7 @@ argument to pass to the Java interpreter
:group 'jde-checkstyle
:type '(repeat (file :tag "Path")))
-(defcustom jde-read-checkstyle-args nil
+(defcustom jde-checkstyle-read-args nil
"*Specify whether to prompt for additional checker arguments.
If this variable is non-nil, the jde-checkstyle command prompts
you to enter additional checker arguments in the minibuffer.
@@ -96,632 +92,112 @@ entered in the minibuffer."
:group 'jde-checkstyle
:type 'boolean)
-(defvar jde-interactive-checkstyle-args ""
+(defvar jde-checkstyle-interactive-args ""
"String of checker arguments entered in the minibuffer.")
-(defvar jde-interactive-compile-arg-history nil
+(defvar jde-checkstyle-interactive-arg-history nil
"History of checker arguments entered in the minibuffer.")
-(defcustom jde-checkstyle-properties-file ""
- "*Path of file that specifies checkstyle options."
+;; (makunbound 'jde-checkstyle-style)
+(defcustom jde-checkstyle-style nil
+ "*Style used to check this project's Java code. \"Sun\"
+checks for conformity to the Java code style standard established by
+Sun Microsystems. \"Custom\" specifies a a user-defined
+style. Selecting this option causes Emacs to display an edit
+field. Enter the path of a CheckStyle configuration file that defines
+the custom coding style in this field (see the CheckStyle
+documentation for information on configuration files). Use
+`jde-checkstyle-properties' to specify the values of properties that
+the configuration file reads from the CheckStyle command line."
:group 'jde-checkstyle
-:type 'file)
-
-(defcustom jde-checkstyle-option-member-format "^[a-z][a-zA-Z0-9]*$"
- "*Regular expression that specifies the format of nonstatic nonpublic
-member variables."
-:group 'jde-checkstyle
-:type 'regexp)
-
-(defcustom jde-checkstyle-option-public-member-format "^f[A-Z][a-zA-Z0-9]*$"
- "*Regular expression that specifies the format of public member variables.
-Default example:
-
- public int fCMPField;"
-:group 'jde-checkstyle
-:type 'regexp)
-
-(defcustom jde-checkstyle-option-constant-format "^[A-Z](_?[A-Z0-9]+)*$"
- "*Regular expression that specifies the format of final static variables.
-Default example:
-
- public static final int MAX_ROWS = 2;"
-:group 'jde-checkstyle
-:type 'regexp)
-
-(defcustom jde-checkstyle-option-static-format "^[a-z][a-zA-Z0-9]*$"
- "*Regular expression that specifies the format of static variables.
-Default example:
-
- private static int numCreated = 0;"
-:group 'jde-checkstyle
-:type 'regexp)
-
-(defcustom jde-checkstyle-option-todo-format "TODO:"
- "Regular expression that specifies the format of to-do comments."
-:group 'jde-checkstyle
-:type 'regexp)
-
+:type '(choice (const :tag "Sun" :value nil)
+ (file :menu-tag "Custom" :tag "Config. File")))
-(defcustom jde-checkstyle-option-parameter-format "^[a-z][a-zA-Z0-9]*$"
- "Regular expression that specifies the format of parameter names."
-:group 'jde-checkstyle
-:type 'regexp)
-
-
-(defcustom jde-checkstyle-option-type-format "^[A-Z][a-zA-Z0-9]*$"
- "Regular expression that specifies the format of type names."
-:group 'jde-checkstyle
-:type 'regexp)
-
-(defcustom jde-checkstyle-option-method-format "^[a-z][a-zA-Z0-9]*$"
- "Regular expression that specifies the format of method names."
-:group 'jde-checkstyle
-:type 'regexp)
-
-(defcustom jde-checkstyle-option-localvar-format "^[a-z][a-zA-Z0-9]*$"
- "Regular expression that specifies the format of local variable names."
-:group 'jde-checkstyle
-:type 'regexp)
-;;(makunbound 'jde-checkstyle-option-lcurly-type)
-(defcustom jde-checkstyle-option-lcurly-type (list "eol")
- "Specifies the policy of where to put the left brace '{' for type
-declarations. The legal values are defined are:
-
-ignore - Ignore the placement of the brace.
-eol - The brace must always be on the end of the line. For example:
-
- if (condition) {
- ...
-
-nl - The brace must always be on a new line. For example:
-
- if (condition)
- {
- ...
-
-nlow - If the brace will fit on the first line of the statement, taking into
- account maximum line length, then apply eol rule. Otherwise apply the nl
- rule. nlow is a mnemonic for 'new line on wrap'. For the example above
- Checkstyle will enforce:
-
- if (condition) {
- ...
-
- But for a statement spanning multiple lines, Checkstyle will enforce:
-
- if (condition1 && condition2 &&
- condition3 && condition4)
- {
- ...
-"
-:group 'jde-checkstyle
-:type '(list
- (radio-button-choice
- :format "%t \n%v"
- :tag "Left brace placement"
- (item "ignore")
- (item "eol")
- (item "nl")
- (item "nlow"))))
+(defcustom jde-checkstyle-expanded-properties nil
+ "*Specify the values of the expanded properties specified by the
+`jde-checkstyle-style' configuration file. (See the CheckStyle
+documentation for information about expanded properties.) To enter a
+property, select the INS button. Emacs displays a Property Name field
+and a Property Value field for the property. Enter the name of the
+property, for example, checkstyle.header.file, in the Property Name
+field; enter its value, for example, docs/java.header, in the Property
+Value field. Repeat this process to display additional
+properties. You can specify as many properties as you like in
+this way. To delete a property, select the DEL button next
+to the property."
+:group 'jde-checkstyle
+:type '(repeat (cons
+ (string :tag "Property Name")
+ (string :tag "Property Value"))))
+
+;; (makunbound 'jde-checkstyle-expanded-properties-file)
+(defcustom jde-checkstyle-expanded-properties-file nil
+ "*Path of a file that specifies the values of a configuration
+file's expanded properties. If this option is set, the JDEE ignores
+the settings of the `jde-checkstyle-expanded-properties' variable."
+:group 'jde-checkstyle
+:type '(choice (const :tag "None" :value nil)
+ (file :menu-tag "Properties File" :tag "Path")))
-
+;; (makunbound 'jde-checkstyle-module-package-names-file)
+(defcustom jde-checkstyle-module-package-names-file nil
+ "*Path of a file that specifies the package names of
+custom style checking modules used by this project."
+:group 'jde-checkstyle
+:type '(choice (const :tag "None" :value nil)
+ (file :menu-tag "Package Names File" :tag "Path")))
-(defcustom jde-checkstyle-option-lcurly-method (list "eol")
- "Specifies the policy of where to put the left brace '{' for method
-declarations. The legal values are the same ones allowed for
`jde-checkstyle-option-lcurly-type'.
-"
-:group 'jde-checkstyle
-:type '(list
- (radio-button-choice
- :format "%t \n%v"
- :tag "Left brace placement"
- (item "ignore")
- (item "eol")
- (item "nl")
- (item "nlow"))))
-
-(defcustom jde-checkstyle-option-lcurly-other (list "eol")
- "Specifies the policy of where to put the left brace '{' for other
-declarations. The keywords covered are switch, while, for, do, if, else,
-synchronized, try, catch, finally and static. The legal values are the same ones
-allowed for `jde-checkstyle-option-lcurly-type'.
-"
-:group 'jde-checkstyle
-:type '(list
- (radio-button-choice
- :format "%t \n%v"
- :tag "Left brace placement"
- (item "ignore")
- (item "eol")
- (item "nl")
- (item "nlow"))))
+;; (makunbound 'jde-checkstyle-output-file)
+(defcustom jde-checkstyle-output-file nil
+ "*Path of a file to store CheckStyle's output."
+:group 'jde-checkstyle
+:type '(choice (const :tag "None" :value nil)
+ (file :menu-tag "Output File" :tag "Path")))
-
-(defcustom jde-checkstyle-option-rcurly (list "same")
- "Specifies the policy of where to put the right brace '}'. The keywords
-covered are else, catch and finally. The legal values are:
-
-ignore - Ignore the placement of the brace.
-same The brace must be on the same line as the next statement. For example:
-
- try {
- ...
- } finally {
-
-alone - The brace must be alone on the line. For example:
-
- try {
- ...
- }
- finally {
-"
-:group 'jde-checkstyle
-:type '(list
- (radio-button-choice
- :format "%t \n%v"
- :tag "Right brace placement"
- (item "ignore")
- (item "same")
- (item "alone"))))
-
-(defcustom jde-checkstyle-option-allow-paren-padding nil
- "Specifies whether to allow padding of parentheses. The default
-is no padding, e.g., method(a, b);"
+;; (makunbound 'jde-checkstyle-output-format)
+(defcustom jde-checkstyle-output-format nil
+ "*Format of CheckStyle's output. Options are plain or XML."
:group 'jde-checkstyle
-:type 'boolean)
+:type '(choice (const :tag "Plain" :value nil)
+ (const :tag "XML" :value "xml")))
-
-(defcustom jde-checkstyle-option-block-try (list "stmt")
- "Specifies the policy for contents of try blocks. The legal values are:
-ignore - Ignore empty blocks.
-text - Require that there is some text in the block. For example:
-
- catch (Exception ex) {
- // This is a bad coding practice
- }
-
-stmt - Require that there is a statement in the block. For example:
-
- finally {
- lock.release();
- }
-"
-:group 'jde-checkstyle
-:type '(list
- (radio-button-choice
- :format "%t \n%v"
- :tag "Required try block content"
- (item "ignore")
- (item "text"
- (item "stmt")))))
-
-
-(defcustom jde-checkstyle-option-block-catch (list "text")
- "Specifies the policy for the contents of catch blocks. The legal values are the
same
-as the ones for `jde-checkstyle-option-block-try'.
-"
-:group 'jde-checkstyle
-:type '(list
- (radio-button-choice
- :format "%t \n%v"
- :tag "Required try block content"
- (item "ignore")
- (item "text"
- (item "stmt")))))
-
-(defcustom jde-checkstyle-option-block-finally (list "text")
- "Specifies the policy of how check finally blocks. The legal values are the same
-as the ones for `jde-checkstyle-option-block-try'.
-"
-:group 'jde-checkstyle
-:type '(list
- (radio-button-choice
- :format "%t \n%v"
- :tag "Required try block content"
- (item "ignore")
- (item "text"
- (item "stmt")))))
-
-(defcustom jde-checkstyle-option-wrap-operator t
- "Specifies the policy of how to wrap on operators. The legal values are:
-
-ignore - Ignore wrapping on an operator.
-nl - The operator must be on a new line. For example:
- someVariable = aBigVariableNameToMakeThings + thisMayWork
- + lookVeryInteresting;
-"
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-allow-protected nil
- "Indicates whether to allow protected data."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-allow-tabs nil
- "Indicates whether to allow tabs."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-allow-package nil
- "Indicates whether to allow package visible data."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-allow-noauthor nil
- "Indicates whether to allow no @author tag to be defined for class and interface
Javadoc comments."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-maxlinelen 80
- "Specifies the maximum line length."
-:group 'jde-checkstyle
-:type 'integer)
-
-(defcustom jde-checkstyle-option-tab-width 8
- "The distance between tab stops, used in line number and column
calculations."
-:group 'jde-checkstyle
-:type 'integer)
-
-(defcustom jde-checkstyle-option-ignore-maxlinelen "^$"
- "Regular expression that matches lines to ignore in maximum line length
checks."
-:group 'jde-checkstyle
-:type 'regexp)
-
-(defcustom jde-checkstyle-option-ignore-importlength nil
- "Specifies whether to ignore the maximum line length for import statements."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-maxmethodlen 150
- "Specifies the maximum number of lines in a method."
-:group 'jde-checkstyle
-:type 'integer)
+;; (makunbound 'jde-checkstyle-source-dir)
+(defcustom jde-checkstyle-source-dir nil
+ "*Path of a directory to check. If you specify a
+path, CheckStyle checks all the files in the specified
+directory. Otherwise, it checks the file in the current
+buffer."
+:group 'jde-checkstyle
+:type '(choice (const :tag "None" :value nil)
+ (file :menu-tag "Source Directory" :tag "Path")))
-(defcustom jde-checkstyle-option-maxconstructorlen 150
- "Specifies the maximum constructor length."
-:group 'jde-checkstyle
-:type 'integer)
-(defcustom jde-checkstyle-option-maxfilelen 2000
- "Specifies the maximum file length."
+;; (makunbound 'jde-checkstyle-source-file-extension)
+(defcustom jde-checkstyle-source-file-extension nil
+ "*Extension of Java source files (if not java)."
:group 'jde-checkstyle
-:type 'integer)
+:type '(choice (const :tag "java" :value nil)
+ (string :menu-tag "other" :tag "Extension")))
-
-(defcustom jde-checkstyle-option-header-file ""
- "Specifies the path of a file containing the boilerplate text that
-should appear at the head of each source file. Checkstyle issues a
-warning if the head of the current source file does not match the
-contents of the header file. If no file is
-specified, checkstyle does not check for a header."
-:group 'jde-checkstyle
-:type 'file)
-
-(defcustom jde-checkstyle-option-header-regexp nil
- "Specifies whether to interpret each line in the
-`jde-checkstyle-option-header-file' as a regular expression.
-Checkstyle also supports interpreting each header line as
-a regular expression. For example, consider the following header when
-regular expression checking is turned on:
-
-line 1: /{71}
-line 2: // checkstyle: Checks Java source code for adherence to a set of rules\.
-line 3: // Copyright \(C\) \d\d\d\d Oliver Burn
-line 4: // Last modification by \$Author.*\$
-line 5: /{71}
-
-Lines 1 and 5 demonstrate a more compact notation for 71 '/' characters. Line 3
-enforces that the copyright notice includes a four digit year. Line 4 is an
-example how to enforce revision control keywords in a file header.
-"
-:group 'jde-checkstyle
-:type 'boolean)
-(defcustom jde-checkstyle-option-header-ignoreline nil
- "Specifies a list of the lines in the header to ignore when
-comparing. Default is to not ignore any line. Most copyright headers will
-contain date information (for example the year) which will change over time. To
-support this, checkstyle supports specifying the lines in the header to ignore
-when comparing the start of the file with the header. For example, consider the
-following header:
-
-line 1: ///////////////////////////////////////////////////////////////////////
-line 2: // checkstyle: Checks Java source code for adherence to a set of rules.
-line 3: // Copyright (C) 2001 Oliver Burn
-line 4: ///////////////////////////////////////////////////////////////////////
-Since the year information will change over time, you can tell checkstyle to ignore line
3.
-"
-:group 'jde-checkstyle
-:type '(repeat (integer :tag "line no")))
+(defmethod jde-checkstyle-get-property-args ((this jde-run-vm))
+ "Get property arguments."
+ (mapcar
+ (lambda (prop)
+ (format "-D%s=%s" (car prop) (cdr prop)))
+ jde-run-option-properties))
-(defcustom jde-checkstyle-option-javadoc-scope (list "private")
- "Specifies the visibility scope where javadoc comments are checked."
-:group 'jde-checkstyle
-:type '(list
- (radio-button-choice
- :format "%t \n%v"
- :tag "Javadoc scope"
- (item "nothing")
- (item "public")
- (item "protected")
- (item "package")
- (item "private")
- (item "anoninner"))))
-
-(defcustom jde-checkstyle-option-require-packagehtml nil
- "Specifies whether to require that package documentation is available."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-ignore-imports nil
- "Specifies whether to ignore checking import statements."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-illegal-imports (list "sun")
- "List of package prefixes that are not allowed in import statements."
-:group 'jde-checkstyle
-:type '(repeat (string :tag "Package")))
-
-(defcustom jde-checkstyle-option-illegal-instantiations nil
- "List of fully qualified class names that are not allowed to
-be instantiated. A common mistake is to create new instances of
-java.lang.Boolean instead of using the constants TRUE and FALSE or the
-Boolean.valueOf() factory methods. This increases the program's memory
-requirements and wastes CPU cycles during memory allocation and garbage
-collection. To find this error automatically, include java.lang.Boolean in the
-list of illegal instantiations.
-"
-:group 'jde-checkstyle
-:type '(repeat (string :tag "Class")))
-
-(defcustom jde-checkstyle-option-ignore-whitespace nil
- "Specifies whether to ignore checking whitespace."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-ignore-whitespace-cast nil
- "Specifies whether to ignore checking for whitespace after a cast."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-ignore-braces nil
- "Specifies whether to ignore checking braces."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-ignore-longell nil
- "Specifies whether to ignore checking the L in long integer literals."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-ignore-public-in-interface nil
- "Specifies whether to ignore the public keyword in interface definitions."
-:group 'jde-checkstyle
-:type 'boolean)
-
-(defcustom jde-checkstyle-option-cache-file ""
- "Specifies the name of a file that can be used to cache details of files that
-pass checkstyle. This can signicantly increase the speed of checkstyle on
-successive runs."
-:group 'jde-checkstyle
-:type 'file)
-
-(defcustom jde-checkstyle-option-javadoc-check-unused-throws nil
- "Specifies whether to check if unused @throws tags are subclasses of
java.lang.RuntimeException."
-:group 'jde-checkstyle
-:type 'boolean)
-
-;; (makunbound 'jde-checkstyle-option-basedir)
-(defcustom jde-checkstyle-option-basedir ""
- "Specifies a base directory for reporting file names relative to .For example,
-if a base directory is specified as c:\\projects\\checkstyle, then an error in the
-file c:\\projects\\checkstyle\\src\\dir\\subdir\\File.java will be reported as
-src\\dir\\subdir\\File.java."
-:group 'jde-checkstyle
-:type 'directory)
-
-(defun jde-checkstyle-get-options ()
- "Constructs a command-line argument string for checker.
-The string consists of the contents of the jde-checkstyle-options
-variable concatenated with the various jde-checkstyle-option
-settings.
-"
- (let (options)
-
- (if (not (string= jde-checkstyle-option-member-format
"^[a-z][a-zA-Z0-9]*$"))
- (add-to-list 'options (concat "-Dcheckstyle.pattern.member="
jde-checkstyle-option-member-format)))
-
- (if (not (string= jde-checkstyle-option-public-member-format
"^f[A-Z][a-zA-Z0-9]*$"))
- (add-to-list 'options (concat "-Dcheckstyle.pattern.publicmember="
- jde-checkstyle-option-public-member-format)))
-
- (if (not (string= jde-checkstyle-option-constant-format
"^[A-Z](_?[A-Z0-9]+)*$"))
- (add-to-list 'options (concat "-Dcheckstyle.pattern.const="
jde-checkstyle-option-constant-format)))
-
- (if (not (string= jde-checkstyle-option-static-format
"^[a-z][a-zA-Z0-9]*$"))
- (add-to-list 'options (concat "-Dcheckstyle.pattern.static="
jde-checkstyle-option-static-format)))
-
- (if (not (string= jde-checkstyle-option-todo-format "TODO:"))
- (add-to-list 'options (concat "-Dcheckstyle.pattern.todo="
jde-checkstyle-option-todo-format)))
-
- (if (not (string= jde-checkstyle-option-parameter-format
"^[a-z][a-zA-Z0-9]*$"))
- (add-to-list 'options (concat "-Dcheckstyle.pattern.parameter="
- jde-checkstyle-option-parameter-format)))
-
-
- (if (not (string= jde-checkstyle-option-type-format "^[A-Z][a-zA-Z0-9]*$"))
- (add-to-list 'options (concat "-Dcheckstyle.pattern.type="
jde-checkstyle-option-type-format)))
-
- (if (not (string= jde-checkstyle-option-method-format
"^[a-z][a-zA-Z0-9]*$"))
- (add-to-list 'options (concat "-Dcheckstyle.pattern.method="
- jde-checkstyle-option-method-format)))
-
- (if (not (string= jde-checkstyle-option-localvar-format
"^[a-z][a-zA-Z0-9]*$"))
- (add-to-list 'options (concat "-Dcheckstyle.pattern.localvar="
- jde-checkstyle-option-localvar-format)))
- (if (not (string= (car jde-checkstyle-option-lcurly-type) "eol"))
- (add-to-list 'options (concat "-Dcheckstyle.lcurly.type=" (car
jde-checkstyle-option-lcurly-type))))
-
- (if (not (string= (car jde-checkstyle-option-lcurly-method) "eol"))
- (add-to-list 'options (concat "-Dcheckstyle.lcurly.method=" (car
jde-checkstyle-option-lcurly-method))))
-
-
- (if (not (string= (car jde-checkstyle-option-lcurly-other) "eol"))
- (add-to-list 'options (concat "-Dcheckstyle.lcurly.other=" (car
jde-checkstyle-option-lcurly-other))))
-
- (if (not (string= (car jde-checkstyle-option-rcurly) "same"))
- (add-to-list 'options (concat "-Dcheckstyle.rcurly=" (car
jde-checkstyle-option-rcurly))))
-
- (if jde-checkstyle-option-allow-paren-padding
- (add-to-list 'options "-Dcheckstyle.paren.pad=ignore"))
-
- (if (not (string= (car jde-checkstyle-option-block-try) "stmt"))
- (add-to-list 'options (concat "-Dcheckstyle.block.try=" (car
jde-checkstyle-option-block-try))))
-
- (if (not (string= (car jde-checkstyle-option-block-catch) "text"))
- (add-to-list 'options (concat "-Dcheckstyle.block.catch=" (car
jde-checkstyle-option-block-catch))))
-
- (if (not (string= (car jde-checkstyle-option-block-finally) "text"))
- (add-to-list 'options (concat "-Dcheckstyle.block.finally="
- (car jde-checkstyle-option-block-finally))))
-
- (if (not jde-checkstyle-option-wrap-operator)
- (add-to-list 'options "-Dcheckstyle.wrap.operator=ignore"))
-
- (if jde-checkstyle-option-allow-protected (add-to-list 'options
"-Dcheckstyle.allow.protected=yes"))
-
- (if jde-checkstyle-option-allow-tabs (add-to-list 'options
"-Dcheckstyle.allow.tabs=yes"))
-
- (if jde-checkstyle-option-allow-package (add-to-list 'options
"-Dcheckstyle.allow.package=yes"))
-
- (if jde-checkstyle-option-allow-noauthor (add-to-list 'options
"-Dcheckstyle.allow.noauthor=yes"))
-
- (if (not (= jde-checkstyle-option-maxlinelen 80))
- (add-to-list 'options (concat "-Dcheckstyle.maxlinelen="
- (int-to-string jde-checkstyle-option-maxlinelen))))
-
- (if (not (= jde-checkstyle-option-tab-width 8))
- (add-to-list 'options (concat "-Dcheckstyle.tab.width="
- (int-to-string jde-checkstyle-option-tab-width))))
-
- (if (not (string= jde-checkstyle-option-ignore-maxlinelen "^$"))
- (add-to-list 'options (concat "-Dcheckstyle.ignore.maxlinelen="
- jde-checkstyle-option-ignore-maxlinelen)))
-
- (if jde-checkstyle-option-ignore-importlength
- (add-to-list 'options "-Dcheckstyle.ignore.importlength=yes"))
-
-
- (if (not (= jde-checkstyle-option-maxmethodlen 150))
- (add-to-list 'options (concat "-Dcheckstyle.maxmethodlen="
- (int-to-string jde-checkstyle-option-maxmethodlen))))
-
- (if (not (= jde-checkstyle-option-maxconstructorlen 150))
- (add-to-list 'options (concat "-Dcheckstyle.maxconstructorlen="
- (int-to-string jde-checkstyle-option-maxconstructorlen))))
-
- (if (not (= jde-checkstyle-option-maxfilelen 2000))
- (add-to-list 'options (concat "-Dcheckstyle.maxfilelen="
- (int-to-string jde-checkstyle-option-maxfilelen))))
-
- (if (not (string= jde-checkstyle-option-header-file ""))
- (add-to-list 'options (concat "-Dcheckstyle.header.file="
jde-checkstyle-option-header-file)))
-
- (if jde-checkstyle-option-header-regexp (add-to-list 'options
"-Dcheckstyle.header.regexp=yes"))
-
- (if jde-checkstyle-option-header-ignoreline
- (add-to-list 'options
- (concat "-Dcheckstyle.header.ignoreline="
- (mapconcat
- (lambda (line)
- (int-to-string line))
- jde-checkstyle-option-header-ignoreline
- ","))))
-
- (if (not (string= (car jde-checkstyle-option-javadoc-scope) "private"))
- (add-to-list 'options (concat "-Dcheckstyle.javadoc.scope=" (car
jde-checkstyle-option-javadoc-scope))))
-
- (if jde-checkstyle-option-require-packagehtml (add-to-list 'options
"-Dcheckstyle.require.packagehtml=yes"))
-
- (if jde-checkstyle-option-ignore-imports
- (add-to-list 'options "-Dcheckstyle.ignore.imports=yes")
-
- (if (not
- (and
- (= (length jde-checkstyle-option-illegal-imports) 1)
- (string= (car jde-checkstyle-option-illegal-imports) "sun")))
- (add-to-list
- 'options
- (concat
- "-Dcheckstyle.illegal.imports="
- (mapconcat
- 'identity
- jde-checkstyle-option-illegal-imports
- ","))))
-
- (if jde-checkstyle-option-illegal-instantiations
- (add-to-list
- 'options
- (concat
- "-Dcheckstyle.illegal.instantiations="
- (mapconcat
- 'identity
- jde-checkstyle-option-illegal-instantiations
- ","))))
-
- (if jde-checkstyle-option-ignore-whitespace
- (add-to-list 'options "-Dcheckstyle.ignore.whitespace=yes"))
-
- (if jde-checkstyle-option-ignore-whitespace-cast
- (add-to-list 'options "-Dcheckstyle.ignore.whitespace.cast=yes"))
-
- (if jde-checkstyle-option-ignore-braces (add-to-list 'options
"-Dcheckstyle.ignore.braces=yes"))
-
- (if jde-checkstyle-option-ignore-longell (add-to-list 'options
"-Dcheckstyle.ignore.longell=yes"))
-
- (if jde-checkstyle-option-ignore-public-in-interface
- (add-to-list 'options "-Dcheckstyle.ignore.public.in.interface=yes"))
-
- (if (not (string= jde-checkstyle-option-cache-file ""))
- (add-to-list 'options (concat "-Dcheckstyle.cache.file="
jde-checkstyle-option-cache-file)))
-
- (if jde-checkstyle-option-javadoc-check-unused-throws
- (add-to-list 'options "-Dcheckstyle.javadoc.checkUnusedThrows=yes"))
-
- (if (not (string= jde-checkstyle-option-basedir ""))
- (add-to-list 'options (concat "-Dcheckstyle.basedir="
jde-checkstyle-option-basedir)))
-
- options)))
-
;;;###autoload
(defun jde-checkstyle-customize ()
"Set Java style checking options."
(interactive)
(customize-group "jde-checkstyle"))
-(defun jde-make-checkstyle-command (more-args)
- "Constructs the java checker command as: jde-checker + options + buffer file
name."
- (concat
- (if (string< jde-version "2.2.9")
- (if (eq system-type 'windows-nt)
- jde-run-java-vm-w
- jde-run-java-vm)
- (oref (jde-run-get-vm) :path))
- (jde-get-checkstyle-options)
- (if (not (string= more-args "")) (concat " " more-args))
- " "
- jde-checkstyle-class
- " "
- (file-name-nondirectory buffer-file-name)))
-
(defclass jde-checkstyle-checker ()
((buffer :initarg :buffer
:type buffer
@@ -798,6 +274,13 @@ settings.
(setq default-directory thisdir
compilation-directory-stack (list default-directory)))))
+(defmethod jde-checkstyle-get-property-args ((this jde-checkstyle-checker))
+ "Get property arguments."
+ (mapcar
+ (lambda (prop)
+ (format "-D%s=%s" (car prop) (cdr prop)))
+ jde-checkstyle-expanded-properties))
+
(defmethod jde-checkstyle-exec ((this jde-checkstyle-checker))
(jde-checkstyle-create-checker-buffer this)
@@ -813,22 +296,39 @@ settings.
(let* ((outbuf (oref this :buffer))
(vm-path (oref (jde-run-get-vm) :path))
- (source-file (file-name-nondirectory buffer-file-name))
+ (source-file
+ (concat (file-name-nondirectory buffer-file-name)))
(jde-java-directory
(concat
(jde-find-jde-data-directory)
"java/"))
(args (append
- (jde-checkstyle-get-options)
+ (unless jde-checkstyle-expanded-properties-file
+ (jde-checkstyle-get-property-args this))
(oref this :interactive-args)
(list "-classpath"
(if jde-checkstyle-classpath
(jde-build-classpath jde-checkstyle-classpath)
- (expand-file-name "lib/checkstyle-all.jar" jde-java-directory)))
- (list jde-checkstyle-class)
- (if (not (string= jde-checkstyle-properties-file ""))
- (list "-p" (jde-normalize-path
jde-checkstyle-properties-file)))
- (list source-file))))
+ (jde-normalize-path
+ (expand-file-name "lib/checkstyle-all.jar" jde-java-directory))))
+ (list jde-checkstyle-class)
+ (list "-c"
+ (if jde-checkstyle-style
+ (jde-normalize-path jde-checkstyle-style)
+ (concat (jde-find-jde-data-directory) "java/lib/sun_checks.xml")))
+ (if jde-checkstyle-expanded-properties-file
+ (list "-p" (jde-normalize-path
jde-checkstyle-expanded-properties-file)))
+ (if jde-checkstyle-module-package-names-file
+ (list "-n" (jde-normalize-path
jde-checkstyle-module-package-names-file)))
+ (if jde-checkstyle-output-format
+ (list "-f" jde-checkstyle-output-format))
+ (if jde-checkstyle-output-file
+ (list "-o" (jde-normalize-path
jde-checkstyle-output-file)))
+ (if jde-checkstyle-source-file-extension
+ (list "-e" jde-checkstyle-source-file-extension))
+ (if jde-checkstyle-source-dir
+ (list "-r" (jde-normalize-path jde-checkstyle-source-dir))
+ (list source-file)))))
(save-excursion
(set-buffer outbuf)
@@ -866,23 +366,23 @@ settings.
This command invokes the style checker specified by `jde-checkstyle-class'
with the options specif2ied by the JDEE customization variables
that begin with `jde-checkstyle'. If the variable
-`jde-read-checkstyle-args' is non-nil, this command reads
+`jde-checkstyle-read-args' is non-nil, this command reads
additional compilation options from the minibuffer, with
history enabled."
(interactive)
- (if jde-read-checkstyle-args
- (setq jde-interactive-checkstyle-args
+ (if jde-checkstyle-read-args
+ (setq jde-checkstyle-interactive-args
(read-from-minibuffer
"Check args: "
- jde-interactive-checkstyle-args
+ jde-checkstyle-interactive-args
nil nil
- '(jde-interactive-checkstyle-arg-history . 1))))
+ '(jde-checkstyle-interactive-arg-history . 1))))
(let ((checker (jde-checkstyle-checker
"checker"
- :interactive-args (if jde-read-checkstyle-args
- jde-interactive-checkstyle-args))))
+ :interactive-args (if jde-checkstyle-read-args
+ jde-checkstyle-interactive-args))))
;; Force save-some-buffers to use the minibuffer
;; to query user about whether to save modified buffers.
@@ -910,6 +410,34 @@ history enabled."
(provide 'jde-checkstyle)
;; $Log: jde-checkstyle.el,v $
+;; Revision 1.16 2003/11/05 08:33:59 paulk
+;; Cosmetic changes.
+;;
+;; Revision 1.15 2003/11/03 06:00:53 paulk
+;; Updated to support CheckStyle 3.1.
+;;
+;; Revision 1.14 2003/09/27 05:15:24 paulk
+;; Normalize path of CheckStyle jar file to permit use on the cygwin versions
+;; of Emacs.
+;;
+;; Revision 1.13 2003/09/01 03:38:18 paulk
+;; Removed the code that somebody added to prepend the package path to
+;; the source file name and hence force the checkstyle command to be run
+;; from the root of a package, thereby making it impossible to run from
+;; the menu.
+;;
+;; Revision 1.12 2003/08/05 16:22:04 ahyatt
+;; Fixes problem with using checkstyle on files not in top-level directory
+;;
+;; Revision 1.11 2003/02/23 06:35:23 paulk
+;; Adds a variable jde-checkstyle-configuration-file to specify xml config file required
by Checkstyle 3.0.
+;; Thanks to Joshua Spiewak <JSpiewak(a)axeda.com>.
+;;
+;; Revision 1.10 2003/01/19 05:46:08 paulk
+;; Removed aliasing of jde-build-classpath to jde-run-build-classpath-arg. I don't
understand
+;; why that was done but it seems very bad for this file to change the definition of
+;; such an important function.
+;;
;; Revision 1.9 2002/12/21 09:06:22 paulk
;; Fix bug in generation of jde-checkstyle-option-lcurly-method option. Thanks to ABE
Yasushi.
;;
@@ -959,4 +487,4 @@ history enabled."
;;
;; Version: 1.0
-;;; JDE-CHECKSTYLE.EL ends here
\ No newline at end of file
+;;; JDE-CHECKSTYLE.EL ends here
1.3 +18 -1 XEmacs/packages/xemacs-packages/jde/lisp/jde-compat.el
Index: jde-compat.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-compat.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- jde-compat.el 2003/03/11 05:45:42 1.2
+++ jde-compat.el 2006/03/03 20:42:38 1.3
@@ -4,7 +4,7 @@
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -72,6 +72,8 @@
(defvar current-menubar nil)
(defvar tags-table-format-hooks nil)
(defvar windowed-process-io nil)
+ (unless (fboundp 'add-submenu)
+ (defun add-submenu (&rest args)))
(defun mswindows-cygwin-to-win32-path (&rest args))
(defun ange-ftp-ftp-name (&rest args))
(defun ange-ftp-get-file-entry (&rest args))
@@ -92,6 +94,7 @@
(if jde-emacs21p
(defvar browse-url-new-window-p nil))
+
;; Define XEmacs- and Emacs-only variables
;; and functions to avoid compiler warnings.
(if (not jde-xemacsp)
@@ -119,3 +122,17 @@
(` (defvar (, var) (, value) (, doc)))))
(provide 'jde-compat)
+
+;; Change History
+
+;;
+;; $Log: jde-compat.el,v $
+;; Revision 1.4 2003/10/23 03:57:11 paulk
+;; Added compatibility fix for older versions of XEmacs. Thanks to Len Trigg.
+;;
+;; Revision 1.3 2003/04/01 04:05:15 paulk
+;; Add change log to end of file.
+;;
+;;
+
+;; End of jde-compat.el
1.10 +211 -183 XEmacs/packages/xemacs-packages/jde/lisp/jde-compile.el
Index: jde-compile.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-compile.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- jde-compile.el 2003/01/18 05:48:43 1.9
+++ jde-compile.el 2006/03/03 20:42:38 1.10
@@ -1,11 +1,11 @@
;;; jde-compile.el -- Integrated Development Environment for Java.
-;; $Revision: 1.49 $ $Date: 2002/12/12 05:24:46 $
+;; $Revision: 1.57 $ $Date: 2003/07/15 11:56:23 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -40,6 +40,11 @@
(require 'cl)
(require 'compile)
+(defgroup jde-compile-options nil
+ "JDE Compiler Options"
+:group 'jde
+:prefix "jde-compile-option-")
+
;; (makunbound 'jde-compiler)
(defcustom jde-compiler '("javac server" "")
"Specify the type, and if necessary, the location of the compiler to
@@ -79,8 +84,7 @@ These arguments are appended to those sp
variables. The JDE maintains a history list of arguments
entered in the minibuffer."
:group 'jde-project
-:type 'boolean
-)
+:type 'boolean)
(defvar jde-interactive-compile-args ""
"String of compiler arguments entered in the minibuffer.")
@@ -129,6 +133,12 @@ were recompiled."
(frame-visible-p speedbar-frame))
(speedbar-refresh)))
+
+(defcustom jde-compile-jump-to-first-error t
+ "*Automatically jump to the first error when a compilation process
completes."
+:group 'jde-compile-options
+:type 'boolean)
+
;; Thanks to Jack Donohue <donohuej(a)synovation.com>.
(defun jde-compile-finish-kill-buffer (buf msg)
"Removes the jde-compile window after a few seconds if no errors."
@@ -137,18 +147,20 @@ were recompiled."
(if (null (or (string-match ".*exited abnormally.*" msg)
(string-match ".*BUILD FAILED.*" (buffer-string))))
;;no errors, make the compilation window go away in a few seconds
- (progn
+ (lexical-let ((compile-buffer buf))
(run-at-time
- "2 sec" nil 'delete-windows-on
- (get-buffer-create "*compilation*"))
+ "2 sec" nil 'jde-compile-kill-buffer
+ compile-buffer)
(message "No compilation errors"))
;;there were errors, so jump to the first error
- (next-error))))
+ (if jde-compile-jump-to-first-error (next-error)))))
-(defgroup jde-compile-options nil
- "JDE Compiler Options"
-:group 'jde
-:prefix "jde-compile-option-")
+(defun jde-compile-kill-buffer(buf)
+ (progn
+ (delete-windows-on buf)
+ (if jde-compile-enable-kill-buffer
+ (kill-buffer buf))))
+
(defcustom jde-compile-option-command-line-args nil
"*Specify options as a string of command-line arguments.
@@ -326,6 +338,29 @@ is used."
:group 'jde-compile-options
:type 'string)
+;;(makunbound 'jde-compile-option-source)
+(defcustom jde-compile-option-source (list "1.3")
+"*Enables support for compiling source code containing assertions.
+
+ 1.3 The compiler does not support assertions
+
+ 1.4 The compiler accepts code containing assertions.
+
+ The compiler defaults to the 1.3 behavior if the -source flag is not
+ used.
+
+ ***NOTE***
+
+ This option is supported only by the version of javac shipped
+ with JDK 1.4"
+:group 'jde-compile-options
+:type '(list
+ (radio-button-choice
+ :format "%t \n%v"
+ :tag "Source release:"
+ (const "1.3")
+ (const "1.4"))))
+
;;(makunbound 'jde-compile-option-target)
(defcustom jde-compile-option-target (list "1.1")
"*Generate class files that will work on VMs with the specified version.
@@ -343,6 +378,9 @@ The default is to generate class files t
Java 2 SDK, v 1.3 and later, but will not run
on 1.1 or 1.2 VMs
+ 1.4 Generate class files that are compatible only with
+ 1.4 VMs.
+
By default, classes are compiled against the bootstrap and extension classes
of the JDK that javac shipped with. But javac also supports cross-compiling,
where classes are compiled against a bootstrap and extension classes of a
@@ -356,7 +394,8 @@ cross-compiling."
:tag "Target VM:"
(const "1.1")
(const "1.2")
- (const "1.3"))))
+ (const "1.3")
+ (const "1.4"))))
(defcustom jde-compile-option-bootclasspath nil
"*Cross-compile against the specified set of boot classes.
@@ -384,12 +423,65 @@ source and class files.
:group 'jde-compile-options
:type 'boolean)
+(defcustom jde-compile-enable-kill-buffer nil
+ "* If true the 'jde-compile-finish-kill-buffer will kill the compilation
+buffer"
+:group 'jde-compile-options
+:type 'boolean)
+
(defun jde-compile-show-options-buffer ()
"Show the JDE Compile Options panel."
(interactive)
(customize-apropos "jde-compile-options" 'groups))
+(defclass jde-compile-server-buffer (bsh-compilation-buffer) ()
+ "Compiler server buffer.")
+
+(defmethod bsh-compilation-buffer-create-native-buffer ((this
jde-compile-server-buffer))
+ "Creates the native Emacs buffer for the JDEE compile server."
+ (oset this buffer-name "*JDEE Compile Server*")
+ (oset this buffer (get-buffer-create (oref this buffer-name))))
+
+(defclass jde-compile-exec-buffer (bsh-compilation-buffer) ()
+ "Compiler exec buffer.")
+
+(defmethod initialize-instance ((this jde-compile-exec-buffer) &rest fields)
+ "Constructor for exec compilation buffer instance."
+
+ (bsh-compilation-buffer-create-native-buffer this)
+
+ (oset
+ this
+ filter
+ (lexical-let ((this-buf this))
+ (lambda (process output)
+ (bsh-compilation-buffer-filter this-buf process output))))
+
+ (oset this process (get-buffer-process (oref this buffer)))
+
+ ;; Make sure this buffer is not associated with a compiler process that is
+ ;; already running.
+ (if (oref this process)
+ (if (or (not (eq (process-status (oref this process)) 'run))
+ (yes-or-no-p
+ "A compilation process is running; kill it?"))
+ (condition-case ()
+ (progn
+ (interrupt-process (oref this process))
+ (sit-for 1)
+ (delete-process (oref this process)))
+ (error nil))
+ (error "Cannot have two processes in `%s' at once"
+ (oref this buffer-name))))
+
+ (bsh-compilation-buffer-set-mode this))
+
+(defmethod bsh-compilation-buffer-create-native-buffer ((this jde-compile-exec-buffer))
+ "Creates the native Emacs buffer for the JDEE compile server."
+ (oset this buffer-name "*compilation*")
+ (oset this buffer (get-buffer-create (oref this buffer-name))))
+
(defclass jde-compile-compiler ()
((name :initarg :name
:type string
@@ -404,7 +496,7 @@ source and class files.
:documentation
"Path of the compiler executable.")
(buffer :initarg :buffer
- :type buffer
+ :type bsh-compilation-buffer
:documentation
"Compilation buffer")
(window :initarg :window
@@ -426,7 +518,7 @@ source and class files.
(let ((classpath
(if jde-compile-option-classpath
jde-compile-option-classpath
- jde-global-classpath))
+ (jde-get-global-classpath)))
(symbol
(if jde-compile-option-classpath
'jde-compile-option-classpath
@@ -559,6 +651,12 @@ source and class files.
(if (not (string= target "1.1"))
(list "-target" target))))
+(defmethod jde-compile-source-arg ((this jde-compile-compiler))
+ "Get compiler source argument for this compiler."
+ (let ((source (car jde-compile-option-source)))
+ (if (not (string= source "1.3"))
+ (list "-source" source))))
+
(defmethod jde-compile-get-args ((this jde-compile-compiler))
(append
(jde-compile-classpath-arg this)
@@ -576,76 +674,12 @@ source and class files.
(jde-compile-verbose-path-arg this)
(jde-compile-nowarn-arg this)
(jde-compile-target-arg this)
+ (jde-compile-source-arg this)
(jde-compile-command-line-args this)))
-(defmethod jde-compile-create-compilation-buffer ((this jde-compile-compiler))
- (save-excursion
- (let ((buf (get-buffer-create "*compilation*"))
- (error-regexp-alist compilation-error-regexp-alist)
- (enter-regexp-alist (if (not jde-xemacsp) compilation-enter-directory-regexp-alist))
- (leave-regexp-alist (if (not jde-xemacsp) compilation-leave-directory-regexp-alist))
- (file-regexp-alist (if (not jde-xemacsp) compilation-file-regexp-alist))
- (nomessage-regexp-alist (if (not jde-xemacsp) compilation-nomessage-regexp-alist))
- (parser compilation-parse-errors-function)
- (error-message "No further errors")
- (thisdir default-directory))
-
- (oset this :buffer buf)
-
- (set-buffer buf)
-
- ;; Make sure a compiler process is not
- ;; already running.
- (if (not (oref this :use-server-p))
- (let ((comp-proc (get-buffer-process (current-buffer))))
- (if comp-proc
- (if (or (not (eq (process-status comp-proc) 'run))
- (yes-or-no-p
- "A compilation process is running; kill it?"))
- (condition-case ()
- (progn
- (interrupt-process comp-proc)
- (sit-for 1)
- (delete-process comp-proc))
- (error nil))
- (error "Cannot have two processes in `%s' at once"
- (buffer-name))))))
-
- ;; In case the compilation buffer is current, make sure we get the global
- ;; values of compilation-error-regexp-alist, etc.
- (kill-all-local-variables)
-
- ;; Clear out the compilation buffer and make it writable.
- (setq buffer-read-only nil)
- (buffer-disable-undo (current-buffer))
- (erase-buffer)
- (buffer-enable-undo (current-buffer))
-
- (compilation-mode "Compilation")
-
- (set (make-local-variable 'compilation-parse-errors-function) parser)
- (set (make-local-variable 'compilation-error-message) error-message)
- (set (make-local-variable 'compilation-error-regexp-alist)
- error-regexp-alist)
- (if (not jde-xemacsp)
- (progn
- (set (make-local-variable 'compilation-enter-directory-regexp-alist)
- enter-regexp-alist)
- (set (make-local-variable 'compilation-leave-directory-regexp-alist)
- leave-regexp-alist)
- (set (make-local-variable 'compilation-file-regexp-alist)
- file-regexp-alist)
- (set (make-local-variable 'compilation-nomessage-regexp-alist)
- nomessage-regexp-alist)))
-; (set (make-local-variable 'compilation-arguments)
-; (list output error-message))
- (setq default-directory thisdir
- compilation-directory-stack (list default-directory))
- )))
-
(defmethod jde-compile-run-exec ((this jde-compile-compiler))
- (let* ((outbuf (oref this :buffer))
+ (let* ((outbuf (oref (oref this buffer) buffer))
(compiler-path (oref this :path))
(source-file (file-name-nondirectory buffer-file-name))
(flag nil)
@@ -690,63 +724,71 @@ source and class files.
(cons proc compilation-in-progress))))))
(defmethod jde-compile-run-server ((this jde-compile-compiler))
- (let* ((directory-sep-char ?/)
- (args
- (append
+
+
+ (let* ((directory-sep-char ?/)
+ (args
+ (append
(jde-compile-get-args this)))
- (source-path
- (jde-normalize-path buffer-file-name))
- (arg-array (concat "new String[] {\"" source-path
"\"")))
+ (source-path
+ (jde-normalize-path buffer-file-name))
+ (arg-array (concat "new String[] {\"" source-path
"\"")))
- (if args
- (setq arg-array
- (concat
- arg-array
- ","
- (mapconcat
- (lambda (arg)
- (concat "\"" arg "\""))
- args
- ","))))
+ (if args
+ (setq arg-array
+ (concat
+ arg-array
+ ","
+ (mapconcat
+ (lambda (arg)
+ (concat "\"" arg "\""))
+ args
+ ","))))
- (setq arg-array (concat arg-array "}"))
+ (setq arg-array (concat arg-array "}"))
- (let* ((w32-quote-process-args ?\")
- (win32-quote-process-args ?\") ;; XEmacs
- proc flag temp)
+
(save-excursion
- (set-buffer (oref this :buffer))
+ (set-buffer (oref (oref this buffer) buffer))
+
(insert "CompileServer output:\n")
- (insert "\n")
- (setq temp
- (mapconcat
- (lambda (x)
- (if (and flag
- jde-compile-option-hide-classpath)
- (progn
- (setq flag nil)
- "...")
- (if (not (string= x "-classpath"))
- x
- (progn
- (setq flag t)
- x)))) args " "))
-
- (insert temp " ")
- (insert source-path "\n")
- (if (not (bsh-running-p))
- (bsh-eval (jde-create-prj-values-str)))
- (setq proc (bsh-get-process))
- (setq jde-compile-comint-filter (process-filter proc))
- (set-process-filter proc 'jde-compile-filter)
- (process-send-string proc
- (concat
- (format
- "jde.util.CompileServer.compile(%s);"
- arg-array)
- "\n"))))))
+ (insert "\n")
+
+ (let (flag temp)
+ (setq temp
+ (mapconcat
+ (lambda (x)
+ (if (and flag
+ jde-compile-option-hide-classpath)
+ (progn
+ (setq flag nil)
+ "...")
+ (if (not (string= x "-classpath"))
+ x
+ (progn
+ (setq flag t)
+ x)))) args " "))
+
+ (insert temp " "))
+ (insert source-path "\n"))
+
+
+ (if (not (jde-bsh-running-p))
+ (progn
+ (bsh-launch (oref 'jde-bsh the-bsh))
+ (bsh-eval (oref 'jde-bsh the-bsh) (jde-create-prj-values-str))))
+ (bsh-buffer-eval
+ (oref 'jde-bsh the-bsh)
+ (concat
+ (format
+ "jde.util.CompileServer.compile(%s);"
+ arg-array)
+ "\n")
+ (oref this buffer))))
+
+
(defmethod jde-compile-launch ((this jde-compile-compiler))
(if (oref this :use-server-p)
@@ -757,67 +799,25 @@ source and class files.
(defmethod jde-compile-compile ((this jde-compile-compiler))
- (jde-compile-create-compilation-buffer this)
+ (if (oref this :use-server-p)
+ (oset this buffer (jde-compile-server-buffer "compilation buffer"))
+ (oset this buffer (jde-compile-exec-buffer "compilation buffer")))
+
;; Pop to compilation buffer.
- (let ((outwin (display-buffer (oref this :buffer))))
+ (let* ((outbuf (oref (oref this buffer) buffer))
+ (outwin (display-buffer outbuf)))
(compilation-set-window-height outwin)
- (oset this :window outwin))
+ (oset this :window outwin)
- (if (not jde-xemacsp)
- (if compilation-process-setup-function
+ (if (not jde-xemacsp)
+ (if compilation-process-setup-function
(funcall compilation-process-setup-function)))
- (jde-compile-launch this)
-
- (setq compilation-last-buffer (oref this :buffer)))
+ (jde-compile-launch this)
-(defun jde-compile-filter (proc string)
- "This filter prints out the result of the process without buffering.
-The result is inserted as it comes in the compilation buffer."
- (with-current-buffer (get-buffer "*compilation*")
- (let ((end-of-result (string-match ".*bsh % " string))
- (win (get-buffer-window "*compilation*"))
- output len (status " "))
- (save-excursion
- ;;Insert the text, advancing the process marker
- (goto-char (point-max))
- (if end-of-result
- (progn
- (setq output (substring string 0 end-of-result))
- (set-process-filter proc jde-compile-comint-filter)
- (set-buffer-modified-p nil)
-
- ;;Searching backwards for the status code
- (while (member status '(" " "\r" "\n"))
- (setq len (length output))
- (if (not (= len 0))
- (progn
- (setq status (substring output (- len 1)))
- (setq output (substring output 0 (- len 1))))
- (progn
- (setq status (buffer-substring (- (point-max) 1)
- (point-max)))
- (delete-region (- (point-max) 1) (point-max)))))
-
- (insert output)
- (compilation-handle-exit
- 'exit status
- (if (string= "0" status)
- "finished\n"
- (format "exited abnormally with code %s\n"
- status))))
- (insert string)))
- (if (not jde-xemacsp)
- (if compilation-scroll-output
- (save-selected-window
- (if win
- (progn
- (select-window win)
- (goto-char (point-max))))
- (sit-for 0)))))))
+ (setq compilation-last-buffer outbuf)))
-(defvar jde-compile-comint-filter nil)
(defclass jde-compile-javac (jde-compile-compiler)
()
@@ -1002,6 +1002,7 @@ The result is inserted as it comes in th
(jde-compile-debug-arg this)
(jde-compile-output-dir-arg this)
(jde-compile-deprecation-arg this)
+ (jde-compile-source-arg this)
(jde-compile-optimize-arg this)
(jde-compile-depend-arg this)
(jde-compile-verbose-arg this)
@@ -1160,6 +1161,33 @@ uses the compiler executable specified b
;; Change History
;; $Log: jde-compile.el,v $
+;; Revision 1.57 2003/07/15 11:56:23 paulk
+;; Update jde-compile-option-target.
+;;
+;; Revision 1.56 2003/04/08 03:16:28 paulk
+;; Fixes regression that causes compilation buffer's default directory to be set
incorrectly. Also rename compile server buffer from *compilation* to *JDEE Compile
Server*
+;;
+;; Revision 1.55 2003/04/05 06:26:19 paulk
+;; Added jde-compile-jump-to-first-error option. Thanks to Sean Wellington.
+;;
+;; Revision 1.54 2003/04/04 13:35:00 jslopez
+;; Adds the source argument to the jikes compiler.
+;;
+;; Revision 1.53 2003/03/04 10:12:50 paulk
+;; Updated the compile server to use the new compilation-mode buffer support
+;; provided by bsh class.
+;;
+;; Revision 1.52 2003/02/28 04:13:33 jslopez
+;; Adds customization variable jde-compile-enable-kill-buffer. If true the
+;; jde-compile-finish-kill-buffer hook will kill the compilation buffer.
+;;
+;; Revision 1.51 2003/02/17 08:13:05 paulk
+;; Changes required to support new package-independent version of beanshell.el
+;;
+;; Revision 1.50 2003/02/07 00:31:57 jslopez
+;; Adds jde-compile-option-source to be compile 1.4 code with
+;; the assert key word on it.
+;;
;; Revision 1.49 2002/12/12 05:24:46 paulk
;; Fixed bug that caused the compile command to fail when jikes
;; is the compiler and jde-compiler does not specify the path of the
1.8 +20 -12 XEmacs/packages/xemacs-packages/jde/lisp/jde-complete.el
Index: jde-complete.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-complete.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- jde-complete.el 2003/01/18 05:48:43 1.7
+++ jde-complete.el 2006/03/03 20:42:38 1.8
@@ -1,6 +1,6 @@
;; jde-complete.el -- Smart completion for the JDE
;;
-;; $Revision: 1.77 $
+;; $Revision: 1.80 $
;;
;; Author: Rodrigo Reyes <reyes(a)chez.com>
;; Maintainers: Rodrigo Reyes
@@ -12,7 +12,7 @@
;; Keywords: java, intellisense, completion
-;; Copyright (C) 1999, 2000, 2001, 2002 Rodrigo Reyes, Paul Kinnucan, David Ponce,
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003 Rodrigo Reyes, Paul Kinnucan,
;; Stephane Nicolas, David Ponce, Javier Lopez
;; This package follows the GNU General Public Licence (GPL), see the
@@ -472,6 +472,7 @@ classes for the access level."
(defun jde-complete-invoke-getClassInfo (name access)
"Invoke the method jde.util.Completion.getClassInfo(String, int)"
(bsh-eval-r
+ (oref 'jde-bsh the-bsh)
(format "jde.util.Completion.getClassInfo(\"%s\",%d);" name
access)))
@@ -944,19 +945,14 @@ You can override the info collecting par
(if jde-complete-display-signature
(eldoc-message jde-complete-current-signature)
(if (semantic-active-p)
- (progn
- (require 'eldoc)
- (require 'senator)
- (senator-eldoc-print-current-symbol-info)))))
+ (senator-eldoc-print-current-symbol-info))))
(defadvice eldoc-print-current-symbol-info (around jde activate)
"Enable ELDOC in non Emacs Lisp, but jde mode."
- (if (eq major-mode 'emacs-lisp-mode)
- ad-do-it
- (if (eq major-mode 'jde-mode)
- (if (eldoc-display-message-p)
- (jde-complete-eldoc-print-current-symbol-info))
- (eldoc-mode -1))))
+ (if (eq major-mode 'jde-mode)
+ (if (eldoc-display-message-p)
+ (jde-complete-eldoc-print-current-symbol-info))
+ ad-do-it))
(defun jde-complete-popup-message (message buffer-or-name)
"Split up the current window horizontally, the new buffer is exactly
@@ -1016,6 +1012,18 @@ all the other completions the cursor is
(provide 'jde-complete)
;; $Log: jde-complete.el,v $
+;; Revision 1.80 2003/06/07 04:03:01 paulk
+;; Prevent jde-mode from disabling the eldoc facility as
+;; soon as eldoc delays display of a message, which made semantic eldoc
+;; extensions practically unusable in Java buffers. Thanks to David Ponce.
+;;
+;; Revision 1.79 2003/02/25 05:32:32 paulk
+;; Fixes defadvice bug that disables eldoc-print-current-symbol-info
+;; in all modes but emacs-lisp-mode and jde-mode. Thanks to ABE Yasushi.
+;;
+;; Revision 1.78 2003/02/18 02:09:40 jslopez
+;; Fixes regression bugs.
+;;
;; Revision 1.77 2002/10/04 02:06:47 jslopez
;; Fixes logic building completion.
;;
1.11 +322 -173 XEmacs/packages/xemacs-packages/jde/lisp/jde-db.el
Index: jde-db.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-db.el,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- jde-db.el 2003/03/17 01:50:17 1.10
+++ jde-db.el 2006/03/03 20:42:38 1.11
@@ -1,11 +1,11 @@
;;; jde-db.el -- Debugger mode for jdb.
-;; $Revision: 1.8 $ $Date: 2003/01/18 05:48:43 $
+;; $Revision: 1.121 $ $Date: 2003/09/18 05:28:29 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 2000, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 2000, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -37,6 +37,11 @@
(require 'jde-parse)
(require 'eieio)
(require 'jde-util)
+(require 'widget)
+
+(eval-when-compile
+ (require 'wid-edit))
+
(unless (fboundp 'make-overlay)
(require 'overlay))
@@ -75,11 +80,6 @@ first line of the debuggee program."
:group 'jde-project
:type 'boolean)
-(defcustom jde-db-startup-commands nil
- "*Commands to run at debugger startup."
-:group 'jde-project
-:type '(repeat (string :tag "Command")))
-
(defcustom jde-db-read-vm-args nil
"*Read vm arguments from the minibuffer.
If this variable is non-nil, the jde-db command reads vm arguments
@@ -226,16 +226,45 @@ option is invalid for JDK verions greate
:group 'jde-db-options
:type 'string)
-;; (makunbound 'jde-db-option-connect-address)
-(defcustom jde-db-option-connect-address nil
- "Specify address used to connect the debugger to a running process.
-If nil, this option defaults to \"javadebug\" on Windows systems
-and \"4444\" on UNIX systems."
+
+;; (makunbound 'jde-db-option-connect-socket)
+(defcustom jde-db-option-connect-socket (list nil "4444")
+ "Specify address of socket to be used to connect the debugger and a
+debuggee process. Selecting \"Prompt\" from the customization value
+menu causes the debugger to prompt you to enter the shared memory name
+when you command it to attach to or listen for an existing
+process. Selecting \"Specify\" allows you to specify a default socket
+host and port to be used by the debugger. "
:group 'jde-db-options
:type '(choice
- (const :menu-tag "Use Default" nil)
- (string :menu-tag "Specify Value" :tag "value")))
+ (const :menu-tag "Prompt" nil)
+ (list
+ :menu-tag "Specify" :tag "Socket Address" :inline nil
+ (choice
+ :tag "Host"
+ (const :menu-tag "Local" nil)
+ (string :menu-tag "Remote" :tag "Name"))
+ (choice
+ :tag "Port"
+ (const :menu-tag "Default" "4444")
+ (string :menu-tag "Custom")))))
+
+
+
+;; (makunbound 'jde-db-option-connect-shared-memory-name)
+(defcustom jde-db-option-connect-shared-memory-name "javadebug"
+ "Specify name to use to establish a shared memory connection
+between the debugger and a debuggee process. Selecting \"Prompt\" from
+the customization value menu causes a debugger attach or listen
+command, e.g., `jde-jdb-attach-via-shared-memory', to prompt you to
+enter the shared memory name. Selecting \"Specify\" allows you to
+specify a name of your choosing."
+:group 'jde-db-options
+:type '(choice
+ (const :menu-tag "Prompt" nil)
+ (string :menu-tag "Specify" :tag "Name")))
+
(defcustom jde-db-option-vm-args nil
"*Specify arguments to be passed to the Java vm.
@@ -594,6 +623,98 @@ and sets the status of all breakpoints t
jde-db-breakpoints)
(setq jde-db-breakpoints nil))
+(defvar jde-db-bp-list nil)
+(defun jde-debug-list-breakpoints (&optional active)
+ "Brings a list of all set breakpoints. It allows the user to jump to a
+particular breakpoint and to select breakpoints to be clear."
+ (interactive "i")
+ (if jde-db-breakpoints
+ (progn
+ (switch-to-buffer "*Breakpoints List*")
+ (kill-all-local-variables)
+ (make-local-variable 'jde-db-bp-list)
+ (setq jde-db-bp-list nil)
+ (let ((inhibit-read-only t))
+ (erase-buffer))
+ (setq active (not active))
+ (widget-insert "Breakpoints:\n\n")
+ (mapc
+ (lambda (assoc)
+ (let* ((xbp (cdr assoc))
+ (id (oref xbp id))
+ (class (oref xbp class))
+ (file (oref xbp file))
+ (line (oref xbp line))
+ (status (oref xbp status)))
+ (widget-create
+ 'checkbox
+:notify (lambda (widget &rest ignore)
+ (if (widget-value widget)
+ (setq jde-db-bp-list
+ (delete (widget-get widget :id)
+ jde-db-bp-list))
+ (setq jde-db-bp-list
+ (append jde-db-bp-list
+ (list (widget-get widget :id))))))
+:id id
+ active)
+ (if (not active)
+ (setq jde-db-bp-list (append jde-db-bp-list (list id))))
+ (widget-insert " ")
+ (widget-create 'push-button
+:notify (lambda (widget &rest ignore)
+ (progn
+ (find-file-other-window
+ (widget-get widget :file))
+ (goto-line
+ (widget-get widget :line))))
+
+:button-face
+ (cond
+ ((eq status 'specified)
+ 'jde-db-spec-breakpoint-face)
+ ((eq status 'active)
+ 'jde-db-active-breakpoint-face)
+ (t 'jde-db-requested-breakpoint-face))
+:file file
+:line line
+ (format "%s:%d" class line))
+ (widget-insert "\n")))
+ jde-db-breakpoints)
+ (widget-insert "\n")
+ (widget-create 'push-button
+:notify (lambda (&rest ignore)
+ (jde-debug-list-breakpoints t))
+ "Clear All")
+ (widget-insert " ")
+ (widget-create 'push-button
+:notify (lambda (&rest ignore)
+ (progn
+ (jde-db-process-breakpoints)
+ (kill-buffer "*Breakpoints List*")))
+ "Apply Form")
+ (use-local-map widget-keymap)
+ (widget-insert "\n")
+ (widget-setup))
+ (message "No breakpoints")))
+
+(defun jde-db-process-breakpoints ()
+ "Deletes all the breakpoints found in `jde-db-bp-list'"
+ (if jde-db-bp-list
+ (if (jde-db-debuggee-running-p)
+ (let* ((debugger (oref 'jde-db-debugger the-debugger))
+ (bp-cmd (oref (oref debugger cmd-set) clear-bp)))
+ (oset
+ bp-cmd
+ breakpoints
+ (mapcar
+ (lambda (assoc)
+ (jde-db-find-breakpoint-by-id assoc))
+ jde-db-bp-list))
+ (jde-db-exec-cmd debugger bp-cmd))
+ (loop for bp-assoc in jde-db-bp-list do
+ (let ((bp (jde-db-find-breakpoint-by-id bp-assoc)))
+ (jde-db-delete-breakpoint bp))))))
(defun jde-db-breakpoints-add (bp)
"Adds this breakpoint to the list of breakpoints."
@@ -602,6 +723,14 @@ and sets the status of all breakpoints t
jde-db-breakpoints)))
+(defun jde-db-find-breakpoint-by-id (id)
+ "Finds the breakpoint object with ID"
+ (cdr (find-if
+ (lambda (assoc)
+ (let ((bp (cdr assoc)))
+ (= (oref bp id) id)))
+ jde-db-breakpoints)))
+
(defun jde-db-find-breakpoint (file line)
"Finds the breakpoint object for the breakpoint at FILE and LINE."
(cdr (find-if
@@ -717,7 +846,7 @@ class. Otherwise, it returns nil."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
-;; Debuggee Process Class ;;
+;; Debuggee Process Status Class ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defclass jde-db-debuggee-status ()
@@ -747,20 +876,77 @@ class. Otherwise, it returns nil."
;; Debuggee Process Class ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defclass jde-db-connector () ()
+ "Proxy for debugger connectors.")
+
+(defclass jde-db-launch-connector (jde-db-connector) ()
+ "Launched by the debugger.")
+
+(defclass jde-db-socket-connector (jde-db-connector)
+ ((port :initarg :port
+ :type (or null string)
+ :initform nil
+ :documentation
+ "Port to the debuggee process."))
+ "Connect via a socket.")
+
+(defclass jde-db-shared-memory-connector (jde-db-connector)
+ ((name :initarg :name
+ :type (or null string)
+ :initform nil
+ :documentation
+ "Shared memory name of debuggee process."))
+ "Connect via a shared-memory transport (Windows only).")
+
+
+(defclass jde-db-attach-connector (jde-db-connector) ()
+ "Attaches to debuggee.")
+
+(defclass jde-db-listen-connector (jde-db-connector) ()
+ "Listens for debuggee.")
+
+
+(defclass jde-db-socket-attach-connector (jde-db-socket-connector
+ jde-db-attach-connector)
+ ((host :initarg :host
+ :type (or null string)
+ :initform nil
+ :documentation
+ "Host on which the debuggee process runs."))
+ "Attach via a socket.")
+
+(defclass jde-db-shared-memory-attach-connector (jde-db-shared-memory-connector
+ jde-db-attach-connector)
+ ()
+ "Attach via a shared memory connection.")
+
+(defclass jde-db-socket-listen-connector (jde-db-socket-connector
+ jde-db-listen-connector)
+ ()
+ "Listen via a socket.")
+
+(defclass jde-db-shared-memory-listen-connector (jde-db-shared-memory-connector
+ jde-db-listen-connector)
+ ()
+ "Listen via a shared memory connection.")
+
+
(defclass jde-db-debuggee ()
((main-class :initarg :main-class
:type string
:documentation
"Qualified name of debuggee main class.")
- (address :initarg :address
- :type (or null string)
- :initform nil
+
+ (connector :initarg :connector
+ :type jde-db-connector
:documentation
- "String that identifies the vm to be debugged.")
+ "Type of connector between this debuggee and the debugger.")
+
(status :initarg :status
:type jde-db-debuggee-status
:documentation
"Status of debuggee process.")
+
(stack-depth :initarg :stack-depth
:type string
:initform ""
@@ -770,10 +956,7 @@ class. Otherwise, it returns nil."
(defmethod initialize-instance ((this jde-db-debuggee) &rest fields)
"Constructs an instance of a debuggee."
- (call-next-method)
- (assert (or (slot-boundp this 'main-class)
- (slot-boundp this 'address)))
- (oset this status (jde-db-debuggee-status "debuggee status")))
+ (call-next-method))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -821,6 +1004,18 @@ response to this command."
:documentation
"List of breakpoint specification."))
"Class of breakpoint commands.")
+
+(defclass jde-db-cmd-launch (jde-db-cmd)
+ ((main-class :initarg :main-class
+:type string
+:documentation
+ "Main class of applications to be debugged."))
+ "Launch a debuggee process.")
+
+(defmethod initialize-instance ((this jde-db-cmd-launch) &rest fields)
+ (call-next-method)
+ (oset this name "launch"))
+
;; Generic Debugger Command Set.
@@ -830,7 +1025,7 @@ response to this command."
:documentation
"Debugger that owns this command set.")
(launch :initarg :launch
- :type jde-db-cmd
+ :type jde-db-cmd-launch
:documentation
"Launch debuggee application")
(run :initarg :run
@@ -1307,148 +1502,24 @@ provides this option."
(defmethod jde-db-debugger-get-prog-args ((this jde-db-debugger))
)
+(defmethod jde-db-debugger-start ((this jde-db-debugger))
+ "Start the debugger.")
-(defmethod jde-db-debugger-start ((this jde-db-debugger) prog-args cmdstr)
- "Start the debugger."
- (let ((w32-quote-process-args ?\")
- (win32-quote-process-args ?\") ;; XEmacs
- (source-directory default-directory)
- (working-directory
- (jde-db-debugger-get-working-dir this)))
-
- (oset this :buffer (get-buffer-create (oref this :buffer-name)))
-
- (save-excursion
- (set-buffer (oref this :buffer))
- ;; Do not erase the last transcript; user may wish to view it.
- ;; (erase-buffer)
- (goto-char (point-max))
- (cd working-directory)
- (insert (concat "cd " working-directory "\n"))
- (insert cmdstr)
- (comint-mode)
- (make-local-variable 'comint-prompt-regexp)
- (setq comint-prompt-regexp "\\(^> *\\)\\|\\(^.*\\[[0-9]+\\] *\\)")
- (make-local-variable 'paragraph-start)
- (setq paragraph-start comint-prompt-regexp)
-
- (comint-exec (oref this :buffer)
- (oref this :buffer-name)
- (oref this :path)
- nil
- prog-args)
-
- (oset this process
- (get-buffer-process (oref this buffer)))
-
- (cd source-directory)
-
- (jde-db-set-process-filter this)
- (jde-db-set-process-sentinel this)
- (run-hooks 'jde-jdb-mode-hook)
- (pop-to-buffer (oref this buffer))
-
- (oset-default 'jde-db-debugger the-debugger this)
- (oset this running-p t))))
-
-(defmethod jde-db-debugger-launch ((this jde-db-debugger))
- "Launch the debugger."
- (if (or
- (not (slot-boundp this 'buffer))
- (not (oref this :buffer))
- (not (comint-check-proc (oref this :buffer))))
- (let* ((debuggee (oref this debuggee))
- (main-class (oref debuggee main-class))
- (source-directory default-directory)
- (working-directory
- (jde-db-debugger-get-working-dir this))
- (prog-args
- (jde-db-debugger-get-prog-args this))
- (command-string
- (concat
- (oref this :path) " "
- (jde-run-make-arg-string prog-args) "\n\n")))
-
- (oset this :buffer-name (concat "*debug" main-class "*"))
- (oset this :buffer (get-buffer-create (oref this :buffer-name)))
-
- (if jde-db-initial-step-p
- (let ((step-cmd (oref (oref this cmd-set) step-into)))
- (oset this next-cmd
- (append (oref this next-cmd) (list step-cmd)))))
-
- ;; Forward to the debugger any breakpoint requests made
- ;; by the user before launching the application.
- (if jde-db-breakpoints
- (let ((bp-cmd (oref (oref this cmd-set) set-bp)))
- (oset
- bp-cmd
- breakpoints
- (mapcar (lambda (assoc) (cdr assoc)) jde-db-breakpoints))
-
- (oset this next-cmd
- (append (oref this next-cmd) (list bp-cmd)))))
-
- (jde-db-debugger-start this prog-args command-string)
-
- (let* ((debuggee (oref this debuggee))
- (debuggee-status (oref debuggee status)))
- (oset debuggee-status running-p t)
- (oset debuggee-status stopped-p t)))
- (progn
- (message "An instance of %s is running." (oref this :buffer-name))
- (pop-to-buffer (oref this :buffer-name)))))
+(defmethod jde-db-debugger-launch ((this jde-db-debugger) main-class)
+ "Launch the application whose main class is MAIN-CLASS in debug mode.")
-(defmethod jde-db-debugger-connect ((this jde-db-debugger) &optional listenp)
- "Launch the debugger."
- (if (or
- (not (slot-boundp this 'buffer))
- (not (oref this :buffer))
- (not (comint-check-proc (oref this :buffer))))
- (let* ((debuggee (oref this debuggee))
- (source-directory default-directory)
- (address (oref debuggee :address))
- (working-directory
- (jde-db-debugger-get-working-dir this))
- (prog-args
- (if listenp
- (if address
- (list "-listen" address)
- (list "-listenany"))
- (list "-attach" address)))
- (command-string
- (format "%s %s\n\n"
- (oref this :path)
- (mapconcat (lambda (x) x) prog-args " "))))
-
- (oset this :buffer-name (concat "*debug " address "*"))
- (oset this :buffer (get-buffer-create (oref this :buffer-name)))
-
- ;; Forward to the debugger any breakpoint requests made
- ;; by the user before launching the application.
- (if jde-db-breakpoints
- (let ((bp-cmd (oref (oref this cmd-set) set-bp)))
- (oset
- bp-cmd
- breakpoints
- (mapcar (lambda (assoc) (cdr assoc)) jde-db-breakpoints))
-
- (oset this next-cmd
- (append (oref this next-cmd) (list bp-cmd)))))
-
- (jde-db-debugger-start this prog-args command-string)
-
- (let* ((debuggee (oref this debuggee))
- (debuggee-status (oref debuggee status)))
- (oset debuggee-status running-p t)
- (oset debuggee-status stopped-p t)))
- (progn
- (message "An instance of %s is running." (oref this :buffer-name))
- (pop-to-buffer (oref this :buffer-name)))))
+(defmethod jde-db-debugger-connect ((this jde-db-debugger) &optional listenp)
+ "Connect the debugger to an existing process.")
+(defun jde-db-get-the-debugger ()
+ "Get the currently selected debugger. This function
+returns an eieio object of type `jde-db-debugger'."
+ (if (string= (car jde-debugger) "JDEbug")
+ jde-dbs-the-debugger
+ (jde-jdb-get-jdb)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
@@ -1463,6 +1534,59 @@ provides this option."
;; existing jdb and JDEbug commands and replacing those commands
;; with the generalized commands.
+;;;###autoload
+(defun jde-debug ()
+ "Run the debugger specified by `jde-debugger' on the Java application
+whose source resides in the current buffer. This command determines
+the main class of the application either from the variable
+`jde-run-application-class' or from the source in the current
+buffer. If `jde-run-application-class' does not specify a class, the
+main class is assumed to be the class defined by the current source
+buffer. This command creates a command buffer for the debug session."
+ (interactive)
+
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;; This is a temporary hack until I
+ ;; wire up the JDEbug to this command.
+ (if (string= (car jde-debugger) "JDEbug")
+ (jde-bug-debug-app)
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ (let* ((debugger (jde-db-get-the-debugger))
+ (application-main-class
+ (let ((main-class jde-run-application-class))
+ (if (or
+ (not main-class)
+ (string= main-class ""))
+ (setq main-class
+ (if (buffer-file-name)
+ (concat (jde-db-get-package)
+ (file-name-sans-extension
+ (file-name-nondirectory (buffer-file-name))))
+ (read-string "Java class to debug: "))))
+ main-class))
+ (cmd-set (oref debugger cmd-set))
+ (launch-cmd (oref cmd-set launch)))
+
+
+ (oset launch-cmd main-class application-main-class)
+
+ (if (not (oref debugger running-p))
+ (jde-db-debugger-start debugger))
+
+ (oset-default 'jde-db-debugger the-debugger debugger)
+
+ ;; Forward to the debugger any breakpoint requests made
+ ;; by the user before launching the application.
+ (if jde-db-breakpoints
+ (let ((bp-cmd (oref (oref debugger cmd-set) set-bp)))
+ (oset
+ bp-cmd
+ breakpoints
+ (mapcar (lambda (assoc) (cdr assoc)) jde-db-breakpoints))
+ (jde-db-exec-cmds debugger (list launch-cmd bp-cmd)))
+ (jde-db-exec-cmd debugger launch-cmd)))))
+
+
(defun jde-debug-run ()
"Start the current debuggee application."
(interactive)
@@ -1640,11 +1764,7 @@ in the current buffer."
(setq bp (jde-db-spec-breakpoint))
(oset bp line line)
(jde-db-breakpoints-add bp))
- (if (and
- (jde-db-debuggee-running-p)
- (or
- (jde-db-debuggee-stopped-p)
- (jde-db-debuggee-suspended-p)))
+ (if (jde-db-debuggee-running-p)
(let* ((debugger (oref 'jde-db-debugger the-debugger))
(bp-cmd (oref (oref debugger cmd-set) set-bp)))
(oset bp-cmd breakpoints (list bp))
@@ -1658,11 +1778,7 @@ in the current buffer."
(line (jde-get-line-at-point))
(bp (jde-db-find-breakpoint file line)))
(if bp
- (if (and
- (jde-db-debuggee-running-p)
- (or
- (jde-db-debuggee-stopped-p)
- (jde-db-debuggee-suspended-p)))
+ (if (jde-db-debuggee-running-p)
(let* ((debugger (oref 'jde-db-debugger the-debugger))
(bp-cmd (oref (oref debugger cmd-set) clear-bp)))
(oset bp-cmd breakpoints (list bp))
@@ -1772,14 +1888,47 @@ matches FILE."
filename))
jde-sourcepath)))
-
(provide 'jde-db)
;; Change History
;; $Log: jde-db.el,v $
-;; Revision 1.8 2003/01/18 05:48:43 andyp
-;; sync to jde 2.3.2
+;; Revision 1.121 2003/09/18 05:28:29 paulk
+;; Created a set of proxie classes for standard JPDA connectors. Added
+;; a connector slot to jde-db-debuggee class. This is intended to
+;; support connecting a debugger to a debuggee class in attach or
+;; listen mode.
+;;
+;; Revision 1.120 2003/05/28 05:54:20 paulk
+;; Deleted definition of jde-db-startup-commands variable, which is no longer used.
+;;
+;; Revision 1.119 2003/05/14 06:36:42 paulk
+;; Replace jde-db-option-connect-address with jde-db-option-listen-address and
+;; jde-db-option-attach-address.
+;;
+;; Revision 1.118 2003/05/13 05:03:47 paulk
+;; Change the jde-db-option-connect-address variable so that a nil
+;; value means that the debugger attach and listen commands should
+;; prompt for a connect address.
+;;
+;; Revision 1.117 2003/03/28 05:33:29 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
+;; Revision 1.116 2003/02/26 03:30:52 jslopez
+;; Adds color to the list of breakpoints.
+;; The color correspond to the status of the breakpoint, active, speficied,
+;; or requested.
+;;
+;; Revision 1.115 2003/02/25 17:45:26 jslopez
+;; Removes the file name from the breakpoints list.
+;; Changes the format to class:line number.
+;;
+;; Revision 1.114 2003/02/25 06:53:29 paulk
+;; Created a generalized jde-debug command and wired it up to jdb.
+;; Next step is to wire it up to JDEbug.
+;;
+;; Revision 1.113 2003/01/12 19:15:20 jslopez
+;; Adds function jde-debug-list-breakpoints.
;;
;; Revision 1.112 2002/10/30 12:59:59 paulk
;; Fixed XEmacs compatibility fix for beginning/end-of-line functions
1.8 +45 -36 XEmacs/packages/xemacs-packages/jde/lisp/jde-dbo.el
Index: jde-dbo.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-dbo.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- jde-dbo.el 2003/01/18 05:48:44 1.7
+++ jde-dbo.el 2006/03/03 20:42:38 1.8
@@ -1,5 +1,5 @@
;;; jde-dbo.el -- JDEbug output functions
-;; $Revision: 1.37 $ $Date: 2002/12/19 22:19:06 $
+;; $Revision: 1.39 $ $Date: 2003/09/27 05:34:36 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
@@ -136,8 +136,21 @@ exception spec."
(oset jde-dbs-the-process-registry :target-process process)))
(message "Start Event Error: can't find process object for process id
%d" process-id))))
+(defun jde-dbo-break (process state-info state reason thread-id thread-name
+ message proc-id class file line-no)
+ (jde-dbs-proc-state-info-set state-info state reason
+ thread-id thread-name)
+ (setq jde-dbo-current-process process)
+ (setq jde-dbo-current-thread-id thread-id)
+ (if jde-bug-local-variables
+ (jde-dbo-update-locals-buf process
+ thread-id 0))
+ (if jde-bug-stack-info (jde-dbo-update-stack process thread-id))
+ (oset process steppablep t)
+ (jde-dbs-display-debug-message proc-id message)
+ (jde-db-set-debug-cursor class file line-no)
+ (when jde-bug-raise-frame-p (raise-frame)))
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Breakpoint Event Handler ;;
@@ -243,24 +256,10 @@ used in the last breakpoint hit event, a
(reason (nth 4 process-state))
(state-info (oref process state-info)))
(if state-info
- (progn
- (jde-dbs-proc-state-info-set state-info state reason
- thread-id thread-name)
- (setq jde-dbo-current-process process)
- (setq jde-dbo-current-thread-id thread-id)
- (if jde-bug-local-variables
- (jde-dbo-update-locals-buf process
- thread-id 0))
- (if jde-bug-stack-info (jde-dbo-update-stack process thread-id))
- (oset process steppablep t)
- (jde-dbs-display-debug-message
- process-id
- (format "Breakpoint hit at line %d in %s (%s) on thread %s. All threads
suspended."
- line-no class file thread-name))
- (jde-db-set-debug-cursor class file line-no)
- ;; (message (selected-frame))
- (when jde-bug-raise-frame-p (raise-frame))
- )
+ (jde-dbo-break process state-info state reason thread-id
+ thread-name
+ (format "Breakpoint hit at line %d in %s (%s) on thread
%s. All threads suspended." line-no class file thread-name)
+ process-id class file line-no)
(message "Breakpoint hit event error: state info object missing for process
%d." process-id)))
(message "Breakpoint hit event error: process object for process %d is
missing." process-id))))
@@ -277,21 +276,11 @@ used in the last breakpoint hit event, a
(reason (nth 4 process-state))
(state-info (oref process state-info)))
(if state-info
- (progn
- (jde-dbs-proc-state-info-set state-info state reason
- thread-id thread-name)
- (setq jde-dbo-current-process process)
- (setq jde-dbo-current-thread-id thread-id)
- (if jde-bug-local-variables
- (jde-dbo-update-locals-buf process
- thread-id 0))
- (if jde-bug-stack-info (jde-dbo-update-stack process thread-id))
- (oset process steppablep t)
- (jde-dbs-display-debug-message
- proc-id
- (format "Stepped to line %d in %s (%s) on thread %s. All threads suspended."
- line-no class file thread-name))
- (jde-db-set-debug-cursor class file line-no))
+ (jde-dbo-break process state-info state reason thread-id
+ thread-name
+ (format "Stepped to line %d in %s (%s) on thread %s. All
threads suspended."
+ line-no class file thread-name)
+ proc-id class file line-no)
(message "Step event error: state info missing for process %d" proc-id)))
(message "Step event error: could not find process %d." proc-id))))
@@ -305,11 +294,24 @@ used in the last breakpoint hit event, a
(thread-name (nth 2 process-state))
(state (nth 3 process-state))
(reason (nth 4 process-state))
+ (location (nth 5 process-state))
(state-info (oref process state-info)))
+ (if (not (equal status "none"))
+ ;; Then it's a break, not a trace
+ (let ((class (nth 1 (car location)))
+ (file (nth 2 (car location)))
+ (line-no (nth 3 (car location))))
+ (if state-info
+ (jde-dbo-break process state-info state reason thread-id
+ thread-name
+ (format "Exception encountered at line %d in %s
(%s) on thread %s. All threads suspended."
+ line-no class file thread-name)
+ proc-id class file line-no)
+ (message "Exception event error: state info missing for process
%d" proc-id)))
(jde-dbs-display-debug-message
proc-id
(format "Exception of class %s occurred on thread %s"
- exception-class thread-name))))))
+ exception-class thread-name)))))))
(defun jde-dbo-vm-disconnected-event (process-id process-status thread)
@@ -563,6 +565,13 @@ The remaining elements are arguments to
(provide 'jde-dbo)
;; $Log: jde-dbo.el,v $
+;; Revision 1.39 2003/09/27 05:34:36 ahyatt
+;; Exceptions should break when the user selects to suspend the thread as
+;; well (not just when the user selects to suspect all threads).
+;;
+;; Revision 1.38 2003/09/17 05:12:24 ahyatt
+;; Added exception breakpoints
+;;
;; Revision 1.37 2002/12/19 22:19:06 ahyatt
;; Fixed problem with nulls in the tree-view display
;;
1.10 +50 -14 XEmacs/packages/xemacs-packages/jde/lisp/jde-dbs.el
Index: jde-dbs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-dbs.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- jde-dbs.el 2003/01/18 05:48:44 1.9
+++ jde-dbs.el 2006/03/03 20:42:38 1.10
@@ -1,11 +1,11 @@
;;; jde-dbs.el -- JDEbug Session Interface Functions
-;; $Revision: 1.91 $ $Date: 2002/12/06 03:47:35 $
+;; $Revision: 1.95 $ $Date: 2003/05/06 05:25:05 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -75,6 +75,11 @@ to 0 to eliminate the connection delay."
(defvar jde-dbs-debugger-socket-process-name "jdebug-socket"
"Name of debugger socket process.")
+(defvar jde-dbs-debugger-hook nil
+ "Hook to run when starting or stopping the debugger.
+The hook is run with a single argument which is non-nil when the
+debugger is starting and nil when it is quitting.")
+
(defun jde-dbs-get-debugger-socket-process ()
(get-process jde-dbs-debugger-socket-process-name))
@@ -409,21 +414,34 @@ process-specific information about a bre
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; Debuggee Process Status ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defclass jde-dbs-proc-status (jde-db-debuggee-status)
+ ((startup-p :initarg :startupp
+:type boolean
+:initform nil
+:documentation
+ "Non-nil if this process is in the startup state.")
+ (steppable-p :initarg :steppablep
+:type boolean
+:initform nil
+:documentation
+ "Non-nil if this process can be single-stepped."))
+ "Status of process being debugged with JDEbug.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
-;; Application Process Class ;;
+;; Debuggee Process Class ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defclass jde-dbs-proc ()
+(defclass jde-dbs-proc (jde-db-debuggee)
((id :initarg :id
:type integer
:documentation
"Id assigned by the JDE.")
- (main-class :initarg :main-class
-:type string
-:documentation
- "Main class for this process.")
(cli-socket :initarg :cli-socket
:type integer
:documentation
@@ -838,7 +856,7 @@ for the breakpoint."
(goto-char (process-mark (get-buffer-process buffer)))
(insert-before-markers (concat message "\n"))))))
-(defmethod jde-dbs-debugger-start((this jde-dbs-debugger))
+(defmethod jde-dbs-debugger-start ((this jde-dbs-debugger))
"Starts the debugger."
(if (not (jde-dbs-debugger-running-p))
(let* ((debugger-buffer-name
@@ -893,6 +911,7 @@ for the breakpoint."
vm-args)
"\n\n"))
debugger-process)
+ (run-hook-with-args 'jde-dbs-debugger-hook t)
(oset this started-p nil)
(setq jde-dbs-debugger-output nil)
@@ -947,9 +966,12 @@ for the breakpoint."
(message "An instance of the debugger is running.")
(pop-to-buffer (jde-dbs-get-app-buffer-name))
nil))
-
+
+
+
(defmethod jde-dbs-debugger-quit ((debugger jde-dbs-debugger))
(jde-dbs-do-command -1 "quit")
+ (run-hook-with-args 'jde-dbs-debugger-hook nil)
(slot-makeunbound debugger :process)
(slot-makeunbound debugger :buffer)
(slot-makeunbound debugger :comint-filter))
@@ -960,6 +982,10 @@ for the breakpoint."
(oref jde-dbs-the-debugger started-p)
(comint-check-proc (oref jde-dbs-the-debugger buffer))))
+(defmethod jde-db-debugger-launch ((this jde-dbs-debugger) main-class)
+ "Launch the application whose main class is MAIN-CLASS in debug mode."
+ )
+
(defvar jde-dbs-the-debugger (jde-dbs-debugger "JDEbug")
"The debugger.")
@@ -1358,7 +1384,7 @@ debugger output following the Lisp form.
:initform ""
:documentation
"Command line arguments to be passed to app's main method."))
- "Class of launch-process commands.")
+ "Command to launch a debuggee process.")
(defun jde-dbs-get-app-buffer-name ()
(concat "*" (jde-run-get-main-class) "*"))
@@ -1870,9 +1896,6 @@ debugger output following the Lisp form.
line file (car (jde-dbo-command-result-data result))))
nil)))))
-
-
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Step Over/Into/Out Command Class ;;
@@ -3281,6 +3304,19 @@ object.")
(provide 'jde-dbs)
; $Log: jde-dbs.el,v $
+; Revision 1.95 2003/05/06 05:25:05 ahyatt
+; Removing last checkin, which was a mistake
+;
+; Revision 1.94 2003/05/06 04:50:07 ahyatt
+; Fixed problem with package variable, and the function to recursively delete a
directory.
+;
+; Revision 1.93 2003/03/28 05:33:29 andyp
+; XEmacs optimizations for JDEbug and efc.
+;
+; Revision 1.92 2003/02/25 06:53:29 paulk
+; Created a generalized jde-debug command and wired it up to jdb.
+; Next step is to wire it up to JDEbug.
+;
; Revision 1.91 2002/12/06 03:47:35 ahyatt
; Changes to support Mac OS X, which does not use tools.jar
;
1.2 +208 -83 XEmacs/packages/xemacs-packages/jde/lisp/jde-ejb.el
Index: jde-ejb.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-ejb.el,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- jde-ejb.el 2003/01/18 05:48:44 1.1
+++ jde-ejb.el 2006/03/03 20:42:39 1.2
@@ -1,11 +1,11 @@
;;; jde-ejb.el -- EJB Extensions to Integrated Development Environment for Java
-;; $Revision: 1.3 $
+;; $Revision: 1.5 $
;; Author: David T. Smith
-;; Maintainer: David T. Smith
+;; Maintainers: David T. Smith, Yoon Kyung Koo
;; Keywords: java, tools, ejb
-;; Copyright (C) 2002, David T. Smith
+;; Copyright (C) 2002, 2003, David T. Smith
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -34,10 +34,10 @@
(require 'jde-wiz)
(require 'jde-gen)
+(eval-and-compile
+ (setq current-ejb-name "")
+ (setq current-ejb-package ""))
-(setq current-ejb-name "")
-(setq current-ejb-package "")
-
(defun current-ejb-name ()
"Return the current EJB name used by all components"
current-ejb-name)
@@ -70,7 +70,29 @@ name portion of the filename string."
(file-name-sans-extension val))
(set-default sym val)))
+;; (makunbound 'jde-ejb-local-format)
+(defcustom jde-ejb-local-format "%sLocal.java"
+ "*Default format for EJB Local Interface"
+:type 'string
+:group 'jde-ejb
+:set '(lambda (sym val)
+ (set-default 'jde-ejb-local
+ (file-name-sans-extension val))
+ (set-default sym val)))
+;; (makunbound 'jde-ejb-local-home-format)
+(defcustom jde-ejb-local-home-format "%sLocalHome.java"
+ "*Default format for EJB LocalHome Interface
+Setting this also resets jde-ejb-local-home to the
+name portion of the filename string."
+:type 'string
+:group 'jde-ejb
+:set '(lambda (sym val)
+ (set-default 'jde-ejb-local-home
+ (file-name-sans-extension val))
+ (set-default sym val)))
+
+
;; (makunbound 'jde-ejb-class-format)
(defcustom jde-ejb-class-format "%sBean.java"
"*Default format for EJB Class.
@@ -98,17 +120,6 @@ name portion of the filename string."
(list
"(funcall jde-gen-boilerplate-function)"
"jde-ejb-package '>'n"
- "\"import java.rmi.RemoteException;\" '>'n"
- "\"/**\" '>'n"
- "\" * \""
- "(file-name-nondirectory buffer-file-name) '>'n"
- "\" *\" '>'n"
- "\" *\" '>'n"
- "\" * Created: \" (current-time-string) '>'n"
- "\" *\" '>'n"
- "\" * @author <a href=\\\"mailto:\" (eval user-mail-address)
\"\\\">\" (user-full-name)
\"</a>\"'>'n"
- "\" * @version\" '>'n"
- "\" */\" '>'n'"
"'>'n"
"\"public interface \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
@@ -122,7 +133,7 @@ name portion of the filename string."
;;;Add standard interface components for Remote Interface
"'>'n"
"\"}\">"
- "\"// \""
+ "\" // \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
"'>'n")
"*Template for new EJB Remote interface.
@@ -144,17 +155,6 @@ command `jde-ejb-remote', as a side-effe
(list
"(funcall jde-gen-boilerplate-function)"
"jde-ejb-package '>'n"
- "\"import java.rmi.RemoteException;\"'>'n"
- "\"/**\" '>'n"
- "\" * \""
- "(file-name-nondirectory buffer-file-name) '>'n"
- "\" *\" '>'n"
- "\" *\" '>'n"
- "\" * Created: \" (current-time-string) '>'n"
- "\" *\" '>'n"
- "\" * @author <a href=\\\"mailto:\" (eval user-mail-address)
\"\\\">\" (user-full-name)
\"</a>\"'>'n"
- "\" * @version\" '>'n"
- "\" */\" '>'n'"
"'>'n"
"\"public interface \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
@@ -168,7 +168,7 @@ command `jde-ejb-remote', as a side-effe
;;;Add standard interface components for Home Interface
"'>'n"
"\"}\">"
- "\"// \""
+ "\" // \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
"'>'n")
"*Template for new EJB Home interface.
@@ -185,27 +185,86 @@ command `jde-ejb-home', as a side-effect
"Insert a generic Java class buffer skeleton."))
(set-default sym val)))
+;;;;;;; start - by yoonforh 2003-01-15 17:09:14
+;; (makunbound 'jde-ejb-local-buffer-template)
+(defcustom jde-ejb-local-buffer-template
+ (list
+ "(funcall jde-gen-boilerplate-function)"
+ "jde-ejb-package '>'n"
+ "'>'n"
+ "\"public interface \""
+ "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
+ "\" extends javax.ejb.EJBLocalObject \""
+
+ "(if jde-gen-k&r "
+ " ()"
+ " '>'n)"
+ "\"{\"'>'n"
+
+;;;Add standard interface components for Remote Interface
+ "'>'n"
+ "\"}\">"
+ "\" // \""
+ "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
+ "'>'n")
+ "*Template for new EJB Local interface.
+This is the interface that contains all user methods.
+Setting this variable defines a template instantiation
+command `jde-ejb-local', as a side-effect."
+:group 'jde-ejb
+:type '(repeat string)
+:set '(lambda (sym val)
+ (defalias 'jde-ejb-local
+ (tempo-define-template "java-ejb-local-buffer-template"
+ (jde-gen-read-template val)
+ nil
+ "Insert a generic Java class buffer skeleton."))
+ (set-default sym val)))
+
+;; (makunbound 'jde-ejb-local-home-buffer-template)
+(defcustom jde-ejb-local-home-buffer-template
+ (list
+ "(funcall jde-gen-boilerplate-function)"
+ "jde-ejb-package '>'n"
+ "'>'n"
+ "\"public interface \""
+ "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
+ "\" extends javax.ejb.EJBLocalHome \""
+
+ "(if jde-gen-k&r "
+ " ()"
+ " '>'n)"
+ "\"{\"'>'n"
+
+;;;Add standard interface components for LocalHome Interface
+ "'>'n"
+ "\"}\">"
+ "\" // \""
+ "(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
+ "'>'n")
+ "*Template for new EJB LocalHome interface.
+This interface defines the create/find (for entity beans)/remove
+methods. Setting this variable defines a template instantiation
+command `jde-ejb-local-home', as a side-effect."
+:group 'jde-ejb
+:type '(repeat string)
+:set '(lambda (sym val)
+ (defalias 'jde-ejb-local-home
+ (tempo-define-template "java-ejb-local-home-buffer-template"
+ (jde-gen-read-template val)
+ nil
+ "Insert a generic Java class buffer skeleton."))
+ (set-default sym val)))
+
+;;;;;;;;;;; end - by yoonforh 2003-01-15 17:09:19
+
;; (makunbound 'jde-ejb-entity-bean-template)
(defcustom jde-ejb-entitiy-bean-template
(list
"(funcall jde-gen-boilerplate-function)"
"jde-ejb-package '>'n"
- "(jde-import-insert-imports-into-buffer "
- " (list \"javax.ejb.*\""
- " \"java.rmi.RemoteException\"))"
"'>"
-
- "\"/**\" '>'n"
- "\" * \""
- "(file-name-nondirectory buffer-file-name) '>'n"
- "\" *\" '>'n"
- "\" *\" '>'n"
- "\" * Created: \" (current-time-string) '>'n"
- "\" *\" '>'n"
- "\" * @author <a href=\\\"mailto:\" (eval user-mail-address)
\"\\\">\" (user-full-name)
\"</a>\"'>'n"
- "\" * @version\" '>'n"
- "\" */\" '>'n'"
"'>'n"
"\"public class \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
@@ -217,13 +276,28 @@ command `jde-ejb-home', as a side-effect
"\"{\"'>'n'n"
"'>'p'n"
+ "'>"
+ "(jde-gen-method-signature"
+ " \"public\""
+ " \"void\""
+ " \"ejbCreate\""
+ " nil"
+ " \"CreateException\""
+ " )"
+
+ "(if jde-gen-k&r "
+ " ()"
+ " 'n)"
+ "\"{\"'>'n"
+ "\"}\"'>'n 'n"
+
"(jde-gen-method-signature"
" \"public\""
" \"void\""
" \"ejbActivate\""
+ " nil"
" nil"
- " \"RemoteException\""
" )"
"'>"
@@ -240,7 +314,7 @@ command `jde-ejb-home', as a side-effect
" \"void\""
" \"ejbPassivate\""
" nil"
- " \"RemoteException\""
+ " nil"
" )"
"(if jde-gen-k&r "
@@ -254,8 +328,8 @@ command `jde-ejb-home', as a side-effect
" \"public\""
" \"void\""
" \"ejbLoad\""
+ " nil"
" nil"
- " \"RemoteException\""
" )"
"(if jde-gen-k&r "
@@ -269,8 +343,8 @@ command `jde-ejb-home', as a side-effect
" \"public\""
" \"void\""
" \"ejbStore\""
+ " nil"
" nil"
- " \"RemoteException\""
" )"
"(if jde-gen-k&r "
@@ -285,7 +359,7 @@ command `jde-ejb-home', as a side-effect
" \"void\""
" \"ejbRemove\""
" nil"
- " \"RemoteException\""
+ " \"RemoveException\""
" )"
"(if jde-gen-k&r "
@@ -300,7 +374,7 @@ command `jde-ejb-home', as a side-effect
" \"void\""
" \"setEntityContext\""
" \"EntityContext ctx\""
- " \"RemoteException\""
+ " nil"
" )"
"(if jde-gen-k&r "
@@ -314,8 +388,8 @@ command `jde-ejb-home', as a side-effect
" \"public\""
" \"void\""
" \"unsetEntityContext\""
+ " nil"
" nil"
- " \"RemoteException\""
" )"
"(if jde-gen-k&r "
@@ -324,7 +398,7 @@ command `jde-ejb-home', as a side-effect
"\"{\"'>'n"
"\"}\"'>'n 'n '>"
"\"}\">"
- "\"// \""
+ "\" // \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
"'>'n")
@@ -352,39 +426,25 @@ command `jde-ejb-entity-bean', as a side
(list
"(funcall jde-gen-boilerplate-function)"
"jde-ejb-package '>'n"
- "(jde-import-insert-imports-into-buffer "
- " (list \"javax.ejb.*\""
- " \"java.rmi.RemoteException\"))"
"'>"
-
- "\"/**\" '>'n"
- "\" * \""
- "(file-name-nondirectory buffer-file-name) '>'n"
- "\" *\" '>'n"
- "\" *\" '>'n"
- "\" * Created: \" (current-time-string) '>'n"
- "\" *\" '>'n"
- "\" * @author <a href=\\\"mailto:\" (eval user-mail-address)
\"\\\">\" (user-full-name)
\"</a>\"'>'n"
- "\" * @version\" '>'n"
- "\" */\" '>'n'"
"'>'n"
"\"public class \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
" \" implements SessionBean \" "
+ ;;we open the bracket according to k&r style or not
"(if jde-gen-k&r "
" ()"
" '>'n)"
"\"{\"'>'n'n"
"'>'p'n"
-
"(jde-gen-method-signature"
" \"public\""
" \"void\""
- " \"ejbActivate\""
+ " \"ejbCreate\""
" nil"
- " \"RemoteException\""
+ " \"CreateException\""
" )"
"'>"
@@ -398,9 +458,9 @@ command `jde-ejb-entity-bean', as a side
"(jde-gen-method-signature"
" \"public\""
" \"void\""
- " \"ejbPassivate\""
+ " \"ejbActivate\""
+ " nil"
" nil"
- " \"RemoteException\""
" )"
"'>"
@@ -414,9 +474,9 @@ command `jde-ejb-entity-bean', as a side
"(jde-gen-method-signature"
" \"public\""
" \"void\""
- " \"ejbRemove\""
+ " \"ejbPassivate\""
" nil"
- " \"RemoteException\""
+ " nil"
" )"
"'>"
@@ -430,9 +490,9 @@ command `jde-ejb-entity-bean', as a side
"(jde-gen-method-signature"
" \"public\""
" \"void\""
- " \"setSessionContext\""
- " \"SessionContext ctx\""
- " \"RemoteException\""
+ " \"ejbRemove\""
+ " nil"
+ " nil"
" )"
"'>"
@@ -446,12 +506,28 @@ command `jde-ejb-entity-bean', as a side
"(jde-gen-method-signature"
" \"public\""
" \"void\""
- " \"unsetSessionContext\""
+ " \"setSessionContext\""
+ " \"SessionContext ctx\""
" nil"
- " \"RemoteException\""
" )"
"'>"
+;; ;;we open the bracket according to k&r style or not
+;; "(if jde-gen-k&r "
+;; " ()"
+;; " 'n)"
+;; "\"{\"'>'n"
+;; "\"}\"'>'n 'n"
+
+;; "(jde-gen-method-signature"
+;; " \"public\""
+;; " \"void\""
+;; " \"unsetSessionContext\""
+;; " nil"
+;; " \"RemoteException\""
+;; " )"
+;; "'>"
+
;;we open the bracket according to k&r style or not
"(if jde-gen-k&r "
" ()"
@@ -460,7 +536,7 @@ command `jde-ejb-entity-bean', as a side
"\"}\"'>'n 'n"
"'>"
"\"}\">"
- "\"// \""
+ "\" // \""
"(file-name-sans-extension (file-name-nondirectory buffer-file-name))"
"'>'n")
@@ -484,8 +560,8 @@ command `jde-ejb-session-bean', as a sid
(defcustom jde-ejb-session-descriptor-buffer-template
(list
"\"<?xml version=\\\"1.0\\\"?>\"'n"
- "\"<!DOCTYPE ejb-jar PUBLIC \\\"-//Sun Microsystems, Inc.//DTD
Enterprise JavaBeans 1.1//EN\\\" \" "
- "\" \\\"file:///\" (jde-find-jde-data-directory)
\"lisp/ejb-jar_1_1.dtd\\\" > \"'>'n'n"
+ "\"<!DOCTYPE ejb-jar PUBLIC \\\"-//Sun Microsystems, Inc.//DTD
Enterprise JavaBeans 2.0//EN\\\" \" "
+ "\" \\\"http://java.sun.com/dtd/ejb-jar_2_0.dtd\\\" >
\"'>'n'n"
"\"<ejb-jar>\"'>'n"
"\"<enterprise-beans>\" '>'n"
"\"<session> \"'>'n"
@@ -498,6 +574,12 @@ command `jde-ejb-session-bean', as a sid
"\"<remote>\""
"(format \"%s.%s\" (current-ejb-package) (current-ejb-name))"
"\"</remote>\"'>'n"
+ "\"<local-home>\""
+ "(format (concat \"%s.\" jde-ejb-local-home) (current-ejb-package)
(current-ejb-name))"
+ "\"</local-home>\"'>'n"
+ "\"<local>\""
+ "(format (concat \"%s.\" jde-ejb-local) (current-ejb-package)
(current-ejb-name))"
+ "\"</local>\"'>'n"
"\"<ejb-class>\""
"(format \"%s.%s\" (current-ejb-package) (format jde-ejb-class
(current-ejb-name)))"
"\"</ejb-class>\"'>'n"
@@ -505,6 +587,9 @@ command `jde-ejb-session-bean', as a sid
"\"<transaction-type>Container</transaction-type>\"'>'n"
"\"</session>\"'>'n"
"\"</enterprise-beans>\"'>'n"
+ "\"<ejb-client-jar>\""
+ "(format \"%sClient.jar\" (current-ejb-name) )"
+ "\"</ejb-client-jar>\"'>'n"
"\"</ejb-jar>\"'>'n"
"'>'n")
"*Template for new EJB Session Bean Deployment Descriptor interface.
@@ -526,8 +611,8 @@ command `jde-ejb-session-descriptor', as
(defcustom jde-ejb-entity-descriptor-buffer-template
(list
"\"<?xml version=\\\"1.0\\\"?>\"'n"
- "\"<!DOCTYPE ejb-jar PUBLIC \\\"-//Sun Microsystems, Inc.//DTD
Enterprise JavaBeans 1.1//EN\\\" \" "
- "\" \\\"file:///\" (jde-find-jde-data-directory)
\"lisp/ejb-jar_1_1.dtd\\\" > \"'>'n'n"
+ "\"<!DOCTYPE ejb-jar PUBLIC \\\"-//Sun Microsystems, Inc.//DTD
Enterprise JavaBeans 2.0//EN\\\" \" "
+ "\" \\\"http://java.sun.com/dtd/ejb-jar_2_0.dtd\\\" >
\"'>'n'n"
"\"<ejb-jar>\"'>'n"
"\"<enterprise-beans>\" '>'n"
"\"<entity> \"'>'n"
@@ -540,11 +625,41 @@ command `jde-ejb-session-descriptor', as
"\"<remote>\""
"(format \"%s.%s\" (current-ejb-package) (current-ejb-name))"
"\"</remote>\"'>'n"
+ "\"<local-home>\""
+ "(format (concat \"%s.\" jde-ejb-local-home) (current-ejb-package)
(current-ejb-name))"
+ "\"</local-home>\"'>'n"
+ "\"<local>\""
+ "(format (concat \"%s.\" jde-ejb-local) (current-ejb-package)
(current-ejb-name))"
+ "\"</local>\"'>'n"
"\"<ejb-class>\""
"(format \"%s.%s\" (current-ejb-package) (format jde-ejb-class
(current-ejb-name)))"
"\"</ejb-class>\"'>'n"
+
"\"<persistence-type>Container</persistence-type>\"'>'n"
+ "\"<prim-key-class>\""
+ "(format \"%s.%sPK\" (current-ejb-package) (current-ejb-name))"
+ "\"</prim-key-class>\"'>'n"
+ "\"<reentrant>False</reentrant>\"'>'n"
"\"</entity>\"'>'n"
"\"</enterprise-beans>\"'>'n"
+ "\"<assembly-descriptor>\"'>'n"
+ "\"<container-transaction>\"'>'n"
+ "\"<method>\"'>'n"
+ "\"<ejb-name>\""
+ "(format jde-ejb-class (current-ejb-name))"
+ "\"</ejb-name>\"'>'n"
+ "\"<method-intf>Local</method-intf>\"'>'n"
+ "\"<method-name>*</method-name>\"'>'n"
+ "\"</method>\"'>'n"
+ "\"<method>\"'>'n"
+ "\"<ejb-name>\""
+ "(format jde-ejb-class (current-ejb-name))"
+ "\"</ejb-name>\"'>'n"
+
"\"<method-intf>Remote</method-intf>\"'>'n"
+ "\"<method-name>*</method-name>\"'>'n"
+ "\"</method>\"'>'n"
+
"\"<trans-attribute>Required</trans-attribute>\"'>'n"
+ "\"</container-transaction>\"'>'n"
+ "\"</assembly-descriptor>\"'>'n"
"\"</ejb-jar>\"'>'n"
"'>'n")
"*Template for new EJB Entity Bean Deployment Descriptor interface.
@@ -611,6 +726,10 @@ Bean-specific interactive function"
(jde-ejb-remote)
(find-file (jde-ejb-format-filename jde-ejb-home-format (current-ejb-name) ejb-dir ))
(jde-ejb-home)
+ (find-file (jde-ejb-format-filename jde-ejb-local-format (current-ejb-name) ejb-dir))
+ (jde-ejb-local)
+ (find-file (jde-ejb-format-filename jde-ejb-local-home-format (current-ejb-name)
ejb-dir ))
+ (jde-ejb-local-home)
(find-file (jde-ejb-format-filename jde-ejb-descriptor-format (current-ejb-name)
ejb-dir))
(funcall (intern-soft jde-desc))
(find-file (jde-ejb-format-filename jde-ejb-class-format (current-ejb-name) ejb-dir))
@@ -626,6 +745,12 @@ Bean-specific interactive function"
;;; Change History:
;; $Log: jde-ejb.el,v $
+;; Revision 1.5 2003/03/28 05:33:29 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
+;; Revision 1.4 2003/01/19 05:11:36 paulk
+;; Updated to reflect EJB 2.x. Thanks to Yoon Kyung Koo.
+;;
;; Revision 1.3 2002/12/02 14:38:17 jslopez
;; Changes current-ejb-name to a function from a macro to fix byte-compilation.
;;
1.9 +235 -71 XEmacs/packages/xemacs-packages/jde/lisp/jde-gen.el
Index: jde-gen.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-gen.el,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- jde-gen.el 2003/01/18 05:48:44 1.8
+++ jde-gen.el 2006/03/03 20:42:39 1.9
@@ -1,11 +1,11 @@
;;; jde-gen.el -- Integrated Development Environment for Java.
-;; $Revision: 1.59 $
+;; $Revision: 1.70 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 2000, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -1319,8 +1319,50 @@ command, `jde-gen-mouse-motion-listener'
"Insert skeleton mouse motion listener."))
(set-default sym val)))
+(defcustom jde-gen-change-listener-template
+ '(
+ "'& (P \"Component name: \")"
+ "\".addChangeListener(\" jde-gen-method-signature-padding-2 "
+ "\"new ChangeListener\" jde-gen-method-signature-padding-1
\"()\" '>"
+
+ ;;we open the bracket according to k&r style or not
+ "(if jde-gen-k&r "
+ " jde-gen-method-signature-padding-3"
+ " 'n)"
+ "\"{\"'>'n"
+
+ "(jde-gen-method-signature"
+ " \"public\""
+ " \"void\""
+ " \"stateChanged\""
+ " \"ChangeEvent e\""
+ " )"
+ "'>"
+ ;;we open the bracket according to k&r style or not
+ "(if jde-gen-k&r "
+ " ()"
+ " 'n)"
+ "\"{\"'>'n"
+ "\"}\"'>'n"
+
+ "\"}\" jde-gen-method-signature-padding-2
\");\"'>'n'>'n'>"
+ )
+ "*Template for generating a change listener.
+Setting this variable defines a template instantiation
+command, `jde-gen-change-listener', as a side-effect."
+:group 'jde-gen
+:type '(repeat string)
+:set '(lambda (sym val)
+ (defalias 'jde-gen-change-listener
+ (tempo-define-template
+ "java-change-listener"
+ (jde-gen-read-template val)
+ nil
+ "Insert skeleton change listener."))
+ (set-default sym val)))
+
(defcustom jde-gen-to-string-method-template
'(
"(end-of-line) '&"
@@ -2025,6 +2067,41 @@ skeleton session bean implementation fro
(set-default sym val)))
+;; (makunbound 'jde-gen-method-javadoc-comment)
+(defcustom jde-gen-method-javadoc-comment "template"
+ "Specifies the type of javadoc comment generated by
+the `jde-gen-method-template'. The choices are
+
+ * Template
+
+ Uses `jde-javadoc-autodoc-at-line' function to generate
+ the documentation.
+
+ * Inherit
+
+ Generates a javadoc comment containing only the
+ javadoc (@inheritDoc) tag. This tag causes javadoc
+ to copy the javadoc comment from the abstract
+ method that the generated method implements but
+ only if the javadoc for the abstract method is
+ also being generated.
+
+ * None
+
+ Specifies that the method template not generate
+ a javadoc comment. In this case, javadoc copies
+ the comment from the abstract method if its doc
+ is also being generated in the same run."
+:group 'jde-gen
+:type '(choice
+ (const :tag "Template" "template")
+ (const :tag "Inherit Tag" "inherit")
+ (const :tag "None" "none")))
+
+
+
+
+;; (makunbound 'jde-gen-method-template)
(defcustom jde-gen-method-template
'(
"(p \"Method modifiers: \" modifiers 'noinsert)"
@@ -2034,6 +2111,15 @@ skeleton session bean implementation fro
"(p \"Method exceptions: \" exceptions 'noinsert)"
"(p \"Method body: \" default-body 'noinsert)"
"(jde-gen-delete-preceding-whitespace) 'n 'n '> 'p"
+
+ ;; Insert inherit javadoc comment if specified.
+ "(if (string= jde-gen-method-javadoc-comment \"inherit\")"
+ "'(l \"/*\" 'n>"
+ "\"* (@inheritDoc)\" 'n>"
+ "\"*/\" 'n>"
+ "))"
+
+ ;; Insert method signature.
"(jde-gen-method-signature"
" (tempo-lookup-named 'modifiers)"
" (tempo-lookup-named 'return-type)"
@@ -2050,12 +2136,15 @@ skeleton session bean implementation fro
"\"{\"'>'n"
"(s default-body) '>'r'n"
"\"}\"'>'n'>"
+ "(if (string= jde-gen-method-javadoc-comment \"template\")"
"(progn (tempo-backward-mark) (beginning-of-line)"
- "(jde-javadoc-autodoc-at-line) nil)"
+ "(jde-javadoc-autodoc-at-line) nil))"
)
- "*Template for generating a method.
-Setting this variable defines a template instantiation
-command, `jde-gen-method', as a side-effect."
+ "*Template for generating a skeleton method. The
+`jde-gen-method-javadoc-comment' variable controls whether this
+template generates a javadoc comment for the method, and, if so, what
+kind of comment. Setting this variable defines a template
+instantiation command, `jde-gen-method', as a side-effect."
:group 'jde-gen
:type '(repeat string)
:set '(lambda (sym val)
@@ -2071,6 +2160,7 @@ command, `jde-gen-method', as a side-eff
(list (cons "Get Set Pair" 'jde-gen-get-set)
(cons "toString method" 'jde-gen-to-string-method)
(cons "Action Listener" 'jde-gen-action-listener)
+ (cons "Change Listener" 'jde-gen-change-listener)
(cons "Window Listener" 'jde-gen-window-listener)
(cons "Mouse Listener" 'jde-gen-mouse-listener)
(cons "Mouse Motion Listener" 'jde-gen-mouse-motion-listener)
@@ -2180,8 +2270,8 @@ Setting this variable to t, uses comment
;; (makunbound 'jde-gen-cflow-if)
(defcustom jde-gen-cflow-if
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"if\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 2)"
" '(l '> \"if\" jde-gen-conditional-padding-1 "
" \"(\" jde-gen-conditional-padding-2 (p \"if-clause: \"
clause)"
" jde-gen-conditional-padding-2 \")\""
@@ -2192,7 +2282,7 @@ Setting this variable to t, uses comment
" \"}\""
" (if jde-gen-comments "
" '(l \" // end of if (\" (s clause) \")\"))"
- " '>'n'> (c-indent-defun))"
+ " '>'n'>)"
" )"
)
"Skeleton if statement. To insert the if statement at point, type if
@@ -2208,8 +2298,8 @@ and then space. Note that abbrev mode mu
(defcustom jde-gen-cflow-else
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"else\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 4)"
" '(l '> \"else\""
" (if jde-gen-k&r "
" jde-gen-conditional-padding-3 "
@@ -2234,8 +2324,8 @@ and then space. Note that abbrev mode mu
(defcustom jde-gen-cflow-if-else
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"ife\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 3)"
" '(l '> \"if\" jde-gen-conditional-padding-1 "
" \"(\" jde-gen-conditional-padding-2 (p \"if-clause: \"
clause)"
" jde-gen-conditional-padding-2 \")\""
@@ -2273,8 +2363,8 @@ and then space. Note that abbrev mode mu
(defcustom jde-gen-cflow-else-if
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"eif\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 3)"
" '(l '> \"else if\" jde-gen-conditional-padding-1 "
" \"(\" jde-gen-conditional-padding-2 (p \"else-if-clause:
\" clause) "
" jde-gen-conditional-padding-2 \")\""
@@ -2302,8 +2392,8 @@ and then space. Note that abbrev mode mu
;; (makunbound 'jde-gen-cflow-while)
(defcustom jde-gen-cflow-while
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"while\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 5)"
" '(l '> \"while\" jde-gen-conditional-padding-1 "
" \"(\" jde-gen-conditional-padding-2 (p \"while-clause: \"
clause) "
" jde-gen-conditional-padding-2 \")\""
@@ -2314,7 +2404,7 @@ and then space. Note that abbrev mode mu
" \"}\""
" (if jde-gen-comments "
" '(l \" // end of while (\" (s clause) \")\"))"
- " '>'n'> (c-indent-defun))"
+ " '>'n'>)"
" )"
)
"Skeleton while statement. To insert the statement at point, type while
@@ -2330,8 +2420,8 @@ and then space. Note that abbrev mode mu
(defcustom jde-gen-cflow-for
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"for\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 3)"
" '(l '> \"for\" jde-gen-conditional-padding-1 "
" \"(\" jde-gen-conditional-padding-2 (p \"for-clause: \"
clause) "
" jde-gen-conditional-padding-2 \")\""
@@ -2358,8 +2448,8 @@ and then space. Note that abbrev mode mu
(defcustom jde-gen-cflow-for-i
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"fori\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 4)"
" '(l '> \"for\" jde-gen-conditional-padding-1 "
" \"(\" jde-gen-conditional-padding-2 \"int \" (p
\"variable: \" var) "
" \" = 0; \" (s var) \" < \" (p \"upper bound:
\" ub) \"; \" (s var) \"++\""
@@ -2381,7 +2471,6 @@ and then space. Note that abbrev mode mu
Note: `tempo-interactive' must be set to a non-nil value to be prompted
for variable name and upper-bounds information."
-
:group 'jde-gen
:type '(repeat string)
:set '(lambda (sym val)
@@ -2392,8 +2481,8 @@ Note: `tempo-interactive' must be set to
(defcustom jde-gen-cflow-for-iter
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"foriter\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 7)"
" '(l '> \"for\" jde-gen-conditional-padding-1 "
" \"(\" jde-gen-conditional-padding-2 \"Iterator \" (p
\"variable: \" var) "
" \" = \" (p \"collection: \" coll) \".iterator();
\""
@@ -2427,8 +2516,8 @@ Note: `tempo-interactive' must be set to
(defcustom jde-gen-cflow-switch
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"switch\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 6)"
" '(l '> \"switch\" jde-gen-conditional-padding-1 "
" \"(\" jde-gen-conditional-padding-2 (p \"switch-condition:
\" clause) "
" jde-gen-conditional-padding-2 \")\""
@@ -2461,8 +2550,8 @@ and then space. Note that abbrev mode mu
(defcustom jde-gen-cflow-case
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"case\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 4)"
" '(l 'n \"case \" (p \"value: \")
\":\"'>'n"
" '>'p'n" ;; point will end up here
" \"break;\"'>'n)"
@@ -2482,8 +2571,8 @@ and then space. Note that abbrev mode mu
;; (makunbound 'jde-gen-cflow-try-catch)
(defcustom jde-gen-cflow-try-catch
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"try\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 3)"
" '(l '> \"try \""
" (if jde-gen-k&r "
" ()"
@@ -2503,7 +2592,7 @@ and then space. Note that abbrev mode mu
" \"}\""
" (if jde-gen-comments "
" '(l \" // end of try-catch\"))"
- " '>'n'> (c-indent-defun))"
+ " '>'n'> )"
" )"
)
"Skeleton try-catch statement. To insert the statement at point, type try
@@ -2519,8 +2608,8 @@ and then space. Note that abbrev mode mu
(defcustom jde-gen-cflow-catch
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"catch\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 5)"
" '(l '> \"catch\" jde-gen-conditional-padding-1 "
" \"(\" jde-gen-conditional-padding-2 (p \"catch what: \"
clause) \" e\""
" jde-gen-conditional-padding-2 \")\""
@@ -2547,8 +2636,8 @@ and then space. Note that abbrev mode mu
(defcustom jde-gen-cflow-try-finally
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"try\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 4)"
" '(l '> \"try \""
" (if jde-gen-k&r "
" ()"
@@ -2593,8 +2682,8 @@ tryf and then space. Note that abbrev mo
(defcustom jde-gen-cflow-finally
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"finally\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 7)"
" '(l '> \"finally\""
" (if jde-gen-k&r "
" jde-gen-conditional-padding-3 "
@@ -2620,8 +2709,8 @@ and then space. Note that abbrev mode mu
(defcustom jde-gen-cflow-main
'(
- "(if (jde-parse-comment-or-quoted-p)"
- " '(l \"main\")"
+ "(unless (jde-parse-comment-or-quoted-p)"
+ "(delete-backward-char 4)"
" '(l '> "
" (jde-gen-method-signature"
" \"public static\""
@@ -2651,6 +2740,31 @@ and then space. Note that abbrev mode mu
(jde-gen-read-template val))
(set-default sym val)))
+(defun jde-gen-load-abbrev-templates ()
+ "Defines jde-mode abbrevs for the control flow templates."
+ (loop for template in jde-gen-abbrev-templates do
+ (let ((abbrev (car template))
+ (expansion(cdr template)))
+ (define-abbrev
+ local-abbrev-table
+ abbrev
+ abbrev ;; Hack (see note below)
+ expansion
+ 0)
+ (put expansion 'no-self-insert (not tempo-interactive)))))
+
+;; Note: the previous function uses the following hack to address the
+;; problem of preventing expansion of control flow abbreviations in
+;; comments and strings. The hack defines the abbreviation such that
+;; abbrev-mode replaces the abbreviation with itself, observing case,
+;; i.e., "if" is replaced with "if" and "If" is replaced
with "If".
+;; If the abbreviation is not in a string or comment, the template
+;; then erases the abbreviation and replaces it with the corresponding
+;; control flow expansion. If the abbreviation is in a string or
+;; comment, the template does nothing, simply leaving the abbreviation
+;; as the user typed it.
+
+
;;JUnit templates
(defvar jde-gen-junit-class-regexp
"\\(.*\\)Test.java"
@@ -2810,29 +2924,33 @@ more information, see
http://www.junit.o
"Insert JUnit test to suite."))
(set-default sym val)))
-(defun jde-gen-load-abbrev-templates ()
- "Defines jde-mode abbrevs for the control flow templates."
- (loop for template in jde-gen-abbrev-templates do
- (define-abbrev
- local-abbrev-table
- (car template) "" (cdr template) 0)))
-
(defun jde-gen-try-catch-wrapper (beg end)
"Wrap the region from BEG to END into a try/catch block.
BEG and END are modified so the region only contains complete lines."
(interactive "r")
- (jde-gen-generic-try-wrapper beg end "catch"))
+ (jde-gen-generic-wrapper beg end "try" "catch"))
(defun jde-gen-try-finally-wrapper (beg end)
"Wrap the region from BEG to END into a try/finally block.
BEG and END are modified so the region only contains complete lines."
(interactive "r")
- (jde-gen-generic-try-wrapper beg end "finally"))
+ (jde-gen-generic-wrapper beg end "try" "finally"))
+(defun jde-gen-if-wrapper (beg end)
+ "Wraps the region from beg to end into an if block."
+ (interactive "r")
+ (jde-gen-generic-wrapper beg end "if"))
+
+(defun jde-gen-if-else-wrapper (beg end)
+ "Wraps the region from beg to end into an if block."
+ (interactive "r")
+ (jde-gen-generic-wrapper beg end "if" "else"))
+
;;This code is a modified version of the method qflib-make-try-wrapper
-(defun jde-gen-generic-try-wrapper (beg end expr)
- "Wrap the region from BEG to END into a try/EXPR block.
-BEG and END are modified so the region only contains complete lines."
+(defun jde-gen-generic-wrapper (beg end expr1 &optional expr2)
+ "Wrap the region from BEG to END into a EXPR1 and EXPR2 block. if EXPR2 is
+nil it is omitted. BEG and END are modified so the region only contains
+complete lines."
(let ((to (make-marker))
indent-region-function)
(set-marker to
@@ -2845,7 +2963,10 @@ BEG and END are modified so the region o
(1+ (point)))))
(goto-char beg)
(beginning-of-line)
- (insert "try")
+ (insert expr1)
+ (if (string= expr1 "if")
+ (insert (concat jde-gen-conditional-padding-1
+ "(" jde-gen-conditional-padding-2 ")")))
(if jde-gen-k&r
(insert " ")
(insert "\n"))
@@ -2857,27 +2978,30 @@ BEG and END are modified so the region o
(indent-region (point) to nil)
(goto-char to)
(insert "}")
- (if jde-gen-k&r
- (insert jde-gen-conditional-padding-3)
- (insert "\n"))
- (if (string= expr "catch")
- (insert (concat "catch" jde-gen-conditional-padding-1
- "(" jde-gen-conditional-padding-2 " e"
- jde-gen-conditional-padding-2 ")"))
- (insert "finally"))
- (if jde-gen-k&r
- (insert jde-gen-conditional-padding-2)
- (insert "\n"))
- (insert "{\n}")
- (if jde-gen-comments
- (insert " // end of try-"
- (if (string= expr "catch")
- expr
- "finally")))
+ (if expr2
+ (progn
+ (if jde-gen-k&r
+ (insert jde-gen-conditional-padding-3)
+ (insert "\n"))
+ (if (string= expr2 "catch")
+ (insert (concat expr2 jde-gen-conditional-padding-1
+ "(" jde-gen-conditional-padding-2 " e"
+ jde-gen-conditional-padding-2 ")"))
+ (insert expr2))
+ (if jde-gen-k&r
+ (insert jde-gen-conditional-padding-3)
+ (insert "\n"))
+ (insert "{\n}")
+ (if jde-gen-comments
+ (insert " // end of " expr1
+ (if expr2
+ (concat "-" expr2))))))
(insert "\n")
(indent-region (marker-position to) (point) nil)
(goto-char to)
- (if (string= expr "catch")
+ (if (string= expr1 "if")
+ (search-backward (concat "(" jde-gen-conditional-padding-2
")")))
+ (if (string= expr2 "catch")
(search-forward "("))))
(provide 'jde-gen)
@@ -2891,6 +3015,7 @@ BEG and END are modified so the region o
;; jde-gen-get-set | | | |
;; jde-gen-inner-class | | | |
;; jde-gen-action-listener | | | |
+;; jde-gen-change-listener | | | |
;; jde-gen-window-listener | | | |
;; jde-gen-mouse-listener | | | |
;; jde-gen-mouse-motion-listener | | | |
@@ -2915,6 +3040,45 @@ BEG and END are modified so the region o
;; jde-gen-cflow-finally | | | |
;; $Log: jde-gen.el,v $
+;; Revision 1.70 2003/11/30 05:00:50 paulk
+;; Fix control flow templates to preserve case of unexpanded
+;; abbreviations in comments and strings.
+;;
+;; Revision 1.69 2003/09/22 03:14:55 paulk
+;; Restore missing parentheses.
+;;
+;; Revision 1.68 2003/09/22 02:44:04 paulk
+;; Fix bug that was causing an extraneous space to be inserted in the
+;; condition clause of control flow expansions, such as if. Thanks to
+;; Sandip Chitale.
+;;
+;; Revision 1.67 2003/09/01 03:04:23 paulk
+;; Updates docstring for jde-gen-method-template to document its
+;; dependence on the new jde-gen-method-javadoc-comment variable.
+;;
+;; Revision 1.66 2003/09/01 02:53:30 paulk
+;; Adds a customization variable, jde-gen-method-javadoc-comment,
+;; that enables you to specify the type of javadoc comment
+;; that the jde-gen-method-template generates for a skeleton method.
+;;
+;; Revision 1.65 2003/07/26 04:22:46 paulk
+;; Removed superfluous c-indent-function from control flow templates.
+;;
+;; Revision 1.64 2003/06/13 12:11:30 paulk
+;; Fix typo. Update copyright.
+;;
+;; Revision 1.63 2003/03/03 14:51:26 jslopez
+;; Fixes a few formatting problems with jde-gen-generic-wrapper.
+;;
+;; Revision 1.62 2003/03/01 00:04:29 jslopez
+;; Add jde-gen-if-wrapper and jde-gen-if-else-wrapper.
+;;
+;; Revision 1.61 2003/02/17 21:39:43 jslopez
+;; Fixes bug with jde-gen-change-listener-template.
+;;
+;; Revision 1.60 2003/01/21 14:15:53 jslopez
+;; Adds jde-gen-change-listener template.
+;;
;; Revision 1.59 2002/12/19 06:36:00 paulk
;; Changed to permit autoloading of jde-package.el file.
;;
1.8 +83 -64 XEmacs/packages/xemacs-packages/jde/lisp/jde-help.el
Index: jde-help.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-help.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- jde-help.el 2003/01/18 05:48:44 1.7
+++ jde-help.el 2006/03/03 20:42:39 1.8
@@ -1,11 +1,11 @@
;;; jde-help.el
-;; $Revision: 1.60 $
+;; $Revision: 1.64 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>, Phillip Lord
<plord(a)hgmp.mrc.ac.uk>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1999, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1999, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -267,18 +267,18 @@ documented."
(condition-case err
(let* ((parse-result (jde-help-parse-symbol-at-point))
(unqualified-name (thing-at-point 'symbol))
- (class-name (jde-parse-get-qualified-name unqualified-name))
+ (class-name (jde-parse-get-qualified-name unqualified-name t))
(pair (jde-parse-java-variable-at-point)))
(if (not class-name)
(if parse-result
(progn
(setq unqualified-name (car parse-result))
- (setq class-name (jde-parse-get-qualified-name unqualified-name)))))
+ (setq class-name (jde-parse-get-qualified-name unqualified-name t)))))
(if class-name
(jde-help-symbol-internal class-name (cdr parse-result))
(if (not (string= (car pair) ""))
(progn
- (setq class-name (jde-parse-get-qualified-name (car pair)))
+ (setq class-name (jde-parse-get-qualified-name (car pair) t))
(jde-help-symbol-internal class-name unqualified-name))
(message "Error: cannot find class '%s' on the current
classpath." unqualified-name))))
(error
@@ -331,12 +331,7 @@ browser to DOCFILE. This is a workaround
that the default browser function for Windows uses the Windows
ShellExecute function to invoke Internet Explorer and for some reason
ShellExecute does not pass the anchor to IE."
- (let* ((temp-directory
- (or (if (boundp 'temporary-file-directory) temporary-file-directory)
- (if (fboundp 'temp-directory) (temp-directory)
- (if (member system-type '(cygwin32 cygwin))
- (jde-cygwin-path-converter-cygpath (temp-directory))
- (temp-directory)))))
+ (let* ((temp-directory (jde-temp-directory))
(metafile (expand-file-name "jde_meta.html" temp-directory))
(buff (find-file-noselect metafile nil t))
(standard-output buff)
@@ -350,31 +345,33 @@ ShellExecute does not pass the anchor to
(erase-buffer)
(if jde-help-use-frames
(progn
- (princ "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0
Transitional//EN\"\"http://www.w3.org/TR/REC-html40/loose.dtd\&...)
- (princ "<HTML>\n")
- (princ "<FRAMESET cols=\"20%,80%\">\n")
- (princ "<FRAMESET rows=\"30%,70%\">\n")
+ (princ "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01
Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">\n")
+ (princ "<html>\n<head>\n")
+ (princ "<title>JDE javadoc
window</title>\n</head>\n")
+ (princ "<frameset cols=\"20%,80%\"
onload=\"window.focus()\">\n")
+ (princ "<frameset rows=\"30%,70%\">\n")
(princ
- (format "<FRAME src=\"%soverview-frame.html\"
name=\"packageListFrame\">\n"
+ (format "<frame src=\"%soverview-frame.html\"
name=\"packageListFrame\">\n"
root))
(princ
- (format "<FRAME src=\"%spackage-frame.html\"
name=\"packageFrame\">\n"
+ (format "<frame src=\"%spackage-frame.html\"
name=\"packageFrame\">\n"
(substring docfile 0 pos)))
(princ
- (format "<FRAME src=\"%sallclasses-frame.html\"
name=\"packageFrame\">\n"
+ (format "<frame src=\"%sallclasses-frame.html\"
name=\"packageFrame\">\n"
root))
- (princ "</FRAMESET>\n")
+ (princ "</frameset>\n")
(princ
- (format "<FRAME src=\"%s\"
name=\"classFrame\">\n"
+ (format "<frame src=\"%s\"
name=\"classFrame\">\n"
(jde-file-to-url anchor)))
- (princ "</FRAMESET>\n")
- (princ "</HTML>\n"))
+ (princ "</frameset>\n")
+ (princ "</html>\n"))
(progn
- (princ "<HTML>\n<HEAD>\n")
+ (princ "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML
4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n")
+ (princ "<html>\n<head>\n")
(princ
- (format "<META HTTP-EQUIV=Refresh CONTENT=\"0;
URL=%s\">\n"
+ (format "<meta http-equiv=\"Refresh\" content=\"0;
URL=%s\">\n"
(jde-file-to-url anchor)))
- (princ "</HEAD>\n</HTML>")))
+ (princ "</head>\n<body
onload=\"window.focus()\">\n</body>\n</html>")))
(save-buffer)
(kill-buffer buff)
(jde-help-show-document metafile))
@@ -427,54 +424,76 @@ for CLASS actually documents the selecte
(jde-help-show-class-member-doc doc-file member)))
(message "Error: cannot find documentation for %s" fq-class-name))))
+
+(defun jde-help-get-jdk-doc-url ()
+ "Gets a URL for the JDK documentation."
+ (cond
+ ((string= jde-jdk-doc-url "")
+ (let ((path (expand-file-name "docs/index.html" (jde-get-jdk-dir))))
+ (if (file-exists-p path)
+ path
+ (error "Cannot find JDK documentation at default location: "
+ path))))
+ ((string-match "http:" jde-jdk-doc-url)
+ (if (or (and
+ (fboundp 'url-file-exists)
+ (not (url-file-exists jde-jdk-doc-url)))
+ (and
+ (executable-find (if (eq system-type 'windows-nt) "wget.exe"
"wget"))
+ (not (string-match "200"
+ (shell-command-to-string
+ (concat "wget --spider " jde-jdk-doc-url))))))
+ (error "JDK doc does not exist at jde-jdk-doc-url value: %s"
jde-jdk-doc-url))
+ jde-jdk-doc-url)
+ ((string-match "file://" jde-jdk-doc-url)
+ (let ((path (substring jde-jdk-doc-url 7)))
+ (if (file-exists-p path)
+ path
+ (error "JDK doc does not exist at jde-jdk-doc-url value file://%s" path))))
+ ((not (string-match jde-jdk-doc-url ""))
+ (let ((path (jde-normalize-path jde-jdk-doc-url)))
+ (if (file-exists-p path)
+ path
+ (error "JDK doc does not exist at jde-jdk-doc-url value %s" path))))
+ (t
+ (let ((path (expand-file-name "docs/index.html"
+ (jde-normalize-path (jde-get-jdk-dir)))))
+ (if (file-exists-p path)
+ path
+ (error "Cannot find JDK doc. Please set jde-jdk-directory or
jde-jdk-doc-url"))))))
+
;;;###autoload
(defun jde-help-browse-jdk-doc ()
"Displays the JDK doc in a web browser. This function uses the URL
stored in the variable jde-jdk-doc-url to locate the JDK documentation."
(interactive)
- (let ((url
- (cond
- ((string= jde-jdk-doc-url "")
- (let ((path (expand-file-name "docs/index.html" (jde-get-jdk-dir))))
- (if (file-exists-p path)
- path
- (error "Cannot find JDK documentation at default location: "
- path))))
- ((string-match "http:" jde-jdk-doc-url)
- (if (or (and
- (fboundp 'url-file-exists)
- (not (url-file-exists jde-jdk-doc-url)))
- (and
- (executable-find (if (eq system-type 'windows-nt) "wget.exe"
"wget"))
- (not (string-match "200"
- (shell-command-to-string
- (concat "wget --spider " jde-jdk-doc-url))))))
- (error "JDK doc does not exist at jde-jdk-doc-url value: %s"
jde-jdk-doc-url))
- jde-jdk-doc-url)
- ((string-match "file://" jde-jdk-doc-url)
- (let ((path (substring jde-jdk-doc-url 7)))
- (if (file-exists-p path)
- path
- (error "JDK doc does not exist at jde-jdk-doc-url value file://%s"
path))))
- ((not (string-match jde-jdk-doc-url ""))
- (let ((path (jde-normalize-path jde-jdk-doc-url)))
- (if (file-exists-p path)
- path
- (error "JDK doc does not exist at jde-jdk-doc-url value %s" path))))
- (t
- (let ((path (expand-file-name "docs/index.html"
- (jde-normalize-path (jde-get-jdk-dir)))))
- (if (file-exists-p path)
- path
- (error "Cannot find JDK doc. Please set jde-jdk-directory or
jde-jdk-doc-url")))))))
- (browse-url url
- (if (boundp 'browse-url-new-window-flag)
- browse-url-new-window-flag
- browse-url-new-window-p))))
+ (browse-url
+ (jde-help-get-jdk-doc-url)
+ (if (boundp
+ 'browse-url-new-window-flag)
+ browse-url-new-window-flag
+ browse-url-new-window-p)))
+
(provide 'jde-help)
;; $Log: jde-help.el,v $
+;; Revision 1.64 2003/08/28 05:18:15 paulk
+;; Add jde-help-get-jdk-doc-url function.
+;;
+;; Revision 1.63 2003/07/15 01:25:06 paulk
+;; Use jde-temp-directory to get directory for temporary files.
+;;
+;; Revision 1.62 2003/02/25 15:01:02 jslopez
+;; Modifies jde-parse-get-qualified-name to take an extra parameters.
+;; If it does not find the qualified name it tries importing the class.
+;; And updates a few places where it is call to do that.
+;;
+;; Revision 1.61 2003/01/12 05:52:44 paulk
+;; Some HTML validity tweaks to jde_meta.html and add window.focus() so the
+;; browser window gets raised when new content is loaded into it.
+;; Thanks to Ville Skyttä <scop(a)xemacs.org>.
+;;
;; Revision 1.60 2002/12/14 04:36:10 paulk
;; The jde-help-show-class-member-doc now opens the jde-metafile.html helper file as a
raw file. This avoids loading any html modes associated with html files on a user's
system. This in turn fixes a bug whereby displaying JAVA API doc triggers loading of
html32-mode which in turn turns on transient mark mode. Thanks to James Cox for this fix.
;;
1.7 +8 -2 XEmacs/packages/xemacs-packages/jde/lisp/jde-imenu.el
Index: jde-imenu.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-imenu.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- jde-imenu.el 2003/01/18 05:48:44 1.6
+++ jde-imenu.el 2006/03/03 20:42:39 1.7
@@ -1,5 +1,5 @@
;;; jde-imenu.el --- imenu setup for the JDE
-;; $Revision: 1.5 $
+;; $Revision: 1.6 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>,
;; David Ponce <david(a)dponce.com>
@@ -417,7 +417,10 @@ This function uses the semantic bovinato
;; semantic overloaded functions
(semantic-install-function-overrides
- '((prototype-nonterminal . jde-imenu-prototype-nonterminal)))
+ (if (fboundp 'semantic-format-tag-prototype)
+ '((format-tag-prototype . jde-imenu-prototype-nonterminal))
+ '((prototype-nonterminal . jde-imenu-prototype-nonterminal))
+ ))
;; function to use for creating the imenu
(setq imenu-create-index-function
@@ -433,6 +436,9 @@ This function uses the semantic bovinato
(provide 'jde-imenu)
;; $Log: jde-imenu.el,v $
+;; Revision 1.6 2003/09/21 03:35:37 paulk
+;; (jde-imenu-setup): Install correct override for Semantic 2.0. Submitted by David
Ponce.
+;;
;; Revision 1.5 2002/09/16 04:42:55 paulk
;; XEmacs compatibility fix: added require statement for regexp-opt package.
;;
1.8 +172 -92 XEmacs/packages/xemacs-packages/jde/lisp/jde-import.el
Index: jde-import.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-import.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- jde-import.el 2003/01/18 05:48:45 1.7
+++ jde-import.el 2006/03/03 20:42:39 1.8
@@ -1,15 +1,15 @@
;; jde-import.el --- Organize Java imports
-;; Copyright (C) 2000, 2001, 2002 by David Ponce
+;; Copyright (C) 2000, 2001, 2002, 2003 by David Ponce
;; Authors: David Ponce <david(a)dponce.com>
;; Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainers: David Ponce <david(a)dponce.com>
;; Paul Kinnucan <paulk(a)mathworks.com>
;; Created: 15 Nov 2000
-;; Version: $Revision: 1.21 $
+;; Version: $Revision: 1.33 $
;; Keywords: java, tools
-;; VC: $Id: jde-import.el,v 1.21 2002/09/06 13:07:12 jslopez Exp $
+;; VC: $Id: jde-import.el,v 1.33 2003/09/22 02:56:24 paulk Exp $
;; This file is not part of Emacs
@@ -43,16 +43,21 @@
;;;;
;; begin JVL enhancement contributed by Jim LoVerde <loverde(a)str.com>
-(defcustom jde-import-excluded-packages '("bsh.*")
+(defcustom jde-import-excluded-packages
+ '("^bsh\\..*" "^java\\.lang\\.[^.]*$"
jde-import-exclude-current-package)
"*Specifies classes that should not be imported into a source file.
-The value of this variable should be a regular expression. The
-`jde-import-find-and-import' command does not import any classes whose
-fully qualified names match the regular expression. If more than one
-fully qualified class name matches the unqualified name that you specify,
-the command prompts you to select only the classes that do not match the
-regular expression."
+The value of this variable should be either a regular expression or a function
+whose only argument is the fully qualified class name.
+The `jde-import-find-and-import' command excludes any classes whose
+fully qualified name matches the regular expression or the test function
+returns non-nil for the fully qualified name.
+If more than one fully qualified class name matches the unqualified name that you
specify,
+the command prompts you to select only the classes that are not excluded."
:group 'jde-project
-:type '(repeat (string :tag "Package")))
+:type '(repeat
+ (choice :tag "Exclude Rule"
+ (regexp :tag "Regexp")
+ (function :tag "Exclude test function"))))
;; end JVL enhancement contributed by Jim LoVerde <loverde(a)str.com>
;; auto sorting of import statements
@@ -141,6 +146,14 @@ inserted."
:group 'jde-project
:type 'boolean)
+(defun jde-import-exclude-current-package (import)
+ "Returns non-nil if the given fully qualified class name belongs to
+the current package."
+ (if (jde-parse-get-package-name)
+ (string-match
+ (concat (regexp-quote (jde-parse-get-package-name)) "\\.[^.]*$")
+ import)))
+
(defun jde-import-get-imports()
(let ((import-re "import[ ]+\\(.*\\)[ ]*;")
(imports nil))
@@ -196,7 +209,7 @@ from any point in the buffer. The functi
statement for the specified class alrady exists."
(interactive
"sClass: ")
- (jde-import-insert-imports (list class)))
+ (jde-import-insert-import (list class)))
;; Contributed by David Ponce <david_ponce(a)mail.schneider.fr>
(defun jde-import-sort (&optional reverse)
@@ -232,8 +245,7 @@ semantic Java parser and requires JDE 2.
(goto-char start)))))))
-;; begin JVL enhancement contributed by Jim LoVerde <loverde(a)str.com>
-(defun jde-import-find-and-import (class)
+(defun jde-import-find-and-import (class &optional no-errors)
"*Insert an import statement for a class in the current buffer.
CLASS is an unqualified class name. This function searches
the classpath for a class (or classes) that match CLASS. If it
@@ -247,7 +259,7 @@ already running so there may be a short
import statement in the session. Note that you must explicitly include
any directories or jars that you want the command to search in your
classpath, except jars implicitly included by the jvm, e.g.,
-rt.jar."
+rt.jar. The NO-ERRORS is used to avoid showing erros to the user"
(interactive
(list (read-from-minibuffer "Class: "
(thing-at-point 'symbol))))
@@ -257,63 +269,65 @@ rt.jar."
(message "Skipping: already imported %s" existing-import)
(let ((imports
(bsh-eval-r
+ (oref 'jde-bsh the-bsh)
(concat "jde.util.JdeUtilities.getQualifiedName(\""
class "\");"))))
(setq imports (remove-duplicates imports :test 'equal))
(if imports
- (jde-import-insert-imports imports)
- (message "Error: could not find %s." class))))))
-;; end JVL enhancement contributed by Jim LoVerde <loverde(a)str.com>
-
-;; begin JVL enhancement contributed by Jim LoVerde <loverde(a)str.com>
-(defun jde-import-insert-imports (new-imports)
- (let* ((imports
- (mapcar 'jde-import-strip-excluded-imports
- (jde-import-strip-existing-imports new-imports
- (jde-import-get-imports)))))
- ;;Delete the nil which result from the excluded ones
- (setq imports (delq nil imports))
- (jde-import-choose-imports imports)))
-;; end JVL enhancement contributed by Jim LoVerde <loverde(a)str.com>
-
-(defun jde-import-strip-excluded-imports (new-import)
- "Removes excluded imports from the list"
- ;; If the string matches the regexp, we want to ignore it.
+ (jde-import-insert-import imports)
+ (if (not no-errors)
+ (message "Error: could not find %s." class)))))))
+
+(defun jde-import-exclude-imports (imports)
+ "Removes imports from IMPORTS that match
+any of the regular expressions specified
+by `jde-import-exclude-imports'."
(if jde-import-excluded-packages
- (let (i n result)
- (setq i 0)
- (message "exclude-regexp=%s"
- jde-import-excluded-packages)
- (setq n (length jde-import-excluded-packages))
- (setq result new-import)
- (while (< i n)
- (let ((exclude-regexp
- (nth i jde-import-excluded-packages)))
- (message "exclude-regexp=%s" exclude-regexp)
- (message "new-import=%s" new-import)
- (if (or (not (string-match "[.]" new-import))
- (string-match exclude-regexp new-import))
+ (delq
+ nil
+ (mapcar
+ (lambda (import)
+ (let ((exclude-regexp-or-func
+ (catch 'found
+ (loop for regexp-or-func in jde-import-excluded-packages do
+ (if (and
+ (string-match "[.]" import)
+ (if (functionp regexp-or-func)
+ (funcall regexp-or-func import)
+ (string-match regexp-or-func import)))
+ (throw 'found regexp-or-func))))))
+ (if exclude-regexp-or-func
(progn
- (message "Excluding import: %s" new-import)
- (setq result nil)))
- (setq i (+ i 1))))
- result)
- new-import))
-
-(defun jde-import-strip-excluded-import (exclude-regexp new-import)
- "Removes excluded imports from the list"
- ;;if the string matchs the regexp we want to ignore it.
- (if (string-match exclude-regexp (concat " " new-import))
- (progn (message "Excluding import: %s" new-import)
- ())
- new-import))
+ (message "Excluding %s." import)
+ nil)
+ import)))
+ imports))
+ imports))
+
+(defun jde-import-insert-import (new-imports)
+ "Asks user, if necessary, to choose one of NEW-IMPORTS and
+inserts the selected import in the buffer."
+ (let* ((existing-imports (jde-import-get-imports))
+ (candidate-imports (jde-import-exclude-imports new-imports))
+ (new-import
+ (if (> (length candidate-imports) 1)
+ (jde-import-choose-import candidate-imports)
+ (car candidate-imports))))
+ (if new-import
+ (if (jde-import-already-imports-class new-import existing-imports)
+ (message "This buffer already imports %s" new-import)
+ (jde-import-insert-imports-into-buffer (list new-import))))))
+
+
-(defun jde-import-insert-imports-into-buffer (new-imports)
+(defun jde-import-insert-imports-into-buffer (new-imports &optional exclude)
"Inserts imports into the correct place in the buffer."
(save-excursion
(goto-char (jde-import-get-import-insertion-point))
(if (not jde-xemacsp) (deactivate-mark))
+ (if exclude
+ (setq new-imports (jde-import-exclude-imports new-imports)))
(loop for new-import in new-imports do
(progn
(insert
@@ -326,25 +340,32 @@ rt.jar."
(funcall jde-import-auto-sort-function))))
+(defun jde-import-already-imports-class (class-name existing-imports)
+ "Determine if a class is already being imported."
+ (find
+ class-name
+ existing-imports
+:test (lambda (new existing)
+ (let ((new-package (jde-parse-get-package-from-name new))
+ (new-class (jde-parse-get-unqualified-name new))
+ (existing-package (jde-parse-get-package-from-name existing))
+ (existing-class (jde-parse-get-unqualified-name existing)))
+ (and
+ (string= new-package existing-package)
+ (or
+ (string= new-class existing-class)
+ (string= existing-class "*")))))))
+
(defun jde-import-strip-existing-imports (new-imports existing-imports)
"Exclude classes that have already been imported."
- (let (i n return-imports)
- (setq i 0)
- (setq n (length new-imports))
- (while (< i n)
- ;;iterate through the new imports
- (let((new-import
- (nth i new-imports)))
- ;;Strip out those alreay there
- (when (not (find new-import existing-imports :test 'string=))
- (setq return-imports (nconc (list new-import)
- return-imports))))
- (setq i(+ i 1)))
- ;;Return any that still exist
- return-imports))
+ (delq
+ nil
+ (mapcar
+ (lambda (new-import)
+ (unless (jde-import-already-imports-class new-import existing-imports)
+ new-import)
+ new-imports))))
-
-;; begin JVL enhancement contributed by Jim LoVerde <loverde(a)str.com>
(defun jde-import-get-existing-import (class-name)
""
(let ((import-re "import[ ]+\\(.*\\)[ ]*;")
@@ -364,9 +385,6 @@ rt.jar."
(setq result existing-import))))
result))
-(defun jde-import-already-imports-class (class-name)
- "Determine if a class is already being imported (ignoring packages)"
- (find class-name (jde-import-get-imports-no-package) :test 'string=))
(defun jde-import-strip-package-from-class (class-name)
"Strips the package name from fully qualified java class"
@@ -390,23 +408,15 @@ rt.jar."
(match-beginning 1)
(match-end 1))))))))
imports))
-;; end JVL enhancement contributed by Jim LoVerde <loverde(a)str.com>
-(defun jde-import-choose-imports (new-imports)
+(defun jde-import-choose-import (new-imports)
"Prompts the user to select a class to import from a list of similarly
named candidates."
- (if (> (length new-imports) 1)
- (let ((dialog
- (efc-option-dialog
- "Classes name dialog"
-:options new-imports
-:text "Select import to insert.")))
- (efc-dialog-show dialog)
- (if (oref dialog selection)
- (jde-import-insert-imports-into-buffer (list (oref dialog selection)))))
- (jde-import-insert-imports-into-buffer new-imports)))
+ (efc-query-options
+ new-imports
+ "Select import to insert."
+ "Classes name dialog"))
-;; Contributed by David Ponce.
(defun jde-import-kill-extra-imports (&optional comment)
"Delete extra Java import statements.
An import statement is considered extra if it is a duplicate,
@@ -704,6 +714,19 @@ version of the JDE with the semantic par
(setq i (1+ i)))
;; 2- Keep the point at the beginning of the first import
(goto-char (semantic-token-start (car imports)))
+ ;; 2b- But check if the previous line already contains the
+ ;; group name for the first group
+ (when jde-import-insert-group-names
+ (setq i 0)
+ (while (and (< i n) (not group))
+ (setq group (aref bins i)
+ i (1+ i)))
+ (when (car group)
+ (previous-line 1)
+ (if (not (string< (concat comment-start (car group))
+ (thing-at-point 'line)))
+ (next-line 1)))
+ (setq group nil))
;; 3- Kill current imports
(kill-region (point)
(progn
@@ -787,6 +810,63 @@ invoke 'jde-import-kill-extra-imports to
;;; History:
;;
;; $Log: jde-import.el,v $
+;; Revision 1.33 2003/09/22 02:56:24 paulk
+;; Cosmetic changes.
+;;
+;; Revision 1.32 2003/09/07 05:19:28 paulk
+;; Extend jde-import-excluded-classes to exclude classes that
+;; belong to the same package as the importing class. Thanks to
+;; Martin Schwamberger.
+;;
+;; Revision 1.31 2003/04/09 01:25:19 jslopez
+;; Updates method call from jde-import-insert-imports to jde-import-insert-import.
+;;
+;; Revision 1.30 2003/04/06 08:17:12 paulk
+;; Fixed regression caused by Andy's efc XEmacs compatibility
+;; changes. The regression was caused by the plural in the name
+;; jde-import-choose-imports which implies that it should return a list
+;; of imports selected by a user when in fact it should return only
+;; one. The plural misled Andy to enclose the import selected by the user
+;; in a list. I removed the enclosing list and I renamed the function and
+;; a set of other similarly misnamed functions to the singular, e.g.,
+;; jde-import-choose-import, to reflect the fact that they actually
+;; insert only a single import.
+;;
+;; Revision 1.29 2003/03/28 05:33:29 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
+;; Revision 1.28 2003/02/28 14:53:08 jslopez
+;; Fixes bug in jde-import-insert-imports.
+;; If new-imports contain only one import and this import is excluded the
+;; code was importing a nil value.
+;;
+;; Revision 1.27 2003/02/26 02:59:38 jslopez
+;; Supresses more error messages when completing.
+;;
+;; Revision 1.26 2003/02/25 05:20:25 paulk
+;; Fix bug that causes jde-import-organize to insert the group name
+;; multiple times when called repeatedly.
+;; Thanks to Joshua Spiewak <JSpiewak(a)axeda.com>
+;;
+;; Revision 1.25 2003/02/18 02:09:40 jslopez
+;; Fixes regression bugs.
+;;
+;; Revision 1.24 2003/01/17 20:58:06 jslopez
+;; Fixes regression bug causing excluded imports to show in the
+;; import list.
+;; Fixes typo in jde-import-insert-imports. It was using new-imports instead
+;; of candidate-imports.
+;;
+;; Revision 1.23 2003/01/12 20:05:26 paulk
+;; - Check whether import already exists AFTER the user selects the
+;; import. This is to prevent the JDE from importing a class that
+;; is already imported but from a different package.
+;; - Display message when the buffer already imports the specified class.
+;; - Clean up the code.
+;;
+;; Revision 1.22 2003/01/10 13:27:01 paulk
+;; Fix jde-import-strip-existing-imports so that it handles package import statements.
+;;
;; Revision 1.21 2002/09/06 13:07:12 jslopez
;; Fixes jde-import-get-classname to handle inner classes.
;;
1.10 +236 -134 XEmacs/packages/xemacs-packages/jde/lisp/jde-java-font-lock.el
Index: jde-java-font-lock.el
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-java-font-lock.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- jde-java-font-lock.el 2005/06/01 19:35:41 1.9
+++ jde-java-font-lock.el 2006/03/03 20:42:39 1.10
@@ -1,13 +1,13 @@
;;; jde-java-font-lock.el -- Extra level font locking for java
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002 by David Ponce
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by David Ponce
;; Author: David Ponce <david(a)dponce.com>
;; Maintainer: David Ponce <david(a)dponce.com>
;; Paul Kinnucan <paulk(a)mathworks.com>
;; Created: September 28 1998
;; Keywords: java, tools
-;; VC: $Id: jde-java-font-lock.el,v 1.15 2002/09/16 04:42:54 paulk Exp $
+;; VC: $Id: jde-java-font-lock.el,v 1.19 2003/07/15 11:58:45 paulk Exp $
;; This file is not part of Emacs
@@ -427,7 +427,10 @@ expression in the returned regexp. ALIA
""))
(cons tag aliases)
"\\|"))
- (hit-re (if (or (featurep 'xemacs)
+ (hit-re (if (or (and (featurep 'xemacs)
+ (or (< emacs-major-version 21)
+ (and (= emacs-major-version 21)
+ (< emacs-minor-version 4))))
(< emacs-major-version 21))
".*"
;; In GNU Emacs 21 use the "non-greedy" variant of
@@ -721,165 +724,245 @@ expressions."
"Extra level fontification keywords for JDE mode.")
(defun jde-java-font-lock-refontify ()
- "Update fontification of buffers in `java-mode' and `jde-mode'."
- (let ((l (buffer-list))
- b)
- (while l
- (setq b (car l)
- l (cdr l))
- (if (buffer-live-p b)
- (with-current-buffer b
- (if (and font-lock-mode
- (memq major-mode '(java-mode jde-mode)))
- (progn
- (message
- "jde-java-font-lock: updating fontification of buffer
%s..."
- (buffer-name))
- (font-lock-mode nil)
- (font-lock-mode 1)
- (message
- "jde-java-font-lock: updating fontification of buffer
%s...done"
- (buffer-name)))))))))
+ "Re-fontify buffers in `java-mode' and `jde-mode'."
+ (dolist (b (buffer-list))
+ (when (buffer-live-p b)
+ (with-current-buffer b
+ (when (and font-lock-mode
+ (memq major-mode '(java-mode jde-mode)))
+ (message "JDEE refontify buffer %s..." b)
+ (font-lock-mode -1)
+ (font-lock-mode 1)
+ (message "JDEE refontify buffer %s...done" b))))))
-;;;###autoload
-(defun jde-java-font-lock-setup-keywords (&optional rebuild)
- "Setup font lock keywords in `java-font-lock-keywords-4'.
+(defun jde-java-font-lock-keywords-with-cc-fonts (&optional rebuild)
+ "JDEE's extra level font lock keywords used with cc-fonts.
If optional REBUILD flag is non-nil create a new cache of regular
expressions."
- (interactive "P")
- (and (interactive-p)
- (consp current-prefix-arg)
- (setq rebuild t))
- (setq
- java-font-lock-keywords-4
- (append
-
- ;; Feature scoping: These must come first or the Special
- ;; constants, Modifiers and Packages from keywords-1 will catch
- ;; them.
+ (append
+
+ java-font-lock-keywords-3
+
+ ;; Fontify user's defined names
+ (mapcar #'(lambda (e)
+ (list
+ (c-make-font-lock-search-function
+ (car e)
+ (list 0 (cdr e) t))))
+ (jde-java-font-lock-api-keywords rebuild))
+
+ (list
+
+ ;; Fontify modifiers.
+ `(,(c-make-font-lock-search-function
+ jde-java-font-lock-modifier-regexp
+ '(0 jde-java-font-lock-modifier-face t)))
+
+ `(,(c-make-font-lock-search-function
+ "\\<\\(false\\|null\\|true\\)\\>"
+ '(1 jde-java-font-lock-constant-face t)))
+
+ ;; Fontify default and assert as keywords
+ `(,(c-make-font-lock-search-function
+ "\\<\\(default\\|assert\\)\\>"
+ '(1 'font-lock-keyword-face t)))
+
+ ;; Fontify const and goto with warning face. These keywords are
+ ;; reserved, even though they are not currently used.
+ `(,(c-make-font-lock-search-function
+ "\\<\\(const\\|goto\\)\\>"
+ '(1 'font-lock-warning-face t)))
+
+ ;; Fontify numbers
+ `(,(c-make-font-lock-search-function
+ jde-java-font-lock-number-regexp
+ '(0 jde-java-font-lock-number-face t)))
+
+ ;; Fontify operators
+;;; `(,(c-make-font-lock-search-function
+;;; jde-java-font-lock-operator-regexp
+;;; '(0 jde-java-font-lock-operator-face t)))
+
+ ;; Fontify capitalised identifiers as constant
+ `(,jde-java-font-lock-capital-id-regexp
+ 1 jde-java-font-lock-constant-face)
+
+ ;; Fontify text between `' in comments
+ jde-java-font-lock-quote-keyword
+
+ ;; Fontify javadoc tags (including non official ones)
+ jde-java-font-lock-javadoc-tag-keyword
+ ;; Fontify @param variable name
+ jde-java-font-lock-javadoc-param-name-keyword
+ ;; Fontify @exception or @throws exception type
+ jde-java-font-lock-javadoc-exception-type-keyword
+ ;; Fontify @docRoot
+ jde-java-font-lock-javadoc-docroot-keyword
+ ;; Fontify @link
+ jde-java-font-lock-javadoc-link-keyword
+ ;; Fontify @see reference
+ jde-java-font-lock-javadoc-see-ref-keyword
+ ;; Fontify the text of a HREF anchor
+ jde-java-font-lock-html-ahref-keyword
+
+ )
+
+ ;; Fontify other HTML tags
+ jde-java-font-lock-html-keywords
+
+ ))
+
+(defun jde-java-font-lock-keywords-default (&optional rebuild)
+ "Default JDEE's extra level font lock keywords.
+If optional REBUILD flag is non-nil create a new cache of regular
+expressions."
+ (append
+
+ ;; Feature scoping: These must come first or the Special
+ ;; constants, Modifiers and Packages from keywords-1 will catch
+ ;; them.
;;; Compatibility
- (if (featurep 'xemacs)
- (list
+ (if (featurep 'xemacs)
+ (list
- ;; Special keywords and constants
- '("\\<\\(this\\|super\\)\\>"
- (1 font-lock-keyword-face))
- '("\\<\\(false\\|null\\|true\\)\\>"
- (1 jde-java-font-lock-constant-face))
- ))
+ ;; Special keywords and constants
+ '("\\<\\(this\\|super\\)\\>"
+ (1 font-lock-keyword-face))
+ '("\\<\\(false\\|null\\|true\\)\\>"
+ (1 jde-java-font-lock-constant-face))
+ ))
- (list
+ (list
- ;; Fontify default as keyword
- '("\\<\\(default\\)\\>" (1 font-lock-keyword-face))
+ ;; Fontify default as keyword
+ '("\\<\\(default\\)\\>" (1 font-lock-keyword-face))
+
+ ;; Fontify assert as keyword
+ '("\\<\\(assert\\)\\>" (1 font-lock-keyword-face))
- ;; Fontify const and goto with warning face. These keywords are
- ;; reserved, even though they are not currently used.
- '("\\<\\(const\\|goto\\)\\>" (1 font-lock-warning-face))
-
- ;; Fontify modifiers.
- (cons jde-java-font-lock-modifier-regexp
- 'jde-java-font-lock-modifier-face)
+ ;; Fontify const and goto with warning face. These keywords are
+ ;; reserved, even though they are not currently used.
+ '("\\<\\(const\\|goto\\)\\>" (1 font-lock-warning-face))
+
+ ;; Fontify modifiers.
+ (cons jde-java-font-lock-modifier-regexp
+ 'jde-java-font-lock-modifier-face)
- ;; Fontify package directives
- '("\\<\\(package\\)\\>\\s-+\\(\\sw+\\)"
- (1 font-lock-keyword-face)
- (2 jde-java-font-lock-package-face nil t)
- ("\\=\\.\\(\\sw+\\)" nil nil
- (1 jde-java-font-lock-package-face nil t)))
+ ;; Fontify package directives
+ '("\\<\\(package\\)\\>\\s-+\\(\\sw+\\)"
+ (1 font-lock-keyword-face)
+ (2 jde-java-font-lock-package-face nil t)
+ ("\\=\\.\\(\\sw+\\)" nil nil
+ (1 jde-java-font-lock-package-face nil t)))
- ;; Fontify import directives
- '("\\<\\(import\\)\\>\\s-+\\(\\sw+\\)"
- (1 font-lock-keyword-face)
- (2 (if (equal (char-after (match-end 0)) ?\.)
+ ;; Fontify import directives
+ ;; XEmacs change: use `equal' instead of `char-equal' here
+ '("\\<\\(import\\)\\>\\s-+\\(\\sw+\\)"
+ (1 font-lock-keyword-face)
+ (2 (if (equal (char-after (match-end 0)) ?\.)
+ 'jde-java-font-lock-package-face
+ 'font-lock-type-face))
+ ("\\=\\.\\(\\*\\|\\sw+\\)" nil nil
+ (1 (if (equal (char-after (match-end 0)) ?\.)
'jde-java-font-lock-package-face
- 'font-lock-type-face))
- ("\\=\\.\\(\\*\\|\\sw+\\)" nil nil
- (1 (if (equal (char-after (match-end 0)) ?\.)
- 'jde-java-font-lock-package-face
- (if (equal (char-before (match-end 0)) ?\*)
- 'jde-java-font-lock-number-face
- 'font-lock-type-face)))))
- )
+ (if (equal (char-before (match-end 0)) ?\*)
+ 'jde-java-font-lock-number-face
+ 'font-lock-type-face)))))
+ )
- ;; Fontify user's defined names
- (jde-java-font-lock-api-keywords rebuild)
+ ;; Fontify user's defined names
+ (jde-java-font-lock-api-keywords rebuild)
;;; Compatibility
- (if (featurep 'xemacs)
- java-font-lock-keywords-2
- ;; Remove existing javadoc font lock keywords from GNU Emacs
- ;; `java-font-lock-keywords-3'
- (jde-java-font-lock-remove-javadoc-keywords
- java-font-lock-keywords-3))
+ (if (featurep 'xemacs)
+ java-font-lock-keywords-2
+ ;; Remove existing javadoc font lock keywords from GNU Emacs
+ ;; `java-font-lock-keywords-3'
+ (jde-java-font-lock-remove-javadoc-keywords
+ java-font-lock-keywords-3))
;;; Compatibility
- (if (featurep 'xemacs)
- nil
- ;; GNU Emacs don't fontify capitalized types so do it
+ (unless (featurep 'xemacs)
+ ;; GNU Emacs don't fontify capitalized types so do it
+ (list
(list
- (list
- (concat "\\<\\([" jde-java-font-lock-capital-letter
"]\\sw*\\)\\>"
- "\\([ \t]*\\[[ \t]*\\]\\)*"
- "\\([ \t]*\\sw\\)")
- '(font-lock-match-c-style-declaration-item-and-skip-to-next
- (goto-char (match-beginning 3))
- (goto-char (match-beginning 3))
- (1 (if (match-beginning 2)
- font-lock-function-name-face
- font-lock-variable-name-face))))
- (cons
- (concat "\\<\\([" jde-java-font-lock-capital-letter
"]\\sw*\\)\\>"
- "\\([ \t]*\\[[ \t]*\\]\\)*"
- "\\([ \t]*\\sw\\)")
- '(1 font-lock-type-face))
+ (concat "\\<\\([" jde-java-font-lock-capital-letter
"]\\sw*\\)\\>"
+ "\\([ \t]*\\[[ \t]*\\]\\)*"
+ "\\([ \t]*\\sw\\)")
+ '(font-lock-match-c-style-declaration-item-and-skip-to-next
+ (goto-char (match-beginning 3))
+ (goto-char (match-beginning 3))
+ (1 (if (match-beginning 2)
+ font-lock-function-name-face
+ font-lock-variable-name-face))))
+ (cons
+ (concat "\\<\\([" jde-java-font-lock-capital-letter
"]\\sw*\\)\\>"
+ "\\([ \t]*\\[[ \t]*\\]\\)*"
+ "\\([ \t]*\\sw\\)")
+ '(1 font-lock-type-face))
- '("\\<\\(new\\|instanceof\\)\\>[ \t]+\\(\\sw+\\)"
- 2 font-lock-type-face)))
+ '("\\<\\(new\\|instanceof\\)\\>[ \t]+\\(\\sw+\\)"
+ 2 font-lock-type-face)))
- ;; Some extra fontification
- (list
+ ;; Some extra fontification
+ (list
- ;; Fontify numbers
- (cons jde-java-font-lock-number-regexp
- 'jde-java-font-lock-number-face)
+ ;; Fontify numbers
+ (cons jde-java-font-lock-number-regexp
+ 'jde-java-font-lock-number-face)
- ;; Fontify operators
+ ;; Fontify operators
;;; (cons jde-java-font-lock-operator-regexp
;;; 'jde-java-font-lock-operator-face)
- ;; Fontify capitalised identifiers as constant
- (cons jde-java-font-lock-capital-id-regexp
- '(1 jde-java-font-lock-constant-face))
-
- ;; Fontify text between `' in comments
- jde-java-font-lock-quote-keyword
-
- ;; Fontify javadoc tags (including non official ones)
- jde-java-font-lock-javadoc-tag-keyword
- ;; Fontify @param variable name
- jde-java-font-lock-javadoc-param-name-keyword
- ;; Fontify @exception or @throws exception type
- jde-java-font-lock-javadoc-exception-type-keyword
- ;; Fontify @docRoot
- jde-java-font-lock-javadoc-docroot-keyword
- ;; Fontify @link
- jde-java-font-lock-javadoc-link-keyword
- ;; Fontify @see reference
- jde-java-font-lock-javadoc-see-ref-keyword
- ;; Fontify the text of a HREF anchor
- jde-java-font-lock-html-ahref-keyword
+ ;; Fontify capitalised identifiers as constant
+ (cons jde-java-font-lock-capital-id-regexp
+ '(1 jde-java-font-lock-constant-face))
+
+ ;; Fontify text between `' in comments
+ jde-java-font-lock-quote-keyword
+
+ ;; Fontify javadoc tags (including non official ones)
+ jde-java-font-lock-javadoc-tag-keyword
+ ;; Fontify @param variable name
+ jde-java-font-lock-javadoc-param-name-keyword
+ ;; Fontify @exception or @throws exception type
+ jde-java-font-lock-javadoc-exception-type-keyword
+ ;; Fontify @docRoot
+ jde-java-font-lock-javadoc-docroot-keyword
+ ;; Fontify @link
+ jde-java-font-lock-javadoc-link-keyword
+ ;; Fontify @see reference
+ jde-java-font-lock-javadoc-see-ref-keyword
+ ;; Fontify the text of a HREF anchor
+ jde-java-font-lock-html-ahref-keyword
- )
+ )
- ;; Fontify other HTML tags
- jde-java-font-lock-html-keywords
+ ;; Fontify other HTML tags
+ jde-java-font-lock-html-keywords
- ))
-
- ;; Update fontification of buffers in `java-mode' and `jde-mode'
+ ))
+
+;;;###autoload
+(defun jde-java-font-lock-setup-keywords (&optional rebuild)
+ "Setup font lock keywords in `java-font-lock-keywords-4'.
+If optional REBUILD flag is non-nil create a new cache of regular
+expressions."
+ (interactive "P")
(and (interactive-p)
- (jde-java-font-lock-refontify)))
+ (consp current-prefix-arg)
+ (setq rebuild t))
+
+ ;; Setup the JDEE's extra font lock keywords.
+ (setq java-font-lock-keywords-4
+ (if (featurep 'cc-fonts)
+ (jde-java-font-lock-keywords-with-cc-fonts rebuild)
+ (jde-java-font-lock-keywords-default rebuild)))
+
+ ;; Update fontification of buffers in `java-mode' and `jde-mode'.
+ (when (interactive-p)
+ (jde-java-font-lock-refontify)))
;; Setup `java-font-lock-keywords-4'
(jde-java-font-lock-setup-keywords)
@@ -939,6 +1022,25 @@ standard `java-mode'."
;;
;; $Log: jde-java-font-lock.el,v $
+;; Revision 1.19 2003/07/15 11:58:45 paulk
+;; Remove CRs.
+;;
+;; Revision 1.18 2003/07/06 13:42:01 paulk
+;; As of version 5.30, cc-mode provides its own set of font lock keywords and faces for
+;; Java: cc-fonts. The JDEE now uses cc-fonts if defined. Thanks to David Ponce.
+;;
+;; Revision 1.17 2003/06/07 05:07:42 paulk
+;; Fix a small bug in the JDEE font lock on XEmacs 21.4.11. Thanks to Andrew Kensler.
+;;
+;; Revision 1.16 2003/02/07 00:38:10 jslopez
+;; Adds assert as a keyword to be fortified.
+;; Ideally we want the assert keyword fortified only when the user
+;; is using jdk 1.4 but I don't know of a good way of enabling/disabling
+;; fortifying a keyword based on another parameter. Since fortifying does
+;; not cause any harm, I rather have it fortified always. This might prevent
+;; users from using the assert keyword and causing them problem if they
+;; want to upgrade to 1.4 and use assertions.
+;;
;; Revision 1.15 2002/09/16 04:42:54 paulk
;; XEmacs compatibility fix: added require statement for regexp-opt package.
;;
1.7 +322 -192 XEmacs/packages/xemacs-packages/jde/lisp/jde-javadoc-gen.el
Index: jde-javadoc-gen.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-javadoc-gen.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- jde-javadoc-gen.el 2003/01/18 05:48:45 1.6
+++ jde-javadoc-gen.el 2006/03/03 20:42:40 1.7
@@ -1,11 +1,11 @@
;;; jde-javadoc-gen.el -- Javadoc builder
-;; $Revision: 1.12 $
+;; $Revision: 1.16 $
;; Author: Sergey A Klibanov <sakliban(a)cs.wustl.edu>
;; Maintainer: Paul Kinnucan, Sergey A Klibanov
;; Keywords: java, tools
-;; Copyright (C) 2000, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 2000, 2001, 2002, 2003 Paul Kinnucan.
;; This file is not part of Emacs
@@ -37,11 +37,6 @@
:group 'jde
:prefix "jde-javadoc-")
-(defcustom jde-javadoc-command-path "javadoc"
- "*Path to the javadoc executable."
-:group 'jde-javadoc
-:type 'string)
-
(defcustom jde-javadoc-display-doc t
"*Display the documentation generated by the `jde-javadoc-make' command.
."
:group 'jde-javadoc
@@ -234,294 +229,429 @@ into the javadoc command line."
:group 'jde-javadoc
:type '(repeat (string :tag "Argument")))
+(defclass jde-javadoc-maker (efc-compiler)
+ ((make-packages-p :initarg :make-packages-p
+ :type boolean
+ :initform t
+ :documentation "Nonnil generates doc for packages."))
+ "Class of Javadoc generators.")
+
+(defmethod initialize-instance ((this jde-javadoc-maker) &rest fields)
+ "Initialize the Javadoc generator."
+
+ (oset this name "javadoc")
+
+ (oset
+ this
+ comp-finish-fcn
+ (lambda (buf msg)
+ (message msg)
+ (if (and
+ jde-javadoc-display-doc
+ (string-match "finished" msg))
+ (browse-url-of-file
+ (expand-file-name
+ "index.html"
+ (jde-normalize-path
+ jde-javadoc-gen-destination-directory
+ 'jde-javadoc-gen-destination-directory))))))
+
+ (oset
+ this
+ exec-path
+ (jde-cygpath (expand-file-name "bin/javadoc" (jde-get-jdk-dir)) t)))
+
+(defmethod get-args ((this jde-javadoc-maker))
+ "Get the arguments to pass to the javadoc process as specified
+by the jde-javadoc-gen variables."
+ (let* ((destination-directory
+ (jde-normalize-path
+ jde-javadoc-gen-destination-directory
+ 'jde-javadoc-gen-destination-directory))
+ (args
+ (list
+ "-d" destination-directory
+ (car jde-javadoc-gen-detail-switch))))
-;;;###autoload
-(defun jde-javadoc-make ()
- "Generates javadoc for the current project. This command runs the
-JDE javadoc program to generate the documentation. The variable
-`jde-javadoc-command-path' specifies the path of the javadoc excutable.
-The variable `jde-global-classpath' specifies the javadoc
--classpath argument. The variable `jde-sourcepath'
-specifies the javadoc -sourcepath argument. You can specify all
-other javadoc options via JDE customization variables. To specify the
-options, select Project->Options->Javadoc from the JDE menu. Use
-`jde-javadoc-gen-packages' to specify the packages, classes, or source
-files for which you want to generate javadoc. If this variable is nil,
-this command generates javadoc for the Java source file in the current
-buffer. If `jde-javadoc-display-doc' is nonnil, this command displays
-the generated documentation in a browser."
- (interactive)
- (save-some-buffers)
-
- (let* ((w32-quote-process-args ?\")
- (win32-quote-process-args ?\") ;; XEmacs
- (destination-directory
- (jde-normalize-path
- jde-javadoc-gen-destination-directory
- 'jde-javadoc-gen-destination-directory))
- (arguments
- (format "%s -d %s %s"
- jde-javadoc-command-path
- destination-directory
- (car jde-javadoc-gen-detail-switch))))
-
- (if (not (directory-files destination-directory nil nil nil))
+ (if (not (file-exists-p destination-directory))
(make-directory destination-directory))
;;Insert online links
(if jde-javadoc-gen-link-online
- (setq arguments
- (concat
- arguments
- (mapconcat
- (lambda (link) (format " -link \"%s\"" link))
- jde-javadoc-gen-link-URL " "))))
+ (setq args
+ (append
+ args
+ (mapcan
+ (lambda (link) (list "-link" link))
+ jde-javadoc-gen-link-URL))))
;;Insert offline links
(if jde-javadoc-gen-link-offline
- (setq arguments
- (concat
- arguments
- (mapconcat
+ (setq args
+ (append
+ args
+ (mapcan
(lambda (link)
- (format " -linkoffline \"%s\" \"%s\" "
- (car link) (cdr link)))
- jde-javadoc-gen-link-offline " "))))
+ (list "-linkoffline" (car link) (cdr link)))
+ jde-javadoc-gen-link-offline))))
;;Insert -group
(if jde-javadoc-gen-group
- (setq arguments
- (concat
- arguments
- (mapconcat
+ (setq args
+ (append
+ args
+ (mapcan
(lambda (group)
- (format " -group \"%s\" \"%s\" "
- ( car group) (cdr group)))
- jde-javadoc-gen-group " "))))
+ (list "-group" (car group) (cdr group)))
+ jde-javadoc-gen-group))))
+
- ;; Insert classpath
+ ;; Insert classpath
(if jde-global-classpath
- (setq arguments
- (concat
- arguments " "
- (jde-build-classpath-arg
- 'jde-global-classpath jde-quote-classpath))))
+ (setq args
+ (append
+ args
+ (list
+ "-classpath"
+ (jde-build-classpath
+ (jde-get-global-classpath)
+ 'jde-global-classpath)))))
+
;; Insert sourcepath
(if jde-sourcepath
- (setq arguments
- (concat
- arguments " "
- (jde-build-path-arg
- "-sourcepath "
- 'jde-sourcepath
- jde-quote-classpath))))
+ (setq args
+ (append
+ args
+ (list
+ "-sourcepath"
+ (jde-build-classpath
+ jde-sourcepath
+ 'jde-sourcepath)))))
;; Insert bootclasspath
(if jde-compile-option-bootclasspath
- (setq arguments
- (concat
- arguments " "
- (jde-build-path-arg
- "-bootclasspath "
- 'jde-compile-option-bootclasspath
- jde-quote-classpath))))
+ (setq args
+ (append
+ args
+ (list
+ "-bootclasspath"
+ (jde-build-classpath
+ jde-compile-option-bootclasspath
+ 'jde-compile-option-bootclasspath)))))
;; Insert extdirs
(if jde-compile-option-extdirs
- (setq arguments
- (concat
- arguments " "
- (jde-build-path-arg
- "-extdirs "
- 'jde-compile-option-extdirs
- jde-quote-classpath))))
+ (setq args
+ (append
+ args
+ (list
+ "-extdirs"
+ (jde-build-classpath
+ jde-compile-option-extdirs
+ 'jde-compile-option-extdirs)))))
;; Insert windowtitle
(if (not (equal "" jde-javadoc-gen-window-title))
- (setq arguments
- (concat
- arguments " -windowtitle \""
- jde-javadoc-gen-window-title "\" ")))
+ (setq args
+ (append
+ args
+ (list
+ "-windowtitle"
+ (concat "\"" jde-javadoc-gen-window-title "\"")))))
;; Insert doctitle
(if (not (equal "" jde-javadoc-gen-doc-title))
- (setq arguments
- (concat
- arguments " -doctitle \""
- jde-javadoc-gen-doc-title "\" ")))
+ (setq args
+ (append
+ args
+ (list
+ "-doctitle"
+ (concat "\"" jde-javadoc-gen-doc-title "\" ")))))
;; Insert header
(if (not (equal "" jde-javadoc-gen-header))
- (setq arguments
- (concat
- arguments " -header \""
- jde-javadoc-gen-header "\" ")))
+ (setq args
+ (append
+ args
+ (list
+ "-header"
+ (concat "\"" jde-javadoc-gen-header "\" ")))))
;; Insert footer
(if (not (equal "" jde-javadoc-gen-footer))
- (setq arguments
- (concat
- arguments " -footer \""
- jde-javadoc-gen-footer "\" ")))
+ (setq args
+ (append
+ args
+ (list
+ "-footer"
+ (concat "\"" jde-javadoc-gen-footer "\" ")))))
;; Insert bottom
(if (not (equal "" jde-javadoc-gen-bottom))
- (setq arguments
- (concat
- arguments " -bottom \""
- jde-javadoc-gen-bottom "\" ")))
+ (setq args
+ (append
+ args
+ (list
+ "-bottom"
+ (concat "\"" jde-javadoc-gen-bottom "\" ")))))
;; Insert helpfile
(if (not (equal "" jde-javadoc-gen-helpfile))
- (setq arguments
- (concat
- arguments " -helpfile \""
- (jde-normalize-path 'jde-javadoc-gen-helpfile) "\" ")))
+ (setq args
+ (append
+ args
+ (list
+ "-helpfile"
+ (jde-normalize-path 'jde-javadoc-gen-helpfile)))))
;; Insert stylesheet
(if (not (equal "" jde-javadoc-gen-stylesheetfile))
- (setq arguments
- (concat
- arguments " -stylesheetfile \""
- (jde-normalize-path 'jde-javadoc-gen-stylesheetfile) "\" ")))
+ (setq args
+ (append
+ args
+ (list
+ "-stylesheetfile"
+ (jde-normalize-path 'jde-javadoc-gen-stylesheetfile)))))
;; Insert -overview
(if (not (equal "" jde-javadoc-gen-overview))
- (setq arguments
- (concat
- arguments " -overview \""
- jde-javadoc-gen-overview "\" ")))
+ (setq args
+ (append
+ args
+ (list
+ "-overview"
+ (concat "\"" jde-javadoc-gen-overview "\" ")))))
;; Insert -doclet
(if (not (equal "" jde-javadoc-gen-doclet))
- (setq arguments
- (concat
- arguments " -doclet \""
- jde-javadoc-gen-doclet "\" ")))
+ (setq args
+ (append
+ args
+ (list
+ "-doclet"
+ (concat "\"" jde-javadoc-gen-doclet "\" ")))))
;; Insert -docletpath
(if jde-javadoc-gen-docletpath
- (setq arguments
- (concat
- arguments " "
- (jde-build-path-arg
- "-docletpath "
- 'jde-javadoc-gen-docletpath
- jde-quote-classpath))))
+ (setq args
+ (append
+ args
+ (list
+ "-docletpath"
+ (jde-build-classpath
+ jde-javadoc-gen-docletpath
+ 'jde-javadoc-gen-docletpath)))))
;; Inser -use
(if jde-javadoc-gen-use
- (setq arguments
- (concat
- arguments " -use ")))
+ (setq args
+ (append
+ args
+ (list "-use"))))
;;Insert -author
(if jde-javadoc-gen-author
- (setq arguments
- (concat
- arguments " -author ")))
+ (setq args
+ (append
+ args
+ (list "-author"))))
;;Insert -version
(if jde-javadoc-gen-version
- (setq arguments
- (concat
- arguments " -version ")))
+ (setq args
+ (append
+ args
+ (list "-version"))))
;;Insert -splitindex
(if jde-javadoc-gen-split-index
- (setq arguments
- (concat
- arguments " -splitindex ")))
+ (setq args
+ (append
+ args
+ (list "-splitindex"))))
;;Insert -nodeprecated
(if jde-javadoc-gen-nodeprecated
- (setq arguments
- (concat
- arguments " -nodeprecated ")))
+ (setq args
+ (append
+ args
+ (list "-nodeprecated"))))
;;Insert -nodeprecatedlist
(if jde-javadoc-gen-nodeprecatedlist
- (setq arguments
- (concat
- arguments " -nodeprecatedlist ")))
+ (setq args
+ (append
+ args
+ (list "-nodeprecatedlist"))))
;;Insert -notree
(if jde-javadoc-gen-notree
- (setq arguments
- (concat
- arguments " -notree ")))
+ (setq args
+ (append
+ args
+ (list "-notree"))))
;;Insert -noindex
(if jde-javadoc-gen-noindex
- (setq arguments
- (concat
- arguments " -noindex ")))
+ (setq args
+ (append
+ args
+ (list "-noindex"))))
;;Insert -nohelp
(if jde-javadoc-gen-nohelp
- (setq arguments
- (concat
- arguments " -nohelp ")))
+ (setq args
+ (append
+ args
+ (list "-nohelp"))))
;;Insert -nonavbar
(if jde-javadoc-gen-nonavbar
- (setq arguments
- (concat
- arguments " -nonavbar ")))
+ (setq args
+ (append
+ args
+ (list "-nonavbar"))))
;;Insert -serialwarn
(if jde-javadoc-gen-serialwarn
- (setq arguments
- (concat
- arguments " -serialwarn ")))
+ (setq args
+ (append
+ args
+ (list "-serialwarn"))))
;;Insert -verbose
(if jde-javadoc-gen-verbose
- (setq arguments
- (concat
- arguments " -verbose ")))
+ (setq args
+ (append
+ args
+ (list "-verbose"))))
;;Insert other tags
(if jde-javadoc-gen-args
- (setq arguments
- (concat
- arguments " "
- (mapconcat
+ (setq args (list
+ (append
+ args
+ (mapcan
(lambda (arg) arg)
- jde-javadoc-gen-args " "))))
+ jde-javadoc-gen-args)))))
;;Insert packages/files
- (if jde-javadoc-gen-packages
- (setq arguments
- (concat
- arguments
- (mapconcat
- (lambda (packagename) (format "%s" packagename))
- jde-javadoc-gen-packages " ")))
- (setq arguments
- (concat arguments " \"" (buffer-file-name) "\"")))
-
- (setq compilation-finish-function
- (lambda (buf msg)
- (message msg)
- (if (and
- jde-javadoc-display-doc
- (string-match "finished" msg))
- (browse-url-of-file
- (expand-file-name
- "index.html"
- (jde-normalize-path
- jde-javadoc-gen-destination-directory
- 'jde-javadoc-gen-destination-directory))))))
+ (if (and (oref this make-packages-p) jde-javadoc-gen-packages)
+ (setq args
+ (append
+ args
+ (mapcar
+ (lambda (packagename) packagename)
+ jde-javadoc-gen-packages)))
+ (setq
+ args
+ (append args (list (buffer-file-name)))))))
+
- (compile-internal arguments "No errors now!")))
+;;;###autoload
+(defun jde-javadoc-make-internal (&optional make-packages-p)
+ "Generates javadoc for the current project if MAKE-PACKAGES-P
+and `jde-javadoc-gen-packages' are nonnil; otherwise, make doc
+for the current buffer. This command runs the
+currently selected javadoc's program to generate the documentation.
+It uses `jde-get-jdk-dir' to determine the location of
+the currentlyh selected JDK. The variable `jde-global-classpath' specifies
+the javadoc -classpath argument. The variable `jde-sourcepath'
+specifies the javadoc -sourcepath argument. You can specify all
+other javadoc options via JDE customization variables. To specify the
+options, select Project->Options->Javadoc from the JDE menu. Use
+`jde-javadoc-gen-packages' to specify the packages, classes, or source
+files for which you want to generate javadoc. If this variable is nil,
+this command generates javadoc for the Java source file in the current
+buffer. If `jde-javadoc-display-doc' is nonnil, this command displays
+the generated documentation in a browser."
+ (save-some-buffers)
+ (let ((generator
+ (jde-javadoc-maker
+ "javadoc generator"
+ :make-packages-p make-packages-p)))
+ (exec generator)))
+
+
+
+;;;###autoload
+(defun jde-javadoc-make ()
+ "Generates javadoc for the current project. This command runs the
+currently selected JDK's javadoc program to generate the documentation.
+It uses `jde-get-jdk-dir' to determine the location of the currently
+selected JDK. The variable `jde-global-classpath' specifies the javadoc
+-classpath argument. The variable `jde-sourcepath'
+specifies the javadoc -sourcepath argument. You can specify all
+other javadoc options via JDE customization variables. To specify the
+options, select Project->Options->Javadoc from the JDE menu. Use
+`jde-javadoc-gen-packages' to specify the packages, classes, or source
+files for which you want to generate javadoc. If this variable is nil,
+this command generates javadoc for the Java source file in the current
+buffer. If `jde-javadoc-display-doc' is nonnil, this command displays
+the generated documentation in a browser."
+ (interactive)
+ (jde-javadoc-make-internal t))
+
+;;;###autoload
+(defun jde-javadoc-make-buffer ()
+ "Generates javadoc for the current buffer. This command runs the
+currently selected JDK's javadoc program to generate the
+documentation. It uses `jde-get-jdk-dir' to determine the location of the currently
+selected JDK. The variable `jde-global-classpath' specifies the
+javadoc -classpath argument. The variable `jde-sourcepath' specifies
+the javadoc -sourcepath argument. You can specify all other javadoc
+options via JDE customization variables. To specify the options,
+select Project->Options->Javadoc from the JDE menu. Use
+`jde-javadoc-make' to generate doc for the files and packages
+specified by `jde-javadoc-gen-packages'. If `jde-javadoc-display-doc'
+is nonnil, this command displays the generated documentation in a
+browser."
+ (interactive)
+ (jde-javadoc-make-internal))
+
+(defun jde-javadoc-browse-tool-doc ()
+ "Displays the documentation for the javadoc tool in a browser."
+ (interactive)
+ (let* ((jdk-url (jde-help-get-jdk-doc-url))
+ (javadoc-url
+ (concat
+ (substring jdk-url 0 (string-match "index" jdk-url))
+ (if (eq system-type 'windows-nt) "tooldocs/windows/"
"tooldocs/solaris/")
+ "javadoc.html")))
+ (browse-url
+ javadoc-url
+ (if (boundp
+ 'browse-url-new-window-flag)
+ browse-url-new-window-flag
+ browse-url-new-window-p))))
+
(provide 'jde-javadoc-gen)
;;
;; $Log: jde-javadoc-gen.el,v $
+;; Revision 1.16 2003/08/28 05:15:15 paulk
+;; Now launches javadoc directly instead of via the current shell. This avoids the need
+;; to quote command-line arguments, which always causes problems.
+;;
+;; Revision 1.15 2003/06/20 03:12:02 paulk
+;; Update docstrings.
+;;
+;; Revision 1.14 2003/06/17 05:54:09 paulk
+;; - Now uses jde-get-jdk-dir to determine the location of the javadoc
+;; executable.
+;;
+;; - Adds a jde-javadoc-make-buffer command to generate doc only for the
+;; source file in the current buffer.
+;;
+;; Revision 1.13 2003/06/05 03:58:38 paulk
+;; Add more precise check for existence of destination directory. Add
+;; call to jde-update-autoloaded-symbols to ensure that the autoloade
+;; customization variables defined by this package are initialized to the
+;; values defined by the current project.
+;;
;; Revision 1.12 2002/12/30 05:01:45 paulk
;; Fixed regression in jde-javadoc-make command.
;;
1.8 +66 -53 XEmacs/packages/xemacs-packages/jde/lisp/jde-javadoc.el
Index: jde-javadoc.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-javadoc.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- jde-javadoc.el 2003/01/18 05:48:45 1.7
+++ jde-javadoc.el 2006/03/03 20:42:40 1.8
@@ -1,5 +1,5 @@
;;; jde-javadoc.el --- JDE javadoc autodoc
-;; $Revision: 1.26 $
+;; $Revision: 1.27 $
;; Copyright (C) 1998, 2000, 2001, 2002 by David Ponce
@@ -703,57 +703,60 @@ Local to checker report buffer.")
(defun jde-javadoc-checker-show-report (report token)
"Show the `jde-javadoc-checker' REPORT for TOKEN."
(let ((buffer (semantic-token-buffer token)))
- (pop-to-buffer jde-javadoc-checker-report-buffer)
- (setq buffer-read-only nil)
- (erase-buffer)
- (jde-javadoc-checker-report-mode)
- (set (make-local-variable 'jde-javadoc-checker-buffer) buffer)
- (set (make-local-variable 'jde-javadoc-checker-token) token)
- (cond
- (report
- (define-key (current-local-map) "f" 'jde-javadoc-checker-fix)
- (insert (car report))
- (newline 2)
- (mapcar (function
- (lambda (line)
- (let* ((from (point))
- (to (progn
- (fill-region
- (point)
- (progn
- (insert " " line)
- (newline)
- (point)))
- (point))))
- (goto-char from)
- (delete-char 1)
- (insert-char ?\* 1)
- (goto-char to))))
- (cdr report))
- (newline)
- (insert "[f]-try to fix ")
- )
- (t
- (define-key (current-local-map) "f" nil)
- (insert "Documentation is up-to-date")
- (newline 2)))
- (insert "[p]-check previous [n]-check next [q]-quit")
- (goto-char (point-min))
- (jde-javadoc-adjust-window
- (get-buffer-window (current-buffer)))
- (setq buffer-read-only t)
- (save-selected-window
- (let ((window (get-buffer-window buffer)))
- (if (not window)
- nil
- (select-window window)
- (goto-char (semantic-token-start token))
- (jde-javadoc-skip-spaces-forward)
- (when (looking-at "/\\*\\*")
- (forward-comment 1)
- (jde-javadoc-skip-spaces-forward))
- (recenter -4))))
- (semantic-momentary-highlight-token token)))
+ (with-current-buffer
+ (get-buffer-create jde-javadoc-checker-report-buffer)
+ (setq buffer-read-only nil)
+ (erase-buffer)
+ (jde-javadoc-checker-report-mode)
+ (set (make-local-variable 'jde-javadoc-checker-buffer) buffer)
+ (set (make-local-variable 'jde-javadoc-checker-token) token)
+ (cond
+ (report
+ (define-key (current-local-map) "f" 'jde-javadoc-checker-fix)
+ (insert (car report))
+ (newline 2)
+ (mapcar (function
+ (lambda (line)
+ (let* ((from (point))
+ (to (progn
+ (fill-region
+ (point)
+ (progn
+ (insert " " line)
+ (newline)
+ (point)))
+ (point))))
+ (goto-char from)
+ (delete-char 1)
+ (insert-char ?\* 1)
+ (goto-char to))))
+ (cdr report))
+ (newline)
+ (insert "[f]-try to fix ")
+ )
+ (t
+ (define-key (current-local-map) "f" nil)
+ (insert "Documentation is up-to-date")
+ (newline 2)))
+ (insert "[p]-check previous [n]-check next [q]-quit")
+ (goto-char (point-min))
+ (setq buffer-read-only t)
+ (pop-to-buffer (current-buffer))
+ (jde-javadoc-adjust-window
+ (get-buffer-window (current-buffer)))
+ (sit-for 0)
+ (save-selected-window
+ (let ((window (get-buffer-window buffer)))
+ (if (not window)
+ nil
+ (select-window window)
+ (goto-char (semantic-token-start token))
+ (jde-javadoc-skip-spaces-forward)
+ (when (looking-at "/\\*\\*")
+ (forward-comment 1)
+ (jde-javadoc-skip-spaces-forward))
+ (recenter -4))))
+ (semantic-momentary-highlight-token token))))
(defun jde-javadoc-check-add-summary (report type name)
"Add a summary to REPORT error list, using token TYPE and NAME."
@@ -1617,7 +1620,8 @@ Call `semantic-bovinate-toplevel' with o
;; Move the point to the first non-blank character found. Skip
;; spaces, tabs and newlines.
(beginning-of-line)
- (jde-javadoc-skip-spaces-forward)
+;; (jde-javadoc-skip-spaces-forward)
+ (forward-comment (point-max))
(semantic-current-nonterminal)))
(defvar jde-javadoc-checkdoc-excursion nil
@@ -1881,6 +1885,15 @@ definition."
;;
;; $Log: jde-javadoc.el,v $
+;; Revision 1.27 2003/09/21 03:33:20 paulk
+;; - (jde-javadoc-checker-show-report): Better interaction with
+;; libraries that use the header-line in GNU Emacs 21.
+;;
+;; - (jde-javadoc-nonterminal-at-line): Use `forward-comment' to skip
+;; comment at beginning of line.
+;;
+;; Submitted by David Ponce.
+;;
;; Revision 1.26 2002/11/21 04:18:41 paulk
;; These packages, when autoloaded, now register and initialize the customization
variables
;; that they define to the values specified in the current project file.
1.5 +884 -76 XEmacs/packages/xemacs-packages/jde/lisp/jde-jdb.el
Index: jde-jdb.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-jdb.el,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- jde-jdb.el 2003/01/18 05:48:45 1.4
+++ jde-jdb.el 2006/03/03 20:42:40 1.5
@@ -1,11 +1,11 @@
;;; jde-jdb.el -- Debugger mode for jdb.
-;; $Revision: 1.19 $ $Date: 2002/11/11 05:24:26 $
+;; $Revision: 1.37 $ $Date: 2003/09/18 05:30:41 $
-;; Author: Paul Kinnucan <paulk(a)mathworks.com>
+;; Author: Paul Kinnucan <paulk(a)mathworks.com>x
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 2000, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 2000, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -55,7 +55,7 @@ breakpoint message."
;; Launch command
-(defclass jde-jdb-cmd-launch (jde-db-cmd) ()
+(defclass jde-jdb-cmd-launch (jde-db-cmd-launch) ()
"Asks jdb to launch the debuggee application.")
(defmethod initialize-instance ((this jde-jdb-cmd-launch) &rest fields)
@@ -230,9 +230,9 @@ current stack location."
output)
(let ((marker (match-string 0 output))
(class (match-string 1 output))
- (line-no (string-to-int (match-string 2 output)))
+ (line-no (jde-jdb-string-to-int (match-string 2 output)))
(package ""))
-
+
(if (equal ".java" (substring class -5))
(setq class (substring class 0 -5)))
@@ -241,7 +241,6 @@ current stack location."
(and (string-match (jde-jdb-make-qualified-class-name-regexp class) marker)
(setq package
(substring marker (match-beginning 2) (match-end 2)))))
-
(jde-db-set-debug-cursor
(if package (concat package "." class) class)
(concat class ".java") line-no)))
@@ -280,8 +279,14 @@ on the list."
(bp (car bps))
(file (oref bp file))
(line (jde-db-breakpoint-get-line bp)))
- (oset bp status 'requested)
- (jde-db-mark-breakpoint-requested file line)
+ (if (string-match "Deferring breakpoint" output)
+ (progn
+ (oset bp status 'requested)
+ (jde-db-mark-breakpoint-requested file line))
+ (if (string-match "Set breakpoint" output)
+ (progn
+ (oset bp status 'active)
+ (jde-db-mark-breakpoint-active file line))))
(setq bps (cdr bps))
(oset this breakpoints bps)
(if bps
@@ -320,9 +325,116 @@ on the list."
(let ((jdb (oref this debugger)))
(jde-db-exec-cmd jdb this)))))
+;; Print command
+(defvar jde-jdb-cmd-print-history nil)
+
+(defclass jde-jdb-cmd-print (jde-db-cmd)
+ ((expr :initarg :expr
+:type string
+:initform ""
+:documentation
+ "Expression passed to jdb"))
+ "Asks jdb to print value of expression at point")
+
+(defmethod initialize-instance ((this jde-jdb-cmd-print) &rest fields)
+ (call-next-method)
+ (oset this name "print")
+ (oset this expr ""))
+
+(defmethod jde-db-cmd-init ((this jde-jdb-cmd-print))
+ "The debugger invokes this method before executing the
+command."
+ (oset this expr (read-from-minibuffer "expr: " (thing-at-point 'word)
+ nil nil 'jde-jdb-cmd-print-history)))
+
+(defmethod jde-db-cmd-make-command-line ((this jde-jdb-cmd-print))
+ "Creates a command line for jdb print command."
+ (format "%s %s"
+ (oref this name)
+ (oref this expr)))
+
+;; Dump command
+(defclass jde-jdb-cmd-dump (jde-jdb-cmd-print) ()
+ "Asks jdb to print all object information of the expression at point")
+
+(defmethod initialize-instance ((this jde-jdb-cmd-dump) &rest fields)
+ (call-next-method)
+ (oset this name "dump"))
+
+;; Eval command
+(defclass jde-jdb-cmd-eval (jde-jdb-cmd-print) ()
+ "Ask jdb to evaluate the expression(Same as the print command)")
+
+(defmethod initialize-instance ((this jde-jdb-cmd-eval) &rest fields)
+ (call-next-method)
+ (oset this name "eval"))
+
+;; Set command
+(defclass jde-jdb-cmd-set-var (jde-jdb-cmd-print)
+ ((value :initarg :value
+:type string
+:initform "null"
+:document
+ "Value to assign to the variable"))
+ "Ask jdb to assign new value to a field/variable/array element")
+
+(defmethod initialize-instance ((this jde-jdb-cmd-set-var) &rest fields)
+ (call-next-method)
+ (oset this name "set"))
+
+(defmethod jde-db-cmd-init ((this jde-jdb-cmd-set-var))
+ "The debugger invokes this method before executing the
+command."
+ (oset this expr (read-from-minibuffer "variable: " (thing-at-point
'word)
+ nil nil 'jde-jdb-cmd-print-history))
+ (oset this value (read-from-minibuffer "value: " nil
+ nil nil '(null))))
+
+(defmethod jde-db-cmd-make-command-line ((this jde-jdb-cmd-set-var))
+ "Creates a command line for jdb print command."
+ (format "%s %s = %s"
+ (oref this name)
+ (oref this expr)
+ (oref this value)))
+
+;; Locals commands
+(defclass jde-jdb-cmd-locals (jde-jdb-cmd-print) ()
+ "Ask jdb to print al local variables in current stack frame")
+
+(defmethod initialize-instance ((this jde-jdb-cmd-locals) &rest fields)
+ (call-next-method)
+ (oset this name "locals"))
+
+(defmethod jde-db-cmd-init ((this jde-jdb-cmd-locals))
+ "The debugger invokes this method before executing the
+command."
+ (oset this expr ""))
+
;; jdb Command Set
-(defclass jde-jdb-cmd-set (jde-db-cmd-set) ()
+(defclass jde-jdb-cmd-set (jde-db-cmd-set)
+ ((print :initarg :print
+:type jde-jdb-cmd-print
+:documentation
+ "Asks jdb to print the value of expression at point")
+ (dump :initarg :dump
+:type jde-jdb-cmd-dump
+:documentation
+ "Ask jdb to print all object information from the
+expression at poing")
+ (eval :initarg :eval
+:type jde-jdb-cmd-eval
+:documentation
+ "Ask jdb to evaluate the expression at point")
+ (set-var :initarg :set-var
+:type jde-jdb-cmd-set-var
+:documentation
+ "Ask jdb to assign a new value to the expression at point")
+ (locals :initarg :locals
+:type jde-jdb-cmd-locals
+:documentation
+ "Ask jdb to print all local variables in current stack frame")
+ )
"Set of debugger commands implemented by jdb.")
(defmethod initialize-instance ((this jde-jdb-cmd-set) &rest fields)
@@ -352,7 +464,18 @@ on the list."
(oset this set-bp
(jde-jdb-cmd-set-breakpoint "jdb set breakpoint" :debugger jdb))
(oset this clear-bp
- (jde-jdb-cmd-clear-breakpoint "jdb clear breakpoint" :debugger jdb))))
+ (jde-jdb-cmd-clear-breakpoint "jdb clear breakpoint" :debugger jdb))
+ (oset this print
+ (jde-jdb-cmd-print "jdb print cmd" :debugger jdb))
+ (oset this dump
+ (jde-jdb-cmd-dump "jdb dump cmd" :debugger jdb))
+ (oset this eval
+ (jde-jdb-cmd-eval "jdb eval cmd" :debugger jdb))
+ (oset this set-var
+ (jde-jdb-cmd-set-var "jdb set cmd" :debugger jdb))
+ (oset this locals
+ (jde-jdb-cmd-locals "jdb locals cmd" :debugger jdb))
+ ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
@@ -408,7 +531,7 @@ on the list."
(oset
this
:marker-regexp
- "^.*: thread=.*, \\(\\(.*[.]\\)*\\)\\([^\$]*\\)\\(\$.*\\)*[.].+(),
line=\\([0-9]*\\),")
+ "^.*: thread=.*, \\(\\(.*[.]\\)*\\)\\([^\$]*\\)\\(\$.*\\)*[.].+(),
line=\\([0-9,]*\\),")
;; Regular expression to match a breakpoint message that lacks a line
;; number because the breakpoint occurs in a class compiled without deug
@@ -470,8 +593,8 @@ on the list."
(defmethod jde-db-listener-filter-output ((this jde-jdb-breakpoint-listener) input)
"Filters the output of the debugger."
- (let ((jdb (oref this debugger))
- (output ""))
+ (let ((jdb (oref this debugger))
+ (output ""))
;; Accumulate next chunk of debugger output.
(oset this
@@ -497,18 +620,17 @@ on the list."
(oref this :marker-acc) 0 (match-beginning 0)))
(marker (substring (oref this :marker-acc)
(match-beginning 0) (match-end 0)))
+ (rest (substring (oref this :marker-acc) (match-end 0)))
(class (substring
(oref this :marker-acc)
(match-beginning marker-regexp-class-index)
(match-end marker-regexp-class-index)))
- (line-no (string-to-int
+ (line-no (jde-jdb-string-to-int
(substring
(oref this :marker-acc)
(match-beginning marker-regexp-line-index)
(match-end marker-regexp-line-index))))
- (rest (substring (oref this :marker-acc) (match-end 0)))
(package ""))
-
;; Extract package path from input.
(let ((case-fold-search nil)) ;; Make sure search is case-sensitive
(and (string-match (jde-jdb-make-qualified-class-name-regexp class) marker)
@@ -610,6 +732,19 @@ on the list."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
+;; jdb Debuggee ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defclass jde-jdb-debuggee (jde-db-debuggee) ()
+ "Application process being debugged with jdb.")
+
+(defmethod initialize-instance ((this jde-jdb-debuggee) &rest fields)
+ "Constructs an instance of a jdb debuggee."
+ (call-next-method)
+ (oset this status (jde-db-debuggee-status "jdb status")))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
;; Class of JDE Debuggers based on jdb. ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -651,6 +786,187 @@ on the list."
"jdb stack listener"
:debugger this)))
+
+(defmethod jde-db-jdb-start ((this jde-db-jdb) prog-args cmdstr)
+ "Start the debugger."
+ (let ((w32-quote-process-args ?\")
+ (win32-quote-process-args ?\") ;; XEmacs
+ (source-directory default-directory)
+ (working-directory
+ (jde-db-debugger-get-working-dir this)))
+
+ (oset this :buffer (get-buffer-create (oref this :buffer-name)))
+
+ (save-excursion
+ (set-buffer (oref this :buffer))
+ ;; Do not erase the last transcript; user may wish to view it.
+ ;; (erase-buffer)
+ (goto-char (point-max))
+ (cd working-directory)
+ (insert (concat "cd " working-directory "\n"))
+ (insert cmdstr)
+ (comint-mode)
+ (make-local-variable 'comint-prompt-regexp)
+ (setq comint-prompt-regexp "\\(^> *\\)\\|\\(^.*\\[[0-9]+\\] *\\)")
+ (make-local-variable 'paragraph-start)
+ (setq paragraph-start comint-prompt-regexp)
+
+ (comint-exec (oref this :buffer)
+ (oref this :buffer-name)
+ (oref this :path)
+ nil
+ prog-args)
+
+ (oset this process
+ (get-buffer-process (oref this buffer)))
+
+ (cd source-directory)
+
+ (jde-db-set-process-filter this)
+ (jde-db-set-process-sentinel this)
+ (run-hooks 'jde-jdb-mode-hook)
+ (pop-to-buffer (oref this buffer))
+
+ (oset-default 'jde-db-debugger the-debugger this)
+ (oset this running-p t))))
+
+
+(defmethod jde-jdb-launch-app ((this jde-db-jdb) main-class)
+ "Launch the application whose main class is MAIN-CLASS in jdb debug mode."
+ (if (or
+ (not (slot-boundp this 'buffer))
+ (not (oref this :buffer))
+ (not (comint-check-proc (oref this :buffer))))
+ (let* ((debuggee
+ (progn
+ (oset this debuggee (jde-jdb-debuggee
+ "jdb debuggee"
+:main-class main-class))
+ (oref this debuggee)))
+ (source-directory default-directory)
+ (working-directory
+ (jde-db-debugger-get-working-dir this))
+ (prog-args (jde-db-debugger-get-prog-args this))
+ (command-string
+ (concat
+ (oref this :path) " "
+ (jde-run-make-arg-string prog-args) "\n\n")))
+
+ (oset this :buffer-name (concat "*debug" main-class "*"))
+ (oset this :buffer (get-buffer-create (oref this :buffer-name)))
+
+ (if jde-db-initial-step-p
+ (let ((step-cmd (oref (oref this cmd-set) step-into)))
+ (oset this next-cmd
+ (append (oref this next-cmd) (list step-cmd)))))
+
+ (jde-db-jdb-start this prog-args command-string)
+
+ (let ((debuggee-status (oref debuggee status)))
+ (oset debuggee-status running-p t)
+ (oset debuggee-status stopped-p t)))
+ (progn
+ (message "An instance of %s is running." (oref this :buffer-name))
+ (pop-to-buffer (oref this :buffer-name)))))
+
+
+(defmethod jde-jdb-connect ((this jde-db-jdb))
+ "Connect the debugger to an existing process."
+ (if (or
+ (not (slot-boundp this 'buffer))
+ (not (oref this :buffer))
+ (not (comint-check-proc (oref this :buffer))))
+ (let* ((debuggee (oref this debuggee))
+ (source-directory default-directory)
+ (connector (oref debuggee connector))
+ (working-directory
+ (jde-db-debugger-get-working-dir this))
+ (prog-args
+ (if (typep connector 'jde-db-listen-connector)
+ (if (typep connector 'jde-db-socket-connector)
+ (list
+ "-connect"
+ (format
+ "com.sun.jdi.SocketListen:port=%s"
+ (oref connector port)))
+ (if (typep connector 'jde-db-shared-memory-connector)
+ (list
+ "-connect"
+ (format
+ "com.sun.jdi.SharedMemoryListen:name=%s"
+ (oref connector name)))
+ (error "Invalid connector type.")))
+ (if (typep connector 'jde-db-attach-connector)
+ (if (typep connector 'jde-db-socket-connector)
+ (let ((host (oref connector host))
+ (port (oref connector port)))
+ (if host
+ (list
+ "-connect"
+ (format
+ "com.sun.jdi.SocketAttach:hostname=%s,port=%s"
+ host port))
+ (list
+ "-connect"
+ (format
+ "com.sun.jdi.SocketAttach:port=%s"
+ port))))
+ (if (typep connector 'jde-db-shared-memory-connector)
+ (list
+ "-connect"
+ (format
+ "com.sun.jdi.SharedMemoryAttach:name=%s"
+ (oref connector name)))
+ (error "Invalid connector type."))))))
+ (command-string
+ (format "%s %s\n\n"
+ (oref this :path)
+ (mapconcat (lambda (x) x) prog-args " "))))
+
+ (oset
+ this
+ :buffer-name
+ (if (typep connector 'jde-db-shared-memory-connector)
+ (format "*debug %s* debugee-shmem-name" (oref connector name))
+ (format
+ "*debug %s:%s*"
+ (if (or (typep connector 'jde-db-listen-connector)
+ (not (oref connector port)))
+ "localhost" (oref connector host))
+ port)))
+
+ (oset this :buffer (get-buffer-create (oref this :buffer-name)))
+
+ ;; Forward to the debugger any breakpoint requests made
+ ;; by the user before launching the application.
+ (if jde-db-breakpoints
+ (let ((bp-cmd (oref (oref this cmd-set) set-bp)))
+ (oset
+ bp-cmd
+ breakpoints
+ (mapcar (lambda (assoc) (cdr assoc)) jde-db-breakpoints))
+
+ (oset this next-cmd
+ (append (oref this next-cmd) (list bp-cmd)))))
+
+ (jde-db-jdb-start this prog-args command-string)
+
+ (let* ((debuggee (oref this debuggee))
+ (debuggee-status (oref debuggee status)))
+ (oset debuggee-status running-p t)
+ (oset debuggee-status stopped-p t)))
+ (progn
+ (message "An instance of %s is running." (oref this :buffer-name))
+ (pop-to-buffer (oref this :buffer-name)))))
+
+
+(defmethod jde-db-exec-cmds :BEFORE ((this jde-db-jdb) cmds)
+ "Handle launch and connect commands."
+ (let ((first-cmd (car cmds)))
+ (if (typep first-cmd jde-jdb-cmd-launch)
+ (jde-jdb-launch-app this (oref first-cmd main-class)))))
+
+
(defmethod jde-db-notify-process-exit ((this jde-db-jdb) msg)
"The default debugger process sentinel invokes this method
when the jdb process terminates."
@@ -691,13 +1007,13 @@ when the jdb process terminates."
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defclass jde-db-jdb-1.1 (jde-db-jdb)
+(defclass jde-db-jdb-1-1 (jde-db-jdb)
()
(:allow-nil-initform t)
"Class of jdb shipped with JDK 1.1.x.")
-(defmethod initialize-instance ((this jde-db-jdb-1.1) &rest fields)
+(defmethod initialize-instance ((this jde-db-jdb-1-1) &rest fields)
"Constructor for jdb-1.1."
(call-next-method)
(oset (oref this bp-listener)
@@ -711,7 +1027,7 @@ when the jdb process terminates."
;; JDK 1.3.1 Support ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defclass jde-db-old-jdb (jde-db-jdb-1.1)
+(defclass jde-db-old-jdb (jde-db-jdb-1-1)
()
(:allow-nil-initform t)
"Class of pre-JPDA jdb shipped with post-JPDA versions of the
@@ -724,7 +1040,7 @@ JDK.")
(oset this :exec-name "oldjdb"))
-(defclass jde-db-jdb-1.3 (jde-db-jdb)
+(defclass jde-db-jdb-1-3 (jde-db-jdb)
()
(:allow-nil-initform t)
"Class of JPDA-based jdb shipped with JDK 1.3.")
@@ -735,12 +1051,12 @@ JDK.")
;; JDK 1.4.0 Support ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defclass jde-db-jdb-1.4 (jde-db-jdb)
+(defclass jde-db-jdb-1-4 (jde-db-jdb)
()
(:allow-nil-initform t)
"Class of JPDA-based jdb shipped with J2SDK 1.4")
-(defmethod initialize-instance ((this jde-db-jdb-1.4) &rest fields)
+(defmethod initialize-instance ((this jde-db-jdb-1-4) &rest fields)
"Constructor for jdb-1.4."
(call-next-method)
;; Regular expression used to find a jdb breakpoint position marker.
@@ -749,7 +1065,7 @@ JDK.")
;; line number at which the breakpoint occurs."
(oset (oref this bp-listener)
:marker-regexp
- "^.*: \"thread=.*\", \\(\\(.*[.]\\)*\\)\\([^$]*\\)\\($.*\\)*[.].+(),
line=\\([0-9]*\\)"))
+ "^.*: \"thread=.*\", \\(\\(.*[.]\\)*\\)\\([^$]*\\)\\($.*\\)*[.].+(),
line=\\([0-9,]*\\)"))
(defun jde-jdb-get-jdb ()
"Gets the version of jdb specified for the
@@ -760,16 +1076,16 @@ current project."
(cond
((and (< (jde-java-major-version) 2)
(< (jde-java-minor-version) 2))
- (setq jdb (jde-db-jdb-1.1 "jdb 1.1")))
+ (setq jdb (jde-db-jdb-1-1 "jdb 1.1")))
((and (< (jde-java-major-version) 2)
(= (jde-java-minor-version) 3))
- (setq jdb (jde-db-jdb-1.3 "jdb 1.3")))
+ (setq jdb (jde-db-jdb-1-3 "jdb 1.3")))
(t
- (setq jdb (jde-db-jdb-1.4 "jdb 1.4")))))
+ (setq jdb (jde-db-jdb-1-4 "jdb 1.4")))))
((string= (car jde-debugger) "old jdb")
(if (and (< (jde-java-major-version) 2)
(< (jde-java-minor-version) 2))
- (setq jdb (jde-db-jdb-1.1 "jdb 1.1"))
+ (setq jdb (jde-db-jdb-1-1 "jdb 1.1"))
(setq jdb (jde-db-old-jdb "old jdb"))))
(t
(error "%s is not a valid jdb debugger choice."
@@ -791,7 +1107,7 @@ creates a command buffer for the debug s
(interactive)
(let ((debugger (jde-jdb-get-jdb))
(debuggee
- (jde-db-debuggee
+ (jde-jdb-debuggee
"debuggee"
:main-class
(let ((main-class jde-run-application-class))
@@ -809,42 +1125,264 @@ creates a command buffer for the debug s
(oset debugger :debuggee debuggee)
(jde-db-debugger-launch debugger)))
-(defun jde-jdb-attach ()
+(defun jde-jdb-get-socket-address ()
+ (if jde-db-option-connect-socket
+ jde-db-option-connect-socket
+ (let ((host
+ (read-from-minibuffer "Debuggee host: " "local"))
+ (port
+ (read-from-minibuffer "Debuggee port: " "4444")))
+ (list
+ (if (not (string= host "local"))
+ host)
+ port))))
+
+
+(defun jde-jdb-attach-via-socket ()
+ "Launch jdb in attach mode. In this mode, jdb connects itself to an
+existing debuggee process via a socket. The debuggee process itself must have been
+launched in debugger server mode. The JDK vm accepts command line
+arguments that starts the vm in the appropriate mode, e.g.,
+
+java -Xdebug -Xrunjdwp:transport=dt_socket,address=4444,server=y,suspend=n MyClass
+
+starts MyClass in debugger server mode at the socket address
+4444. See jdb in the tools section of the JDK documentation for
+more information on these arguments.
+
+Selecting the Server mode option of the `jde-run-option-debug' customization
+variable causes the JDEE to specify the appropriate command-line
+arguments when launching the debuggee process.
+
+The attach command connects the debugger to the debuggee at the
+address specified by `jde-db-option-connect-socket'. If this variable
+is nil, this command prompts you to enter the address."
(interactive)
- (let ((debugger (jde-jdb-get-jdb))
- (debuggee
- (jde-db-debuggee
- "debuggee"
- :address
- (if jde-db-option-connect-address
- jde-db-option-connect-address
- (if (eq system-type 'windows-nt)
- "javadebug"
- "4444")))))
+ (let* ((socket (jde-jdb-get-socket-address))
+ (host (nth 0 socket))
+ (port (nth 1 socket)))
+ (if (string= port "")
+ (error "You must specify the port of the debuggee process.")
+ (let* ((debugger (jde-jdb-get-jdb))
+ (connector
+ (jde-db-socket-attach-connector
+ "connector"
+ :host host
+ :port port))
+ (debuggee
+ (jde-jdb-debuggee
+ "debuggee"
+ :main-class (format
+ "Attached to socket %s:%s"
+ (if host host "localhost")
+ port)
+ :connector connector)))
+ (oset debugger the-debugger debugger)
+ (oset debugger :debuggee debuggee)
+ (jde-jdb-connect debugger)))))
+
+
+(defun jde-jdb-get-shared-memory-name ()
+ (if jde-db-option-connect-shared-memory-name
+ jde-db-option-connect-shared-memory-name
+ (read-from-minibuffer "Shared memory name: " "javadebug")))
+
+
+(defun jde-jdb-attach-via-shared-memory ()
+ "Launch jdb in attach mode. In this mode, jdb connects itself to an
+existing debuggee process. This command specifies use of shared memory
+as the connection transport. The debuggee process itself must have
+been launched in debugger server mode. The JDK vm accepts command line
+arguments that starts the vm in the appropriate mode, e.g.,
+
+java -Xdebug -Xrunjdwp:transport=dt_shmem,address=javadebug,server=y,suspend=n MyClass
+
+starts MyClass in debugger server mode, specifying \"javadebug\" as
+the name of the shared memory transport. See jdb in the tools section
+of the JDK documentation for more information on these arguments.
+
+Selecting the Server mode option of the `jde-run-option-debug' customization
+variable causes the JDEE to specify the appropriate command-line
+arguments when launching the debuggee process.
+
+The attach command connects the debugger to the debuggee at the
+address specified by `jde-db-option-connect-shared-memory', or, if
+this variable is nil, this command prompts you to enter a name."
+ (interactive)
+ (assert
+ (eq system-type 'windows-nt)
+ "The debugger does not support shared memory connections on this
platform.")
+ (let ((shmem-name (jde-jdb-get-shared-memory-name)))
+ (if (string= shmem-name "")
+ (error "Shared memory name required.")
+ (let* ((debugger (jde-jdb-get-jdb))
+ (connector
+ (jde-db-shared-memory-attach-connector
+ "connector"
+ :name shmem-name))
+ (debuggee
+ (jde-jdb-debuggee
+ "debuggee"
+ :main-class (format
+ "Attached via shared memory: %s."
+ shmem-name)
+ :connector connector)))
+ (oset debugger the-debugger debugger)
+ (oset debugger :debuggee debuggee)
+ (jde-jdb-connect debugger)))))
+
+
+(defun jde-jdb-get-socket-listen-port ()
+ (if jde-db-option-connect-socket
+ (nth 1 jde-db-option-connect-socket)
+ (read-from-minibuffer "Listen port: " "4444")))
+
+(defun jde-jdb-listen-via-socket ()
+ "Launch jdb in listen mode. In this mode, jdb launches itself and
+connects itself to a subsequently launched debuggee process. This
+command uses a socket as the method for connecting to the debuggee
+process. The debuggee process itself must be launched in debugger
+client mode The JDK vm accepts command line arguments that starts the
+vm in the appropriate mode, e.g.,
+
+java -Xdebug -Xrunjdwp:transport=dt_socket,address=4444,server=n,suspend=n MyClass
+
+starts MyClass in debugger client mode at the socket port 4444. See jdb in
+the tools section of the JDK documentation for
+more information.
+
+Selecting the Client mode option of the `jde-run-option-debug' customization
+variable causes the JDEE to specify the appropriate command-line
+arguments when launching the debuggee process.
+
+The listen command listens for the debugger at the
+address specified by `jde-db-option-connect-socket'. If this variable
+is nil, this command prompts you to enter the address. You can enter
+either the address that you plan to start the debuggee process at
+(e.g., jdbconn) or a null string. If you enter a null string, this
+command startes the debugger in a mode that accepts connections from
+any debuggee process started in debugger client mode, regardless of
+address."
+ (interactive)
+ (let* ((debugger (jde-jdb-get-jdb))
+ (port (jde-jdb-get-socket-listen-port))
+ (connector
+ (jde-db-socket-listen-connector
+ "connector"
+ :port port))
+ (debuggee
+ (jde-jdb-debuggee
+ "debuggee"
+:main-class (concat "Listening at port " port)
+ :connector connector)))
(oset debugger the-debugger debugger)
(oset debugger :debuggee debuggee)
- (jde-db-debugger-connect debugger)))
-
+ (jde-jdb-connect debugger)))
-(defun jde-jdb-listen ()
+(defun jde-jdb-listen-via-shared-memory ()
+ "Launch jdb in listen mode. In this mode, a subsequently
+launched debuggee process connects itself to jdb. This command uses
+Windows shared memory primitives as the method of communications
+between jdb andthe debuggee process. The debuggee process itself must
+be launched in debugger client mode. The JDK vm accepts command line
+arguments that starts the vm in the appropriate mode, e.g.,
+
+java -Xdebug
+-Xrunjdwp:transport=dt_shmem,address=javadebug,server=n,suspend=n
+MyClass
+
+starts MyClass in debugger client mode at the shared memory address
+javadebug. See jdb in the tools section of the JDK documentation for
+more information.
+
+Selecting the Client mode option of the `jde-run-option-debug' customization
+variable causes the JDEE to specify the appropriate command-line
+arguments when launching the debuggee process.
+
+The listen command listens for the debugger at the
+address specified by `jde-db-option-connect-shared-memory'. If this variable
+is nil, this command prompts you to enter the address that you plan to start
+the debuggee process at (e.g., jdbconn)."
(interactive)
- (let ((debugger (jde-jdb-get-jdb))
- (debuggee
- (jde-db-debuggee
- "debuggee"
- :address
- (if jde-db-option-connect-address
- jde-db-option-connect-address
- (if (eq system-type 'windows-nt)
- "javadebug"
- "4444")))))
+ (assert
+ (eq system-type 'windows-nt)
+ "The debugger does not support shared memory connections on this
platform.")
+ (let* ((debugger (jde-jdb-get-jdb))
+ (name (jde-jdb-get-shared-memory-name))
+ (connector
+ (jde-db-shared-memory-listen-connector
+ "connector"
+ :name name))
+ (debuggee
+ (jde-jdb-debuggee
+ "debuggee"
+:main-class (concat "Listening to " name)
+ :connector connector)))
(oset debugger the-debugger debugger)
(oset debugger :debuggee debuggee)
- (jde-db-debugger-connect debugger t)))
+ (jde-jdb-connect debugger)))
+
+(defun jde-jdb-display (key)
+ "Print expression at point."
+ (interactive "sExpression: ")
+ (jde-assert-source-or-debug-buffer)
+ (let* ((debugger (oref 'jde-db-debugger the-debugger))
+ (debuggee (oref debugger debuggee))
+ (debuggee-status (oref debuggee status)))
+ (if (and (oref debugger running-p)
+ (oref debuggee-status stopped-p))
+ (let* ((cmd-set (oref debugger cmd-set))
+ cmd)
+ (if (string= "print" key)
+ (setq cmd (oref cmd-set print))
+ (if (string= "dump" key)
+ (setq cmd (oref cmd-set dump))
+ (if (string= "eval" key)
+ (setq cmd (oref cmd-set eval))
+ (if (string= "set" key)
+ (setq cmd (oref cmd-set set-var))
+ (if (string= "locals" key)
+ (setq cmd (oref cmd-set locals)))))))
+ (jde-db-exec-cmd debugger cmd))
+ (let ((class (oref debuggee main-class)))
+ (error "Application %s is not stopped" class)))))
+
+(defun jde-jdb-print ()
+ (interactive)
+ (jde-jdb-display "print"))
+
+(defun jde-jdb-dump ()
+ (interactive)
+ (jde-jdb-display "dump"))
+
+(defun jde-jdb-eval ()
+ (interactive)
+ (jde-jdb-display "eval"))
+(defun jde-jdb-locals ()
+ (interactive)
+ (jde-jdb-display "locals"))
+(defun jde-jdb-set ()
+ (interactive)
+ (jde-jdb-display "set"))
+(defun jde-jdb-help ()
+ (interactive)
+ (let* ((jde-dir (jde-find-jde-doc-directory))
+ (jdb-ug-path
+ (if jde-dir
+ (expand-file-name "doc/html/jdb-ug/jdb-ug-frame.html" jde-dir))))
+ (if (and
+ jdb-ug-path
+ (file-exists-p jdb-ug-path))
+ (browse-url (concat "file://" (jde-convert-cygwin-path jdb-ug-path))
+ (if (boundp 'browse-url-new-window-flag)
+ 'browse-url-new-window-flag
+ browse-url-new-window-p))
+ (signal 'error '("Cannot find jdb user guide.")))))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Debug Commands ;;
@@ -852,17 +1390,178 @@ creates a command buffer for the debug s
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defvar jde-jdb-menu-spec
+(defvar jde-jdb-emacs-menu-spec
(list "Jdb"
["Step Over"
- jde-debug-step-over
- :active (jde-db-debuggee-stopped-p)]
+ jde-debug-step-over
+ :active (jde-db-debuggee-stopped-p)
+ :help "Step over the next method."]
+
["Step Into"
jde-debug-step-into
- :active (jde-db-debuggee-stopped-p)]
+ :active (jde-db-debuggee-stopped-p)
+ :help "Step into the next method."]
+
+ ["Step Out"
+ jde-debug-step-out
+ :active (jde-db-debuggee-stopped-p)
+ :help "Step out of the current method."]
+
+ ["Run"
+ jde-debug-run
+ :active (and
+ (slot-boundp 'jde-db-debugger 'the-debugger)
+ (let* ((debugger (oref 'jde-db-debugger the-debugger))
+ (debuggee (oref debugger debuggee))
+ (debuggee-status (oref debuggee status)))
+ (and (oref debugger running-p)
+ (not (oref debuggee-status running-p)))))
+
+ :included (or
+ (not (slot-boundp 'jde-db-debugger 'the-debugger))
+ (let* ((debugger (oref 'jde-db-debugger the-debugger))
+ (debuggee (oref debugger debuggee))
+ (debuggee-status (oref debuggee status)))
+ (or (not (oref debugger running-p))
+ (not (oref debuggee-status running-p)))))
+ :help "Start the current program."]
+
+ ["Continue"
+ jde-debug-cont
+ :active (or
+ (jde-db-debuggee-stopped-p)
+ (jde-db-debuggee-suspended-p))
+
+ :included (jde-db-debuggee-running-p)
+ :help "Continue the current program."]
+
+ ["Quit"
+ jde-debug-quit
+ :active (jde-db-debuggee-running-p)
+ :help "Terminate the current debugging session."]
+
+ "-"
+
+ ["Toggle Breakpoint"
+ jde-debug-toggle-breakpoint
+ :active t
+ :help "Set (or remove) a breakpoint at the current line."]
+
+ ["Clear Breakpoints"
+ jde-debug-clear-breakpoints
+ :active jde-db-breakpoints
+ :help "Remove all breakpoints."]
+
+ ["List Breakpoints"
+ jde-debug-list-breakpoints
+ :active jde-db-breakpoints
+ :help "Display a list of breakpoints."]
+
+ "-"
+
+ (list
+ "Display"
+
+ ["Expression"
+ jde-jdb-print
+ :active (jde-db-debuggee-stopped-p)
+ :help "Evaluate an expression and display the results."]
+
+ ["Object"
+ jde-jdb-dump
+ :active (jde-db-debuggee-stopped-p)
+ :help "Display the fields of an object referenced by a variable."]
+
+
+ ["Locals"
+ jde-jdb-locals
+ :active (jde-db-debuggee-stopped-p)
+ :help "Display the variables in scope at the current line."]
+ )
+
+ ["Set Variable"
+ jde-jdb-set
+ :active (jde-db-debuggee-stopped-p)
+ :help "Change the value of an in-scope variable."]
+
+ (list
+ "Stack"
+
+ ["Up"
+ jde-debug-up
+ :active (jde-db-debuggee-stopped-p)
+ :help "Move the debug cursor up the method call stack."]
+
+ ["Down"
+ jde-debug-down
+ :active (and
+ (jde-db-debuggee-stopped-p)
+ (let* ((debugger (oref 'jde-db-debugger the-debugger))
+ (debuggee (oref debugger debuggee)))
+ (> (jde-jdb-string-to-int
+ (oref debuggee :stack-depth)) 1)))
+ :help "Move the debug cursor down the method call stack." ]
+
+ ["Where"
+ jde-debug-where
+ :active (jde-db-debuggee-stopped-p)
+ :help "Display the call stack."]
+
+ )
+ "-"
+ (list
+ "External Process"
+ ["Attach Via Socket"
+ jde-jdb-attach-via-socket
+ :active (not (jde-db-debuggee-running-p))
+ :help "Attach the debugger to an external process via a socket."]
+ ["Attach Via Shared Memory"
+ jde-jdb-attach-via-shared-memory
+ :active (and
+ (eq system-type 'windows-nt)
+ (not (jde-db-debuggee-running-p)))
+ :help "Attach the debugger to an external process via a shared memory
connection."]
+ ["Listen Via Socket"
+ jde-jdb-listen-via-socket
+ :active (not (jde-db-debuggee-running-p))
+ :help "Listen at a socket for an external process."]
+ ["Listen Via Shared Memory"
+ jde-jdb-listen-via-shared-memory
+ :active (and
+ (eq system-type 'windows-nt)
+ (not (jde-db-debuggee-running-p)))
+ :help "Listen in shared memory for an external process."]
+ )
+ "-"
+ ["Preferences"
+ jde-bug-show-preferences
+ :active nil
+ :help "Not yet implemented."]
+
+ "-"
+ ["Help"
+ jde-jdb-help
+ :active t
+ :help "Display the JDEE's jdb user's guide in an HTML browser."]
+ )
+ "Defines the Jdb menu for Emacs.")
+
+(defvar jde-jdb-xemacs-menu-spec
+ (list "Jdb"
+
+ ["Step Over"
+ jde-debug-step-over
+ :active (jde-db-debuggee-stopped-p)]
+
+
+ ["Step Into"
+ jde-debug-step-into
+ :active (jde-db-debuggee-stopped-p)
+ ]
+
["Step Out"
jde-debug-step-out
:active (jde-db-debuggee-stopped-p)]
@@ -907,14 +1606,33 @@ creates a command buffer for the debug s
jde-debug-clear-breakpoints
jde-db-breakpoints]
+ ["List Breakpoints"
+ jde-debug-list-breakpoints
+ jde-db-breakpoints]
"-"
- ["Display Variable"
- jde-jdb-cmd-print
- nil]
+ (list
+ "Display"
+
+ ["Expression"
+ jde-jdb-print
+ :active (jde-db-debuggee-stopped-p)]
+
+ ["Object"
+ jde-jdb-dump
+ :active (jde-db-debuggee-stopped-p)]
- (list
+ ["Locals"
+ jde-jdb-locals
+ :active (jde-db-debuggee-stopped-p)]
+ )
+
+ ["Set Variable"
+ jde-jdb-set
+ :active (jde-db-debuggee-stopped-p)]
+
+ (list
"Stack"
["Up"
@@ -927,7 +1645,8 @@ creates a command buffer for the debug s
(jde-db-debuggee-stopped-p)
(let* ((debugger (oref 'jde-db-debugger the-debugger))
(debuggee (oref debugger debuggee)))
- (> (string-to-int (oref debuggee :stack-depth)) 1)))]
+ (> (jde-jdb-string-to-int
+ (oref debuggee :stack-depth)) 1)))]
["Where"
jde-debug-where
@@ -936,29 +1655,41 @@ creates a command buffer for the debug s
)
"-"
(list
- "Exernal Process"
- ["Attach to"
- jde-jdb-attach
+ "External Process"
+ ["Attach Via Socket"
+ jde-jdb-attach-via-socket
:active (not (jde-db-debuggee-running-p))]
- ["Listen for"
- jde-jdb-listen
+ ["Attach Via Shared Memory"
+ jde-jdb-attach-via-shared-memory
+ :active (and
+ (eq system-type 'windows-nt)
+ (not (jde-db-debuggee-running-p)))]
+ ["Listen Via Socket"
+ jde-jdb-listen-via-socket
:active (not (jde-db-debuggee-running-p))]
+ ["Listen Via Shared Memory"
+ jde-jdb-listen-via-shared-memory
+ :active (and
+ (eq system-type 'windows-nt)
+ (not (jde-db-debuggee-running-p)))]
+
)
"-"
["Preferences"
jde-bug-show-preferences nil]
"-"
["Help"
- jde-bug-help nil]
+ jde-jdb-help t]
)
"Defines the JDE's menu of jdb commands.")
+
(defvar jde-jdb-mode-map
(let ((km (make-sparse-keymap)))
- (easy-menu-define jde-jdb-menu km "JDEbug Minor Mode Menu"
- jde-jdb-menu-spec)
+ (easy-menu-define jde-jdb-menu km "Jdb Minor Mode Menu"
+ jde-jdb-emacs-menu-spec)
km)
- "Keymap for JDEbug minor mode.")
+ "Keymap for Jdb minor mode.")
(defvar jde-jdb-minor-mode nil
"Non-nil if jdb minor mode is enabled.")
@@ -982,9 +1713,9 @@ With prefix argument ARG, turn on if pos
(if jde-jdb-minor-mode
(if (featurep 'xemacs)
- (easy-menu-add jde-jdb-menu-spec jde-jdb-mode-map))
+ (easy-menu-add jde-jdb-xemacs-menu-spec jde-jdb-mode-map))
(if (featurep 'xemacs)
- (easy-menu-remove jde-jdb-menu-spec))))
+ (easy-menu-remove jde-jdb-xemacs-menu-spec))))
(semantic-add-minor-mode 'jde-jdb-minor-mode " jdb" jde-jdb-mode-map)
@@ -998,7 +1729,12 @@ With prefix argument ARG, turn on if pos
(cons "[?\C-c ?\C-a ?\C-r]" 'jde-debug-run)
(cons "[?\C-c ?\C-a ?\C-b]" 'jde-debug-toggle-breakpoint)
(cons "[?\C-c ?\C-a ?\C-u]" 'jde-debug-up)
- (cons "[?\C-c ?\C-a ?\C-d]" 'jde-debug-down))
+ (cons "[?\C-c ?\C-a ?\C-d]" 'jde-debug-down)
+ (cons "[?\C-c ?\C-a ?\C-p]" 'jde-jdb-print)
+ (cons "[?\C-c ?\C-a ?\C-d]" 'jde-jdb-dump)
+ (cons "[?\C-c ?\C-a ?\C-e]" 'jde-jdb-eval)
+ (cons "[?\C-c ?\C-a ?\C-v]" 'jde-jdb-set)
+ (cons "[?\C-c ?\C-a ?\C-l]" 'jde-jdb-locals))
"*Specifies key bindings for jdb debug commands.
The value of this variable is an association list. The car of
each element specifies a key sequence. The cdr specifies
@@ -1048,7 +1784,7 @@ You can use the notation [f1], [f2], etc
source-directory))
(debugger (jde-jdb-get-jdb))
(debuggee
- (jde-db-debuggee
+ (jde-jdb-debuggee
"applet"
:main-class applet-doc)))
(oset debugger :debuggee debuggee)
@@ -1104,10 +1840,82 @@ file in the current buffer."
(interactive)
(jde-jdb-applet))
+(defun jde-jdb-string-to-int(number)
+ "Some numbers show like, 1,200, this method remove the comma to allow the
+number to show as 1200 insteand 1"
+ (if (string-match "," number)
+ (setq number (replace-match "" nil nil number)))
+ (string-to-int number))
+
(provide 'jde-jdb)
;; Change History
;; $Log: jde-jdb.el,v $
+;; Revision 1.37 2003/09/18 05:30:41 paulk
+;; Replace the attach and listen commands with separate commands for
+;; attaching/listening via sockets and shared memory. This is necessary to support
attaching via sockets on Windows platforms.
+;;
+;; Revision 1.36 2003/06/30 03:58:11 paulk
+;; Provided help strings for Jdb menu items.
+;;
+;; Revision 1.35 2003/06/15 04:35:29 paulk
+;; Fix docstrings for jde-jdb-attach and jde-jdb-listen.
+;;
+;; Revision 1.34 2003/06/12 04:06:19 paulk
+;; Cosmetic fix to set-var command.
+;;
+;; Revision 1.33 2003/06/02 05:08:51 paulk
+;; Reorganized Jdb->Display menu. Changed names of commands to reflect purpose, e.g.,
Display->Print
+;; becomes Display->Expression. Deleted Display-Eval because it is the same as
Display->Expression.
+;; Moved Set (variable) command from the DIsplay submenu to the toplevel Jdb menu.
Changed
+;; first Jdb->Set Variable prompt from "Expression: " to Variable: ".
+;;
+;; Revision 1.32 2003/05/27 04:05:15 paulk
+;; Adds jde-jdb-help command. This command displays the JDB user's guide.
+;;
+;; Revision 1.31 2003/05/14 11:09:30 paulk
+;; Fix regression caused by renaming jdb classes.
+;;
+;; Revision 1.30 2003/05/14 06:38:48 paulk
+;; Fix jde-jdb-attach and jde-jdb-listen to reflect replacement of
+;; jde-db-option-connect-address with jde-db-option-listen-address and
+;; jde-db-option-attach-address.
+;;
+;; Revision 1.29 2003/05/13 05:06:04 paulk
+;; The attach and listen commands now prompt for a connect address if
jde-db-connect-address
+;; is nil. Also provided extensive doc strings for these commands.
+;;
+;; Revision 1.28 2003/02/25 17:19:59 jslopez
+;; Fixes bug setting breakpoints that will leave breakpoints mark as
+;; deferred even though they are not.
+;;
+;; Revision 1.27 2003/02/25 17:09:11 jslopez
+;; Fixes regression bug. Updates the remaining jde-db-debuggee to jde-jdb-debuggee.
+;;
+;; Revision 1.26 2003/02/25 06:53:29 paulk
+;; Created a generalized jde-debug command and wired it up to jdb.
+;; Next step is to wire it up to JDEbug.
+;;
+;; Revision 1.25 2003/02/25 04:37:15 jslopez
+;; Sets a main-class when attaching or listening through jdb to avoid
+;; an unbound error.
+;;
+;; Revision 1.24 2003/02/24 18:03:28 jslopez
+;; Fixes bug in jde-db-listener-filter-output.
+;;
+;; Revision 1.23 2003/01/12 19:17:17 jslopez
+;; Adds command List Breakpoints to the JDB menu.
+;;
+;; Revision 1.22 2003/01/09 12:10:13 jslopez
+;; Exposes the jdb methods: print, dump, eval, set, and locals.
+;;
+;; Revision 1.21 2003/01/08 21:49:13 jslopez
+;; Fixes typo in menu.
+;;
+;; Revision 1.20 2003/01/07 00:05:32 jslopez
+;; Fixes bug that would parse line number higher than 999.
+;; JDB prints out the number as 1,999.
+;;
;; Revision 1.19 2002/11/11 05:24:26 paulk
;; No need to add .exe to jdb path thanks to Mac compatibility fix.
;;
1.8 +13 -4 XEmacs/packages/xemacs-packages/jde/lisp/jde-make.el
Index: jde-make.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-make.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- jde-make.el 2003/01/18 05:48:46 1.7
+++ jde-make.el 2006/03/03 20:42:40 1.8
@@ -1,11 +1,11 @@
;;; jde-make.el -- Integrated Development Environment for Java.
-;; $Revision: 1.15 $
+;; $Revision: 1.16 $
;; Author: Paul Kinnucan <pkinnucan(a)attbi.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -99,11 +99,13 @@ enter to the make program along with the
(let ((make-command
(jde-make-make-command
jde-interactive-make-args))
+ (save-default-directory default-directory)
(default-directory
(if (string= jde-make-working-directory "")
default-directory
(jde-normalize-path 'jde-make-working-directory))))
+
;; Force save-some-buffers to use the minibuffer
;; to query user about whether to save modified buffers.
;; Otherwise, when user invokes jde-make from
@@ -126,7 +128,9 @@ enter to the make program along with the
(run-hook-with-args 'jde-make-finish-hook buf msg)
(setq compilation-finish-function nil)))
- (compile-internal make-command "No more errors")))
+ (cd default-directory)
+ (compile-internal make-command "No more errors")
+ (cd save-default-directory)))
;;;###autoload
(defun jde-make-show-options ()
@@ -141,6 +145,11 @@ enter to the make program along with the
(provide 'jde-make)
;; $Log: jde-make.el,v $
+;; Revision 1.16 2003/09/16 05:13:39 paulk
+;; Update jde-make command to issue a cd to the default directory before invoking
+;; make and to restore the original cwd afterwards. This fixes a bug in the
+;; implementation of the jde-make-working-directory variable.
+;;
;; Revision 1.15 2002/11/21 04:18:41 paulk
;; These packages, when autoloaded, now register and initialize the customization
variables
;; that they define to the values specified in the current project file.
@@ -191,4 +200,4 @@ enter to the make program along with the
;; Initial revision
;;
-;; End of jde-make.el
\ No newline at end of file
+;; End of jde-make.el
1.4 +38 -16 XEmacs/packages/xemacs-packages/jde/lisp/jde-open-source.el
Index: jde-open-source.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-open-source.el,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- jde-open-source.el 2003/01/18 05:48:46 1.3
+++ jde-open-source.el 2006/03/03 20:42:40 1.4
@@ -1,12 +1,12 @@
;; jde-open-source.el -- Open class source files
;;
-;; $Revision: 1.8 $
+;; $Revision: 1.11 $
;;
;; Author: Klaus Berndl
;; Keywords: java, open files
-;; Copyright (C) 2002 Klaus Berndl
+;; Copyright (C) 2002, 2003 Klaus Berndl
;; This package follows the GNU General Public Licence (GPL), see the
;; COPYING file that comes along with GNU Emacs. This is free software,
@@ -153,23 +153,23 @@ through the PREFIX-LIST"
(defun jde-open-jump-to-class (parsed-symbol class-name java-file-name)
"Opens JAVA-FILE-NAME and place the cursor in the parsed variable"
- (let* ((tokens (semantic-token-type-parent-superclass
- (semantic-current-nonterminal-of-type 'type)))
- (super-class (car tokens))
- (first-time t))
-
+ (let* (tokens super-class (first-time t))
;; if the current buffer contains java-file-name do not try to
;; open the file
(if (not (string-equal (buffer-file-name) java-file-name))
(funcall (or jde-open-cap-ff-function-temp-override
jde-open-class-at-point-find-file-function)
java-file-name))
+ (search-forward "{" nil t)
+ (setq tokens (semantic-token-type-parent-superclass
+ (semantic-current-nonterminal-of-type 'type)))
+ (setq super-class (car tokens))
;; Now letŽs jump to the thing-of-interest. If this is a
;; variable-name then we will not find this with senator in
;; the opened java-file so we search for the definiton of
;; the class itself. This feature is only available if we
;; have senator!
- (when (fboundp 'senator-search-forward)
+ (when (and (fboundp 'senator-search-forward) (not (string= parsed-symbol
"")))
(beginning-of-buffer)
(senator-parse)
(setq parsed-symbol (concat "\\b" parsed-symbol "\\b"))
@@ -177,9 +177,11 @@ through the PREFIX-LIST"
;; searching for the thing-of-interest has failed
;; let's try in the base class
(progn
- (jde-show-superclass-source-2 tokens)
+ (let ((jde-open-cap-ff-function-temp-override 'find-file))
+ (jde-show-superclass-source-2 tokens))
(beginning-of-buffer)
(senator-parse)
+ (search-forward "{" nil t)
(setq tokens (semantic-token-type-parent-superclass
(semantic-current-nonterminal-of-type 'type)))
;;if it is the first time try in the class definition
@@ -218,15 +220,24 @@ $CLASSPATH, then in current-directory."
(progn
(setq java-file-name (jde-open-find-java-file-name
class-to-open source-path-prefix-list))
- (if (not java-file-name)
+ (if (string= (car pair) "")
+; (setq thing-of-interest ""))
+ (let ((pos (jde-parse-find-declaration-of
+ thing-of-interest)))
+ (if (not (null pos))
+ (progn
+ (goto-char pos)
+ (setq found 't)))))
+ (if (and (not java-file-name) (not found))
(error "Can not find the sourcecode-file for
\"%s\""
thing-of-interest)
- ;; we have found the java-sourcefile. So letŽs open it and
- ;; then jump to the thing-of-interest
- (jde-open-jump-to-class thing-of-interest
- class-to-open
- java-file-name)))
- (error "Can not parse the thing at point!")))
+ (if (not found)
+ ;; we have found the java-sourcefile. So letŽs open it and
+ ;; then jump to the thing-of-interest
+ (jde-open-jump-to-class thing-of-interest
+ class-to-open
+ java-file-name))))
+ (error "Cannot determine the class of the symbol at point!")))
(message "You need JDE >= 2.2.6 and Senator for using this feature!")))
(defun jde-open-class-source ( &optional unqual-class )
@@ -305,6 +316,17 @@ you to select one of the interfaces to s
(provide 'jde-open-source)
;; $Log: jde-open-source.el,v $
+;; Revision 1.11 2003/10/06 12:30:37 jslopez
+;; Fixes several broken cases with jde-open-class-at-point.
+;;
+;; Revision 1.10 2003/07/19 05:44:48 paulk
+;; Make error message for jde-open-class-at-point more meaningful.
+;;
+;; Revision 1.9 2003/01/03 16:24:25 jslopez
+;; Fixes bug handling finding method definition in a super class.
+;; The code was parsing the java file from where it was invoked instead
+;; of the class file that was pertinent.
+;;
;; Revision 1.8 2002/08/22 04:15:17 jslopez
;; Fixes jde-open-class-at-point to loop through
;; all the super classes looking for the given token.
1.3 +140 -105 XEmacs/packages/xemacs-packages/jde/lisp/jde-parse-class.el
Index: jde-parse-class.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-parse-class.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- jde-parse-class.el 2003/03/11 05:45:42 1.2
+++ jde-parse-class.el 2006/03/03 20:42:40 1.3
@@ -1,5 +1,5 @@
;; JDE-PARSE-CLASS.EL --- Parse a Java class file.
-;; $Revision: 1.1 $ $Date: 2003/01/18 05:48:46 $
+;; $Revision: 1.7 $ $Date: 2003/06/19 17:01:39 $
;;
;; Copyright (C) 2002 Andrew Hyatt
;;
@@ -26,7 +26,7 @@
;; LCD Archive Entry:
;; jde-parse-class|Andrew Hyatt|
;; |Parse a Java class file to get xref info for the JDEE.
-;; |$Date: 2003/01/18 05:48:46 $|$Revision: 1.1 $|~/packages/jde-parse-class.el
+;; |$Date: 2003/06/19 17:01:39 $|$Revision: 1.7 $|~/packages/jde-parse-class.el
;;; Commentary:
@@ -57,64 +57,11 @@
;; equivalent to bytes). This is useful for the kind of parsing we are
;; doing.
-;; XEmacs doesn't have replace-regexp-in-string so define our own
-;; version
-(defun jde-replace-regexp-in-string (regexp rep string &optional
- fixedcase literal subexp start)
- "Replace all matches for REGEXP with REP in STRING.
-
-Return a new string containing the replacements.
-
-Optional arguments FIXEDCASE, LITERAL and SUBEXP are like the
-arguments with the same names of function `replace-match'. If START
-is non-nil, start replacements at that index in STRING.
-
-REP is either a string used as the NEWTEXT arg of `replace-match' or a
-function. If it is a function it is applied to each match to generate
-the replacement passed to `replace-match'; the match-data at this
-point are such that match 0 is the function's argument.
-
-To replace only the first match (if any), make REGEXP match up to \\'
-and replace a sub-expression, e.g.
- (replace-regexp-in-string \"\\(foo\\).*\\'\" \"bar\" \"
foo foo\" nil nil 1)
- => \" bar foo\"
-"
-
- ;; To avoid excessive consing from multiple matches in long strings,
- ;; don't just call `replace-match' continually. Walk down the
- ;; string looking for matches of REGEXP and building up a (reversed)
- ;; list MATCHES. This comprises segments of STRING which weren't
- ;; matched interspersed with replacements for segments that were.
- ;; [For a `large' number of replacments it's more efficient to
- ;; operate in a temporary buffer; we can't tell from the function's
- ;; args whether to choose the buffer-based implementation, though it
- ;; might be reasonable to do so for long enough STRING.]
- (let ((l (length string))
- (start (or start 0))
- matches str mb me)
- (save-match-data
- (while (and (< start l) (string-match regexp string start))
- (setq mb (match-beginning 0)
- me (match-end 0))
- ;; If we matched the empty string, make sure we advance by one char
- (when (= me mb) (setq me (min l (1+ mb))))
- ;; Generate a replacement for the matched substring.
- ;; Operate only on the substring to minimize string consing.
- ;; Set up match data for the substring for replacement;
- ;; presumably this is likely to be faster than munging the
- ;; match data directly in Lisp.
- (string-match regexp (setq str (substring string mb me)))
- (setq matches
- (cons (replace-match (if (stringp rep)
- rep
- (funcall rep (match-string 0 str)))
- fixedcase literal str subexp)
- (cons (substring string start mb) ; unmatched prefix
- matches)))
- (setq start me))
- ;; Reconstruct a string from the pieces.
- (setq matches (cons (substring string start l) matches)) ; leftover
- (apply #'concat (nreverse matches)))))
+;; for XEmacs compatibilty
+(unless (fboundp 'char-int)
+ (defalias 'char-int 'identity))
+(when jde-xemacsp
+ (require 'jde-xemacs))
(defmacro do-and-advance-chars (num &rest body)
"Execute BODY, and then advance the point NUM bytes, called like
@@ -128,22 +75,29 @@ and replace a sub-expression, e.g.
(cadr (jde-parse-class-lookup-constant
(jde-parse-class-get-next-2-bytes) constants)))
+;; xemacs without mule can't do utf-8
+(setq jde-parse-class-encoding
+ (if (member 'utf-8 (coding-system-list))
+ 'utf-8 'raw-text))
+
(defun jde-parse-class-slash-to-dot (string)
- (jde-replace-regexp-in-string "/" "." string))
+ (subst-char-in-string ?/ ?. string))
(defun jde-parse-class (class-file)
"Parse the class in CLASS-FILE, and return an alist, with the following
keys: version, this-class, interfaces, fields, and methods."
;; we must visit the file in such a way as to not use any encoding,
;; else our parsing could be severely messed up
+ (unless (file-exists-p class-file)
+ (error (concat "Class file " class-file " does not exist")))
(let ((buf (find-file-noselect class-file nil t)))
(set-buffer buf)
(let* ((constants (jde-parse-class-get-constants))
(version (jde-parse-class-get-version))
(access (jde-parse-class-get-access-flags))
(this-class
- (jde-replace-regexp-in-string
- "/" "." (cadr (jde-parse-class-lookup-constant
+ (subst-char-in-string
+ ?/ ?. (cadr (jde-parse-class-lookup-constant
(jde-parse-class-get-next-const-val constants)
constants))))
(superclass (jde-parse-class-slash-to-dot
@@ -156,29 +110,66 @@ keys: version, this-class, interfaces, f
(cadr val) constants)))))))
(interfaces (jde-parse-class-get-interfaces constants))
(fields (jde-parse-class-get-fields constants))
- (methods (jde-parse-class-get-methods constants)))
+ (methods (jde-parse-class-get-methods constants))
+ (attributes (jde-parse-class-get-attributes constants)))
(kill-buffer buf)
`((version . ,version) (access . ,access)
(this-class . ,this-class) (superclass . ,superclass)
(interfaces . ,interfaces)
(fields . ,fields)
- (methods . ,methods)))))
+ (methods . ,methods)
+ (attributes . ,attributes)))))
+
+(defun jde-parse-class-extract-caught-exception-types (info)
+ "Returns a list of a two-element of list of method signatures to
+ caught exception types for each method"
+ (mapcar (lambda (method)
+ (list `(,(cdr (nth 2 info))
+ ,(cdr (assoc 'name method))
+ ,@(cdr (assoc 'descriptor method)))
+ (mapcar (lambda (class) (when class
+ (jde-parse-class-slash-to-dot class)))
+ (cdr (assoc
+ 'catch-types
+ (cdr
+ (assoc 'code
+ (cdr
+ (assoc 'attributes
+ method)))))))))
+ (cdr (assoc 'methods info))))
+
+(defun jde-parse-class-extract-thrown-exception-types (info)
+ "Returns a two element list of method signatures to thrown exception
+ types for each method"
+ (mapcar (lambda (method)
+ (list `(,(cdr (nth 2 info))
+ ,(cdr (assoc 'name method))
+ ,@(cdr (assoc 'descriptor method)))
+ (cdr
+ (assoc 'exceptions
+ (cdr
+ (assoc 'attributes
+ method))))))
+ (cdr (assoc 'methods info))))
(defun jde-parse-class-extract-method-calls (info)
- "Return a cons of a fully qualified classname, and a list of the
-methods it calls. Each method in the list is a list of the calling
-method or line number if available, the Class, method, and return
-value, and arguments. INFO is the result of `jde-parse-class'"
+ "Return a cons of a method signature, and a list of the methods it
+calls. Each method in the list is a list of the calling method or
+line number if available, the Class, method, and return value, and
+arguments. INFO is the result of `jde-parse-class'"
(mapcan (lambda (method) (mapcar (lambda (attr)
(list
`(,(cdr (nth 2 info))
,(cdr (assoc 'name method))
,@(cdr (assoc 'descriptor method))
,(car attr)) (cdr attr)))
- (cdr
- (assoc 'code
- (cdr
- (assoc 'attributes method))))))
+ (cdr (assoc
+ 'calls
+ (cdr
+ (assoc 'code
+ (cdr
+ (assoc 'attributes
+ method))))))))
(cdr (assoc 'methods info))))
(defun jde-parse-class-extract-interfaces (info)
@@ -210,6 +201,9 @@ value, and arguments. INFO is the resul
INFO is the result of `jde-parse-class'"
(cdr (assoc 'this-class info)))
+(defun jde-parse-class-extract-sourcefile (info)
+ (cdr (assoc 'source-file (cdr (assoc 'attributes info)))))
+
(defun jde-parse-class-get-const-ref (point constants)
"Look at point in the class file and read it as a reference to the array.
Returns the constant information contained at the reference"
@@ -269,14 +263,32 @@ Returns the constant information contain
(let ((attribute-type (jde-parse-class-get-next-const-val constants))
(numbytes (jde-parse-class-get-next-4-bytes (point))))
;; TODO: implement the rest of the common attribute types
- (cond ((string= attribute-type "Code")
+ (cond ((equal attribute-type "Code")
(cons 'code
(jde-parse-class-get-code-attribute numbytes constants)))
- ((string= attribute-type "LineNumberTable")
+ ((equal attribute-type "LineNumberTable")
(cons 'line-number-table
(jde-parse-class-get-line-number-attribute)))
- (t (do-and-advance-chars numbytes nil)))))
+ ((equal attribute-type "Exceptions")
+ (cons 'throws
+ (jde-parse-class-get-exception-attribute constants)))
+ ((equal attribute-type "SourceFile")
+ (cons 'source-file
+ (jde-parse-class-get-source-file-attribute constants)))
+ (t (forward-char numbytes)))))
+
+(defun jde-parse-class-get-source-file-attribute (constants)
+ (jde-parse-class-get-next-const-val constants))
+(defun jde-parse-class-get-exception-attribute (constants)
+ (let ((num (jde-parse-class-get-next-length-val))
+ (classes '()))
+ (dotimes (i num classes)
+ (add-to-list 'classes
+ (cadr (jde-parse-class-lookup-constant
+ (jde-parse-class-get-next-const-val constants)
+ constants))))))
+
(defun jde-parse-class-get-line-number-attribute ()
(let ((num (jde-parse-class-get-next-length-val))
(line-number-infos '()))
@@ -291,9 +303,11 @@ Returns the constant information contain
(let* ((code-numbytes (jde-parse-class-get-next-4-bytes (point)))
(end-point (+ (point) code-numbytes))
(begin-point (point))
- (calls '()))
+ (calls '())
+ (catch-types '()))
(while (< (point) end-point)
- (let* ((opcode-info (aref jde-parse-class-opcode-vec (char-after)))
+ (let* ((opcode-info (aref jde-parse-class-opcode-vec
+ (char-int (char-after))))
(opcode-val (car opcode-info))
(opcode-length (cdr opcode-info)))
(forward-char)
@@ -321,29 +335,47 @@ Returns the constant information contain
(forward-char 4)
(forward-char (* 8 (jde-parse-class-get-next-4-bytes-as-signed))))
((eq opcode-val 'wide)
- (let ((opcode2 (char-after)))
+ (let ((opcode2 (char-int (char-after))))
(if (eq opcode2 'iinc)
(forward-char 4)
(forward-char 2))))
(t (forward-char (- opcode-length 1))))))
- (let ((num-exceptions (jde-parse-class-get-next-length-val)))
- (forward-char (* num-exceptions 8))) ;; skip over exception info (for now)
- (let ((attributes (jde-parse-class-get-attributes constants)))
- ;; Get the line numbers if there, if not use -1's to iondicate no line
number
- (let ((table (when (assoc 'line-number-table attributes)
- (cdr (assoc 'line-number-table attributes)))))
- (mapcar (lambda (call)
- (if table
- ;; The line numbers describe the instruction at
- ;; the start of the line, not every instruction
-
- ;; Advance in the table when the next byte
- ;; described is higher than the current one
- (progn (while (and (cadr table)
- (>= (car call) (caadr table)))
- (setq table (cdr table)))
- (cons (cdar table) (cdr call)))
- (cons -1 (cdr call)))) (nreverse calls))))))
+ (let ((num-exceptions (jde-parse-class-get-next-length-val)))
+ (dotimes (i num-exceptions)
+ (let ((type (cdr (assoc 'catch-type
+ (jde-parse-class-get-exception-handler
+ constants)))))
+ (when type
+ (add-to-list 'catch-types type)))))
+ (let ((attributes (jde-parse-class-get-attributes constants)))
+ ;; Get the line numbers if there, if not use -1's to iondicate no line number
+ (let ((table (when (assoc 'line-number-table attributes)
+ (cdr (assoc 'line-number-table attributes)))))
+ (list (cons
+ 'calls
+ (mapcar (lambda (call)
+ (if table
+ ;; The line numbers describe the instruction at
+ ;; the start of the line, not every instruction
+
+ ;; Advance in the table when the next byte
+ ;; described is higher than the current one
+ (progn (while (and (cadr table)
+ (>= (car call) (caadr table)))
+ (setq table (cdr table)))
+ (cons (cdar table) (cdr call)))
+ (cons -1 (cdr call)))) (nreverse calls)))
+ (cons 'catch-types catch-types))))))
+
+(defun jde-parse-class-get-exception-handler (constants)
+ (list (cons 'start-pc (jde-parse-class-get-next-2-bytes))
+ (cons 'end-pc (jde-parse-class-get-next-2-bytes))
+ (cons 'handler-pc (jde-parse-class-get-next-2-bytes))
+ (cons 'catch-type (let ((val (jde-parse-class-get-next-2-bytes)))
+ (when (> val 0)
+ (cadr (jde-parse-class-lookup-constant
+ (cadr (jde-parse-class-lookup-constant val constants))
+ constants)))))))
(defun jde-parse-class-parse-first-arg (sig)
(let ((char (char-to-string (string-to-char sig))))
@@ -420,8 +452,8 @@ returns ('f 'g)"
(defun jde-parse-class-get-access-flags ()
(do-and-advance-chars 2
- (let ((raw0 (char-after (point)))
- (raw1 (char-after (+ (point) 1))))
+ (let ((raw0 (char-int (char-after (point))))
+ (raw1 (char-int (char-after (+ (point) 1)))))
(append
(get-bit-flags-for-byte raw0
[nil nil nil nil 'string 'abstract
@@ -438,8 +470,8 @@ returns ('f 'g)"
(defun jde-parse-class-get-2byte (point)
"Gets the value of two bytes (0 - 65535) as an int"
- (let ((b1 (char-after point))
- (b2 (char-after (+ 1 point))))
+ (let ((b1 (char-int (char-after point)))
+ (b2 (char-int (char-after (+ 1 point)))))
(+ (* b1 256) b2)))
(defun jde-parse-class-get-next-2-bytes ()
@@ -516,12 +548,12 @@ of the constants) and a vector of all co
(let* ((len (jde-parse-class-get-next-2-bytes))
(result (encode-coding-string (buffer-substring (point)
(+ len (point)))
- 'utf-8)))
+ jde-parse-class-encoding)))
(goto-char (+ len (point)))
result))
(defun jde-parse-class-get-next-constant ()
- (let ((const-type (char-after (point))))
+ (let ((const-type (char-int (char-after (point)))))
(forward-char)
(cond ((eq const-type 7)
`(class ,(jde-parse-class-get-next-2-bytes)))
@@ -760,8 +792,11 @@ must be calculated at runtime.")
(provide 'jde-parse-class)
;; $Log: jde-parse-class.el,v $
-;; Revision 1.1 2003/01/18 05:48:46 andyp
-;; sync to jde 2.3.2
+;; Revision 1.7 2003/06/19 17:01:39 ahyatt
+;; Now compatible with emacs and xemacs versions without MULE
+;;
+;; Revision 1.5 2003/03/08 06:32:45 ahyatt
+;; Now parses exception information
;;
;; Revision 1.4 2002/12/01 02:39:58 ahyatt
;; Support for jde-xref's latest improvements, which require more
1.8 +114 -53 XEmacs/packages/xemacs-packages/jde/lisp/jde-parse.el
Index: jde-parse.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-parse.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- jde-parse.el 2003/01/18 05:48:46 1.7
+++ jde-parse.el 2006/03/03 20:42:40 1.8
@@ -1,11 +1,11 @@
;;; jde-parse.el
-;; $Revision: 1.47 $
+;; $Revision: 1.58 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 2000, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
;; Boston, MA 02111-1307, USA.
(require 'semantic-sb)
-(require 'semantic-bnf)
(require 'semantic-ctxt)
(require 'avltree)
(require 'thingatpt)
@@ -296,7 +295,7 @@ this function returns nil."
pos))
(point-min)))
(case-fold-search nil)
- (class-re "^[
\t]*\\(\\(public\\|abstract\\|final\\|static\\|strictfp\\|protected\\)[ \t]+\\)*[
\t]*class[ \t]+\\([^ \t\n{]*\\).*")
+ (class-re "^[
\t]*\\(\\(public\\|abstract\\|final\\|static\\|strictfp\\|protected\\)[ \t]+\\)*[
\t]*\\(class\\|interface\\)[ \t]+\\([^ \t\n{]*\\).*")
(class-pos (re-search-backward class-re search-end-pos t)))
(if class-pos
(progn
@@ -305,8 +304,8 @@ this function returns nil."
'class-found
(cons
(buffer-substring-no-properties
- (match-beginning 3)
- (match-end 3))
+ (match-beginning 4)
+ (match-end 4))
class-pos))))))))
(setq left-paren-index (1+ left-paren-index)))))))))
@@ -342,13 +341,10 @@ Return the selection."
(format "jde.util.JdeUtilities.getQualifiedName(\"%s\");"
class))))
(if names
(if (> (length names) 1)
- (let ((dialog
- (efc-option-dialog
- "Class Name Dialog"
- :options names
- :text (or prompt "Select class."))))
- (efc-dialog-show dialog)
- (oref dialog selection))
+ (efc-query-options
+ names
+ (or prompt "Select class.")
+ "Class Name Dialog")
(car names))
(error "Cannot find class %s on the current classpath." class)))
(error
@@ -436,7 +432,27 @@ function does not give the fully-qualifi
the type as it is declared, and a qualifier that might be the package or
the containing/outer class of the declared type."
(save-excursion
- (let (found res pos orgpt resname foundpt qualifier)
+ (let (found res foundpt qualifier)
+ (setq foundpt (jde-parse-find-declaration-of name))
+ (setq found (not (null foundpt)))
+
+ ;; now check for qualifying identifier. Note: reuses
+ ;; jde-parse-qualified-name-at-point for simplicity, not efficiency
+ (if found
+ (let (qualname)
+ (goto-char foundpt)
+ (setq qualname (jde-parse-qualified-name-at-point))
+ (setq qualifier (car qualname))
+ (setq res (cdr qualname))))
+
+ (cons res qualifier))))
+
+(defun jde-parse-find-declaration-of (name)
+ "Find in the current buffer the location where NAME is declared.
+Returns the character position in the buffer, or nil if no declaration
+could be found."
+ (save-excursion
+ (let (found pos orgpt resname foundpt)
(setq orgpt (point))
(while (and (not found)
(search-backward name nil t))
@@ -448,8 +464,7 @@ the containing/outer class of the declar
(forward-char -1)
(if (and (not (null resname))
(not (jde-parse-keywordp resname)))
- (progn (setq res resname)
- (setq found t))))
+ (setq found t)))
(goto-char orgpt)
@@ -462,19 +477,9 @@ the containing/outer class of the declar
(goto-char pos)
(forward-char 1)
(if (not (null resname))
- (progn (setq res resname)
- (setq found t))))
+ (setq found t)))
- ;; now check for qualifying identifier. Note: reuses
- ;; jde-parse-qualified-name-at-point for simplicity, not efficiency
- (if found
- (let (qualname)
- (goto-char foundpt)
- (setq qualname (jde-parse-qualified-name-at-point))
- (setq qualifier (car qualname))
- (setq res (cdr qualname))))
-
- (cons res qualifier))))
+ (if found foundpt nil))))
(defun jde-display-parse-error (error)
@@ -942,13 +947,13 @@ Java type name, e.g., int."
"char")
;; If it's "this", we return the class name of the class we
code in
((and class-at-point (string= "this" expr))
- (jde-parse-get-qualified-name class-at-point))
+ (jde-parse-get-qualified-name class-at-point t))
;; If it's "super", we return the super class
;;name of the class we code in
((and super-at-point (string= "super" expr))
- (jde-parse-get-qualified-name super-at-point))
+ (jde-parse-get-qualified-name super-at-point t))
;;if it's a class name, done
- ((setq qualified-name (jde-parse-get-qualified-name expr))
+ ((setq qualified-name (jde-parse-get-qualified-name expr t))
qualified-name)
;;check if it's an inner class
@@ -984,17 +989,19 @@ Java type name, e.g., int."
;;if the previous did not work try again
(setq qualified-name
- (jde-parse-get-qualified-name result))
+ (jde-parse-get-qualified-name result t))
(if qualified-name
qualified-name
(if jde-complete-current-list
(progn
(setq to-complete
(car (car jde-complete-current-list)))
- (setq chop-pos (string-match " : " to-complete))
- (substring to-complete (+ chop-pos 3)))
- (error "Could not find type of %s" expr)))))
-
+ (setq chop-pos (+ 3 (string-match " : " to-complete)))
+ (let* ((space-pos (string-match " " to-complete chop-pos))
+ (uqname (if space-pos (substring to-complete chop-pos space-pos)
+ (substring to-complete chop-pos))))
+ uqname))))))
+
;;if it's an array
((eq last-char ?\])
(let ((temp (jde-parse-eval-type-of
@@ -1011,9 +1018,11 @@ Java type name, e.g., int."
(progn
(setq to-complete (car (car
jde-complete-current-list)))
- (setq chop-pos (string-match " : " to-complete))
- (jde-parse-get-qualified-name
- (substring to-complete (+ chop-pos 3))))
+ (setq chop-pos (+ 3 (string-match " : " to-complete)))
+ (let* ((space-pos (string-match " " to-complete chop-pos))
+ (uqname (if space-pos (substring to-complete chop-pos space-pos)
+ (substring to-complete chop-pos))))
+ (jde-parse-get-qualified-name uqname)))
nil))
(t
@@ -1051,7 +1060,8 @@ Java type name, e.g., int."
work)
;; otherwise use unqualified class name
(t
- (jde-parse-get-qualified-name result)))))
+ (jde-parse-get-qualified-name result
+ t)))))
(if type
(progn
@@ -1197,9 +1207,10 @@ statements. It implicitly adds the java.
;; uses the beanshell to determine if an import statement with a
;; wildcard contains the unqualified class name passed to this
;; function.
-(defun jde-parse-get-qualified-name (name)
- "Guess the fully qualified name of the class NAME, using the import
-list. It returns a string if the fqn was found, or null otherwise."
+(defun jde-parse-get-qualified-name (name &optional import)
+ "Guess the fully qualified name of the class NAME, using the import list. It
+returns a string if the fqn was found, or null otherwise. If IMPORT is non-nil
+try importing the class"
(if (jde-parse-class-exists name)
name
(let ((importlist (jde-parse-import-list))
@@ -1215,21 +1226,29 @@ list. It returns a string if the fqn was
(setq result fullname))
(t
(setq importlist (cdr importlist)))))
+ (if (and (null result) import)
+ (progn
+ (jde-import-find-and-import name t)
+ (setq result (jde-parse-get-qualified-name name))))
result)))
;; Contributed by Charles Hart <cfhart(a)Z-TEL.com>
-;; Returns t if the fully qualified class name can be found in the
-;; classpath, nil otherwise
(defun jde-parse-class-exists (name)
- ;;replacing double quotes by empty strings double quotes seems to break
- ;;the beanshell
- (while (string-match "\"" name)
- (setq name (replace-match "" nil nil name)))
+ "Returns t if the fully qualified class name can be found in the
+ classpath, nil otherwise."
+ (if (stringp name)
+ (progn
+ ;; Replace double quotes by empty strings.
+ ;; Double quotes seems to break the beanshell.
+ (while (string-match "\"" name)
+ (setq name (replace-match "" nil nil name)))
- ;;replacing back slaches by empty strings backlashes causes beanshell problem
- (while (string-match "\\\\" name)
- (setq name (replace-match "" nil nil name)))
- (jde-jeval-r (concat "jde.util.JdeUtilities.classExists(\"" name
"\");")))
+ ;; Replace back slashes by empty strings.\
+ ;; Back slashes causes Beeanshell problems
+ (while (string-match "\\\\" name)
+ (setq name (replace-match "" nil nil name)))
+
+ (jde-jeval-r (concat "jde.util.JdeUtilities.classExists(\"" name
"\");")))))
(defun jde-parse-get-inner-class (expr)
"Takes a single argument like B.A and split it up in a name
@@ -1376,6 +1395,48 @@ otherwise."
(provide 'jde-parse)
;; $Log: jde-parse.el,v $
+;; Revision 1.58 2003/10/06 12:30:37 jslopez
+;; Fixes several broken cases with jde-open-class-at-point.
+;;
+;; Revision 1.57 2003/09/27 06:06:32 paulk
+;; - Fix jde-parse-get-innermost-class-at-point to handle interface definitions.
+;; - Fix jde-parse-eval-type-of to handle methods that throw exceptions.
+;;
+;; Thanks to Suraj Acharya for these fixes.
+;;
+;; Revision 1.56 2003/09/08 03:36:53 paulk
+;; Remove unnecessary require for semantic-bnf.
+;;
+;; Revision 1.55 2003/07/15 05:04:06 ahyatt
+;; Fixed problem with private inner classes not being recognized by
+;; jde-parse-get-innermost-class-at-point
+;;
+;; Revision 1.54 2003/03/28 05:33:29 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
+;; Revision 1.53 2003/02/26 02:59:37 jslopez
+;; Supresses more error messages when completing.
+;;
+;; Revision 1.52 2003/02/25 15:55:44 jslopez
+;; Removes error messages that is not needed anymore.
+;;
+;; Revision 1.51 2003/02/25 15:15:58 jslopez
+;; Fixes bug with jde-parse-get-qualified-name.
+;;
+;; Revision 1.50 2003/02/25 15:01:02 jslopez
+;; Modifies jde-parse-get-qualified-name to take an extra parameters.
+;; If it does not find the qualified name it tries importing the class.
+;; And updates a few places where it is call to do that.
+;;
+;; Revision 1.49 2003/02/25 14:49:29 jslopez
+;; Modifies jde-parse-get-qualified-name to take an extra parameters.
+;; If it does not find the qualified name it tries importing the class.
+;;
+;; Revision 1.48 2003/01/23 05:37:16 paulk
+;; Added check to ensure that the name argument to jde-parse-class-exists is
+;; a string. This fixes bug where jde-complete was passing a nil argument to
+;; jde-parse-exists-class-exists.
+;;
;; Revision 1.47 2002/10/05 12:22:51 jslopez
;; Fixes bug in completion when jde-complete-display-qualified-types is set to
;; nil.
1.10 +162 -92 XEmacs/packages/xemacs-packages/jde/lisp/jde-run.el
Index: jde-run.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-run.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- jde-run.el 2003/03/11 05:45:42 1.9
+++ jde-run.el 2006/03/03 20:42:41 1.10
@@ -1,11 +1,11 @@
;; jde-run.el --- runs the Java app in the current buffer.
-;; $Revision: 1.8 $ $Date: 2003/01/18 05:48:46 $
+;; $Revision: 1.89 $ $Date: 2003/11/18 06:28:19 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: tools, processes
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Paul Kinnucan
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Paul Kinnucan
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -244,44 +244,84 @@ nonnil, the JDEE treats the paths as rel
project file for the current project and replaces the period (.) with
the path of the directory containing the project file."
:group 'jde-run-options
-:type '(choice :tag "Classpath Options"
+:type '(choice
+ :tag "Classpath Options"
(const :tag "standard" nil)
(cons :tag "custom" :inline nil
- (choice :tag "Custom Mode"
- (const "append")
- (const "prepend")
- (const "replace"))
- (repeat :tag "Classpath"
- (file :tag "Path")))))
+ (choice
+ :tag "Custom Mode"
+ (const "append")
+ (const "prepend")
+ (const "replace"))
+ (repeat
+ :tag "Classpath"
+ (file :tag "Path")))))
;; (makunbound 'jde-run-option-debug)
-(defcustom jde-run-option-debug (list t "Attach" nil)
- "*If checked, this option allows the application to start and then
-connect to a debugger, for example, jdb or JDEbug. \"DebuggerConnect
-Mode\" specifies the method for establishing the connection. The
-options are \"Attach\" (allow a debugger to attach to the application
-after the applicaiton starts) or \"Client\" (start the application and
-then try to connect the application to a listening debugger). On Unix
- systems, the \"Address\" option specifies the port number
-of the socket used to connect the debugger and the application. On
-Windows systems, it specifies an arbitrary identifier. If \"Address\"
-is nil, the JDEE uses a default value. The default is \"javadebug\" on
-Windows systems and 4444 on Unix systems."
-:group 'jde-run-options
-:type '(list
- (checkbox :format "%[%v%] %t \n\n"
-:tag "Enabled")
- (radio-button-choice :format " %t\n%v"
- :indent 2
-:tag "Debugger Connect Mode:"
- (const "Attach")
- (const "Listen"))
- (choice :format "\n %[Address%] %v\n\n"
- (const :menu-tag "Use Default"
- nil)
- (string :menu-tag "Specify" :tag "Value"))))
-
+(defcustom jde-run-option-debug nil
+ "*If \"Connect\" is selected, this option allows the application to
+ start and then connect to a debugger, for example, jdb or JDEbug.
+
+\"Mode\" specifies the method for establishing the connection. The
+options are \"Server\" (allow a debugger to attach to the application
+after the application starts) or \"Client\" (allows the application to connect
+to a listening debugger).
+
+\"Data Transport\" specifies the method that the debuggee process uses to
+communicate with the debugger. The \"Shared Memory\" option is valid
+only when the the debuggee process and the debugger are both running
+on the same Microsoft Windows system. (It is also the best choice for
+such debugging sessions.) You must choose \"Socket\" if the debugger
+and the debuggee process run on different systems or if they both
+run on the same Unix system.
+
+The \"Shared Memory Name\" option specifies the name of the shared
+memory connection used to connect the debugger and the application.
+This option applies only when you specify a shared memory connection
+to the debugger.
+
+The \"Socket Host\" specifes the host on which a remote debugger
+resides. This option applies only when you run the process in
+client mode, using a socket transport.
+
+The \"Socket Port\" option specifies the socket port used to
+connect this process to the debugger. This option applies only
+when you select socket as the transport method.
+
+The \"Suspend\" option specifies whether the vm should suspend
+this process on startup."
+:group 'jde-run-options
+:type '(choice
+ :tag "Debug Connection Options"
+ (const :tag "No connect" nil)
+ (list
+ :tag "Connect"
+ :inline nil
+ (choice
+ :tag "Mode"
+ (const "Server")
+ (const "Client"))
+ (choice
+ :tag "Data Transport"
+ (const "Shared Memory")
+ (const "Socket"))
+ (choice
+ :tag "Shared Memory Name"
+ (const :menu-tag "Default" "javadebug")
+ (string :menu-tag "Custom" :tag "Name"))
+ (choice
+ :tag "Socket Host"
+ (const :menu-tag "Local" nil)
+ (string :menu-tag "Remote" :tag "Name"))
+ (choice
+ :tag "Socket Port"
+ (const :menu-tag "Default" "4444")
+ (string :menu-tag "Custom" :tag "Address"))
+ (choice
+ :tag "Suspend?"
+ (const :tag "No" nil)
+ (const :tag "Yes" t)))))
(defcustom jde-run-option-interpret-mode nil
"Causes the vm to interpret all byte codes. By default VMs
@@ -754,7 +794,7 @@ panel to specifying the applet document.
(defmethod jde-run-debug-args ((this jde-run-vm-1-1))
"Get arguments required to allow process to connect
to a debugger."
- (if (car jde-run-option-debug)
+ (if jde-run-option-debug
'("-debug")))
(defmethod jde-run-interpret-mode-arg ((this jde-run-vm-1-1))
@@ -828,7 +868,7 @@ to a debugger."
(defmethod jde-run-debug-args ((this jde-run-vm-1-2))
"Get arguments required to allow process to connect
to a debugger."
- (if (car jde-run-option-debug)
+ (if jde-run-option-debug
'("-Xdebug")))
(defmethod jde-run-interpret-mode-arg ((this jde-run-vm-1-2))
@@ -897,16 +937,31 @@ to a debugger."
(defmethod jde-run-debug-args ((this jde-run-vm-1-3))
"Get arguments required to allow process to connect
to a debugger."
- (if (car jde-run-option-debug)
- (let ((mode (nth 1 jde-run-option-debug))
- (address (nth 2 jde-run-option-debug))
- (ms-windows (eq system-type 'windows-nt)))
+ (if jde-run-option-debug
+ (let ((mode (nth 0 jde-run-option-debug))
+ (transport (nth 1 jde-run-option-debug))
+ (shared-mem-name (nth 2 jde-run-option-debug))
+ (socket-host (nth 3 jde-run-option-debug))
+ (socket-port (nth 4 jde-run-option-debug))
+ (suspend (nth 5 jde-run-option-debug))
+ (ms-windows (eq system-type 'windows-nt)))
(list "-Xdebug"
(format
- "-Xrunjdwp:transport=%s,address=%s,server=%s,suspend=n"
- (if ms-windows "dt_shmem" "dt_socket")
- (if address address (if ms-windows "javadebug" "4444"))
- (if (string= mode "Attach") "y" "n"))))))
+ "-Xrunjdwp:transport=%s,address=%s,server=%s,suspend=%s"
+ (if (string= transport "Shared Memory")
+ (if ms-windows
+ "dt_shmem"
+ (error "Shared memory transport is valid only on Windows."))
+ "dt_socket")
+ (if (string= transport "Shared Memory")
+ shared-mem-name
+ (if (string= mode "Client")
+ (if socket-host
+ (concat socket-host ":" socket-port)
+ socket-port)
+ socket-port))
+ (if (string= mode "Server") "y" "n")
+ (if suspend "y" "n"))))))
(defmethod jde-run-get-vm-args ((this jde-run-vm-1-3))
(append
@@ -1078,29 +1133,40 @@ to a debugger."
vm))
;;;###autoload
-(defun jde-run (main-class)
+(defun jde-run (prefix)
"Run the Java application specified by `jde-run-executable', if
-not the null string. Otherwise run the class specified by
-`jde-run-application-class', if non-null; otherwise the class in
-the current buffer. Specifying a prefix argument, e.g.,
-C-u C-c C-v C-r, causes this command to prompt you to enter
-the name of the application's main class This command
-creates a comint buffer to allow you to interact with the program."
- (interactive "P")
+not the null string. Otherwise run the class specified by
+`jde-run-application-class', if non-null; otherwise the class in the
+current buffer. Specifying a prefix argument, e.g., C-u C-c C-v C-r,
+causes this command to prompt you to enter arguments to be passed to
+the application's main method. Specifying a minus prefix argument,
+i.e., C-u - C-c C-v C-r, causes this command to prompt you to also
+enter the name of the application's main class. Note that you can use
+`jde-run-read-app-args' to cause the command to prompt you for
+application arguments by default (i.e., without having to specify a
+prefix argument). This command creates a comint buffer to allow you to
+interact with the program."
+ (interactive "p")
(if (equal major-mode 'jde-mode)
(if (string= jde-run-executable "")
- (let ((vm (jde-run-get-vm)))
+ (let ((vm (jde-run-get-vm))
+ (read-app-args
+ (or jde-run-read-app-args
+ (not (= prefix 1))))
+ (read-main-class
+ (= prefix -1)))
(oset
vm
:main-class
- (if main-class
+ (if read-main-class
(read-from-minibuffer
"Main class: "
(concat (jde-db-get-package)
(file-name-sans-extension
(file-name-nondirectory (buffer-file-name)))))
(jde-run-get-main-class)))
- (jde-run-vm-launch vm))
+ (let ((jde-run-read-app-args read-app-args))
+ (jde-run-vm-launch vm)))
(jde-run-executable))
(error "The jde-run command works only in a Java source buffer.")))
@@ -1117,39 +1183,6 @@ source buffer belongs."
(file-name-nondirectory (buffer-file-name))))))
main-class))
-
-(defun jde-run-get-vm ()
- "Gets the vm for the current JDK."
- (let* ((jdk-version (jde-java-version))
- (vm
- (find-if
- (lambda (vm-x)
- (string-match
- (oref vm-x :version)
- (if jdk-version jdk-version "")))
- jde-run-virtual-machines)))
- (if (not vm)
- (setq vm (car jde-run-virtual-machines)))
- (oset vm
- :path
- (let ((vm-path
- (substitute-in-file-name jde-vm-path)))
- (if (string= vm-path "")
- (jde-get-jdk-prog (if (eq system-type 'windows-nt)
- 'javaw 'java))
- (if (file-exists-p
- (if (and
- (eq system-type 'windows-nt)
- (not (string-match "[.]exe$" vm-path)))
- (concat vm-path ".exe")
- vm-path))
- vm-path
- (if (executable-find vm-path)
- vm-path
- (error "Invalid vm path: %s"
- vm-path))))))
- vm))
-
(defun jde-run-main-class()
"Runs the Java program named by `jde-run-application-class' in
a buffer, piping output from the program to the buffer and
@@ -1159,7 +1192,6 @@ input from the buffer to the program."
(oset vm :main-class (jde-run-get-main-class))
(jde-run-vm-launch vm)))
-
(defmacro save-w32-show-window (&rest body)
"Saves the value of the w32-start-process-show-window variable
before evaluating body and restores the value afterwards."
@@ -1553,8 +1585,46 @@ The point should be anywhere on the line
;; Change History
;; $Log: jde-run.el,v $
-;; Revision 1.8 2003/01/18 05:48:46 andyp
-;; sync to jde 2.3.2
+;; Revision 1.89 2003/11/18 06:28:19 paulk
+;; Fix the jde-run command so that it prompts you for application arguments if
jde-run-read-app-args is nonnil or if the jde-run command has a prefix argument.
+;;
+;; Revision 1.88 2003/09/18 05:35:29 paulk
+;; Fixed bug.
+;;
+;; Revision 1.87 2003/09/14 04:43:19 paulk
+;; Changed jde-run-option-debug to provide separate options for shared memory
+;; name, socket host, and socket port and to specify defaults explicitly.
+;;
+;; Revision 1.86 2003/07/18 12:49:02 paulk
+;; Prefixing the jde-run command (e.g., C-u C-c C-v C-r) now
+;; causes the command to prompt you to enter application arguments.
+;; Prefixing the command with a - (e.g., C-u - C-c C-v C-r)
+;; causes the command to prompt you to enter the name of
+;; the application's main class as well as application arguments.
+;; In previous releases, prefixing the command caused it only
+;; to prompt for the application main class.
+;;
+;; Revision 1.85 2003/06/15 04:36:56 paulk
+;; Enhance jde-run-option-debug to support suspend option.
+;;
+;; Revision 1.84 2003/06/12 04:55:06 paulk
+;; Change terminology in jde-run-option-debug to match documentation, i.e., Attach
becomes Server mode and Listen becomes Client mode.
+;;
+;; Revision 1.83 2003/05/14 06:44:37 paulk
+;; Corrected and expanded the doc string for jde-run-option-debug.
+;;
+;; Revision 1.82 2003/05/14 05:02:02 paulk
+;; Enhance jde-run-option-debug to permit specification of type of data transport
+;; to be used between debugger and debuggee process.
+;;
+;; Revision 1.81 2003/03/28 05:33:30 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
+;; Revision 1.80 2003/03/10 06:13:53 paulk
+;; Simplified data type of jde-run-option-debug and set it off by default.
+;;
+;; Revision 1.79 2003/01/08 21:40:13 jslopez
+;; Removes duplicate definition of jde-run-get-vm.
;;
;; Revision 1.78 2002/11/30 02:54:22 paulk
;; Update jde-run-option-boot-classpath to support the append and prepend
1.8 +3 -3 XEmacs/packages/xemacs-packages/jde/lisp/jde-stat.el
Index: jde-stat.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-stat.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- jde-stat.el 2003/03/11 05:45:42 1.7
+++ jde-stat.el 2006/03/03 20:42:41 1.8
@@ -1,5 +1,5 @@
;;; jde-stat.el -- Integrated Development Environment for Java.
-;; $Revision: 1.6 $ $Date: 2003/01/18 05:48:47 $
+;; $Revision: 1.7 $ $Date: 2003/03/28 05:33:30 $
;; Author: Stephane Nicolas <s.nicolas(a)videotron.ca>
;; Maintainer: Paul Kinnucan
@@ -250,8 +250,8 @@ list of four elements."
;; Change History
;;
;; $Log: jde-stat.el,v $
-;; Revision 1.6 2003/01/18 05:48:47 andyp
-;; sync to jde 2.3.2
+;; Revision 1.7 2003/03/28 05:33:30 andyp
+;; XEmacs optimizations for JDEbug and efc.
;;
;; Revision 1.6 2002/11/21 04:18:41 paulk
;; These packages, when autoloaded, now register and initialize the customization
variables
1.4 +73 -8 XEmacs/packages/xemacs-packages/jde/lisp/jde-util.el
Index: jde-util.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-util.el,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- jde-util.el 2003/01/18 05:48:47 1.3
+++ jde-util.el 2006/03/03 20:42:41 1.4
@@ -1,11 +1,11 @@
;;; jde-util.el -- JDE utilities.
-;; $Revision: 1.7 $ $Date: 2002/08/20 03:09:05 $
+;; $Revision: 1.12 $ $Date: 2003/12/08 03:51:51 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -129,14 +129,64 @@ it returns the file's path. Otherwise, i
"Removes the inner class name for the class"
(car (split-string class "[$]")))
-(defun jde-find-class-source (class)
- "*Find the source file for a specified class.
+
+(defun jde-find-class-source (class &optional other-window)
+ "*Find the source file for a specified class.
Calls `jde-find-class-source-file' to do the search.
If it finds the source file, it opens the file in a buffer."
- (interactive "sClass: ")
- (let ((source (jde-find-class-source-file class)))
- (when source
- (find-file source))))
+ (interactive "sClass: ")
+ (let ((source (jde-find-class-source-file class)))
+ (when source
+ (if (not (string-equal (buffer-file-name) source))
+ (if other-window
+ (find-file-other-window source)
+ (find-file source)))
+ (if (fboundp 'senator-re-search-forward)
+ (let ((inner-class-pos (string-match "\\$" class)))
+ (if inner-class-pos
+ (let ((inner-class (substring class (+ 1 inner-class-pos))))
+ (when inner-class
+ (beginning-of-buffer)
+ (senator-parse)
+ (senator-re-search-forward (concat "\\b" inner-class "\\b") nil
t)))))))))
+
+
+(defun jde-root()
+ "Return the path of the root directory of this JDEE
+installation. The root directory is the parent of the
+directory that contains the JDEE's Lisp files. On
+Emacs and on XEmacs installations that use the
+JDEE distributable, the root directory is the root
+directory that results from unpacking the distributable.
+On installations based on the version of the JDEE
+packaged with XEmacs, the root directory is
+xemacs-packages/lisp."
+ (let ((directory-sep-char ?/))
+ (expand-file-name
+ "../"
+ (file-name-directory (locate-library "jde")))))
+
+(defun jde-find-jde-data-directory ()
+ "Return the path of the JDE data directory.
+Returns the path of the directory containing the
+JDE java and documentation directories; nil if the
+directory cannot be found. If XEmacs, returns the location of
+the data directory in the XEmacs distribution hierarchy. On all other Emacs versions,
+the JDE expects to find the documentation and Java class directories
+in the same directory that contains the JDE lisp directory."
+ (let ((directory-sep-char ?/))
+ (if (featurep 'xemacs)
+ (let ((dir (locate-data-directory "jde")))
+ (if dir dir (jde-root))))
+ (jde-root)))
+
+(defun jde-temp-directory ()
+"Get the location used by the host system to store temporary files."
+ (or (if (boundp 'temporary-file-directory) temporary-file-directory)
+ (if (fboundp 'temp-directory) (temp-directory)
+ (if (member system-type '(cygwin32 cygwin))
+ (jde-cygwin-path-converter-cygpath (temp-directory))
+ (temp-directory)))))
(provide 'jde-util)
@@ -144,6 +194,21 @@ If it finds the source file, it opens th
;;
;; $Log: jde-util.el,v $
+;; Revision 1.12 2003/12/08 03:51:51 paulk
+;; Fix bug in jde-find-class-source.
+;;
+;; Revision 1.11 2003/12/08 03:00:18 paulk
+;; Update jde-find-class-source to work for inner classes.
+;;
+;; Revision 1.10 2003/07/15 01:18:39 paulk
+;; Add jde-temp-directory function.
+;;
+;; Revision 1.9 2003/06/27 04:08:11 paulk
+;; Expand docstring for jde-root function.
+;;
+;; Revision 1.8 2003/04/09 04:05:19 paulk
+;; Adds jde-root function. Rewrote jde-find-jde-data-directory to use jde-root function.
+;;
;; Revision 1.7 2002/08/20 03:09:05 jslopez
;; Fixes bug in jde-find-class-source-file that was not handling
;; inner class properly.
1.9 +6 -1 XEmacs/packages/xemacs-packages/jde/lisp/jde-widgets.el
Index: jde-widgets.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-widgets.el,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- jde-widgets.el 2003/01/18 05:48:47 1.8
+++ jde-widgets.el 2006/03/03 20:42:41 1.9
@@ -1,5 +1,5 @@
;;; jde-widgets.el -- Custom-style widgets used by the JDE
-;; $Revision: 1.24 $ $Date: 2001/12/04 05:27:26 $
+;; $Revision: 1.25 $ $Date: 2003/01/12 23:34:51 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
@@ -276,6 +276,7 @@ tree."
(var-tag (format "%s %s" var-type var-name)))
(cond
((typep var-value 'jde-dbs-java-udci)
+ (setq var-tag (format "%s [id: %d]" var-tag (oref var-value :id)))
(if (string= (oref var-value :jtype) "java.lang.String")
(let* ((cmd (jde-dbs-get-string
"get string"
@@ -295,6 +296,7 @@ tree."
:process process
:object-id (oref var-value :id))))
((typep var-value 'jde-dbs-java-array)
+ (setq var-tag (format "%s [id: %d]" var-tag (oref var-value :id)))
(list 'jde-widget-java-array
:tag var-tag
:node-name var-tag
@@ -582,6 +584,9 @@ expand button causes the widget to displ
(provide 'jde-widgets)
;; $Log: jde-widgets.el,v $
+;; Revision 1.25 2003/01/12 23:34:51 jslopez
+;; Small, patch to reduce the amount of cases that cause infinite recursion.
+;;
;; Revision 1.24 2001/12/04 05:27:26 paulk
;; Moved dialog classes to the efc (Emacs Foundation Classes) package.
;;
1.9 +104 -56 XEmacs/packages/xemacs-packages/jde/lisp/jde-wiz.el
Index: jde-wiz.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-wiz.el,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- jde-wiz.el 2003/01/18 05:48:47 1.8
+++ jde-wiz.el 2006/03/03 20:42:41 1.9
@@ -1,10 +1,10 @@
;;; jde-wiz.el
-;; $Revision: 1.75 $
+;; $Revision: 1.83 $
;; Author: Paul Kinnucan <paulk(a)mathworks.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 2000, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -46,7 +46,7 @@ the classpath defined by jde-global-clas
unqualified class names. If you add any classes to the classpath after invoking
a wizard, you should update the class list."
(interactive)
- (if (bsh-running-p)
+ (if (jde-bsh-running-p)
(progn
(message "Rescanning classes...")
(jde-jeval (jde-create-prj-values-str))
@@ -63,7 +63,7 @@ projects does not necessarily force a re
is cached in the beanshell. You can force a rescan for a project by
calling `jde-wiz-update-class-list'."
(interactive)
- (when (bsh-running-p)
+ (when (jde-bsh-running-p)
(jde-jeval (jde-create-prj-values-str))))
(defun jde-wiz-get-package-name ()
@@ -136,7 +136,7 @@ extends clause is updated"
"jde.wizards.InterfaceFactory.getImportedClasses();")))
(eval code)
(if required-imports
- (jde-import-insert-imports-into-buffer required-imports))
+ (jde-import-insert-imports-into-buffer required-imports t))
(jde-wiz-update-implements-clause interface-name)))))
(defun jde-wiz-gen-implementation-methods (gen-list)
@@ -152,9 +152,7 @@ subsequent method(s) or invocations of `
(jde-gen-section-comment))
(eval (car items)))
(goto-char (- (point-max) to-end)))
- (setq items (cdr items))
- ))
- )
+ (setq items (cdr items)))))
(defun jde-wiz-implement-interface-internal (interface-name)
"*Generate a skeleton implementation of a specified interface.
@@ -168,13 +166,11 @@ set, otherwise the CLASSPATH environment
interface-name ))))
(if names
(if (> (length names) 1)
- (let ((dialog
- (efc-option-dialog
- "class name dialog"
- :options names
- :text "Select interface to implement.")))
- (efc-dialog-show dialog)
- (jde-wiz-generate-interface (oref dialog selection)))
+ (jde-wiz-generate-interface
+ (efc-query-options
+ names
+ "Select interface to implement."
+ "Class Name dialog"))
(jde-wiz-generate-interface (car names)))
(error "Cannot find interface %s on the current classpath."
interface-name))))
@@ -183,7 +179,16 @@ set, otherwise the CLASSPATH environment
"*Generate a skeleton implementation of a specified interface.
This command works only for interfaces that exist on the classpath
defined by `jde-global-classpath', if set, otherwise
-by the CLASSPATH environment variable."
+by the CLASSPATH environment variable. This command uses
+`jde-gen-method-template' as a template for generating the
+code for each of the skeleton methods required to implement
+the interface. You can thus customize the format of the skeleton
+methods by customizing `jde-gen-method-template' The template
+in turn invokes the `jde-javadoc-autodoc-at-line' function to
+generate the skeleton javadoc for each skeleton method. This function
+uses various templates that you can customize to customize
+the skeleton javadoc. See the function's documentation for
+more information."
(interactive
"sInterface name: ")
(condition-case err
@@ -219,7 +224,7 @@ to store the listeners too."
(message "%s" "eval done")
(jde-wiz-indent pos)
(if required-imports
- (jde-import-insert-imports-into-buffer required-imports)
+ (jde-import-insert-imports-into-buffer required-imports t)
(message "%s" "no imports"))
)))
(error
@@ -277,13 +282,10 @@ set, otherwise the CLASSPATH environment
(format "jde.util.JdeUtilities.getQualifiedName(\"%s\");"
interface-name ))))
(if names
(if (> (length names) 1)
- (let ((dialog
- (efc-option-dialog
- "class name dialog"
- :options names
- :text "Select interface to implement.")))
- (efc-dialog-show dialog)
- (jde-wiz-generate-event-source (oref dialog selection)))
+ (jde-wiz-generate-event-source
+ (efc-query-options names
+ "Select interface to implement."
+ "class name dialog"))
(jde-wiz-generate-event-source (car names)))
(error "Cannot find listener interface %s on the current classpath."
interface-name)))
(error
@@ -336,7 +338,7 @@ NOTE: this command works only if the ove
(condition-case err
(let* ((super-class (jde-parse-get-super-class-at-point))
(qualified-super-class
- (jde-parse-get-qualified-name super-class))
+ (jde-parse-get-qualified-name super-class t))
(classinfo
(jde-complete-get-classinfo qualified-super-class jde-complete-protected))
pair pos class-name qualified-class-name method-name)
@@ -357,7 +359,7 @@ NOTE: this command works only if the ove
(setq class-name
(jde-parse-get-super-class-at-point))
(setq qualified-class-name
- (jde-parse-get-qualified-name class-name))
+ (jde-parse-get-qualified-name class-name t))
(setq pos (string-match "(" method-name))
(if qualified-super-class
@@ -395,7 +397,7 @@ NOTE: this command works only if the ove
(jde-jeval-r
"jde.wizards.MethodOverrideFactory.getImportedClasses();"))
(if required-imports
- (jde-import-insert-imports-into-buffer required-imports))))
+ (jde-import-insert-imports-into-buffer required-imports t))))
(defun jde-wiz-gen-method (modifiers return-type name parameters exceptions
default-body)
@@ -472,32 +474,46 @@ the cursor"
(fq-class-name
(jde-parse-select-qualified-class-name class)))
(if fq-class-name
- (bsh-eval (format "browseClass(\"%s\");" fq-class-name)))))
-
-(defun jde-wiz-delegate (attribute-name)
- "*Generate delegation methods for a given attribute.
-This method generates methods in the current buffer that delegate
-calls to methods of the given ATTRIBUTE of the current class. For
-example, if the current buffer contains Java class A and there is
-an attribute in A named b of class type B, this method will
-generate in A, all the public methods of class B and delegate
-handling of those methods via attribute B."
+ (bsh-eval
+ (oref 'jde-bsh the-bsh)
+ (format "browseClass(\"%s\");" fq-class-name)))))
+
+(defun jde-wiz-delegate (delegee)
+ "*Generate methods for the class in the current source buffer
+that delegate tasks to an instance of another class. The delegator
+class must have a field that references an instance of the delegee
+class. DELEGEE is the name of the field in the delegator class that
+references the delegee. This command generates methods in the current
+buffer that invoke identically named methods of DELEGEE. For example,
+if the current buffer contains class A and A has a field named b that
+references an instance of class B, this command generates methods for
+A that have the same signatures as the public methods of B. Each of
+the generated A methods invokes the corresponding B method.
+
+This function uses `jde-gen-method-template' as a template for
+generating the skeleton code for each of the the delegated methods.
+You can thus customize the format of the skeleton methods by
+customizing `jde-gen-method-template' The template in turn invokes the
+`jde-javadoc-autodoc-at-line' function to generate the skeleton
+javadoc for each skeleton method. This function uses various templates
+that you can customize to customize the skeleton javadoc. See the
+function's documentation for more information."
(interactive
- "sAttribute name: ")
+ "sDelegee name: ")
(condition-case err
(let* ((pos (point))
(start nil)
(class-name
(or (jde-parse-get-qualified-name
- (car (jde-parse-declared-type-of attribute-name)))
+ (car (jde-parse-declared-type-of delegee)) t)
(read-string (concat "Enter fully qualified class name of "
- attribute-name ": "))))
+ delegee ": "))))
(code
(read
(jde-jeval
(concat
- "jde.wizards.DelegateFactory.makeDelegatesExpression(\""
- attribute-name "\", \"" class-name "\",
true);")))))
+ "jde.wizards.DelegateFactory.makeDelegatorMethods(\""
+ delegee "\", \"" class-name "\", true);")))))
(if code
(let ((required-imports
(jde-jeval-r
@@ -508,7 +524,7 @@ handling of those methods via attribute
;;indenting the new code
(jde-wiz-indent pos)
(if required-imports
- (jde-import-insert-imports-into-buffer required-imports))
+ (jde-import-insert-imports-into-buffer required-imports t))
(font-lock-mode)
)))
(error
@@ -533,7 +549,7 @@ handling of those methods via attribute
"jde.wizards.AbstractClassFactory.getImportedClasses();")))
(eval code)
(if required-imports
- (jde-import-insert-imports-into-buffer required-imports))
+ (jde-import-insert-imports-into-buffer required-imports t))
(jde-wiz-update-implements-clause class-name t))))
(message "%s" (error-message-string err))))
@@ -550,12 +566,9 @@ set, otherwise the CLASSPATH environment
class-name ))))
(if names
(if (> (length names) 1)
- (let ((dialog
- (efc-option-dialog
- "class name dialog"
- :options names)))
- (efc-dialog-show dialog)
- (jde-wiz-generate-abstract-class (oref dialog selection)))
+ (jde-wiz-generate-abstract-class
+ (efc-query-options names nil
+ "class name dialog"))
(jde-wiz-generate-abstract-class (car names)))
(message "Cannot find abstract class %s on the current classpath."
class-name)))
@@ -565,7 +578,16 @@ set, otherwise the CLASSPATH environment
"*Generate a skeleton implementation of the abstract methods of the
a specified class. This command works only for abstract classes that exist
on the classpath defined by `jde-global-classpath', if set, otherwise
-by the CLASSPATH environment variable."
+by the CLASSPATH environment variable.
+
+This command uses `jde-gen-method-template' as a template for
+generating the skeleton code for each of the abstract methods. You can
+thus customize the format of the skeleton methods by customizing
+`jde-gen-method-template' The template in turn invokes the
+`jde-javadoc-autodoc-at-line' function to generate the skeleton
+javadoc for each skeleton method. This function uses various templates
+that you can customize to customize the skeleton javadoc. See the
+function's documentation for more information."
(interactive
"sAbstract class name: ")
(jde-wiz-extend-abstract-class-internal class-name))
@@ -575,11 +597,8 @@ by the CLASSPATH environment variable."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defcustom jde-wiz-include-javadoc t
- "This variables indicates if javadoc comments should be included in
-skeletons created by wizards. This variable modifies the output
-of the functions `jde-wiz-get-set-methods',
-`jde-wiz-generate-interface', `jde-wiz-extend-abstract-class' and
-`jde-wiz-delegate'"
+ "This variables specifies whether javadoc comments should be included in
+skeletons created by the `jde-wiz-get-set-methods' function."
:group 'jde-wiz
:type 'boolean)
@@ -1037,6 +1056,35 @@ return \"Name\"."
;;; Change History:
;; $Log: jde-wiz.el,v $
+;; Revision 1.83 2003/09/22 02:57:49 paulk
+;; Cosmetic change.
+;;
+;; Revision 1.82 2003/09/07 05:21:12 paulk
+;; Fix interface, abstract class, and method delegation wizards
+;; to observe jde-import-excluded-classes. Thanks to Martin
+;; Schwamberger.
+;;
+;; Revision 1.81 2003/04/09 02:24:42 paulk
+;; Tiny docstring change.
+;;
+;; Revision 1.80 2003/03/28 05:33:30 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
+;; Revision 1.79 2003/03/19 04:11:06 paulk
+;; Updated doc for jde-wiz-include-javadoc, jde-wiz-generate-interface,
jde-wiz-delegate,
+;; jde-wiz-generate-abstract-class commands.
+;;
+;; Revision 1.78 2003/02/25 15:01:01 jslopez
+;; Modifies jde-parse-get-qualified-name to take an extra parameters.
+;; If it does not find the qualified name it tries importing the class.
+;; And updates a few places where it is call to do that.
+;;
+;; Revision 1.77 2003/02/18 02:09:40 jslopez
+;; Fixes regression bugs.
+;;
+;; Revision 1.76 2003/02/17 08:13:05 paulk
+;; Changes required to support new package-independent version of beanshell.el
+;;
;; Revision 1.75 2002/09/16 04:04:50 paulk
;; Added require statement for semantic-util. Thanks to Andy Piper.
;;
1.3 +306 -243 XEmacs/packages/xemacs-packages/jde/lisp/jde-xref.el
Index: jde-xref.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde-xref.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- jde-xref.el 2003/03/11 05:45:42 1.2
+++ jde-xref.el 2006/03/03 20:42:41 1.3
@@ -1,7 +1,7 @@
;; JDE-XREF.EL --- Class cross-reference commands for the JDEE.
-;; $Revision: 1.1 $ $Date: 2003/01/18 05:48:47 $
+;; $Revision: 1.23 $ $Date: 2003/11/07 04:27:14 $
;;
-;; Copyright (C) 2002 Andrew Hyatt
+;; Copyright (C) 2002, 2003 Andrew Hyatt
;;
;; Author: Andrew Hyatt <andy_jde(a)thehyatts.net>
;; Maintainers: Andrew Hyatt and Paul Kinnucan
@@ -26,7 +26,7 @@
;; LCD Archive Entry:
;; jde-xref|Andrew Hyatt|
;; |Java class cross-referencing commands for the JDEE
-;; |$Date: 2003/01/18 05:48:47 $|$Revision: 1.1 $|~/packages/jde-xref.el
+;; |$Date: 2003/11/07 04:27:14 $|$Revision: 1.23 $|~/packages/jde-xref.el
;;; Commentary:
@@ -55,11 +55,15 @@
;; functionality is not always wanted, so the functions that show
;; caller information can either use it or not.
;;
-;; The other table is a table of which class has which methods and
+;; The third table is a table of which class has which methods and
;; fields. This is necessary to determine which references to
;; subclasses really are references to a superclass because the fields
;; or methods have not been overriden.
;;
+;; The fourth table is a table of classes to superclasses, necessary
+;; to figure out when a call to superclass might be a call to a
+;; subclass (when the user asks about calls to the subclass).
+;;
;; There is also a global table across all packages, which is a
;; map of which classes are subclasses of which other classes. This
;; makes it possible to investigate a class's subclasses when looking
@@ -68,6 +72,7 @@
(require 'jde-parse)
(require 'jde-parse-class)
+(require 'jde-class)
(require 'tree-widget)
(defconst jde-xref-version "1.5")
@@ -76,8 +81,9 @@
"JDEE Class Cross-Reference (Refactoring) Options"
:group 'jde
:prefix "jde-xref-")
+
-(defcustom jde-xref-db-base-directory nil
+(defcustom jde-xref-db-base-directory "."
"The path to store the directory which contains the database of
which function calls which. The data directory will be called
\"xrefdb\" and will reside in the directory pointed to at this
@@ -85,22 +91,11 @@
:group 'jde-xref
:type 'directory)
-(defcustom jde-xref-class-path nil
- "Similar to `jde-global-classpath', except this path should only
-have those items that the user wants to be in the database of
-functions calls (for the finding of callers to functions
-functionality). This does not have to correspond in any way to a
-package structure, it merely has to be a list of places to recursively
-descend to find all class files."
-:group 'jde-xref
-:type '(repeat (file :tag "Path")))
-
(defcustom jde-xref-store-prefixes nil
- "A list of what prefixes to put in the database. A value of NIL
- indicates that to store everything (this will include which
- functions call java functions like println, etc.) Otherwise, it is
- a list of prefixes such as: '(\"org\" \"jde\"), to keep track
of all
- references to classes that start with \"org\" or \"jde\"."
+ "A list of what prefixes to specify what references should be
+ tracked in the caller database. Such as: '(\"org.apache\"
\"jde\"),
+ to keep track of all references to classes that start with
+ \"org.apache\" or \"jde\"."
:group 'jde-xref
:type '(repeat (string :tag "Prefix")))
@@ -130,14 +125,6 @@ descend to find all class files."
"A hashtable containing a list of which classes subclass which other
subclasses.")
-(defun jde-xref-remove-all-from-directory (dir)
- (if (file-directory-p dir)
- (progn
- (mapcar 'jde-xref-remove-all-from-directory
- (directory-files dir t "[^\\.]$"))
- (delete-directory dir))
- (delete-file dir)))
-
(defun jde-xref-pickle-hash (hash filename)
"Store HASH in the file FILENAME. The hash can be retrieved by
calling `jde-xref-unpickle-hash'."
@@ -164,40 +151,68 @@ FILENAME must be created by `jde-xref-pi
(unless (file-exists-p filename)
(error (concat "Cannot unpickle - file " filename " does not exist.
"
"The xref database may need to be recreated.")))
- (save-excursion
- (let ((buf (find-file-noselect filename)))
- (set-buffer buf)
- (goto-char (point-min))
- (dolist (item (read buf))
- (puthash (car item) (cdr item) hash))
- (kill-buffer buf))))
+ (dolist (item (with-temp-buffer
+ (insert-file-contents-literally filename)
+ (read (current-buffer))))
+ (puthash (car item) (cdr item) hash)))
(defun jde-xref-get-db-directory ()
(concat (jde-normalize-path jde-xref-db-base-directory) "/xrefdb"))
+(defun jde-xref-guess-and-set-prefixes ()
+ (let ((prefixes (jde-xref-guess-prefixes)))
+ (when prefixes
+ (setq jde-xref-store-prefixes prefixes))))
+
+(defun jde-xref-guess-prefixes ()
+ "Try to guess what the prefixes are. Return the prefix list if
+ correctly guessed, otherwise return NULL. This works by looking at
+ the sourcepath, and putting all the top-level packages in the list,
+ where toplevel is defined as being a package from which all the
+ other packages branch out from."
+
+ (labels ((get-prefix (base-path package-path)
+ ;; if the directory contains just one directory (or two,
+ ;; one being CVS), then we can recurse down it to build
+ ;; up a proper prefix before the package tree really
+ ;; branches out
+ (let ((files (remove-if-not
+ (lambda (dir) (and (file-directory-p
+ (concat base-path "/"
package-path "/" dir)))
+ (not (equal "CVS" dir)))
+ (directory-files
+ (concat base-path "/" package-path)
+ nil "[^.]$"))))
+ (if (eq (length files) 1)
+ (get-prefix base-path (concat package-path "/"
+ (car files)))
+ (subst-char-in-string ?/ ?. package-path)))))
+ (when (and (eq major-mode 'jde-mode) jde-sourcepath)
+ (let ((first-prefix (car (split-string (jde-parse-get-package-name)
+ "\\."))) (prefixes))
+ (dolist (path (remove-if-not (lambda (path) (file-exists-p path)) jde-sourcepath)
prefixes)
+ (when (member first-prefix (directory-files path nil "[^.]$"))
+ (message (concat "path = " path))
+ (add-to-list 'prefixes (get-prefix path first-prefix))))))))
+
;;;###autoload
(defun jde-xref-make-xref-db ()
"Create a database of caller to callee (and the reverse) from the
-classes in `jde-xref-class-path' and store the data in the location
+classes in `jde-built-class-path' and store the data in the location
specified by `jde-xref-db-file'"
(interactive)
(when (null jde-xref-db-base-directory)
(error "The variable `jde-xref-db-base-directory' must be defined to make a
caller database"))
- (when (null jde-xref-class-path)
- (error "The variable `jde-xref-class-path' must be defined to make a caller
database"))
+ (when (null jde-built-class-path)
+ (error "The variable `jde-built-class-path' must be defined to make a caller
database"))
+ (when (null jde-xref-store-prefixes)
+ (error "The variable `jde-xref-store-prefixes' must be defined to make a
caller database"))
(unless (file-exists-p (jde-xref-get-db-directory))
(make-directory (jde-xref-get-db-directory)))
(jde-xref-update-xref-db )
(message "Finished creating xref database")
- (add-hook 'jde-compile-finish-hook 'jde-xref-update-caller-table)
(add-hook 'after-save-hook 'jde-xref-file-saved))
-(defun jde-xref-partial-match-member (str list)
- "Like `member' but works with strings and will return true if any of
-the strings in LIST exist at the end of STR"
- (member-if (lambda (item) (string-match (concat (regexp-quote item) "$")
- str)) list))
-
(defun jde-xref-substring-member (str prefixlist)
"Like `member' but works with strings and will return true if any of
the prefixes in PREFIXLIST match STR"
@@ -222,9 +237,7 @@ the strings in LIST exist at the end of
data))
(defun jde-xref-update-xref-db (&optional only-classes)
- (let ((origdir default-directory)
- (origbuf (current-buffer))
- (package-data (if only-classes
+ (let ((package-data (if only-classes
(jde-xref-get-package-data)
(make-hash-table :test 'equal :size 10)))
(subclasses (make-hash-table :test 'equal :size 500)))
@@ -240,66 +253,38 @@ the strings in LIST exist at the end of
(nth 0 single-package-data)))
(nth 0 single-package-data)))
package-data))
- (unwind-protect
- (progn
- (dolist (path jde-xref-class-path)
- (let ((normalized-path (jde-normalize-path path)))
- (unless (file-exists-p normalized-path)
- (error (concat "Could not find file or directory "
- normalized-path)))
- (if (file-directory-p normalized-path)
- (jde-xref-make-db-from-path normalized-path
- package-data
- subclasses
- only-classes)
- ;; we're a directory, assume we are a jar file
- (let ((dir (concat temporary-file-directory "/"
- (make-temp-name "jde-xref"))))
- (make-directory dir)
- (cd dir)
- (let ((buf (get-buffer-create "*Jar output*")))
- (unless (eq (call-process (jde-get-jdk-prog 'jar) nil buf nil
"-xf"
- (expand-file-name normalized-path)) 0)
- (error (concat "Could not unjar file " (expand-file-name
- normalized-path)
- ". See *Jar output* buffer for details")))
- (kill-buffer buf))
- (jde-xref-make-db-from-path dir
- package-data
- subclasses
- only-classes)
- (jde-xref-remove-all-from-directory dir))))))
- (set-buffer origbuf)
- (cd origdir)
- (setq jde-xref-parsed-classes nil)
- (jde-xref-pickle-hash subclasses (jde-xref-get-subclass-file))
- (setq jde-xref-subclasses subclasses)
- (maphash (lambda (package data)
- (jde-xref-pickle-hash (nth 0 data)
- (jde-xref-get-caller-file package))
- (jde-xref-pickle-hash (nth 1 data)
- (jde-xref-get-interface-file package))
- (jde-xref-pickle-hash (nth 2 data)
- (jde-xref-get-member-file package)))
- package-data))))
-
-
-(defun jde-xref-path-in-classes-p (path classes)
- "Returns true if the PATH looks like it represents a class in CLASSES"
- (jde-xref-partial-match-member
- (jde-replace-regexp-in-string "\\.[Cc][Ll][Aa][Ss][Ss]$" ""
- (jde-replace-regexp-in-string "/\\|\\$" "." path))
- classes))
+ (with-all-class-infos-when (info)
+ (lambda (class-file)
+ (or (null only-classes)
+ (jde-class-path-in-classes-p
+ class-file only-classes)))
+ (jde-xref-add-class-info-to-db info package-data
+ subclasses))
+ (setq jde-xref-parsed-classes nil)
+ (jde-xref-pickle-hash subclasses (jde-xref-get-subclass-file))
+ (setq jde-xref-subclasses subclasses)
+ (maphash (lambda (package data)
+ (jde-xref-pickle-hash (nth 0 data)
+ (jde-xref-get-caller-file package))
+ (jde-xref-pickle-hash (nth 1 data)
+ (jde-xref-get-interface-file package))
+ (jde-xref-pickle-hash (nth 2 data)
+ (jde-xref-get-member-file package))
+ (jde-xref-pickle-hash (nth 3 data)
+ (jde-xref-get-superclass-file package)))
+ package-data)
+ (setq jde-xref-cache nil)))
(defun jde-xref-create-package-hashes (&optional fake)
"Returns a list of the three hashes that are in a package's data.
-The hashes are for the caller-hash, the interface-hash and the
-member-hash. FAKE determines if we are just creating them so that
-there is something to check against. In those circumstance we just
-create tiny hashes to conserve memory."
+The hashes are for the caller-hash, the interface-hash, the
+member-hash, and the superclass hash. FAKE determines if we are just
+creating them so that there is something to check against. In those
+circumstance we just create tiny hashes to conserve memory."
(list (make-hash-table :test 'equal :size (if fake 1 100))
(make-hash-table :test 'equal :size (if fake 1 20))
- (make-hash-table :test 'equal :size (if fake 1 100))))
+ (make-hash-table :test 'equal :size (if fake 1 100))
+ (make-hash-table :test 'equal :size (if fake 1 20))))
(defun jde-xref-load-package-hashes (package)
(let ((data (jde-xref-create-package-hashes)))
@@ -309,6 +294,8 @@ create tiny hashes to conserve memory."
(jde-xref-get-interface-file package))
(jde-xref-unpickle-hash (nth 2 data)
(jde-xref-get-member-file package))
+ (jde-xref-unpickle-hash (nth 3 data)
+ (jde-xref-get-superclass-file package))
data))
(defun jde-xref-append-hash (key value hash)
@@ -317,106 +304,100 @@ create tiny hashes to conserve memory."
value
(list value))) hash))
-(defun jde-xref-make-db-from-path (path package-data subclasses
- &optional only-classes)
- (if (file-directory-p path)
- (dolist (path (directory-files path t "[^.]$"))
- (jde-xref-make-db-from-path path package-data
- subclasses
- only-classes))
- (when (and (string-match "\.[Cc][Ll][Aa][Ss][Ss]$" path)
- (or (null only-classes) (jde-xref-path-in-classes-p
- path only-classes))
- (not (jde-xref-path-in-classes-p path jde-xref-parsed-classes)))
- (message (concat "Parsing class " path))
- (let ((info (jde-parse-class path)))
- (add-to-list 'jde-xref-parsed-classes
- (jde-parse-class-extract-classname info))
- (let ((package (jde-parse-get-package-from-name
- (jde-parse-class-extract-classname info))))
- ;; If there is no existing package data
- (unless (gethash package package-data)
- (puthash package
- ;; package-data's values are (caller-hash
- ;; interface-hash method-and-field-hash)
- (jde-xref-create-package-hashes)
- package-data))
- (destructuring-bind (caller-hash interface-hash
- method-and-field-hash)
- (gethash package package-data)
- (puthash (jde-parse-class-extract-classname info)
- (jde-parse-class-extract-interfaces info)
- interface-hash)
- (puthash (jde-parse-class-extract-classname info)
- (append (jde-parse-class-extract-method-signatures info)
- (jde-parse-class-extract-field-signatures info))
- method-and-field-hash)
- (jde-xref-append-hash
- (jde-parse-class-extract-superclass info)
- (jde-parse-class-extract-classname info) subclasses)
- (dolist (call (nreverse
- (jde-parse-class-extract-method-calls info)))
- (let ((calls (car call))
- (called (cadr call)))
- (if (or (not jde-xref-store-prefixes)
- (and
- (jde-xref-substring-member (car calls)
- jde-xref-store-prefixes)
- (jde-xref-substring-member (car called)
- jde-xref-store-prefixes)))
- (let* ((dqcalled (list (car called)
- (nth 1 called)
- (when (nth 2 called)
- (jde-parse-get-unqualified-name
- (nth 2 called)))
- ;; We don't want to need to
- ;; know the constructor args
- ;; for anonymous classes
- (unless (jde-xref-is-class-anonymous (car
called))
- (mapcar 'jde-parse-get-unqualified-name
- (nth 3 called)))))
- (called-package (jde-parse-get-package-from-name
- (car dqcalled))))
- ;; Create the package data if needed
- (unless (gethash called-package package-data)
- (puthash called-package (jde-xref-create-package-hashes)
- package-data))
- (let* ((called-package-hashes
- (gethash called-package package-data))
- (called-package-caller-hash
- (car called-package-hashes)))
- ;; add things to the table - making sure there are no duplicates
- (puthash dqcalled
- (if (member calls (gethash
- dqcalled
- called-package-caller-hash))
- (gethash dqcalled called-package-caller-hash)
- (cons calls
- (gethash dqcalled
- called-package-caller-hash)))
- called-package-caller-hash))))))))))))
+(defun jde-xref-add-class-info-to-db (info package-data subclasses)
+ (message (concat "Parsing class " (jde-parse-class-extract-classname info)))
+ (add-to-list 'jde-xref-parsed-classes
+ (jde-parse-class-extract-classname info))
+ (let ((package (jde-parse-get-package-from-name
+ (jde-parse-class-extract-classname info))))
+ ;; If there is no existing package data
+ (unless (gethash package package-data)
+ (puthash package
+ ;; package-data's values are (caller-hash
+ ;; interface-hash method-and-field-hash)
+ (jde-xref-create-package-hashes)
+ package-data))
+ (destructuring-bind (caller-hash interface-hash
+ method-and-field-hash superclass-hash)
+ (gethash package package-data)
+ (puthash (jde-parse-class-extract-classname info)
+ (jde-parse-class-extract-interfaces info)
+ interface-hash)
+ (puthash (jde-parse-class-extract-classname info)
+ (append (jde-parse-class-extract-method-signatures info)
+ (jde-parse-class-extract-field-signatures info))
+ method-and-field-hash)
+ (puthash (jde-parse-class-extract-classname info)
+ (jde-parse-class-extract-superclass info)
+ superclass-hash)
+ (jde-xref-append-hash
+ (jde-parse-class-extract-superclass info)
+ (jde-parse-class-extract-classname info) subclasses)
+ (dolist (call (nreverse
+ (jde-parse-class-extract-method-calls info)))
+ (let ((calls (car call))
+ (called (cadr call)))
+ (if (or (not jde-xref-store-prefixes)
+ (and
+ (jde-xref-substring-member (car calls)
+ jde-xref-store-prefixes)
+ (jde-xref-substring-member (car called)
+ jde-xref-store-prefixes)))
+ (let* ((dqcalled (list (car called)
+ (nth 1 called)
+ (when (nth 2 called)
+ (jde-parse-get-unqualified-name
+ (nth 2 called)))
+ ;; We don't want to need to
+ ;; know the constructor args
+ ;; for anonymous classes
+ (unless (jde-xref-is-class-anonymous (car called))
+ (mapcar 'jde-parse-get-unqualified-name
+ (nth 3 called)))))
+ (called-package (jde-parse-get-package-from-name
+ (car dqcalled))))
+ ;; Create the package data if needed
+ (unless (gethash called-package package-data)
+ (puthash called-package (jde-xref-create-package-hashes)
+ package-data))
+ (let* ((called-package-hashes
+ (gethash called-package package-data))
+ (called-package-caller-hash
+ (car called-package-hashes)))
+ ;; add things to the table - making sure there are no duplicates
+ (puthash dqcalled
+ (if (member calls (gethash
+ dqcalled
+ called-package-caller-hash))
+ (gethash dqcalled called-package-caller-hash)
+ (cons calls
+ (gethash dqcalled
+ called-package-caller-hash)))
+ called-package-caller-hash)))))))))
(defun jde-xref-class-and-token-to-signature (class token)
- (list (semantic-token-token token)
- class
- (if (equal (semantic-token-name token)
- (jde-parse-get-unqualified-name
- class))
- "<init>"
- (semantic-token-name token))
- (when (eq (semantic-token-token token) 'function)
- (if (or (not (nth 2 token)) (equal (nth 2 token) "void"))
- nil
- (jde-parse-get-unqualified-name (nth 2 token))))
- (if (eq (semantic-token-token token) 'function)
- (mapcar (lambda (arg) (jde-parse-get-unqualified-name (nth 2 arg)))
- (semantic-token-function-args token))
- (list (jde-parse-get-unqualified-name (nth 2 token))))))
+ (let ((ttype (semantic-token-type token))
+ (tclass (semantic-token-token token))
+ (tname (semantic-token-name token)))
+ (list tclass
+ class
+ (if (equal tname (jde-parse-get-unqualified-name class))
+ "<init>"
+ tname)
+ (when (eq tclass 'function)
+ (if (or (not ttype) (equal ttype "void"))
+ nil
+ (jde-parse-get-unqualified-name ttype)))
+ (if (eq tclass 'function)
+ (mapcar (lambda (arg)
+ (jde-parse-get-unqualified-name
+ (semantic-token-type arg)))
+ (semantic-token-function-args token))
+ (list (jde-parse-get-unqualified-name ttype))))))
(defun jde-xref-get-current-class ()
- (concat (jde-parse-get-package-name) (when (jde-parse-get-package-name) ".")
- (or (car (jde-parse-get-innermost-class-at-point))
- (jde-parse-get-buffer-class))))
+ (let ((package-name (jde-parse-get-package-name)))
+ (concat package-name (when package-name ".") (replace-regexp-in-string
"\\." "$" (jde-parse-get-class-at-point)))))
(defun jde-xref-get-current-signature ()
(unless (member
@@ -432,7 +413,10 @@ create tiny hashes to conserve memory."
"Put the list of who calls the current function on the stack and
display the first caller. Subsequent callers are displayed through
`jde-xref-show-next-caller'. STRICT should be true if the callers of
-interfaces to a function should not be considered"
+interfaces to a function, or calls to a superclass which may result in
+a virtual function call to the subclass should not be considered. In
+other words, if STRICT is true, then only calls that are definitely to
+the requested function are considered."
(interactive "P")
(jde-xref-load-subclasses-table-if-necessary)
(setq jde-xref-stack (jde-xref-get-callers
@@ -449,7 +433,9 @@ interfaces to a function should not be c
and show it"
(interactive)
(if jde-xref-stack
- (jde-xref-goto-caller (pop jde-xref-stack))
+ (if (listp (car jde-xref-stack))
+ (jde-xref-goto-caller (pop jde-xref-stack))
+ (jde-xref-goto-caller (pop (pop jde-xref-stack)))) ;; skip over called classname
(message "No more calls")))
(defun jde-xref-load-subclasses-table-if-necessary ()
@@ -459,7 +445,6 @@ and show it"
(jde-xref-get-subclass-file))
;; if subclasses were empty, then it's the first time this is run,
;; so do our one-time initializations
- (add-hook 'jde-compile-finish-hook 'jde-xref-compile-hook)
(add-hook 'after-save-hook 'jde-xref-file-saved)))
(defun jde-xref-signature-to-string (sig)
@@ -486,13 +471,16 @@ and show it"
(defun jde-xref-get-member-file (package)
(concat (jde-xref-get-db-directory) "/" package "-members"))
+(defun jde-xref-get-superclass-file (package)
+ (concat (jde-xref-get-db-directory) "/" package "-superclasses"))
+
(defun jde-xref-get-subclass-file ()
(concat (jde-xref-get-db-directory) "/subclasses"))
(defun jde-xref-find-or-create-package-in-cache (package)
(unless jde-xref-db-base-directory
(error "The variable `jde-xref-db-base-directory' must be specified to load
the xref db"))
- (if (jde-xref-substring-member package jde-xref-store-prefixes)
+ (if (file-exists-p (jde-xref-get-caller-file package))
(or (jde-xref-find-package-in-cache package jde-xref-cache)
;; Or we need to get the new package and put it in the cache
(let ((data (jde-xref-load-package-hashes package)))
@@ -513,6 +501,9 @@ and show it"
(defun jde-xref-get-member-hash (package)
(nth 2 (jde-xref-find-or-create-package-in-cache package)))
+(defun jde-xref-get-superclass-hash (package)
+ (nth 3 (jde-xref-find-or-create-package-in-cache package)))
+
(defun jde-xref-get-basic-caller (sig)
(gethash (cdr sig) (jde-xref-get-caller-hash (jde-parse-get-package-from-name
(nth 1 sig)))))
@@ -521,6 +512,10 @@ and show it"
(gethash class (jde-xref-get-member-hash (jde-parse-get-package-from-name
class))))
+(defun jde-xref-get-superclass (class)
+ (gethash class (jde-xref-get-superclass-hash (jde-parse-get-package-from-name
+ class))))
+
(defun jde-xref-is-class-anonymous (class)
(string-match "\\$[0-9]+$" class))
@@ -531,32 +526,46 @@ and show it"
(jde-xref-is-class-anonymous (nth 1 sig)))
(defun jde-xref-get-callers (sig &optional strict)
- (let ((package (jde-parse-get-package-from-name (nth 1 sig)))
- (interface-callers nil))
+ (let ((typesig (car sig))
+ (classname (cadr sig)))
(append
;; if we're an anonymous class, then we want to see where we are
;; created, since it kind of goes along with usage of the function.
(when (jde-xref-is-sig-anonymous-class sig)
- (jde-xref-get-basic-caller (list (nth 0 sig) (nth 1 sig)
- "<init>" nil nil)))
- (unless strict
- (dolist (interface (gethash (nth 1 sig)
- (jde-xref-get-interface-hash
- package))
- interface-callers)
- (setq interface-callers
- (append interface-callers
- (jde-xref-get-basic-caller
- (cons 'function
- (cons interface (cddr sig))))))))
+ (jde-xref-get-basic-caller (list typesig classname "<init>" nil
nil)))
+
(jde-xref-get-basic-caller sig)
- (mapcan (lambda (subclass)
- (unless (member (cddr sig)
- (jde-xref-get-members
- subclass))
- (jde-xref-get-callers
- `(,(car sig) ,subclass ,@(cddr sig)) strict)))
- (gethash (nth 1 sig) jde-xref-subclasses)))))
+ (unless strict
+ (apply 'append
+ (mapcar
+ (lambda (classname)
+ (let* ((sig `(,typesig ,classname ,@(cddr sig)))
+ (callers-for-classname (jde-xref-get-basic-caller sig)))
+ (when callers-for-classname
+ (cons classname callers-for-classname)))) ;; include classname in the usage
list
+ (jde-xref-get-subs classname sig (jde-xref-get-supers classname nil))))))))
+
+
+(defun jde-xref-get-supers (classname collect)
+ (mapc (lambda (super)
+ (unless (member super collect)
+ (setq collect (jde-xref-get-supers super (cons super collect)))))
+ (let* ((package (jde-parse-get-package-from-name classname))
+ (superclass (jde-xref-get-superclass classname))
+ (superinterfaces (gethash classname (jde-xref-get-interface-hash package))))
+ (if superclass
+ (cons superclass superinterfaces)
+ superinterfaces)))
+ collect)
+
+
+(defun jde-xref-get-subs (classname sig collect)
+ (mapc (lambda (subclass)
+ (unless (or (member subclass collect) (member (cddr sig) (jde-xref-get-members
subclass)))
+ (setq collect (jde-xref-get-subs subclass sig (cons subclass collect)))))
+ (gethash classname jde-xref-subclasses))
+ collect)
+
(defun jde-xref-notify (widget child &optional event)
(jde-xref-goto-caller (widget-get widget :caller)))
@@ -569,20 +578,22 @@ and show it"
(when sig
(mapcar
(lambda (caller)
+ (if (listp caller)
(let ((caller-sig (jde-xref-caller-to-sig caller)))
(list
'tree-widget
:node `(push-button
-:tag ,(jde-xref-signature-to-string caller-sig)
-:format "%[%t%]\n"
-:sig ,caller-sig
-:caller ,caller
-:notify jde-xref-notify)
+:tag ,(jde-xref-signature-to-string caller-sig)
+:format "%[%t%]\n"
+:sig ,caller-sig
+:caller ,caller
+:notify jde-xref-notify)
:dynargs 'jde-xref-tree-get-children-from-tree
:sig caller-sig
-:has-children t)))
- (jde-xref-get-callers sig))))
-
+:has-children t))
+ (list 'tree-widget :tag caller))) ;; class for next set of usages
+ (jde-xref-get-callers sig))))
+
(defun jde-xref-tree-get-children-from-tree (tree)
(jde-xref-tree-get-children (widget-get tree :sig)))
@@ -590,7 +601,10 @@ and show it"
(defun jde-xref-display-call-tree (strict)
"Display an interactive call tree of which function call the current
function, which can be expanded outward. STRICT should be true if
- the callers of interfaces to a function should not be considered"
+ the callers of interfaces to a function, or calls to a superclass
+ which may result in a virtual function call to the subclass should
+ not be considered. In other words, if STRICT is true, then only
+ calls that are definitely to the requested function are considered. "
(interactive "P")
(jde-xref-load-subclasses-table-if-necessary)
(let* ((sig (jde-xref-get-current-signature))
@@ -608,10 +622,10 @@ and show it"
(widget-setup)))
(defun jde-xref-get-class-variables (class-token)
- (mapcan (lambda (token) (when (eq (semantic-token-token token)
- 'variable)))
- ;; semantic-nonterminal-children does not seem to work
- (nth 3 class-token)))
+ (mapcan (lambda (token)
+ (when (eq (semantic-token-token token) 'variable)
+ (list token)))
+ (semantic-nonterminal-children class-token)))
;;;###autoload
(defun jde-xref-list-uncalled-functions (strict)
@@ -619,9 +633,12 @@ and show it"
not directly. Do not assume that this means this code can never be
reached, since reflection could always call any method. Use this list
and your best judgement to figure out what are good candidates for
-code cleanup. STRICT should be set to true if the callers of
-interfaces to a function should not be considered. This function could
-take a while. If it does, you might want to consider increasing
+code cleanup. STRICT should be true if the callers of interfaces to a
+function, or calls to a superclass which may result in a virtual
+function call to the subclass should not be considered. In other
+words, if STRICT is true, then only calls that are definitely to the
+requested function are considered. This function could take a
+while. If it does, you might want to consider increasing
`jde-xref-cache-size'."
(interactive "P")
(jde-xref-load-subclasses-table-if-necessary)
@@ -651,7 +668,7 @@ take a while. If it does, you might want
(insert "The following is a list of methods and members that are\n")
(insert "uncalled directly by any Java classes that are in the\n")
(insert "following locations: \n")
- (insert (mapconcat (lambda (x) x) jde-xref-class-path ", "))
+ (insert (mapconcat (lambda (x) x) jde-built-class-path ", "))
(newline)
(newline)
(if uncalled-methods
@@ -717,8 +734,54 @@ call list of all files modified in emacs
(provide 'jde-xref)
;; $Log: jde-xref.el,v $
-;; Revision 1.1 2003/01/18 05:48:47 andyp
-;; sync to jde 2.3.2
+;; Revision 1.23 2003/11/07 04:27:14 ahyatt
+;; Invalid hooks removed
+;;
+;; Revision 1.22 2003/10/17 03:42:57 ahyatt
+;; Speed improvements to jde-xref. Thanks to Suraj Acharya.
+;;
+;; Revision 1.21 2003/10/09 05:58:55 ahyatt
+;; David Ponce's fixes pertaining to the upcoming Semantic 2.0, plus
+;; fixes of my own to get his changes working with the existing code.
+;;
+;; Revision 1.20 2003/09/27 04:53:35 ahyatt
+;; Put in Suraj Acharya's fixes, fixed a no-prefix bug (but still don't allow no
prefixes)
+;;
+;; Revision 1.19 2003/09/02 22:05:43 ahyatt
+;; We weren't doing any subclass checks! Fixed this problem, then fixed
+;; a problem where the subclass checks caused an infinite recursion
+;; problem.
+;;
+;; Revision 1.18 2003/07/15 05:19:47 ahyatt
+;; Fix for bug where users could not find the callers to interface functions
+;;
+;; Revision 1.17 2003/07/09 06:11:20 ahyatt
+;; Made jde-xref-store-prefixes non-optional. I think if we didn't do
+;; this, most people would leave it blank, therefore significantly
+;; impacting both size of the database and the time and memory it takes
+;; to make it.
+;;
+;; Revision 1.16 2003/05/07 04:38:45 ahyatt
+;; Uncommenting jde-update-autoloaded-symbols
+;;
+;; Revision 1.15 2003/05/06 06:50:55 ahyatt
+;; Fixes recent regression with default-directory not getting set back after making the
xref db (if the jde-built-class-path contains jars)
+;;
+;; Revision 1.14 2003/05/03 09:00:53 paulk
+;; Fixed bug in jde-xref-update-xref-db that cause incorrect resolution
+;; of db path specified relative to project file.
+;;
+;; Revision 1.13 2003/03/08 06:32:02 ahyatt
+;; Simplified using new jde-class functionality
+;;
+;; Revision 1.12 2003/01/07 15:27:37 ahyatt
+;; Needed to clear the cache after updating.
+;;
+;; Revision 1.11 2003/01/02 05:10:20 ahyatt
+;; Added ability for calls to superclasses to show up (under non-strict
+;; mode) as calls to the subclass. So if class B inherits from class A,
+;; then a call to a method on a class of type A (at compile time), may in
+;; fact call a method on B at runtime. This is turned off in STRICT mode.
;;
;; Revision 1.10 2002/12/18 04:09:15 ahyatt
;; Fixes a usability problem with call-trees, and fixes a bug where some
1.16 +615 -117 XEmacs/packages/xemacs-packages/jde/lisp/jde.el
Index: jde.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/jde.el,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- jde.el 2003/10/08 06:38:04 1.15
+++ jde.el 2006/03/03 20:42:42 1.16
@@ -1,11 +1,11 @@
;;; jde.el -- Integrated Development Environment for Java.
-;; $Revision: 1.13 $ $Date: 2003/01/11 16:18:48 $
+;; $Revision: 1.321 $ $Date: 2003/11/29 05:28:26 $
;; Author: Paul Kinnucan <pkinnucan(a)attbi.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Paul Kinnucan.
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@
;;;###autoload
-(defconst jde-version "2.3.2"
+(defconst jde-version "2.3.3"
"JDE version number.")
(defconst jde-semantic-min-version "1.4beta13"
@@ -63,6 +63,21 @@
(defconst jde-emacs21p (and (string-match "\\bEmacs\\b" (emacs-version))
(>= emacs-major-version 21)))
+(require 'jde-util)
+
+;; The version of the JDEE distributed with XEmacs has its own
+;; autoloads file (auto-autoloads.el). Therefore, require
+;; jde-autoloads only if this JDEE version is not part of the XEmacs
+;; package.
+;; XEmacs change: this particular one is, duh.
+;(unless
+; (and jde-xemacsp
+; (file-exists-p
+; (expand-file-name
+; "jde/auto-autoloads.el"
+; (jde-root))))
+; (require 'jde-autoload))
+
(require 'jde-help)
(require 'semantic-load)
(require 'easymenu)
@@ -81,12 +96,14 @@
(require 'imenu)
(require 'browse-url)
(require 'beanshell)
+(require 'jde-plugins)
(require 'jde-wiz)
(require 'jde-java-grammar)
(require 'jde-complete)
(require 'jde-which-method)
(require 'jde-java-font-lock)
(require 'jde-import)
+(require 'jde-class)
(require 'executable) ;; in XEmacs' sh-script package
(require 'efc)
(require 'jde-open-source)
@@ -123,14 +140,14 @@ See also the function `jde-check-version
(cons "[?\C-c ?\C-v ?\C-d]" 'jde-debug)
(cons "[?\C-c ?\C-v ?\C-f]" 'jde-find)
(cons "[?\C-c ?\C-v ?\C-g]" 'jde-open-class-at-point)
- (cons "[?\C-c ?\C-v ?\C-k]" 'bsh)
+ (cons "[?\C-c ?\C-v ?\C-k]" 'jde-bsh-run)
(cons "[?\C-c ?\C-v ?\C-l]" 'jde-gen-println)
(cons "[?\C-c ?\C-v ?\C-n]" 'jde-help-browse-jdk-doc)
(cons "[?\C-c ?\C-v ?\C-p]" 'jde-save-project)
(cons "[?\C-c ?\C-v ?\C-q]" 'jde-wiz-update-class-list)
(cons "[?\C-c ?\C-v ?\C-r]" 'jde-run)
(cons "[?\C-c ?\C-v ?\C-s]" 'speedbar-frame-mode)
- (cons "[?\C-c ?\C-v ?\C-t]" 'jde-db-menu-debug-applet)
+ (cons "[?\C-c ?\C-v ?\C-t]" 'jde-jdb-menu-debug-applet)
(cons "[?\C-c ?\C-v ?\C-w]" 'jde-help-symbol)
(cons "[?\C-c ?\C-v ?\C-x]" 'jde-show-superclass-source)
(cons "[?\C-c ?\C-v ?\C-y]" 'jde-open-class-at-point)
@@ -289,6 +306,30 @@ the current project."
'custom-set-default
'(jde-jdk-registry)))
+(defun jde-find-jdk-in-exec-path ()
+ "Search for a JDK in `exec-path' and return the path of
+the root directory of the first JDK that is found. Return nil if a
+JDK is not found anywhere in exec-path."
+ (let ((list exec-path)
+ (command "java")
+ file)
+ (while list
+ (setq list
+ (if (and (setq file (expand-file-name command (car list)))
+ (let ((suffixes executable-binary-suffixes)
+ candidate)
+ (while suffixes
+ (setq candidate (concat file (car suffixes)))
+ (if (and (file-executable-p candidate)
+ (not (file-directory-p candidate)))
+ (setq suffixes nil)
+ (setq suffixes (cdr suffixes))
+ (setq candidate nil)))
+ (setq file candidate)))
+ nil
+ (setq file nil)
+ (cdr list))))
+ file))
(defun jde-get-jdk-dir ()
@@ -302,6 +343,7 @@ java.exe on Windows systems. If neither
nor the Java home environment variable specify a JDK directory, this
function displays an error message."
(interactive)
+
(if jde-jdk
(let* ((jdk (assoc (car jde-jdk) jde-jdk-registry))
(jdk-dir (cdr jdk)))
@@ -329,8 +371,7 @@ function displays an error message."
jdk-dir))))
(progn
(setq jdk-dir
- (executable-find
- (if (eq system-type 'windows-nt) "java.exe" "java")))
+ (executable-find "javac"))
(if jdk-dir
(setq jdk-dir
(expand-file-name
@@ -361,12 +402,20 @@ function displays an error message."
progpath
(executable-find full-progname))))
+
(defun jde-get-tools-jar ()
- "Gets the correct tools.jar or equivalent"
- (expand-file-name (if (eq system-type 'darwin)
- "Classes/classes.jar"
- "lib/tools.jar")
- (jde-get-jdk-dir)))
+ "Gets the correct tools.jar or equivalent. Signals an
+error if it cannot find the jar."
+ (let ((tools
+ (expand-file-name
+ (if (eq system-type 'darwin)
+ "Classes/classes.jar"
+ "lib/tools.jar")
+ (jde-get-jdk-dir))))
+ (if (file-exists-p tools)
+ tools
+ (error (concat "Cannot find JDK's tools jar file (or equivalent)."
+ "Type M-x describe-function [RET] jde-get-jdk-dir for more
info.")))))
(defvar jde-java-version-cache nil
"Cache to hold the version of Java being used.")
@@ -398,7 +447,7 @@ system command path."
(if (not java-version)
(if jde-java-version-cache
(setq java-version jde-java-version-cache)
- (if (bsh-running-p)
+ (if (jde-bsh-running-p)
(progn
(setq jde-java-version-cache
(jde-jeval-r "jde.util.JdeUtilities.getJavaVersion();"))
@@ -584,6 +633,13 @@ version of jdb instead of the new (JPDA-
(jde-get-java-source-buffers))
(set-default sym val)))
+(defcustom jde-devel-debug nil
+ "If true, use the JDEE Java classes in the jde/java/classes
+directory instead of the jde.jar. This variable is intended for
+use in testing the JDEE's java classes."
+:group 'jde-project
+:type 'boolean)
+
(defcustom jde-enable-senator t
"Enable senator minor mode.
This mode provides Java-aware buffer navigation and searching
@@ -608,7 +664,18 @@ commands."
"*Enable expansion of abbreviations in jde-mode.
See `jde-mode-abbreviations' for more information."
:group 'jde-project
-:type 'boolean)
+:type 'boolean
+:set '(lambda (sym val)
+ (set-default sym val)
+ (if (featurep 'jde) ;; skip initial set.
+ (mapc
+ (lambda (buf)
+ (with-current-buffer buf
+ (setq abbrev-mode val)
+ (when abbrev-mode
+ (setq local-abbrev-table (make-abbrev-table))
+ (jde-init-abbrev-table))))
+ (jde-get-current-project-buffers)))))
(defcustom jde-mode-abbreviations
(list
@@ -656,7 +723,7 @@ See `jde-mode-abbreviations' for more in
(cons "sy" "synchronized")
(cons "th" "this")
(cons "thr" "throw")
- (cons "throw" "throws")
+ (cons "thro" "throws")
(cons "tra" "transient")
(cons "tr" "true")
(cons "vo" "void")
@@ -668,22 +735,24 @@ To use these abbreviations, you must ena
`jde-enable-abbrev-mode'). To use an abbreviation, enter the
abbreviation followed by a white-space character. To suppress
expansion, enter C-q white-space."
-:group 'jde-project
-:type '(repeat
- (cons :tag "jde-mode abbreviation"
- (string :tag "Abbreviation")
- (string :tag "Expansion"))))
-
-(defcustom jde-devel-debug nil
- "If true, use the JDEE Java classes in the jde/java/classes
-directory instead of the jde.jar. This variable is intended for
-use in testing the JDEE's java classes."
:group 'jde-project
-:type 'boolean)
-
-(defvar jde-mode-abbrev-table (make-abbrev-table)
- "Abbrev table for use in JDE-mode buffers.")
-
+:type '(repeat
+ (cons :tag "jde-mode abbreviation"
+ (string :tag "Abbreviation")
+ (string :tag "Expansion")))
+:set '(lambda (sym val)
+ (set-default sym val)
+ (if (and
+ (featurep 'jde)
+ jde-enable-abbrev-mode)
+ (progn
+ (message "Loading abbrev table.")
+ (mapc
+ (lambda (buf)
+ (with-current-buffer buf
+ (setq local-abbrev-table (make-abbrev-table))
+ (jde-init-abbrev-table)))
+ (jde-get-current-project-buffers))))))
(defun jde-init-abbrev-table ()
"Load the abbrev table.
@@ -749,6 +818,10 @@ t) "Abbreviations"))))
"The separator to use in a classpath.
This is usually the same as `path-separator'")
+(defvar jde-current-project ""
+ "Path of the project file for the current project.")
+
+
;;;###autoload
(defun jde-set-global-classpath (classpath)
"Set the value of `jde-global-classpath'.
@@ -832,7 +905,9 @@ This command invokes the function define
(setq jde-current-project
(or (jde-find-project-file default-directory)
- ""));; Avoid setting twice the startup values!
+ "")) ;; Avoid setting startup values twice!
+
+ (setq jde-buffer-project-file jde-current-project)
;; Load the project file for this buffer. The project file
;; defines JDE options for a project.
@@ -846,9 +921,10 @@ This command invokes the function define
(make-local-hook 'post-command-hook)
(add-hook 'post-command-hook
'jde-detect-java-buffer-activation nil t)
-
- (if jde-xemacsp
- (jde-insert-menu-in-xemacs-menubar))
+
+ (when jde-xemacsp
+ (require 'jde-xemacs)
+ (jde-insert-menu-in-xemacs-menubar))
;; Define underscore as a word constituent. This is needed
;; to support coding styles the begin fields with an underscore.
@@ -882,12 +958,12 @@ This command invokes the function define
(if (and
(not jde-launch-beanshell-on-demand-p)
- (not (bsh-running-p)))
- (bsh-internal))
+ (not (jde-bsh-running-p)))
+ (bsh-launch (oref 'jde-bsh the-bsh)))
(jde-wiz-set-bsh-project)
- ;; Setup Semantic stuff needed by the JDEE when Seantic is ready to
+ ;; Setup Semantic stuff needed by the JDEE when Semantic is ready to
;; parse!
(add-hook 'semantic-init-hooks 'jde-parse-semantic-default-setup)
@@ -896,6 +972,9 @@ This command invokes the function define
(jde-bug-minor-mode 1)
(jde-jdb-minor-mode 1))
+ ;; Install plugin menu.
+ (jde-plugin-minor-mode 1)
+
;; The next form must be the last executed
;; by jde-mode.
(derived-mode-run-hooks 'jde-mode))
@@ -1045,14 +1124,17 @@ Does nothing but return nil if `jde-log-
["Interface" jde-show-interface-source t]
)
(list "Interpreter"
- ["Start" bsh t]
- ["Exit" bsh-exit t]
+ ["Start" jde-bsh-run t]
+ ["Exit" jde-bsh-exit t]
)
(list "Documentation"
["Add" jde-javadoc-autodoc-at-line
(jde-javadoc-enable-menu-p)]
["Check This" jde-javadoc-checkdoc-at-line
(jde-javadoc-enable-menu-p)]
- ["Check All" jde-javadoc-checkdoc t]
- ["Generate" jde-javadoc-make t]
+ ["Check All" jde-javadoc-checkdoc t]
+ ["Generate All" jde-javadoc-make t]
+ ["Generate Buffer" jde-javadoc-make-buffer t]
+ "-"
+ ["Javadoc Reference" jde-javadoc-browse-tool-doc t]
)
"-"
(list "Code Generation"
@@ -1061,6 +1143,7 @@ Does nothing but return nil if `jde-log-
["Println..." jde-gen-println t]
(list "Listener"
["Action" jde-gen-action-listener t]
+ ["Change" jde-gen-change-listener t]
["Window" jde-gen-window-listener t]
["Mouse" jde-gen-mouse-listener t]
)
@@ -1079,7 +1162,10 @@ Does nothing but return nil if `jde-log-
["Update Class List" jde-wiz-update-class-list t]
)
)
- ["Speedbar" jde-show-speedbar t]
+ (list "Browse"
+ ["Source Files" jde-show-speedbar t]
+ ["Class at Point" jde-browse-class-at-point t]
+ )
["Check Style" jde-checkstyle]
(list "Project"
(vector "Auto Switch"
@@ -1147,6 +1233,7 @@ Does nothing but return nil if `jde-log-
(add-submenu nil jde-menu-definition)
(add-menu nil "JDE" (cdr jde-menu-definition)))))
+
(defcustom jde-new-buffer-menu
(list
"JDE New"
@@ -1166,7 +1253,7 @@ Does nothing but return nil if `jde-log-
(set-default sym val)
(if jde-xemacsp
(unless (featurep 'infodock)
- (when (fboundp 'add-submenu)
+ (when (fboundp 'add-submenu)
(add-submenu '("File") val "Insert File...")))
(let* ((mb (assq 'menu-bar global-map))
(files (assq 'files mb))
@@ -1185,21 +1272,24 @@ Does nothing but return nil if `jde-log-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun jde-cygpath (path &optional direction)
- "Converts a path from cygwin to DOS form if DIRECTION is nil.
-Otherwise, it converts the path to cygwin form. Requires that cygpath
-be in your path."
+ "If `system-type' is cygwin or cygwin32, converts PATH from cygwin
+to DOS form (if DIRECTION is nil) or to cygwin form (if DIRECTION is
+nonnil). The converion requires that cygpath be in your path. If the
+`system-type' is not cygwin or cygwin32, returns PATH unchanged."
(interactive "sPath: ")
- (if (executable-find "cygpath")
- (save-excursion
- (let ((buf-name "*cygwin-output*")
- (output-type (if direction "-u" "-w")))
- (shell-command
- (concat "cygpath " output-type " -p '" path
"'") buf-name)
- (set-buffer buf-name)
- (let ((output (buffer-substring (point-min) (point-max))))
- (kill-buffer buf-name)
- (substitute ?\/ ?\\ (remove ?\n output)))))
- (error "Cannot find cygpath executable.")))
+ (if (member system-type '(cygwin32 cygwin))
+ (if (executable-find "cygpath")
+ (save-excursion
+ (let ((buf-name "*cygwin-output*")
+ (output-type (if direction "-u" "-w")))
+ (shell-command
+ (concat "cygpath " output-type " -p '" path
"'") buf-name)
+ (set-buffer buf-name)
+ (let ((output (buffer-substring (point-min) (point-max))))
+ (kill-buffer buf-name)
+ (substitute ?\/ ?\\ (remove ?\n output)))))
+ (error "Cannot find cygpath executable."))
+ path))
(defvar jde-cygwin-root-cache nil
"Cache of converted cygwin root directory paths.")
@@ -1369,7 +1459,16 @@ SYMBOL is unnecessary."
t)
((> (length dir1) (length dir2)))))))))
(setq prjs (sort prjs sort-fn))
- (setq prj-file-path (caar prjs)))
+ (setq prj-file-path (caar prjs))
+ (if (string= prj-file-path "default")
+ ;; Case where the project file that sets symbol
+ ;; is the user's .emacs file. Assume that the
+ ;; user wants the relative path in the .emacs
+ ;; file to be the default relative path for
+ ;; projects that do not specify a
+ ;; relative path.
+ (setq prj-file-path
+ (jde-find-project-file dir))))
(setq prj-file-path
(jde-find-project-file dir)))
(if prj-file-path
@@ -1471,7 +1570,7 @@ that contain spaces."
(defun jde-root-dir-p (dir)
"Return nonnil if DIR is a root directory."
- (let ((parent (expand-file-name "../" dir)))
+ (let ((parent (expand-file-name ".." dir)))
(cond
((and
(fboundp 'ange-ftp-ftp-name)
@@ -1488,13 +1587,13 @@ that contain spaces."
(or
(string= parent "//") ; for paths like //host/d/prj/src
(string= parent "\\\\") ; for paths like \\host\d\prj\src
- (string= (substring parent -3) "../"))) ; for paths like d:/prj/src
+ (string= (substring parent -3) "/.."))) ; for paths like d:/prj/src
((member system-type '(cygwin32 cygwin))
(or (string= (file-truename dir) (file-truename "/"))
(string= parent "//") ; for paths like //host/d/prj/src
(string= parent "\\\\") ; for paths like \\host\d\prj\src
(and (> (length parent) 3) ; for paths like d:/prj/src
- (string= (substring parent -3) "../"))
+ (string= (substring parent -3) "/.."))
(not (file-exists-p (file-truename dir)))))
(t
(or (or (not (file-readable-p dir))
@@ -1505,12 +1604,18 @@ that contain spaces."
(defun jde-get-global-classpath ()
"Return the value of `jde-global-classpath', if defined, otherwise
-the value of the CLASSPATH environment variable converted to a list."
+the value of the CLASSPATH environment variable converted to a list,
+of normalized paths, i.e., with . and ~ characters expanded and backslashes
+replaces with slashes."
(if jde-global-classpath
jde-global-classpath
(let ((cp (getenv "CLASSPATH")))
(if (stringp cp)
- (split-string cp jde-classpath-separator)))))
+ (mapcar
+ (lambda (path)
+ (let ((directory-sep-char ?/))
+ (expand-file-name path)))
+ (split-string cp jde-classpath-separator))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
@@ -1538,8 +1643,26 @@ or an ascendant directory."
(if file
(expand-file-name file dir)
(if (not (jde-root-dir-p dir))
- (jde-find-project-file (expand-file-name "../" dir))))))
+ (jde-find-project-file (expand-file-name ".." dir))))))
+
+(defvar jde-buffer-project-file ""
+ "Path of project file associated with the current Java source buffer.")
+(make-variable-buffer-local 'jde-buffer-project-file)
+
+
+(defun jde-get-current-project-buffers ()
+ "Return a list of the Java source buffers that belong
+to the current project."
+ (delq
+ nil
+ (mapcar
+ (lambda (buffer)
+ (with-current-buffer buffer
+ (if (string= jde-buffer-project-file jde-current-project)
+ buffer)))
+ (jde-get-java-source-buffers))))
+
(defun jde-find-project-files (dir)
"Return all the project files in the current directory tree,
starting with the topmost."
@@ -1553,7 +1676,7 @@ starting with the topmost."
file
(if (not (jde-root-dir-p current-dir))
(jde-find-project-file
- (expand-file-name "../" current-dir)))))
+ (expand-file-name ".." current-dir)))))
files))
(defvar jde-loading-project nil
@@ -1568,7 +1691,11 @@ the project files starting with the topm
If no project files are found, set the JDE variables to their
Emacs startup values."
(interactive)
- (let ((prj-files (jde-find-project-files default-directory)))
+ (let ((prj-files
+ (jde-find-project-files
+ ;; Need to normalize path to work around bug in the
+ ;; cygwin version of XEmacs.
+ (expand-file-name "." default-directory))))
(if prj-files
(progn
(jde-set-variables-init-value)
@@ -1629,7 +1756,9 @@ Leave point at the location of the call,
(defun jde-symbol-p (symbol)
"Returns non-nil if SYMBOL is a JDE variable."
- (and (get symbol 'custom-type)
+ (and (or
+ (get symbol 'custom-type)
+ (get symbol 'jde-project))
(or (string-match "^bsh-" (symbol-name symbol))
(string-match "^jde-" (symbol-name symbol)))))
@@ -1907,8 +2036,6 @@ The value of SYMBOL is set to VALUE.
;; from a Java source buffer belonging to one project to a buffer
;; belonging to another.
-(setq jde-current-project "")
-
(defun jde-reload-project-file ()
"If project context-switching is enabled (see
`jde-project-context-switching-enabled-p'), reloads the project file
@@ -1971,7 +2098,8 @@ If the activated buffer is a Java buffer
(lambda (file-type buffer)
(let ((file-name (buffer-file-name buffer)))
(if file-name
- (string-match file-type file-name))))))
+ (save-match-data
+ (string-match file-type file-name)))))))
(defun jde-remove-jde-hook ()
@@ -1984,29 +2112,6 @@ all Java source buffers have been closed
;; JDE help
-(defun jde-find-jde-data-directory ()
- "Return the path of the JDE data directory.
-Returns the path of the directory containing the
-JDE java and documentation directories; nil if the
-directory cannot be found. If XEmacs, returns the location of
-the data directory in the XEmacs distribution hierarchy. On all other Emacs versions,
-the JDE expects to find the documentation and Java class directories
-in the same directory that contains the JDE lisp directory."
- (let ((directory-sep-char ?/)
- dir)
- (flet ((find-data-dir
- ()
- (expand-file-name
- "../"
- (file-name-directory (locate-library "jde")))))
- (if jde-xemacsp
- (progn
- (setq dir (locate-data-directory "jde"))
- (if (not dir)
- (setq dir (find-data-dir))))
- (setq dir (find-data-dir))))
- dir))
-
(defun jde-find-jde-doc-directory ()
"Return the path of the JDE documentation directory.
Returns nil if the directory cannot be found. At some
@@ -2035,13 +2140,17 @@ jde.el."
browse-url-new-window-p))
(signal 'error '("Cannot find JDE help file.")))))
-(defun jde-debug ()
-"*Runs the debugger specified by `jde-debugger'."
- (interactive)
- (if (string= (car jde-debugger) "JDEbug")
- (jde-bug-debug-app)
- (jde-jdb)))
+;; The following version of jde-dbug has been replaced by the version
+;; in jde-db.el.
+
+;; (defun jde-debug ()
+;; "*Runs the debugger specified by `jde-debugger'."
+;; (interactive)
+;; (if (string= (car jde-debugger) "JDEbug")
+;; (jde-bug-debug-app)
+;; (jde-jdb)))
+
;;
;; Problem reporting functions contributed by Phillip Lord <plord(a)hgmp.mrc.ac.uk>.
;;
@@ -2183,14 +2292,10 @@ for insertion of the .emacs file"
(defun jde-problem-report-list-all-variables()
"List all variables starting with `jde' or `bsh'."
- (let ((vars))
+ (let (vars)
(mapatoms
(lambda (symbol)
- (when
- (and (or
- (string-match "bsh-" (symbol-name symbol))
- (string-match "jde-" (symbol-name symbol)))
- (get symbol 'custom-type))
+ (if (jde-symbol-p symbol)
(setq vars (cons symbol vars)))))
vars))
@@ -2297,8 +2402,11 @@ This is done if FILE.el is newer than FI
(if (string= (file-name-extension file) "el")
(let* ((root (file-name-sans-extension file))
(elc-file (concat root ".elc")))
- (if (or (not (file-exists-p elc-file))
+ (if (and
+ (or (not (file-exists-p elc-file))
(file-newer-than-file-p file elc-file))
+ (or (not (string= root "jde-xemacs"))
+ (featurep 'xemacs)))
(progn
(message (format "Byte-compiling %s..."
(file-name-nondirectory file)))
@@ -2677,24 +2785,231 @@ that is not defined the classpath specif
environment variable."
(let* ((directory-sep-char ?/) ;; Override NT/XEmacs setting
(classpath
- (if jde-global-classpath
- (jde-build-path-arg nil jde-global-classpath t)
- (if (getenv "CLASSPATH")
- (concat " \"" (getenv "CLASSPATH") "\"")
- "\"\""))))
+ (jde-build-path-arg nil (jde-get-global-classpath) t)))
(format "jde.util.JdeUtilities.setProjectValues(\"%s\", %s);"
jde-current-project
classpath)))
+(defclass jde-bsh-buffer (bsh-comint-buffer) ()
+ "JDEE's beanshell buffer")
+
+(defmethod initialize-instance ((this jde-bsh-buffer) &rest fields)
+ (oset this buffer-name "*JDEE bsh*")
+ (call-next-method))
+
+(defclass jde-bsh (bsh)
+ ((bsh-cmd-dir :initarg :bsh-cmd-dir
+:type string
+:documentation
+ "Path of the BeanShell commmand directory.")
+
+ (checkstyle-jar :initarg :checkstyle-jar
+:type string
+:documentation
+ "Path of the Checkstyle jar.")
+
+ (regexp-jar :initarg :regexp-jar
+:type string
+:documentation
+ "Path of the Jakarta regexp jar.")
+
+ (jde-jar :initarg :jde-jar
+:type string
+:documentation
+ "Path of the JDEE jar.")
+
+ (jde-classes-dir :initarg :jde-classes-dir
+:type string
+:documentation
+ "Path of the JDEE classes directory.")
+
+
+ (the-bsh :type jde-bsh
+:allocation :class
+:documentation
+ "The single instance of the JDEE's BeanShell."))
+ "Class of JDEE BeanShells. There is only one per Emacs session.")
+
+(defmethod initialize-instance ((this jde-bsh) &rest fields)
+ "Constructor for the JDEE BeanShell instance."
+ (call-next-method)
+ (let* ((jde-java-directory
+ (concat
+ (jde-find-jde-data-directory)
+ "java/")))
+
+ (oset this bsh-cmd-dir (expand-file-name "bsh-commands"
jde-java-directory))
+ (oset this checkstyle-jar (expand-file-name "lib/checkstyle-all.jar"
jde-java-directory))
+ (oset this regexp-jar (expand-file-name "lib/jakarta-regexp.jar"
jde-java-directory))
+ (oset this jde-classes-dir (expand-file-name "classes"
jde-java-directory))
+ (oset this jde-jar (expand-file-name "lib/jde.jar" jde-java-directory))
+ (oset this jar (expand-file-name "lib/bsh.jar" jde-java-directory))
+ (oset-default 'jde-bsh the-bsh this)))
+
+(defmethod bsh-create-buffer ((this jde-bsh))
+ "Creates the JDEE's beanshell buffer."
+ (oset this buffer (jde-bsh-buffer "JDEE bsh buffer")))
+
+(defmethod bsh-build-classpath-argument ((this jde-bsh))
+ (jde-build-classpath (oref this cp) 'jde-global-classpath t))
+
+(defmethod bsh-launch :BEFORE ((this jde-bsh) &optional display-buffer)
+ "Sets the vm and classpath to the vm and classpath for the current project before
+the PRIMARY launch method is invoked."
+ (let* ((project-ant-home
+ (jde-get-project 'jde-ant-home jde-current-project))
+ (ant-home (if (and (boundp 'jde-ant-home)
+ (not (string= jde-ant-home "")))
+ jde-ant-home ;jde-ant loaded
+ (if (and project-ant-home
+ (not (string= project-ant-home "")))
+ project-ant-home ; jde-ant not loaded but
+ ; jde-ant-home set in project
+ ; file
+ (getenv "ANT_HOME")))) ; jde-ant-home not set in
+ ; project file and not
+ ; customized
+ )
+
+ (oset this vm (oref (jde-run-get-vm) :path))
+ (oset this cp (delq
+ nil
+ (append
+ (list
+ (oref this jar)
+ (oref this bsh-cmd-dir)
+ (oref this checkstyle-jar)
+ (oref this regexp-jar)
+ (if jde-devel-debug
+ (oref this jde-classes-dir)
+ (oref this jde-jar))
+ (jde-get-tools-jar)
+ (if ant-home (expand-file-name "lib" ant-home)))
+ (jde-pi-get-bsh-classpath)
+ (jde-expand-classpath (jde-get-global-classpath)))))))
+
+;; Create the BeanShell wrapper object.
+(jde-bsh "JDEE BeanShell")
+
+(defun jde-bsh-running-p ()
+ "Returns t if the JDEE's BeanShell instance is running."
+ (bsh-running-p (oref 'jde-bsh the-bsh)))
+
+
(defun jde-jeval (java-statement &optional eval-return)
- (if (not (bsh-running-p))
- (bsh-eval (jde-create-prj-values-str)))
- (bsh-eval java-statement eval-return))
+ "Uses the JDEE's instance of the BeanShell
+Java interpreter to evaluate the Java expression EXPR. If the
+BeanShell is not running, the JDEE starts an instance. This function
+returns any text output by the Java interpreter's standard out or
+standard error pipes. If EVAL-RETURN is non-nil, this function
+returns the result of evaluating the Java output as a Lisp
+expression."
+ (let ((the-bsh (oref 'jde-bsh the-bsh)))
+
+ (when (not (bsh-running-p the-bsh))
+ (bsh-launch the-bsh)
+ (bsh-eval the-bsh (jde-create-prj-values-str)))
+ (bsh-eval the-bsh java-statement eval-return)))
+
(defun jde-jeval-r (java-statement)
+ "Uses the JDEE's instance of the BeanShell to
+evaluate JAVA-STATEMENT and then uses the Emacs Lisp
+interpreter to evaluate the result. This function
+is intended to be used to implement Emacs extensions
+coded in Java and executed by the BeanShell. The function
+assumes that the Java extension interacts with Emacs
+by printing Lisp forms to the BeanShell's standard output \
+port."
(jde-jeval java-statement t))
+(defun jde-jeval-cm (java-expr &optional buffer-head finish-fcn)
+ "Evaluate JAVA-EXPR and display the result in a compilation-mode buffer.
+The optional argument BUFFER-HEAD specifies text to appear at the head of
+the compilation buffer. The optional argument FINISH-FCN specifies a
+function to be called when the compilation is finished. This function
+is intended to be used to invoke Java development utilities, such as
+source code style checkers, that emit compiler-like error messages.
+Displaying the output in a compilation-mode buffer enables the user to
+use compilation-mode's error message navigation and hyperlinking
+capabilities.
+
+The following example uses this function to invoke the javac compiler on
+a file in the current directory:
+
+ (jde-bsh-compile-mode-eval
\"jde.util.CompileServer.compile(\\\"Test.java\\\");\"
+ \"Compile Test.java\" 'jde-compile-finish-kill-buffer)"
+ (let* ((buffer-obj (bsh-compilation-buffer "buffer"))
+ (native-buf (oref buffer-obj buffer))
+ (bufwin (display-buffer native-buf)))
+
+ (compilation-set-window-height bufwin)
+
+ (save-some-buffers (not compilation-ask-about-save) nil)
+
+ (if finish-fcn
+ (lexical-let ((finish finish-fcn))
+ (setq compilation-finish-function
+ (lambda (buf msg)
+ (funcall finish buf msg)
+ (setq compilation-finish-function nil)))))
+
+
+ (if (not (featurep 'xemacs))
+ (if compilation-process-setup-function
+ (funcall compilation-process-setup-function)))
+
+
+ (if (not (featurep 'xemacs))
+ (if compilation-process-setup-function
+ (funcall compilation-process-setup-function)))
+
+
+ (save-excursion
+ (set-buffer native-buf)
+
+ (if buffer-head
+ (insert buffer-head)
+ (insert java-expr))
+
+ (insert "\n")
+
+
+ (if (not (jde-bsh-running-p))
+ (progn
+ (bsh-launch (oref 'jde-bsh the-bsh))
+ (bsh-eval (oref 'jde-bsh the-bsh) (jde-create-prj-values-str))))
+
+
+ (bsh-buffer-eval
+ (oref 'jde-bsh the-bsh)
+ java-expr
+ buffer-obj)
+
+ (set-buffer-modified-p nil)
+ (setq compilation-last-buffer native-buf))))
+
+
+
+(defun jde-bsh-run()
+ "*Starts the JDEE version of the BeanShell."
+ (interactive)
+ (bsh-launch (oref 'jde-bsh the-bsh) t))
+
+(defun jde-bsh-exit ()
+ "Closes the existing beanshell process"
+ (interactive)
+ (if (jde-bsh-running-p)
+ (let ((process (bsh-get-process (oref 'jde-bsh the-bsh))))
+ (if (and
+ (boundp 'jde-ant-invocation-method) ;; ant package may not be loaded.
+ (string= (car jde-ant-invocation-method) "Ant Server"))
+ (process-send-string process "jde.util.JdeUtilities.exit();\n")
+ (process-send-string process "exit();\n")))
+ (message "The beanshell is not running")))
+
+
(defun jde-show-speedbar ()
"Show the speedbar after first checking whether the correct
version of speedar is installed."
@@ -2717,16 +3032,199 @@ version of speedar is installed."
(defun jde-autoload-update ()
"Updates autoload definitions in jde-autoload.el."
(interactive)
- (let* ((default-directory (concat (jde-find-jde-data-directory) "lisp/"))
- (generated-autoload-file (concat default-directory "jde-autoload.el")))
- (mapc 'update-file-autoloads (directory-files "." nil
"\\.el$"))))
+ (let* ((default-directory (expand-file-name "lisp"
(jde-find-jde-data-directory)))
+ (generated-autoload-file (expand-file-name "jde-autoload.el"
default-directory)))
+ (mapc 'update-file-autoloads (directory-files "." nil
"\\.el$"))
+ (save-excursion
+ (set-buffer "jde-autoload.el")
+ (save-buffer))
+ (kill-buffer "jde-autoload.el")))
+
+
+(defun jde-browse-class-at-point ()
+ "Displays the class of the object at point in the BeanShell Class
+Browser. Point can be in a variable name, class name, method name, or field name).
+This command has the same requirements to work as the field/method-completion
+feature in JDE (see `jde-complete-at-point')."
+ (interactive)
+ (if (jde-open-functions-exist)
+ (let* ((thing-of-interest (thing-at-point 'symbol))
+ (pair (save-excursion (end-of-thing 'symbol)
+ (jde-parse-java-variable-at-point)))
+ (class-to-open (jde-open-get-class-to-open
+ pair thing-of-interest))
+ (source-path-prefix-list (jde-open-get-path-prefix-list)))
+ (if (and class-to-open (stringp class-to-open))
+ (progn
+ (bsh-eval
+ (oref 'jde-bsh the-bsh)
+ (concat "exploreClass(\"" class-to-open
"\");")))
+ (error "Can not parse the thing at point!")))
+ (message "You need JDE >= 2.2.6 and Senator for using this feature!")))
+
(provide 'jde)
;; Change History
;;
;; $Log: jde.el,v $
+;; Revision 1.321 2003/11/29 05:28:26 paulk
+;; Change abbreviation for throws from throw to thro to avoid inadvertent completion of
throw to throws.
+;;
+;; Revision 1.320 2003/11/25 06:48:02 paulk
+;; Fix regression that was causing abbrev-mode to be enabled for JDEE buffers even when
jde-enable-abbrev-mode was set to nil. Also, enable abbrev-mode in all open JDEE buffers
for the current project as a side effect of setting jde-enable-abbrev-mode on.
+;;
+;; Revision 1.319 2003/10/23 03:53:22 paulk
+;; Added fix for compatibility with old versions of XEmacs. Thanks to Len Trigg.
+;;
+;; Revision 1.318 2003/10/14 05:07:40 paulk
+;; jde-count-open-java-buffers now saves match data before doing a string-match. This
fixes compatibility problem with emacs-w3m.
+;;
+;; Revision 1.317 2003/09/28 05:09:38 paulk
+;; Created a new buffer-local variable, jde-buffer-project-file, that stores
+;; the path of the project file for the current Java buffer. Updated
+;; jde-get-current-project-buffers to use this variable to test whether
+;; a given buffer is part of the current project. This should improve
+;; the performance of this function and hence loading of project files,
+;; which depends on it.
+;;
+;; Revision 1.316 2003/09/24 05:13:15 paulk
+;; Changed jde-normalize-path to support use of relative paths in .emacs
+;; files. Previously, if a relative path appeared in a variable, e.g.,
+;; jde-global-path, that was set for the current project by the user's
+;; .emacs file (as opposed to a project file), jde-normalize-path would
+;; resolve the variable relative to the source buffer directory. Now
+;; jde-normalize-path resolves it relative to the location of the nearest
+;; project file in the source buffer directory tree. If the directory
+;; tree does not contain a project file, jde-normalize-path resolves the
+;; path relative to the source buffer directory.
+;;
+;; Revision 1.315 2003/08/25 05:33:13 paulk
+;; Added item to the Documentation submenu to display the Javadoc Tool Reference.
+;;
+;; Revision 1.314 2003/07/11 14:35:54 paulk
+;; Makes jde-cygpath a noop if system-type is not cygwin.
+;;
+;; Revision 1.313 2003/07/08 05:54:16 paulk
+;; Add documentation for jde-jeval- functions.
+;;
+;; Revision 1.312 2003/07/01 05:10:58 paulk
+;; Adds a jde-bsh-compile-mode-eval function. This function
+;; is intended to be used by plugins to invoke Java development
+;; utilities, such as source code style checkers, that emit
+;; compiler-like error messages. Displaying the output in a
+;; compilation-mode buffer enables the user to use compilation-mode's
+;; error message navigation and hyperlinking capabilities.
+;;
+;; Revision 1.311 2003/06/26 05:36:13 paulk
+;; Fix regression introduced by changes to jde-root-dir-p in previous version.
+;;
+;; Revision 1.310 2003/06/26 04:45:36 paulk
+;; - Now requires jde-autoloads for XEmacs installations that use
+;; the independently distributed version of the JDEE rather than
+;; the version that is packaged with XEmacs.
+;;
+;; - Provides a workaround for a bug in file-exists-p in the cygwin
+;; version of XEmacs that prevented the JDEE from finding project
+;; files. The bug is that file-exists-p denies the existence of
+;; files whose native Windows paths (file-truename) end in a slash.
+;;
+;; Revision 1.309 2003/06/24 04:08:44 paulk
+;; - Update jde-symbol-p to recognize variables defined by autoloaded packages
+;; that have not yet been loaded. Thanks to Martin Schwamberger.
+;;
+;; - Fix jde-compile-jde to compile jde-xemacs.el only on Xemacs.
+;;
+;; Revision 1.308 2003/06/18 10:49:20 paulk
+;; Enhance jde-autoload-update to save and kill jde-autload.el buffer.
+;;
+;; Revision 1.307 2003/06/17 06:11:45 paulk
+;; - Change JDE->Documentation->Generate to Generate All.
+;; - Add JDE->Documentation->Generate Buffer.
+;;
+;; Revision 1.306 2003/05/03 09:01:55 paulk
+;; Require jde-class package.
+;;
+;; Revision 1.305 2003/04/28 04:49:57 paulk
+;; jde-mode now installs plugin menu if any plugins are installed on the user's
system and the plugins have menus. beanshell startup now includes plugin classpaths in the
beanshell classpath.
+;;
+;; Revision 1.304 2003/04/17 16:56:39 jslopez
+;; Points C-c C-v C-k from jde-bsh to jde-bsh-run.
+;;
+;; Revision 1.303 2003/04/16 04:15:26 paulk
+;; Restore require for jde-plugins package. This package is now in the CVS repository.
+;;
+;; Revision 1.302 2003/04/11 22:53:08 jslopez
+;; Removes require clause for missing library, jde-plugins. It was
+;; breaking the byte compilation.
+;;
+;; Revision 1.301 2003/04/09 04:03:23 paulk
+;; Moved jde-find-jde-data-directory to jde-util package.
+;;
+;; Revision 1.300 2003/04/06 07:34:43 paulk
+;; Renamed jde-bsh to jde-bsh-run to avoid conflict with class name.
+;;
+;; Revision 1.299 2003/03/28 05:33:30 andyp
+;; XEmacs optimizations for JDEbug and efc.
+;;
+;; Revision 1.298 2003/03/04 10:15:07 paulk
+;; Updated to use the new bsh-get-process method provided
+;; by bsh to get its process. This is necessary to insulate
+;; clients from the fact that bsh now uses a bsh-buffer
+;; object to wrap the Emacs Lisp buffer object that specifies
+;; the associated process.
+;;
+;; Revision 1.297 2003/02/25 16:00:30 jslopez
+;; Fixes typo.
+;;
+;; Revision 1.296 2003/02/25 06:58:07 paulk
+;; - Moved jde-debug command to jde-db.el and reimplemented it so that
+;; it works for both jdb and JDEbug.
+;;
+;; - Changing jde-mode-abbreviations now updates all the Java source
+;; buffers in the current project.
+;;
+;; Revision 1.295 2003/02/18 02:09:39 jslopez
+;; Fixes regression bugs.
+;;
+;; Revision 1.294 2003/02/17 08:13:05 paulk
+;; Changes required to support new package-independent version of beanshell.el
+;;
+;; Revision 1.293 2003/02/10 13:59:35 jslopez
+;; Fixes regression bug. Readds jde-debug method.
+;;
+;; Revision 1.292 2003/01/27 06:36:55 paulk
+;; jde-get-jdk-dir now uses javac instead of java as the JDK program to look
+;; for when searching exec-path for the JDK. This eliminates false hits on
+;; instances of java that were not installed as part of a JDK.
+;;
+;; Revision 1.291 2003/01/26 16:40:37 paulk
+;; Fix jde-get-global-classpath to normalize the value of CLASSPATH using
+;; the standard interpretation of the relative path character (.) rather
+;; than the project-relative interpretation.
+;;
+;; Revision 1.290 2003/01/26 08:09:46 paulk
+;; Fix to jde-create-prj-values-str to handle the case where the CLASSPATH
+;; has backslashes. Thanks to Martin Schwamberger.
+;;
+;; Revision 1.289 2003/01/21 14:21:57 jslopez
+;; Adds jde-gen-change-listener to the listeners submenu.
+;;
+;; Revision 1.288 2003/01/21 05:37:01 paulk
+;; - Adds jde-browse-class-at-point command. This command displays
+;; the class at point in the BeanShell class browser.
+;;
+;; - Replaces Speedbar menu item with a Browse submenu
+;; containing the items Browse->Source and
+;; Browse->Class at Point. The first displays the
+;; speedbar. The second invokes the
+;; jde-browse-class-at-point command.
+;;
+;; Revision 1.287 2003/01/02 07:37:19 paulk
+;; Fixed typo in binding for jde-jdb-menu-debug-applet.
+;; Thanks to Matt Watson.
+;;
;; Revision 1.286 2002/12/30 05:25:24 paulk
;; Minor tweaks for JDEE 2.3.2
;;
1.4 +12 -4 XEmacs/packages/xemacs-packages/jde/lisp/makefile
Index: makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/jde/lisp/makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- makefile 2003/01/18 05:48:47 1.3
+++ makefile 2006/03/03 20:42:42 1.4
@@ -1,4 +1,4 @@
-# $Revision: 1.13 $ $Date: 2002/08/07 06:36:14 $
+# $Revision: 1.14 $ $Date: 2003/06/24 12:48:26 $
#
# This makefile compiles the JDE lisp files.
#
@@ -25,11 +25,19 @@ all:
echo "(setq debug-on-error t)" >> jde-compile-script-init
echo "(require 'jde-compat)" >> jde-compile-script-init
echo "(require 'jde)" >>jde-compile-script-init
- $(EMACS) -batch -l jde-compile-script-init -f batch-byte-compile *.el
- rm -f jde-compile-script-init
+ if test `echo "$(EMACS)" | grep -w xemacs` ; \
+ then $(EMACS) -batch -l jde-compile-script-init -f batch-byte-compile `echo *.el` ; \
+ else $(EMACS) -batch -l jde-compile-script-init \
+ -f batch-byte-compile `ls -1 *.el | egrep -v 'jde-xemacs.el'`; \
+ fi;
+ if test -f jde-compile-script-init; then rm -f jde-compile-script-init; fi;
+
#
# $Log: makefile,v $
+# Revision 1.14 2003/06/24 12:48:26 paulk
+# Conditionalize to compile jde-xemacs.el only for XEmacs. Thanks to Raul Acevedo.
+#
# Revision 1.13 2002/08/07 06:36:14 paulk
# Removed code intended to eliminate spurious warnings when byte-compiling the JDEE. The
# removed code now resides in a separate package, jde-compat.el. Thanks to Andy Piper
@@ -50,4 +58,4 @@ all:
#
#
-# End of makefile
\ No newline at end of file
+# End of makefile
1.1 XEmacs/packages/xemacs-packages/jde/lisp/ChangeLog.upstream
Index: ChangeLog.upstream
===================================================================
2003-12-08 Paul Kinnucan <paulk(a)mathworks.com>
* jde-util.el: Update jde-find-class-source to work for inner classes.
2003-12-06 jslopez <jslopez@paulk_homepc>
* ReleaseNotes.txt: Adds notes to fix in jde-ant.
* jde-ant.el:
Fixes problem where jde-ant-program was being normalized unless it was set to
ant or ant.bat. Now it only gets normalized if it contains '/' or a '\'.
2003-11-30 Paul Kinnucan <paulk(a)mathworks.com>
* jde-gen.el: Fix control flow templates to preserve case of unexpanded
abbreviations in comments and strings.
2003-11-29 Paul Kinnucan <paulk(a)mathworks.com>
* efc.el:
The efc-dialog-show method ofr efc-option-dialog now uses save-window-excursion
to restore the user's original window conversion after showing the selection
buffer.
* jde.el:
Change abbreviation for throws from throw to thro to avoid inadvertent completion of
throw to throws.
2003-11-25 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
Fix regression that was causing abbrev-mode to be enabled for JDEE buffers even when
jde-enable-abbrev-mode was set to nil. Also, enable abbrev-mode in all open JDEE buffers
for the current project as a side effect of setting jde-enable-abbrev-mode on.
2003-11-23 Paul Kinnucan <paulk(a)mathworks.com>
* efc-xemacs.el:
Don't try to use native widgets if this version of XEmacs does not support native
widgets. Thanks to Len Trigg.
2003-11-18 Paul Kinnucan <paulk(a)mathworks.com>
* jde-run.el:
Fix the jde-run command so that it prompts you for application arguments if
jde-run-read-app-args is nonnil or if the jde-run command has a prefix argument.
2003-11-07 ahyatt <ahyatt@paulk_homepc>
* jde-xref.el: Invalid hooks removed
2003-11-05 Paul Kinnucan <paulk(a)mathworks.com>
* jde-checkstyle.el: Cosmetic changes.
* ReleaseNotes.txt: Note changes to CheckStyle interface.
2003-11-03 Paul Kinnucan <paulk(a)mathworks.com>
* jde-checkstyle.el: Updated to support CheckStyle 3.1.
2003-10-23 Paul Kinnucan <paulk(a)mathworks.com>
* jde-xemacs.el, jde-compat.el:
Added compatibility fix for older versions of XEmacs. Thanks to Len Trigg.
* jde.el:
Added fix for compatibility with old versions of XEmacs. Thanks to Len Trigg.
2003-10-19 jslopez <jslopez@paulk_homepc>
* ReleaseNotes.txt: Adds notes for fixes to jde-ant.
* jde-ant.el:
Removes sit-for from jde-ant-filter. It causes the tool-bar and menu bar to
redisplay annoyingly, plus it is not needed.
* jde-ant.el: Fixes error in the jde-ant-filter.
2003-10-17 ahyatt <ahyatt@paulk_homepc>
* ReleaseNotes.txt, jde-xref.el:
Speed improvements to jde-xref. Thanks to Suraj Acharya.
2003-10-14 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
jde-count-open-java-buffers now saves match data before doing a string-match. This fixes
compatibility problem with emacs-w3m.
2003-10-10 jslopez <jslopez@paulk_homepc>
* ReleaseNotes.txt:
Adds notes for fix to jde-wiz-extend-abstract-class.
2003-10-09 ahyatt <ahyatt@paulk_homepc>
* jde-xref.el:
David Ponce's fixes pertaining to the upcoming Semantic 2.0, plus
fixes of my own to get his changes working with the existing code.
2003-10-06 jslopez <jslopez@paulk_homepc>
* ReleaseNotes.txt: Adds notes for the change.
* jde-open-source.el, jde-parse.el:
Fixes several broken cases with jde-open-class-at-point.
2003-09-28 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
Created a new buffer-local variable, jde-buffer-project-file, that stores
the path of the project file for the current Java buffer. Updated
jde-get-current-project-buffers to use this variable to test whether
a given buffer is part of the current project. This should improve
the performance of this function and hence loading of project files,
which depends on it.
2003-09-28 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
Created a new buffer-local variable, jde-buffer-project-file, that stores
the path of the project file for the current Java buffer. Updated
jde-get-current-project-buffers to use this variable to test whether
a given buffer is part of the current project. This should improve
the performance of this function and hence loading of project files,
which depends on it.
2003-09-27 Paul Kinnucan <paulk(a)mathworks.com>
* ReleaseNotes.txt, jde-parse.el:
- Fix jde-parse-get-innermost-class-at-point to handle interface definitions.
- Fix jde-parse-eval-type-of to handle methods that throw exceptions.
Thanks to Suraj Acharya for these fixes.
2003-09-27 ahyatt <ahyatt@paulk_homepc>
* jde-dbo.el:
Exceptions should break when the user selects to suspend the thread as
well (not just when the user selects to suspect all threads).
2003-09-27 Paul Kinnucan <paulk(a)mathworks.com>
* jde-checkstyle.el:
Normalize path of CheckStyle jar file to permit use on the cygwin versions
of Emacs.
2003-09-27 ahyatt <ahyatt@paulk_homepc>
* ReleaseNotes.txt: Mentioned Suraj's fixes
* jde-xref.el:
Put in Suraj Acharya's fixes, fixed a no-prefix bug (but still don't allow no
prefixes)
2003-09-24 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
Changed jde-normalize-path to support use of relative paths in .emacs
files. Previously, if a relative path appeared in a variable, e.g.,
jde-global-path, that was set for the current project by the user's
.emacs file (as opposed to a project file), jde-normalize-path would
resolve the variable relative to the source buffer directory. Now
jde-normalize-path resolves it relative to the location of the nearest
project file in the source buffer directory tree. If the directory
tree does not contain a project file, jde-normalize-path resolves the
path relative to the source buffer directory.
2003-09-22 Paul Kinnucan <paulk(a)mathworks.com>
* jde-bug.el: Move Break on Exception menu item.
* jde-gen.el: Restore missing parentheses.
* jde-wiz.el: Cosmetic change.
* jde-import.el: Cosmetic changes.
* ReleaseNotes.txt: *** empty log message ***
* jde-gen.el:
Fix bug that was causing an extraneous space to be inserted in the
condition clause of control flow expansions, such as if. Thanks to
Sandip Chitale.
2003-09-21 Paul Kinnucan <paulk(a)mathworks.com>
* jde-bug.el:
Enable Break on Exception menu item only when a debuggee process
is running.
2003-09-21 Paul Kinnucan <paulk(a)mathworks.com>
* jde-imenu.el (jde-imenu-setup):
Install correct override for Semantic 2.0. Submitted by David Ponce.
* jde-javadoc.el:
- (jde-javadoc-checker-show-report): Better interaction with
libraries that use the header-line in GNU Emacs 21.
- (jde-javadoc-nonterminal-at-line): Use `forward-comment' to skip
comment at beginning of line.
Submitted by David Ponce.
2003-09-18 Paul Kinnucan <paulk(a)mathworks.com>
* jde-run.el: Fixed bug.
* jde-jdb.el:
Replace the attach and listen commands with separate commands for
attaching/listening via sockets and shared memory. This is necessary to support attaching
via sockets on Windows platforms.
* jde-db.el:
Created a set of proxie classes for standard JPDA connectors. Added
a connector slot to jde-db-debuggee class. This is intended to
support connecting a debugger to a debuggee class in attach or
listen mode.
2003-09-17 ahyatt <ahyatt@paulk_homepc>
* jde-bug.el: Added message to help users remove exception breakpoint
* ReleaseNotes.txt, jde-bug.el, jde-dbo.el: Added exception breakpoints
2003-09-16 Paul Kinnucan <paulk(a)mathworks.com>
* jde-make.el:
Update jde-make command to issue a cd to the default directory before invoking
make and to restore the original cwd afterwards. This fixes a bug in the
implementation of the jde-make-working-directory variable.
2003-09-14 Paul Kinnucan <paulk(a)mathworks.com>
* jde-run.el:
Changed jde-run-option-debug to provide separate options for shared memory
name, socket host, and socket port and to specify defaults explicitly.
2003-09-08 Paul Kinnucan <paulk(a)mathworks.com>
* jde-parse.el: Remove unnecessary require for semantic-bnf.
2003-09-07 Paul Kinnucan <paulk(a)mathworks.com>
* jde-wiz.el:
Fix interface, abstract class, and method delegation wizards
to observe jde-import-excluded-classes. Thanks to Martin
Schwamberg.
* jde-import.el:
Extend jde-import-excluded-classes to exclude classes that
belong to the same package as the importing class. Thanks to
Martin Schwamberg.
2003-09-02 ahyatt <ahyatt@paulk_homepc>
* jde-xref.el:
We weren't doing any subclass checks! Fixed this problem, then fixed
a problem where the subclass checks caused an infinite recursion
problem.
2003-09-01 Paul Kinnucan <paulk(a)mathworks.com>
* jde-checkstyle.el:
Removed the code that somebody added to prepend the package path to
the source file name and hence force the checkstyle command to be run
from the root of a package, thereby making it impossible to run from
the menu.
* jde-gen.el:
Updates docstring for jde-gen-method-template to document its
dependence on the new jde-gen-method-javadoc-comment variable.
* jde-gen.el:
Adds a customization variable, jde-gen-method-javadoc-comment,
that enables you to specify the type of javadoc comment
that the jde-gen-method-template generates for a skeleton method.
2003-08-28 Paul Kinnucan <paulk(a)mathworks.com>
* jde-help.el: Add jde-help-get-jdk-doc-url function.
* jde-javadoc-gen.el:
Now launches javadoc directly instead of via the current shell. This avoids the need
to quote command-line arguments, which always causes problems.
2003-08-25 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
Added item to the Documentation submenu to display the Javadoc Tool Reference.
* efc.el:
Adds efc-compiler class. This class implements an Emacs interface to an external process
that generates compiler-like output.
2003-08-05 ahyatt <ahyatt@paulk_homepc>
* jde-checkstyle.el:
Fixes problem with using checkstyle on files not in top-level directory
2003-07-26 Paul Kinnucan <paulk(a)mathworks.com>
* jde-gen.el:
Removed superfluous c-indent-function from control flow templates.
2003-07-19 Paul Kinnucan <paulk(a)mathworks.com>
* jde-open-source.el:
Make error message for jde-open-class-at-point more meaningful.
2003-07-18 Paul Kinnucan <paulk(a)mathworks.com>
* jde-run.el: Prefixing the jde-run command (e.g., C-u C-c C-v C-r) now
causes the command to prompt you to enter application arguments.
Prefixing the command with a - (e.g., C-u - C-c C-v C-r)
causes the command to prompt you to enter the name of
the application's main class as well as application arguments.
In previous releases, prefixing the command caused it only
to prompt for the application main class.
2003-07-15 Paul Kinnucan <paulk(a)mathworks.com>
* jde-java-font-lock.el: Remove CRs.
* jde-compile.el: Update jde-compile-option-target.
2003-07-15 ahyatt <ahyatt@paulk_homepc>
* jde-xemacs.el: coding-system-list was not defined in non-MULE xemacs
* jde-class.el: temp-directory was not always defined (in xemacs)
* jde-xref.el:
Fix for bug where users could not find the callers to interface functions
* jde-parse.el:
Fixed problem with private inner classes not being recognized by
jde-parse-get-innermost-class-at-point
2003-07-15 Paul Kinnucan <paulk(a)mathworks.com>
* jde-help.el:
Use jde-temp-directory to get directory for temporary files.
* jde-util.el: Add jde-temp-directory function.
2003-07-11 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el: Makes jde-cygpath a noop if system-type is not cygwin.
2003-07-09 ahyatt <ahyatt@paulk_homepc>
* jde-xref.el:
Made jde-xref-store-prefixes non-optional. I think if we didn't do
this, most people would leave it blank, therefore significantly
impacting both size of the database and the time and memory it takes
to make it.
2003-07-08 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el: Add documentation for jde-jeval- functions.
2003-07-06 Paul Kinnucan <paulk(a)mathworks.com>
* jde-java-font-lock.el:
As of version 5.30, cc-mode provides its own set of font lock keywords and faces for
Java: cc-fonts. The JDEE now uses cc-fonts if defined. Thanks to David Ponce.
2003-07-01 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el: Adds a jde-bsh-compile-mode-eval function. This function
is intended to be used by plugins to invoke Java development
utilities, such as source code style checkers, that emit
compiler-like error messages. Displaying the output in a
compilation-mode buffer enables the user to use compilation-mode's
error message navigation and hyperlinking capabilities.
2003-06-30 Paul Kinnucan <paulk(a)mathworks.com>
* jde-jdb.el: Provided help strings for Jdb menu items.
* beanshell.el:
Include bsh-vm-args in the command line that starts the BeanShell, thus fixing a
regression error reported by TAKAHASHI Toru.
2003-06-27 Paul Kinnucan <paulk(a)mathworks.com>
* jde-util.el: Expand docstring for jde-root function.
2003-06-26 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
Fix regression introduced by changes to jde-root-dir-p in previous version.
* ReleaseNotes.txt: Note bug fixes.
* jde.el:
- Now requires jde-autoloads for XEmacs installations that use
the independently distributed version of the JDEE rather than
the version that is packaged with XEmacs.
- Provides a workaround for a bug in file-exists-p in the cygwin
version of XEmacs that prevented the JDEE from finding project
files. The bug is that file-exists-p denies the existence of
files whose native Windows paths (file-truename) end in a slash.
2003-06-24 Paul Kinnucan <paulk(a)mathworks.com>
* jde-ant.el:
Fixed bug that caused noncompleting prompting for target to fail. Thanks to Christian
Schmitt.
* makefile:
Conditionalize to compile jde-xemacs.el only for XEmacs. Thanks to Raul Acevedo.
* jde.el:
- Update jde-symbol-p to recognize variables defined by autoloaded packages
that have not yet been loaded. Thanks to Martin Schwamberger.
- Fix jde-compile-jde to compile jde-xemacs.el only on Xemacs.
2003-06-22 Paul Kinnucan <paulk(a)mathworks.com>
* ReleaseNotes.txt: Fix and amplify.
* ReleaseNotes.txt: note beta3 bug fixes
* beanshell.el:
Fix "unreadable object" error when XEmacs tries to load beanshell.elc.
2003-06-22 Paul Kinnucan <paulk(a)mathworks.com>
* ReleaseNotes.txt: note beta3 bug fixes
* beanshell.el:
Fix "unreadable object" error when XEmacs tries to load beanshell.elc.
2003-06-21 Paul Kinnucan <paulk(a)mathworks.com>
* jde-plugins.el: Fix typo. Thanks to Martin Schamberger.
2003-06-20 Paul Kinnucan <paulk(a)mathworks.com>
* jde-javadoc-gen.el: Update docstrings.
2003-06-19 ahyatt <ahyatt@paulk_homepc>
* jde-parse-class.el:
Now compatible with emacs and xemacs versions without MULE
2003-06-18 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
Enhance jde-autoload-update to save and kill jde-autload.el buffer.
* jde-plugins.el:
Fix bug in jde-plugin-minor-mode's menu-installing code for XEmacs.
2003-06-18 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
Enhance jde-autoload-update to save and kill jde-autload.el buffer.
* jde-plugins.el:
Fix bug in jde-plugin-minor-mode's menu-installing code for XEmacs.
2003-06-17 Paul Kinnucan <paulk(a)mathworks.com>
* ReleaseNotes.txt: Corrections.
* jde.el: - Change JDE->Documentation->Generate to Generate All.
- Add JDE->Documentation->Generate Buffer.
* ReleaseNotes.txt: Note javadoc generation enhancements.
* jde-javadoc-gen.el:
- Now uses jde-get-jdk-dir to determine the location of the javadoc
executable.
- Adds a jde-javadoc-make-buffer command to generate doc only for the
source file in the current buffer.
2003-06-15 Paul Kinnucan <paulk(a)mathworks.com>
* jde-run.el: Enhance jde-run-option-debug to support suspend option.
* jde-jdb.el: Fix docstrings for jde-jdb-attach and jde-jdb-listen.
2003-06-13 Paul Kinnucan <paulk(a)mathworks.com>
* jde-gen.el: Fix typo. Update copyright.
* dist.makefile: Add jde-class to distribution.
2003-06-12 Paul Kinnucan <paulk(a)mathworks.com>
* jde-run.el:
Change terminology in jde-run-option-debug to match documentation, i.e., Attach becomes
Server mode and Listen becomes Client mode.
* jde-jdb.el: Cosmetic fix to set-var command.
2003-06-09 Paul Kinnucan <paulk(a)mathworks.com>
* jde-plugins.el: Test for nonexistence of plugins directory.
2003-06-07 Paul Kinnucan <paulk(a)mathworks.com>
* jde-java-font-lock.el:
Fix a small bug in the JDEE font lock on XEmacs 21.4.11. Thanks to Andrew Kensler.
* efc.el:
Fix regexp for matching Emacs versions. Thanks to David Ponce.
* jde-complete.el:
Prevent jde-mode from disabling the eldoc facility as
soon as eldoc delays display of a message, which made semantic eldoc
extensions practically unusable in Java buffers. Thanks to David Ponce.
2003-06-05 Paul Kinnucan <paulk(a)mathworks.com>
* ReleaseNotes.txt: Note fixes to jde-javadoc-gen.el.
* jde-javadoc-gen.el:
Add more precise check for existence of destination directory. Add
call to jde-update-autoloaded-symbols to ensure that the autoloade
customization variables defined by this package are initialized to the
values defined by the current project.
2003-06-02 Paul Kinnucan <paulk(a)mathworks.com>
* jde-jdb.el:
Reorganized Jdb->Display menu. Changed names of commands to reflect purpose, e.g.,
Display->Print
becomes Display->Expression. Deleted Display-Eval because it is the same as
Display->Expression.
Moved Set (variable) command from the DIsplay submenu to the toplevel Jdb menu. Changed
first Jdb->Set Variable prompt from "Expression: " to Variable: ".
2003-05-28 Paul Kinnucan <paulk(a)mathworks.com>
* jde-db.el:
Deleted definition of jde-db-startup-commands variable, which is no longer used.
2003-05-27 Paul Kinnucan <paulk(a)mathworks.com>
* jde-jdb.el:
Adds jde-jdb-help command. This command displays the JDB user's guide.
2003-05-22 ahyatt <ahyatt@paulk_homepc>
* jde-parse-class.el, jde-xemacs.el:
Fixes to make jde-parse-class and jde-xref compatible with xemacs
2003-05-15 Paul Kinnucan <paulk(a)mathworks.com>
* jde-ant.el: Fix jde-ant-get-ant-home.
2003-05-14 Paul Kinnucan <paulk(a)mathworks.com>
* jde-jdb.el: Fix regression caused by renaming jdb classes.
* jde-run.el:
Corrected and expanded the doc string for jde-run-option-debug.
* jde-jdb.el:
Fix jde-jdb-attach and jde-jdb-listen to reflect replacement of
jde-db-option-connect-address with jde-db-option-listen-address and
jde-db-option-attach-address.
* jde-db.el:
Replace jde-db-option-connect-address with jde-db-option-listen-address and
jde-db-option-attach-address.
* ReleaseNotes.txt: Note change to jde-run-option-debug variable.
* jde-run.el:
Enhance jde-run-option-debug to permit specification of type of data transport
to be used between debugger and debuggee process.
2003-05-13 Paul Kinnucan <paulk(a)mathworks.com>
* jde-jdb.el:
The attach and listen commands now prompt for a connect address if
jde-db-connect-address
is nil. Also provided extensive doc strings for these commands.
* jde-db.el:
Change the jde-db-option-connect-address variable so that a nil
value means that the debugger attach and listen commands should
prompt for a connect address.
2003-05-10 ahyatt <ahyatt@paulk_homepc>
* jde-class.el:
Fix assorted bugs dealing with with-all-corresponding-class-infos and using
with-all-class-files with package specifiers while using jar files.
2003-05-07 Paul Kinnucan <paulk(a)mathworks.com>
* ReleaseNotes.txt:
Note introduction of Andy Hyatt's class cross-reference tool.
2003-05-07 ahyatt <ahyatt@paulk_homepc>
* jde-xref.el: Uncommenting jde-update-autoloaded-symbols
2003-05-07 Paul Kinnucan <paulk(a)mathworks.com>
* beanshell.el:
Include Lisp error in messages buffer when a Lisp error results from evaluating the
result of a Java evaluation as Lisp.
2003-05-06 ahyatt <ahyatt@paulk_homepc>
* jde-class.el, jde-xref.el:
Fixes recent regression with default-directory not getting set back after making the xref
db (if the jde-built-class-path contains jars)
* jde-class.el:
Fixed problem with package variable, and the function to recursively delete a directory.
* jde-dbs.el: Removing last checkin, which was a mistake
* jde-dbs.el:
Fixed problem with package variable, and the function to recursively delete a directory.
2003-05-03 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el: Require jde-class package.
* jde-xref.el:
Fixed bug in jde-xref-update-xref-db that cause incorrect resolution
of db path specified relative to project file.
* jde-class.el: Fix typo in with-all-class-files.
2003-04-28 Paul Kinnucan <paulk(a)mathworks.com>
* jde.el:
jde-mode now installs plugin menu if any plugins are installed on the user's system
and the plugins have menus. beanshell startup now includes plugin classpaths in the
beanshell classpath.
* jde-plugins.el:
Implemented installation of menus and beanshell classpath for plugins.
2003-04-17 jslopez <jslopez@paulk_homepc>
* jde.el: Points C-c C-v C-k from jde-bsh to jde-bsh-run.
2003-04-16 Paul Kinnucan <paulk(a)mathworks.com>
* ChangeLog: Updated to latest changes.
* jde.el:
Restore require for jde-plugins package. This package is now in the CVS repository.
* beanshell.el:
Added a require statement for the comint package. This is not necessary for use with the
JDEE, which already requires comint, but may be necessary when beanshell.el is used
independently of the JDEE.
* jde-plugins.el: Initial revision.
* dist.makefile: Add jde-plugins.el to JDEE distribution.
2003-04-16 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde.el:
Restore require for jde-plugins package. This package is now in the CVS repository.
* /pack/anoncvs/jde/lisp/beanshell.el:
Added a require statement for the comint package. This is not
necessary for use with the JDEE, which already requires
comint, but may be necessary when beanshell.el is used
independently of the JDEE.
* /pack/anoncvs/jde/lisp/jde-plugins.el: Initial revision.
* /pack/anoncvs/jde/lisp/dist.makefile:
Add jde-plugins.el to JDEE distribution.
2003-04-11 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde.el:
Removes require clause for missing library, jde-plugins. It was
breaking the byte compilation.
* /pack/anoncvs/jde/lisp/beanshell.el: Fixes typo, orer to oref.
2003-04-11 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde.el:
Removes require clause for missing library, jde-plugins. It was
breaking the byte compilation.
* /pack/anoncvs/jde/lisp/beanshell.el: Fixes typo, orer to oref.
2003-04-09 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-util.el:
Adds jde-root function. Rewrote jde-find-jde-data-directory to use jde-root function.
* /pack/anoncvs/jde/lisp/jde.el:
Moved jde-find-jde-data-directory to jde-util package.
* /pack/anoncvs/jde/lisp/jde-wiz.el: Tiny docstring change.
2003-04-09 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-import.el:
Updates method call from jde-import-insert-imports to jde-import-insert-import.
2003-04-08 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-compile.el:
Fixes regression that causes compilation buffer's default
directory to be set incorrectly. Also rename compile
server buffer from *compilation* to *JDEE Compile Server*
* /pack/anoncvs/jde/lisp/beanshell.el:
Fixes bug that caused the working directory of the compilation buffer to be set
incorrectly. Also add methods to bsh-compilation-buffer class that simplify subclassing.
2003-04-06 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-import.el:
Fixed regression caused by Andy's efc XEmacs compatibility
changes. The regression was caused by the plural in the name
jde-import-choose-imports which implies that it should return a list
of imports selected by a user when in fact it should return only
one. The plural misled Andy to enclose the import selected by the user
in a list. I removed the enclosing list and I renamed the function and
a set of other similarly misnamed functions to the singular, e.g.,
jde-import-choose-import, to reflect the fact that they actually
insert only a single import.
* /pack/anoncvs/jde/lisp/jde.el:
Renamed jde-bsh to jde-bsh-run to avoid conflict with class name.
* /pack/anoncvs/jde/lisp/beanshell.el:
Fixed bugs caused by not handling the case when the user has killed a
Beanshell buffer. Also added a bsh-create-buffer method to allow
derived classes to override the type of buffer used to interact
with the BeanShell.
2003-04-05 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Note new jde-compile-jump-to-first-error option.
* /pack/anoncvs/jde/lisp/jde-compile.el:
Added jde-compile-jump-to-first-error option. Thanks to Sean Wellington.
2003-04-04 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-compile.el:
Adds the source argument to the jikes compiler.
2003-04-01 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/dist.makefile:
Added efc-xemacs.el and jde-xemacs.el to the JDEE distribution.
* /pack/anoncvs/jde/lisp/jde-compat.el: Add change log to end of file.
2003-03-28 andyp <andyp@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-run.el, /pack/anoncvs/jde/lisp/jde-stat.el,
/pack/anoncvs/jde/lisp/jde-wiz.el, /pack/anoncvs/jde/lisp/jde-xemacs.el,
/pack/anoncvs/jde/lisp/jde.el, /pack/anoncvs/jde/lisp/efc-xemacs.el,
/pack/anoncvs/jde/lisp/efc.el, /pack/anoncvs/jde/lisp/jde-ant.el,
/pack/anoncvs/jde/lisp/jde-bug.el, /pack/anoncvs/jde/lisp/jde-compat.el,
/pack/anoncvs/jde/lisp/jde-db.el, /pack/anoncvs/jde/lisp/jde-dbs.el,
/pack/anoncvs/jde/lisp/jde-ejb.el, /pack/anoncvs/jde/lisp/jde-import.el,
/pack/anoncvs/jde/lisp/jde-parse.el, /pack/anoncvs/jde/lisp/ChangeLog,
/pack/anoncvs/jde/lisp/ReleaseNotes.txt:
XEmacs optimizations for JDEbug and efc.
2003-03-19 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-wiz.el:
Updated doc for jde-wiz-include-javadoc, jde-wiz-generate-interface, jde-wiz-delegate,
jde-wiz-generate-abstract-class commands.
2003-03-13 ahyatt <ahyatt@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-class.el: Added CVS tags
2003-03-10 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Note change to jde-run-option-debug.
* /pack/anoncvs/jde/lisp/jde-run.el:
Simplified data type of jde-run-option-debug and set it off by default.
2003-03-08 ahyatt <ahyatt@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-parse-class.el:
Now parses exception information
* /pack/anoncvs/jde/lisp/jde-xref.el:
Simplified using new jde-class functionality
2003-03-04 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-ant.el, /pack/anoncvs/jde/lisp/jde.el:
Updated to use the new bsh-get-process method provided
by bsh to get its process. This is necessary to insulate
clients from the fact that bsh now uses a bsh-buffer
object to wrap the Emacs Lisp buffer object that specifies
the associated process.
* /pack/anoncvs/jde/lisp/jde-compile.el:
Updated the compile server to use the new compilation-mode buffer support
provided by bsh class.
* /pack/anoncvs/jde/lisp/beanshell.el:
Made the following changes to provide generalized support
for displaying BeanShell output in a compilation-mode buffer.
- Defined a new eieio class hierarchy that wraps Emacs buffers.
The hierarchy contains three classes: bsh-buffer, the base,
and bsh-comint-buffer and bsh-compilation-buffer class, which
wrap comint-mode and compilation-mode buffers, respectively.
- Added a bsh-buffer-eval method to the bsh class that displays
the results of evaluating a Java expression in a specified
bsh-buffer.
2003-03-03 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-gen.el:
Fixes a few formatting problems with jde-gen-generic-wrapper.
2003-03-01 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Adds notes for the addition of jde-gen-if-wrapper and jde-gen-if-else-wrapper.
* /pack/anoncvs/jde/lisp/jde-gen.el:
Add jde-gen-if-wrapper and jde-gen-if-else-wrapper.
2003-02-28 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-ant.el:
Adds support to jde-ant-complete-target to complete multiple targets.
* /pack/anoncvs/jde/lisp/jde-import.el:
Fixes bug in jde-import-insert-imports.
If new-imports contain only one import and this import is excluded the
code was importing a nil value.
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-compile.el:
Adds customization variable jde-compile-enable-kill-buffer. If true the
jde-compile-finish-kill-buffer hook will kill the compilation buffer.
2003-02-26 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-db.el:
Adds color to the list of breakpoints.
The color correspond to the status of the breakpoint, active, speficied,
or requested.
* /pack/anoncvs/jde/lisp/jde-import.el, /pack/anoncvs/jde/lisp/jde-parse.el:
Supresses more error messages when completing.
2003-02-25 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-db.el:
Removes the file name from the breakpoints list.
Changes the format to class:line number.
* /pack/anoncvs/jde/lisp/jde-jdb.el:
Fixes bug setting breakpoints that will leave breakpoints mark as
deferred even though they are not.
* /pack/anoncvs/jde/lisp/jde-jdb.el:
Fixes regression bug. Updates the remaining jde-db-debuggee to jde-jdb-debuggee.
* /pack/anoncvs/jde/lisp/jde.el: Fixes typo.
* /pack/anoncvs/jde/lisp/jde-parse.el:
Removes error messages that is not needed anymore.
* /pack/anoncvs/jde/lisp/jde-parse.el:
Fixes bug with jde-parse-get-qualified-name.
* /pack/anoncvs/jde/lisp/jde-help.el, /pack/anoncvs/jde/lisp/jde-parse.el,
/pack/anoncvs/jde/lisp/jde-wiz.el:
Modifies jde-parse-get-qualified-name to take an extra parameters.
If it does not find the qualified name it tries importing the class.
And updates a few places where it is call to do that.
* /pack/anoncvs/jde/lisp/jde-parse.el:
Modifies jde-parse-get-qualified-name to take an extra parameters.
If it does not find the qualified name it tries importing the class.
2003-02-25 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde.el:
- Moved jde-debug command to jde-db.el and reimplemented it so that
it works for both jdb and JDEbug.
- Changing jde-mode-abbreviations now updates all the Java source
buffers in the current project.
* /pack/anoncvs/jde/lisp/jde-db.el, /pack/anoncvs/jde/lisp/jde-dbs.el,
/pack/anoncvs/jde/lisp/jde-jdb.el:
Created a generalized jde-debug command and wired it up to jdb.
Next step is to wire it up to JDEbug.
* /pack/anoncvs/jde/lisp/jde-complete.el:
Fixes defadvice bug that disables eldoc-print-current-symbol-info
in all modes but emacs-lisp-mode and jde-mode. Thanks to ABE Yasushi.
* /pack/anoncvs/jde/lisp/jde-import.el:
Fix bug that causes jde-import-organize to insert the group name
multiple times when called repeatedly.
Thanks to Joshua Spiewak <JSpiewak(a)axeda.com>
2003-02-25 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-jdb.el:
Sets a main-class when attaching or listening through jdb to avoid
an unbound error.
2003-02-24 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-jdb.el:
Fixes bug in jde-db-listener-filter-output.
2003-02-24 nsieger <nsieger@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-juci.el:
Get rid of the defun-juci mechanism and declarative elisp functions
that map to java methods -- it didn't feel right, and is probably not
the standard way of doing things in Elisp. Better to be explicit and
pass the args directly to jde-juci-invoke-java.
2003-02-23 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-checkstyle.el:
Adds a variable jde-checkstyle-configuration-file to specify xml config file
required by Checkstyle 3.0.
Thanks to Joshua Spiewak <JSpiewak(a)axeda.com>.
2003-02-18 nsieger <nsieger@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-juci.el:
Ensure that a lisp result is written every time a java method or
beanshell script is invoked to suppress beanshell warnings
* /pack/anoncvs/jde/lisp/jde-juci.el:
Downcase variable names; use jde-jeval instead of bsh-eval
2003-02-18 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jcomplete.el, /pack/anoncvs/jde/lisp/jde-complete.el,
/pack/anoncvs/jde/lisp/jde-import.el, /pack/anoncvs/jde/lisp/jde-juci.el,
/pack/anoncvs/jde/lisp/jde-wiz.el, /pack/anoncvs/jde/lisp/jde.el:
Fixes regression bugs.
2003-02-17 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Note changes to beanshell.el.
2003-02-17 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-gen.el:
Fixes bug with jde-gen-change-listener-template.
* /pack/anoncvs/jde/lisp/jde-ant.el: Fixes regression bug.
2003-02-17 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-ant.el, /pack/anoncvs/jde/lisp/jde-compile.el,
/pack/anoncvs/jde/lisp/jde-wiz.el, /pack/anoncvs/jde/lisp/jde.el:
Changes required to support new package-independent version of beanshell.el
* /pack/anoncvs/jde/lisp/beanshell.el:
Refactors beanshell.el so that it supports but does not require the
JDEE. This allows beanshell.el to be used to support other Emacs
applications that want to use Java as an extension language. See
the package commentary for more information.
2003-02-17 nsieger <nsieger@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-juci.el:
One-way invocation of named Beanshell scripts working with defun-juci
macro
2003-02-15 nsieger <nsieger@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-juci.el:
Initial JUCI (JDEE Universal Communication Interface) checkin. No
code is loaded or built into the JDEE distribution or runtime yet.
* /pack/anoncvs/jde/lisp/beanshell.el (bsh-eval):
Add second optional IGNORE-EMPTY parameter which
suppresses errors if evaluation produces no forms. Part of initial
JUCI checkin, which necessitated this feature.
2003-02-10 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde.el:
Fixes regression bug. Readds jde-debug method.
2003-02-07 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Adds notes for the added support of assertion functionality.
* /pack/anoncvs/jde/lisp/jde-java-font-lock.el:
Adds assert as a keyword to be fortified.
Ideally we want the assert keyword fortified only when the user
is using jdk 1.4 but I don't know of a good way of enabling/disabling
fortifying a keyword based on another parameter. Since fortifying does
not cause any harm, I rather have it fortified always. This might prevent
users from using the assert keyword and causing them problem if they
want to upgrade to 1.4 and use assertions.
* /pack/anoncvs/jde/lisp/jde-compile.el:
Adds jde-compile-option-source to be compile 1.4 code with
the assert key word on it.
2003-01-31 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-ant.el:
Fixes regression bug for XEmacs. "'" Causes in XEmacs not to be able to
find the buildfile.
2003-01-27 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/beanshell.el:
Moved error-handling for when jde-get-tools-jar returns a nil value into
jde-get-tools-jar itself.
* /pack/anoncvs/jde/lisp/jde.el:
jde-get-jdk-dir now uses javac instead of java as the JDK program to look
for when searching exec-path for the JDK. This eliminates false hits on
instances of java that were not installed as part of a JDK.
2003-01-26 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde.el:
Fix jde-get-global-classpath to normalize the value of CLASSPATH using
the standard interpretation of the relative path character (.) rather
than the project-relative interpretation.
* /pack/anoncvs/jde/lisp/jde.el:
Fix to jde-create-prj-values-str to handle the case where the CLASSPATH
has backslashes. Thanks to Martin Schwamberger.
2003-01-23 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Note fix to jde-parse-class exists.
* /pack/anoncvs/jde/lisp/jde-parse.el:
Added check to ensure that the name argument to jde-parse-class-exists is
a string. This fixes bug where jde-complete was passing a nil argument to
jde-parse-exists-class-exists.
2003-01-23 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-ant.el:
Fixes bug when using ant.bat, double quotes seem to cause problems.
Fix to use jde-normalize-path when jde-ant-program is not ant or ant.bat.
2003-01-22 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Adds note for normalization of jde-ant-program.
* /pack/anoncvs/jde/lisp/jde-ant.el: Normalizes jde-ant-program.
2003-01-21 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde.el:
Adds jde-gen-change-listener to the listeners submenu.
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Adds notes for the addition of the change listener.
* /pack/anoncvs/jde/lisp/jde-gen.el:
Adds jde-gen-change-listener template.
* /pack/anoncvs/jde/lisp/jde-ant.el:
XEmacs compatibility fix, history seems to be a reserve word
in XEmacs.
2003-01-21 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Note new class browser command and browse menu.
* /pack/anoncvs/jde/lisp/jde.el:
- Adds jde-browse-class-at-point command. This command displays
the class at point in the BeanShell class browser.
- Replaces Speedbar menu item with a Browse submenu
containing the items Browse->Source and
Browse->Class at Point. The first displays the
speedbar. The second invokes the
jde-browse-class-at-point command.
2003-01-20 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/beanshell.el:
Slightly expanded error message for not being able to find the JDK tools jar file.
2003-01-19 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-checkstyle.el:
Removed aliasing of jde-build-classpath to jde-run-build-classpath-arg. I don't
understand
why that was done but it seems very bad for this file to change the definition of
such an important function.
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Note changes to jde-ejb.el.
* /pack/anoncvs/jde/lisp/jde-ejb.el:
Updated to reflect EJB 2.x. Thanks to Yoon Kyung Koo.
2003-01-17 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-import.el:
Fixes regression bug causing excluded imports to show in the
import list.
Fixes typo in jde-import-insert-imports. It was using new-imports instead
of candidate-imports.
2003-01-12 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-widgets.el:
Small, patch to reduce the amount of cases that cause infinite recursion.
2003-01-12 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt: cosmetic changes
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Note import wizard changes.
* /pack/anoncvs/jde/lisp/jde-import.el:
- Check whether import already exists AFTER the user selects the
import. This is to prevent the JDE from importing a class that
is already imported but from a different package.
- Display message when the buffer already imports the specified class.
- Clean up the code.
2003-01-12 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Add notes for a bug fix to jde-bug-set-breakpoint.
and for new jde-debug-list-breakpoints command.
* /pack/anoncvs/jde/lisp/jde-jdb.el:
Adds command List Breakpoints to the JDB menu.
* /pack/anoncvs/jde/lisp/jde-db.el:
Adds function jde-debug-list-breakpoints.
* /pack/anoncvs/jde/lisp/jde-bug.el:
Fixes bug in jde-bug-set-breakpoint.
The line number was not being set for new breakpoints with this method.
2003-01-12 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-help.el:
Some HTML validity tweaks to jde_meta.html and add window.focus() so the
browser window gets raised when new content is loaded into it.
Thanks to Ville Skyttä <scop(a)xemacs.org>.
2003-01-10 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Note fix to import wizard.
* /pack/anoncvs/jde/lisp/jde-import.el:
Fix jde-import-strip-existing-imports so that it handles package import statements.
2003-01-09 ahyatt <ahyatt@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/beanshell.el:
Beanshell should be started with an expanded classpath
2003-01-09 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Adds notes for jdb additions.
* /pack/anoncvs/jde/lisp/jde-jdb.el:
Exposes the jdb methods: print, dump, eval, set, and locals.
2003-01-08 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-jdb.el: Fixes typo in menu.
* /pack/anoncvs/jde/lisp/jde-run.el:
Removes duplicate definition of jde-run-get-vm.
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Adds notes for bug fix to jdb.
2003-01-07 ahyatt <ahyatt@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-xref.el:
Needed to clear the cache after updating.
2003-01-07 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-jdb.el:
Fixes bug that would parse line number higher than 999.
JDB prints out the number as 1,999.
2003-01-04 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-ant.el: Fixes regression bug.
Uncomments jde-ant-interactive-args-history definition.
2003-01-03 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Add notes for a couple of bug fixes.
* /pack/anoncvs/jde/lisp/beanshell.el:
Fixes bug that was not adding the ant jar files to the beanshell classpath
when jde-ant-home is not bound. This could happen because the jde-ant
package has not been loaded.
* /pack/anoncvs/jde/lisp/jde-open-source.el:
Fixes bug handling finding method definition in a super class.
The code was parsing the java file from where it was invoked instead
of the class file that was pertinent.
2003-01-02 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Note typo fix.
* /pack/anoncvs/jde/lisp/jde.el:
Fixed typo in binding for jde-jdb-menu-debug-applet.
Thanks to Matt Watson.
2003-01-02 ahyatt <ahyatt@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-xref.el:
Added ability for calls to superclasses to show up (under non-strict
mode) as calls to the subclass. So if class B inherits from class A,
then a call to a method on a class of type A (at compile time), may in
fact call a method on B at runtime. This is turned off in STRICT mode.
2002-12-30 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-autoload.el,
/pack/anoncvs/jde/lisp/jde.el:
Minor tweaks for JDEE 2.3.2
* /pack/anoncvs/jde/lisp/beanshell.el:
Define bsh-script-mode for editing BeanShell scripts.
* /pack/anoncvs/jde/lisp/jde-autoload.el: Updated for next release.
* /pack/anoncvs/jde/lisp/jde-javadoc-gen.el:
Fixed regression in jde-javadoc-make command.
2002-12-26 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde.el:
- Removed the obsolete function jde-set-compiler.
- Fixed jde-set-global-classpath to set jde-global-classpath correctly.
2002-12-21 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-checkstyle.el:
Fix bug in generation of jde-checkstyle-option-lcurly-method option. Thanks to ABE
Yasushi.
* /pack/anoncvs/jde/lisp/jde-javadoc-gen.el:
Fix docstring for jde-javadoc-gen-destination-directory.
* /pack/anoncvs/jde/lisp/jde.el:
Fix docstring for jde-global-classpath.
* /pack/anoncvs/jde/lisp/jde-javadoc-gen.el:
Normalize jde-javadoc-gen-destination-directory.
2002-12-19 ahyatt <ahyatt@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-bug.el:
Should have used slot-boundp instead of slot-existsp
* /pack/anoncvs/jde/lisp/jde-dbo.el:
Fixed problem with nulls in the tree-view display
2002-12-19 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-package.el:
Update customization variables when jde-package.el is loaded.
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt, /pack/anoncvs/jde/lisp/jde-autoload.el,
/pack/anoncvs/jde/lisp/jde-gen.el, /pack/anoncvs/jde/lisp/jde.el:
Changed to permit autoloading of jde-package.el file.
* /pack/anoncvs/jde/lisp/jde-package.el:
Fixed a bug caused by treating "." as a standard relative path character
instead of a project file relative path character.
Fixed and expanded some doc strings.
2002-12-18 ahyatt <ahyatt@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-xref.el:
Fixes a usability problem with call-trees, and fixes a bug where some
classes never get added to the xref database
2002-12-16 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/dist.makefile:
Add jde-ejb.el to the distribution.
2002-12-14 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt: Notes for more ant changes.
* /pack/anoncvs/jde/lisp/jde-ant.el: Fixes regression bug.
* /pack/anoncvs/jde/lisp/jde-ant.el:
Removes incompatibility between jde-ant-enable-find and jde-ant-read-buildfile.
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt:
Notes for recent changes to jde-ant.
* /pack/anoncvs/jde/lisp/jde-ant.el:
Changes the target history to be specific to each buildfile.
2002-12-14 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/ReleaseNotes.txt: *** empty log message ***
* /pack/anoncvs/jde/lisp/jde-help.el:
The jde-help-show-class-member-doc now opens the jde-metafile.html helper file as a raw
file. This avoids loading any html modes associated with html files on a user's
system. This in turn fixes a bug whereby displaying JAVA API doc triggers loading of
html32-mode which in turn turns on transient mark mode. Thanks to James Cox for this fix.
2002-12-14 jslopez <jslopez@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/beanshell.el:
Adds all the jar files in the ant/lib directory to the beanshell classpath.
* /pack/anoncvs/jde/lisp/jde-ant.el:
Fixes quoting the classpath for the Java invocation method.
Fixes the jde-ant-build-classpath command to grab the jar files
in the ANT_HOME/lib directory.
2002-12-13 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-gen.el:
Enhance the following code templates
- jde-gen-interface-buffer-template
- jde-gen-console-buffer-template
- jde-gen-jfc-app-buffer-template
- jde-gen-junit-test-class-buffer-template
to use the following javadoc templates instead of
literal text:
- jde-javadoc-author-tag-template
- jde-javadoc-version-tag-template
- jde-javadoc-end-block-template
Thanks to Peter Dobratz <dobratzp(a)ele.uri.edu>.
* /pack/anoncvs/jde/lisp/jde-checkstyle.el:
Fix typo in defcustom for jde-checkstyle-option-illegal-instantiations.
2002-12-12 Paul Kinnucan <paulk(a)mathworks.com>
* /pack/anoncvs/jde/lisp/jde-compile.el:
Fixed bug that caused the compile command to fail when jikes
is the compiler and jde-compiler does not specify the path of the
jikes executable.
2002-12-10 ahyatt <ahyatt@PAULK_HOMEPC>
* /pack/anoncvs/jde/lisp/jde-bug.el:
Previous changes did not work on slightly older versions of emacs.
Also, there were problems when opening a debug frame when attached to
a process.
2002-12-09 Andy Piper <andy(a)xemacs.org>
* jde-bug.el (jde-bug-minor-mode): move menu initialization to
jde-xemacs.el. Add a new hook jde-bug-minor-mode-hook.
* jde-xemacs.el: new file encapsulating XEmacs specific JDEE
features.
* efc-xemacs.el: new file encapsulating XEmacs specific efc
support.
2002-10-18 Andy Piper <andy(a)xemacs.org>
* jde-dbs.el (jde-dbs-debugger-hook): new hook run when the
debugger starts or stops.
* jde-import.el (jde-import-choose-imports): use
efc-query-options.
* jde-parse.el (jde-parse-select-qualified-class-name): ditto.
* jde-wiz.el (jde-wiz-implement-interface-internal): ditto.
(jde-wiz-implement-event-source-internal): ditto.
(jde-wiz-extend-abstract-class-internal): ditto.
1.1 XEmacs/packages/xemacs-packages/jde/lisp/efc-xemacs.el
Index: efc-xemacs.el
===================================================================
;;; efc-xemacs.el -- Emacs Foundation Classes using XEmacs gui features.
;; Author: Andy Piper <andy(a)xemacs.org>
;; Maintainer: Andy Piper
;; Keywords: lisp, tools, classes gui
;; Copyright (C) 2002, 2003 Andy Piper.
;; Copyright (C) 2001, 2002 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs 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 for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, US
;;; Commentary:
;; This package contains a set of eieio-based foundation classes
;; for XEmacs.
;; Please send bug reports and enhancement suggestions
;; to Andy Piper at <andy(a)xemacs.org>
;;; Code:
(require 'eieio)
(require 'efc)
;; Install ourselves as the default option function,
;; only if this version of XEmacs supports native widgets.
(when (fboundp 'make-dialog-box)
(setq efc-query-options-function 'efc-xemacs-query-options))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Option Dialog ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defclass efc-xemacs-option-dialog (efc-dialog)
((options :initarg :options
:documentation
"Options from from which to choose.")
(radio-buttons :initarg :radio-buttons
:documentation
"Buttons for selecting options.")
(text :initarg :text
:type string
:initform "Select option."
:documentation
"Text to be inserted at top of dialog.")
(selection :initarg :selection
:initform nil
:documentation
"Option chosen by the user."))
"This dialog allows a user to choose one of a set of OPTIONS by clicking
a radio button next to the option. The dialog sets SELECTION to the option
chosen by the user when the user selects the OK button on the dialog. This
dialog uses recursive edit to emulate a modal dialog.")
(defmethod initialize-instance ((this efc-xemacs-option-dialog) &rest fields)
"Dialog constructor."
(call-next-method))
(defmethod efc-dialog-show ((this efc-xemacs-option-dialog))
"Shows the options dialog buffer. After showing the dialog buffer,
this method invokes recursive-edit to emulate the behavior of a modal
dialog. This suspends the current command until the user has selected
an option or canceled the dialog. See `efc-dialog-ok' and
`efc-dialog-cancel' for more information."
(efc-xemacs-option-dialog-show this))
;; This is hack to get round a bug in XEmacs' treatment of :selected
(defvar efc-xemacs-option-dialog-selection nil)
(defun efc-xemacs-option-dialog-show (this)
(let ((parent (selected-frame)))
(unless (oref this selection)
(oset this selection (car (oref this options))))
(setq efc-xemacs-option-dialog-selection (oref this selection))
(oset
this selection
(make-dialog-box
'general
:parent parent
:title (oref this title)
:modal t
:autosize t
:spec (make-glyph
`[layout :orientation vertical
:justify center
:border [string :data ,(oref this text)]
:items ([layout :orientation vertical
:horizontally-justify left
:vertically-justify center
:items
,(mapcar
(lambda (x)
(vector
'button :descriptor x
:style 'radio
:selected
(list 'efc-xemacs-option-dialog-action this x)
:callback
(list 'efc-xemacs-option-dialog-select this x)))
(oref this options))]
[layout :orientation horizontal
:justify center
:items
([button :descriptor "Ok"
:callback-ex
(lambda (image-instance event)
(efc-xemacs-dialog-ok ,this event))]
[button :descriptor "Cancel"
:callback-ex 'efc-xemacs-dialog-cancel
])])]))
)))
(defun efc-xemacs-option-dialog-select (this item)
(oset this selection item)
(setq efc-xemacs-option-dialog-selection item))
(defun efc-xemacs-option-dialog-action (this item)
; This doesn't work for some reason I don't understand
; (equal item (oref this selection))
(equal efc-xemacs-option-dialog-selection item))
(defun efc-xemacs-dialog-ok (image-instance event)
"Invoked when the user selects the OK button on the options
dialog. Sets the :selection field of THIS to the option chosen by the
user and kills the dialog window."
(delete-frame (event-channel event))
(dialog-box-finish efc-xemacs-option-dialog-selection))
(defun efc-xemacs-dialog-cancel (image-instance event)
"Invoked when the user clicks the dialog's Cancel button. Invokes
the default cancel method, sets the :selection field of THIS to nil,
and kills the dialog window."
(delete-frame (event-channel event))
(dialog-box-cancel))
(defun efc-xemacs-query-options (options &optional prompt title)
"Ask user to choose among a set of options."
(let ((dialog
(efc-xemacs-option-dialog
(or title "Option Dialog")
:title (or title "Option Dialog")
:text (if prompt prompt "Select option:")
:options options)))
(efc-dialog-show dialog)
(oref dialog selection)))
;(defun efc-xemacs-test()
; (interactive)
; (message (efc-query-options (list "one" "two" "three")
; "Select an option.")))
;(defun efc-xemacs-test-ok()
; (interactive)
; (let ((dialog
; (efc-dialog
; "Ok cancel dialog"
; :title "Ok cancel dialog")))
; (efc-dialog-show dialog)))
(provide 'efc-xemacs)
1.1 XEmacs/packages/xemacs-packages/jde/lisp/jde-class.el
Index: jde-class.el
===================================================================
;; JDE-CLASS.EL --- Class usage commands for the JDEE.
;; $Revision: 1.6 $
;;
;; Copyright (C) 2003 Andrew Hyatt
;;
;; Author: Andrew Hyatt <andy_jde(a)thehyatts.net>
;; Maintainers: Andrew Hyatt and Paul Kinnucan
;; Keywords: java, tools
;;
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This program 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 for more details.
;; A copy of the GNU General Public License can be obtained from this
;; program's author (send electronic mail to
;; ) or from the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;; $Date: 2003/07/15 06:03:13 $
;;; Commentary:
;;;
;;;This is a package that contains various utility classes that are
;;; useful when dealing with class files. There are several macros to
;;; enable one to write code that looks through all compiled class
;;; files, such as `with-all-class-files', which calls some code for
;;; every class files in the `jde-built-class-path'. There is also
;;; `with-all-class-infos-when', which tests each class file with some
;;; predicate, and if it passes then makes the class-info available to
;;; the code in the body. `with-all-corresponding-class-infos' will
;;; execte for classes that are compiled from a certain Java source file.
;;;
;;; There are also a few helper utilities here.
(require 'jde-parse-class)
(defcustom jde-built-class-path nil
"Similar to `jde-global-classpath', except this path should only
have those places where compile files live. This list of paths could
contain both directories and jar files. Each of these should
correspond to the root of the build tree, in other words the
directories under it should correpond to packages."
:group 'jde-project
:type '(repeat (file :tag "Path")))
(defmacro with-all-class-files (spec &rest body)
"Call BODY for every class file found in `jde-built-class-path'.
Pass in the variable that the class filename will be substituted for,
and optionally a value to use as the return value (similar to
`dotimes'), otherwise `nil' will be returned. Another optional
argument in the SPEC is the package to restrict processing to.
\(fn (VAR [RESULT] [PACKAGE]) BODY...)"
(let ((class-var-sym (car spec))
(old-dir-sym (gensym "--with-all-class-files-old-dir"))
(normalized-path-sym (gensym "--with-all-class-files-npath"))
(dir-sym (gensym "--with-all-class-files-dir-sym"))
(dir2-sym (gensym "--with-all-class-files-dir2-sym"))
(path-sym (gensym "--with-all-class-files-path"))
(buf-sym (gensym "--with-all-class-files-buf"))
(rec-descend (gensym "--with-all-class-files-rec-descend"))
(process-files (gensym "--with-all-class-files-process-files"))
(process-class (gensym "--with-all-class-files-process-class"))
(child-path (gensym "--with-all-class-files-child-path"))
(package (nth 2 spec)))
`(labels ((,process-class (,class-var-sym)
(when (string-match "\.[Cc][Ll][Aa][Ss][Ss]$"
,class-var-sym)
,@body))
(,process-files (,dir2-sym)
(when (file-exists-p ,dir2-sym)
(dolist (,class-var-sym (directory-files
,dir2-sym
t
"[^.]$"))
(,process-class ,class-var-sym))))
(,rec-descend (,dir2-sym)
(if (file-directory-p ,dir2-sym)
(dolist (,child-path (directory-files ,dir2-sym
t
"[^.]$"))
(,rec-descend ,child-path))
(,process-class ,dir2-sym))))
(let ((,old-dir-sym default-directory))
(unwind-protect
(save-excursion
(dolist (,path-sym jde-built-class-path)
(let ((,normalized-path-sym (jde-normalize-path ,path-sym)))
(unless (file-exists-p ,normalized-path-sym)
(error (concat "Could not find file or directory "
,normalized-path-sym)))
(if (file-directory-p ,normalized-path-sym)
(if ,package
(,process-files
(concat ,normalized-path-sym "/"
(subst-char-in-string ?. ?/ ,package)))
(,rec-descend ,normalized-path-sym))
;; we're not a directory, assume we are a jar file
(let ((,dir-sym (concat (jde-temp-directory) "/"
(make-temp-name
"jde-classes-temp"))))
(make-directory ,dir-sym)
(cd ,dir-sym)
(let ((,buf-sym (get-buffer-create "*Jar output*")))
(unless (eq (call-process (jde-get-jdk-prog 'jar) nil
,buf-sym nil "-xf"
(expand-file-name
,normalized-path-sym)) 0)
(error
(concat "Could not unjar file "
(expand-file-name ,normalized-path-sym)
". See *Jar output* buffer for
details")))
(kill-buffer ,buf-sym))
(unwind-protect
(if ,package
(,process-files
(concat ,dir-sym "/" (subst-char-in-string
?. ?/ ,package)))
(,rec-descend ,dir-sym))
(jde-remove-all-from-directory ,dir-sym)))))))
(cd ,old-dir-sym)))
;; return val
,(nth 1 spec))))
(defmacro with-all-class-infos-when (spec pred &rest body)
"Call BODY with the parsed class information of each file found in
`jde-built-class-path' which passes PRED. PRED is called on the file
name, not the info. Also, in contrast to `with-all-classes', the BODY
won't get called on the same class twice. Pass in the variable that
the class info will be substituted for, and optionally a value to use
as the return value (similar to `dotimes'). Otherwise `nil' will be
returned. The second optional parameter is the optional package
parameter, to restrict processing to a particular package.
Example:(with-all-class-infos-when (info) (lambda (x)
(some-pred-p x)) (do-stuff info))"
(let ((parsed-class-sym (gensym "--with-all-class-infos-pclasses"))
(class-file-sym (gensym "--with-all-class-infos-cfile"))
(var-sym (car spec)))
`(let ((,parsed-class-sym '()))
(with-all-class-files (,class-file-sym ,@(cdr spec))
(when (and (not (jde-class-path-in-classes-p ,class-file-sym
,parsed-class-sym))
(funcall ,pred ,class-file-sym))
(let ((,var-sym (jde-parse-class ,class-file-sym)))
,@body
(add-to-list (quote ,parsed-class-sym)
(jde-parse-class-extract-classname info)))))
,(cadr spec))))
(defmacro with-all-corresponding-class-infos (spec &rest body)
"Do BODY with all the class files that correspond to the given
source file. SPEC is a list of the variable name to store the class
info, the package name of the source file, the source name of the source file, and the
optional return val.
\((with-all-corresponding-class-infos (VAR PACKAGE FILENAME [RESULT]) BODY...)"
`(with-all-class-infos-when (,(nth 0 spec) ,(nth 3 spec) ,(nth 1 spec))
(lambda (class-file)
(string-match ,(nth 1 spec)
(replace-regexp-in-string "/" "."
(file-name-directory class-file))))
(when (equal (jde-parse-class-extract-sourcefile info) ,(nth 2 spec))
,@body)))
(defun jde-class-path-in-classes-p (path classes)
"Returns true if the PATH looks like it represents a class in CLASSES"
(jde-class-partial-match-member
(replace-regexp-in-string "\\.[Cc][Ll][Aa][Ss][Ss]$" ""
(replace-regexp-in-string "/\\|\\$" "."
path))
classes))
(defun jde-class-partial-match-member (str list)
"Like `member' but works with strings and will return true if any of
the strings in LIST exist at the end of STR"
(member-if (lambda (item) (string-match (concat (regexp-quote item) "$")
str)) list))
(defun jde-remove-all-from-directory (dir)
(if (file-directory-p dir)
(progn
(mapcar 'jde-remove-all-from-directory
(directory-files dir t "[^\\.]$"))
(delete-directory dir))
(delete-file dir)))
(defun append-to-list (var list &optional accept-nil)
"Appends everything in LIST to the list in VAR. Use similar to
add-to-list, but instead of adding one things, adds a bunch.
ACCEPT-NIL determines if 'nil's are to be added. By default, they
will not be."
(dolist (item list)
(when (or accept-nil item)
(add-to-list var item))))
(defun jde-class-get-all-classes-used-by-source (package source-file)
(let ((primitives '("boolean" "int" "void"
"float" "double"))
(classes '()))
(with-all-corresponding-class-infos (info package source-file classes)
;;a. super class type
(add-to-list 'classes
(jde-parse-class-extract-superclass info))
;;b. super interfaces type
(append-to-list 'classes
(jde-parse-class-extract-interfaces info))
;;c. types of declared fields
;;d. local variable types
;; (all called types should wrk for this...)
(append-to-list 'classes (mapcar (lambda(item)
(caadr item))
(jde-parse-class-extract-method-calls info)))
;;e. method return type
;;f. method parameter type
(dolist (sig
(jde-parse-class-extract-method-signatures info))
(when (and (nth 1 sig) (not (member (nth 1 sig)
primitives)))
(add-to-list 'classes (nth 1 sig)))
(append-to-list 'classes
(mapcar (lambda (c) (when (and c
(not (member c primitives)) c)))
(nth 2 sig))))
;;g. method exception types
(dolist (exceptions (mapcar (lambda
(method-exceptions) (nth 1 method-exceptions))
(jde-parse-class-extract-thrown-exception-types info)))
(append-to-list 'classes exceptions))
;;h. type of exceptions in 'catch'
statements.
(dolist (exceptions (mapcar (lambda
(method-exceptions) (nth 1 method-exceptions))
(jde-parse-class-extract-caught-exception-types info)))
(append-to-list 'classes exceptions)))))
(provide 'jde-class)
;; $Log: jde-class.el,v $
;; Revision 1.6 2003/07/15 06:03:13 ahyatt
;; temp-directory was not always defined (in xemacs)
;;
;; Revision 1.5 2003/05/10 06:05:57 ahyatt
;; Fix assorted bugs dealing with with-all-corresponding-class-infos and using
with-all-class-files with package specifiers while using jar files.
;;
;; Revision 1.4 2003/05/06 06:50:55 ahyatt
;; Fixes recent regression with default-directory not getting set back after making the
xref db (if the jde-built-class-path contains jars)
;;
;; Revision 1.3 2003/05/06 05:25:47 ahyatt
;; Fixed problem with package variable, and the function to recursively delete a
directory.
;;
;; Revision 1.2 2003/05/03 08:43:41 paulk
;; Fix typo in with-all-class-files.
;;
;; Revision 1.1 2003/03/13 19:06:20 ahyatt
;; Added CVS tags
;;
1.1 XEmacs/packages/xemacs-packages/jde/lisp/jde-plugins.el
Index: jde-plugins.el
===================================================================
;;; jde-plugins.el -- Support for JDEE plugins
;; $Revision: 1.5 $ $Date: 2003/06/21 09:01:43 $
;; Author: Paul Kinnucan <pkinnucan(a)attbi.com>
;; Maintainer: Paul Kinnucan
;; Keywords: java, tools
;; Copyright (C) 2003 Paul Kinnucan.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs 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 for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
(require 'eieio)
(require 'executable)
;; XEmacs change: default to etc/jde/plugins
(defcustom jde-plugins-directory
(expand-file-name "plugins" (jde-find-jde-data-directory))
"Location of the JDEE's plugins directory."
:group 'jde
:type 'file)
(defclass jde-plugin ()
((bsh-cp :initarg :bsh-cp
:type list
:documentation "Beanshell classpath for this plugin.")
(menu-spec :initarg :menu-spec
:type list
:documentation "Specifies menu for this plugin.")
(plugins :type list
:allocation :class
:initform nil
:documentation
"Installed plugins."))
"Class of plugins.")
(defun jde-pi-register (plugin)
"Register PLUGIN, which must be an object of
type `jde-plugin'."
(oset-default
'jde-plugin
plugins
(cons plugin (oref 'jde-plugin plugins))))
(defun jde-pi-get-plugin-dir (plugin)
"Returns the path of the directory containing PLUGIN."
(expand-file-name plugin jde-plugins-directory))
(defun jde-pi-load-plugin (plugin)
"Loads the plugin named PLUGIN. This function assumes that the plugin resides
in a subdirectory of the JDEE's plugins directory named PLUGIN and that this
subdirectory contains a subdirectory name lisp that contains
a file named jde-PLUGIN.el. This function loads jde-PLUGIN.el."
(let* ((plugin-dir (expand-file-name plugin jde-plugins-directory))
(plugin-lisp-dir (expand-file-name "lisp" plugin-dir))
(plugin-lisp-package-name (concat "jde-" plugin))
(plugin-lisp-file-name (concat plugin-lisp-package-name ".el"))
(plugin-lisp-file
(expand-file-name
plugin-lisp-file-name
plugin-lisp-dir)))
(if (file-exists-p plugin-lisp-file)
(progn
(add-to-list 'load-path plugin-lisp-dir)
(require (intern plugin-lisp-package-name)))
(error "JDEE plugin Lisp file %s missing" plugin-lisp-file-name))))
(defun jde-pi-load-plugins ()
"Loads the plugins in the JDEE's plugins directory."
(interactive)
(if (file-exists-p jde-plugins-directory)
(let ((plugins
(delq
nil
(mapcar
(lambda (file)
(let ((file-name (file-name-nondirectory file)))
(if (and
(file-directory-p file)
(not (string= file-name "."))
(not (string= file-name "..")))
file-name)))
(directory-files jde-plugins-directory t)))))
(loop for plugin in plugins do
(jde-pi-load-plugin plugin)))))
(jde-pi-load-plugins)
(defun jde-pi-get-bsh-classpath ()
"Get the plugin directories and jar files to include in the Beanshell
classpath."
(mapcan
(lambda (plugin)
(oref plugin bsh-cp))
(oref 'jde-plugin plugins)))
(defun jde-pi-install-plugins ()
"This command installs any plugin distributables that it
finds in the JDEE's plugins directory. It assumes that
the distributables are in jar or zip format and that the
jar program is on the system path."
(interactive)
(assert (executable-find "jar") nil
"Cannot find the jar program on the system path.")
(let ((zip-files
(directory-files jde-plugins-directory nil ".*[.]\\(zip\\|jar\\)")))
(when zip-files
(let ((buf (get-buffer-create "*plugins*")))
(with-current-buffer buf
(erase-buffer)
(insert "JDEE Plugin Installation Log")
(pop-to-buffer buf)
(cd jde-plugins-directory)
(loop for zip-file in zip-files do
(let ((result
(shell-command-to-string
(concat "jar xvf " zip-file))))
(insert "\n\n")
(insert (format "Installing %s ..."
(file-name-sans-extension zip-file)))
(insert "\n\n")
(insert result)))
(insert "\n\nInstallation complete"))))))
(defun jde-plugin-make-menu-spec ()
(if (oref 'jde-plugin plugins)
(append
(list "JDEpi")
(delq
nil
(mapcan
(lambda (plugin)
(oref plugin menu-spec))
(oref 'jde-plugin plugins))))))
(defvar jde-plugin-mode-map
(let ((km (make-sparse-keymap))
(menu-spec (jde-plugin-make-menu-spec)))
(if menu-spec
(easy-menu-define jde-plugin-menu km "JDEE Plugin Minor Mode Menu"
menu-spec))
km)
"Keymap for JDEE plugin minor mode.")
(defvar jde-plugin-minor-mode nil
"Non-nil if JDEE plugin minor mode is enabled.")
(make-variable-buffer-local 'jde-plugin-minor-mode)
(defun jde-plugin-minor-mode (&optional arg)
"Toggle JDEE plugin minor mode.
With prefix argument ARG, turn on if positive, otherwise off..
\\{jde-plugin-mode-map}"
(interactive
(list (or current-prefix-arg
(if jde-plugin-minor-mode 0 1))))
(setq jde-plugin-minor-mode
(if arg
(>
(prefix-numeric-value arg)
0)
(not jde-plugin-minor-mode)))
(if (featurep 'xemacs)
(let ((menu-spec (jde-plugin-make-menu-spec)))
(if menu-spec
(if jde-plugin-minor-mode
(easy-menu-add menu-spec jde-plugin-mode-map)
(easy-menu-remove menu-spec))))))
(semantic-add-minor-mode 'jde-plugin-minor-mode " plugin"
jde-plugin-mode-map)
(provide 'jde-plugins)
;; Change History
;;
;; $Log: jde-plugins.el,v $
;; Revision 1.5 2003/06/21 09:01:43 paulk
;; Fix typo. Thanks to Martin Schamberg.
;;
;; Revision 1.4 2003/06/18 05:05:30 paulk
;; Fix bug in jde-plugin-minor-mode's menu-installing code for XEmacs.
;;
;; Revision 1.3 2003/06/09 05:45:26 paulk
;; Test for nonexistence of plugins directory.
;;
;; Revision 1.2 2003/04/28 04:47:02 paulk
;; Implemented installation of menus and beanshell classpath for plugins.
;;
;; Revision 1.1 2003/04/16 04:08:46 paulk
;; Initial revision.
;;
;;
;; End of jde-plugins.el
1.1 XEmacs/packages/xemacs-packages/jde/lisp/jde-xemacs.el
Index: jde-xemacs.el
===================================================================
;;; jde-xemacs.el -- xemacs specific code for JDEE.
;; Keywords: java, tools, debugging
;; Copyright (C) 2002, 2003 Andy Piper <andy(a)xemacs.org>
;; Copyright (C) 2002 Paul Kinnucan <paulk(a)mathworks.com>
;;
;; This file is part of XEmacs.
;;
;; XEmacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; XEmacs 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 for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with XEmacs; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;; Please send bug reports and enhancement suggestions
;; to Andy Piper at <andy(a)xemacs.org>
;;
;; If you don't use XEmacs, you should! XEmacs kicks some serious
;; butt!
;; XEmacs doesn't have replace-regexp-in-string so define our own
;; version
(unless (fboundp 'replace-regexp-in-string)
(defun replace-regexp-in-string (regexp rep string &optional
fixedcase literal subexp start)
"Replace all matches for REGEXP with REP in STRING.
Return a new string containing the replacements.
Optional arguments FIXEDCASE, LITERAL and SUBEXP are like the
arguments with the same names of function `replace-match'. If START
is non-nil, start replacements at that index in STRING.
REP is either a string used as the NEWTEXT arg of `replace-match' or a
function. If it is a function it is applied to each match to generate
the replacement passed to `replace-match'; the match-data at this
point are such that match 0 is the function's argument.
To replace only the first match (if any), make REGEXP match up to \\'
and replace a sub-expression, e.g.
(replace-regexp-in-string \"\\(foo\\).*\\'\" \"bar\" \" foo
foo\" nil nil 1)
=> \" bar foo\"
"
;; To avoid excessive consing from multiple matches in long strings,
;; don't just call `replace-match' continually. Walk down the
;; string looking for matches of REGEXP and building up a (reversed)
;; list MATCHES. This comprises segments of STRING which weren't
;; matched interspersed with replacements for segments that were.
;; [For a `large' number of replacments it's more efficient to
;; operate in a temporary buffer; we can't tell from the function's
;; args whether to choose the buffer-based implementation, though it
;; might be reasonable to do so for long enough STRING.]
(let ((l (length string))
(start (or start 0))
matches str mb me)
(save-match-data
(while (and (< start l) (string-match regexp string start))
(setq mb (match-beginning 0)
me (match-end 0))
;; If we matched the empty string, make sure we advance by one char
(when (= me mb) (setq me (min l (1+ mb))))
;; Generate a replacement for the matched substring.
;; Operate only on the substring to minimize string consing.
;; Set up match data for the substring for replacement;
;; presumably this is likely to be faster than munging the
;; match data directly in Lisp.
(string-match regexp (setq str (substring string mb me)))
(setq matches
(cons (replace-match (if (stringp rep)
rep
(funcall rep (match-string 0 str)))
fixedcase literal str subexp)
(cons (substring string start mb) ; unmatched prefix
matches)))
(setq start me))
;; Reconstruct a string from the pieces.
(setq matches (cons (substring string start l) matches)) ; leftover
(apply #'concat (nreverse matches)))))
)
(unless (fboundp 'subst-char-in-string)
(defun subst-char-in-string (fromchar tochar string &optional inplace)
"Replace FROMCHAR with TOCHAR in STRING each time it occurs.
Unless optional argument INPLACE is non-nil, return a new string."
(let ((i (length string))
(newstr (if inplace string (copy-sequence string))))
(while (> i 0)
(setq i (1- i))
(if (eq (aref newstr i) fromchar)
(aset newstr i tochar)))
newstr)))
;; For non-MULE versions of xemacs
(unless (fboundp 'coding-system-list)
(defun coding-system-list (&optional base-only)
'(raw-text)))
(when (featurep 'toolbar)
(require 'debug-toolbar))
(require 'jde-bug)
(require 'jde-compile)
;; Install gui options on XEmacs versions that can understand them
(when (and (featurep 'widget)
(>= emacs-major-version 21)
(>= emacs-minor-version 4)
(>= emacs-patch-level 10))
(require 'efc-xemacs))
;; Redefine toolbar-debug and toolbar-compile so that clicking the
;; icons on the toolbar will pop us into jde functions.
(defun toolbar-debug ()
(interactive)
(call-interactively 'jde-debug))
(defun toolbar-compile ()
(interactive)
(call-interactively 'jde-compile))
(add-hook 'jde-bug-minor-mode-hook
'(lambda (&optional on)
(if on
(easy-menu-add jde-bug-menu-spec jde-bug-mode-map)
(easy-menu-remove jde-bug-menu-spec))))
(defvar jde-xemacs-old-toolbar nil
"Saved toolbar for buffer.")
(defvar jde-xemacs-old-hooks nil
"Saved hooks for buffer.")
(defvar jde-xemacs-bug-mode-active nil
"Indicates whether jde-xemacs-bug-minor-mode is active.")
(defvar jde-xemacs-bug-minor-mode nil
"Indicates whether buffer is in jde-xemacs-bug-minor-mode or not")
(make-variable-buffer-local 'jde-xemacs-bug-minor-mode)
;; Make sure we only get the toolbar when we start debugging.
(add-hook 'jde-dbs-debugger-hook 'jde-xemacs-bug-minor-mode)
(defvar jde-xemacs-bug-initial-readonly 'undefined
"read-only status of buffer when not in jde-xemacs-bug-minor-mode")
(defvar jde-xemacs-bug-minor-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
(set-keymap-name map 'jde-xemacs-bug-minor-mode-map)
; (set-keymap-parent map jde-bug-mode-map)
(define-key map "\C-x\C-q" 'jde-xemacs-bug-minor-mode) ; toggle
read-only
(define-key map "c" 'jde-bug-continue)
(define-key map "n" 'jde-bug-step-over)
(define-key map "i" 'jde-bug-step-into)
(define-key map "b" 'jde-bug-toggle-breakpoint)
(define-key map "r" 'jde-bug-step-out)
(define-key map "g" 'jde-debug)
(define-key map "u" 'jde-bug-up-stack)
(define-key map "d" 'jde-bug-down-stack)
(define-key map "p" 'jde-bug-evaluate-expression)
(define-key map "q" 'jde-bug-exit)
map)
"Minor keymap for buffers in jde-xemacs-bug-minor-mode")
;; Create a new minor mode jde-bug-minor-mode is no good because it is
;; unconditionally on.
(semantic-add-minor-mode 'jde-xemacs-bug-minor-mode "[src]"
jde-xemacs-bug-minor-mode-map)
(defvar jde-xemacs-toolbar
'([debug::toolbar-stop-at-icon
jde-bug-toggle-breakpoint
t
"Stop at selected position"]
[debug::toolbar-stop-in-icon
jde-bug-set-conditional-breakpoint
nil
"Stop in function whose name is selected"]
[debug::toolbar-clear-at-icon
jde-bug-toggle-breakpoint
t
"Clear at selected position"]
[debug::toolbar-evaluate-icon
jde-bug-evaluate-expression
(and
(jde-dbs-debugger-running-p)
(jde-dbs-get-target-process))
"Evaluate selected expression"]
[debug::toolbar-run-icon
jde-debug
t
"Run current program"]
[debug::toolbar-cont-icon
jde-bug-continue
(jde-dbs-target-process-runnable-p)
"Continue current program"]
[debug::toolbar-step-into-icon
jde-bug-step-into
(jde-dbs-target-process-steppable-p)
"Step into (aka step)"]
[debug::toolbar-step-over-icon
jde-bug-step-over
(jde-dbs-target-process-steppable-p)
"Step over (aka next)"]
[debug::toolbar-up-icon
jde-xemacs-toolbar-up
(or
(not (jde-dbs-target-process-steppable-p))
(let* ((process (jde-dbs-get-target-process))
(stack-max
(if (slot-boundp process 'stack)
(1- (length (oref process stack)))
0))
(stack-ptr (oref process stack-ptr)))
(< stack-ptr stack-max)))
"Go Up (towards \"cooler\" - less recently visited - frames, or
superclass)"]
[debug::toolbar-down-icon
jde-xemacs-toolbar-down
(or
(not (jde-dbs-target-process-steppable-p))
(let* ((process (jde-dbs-get-target-process))
(stack-ptr (oref process stack-ptr)))
(> stack-ptr 0)))
"Go Down (towards \"warmer\" - more recently visited - frames, or
class at point)"]
[debug::toolbar-fix-icon
nil
nil
"Fix (not available with jde-bug)"]
[debug::toolbar-build-icon
jde-compile
t
"Compile the current file"]
))
(defun jde-xemacs-bug-minor-mode (arg &optional quiet)
"Minor mode for interacting with JDEbug from a Java source file.
With arg, turn jde-xemacs-bug-minor-mode on iff arg is positive. In
jde-xemacs-bug-minor-mode, you may send an associated JDEbug buffer commands
from the current buffer containing Java source code."
(interactive "P")
(setq jde-xemacs-bug-minor-mode
(if (null arg)
(not jde-xemacs-bug-minor-mode)
(> (prefix-numeric-value arg) 0)))
(cond (jde-xemacs-bug-minor-mode
;; Turn on jde-xemacs-bug-minor-mode
(when (not (local-variable-p 'jde-xemacs-bug-initial-readonly (current-buffer)))
(set (make-local-variable 'jde-xemacs-bug-initial-readonly)
buffer-read-only))
(jde-xemacs-insert-toolbar nil)
(setq buffer-read-only t)
;; Save old hooks and make sure we get turned on for new
;; buffers.
(unless jde-xemacs-bug-mode-active
(setq jde-xemacs-old-hooks jde-entering-java-buffer-hook)
(setq jde-entering-java-buffer-hook '(jde-xemacs-bug-minor-mode-hook))
;; Make sure turning off jde-bug mode turns us off also.
(add-hook 'jde-bug-minor-mode-hook 'jde-xemacs-bug-minor-mode)
(setq jde-xemacs-bug-mode-active t))
;; Killing the buffer kills the mode
(make-local-hook 'kill-buffer-hook)
(add-hook 'kill-buffer-hook 'jde-xemacs-bug-minor-mode-reset nil t)
(or quiet (message "Entering jde-xemacs-bug-minor-mode...")))
(t
;; Turn off jde-xemacs-bug-minor-mode
(and (local-variable-p 'jde-xemacs-bug-initial-readonly (current-buffer))
(progn
(setq buffer-read-only jde-xemacs-bug-initial-readonly)
(kill-local-variable 'jde-xemacs-bug-initial-readonly)
))
(jde-xemacs-insert-toolbar t)
;; First time through kill the hooks and reset all other
;; associated buffers.
(when jde-xemacs-bug-mode-active
(setq jde-entering-java-buffer-hook jde-xemacs-old-hooks)
(setq jde-xemacs-old-hooks nil)
(setq jde-xemacs-bug-mode-active nil)
(remove-hook 'jde-bug-minor-mode-hook 'jde-xemacs-bug-minor-mode)
(jde-xemacs-bug-minor-mode-reset))
(or quiet (message "Exiting jde-xemacs-bug-minor-mode..."))))
(redraw-modeline t))
(defun jde-xemacs-bug-minor-mode-hook ()
"Hook function to run when entering a Java buffer while in bug-minor-mode."
(jde-xemacs-bug-minor-mode t t))
(defun jde-xemacs-bug-minor-mode-reset ()
;; tidy house and turn off jde-xemacs-bug-minor-mode in all buffers
(mapcar #'(lambda (buffer)
(set-buffer buffer)
(cond ((local-variable-p 'jde-xemacs-bug-initial-readonly (current-buffer))
(jde-xemacs-bug-minor-mode -1 t))))
(buffer-list)))
;;;###autoload
(defun jde-xemacs-insert-toolbar (&optional remove)
"Insert or remove JDE toolbar in the XEmacs toolbar."
(interactive "P")
(when (featurep 'toolbar)
(if remove
(progn
(if (and jde-xemacs-old-toolbar (not (eq jde-xemacs-old-toolbar 'default)))
(set-specifier default-toolbar
(cons (current-buffer)
jde-xemacs-old-toolbar))
(remove-specifier default-toolbar (current-buffer)))
(kill-local-variable 'jde-xemacs-old-toolbar))
(unless jde-xemacs-old-toolbar
(set (make-local-variable 'jde-xemacs-old-toolbar)
(or (specifier-specs default-toolbar (current-buffer)) 'default)))
(set-specifier default-toolbar (cons (current-buffer)
jde-xemacs-toolbar)))))
(defun jde-xemacs-toolbar-up ()
(interactive)
(if (jde-dbs-target-process-steppable-p)
(jde-bug-up-stack)
(jde-show-superclass-source)))
(defun jde-xemacs-toolbar-down ()
(interactive)
(if (jde-dbs-target-process-steppable-p)
(jde-bug-down-stack)
(jde-show-class-source)))
(provide 'jde-xemacs)
1.1 XEmacs/packages/xemacs-packages/jde/plugins/README.txt
Index: README.txt
===================================================================
Install JDE plugins here.