mirror of
https://github.com/revanced/smali.git
synced 2025-06-13 04:27:38 +02:00
Use collections of annotations, not lists.
This commit is contained in:
@ -257,7 +257,7 @@ public abstract class DebugInfo implements Iterable<DebugItem> {
|
||||
@Nonnull @Override public String getType() { return methodParameter.getType(); }
|
||||
@Nullable @Override public String getName() { return name; }
|
||||
@Nullable @Override public String getSignature() { return methodParameter.getSignature();}
|
||||
@Nonnull @Override public List<? extends Annotation> getAnnotations() {
|
||||
@Nonnull @Override public Collection<? extends Annotation> getAnnotations() {
|
||||
return methodParameter.getAnnotations();
|
||||
}
|
||||
};
|
||||
|
@ -44,7 +44,7 @@ public interface ClassDef extends TypeReference {
|
||||
@Nullable String getSuperclass();
|
||||
@Nonnull List<String> getInterfaces();
|
||||
@Nullable String getSourceFile();
|
||||
@Nonnull List<? extends Annotation> getAnnotations();
|
||||
@Nonnull Collection<? extends Annotation> getAnnotations();
|
||||
@Nonnull Collection<? extends Field> getFields();
|
||||
@Nonnull Collection<? extends Method> getMethods();
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ import org.jf.dexlib2.iface.value.EncodedValue;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
|
||||
public interface Field extends FieldReference {
|
||||
@Nonnull String getContainingClass();
|
||||
@ -44,5 +44,5 @@ public interface Field extends FieldReference {
|
||||
@Nonnull String getType();
|
||||
int getAccessFlags();
|
||||
@Nullable EncodedValue getInitialValue();
|
||||
@Nonnull List<? extends Annotation> getAnnotations();
|
||||
@Nonnull Collection<? extends Annotation> getAnnotations();
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ import org.jf.dexlib2.iface.reference.MethodReference;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface Method extends MethodReference {
|
||||
@Nonnull String getContainingClass();
|
||||
@ -44,6 +43,6 @@ public interface Method extends MethodReference {
|
||||
@Nonnull Collection<? extends MethodParameter> getParameters();
|
||||
@Nonnull String getReturnType();
|
||||
int getAccessFlags();
|
||||
@Nonnull List<? extends Annotation> getAnnotations();
|
||||
@Nonnull Collection<? extends Annotation> getAnnotations();
|
||||
@Nullable MethodImplementation getImplementation();
|
||||
}
|
||||
|
@ -36,11 +36,11 @@ import org.jf.dexlib2.iface.reference.TypeReference;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
|
||||
public interface MethodParameter extends TypeReference, LocalInfo {
|
||||
@Nonnull String getType();
|
||||
@Nonnull List<? extends Annotation> getAnnotations();
|
||||
@Nonnull Collection<? extends Annotation> getAnnotations();
|
||||
@Nullable String getName();
|
||||
@Nullable String getSignature();
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ import org.jf.util.ImmutableListUtils;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class ImmutableAnnotation implements Annotation {
|
||||
public final int visibility;
|
||||
@ -78,7 +77,7 @@ public class ImmutableAnnotation implements Annotation {
|
||||
@Nonnull @Override public ImmutableList<? extends ImmutableAnnotationElement> getElements() { return elements; }
|
||||
|
||||
@Nonnull
|
||||
public static ImmutableList<ImmutableAnnotation> immutableListOf(@Nullable List<? extends Annotation> list) {
|
||||
public static ImmutableList<ImmutableAnnotation> immutableListOf(@Nullable Iterable<? extends Annotation> list) {
|
||||
return CONVERTER.convert(list);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class ImmutableClassDef extends BaseTypeReference implements ClassDef {
|
||||
@Nullable String superclass,
|
||||
@Nullable List<String> interfaces,
|
||||
@Nullable String sourceFile,
|
||||
@Nullable List<? extends Annotation> annotations,
|
||||
@Nullable Collection<? extends Annotation> annotations,
|
||||
@Nullable Collection<? extends Field> fields,
|
||||
@Nullable Collection<? extends Method> methods) {
|
||||
this.type = type;
|
||||
|
@ -43,7 +43,7 @@ import org.jf.util.ImmutableListUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
|
||||
public class ImmutableField extends BaseFieldReference implements Field {
|
||||
@Nonnull public final String containingClass;
|
||||
@ -58,7 +58,7 @@ public class ImmutableField extends BaseFieldReference implements Field {
|
||||
@Nonnull String type,
|
||||
int accessFlags,
|
||||
@Nullable EncodedValue initialValue,
|
||||
@Nullable List<? extends Annotation> annotations) {
|
||||
@Nullable Collection<? extends Annotation> annotations) {
|
||||
this.containingClass = containingClass;
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
|
@ -43,7 +43,6 @@ import org.jf.util.ImmutableListUtils;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class ImmutableMethod extends BaseMethodReference implements Method {
|
||||
@Nonnull public final String containingClass;
|
||||
@ -59,7 +58,7 @@ public class ImmutableMethod extends BaseMethodReference implements Method {
|
||||
@Nullable Collection<? extends MethodParameter> parameters,
|
||||
@Nonnull String returnType,
|
||||
int accessFlags,
|
||||
@Nullable List<? extends Annotation> annotations,
|
||||
@Nullable Collection<? extends Annotation> annotations,
|
||||
@Nullable MethodImplementation methodImplementation) {
|
||||
this.containingClass = containingClass;
|
||||
this.name = name;
|
||||
|
@ -40,6 +40,7 @@ import org.jf.util.ImmutableListUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class ImmutableMethodParameter extends BaseTypeReference implements MethodParameter {
|
||||
@ -48,7 +49,7 @@ public class ImmutableMethodParameter extends BaseTypeReference implements Metho
|
||||
@Nullable public final String name;
|
||||
|
||||
public ImmutableMethodParameter(@Nonnull String type,
|
||||
@Nullable List<? extends Annotation> annotations,
|
||||
@Nullable Collection<? extends Annotation> annotations,
|
||||
@Nullable String name) {
|
||||
this.type = type;
|
||||
this.annotations = ImmutableAnnotation.immutableListOf(annotations);
|
||||
|
Reference in New Issue
Block a user