Consistently use tabs rather than spaces

Update code that has accidentally used spaces instead of tabs.
Also remove all trailing whitespace.

Issue: SPR-16968
This commit is contained in:
Phillip Webb
2018-06-18 14:42:00 -07:00
committed by Juergen Hoeller
parent be85bd8e09
commit 5cedd0d5d4
110 changed files with 527 additions and 526 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ package org.aopalliance.aop;
* Superclass for all AOP infrastructure exceptions. * Superclass for all AOP infrastructure exceptions.
* Unchecked, as such exceptions are fatal and end user * Unchecked, as such exceptions are fatal and end user
* code shouldn't be forced to catch them. * code shouldn't be forced to catch them.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Bob Lee * @author Bob Lee
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -30,12 +30,12 @@ import java.lang.reflect.Constructor;
*/ */
public interface ConstructorInvocation extends Invocation { public interface ConstructorInvocation extends Invocation {
/** /**
* Get the constructor being called. * Get the constructor being called.
* <p>This method is a friendly implementation of the * <p>This method is a friendly implementation of the
* {@link Joinpoint#getStaticPart()} method (same result). * {@link Joinpoint#getStaticPart()} method (same result).
* @return the constructor being called * @return the constructor being called
*/ */
Constructor<?> getConstructor(); Constructor<?> getConstructor();
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import org.aopalliance.aop.Advice;
* <p>A generic interceptor can intercept runtime events that occur * <p>A generic interceptor can intercept runtime events that occur
* within a base program. Those events are materialized by (reified * within a base program. Those events are materialized by (reified
* in) joinpoints. Runtime joinpoints can be invocations, field * in) joinpoints. Runtime joinpoints can be invocations, field
* access, exceptions... * access, exceptions...
* *
* <p>This interface is not used directly. Use the sub-interfaces * <p>This interface is not used directly. Use the sub-interfaces
* to intercept specific events. For instance, the following class * to intercept specific events. For instance, the following class
@@ -32,7 +32,7 @@ import org.aopalliance.aop.Advice;
* debugger: * debugger:
* *
* <pre class=code> * <pre class=code>
* class DebuggingInterceptor implements MethodInterceptor, * class DebuggingInterceptor implements MethodInterceptor,
* ConstructorInterceptor, FieldInterceptor { * ConstructorInterceptor, FieldInterceptor {
* *
* Object invoke(MethodInvocation i) throws Throwable { * Object invoke(MethodInvocation i) throws Throwable {
@@ -44,7 +44,7 @@ import org.aopalliance.aop.Advice;
* debug(i.getConstructor(), i.getThis(), i.getArgs()); * debug(i.getConstructor(), i.getThis(), i.getArgs());
* return i.proceed(); * return i.proceed();
* } * }
* *
* Object get(FieldAccess fa) throws Throwable { * Object get(FieldAccess fa) throws Throwable {
* debug(fa.getField(), fa.getThis(), null); * debug(fa.getField(), fa.getThis(), null);
* return fa.proceed(); * return fa.proceed();

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ package org.aopalliance.intercept;
*/ */
@FunctionalInterface @FunctionalInterface
public interface MethodInterceptor extends Interceptor { public interface MethodInterceptor extends Interceptor {
/** /**
* Implement this method to perform extra treatments before and * Implement this method to perform extra treatments before and
* after the invocation. Polite implementations would certainly * after the invocation. Polite implementations would certainly

View File

@@ -66,7 +66,7 @@ public abstract class AspectJProxyUtils {
return (advisor instanceof InstantiationModelAwarePointcutAdvisor || return (advisor instanceof InstantiationModelAwarePointcutAdvisor ||
advisor.getAdvice() instanceof AbstractAspectJAdvice || advisor.getAdvice() instanceof AbstractAspectJAdvice ||
(advisor instanceof PointcutAdvisor && (advisor instanceof PointcutAdvisor &&
((PointcutAdvisor) advisor).getPointcut() instanceof AspectJExpressionPointcut)); ((PointcutAdvisor) advisor).getPointcut() instanceof AspectJExpressionPointcut));
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public class AdvisorComponentDefinition extends AbstractComponentDefinition {
public AdvisorComponentDefinition(String advisorBeanName, BeanDefinition advisorDefinition) { public AdvisorComponentDefinition(String advisorBeanName, BeanDefinition advisorDefinition) {
this(advisorBeanName, advisorDefinition, null); this(advisorBeanName, advisorDefinition, null);
} }
public AdvisorComponentDefinition( public AdvisorComponentDefinition(

View File

@@ -113,8 +113,8 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
for (Class<?> ifc : this.interfaces) { for (Class<?> ifc : this.interfaces) {
if (this.advice instanceof DynamicIntroductionAdvice && if (this.advice instanceof DynamicIntroductionAdvice &&
!((DynamicIntroductionAdvice) this.advice).implementsInterface(ifc)) { !((DynamicIntroductionAdvice) this.advice).implementsInterface(ifc)) {
throw new IllegalArgumentException("DynamicIntroductionAdvice [" + this.advice + "] " + throw new IllegalArgumentException("DynamicIntroductionAdvice [" + this.advice + "] " +
"does not implement interface [" + ifc.getName() + "] specified for introduction"); "does not implement interface [" + ifc.getName() + "] specified for introduction");
} }
} }
} }

View File

@@ -69,9 +69,9 @@ public class TypeMismatchException extends PropertyAccessException {
"Failed to convert property value of type '" + "Failed to convert property value of type '" +
ClassUtils.getDescriptiveType(propertyChangeEvent.getNewValue()) + "'" + ClassUtils.getDescriptiveType(propertyChangeEvent.getNewValue()) + "'" +
(requiredType != null ? (requiredType != null ?
" to required type '" + ClassUtils.getQualifiedName(requiredType) + "'" : "") + " to required type '" + ClassUtils.getQualifiedName(requiredType) + "'" : "") +
(propertyChangeEvent.getPropertyName() != null ? (propertyChangeEvent.getPropertyName() != null ?
" for property '" + propertyChangeEvent.getPropertyName() + "'" : ""), " for property '" + propertyChangeEvent.getPropertyName() + "'" : ""),
cause); cause);
this.propertyName = propertyChangeEvent.getPropertyName(); this.propertyName = propertyChangeEvent.getPropertyName();
this.value = propertyChangeEvent.getNewValue(); this.value = propertyChangeEvent.getNewValue();

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -96,7 +96,7 @@ public class AnnotatedGenericBeanDefinition extends GenericBeanDefinition implem
@Override @Override
public final AnnotationMetadata getMetadata() { public final AnnotationMetadata getMetadata() {
return this.metadata; return this.metadata;
} }
@Override @Override

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -58,15 +58,15 @@ abstract class AutowireUtils {
*/ */
public static void sortConstructors(Constructor<?>[] constructors) { public static void sortConstructors(Constructor<?>[] constructors) {
Arrays.sort(constructors, (c1, c2) -> { Arrays.sort(constructors, (c1, c2) -> {
boolean p1 = Modifier.isPublic(c1.getModifiers()); boolean p1 = Modifier.isPublic(c1.getModifiers());
boolean p2 = Modifier.isPublic(c2.getModifiers()); boolean p2 = Modifier.isPublic(c2.getModifiers());
if (p1 != p2) { if (p1 != p2) {
return (p1 ? -1 : 1); return (p1 ? -1 : 1);
} }
int c1pl = c1.getParameterCount(); int c1pl = c1.getParameterCount();
int c2pl = c2.getParameterCount(); int c2pl = c2.getParameterCount();
return (c1pl < c2pl ? 1 : (c1pl > c2pl ? -1 : 0)); return (c1pl < c2pl ? 1 : (c1pl > c2pl ? -1 : 0));
}); });
} }
/** /**
@@ -78,15 +78,15 @@ abstract class AutowireUtils {
*/ */
public static void sortFactoryMethods(Method[] factoryMethods) { public static void sortFactoryMethods(Method[] factoryMethods) {
Arrays.sort(factoryMethods, (fm1, fm2) -> { Arrays.sort(factoryMethods, (fm1, fm2) -> {
boolean p1 = Modifier.isPublic(fm1.getModifiers()); boolean p1 = Modifier.isPublic(fm1.getModifiers());
boolean p2 = Modifier.isPublic(fm2.getModifiers()); boolean p2 = Modifier.isPublic(fm2.getModifiers());
if (p1 != p2) { if (p1 != p2) {
return (p1 ? -1 : 1); return (p1 ? -1 : 1);
} }
int c1pl = fm1.getParameterCount(); int c1pl = fm1.getParameterCount();
int c2pl = fm2.getParameterCount(); int c2pl = fm2.getParameterCount();
return (c1pl < c2pl ? 1 : (c1pl > c2pl ? -1 : 0)); return (c1pl < c2pl ? 1 : (c1pl > c2pl ? -1 : 0));
}); });
} }
/** /**

View File

@@ -78,7 +78,7 @@ public class BeanConfigurerSupport implements BeanFactoryAware, InitializingBean
public void setBeanFactory(BeanFactory beanFactory) { public void setBeanFactory(BeanFactory beanFactory) {
if (!(beanFactory instanceof ConfigurableListableBeanFactory)) { if (!(beanFactory instanceof ConfigurableListableBeanFactory)) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Bean configurer aspect needs to run in a ConfigurableListableBeanFactory: " + beanFactory); "Bean configurer aspect needs to run in a ConfigurableListableBeanFactory: " + beanFactory);
} }
this.beanFactory = (ConfigurableListableBeanFactory) beanFactory; this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
if (this.beanWiringInfoResolver == null) { if (this.beanWiringInfoResolver == null) {

View File

@@ -190,7 +190,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe
private DataSource nonTransactionalDataSource; private DataSource nonTransactionalDataSource;
@Nullable @Nullable
private Map<String, ?> schedulerContextMap; private Map<String, ?> schedulerContextMap;
@Nullable @Nullable
private ApplicationContext applicationContext; private ApplicationContext applicationContext;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -122,7 +122,7 @@ public class GenericGroovyApplicationContext extends GenericApplicationContext i
private final BeanWrapper contextWrapper = new BeanWrapperImpl(this); private final BeanWrapper contextWrapper = new BeanWrapperImpl(this);
private MetaClass metaClass = GroovySystem.getMetaClassRegistry().getMetaClass(getClass()); private MetaClass metaClass = GroovySystem.getMetaClassRegistry().getMetaClass(getClass());
/** /**
@@ -229,7 +229,7 @@ public class GenericGroovyApplicationContext extends GenericApplicationContext i
this.metaClass = metaClass; this.metaClass = metaClass;
} }
public MetaClass getMetaClass() { public MetaClass getMetaClass() {
return this.metaClass; return this.metaClass;
} }
@@ -247,7 +247,7 @@ public class GenericGroovyApplicationContext extends GenericApplicationContext i
} }
@Nullable @Nullable
public Object getProperty(String property) { public Object getProperty(String property) {
if (containsBean(property)) { if (containsBean(property)) {
return getBean(property); return getBean(property);
} }

View File

@@ -85,7 +85,7 @@ public final class CharSequenceEncoder extends AbstractEncoder<CharSequence> {
charset = mimeType.getCharset(); charset = mimeType.getCharset();
} }
else { else {
charset = DEFAULT_CHARSET; charset = DEFAULT_CHARSET;
} }
return charset; return charset;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -88,7 +88,7 @@ public abstract class AbstractTypeHierarchyTraversingFilter implements TypeFilte
logger.debug("Could not read super class [" + metadata.getSuperClassName() + logger.debug("Could not read super class [" + metadata.getSuperClassName() +
"] of type-filtered class [" + metadata.getClassName() + "]"); "] of type-filtered class [" + metadata.getClassName() + "]");
} }
} }
} }
} }

View File

@@ -199,7 +199,7 @@ public class ExponentialBackOff implements BackOff {
return maxInterval; return maxInterval;
} }
else if (this.currentInterval < 0) { else if (this.currentInterval < 0) {
long initialInterval = getInitialInterval(); long initialInterval = getInitialInterval();
this.currentInterval = (initialInterval < maxInterval this.currentInterval = (initialInterval < maxInterval
? initialInterval : maxInterval); ? initialInterval : maxInterval);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -27,13 +27,13 @@ import org.springframework.expression.spel.SpelMessage;
/** /**
* Represents a bean reference to a type, for example <tt>@foo</tt> or <tt>@'foo.bar'</tt>. * Represents a bean reference to a type, for example <tt>@foo</tt> or <tt>@'foo.bar'</tt>.
* For a FactoryBean the syntax <tt>&foo</tt> can be used to access the factory itself. * For a FactoryBean the syntax <tt>&foo</tt> can be used to access the factory itself.
* *
* @author Andy Clement * @author Andy Clement
*/ */
public class BeanReference extends SpelNodeImpl { public class BeanReference extends SpelNodeImpl {
private static final String FACTORY_BEAN_PREFIX = "&"; private static final String FACTORY_BEAN_PREFIX = "&";
private final String beanName; private final String beanName;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -42,16 +42,16 @@ public class BooleanLiteral extends Literal {
public BooleanTypedValue getLiteralValue() { public BooleanTypedValue getLiteralValue() {
return this.value; return this.value;
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
return true; return true;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
if (this.value == BooleanTypedValue.TRUE) { if (this.value == BooleanTypedValue.TRUE) {
mv.visitLdcInsn(1); mv.visitLdcInsn(1);
} }
else { else {
mv.visitLdcInsn(0); mv.visitLdcInsn(0);

View File

@@ -161,7 +161,7 @@ public class ConstructorReference extends SpelNodeImpl {
if (executorToUse instanceof ReflectiveConstructorExecutor) { if (executorToUse instanceof ReflectiveConstructorExecutor) {
this.exitTypeDescriptor = CodeFlow.toDescriptor( this.exitTypeDescriptor = CodeFlow.toDescriptor(
((ReflectiveConstructorExecutor) executorToUse).getConstructor().getDeclaringClass()); ((ReflectiveConstructorExecutor) executorToUse).getConstructor().getDeclaringClass());
} }
return executorToUse.execute(state.getEvaluationContext(), arguments); return executorToUse.execute(state.getEvaluationContext(), arguments);
} }
@@ -422,10 +422,10 @@ public class ConstructorReference extends SpelNodeImpl {
private boolean hasInitializer() { private boolean hasInitializer() {
return (getChildCount() > 1); return (getChildCount() > 1);
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
if (!(this.cachedExecutor instanceof ReflectiveConstructorExecutor) || if (!(this.cachedExecutor instanceof ReflectiveConstructorExecutor) ||
this.exitTypeDescriptor == null) { this.exitTypeDescriptor == null) {
return false; return false;
} }
@@ -446,7 +446,7 @@ public class ConstructorReference extends SpelNodeImpl {
return (Modifier.isPublic(constructor.getModifiers()) && return (Modifier.isPublic(constructor.getModifiers()) &&
Modifier.isPublic(constructor.getDeclaringClass().getModifiers())); Modifier.isPublic(constructor.getDeclaringClass().getModifiers()));
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
ReflectiveConstructorExecutor executor = ((ReflectiveConstructorExecutor) this.cachedExecutor); ReflectiveConstructorExecutor executor = ((ReflectiveConstructorExecutor) this.cachedExecutor);
@@ -460,7 +460,7 @@ public class ConstructorReference extends SpelNodeImpl {
// children[0] is the type of the constructor, don't want to include that in argument processing // children[0] is the type of the constructor, don't want to include that in argument processing
SpelNodeImpl[] arguments = new SpelNodeImpl[this.children.length - 1]; SpelNodeImpl[] arguments = new SpelNodeImpl[this.children.length - 1];
System.arraycopy(this.children, 1, arguments, 0, this.children.length - 1); System.arraycopy(this.children, 1, arguments, 0, this.children.length - 1);
generateCodeForArguments(mv, cf, constructor, arguments); generateCodeForArguments(mv, cf, constructor, arguments);
mv.visitMethodInsn(INVOKESPECIAL, classDesc, "<init>", CodeFlow.createSignatureDescriptor(constructor), false); mv.visitMethodInsn(INVOKESPECIAL, classDesc, "<init>", CodeFlow.createSignatureDescriptor(constructor), false);
cf.pushDescriptor(this.exitTypeDescriptor); cf.pushDescriptor(this.exitTypeDescriptor);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ public class FloatLiteral extends Literal {
public boolean isCompilable() { public boolean isCompilable() {
return true; return true;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
mv.visitLdcInsn(this.value.getValue()); mv.visitLdcInsn(this.value.getValue());

View File

@@ -163,7 +163,7 @@ public class FunctionReference extends SpelNodeImpl {
} }
return arguments; return arguments;
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
Method method = this.method; Method method = this.method;
@@ -182,8 +182,8 @@ public class FunctionReference extends SpelNodeImpl {
} }
return true; return true;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
Method method = this.method; Method method = this.method;
Assert.state(method != null, "No method handle"); Assert.state(method != null, "No method handle");

View File

@@ -190,7 +190,7 @@ public class Indexer extends SpelNodeImpl {
throw new SpelEvaluationException( throw new SpelEvaluationException(
getStartPosition(), SpelMessage.INDEXING_NOT_SUPPORTED_FOR_TYPE, targetDescriptor); getStartPosition(), SpelMessage.INDEXING_NOT_SUPPORTED_FOR_TYPE, targetDescriptor);
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
if (this.indexedType == IndexedType.ARRAY) { if (this.indexedType == IndexedType.ARRAY) {
@@ -210,7 +210,7 @@ public class Indexer extends SpelNodeImpl {
} }
return false; return false;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
String descriptor = cf.lastDescriptor(); String descriptor = cf.lastDescriptor();
@@ -249,7 +249,7 @@ public class Indexer extends SpelNodeImpl {
mv.visitTypeInsn(CHECKCAST, "[C"); mv.visitTypeInsn(CHECKCAST, "[C");
insn = CALOAD; insn = CALOAD;
} }
else { else {
mv.visitTypeInsn(CHECKCAST, "["+ this.exitTypeDescriptor + mv.visitTypeInsn(CHECKCAST, "["+ this.exitTypeDescriptor +
(CodeFlow.isPrimitiveArray(this.exitTypeDescriptor) ? "" : ";")); (CodeFlow.isPrimitiveArray(this.exitTypeDescriptor) ? "" : ";"));
//depthPlusOne(exitTypeDescriptor)+"Ljava/lang/Object;"); //depthPlusOne(exitTypeDescriptor)+"Ljava/lang/Object;");
@@ -286,7 +286,7 @@ public class Indexer extends SpelNodeImpl {
} }
mv.visitMethodInsn( mv.visitMethodInsn(
INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true); INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);
} }
else if (this.indexedType == IndexedType.OBJECT) { else if (this.indexedType == IndexedType.OBJECT) {
ReflectivePropertyAccessor.OptimalPropertyAccessor accessor = ReflectivePropertyAccessor.OptimalPropertyAccessor accessor =
@@ -313,7 +313,7 @@ public class Indexer extends SpelNodeImpl {
mv.visitFieldInsn((isStatic ? GETSTATIC : GETFIELD), classDesc, member.getName(), mv.visitFieldInsn((isStatic ? GETSTATIC : GETFIELD), classDesc, member.getName(),
CodeFlow.toJvmDescriptor(((Field) member).getType())); CodeFlow.toJvmDescriptor(((Field) member).getType()));
} }
} }
cf.pushDescriptor(this.exitTypeDescriptor); cf.pushDescriptor(this.exitTypeDescriptor);
} }

View File

@@ -128,12 +128,12 @@ public class InlineList extends SpelNodeImpl {
Assert.state(this.constant != null, "No constant"); Assert.state(this.constant != null, "No constant");
return (List<Object>) this.constant.getValue(); return (List<Object>) this.constant.getValue();
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
return isConstant(); return isConstant();
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow codeflow) { public void generateCode(MethodVisitor mv, CodeFlow codeflow) {
final String constantFieldName = "inlineList$" + codeflow.nextFieldId(); final String constantFieldName = "inlineList$" + codeflow.nextFieldId();
@@ -144,11 +144,11 @@ public class InlineList extends SpelNodeImpl {
codeflow.registerNewClinit((mVisitor, cflow) -> codeflow.registerNewClinit((mVisitor, cflow) ->
generateClinitCode(className, constantFieldName, mVisitor, cflow, false)); generateClinitCode(className, constantFieldName, mVisitor, cflow, false));
mv.visitFieldInsn(GETSTATIC, className, constantFieldName, "Ljava/util/List;"); mv.visitFieldInsn(GETSTATIC, className, constantFieldName, "Ljava/util/List;");
codeflow.pushDescriptor("Ljava/util/List"); codeflow.pushDescriptor("Ljava/util/List");
} }
void generateClinitCode(String clazzname, String constantFieldName, MethodVisitor mv, CodeFlow codeflow, boolean nested) { void generateClinitCode(String clazzname, String constantFieldName, MethodVisitor mv, CodeFlow codeflow, boolean nested) {
mv.visitTypeInsn(NEW, "java/util/ArrayList"); mv.visitTypeInsn(NEW, "java/util/ArrayList");
mv.visitInsn(DUP); mv.visitInsn(DUP);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -70,7 +70,7 @@ public class InlineMap extends SpelNodeImpl {
break; break;
} }
} }
else if (!((c%2)==0 && (child instanceof PropertyOrFieldReference))) { else if (!((c%2)==0 && (child instanceof PropertyOrFieldReference))) {
isConstant = false; isConstant = false;
break; break;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ public class IntLiteral extends Literal {
public boolean isCompilable() { public boolean isCompilable() {
return true; return true;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
Integer intValue = (Integer) this.value.getValue(); Integer intValue = (Integer) this.value.getValue();

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -42,12 +42,12 @@ public class LongLiteral extends Literal {
public TypedValue getLiteralValue() { public TypedValue getLiteralValue() {
return this.value; return this.value;
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
return true; return true;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
mv.visitLdcInsn(this.value.getValue()); mv.visitLdcInsn(this.value.getValue());

View File

@@ -301,7 +301,7 @@ public class MethodReference extends SpelNodeImpl {
return true; return true;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
CachedMethodExecutor executorToCheck = this.cachedExecutor; CachedMethodExecutor executorToCheck = this.cachedExecutor;
@@ -332,7 +332,7 @@ public class MethodReference extends SpelNodeImpl {
// Something on the stack when nothing is needed // Something on the stack when nothing is needed
mv.visitInsn(POP); mv.visitInsn(POP);
} }
if (CodeFlow.isPrimitive(descriptor)) { if (CodeFlow.isPrimitive(descriptor)) {
CodeFlow.insertBoxIfNecessary(mv, descriptor.charAt(0)); CodeFlow.insertBoxIfNecessary(mv, descriptor.charAt(0));
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ public class NullLiteral extends Literal {
public boolean isCompilable() { public boolean isCompilable() {
return true; return true;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
mv.visitInsn(ACONST_NULL); mv.visitInsn(ACONST_NULL);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ public class OpAnd extends Operator {
CodeFlow.isBooleanCompatible(left.exitTypeDescriptor) && CodeFlow.isBooleanCompatible(left.exitTypeDescriptor) &&
CodeFlow.isBooleanCompatible(right.exitTypeDescriptor)); CodeFlow.isBooleanCompatible(right.exitTypeDescriptor));
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
// Pseudo: if (!leftOperandValue) { result=false; } else { result=rightOperandValue; } // Pseudo: if (!leftOperandValue) { result=false; } else { result=rightOperandValue; }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -95,13 +95,13 @@ public class OpDivide extends Operator {
return false; return false;
} }
if (this.children.length > 1) { if (this.children.length > 1) {
if (!getRightOperand().isCompilable()) { if (!getRightOperand().isCompilable()) {
return false; return false;
} }
} }
return (this.exitTypeDescriptor != null); return (this.exitTypeDescriptor != null);
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
getLeftOperand().generateCode(mv, cf); getLeftOperand().generateCode(mv, cf);
@@ -123,12 +123,12 @@ public class OpDivide extends Operator {
case 'J': case 'J':
mv.visitInsn(LDIV); mv.visitInsn(LDIV);
break; break;
case 'F': case 'F':
mv.visitInsn(FDIV); mv.visitInsn(FDIV);
break; break;
case 'D': case 'D':
mv.visitInsn(DDIV); mv.visitInsn(DDIV);
break; break;
default: default:
throw new IllegalStateException( throw new IllegalStateException(
"Unrecognized exit type descriptor: '" + this.exitTypeDescriptor + "'"); "Unrecognized exit type descriptor: '" + this.exitTypeDescriptor + "'");

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ public class OpGE extends Operator {
this.leftActualDescriptor = CodeFlow.toDescriptorFromObject(left); this.leftActualDescriptor = CodeFlow.toDescriptorFromObject(left);
this.rightActualDescriptor = CodeFlow.toDescriptorFromObject(right); this.rightActualDescriptor = CodeFlow.toDescriptorFromObject(right);
if (left instanceof Number && right instanceof Number) { if (left instanceof Number && right instanceof Number) {
Number leftNumber = (Number) left; Number leftNumber = (Number) left;
Number rightNumber = (Number) right; Number rightNumber = (Number) right;
@@ -90,12 +90,12 @@ public class OpGE extends Operator {
return BooleanTypedValue.forValue(state.getTypeComparator().compare(left, right) >= 0); return BooleanTypedValue.forValue(state.getTypeComparator().compare(left, right) >= 0);
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
return isCompilableOperatorUsingNumerics(); return isCompilableOperatorUsingNumerics();
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
generateComparisonCode(mv, cf, IFLT, IF_ICMPLT); generateComparisonCode(mv, cf, IFLT, IF_ICMPLT);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ public class OpGT extends Operator {
this.leftActualDescriptor = CodeFlow.toDescriptorFromObject(left); this.leftActualDescriptor = CodeFlow.toDescriptorFromObject(left);
this.rightActualDescriptor = CodeFlow.toDescriptorFromObject(right); this.rightActualDescriptor = CodeFlow.toDescriptorFromObject(right);
if (left instanceof Number && right instanceof Number) { if (left instanceof Number && right instanceof Number) {
Number leftNumber = (Number) left; Number leftNumber = (Number) left;
Number rightNumber = (Number) right; Number rightNumber = (Number) right;
@@ -100,7 +100,7 @@ public class OpGT extends Operator {
public boolean isCompilable() { public boolean isCompilable() {
return isCompilableOperatorUsingNumerics(); return isCompilableOperatorUsingNumerics();
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
generateComparisonCode(mv, cf, IFLE, IF_ICMPLE); generateComparisonCode(mv, cf, IFLE, IF_ICMPLE);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ public class OpLE extends Operator {
this.leftActualDescriptor = CodeFlow.toDescriptorFromObject(left); this.leftActualDescriptor = CodeFlow.toDescriptorFromObject(left);
this.rightActualDescriptor = CodeFlow.toDescriptorFromObject(right); this.rightActualDescriptor = CodeFlow.toDescriptorFromObject(right);
if (left instanceof Number && right instanceof Number) { if (left instanceof Number && right instanceof Number) {
Number leftNumber = (Number) left; Number leftNumber = (Number) left;
Number rightNumber = (Number) right; Number rightNumber = (Number) right;
@@ -90,12 +90,12 @@ public class OpLE extends Operator {
return BooleanTypedValue.forValue(state.getTypeComparator().compare(left, right) <= 0); return BooleanTypedValue.forValue(state.getTypeComparator().compare(left, right) <= 0);
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
return isCompilableOperatorUsingNumerics(); return isCompilableOperatorUsingNumerics();
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
generateComparisonCode(mv, cf, IFGT, IF_ICMPGT); generateComparisonCode(mv, cf, IFGT, IF_ICMPGT);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -95,12 +95,12 @@ public class OpLT extends Operator {
return BooleanTypedValue.forValue(state.getTypeComparator().compare(left, right) < 0); return BooleanTypedValue.forValue(state.getTypeComparator().compare(left, right) < 0);
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
return isCompilableOperatorUsingNumerics(); return isCompilableOperatorUsingNumerics();
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
generateComparisonCode(mv, cf, IFGE, IF_ICMPGE); generateComparisonCode(mv, cf, IFGE, IF_ICMPGE);

View File

@@ -93,9 +93,9 @@ public class OpModulus extends Operator {
return false; return false;
} }
if (this.children.length > 1) { if (this.children.length > 1) {
if (!getRightOperand().isCompilable()) { if (!getRightOperand().isCompilable()) {
return false; return false;
} }
} }
return (this.exitTypeDescriptor != null); return (this.exitTypeDescriptor != null);
} }
@@ -121,12 +121,12 @@ public class OpModulus extends Operator {
case 'J': case 'J':
mv.visitInsn(LREM); mv.visitInsn(LREM);
break; break;
case 'F': case 'F':
mv.visitInsn(FREM); mv.visitInsn(FREM);
break; break;
case 'D': case 'D':
mv.visitInsn(DREM); mv.visitInsn(DREM);
break; break;
default: default:
throw new IllegalStateException( throw new IllegalStateException(
"Unrecognized exit type descriptor: '" + this.exitTypeDescriptor + "'"); "Unrecognized exit type descriptor: '" + this.exitTypeDescriptor + "'");

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -126,13 +126,13 @@ public class OpMultiply extends Operator {
return false; return false;
} }
if (this.children.length > 1) { if (this.children.length > 1) {
if (!getRightOperand().isCompilable()) { if (!getRightOperand().isCompilable()) {
return false; return false;
} }
} }
return (this.exitTypeDescriptor != null); return (this.exitTypeDescriptor != null);
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
getLeftOperand().generateCode(mv, cf); getLeftOperand().generateCode(mv, cf);
@@ -154,12 +154,12 @@ public class OpMultiply extends Operator {
case 'J': case 'J':
mv.visitInsn(LMUL); mv.visitInsn(LMUL);
break; break;
case 'F': case 'F':
mv.visitInsn(FMUL); mv.visitInsn(FMUL);
break; break;
case 'D': case 'D':
mv.visitInsn(DMUL); mv.visitInsn(DMUL);
break; break;
default: default:
throw new IllegalStateException( throw new IllegalStateException(
"Unrecognized exit type descriptor: '" + this.exitTypeDescriptor + "'"); "Unrecognized exit type descriptor: '" + this.exitTypeDescriptor + "'");

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -77,7 +77,7 @@ public class OpOr extends Operator {
CodeFlow.isBooleanCompatible(left.exitTypeDescriptor) && CodeFlow.isBooleanCompatible(left.exitTypeDescriptor) &&
CodeFlow.isBooleanCompatible(right.exitTypeDescriptor)); CodeFlow.isBooleanCompatible(right.exitTypeDescriptor));
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
// pseudo: if (leftOperandValue) { result=true; } else { result=rightOperandValue; } // pseudo: if (leftOperandValue) { result=true; } else { result=rightOperandValue; }
@@ -98,5 +98,5 @@ public class OpOr extends Operator {
mv.visitLabel(endOfIf); mv.visitLabel(endOfIf);
cf.pushDescriptor(this.exitTypeDescriptor); cf.pushDescriptor(this.exitTypeDescriptor);
} }
} }

View File

@@ -178,9 +178,9 @@ public class OpPlus extends Operator {
return false; return false;
} }
if (this.children.length > 1) { if (this.children.length > 1) {
if (!getRightOperand().isCompilable()) { if (!getRightOperand().isCompilable()) {
return false; return false;
} }
} }
return (this.exitTypeDescriptor != null); return (this.exitTypeDescriptor != null);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ public class OperatorInstanceof extends Operator {
@Nullable @Nullable
private Class<?> type; private Class<?> type;
public OperatorInstanceof(int pos, SpelNodeImpl... operands) { public OperatorInstanceof(int pos, SpelNodeImpl... operands) {
super("instanceof", pos, operands); super("instanceof", pos, operands);
@@ -76,7 +76,7 @@ public class OperatorInstanceof extends Operator {
} }
this.type = rightClass; this.type = rightClass;
if (rightOperand instanceof TypeReference) { if (rightOperand instanceof TypeReference) {
// Can only generate bytecode where the right operand is a direct type reference, // Can only generate bytecode where the right operand is a direct type reference,
// not if it is indirect (for example when right operand is a variable reference) // not if it is indirect (for example when right operand is a variable reference)
this.exitTypeDescriptor = "Z"; this.exitTypeDescriptor = "Z";
} }
@@ -87,7 +87,7 @@ public class OperatorInstanceof extends Operator {
public boolean isCompilable() { public boolean isCompilable() {
return (this.exitTypeDescriptor != null && getLeftOperand().isCompilable()); return (this.exitTypeDescriptor != null && getLeftOperand().isCompilable());
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
getLeftOperand().generateCode(mv, cf); getLeftOperand().generateCode(mv, cf);
@@ -98,7 +98,7 @@ public class OperatorInstanceof extends Operator {
// in case it had side effects // in case it had side effects
mv.visitInsn(POP); mv.visitInsn(POP);
mv.visitInsn(ICONST_0); // value of false mv.visitInsn(ICONST_0); // value of false
} }
else { else {
mv.visitTypeInsn(INSTANCEOF, Type.getInternalName(this.type)); mv.visitTypeInsn(INSTANCEOF, Type.getInternalName(this.type));
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -60,20 +60,20 @@ public class OperatorNot extends SpelNodeImpl { // Not is a unary operator so d
public String toStringAST() { public String toStringAST() {
return "!" + getChild(0).toStringAST(); return "!" + getChild(0).toStringAST();
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
SpelNodeImpl child = this.children[0]; SpelNodeImpl child = this.children[0];
return (child.isCompilable() && CodeFlow.isBooleanCompatible(child.exitTypeDescriptor)); return (child.isCompilable() && CodeFlow.isBooleanCompatible(child.exitTypeDescriptor));
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
this.children[0].generateCode(mv, cf); this.children[0].generateCode(mv, cf);
cf.unboxBooleanIfNecessary(mv); cf.unboxBooleanIfNecessary(mv);
Label elseTarget = new Label(); Label elseTarget = new Label();
Label endOfIf = new Label(); Label endOfIf = new Label();
mv.visitJumpInsn(IFNE,elseTarget); mv.visitJumpInsn(IFNE,elseTarget);
mv.visitInsn(ICONST_1); // TRUE mv.visitInsn(ICONST_1); // TRUE
mv.visitJumpInsn(GOTO,endOfIf); mv.visitJumpInsn(GOTO,endOfIf);
mv.visitLabel(elseTarget); mv.visitLabel(elseTarget);

View File

@@ -328,14 +328,14 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
resolvers.addAll(generalAccessors); resolvers.addAll(generalAccessors);
return resolvers; return resolvers;
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
PropertyAccessor accessorToUse = this.cachedReadAccessor; PropertyAccessor accessorToUse = this.cachedReadAccessor;
return (accessorToUse instanceof CompilablePropertyAccessor && return (accessorToUse instanceof CompilablePropertyAccessor &&
((CompilablePropertyAccessor) accessorToUse).isCompilable()); ((CompilablePropertyAccessor) accessorToUse).isCompilable());
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
PropertyAccessor accessorToUse = this.cachedReadAccessor; PropertyAccessor accessorToUse = this.cachedReadAccessor;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public class RealLiteral extends Literal {
public boolean isCompilable() { public boolean isCompilable() {
return true; return true;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
mv.visitLdcInsn(this.value.getValue()); mv.visitLdcInsn(this.value.getValue());

View File

@@ -194,7 +194,7 @@ public abstract class SpelNodeImpl implements SpelNode, Opcodes {
public abstract TypedValue getValueInternal(ExpressionState expressionState) throws EvaluationException; public abstract TypedValue getValueInternal(ExpressionState expressionState) throws EvaluationException;
/** /**
* Generate code that handles building the argument values for the specified method. * Generate code that handles building the argument values for the specified method.
* This method will take account of whether the invoked method is a varargs method * This method will take account of whether the invoked method is a varargs method
@@ -222,12 +222,12 @@ public abstract class SpelNodeImpl implements SpelNode, Opcodes {
// have been passed to satisfy the varargs and so something needs to be built. // have been passed to satisfy the varargs and so something needs to be built.
int p = 0; // Current supplied argument being processed int p = 0; // Current supplied argument being processed
int childCount = arguments.length; int childCount = arguments.length;
// Fulfill all the parameter requirements except the last one // Fulfill all the parameter requirements except the last one
for (p = 0; p < paramDescriptors.length - 1; p++) { for (p = 0; p < paramDescriptors.length - 1; p++) {
generateCodeForArgument(mv, cf, arguments[p], paramDescriptors[p]); generateCodeForArgument(mv, cf, arguments[p], paramDescriptors[p]);
} }
SpelNodeImpl lastChild = (childCount == 0 ? null : arguments[childCount - 1]); SpelNodeImpl lastChild = (childCount == 0 ? null : arguments[childCount - 1]);
String arrayType = paramDescriptors[paramDescriptors.length - 1]; String arrayType = paramDescriptors[paramDescriptors.length - 1];
// Determine if the final passed argument is already suitably packaged in array // Determine if the final passed argument is already suitably packaged in array

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -49,12 +49,12 @@ public class StringLiteral extends Literal {
public String toString() { public String toString() {
return "'" + getLiteralValue().getValue() + "'"; return "'" + getLiteralValue().getValue() + "'";
} }
@Override @Override
public boolean isCompilable() { public boolean isCompilable() {
return true; return true;
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
mv.visitLdcInsn(this.value.getValue()); mv.visitLdcInsn(this.value.getValue());

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -59,7 +59,7 @@ public class Ternary extends SpelNodeImpl {
computeExitTypeDescriptor(); computeExitTypeDescriptor();
return result; return result;
} }
@Override @Override
public String toStringAST() { public String toStringAST() {
return getChild(0).toStringAST() + " ? " + getChild(1).toStringAST() + " : " + getChild(2).toStringAST(); return getChild(0).toStringAST() + " ? " + getChild(1).toStringAST() + " : " + getChild(2).toStringAST();
@@ -89,7 +89,7 @@ public class Ternary extends SpelNodeImpl {
CodeFlow.isBooleanCompatible(condition.exitTypeDescriptor) && CodeFlow.isBooleanCompatible(condition.exitTypeDescriptor) &&
left.exitTypeDescriptor != null && right.exitTypeDescriptor != null); left.exitTypeDescriptor != null && right.exitTypeDescriptor != null);
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
// May reach here without it computed if all elements are literals // May reach here without it computed if all elements are literals

View File

@@ -78,7 +78,7 @@ public class VariableReference extends SpelNodeImpl {
if (value == null || !Modifier.isPublic(value.getClass().getModifiers())) { if (value == null || !Modifier.isPublic(value.getClass().getModifiers())) {
// If the type is not public then when generateCode produces a checkcast to it // If the type is not public then when generateCode produces a checkcast to it
// then an IllegalAccessError will occur. // then an IllegalAccessError will occur.
// If resorting to Object isn't sufficient, the hierarchy could be traversed for // If resorting to Object isn't sufficient, the hierarchy could be traversed for
// the first public type. // the first public type.
this.exitTypeDescriptor = "Ljava/lang/Object"; this.exitTypeDescriptor = "Ljava/lang/Object";
} }
@@ -108,7 +108,7 @@ public class VariableReference extends SpelNodeImpl {
public boolean isCompilable() { public boolean isCompilable() {
return (this.exitTypeDescriptor != null); return (this.exitTypeDescriptor != null);
} }
@Override @Override
public void generateCode(MethodVisitor mv, CodeFlow cf) { public void generateCode(MethodVisitor mv, CodeFlow cf) {
if (this.name.equals(ROOT)) { if (this.name.equals(ROOT)) {

View File

@@ -385,10 +385,10 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@Nullable @Nullable
protected Method findGetterForProperty(String propertyName, Class<?> clazz, boolean mustBeStatic) { protected Method findGetterForProperty(String propertyName, Class<?> clazz, boolean mustBeStatic) {
Method method = findMethodForProperty(getPropertyMethodSuffixes(propertyName), Method method = findMethodForProperty(getPropertyMethodSuffixes(propertyName),
"get", clazz, mustBeStatic, 0, ANY_TYPES); "get", clazz, mustBeStatic, 0, ANY_TYPES);
if (method == null) { if (method == null) {
method = findMethodForProperty(getPropertyMethodSuffixes(propertyName), method = findMethodForProperty(getPropertyMethodSuffixes(propertyName),
"is", clazz, mustBeStatic, 0, BOOLEAN_TYPES); "is", clazz, mustBeStatic, 0, BOOLEAN_TYPES);
} }
return method; return method;
} }

View File

@@ -203,7 +203,7 @@ public class StandardEvaluationContext implements EvaluationContext {
@Override @Override
public TypeConverter getTypeConverter() { public TypeConverter getTypeConverter() {
if (this.typeConverter == null) { if (this.typeConverter == null) {
this.typeConverter = new StandardTypeConverter(); this.typeConverter = new StandardTypeConverter();
} }
return this.typeConverter; return this.typeConverter;
} }

View File

@@ -129,17 +129,17 @@ public interface Log {
void fatal(Object message, Throwable t); void fatal(Object message, Throwable t);
/** /**
* Logs a message with error log level. * Logs a message with error log level.
* @param message log this message * @param message log this message
*/ */
void error(Object message); void error(Object message);
/** /**
* Logs an error with error log level. * Logs an error with error log level.
* @param message log this message * @param message log this message
* @param t log this cause * @param t log this cause
*/ */
void error(Object message, Throwable t); void error(Object message, Throwable t);
/** /**
* Logs a message with warn log level. * Logs a message with warn log level.
@@ -154,18 +154,18 @@ public interface Log {
*/ */
void warn(Object message, Throwable t); void warn(Object message, Throwable t);
/** /**
* Logs a message with info log level. * Logs a message with info log level.
* @param message log this message * @param message log this message
*/ */
void info(Object message); void info(Object message);
/** /**
* Logs an error with info log level. * Logs an error with info log level.
* @param message log this message * @param message log this message
* @param t log this cause * @param t log this cause
*/ */
void info(Object message, Throwable t); void info(Object message, Throwable t);
/** /**
* Logs a message with debug log level. * Logs a message with debug log level.
@@ -181,16 +181,16 @@ public interface Log {
void debug(Object message, Throwable t); void debug(Object message, Throwable t);
/** /**
* Logs a message with trace log level. * Logs a message with trace log level.
* @param message log this message * @param message log this message
*/ */
void trace(Object message); void trace(Object message);
/** /**
* Logs an error with trace log level. * Logs an error with trace log level.
* @param message log this message * @param message log this message
* @param t log this cause * @param t log this cause
*/ */
void trace(Object message, Throwable t); void trace(Object message, Throwable t);
} }

View File

@@ -90,20 +90,20 @@ public interface TableMetaDataProvider {
/** /**
* Are we using the meta-data for the table columns? * Are we using the meta-data for the table columns?
*/ */
boolean isTableColumnMetaDataUsed(); boolean isTableColumnMetaDataUsed();
/** /**
* Does this database support the JDBC 3.0 feature of retrieving generated keys: * Does this database support the JDBC 3.0 feature of retrieving generated keys:
* {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}? * {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
*/ */
boolean isGetGeneratedKeysSupported(); boolean isGetGeneratedKeysSupported();
/** /**
* Does this database support a simple query to retrieve the generated key when * Does this database support a simple query to retrieve the generated key when
* the JDBC 3.0 feature of retrieving generated keys is not supported? * the JDBC 3.0 feature of retrieving generated keys is not supported?
* @see #isGetGeneratedKeysSupported() * @see #isGetGeneratedKeysSupported()
*/ */
boolean isGetGeneratedKeysSimulated(); boolean isGetGeneratedKeysSimulated();
/** /**
* Get the simple query to retrieve a generated key. * Get the simple query to retrieve a generated key.
@@ -115,7 +115,7 @@ public interface TableMetaDataProvider {
* Does this database support a column name String array for retrieving generated keys: * Does this database support a column name String array for retrieving generated keys:
* {@link java.sql.Connection#createStruct(String, Object[])}? * {@link java.sql.Connection#createStruct(String, Object[])}?
*/ */
boolean isGeneratedKeysColumnNameArraySupported(); boolean isGeneratedKeysColumnNameArraySupported();
/** /**
* Get the table parameter meta-data that is currently used. * Get the table parameter meta-data that is currently used.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ public class NamedParameterJdbcDaoSupport extends JdbcDaoSupport {
*/ */
@Nullable @Nullable
public NamedParameterJdbcTemplate getNamedParameterJdbcTemplate() { public NamedParameterJdbcTemplate getNamedParameterJdbcTemplate() {
return this.namedParameterJdbcTemplate; return this.namedParameterJdbcTemplate;
} }
} }

View File

@@ -96,7 +96,7 @@ public abstract class JdbcDaoSupport extends DaoSupport {
*/ */
@Nullable @Nullable
public final JdbcTemplate getJdbcTemplate() { public final JdbcTemplate getJdbcTemplate() {
return this.jdbcTemplate; return this.jdbcTemplate;
} }
/** /**

View File

@@ -228,7 +228,7 @@ public abstract class SqlQuery<T> extends SqlOperation {
String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource); String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters()); Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
RowMapper<T> rowMapper = newRowMapper(params, context); RowMapper<T> rowMapper = newRowMapper(params, context);
return getJdbcTemplate().query(newPreparedStatementCreator(sqlToUse, params), rowMapper); return getJdbcTemplate().query(newPreparedStatementCreator(sqlToUse, params), rowMapper);
} }
/** /**

View File

@@ -72,7 +72,7 @@ public @interface SendToUser {
* or only to the session of the input message being handled. * or only to the session of the input message being handled.
* <p>By default, this is set to {@code true} in which case messages are * <p>By default, this is set to {@code true} in which case messages are
* broadcast to all sessions. * broadcast to all sessions.
*/ */
boolean broadcast() default true; boolean broadcast() default true;
} }

View File

@@ -467,8 +467,8 @@ public class MessageHeaderAccessor {
@Nullable @Nullable
public Object getReplyChannel() { public Object getReplyChannel() {
return getHeader(MessageHeaders.REPLY_CHANNEL); return getHeader(MessageHeaders.REPLY_CHANNEL);
} }
public void setErrorChannelName(String errorChannelName) { public void setErrorChannelName(String errorChannelName) {
setHeader(MessageHeaders.ERROR_CHANNEL, errorChannelName); setHeader(MessageHeaders.ERROR_CHANNEL, errorChannelName);
@@ -480,8 +480,8 @@ public class MessageHeaderAccessor {
@Nullable @Nullable
public Object getErrorChannel() { public Object getErrorChannel() {
return getHeader(MessageHeaders.ERROR_CHANNEL); return getHeader(MessageHeaders.ERROR_CHANNEL);
} }
// Log message stuff // Log message stuff

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -113,7 +113,7 @@ public abstract class HibernateDaoSupport extends DaoSupport {
*/ */
@Nullable @Nullable
public final HibernateTemplate getHibernateTemplate() { public final HibernateTemplate getHibernateTemplate() {
return this.hibernateTemplate; return this.hibernateTemplate;
} }
@Override @Override

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -311,12 +311,12 @@ public class PersistenceAnnotationBeanPostProcessor
} }
public void setOrder(int order) { public void setOrder(int order) {
this.order = order; this.order = order;
} }
@Override @Override
public int getOrder() { public int getOrder() {
return this.order; return this.order;
} }
@Override @Override

View File

@@ -767,7 +767,7 @@ public class XStreamMarshaller extends AbstractMarshaller implements BeanClassLo
else { else {
throw new IllegalArgumentException("DOMSource contains neither Document nor Element"); throw new IllegalArgumentException("DOMSource contains neither Document nor Element");
} }
return doUnmarshal(streamReader, null); return doUnmarshal(streamReader, null);
} }
@Override @Override
@@ -783,7 +783,7 @@ public class XStreamMarshaller extends AbstractMarshaller implements BeanClassLo
@Override @Override
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException { protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException {
return doUnmarshal(new StaxReader(new QNameMap(), streamReader, this.nameCoder), null); return doUnmarshal(new StaxReader(new QNameMap(), streamReader, this.nameCoder), null);
} }
@Override @Override
@@ -800,12 +800,12 @@ public class XStreamMarshaller extends AbstractMarshaller implements BeanClassLo
} }
public Object unmarshalInputStream(InputStream inputStream, @Nullable DataHolder dataHolder) throws XmlMappingException, IOException { public Object unmarshalInputStream(InputStream inputStream, @Nullable DataHolder dataHolder) throws XmlMappingException, IOException {
if (this.streamDriver != null) { if (this.streamDriver != null) {
return doUnmarshal(this.streamDriver.createReader(inputStream), dataHolder); return doUnmarshal(this.streamDriver.createReader(inputStream), dataHolder);
} }
else { else {
return unmarshalReader(new InputStreamReader(inputStream, this.encoding), dataHolder); return unmarshalReader(new InputStreamReader(inputStream, this.encoding), dataHolder);
} }
} }
@Override @Override

View File

@@ -94,7 +94,7 @@ public class MockAsyncContext implements AsyncContext {
@Override @Override
public void dispatch() { public void dispatch() {
dispatch(this.request.getRequestURI()); dispatch(this.request.getRequestURI());
} }
@Override @Override
public void dispatch(String path) { public void dispatch(String path) {

View File

@@ -71,7 +71,7 @@ public interface MvcResult {
* @return an exception, or {@code null} if none * @return an exception, or {@code null} if none
*/ */
@Nullable @Nullable
Exception getResolvedException(); Exception getResolvedException();
/** /**
* Return the "output" flash attributes saved during request processing. * Return the "output" flash attributes saved during request processing.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -269,11 +269,11 @@ public abstract class MockMvcRequestBuilders {
mvcResult.getAsyncResult(); mvcResult.getAsyncResult();
return servletContext -> { return servletContext -> {
MockHttpServletRequest request = mvcResult.getRequest(); MockHttpServletRequest request = mvcResult.getRequest();
request.setDispatcherType(DispatcherType.ASYNC); request.setDispatcherType(DispatcherType.ASYNC);
request.setAsyncStarted(false); request.setAsyncStarted(false);
return request; return request;
}; };
} }
} }

View File

@@ -81,17 +81,17 @@ public class ModelResultMatchers {
}; };
} }
/** /**
* Assert the given model attributes do not exist. * Assert the given model attributes do not exist.
*/ */
public ResultMatcher attributeDoesNotExist(final String... names) { public ResultMatcher attributeDoesNotExist(final String... names) {
return result -> { return result -> {
ModelAndView mav = getModelAndView(result); ModelAndView mav = getModelAndView(result);
for (String name : names) { for (String name : names) {
assertTrue("Model attribute '" + name + "' exists", mav.getModel().get(name) == null); assertTrue("Model attribute '" + name + "' exists", mav.getModel().get(name) == null);
} }
}; };
} }
/** /**
* Assert the given model attribute(s) have errors. * Assert the given model attribute(s) have errors.

View File

@@ -445,31 +445,31 @@ public class StatusResultMatchers {
} }
/** /**
* Assert the response status code is {@code HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE} (419). * Assert the response status code is {@code HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE} (419).
* @deprecated matching the deprecation of {@code HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE} * @deprecated matching the deprecation of {@code HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE}
*/ */
@Deprecated @Deprecated
public ResultMatcher isInsufficientSpaceOnResource() { public ResultMatcher isInsufficientSpaceOnResource() {
return matcher(HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE); return matcher(HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE);
} }
/** /**
* Assert the response status code is {@code HttpStatus.METHOD_FAILURE} (420). * Assert the response status code is {@code HttpStatus.METHOD_FAILURE} (420).
* @deprecated matching the deprecation of {@code HttpStatus.METHOD_FAILURE} * @deprecated matching the deprecation of {@code HttpStatus.METHOD_FAILURE}
*/ */
@Deprecated @Deprecated
public ResultMatcher isMethodFailure() { public ResultMatcher isMethodFailure() {
return matcher(HttpStatus.METHOD_FAILURE); return matcher(HttpStatus.METHOD_FAILURE);
} }
/** /**
* Assert the response status code is {@code HttpStatus.DESTINATION_LOCKED} (421). * Assert the response status code is {@code HttpStatus.DESTINATION_LOCKED} (421).
* @deprecated matching the deprecation of {@code HttpStatus.DESTINATION_LOCKED} * @deprecated matching the deprecation of {@code HttpStatus.DESTINATION_LOCKED}
*/ */
@Deprecated @Deprecated
public ResultMatcher isDestinationLocked() { public ResultMatcher isDestinationLocked() {
return matcher(HttpStatus.DESTINATION_LOCKED); return matcher(HttpStatus.DESTINATION_LOCKED);
} }
/** /**
* Assert the response status code is {@code HttpStatus.UNPROCESSABLE_ENTITY} (422). * Assert the response status code is {@code HttpStatus.UNPROCESSABLE_ENTITY} (422).

View File

@@ -56,7 +56,7 @@ public abstract class CciDaoSupport extends DaoSupport {
*/ */
public final void setConnectionFactory(ConnectionFactory connectionFactory) { public final void setConnectionFactory(ConnectionFactory connectionFactory) {
if (this.cciTemplate == null || connectionFactory != this.cciTemplate.getConnectionFactory()) { if (this.cciTemplate == null || connectionFactory != this.cciTemplate.getConnectionFactory()) {
this.cciTemplate = createCciTemplate(connectionFactory); this.cciTemplate = createCciTemplate(connectionFactory);
} }
} }
@@ -95,7 +95,7 @@ public abstract class CciDaoSupport extends DaoSupport {
*/ */
@Nullable @Nullable
public final CciTemplate getCciTemplate() { public final CciTemplate getCciTemplate() {
return this.cciTemplate; return this.cciTemplate;
} }
@Override @Override

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -159,7 +159,7 @@ public class HttpComponentsAsyncClientHttpRequestFactory extends HttpComponentsC
} }
private HttpAsyncClient startAsyncClient() { private HttpAsyncClient startAsyncClient() {
HttpAsyncClient client = getAsyncClient(); HttpAsyncClient client = getAsyncClient();
if (client instanceof CloseableHttpAsyncClient) { if (client instanceof CloseableHttpAsyncClient) {
CloseableHttpAsyncClient closeableAsyncClient = (CloseableHttpAsyncClient) client; CloseableHttpAsyncClient closeableAsyncClient = (CloseableHttpAsyncClient) client;
if (!closeableAsyncClient.isRunning()) { if (!closeableAsyncClient.isRunning()) {
@@ -175,10 +175,10 @@ public class HttpComponentsAsyncClientHttpRequestFactory extends HttpComponentsC
HttpUriRequest httpRequest = createHttpUriRequest(httpMethod, uri); HttpUriRequest httpRequest = createHttpUriRequest(httpMethod, uri);
postProcessHttpRequest(httpRequest); postProcessHttpRequest(httpRequest);
HttpContext context = createHttpContext(httpMethod, uri); HttpContext context = createHttpContext(httpMethod, uri);
if (context == null) { if (context == null) {
context = HttpClientContext.create(); context = HttpClientContext.create();
} }
// Request configuration not set in the context // Request configuration not set in the context
if (context.getAttribute(HttpClientContext.REQUEST_CONFIG) == null) { if (context.getAttribute(HttpClientContext.REQUEST_CONFIG) == null) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -82,21 +82,21 @@ final class HttpComponentsClientHttpResponse extends AbstractClientHttpResponse
@Override @Override
public void close() { public void close() {
// Release underlying connection back to the connection manager // Release underlying connection back to the connection manager
try { try {
try { try {
// Attempt to keep connection alive by consuming its remaining content // Attempt to keep connection alive by consuming its remaining content
EntityUtils.consume(this.httpResponse.getEntity()); EntityUtils.consume(this.httpResponse.getEntity());
} }
finally { finally {
if (this.httpResponse instanceof Closeable) { if (this.httpResponse instanceof Closeable) {
((Closeable) this.httpResponse).close(); ((Closeable) this.httpResponse).close();
} }
} }
} }
catch (IOException ex) { catch (IOException ex) {
// Ignore exception on close... // Ignore exception on close...
} }
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ import org.springframework.util.MultiValueMap;
* @since 5.0 * @since 5.0
*/ */
public class ClientHttpRequestDecorator implements ClientHttpRequest { public class ClientHttpRequestDecorator implements ClientHttpRequest {
private final ClientHttpRequest delegate; private final ClientHttpRequest delegate;

View File

@@ -33,7 +33,7 @@ import org.springframework.util.MultiValueMap;
* @since 5.0 * @since 5.0
*/ */
public class ClientHttpResponseDecorator implements ClientHttpResponse { public class ClientHttpResponseDecorator implements ClientHttpResponse {
private final ClientHttpResponse delegate; private final ClientHttpResponse delegate;

View File

@@ -35,63 +35,63 @@ import org.springframework.lang.Nullable;
public final class ServerSentEvent<T> { public final class ServerSentEvent<T> {
@Nullable @Nullable
private final String id; private final String id;
@Nullable @Nullable
private final String event; private final String event;
@Nullable @Nullable
private final Duration retry; private final Duration retry;
@Nullable @Nullable
private final String comment; private final String comment;
@Nullable @Nullable
private final T data; private final T data;
private ServerSentEvent(@Nullable String id, @Nullable String event, @Nullable Duration retry, private ServerSentEvent(@Nullable String id, @Nullable String event, @Nullable Duration retry,
@Nullable String comment, @Nullable T data) { @Nullable String comment, @Nullable T data) {
this.id = id; this.id = id;
this.event = event; this.event = event;
this.retry = retry; this.retry = retry;
this.comment = comment; this.comment = comment;
this.data = data; this.data = data;
} }
/** /**
* Return the {@code id} field of this event, if available. * Return the {@code id} field of this event, if available.
*/ */
@Nullable
public String id() {
return this.id;
}
/**
* Return the {@code event} field of this event, if available.
*/
@Nullable @Nullable
public String event() { public String id() {
return this.event; return this.id;
} }
/** /**
* Return the {@code retry} field of this event, if available. * Return the {@code event} field of this event, if available.
*/ */
@Nullable @Nullable
public Duration retry() { public String event() {
return this.retry; return this.event;
} }
/** /**
* Return the comment of this event, if available. * Return the {@code retry} field of this event, if available.
*/ */
@Nullable @Nullable
public String comment() { public Duration retry() {
return this.comment; return this.retry;
} }
/**
* Return the comment of this event, if available.
*/
@Nullable
public String comment() {
return this.comment;
}
/** /**
* Return the {@code data} field of this event, if available. * Return the {@code data} field of this event, if available.
@@ -102,11 +102,11 @@ public final class ServerSentEvent<T> {
} }
@Override @Override
public String toString() { public String toString() {
return ("ServerSentEvent [id = '" + this.id + "\', event='" + this.event + "\', retry=" + return ("ServerSentEvent [id = '" + this.id + "\', event='" + this.event + "\', retry=" +
this.retry + ", comment='" + this.comment + "', data=" + this.data + ']'); this.retry + ", comment='" + this.comment + "', data=" + this.data + ']');
} }
/** /**
@@ -128,41 +128,41 @@ public final class ServerSentEvent<T> {
} }
/** /**
* A mutable builder for a {@code SseEvent}. * A mutable builder for a {@code SseEvent}.
* *
* @param <T> the type of data that this event contains * @param <T> the type of data that this event contains
*/ */
public interface Builder<T> { public interface Builder<T> {
/** /**
* Set the value of the {@code id} field. * Set the value of the {@code id} field.
* @param id the value of the id field * @param id the value of the id field
* @return {@code this} builder * @return {@code this} builder
*/ */
Builder<T> id(String id); Builder<T> id(String id);
/** /**
* Set the value of the {@code event} field. * Set the value of the {@code event} field.
* @param event the value of the event field * @param event the value of the event field
* @return {@code this} builder * @return {@code this} builder
*/ */
Builder<T> event(String event); Builder<T> event(String event);
/** /**
* Set the value of the {@code retry} field. * Set the value of the {@code retry} field.
* @param retry the value of the retry field * @param retry the value of the retry field
* @return {@code this} builder * @return {@code this} builder
*/ */
Builder<T> retry(Duration retry); Builder<T> retry(Duration retry);
/** /**
* Set SSE comment. If a multi-line comment is provided, it will be turned into multiple * Set SSE comment. If a multi-line comment is provided, it will be turned into multiple
* SSE comment lines as defined in Server-Sent Events W3C recommendation. * SSE comment lines as defined in Server-Sent Events W3C recommendation.
* @param comment the comment to set * @param comment the comment to set
* @return {@code this} builder * @return {@code this} builder
*/ */
Builder<T> comment(String comment); Builder<T> comment(String comment);
/** /**
* Set the value of the {@code data} field. If the {@code data} argument is a multi-line * Set the value of the {@code data} field. If the {@code data} argument is a multi-line
@@ -174,61 +174,61 @@ public final class ServerSentEvent<T> {
*/ */
Builder<T> data(@Nullable T data); Builder<T> data(@Nullable T data);
/** /**
* Builds the event. * Builds the event.
* @return the built event * @return the built event
*/ */
ServerSentEvent<T> build(); ServerSentEvent<T> build();
} }
private static class BuilderImpl<T> implements Builder<T> { private static class BuilderImpl<T> implements Builder<T> {
@Nullable @Nullable
private String id; private String id;
@Nullable @Nullable
private String event; private String event;
@Nullable @Nullable
private Duration retry; private Duration retry;
@Nullable @Nullable
private String comment; private String comment;
@Nullable @Nullable
private T data; private T data;
public BuilderImpl() { public BuilderImpl() {
} }
public BuilderImpl(T data) { public BuilderImpl(T data) {
this.data = data; this.data = data;
} }
@Override @Override
public Builder<T> id(String id) { public Builder<T> id(String id) {
this.id = id; this.id = id;
return this; return this;
} }
@Override @Override
public Builder<T> event(String event) { public Builder<T> event(String event) {
this.event = event; this.event = event;
return this; return this;
} }
@Override @Override
public Builder<T> retry(Duration retry) { public Builder<T> retry(Duration retry) {
this.retry = retry; this.retry = retry;
return this; return this;
} }
@Override @Override
public Builder<T> comment(String comment) { public Builder<T> comment(String comment) {
this.comment = comment; this.comment = comment;
return this; return this;
} }
@Override @Override
public Builder<T> data(@Nullable T data) { public Builder<T> data(@Nullable T data) {
@@ -236,10 +236,10 @@ public final class ServerSentEvent<T> {
return this; return this;
} }
@Override @Override
public ServerSentEvent<T> build() { public ServerSentEvent<T> build() {
return new ServerSentEvent<>(this.id, this.event, this.retry, this.comment, this.data); return new ServerSentEvent<>(this.id, this.event, this.retry, this.comment, this.data);
} }
} }
} }

View File

@@ -176,7 +176,7 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple
return buffer; return buffer;
} }
protected ObjectWriter customizeWriter(ObjectWriter writer, @Nullable MimeType mimeType, protected ObjectWriter customizeWriter(ObjectWriter writer, @Nullable MimeType mimeType,
ResolvableType elementType, @Nullable Map<String, Object> hints) { ResolvableType elementType, @Nullable Map<String, Object> hints) {
@@ -227,5 +227,5 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple
protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) { protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) {
return parameter.getMethodAnnotation(annotType); return parameter.getMethodAnnotation(annotType);
} }
} }

View File

@@ -48,7 +48,7 @@ public class Jackson2JsonEncoder extends AbstractJackson2Encoder {
@Nullable @Nullable
private final PrettyPrinter ssePrettyPrinter; private final PrettyPrinter ssePrettyPrinter;
public Jackson2JsonEncoder() { public Jackson2JsonEncoder() {
this(Jackson2ObjectMapperBuilder.json().build()); this(Jackson2ObjectMapperBuilder.json().build());
@@ -70,7 +70,7 @@ public class Jackson2JsonEncoder extends AbstractJackson2Encoder {
@Override @Override
protected ObjectWriter customizeWriter(ObjectWriter writer, @Nullable MimeType mimeType, protected ObjectWriter customizeWriter(ObjectWriter writer, @Nullable MimeType mimeType,
ResolvableType elementType, @Nullable Map<String, Object> hints) { ResolvableType elementType, @Nullable Map<String, Object> hints) {
return (this.ssePrettyPrinter != null && return (this.ssePrettyPrinter != null &&
MediaType.TEXT_EVENT_STREAM.isCompatibleWith(mimeType) && MediaType.TEXT_EVENT_STREAM.isCompatibleWith(mimeType) &&
writer.getConfig().isEnabled(SerializationFeature.INDENT_OUTPUT) ? writer.getConfig().isEnabled(SerializationFeature.INDENT_OUTPUT) ?

View File

@@ -43,8 +43,8 @@ public class Jackson2SmileEncoder extends AbstractJackson2Encoder {
private static final MimeType[] DEFAULT_SMILE_MIME_TYPES = new MimeType[] { private static final MimeType[] DEFAULT_SMILE_MIME_TYPES = new MimeType[] {
new MimeType("application", "x-jackson-smile", StandardCharsets.UTF_8), new MimeType("application", "x-jackson-smile", StandardCharsets.UTF_8),
new MimeType("application", "*+x-jackson-smile", StandardCharsets.UTF_8)}; new MimeType("application", "*+x-jackson-smile", StandardCharsets.UTF_8)};
public Jackson2SmileEncoder() { public Jackson2SmileEncoder() {
this(Jackson2ObjectMapperBuilder.smile().build(), DEFAULT_SMILE_MIME_TYPES); this(Jackson2ObjectMapperBuilder.smile().build(), DEFAULT_SMILE_MIME_TYPES);
} }

View File

@@ -118,7 +118,7 @@ public class SynchronossPartHttpMessageReader extends LoggingCodecSupport implem
private final ReactiveHttpInputMessage inputMessage; private final ReactiveHttpInputMessage inputMessage;
private final DataBufferFactory bufferFactory; private final DataBufferFactory bufferFactory;
private final PartBodyStreamStorageFactory streamStorageFactory; private final PartBodyStreamStorageFactory streamStorageFactory;
SynchronossPartGenerator(ReactiveHttpInputMessage inputMessage, DataBufferFactory bufferFactory, SynchronossPartGenerator(ReactiveHttpInputMessage inputMessage, DataBufferFactory bufferFactory,

View File

@@ -35,6 +35,6 @@ public interface ExtensionRegistryInitializer {
* Initializes the {@code ExtensionRegistry} with Protocol Message extensions. * Initializes the {@code ExtensionRegistry} with Protocol Message extensions.
* @param registry the registry to populate * @param registry the registry to populate
*/ */
void initializeExtensionRegistry(ExtensionRegistry registry); void initializeExtensionRegistry(ExtensionRegistry registry);
} }

View File

@@ -108,10 +108,10 @@ class ServletServerHttpRequest extends AbstractServerHttpRequest {
private static HttpHeaders initHeaders(HttpServletRequest request) { private static HttpHeaders initHeaders(HttpServletRequest request) {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
for (Enumeration<?> names = request.getHeaderNames(); for (Enumeration<?> names = request.getHeaderNames();
names.hasMoreElements(); ) { names.hasMoreElements(); ) {
String name = (String) names.nextElement(); String name = (String) names.nextElement();
for (Enumeration<?> values = request.getHeaders(name); for (Enumeration<?> values = request.getHeaders(name);
values.hasMoreElements(); ) { values.hasMoreElements(); ) {
headers.add(name, (String) values.nextElement()); headers.add(name, (String) values.nextElement());
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -63,10 +63,10 @@ public class HessianServiceExporter extends HessianExporter implements HttpReque
response.setContentType(CONTENT_TYPE_HESSIAN); response.setContentType(CONTENT_TYPE_HESSIAN);
try { try {
invoke(request.getInputStream(), response.getOutputStream()); invoke(request.getInputStream(), response.getOutputStream());
} }
catch (Throwable ex) { catch (Throwable ex) {
throw new NestedServletException("Hessian skeleton invocation failed", ex); throw new NestedServletException("Hessian skeleton invocation failed", ex);
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ import org.springframework.util.Assert;
/** /**
* Package-private implementation of {@link ServerWebExchange.Builder}. * Package-private implementation of {@link ServerWebExchange.Builder}.
* *
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0
*/ */

View File

@@ -25,7 +25,7 @@ import org.springframework.web.server.ServerWebExchange;
/** /**
* Request and response header-based {@link WebSessionIdResolver}. * Request and response header-based {@link WebSessionIdResolver}.
* *
* @author Greg Turnquist * @author Greg Turnquist
* @author Rob Winch * @author Rob Winch
* @since 5.0 * @since 5.0

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ public class CookieGenerator {
private String cookiePath = DEFAULT_COOKIE_PATH; private String cookiePath = DEFAULT_COOKIE_PATH;
@Nullable @Nullable
private Integer cookieMaxAge; private Integer cookieMaxAge;
private boolean cookieSecure = false; private boolean cookieSecure = false;

View File

@@ -124,7 +124,7 @@ class HtmlCharacterEntityReferences {
*/ */
@Nullable @Nullable
public String convertToReference(char character) { public String convertToReference(char character) {
return convertToReference(character, WebUtils.DEFAULT_CHARACTER_ENCODING); return convertToReference(character, WebUtils.DEFAULT_CHARACTER_ENCODING);
} }
/** /**

View File

@@ -36,25 +36,25 @@ import org.springframework.util.SystemPropertyUtils;
*/ */
public abstract class ServletContextPropertyUtils { public abstract class ServletContextPropertyUtils {
private static final PropertyPlaceholderHelper strictHelper = private static final PropertyPlaceholderHelper strictHelper =
new PropertyPlaceholderHelper(SystemPropertyUtils.PLACEHOLDER_PREFIX, new PropertyPlaceholderHelper(SystemPropertyUtils.PLACEHOLDER_PREFIX,
SystemPropertyUtils.PLACEHOLDER_SUFFIX, SystemPropertyUtils.VALUE_SEPARATOR, false); SystemPropertyUtils.PLACEHOLDER_SUFFIX, SystemPropertyUtils.VALUE_SEPARATOR, false);
private static final PropertyPlaceholderHelper nonStrictHelper = private static final PropertyPlaceholderHelper nonStrictHelper =
new PropertyPlaceholderHelper(SystemPropertyUtils.PLACEHOLDER_PREFIX, new PropertyPlaceholderHelper(SystemPropertyUtils.PLACEHOLDER_PREFIX,
SystemPropertyUtils.PLACEHOLDER_SUFFIX, SystemPropertyUtils.VALUE_SEPARATOR, true); SystemPropertyUtils.PLACEHOLDER_SUFFIX, SystemPropertyUtils.VALUE_SEPARATOR, true);
/** /**
* Resolve ${...} placeholders in the given text, replacing them with corresponding * Resolve ${...} placeholders in the given text, replacing them with corresponding
* servlet context init parameter or system property values. * servlet context init parameter or system property values.
* @param text the String to resolve * @param text the String to resolve
* @param servletContext the servletContext to use for lookups. * @param servletContext the servletContext to use for lookups.
* @return the resolved String * @return the resolved String
* @throws IllegalArgumentException if there is an unresolvable placeholder * @throws IllegalArgumentException if there is an unresolvable placeholder
* @see SystemPropertyUtils#PLACEHOLDER_PREFIX * @see SystemPropertyUtils#PLACEHOLDER_PREFIX
* @see SystemPropertyUtils#PLACEHOLDER_SUFFIX * @see SystemPropertyUtils#PLACEHOLDER_SUFFIX
* @see SystemPropertyUtils#resolvePlaceholders(String, boolean) * @see SystemPropertyUtils#resolvePlaceholders(String, boolean)
*/ */
public static String resolvePlaceholders(String text, ServletContext servletContext) { public static String resolvePlaceholders(String text, ServletContext servletContext) {
return resolvePlaceholders(text, servletContext, false); return resolvePlaceholders(text, servletContext, false);
@@ -65,13 +65,13 @@ public abstract class ServletContextPropertyUtils {
* servlet context init parameter or system property values. Unresolvable placeholders * servlet context init parameter or system property values. Unresolvable placeholders
* with no default value are ignored and passed through unchanged if the flag is set to true. * with no default value are ignored and passed through unchanged if the flag is set to true.
* @param text the String to resolve * @param text the String to resolve
* @param servletContext the servletContext to use for lookups. * @param servletContext the servletContext to use for lookups.
* @param ignoreUnresolvablePlaceholders flag to determine is unresolved placeholders are ignored * @param ignoreUnresolvablePlaceholders flag to determine is unresolved placeholders are ignored
* @return the resolved String * @return the resolved String
* @throws IllegalArgumentException if there is an unresolvable placeholder and the flag is false * @throws IllegalArgumentException if there is an unresolvable placeholder and the flag is false
* @see SystemPropertyUtils#PLACEHOLDER_PREFIX * @see SystemPropertyUtils#PLACEHOLDER_PREFIX
* @see SystemPropertyUtils#PLACEHOLDER_SUFFIX * @see SystemPropertyUtils#PLACEHOLDER_SUFFIX
* @see SystemPropertyUtils#resolvePlaceholders(String, boolean) * @see SystemPropertyUtils#resolvePlaceholders(String, boolean)
*/ */
public static String resolvePlaceholders(String text, ServletContext servletContext, public static String resolvePlaceholders(String text, ServletContext servletContext,
boolean ignoreUnresolvablePlaceholders) { boolean ignoreUnresolvablePlaceholders) {
@@ -84,20 +84,20 @@ public abstract class ServletContextPropertyUtils {
private static class ServletContextPlaceholderResolver private static class ServletContextPlaceholderResolver
implements PropertyPlaceholderHelper.PlaceholderResolver { implements PropertyPlaceholderHelper.PlaceholderResolver {
private final String text; private final String text;
private final ServletContext servletContext; private final ServletContext servletContext;
public ServletContextPlaceholderResolver(String text, ServletContext servletContext) { public ServletContextPlaceholderResolver(String text, ServletContext servletContext) {
this.text = text; this.text = text;
this.servletContext = servletContext; this.servletContext = servletContext;
} }
@Override @Override
@Nullable @Nullable
public String resolvePlaceholder(String placeholderName) { public String resolvePlaceholder(String placeholderName) {
try { try {
String propVal = this.servletContext.getInitParameter(placeholderName); String propVal = this.servletContext.getInitParameter(placeholderName);
if (propVal == null) { if (propVal == null) {
// Fall back to system properties. // Fall back to system properties.
propVal = System.getProperty(placeholderName); propVal = System.getProperty(placeholderName);
@@ -108,12 +108,12 @@ public abstract class ServletContextPropertyUtils {
} }
return propVal; return propVal;
} }
catch (Throwable ex) { catch (Throwable ex) {
System.err.println("Could not resolve placeholder '" + placeholderName + "' in [" + System.err.println("Could not resolve placeholder '" + placeholderName + "' in [" +
this.text + "] as ServletContext init-parameter or system property: " + ex); this.text + "] as ServletContext init-parameter or system property: " + ex);
return null; return null;
} }
} }
} }
} }

View File

@@ -102,20 +102,20 @@ public class UriTemplate implements Serializable {
return encodedComponents.toUri(); return encodedComponents.toUri();
} }
/** /**
* Given an array of variables, expand this template into a full URI. The array represent variable values. * Given an array of variables, expand this template into a full URI. The array represent variable values.
* The order of variables is significant. * The order of variables is significant.
* <p>Example: * <p>Example:
* <pre class="code"> * <pre class="code">
* UriTemplate template = new UriTemplate("http://example.com/hotels/{hotel}/bookings/{booking}"); * UriTemplate template = new UriTemplate("http://example.com/hotels/{hotel}/bookings/{booking}");
* System.out.println(template.expand("Rest & Relax", 42)); * System.out.println(template.expand("Rest & Relax", 42));
* </pre> * </pre>
* will print: <blockquote>{@code http://example.com/hotels/Rest%20%26%20Relax/bookings/42}</blockquote> * will print: <blockquote>{@code http://example.com/hotels/Rest%20%26%20Relax/bookings/42}</blockquote>
* @param uriVariableValues the array of URI variables * @param uriVariableValues the array of URI variables
* @return the expanded URI * @return the expanded URI
* @throws IllegalArgumentException if {@code uriVariables} is {@code null} * @throws IllegalArgumentException if {@code uriVariables} is {@code null}
* or if it does not contain sufficient variables * or if it does not contain sufficient variables
*/ */
public URI expand(Object... uriVariableValues) { public URI expand(Object... uriVariableValues) {
UriComponents expandedComponents = this.uriComponents.expand(uriVariableValues); UriComponents expandedComponents = this.uriComponents.expand(uriVariableValues);
UriComponents encodedComponents = expandedComponents.encode(); UriComponents encodedComponents = expandedComponents.encode();

View File

@@ -107,8 +107,8 @@ class CaptureVariablePathElement extends PathElement {
match = (pathIndex == matchingContext.pathLength); match = (pathIndex == matchingContext.pathLength);
if (!match && matchingContext.isMatchOptionalTrailingSeparator()) { if (!match && matchingContext.isMatchOptionalTrailingSeparator()) {
match = //(nextPos > candidateIndex) && match = //(nextPos > candidateIndex) &&
(pathIndex + 1) == matchingContext.pathLength && (pathIndex + 1) == matchingContext.pathLength &&
matchingContext.isSeparator(pathIndex); matchingContext.isSeparator(pathIndex);
} }
} }
} }

View File

@@ -75,7 +75,7 @@ class RegexPathElement extends PathElement {
patternBuilder.append(".*"); patternBuilder.append(".*");
int pos = matcher.start(); int pos = matcher.start();
if (pos < 1 || text.charAt(pos-1) != '.') { if (pos < 1 || text.charAt(pos-1) != '.') {
// To be compatible with the AntPathMatcher comparator, // To be compatible with the AntPathMatcher comparator,
// '.*' is not considered a wildcard usage // '.*' is not considered a wildcard usage
this.wildcardCount++; this.wildcardCount++;
} }
@@ -129,13 +129,13 @@ class RegexPathElement extends PathElement {
@Override @Override
public boolean matches(int pathIndex, MatchingContext matchingContext) { public boolean matches(int pathIndex, MatchingContext matchingContext) {
String textToMatch = matchingContext.pathElementValue(pathIndex); String textToMatch = matchingContext.pathElementValue(pathIndex);
Matcher matcher = this.pattern.matcher(textToMatch); Matcher matcher = this.pattern.matcher(textToMatch);
boolean matches = matcher.matches(); boolean matches = matcher.matches();
if (matches) { if (matches) {
if (isNoMorePattern()) { if (isNoMorePattern()) {
if (matchingContext.determineRemainingPath && if (matchingContext.determineRemainingPath &&
(this.variableNames.isEmpty() ? true : textToMatch.length() > 0)) { (this.variableNames.isEmpty() ? true : textToMatch.length() > 0)) {
matchingContext.remainingPathIndex = pathIndex + 1; matchingContext.remainingPathIndex = pathIndex + 1;
matches = true; matches = true;
@@ -143,12 +143,13 @@ class RegexPathElement extends PathElement {
else { else {
// No more pattern, is there more data? // No more pattern, is there more data?
// If pattern is capturing variables there must be some actual data to bind to them // If pattern is capturing variables there must be some actual data to bind to them
matches = (pathIndex + 1) >= matchingContext.pathLength && matches = (pathIndex + 1) >= matchingContext.pathLength
(this.variableNames.isEmpty() || textToMatch.length() > 0); && (this.variableNames.isEmpty() || textToMatch.length() > 0);
if (!matches && matchingContext.isMatchOptionalTrailingSeparator()) { if (!matches && matchingContext.isMatchOptionalTrailingSeparator()) {
matches = (this.variableNames.isEmpty() || textToMatch.length() > 0) && matches = (this.variableNames.isEmpty()
(pathIndex + 2) >= matchingContext.pathLength && || textToMatch.length() > 0)
matchingContext.isSeparator(pathIndex + 1); && (pathIndex + 2) >= matchingContext.pathLength
&& matchingContext.isSeparator(pathIndex + 1);
} }
} }
} }
@@ -176,7 +177,7 @@ class RegexPathElement extends PathElement {
} }
return matches; return matches;
} }
@Override @Override
public int getNormalizedLength() { public int getNormalizedLength() {
int varsLength = 0; int varsLength = 0;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -65,7 +65,7 @@ class SeparatorPathElement extends PathElement {
public String toString() { public String toString() {
return "Separator(" + this.separator + ")"; return "Separator(" + this.separator + ")";
} }
public char[] getChars() { public char[] getChars() {
return new char[] {this.separator}; return new char[] {this.separator};
} }

View File

@@ -73,7 +73,7 @@ class SingleCharWildcardedPathElement extends PathElement {
// Not enough data to match this path element // Not enough data to match this path element
return false; return false;
} }
char[] data = ((PathSegment)element).valueToMatchAsChars(); char[] data = ((PathSegment)element).valueToMatchAsChars();
if (this.caseSensitive) { if (this.caseSensitive) {
for (int i = 0; i < this.len; i++) { for (int i = 0; i < this.len; i++) {
@@ -92,7 +92,7 @@ class SingleCharWildcardedPathElement extends PathElement {
} }
} }
} }
pathIndex++; pathIndex++;
if (isNoMorePattern()) { if (isNoMorePattern()) {
if (matchingContext.determineRemainingPath) { if (matchingContext.determineRemainingPath) {
@@ -129,7 +129,7 @@ class SingleCharWildcardedPathElement extends PathElement {
public String toString() { public String toString() {
return "SingleCharWildcarded(" + String.valueOf(this.text) + ")"; return "SingleCharWildcarded(" + String.valueOf(this.text) + ")";
} }
@Override @Override
public char[] getChars() { public char[] getChars() {
return this.text; return this.text;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import org.springframework.web.util.pattern.PathPattern.MatchingContext;
/** /**
* A wildcard path element. In the pattern '/foo/&ast;/goo' the * is * A wildcard path element. In the pattern '/foo/&ast;/goo' the * is
* represented by a WildcardPathElement. Within a path it matches at least * represented by a WildcardPathElement. Within a path it matches at least
* one character but at the end of a path it can match zero characters. * one character but at the end of a path it can match zero characters.
* *
* @author Andy Clement * @author Andy Clement
@@ -36,7 +36,7 @@ class WildcardPathElement extends PathElement {
/** /**
* Matching on a WildcardPathElement is quite straight forward. Scan the * Matching on a WildcardPathElement is quite straight forward. Scan the
* candidate from the candidateIndex onwards for the next separator or the end of the * candidate from the candidateIndex onwards for the next separator or the end of the
* candidate. * candidate.
*/ */
@@ -53,7 +53,7 @@ class WildcardPathElement extends PathElement {
segmentData = ((PathContainer.PathSegment)element).valueToMatch(); segmentData = ((PathContainer.PathSegment)element).valueToMatch();
pathIndex++; pathIndex++;
} }
if (isNoMorePattern()) { if (isNoMorePattern()) {
if (matchingContext.determineRemainingPath) { if (matchingContext.determineRemainingPath) {
matchingContext.remainingPathIndex = pathIndex; matchingContext.remainingPathIndex = pathIndex;
@@ -72,7 +72,7 @@ class WildcardPathElement extends PathElement {
} }
} }
} }
else { else {
// Within a path (e.g. /aa/*/bb) there must be at least one character to match the wildcard // Within a path (e.g. /aa/*/bb) there must be at least one character to match the wildcard
if (segmentData == null || segmentData.length() == 0) { if (segmentData == null || segmentData.length() == 0) {
return false; return false;

View File

@@ -64,8 +64,8 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport
public AbstractHandlerMapping() { public AbstractHandlerMapping() {
this.patternParser = new PathPatternParser(); this.patternParser = new PathPatternParser();
this.globalCorsConfigSource = new UrlBasedCorsConfigurationSource(this.patternParser); this.globalCorsConfigSource = new UrlBasedCorsConfigurationSource(this.patternParser);
} }

View File

@@ -42,7 +42,7 @@ import org.springframework.web.reactive.socket.WebSocketSession;
/** /**
* Jetty {@link WebSocket @WebSocket} handler that delegates events to a * Jetty {@link WebSocket @WebSocket} handler that delegates events to a
* reactive {@link WebSocketHandler} and its session. * reactive {@link WebSocketHandler} and its session.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ import org.springframework.web.reactive.socket.WebSocketSession;
/** /**
* Spring {@link WebSocketSession} implementation that adapts to a Jetty * Spring {@link WebSocketSession} implementation that adapts to a Jetty
* WebSocket {@link org.eclipse.jetty.websocket.api.Session}. * WebSocket {@link org.eclipse.jetty.websocket.api.Session}.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0

View File

@@ -37,7 +37,7 @@ import org.springframework.web.reactive.socket.WebSocketSession;
/** /**
* Adapter for Java WebSocket API (JSR-356) that delegates events to a reactive * Adapter for Java WebSocket API (JSR-356) that delegates events to a reactive
* {@link WebSocketHandler} and its session. * {@link WebSocketHandler} and its session.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0

View File

@@ -38,7 +38,7 @@ import org.springframework.web.reactive.socket.WebSocketSession;
/** /**
* Spring {@link WebSocketSession} adapter for a standard Java (JSR 356) * Spring {@link WebSocketSession} adapter for a standard Java (JSR 356)
* {@link javax.websocket.Session}. * {@link javax.websocket.Session}.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0

View File

@@ -29,7 +29,7 @@ import org.springframework.web.reactive.socket.WebSocketSession;
/** /**
* Spring {@link WebSocketSession} adapter for Tomcat's * Spring {@link WebSocketSession} adapter for Tomcat's
* {@link javax.websocket.Session}. * {@link javax.websocket.Session}.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @since 5.0 * @since 5.0
*/ */

View File

@@ -36,7 +36,7 @@ import org.springframework.web.reactive.socket.WebSocketMessage.Type;
/** /**
* Undertow {@link WebSocketConnectionCallback} implementation that adapts and * Undertow {@link WebSocketConnectionCallback} implementation that adapts and
* delegates to a Spring {@link WebSocketHandler}. * delegates to a Spring {@link WebSocketHandler}.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ import org.springframework.web.reactive.socket.WebSocketSession;
/** /**
* Spring {@link WebSocketSession} implementation that adapts to an Undertow * Spring {@link WebSocketSession} implementation that adapts to an Undertow
* {@link io.undertow.websockets.core.WebSocketChannel}. * {@link io.undertow.websockets.core.WebSocketChannel}.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0

View File

@@ -28,7 +28,7 @@ import reactor.core.publisher.MonoProcessor;
/** /**
* {@link WebSocketClient} implementation for use with the Java WebSocket API. * {@link WebSocketClient} implementation for use with the Java WebSocket API.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @since 5.0 * @since 5.0
*/ */

View File

@@ -92,7 +92,7 @@ public class UndertowWebSocketClient extends WebSocketClientSupport implements W
* @since 5.0.8 * @since 5.0.8
*/ */
public UndertowWebSocketClient(XnioWorker worker, ByteBufferPool byteBufferPool, public UndertowWebSocketClient(XnioWorker worker, ByteBufferPool byteBufferPool,
Consumer<ConnectionBuilder> builderConsumer) { Consumer<ConnectionBuilder> builderConsumer) {
Assert.notNull(worker, "XnioWorker must not be null"); Assert.notNull(worker, "XnioWorker must not be null");
Assert.notNull(byteBufferPool, "ByteBufferPool must not be null"); Assert.notNull(byteBufferPool, "ByteBufferPool must not be null");

View File

@@ -45,7 +45,7 @@ import org.springframework.web.server.ServerWebExchange;
/** /**
* A {@link RequestUpgradeStrategy} for use with Jetty. * A {@link RequestUpgradeStrategy} for use with Jetty.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0

View File

@@ -44,7 +44,7 @@ import org.springframework.web.server.ServerWebExchange;
/** /**
* A {@link RequestUpgradeStrategy} for use with Undertow. * A {@link RequestUpgradeStrategy} for use with Undertow.
* *
* @author Violeta Georgieva * @author Violeta Georgieva
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0

View File

@@ -214,7 +214,7 @@ class ResourcesBeanDefinitionParser implements BeanDefinitionParser {
else { else {
cacheControl = CacheControl.empty(); cacheControl = CacheControl.empty();
} }
if ("true".equals(element.getAttribute("must-revalidate"))) { if ("true".equals(element.getAttribute("must-revalidate"))) {
cacheControl = cacheControl.mustRevalidate(); cacheControl = cacheControl.mustRevalidate();
} }

Some files were not shown because too many files have changed in this diff Show More