Fixed some Reflection Errors due to the Switch from Application to LegacyApplication

cleanup_build_scripts v3.1.0-beta1
MeFisto94 9 years ago
parent d044ad13e1
commit 310f4db6ad
  1. 6
      jme3-examples/src/main/java/jme3test/TestChooser.java

@ -32,7 +32,7 @@
package jme3test; package jme3test;
import com.jme3.app.Application; import com.jme3.app.LegacyApplication;
import com.jme3.app.SimpleApplication; import com.jme3.app.SimpleApplication;
import com.jme3.system.JmeContext; import com.jme3.system.JmeContext;
import java.awt.*; import java.awt.*;
@ -260,7 +260,7 @@ public class TestChooser extends JDialog {
for (int i = 0; i < appClass.length; i++) { for (int i = 0; i < appClass.length; i++) {
Class<?> clazz = (Class)appClass[i]; Class<?> clazz = (Class)appClass[i];
try { try {
if (Application.class.isAssignableFrom(clazz)) { if (LegacyApplication.class.isAssignableFrom(clazz)) {
Object app = clazz.newInstance(); Object app = clazz.newInstance();
if (app instanceof SimpleApplication) { if (app instanceof SimpleApplication) {
final Method settingMethod = clazz.getMethod("setShowSettings", boolean.class); final Method settingMethod = clazz.getMethod("setShowSettings", boolean.class);
@ -268,7 +268,7 @@ public class TestChooser extends JDialog {
} }
final Method mainMethod = clazz.getMethod("start"); final Method mainMethod = clazz.getMethod("start");
mainMethod.invoke(app); mainMethod.invoke(app);
Field contextField = Application.class.getDeclaredField("context"); Field contextField = LegacyApplication.class.getDeclaredField("context");
contextField.setAccessible(true); contextField.setAccessible(true);
JmeContext context = null; JmeContext context = null;
while (context == null) { while (context == null) {

Loading…
Cancel
Save