return 1;
}
}
// Favor SwcScript's with a cached CompilationUnit
CompilationUnit swcScript1CompilationUnit = swcScript1.getCompilationUnit();
CompilationUnit swcScript2CompilationUnit = swcScript2.getCompilationUnit();
if (swcScript1CompilationUnit != null)
{
if (swcScript1CompilationUnit.hasTypeInfo)
{
return -1;
}
}
else if (swcScript2CompilationUnit != null)
{
if (swcScript2CompilationUnit.hasTypeInfo)
{
return 1;
}
}
return 0;
}
else if (swcScript1mod < swcScript2mod)
{
return 1;
}
else
{
return -1;
}
}
});
def2script = new HashMap<String, SwcScript>();
qnames = new HashSet<QName>();
for (int i = 0; i < scriptArray.length; i++)
{
SwcScript s = scriptArray[i];
String name = s.getName();
HashMap<String, SwcScript> staging = new HashMap<String, SwcScript>();
for (Iterator defit = s.getDefinitionIterator(); defit.hasNext();)
{
String def = (String) defit.next();
staging.put(def, s);
SwcScript newerSwcScript = def2script.get(def);
if (newerSwcScript != null)
{
// already have a newer definition, this script is obsolete.
staging = null;
CompilationUnit compilationUnit = s.getCompilationUnit();
if (compilationUnit != null)
{
CompilationUnit newerCompilationUnit = newerSwcScript.getCompilationUnit();
if (newerCompilationUnit != null)
{
if ((newerCompilationUnit != null) &&
(compilationUnit.typeInfo != newerCompilationUnit.typeInfo))