[kaffe] CVS kaffe (robilad): Resynced with cp-tools: rmic fixes, lucene now builds fine

Kaffe CVS cvs-commits at kaffe.org
Fri Sep 16 12:23:06 PDT 2005


PatchSet 6908 
Date: 2005/09/16 19:17:48
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with cp-tools: rmic fixes, lucene now builds fine

Members: 
	ChangeLog:1.4429->1.4430 
	THIRDPARTY:1.37->1.38 
	libraries/clib/native/ClassLoader.c:1.47->1.48 
	libraries/javalib/Makefile.am:1.392->1.393 
	libraries/javalib/Makefile.am.in:1.47->1.48 
	libraries/javalib/Makefile.in:1.483->1.484 
	libraries/javalib/all.files:1.162->1.163 
	libraries/javalib/gnu/classpath/VMSystemProperties.java:1.10->1.11 
	libraries/javalib/gnu/classpath/tools/Util.java:1.3->1.4 
	libraries/javalib/gnu/classpath/tools/rmi/rmic/Compile_gcj.java:1.1->1.2(DEAD) 
	libraries/javalib/gnu/classpath/tools/rmi/rmic/Compile_jikes.java:1.2->1.3(DEAD) 
	libraries/javalib/gnu/classpath/tools/rmi/rmic/Compile_kjc.java:1.2->1.3(DEAD) 
	libraries/javalib/gnu/classpath/tools/rmi/rmic/Compiler.java:1.4->1.5(DEAD) 
	libraries/javalib/gnu/classpath/tools/rmi/rmic/CompilerProcess.java:1.2->1.3(DEAD) 
	libraries/javalib/gnu/classpath/tools/rmi/rmic/RMIC.java:1.2->1.3 
	libraries/javalib/gnu/classpath/tools/rmi/rmic/TabbedWriter.java:1.2->1.3(DEAD) 
	libraries/javalib/gnu/classpath/tools/rmi/rmic/Variables.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/Attribute.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/ByteVector.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/ClassReader.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/ClassVisitor.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/ClassWriter.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/CodeVisitor.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/CodeWriter.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/Constants.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/Edge.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/Item.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/Label.java:INITIAL->1.1 
	libraries/javalib/org/objectweb/asm153/Type.java:INITIAL->1.1 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4429 kaffe/ChangeLog:1.4430
--- kaffe/ChangeLog:1.4429	Fri Sep 16 14:44:48 2005
+++ kaffe/ChangeLog	Fri Sep 16 19:17:48 2005
@@ -1,3 +1,62 @@
+2005-09-16  Dalibor Topic  <robilad at kaffe.org>
+
+	* libraries/clib/native/ClassLoader.c 
+	(java_lang_VMClassLoader_loadClass): Allow classes from
+	gnu.classpath.tools to be loaded.
+
+	* libraries/javalib/Makefile.am.in:
+	(JAR_CMD2) Put rmic classes into rt.jar for ant.
+	(JAR_CMD_TOOLS) Add asm classes to tools.jar as well.
+
+	* libraries/javalib/all.files: Regenerated.
+
+	* libraries/javalib/gnu/classpath/VMSystemProperties.java:
+	Preset build.rmic propert to kaffe.
+
+	* libraries/javalib/org/objectweb/asm153/Attribute.java,
+	libraries/javalib/org/objectweb/asm153/ByteVector.java,
+	libraries/javalib/org/objectweb/asm153/ClassReader.java,
+	libraries/javalib/org/objectweb/asm153/ClassVisitor.java,
+	libraries/javalib/org/objectweb/asm153/ClassWriter.java,
+	libraries/javalib/org/objectweb/asm153/CodeVisitor.java,
+	libraries/javalib/org/objectweb/asm153/CodeWriter.java,
+	libraries/javalib/org/objectweb/asm153/Constants.java,
+	libraries/javalib/org/objectweb/asm153/Edge.java,
+	libraries/javalib/org/objectweb/asm153/Item.java,
+	libraries/javalib/org/objectweb/asm153/Label.java,
+	libraries/javalib/org/objectweb/asm153/Type.java:
+	New files. Taken from BSD-without-advertising-clause
+	licensed ASM project from ObjectWeb. Renamed package asm to
+	asm153 to make sure that the package name won't conflict with
+	normal programs using their own copies of asm.
+
+	* THIRDPARTY: Added information about the ASM project.
+ 
+	Resynced with GNU classpath tools.
+
+	2005-08-02  Archit Shah  <archit.shah at alum.mit.edu>
+
+        * src/gnu/classpath/tools/rmi/rmic/RMIC.java: Centralize calls to
+        System.exit and make handling of error conditions more uniform.
+
+	2005-07-05  Archit Shah  <archit.shah at alum.mit.edu>
+
+        Rewrite rmic to use ASM library:
+        * src/gnu/classpath/tools/rmi/rmic/Compile_gcj.java,
+        src/gnu/classpath/tools/rmi/rmic/Compile_jikes.java,
+        src/gnu/classpath/tools/rmi/rmic/Compile_kjc.java,
+        src/gnu/classpath/tools/rmi/rmic/Compiler.java,
+        src/gnu/classpath/tools/rmi/rmic/CompilerProcess.java,
+        src/gnu/classpath/tools/rmi/rmic/TabbedWriter.java: Removed.
+        * src/gnu/classpath/tools/rmi/rmic/RMIC.java: Rewrote.
+        * src/gnu/classpath/tools/rmi/rmic/Variables.java: New file.
+
+	2005-06-27  Guilhem Lavaux  <guilhem at kaffe.org>
+
+        * src/gnu/classpath/tools/Util.java
+        (Util): Really search in the default classpath if searching in the
+        current directory fails.	
+
 2005-09-16  David Walluck <walluck at mandrake.org>
 
 	* libraries/clib/awt/qt/toolkit.h,
