diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java index 8a0956d8f0e..ec5356e6a79 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -350,7 +350,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp else { String scopeName = mbd.getScope(); if (!StringUtils.hasLength(scopeName)) { - throw new IllegalStateException("No scope name defined for bean ยด" + beanName + "'"); + throw new IllegalStateException("No scope name defined for bean '" + beanName + "'"); } Scope scope = this.scopes.get(scopeName); if (scope == null) { diff --git a/spring-expression/src/main/java/org/springframework/expression/BeanResolver.java b/spring-expression/src/main/java/org/springframework/expression/BeanResolver.java index eabeb9f495b..7530c36f6ee 100644 --- a/spring-expression/src/main/java/org/springframework/expression/BeanResolver.java +++ b/spring-expression/src/main/java/org/springframework/expression/BeanResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 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. @@ -19,7 +19,7 @@ package org.springframework.expression; /** * A bean resolver can be registered with the evaluation context and will kick in * for bean references: {@code @myBeanName} and {@code &myBeanName} expressions. - * The & variant syntax allows access to the factory bean where relevant. + * The {@code &} variant syntax allows access to the factory bean where relevant. * * @author Andy Clement * @since 3.0.3 @@ -28,7 +28,7 @@ public interface BeanResolver { /** * Look up a bean by the given name and return a corresponding instance for it. - * For attempting access to a factory bean, the name needs a & prefix. + * For attempting access to a factory bean, the name needs a {@code &} prefix. * @param context the current evaluation context * @param beanName the name of the bean to look up * @return an object representing the bean diff --git a/spring-expression/src/main/java/org/springframework/expression/TypeComparator.java b/spring-expression/src/main/java/org/springframework/expression/TypeComparator.java index 7696cd7f6dc..88d07d39fb8 100644 --- a/spring-expression/src/main/java/org/springframework/expression/TypeComparator.java +++ b/spring-expression/src/main/java/org/springframework/expression/TypeComparator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2021 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. @@ -40,10 +40,11 @@ public interface TypeComparator { * Compare two given objects. * @param firstObject the first object * @param secondObject the second object - * @return 0 if they are equal, <0 if the first is smaller than the second, - * or >0 if the first is larger than the second + * @return 0 if they are equal, a negative integer if the first is smaller than + * the second, or a positive integer if the first is larger than the second * @throws EvaluationException if a problem occurs during comparison * (or if they are not comparable in the first place) + * @see Comparable#compareTo */ int compare(@Nullable Object firstObject, @Nullable Object secondObject) throws EvaluationException; diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/ast/BeanReference.java b/spring-expression/src/main/java/org/springframework/expression/spel/ast/BeanReference.java index a59d98250fb..5f1d2adeb31 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/ast/BeanReference.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/ast/BeanReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 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. @@ -25,8 +25,8 @@ import org.springframework.expression.spel.SpelEvaluationException; import org.springframework.expression.spel.SpelMessage; /** - * Represents a bean reference to a type, for example @foo or @'foo.bar'. - * For a FactoryBean the syntax &foo can be used to access the factory itself. + * Represents a bean reference to a type, for example {@code @foo} or {@code @'foo.bar'}. + * For a FactoryBean the syntax {@code &foo} can be used to access the factory itself. * * @author Andy Clement */ @@ -64,13 +64,13 @@ public class BeanReference extends SpelNodeImpl { public String toStringAST() { StringBuilder sb = new StringBuilder(); if (!this.beanName.startsWith(FACTORY_BEAN_PREFIX)) { - sb.append("@"); + sb.append('@'); } if (!this.beanName.contains(".")) { sb.append(this.beanName); } else { - sb.append("'").append(this.beanName).append("'"); + sb.append('\'').append(this.beanName).append('\''); } return sb.toString(); }