Skip to content

Commit 541dbd8

Browse files
Add annotationExists method
1 parent 32084ae commit 541dbd8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCGenericTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,15 +509,19 @@ else if (!paramFullType.contains(">")) {
509509
assertTrue("The following RPCs don't have a constructor that has all the mandatory params: " + rpcsWithInvalidConstructor, rpcsWithInvalidConstructor.isEmpty());
510510
}
511511

512-
private boolean isDeprecated (AnnotatedElement element) {
512+
private boolean annotationExists (AnnotatedElement element, String annotationName) {
513513
for (Annotation annotation : element.getDeclaredAnnotations()) {
514-
if (annotation.annotationType().getSimpleName().equalsIgnoreCase("deprecated")) {
514+
if (annotation.annotationType().getSimpleName().equalsIgnoreCase(annotationName)) {
515515
return true;
516516
}
517517
}
518518
return false;
519519
}
520520

521+
private boolean isDeprecated (AnnotatedElement element) {
522+
return annotationExists(element, "deprecated");
523+
}
524+
521525
private Field getEnumField(Class aClass, String elementName) {
522526
Field field = null;
523527
for (Object anEnum : EnumSet.allOf(aClass)) {

0 commit comments

Comments
 (0)