includes.add(f);
includeTimes.put(f, new Long(ts));
}
size = readU32(in);
LocalLogger logger = size == 0 ? null : new LocalLogger(null);
for (int i = 0; i < size; i++)
{
String path = (String) pool[readU32(in)];
if (path.length() == 0)
{
path = null;
}
String warning = (String) pool[readU32(in)];
if (warning.length() == 0)
{
warning = null;
}
String source = (String) pool[readU32(in)];
if (source.length() == 0)
{
source = null;
}
int line = readU32(in);
int col = readU32(in);
int errorCode = readU32(in);
logger.recordWarning(path,
line == -1 ? null : IntegerPool.getNumber(line),
col == -1 ? null : IntegerPool.getNumber(col),
warning,
source,
errorCode == -1 ? null : IntegerPool.getNumber(errorCode));
}
byte[] abc = (hasUnit) ? (byte[]) pool[readU32(in)] : null;
Source s = null;
if (owner == 0) // FileSpec
{
Collection<Source> c = fileSpec.sources();
for (Iterator<Source> i = c.iterator(); i.hasNext();)
{
s = i.next();
if (s.getName().equals(name))
{
Source.populateSource(s, fileTime, pathRoot, relativePath, shortName, fileSpec, isInternal, isRoot, isDebuggable,
includes, includeTimes, logger);
break;
}
}
}
else if (owner == 1) // SourceList
{
Collection<Source> c = sourceList.sources().values();
for (Iterator<Source> i = c.iterator(); i.hasNext();)
{
s = i.next();
if (s.getName().equals(name))
{
Source.populateSource(s, fileTime, pathRoot, relativePath, shortName, sourceList, isInternal, isRoot, isDebuggable,
includes, includeTimes, logger);
break;
}
}
}
else if (owner == 2) // SourcePath
{
Map<String, Source> c = sourcePath.sources();
String className = mappings.get(name);
if ((className != null) && !c.containsKey(className))
{
VirtualFile f = resolver.resolve(name);
if (f == null)
{
f = new DeletedFile(name);
}
s = Source.newSource(f, fileTime, pathRoot, relativePath, shortName, sourcePath, isInternal, isRoot, isDebuggable,
includes, includeTimes, logger);
c.put(className, s);
}
else
{
assert false : name;
}
}
else if (owner == 3) // ResourceContainer
{
if (resources == null)
{
LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
throw new IOException(l10n.getLocalizedTextString(new NoResourceContainer()));
}
s = Source.newSource(abc, name, fileTime, pathRoot, relativePath, shortName, resources, isInternal, isRoot, isDebuggable,
includes, includeTimes, logger);
s = resources.addResource(s);
}
else if (owner == 4) // ResourceBundlePath
{
Map<String, Source> c = bundlePath.sources();
Object[] value = (Object[]) rbMappings.get(name);
String bundleName = (String) value[0];
String[] rNames = (String[]) value[1];
String[] rRoots = (String[]) value[2];
if (bundleName != null)
{
VirtualFile[] rFiles = new VirtualFile[rNames.length];
for (int i = 0; i < rFiles.length; i++)
{
if (rNames[i] != null)
{
rFiles[i] = resolver.resolve(rNames[i]);
if (rFiles[i] == null)
{
rFiles[i] = new DeletedFile(rNames[i]);
}
}
}
VirtualFile[] rRootFiles = new VirtualFile[rRoots.length];
for (int i = 0; i < rRootFiles.length; i++)
{
if (rRoots[i] != null)
{
rRootFiles[i] = resolver.resolve(rRoots[i]);
if (rRootFiles[i] == null)
{
rRootFiles[i] = new DeletedFile(rRoots[i]);
}
}
}
VirtualFile f = new ResourceFile(name, bundlePath.getLocales(), rFiles, rRootFiles);
s = Source.newSource(f, fileTime, pathRoot, relativePath, shortName, bundlePath, isInternal, isRoot, isDebuggable,
includes, includeTimes, logger);
c.put(bundleName, s);
}
else
{
assert false : name;
}
}
else
{
assert false : "owner = " + owner;
}
if (logger != null)
{
logger.setSource(s);
}
if (hasUnit)
{
CompilationUnit u = s.newCompilationUnit(null, new CompilerContext());