Compare commits
3 commits
a42efaae80
...
c784a8b286
Author | SHA1 | Date | |
---|---|---|---|
moehreag | c784a8b286 | ||
moehreag | 9ed7490c0e | ||
moehreag | fe32ccd2bd |
|
@ -4,6 +4,7 @@ import dev.frogmc.frogloader.impl.gui.component.DependencyErrorEntry;
|
|||
import dev.frogmc.frogloader.impl.mod.ModDependencyResolver;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.Objects;
|
||||
|
||||
public class BreakingDepPage extends JScrollPane {
|
||||
|
@ -47,6 +48,7 @@ public class BreakingDepPage extends JScrollPane {
|
|||
list.add(result);
|
||||
});
|
||||
setViewportView(list);
|
||||
SwingUtilities.invokeLater(() -> getViewport().setViewPosition(new Point()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package dev.frogmc.frogloader.impl.gui.page;
|
||||
|
||||
import dev.frogmc.frogloader.impl.util.PlatformUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
@ -10,18 +9,24 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class ReportPage extends JTextPane {
|
||||
public class ReportPage extends JScrollPane {
|
||||
|
||||
public ReportPage(Path reportPath) {
|
||||
setEditable(false);
|
||||
getHorizontalScrollBar().setUnitIncrement(16);
|
||||
getVerticalScrollBar().setUnitIncrement(16);
|
||||
|
||||
JTextPane text = new JTextPane();
|
||||
text.setEditable(false);
|
||||
try {
|
||||
setText(Files.readString(reportPath, StandardCharsets.UTF_8));
|
||||
text.setText(Files.readString(reportPath, StandardCharsets.UTF_8));
|
||||
} catch (IOException e) {
|
||||
StringWriter writer = new StringWriter();
|
||||
PrintWriter printer = new PrintWriter(writer);
|
||||
printer.printf("Could not load contents of %s:%n", reportPath);
|
||||
e.printStackTrace(printer);
|
||||
}
|
||||
setViewportView(text);
|
||||
SwingUtilities.invokeLater(() -> getViewport().setViewPosition(new Point(0, 0)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package dev.frogmc.frogloader.impl.gui.page;
|
||||
|
||||
import dev.frogmc.frogloader.impl.FrogLoaderImpl;
|
||||
import dev.frogmc.frogloader.impl.gui.component.DependencyErrorEntry;
|
||||
import dev.frogmc.frogloader.impl.mod.ModDependencyResolver;
|
||||
import dev.frogmc.frogloader.impl.mod.ModUtil;
|
||||
import dev.frogmc.frogloader.impl.util.PlatformUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Objects;
|
||||
|
@ -73,6 +72,7 @@ public class UnfulfilledDepPage extends JScrollPane {
|
|||
});
|
||||
|
||||
setViewportView(list);
|
||||
SwingUtilities.invokeLater(() -> getViewport().setViewPosition(new Point()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -91,6 +91,20 @@ public class AccessWidener {
|
|||
}
|
||||
return super.visitMethod(access, name, descriptor, signature, exceptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitInnerClass(String name, String outerName, String innerName, int access) {
|
||||
Entry e = classMap.get(name);
|
||||
if (e != null) {
|
||||
access &= ~(Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED | Opcodes.ACC_PUBLIC);
|
||||
access |= e.type.access;
|
||||
}
|
||||
if (fields.containsKey(name) || methods.containsKey(name) || mutations.containsKey(name)) {
|
||||
access &= ~(Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED | Opcodes.ACC_PUBLIC);
|
||||
access |= Opcodes.ACC_PUBLIC;
|
||||
}
|
||||
super.visitInnerClass(name, outerName, innerName, access);
|
||||
}
|
||||
};
|
||||
|
||||
reader.accept(mapper, 0);
|
||||
|
@ -139,7 +153,7 @@ public class AccessWidener {
|
|||
public record Entry(AccessType type, String targetType, String className, String name, String descriptor) {
|
||||
|
||||
public Entry(String[] line) {
|
||||
this(AccessType.of(line[0]), line[1], line[2], line[3], line[4]);
|
||||
this(AccessType.of(line[0]), line[1], line[2], line.length > 3 ? line[3] : null, line.length > 4 ? line[4] : null);
|
||||
}
|
||||
|
||||
public boolean isAccessGreaterThan(Entry other) {
|
||||
|
|
Loading…
Reference in a new issue