Skip to content

Commit

Permalink
Remove obsolete AttributeMethods.hasOnlyValueAttribute() method
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen authored and mdeinum committed Jun 29, 2023
1 parent 4c24bfd commit 369889b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
Expand Up @@ -86,17 +86,6 @@ private AttributeMethods(@Nullable Class<? extends Annotation> annotationType, M
}


/**
* Determine if this instance only contains a single attribute named
* {@code value}.
* @return {@code true} if there is only a value attribute
*/
boolean hasOnlyValueAttribute() {
return (this.attributeMethods.length == 1 &&
MergedAnnotation.VALUE.equals(this.attributeMethods[0].getName()));
}


/**
* Determine if values from the given annotation can be safely accessed without
* causing any {@link TypeNotPresentException TypeNotPresentExceptions}.
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -58,24 +58,6 @@ void forAnnotationTypeWhenHasMultipleAttributesReturnsAttributes() {
assertThat(getAll(methods)).flatExtracting(Method::getName).containsExactly("intValue", "value");
}

@Test
void hasOnlyValueAttributeWhenHasOnlyValueAttributeReturnsTrue() {
AttributeMethods methods = AttributeMethods.forAnnotationType(ValueOnly.class);
assertThat(methods.hasOnlyValueAttribute()).isTrue();
}

@Test
void hasOnlyValueAttributeWhenHasOnlySingleNonValueAttributeReturnsFalse() {
AttributeMethods methods = AttributeMethods.forAnnotationType(NonValueOnly.class);
assertThat(methods.hasOnlyValueAttribute()).isFalse();
}

@Test
void hasOnlyValueAttributeWhenHasOnlyMultipleAttributesIncludingValueReturnsFalse() {
AttributeMethods methods = AttributeMethods.forAnnotationType(MultipleAttributes.class);
assertThat(methods.hasOnlyValueAttribute()).isFalse();
}

@Test
void indexOfNameReturnsIndex() {
AttributeMethods methods = AttributeMethods.forAnnotationType(MultipleAttributes.class);
Expand Down

0 comments on commit 369889b

Please sign in to comment.