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 9
9
import java .lang .reflect .Constructor ;
10
10
import java .lang .reflect .Field ;
11
11
import java .lang .reflect .InvocationTargetException ;
12
- import java .lang .reflect .Modifier ;
13
12
import java .util .HashMap ;
14
13
import java .util .List ;
15
14
import java .util .Map ;
@@ -399,17 +398,12 @@ protected Class<?> findClass(String name) throws ClassNotFoundException {
399
398
400
399
LangNativeModule langNativeModule = lnmArray [0 ] = (LangNativeModule )entryPointConstructor .newInstance ();
401
400
402
- Field modifiersField = Field .class .getDeclaredField ("modifiers" );
403
- modifiersField .setAccessible (true );
404
-
405
401
Field interpreterField = LangNativeModule .class .getDeclaredField ("interpreter" );
406
402
interpreterField .setAccessible (true );
407
- modifiersField .setInt (interpreterField , interpreterField .getModifiers () & ~Modifier .FINAL );
408
403
interpreterField .set (langNativeModule , interpreter );
409
404
410
405
Field moduleField = LangNativeModule .class .getDeclaredField ("module" );
411
406
moduleField .setAccessible (true );
412
- modifiersField .setInt (moduleField , moduleField .getModifiers () & ~Modifier .FINAL );
413
407
moduleField .set (langNativeModule , module );
414
408
}catch (ClassNotFoundException |NoSuchMethodException |SecurityException |InstantiationException |
415
409
IllegalAccessException |IllegalArgumentException |InvocationTargetException |NoSuchFieldException e ) {
Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ public abstract class LangNativeModule {
14
14
/**
15
15
* The value for this field will be injected after the instantiation with the default constructor
16
16
*/
17
- protected final LangInterpreter interpreter = null ;
17
+ protected LangInterpreter interpreter ;
18
18
/**
19
19
* The value for this field will be injected after the instantiation with the default constructor
20
20
*/
21
- protected final LangModule module = null ;
21
+ protected LangModule module ;
22
22
23
23
protected final void exportFunction (String functionName , LangPredefinedFunctionObject func ) {
24
24
if (!module .isLoad ())
You can’t perform that action at this time.
0 commit comments