From: stephey Date: Fri, 22 Apr 2011 08:20:39 +0000 (+0000) Subject: Changes so that internally on the analysis side, classesnames are still package1... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=af1752a54135e11c26fab5da82411c22e8be1597;p=IRC.git Changes so that internally on the analysis side, classesnames are still package1.package2.classname instead of using ___________ for the .'s --- diff --git a/Robust/src/IR/Descriptor.java b/Robust/src/IR/Descriptor.java index 4d4d67b7..4439b198 100644 --- a/Robust/src/IR/Descriptor.java +++ b/Robust/src/IR/Descriptor.java @@ -33,8 +33,10 @@ public abstract class Descriptor { return name; } + //the text replacement is done here because SOMEWHERE someone + //modifies safename without going through the constructor... public String getSafeSymbol() { - return safename; + return safename.replaceAll("\\.", "___________"); } public int getNum() { return uniqueid; diff --git a/Robust/src/IR/NameDescriptor.java b/Robust/src/IR/NameDescriptor.java index fb4f5344..ca0d426e 100644 --- a/Robust/src/IR/NameDescriptor.java +++ b/Robust/src/IR/NameDescriptor.java @@ -38,7 +38,7 @@ public class NameDescriptor extends Descriptor { String path = id; NameDescriptor temp = this.nd; while(temp!=null) { - path = temp.identifier + "___________" + path; + path = temp.identifier + "." + path; temp = temp.nd; } @@ -51,5 +51,4 @@ public class NameDescriptor extends Descriptor { else return nd+"."+identifier; } - } diff --git a/Robust/src/IR/TypeUtil.java b/Robust/src/IR/TypeUtil.java index 4fa3412c..50f68639 100644 --- a/Robust/src/IR/TypeUtil.java +++ b/Robust/src/IR/TypeUtil.java @@ -43,11 +43,11 @@ public class TypeUtil { } public void addNewClass(String cl, Set todo) { + System.out.println("I'm looking for "+cl.replace(".", "/")); //search through the default locations for the file. for (int i = 0; i < state.classpath.size(); i++) { String path = (String) state.classpath.get(i); - //The name has ___________ to separate out packages - File f = new File(path, cl.replaceAll("___________", "/") + ".java"); + File f = new File(path, cl.replace('.', '/') + ".java"); if (f.exists()) { try { ParseNode pn = Main.readSourceFile(state, f.getCanonicalPath());