[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Works in Linux but not in Windows.




Hi, 

Have anyone come across the phenomenon where a soot program runs fine on one 
platform but fails on a other. I have attached a small program which runs 
fine on Linux but fails on Windows.

Windows==============================

java -classpath 
sootclasses-1.2.2.jar;jasminclasses-1.06-s10.jar;c:\j2sdk1.4.0\jre\lib\rt.jar;. 
TestTransform TestTransform
#1
#2
#3
Soot started on Fri Apr 05 12:42:26 EEST 2002
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
        at java.lang.String.charAt(String.java:455)
        at soot.util.SourceLocator.getInputStreamOf(SourceLocator.java:117)
        at soot.util.SourceLocator.getInputStreamOf(SourceLocator.java:80)
        at 
soot.SootResolver.resolveClassAndSupportClasses(SootResolver.java:88)

        at soot.Scene.loadClassAndSupport(Scene.java:331)
        at soot.Main.run(Main.java:1409)
        at java.lang.Thread.run(Thread.java:536)



Linux:
java -classpath 
sootclasses-1.2.2.jar:jasminclasses-1.06-s10.jar:/usr/local/j2sdk1.4.0/jre/lib/rt.jar:. 
TestTransform TestTransform
#1
#2
#3
Soot started on Fri Apr 05 12:55:39 EEST 2002
#internal 1
TestTransform
*** Class: TestTransform
*** Method: <init>
*** Method: internalTransform
*** Method: main
#internal 2
Transforming TestTransform...
Soot finished on Fri Apr 05 12:55:54 EEST 2002
Soot has run for 0 min. 15 sec.

==========================================

Our main problem is that we have written a larger program that must be 
runnable in Windows which starts soot in a similar way as the example.

Any help or suggestion are welcome.

Henrik.





import java.util.*;

import soot.*;
import soot.gui.*;
import soot.toolkits.graph.*;

public class TestTransform extends SceneTransformer {
        public TestTransform() {
        }

        protected void internalTransform(String sPhase, Map mapOptions) {
                System.err.println("#internal 1");
                Iterator iter = Scene.v().getApplicationClasses().iterator();
                while (iter.hasNext()) {
                        System.err.println(iter.next());
                }

                Iterator classIter = 
Scene.v().getApplicationClasses().iterator();
                while (classIter.hasNext()) {
                        SootClass clazz = (SootClass)classIter.next();
                        System.err.println("*** Class: " + clazz.getName());
                        Iterator methIter = clazz.getMethods().iterator();
                        while (methIter.hasNext()) {
                                SootMethod method = 
(SootMethod)methIter.next();                                                  
              
                                System.err.println("*** Method: " + 
method.getName());
                        }
                }
                System.err.println("#internal 2");
        }

        public static void main(String[] args) {
                System.err.println("#1");
                Scene.v().getPack("wjtp").add(new Transform("wjtp.flow", new 
TestTransform()));
                System.err.println("#2");
                soot.Main.main(args);
                System.err.println("#3");
        }
}