Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public boolean canLoad(String internalName) {
return this.getClass().getResource("/" + internalName + ".class") != null;
}


public static void main(String[] args) {
Sample sample = new Sample();
Loader loader = new Loader(sample::canLoad, sample::load);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ public String getName() {

@Override
public Entries getEntries() {
if (classpathEntries == null) return Entries.EMPTY;
if (classpathEntries == null) {
return Entries.EMPTY;
}
loadClasspathEntries();
List<Entry> classes = new ArrayList<>();
for (Map.Entry<String, ZipFile> entry : openedZipFiles.entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public static <K, V, E extends Throwable> V computeIfAbsent(Map<K, V> map, K key
@SuppressWarnings("all")
V v = map.get(key);
if (v == null) {
V newValue;
if ((newValue = mappingFunction.apply(key)) != null) {
V newValue = mappingFunction.apply(key);
if (newValue != null) {
map.put(key, newValue);
return newValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
public interface SettingsApplicable {

final class Constants {
private static final Class<?>[] BOOLEAN_PARAM = new Class<?>[] { boolean.class };
private static final Class<?>[] INT_PARAM = new Class<?>[] { int.class };
private static final Class<?>[] BOOLEAN_PARAM = { boolean.class };
private static final Class<?>[] INT_PARAM = { int.class };

private Constants() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public interface Decompiler<S> {

/**
* Decompile the given class with a loader
*
*
* @param loader The loader implementation used to load the class
* @param internalName The internal name of the class to decompile
* @param settings The settings to use with this decompiler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public FernflowerBytecodeProvider(Map<String, byte[]> data) {

/**
* internalPath is null
* externalPath does not exist but internal class name can be extracted from it
* externalPath does not exist but internal class name can be extracted from it
*/
@Override
public byte[] getBytecode(String externalPath, String internalPath) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static BytecodeOutputOptions createBytecodeFormattingOptions(final Comma
@Override
public DecompilationResult decompile(Loader loader, String internalName, CommandLineOptions options) throws IOException {
Map<String, byte[]> importantClasses = new HashMap<>();

String key = readClassAndInnerClasses(loader, internalName).fullClassName();

importantClasses.put(key, loader.load(internalName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public boolean tryLoadType(String s, Buffer buffer) {
return true;
} catch (IOException e) {
System.err.println(e);
return false;
}
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ private void addRef(TextRange range, ReferenceData reference) {
}

private static String toFragment(DeclarationData data, String desc) {
if (data.isAType()) return data.getTypeName();
if (data.isAType()) {
return data.getTypeName();
}
return data.getTypeName() + '-' + data.getName() + '-' + desc;
}
}