Replaced getDeclaredConstructor with constructors

This commit is contained in:
Pazaz 2022-04-28 02:41:20 -04:00
parent fd3572f709
commit 37883b9f35
7 changed files with 7 additions and 19 deletions

View file

@ -79,7 +79,7 @@ public class AudioChannel {
throw new IllegalStateException(); throw new IllegalStateException();
} }
try { try {
@Pc(33) AudioChannel audioChannel = (AudioChannel) Class.forName("rt4.JavaAudioChannel").getDeclaredConstructor().newInstance(); @Pc(33) AudioChannel audioChannel = new JavaAudioChannel();
audioChannel.sampleRate2 = arg0; audioChannel.sampleRate2 = arg0;
audioChannel.samples = new int[(stereo ? 2 : 1) * 256]; audioChannel.samples = new int[(stereo ? 2 : 1) * 256];
audioChannel.init(arg2); audioChannel.init(arg2);

View file

@ -141,18 +141,7 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
@OriginalMember(owner = "client!sd", name = "e", descriptor = "(I)V") @OriginalMember(owner = "client!sd", name = "e", descriptor = "(I)V")
public static void getMaxMemory() { public static void getMaxMemory() {
try { maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1048576L) + 1;
@Pc(12) Method method = Runtime.class.getMethod("maxMemory");
if (method != null) {
try {
@Pc(17) Runtime runtime = Runtime.getRuntime();
@Pc(24) Long bytes = (Long) method.invoke(runtime, (Object[]) null);
maxMemory = (int) (bytes / 1048576L) + 1;
} catch (@Pc(34) Throwable ex) {
}
}
} catch (@Pc(36) Exception ex) {
}
} }
@OriginalMember(owner = "client!la", name = "a", descriptor = "(Lsignlink!ll;Ljava/lang/Object;I)V") @OriginalMember(owner = "client!la", name = "a", descriptor = "(Lsignlink!ll;Ljava/lang/Object;I)V")

View file

@ -12,7 +12,7 @@ public abstract class MouseWheel {
@OriginalMember(owner = "client!dh", name = "a", descriptor = "(B)Lclient!uc;") @OriginalMember(owner = "client!dh", name = "a", descriptor = "(B)Lclient!uc;")
public static MouseWheel create() { public static MouseWheel create() {
try { try {
return (MouseWheel) Class.forName("rt4.JavaMouseWheel").getDeclaredConstructor().newInstance(); return new JavaMouseWheel();
} catch (@Pc(15) Throwable local15) { } catch (@Pc(15) Throwable local15) {
return null; return null;
} }

View file

@ -125,8 +125,7 @@ public final class Static131 {
@OriginalMember(owner = "client!kd", name = "a", descriptor = "(IIZLjava/awt/Component;)Lclient!vk;") @OriginalMember(owner = "client!kd", name = "a", descriptor = "(IIZLjava/awt/Component;)Lclient!vk;")
public static FrameBuffer create(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) Component arg2) { public static FrameBuffer create(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) Component arg2) {
try { try {
@Pc(12) Class local12 = Class.forName("rt4.BufferedImageFrameBuffer"); @Pc(16) FrameBuffer local16 = new BufferedImageFrameBuffer();
@Pc(16) FrameBuffer local16 = (FrameBuffer) local12.getDeclaredConstructor().newInstance();
local16.init(arg0, arg1, arg2); local16.init(arg0, arg1, arg2);
return local16; return local16;
} catch (@Pc(25) Throwable local25) { } catch (@Pc(25) Throwable local25) {

View file

@ -56,7 +56,7 @@ public final class Static33 {
} }
if (arg0.length > 136 && !Static84.aBoolean127) { if (arg0.length > 136 && !Static84.aBoolean127) {
try { try {
@Pc(27) ByteArray local27 = (ByteArray) Class.forName("rt4.DirectByteArray").getDeclaredConstructor().newInstance(); @Pc(27) ByteArray local27 = new DirectByteArray();
local27.set(arg0); local27.set(arg0);
return local27; return local27;
} catch (@Pc(34) Throwable local34) { } catch (@Pc(34) Throwable local34) {

View file

@ -50,7 +50,7 @@ public final class Static44 {
@OriginalMember(owner = "client!dh", name = "b", descriptor = "(I)Lclient!q;") @OriginalMember(owner = "client!dh", name = "b", descriptor = "(I)Lclient!q;")
public static ReferenceNodeFactory method1147() { public static ReferenceNodeFactory method1147() {
try { try {
return (ReferenceNodeFactory) Class.forName("rt4.SoftReferenceNodeFactory").getDeclaredConstructor().newInstance(); return new SoftReferenceNodeFactory();
} catch (@Pc(15) Throwable local15) { } catch (@Pc(15) Throwable local15) {
return null; return null;
} }

View file

@ -11,7 +11,7 @@ public abstract class Timer {
@OriginalMember(owner = "client!fi", name = "a", descriptor = "(B)Lclient!s;") @OriginalMember(owner = "client!fi", name = "a", descriptor = "(B)Lclient!s;")
public static Timer create() { public static Timer create() {
try { try {
return (Timer) Class.forName("rt4.NanoTimer").getDeclaredConstructor().newInstance(); return new NanoTimer();
} catch (@Pc(15) Throwable ex) { } catch (@Pc(15) Throwable ex) {
return new MillisTimer(); return new MillisTimer();
} }