mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-01 14:12:59 +00:00
Replace Collections methods with {List,Map,Set}.of
The two implementations aren't entirely compatible - the implementation returned by .of will throw an NPE on .contains(null), whereas the Collections implementations just return false. However, we try to avoid passing null to collections methods, so this should be safe. There's no strong reason to do this, but it helps make the code a little more consistent
This commit is contained in:
@@ -74,7 +74,7 @@ public class MethodReflection {
|
||||
.build(CacheLoader.from(Internal::getMethodsImpl));
|
||||
|
||||
private static final StaticGenerator<LuaMethod> GENERATOR = new StaticGenerator<>(
|
||||
LuaMethod.class, Collections.singletonList(ILuaContext.class), Internal::createClass
|
||||
LuaMethod.class, List.of(ILuaContext.class), Internal::createClass
|
||||
);
|
||||
|
||||
static List<NamedMethod<ReflectClass<LuaMethod>>> getMethods(Class<?> klass) {
|
||||
|
||||
Reference in New Issue
Block a user