Remove some unused code

This commit is contained in:
Luck 2019-02-04 20:35:39 +00:00
parent 1a690dabd7
commit d91355e4d6
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -25,8 +25,6 @@
package me.lucko.luckperms.nukkit.inject.dummy;
import org.checkerframework.checker.nullness.qual.NonNull;
import cn.nukkit.permission.PermissibleBase;
import cn.nukkit.permission.Permission;
import cn.nukkit.permission.PermissionAttachment;
@ -34,14 +32,11 @@ import cn.nukkit.permission.PermissionAttachmentInfo;
import cn.nukkit.plugin.Plugin;
import java.lang.reflect.Field;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.RandomAccess;
import java.util.function.BiFunction;
import java.util.function.Function;
@ -119,31 +114,4 @@ public class DummyPermissibleBase extends PermissibleBase {
@Override public void clearPermissions() {}
@Override public Map<String, PermissionAttachmentInfo> getEffectivePermissions() { return Collections.emptyMap(); }
// empty list impl that doesn't throw an exception on calls to #add
private static final List EMPTY_LIST = new EmptyList<>();
private static class EmptyList<E> extends AbstractList<E> implements RandomAccess {
@Override
public boolean add(E e) {
// do nothing, but don't throw an exception
return true;
}
@Override
public boolean addAll(@NonNull Collection<? extends E> c) {
// do nothing
return true;
}
@Override
public E get(int index) {
throw new IndexOutOfBoundsException();
}
@Override
public int size() {
return 0;
}
}
}