Skip to content

Commit 05dec6d

Browse files
committed
Consistent use of @throws instead of @exception
(cherry picked from commit 5c813a3)
1 parent cc77b4b commit 05dec6d

File tree

7 files changed

+21
-19
lines changed

7 files changed

+21
-19
lines changed

spring-beans/src/main/java/org/springframework/beans/Mergeable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ public interface Mergeable {
4141
* @param parent the object to merge with
4242
* @return the result of the merge operation
4343
* @throws IllegalArgumentException if the supplied parent is {@code null}
44-
* @exception IllegalStateException if merging is not enabled for this instance
44+
* @throws IllegalStateException if merging is not enabled for this instance
4545
* (i.e. {@code mergeEnabled} equals {@code false}).
4646
*/
4747
Object merge(Object parent);

spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -217,7 +217,7 @@ public void setAutodetect(boolean autodetect) {
217217

218218
/**
219219
* Set the autodetection mode to use.
220-
* @exception IllegalArgumentException if the supplied value is not
220+
* @throws IllegalArgumentException if the supplied value is not
221221
* one of the {@code AUTODETECT_} constants
222222
* @see #setAutodetectModeName(String)
223223
* @see #AUTODETECT_ALL
@@ -234,7 +234,7 @@ public void setAutodetectMode(int autodetectMode) {
234234

235235
/**
236236
* Set the autodetection mode to use by name.
237-
* @exception IllegalArgumentException if the supplied value is not resolvable
237+
* @throws IllegalArgumentException if the supplied value is not resolvable
238238
* to one of the {@code AUTODETECT_} constants or is {@code null}
239239
* @see #setAutodetectMode(int)
240240
* @see #AUTODETECT_ALL
@@ -505,7 +505,7 @@ public void unregisterManagedResource(ObjectName objectName) {
505505
//---------------------------------------------------------------------
506506

507507
/**
508-
* Registers the defined beans with the {@link MBeanServer}.
508+
* Register the defined beans with the {@link MBeanServer}.
509509
* <p>Each bean is exposed to the {@code MBeanServer} via a
510510
* {@code ModelMBean}. The actual implemetation of the
511511
* {@code ModelMBean} interface used depends on the implementation of
@@ -565,7 +565,7 @@ protected boolean isBeanDefinitionLazyInit(ListableBeanFactory beanFactory, Stri
565565
}
566566

567567
/**
568-
* Registers an individual bean with the {@link #setServer MBeanServer}.
568+
* Register an individual bean with the {@link #setServer MBeanServer}.
569569
* <p>This method is responsible for deciding <strong>how</strong> a bean
570570
* should be exposed to the {@code MBeanServer}. Specifically, if the
571571
* supplied {@code mapValue} is the name of a bean that is configured
@@ -632,7 +632,7 @@ else if (mapValue != null) {
632632
}
633633

634634
/**
635-
* Replaces any bean names used as keys in the {@code NotificationListener}
635+
* Replace any bean names used as keys in the {@code NotificationListener}
636636
* mappings with their corresponding {@code ObjectName} values.
637637
* @param beanName the name of the bean to be registered
638638
* @param objectName the {@code ObjectName} under which the bean will be registered
@@ -666,6 +666,7 @@ private ObjectName registerBeanInstance(Object bean, String beanKey) throws JMEx
666666
mbeanToExpose = adaptedBean;
667667
}
668668
}
669+
669670
if (mbeanToExpose != null) {
670671
if (logger.isInfoEnabled()) {
671672
logger.info("Located MBean '" + beanKey + "': registering with JMX server as MBean [" +
@@ -682,11 +683,12 @@ private ObjectName registerBeanInstance(Object bean, String beanKey) throws JMEx
682683
doRegister(mbean, objectName);
683684
injectNotificationPublisherIfNecessary(bean, mbean, objectName);
684685
}
686+
685687
return objectName;
686688
}
687689

688690
/**
689-
* Registers beans that are configured for lazy initialization with the
691+
* Register beans that are configured for lazy initialization with the
690692
* {@code MBeanServer} indirectly through a proxy.
691693
* @param beanName the name of the bean in the {@code BeanFactory}
692694
* @param beanKey the key associated with this bean in the beans map

spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/HandlerMethodArgumentResolverComposite.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -102,7 +102,7 @@ public boolean supportsParameter(MethodParameter parameter) {
102102

103103
/**
104104
* Iterate over registered {@link HandlerMethodArgumentResolver}s and invoke the one that supports it.
105-
* @exception IllegalStateException if no suitable {@link HandlerMethodArgumentResolver} is found.
105+
* @throws IllegalStateException if no suitable {@link HandlerMethodArgumentResolver} is found.
106106
*/
107107
@Override
108108
public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception {

spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -100,7 +100,7 @@ public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDisc
100100
* @param message the current message being processed
101101
* @param providedArgs "given" arguments matched by type, not resolved
102102
* @return the raw value returned by the invoked method
103-
* @exception Exception raised if no suitable argument resolver can be found,
103+
* @throws Exception raised if no suitable argument resolver can be found,
104104
* or if the method raised an exception
105105
*/
106106
public Object invoke(Message<?> message, Object... providedArgs) throws Exception {

spring-web/src/main/java/org/springframework/web/method/annotation/AbstractWebArgumentResolverAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -87,7 +87,7 @@ public boolean supportsParameter(MethodParameter parameter) {
8787

8888
/**
8989
* Delegate to the {@link WebArgumentResolver} instance.
90-
* @exception IllegalStateException if the resolved value is not assignable
90+
* @throws IllegalStateException if the resolved value is not assignable
9191
* to the method parameter.
9292
*/
9393
@Override

spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -119,7 +119,7 @@ public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDisc
119119
* @param mavContainer the ModelAndViewContainer for this request
120120
* @param providedArgs "given" arguments matched by type, not resolved
121121
* @return the raw value returned by the invoked method
122-
* @exception Exception raised if no suitable argument resolver can be found,
122+
* @throws Exception raised if no suitable argument resolver can be found,
123123
* or if the method raised an exception
124124
*/
125125
public Object invokeForRequest(NativeWebRequest request, ModelAndViewContainer mavContainer,

spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/SockJsServiceConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ public interface SockJsServiceConfig {
6868

6969
/**
7070
* The codec to use for encoding and decoding SockJS messages.
71-
* @exception IllegalStateException if no {@link SockJsMessageCodec} is available
71+
* @throws IllegalStateException if no {@link SockJsMessageCodec} is available
7272
*/
7373
SockJsMessageCodec getMessageCodec();
7474

0 commit comments

Comments
 (0)