mirror of
https://github.com/revanced/smali.git
synced 2025-05-28 03:40:12 +02:00
Don't trim empty parameter annotations
This commit is contained in:
parent
263083faed
commit
f6958ae4bc
@ -248,18 +248,18 @@ public class BuilderClassPool implements ClassSection<BuilderStringReference, Bu
|
||||
|
||||
@Nullable @Override public List<? extends BuilderAnnotationSet> getParameterAnnotations(
|
||||
@Nonnull final BuilderMethod method) {
|
||||
final int lastIndex = CollectionUtils.lastIndexOf(method.getParameters(), HAS_PARAMETER_ANNOTATIONS);
|
||||
final List<? extends BuilderMethodParameter> parameters = method.getParameters();
|
||||
boolean hasParameterAnnotations = Iterables.any(parameters, HAS_PARAMETER_ANNOTATIONS);
|
||||
|
||||
if (lastIndex > -1) {
|
||||
if (hasParameterAnnotations) {
|
||||
return new AbstractForwardSequentialList<BuilderAnnotationSet>() {
|
||||
@Nonnull @Override public Iterator<BuilderAnnotationSet> iterator() {
|
||||
return FluentIterable.from(method.getParameters())
|
||||
.limit(lastIndex+1)
|
||||
return FluentIterable.from(parameters)
|
||||
.transform(PARAMETER_ANNOTATIONS).iterator();
|
||||
}
|
||||
|
||||
@Override public int size() {
|
||||
return lastIndex+1;
|
||||
return parameters.size();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -371,18 +371,18 @@ public class ClassPool implements ClassSection<CharSequence, CharSequence,
|
||||
|
||||
@Nullable @Override public List<? extends Set<? extends Annotation>> getParameterAnnotations(
|
||||
@Nonnull final PoolMethod method) {
|
||||
final int lastIndex = CollectionUtils.lastIndexOf(method.getParameters(), HAS_PARAMETER_ANNOTATIONS);
|
||||
final List<? extends MethodParameter> parameters = method.getParameters();
|
||||
boolean hasParameterAnnotations = Iterables.any(parameters, HAS_PARAMETER_ANNOTATIONS);
|
||||
|
||||
if (lastIndex > -1) {
|
||||
if (hasParameterAnnotations) {
|
||||
return new AbstractForwardSequentialList<Set<? extends Annotation>>() {
|
||||
@Nonnull @Override public Iterator<Set<? extends Annotation>> iterator() {
|
||||
return FluentIterable.from(method.getParameters())
|
||||
.limit(lastIndex+1)
|
||||
return FluentIterable.from(parameters)
|
||||
.transform(PARAMETER_ANNOTATIONS).iterator();
|
||||
}
|
||||
|
||||
@Override public int size() {
|
||||
return lastIndex+1;
|
||||
return parameters.size();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user