File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
src/main/java/com/laytonsmith/core/constructs Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1515 */
1616public class NativeTypeList {
1717
18+ private static Set <String > nativeTypes ;
19+
1820 /**
1921 * Returns a list of all the known native classes.
2022 *
2123 * @return
2224 */
2325 public static Set <String > getNativeTypeList () {
24- Set <String > ret = new HashSet <>();
26+ if (nativeTypes != null ) {
27+ return nativeTypes ;
28+ }
29+ nativeTypes = new HashSet <>();
2530 for (ClassMirror <? extends Mixed > c : ClassDiscovery .getDefaultInstance ().getClassesWithAnnotationThatExtend (typeof .class , Mixed .class )) {
26- ret .add (c .loadAnnotation (typeof .class ).value ());
31+ nativeTypes .add (c .loadAnnotation (typeof .class ).value ());
2732 }
2833 // Also add this one in
29- ret .add ("mixed" );
30- return ret ;
34+ nativeTypes .add ("mixed" );
35+ return nativeTypes ;
3136 }
3237
3338 /**
@@ -70,7 +75,7 @@ public static Class<? extends Mixed> getNativeClassOrInterfaceRunner(String meth
7075 * @param methodscriptType
7176 * @return
7277 * @throws ClassNotFoundException If the methodscript type could not be found
73- * @throws IllegalArgumentExceptio If the underlying type isn't a java interface or abstract class
78+ * @throws IllegalArgumentException If the underlying type isn't a java interface or abstract class
7479 */
7580 public static Class <? extends MixedInterfaceRunner > getInterfaceRunnerFor (String methodscriptType ) throws
7681 ClassNotFoundException , IllegalArgumentException {
You can’t perform that action at this time.
0 commit comments