Changes so that internally on the analysis side, classesnames are still package1...
authorstephey <stephey>
Fri, 22 Apr 2011 08:20:39 +0000 (08:20 +0000)
committerstephey <stephey>
Fri, 22 Apr 2011 08:20:39 +0000 (08:20 +0000)
Robust/src/IR/Descriptor.java
Robust/src/IR/NameDescriptor.java
Robust/src/IR/TypeUtil.java

index 4d4d67b7d7d6a06576683caefa88b554b4fa92f3..4439b1982c2953b9ca51d93d11b0115b9291949e 100644 (file)
@@ -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;
index fb4f5344486cd3d8feee06d5b6dee91c1dd71738..ca0d426edcd96b0a659f8c584a4a447dea79e90d 100644 (file)
@@ -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;
   }
-
 }
index 4fa3412c63b2dd5d67f029387cb05315a7277f17..50f6863909c19f7f8e04a145da46eedcedb42db1 100644 (file)
@@ -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());