Index: kaffe/THIRDPARTY
diff -u kaffe/THIRDPARTY:1.37 kaffe/THIRDPARTY:1.38
--- kaffe/THIRDPARTY:1.37	Thu Sep 15 03:35:40 2005
+++ kaffe/THIRDPARTY	Fri Sep 16 19:17:48 2005
@@ -784,3 +784,41 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    02111-1307, USA.
 
+* libraries/javalib/org/objectweb/asm153
+
+  These files were taken from the ObjectWeb ASM bytecode transformation
+  library, release 1.5.3. The asm package was renamed to reflect the version
+  used to avoid conflicts with asm library used in external programs.
+
+  The files are distributed under the following terms:
+
+   ASM: a very small and fast Java bytecode manipulation framework
+   Copyright (c) 2000,2002,2003 INRIA, France Telecom
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+   3. Neither the name of the copyright holders nor the names of its
+      contributors may be used to endorse or promote products derived from
+      this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+   THE POSSIBILITY OF SUCH DAMAGE.
+
+  More information on the ASM project is available at 
+  http://asm.objectweb.org/
Index: kaffe/libraries/clib/native/ClassLoader.c
diff -u kaffe/libraries/clib/native/ClassLoader.c:1.47 kaffe/libraries/clib/native/ClassLoader.c:1.48
--- kaffe/libraries/clib/native/ClassLoader.c:1.47	Thu Jun 23 16:43:59 2005
+++ kaffe/libraries/clib/native/ClassLoader.c	Fri Sep 16 19:17:49 2005
@@ -185,7 +185,10 @@
 
 	if (foundSlash ||
 	    !strncmp (name, "kaffe/lang/", 11) ||
-	    !strncmp (name, "gnu/classpath/", 14)) {
+	    (!strncmp (name, "gnu/classpath/", 14)
+             && strncmp (name, 
+                         "gnu/classpath/tools/", 
+                         strlen("gnu/classpath/tools/")))) {
 		struct Hjava_lang_Throwable *throwable;
 
 		throwable = (struct Hjava_lang_Throwable *)execute_java_constructor(JAVA_LANG(ClassNotFoundException),
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.392 kaffe/libraries/javalib/Makefile.am:1.393
--- kaffe/libraries/javalib/Makefile.am:1.392	Thu Sep 15 02:25:34 2005
+++ kaffe/libraries/javalib/Makefile.am	Fri Sep 16 19:17:49 2005
@@ -329,6 +329,7 @@
 	$(org_metastatic_jessie_pki_io_SRCS) \
 	$(org_metastatic_jessie_pki_provider_SRCS) \
 	$(org_metastatic_jessie_provider_SRCS) \
+	$(org_objectweb_asm153_SRCS) \
 	$(org_omg_CORBA_SRCS) \
 	$(org_omg_CORBA_DynAnyPackage_SRCS) \
 	$(org_omg_CORBA_ORBPackage_SRCS) \
@@ -723,14 +724,9 @@
 gnu_classpath_tools_native2ascii_SRCS = \
 	gnu/classpath/tools/native2ascii/Native2ASCII.java
 gnu_classpath_tools_rmi_rmic_SRCS = \
-	gnu/classpath/tools/rmi/rmic/Compile_gcj.java \
-	gnu/classpath/tools/rmi/rmic/Compile_jikes.java \
-	gnu/classpath/tools/rmi/rmic/Compile_kjc.java \
-	gnu/classpath/tools/rmi/rmic/Compiler.java \
-	gnu/classpath/tools/rmi/rmic/CompilerProcess.java \
 	gnu/classpath/tools/rmi/rmic/RMIC.java \
 	gnu/classpath/tools/rmi/rmic/RMICException.java \
-	gnu/classpath/tools/rmi/rmic/TabbedWriter.java
+	gnu/classpath/tools/rmi/rmic/Variables.java
 gnu_classpath_tools_serialver_SRCS = \
 	gnu/classpath/tools/serialver/SerialVer.java
 gnu_crypto_SRCS = \
@@ -4645,6 +4641,19 @@
 	org/metastatic/jessie/provider/X509KeyManagerFactory.java \
 	org/metastatic/jessie/provider/X509TrustManagerFactory.java \
 	org/metastatic/jessie/provider/XMLSessionContext.java
+org_objectweb_asm153_SRCS = \
+	org/objectweb/asm153/Attribute.java \
+	org/objectweb/asm153/ByteVector.java \
+	org/objectweb/asm153/ClassReader.java \
+	org/objectweb/asm153/ClassVisitor.java \
+	org/objectweb/asm153/ClassWriter.java \
+	org/objectweb/asm153/CodeVisitor.java \
+	org/objectweb/asm153/CodeWriter.java \
+	org/objectweb/asm153/Constants.java \
+	org/objectweb/asm153/Edge.java \
+	org/objectweb/asm153/Item.java \
+	org/objectweb/asm153/Label.java \
+	org/objectweb/asm153/Type.java
 org_omg_CORBA_SRCS = \
 	org/omg/CORBA/ARG_IN.java \
 	org/omg/CORBA/ARG_INOUT.java \
@@ -5933,12 +5942,12 @@
 .PHONY: compile-classes classes
 
 JAR_CMD1 = (cd $(srcdir) && $(ZIP) -q -r $(CURDIR)/$@.new META-INF)
-JAR_CMD2 = (cd $(LIBDIR) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(SRCDIRS) -x gnu/bytecode/*.class -x gnu/classpath/tools)
+JAR_CMD2 = (cd $(LIBDIR) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(SRCDIRS) -x gnu/bytecode/*.class -x gnu/classpath/tools/ gnu/classpath/tools/rmi/rmic/)
 JAR_CMD3 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(gnu_regexp_message_bundles))
 JAR_CMD4 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(gnu_getopt_message_bundles))
 JAR_CMD5 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(classpath_resources))
 JAR_CMD6 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(classpath_icons))
-JAR_CMD_TOOLS = (cd $(LIBDIR) && $(ZIP) -q -r $(CURDIR)/$@.new gnu/bytecode gnu/classpath/tools)
+JAR_CMD_TOOLS = (cd $(LIBDIR) && $(ZIP) -q -r $(CURDIR)/$@.new gnu/bytecode gnu/classpath/tools org/objectweb)
 
 .PHONY: jar-classes
 if USE_PRECOMPILED_RT_JAR
Index: kaffe/libraries/javalib/Makefile.am.in
diff -u kaffe/libraries/javalib/Makefile.am.in:1.47 kaffe/libraries/javalib/Makefile.am.in:1.48
--- kaffe/libraries/javalib/Makefile.am.in:1.47	Thu Aug 25 00:51:23 2005
+++ kaffe/libraries/javalib/Makefile.am.in	Fri Sep 16 19:17:51 2005
@@ -370,12 +370,12 @@
 .PHONY: compile-classes classes
 
 JAR_CMD1 = (cd $(srcdir) && $(ZIP) -q -r $(CURDIR)/$@.new META-INF)
-JAR_CMD2 = (cd $(LIBDIR) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(SRCDIRS) -x gnu/bytecode/*.class -x gnu/classpath/tools)
+JAR_CMD2 = (cd $(LIBDIR) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(SRCDIRS) -x gnu/bytecode/*.class -x gnu/classpath/tools/ gnu/classpath/tools/rmi/rmic/)
 JAR_CMD3 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(gnu_regexp_message_bundles))
 JAR_CMD4 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(gnu_getopt_message_bundles))
 JAR_CMD5 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(classpath_resources))
 JAR_CMD6 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(classpath_icons))
-JAR_CMD_TOOLS = (cd $(LIBDIR) && $(ZIP) -q -r $(CURDIR)/$@.new gnu/bytecode gnu/classpath/tools)
+JAR_CMD_TOOLS = (cd $(LIBDIR) && $(ZIP) -q -r $(CURDIR)/$@.new gnu/bytecode gnu/classpath/tools org/objectweb)
 
 .PHONY: jar-classes
 if USE_PRECOMPILED_RT_JAR
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.483 kaffe/libraries/javalib/Makefile.in:1.484
--- kaffe/libraries/javalib/Makefile.in:1.483	Thu Sep 15 02:25:37 2005
+++ kaffe/libraries/javalib/Makefile.in	Fri Sep 16 19:17:51 2005
@@ -690,6 +690,7 @@
 	$(org_metastatic_jessie_pki_io_SRCS) \
 	$(org_metastatic_jessie_pki_provider_SRCS) \
 	$(org_metastatic_jessie_provider_SRCS) \
+	$(org_objectweb_asm153_SRCS) \
 	$(org_omg_CORBA_SRCS) \
 	$(org_omg_CORBA_DynAnyPackage_SRCS) \
 	$(org_omg_CORBA_ORBPackage_SRCS) \
@@ -1109,14 +1110,9 @@
 	gnu/classpath/tools/native2ascii/Native2ASCII.java
 
 gnu_classpath_tools_rmi_rmic_SRCS = \
-	gnu/classpath/tools/rmi/rmic/Compile_gcj.java \
-	gnu/classpath/tools/rmi/rmic/Compile_jikes.java \
-	gnu/classpath/tools/rmi/rmic/Compile_kjc.java \
-	gnu/classpath/tools/rmi/rmic/Compiler.java \
-	gnu/classpath/tools/rmi/rmic/CompilerProcess.java \
 	gnu/classpath/tools/rmi/rmic/RMIC.java \
 	gnu/classpath/tools/rmi/rmic/RMICException.java \
-	gnu/classpath/tools/rmi/rmic/TabbedWriter.java
+	gnu/classpath/tools/rmi/rmic/Variables.java
 
 gnu_classpath_tools_serialver_SRCS = \
 	gnu/classpath/tools/serialver/SerialVer.java
@@ -5283,6 +5279,20 @@
 	org/metastatic/jessie/provider/X509TrustManagerFactory.java \
 	org/metastatic/jessie/provider/XMLSessionContext.java
 
+org_objectweb_asm153_SRCS = \
+	org/objectweb/asm153/Attribute.java \
+	org/objectweb/asm153/ByteVector.java \
+	org/objectweb/asm153/ClassReader.java \
+	org/objectweb/asm153/ClassVisitor.java \
+	org/objectweb/asm153/ClassWriter.java \
+	org/objectweb/asm153/CodeVisitor.java \
+	org/objectweb/asm153/CodeWriter.java \
+	org/objectweb/asm153/Constants.java \
+	org/objectweb/asm153/Edge.java \
+	org/objectweb/asm153/Item.java \
+	org/objectweb/asm153/Label.java \
+	org/objectweb/asm153/Type.java
+
 org_omg_CORBA_SRCS = \
 	org/omg/CORBA/ARG_IN.java \
 	org/omg/CORBA/ARG_INOUT.java \
@@ -6610,12 +6620,12 @@
 LIBDIR = lib
 rebuildLib = ./rebuildLib
 JAR_CMD1 = (cd $(srcdir) && $(ZIP) -q -r $(CURDIR)/$@.new META-INF)
-JAR_CMD2 = (cd $(LIBDIR) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(SRCDIRS) -x gnu/bytecode/*.class -x gnu/classpath/tools)
+JAR_CMD2 = (cd $(LIBDIR) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(SRCDIRS) -x gnu/bytecode/*.class -x gnu/classpath/tools/ gnu/classpath/tools/rmi/rmic/)
 JAR_CMD3 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(gnu_regexp_message_bundles))
 JAR_CMD4 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(gnu_getopt_message_bundles))
 JAR_CMD5 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(classpath_resources))
 JAR_CMD6 = (cd $(srcdir) && $(ZIP) -q -DX -r $(CURDIR)/$@.new $(classpath_icons))
-JAR_CMD_TOOLS = (cd $(LIBDIR) && $(ZIP) -q -r $(CURDIR)/$@.new gnu/bytecode gnu/classpath/tools)
+JAR_CMD_TOOLS = (cd $(LIBDIR) && $(ZIP) -q -r $(CURDIR)/$@.new gnu/bytecode gnu/classpath/tools org/objectweb)
 all: all-recursive
 
 .SUFFIXES:
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.162 kaffe/libraries/javalib/all.files:1.163
--- kaffe/libraries/javalib/all.files:1.162	Thu Sep 15 02:25:38 2005
+++ kaffe/libraries/javalib/all.files	Fri Sep 16 19:17:55 2005
@@ -155,14 +155,9 @@
 gnu/classpath/tools/javap/Javap.java
 gnu/classpath/tools/javap/JavapMain.java
 gnu/classpath/tools/native2ascii/Native2ASCII.java
-gnu/classpath/tools/rmi/rmic/Compile_gcj.java
-gnu/classpath/tools/rmi/rmic/Compile_jikes.java
-gnu/classpath/tools/rmi/rmic/Compile_kjc.java
-gnu/classpath/tools/rmi/rmic/Compiler.java
-gnu/classpath/tools/rmi/rmic/CompilerProcess.java
 gnu/classpath/tools/rmi/rmic/RMICException.java
 gnu/classpath/tools/rmi/rmic/RMIC.java
-gnu/classpath/tools/rmi/rmic/TabbedWriter.java
+gnu/classpath/tools/rmi/rmic/Variables.java
 gnu/classpath/tools/serialver/SerialVer.java
 gnu/classpath/tools/Util.java
 gnu/classpath/VMStackWalker.java
@@ -3978,6 +3973,18 @@
 org/metastatic/jessie/SRPManagerParameters.java
 org/metastatic/jessie/SRPTrustManager.java
 org/metastatic/jessie/StaticTrustAnchors.java
+org/objectweb/asm153/Attribute.java
+org/objectweb/asm153/ByteVector.java
+org/objectweb/asm153/ClassReader.java
+org/objectweb/asm153/ClassVisitor.java
+org/objectweb/asm153/ClassWriter.java
+org/objectweb/asm153/CodeVisitor.java
+org/objectweb/asm153/CodeWriter.java
+org/objectweb/asm153/Constants.java
+org/objectweb/asm153/Edge.java
+org/objectweb/asm153/Item.java
+org/objectweb/asm153/Label.java
+org/objectweb/asm153/Type.java
 org/omg/CORBA_2_3/ORB.java
 org/omg/CORBA_2_3/portable/Delegate.java
 org/omg/CORBA_2_3/portable/InputStream.java
Index: kaffe/libraries/javalib/gnu/classpath/VMSystemProperties.java
diff -u kaffe/libraries/javalib/gnu/classpath/VMSystemProperties.java:1.10 kaffe/libraries/javalib/gnu/classpath/VMSystemProperties.java:1.11
--- kaffe/libraries/javalib/gnu/classpath/VMSystemProperties.java:1.10	Sat Aug 27 02:34:13 2005
+++ kaffe/libraries/javalib/gnu/classpath/VMSystemProperties.java	Fri Sep 16 19:17:56 2005
@@ -116,6 +116,7 @@
        */
       properties.setProperty("kaffe.compiler", "jikes");
       properties.setProperty("build.compiler", "jikes");
+      properties.setProperty("build.rmic", "kaffe");
 
       // Invoke native methods to get the values of the other properties
 
Index: kaffe/libraries/javalib/gnu/classpath/tools/Util.java
diff -u kaffe/libraries/javalib/gnu/classpath/tools/Util.java:1.3 kaffe/libraries/javalib/gnu/classpath/tools/Util.java:1.4
--- kaffe/libraries/javalib/gnu/classpath/tools/Util.java:1.3	Mon Jul  4 00:04:34 2005
+++ kaffe/libraries/javalib/gnu/classpath/tools/Util.java	Fri Sep 16 19:17:57 2005
@@ -14,7 +14,7 @@
  * 
  * You should have received a copy of the GNU General Public License along with
  * GNU Classpath; see the file COPYING. If not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 package gnu.classpath.tools;
 
@@ -63,9 +63,9 @@
     else
       {
         is = findFile(filename);
-        if (is == null)
+	if (is == null)
 	  {
-	    String path = getSearchPath();
+            String path = getSearchPath();
             is = findClass(filename, path);
 	  }
       }
===================================================================
Checking out kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Compile_gcj.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Attic/Compile_gcj.java,v
VERS: 1.1
***************
--- kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Compile_gcj.java	Fri Sep 16 19:23:04 2005
+++ /dev/null	Sun Aug  4 19:57:58 2002
@@ -1,33 +0,0 @@
-/*
-  Copyright (c) 2001, 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
- 
-GNU Classpath 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. */
-
-package gnu.classpath.tools.rmi.rmic;
-
-/** Subclass of Compiler that can be used to invoke gcj.  */
-public class Compile_gcj extends CompilerProcess
-{
-  private static final String [] COMPILER_ARGS = 
-  {
-    "gcj",
-    "-C"
-  };
-
-  public String[] computeArguments (String filename)
-  {
-    return computeTypicalArguments(COMPILER_ARGS,
-				   getDestination(),
-				   filename);
-  }
-}
===================================================================
Checking out kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Compile_jikes.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Attic/Compile_jikes.java,v
VERS: 1.2
***************
--- kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Compile_jikes.java	Fri Sep 16 19:23:06 2005
+++ /dev/null	Sun Aug  4 19:57:58 2002
@@ -1,39 +0,0 @@
-/*
-  Copyright (c) 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
- 
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA. */
-
-package gnu.classpath.tools.rmi.rmic;
-
-/** Subclass of Compiler that can be used to invoke jikes.  */
-public class Compile_jikes extends CompilerProcess
-{
-  /** Compiler arguments to invoke jikes */
-  private static final String [] COMPILER_ARGS = 
-  {
-    "jikes"
-  };
-
-  /** Compute the command line for the process.  */
-  public String[] computeArguments (String filename)
-  {
-    return computeTypicalArguments(COMPILER_ARGS,
-				   getDestination(),
-				   filename);
-  }
-}
===================================================================
Checking out kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Compile_kjc.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Attic/Compile_kjc.java,v
VERS: 1.2
***************
--- kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Compile_kjc.java	Fri Sep 16 19:23:06 2005
+++ /dev/null	Sun Aug  4 19:57:58 2002
@@ -1,39 +0,0 @@
-/*
-  Copyright (c) 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
- 
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA. */
-
-package gnu.classpath.tools.rmi.rmic;
-
-/** Subclass of Compiler that can be used to invoke kjc.  */
-public class Compile_kjc extends CompilerProcess
-{
-  /** Compiler arguments to invoke kjc */
-  private static final String [] COMPILER_ARGS = 
-  {
-    "kjc"
-  };
-
-  /** Compute the command line for the process.  */
-  public String[] computeArguments (String filename)
-  {
-    return computeTypicalArguments(COMPILER_ARGS,
-				   getDestination(),
-				   filename);
-  }
-}
===================================================================
Checking out kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Compiler.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Attic/Compiler.java,v
VERS: 1.4
***************
--- kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Compiler.java	Fri Sep 16 19:23:06 2005
+++ /dev/null	Sun Aug  4 19:57:58 2002
@@ -1,78 +0,0 @@
-/*
-  Copyright (c) 2001, 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
- 
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA. */
-
-package gnu.classpath.tools.rmi.rmic;
-
-/**
- * A Compiler object can be used to compile a .java file into a
- * .class file.  This is an abstract class; the
- * <code>getInstance()</code> method is used to obtain the actual
- * compiler object.
- */
-public abstract class Compiler
-{
-  // Can't directly instantiate.
-  protected Compiler ()
-  {
-  }
-
-  /** Create a new compiler instance.  */
-  public static Compiler getInstance ()
-  {
-    return getInstance (System.getProperty ("classpath.compiler", "gcj"));
-  }
-
-  /** Create a new compiler instance given the name of the compiler.  */
-  public static Compiler getInstance (String name)
-  {
-    try
-      {
-	Class k = Class.forName (classPrefix + name);
-	return (Compiler) k.newInstance ();
-      }
-    catch (Throwable _)
-      {
-      }
-    return null;
-  }
-
-   /** Get the directory where output files will be put.  */
-   public String getDestination ()
-   {
-     return dest;
-   }
-
-  /** Set the directory where output files will be put.  */
-  public void setDestination (String dest)
-  {
-    this.dest = dest;
-  }
-
-  /** Compile the given file.  Throws exception on error.  */
-  public abstract void compile (String name) throws Exception;
-
-  /** The destination directory, or null if none set.  */
-  protected String dest;
-
-  /** Class prefix used when trying to find instance.  */
-  private static final String classPrefix =
-    Compiler.class.getPackage().getName() + ".Compile_";
-//    "gnu.classpath.tools.rmi.rmic.Compile_";
-}
===================================================================
Checking out kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/CompilerProcess.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/Attic/CompilerProcess.java,v
VERS: 1.2
***************
--- kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/CompilerProcess.java	Fri Sep 16 19:23:06 2005
+++ /dev/null	Sun Aug  4 19:57:58 2002
@@ -1,107 +0,0 @@
-/*
-  Copyright (c) 2001, 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
- 
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA. */
-
-package gnu.classpath.tools.rmi.rmic;
-
-import java.io.InputStream;
-
-/**
- * Subclass of Compiler that can be subclassed to invoke a process to
- * do its work.
- */
-public abstract class CompilerProcess extends Compiler
-{
-  /** This is used to compute the command line for the process.  */
-  public abstract String[] computeArguments (String filename);
-
-   /**
-    * This is used to compute the command line for the process.
-    * Most compilers typically arrange their arguments as in
-    * &lt;compiler name and arguments&gt; &lt;optional destination&gt; &lt;filename&gt;.
-    * This method builds an argument array out that. It should be used
-    * to define computeArguments for those compilers that follow the
-    * argument convention described above.
-    */
-   public static String[] computeTypicalArguments(String[] compilerArgs,
-	String destination, String filename)
-   {
-     /* length of compiler specific arguments */
-     final int len = compilerArgs.length;
-
-     /* length of returned array of arguments */
-     final int arglen = len + (destination == null ? 0 : 2) + 1;
-
-     /* Allocate String array for computed arguments. */
-     String [] args = new String[arglen];
-
-     /* Fill in compiler arguments. */
-     System.arraycopy(compilerArgs, 0, args, 0, len);
-
-     /* Fill in destination argument if necessary. */
-     if (destination != null)
-      {
-	args[len] = "-d";
-	args[len + 1] = destination;
-      }
-
-     /* Fill in filename */
-     args[arglen - 1] = filename;
-
-     return args;
-   }
-
-  public void compile (String name) throws Exception
-  {
-    String[] args = computeArguments (name);
-    Process p = Runtime.getRuntime ().exec (args);
-
-    /* Print compiler output to System.out. */
-    InputStream procin = p.getInputStream();
-    for (int ch = procin.read(); ch != -1; ch = procin.read())
-      System.out.print((char) ch);
-
-    /* Collect compiler error output in a buffer.
-     * If compilation fails, it will be used for an error message.
-     */
-    StringBuffer stderr = new StringBuffer();
-    InputStream procerr = p.getErrorStream();
-    for (int ch = procerr.read(); ch != -1; ch = procerr.read())
-      stderr.append((char) ch);
-
-    int result;
-    while (true)
-      {
-	try
-	  {
-	    result = p.waitFor ();
-	    break;
-	  }
-	catch (InterruptedException _)
-	  {
-	  }
-      }
-    if (result != 0)
-      {
-	// FIXME: wrong exception class.
-	throw new Exception ("compiler exited with status: " + result,
-			     new RMICException(stderr.toString()));
-      }
-  }
-}
Index: kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/RMIC.java
diff -u kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/RMIC.java:1.2 kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/RMIC.java:1.3
--- kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/RMIC.java:1.2	Mon Jul  4 00:04:35 2005
+++ kaffe/libraries/javalib/gnu/classpath/tools/rmi/rmic/RMIC.java	Fri Sep 16 19:17:58 2005
@@ -1,5 +1,5 @@
 /* RMIC.java --
-   Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
+   Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
@@ -16,46 +16,79 @@
 
 You should have received a copy of the GNU General Public License
 along with GNU Classpath; see the file COPYING.  If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA. */
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA. */
 
 package gnu.classpath.tools.rmi.rmic;
 
 import gnu.java.rmi.server.RMIHashes;
-
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import java.io.PrintWriter;
 import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.rmi.MarshalException;
+import java.rmi.Remote;
 import java.rmi.RemoteException;
+import java.rmi.UnexpectedException;
+import java.rmi.UnmarshalException;
+import java.rmi.server.Operation;
+import java.rmi.server.RemoteCall;
+import java.rmi.server.RemoteObject;
+import java.rmi.server.RemoteRef;
+import java.rmi.server.RemoteStub;
+import java.rmi.server.Skeleton;
+import java.rmi.server.SkeletonMismatchException;
+import java.security.MessageDigest;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Set;
-
+import java.util.StringTokenizer;
+import org.objectweb.asm153.ClassVisitor;
+import org.objectweb.asm153.ClassWriter;
+import org.objectweb.asm153.CodeVisitor;
+import org.objectweb.asm153.Constants;
+import org.objectweb.asm153.Label;
+import org.objectweb.asm153.Type;
 
 public class RMIC
 {
   private String[] args;
   private int next;
-  private Exception exception;
+  private List errors = new ArrayList();
   private boolean keep = false;
   private boolean need11Stubs = true;
   private boolean need12Stubs = true;
   private boolean compile = true;
   private boolean verbose;
   private String destination;
-  private PrintWriter out;
-  private TabbedWriter ctrl;
+  private String classpath;
+  private ClassLoader loader;
+  private int errorCount = 0;
+
   private Class clazz;
   private String classname;
+  private String classInternalName;
   private String fullclassname;
   private MethodRef[] remotemethods;
   private String stubname;
   private String skelname;
-  private int errorCount = 0;
-  private Class mRemoteInterface;
+  private List mRemoteInterfaces;
+
+  private static class C
+    implements Constants
+  {
+  }
 
   public RMIC(String[] a)
   {
@@ -64,65 +97,85 @@
 
   public static void main(String[] args)
   {
+    if (rmic(args))
+      System.exit(0);
+    else
+      System.exit(1);
+  }
+
+  /**
+   * @return true if compilation was successful
+   */
+  public static boolean rmic(String[] args)
+  {
     RMIC r = new RMIC(args);
-    if (r.run() == false)
-      {
-	Exception e = r.getException();
-	if (e != null)
-	  e.printStackTrace();
-	else
-	  System.exit(1);
-      }
+    return r.run();
   }
 
-  public boolean run()
+  /**
+   * @return true if run was successful
+   */
+  private boolean run()
   {
-    parseOptions();
+    boolean done = parseOptions();
+    if (done)
+      return errorCount == 0;
+
     if (next >= args.length)
-      error("no class names found");
+      {
+        usage();
+        return false;
+      }
+
     for (int i = next; i < args.length; i++)
       {
 	try
 	  {
-	    if (verbose)
+            if (verbose)
 	      System.out.println("[Processing class " + args[i] + ".class]");
 	    processClass(args[i].replace(File.separatorChar, '.'));
 	  }
-	catch (Exception e)
-	  {
-	    exception = e;
-	    return (false);
-	  }
+        catch (IOException e)
+          {
+            errors.add(e);
+          }
+        catch (RMICException e)
+          {
+            errors.add(e);
+          }
+      }
+    if (errors.size() > 0)
+      {
+        for (Iterator it = errors.iterator(); it.hasNext(); )
+          {
+            Exception ex = (Exception) it.next();
+            logError(ex);
+          }
       }
-    return (true);
+
+    return errorCount == 0;
   }
 
-  private boolean processClass(String classname) throws Exception
+  private void processClass(String cls) throws IOException, RMICException
   {
-    errorCount = 0;
-    analyzeClass(classname);
-    if (errorCount > 0)
-      System.exit(1);
+    // reset class specific vars
+    clazz = null;
+    classname = null;
+    classInternalName = null;
+    fullclassname = null;
+    remotemethods = null;
+    stubname = null;
+    skelname = null;
+    mRemoteInterfaces = new ArrayList();
+
+    analyzeClass(cls);
     generateStub();
     if (need11Stubs)
       generateSkel();
-    if (compile)
-      {
-	compile(stubname.replace('.', File.separatorChar) + ".java");
-	if (need11Stubs)
-	  compile(skelname.replace('.', File.separatorChar) + ".java");
-      }
-    if (! keep)
-      {
-	(new File(stubname.replace('.', File.separatorChar) + ".java")).delete();
-	if (need11Stubs)
-	  (new File(skelname.replace('.', File.separatorChar) + ".java"))
-	  .delete();
-      }
-    return (true);
   }
 
-  private void analyzeClass(String cname) throws Exception
+  private void analyzeClass(String cname)
+    throws RMICException
   {
     if (verbose)
       System.out.println("[analyze class " + cname + "]");
@@ -133,759 +186,1419 @@
       classname = cname;
     fullclassname = cname;
 
-    HashSet rmeths = new HashSet();
     findClass();
+    findRemoteMethods();
+  }
 
-    // get the remote interface
-    mRemoteInterface = getRemoteInterface(clazz);
-    if (mRemoteInterface == null)
-      return;
-    if (verbose)
-      System.out.println("[implements " + mRemoteInterface.getName() + "]");
+  /**
+   * @deprecated
+   */
+  public Exception getException()
+  {
+    return errors.size() == 0 ? null : (Exception) errors.get(0);
+  }
 
-    // check if the methods of the remote interface declare RemoteExceptions
-    Method[] meths = mRemoteInterface.getDeclaredMethods();
-    for (int i = 0; i < meths.length; i++)
-      {
-	Class[] exceptions = meths[i].getExceptionTypes();
-	int index = 0;
-	for (; index < exceptions.length; index++)
-	  {
-	    if (exceptions[index].equals(RemoteException.class))
-	      break;
-	  }
-	if (index < exceptions.length)
-	  rmeths.add(meths[i]);
-	else
-	  logError("Method " + meths[i]
-	           + " does not throw a java.rmi.RemoteException");
+  private void findClass()
+    throws RMICException
+  {
+    ClassLoader cl = (loader == null
+                      ? ClassLoader.getSystemClassLoader()
+                      : loader);
+    try
+      {
+        clazz = Class.forName(fullclassname, false, cl);
+      }
+    catch (ClassNotFoundException cnfe)

*** Patch too long, truncated ***




More information about the kaffe mailing list