Skip to content

Commit

Permalink
refactor: remove redundant type cast; add final to parameters for c…
Browse files Browse the repository at this point in the history
…onsistency
  • Loading branch information
oldratlee committed Mar 24, 2024
1 parent dfccdea commit 931c7b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface Wrapper<T> {
* otherwise return {@code true}
* @throws NullPointerException if any arguments is null
*/
static <W> boolean isInstanceOf(W wrapper, Class<?> clazz) {
static <W> boolean isInstanceOf(final W wrapper, final Class<?> clazz) {
requireNonNull(wrapper, "wrapper is null");
requireNonNull(clazz, "clazz is null");
return inspect(wrapper, w -> clazz.isAssignableFrom(w.getClass()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AttachableDelegate<K, V> implements Attachable<K, V> {
* Sets an attachment.
*/
@Override
public void setAttachment(K key, V value) {
public void setAttachment(final K key, final V value) {
requireNonNull(key, "key is null");
requireNonNull(value, "value is null");
attachments.put(key, value);
Expand All @@ -44,8 +44,8 @@ public void setAttachment(K key, V value) {
*/
@Nullable
@Override
public V getAttachment(K key) {
public V getAttachment(final K key) {
requireNonNull(key, "key is null");
return (V) attachments.get(key);
return attachments.get(key);
}
}

0 comments on commit 931c7b6

Please sign in to comment.