diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java index a806b4037e8..ed046c495d8 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java @@ -651,7 +651,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport } public String getBeanName() { - return beanName; + return this.beanName; } @Override diff --git a/spring-aop/src/main/java/org/springframework/aop/target/AbstractPrototypeBasedTargetSource.java b/spring-aop/src/main/java/org/springframework/aop/target/AbstractPrototypeBasedTargetSource.java index 4376dcddf6f..2d6370ac51b 100644 --- a/spring-aop/src/main/java/org/springframework/aop/target/AbstractPrototypeBasedTargetSource.java +++ b/spring-aop/src/main/java/org/springframework/aop/target/AbstractPrototypeBasedTargetSource.java @@ -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"); * you may not use this file except in compliance with the License. @@ -74,8 +74,8 @@ public abstract class AbstractPrototypeBasedTargetSource extends AbstractBeanFac * @param target the bean instance to destroy */ protected void destroyPrototypeInstance(Object target) { - if (this.logger.isDebugEnabled()) { - this.logger.debug("Destroying instance of bean '" + getTargetBeanName() + "'"); + if (logger.isDebugEnabled()) { + logger.debug("Destroying instance of bean '" + getTargetBeanName() + "'"); } if (getBeanFactory() instanceof ConfigurableBeanFactory) { ((ConfigurableBeanFactory) getBeanFactory()).destroyBean(getTargetBeanName(), target); @@ -85,7 +85,7 @@ public abstract class AbstractPrototypeBasedTargetSource extends AbstractBeanFac ((DisposableBean) target).destroy(); } catch (Throwable ex) { - logger.error("Couldn't invoke destroy method of bean with name '" + getTargetBeanName() + "'", ex); + logger.error("Destroy method on bean with name '" + getTargetBeanName() + "' threw an exception", ex); } } } diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java index 5cd65f21b90..6086b29d7b2 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java @@ -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"); * you may not use this file except in compliance with the License. @@ -248,12 +248,12 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable { try { if (System.getSecurityManager() != null) { AccessController.doPrivileged((PrivilegedExceptionAction) () -> { - ((DisposableBean) bean).destroy(); + ((DisposableBean) this.bean).destroy(); return null; - }, acc); + }, this.acc); } else { - ((DisposableBean) bean).destroy(); + ((DisposableBean) this.bean).destroy(); } } catch (Throwable ex) { @@ -326,7 +326,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable { }); try { AccessController.doPrivileged((PrivilegedExceptionAction) () -> - destroyMethod.invoke(bean, args), acc); + destroyMethod.invoke(this.bean, args), this.acc); } catch (PrivilegedActionException pax) { throw (InvocationTargetException) pax.getException(); @@ -334,12 +334,12 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable { } else { ReflectionUtils.makeAccessible(destroyMethod); - destroyMethod.invoke(bean, args); + destroyMethod.invoke(this.bean, args); } } catch (InvocationTargetException ex) { - String msg = "Invocation of destroy method '" + this.destroyMethodName + - "' failed on bean with name '" + this.beanName + "'"; + String msg = "Destroy method '" + this.destroyMethodName + "' on bean with name '" + + this.beanName + "' threw an exception"; if (logger.isDebugEnabled()) { logger.warn(msg, ex.getTargetException()); } @@ -348,7 +348,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable { } } catch (Throwable ex) { - logger.error("Couldn't invoke destroy method '" + this.destroyMethodName + + logger.error("Failed to invoke destroy method '" + this.destroyMethodName + "' on bean with name '" + this.beanName + "'", ex); } } diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java b/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java index c02ceb33192..399fc74510b 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java @@ -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"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ public class AutoProxyRegistrar implements ImportBeanDefinitionRegistrar { } } } - if (!candidateFound) { + if (!candidateFound && logger.isWarnEnabled()) { String name = getClass().getSimpleName(); logger.warn(String.format("%s was imported but no annotations were found " + "having both 'mode' and 'proxyTargetClass' attributes of type " + diff --git a/spring-context/src/main/java/org/springframework/jmx/support/MBeanRegistrationSupport.java b/spring-context/src/main/java/org/springframework/jmx/support/MBeanRegistrationSupport.java index fdf2e7246f3..94a2f0d8eb9 100644 --- a/spring-context/src/main/java/org/springframework/jmx/support/MBeanRegistrationSupport.java +++ b/spring-context/src/main/java/org/springframework/jmx/support/MBeanRegistrationSupport.java @@ -151,7 +151,9 @@ public class MBeanRegistrationSupport { registeredBean = this.server.registerMBean(mbean, objectName); } catch (InstanceNotFoundException ex2) { - logger.error("Unable to replace existing MBean at [" + objectName + "]", ex2); + if (logger.isErrorEnabled()) { + logger.error("Unable to replace existing MBean at [" + objectName + "]", ex2); + } throw ex; } } @@ -181,9 +183,9 @@ public class MBeanRegistrationSupport { } if (!snapshot.isEmpty()) { logger.info("Unregistering JMX-exposed beans"); - } - for (ObjectName objectName : snapshot) { - doUnregister(objectName); + for (ObjectName objectName : snapshot) { + doUnregister(objectName); + } } } diff --git a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiServiceExporter.java b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiServiceExporter.java index 960fc466b56..7e80778e0ab 100644 --- a/spring-context/src/main/java/org/springframework/remoting/rmi/RmiServiceExporter.java +++ b/spring-context/src/main/java/org/springframework/remoting/rmi/RmiServiceExporter.java @@ -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"); * you may not use this file except in compliance with the License. @@ -436,8 +436,8 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing } catch (NotBoundException ex) { if (logger.isWarnEnabled()) { - logger.warn("RMI service '" + this.serviceName + "' is not bound to registry" - + (this.createdRegistry ? (" at port '" + this.registryPort + "' anymore") : ""), ex); + logger.warn("RMI service '" + this.serviceName + "' is not bound to registry" + + (this.createdRegistry ? (" at port '" + this.registryPort + "' anymore") : ""), ex); } } finally { @@ -454,8 +454,9 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing } catch (NoSuchObjectException ex) { if (logger.isWarnEnabled()) { - logger.warn("RMI object for service '" + this.serviceName + "' isn't exported anymore", ex); + logger.warn("RMI object for service '" + this.serviceName + "' is not exported anymore", ex); } } } + } diff --git a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationBasedExporter.java b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationBasedExporter.java index edd3e72eadf..cd07dc9ad6d 100644 --- a/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationBasedExporter.java +++ b/spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocationBasedExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,13 +79,13 @@ public abstract class RemoteInvocationBasedExporter extends RemoteExporter { } catch (NoSuchMethodException ex) { if (logger.isDebugEnabled()) { - logger.warn("Could not find target method for " + invocation, ex); + logger.debug("Could not find target method for " + invocation, ex); } throw ex; } catch (IllegalAccessException ex) { if (logger.isDebugEnabled()) { - logger.warn("Could not access target method for " + invocation, ex); + logger.debug("Could not access target method for " + invocation, ex); } throw ex; } diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java index 15c83502b8d..197c7f01d8b 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java @@ -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"); * you may not use this file except in compliance with the License. @@ -157,7 +157,7 @@ public class ScheduledExecutorFactoryBean extends ExecutorConfigurationSupport ((ScheduledThreadPoolExecutor) executor).setRemoveOnCancelPolicy(true); } else { - logger.info("Could not apply remove-on-cancel policy - not a Java 7+ ScheduledThreadPoolExecutor"); + logger.info("Could not apply remove-on-cancel policy - not a ScheduledThreadPoolExecutor"); } } diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java index ccddbf96dd7..6b8ef9745b8 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java @@ -99,7 +99,7 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport ((ScheduledThreadPoolExecutor) this.scheduledExecutor).setRemoveOnCancelPolicy(removeOnCancelPolicy); } else if (removeOnCancelPolicy && this.scheduledExecutor != null) { - logger.info("Could not apply remove-on-cancel policy - not a Java 7+ ScheduledThreadPoolExecutor"); + logger.info("Could not apply remove-on-cancel policy - not a ScheduledThreadPoolExecutor"); } } @@ -122,7 +122,7 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport ((ScheduledThreadPoolExecutor) this.scheduledExecutor).setRemoveOnCancelPolicy(true); } else { - logger.info("Could not apply remove-on-cancel policy - not a Java 7+ ScheduledThreadPoolExecutor"); + logger.info("Could not apply remove-on-cancel policy - not a ScheduledThreadPoolExecutor"); } } @@ -284,8 +284,8 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport private void executeAndTrack(ExecutorService executor, ListenableFutureTask listenableFuture) { Future scheduledFuture = executor.submit(errorHandlingTask(listenableFuture, false)); this.listenableFutureMap.put(scheduledFuture, listenableFuture); - listenableFuture.addCallback(result -> listenableFutureMap.remove(scheduledFuture), - ex -> listenableFutureMap.remove(scheduledFuture)); + listenableFuture.addCallback(result -> this.listenableFutureMap.remove(scheduledFuture), + ex -> this.listenableFutureMap.remove(scheduledFuture)); } @Override @@ -403,8 +403,8 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport try { return this.delegate.call(); } - catch (Throwable t) { - this.errorHandler.handleError(t); + catch (Throwable ex) { + this.errorHandler.handleError(ex); return null; } } diff --git a/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java b/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java index b50b8b8242d..19130e9ec15 100644 --- a/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java +++ b/spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java @@ -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"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package org.springframework.core.env; import java.security.AccessControlException; +import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashSet; import java.util.Map; @@ -250,6 +251,9 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @Override public void setActiveProfiles(String... profiles) { Assert.notNull(profiles, "Profile array must not be null"); + if (logger.isDebugEnabled()) { + logger.debug("Activating profiles " + Arrays.asList(profiles)); + } synchronized (this.activeProfiles) { this.activeProfiles.clear(); for (String profile : profiles) { diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java index ba018aed9a2..c2494f7574b 100755 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java @@ -520,7 +520,7 @@ public class CallMetaDataContext { matchedParameters.put(parameterName, SqlParameterSourceUtils.getTypedValue(parameterSource, sourceName)); } - else { + else if (logger.isWarnEnabled()) { logger.warn("Unable to locate the corresponding parameter value for '" + parameterName + "' within the parameter values provided: " + caseInsensitiveParameterNames.values()); @@ -587,7 +587,7 @@ public class CallMetaDataContext { for (String parameterName : callParameterNames.keySet()) { String parameterNameToMatch = provider.parameterNameToUse(parameterName); String callParameterName = callParameterNames.get(lowerCase(parameterNameToMatch)); - if (!matchedParameters.containsKey(callParameterName)) { + if (!matchedParameters.containsKey(callParameterName) && logger.isWarnEnabled()) { logger.warn("Unable to locate the corresponding parameter value for '" + parameterName + "' within the parameter values provided: " + inParameters.keySet()); } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataContext.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataContext.java index 62ca6ff74c8..a84c3936280 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataContext.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataContext.java @@ -264,7 +264,7 @@ public class TableMetaDataContext { /** - * Build the insert string based on configuration and meta-data information + * Build the insert string based on configuration and meta-data information. * @return the insert string to be used */ public String createInsertString(String... generatedKeyNames) { @@ -293,8 +293,10 @@ public class TableMetaDataContext { insertStatement.append(") VALUES("); if (columnCount < 1) { if (this.generatedKeyColumnsUsed) { - logger.info("Unable to locate non-key columns for table '" + - getTableName() + "' so an empty insert statement is generated"); + if (logger.isInfoEnabled()) { + logger.info("Unable to locate non-key columns for table '" + + getTableName() + "' so an empty insert statement is generated"); + } } else { throw new InvalidDataAccessApiUsageException("Unable to locate columns for table '" + @@ -360,6 +362,9 @@ public class TableMetaDataContext { } /** + * Does this database support a simple query to retrieve generated keys + * when the JDBC 3.0 feature is not supported: + * {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}? * @deprecated as of 4.3.15, in favor of {@link #getSimpleQueryForGetGeneratedKey} */ @Deprecated diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java index 0196a4bec06..46405f41a6e 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java @@ -91,8 +91,8 @@ public class EmbeddedDatabaseFactory { * generation of a pseudo-random unique ID to be used as the database name. *

Setting this flag to {@code true} overrides any explicit name set * via {@link #setDatabaseName}. - * @see #setDatabaseName * @since 4.2 + * @see #setDatabaseName */ public void setGenerateUniqueDatabaseName(boolean generateUniqueDatabaseName) { this.generateUniqueDatabaseName = generateUniqueDatabaseName; @@ -187,7 +187,7 @@ public class EmbeddedDatabaseFactory { if (this.dataSource instanceof SimpleDriverDataSource) { SimpleDriverDataSource simpleDriverDataSource = (SimpleDriverDataSource) this.dataSource; logger.info(String.format("Starting embedded database: url='%s', username='%s'", - simpleDriverDataSource.getUrl(), simpleDriverDataSource.getUsername())); + simpleDriverDataSource.getUrl(), simpleDriverDataSource.getUsername())); } else { logger.info(String.format("Starting embedded database '%s'", this.databaseName)); diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java index 00351f72b32..d70d8706a0a 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java @@ -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"); * you may not use this file except in compliance with the License. @@ -124,8 +124,8 @@ public class SQLErrorCodesFactory { // Check all beans of type SQLErrorCodes. errorCodes = lbf.getBeansOfType(SQLErrorCodes.class, true, false); - if (logger.isInfoEnabled()) { - logger.info("SQLErrorCodes loaded: " + errorCodes.keySet()); + if (logger.isDebugEnabled()) { + logger.debug("SQLErrorCodes loaded: " + errorCodes.keySet()); } } catch (BeansException ex) { diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java index 474907c6871..dae766e42a8 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java @@ -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"); * you may not use this file except in compliance with the License. @@ -188,7 +188,7 @@ public class TemporaryLobCreator implements LobCreator { } } catch (SQLException ex) { - logger.error("Could not free LOB", ex); + logger.error("Could not free LOBs", ex); } } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractHeaderMapper.java b/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractHeaderMapper.java index 6c3fe3385ff..8abe05eaff0 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractHeaderMapper.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractHeaderMapper.java @@ -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"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import org.springframework.messaging.MessageHeaders; import org.springframework.util.StringUtils; /** - * A base {@link HeaderMapper} implementation + * A base {@link HeaderMapper} implementation. * * @author Stephane Nicoll * @since 4.1 diff --git a/spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java index 578cc2a2e35..7f7685a9168 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/jibx/JibxMarshaller.java @@ -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"); * you may not use this file except in compliance with the License. @@ -218,7 +218,8 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe if (this.targetClass != null) { if (StringUtils.hasLength(this.bindingName)) { if (logger.isInfoEnabled()) { - logger.info("Configured for target class [" + this.targetClass + "] using binding [" + this.bindingName + "]"); + logger.info("Configured for target class [" + this.targetClass + + "] using binding [" + this.bindingName + "]"); } this.bindingFactory = BindingDirectory.getFactory(this.bindingName, this.targetClass); } @@ -230,11 +231,12 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe } } else if (this.targetPackage != null) { - if (!StringUtils.hasLength(bindingName)) { - bindingName = DEFAULT_BINDING_NAME; + if (!StringUtils.hasLength(this.bindingName)) { + this.bindingName = DEFAULT_BINDING_NAME; } if (logger.isInfoEnabled()) { - logger.info("Configured for target package [" + this.targetPackage + "] using binding [" + this.bindingName + "]"); + logger.info("Configured for target package [" + this.targetPackage + + "] using binding [" + this.bindingName + "]"); } this.bindingFactory = BindingDirectory.getFactory(this.bindingName, this.targetPackage); } @@ -290,9 +292,10 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe } private void marshalDocument(IMarshallingContext marshallingContext, Object graph) throws IOException, JiBXException { - if (StringUtils.hasLength(docTypeRootElementName)) { + if (StringUtils.hasLength(this.docTypeRootElementName)) { IXMLWriter xmlWriter = marshallingContext.getXmlWriter(); - xmlWriter.writeDocType(docTypeRootElementName, docTypeSystemId, docTypePublicId, docTypeInternalSubset); + xmlWriter.writeDocType(this.docTypeRootElementName, this.docTypeSystemId, + this.docTypePublicId, this.docTypeInternalSubset); } marshallingContext.marshalDocument(graph); } @@ -391,7 +394,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException { try { IUnmarshallingContext unmarshallingContext = createUnmarshallingContext(); - return unmarshallingContext.unmarshalDocument(inputStream, encoding); + return unmarshallingContext.unmarshalDocument(inputStream, this.encoding); } catch (JiBXException ex) { throw convertJibxException(ex, false); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketAnnotationMethodMessageHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketAnnotationMethodMessageHandler.java index 3f4ae0bda78..92b9cb7c718 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketAnnotationMethodMessageHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketAnnotationMethodMessageHandler.java @@ -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"); * you may not use this file except in compliance with the License. @@ -76,7 +76,9 @@ public class WebSocketAnnotationMethodMessageHandler extends SimpAnnotationMetho AnnotationExceptionHandlerMethodResolver resolver = new AnnotationExceptionHandlerMethodResolver(type); if (resolver.hasExceptionMappings()) { registerExceptionHandlerAdvice(bean, resolver); - logger.info("Detected @MessageExceptionHandler methods in " + bean); + if (logger.isInfoEnabled()) { + logger.info("Detected @MessageExceptionHandler methods in " + bean); + } } } } diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java index 457480c62ce..d4230371f4c 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java @@ -145,9 +145,9 @@ public class ServerEndpointExporter extends WebApplicationObjectSupport ServerContainer serverContainer = getServerContainer(); Assert.state(serverContainer != null, "No ServerContainer set. Most likely the server's own WebSocket ServletContainerInitializer " + - "has not run yet. Was the Spring ApplicationContext refreshed through a " + - "org.springframework.web.context.ContextLoaderListener, " + - "i.e. after the ServletContext has been fully initialized?"); + "has not run yet. Was the Spring ApplicationContext refreshed through a " + + "org.springframework.web.context.ContextLoaderListener, " + + "i.e. after the ServletContext has been fully initialized?"); try { if (logger.isInfoEnabled()) { logger.info("Registering @ServerEndpoint class: " + endpointClass);