Davanum Srinivas wrote:
Stefano,

i think i poked through all the jars in JDK 1.4 and did not find
it...hence the question.

Found it!!!

The problem is in the XJavac task that Xerces2 uses to compile stuff (probably it's a left-over workaround from an ant bug on the javac task).

Now, not only I can't find the sourcecode of that sucker (I had to decompile it with jad (find it attached) but here is the offending part:

String s = ((String) properties.get( "java.vendor" )).toUpperCase( Locale.ENGLISH );
if(s.indexOf("IBM") >= 0)
{
// create an IBM-specific classpath
}
else if(s.indexOf("SUN") >= 0 ||
s.indexOf("BLACKDOWN") >= 0 ||
s.indexOf("APPLE") >= 0)
{
// build the regular classpath
}


note how the classpath *IS*NOT*BUILT* if neither of the above match!

I would strongly lobby with the xerces people to get rid of that silly task.

--
Stefano.

// Decompiled by Jad v1.5.8c. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   XJavac.java

package org.apache.xerces.util;

import java.util.Hashtable;
import java.util.Locale;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.Javac;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.util.JavaEnvUtils;

public class XJavac extends Javac
{

    public XJavac()
    {
    }

    public void execute()
        throws BuildException
    {
        if(isJDK14OrHigher())
        {
            java.util.Properties properties = null;
            try
            {
                properties = System.getProperties();
            }
            catch(Exception exception)
            {
                throw new BuildException("unable to determine java vendor 
because could not access system properties!");
            }
            String s = 
((String)properties.get("java.vendor")).toUpperCase(Locale.ENGLISH);
            if(s.indexOf("IBM") >= 0)
            {
                Path path = createBootclasspath();
                String s1 = System.getProperty("java.home");
                StringBuffer stringbuffer = new StringBuffer();
                stringbuffer.append(s1).append("/lib/charsets.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/core.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/graphics.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/javaws.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/jaws.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/security.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/server.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/ext/JawBridge.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/ext/gskikm.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/ext/ibmjceprovider.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/ext/indicim.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/ext/jaccess.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/ext/ldapsec.jar:");
                path.createPathElement().setPath(stringbuffer.toString());
                stringbuffer.replace(s1.length(), stringbuffer.length(), 
"/lib/ext/oldcertpath.jar");
                path.createPathElement().setPath(stringbuffer.toString());
                setBootclasspath(path);
            } else
            if(s.indexOf("SUN") >= 0 || s.indexOf("BLACKDOWN") >= 0 || 
s.indexOf("APPLE") >= 0)
            {
                Path path1 = createBootclasspath();
                Path path2 = getClasspath();
                path1.append(path2);
                String s2 = (String)properties.get("sun.boot.class.path");
                Path path3 = new Path(null);
                path3.createPathElement().setPath(s2);
                path1.append(path3);
                setBootclasspath(path1);
            }
        }
        super.execute();
    }

    private boolean isJDK14OrHigher()
    {
        String s = JavaEnvUtils.getJavaVersion();
        return s.equals("1.4") || !s.equals("1.3") && !s.equals("1.2") && 
!s.equals("1.1") && !s.equals("1.0");
    }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to