bar.setMinimum(0);
bar.setMaximum(jfile.size());
byte data[] = new byte[1024];
DecompilerSettings settings = cloneSettings();
LuytenTypeLoader typeLoader = new LuytenTypeLoader();
MetadataSystem metadataSystem = new MetadataSystem(typeLoader);
ITypeLoader jarLoader = new JarTypeLoader(jfile);
typeLoader.getTypeLoaders().add(jarLoader);
DecompilationOptions decompilationOptions = new DecompilationOptions();
decompilationOptions.setSettings(settings);
decompilationOptions.setFullDecompilation(true);
List<String> mass = null;
JarEntryFilter jarEntryFilter = new JarEntryFilter(jfile);
LuytenPreferences luytenPrefs = ConfigSaver.getLoadedInstance().getLuytenPreferences();
if (luytenPrefs.isFilterOutInnerClassEntries()) {
mass = jarEntryFilter.getEntriesWithoutInnerClasses();
} else {
mass = jarEntryFilter.getAllEntriesFromJar();
}
Enumeration<JarEntry> ent = jfile.entries();
Set<JarEntry> history = new HashSet<JarEntry>();
int tick = 0;
while (ent.hasMoreElements() && !cancel) {
bar.setValue(++tick);
JarEntry entry = ent.nextElement();
if (!mass.contains(entry.getName()))
continue;
label.setText("Extracting: " + entry.getName());
bar.setVisible(true);
if (entry.getName().endsWith(".class")) {
JarEntry etn = new JarEntry(entry.getName().replace(".class", ".java"));
label.setText("Extracting: " + etn.getName());
//Duplicate
if(history.add(etn)){
out.putNextEntry(etn);
try {
String internalName = StringUtilities.removeRight(entry.getName(), ".class");
TypeReference type = metadataSystem.lookupType(internalName);
TypeDefinition resolvedType = null;
if ((type == null) || ((resolvedType = type.resolve()) == null)) {
throw new Exception("Unable to resolve type.");
}
Writer writer = new OutputStreamWriter(out);