From 5345a139186f44cbb73f841a1124efe652eea667 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Sun, 10 Mar 2024 12:36:08 +0100 Subject: [PATCH] Polish contribution See gh-32405 --- .../springframework/core/convert/TypeDescriptor.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java index df1a829ba381..c23f98964442 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java +++ b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 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. @@ -742,9 +742,9 @@ public static TypeDescriptor nested(Property property, int nestingLevel) { * @see AnnotatedElementUtils#getMergedAnnotation(AnnotatedElement, Class) */ private static final class AnnotatedElementAdapter implements AnnotatedElement, Serializable { + private static final AnnotatedElementAdapter EMPTY = new AnnotatedElementAdapter(new Annotation[0]); - @NonNull private final Annotation[] annotations; private AnnotatedElementAdapter(@NonNull Annotation[] annotations) { @@ -782,7 +782,7 @@ public T getAnnotation(Class annotationClass) { @Override public Annotation[] getAnnotations() { - return isEmpty() ? this.annotations : this.annotations.clone(); + return (isEmpty() ? this.annotations : this.annotations.clone()); } @Override @@ -791,7 +791,7 @@ public Annotation[] getDeclaredAnnotations() { } public boolean isEmpty() { - return this.annotations.length == 0; + return (this.annotations.length == 0); } @Override @@ -807,7 +807,7 @@ public int hashCode() { @Override public String toString() { - return "{AnnotatedElementAdapter annotations=" + Arrays.toString(this.annotations) + "}"; + return "AnnotatedElementAdapter annotations=" + Arrays.toString(this.annotations); } }