blob: 7c0dcd20ea964082089dac26a1749592dfe89d67 [file] [log] [blame]
// Copyright (c) 2020, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.graph;
import static com.android.tools.r8.graph.GenericSignature.ClassSignature.NO_CLASS_SIGNATURE;
import static com.android.tools.r8.graph.GenericSignature.MethodTypeSignature.NO_METHOD_TYPE_SIGNATURE;
import static com.android.tools.r8.graph.GenericSignature.NO_FIELD_TYPE_SIGNATURE;
import com.android.tools.r8.graph.GenericSignature.DexDefinitionSignature;
public class GenericSignatureUtils {
public static boolean verifyNoDuplicateGenericDefinitions(
DexDefinitionSignature<?> signature, DexAnnotationSet annotations) {
assert signature != null;
if (signature == NO_METHOD_TYPE_SIGNATURE
|| signature == NO_FIELD_TYPE_SIGNATURE
|| signature == NO_CLASS_SIGNATURE
|| annotations == null) {
return true;
}
// The check is on the string descriptor to allow for not passing in a factory.
for (DexAnnotation annotation : annotations.annotations) {
assert !annotation
.getAnnotationType()
.descriptor
.toString()
.equals(DexItemFactory.dalvikAnnotationSignatureString);
}
return true;
}
}