jarspy-commits Mailing List for JarSpy- Java Archive Spying Utility (Page 11)
Status: Beta
Brought to you by:
brown_j
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(39) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(39) |
Feb
(12) |
Mar
|
Apr
(10) |
May
|
Jun
(24) |
Jul
(38) |
Aug
(9) |
Sep
(58) |
Oct
(34) |
Nov
|
Dec
(13) |
| 2003 |
Jan
(64) |
Feb
(3) |
Mar
(17) |
Apr
(20) |
May
(8) |
Jun
(3) |
Jul
|
Aug
(6) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
|
| 2005 |
Jan
(41) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Jeff B. <br...@us...> - 2002-09-18 23:07:42
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails
In directory usw-pr-cvs1:/tmp/cvs-serv7519/src/com/ociweb/jarspy/gui/classdetails
Modified Files:
DependencyTab.java FieldsTab.java MethodsTab.java
Log Message:
changed some of the detail panels to use text area instead of list
Index: DependencyTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/DependencyTab.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DependencyTab.java 14 Sep 2002 00:42:52 -0000 1.5
--- DependencyTab.java 18 Sep 2002 23:07:32 -0000 1.6
***************
*** 23,28 ****
import java.util.Iterator;
import java.util.Vector;
! import javax.swing.DefaultListModel;
! import javax.swing.JList;
/**
--- 23,27 ----
import java.util.Iterator;
import java.util.Vector;
! import javax.swing.JTextArea;
/**
***************
*** 33,53 ****
public class DependencyTab extends AbstractClassDetailTab {
! private JList dependencyList = new JList();
public DependencyTab() {
super("Dependencies");
setLayout(new BorderLayout());
! add(dependencyList);
}
public void setClassInfo(ClassInfo classInfo) {
- DefaultListModel model = new DefaultListModel();
Vector deps = classInfo.getDependencies();
Iterator iter = deps.iterator();
while (iter.hasNext()) {
! model.addElement(iter.next());
}
-
- dependencyList.setModel(model);
}
}
--- 32,50 ----
public class DependencyTab extends AbstractClassDetailTab {
! private JTextArea dependencyTextArea = new JTextArea();
public DependencyTab() {
super("Dependencies");
setLayout(new BorderLayout());
! dependencyTextArea.setEditable(false);
! add(dependencyTextArea);
}
public void setClassInfo(ClassInfo classInfo) {
Vector deps = classInfo.getDependencies();
Iterator iter = deps.iterator();
while (iter.hasNext()) {
! dependencyTextArea.append(iter.next().toString() + '\n');
}
}
}
Index: FieldsTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/FieldsTab.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FieldsTab.java 14 Sep 2002 00:42:52 -0000 1.2
--- FieldsTab.java 18 Sep 2002 23:07:32 -0000 1.3
***************
*** 21,26 ****
import com.ociweb.jarspy.ClassInfo;
import java.awt.BorderLayout;
! import javax.swing.DefaultListModel;
! import javax.swing.JList;
/**
--- 21,25 ----
import com.ociweb.jarspy.ClassInfo;
import java.awt.BorderLayout;
! import javax.swing.JTextArea;
/**
***************
*** 31,54 ****
public class FieldsTab extends AbstractClassDetailTab {
! private JList fieldsList = new JList();
public FieldsTab() {
super("Fields");
setLayout(new BorderLayout());
! add(fieldsList);
}
public void setClassInfo(ClassInfo classInfo) {
Object[] fields = classInfo.getFields();
- DefaultListModel model = new DefaultListModel();
if (fields.length == 0) {
! model.addElement("<none>");
} else {
for (int i = 0; i < fields.length; i++) {
! model.addElement(fields[i]);
}
}
- fieldsList.setModel(model);
-
}
}
--- 30,51 ----
public class FieldsTab extends AbstractClassDetailTab {
! private JTextArea fieldsTextArea = new JTextArea();
public FieldsTab() {
super("Fields");
setLayout(new BorderLayout());
! fieldsTextArea.setEditable(false);
! add(fieldsTextArea);
}
public void setClassInfo(ClassInfo classInfo) {
Object[] fields = classInfo.getFields();
if (fields.length == 0) {
! fieldsTextArea.setText("<none>");
} else {
for (int i = 0; i < fields.length; i++) {
! fieldsTextArea.append(fields[i].toString() + '\n');
}
}
}
}
Index: MethodsTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/MethodsTab.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MethodsTab.java 14 Sep 2002 00:42:52 -0000 1.2
--- MethodsTab.java 18 Sep 2002 23:07:32 -0000 1.3
***************
*** 21,26 ****
import com.ociweb.jarspy.ClassInfo;
import java.awt.BorderLayout;
! import javax.swing.DefaultListModel;
! import javax.swing.JList;
/**
--- 21,25 ----
import com.ociweb.jarspy.ClassInfo;
import java.awt.BorderLayout;
! import javax.swing.JTextArea;
/**
***************
*** 31,50 ****
public class MethodsTab extends AbstractClassDetailTab {
! private JList methodsList = new JList();
public MethodsTab() {
super("Methods");
setLayout(new BorderLayout());
! add(methodsList);
}
public void setClassInfo(ClassInfo classInfo) {
Object[] methods = classInfo.getMethods();
- DefaultListModel model = new DefaultListModel();
for (int i = 0; i < methods.length; i++) {
! model.addElement(methods[i]);
}
- methodsList.setModel(model);
}
}
--- 30,48 ----
public class MethodsTab extends AbstractClassDetailTab {
! private JTextArea methodsTextArea = new JTextArea();
public MethodsTab() {
super("Methods");
setLayout(new BorderLayout());
! methodsTextArea.setEditable(false);
! add(methodsTextArea);
}
public void setClassInfo(ClassInfo classInfo) {
Object[] methods = classInfo.getMethods();
for (int i = 0; i < methods.length; i++) {
! methodsTextArea.append(methods[i].toString() + '\n');
}
}
}
|
|
From: Jeff B. <br...@us...> - 2002-09-18 22:58:56
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/classinfo
In directory usw-pr-cvs1:/tmp/cvs-serv5047
Modified Files:
ClassReader.java
Log Message:
comment clean up
Index: ClassReader.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/classinfo/ClassReader.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ClassReader.java 18 Sep 2002 22:56:13 -0000 1.7
--- ClassReader.java 18 Sep 2002 22:58:53 -0000 1.8
***************
*** 19,27 ****
package com.ociweb.classinfo;
! import com.ociweb.classinfo.constantpool.*;
!
import java.io.DataInputStream;
- import java.io.File;
- import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Vector;
--- 19,28 ----
package com.ociweb.classinfo;
! import com.ociweb.classinfo.constantpool.CP_ClassEntry;
! import com.ociweb.classinfo.constantpool.CP_Utf8Entry;
! import com.ociweb.classinfo.constantpool.ConstantPool;
! import com.ociweb.classinfo.constantpool.ConstantPoolEntry;
! import com.ociweb.classinfo.constantpool.DefaultConstantPool;
import java.io.DataInputStream;
import java.io.InputStream;
import java.util.Vector;
***************
*** 64,68 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
public static final short ACC_PUBLIC = 0x0001;
--- 65,68 ----
***************
*** 70,74 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
public static final short ACC_PRIVATE = 0x0002;
--- 70,73 ----
***************
*** 76,80 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
public static final short ACC_PROTECTED = 0x0004;
--- 75,78 ----
***************
*** 82,86 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
public static final short ACC_STATIC = 0x0008;
--- 80,83 ----
***************
*** 88,92 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
public static final short ACC_FINAL = 0x0010;
--- 85,88 ----
***************
*** 94,98 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
// public static final short ACC_SYNCHRONIZED = 0x0020;
--- 90,93 ----
***************
*** 100,104 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
// public static final short ACC_SUPER = 0x0020;
--- 95,98 ----
***************
*** 106,110 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
public static final short ACC_VOLATILE = 0x0040;
--- 100,103 ----
***************
*** 112,116 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
public static final short ACC_TRANSIENT = 0x0080;
--- 105,108 ----
***************
*** 118,122 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
// public static final short ACC_NATIVE = 0x0100;
--- 110,113 ----
***************
*** 124,128 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
public static final short ACC_INTERFACE = 0x0200;
--- 115,118 ----
***************
*** 130,134 ****
/**
* value to mask against access_flags to identify signatures
- * @see #getAccessFlags
*/
public static final short ACC_ABSTRACT = 0x0400;
--- 120,123 ----
***************
*** 335,339 ****
/**
* @return true if this class is marked as public, otherwise false
- * @see #getAccessFlags
*/
public boolean isPublic() {
--- 324,327 ----
***************
*** 343,347 ****
/**
* @return true if this class is marked as final, otherwise false
- * @see #getAccessFlags
*/
public boolean isFinal() {
--- 331,334 ----
***************
*** 351,355 ****
/**
* @return true if this class is marked as abstract, otherwise false
- * @see #getAccessFlags
*/
public boolean isAbstract() {
--- 338,341 ----
***************
*** 359,363 ****
/**
* @return true if this class is an interface, otherwise false
- * @see #getAccessFlags
*/
public boolean isAnInterface() {
--- 345,348 ----
|
|
From: Jeff B. <br...@us...> - 2002-09-18 22:56:16
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/classinfo
In directory usw-pr-cvs1:/tmp/cvs-serv4298
Modified Files:
ClassReader.java
Log Message:
change code that reads in field and method attributes
to be more efficient
Index: ClassReader.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/classinfo/ClassReader.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ClassReader.java 13 Sep 2002 23:13:13 -0000 1.6
--- ClassReader.java 18 Sep 2002 22:56:13 -0000 1.7
***************
*** 60,64 ****
private short minorVersion_;
! private static final int MAGIC_NUMBER = 0xCAFEBABE;
/**
--- 60,64 ----
private short minorVersion_;
! private static final int MAGIC_NUMBER = 0xCAFEBABE;
/**
***************
*** 175,180 ****
for (int i = 0; i < entries.length; i++) {
ConstantPoolEntry entry = entries[i];
! if(entry instanceof CP_ClassEntry) {
! int index = ((CP_ClassEntry)entry).getIndex();
CP_Utf8Entry ue = (CP_Utf8Entry) constantPool.getEntryAt(index);
classDependencies_.addClass(ue.getValue());
--- 175,180 ----
for (int i = 0; i < entries.length; i++) {
ConstantPoolEntry entry = entries[i];
! if (entry instanceof CP_ClassEntry) {
! int index = ((CP_ClassEntry) entry).getIndex();
CP_Utf8Entry ue = (CP_Utf8Entry) constantPool.getEntryAt(index);
classDependencies_.addClass(ue.getValue());
***************
*** 219,228 ****
local_access_flags,
descriptorEntry.getValue());
for (int j = 0; j < attributes_count; j++) {
/*short attribute_name_index = */di.readShort();
int attribute_length = di.readInt();
! for (int k = 0; k < attribute_length; k++) {
! di.readByte();
! }
}
}
--- 219,235 ----
local_access_flags,
descriptorEntry.getValue());
+
+
for (int j = 0; j < attributes_count; j++) {
/*short attribute_name_index = */di.readShort();
int attribute_length = di.readInt();
! byte[] fieldAttribute = new byte[attribute_length];
! int bytesRead = 0;
! do {
! bytesRead += di.read(fieldAttribute,
! bytesRead,
! attribute_length - bytesRead);
!
! } while (bytesRead < attribute_length);
}
}
***************
*** 244,251 ****
/*short attribute_name_index2 = */di.readShort();
! int attribute_length2 = di.readInt();
! for (int k = 0; k < attribute_length2; k++) {
! /*byte info2 = */di.readByte();
! }
}
}
--- 251,263 ----
/*short attribute_name_index2 = */di.readShort();
! int attribute_length = di.readInt();
! byte[] fieldAttribute = new byte[attribute_length];
! int bytesRead = 0;
! do {
! bytesRead += di.read(fieldAttribute,
! bytesRead,
! attribute_length - bytesRead);
!
! } while (bytesRead < attribute_length);
}
}
|
|
From: Jeff B. <br...@us...> - 2002-09-18 22:47:36
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui
In directory usw-pr-cvs1:/tmp/cvs-serv2071
Modified Files:
MemoryMeter.java
Log Message:
update popup menu component tree ui before showing it
Index: MemoryMeter.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/gui/MemoryMeter.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** MemoryMeter.java 18 Sep 2002 00:18:18 -0000 1.6
--- MemoryMeter.java 18 Sep 2002 22:47:33 -0000 1.7
***************
*** 111,114 ****
--- 111,115 ----
public void mouseClicked(MouseEvent me) {
if (me.getButton() != 1) {
+ SwingUtilities.updateComponentTreeUI(gcPopup);
gcPopup.show(MemoryMeter.this, me.getX(), me.getY());
}
|
|
From: Jeff B. <br...@us...> - 2002-09-18 00:36:50
|
Update of /cvsroot/jarspy/JarSpy
In directory usw-pr-cvs1:/tmp/cvs-serv26055
Modified Files:
build.xml
Log Message:
exclude intellij dependency files from jar
Index: build.xml
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/build.xml,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** build.xml 19 Feb 2002 23:29:40 -0000 1.14
--- build.xml 18 Sep 2002 00:36:47 -0000 1.15
***************
*** 45,49 ****
<jar jarfile="${jar.file}"
manifest="${manifest.file}"
! basedir="${build.dir}"/>
</target>
--- 45,50 ----
<jar jarfile="${jar.file}"
manifest="${manifest.file}"
! basedir="${build.dir}"
! excludes="**/.dependency-info/"/>
</target>
|
|
From: Jeff B. <br...@us...> - 2002-09-18 00:18:21
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui
In directory usw-pr-cvs1:/tmp/cvs-serv21883
Modified Files:
MemoryMeter.java
Log Message:
removed code that was previously commented out
Index: MemoryMeter.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/gui/MemoryMeter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** MemoryMeter.java 18 Sep 2002 00:17:39 -0000 1.5
--- MemoryMeter.java 18 Sep 2002 00:18:18 -0000 1.6
***************
*** 73,81 ****
/**
- * popup menu used to trigger gc
- */
- // private JPopupMenu gcPopup;
-
- /**
* default constructor uses DEFAULT_REFRESH_INTERVAL
*/
--- 73,76 ----
|
|
From: Jeff B. <br...@us...> - 2002-09-18 00:17:45
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui
In directory usw-pr-cvs1:/tmp/cvs-serv21711
Modified Files:
MemoryMeter.java
Log Message:
refactor popup menu code
Index: MemoryMeter.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/gui/MemoryMeter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MemoryMeter.java 18 Sep 2002 00:08:16 -0000 1.4
--- MemoryMeter.java 18 Sep 2002 00:17:39 -0000 1.5
***************
*** 75,79 ****
* popup menu used to trigger gc
*/
! private JPopupMenu gcPopup;
/**
--- 75,79 ----
* popup menu used to trigger gc
*/
! // private JPopupMenu gcPopup;
/**
***************
*** 99,103 ****
}
};
! gcPopup = new JPopupMenu();
JMenuItem mi = new JMenuItem("Run GC");
gcPopup.add(mi);
--- 99,107 ----
}
};
! setupPopupMenu();
! }
!
! private void setupPopupMenu() {
! final JPopupMenu gcPopup = new JPopupMenu();
JMenuItem mi = new JMenuItem("Run GC");
gcPopup.add(mi);
|
|
From: Jeff B. <br...@us...> - 2002-09-18 00:08:20
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui
In directory usw-pr-cvs1:/tmp/cvs-serv18930
Modified Files:
MemoryMeter.java
Log Message:
add popup menu to trigger gc and add some comments
Index: MemoryMeter.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/gui/MemoryMeter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MemoryMeter.java 17 Sep 2002 23:51:36 -0000 1.3
--- MemoryMeter.java 18 Sep 2002 00:08:16 -0000 1.4
***************
*** 20,25 ****
--- 20,31 ----
import java.awt.BorderLayout;
+ import java.awt.event.ActionEvent;
+ import java.awt.event.ActionListener;
+ import java.awt.event.MouseAdapter;
+ import java.awt.event.MouseEvent;
import java.text.DecimalFormat;
+ import javax.swing.JMenuItem;
import javax.swing.JPanel;
+ import javax.swing.JPopupMenu;
import javax.swing.JProgressBar;
import javax.swing.SwingUtilities;
***************
*** 30,49 ****
public class MemoryMeter extends JPanel {
!
public static final long DEFAULT_REFRESH_INTERVAL = 4000;
private JProgressBar progressBar = new JProgressBar();
private Thread refreshThread;
private long refreshInterval;
private DecimalFormat kFormatter = new DecimalFormat("#,##0.#K");
private DecimalFormat mFormatter = new DecimalFormat("###,###,###.#M");
private Runnable updateRunnable;
public MemoryMeter() {
this(DEFAULT_REFRESH_INTERVAL);
}
public MemoryMeter(long refreshInterval) {
super(new BorderLayout());
--- 36,92 ----
public class MemoryMeter extends JPanel {
! /**
! * the default amount of time between automatic updates to the display
! */
public static final long DEFAULT_REFRESH_INTERVAL = 4000;
+ /**
+ * displays current memory utilization
+ */
private JProgressBar progressBar = new JProgressBar();
+
+ /**
+ * thread used to constantly run and update the ui
+ * @see #DEFAULT_REFRESH_INTERVAL
+ */
private Thread refreshThread;
+
+ /**
+ * The amount of time between automatic updates to the display
+ */
private long refreshInterval;
+ /**
+ * used to format memory figures represented in kBytes
+ */
private DecimalFormat kFormatter = new DecimalFormat("#,##0.#K");
+
+ /**
+ * used to format memory figures represented in mBytes
+ */
private DecimalFormat mFormatter = new DecimalFormat("###,###,###.#M");
+ /**
+ * a runnable that is executed each time the display needs to be updated
+ */
private Runnable updateRunnable;
+ /**
+ * popup menu used to trigger gc
+ */
+ private JPopupMenu gcPopup;
+
+ /**
+ * default constructor uses DEFAULT_REFRESH_INTERVAL
+ */
public MemoryMeter() {
this(DEFAULT_REFRESH_INTERVAL);
}
+ /**
+ *
+ * @param refreshInterval the number of milliseconds between
+ * updates to the display
+ */
public MemoryMeter(long refreshInterval) {
super(new BorderLayout());
***************
*** 56,69 ****
}
};
! }
!
! public void addNotify() {
! super.addNotify();
! start();
! }
!
! public void removeNotify() {
! stop();
! super.removeNotify();
}
--- 99,119 ----
}
};
! gcPopup = new JPopupMenu();
! JMenuItem mi = new JMenuItem("Run GC");
! gcPopup.add(mi);
! mi.addActionListener(new ActionListener() {
! public void actionPerformed(ActionEvent ae) {
! System.runFinalization();
! System.gc();
! SwingUtilities.invokeLater(updateRunnable);
! }
! });
! progressBar.addMouseListener(new MouseAdapter() {
! public void mouseClicked(MouseEvent me) {
! if (me.getButton() != 1) {
! gcPopup.show(MemoryMeter.this, me.getX(), me.getY());
! }
! }
! });
}
***************
*** 119,122 ****
--- 169,181 ----
return kFormatter.format(value / 1000f);
}
+ }
+ public void addNotify() {
+ super.addNotify();
+ start();
+ }
+
+ public void removeNotify() {
+ stop();
+ super.removeNotify();
}
}
|
|
From: Jeff B. <br...@us...> - 2002-09-17 23:51:42
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui
In directory usw-pr-cvs1:/tmp/cvs-serv15307
Modified Files:
MemoryMeter.java
Log Message:
refactor so a new Runnable is not instantiated every
few seconds when the ui needs to be updated
Index: MemoryMeter.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/gui/MemoryMeter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MemoryMeter.java 17 Sep 2002 21:38:29 -0000 1.2
--- MemoryMeter.java 17 Sep 2002 23:51:36 -0000 1.3
***************
*** 40,43 ****
--- 40,45 ----
private DecimalFormat mFormatter = new DecimalFormat("###,###,###.#M");
+ private Runnable updateRunnable;
+
public MemoryMeter() {
this(DEFAULT_REFRESH_INTERVAL);
***************
*** 49,52 ****
--- 51,59 ----
progressBar.setStringPainted(true);
add(BorderLayout.CENTER, progressBar);
+ updateRunnable = new Runnable() {
+ public void run() {
+ updateDisplay();
+ }
+ };
}
***************
*** 60,80 ****
super.removeNotify();
}
public synchronized void start() {
stop();
refreshThread = new Thread() {
public void run() {
- Runtime runtime = Runtime.getRuntime();
try {
while (true) {
! final long totalMemory = runtime.totalMemory();
! long freeMemory = runtime.freeMemory();
! final long usedMemory = totalMemory - freeMemory;
! SwingUtilities.invokeLater(new Runnable() {
! public void run() {
! progressBar.setMaximum((int) totalMemory);
! progressBar.setValue((int) usedMemory);
! progressBar.setString(format(usedMemory, totalMemory));
! }
! });
Thread.sleep(refreshInterval);
}
--- 67,78 ----
super.removeNotify();
}
+
public synchronized void start() {
stop();
refreshThread = new Thread() {
public void run() {
try {
while (true) {
! SwingUtilities.invokeLater(updateRunnable);
Thread.sleep(refreshInterval);
}
***************
*** 88,91 ****
--- 86,99 ----
}
+ private synchronized void updateDisplay() {
+ Runtime runtime = Runtime.getRuntime();
+ final long totalMemory = runtime.totalMemory();
+ long freeMemory = runtime.freeMemory();
+ final long usedMemory = totalMemory - freeMemory;
+ progressBar.setMaximum((int) totalMemory);
+ progressBar.setValue((int) usedMemory);
+ progressBar.setString(format(usedMemory, totalMemory));
+ }
+
public synchronized void stop() {
try {
***************
*** 106,110 ****
private String format(long value) {
! if(value > 2200000) {
return mFormatter.format(value / 1000000f);
} else {
--- 114,118 ----
private String format(long value) {
! if (value > 2200000) {
return mFormatter.format(value / 1000000f);
} else {
***************
*** 112,115 ****
}
}
-
}
--- 120,122 ----
|
|
From: Jeff B. <br...@us...> - 2002-09-17 21:43:36
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails
In directory usw-pr-cvs1:/tmp/cvs-serv12511/src/com/ociweb/jarspy/gui/classdetails
Modified Files:
ClassDetailTabbedPane.java ConstantPoolTab.java
Log Message:
put each tabbed panel in a scroll pane
Index: ClassDetailTabbedPane.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/ClassDetailTabbedPane.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ClassDetailTabbedPane.java 14 Sep 2002 00:42:52 -0000 1.5
--- ClassDetailTabbedPane.java 17 Sep 2002 21:43:33 -0000 1.6
***************
*** 21,24 ****
--- 21,25 ----
import com.ociweb.jarspy.ClassInfo;
import javax.swing.BorderFactory;
+ import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
***************
*** 43,47 ****
AbstractClassDetailTab tab = tabs[i];
tab.setBorder(BorderFactory.createRaisedBevelBorder());
! add(tab);
}
}
--- 44,48 ----
AbstractClassDetailTab tab = tabs[i];
tab.setBorder(BorderFactory.createRaisedBevelBorder());
! add(new JScrollPane(tab), tab.getName());
}
}
Index: ConstantPoolTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/ConstantPoolTab.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ConstantPoolTab.java 14 Sep 2002 00:42:52 -0000 1.4
--- ConstantPoolTab.java 17 Sep 2002 21:43:33 -0000 1.5
***************
*** 21,25 ****
import com.ociweb.jarspy.ClassInfo;
import java.awt.BorderLayout;
- import javax.swing.JScrollPane;
import javax.swing.JTextArea;
--- 21,24 ----
***************
*** 37,41 ****
setLayout(new BorderLayout());
txtArea.setEditable(false);
! add(BorderLayout.CENTER, new JScrollPane(txtArea));
}
--- 36,40 ----
setLayout(new BorderLayout());
txtArea.setEditable(false);
! add(BorderLayout.CENTER, txtArea);
}
|
|
From: Jeff B. <br...@us...> - 2002-09-17 21:38:32
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui In directory usw-pr-cvs1:/tmp/cvs-serv11114/src/com/ociweb/gui Modified Files: MemoryMeter.java Log Message: Index: MemoryMeter.java =================================================================== RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/gui/MemoryMeter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MemoryMeter.java 14 Sep 2002 00:44:00 -0000 1.1 --- MemoryMeter.java 17 Sep 2002 21:38:29 -0000 1.2 *************** *** 19,27 **** package com.ociweb.gui; import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.SwingUtilities; - import java.awt.BorderLayout; - import java.text.DecimalFormat; /** --- 19,27 ---- package com.ociweb.gui; + import java.awt.BorderLayout; + import java.text.DecimalFormat; import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.SwingUtilities; /** |
|
From: Jeff B. <br...@us...> - 2002-09-17 21:38:12
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv11001
Modified Files:
JarSpyGUI.java
Log Message:
dispose status screen when finished
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** JarSpyGUI.java 14 Sep 2002 00:42:52 -0000 1.36
--- JarSpyGUI.java 17 Sep 2002 21:38:08 -0000 1.37
***************
*** 304,307 ****
--- 304,308 ----
public void run() {
ss.setVisible(false);
+ ss.dispose();
}
});
|
|
From: Jeff B. <br...@us...> - 2002-09-16 22:03:24
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv23784
Modified Files:
StatusBar.java
Log Message:
changed insets
Index: StatusBar.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/StatusBar.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** StatusBar.java 14 Sep 2002 00:44:41 -0000 1.1
--- StatusBar.java 16 Sep 2002 22:03:21 -0000 1.2
***************
*** 43,46 ****
--- 43,47 ----
gbc.fill = gbc.HORIZONTAL;
gbc.insets.left = gbc.insets.right = 10;
+ gbc.insets.top = gbc.insets.bottom = 2;
gbc.weightx = 1.0;
add(statusLabel, gbc);
|
|
From: Jeff B. <br...@us...> - 2002-09-14 00:44:44
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv1408
Added Files:
StatusBar.java
Log Message:
--- NEW FILE: StatusBar.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.BorderFactory;
import javax.swing.border.BevelBorder;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import com.ociweb.jarspy.ClassInfo;
import com.ociweb.gui.MemoryMeter;
/**
* @version $Id: StatusBar.java,v 1.1 2002/09/14 00:44:41 brown_j Exp $
*/
public class StatusBar extends JPanel implements ClassSelectionListener {
private JLabel statusLabel = new JLabel("JarSpy");
StatusBar() {
setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = gbc.RELATIVE;
gbc.gridy = 0;
gbc.fill = gbc.HORIZONTAL;
gbc.insets.left = gbc.insets.right = 10;
gbc.weightx = 1.0;
add(statusLabel, gbc);
gbc.weightx = 0;
gbc.insets.left = gbc.insets.right = 2;
add(new JLabel("Mem:"), gbc);
add(new MemoryMeter(), gbc);
}
public void classSelected(ClassInfo classInfo) {
statusLabel.setText(classInfo != null ?
classInfo.getClassName() :
"JarSpy");
}
}
|
|
From: Jeff B. <br...@us...> - 2002-09-14 00:44:03
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui
In directory usw-pr-cvs1:/tmp/cvs-serv1271
Added Files:
MemoryMeter.java
Log Message:
--- NEW FILE: MemoryMeter.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.gui;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.text.DecimalFormat;
/**
* @version $Id: MemoryMeter.java,v 1.1 2002/09/14 00:44:00 brown_j Exp $
*/
public class MemoryMeter extends JPanel {
public static final long DEFAULT_REFRESH_INTERVAL = 4000;
private JProgressBar progressBar = new JProgressBar();
private Thread refreshThread;
private long refreshInterval;
private DecimalFormat kFormatter = new DecimalFormat("#,##0.#K");
private DecimalFormat mFormatter = new DecimalFormat("###,###,###.#M");
public MemoryMeter() {
this(DEFAULT_REFRESH_INTERVAL);
}
public MemoryMeter(long refreshInterval) {
super(new BorderLayout());
this.refreshInterval = refreshInterval;
progressBar.setStringPainted(true);
add(BorderLayout.CENTER, progressBar);
}
public void addNotify() {
super.addNotify();
start();
}
public void removeNotify() {
stop();
super.removeNotify();
}
public synchronized void start() {
stop();
refreshThread = new Thread() {
public void run() {
Runtime runtime = Runtime.getRuntime();
try {
while (true) {
final long totalMemory = runtime.totalMemory();
long freeMemory = runtime.freeMemory();
final long usedMemory = totalMemory - freeMemory;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
progressBar.setMaximum((int) totalMemory);
progressBar.setValue((int) usedMemory);
progressBar.setString(format(usedMemory, totalMemory));
}
});
Thread.sleep(refreshInterval);
}
} catch (InterruptedException e) {
}
}
};
refreshThread.setDaemon(true);
refreshThread.setPriority(Thread.MIN_PRIORITY);
refreshThread.start();
}
public synchronized void stop() {
try {
if (refreshThread != null) {
refreshThread.interrupt();
}
} catch (Exception e) {
}
}
public void setRefreshInterval(long refreshInterval) {
this.refreshInterval = refreshInterval;
}
private String format(long usedMemory, long totalMemory) {
return format(usedMemory) + " of " + format(totalMemory);
}
private String format(long value) {
if(value > 2200000) {
return mFormatter.format(value / 1000000f);
} else {
return kFormatter.format(value / 1000f);
}
}
}
|
|
From: Jeff B. <br...@us...> - 2002-09-14 00:42:55
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails
In directory usw-pr-cvs1:/tmp/cvs-serv1118/src/com/ociweb/jarspy/gui/classdetails
Modified Files:
ClassDetailTabbedPane.java ClassDetailsPanel.java
ConstantPoolTab.java DependencyTab.java FieldsTab.java
GeneralTab.java MethodsTab.java NoClassSelectedPanel.java
Log Message:
Index: ClassDetailTabbedPane.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/ClassDetailTabbedPane.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ClassDetailTabbedPane.java 13 Sep 2002 23:13:13 -0000 1.4
--- ClassDetailTabbedPane.java 14 Sep 2002 00:42:52 -0000 1.5
***************
*** 20,27 ****
import com.ociweb.jarspy.ClassInfo;
!
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
- import javax.swing.BorderFactory;
/**
--- 20,26 ----
import com.ociweb.jarspy.ClassInfo;
! import javax.swing.BorderFactory;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
/**
Index: ClassDetailsPanel.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/ClassDetailsPanel.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ClassDetailsPanel.java 13 Sep 2002 23:13:13 -0000 1.2
--- ClassDetailsPanel.java 14 Sep 2002 00:42:52 -0000 1.3
***************
*** 23,31 ****
import com.ociweb.jarspy.gui.JarFileSelectionListener;
import com.ociweb.jarspy.gui.JarSpyGUI;
-
- import javax.swing.JPanel;
- import javax.swing.JScrollPane;
import java.awt.CardLayout;
import java.io.File;
/**
--- 23,30 ----
import com.ociweb.jarspy.gui.JarFileSelectionListener;
import com.ociweb.jarspy.gui.JarSpyGUI;
import java.awt.CardLayout;
import java.io.File;
+ import javax.swing.JPanel;
+ import javax.swing.JScrollPane;
/**
Index: ConstantPoolTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/ConstantPoolTab.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ConstantPoolTab.java 13 Sep 2002 23:13:13 -0000 1.3
--- ConstantPoolTab.java 14 Sep 2002 00:42:52 -0000 1.4
***************
*** 20,26 ****
import com.ociweb.jarspy.ClassInfo;
!
! import javax.swing.*;
! import java.awt.*;
/**
--- 20,26 ----
import com.ociweb.jarspy.ClassInfo;
! import java.awt.BorderLayout;
! import javax.swing.JScrollPane;
! import javax.swing.JTextArea;
/**
***************
*** 36,42 ****
super("Constant Pool");
setLayout(new BorderLayout());
- Font f = txtArea.getFont();
- Font fixedWidth = new Font("Courier", f.getStyle(), f.getSize() + 2);
- txtArea.setFont(fixedWidth);
txtArea.setEditable(false);
add(BorderLayout.CENTER, new JScrollPane(txtArea));
--- 36,39 ----
Index: DependencyTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/DependencyTab.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DependencyTab.java 27 Aug 2002 03:02:38 -0000 1.4
--- DependencyTab.java 14 Sep 2002 00:42:52 -0000 1.5
***************
*** 20,29 ****
import com.ociweb.jarspy.ClassInfo;
-
- import javax.swing.DefaultListModel;
- import javax.swing.JList;
import java.awt.BorderLayout;
- import java.util.Vector;
import java.util.Iterator;
/**
--- 20,28 ----
import com.ociweb.jarspy.ClassInfo;
import java.awt.BorderLayout;
import java.util.Iterator;
+ import java.util.Vector;
+ import javax.swing.DefaultListModel;
+ import javax.swing.JList;
/**
Index: FieldsTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/FieldsTab.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FieldsTab.java 21 Jul 2002 02:03:47 -0000 1.1
--- FieldsTab.java 14 Sep 2002 00:42:52 -0000 1.2
***************
*** 20,27 ****
import com.ociweb.jarspy.ClassInfo;
!
import javax.swing.DefaultListModel;
import javax.swing.JList;
- import java.awt.BorderLayout;
/**
--- 20,26 ----
import com.ociweb.jarspy.ClassInfo;
! import java.awt.BorderLayout;
import javax.swing.DefaultListModel;
import javax.swing.JList;
/**
Index: GeneralTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/GeneralTab.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GeneralTab.java 21 Jul 2002 02:03:47 -0000 1.1
--- GeneralTab.java 14 Sep 2002 00:42:52 -0000 1.2
***************
*** 20,29 ****
import com.ociweb.jarspy.ClassInfo;
-
- import javax.swing.JLabel;
- import javax.swing.JPanel;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
/**
--- 20,28 ----
import com.ociweb.jarspy.ClassInfo;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
+ import javax.swing.JLabel;
+ import javax.swing.JPanel;
/**
Index: MethodsTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/MethodsTab.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MethodsTab.java 21 Jul 2002 02:03:47 -0000 1.1
--- MethodsTab.java 14 Sep 2002 00:42:52 -0000 1.2
***************
*** 20,27 ****
import com.ociweb.jarspy.ClassInfo;
!
import javax.swing.DefaultListModel;
import javax.swing.JList;
- import java.awt.BorderLayout;
/**
--- 20,26 ----
import com.ociweb.jarspy.ClassInfo;
! import java.awt.BorderLayout;
import javax.swing.DefaultListModel;
import javax.swing.JList;
/**
Index: NoClassSelectedPanel.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/NoClassSelectedPanel.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NoClassSelectedPanel.java 21 Jul 2002 02:03:47 -0000 1.1
--- NoClassSelectedPanel.java 14 Sep 2002 00:42:52 -0000 1.2
***************
*** 19,26 ****
package com.ociweb.jarspy.gui.classdetails;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
- import java.awt.BorderLayout;
/**
--- 19,26 ----
package com.ociweb.jarspy.gui.classdetails;
+ import java.awt.BorderLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
/**
|
|
From: Jeff B. <br...@us...> - 2002-09-14 00:42:55
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv1118/src/com/ociweb/jarspy/gui
Modified Files:
JarSpyGUI.java
Log Message:
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** JarSpyGUI.java 22 Aug 2002 23:09:07 -0000 1.35
--- JarSpyGUI.java 14 Sep 2002 00:42:52 -0000 1.36
***************
*** 56,59 ****
--- 56,60 ----
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
+ import javax.swing.JButton;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
***************
*** 69,72 ****
--- 70,75 ----
import java.awt.Point;
import java.awt.event.WindowListener;
+ import java.awt.event.ActionEvent;
+ import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
***************
*** 113,116 ****
--- 116,123 ----
splitter = new JSplitPane();
cont.add(BorderLayout.NORTH, createToolBar());
+ StatusBar sb = new StatusBar();
+
+ addClassSelectionListener(sb);
+ cont.add(BorderLayout.SOUTH, sb);
cont.add(BorderLayout.CENTER, splitter);
splitter.setRightComponent(classDetailPanel);
***************
*** 300,303 ****
--- 307,311 ----
});
} catch (Exception e1) {
+ e1.printStackTrace();
}
}
***************
*** 389,393 ****
/**
* Called whenever the value of the selection changes.
! * @param e the event that characterizes the change.
*/
public void valueChanged(TreeSelectionEvent tse) {
--- 397,401 ----
/**
* Called whenever the value of the selection changes.
! * @param tse the event that characterizes the change.
*/
public void valueChanged(TreeSelectionEvent tse) {
|
|
From: Jeff B. <br...@us...> - 2002-09-14 00:31:52
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions In directory usw-pr-cvs1:/tmp/cvs-serv31662 Modified Files: OpenArchiveAction.java Log Message: Index: OpenArchiveAction.java =================================================================== RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/OpenArchiveAction.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OpenArchiveAction.java 14 Sep 2002 00:31:20 -0000 1.5 --- OpenArchiveAction.java 14 Sep 2002 00:31:50 -0000 1.6 *************** *** 20,29 **** import com.ociweb.jarspy.gui.JarSpyGUI; - - import javax.swing.*; - import java.awt.*; import java.awt.event.ActionEvent; import java.io.File; import java.lang.reflect.InvocationTargetException; /** --- 20,29 ---- import com.ociweb.jarspy.gui.JarSpyGUI; import java.awt.event.ActionEvent; import java.io.File; import java.lang.reflect.InvocationTargetException; + import javax.swing.JFileChooser; + import javax.swing.JOptionPane; + import javax.swing.SwingUtilities; /** |
|
From: Jeff B. <br...@us...> - 2002-09-14 00:31:22
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions
In directory usw-pr-cvs1:/tmp/cvs-serv31565
Modified Files:
OpenArchiveAction.java
Log Message:
Index: OpenArchiveAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/OpenArchiveAction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** OpenArchiveAction.java 19 Jul 2002 00:46:43 -0000 1.4
--- OpenArchiveAction.java 14 Sep 2002 00:31:20 -0000 1.5
***************
*** 25,28 ****
--- 25,29 ----
import java.awt.event.ActionEvent;
import java.io.File;
+ import java.lang.reflect.InvocationTargetException;
/**
***************
*** 44,65 ****
Thread t = new Thread() {
public void run() {
! File file = null;
! jarSpyGUI.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
! try {
! file = fileChooser.getSelectedFile();
! jarSpyGUI.setFile(file);
! } catch (Exception exc) {
! String msg = "File: " + (file != null ?
! file.getName() :
! "(unknown)") +
! "\n" +
! exc.getMessage();
! JOptionPane.showMessageDialog(jarSpyGUI,
! msg,
! "ERROR",
! JOptionPane.ERROR_MESSAGE);
! } finally {
! jarSpyGUI.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
! }
}
};
--- 45,71 ----
Thread t = new Thread() {
public void run() {
! File file = null;
! try {
! file = fileChooser.getSelectedFile();
! jarSpyGUI.setFile(file);
! } catch (Exception exc) {
! final String msg = "File: " + (file != null ?
! file.getName() :
! "(unknown)") +
! "\n" +
! exc.getMessage();
! try {
! SwingUtilities.invokeAndWait(new Runnable() {
! public void run() {
! JOptionPane.showMessageDialog(jarSpyGUI,
! msg,
! "ERROR",
! JOptionPane.ERROR_MESSAGE);
! }
! });
! } catch (InterruptedException e) {
! } catch (InvocationTargetException e) {
! }
! }
}
};
|
|
From: Jeff B. <br...@us...> - 2002-09-13 23:13:57
|
Update of /cvsroot/jarspy/JarSpy In directory usw-pr-cvs1:/tmp/cvs-serv12716 Modified Files: .cvsignore Log Message: Index: .cvsignore =================================================================== RCS file: /cvsroot/jarspy/JarSpy/.cvsignore,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .cvsignore 14 Apr 2002 18:50:08 -0000 1.5 --- .cvsignore 13 Sep 2002 23:13:54 -0000 1.6 *************** *** 3,5 **** --- 3,6 ---- dist JarSpy.ipr + JarSpy.iws |
|
From: Jeff B. <br...@us...> - 2002-09-13 23:13:16
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails
In directory usw-pr-cvs1:/tmp/cvs-serv12534/src/com/ociweb/jarspy/gui/classdetails
Modified Files:
ClassDetailTabbedPane.java ClassDetailsPanel.java
ConstantPoolTab.java
Log Message:
first cut of using new constantpool api
Index: ClassDetailTabbedPane.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/ClassDetailTabbedPane.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ClassDetailTabbedPane.java 1 Sep 2002 00:38:35 -0000 1.3
--- ClassDetailTabbedPane.java 13 Sep 2002 23:13:13 -0000 1.4
***************
*** 50,53 ****
--- 50,54 ----
public void setClassInfo(final ClassInfo classInfo) {
+
// update all of the tabs
// use the event thread since these componenets will
Index: ClassDetailsPanel.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/ClassDetailsPanel.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ClassDetailsPanel.java 21 Jul 2002 02:03:47 -0000 1.1
--- ClassDetailsPanel.java 13 Sep 2002 23:13:13 -0000 1.2
***************
*** 50,54 ****
add(new JScrollPane(new NoClassSelectedPanel()), NO_CLASS_SELECTED);
! add(new JScrollPane(tabbedPane), CLASS_DETAIL_PANEL);
cardLayout.show(this, NO_CLASS_SELECTED);
--- 50,54 ----
add(new JScrollPane(new NoClassSelectedPanel()), NO_CLASS_SELECTED);
! add(tabbedPane, CLASS_DETAIL_PANEL);
cardLayout.show(this, NO_CLASS_SELECTED);
Index: ConstantPoolTab.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/ConstantPoolTab.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ConstantPoolTab.java 23 Aug 2002 02:44:37 -0000 1.2
--- ConstantPoolTab.java 13 Sep 2002 23:13:13 -0000 1.3
***************
*** 21,25 ****
import com.ociweb.jarspy.ClassInfo;
! import javax.swing.JLabel;
/**
--- 21,26 ----
import com.ociweb.jarspy.ClassInfo;
! import javax.swing.*;
! import java.awt.*;
/**
***************
*** 30,39 ****
public class ConstantPoolTab extends AbstractClassDetailTab {
public ConstantPoolTab() {
super("Constant Pool");
! add(new JLabel("Not Implemented Yet."));
}
public void setClassInfo(ClassInfo classInfo) {
}
}
--- 31,49 ----
public class ConstantPoolTab extends AbstractClassDetailTab {
+ private JTextArea txtArea = new JTextArea();
+
public ConstantPoolTab() {
super("Constant Pool");
! setLayout(new BorderLayout());
! Font f = txtArea.getFont();
! Font fixedWidth = new Font("Courier", f.getStyle(), f.getSize() + 2);
! txtArea.setFont(fixedWidth);
! txtArea.setEditable(false);
! add(BorderLayout.CENTER, new JScrollPane(txtArea));
}
public void setClassInfo(ClassInfo classInfo) {
+ txtArea.setText(classInfo.getConstantPool().toString());
+ txtArea.setCaretPosition(0);
}
}
|
|
From: Jeff B. <br...@us...> - 2002-09-13 23:13:16
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/classinfo
In directory usw-pr-cvs1:/tmp/cvs-serv12534/src/com/ociweb/classinfo
Modified Files:
ClassReader.java
Log Message:
first cut of using new constantpool api
Index: ClassReader.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/classinfo/ClassReader.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ClassReader.java 20 Jul 2002 18:12:23 -0000 1.5
--- ClassReader.java 13 Sep 2002 23:13:13 -0000 1.6
***************
*** 19,22 ****
--- 19,24 ----
package com.ociweb.classinfo;
+ import com.ociweb.classinfo.constantpool.*;
+
import java.io.DataInputStream;
import java.io.File;
***************
*** 58,74 ****
private short minorVersion_;
! private static final String DEPRECATED_FLAG = "Deprecated";
! private static final byte CONSTANT_Utf8 = 1;
! private static final byte CONSTANT_Integer = 3;
! private static final byte CONSTANT_Float = 4;
! private static final byte CONSTANT_Long = 5;
! private static final byte CONSTANT_Double = 6;
! private static final byte CONSTANT_Class = 7;
! private static final byte CONSTANT_String = 8;
! private static final byte CONSTANT_Fieldref = 9;
! private static final byte CONSTANT_Methodref = 10;
! private static final byte CONSTANT_InterfaceMethodref = 11;
! private static final byte CONSTANT_NameAndType = 12;
! private static final int MAGIC_NUMBER = 0xCAFEBABE;
/**
--- 60,64 ----
private short minorVersion_;
! private static final int MAGIC_NUMBER = 0xCAFEBABE;
/**
***************
*** 144,165 ****
public static final short ACC_ABSTRACT = 0x0400;
! /**
! * @param filename the name of a class file that this
! * <code>ClassReader</code> will attempt to parse. This constructor does
! * not declare it, but an <code>InvalidClassFileException</code> will be
! * thrown if the first 4 bytes of the file do not contain 0xCAFEBABE --
! * the "magic number" of a java class file
! */
! public ClassReader(File file) {
!
! FileInputStream is = null;
!
! try {
! is = new FileInputStream(file);
! read(is);//, file.getName());
! } catch (Exception e) {
! e.printStackTrace();
! }
! }
public ClassReader(InputStream is) {
--- 134,157 ----
public static final short ACC_ABSTRACT = 0x0400;
! // --Recycle Bin START (9/13/02 5:57 PM):
! // /**
! // * @param file
! // * <code>ClassReader</code> will attempt to parse. This constructor does
! // * not declare it, but an <code>InvalidClassFileException</code> will be
! // * thrown if the first 4 bytes of the file do not contain 0xCAFEBABE --
! // * the "magic number" of a java class file
! // */
! // public ClassReader(File file) {
! //
! // FileInputStream is = null;
! //
! // try {
! // is = new FileInputStream(file);
! // read(is);//, file.getName());
! // } catch (Exception e) {
! // e.printStackTrace();
! // }
! // }
! // --Recycle Bin STOP (9/13/02 5:57 PM)
public ClassReader(InputStream is) {
***************
*** 177,257 ****
minorVersion_ = di.readShort();
majorVersion_ = di.readShort();
! short constantPoolCount = di.readShort();
! constantPool = new String[constantPoolCount + 1];
! for (int i = 1; i < constantPoolCount; i++) {
! int tag = di.readUnsignedByte();
! switch (tag) {
! case CONSTANT_Utf8:
! constantPool[i] = di.readUTF();
! break;
! case CONSTANT_Integer:
! Integer tInt = new Integer(di.readInt());
! constantPool[i] = tInt.toString();
! break;
! case CONSTANT_Float:
! Float tFloat = new Float(di.readFloat());
! constantPool[i] = tFloat.toString();
! break;
! case CONSTANT_Long:
! Long tLong = new Long(di.readLong());
! constantPool[i] = tLong.toString();
! constantPool[++i] = tLong.toString();
! break;
! case CONSTANT_Double:
! Double tDouble = new Double(di.readDouble());
! constantPool[i] = tDouble.toString();
! constantPool[++i] = tDouble.toString();
! break;
! case CONSTANT_Class:
! Short tShort = new Short(di.readShort());
! constantPool[i] = tShort.toString();
! classRefs_.addElement(constantPool[i]);
! break;
! case CONSTANT_String:
! Short tString =
! new Short(di.readShort());
! constantPool[i] = tString.toString();
! break;
! case CONSTANT_Fieldref:
! short st6 = di.readShort();
! short st7 = di.readShort();
! constantPool[i] = st6 + ", " + st7;
! // constantPool[i] = "4";
! break;
! case CONSTANT_Methodref:
! short st2 = di.readShort();
! short st3 = di.readShort();
! constantPool[i] = st2 + ", " + st3;
! break;
! case CONSTANT_InterfaceMethodref:
! short ss1 = di.readShort();
! short ss2 = di.readShort();
! constantPool[i] = ss1 + ", " + ss2;
! break;
! case CONSTANT_NameAndType:
! short st4 = di.readShort();
! short st5 = di.readShort();
! constantPool[i] = st4 + ", " + st5;
! break;
! default:
! System.out.println("whoops: i = " +
! i + " tag = " + tag);
}
-
- }
-
- for (int i = 0; i < classRefs_.size(); i++) {
- String temp = (String) classRefs_.elementAt(i);
- int ti = Integer.parseInt(temp);
- String s = constantPool[ti];
-
- classDependencies_.addClass(s);
}
accessFlags_ = di.readShort();
! className_ = constantPool[Integer.valueOf
! (constantPool[di.readShort()]).intValue()].replace('/', '.');
int lastDot = className_.lastIndexOf('.');
--- 169,192 ----
minorVersion_ = di.readShort();
majorVersion_ = di.readShort();
! constantPool = new DefaultConstantPool(di);
! // populate the dependencies...
! ConstantPoolEntry[] entries = constantPool.getEntries();
! for (int i = 0; i < entries.length; i++) {
! ConstantPoolEntry entry = entries[i];
! if(entry instanceof CP_ClassEntry) {
! int index = ((CP_ClassEntry)entry).getIndex();
! CP_Utf8Entry ue = (CP_Utf8Entry) constantPool.getEntryAt(index);
! classDependencies_.addClass(ue.getValue());
}
}
accessFlags_ = di.readShort();
! short classNameIndex = di.readShort();
! ConstantPoolEntry e = constantPool.getEntryAt(classNameIndex);
! CP_ClassEntry classStringEntry = (CP_ClassEntry) e;
! CP_Utf8Entry c = (CP_Utf8Entry) constantPool.getEntryAt(classStringEntry.getIndex());
! className_ = c.getValue().replace('/', '.');
int lastDot = className_.lastIndexOf('.');
***************
*** 260,270 ****
int i2 = di.readShort();
if (i2 > 0) {
! int i1 = Integer.valueOf(constantPool[i2]).intValue();
! superClassName_ = constantPool[i1].replace('/', '.');
}
short interfaces_count = di.readShort();
for (int i = 1; i <= interfaces_count; i++) {
! short s = di.readShort();
}
--- 195,206 ----
int i2 = di.readShort();
if (i2 > 0) {
! CP_ClassEntry superClassEntry = (CP_ClassEntry) constantPool.getEntries()[i2];
! CP_Utf8Entry c2 = (CP_Utf8Entry) constantPool.getEntryAt(superClassEntry.getIndex());
! superClassName_ = c2.getValue().replace('/', '.');
}
short interfaces_count = di.readShort();
for (int i = 1; i <= interfaces_count; i++) {
! /*short s = */di.readShort();
}
***************
*** 278,314 ****
short descriptor_index = di.readShort();
short attributes_count = di.readShort();
! fields_[i] = new CRField(constantPool[name_index],
! local_access_flags,
! constantPool[descriptor_index]);
!
for (int j = 0; j < attributes_count; j++) {
! short attribute_name_index = di.readShort();
!
int attribute_length = di.readInt();
for (int k = 0; k < attribute_length; k++) {
! byte info = di.readByte();
}
}
}
short methods_count = di.readShort();
-
methods_ = new CRMethod[methods_count];
for (int i = 0; i < methods_count; i++) {
! short methodAccessFlag = di.readShort();
short name_index2 = di.readShort();
short descriptor_index2 = di.readShort();
short attributes_count2 = di.readShort();
!
! methods_[i] = new CRMethod(constantPool[name_index2],
! methodAccessFlag,
! constantPool[descriptor_index2]);
for (int j = 0; j < attributes_count2; j++) {
! short attribute_name_index2 = di.readShort();
int attribute_length2 = di.readInt();
for (int k = 0; k < attribute_length2; k++) {
! byte info2 = di.readByte();
}
}
--- 214,250 ----
short descriptor_index = di.readShort();
short attributes_count = di.readShort();
! CP_Utf8Entry nameEntry = (CP_Utf8Entry) constantPool.getEntryAt(name_index);
! CP_Utf8Entry descriptorEntry = (CP_Utf8Entry) constantPool.getEntryAt(descriptor_index);
! fields_[i] = new CRField(nameEntry.getValue(),
! local_access_flags,
! descriptorEntry.getValue());
for (int j = 0; j < attributes_count; j++) {
! /*short attribute_name_index = */di.readShort();
int attribute_length = di.readInt();
for (int k = 0; k < attribute_length; k++) {
! di.readByte();
}
}
}
short methods_count = di.readShort();
methods_ = new CRMethod[methods_count];
for (int i = 0; i < methods_count; i++) {
! short methodAccessflag = di.readShort();
short name_index2 = di.readShort();
short descriptor_index2 = di.readShort();
short attributes_count2 = di.readShort();
! CP_Utf8Entry nameEntry = (CP_Utf8Entry) constantPool.getEntryAt(name_index2);
! CP_Utf8Entry descriptorEntry = (CP_Utf8Entry) constantPool.getEntryAt(descriptor_index2);
! methods_[i] = new CRMethod(nameEntry.getValue(),
! methodAccessflag,
! descriptorEntry.getValue());
for (int j = 0; j < attributes_count2; j++) {
! /*short attribute_name_index2 = */di.readShort();
int attribute_length2 = di.readInt();
for (int k = 0; k < attribute_length2; k++) {
! /*byte info2 = */di.readByte();
}
}
***************
*** 328,331 ****
--- 264,271 ----
}
+ public ConstantPool getConstantPool() {
+ return constantPool;
+ }
+
/**
* @return the name of this class
***************
*** 372,381 ****
}
! /**
! * @return the access flags for this class.
! */
! public short getAccessFlags() {
! return accessFlags_;
! }
/**
--- 312,323 ----
}
! // --Recycle Bin START (9/13/02 6:01 PM):
! // /**
! // * @return the access flags for this class.
! // */
! // public short getAccessFlags() {
! // return accessFlags_;
! // }
! // --Recycle Bin STOP (9/13/02 6:01 PM)
/**
***************
*** 411,415 ****
}
! private String[] constantPool;
public Vector getDependencies() {
--- 353,358 ----
}
! // private String[] constantPool;
! ConstantPool constantPool;
public Vector getDependencies() {
***************
*** 417,421 ****
}
! private Vector classRefs_ = new Vector();
private CRClassDependencies classDependencies_ =
--- 360,364 ----
}
! // --Recycle Bin (9/13/02 5:57 PM): private Vector classRefs_ = new Vector();
private CRClassDependencies classDependencies_ =
***************
*** 482,486 ****
int endOfType = descriptor.indexOf(';');
if (endOfType < 0) {
! endOfType = descriptor.length();
typeDescription +=
convertDescriptor(descriptor.substring(1)) + brackets;
--- 425,429 ----
int endOfType = descriptor.indexOf(';');
if (endOfType < 0) {
! // endOfType = descriptor.length();
typeDescription +=
convertDescriptor(descriptor.substring(1)) + brackets;
***************
*** 489,493 ****
typeDescription +=
convertDescriptor(descriptor.substring
! (arrayCounter, endOfType)) + brackets;
descriptor = descriptor.substring(endOfType + 1);
}
--- 432,436 ----
typeDescription +=
convertDescriptor(descriptor.substring
! (arrayCounter, endOfType)) + brackets;
descriptor = descriptor.substring(endOfType + 1);
}
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/classinfo/constantpool
In directory usw-pr-cvs1:/tmp/cvs-serv12193
Added Files:
AbstractConstantPoolEntry.java CP_ClassEntry.java
CP_DoubleEntry.java CP_FieldrefEntry.java CP_FloatEntry.java
CP_IntegerEntry.java CP_InterfaceMethodrefEntry.java
CP_LongEntry.java CP_MethodrefEntry.java
CP_NameAndTypeEntry.java CP_StringEntry.java CP_Utf8Entry.java
ConstantPool.java ConstantPoolEntry.java
ConstantPoolEntryType.java DefaultCP_ClassEntry.java
DefaultCP_DoubleEntry.java DefaultCP_FieldrefEntry.java
DefaultCP_FloatEntry.java DefaultCP_IntegerEntry.java
DefaultCP_InterfaceMethodrefEntry.java
DefaultCP_LongEntry.java DefaultCP_MethdrefEntry.java
DefaultCP_NameAndTypeEntry.java DefaultCP_StringEntry.java
DefaultCP_Utf8Entry.java DefaultConstantPool.java
DefaultNULLCPEntry.java
Log Message:
added constantpool package
--- NEW FILE: AbstractConstantPoolEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* AbstractConstantPoolEntry
*/
public abstract class AbstractConstantPoolEntry
implements ConstantPoolEntry {
private final ConstantPoolEntryType type;
public AbstractConstantPoolEntry(ConstantPoolEntryType type) {
this.type = type;
}
public ConstantPoolEntryType getType() {
return type;
}
public String toString() {
return getType() + ": " + getValueDescription();
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
abstract String getValueDescription();
}
--- NEW FILE: CP_ClassEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_ClassEntry
*/
public interface CP_ClassEntry extends ConstantPoolEntry {
public short getIndex();
}
--- NEW FILE: CP_DoubleEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_DoubleEntry
*/
public interface CP_DoubleEntry extends ConstantPoolEntry {
}
--- NEW FILE: CP_FieldrefEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_FieldrefEntry
*/
public interface CP_FieldrefEntry extends ConstantPoolEntry {
}
--- NEW FILE: CP_FloatEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_FloatEntry
*/
public interface CP_FloatEntry extends ConstantPoolEntry {
}
--- NEW FILE: CP_IntegerEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_IntegerEntry
*/
public interface CP_IntegerEntry extends ConstantPoolEntry {
}
--- NEW FILE: CP_InterfaceMethodrefEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_InterfaceMethodrefEntry
*/
public interface CP_InterfaceMethodrefEntry extends ConstantPoolEntry {
}
--- NEW FILE: CP_LongEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_LongEntry
*/
public interface CP_LongEntry extends ConstantPoolEntry {
}
--- NEW FILE: CP_MethodrefEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_MethodrefEntry
*/
public interface CP_MethodrefEntry extends ConstantPoolEntry {
}
--- NEW FILE: CP_NameAndTypeEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_NameAndTypeEntry
*/
public interface CP_NameAndTypeEntry extends ConstantPoolEntry {
}
--- NEW FILE: CP_StringEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_StringEntry
*/
public interface CP_StringEntry extends ConstantPoolEntry {
public short getIndex();
}
--- NEW FILE: CP_Utf8Entry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* CP_Utf8Entry
*/
public interface CP_Utf8Entry extends ConstantPoolEntry {
public String getValue();
}
--- NEW FILE: ConstantPool.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* ConstantPool
*/
public interface ConstantPool {
/**
* @return an array of <code>ConstantPoolEntry</code>
* objects contained in this constant pool
*/
public ConstantPoolEntry[] getEntries();
/**
* @param index into the constant pool
* @return the entry at index
*/
public ConstantPoolEntry getEntryAt(int index);
}
--- NEW FILE: ConstantPoolEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* ConstantPoolEntry
*/
public interface ConstantPoolEntry {
public ConstantPoolEntryType getType();
}
--- NEW FILE: ConstantPoolEntryType.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* ConstantPoolEntryType
*/
public final class ConstantPoolEntryType {
public static final ConstantPoolEntryType CLASS_TYPE =
new ConstantPoolEntryType("Class");
public static final ConstantPoolEntryType DOUBLE_TYPE =
new ConstantPoolEntryType("Double");
public static final ConstantPoolEntryType FIELDREF_TYPE =
new ConstantPoolEntryType("Fieldref");
public static final ConstantPoolEntryType FLOAT_TYPE =
new ConstantPoolEntryType("Float");
public static final ConstantPoolEntryType INTEGER_TYPE =
new ConstantPoolEntryType("Integer");
public static final ConstantPoolEntryType INTERFACE_METHODREF_TYPE =
new ConstantPoolEntryType("InterfaceMethodref");
public static final ConstantPoolEntryType LONG_TYPE =
new ConstantPoolEntryType("Long");
public static final ConstantPoolEntryType METHODREF_TYPE =
new ConstantPoolEntryType("Methodref");
public static final ConstantPoolEntryType NAMEANDTYPE_TYPE =
new ConstantPoolEntryType("NameAndType");
public static final ConstantPoolEntryType STRING_TYPE =
new ConstantPoolEntryType("String");
public static final ConstantPoolEntryType UTF8_TYPE =
new ConstantPoolEntryType("Utf8");
public static final ConstantPoolEntryType NULL_ENTRY =
new ConstantPoolEntryType("null");
private String typeName;
private ConstantPoolEntryType(String typeName) {
this.typeName = typeName;
}
public String getTypeName() {
return typeName;
}
public String toString() {
return getTypeName();
}
}
--- NEW FILE: DefaultCP_ClassEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_ClassEntry
*/
public class DefaultCP_ClassEntry extends AbstractConstantPoolEntry
implements CP_ClassEntry {
private final short index;
public DefaultCP_ClassEntry(short index) {
super(ConstantPoolEntryType.CLASS_TYPE);
this.index = index;
}
public short getIndex() {
return index;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "index = " + index;
}
}
--- NEW FILE: DefaultCP_DoubleEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_DoubleEntry
*/
public class DefaultCP_DoubleEntry extends AbstractConstantPoolEntry
implements CP_DoubleEntry {
private final double value;
public DefaultCP_DoubleEntry(double value) {
super(ConstantPoolEntryType.DOUBLE_TYPE);
this.value = value;
}
public double getValue() {
return value;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "value = " + value;
}
}
--- NEW FILE: DefaultCP_FieldrefEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_FieldrefEntry
*/
public class DefaultCP_FieldrefEntry extends AbstractConstantPoolEntry
implements CP_FieldrefEntry {
private final short classIndex;
private final short nameAndTypeIndex;
public DefaultCP_FieldrefEntry(short classIndex,
short nameAndTypeIndex) {
super(ConstantPoolEntryType.FIELDREF_TYPE);
this.classIndex = classIndex;
this.nameAndTypeIndex = nameAndTypeIndex;
}
public short getClassIndex() {
return classIndex;
}
public short getNameAndTypeIndex() {
return nameAndTypeIndex;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "classIndex = " + classIndex + ", nameAndTypeIndex = " + nameAndTypeIndex;
}
}
--- NEW FILE: DefaultCP_FloatEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_FloatEntry
*/
public class DefaultCP_FloatEntry extends AbstractConstantPoolEntry
implements CP_FloatEntry {
private final float value;
public DefaultCP_FloatEntry(float value) {
super(ConstantPoolEntryType.FLOAT_TYPE);
this.value = value;
}
public float getValue() {
return value;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "value = " + value;
}
}
--- NEW FILE: DefaultCP_IntegerEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_IntegerEntry
*/
public class DefaultCP_IntegerEntry extends AbstractConstantPoolEntry
implements CP_IntegerEntry {
private final int value;
public DefaultCP_IntegerEntry(int value) {
super(ConstantPoolEntryType.INTEGER_TYPE);
this.value = value;
}
public int getValue() {
return value;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "value = " + value;
}
}
--- NEW FILE: DefaultCP_InterfaceMethodrefEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_InterfaceMethodrefEntry
*/
public class DefaultCP_InterfaceMethodrefEntry extends AbstractConstantPoolEntry
implements CP_InterfaceMethodrefEntry {
private final short classIndex;
private final short nameAndTypeIndex;
public DefaultCP_InterfaceMethodrefEntry(short classIndex,
short nameAndTypeIndex) {
super(ConstantPoolEntryType.INTERFACE_METHODREF_TYPE);
this.classIndex = classIndex;
this.nameAndTypeIndex = nameAndTypeIndex;
}
public short getClassIndex() {
return classIndex;
}
public short getNameAndTypeIndex() {
return nameAndTypeIndex;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "classIndex = " + classIndex + ", nameAndTypeIndex = " + nameAndTypeIndex;
}
}
--- NEW FILE: DefaultCP_LongEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_LongEntry
*/
public class DefaultCP_LongEntry extends AbstractConstantPoolEntry
implements CP_LongEntry {
private final long value;
public DefaultCP_LongEntry(long value) {
super(ConstantPoolEntryType.LONG_TYPE);
this.value = value;
}
public long getValue() {
return value;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "value = " + value;
}
}
--- NEW FILE: DefaultCP_MethdrefEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_MethdrefEntry
*/
public class DefaultCP_MethdrefEntry extends AbstractConstantPoolEntry
implements CP_MethodrefEntry {
private final short classIndex;
private final short nameAndTypeIndex;
public DefaultCP_MethdrefEntry(short classIndex,
short nameAndTypeIndex) {
super(ConstantPoolEntryType.METHODREF_TYPE);
this.classIndex = classIndex;
this.nameAndTypeIndex = nameAndTypeIndex;
}
public short getClassIndex() {
return classIndex;
}
public short getNameAndTypeIndex() {
return nameAndTypeIndex;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "classIndex = " + classIndex + ", nameAndTypeIndex = " + nameAndTypeIndex;
}
}
--- NEW FILE: DefaultCP_NameAndTypeEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_NameAndTypeEntry
*/
public class DefaultCP_NameAndTypeEntry extends AbstractConstantPoolEntry
implements CP_NameAndTypeEntry {
private final short nameIndex;
private final short descriptorIndex;
public DefaultCP_NameAndTypeEntry(short nameIndex,
short descriptorIndex) {
super(ConstantPoolEntryType.NAMEANDTYPE_TYPE);
this.nameIndex = nameIndex;
this.descriptorIndex = descriptorIndex;
}
public short getNameIndex() {
return nameIndex;
}
public short getDescriptorIndex() {
return descriptorIndex;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "nameIndex = " + nameIndex + ", descriptorIndex = " + descriptorIndex;
}
}
--- NEW FILE: DefaultCP_StringEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_StringEntry
*/
public class DefaultCP_StringEntry extends AbstractConstantPoolEntry
implements CP_StringEntry {
private final short index;
public DefaultCP_StringEntry(short index) {
super(ConstantPoolEntryType.STRING_TYPE);
this.index = index;
}
public short getIndex() {
return index;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "index = " + index;
}
}
--- NEW FILE: DefaultCP_Utf8Entry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultCP_Utf8Entry
*/
public class DefaultCP_Utf8Entry extends AbstractConstantPoolEntry
implements CP_Utf8Entry {
private final String value;
public DefaultCP_Utf8Entry(String value) {
super(ConstantPoolEntryType.UTF8_TYPE);
this.value = value;
}
public String getValue() {
return value;
}
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return value;
}
}
--- NEW FILE: DefaultConstantPool.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
import java.io.DataInputStream;
import java.io.IOException;
import java.text.DecimalFormat;
/**
* DefaultConstantPool
*/
public class DefaultConstantPool implements ConstantPool {
private static final byte CONSTANT_Utf8 = 1;
private static final byte CONSTANT_Integer = 3;
private static final byte CONSTANT_Float = 4;
private static final byte CONSTANT_Long = 5;
private static final byte CONSTANT_Double = 6;
private static final byte CONSTANT_Class = 7;
private static final byte CONSTANT_String = 8;
private static final byte CONSTANT_Fieldref = 9;
private static final byte CONSTANT_Methodref = 10;
private static final byte CONSTANT_InterfaceMethodref = 11;
private static final byte CONSTANT_NameAndType = 12;
private final ConstantPoolEntry[] entries;
public DefaultConstantPool(DataInputStream di)
throws IOException {
short constantPoolSize = di.readShort();
entries = new ConstantPoolEntry[constantPoolSize];
entries[0] = DefaultNULLCPEntry.INSTANCE;
for (int i = 1; i < constantPoolSize; i++) {
int tag = di.readUnsignedByte();
switch (tag) {
case CONSTANT_Utf8:
entries[i] = new DefaultCP_Utf8Entry(di.readUTF());
break;
case CONSTANT_Integer:
entries[i] = new DefaultCP_IntegerEntry(di.readInt());
break;
case CONSTANT_Float:
entries[i] = new DefaultCP_FloatEntry(di.readFloat());
break;
case CONSTANT_Long:
entries[i] = new DefaultCP_LongEntry(di.readLong());
entries[++i] = DefaultNULLCPEntry.INSTANCE;
break;
case CONSTANT_Double:
entries[i] = new DefaultCP_DoubleEntry(di.readDouble());
entries[++i] = DefaultNULLCPEntry.INSTANCE;
break;
case CONSTANT_Class:
entries[i] = new DefaultCP_ClassEntry(di.readShort());
break;
case CONSTANT_String:
entries[i] = new DefaultCP_StringEntry(di.readShort());
break;
case CONSTANT_Fieldref:
short fieldClassIndex = di.readShort();
short fieldNameAndTypeIndex = di.readShort();
entries[i] = new DefaultCP_FieldrefEntry(fieldClassIndex, fieldNameAndTypeIndex);
break;
case CONSTANT_Methodref:
short methodClassIndex = di.readShort();
short methodNameAndTypeIndex = di.readShort();
entries[i] = new DefaultCP_MethdrefEntry(methodClassIndex, methodNameAndTypeIndex);
break;
case CONSTANT_InterfaceMethodref:
short interfaceMethodClassIndex = di.readShort();
short interfaceNameAndTypeIndex = di.readShort();
entries[i] = new DefaultCP_InterfaceMethodrefEntry(interfaceMethodClassIndex, interfaceNameAndTypeIndex);
break;
case CONSTANT_NameAndType:
short nameIndex = di.readShort();
short descriptorIndex = di.readShort();
entries[i] = new DefaultCP_NameAndTypeEntry(nameIndex, descriptorIndex);
break;
default:
throw new IllegalArgumentException("Invalid ConstantPool Tag: " +
tag);
}
}
}
public ConstantPoolEntry[] getEntries() {
return entries;
}
/**
* @param index into the constant pool
* @return the entry at index
*/
public ConstantPoolEntry getEntryAt(int index) {
return entries[index];
}
public String toString() {
StringBuffer sb = new StringBuffer("Constant Pool:\n");
int numberOfCharacters = String.valueOf(entries.length).length();
String formatString = "0";
for (int i = 1; i < numberOfCharacters; i++) {
formatString = "0" + formatString;
}
DecimalFormat formatter = new DecimalFormat(formatString);
for (int i = 1; i < entries.length; i++) {
sb.append("[" + formatter.format(i) + "] " + entries[i] + "\n");
}
return sb.toString();
}
}
--- NEW FILE: DefaultNULLCPEntry.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy 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.
//
// JarSpy 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 JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.classinfo.constantpool;
/**
* DefaultNULLCPEntry
*/
public final class DefaultNULLCPEntry extends AbstractConstantPoolEntry {
public static final DefaultNULLCPEntry INSTANCE =
new DefaultNULLCPEntry();
/**
*
* @return a <code>String</code> representing the value of this entry
*/
String getValueDescription() {
return "";
}
private DefaultNULLCPEntry() {
super(ConstantPoolEntryType.NULL_ENTRY);
}
}
|
|
From: Jeff B. <br...@us...> - 2002-09-13 23:11:32
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/classinfo/constantpool In directory usw-pr-cvs1:/tmp/cvs-serv12062/constantpool Log Message: Directory /cvsroot/jarspy/JarSpy/src/com/ociweb/classinfo/constantpool added to the repository |
|
From: Jeff B. <br...@us...> - 2002-09-01 00:38:38
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails
In directory usw-pr-cvs1:/tmp/cvs-serv12469
Modified Files:
ClassDetailTabbedPane.java
Log Message:
add border to each pane
Index: ClassDetailTabbedPane.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/classdetails/ClassDetailTabbedPane.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ClassDetailTabbedPane.java 1 Sep 2002 00:30:28 -0000 1.2
--- ClassDetailTabbedPane.java 1 Sep 2002 00:38:35 -0000 1.3
***************
*** 23,26 ****
--- 23,27 ----
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
+ import javax.swing.BorderFactory;
/**
***************
*** 42,45 ****
--- 43,47 ----
for (int i = 0; i < tabs.length; i++) {
AbstractClassDetailTab tab = tabs[i];
+ tab.setBorder(BorderFactory.createRaisedBevelBorder());
add(tab);
}
|