File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed
src/me/jddev0/module/lang Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change 99import java .lang .reflect .Constructor ;
1010import java .lang .reflect .Field ;
1111import java .lang .reflect .InvocationTargetException ;
12- import java .lang .reflect .Modifier ;
1312import java .util .HashMap ;
1413import java .util .List ;
1514import java .util .Map ;
@@ -399,17 +398,12 @@ protected Class<?> findClass(String name) throws ClassNotFoundException {
399398
400399 LangNativeModule langNativeModule = lnmArray [0 ] = (LangNativeModule )entryPointConstructor .newInstance ();
401400
402- Field modifiersField = Field .class .getDeclaredField ("modifiers" );
403- modifiersField .setAccessible (true );
404-
405401 Field interpreterField = LangNativeModule .class .getDeclaredField ("interpreter" );
406402 interpreterField .setAccessible (true );
407- modifiersField .setInt (interpreterField , interpreterField .getModifiers () & ~Modifier .FINAL );
408403 interpreterField .set (langNativeModule , interpreter );
409404
410405 Field moduleField = LangNativeModule .class .getDeclaredField ("module" );
411406 moduleField .setAccessible (true );
412- modifiersField .setInt (moduleField , moduleField .getModifiers () & ~Modifier .FINAL );
413407 moduleField .set (langNativeModule , module );
414408 }catch (ClassNotFoundException |NoSuchMethodException |SecurityException |InstantiationException |
415409 IllegalAccessException |IllegalArgumentException |InvocationTargetException |NoSuchFieldException e ) {
Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ public abstract class LangNativeModule {
1414 /**
1515 * The value for this field will be injected after the instantiation with the default constructor
1616 */
17- protected final LangInterpreter interpreter = null ;
17+ protected LangInterpreter interpreter ;
1818 /**
1919 * The value for this field will be injected after the instantiation with the default constructor
2020 */
21- protected final LangModule module = null ;
21+ protected LangModule module ;
2222
2323 protected final void exportFunction (String functionName , LangPredefinedFunctionObject func ) {
2424 if (!module .isLoad ())
You can’t perform that action at this time.
0 commit comments