Skip to content

Commit

Permalink
Fixed some Reflection Errors due to the Switch from Application to Le…
Browse files Browse the repository at this point in the history
…gacyApplication
  • Loading branch information
MeFisto94 committed Apr 24, 2016
1 parent d044ad1 commit 310f4db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jme3-examples/src/main/java/jme3test/TestChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

package jme3test;

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

0 comments on commit 310f4db

Please sign in to comment.