From 3299793c8a5b764aaf66dcc1d875efe6541ec1a1 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 6 Jan 2020 11:30:05 +0100 Subject: [PATCH] Polish [Simple]AliasRegistry[Tests] --- .../java/org/springframework/core/AliasRegistry.java | 6 +++--- .../org/springframework/core/SimpleAliasRegistry.java | 10 +++++----- .../springframework/core/SimpleAliasRegistryTests.java | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/AliasRegistry.java b/spring-core/src/main/java/org/springframework/core/AliasRegistry.java index 3fb47cb12a..689b3aeea9 100644 --- a/spring-core/src/main/java/org/springframework/core/AliasRegistry.java +++ b/spring-core/src/main/java/org/springframework/core/AliasRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2020 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. @@ -17,7 +17,7 @@ package org.springframework.core; /** - * Common interface for managing aliases. Serves as super-interface for + * Common interface for managing aliases. Serves as a super-interface for * {@link org.springframework.beans.factory.support.BeanDefinitionRegistry}. * * @author Juergen Hoeller @@ -42,7 +42,7 @@ public interface AliasRegistry { void removeAlias(String alias); /** - * Determine whether this given name is defines as an alias + * Determine whether the given name is defined as an alias * (as opposed to the name of an actually registered component). * @param name the name to check * @return whether the given name is an alias diff --git a/spring-core/src/main/java/org/springframework/core/SimpleAliasRegistry.java b/spring-core/src/main/java/org/springframework/core/SimpleAliasRegistry.java index 9e2cae75a9..1eee8f2c3a 100644 --- a/spring-core/src/main/java/org/springframework/core/SimpleAliasRegistry.java +++ b/spring-core/src/main/java/org/springframework/core/SimpleAliasRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 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. @@ -32,7 +32,7 @@ import org.springframework.util.StringValueResolver; /** * Simple implementation of the {@link AliasRegistry} interface. - * Serves as base class for + *

Serves as base class for * {@link org.springframework.beans.factory.support.BeanDefinitionRegistry} * implementations. * @@ -86,8 +86,8 @@ public class SimpleAliasRegistry implements AliasRegistry { } /** - * Return whether alias overriding is allowed. - * Default is {@code true}. + * Determine whether alias overriding is allowed. + *

Default is {@code true}. */ protected boolean allowAliasOverriding() { return true; @@ -145,7 +145,7 @@ public class SimpleAliasRegistry implements AliasRegistry { /** * Resolve all alias target names and aliases registered in this - * factory, applying the given StringValueResolver to them. + * registry, applying the given {@link StringValueResolver} to them. *

The value resolver may for example resolve placeholders * in target bean names and even in alias names. * @param valueResolver the StringValueResolver to apply diff --git a/spring-core/src/test/java/org/springframework/core/SimpleAliasRegistryTests.java b/spring-core/src/test/java/org/springframework/core/SimpleAliasRegistryTests.java index 802b705c98..5e679128cc 100644 --- a/spring-core/src/test/java/org/springframework/core/SimpleAliasRegistryTests.java +++ b/spring-core/src/test/java/org/springframework/core/SimpleAliasRegistryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 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. @@ -35,13 +35,13 @@ class SimpleAliasRegistryTests { assertThat(registry.hasAlias("test", "testAlias")).isTrue(); assertThat(registry.hasAlias("test", "testAlias2")).isTrue(); assertThat(registry.hasAlias("test", "testAlias3")).isTrue(); - assertThat(registry.canonicalName("testAlias")).isSameAs("test"); - assertThat(registry.canonicalName("testAlias2")).isSameAs("test"); - assertThat(registry.canonicalName("testAlias3")).isSameAs("test"); + assertThat(registry.canonicalName("testAlias")).isEqualTo("test"); + assertThat(registry.canonicalName("testAlias2")).isEqualTo("test"); + assertThat(registry.canonicalName("testAlias3")).isEqualTo("test"); } @Test // SPR-17191 - void testAliasChainingWithMultipleAliases() { + void aliasChainingWithMultipleAliases() { SimpleAliasRegistry registry = new SimpleAliasRegistry(); registry.registerAlias("name", "alias_a"); registry.registerAlias("name", "alias_b");