public void addNewClass(String cl, Set todo) {
//search through the default locations for the file.
public void addNewClass(String cl, Set todo) {
//search through the default locations for the file.
for (int i = 0; i < state.classpath.size(); i++) {
String path = (String) state.classpath.get(i);
File f = new File(path, cl.replace('.', '/') + ".java");
for (int i = 0; i < state.classpath.size(); i++) {
String path = (String) state.classpath.get(i);
File f = new File(path, cl.replace('.', '/') + ".java");
- ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(classname);
+ String cl = classname;
+ if(state.MGC) {
+ // do not consider package or import when compiling MGC version
+ cl = (cl.lastIndexOf('.')==-1)?cl:cl.substring(cl.lastIndexOf('.')+1);
+ }
+ ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(cl);
- ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(classname);
+ String cl = classname;
+ if(state.MGC) {
+ // do not consider package or import when compiling MGC version
+ cl = (cl.lastIndexOf('.')==-1)?cl:cl.substring(cl.lastIndexOf('.')+1);
+ }
+ ClassDescriptor cd=(ClassDescriptor)state.getClassSymbolTable().get(cl);