Small fixes for #758 (#1057)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This commit is contained in:
Bogdan Drutu 2020-03-30 21:33:19 -07:00 committed by GitHub
parent 46ee284b0a
commit 1f97c4bce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 6 deletions

View File

@ -36,7 +36,6 @@ public final class BooleanAttributeSetter {
private final String attributeKey;
private BooleanAttributeSetter(String attributeKey) {
super();
if (attributeKey == null || attributeKey.length() == 0) {
throw new IllegalArgumentException("attributeKey cannot be empty");
}

View File

@ -36,7 +36,6 @@ public final class DoubleAttributeSetter {
private final String attributeKey;
private DoubleAttributeSetter(String attributeKey) {
super();
if (attributeKey == null || attributeKey.length() == 0) {
throw new IllegalArgumentException("attributeKey cannot be empty");
}

View File

@ -36,7 +36,6 @@ public final class LongAttributeSetter {
private final String attributeKey;
private LongAttributeSetter(String attributeKey) {
super();
if (attributeKey == null || attributeKey.length() == 0) {
throw new IllegalArgumentException("attributeKey cannot be empty");
}

View File

@ -37,7 +37,6 @@ public final class StringAttributeSetter {
private final String attributeKey;
private StringAttributeSetter(String attributeKey) {
super();
if (attributeKey == null || attributeKey.length() == 0) {
throw new IllegalArgumentException("attributeKey cannot be empty");
}

View File

@ -45,8 +45,8 @@ public class SemanticAttributesTest {
public void shouldEnableSetAttributeOnSpan() throws IllegalAccessException {
Set<String> keys = new HashSet<>();
Field[] fields = SemanticAttributes.class.getFields();
for (int i = 0; i < fields.length; i++) {
Object attribute = fields[i].get(null);
for (Field field : fields) {
Object attribute = field.get(null);
if (attribute instanceof StringAttributeSetter) {
keys.add(((StringAttributeSetter) attribute).key());
((StringAttributeSetter) attribute).set(span, "TestValue");