Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/ch/akuhn/fame/codegen/GenFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ public void addImport(String aPackage, String className) {
imports.add(aPackage + "." + className);
}

public void addSuperclass(String aPackage, String className) {
if (className.equals("Object") && aPackage.equals("java.lang")) return;
this.addImport(aPackage, className);
this.superName = className;
public void addSuperclass(String packageName, String superClassName) {
if (superClassName.equals("Object") && packageName.equals("java.lang")) return;

if (this.name.equals(superClassName)) {
this.superName = packageName + "." + superClassName;
} else {
this.addImport(packageName, superClassName);
this.superName = superClassName;
}
}

public abstract void generateCode(Appendable stream) throws IOException;
Expand Down