Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toss everything deprecated #155

Merged
merged 6 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -8,8 +8,6 @@
import java.util.Map;

public class DecompilerConfig {
@Deprecated
private static final String QUILTFLOWER = "Quiltflower";
private static final String VINEFLOWER = "Vineflower";

private DecompilerConfig() {
Expand Down Expand Up @@ -44,20 +42,7 @@ public static void bootstrap() {
// Just run the static initialization
}

private static void updateToVineflower() {
if (cfg.data().sections().containsKey(QUILTFLOWER)) {
ConfigSection oldSection = cfg.data().section(QUILTFLOWER);
ConfigSection newSection = getVineflowerSection();
oldSection.values().forEach(newSection::setIfAbsentString);

cfg.data().removeSection(QUILTFLOWER);
save();
}
}

static {
updateToVineflower();

VineflowerPreferences.OPTIONS.putAll(getVineflowerSection().values());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ public final class UiConfig {
public static final String MAX_RECENT_FILES = "Max Recent Files";

public static final String PAIR_SEPARATOR = ";";
@Deprecated(since = "1.6.2", forRemoval = true)
private static final String OLD_PAIR_SEPARATOR = ":";

private UiConfig() {
}

Expand Down Expand Up @@ -175,7 +174,7 @@ public static Optional<Map<Docker, Docker.VerticalLocation>> getHostedDockers(Do

for (String dockInfo : hostedDockers.get()) {
if (!dockInfo.isBlank()) {
String[] split = dockInfo.split(dockInfo.contains(PAIR_SEPARATOR) ? PAIR_SEPARATOR : OLD_PAIR_SEPARATOR);
String[] split = dockInfo.split(PAIR_SEPARATOR);

try {
Docker.VerticalLocation location = Docker.VerticalLocation.valueOf(split[1]);
Expand Down Expand Up @@ -292,7 +291,7 @@ public static List<Pair<Path, Path>> getRecentFilePairs() {
}

private static Optional<Pair<Path, Path>> parseFilePair(String pair) {
String[] split = pair.split(pair.contains(PAIR_SEPARATOR) ? PAIR_SEPARATOR : OLD_PAIR_SEPARATOR);
String[] split = pair.split(PAIR_SEPARATOR);

if (split.length != 2) {
return Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private CompletableFuture<Result<Source, ClassHandleError>> decompile() {
return CompletableFuture.supplyAsync(() -> {
if (this.decompileVersion.get() != v) return null;

Result<Source, ClassHandleError> uncommentedSource = Result.ok(this.p.decompiler.getSource(this.entry.getFullName()));
Result<Source, ClassHandleError> uncommentedSource = Result.ok(this.p.decompiler.getSource(this.entry.getFullName(), null));
Entry.this.uncommentedSource = uncommentedSource;
Entry.this.waitingUncommentedSources.forEach(f -> f.complete(uncommentedSource));
Entry.this.waitingUncommentedSources.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@
import org.checkerframework.checker.nullness.qual.Nullable;

public interface Decompiler {
@Deprecated // use remapper specific one for easy doc inclusion
default Source getSource(String className) {
ix0rai marked this conversation as resolved.
Show resolved Hide resolved
return this.getSource(className, null);
}

Source getSource(String className, @Nullable EntryRemapper remapper);
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ public AccessFlags setBridge() {
return this;
}

@Deprecated
public AccessFlags setBridged() {
return this.setBridge();
}

public void setVisibility(int visibility) {
this.resetVisibility();
this.flags |= visibility;
Expand Down
44 changes: 22 additions & 22 deletions enigma/src/test/java/org/quiltmc/enigma/TestDeobfed.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,27 @@ public void obfEntries() {
public void decompile() {
Decompiler decompiler = Decompilers.CFR.create(deobfProject.getClassProvider(), new SourceSettings(false, false));

decompiler.getSource("a");
decompiler.getSource("b");
decompiler.getSource("c");
decompiler.getSource("d");
decompiler.getSource("d$1");
decompiler.getSource("e");
decompiler.getSource("f");
decompiler.getSource("g");
decompiler.getSource("g$a");
decompiler.getSource("g$a$a");
decompiler.getSource("g$b");
decompiler.getSource("g$b$a");
decompiler.getSource("h");
decompiler.getSource("h$a");
decompiler.getSource("h$a$a");
decompiler.getSource("h$b");
decompiler.getSource("h$b$a");
decompiler.getSource("h$b$a$a");
decompiler.getSource("h$b$a$b");
decompiler.getSource("i");
decompiler.getSource("i$a");
decompiler.getSource("i$b");
decompiler.getSource("a", null);
decompiler.getSource("b", null);
decompiler.getSource("c", null);
decompiler.getSource("d", null);
decompiler.getSource("d$1", null);
decompiler.getSource("e", null);
decompiler.getSource("f", null);
decompiler.getSource("g", null);
decompiler.getSource("g$a", null);
decompiler.getSource("g$a$a", null);
decompiler.getSource("g$b", null);
decompiler.getSource("g$b$a", null);
decompiler.getSource("h", null);
decompiler.getSource("h$a", null);
decompiler.getSource("h$a$a", null);
decompiler.getSource("h$b", null);
decompiler.getSource("h$b$a", null);
decompiler.getSource("h$b$a$a", null);
decompiler.getSource("h$b$a$b", null);
decompiler.getSource("i", null);
decompiler.getSource("i$a", null);
decompiler.getSource("i$b", null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public void decompileClass() throws Exception {
EnigmaProject project = this.openProject();
Decompiler decompiler = Decompilers.CFR.create(project.getClassProvider(), new SourceSettings(false, false));

decompiler.getSource("a").asString();
decompiler.getSource("a", null).asString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ public void classTree() {
}

private void decompile(ClassEntry classEntry) {
this.decompiler.getSource(classEntry.getName());
this.decompiler.getSource(classEntry.getName(), null);
}
}
4 changes: 2 additions & 2 deletions enigma/src/test/java/org/quiltmc/enigma/TokenChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected TokenChecker(Path path, DecompilerService decompilerService, ClassProv

protected String getDeclarationToken(Entry<?> entry) {
// decompile the class
Source source = this.decompiler.getSource(entry.getContainingClass().getFullName());
Source source = this.decompiler.getSource(entry.getContainingClass().getFullName(), null);
// DEBUG
// createDebugFile(source, entry.getContainingClass());
String string = source.asString();
Expand All @@ -61,7 +61,7 @@ protected String getDeclarationToken(Entry<?> entry) {
@SuppressWarnings("unchecked")
protected Collection<String> getReferenceTokens(EntryReference<? extends Entry<?>, ? extends Entry<?>> reference) {
// decompile the class
Source source = this.decompiler.getSource(reference.context.getContainingClass().getFullName());
Source source = this.decompiler.getSource(reference.context.getContainingClass().getFullName(), null);
String string = source.asString();
SourceIndex index = source.index();
// DEBUG
Expand Down