Merge branch '5.1.x'
This commit is contained in:
commit
ce9162065c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2019 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.
|
||||||
|
@ -54,8 +54,9 @@ public interface InstantiationAwareBeanPostProcessor extends BeanPostProcessor {
|
||||||
* will be short-circuited. The only further processing applied is the
|
* will be short-circuited. The only further processing applied is the
|
||||||
* {@link #postProcessAfterInitialization} callback from the configured
|
* {@link #postProcessAfterInitialization} callback from the configured
|
||||||
* {@link BeanPostProcessor BeanPostProcessors}.
|
* {@link BeanPostProcessor BeanPostProcessors}.
|
||||||
* <p>This callback will only be applied to bean definitions with a bean class.
|
* <p>This callback will be applied to bean definitions with their bean class,
|
||||||
* In particular, it will not be applied to beans with a factory method.
|
* as well as to factory-method definitions in which case the returned bean type
|
||||||
|
* will be passed in here.
|
||||||
* <p>Post-processors may implement the extended
|
* <p>Post-processors may implement the extended
|
||||||
* {@link SmartInstantiationAwareBeanPostProcessor} interface in order
|
* {@link SmartInstantiationAwareBeanPostProcessor} interface in order
|
||||||
* to predict the type of the bean object that they are going to return here.
|
* to predict the type of the bean object that they are going to return here.
|
||||||
|
@ -66,7 +67,8 @@ public interface InstantiationAwareBeanPostProcessor extends BeanPostProcessor {
|
||||||
* or {@code null} to proceed with default instantiation
|
* or {@code null} to proceed with default instantiation
|
||||||
* @throws org.springframework.beans.BeansException in case of errors
|
* @throws org.springframework.beans.BeansException in case of errors
|
||||||
* @see #postProcessAfterInstantiation
|
* @see #postProcessAfterInstantiation
|
||||||
* @see org.springframework.beans.factory.support.AbstractBeanDefinition#hasBeanClass
|
* @see org.springframework.beans.factory.support.AbstractBeanDefinition#getBeanClass()
|
||||||
|
* @see org.springframework.beans.factory.support.AbstractBeanDefinition#getFactoryMethodName()
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
default Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException {
|
default Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException {
|
||||||
|
|
|
@ -5124,7 +5124,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// helper methods
|
// Helper methods
|
||||||
|
|
||||||
private SpelNodeImpl getAst() {
|
private SpelNodeImpl getAst() {
|
||||||
SpelExpression spelExpression = (SpelExpression) expression;
|
SpelExpression spelExpression = (SpelExpression) expression;
|
||||||
|
@ -5196,69 +5196,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// nested types
|
// Nested types
|
||||||
|
|
||||||
public class Reg {
|
|
||||||
private Integer _value,_value2;
|
|
||||||
private Long _valueL,_valueL2;
|
|
||||||
private Double _valueD,_valueD2;
|
|
||||||
private Float _valueF,_valueF2;
|
|
||||||
|
|
||||||
|
|
||||||
public Reg(int v) {
|
|
||||||
this._value = v;
|
|
||||||
this._valueL = new Long(v);
|
|
||||||
this._valueD = new Double(v);
|
|
||||||
this._valueF = new Float(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getValue() {
|
|
||||||
return _value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getValueL() {
|
|
||||||
return _valueL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getValueD() {
|
|
||||||
return _valueD;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Float getValueF() {
|
|
||||||
return _valueF;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getValue2() {
|
|
||||||
return _value2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getValueL2() {
|
|
||||||
return _valueL2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getValueD2() {
|
|
||||||
return _valueD2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Float getValueF2() {
|
|
||||||
return _valueF2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(Integer value) {
|
|
||||||
_value = value;
|
|
||||||
_valueL = value==null?null:new Long(value);
|
|
||||||
_valueD = value==null?null:new Double(value);
|
|
||||||
_valueF = value==null?null:new Float(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue2(Integer value) {
|
|
||||||
_value2 = value;
|
|
||||||
_valueL2 = value==null?null:new Long(value);
|
|
||||||
_valueD2 = value==null?null:new Double(value);
|
|
||||||
_valueF2 = value==null?null:new Float(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public interface Message<T> {
|
public interface Message<T> {
|
||||||
|
|
||||||
|
@ -6276,4 +6214,66 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||||
public Long someLong = 3L;
|
public Long someLong = 3L;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class Reg {
|
||||||
|
|
||||||
|
private Integer _value,_value2;
|
||||||
|
private Long _valueL,_valueL2;
|
||||||
|
private Double _valueD,_valueD2;
|
||||||
|
private Float _valueF,_valueF2;
|
||||||
|
|
||||||
|
public Reg(int v) {
|
||||||
|
this._value = v;
|
||||||
|
this._valueL = new Long(v);
|
||||||
|
this._valueD = new Double(v);
|
||||||
|
this._valueF = new Float(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getValue() {
|
||||||
|
return _value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getValueL() {
|
||||||
|
return _valueL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getValueD() {
|
||||||
|
return _valueD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Float getValueF() {
|
||||||
|
return _valueF;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getValue2() {
|
||||||
|
return _value2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getValueL2() {
|
||||||
|
return _valueL2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getValueD2() {
|
||||||
|
return _valueD2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Float getValueF2() {
|
||||||
|
return _valueF2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(Integer value) {
|
||||||
|
_value = value;
|
||||||
|
_valueL = value==null?null:new Long(value);
|
||||||
|
_valueD = value==null?null:new Double(value);
|
||||||
|
_valueF = value==null?null:new Float(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue2(Integer value) {
|
||||||
|
_value2 = value;
|
||||||
|
_valueL2 = value==null?null:new Long(value);
|
||||||
|
_valueD2 = value==null?null:new Double(value);
|
||||||
|
_valueF2 = value==null?null:new Float(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,11 +87,11 @@ public enum Propagation {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute within a nested transaction if a current transaction exists,
|
* Execute within a nested transaction if a current transaction exists,
|
||||||
* behave like {@code REQUIRED} else. There is no analogous feature in EJB.
|
* behave like {@code REQUIRED} otherwise. There is no analogous feature in EJB.
|
||||||
* <p>Note: Actual creation of a nested transaction will only work on specific
|
* <p>Note: Actual creation of a nested transaction will only work on specific
|
||||||
* transaction managers. Out of the box, this only applies to the JDBC
|
* transaction managers. Out of the box, this only applies to the JDBC
|
||||||
* DataSourceTransactionManager when working on a JDBC 3.0 driver.
|
* DataSourceTransactionManager. Some JTA providers might support nested
|
||||||
* Some JTA providers might support nested transactions as well.
|
* transactions as well.
|
||||||
* @see org.springframework.jdbc.datasource.DataSourceTransactionManager
|
* @see org.springframework.jdbc.datasource.DataSourceTransactionManager
|
||||||
*/
|
*/
|
||||||
NESTED(TransactionDefinition.PROPAGATION_NESTED);
|
NESTED(TransactionDefinition.PROPAGATION_NESTED);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2019 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.
|
||||||
|
@ -553,7 +553,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
||||||
if (definition.getTimeout() != TransactionDefinition.TIMEOUT_DEFAULT) {
|
if (definition.getTimeout() != TransactionDefinition.TIMEOUT_DEFAULT) {
|
||||||
return definition.getTimeout();
|
return definition.getTimeout();
|
||||||
}
|
}
|
||||||
return this.defaultTimeout;
|
return getDefaultTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1099,6 +1099,8 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
||||||
* @param definition a TransactionDefinition instance, describing propagation
|
* @param definition a TransactionDefinition instance, describing propagation
|
||||||
* behavior, isolation level, read-only flag, timeout, and transaction name
|
* behavior, isolation level, read-only flag, timeout, and transaction name
|
||||||
* @throws TransactionException in case of creation or system errors
|
* @throws TransactionException in case of creation or system errors
|
||||||
|
* @throws org.springframework.transaction.NestedTransactionNotSupportedException
|
||||||
|
* if the underlying transaction does not support nesting
|
||||||
*/
|
*/
|
||||||
protected abstract void doBegin(Object transaction, TransactionDefinition definition)
|
protected abstract void doBegin(Object transaction, TransactionDefinition definition)
|
||||||
throws TransactionException;
|
throws TransactionException;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2017 the original author or authors.
|
* Copyright 2002-2019 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.
|
||||||
|
@ -292,10 +292,11 @@ public abstract class TransactionSynchronizationManager {
|
||||||
throws IllegalStateException {
|
throws IllegalStateException {
|
||||||
|
|
||||||
Assert.notNull(synchronization, "TransactionSynchronization must not be null");
|
Assert.notNull(synchronization, "TransactionSynchronization must not be null");
|
||||||
if (!isSynchronizationActive()) {
|
Set<TransactionSynchronization> synchs = synchronizations.get();
|
||||||
|
if (synchs == null) {
|
||||||
throw new IllegalStateException("Transaction synchronization is not active");
|
throw new IllegalStateException("Transaction synchronization is not active");
|
||||||
}
|
}
|
||||||
synchronizations.get().add(synchronization);
|
synchs.add(synchronization);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue