From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8914 invoked by alias); 4 Jan 2003 23:25:11 -0000 Mailing-List: contact rhug-rhats-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rhug-rhats-owner@sources.redhat.com Received: (qmail 8907 invoked from network); 4 Jan 2003 23:25:10 -0000 Received: from unknown (HELO amsfep15-int.chello.nl) (213.46.243.28) by 209.249.29.67 with SMTP; 4 Jan 2003 23:25:10 -0000 Received: from node-c-6778.a2000.nl ([62.194.103.120]) by amsfep15-int.chello.nl (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with ESMTP id <20030104232457.WMHM14779.amsfep15-int.chello.nl@node-c-6778.a2000.nl> for ; Sun, 5 Jan 2003 00:24:57 +0100 Subject: BCEL AssertionViolatedException, Ant, Xerces, Xalan - part II From: Dhek Bhun Kho To: Rhug Content-Type: multipart/mixed; boundary="=-OWkCDv4c49dRFJous9EO" Date: Sat, 04 Jan 2003 23:25:00 -0000 Message-Id: <1041722697.22878.84.camel@tasslehof.bhun.net> Mime-Version: 1.0 X-SW-Source: 2003-01/txt/msg00001.txt.bz2 --=-OWkCDv4c49dRFJous9EO Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 3390 Hi there, I saw the BCEL in the source repository but at the moment the toplevel make from RHUG won't build breaking on something from gnu.readline and haven't had time to inspect the rest yet. Some time ago there was a question about the AssertionViolationException.java I delved into the code and there are some notes from the authors stating it is only meant for internal use. Furthermore it only occurs once in the Pass1Verifier.java. I included two diffs that remove the offending method (something of an internal name clash that GCJ can't resolve), and a diff that removes the only call to the method in the whole sourcecode. Applying these patches and removing: VerifierAppFrame.java VerifyDialog.java VerifierFactoryListModel.java GraphicalVerifier.java Will get it to compile. I looked into the RHUG cvs and saw that those sources have been already removed. I am well on my way compiling Tomcat at the moment, but am still bugged by resourcefiles. Currently I fix this by dumping resource files into a jar and placing them in the classpath compiling using gcj --resource xx/xx/xxx/xx/resource xx/xx/xxx/xx/resource -o xx/xx/xxx/xxx/resource_res.o does compile but the code will not find the resource in question. if it doesn't take too much of your time, can anybody point out the code where the core:// protocol in handled in the GCJ sources or what I am doing wrong? Xerces and Xalan compile without problems, except for 1 source file the DTMDefaultTraverser where there is a bit of unreachable code, I have posted a diff before but that one seemed incorrect, becuase in one case of the for(;;) loops where the increment (last term of the for-loop) was unreachable in some cases my modification of the code prevented reexecution of the loop. I included the diff for that too. I know it's all peanuts work, but hopefull it's of some use. One worty thing to mention is that compiling directly from java sources to native code seems to be the way to go with GCJ. A lot of the problems I reported in the weeks before due to try{} catch {} loops etc. are only encountered when generating classfiles from java sources and subsequently generating native code from those classfiles. Generating the native code from java sources directly also result in a smaller number of object files because the inner classes are integrated into the same object file. Java_cup and regexp don't need any modifications at all. Ant does have problems: The diff for GET solves the depedency on com.sun. packages for a Base64 encoder which is already implemented in the classfile itself. The ImplementationSpecificArgument has problems resolving the superclass, the diff extends the superclass with it's FQN instead of it's short name. The DateUtils diff prevents calling a format method that is broken in GCJ 3.2.1 and cvs last time I checked. Ant will not run correctly as long as the StringTokenizer.java isn't fixed in GCJ and as such will not run correctly with GCJ 3.2.1. Oddly enought the version from Classpath is correct and GCJ's version seems to be an older version. Rhug's version of Ant is very unlikely to build as it contains sun.* dependent code for Get.java. I think it's not necessary to remove all optional packages especially the xml tasks, as Ant depends on xerces anyway and sourcecode for javax.xml.* interfaces of xerces and xalan supplement each other. Greets, Bhun. --=-OWkCDv4c49dRFJous9EO Content-Disposition: attachment; filename=org.apache.bcel.verifier.exc.AssertionViolatedException.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name=org.apache.bcel.verifier.exc.AssertionViolatedException.diff; charset=ISO-8859-15 Content-length: 831 --- AssertionViolatedException.java 2003-01-04 21:29:13.000000000 +0100 +++ /home/cvs/salvation/salvation/base/src/org/apache/bcel/verifier/exc/Ass= ertionViolatedException.java 2003-01-04 21:33:10.000000000 +0100 @@ -95,21 +95,12 @@ return detailMessage; } =20 - /**=20 - * DO NOT USE. It's for experimental testing during development only. - */ - public static void main(String[] args){ - AssertionViolatedException ave =3D new AssertionViolatedException("Oops!= "); - ave.extendMessage("\nFOUND:\n\t","\nExiting!!\n"); - throw ave; - } - /** * Returns the backtrace of this AssertionViolatedException as a String. * @return The backtrace of this AssertionViolatedException as a String. */ public String getStackTrace(){ - return Utility.getStackTrace(this); + return "Unsupported operation"; } =20 } --=-OWkCDv4c49dRFJous9EO Content-Disposition: attachment; filename=org.apache.bcel.verifier.statics.Pass1Verifier.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name=org.apache.bcel.verifier.statics.Pass1Verifier.diff; charset=ISO-8859-15 Content-length: 1127 --- diff/org.apache.bcel.verifier.statics.Pass1Verifier.java 2003-01-04 23:= 35:30.000000000 +0100 +++ salvation/base/src/org/apache/bcel/verifier/statics/Pass1Verifier.java = 2003-01-04 22:00:06.000000000 +0100 @@ -67,7 +67,7 @@ * More detailed information is to be found at the do_verify() method's * documentation. * - * @version $Id: Pass1Verifier.java,v 1.1.1.1 2001/10/29 20:00:35 jvanzyl = Exp $ + * @version $Id: Pass1Verifier.java,v 1.1 2003/01/04 18:21:22 bhun Exp $ * @author Enver Haase * @see #do_verify() */ @@ -183,7 +183,7 @@ catch(RuntimeException e){ // BCEL does not catch every possible RuntimeException; e.g. if // a constant pool index is referenced that does not exist. - return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Pa= rsing via BCEL did not succeed. "+e.getClass().getName()+" occured:\n"+Util= ity.getStackTrace(e)); + return new VerificationResult(VerificationResult.VERIFIED_REJECTED, "Pa= rsing via BCEL did not succeed. "+e.getClass().getName()+" occured:\n"); } =20 if (jc !=3D null){ --=-OWkCDv4c49dRFJous9EO Content-Disposition: attachment; filename=org.apache.xml.dtm.ref.DTMDefaultBaseTraversers.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/x-patch; name=org.apache.xml.dtm.ref.DTMDefaultBaseTraversers.diff; charset=ISO-8859-15 Content-length: 4445 *** src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java 2002-12-30 13:= 03:46.000000000 +0100 --- diff/DTMDefaultBaseTraversers.java 2002-12-30 12:52:09.000000000 +0100 *************** public abstract class DTMDefaultBaseTrav *** 717,728 **** {=0D int type =3D _type(current); // may call nextNode()=0D =0D ! if (!isDescendant(subtreeRootIdent, current)) {=0D return NULL;=0D ! } =0D ! if (ATTRIBUTE_NODE !=3D type && NAMESPACE_NODE !=3D type) {=0D ! return makeNodeHandle(current); // make handle.=0D ! }=0D }=0D }=0D =0D --- 717,729 ---- {=0D int type =3D _type(current); // may call nextNode()=0D =0D ! if (!isDescendant(subtreeRootIdent, current))=0D return NULL;=0D ! =0D ! if (ATTRIBUTE_NODE =3D=3D type || NAMESPACE_NODE =3D=3D type)=0D ! continue;=0D ! =0D ! return makeNodeHandle(current); // make handle.=0D }=0D }=0D =0D *************** public abstract class DTMDefaultBaseTrav *** 755,763 **** if (!isDescendant(subtreeRootIdent, current))=0D return NULL;=0D =0D ! if (exptype =3D=3D expandedTypeID) {=0D ! return makeNodeHandle(current); // make handle.=0D ! }=0D }=0D }=0D }=0D --- 756,765 ---- if (!isDescendant(subtreeRootIdent, current))=0D return NULL;=0D =0D ! if (exptype !=3D expandedTypeID)=0D ! continue;=0D ! =0D ! return makeNodeHandle(current); // make handle.=0D }=0D }=0D }=0D *************** public abstract class DTMDefaultBaseTrav *** 815,821 **** =0D int subtreeRootIdent =3D makeNodeIdentity(context);=0D =0D ! for (current =3D makeNodeIdentity(current) + 1; ; )=0D {=0D // Trickological code: _exptype() has the side-effect of=0D // running nextNode until the specified node has been loaded,=0D --- 817,823 ---- =0D int subtreeRootIdent =3D makeNodeIdentity(context);=0D =0D ! for (current =3D makeNodeIdentity(current) + 1; ; current++)=0D {=0D // Trickological code: _exptype() has the side-effect of=0D // running nextNode until the specified node has been loaded,=0D *************** public abstract class DTMDefaultBaseTrav *** 943,954 **** // %REVIEW% Are we using handles or indexes?=0D int type =3D _type(current); // may call nextNode()=0D =0D ! if (NULL =3D=3D type) {=0D return NULL;=0D ! } =0D ! if (ATTRIBUTE_NODE !=3D type && NAMESPACE_NODE !=3D type) {=0D ! return makeNodeHandle(current); // make handle.=0D ! }=0D }=0D }=0D =0D --- 945,957 ---- // %REVIEW% Are we using handles or indexes?=0D int type =3D _type(current); // may call nextNode()=0D =0D ! if (NULL =3D=3D type)=0D return NULL;=0D ! =0D ! if (ATTRIBUTE_NODE =3D=3D type || NAMESPACE_NODE =3D=3D type)=0D ! continue;=0D ! =0D ! return makeNodeHandle(current); // make handle.=0D }=0D }=0D =0D *************** public abstract class DTMDefaultBaseTrav *** 1513,1519 **** // Compute in ID space=0D int subtreeRootIdent =3D makeNodeIdentity(context);=0D =0D ! for (current =3D makeNodeIdentity(current) + 1; ; )=0D {=0D // Kluge test: Just make sure +1 yielded a real node=0D int type =3D _type(current); // may call nextNode()=0D --- 1516,1522 ---- // Compute in ID space=0D int subtreeRootIdent =3D makeNodeIdentity(context);=0D =0D ! for (current =3D makeNodeIdentity(current) + 1; ; current++)=0D {=0D // Kluge test: Just make sure +1 yielded a real node=0D int type =3D _type(current); // may call nextNode()=0D *************** public abstract class DTMDefaultBaseTrav *** 1546,1554 **** if (exptype =3D=3D NULL)=0D return NULL;=0D =0D ! if (exptype =3D=3D expandedTypeID) {=0D ! return makeNodeHandle(current); // make handle.=0D ! }=0D }=0D }=0D }=0D --- 1549,1558 ---- if (exptype =3D=3D NULL)=0D return NULL;=0D =0D ! if (exptype !=3D expandedTypeID)=0D ! continue;=0D ! =0D ! return makeNodeHandle(current); // make handle.=0D }=0D }=0D }=0D --=-OWkCDv4c49dRFJous9EO Content-Disposition: attachment; filename=org.apache.tools.ant.util.DateUtils.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name=org.apache.tools.ant.util.DateUtils.diff; charset=ISO-8859-15 Content-length: 894 --- jakarta-ant-1.5.1/src/main/org/apache/tools/ant/util/DateUtils.java 200= 2-10-02 17:08:51.000000000 +0200 +++ src/org/apache/tools/ant/util/DateUtils.java 2002-12-14 20:16:21.000000= 000 +0100 @@ -159,10 +159,11 @@ * @return the formatted text in minutes/seconds.=0D */=0D public static String formatElapsedTime(long millis) {=0D - long seconds =3D millis / 1000;=0D - long minutes =3D seconds / 60;=0D - Object[] args =3D {new Long(minutes), new Long(seconds % 60)};=0D - return MINUTE_SECONDS.format(args);=0D + //long seconds =3D millis / 1000;=0D + //long minutes =3D seconds / 60;=0D + //Object[] args =3D {new Long(minutes), new Long(seconds % 60)};= =0D + //str =3D MINUTE_SECONDS.format(args);=0D + return millis/1000 + " seconds"; // HACK: MessageFormat has errors in CL= ASSPATH=0D }=0D =0D /**=0D --=-OWkCDv4c49dRFJous9EO Content-Disposition: attachment; filename*0=org.apache.tools.ant.util.facade.ImplementationSpecificArgume; filename*1=nt.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name*0=org.apache.tools.ant.util.facade.ImplementationSpecificArgument.d; name*1=iff; charset=ISO-8859-15 Content-length: 554 --- ImplementationSpecificArgument.java 2003-01-04 21:30:25.000000000 +0100 +++ /home/cvs/salvation/salvation/base/src/org/apache/tools/ant/util/facade= /ImplementationSpecificArgument.java 2003-01-04 21:31:05.000000000 +0100 @@ -66,7 +66,7 @@ *=0D * @since Ant 1.5=0D */=0D -public class ImplementationSpecificArgument extends Commandline.Argument {= =0D +public class ImplementationSpecificArgument extends org.apache.tools.ant.t= ypes.Commandline.Argument {=0D private String impl;=0D =0D public ImplementationSpecificArgument() {=0D --=-OWkCDv4c49dRFJous9EO Content-Disposition: attachment; filename=org.apache.tools.ant.taskdefs.Get.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name=org.apache.tools.ant.taskdefs.Get.diff; charset=ISO-8859-15 Content-length: 1727 --- jakarta-ant-1.5.1/src/main/org/apache/tools/ant/taskdefs/Get.java 2002-= 10-02 17:08:53.000000000 +0200 +++ src/org/apache/tools/ant/taskdefs/Get.java 2002-12-14 01:19:50.00000000= 0 +0100 @@ -145,18 +145,18 @@ String up =3D uname + ":" + pword;=0D String encoding;=0D // check to see if sun's Base64 encoder is available.=0D - try {=0D - sun.misc.BASE64Encoder encoder =3D=0D - (sun.misc.BASE64Encoder)=0D - Class.forName("sun.misc.BASE64Encoder").newInstanc= e();=0D - encoding =3D encoder.encode (up.getBytes());=0D -=0D - } catch (Exception ex) { // sun's base64 encoder isn't ava= ilable=0D + //try {=0D + // sun.misc.BASE64Encoder encoder =3D=0D + // (sun.misc.BASE64Encoder)=0D + // Class.forName("sun.misc.BASE64Encoder").newInsta= nce();=0D +// encoding =3D encoder.encode (up.getBytes());=0D +//=0D + // } catch (Exception ex) { // sun's base64 encoder isn't a= vailable=0D Base64Converter encoder =3D new Base64Converter();=0D encoding =3D encoder.encode(up.getBytes());=0D - }=0D - connection.setRequestProperty ("Authorization",=0D - "Basic " + encoding);=0D + // }=0D + // connection.setRequestProperty ("Authorization",=0D + // "Basic " + encoding);=0D }=0D =0D //connect to the remote site (may take some time)=0D --=-OWkCDv4c49dRFJous9EO--