core: fix duplicated imports

This commit is contained in:
Skylot
2013-07-24 17:30:57 +04:00
parent 7096c38299
commit ddf2174cae
2 changed files with 7 additions and 5 deletions
@@ -62,10 +62,12 @@ public class ClassGen {
clsCode.newLine();
}
if (imports.size() != 0) {
List<String> sortImports = new ArrayList<String>();
for (ClassInfo ic : imports)
int importsCount = imports.size();
if (importsCount != 0) {
List<String> sortImports = new ArrayList<String>(importsCount);
for (ClassInfo ic : imports) {
sortImports.add(ic.getFullName());
}
Collections.sort(sortImports);
for (String imp : sortImports) {
@@ -135,12 +135,12 @@ public final class ClassInfo {
@Override
public String toString() {
return getFullName();
return fullName;
}
@Override
public int hashCode() {
return type.hashCode();
return fullName.hashCode();
}
@Override