@ -976,11 +976,11 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
@@ -976,11 +976,11 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
intlength=propertyName.length();
for(inti=startIndex;i<length;i++){
switch(propertyName.charAt(i)){
casePropertyAccessor.PROPERTY_KEY_PREFIX_CHAR:
casePropertyAccessor.PROPERTY_KEY_PREFIX_CHAR->{
// The property name contains opening prefix(es)...
unclosedPrefixes++;
break;
casePropertyAccessor.PROPERTY_KEY_SUFFIX_CHAR:
}
casePropertyAccessor.PROPERTY_KEY_SUFFIX_CHAR->{
if(unclosedPrefixes==0){
// No unclosed prefix(es) in the property name (left) ->
// this is the suffix we are looking for.
@ -991,13 +991,12 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
@@ -991,13 +991,12 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
// just one that occurred within the property name.
@ -94,20 +94,20 @@ public class LoadTimeWeavingConfiguration implements ImportAware, BeanClassLoade
@@ -94,20 +94,20 @@ public class LoadTimeWeavingConfiguration implements ImportAware, BeanClassLoade
@ -277,13 +277,15 @@ public class DateFormatter implements Formatter<Date> {
@@ -277,13 +277,15 @@ public class DateFormatter implements Formatter<Date> {
@ -184,14 +184,10 @@ public abstract class TemplateAwareExpressionParser implements ExpressionParser
@@ -184,14 +184,10 @@ public abstract class TemplateAwareExpressionParser implements ExpressionParser
@ -203,9 +199,8 @@ public abstract class TemplateAwareExpressionParser implements ExpressionParser
@@ -203,9 +199,8 @@ public abstract class TemplateAwareExpressionParser implements ExpressionParser
"' at position "+pos+" but most recent opening is '"+p.bracket+
"' at position "+p.pos);
}
break;
case'\'':
case'"':
}
case'\'','"'->{
// jump to the end of the literal
intendLiteral=expressionString.indexOf(ch,pos+1);
if(endLiteral==-1){
@ -213,7 +208,7 @@ public abstract class TemplateAwareExpressionParser implements ExpressionParser
@@ -213,7 +208,7 @@ public abstract class TemplateAwareExpressionParser implements ExpressionParser
"Found non terminating string literal starting at position "+pos);
@ -302,28 +302,31 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
@@ -302,28 +302,31 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
// Invocation on ConnectionProxy interface coming in...
switch(method.getName()){
case"equals":
case"equals"->{
// We must avoid fetching a target Connection for "equals".
// Only consider equal when proxies are identical.
return(proxy==args[0]);
case"hashCode":
}
case"hashCode"->{
// We must avoid fetching a target Connection for "hashCode",
// and we must return the same hash code even when the target
// Connection has been fetched: use hashCode of Connection proxy.
@ -332,58 +335,68 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
@@ -332,58 +335,68 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
// a physical JDBC Connection until absolutely necessary.
switch(method.getName()){
case"toString":
case"toString"->{
return"Lazy Connection proxy for target DataSource ["+getTargetDataSource()+"]";
case"getAutoCommit":
}
case"getAutoCommit"->{
if(this.autoCommit!=null){
returnthis.autoCommit;
}
// Else fetch actual Connection and check there,
// because we didn't have a default specified.
break;
case"setAutoCommit":
}
case"setAutoCommit"->{
this.autoCommit=(Boolean)args[0];
returnnull;
case"getTransactionIsolation":
}
case"getTransactionIsolation"->{
if(this.transactionIsolation!=null){
returnthis.transactionIsolation;
}
// Else fetch actual Connection and check there,
// because we didn't have a default specified.
break;
case"setTransactionIsolation":
}
case"setTransactionIsolation"->{
this.transactionIsolation=(Integer)args[0];
returnnull;
case"isReadOnly":
}
case"isReadOnly"->{
returnthis.readOnly;
case"setReadOnly":
}
case"setReadOnly"->{
this.readOnly=(Boolean)args[0];
returnnull;
case"getHoldability":
}
case"getHoldability"->{
returnthis.holdability;
case"setHoldability":
}
case"setHoldability"->{
this.holdability=(Integer)args[0];
returnnull;
case"commit":
case"rollback":
}
case"commit","rollback"->{
// Ignore: no statements created yet.
returnnull;
case"getWarnings":
case"clearWarnings":
}
case"getWarnings","clearWarnings"->{
// Ignore: no warnings to expose yet.
returnnull;
case"close":
}
case"close"->{
// Ignore: no target connection yet.
this.closed=true;
returnnull;
case"isClosed":
}
case"isClosed"->{
returnthis.closed;
default:
}
default->{
if(this.closed){
// Connection proxy closed, without ever having fetched a
@ -349,34 +349,28 @@ public class SingleConnectionDataSource extends DriverManagerDataSource
@@ -349,34 +349,28 @@ public class SingleConnectionDataSource extends DriverManagerDataSource
@ -176,13 +176,15 @@ public class TransactionAwareDataSourceProxy extends DelegatingDataSource {
@@ -176,13 +176,15 @@ public class TransactionAwareDataSourceProxy extends DelegatingDataSource {
// Invocation on ConnectionProxy interface coming in...
switch(method.getName()){
case"equals":
case"equals"->{
// Only considered as equal when proxies are identical.
return(proxy==args[0]);
case"hashCode":
}
case"hashCode"->{
// Use hashCode of Connection proxy.
returnSystem.identityHashCode(proxy);
case"toString":
}
case"toString"->{
// Allow for differentiating between the proxy and the raw Connection.
StringBuildersb=newStringBuilder("Transaction-aware proxy for target Connection ");
if(this.target!=null){
@ -192,23 +194,26 @@ public class TransactionAwareDataSourceProxy extends DelegatingDataSource {
@@ -192,23 +194,26 @@ public class TransactionAwareDataSourceProxy extends DelegatingDataSource {
sb.append(" from DataSource [").append(this.targetDataSource).append(']');
}
returnsb.toString();
case"close":
}
case"close"->{
// Handle close method: only close if not within a transaction.
@ -600,35 +600,35 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
@@ -600,35 +600,35 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
"setClientID call not supported on proxy for shared Connection. "+
"Set the 'clientId' property on the SingleConnectionFactory instead.");
"Set the 'clientId' property on the SingleConnectionFactory instead.");
}
case"setExceptionListener":
}
case"setExceptionListener"->{
// Handle setExceptionListener method: add to the chain.
synchronized(connectionMonitor){
if(aggregatedExceptionListener!=null){
@ -642,32 +642,36 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
@@ -642,32 +642,36 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
}
this.localExceptionListener=listener;
}
returnnull;
yieldnull;
}
else{
thrownewjakarta.jms.IllegalStateException(
"setExceptionListener call not supported on proxy for shared Connection. "+
"Set the 'exceptionListener' property on the SingleConnectionFactory instead. "+
"which will allow for registering further ExceptionListeners to the recovery chain.");
}
}
case"getExceptionListener":
}
case"getExceptionListener"->{
synchronized(connectionMonitor){
if(this.localExceptionListener!=null){
returnthis.localExceptionListener;
yieldthis.localExceptionListener;
}
else{
returngetExceptionListener();
yieldgetExceptionListener();
}
}
case"start":
}
case"start"->{
localStart();
returnnull;
case"stop":
yieldnull;
}
case"stop"->{
localStop();
returnnull;
case"close":
yieldnull;
}
case"close"->{
localStop();
synchronized(connectionMonitor){
if(this.localExceptionListener!=null){
@ -677,10 +681,9 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
@@ -677,10 +681,9 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
@ -707,16 +710,24 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
@@ -707,16 +710,24 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
@ -153,13 +153,11 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver {
@@ -153,13 +153,11 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver {
@ -1150,36 +1150,34 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
@@ -1150,36 +1150,34 @@ public class HibernateTemplate implements HibernateOperations, InitializingBean
@ -412,28 +412,25 @@ public class LocalSessionFactoryBuilder extends Configuration {
@@ -412,28 +412,25 @@ public class LocalSessionFactoryBuilder extends Configuration {
@ -711,13 +711,15 @@ public abstract class AbstractEntityManagerFactoryBean implements
@@ -711,13 +711,15 @@ public abstract class AbstractEntityManagerFactoryBean implements
// Only consider equal when proxies are identical.
return(proxy==args[0]);
case"hashCode":
}
case"hashCode"->{
// Use hashCode of EntityManagerFactory proxy.
returnSystem.identityHashCode(proxy);
case"unwrap":
}
case"unwrap"->{
// Handle JPA 2.1 unwrap method - could be a proxy match.
Class<?>targetClass=(Class<?>)args[0];
if(targetClass==null){
@ -726,7 +728,7 @@ public abstract class AbstractEntityManagerFactoryBean implements
@@ -726,7 +728,7 @@ public abstract class AbstractEntityManagerFactoryBean implements
@ -251,27 +251,24 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory
@@ -251,27 +251,24 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory
@ -143,28 +143,26 @@ public class TransactionAwareConnectionFactoryProxy extends DelegatingConnection
@@ -143,28 +143,26 @@ public class TransactionAwareConnectionFactoryProxy extends DelegatingConnection
}
}
switch(method.getName()){
case"unwrap":
returnthis.connection;
case"close":
// Handle close method: only close if not within a transaction.
@ -519,27 +519,24 @@ final class DefaultDatabaseClient implements DatabaseClient {
@@ -519,27 +519,24 @@ final class DefaultDatabaseClient implements DatabaseClient {
@ -57,7 +57,7 @@ public class JtaAfterCompletionSynchronization implements Synchronization {
@@ -57,7 +57,7 @@ public class JtaAfterCompletionSynchronization implements Synchronization {
@ -65,14 +65,15 @@ public class JtaAfterCompletionSynchronization implements Synchronization {
@@ -65,14 +65,15 @@ public class JtaAfterCompletionSynchronization implements Synchronization {
@ -303,40 +303,25 @@ public class WebClientResponseException extends WebClientException {
@@ -303,40 +303,25 @@ public class WebClientResponseException extends WebClientException {