private static void updateData(final List<File> files,
final List<LWRepository> holder,
final Map<File, ClassCount> classCountMap) {
new TaskRunner(new ISwingRunnableWithProgress() {
public void run(IProgress progress) throws Throwable {
LWRepository other = new LWRepository(files, progress);
holder.add(other);
List<String> allDefinedClassNames = other
.getAllDefinedClassNames();
int steps = Math.min(allDefinedClassNames.size(), 20);
int stepSize = allDefinedClassNames.size() / steps;
progress.setRange(0, steps);
int index = 0;
for (String className : allDefinedClassNames) {
index++;
if (index % stepSize == 0) {
progress.increment(1, "Loaded " + index + " classes.");
}
File file = other.locateClass(className);
if (file != null) {
file = file.getCanonicalFile();
ClassCount count = classCountMap.get(file);
if (count == null) {
count = new ClassCount(0, 0);
classCountMap.put(file, count);
}
if (other.findClass(className).isInterface()) {
count
.setInterfaceCount(count
.getInterfaceCount() + 1);
} else {
count.setClassCount(count.getClassCount() + 1);