language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-messaging/src/main/java/org/springframework/messaging/core/AbstractMessageSendingTemplate.java
@@ -54,7 +54,7 @@ public D getDefaultDestination() { /** * Set the {@link MessageConverter} that is to be used to convert * between Messages and objects for this template. - * <p>The default is {@link SimplePayloadMessageConverter}. + * <p>The default is {@link SimpleMessageConverter}. */ public void setMessageConverter(MessageConverter messageConverter) { Assert.notNull(messageConverter, "'messageConverter' must not be null");
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractNamedValueMethodArgumentResolver.java
@@ -19,6 +19,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.config.BeanExpressionContext; import org.springframework.beans.factory.config.BeanExpressionResolver; import org.springframework.beans.factory.config.ConfigurableBeanFactory; @@ -37,20 +38,20 @@ * Abstract base class for resolving method arguments from a named value. Message headers, * and path variables are examples of named values. Each may have a name, a required flag, * and a default value. - * <p> - * Subclasses define how to do the following: + * + * <p>Subclasses define how to do the following: * <ul> * <li>Obtain named value information for a method parameter * <li>Resolve names into argument values * <li>Handle missing argument values when argument values are required * <li>Optionally handle a resolved value * </ul> - * <p> - * A default value string can contain ${...} placeholders and Spring Expression Language - * #{...} expressions. For this to work a {@link ConfigurableBeanFactory} must be supplied - * to the class constructor. - * <p> - * A {@link ConversionService} may be used to apply type conversion to the resolved + * + * <p>A default value string can contain ${...} placeholders and Spring Expression + * Language {@code #{...}} expressions. For this to work a {@link ConfigurableBeanFactory} + * must be supplied to the class constructor. + * + * <p>A {@link ConversionService} may be used to apply type conversion to the resolved * argument value if it doesn't match the method parameter type. * * @author Rossen Stoyanchev @@ -70,12 +71,11 @@ public abstract class AbstractNamedValueMethodArgumentResolver implements Handle /** * Constructor with a {@link ConversionService} and a {@link BeanFactory}. - * * @param cs conversion service for converting values to match the - * target method parameter type - * @param beanFactory a bean factory to use for resolving ${...} placeholder and - * #{...} SpEL expressions in default values, or {@code null} if default values - * are not expected to contain expressions + * target method parameter type + * @param beanFactory a bean factory to use for resolving {@code ${...}} placeholder + * and {@code #{...}} SpEL expressions in default values, or {@code null} if default + * values are not expected to contain expressions */ protected AbstractNamedValueMethodArgumentResolver(ConversionService cs, ConfigurableBeanFactory beanFactory) { this.conversionService = (cs != null) ? cs : new DefaultConversionService(); @@ -154,7 +154,6 @@ private NamedValueInfo updateNamedValueInfo(MethodParameter parameter, NamedValu * @param parameter the method parameter to resolve to an argument value * @param message the current request * @param name the name of the value being resolved - * * @return the resolved argument. May be {@code null} * @throws Exception in case of errors */ @@ -180,7 +179,6 @@ private Object resolveDefaultValue(String defaultValue) { * Invoked when a named value is required, but * {@link #resolveArgumentInternal(MethodParameter, Message, String)} returned {@code null} and * there is no default value. Subclasses typically throw an exception in this case. - * * @param name the name for the value * @param parameter the method parameter * @param message the message being processed @@ -208,7 +206,6 @@ else if (paramType.isPrimitive()) { /** * Invoked after a value is resolved. - * * @param arg the resolved argument value * @param name the argument name * @param parameter the argument parameter type
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserDestinationResolver.java
@@ -29,7 +29,7 @@ import java.util.Set; /** - * A default implementation of {@link @UserDestinationResolver}. + * A default implementation of {@link UserDestinationResolver}. * <p> * Resolves messages sent to destination patterns "/user/{user-name}/**" as well as * subscriptions to destinations "/user/queue/**" where the "/user/" prefix used to
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-messaging/src/main/java/org/springframework/messaging/simp/handler/DefaultUserSessionRegistry.java
@@ -25,7 +25,7 @@ import java.util.concurrent.CopyOnWriteArraySet; /** - * A default thread-safe implementation of {@link @UserSessionRegistry}. + * A default thread-safe implementation of {@link UserSessionRegistry}. * * @author Rossen Stoyanchev * @since 4.0
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
@@ -36,6 +36,7 @@ import java.util.Date; import java.util.Map; import java.util.UUID; + import javax.activation.DataHandler; import javax.activation.DataSource; import javax.xml.XMLConstants; @@ -63,6 +64,7 @@ import javax.xml.transform.Source; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; @@ -74,7 +76,6 @@ import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; - import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.JdkVersion;
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java
@@ -182,7 +182,7 @@ public MockServletContext(ResourceLoader resourceLoader) { * Create a new MockServletContext using the supplied resource base path and * resource loader. * <p>Registers a {@link MockRequestDispatcher} for the Servlet named - * {@value #COMMON_DEFAULT_SERVLET_NAME}. + * {@literal 'default'}. * @param resourceBasePath the root directory of the WAR (should not end with a slash) * @param resourceLoader the ResourceLoader to use (or null for the default) * @see #registerNamedDispatcher @@ -383,7 +383,7 @@ public void unregisterNamedDispatcher(String name) { /** * Get the name of the <em>default</em> {@code Servlet}. - * <p>Defaults to {@value #COMMON_DEFAULT_SERVLET_NAME}. + * <p>Defaults to {@literal 'default'}. * @see #setDefaultServletName */ public String getDefaultServletName() {
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunAfterTestClassCallbacks.java
@@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.List; +import org.junit.runners.model.MultipleFailureException; import org.junit.runners.model.Statement; import org.springframework.test.context.TestContextManager;
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunAfterTestMethodCallbacks.java
@@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; +import org.junit.runners.model.MultipleFailureException; import org.junit.runners.model.Statement; import org.springframework.test.context.TestContextManager;
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextTestExecutionListener.java
@@ -72,7 +72,7 @@ protected void dirtyContext(TestContext testContext, HierarchyMode hierarchyMode * mode} is set to {@link ClassMode#AFTER_EACH_TEST_METHOD * AFTER_EACH_TEST_METHOD}, the {@linkplain ApplicationContext application * context} of the test context will be - * {@linkplain TestContext#markApplicationContextDirty() marked as dirty} and the + * {@linkplain TestContext#markApplicationContextDirty marked as dirty} and the * {@link DependencyInjectionTestExecutionListener#REINJECT_DEPENDENCIES_ATTRIBUTE} * in the test context will be set to {@code true}. */ @@ -107,7 +107,7 @@ public void afterTestMethod(TestContext testContext) throws Exception { * If the test class of the supplied {@linkplain TestContext test context} is * annotated with {@link DirtiesContext &#064;DirtiesContext}, the * {@linkplain ApplicationContext application context} of the test context will - * be {@linkplain TestContext#markApplicationContextDirty() marked as dirty}, + * be {@linkplain TestContext#markApplicationContextDirty marked as dirty}, * and the * {@link DependencyInjectionTestExecutionListener#REINJECT_DEPENDENCIES_ATTRIBUTE * REINJECT_DEPENDENCIES_ATTRIBUTE} in the test context will be set to
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-tx/src/main/java/org/springframework/dao/support/DaoSupport.java
@@ -31,7 +31,6 @@ * @author Juergen Hoeller * @since 1.2.2 * @see org.springframework.jdbc.core.support.JdbcDaoSupport - * @see org.springframework.orm.jdo.support.JdoDaoSupport */ public abstract class DaoSupport implements InitializingBean {
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionProxyFactoryBean.java
@@ -70,8 +70,7 @@ * <p>The "preInterceptors" and "postInterceptors" properties can be set to add * additional interceptors to the mix, like * {@link org.springframework.aop.interceptor.PerformanceMonitorInterceptor} or - * {@link org.springframework.orm.hibernate3.HibernateInterceptor} / - * {@link org.springframework.orm.jdo.JdoInterceptor}. + * {@link org.springframework.orm.hibernate3.HibernateInterceptor}. * * <p><b>HINT:</b> This class is often used with parent / child bean definitions. * Typically, you will define the transaction manager and default transaction
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-web/src/main/java/org/springframework/http/StreamingHttpOutputMessage.java
@@ -29,21 +29,19 @@ public interface StreamingHttpOutputMessage extends HttpOutputMessage { /** * Sets the streaming body for this message. - * * @param body the streaming body */ void setBody(Body body); /** * Defines the contract for bodies that can be written directly to a - * {@link OuputStream}. It is useful with HTTP client libraries that provide indirect + * {@link OutputStream}. It is useful with HTTP client libraries that provide indirect * access to an {@link OutputStream} via a callback mechanism. */ public interface Body { /** - * Writes this body to the given {@link OuputStream}. - * + * Writes this body to the given {@link OutputStream}. * @param outputStream the output stream to write to * @throws IOException in case of errors */
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
@@ -63,7 +63,7 @@ * LinkedMultiValueMap&lt;String, Object&gt;(); parts.add("field 1", "value 1"); parts.add("file", new * ClassPathResource("myFile.jpg")); template.postForLocation("http://example.com/myFileUpload", parts); </pre> * - * <p>Some methods in this class were inspired by {@link org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity}. + * <p>Some methods in this class were inspired by {@code org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity}. * * @author Arjen Poutsma * @see MultiValueMap
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpComponentsHttpInvokerRequestExecutor.java
@@ -64,7 +64,7 @@ public class HttpComponentsHttpInvokerRequestExecutor extends AbstractHttpInvoke /** * Create a new instance of the HttpComponentsHttpInvokerRequestExecutor with a default - * {@link HttpClient} that uses a default {@link org.apache.http.impl.conn.PoolingClientConnectionManager}. + * {@link HttpClient} that uses a default {@code org.apache.http.impl.conn.PoolingClientConnectionManager}. */ public HttpComponentsHttpInvokerRequestExecutor() { org.apache.http.conn.scheme.SchemeRegistry schemeRegistry = new org.apache.http.conn.scheme.SchemeRegistry();
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-web/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerClientInterceptor.java
@@ -100,10 +100,10 @@ public String getCodebaseUrl() { * Set the HttpInvokerRequestExecutor implementation to use for executing * remote invocations. * <p>Default is {@link SimpleHttpInvokerRequestExecutor}. Alternatively, - * consider using {@link CommonsHttpInvokerRequestExecutor} for more + * consider using {@link HttpComponentsHttpInvokerRequestExecutor} for more * sophisticated needs. * @see SimpleHttpInvokerRequestExecutor - * @see CommonsHttpInvokerRequestExecutor + * @see HttpComponentsHttpInvokerRequestExecutor */ public void setHttpInvokerRequestExecutor(HttpInvokerRequestExecutor httpInvokerRequestExecutor) { this.httpInvokerRequestExecutor = httpInvokerRequestExecutor;
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-web/src/main/java/org/springframework/web/bind/ServletRequestDataBinder.java
@@ -31,10 +31,6 @@ * which include specifying allowed/required fields, and registering custom * property editors. * - * <p>Used by Spring Web MVC's BaseCommandController and MultiActionController. - * Note that BaseCommandController and its subclasses allow for easy customization - * of the binder instances that they use through overriding {@code initBinder}. - * * <p>Can also be used for manual data binding in custom web controllers: * for example, in a plain Controller implementation or in a MultiActionController * handler method. Simply instantiate a ServletRequestDataBinder for each binding @@ -59,7 +55,6 @@ * @see #setAllowedFields * @see #setRequiredFields * @see #setFieldMarkerPrefix - * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder */ public class ServletRequestDataBinder extends WebDataBinder { @@ -99,7 +94,6 @@ public ServletRequestDataBinder(Object target, String objectName) { * @param request request with parameters to bind (can be multipart) * @see org.springframework.web.multipart.MultipartHttpServletRequest * @see org.springframework.web.multipart.MultipartFile - * @see #bindMultipartFiles * @see #bind(org.springframework.beans.PropertyValues) */ public void bind(ServletRequest request) {
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-web/src/main/java/org/springframework/web/bind/annotation/RequestMapping.java
@@ -161,7 +161,7 @@ * * <p>The following return types are supported for handler methods: * <ul> - * <li>A {@link ModelAndView} object (Servlet MVC or Portlet MVC), + * <li>A {@code ModelAndView} object (Servlet MVC or Portlet MVC), * with the model implicitly enriched with command objects and the results * of {@link ModelAttribute @ModelAttribute} annotated reference data accessor methods. * <li>A {@link org.springframework.ui.Model Model} object, with the view name
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-web/src/main/java/org/springframework/web/context/support/WebApplicationContextUtils.java
@@ -63,7 +63,6 @@ * @see org.springframework.web.servlet.FrameworkServlet * @see org.springframework.web.servlet.DispatcherServlet * @see org.springframework.web.jsf.FacesContextUtils - * @see org.springframework.web.jsf.SpringBeanVariableResolver * @see org.springframework.web.jsf.el.SpringBeanFacesELResolver */ public abstract class WebApplicationContextUtils {
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/bind/PortletRequestDataBinder.java
@@ -32,10 +32,6 @@ * which include specifying allowed/required fields, and registering custom * property editors. * - * <p>Used by Spring Portlet MVC's BaseCommandController. - * Note that BaseCommandController and its subclasses allow for easy customization - * of the binder instances that they use through overriding {@code initBinder}. - * * <p>Can also be used for manual data binding in custom web controllers: * for example, in a plain Portlet Controller implementation. Simply instantiate * a PortletRequestDataBinder for each binding process, and invoke {@code bind} @@ -61,7 +57,6 @@ * @see #setAllowedFields * @see #setRequiredFields * @see #setFieldMarkerPrefix - * @see org.springframework.web.portlet.mvc.BaseCommandController#initBinder */ public class PortletRequestDataBinder extends WebDataBinder { @@ -101,7 +96,6 @@ public PortletRequestDataBinder(Object target, String objectName) { * @param request request with parameters to bind (can be multipart) * @see org.springframework.web.portlet.multipart.MultipartActionRequest * @see org.springframework.web.multipart.MultipartFile - * @see #bindMultipartFiles * @see #bind(org.springframework.beans.PropertyValues) */ public void bind(PortletRequest request) {
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/MvcUriComponentsBuilder.java
@@ -205,7 +205,7 @@ public static UriComponentsBuilder fromMethod(Method method, Object... argumentV * * </pre> * - * The above supports {@codce @PathVariable} and {@code @RequestParam} method parameters. + * The above supports {@code @PathVariable} and {@code @RequestParam} method parameters. * Any other arguments can be provided as {@literal null} and will be ignored. * <p> * Additional (custom) argument types can be supported through an implementation
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java
@@ -66,8 +66,7 @@ public class StompSubProtocolHandler implements SubProtocolHandler { /** * Provide a registry with which to register active user session ids. - * - * @see {@link org.springframework.messaging.simp.handler.UserDestinationMessageHandler} + * @see org.springframework.messaging.simp.handler.UserDestinationMessageHandler */ public void setUserSessionRegistry(UserSessionRegistry registry) { this.userSessionRegistry = registry;
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-websocket/src/main/java/org/springframework/web/socket/server/config/WebSocketConfigurationSupport.java
@@ -45,7 +45,7 @@ protected void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { /** * The default TaskScheduler to use if none is configured via - * {@link SockJsServiceRegistration#setTaskScheduler()}, i.e. + * {@link SockJsServiceRegistration#setTaskScheduler}, i.e. * <pre class="code"> * &#064;Configuration * &#064;EnableWebSocket
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-websocket/src/main/java/org/springframework/web/socket/server/support/WebSocketHttpRequestHandler.java
@@ -49,10 +49,6 @@ * {@link HttpServletResponse} to {@link ServerHttpRequest} and {@link ServerHttpResponse} * respectively. * - * <p>The {@link #applyDefaultDecorators(WebSocketHandler)} method decorates the given - * WebSocketHandler with a logging and exception handling decorators. This method can - * be overridden to change that. - * * @author Rossen Stoyanchev * @since 4.0 */
true
Other
spring-projects
spring-framework
a31ac882c54b9a32345274b09647b7423ecf0839.json
Fix various javadoc warnings
spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/TransportHandlerSupport.java
@@ -23,7 +23,7 @@ /** * @author Rossen Stoyanchev - * @sicne 4.0 + * @since 4.0 */ public abstract class TransportHandlerSupport {
true
Other
spring-projects
spring-framework
c5779e2ed6b2235dfac8de20aa9a2faf22dfc317.json
Remove unused GlassFishLoadTimeWeaverTests Delete the unused GlassFishLoadTimeWeaverTests and in the process fix the "Unable to load JUnit4 runner to calculate Ignored test cases" Gradle error. Issue: SPR-10563
spring-context/src/test/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaverTests.java
@@ -1,150 +0,0 @@ -/* - * Copyright 2002-2012 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.instrument.classloading.glassfish; - -import org.junit.Ignore; - -// converting away from old-style EasyMock APIs was problematic with this class -// glassfish dependencies no longer on classpath -@Ignore -public class GlassFishLoadTimeWeaverTests { - -// private MockControl loaderCtrl; -// private GlassFishClassLoaderAdapter loader; -// private LoadTimeWeaver ltw; -// -// private class DummyInstrumentableClassLoader extends SecureClassLoader { -// -// String INSTR_CL_NAME = GlassFishClassLoaderAdapter.INSTRUMENTABLE_CLASSLOADER_GLASSFISH_V2; -// -// public DummyInstrumentableClassLoader() { -// super(); -// } -// -// public DummyInstrumentableClassLoader(ClassLoader parent) { -// super(parent); -// } -// -// private List<ClassTransformer> v2Transformers = new ArrayList<ClassTransformer>(); -// private List<ClassFileTransformer> v3Transformers = new ArrayList<ClassFileTransformer>(); -// -// public void addTransformer(ClassTransformer transformer) { -// v2Transformers.add(transformer); -// } -// -// public void addTransformer(ClassFileTransformer transformer) { -// v3Transformers.add(transformer); -// } -// -// public ClassLoader copy() { -// return new DummyInstrumentableClassLoader(); -// } -// -// @Override -// public Class<?> loadClass(String name) throws ClassNotFoundException { -// if (INSTR_CL_NAME.equals(name)) { -// return this.getClass(); -// } -// -// return getClass().getClassLoader().loadClass(name); -// } -// } -// -// @Before -// public void setUp() throws Exception { -// ltw = new GlassFishLoadTimeWeaver(new DummyInstrumentableClassLoader()); -// } -// -// @After -// public void tearDown() throws Exception { -// loaderCtrl.verify(); -// ltw = null; -// } -// -// @Test -// public void testGlassFishLoadTimeWeaver() { -// try { -// ltw = new GlassFishLoadTimeWeaver(); -// fail("expected exception"); -// } catch (IllegalArgumentException ex) { -// // expected -// } -// -// } -// -// @Test -// public void testGlassFishLoadTimeWeaverClassLoader() { -// try { -// ltw = new GlassFishLoadTimeWeaver(null); -// fail("expected exception"); -// } catch (RuntimeException e) { -// // expected -// } -// -// ClassLoader cl1 = new URLClassLoader(new URL[0]); -// ClassLoader cl2 = new URLClassLoader(new URL[0], cl1); -// ClassLoader cl3 = new DummyInstrumentableClassLoader(cl2); -// ClassLoader cl4 = new URLClassLoader(new URL[0], cl3); -// -// ltw = new GlassFishLoadTimeWeaver(cl4); -// assertSame(cl3, ltw.getInstrumentableClassLoader()); -// -// cl1 = new URLClassLoader(new URL[0]); -// cl2 = new URLClassLoader(new URL[0], cl1); -// cl3 = new DummyInstrumentableClassLoader(cl2); -// cl4 = new DummyInstrumentableClassLoader(cl3); -// -// ltw = new GlassFishLoadTimeWeaver(cl4); -// assertSame(cl4, ltw.getInstrumentableClassLoader()); -// } -// -// @Test -// public void testAddTransformer() { -// ClassFileTransformer transformer = MockControl.createNiceControl(ClassFileTransformer.class).getMock(); -// loaderCtrl.reset(); -// loader.addTransformer(transformer); -// loaderCtrl.setMatcher(new ArgumentsMatcher() { -// -// public boolean matches(Object[] arg0, Object[] arg1) { -// for (int i = 0; i < arg0.length; i++) { -// if (arg0 != null && arg0.getClass() != arg1.getClass()) -// return false; -// } -// return true; -// } -// -// public String toString(Object[] arg0) { -// return Arrays.toString(arg0); -// } -// -// }); -// -// loaderCtrl.replay(); -// -// ltw.addTransformer(transformer); -// } -// -// @Test -// public void testGetThrowawayClassLoader() { -// loaderCtrl.reset(); -// ClassLoader cl = new URLClassLoader(new URL[0]); -// loaderCtrl.expectAndReturn(loader.getClassLoader(), cl); -// loaderCtrl.replay(); -// -// assertSame(ltw.getThrowawayClassLoader(), cl); -// } -}
false
Other
spring-projects
spring-framework
119e793994796bc4e7ebfd7d57fe3b219c07c68b.json
Fix concurrency issue in TestDispatcherServlet This change fixes a timing issue in tests using Spring MVC Tests where assertions on an async result may not wait long enough. The fix involves the use of a new callback in MockAsyncContext that allows tests to detect when an async dispatch has been invoked. Issue: SPR-10838
spring-test/src/main/java/org/springframework/mock/web/MockAsyncContext.java
@@ -28,7 +28,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.logging.Log; import org.springframework.beans.BeanUtils; +import org.springframework.util.Assert; import org.springframework.web.util.WebUtils; /** @@ -49,13 +51,20 @@ public class MockAsyncContext implements AsyncContext { private long timeout = 10 * 1000L; // 10 seconds is Tomcat's default + private final List<Runnable> dispatchHandlers = new ArrayList<Runnable>(); + public MockAsyncContext(ServletRequest request, ServletResponse response) { this.request = (HttpServletRequest) request; this.response = (HttpServletResponse) response; } + public void addDispatchHandler(Runnable handler) { + Assert.notNull(handler); + this.dispatchHandlers.add(handler); + } + @Override public ServletRequest getRequest() { return this.request; @@ -84,6 +93,9 @@ public void dispatch(String path) { @Override public void dispatch(ServletContext context, String path) { this.dispatchedPath = path; + for (Runnable r : this.dispatchHandlers) { + r.run(); + } } public String getDispatchedPath() {
true
Other
spring-projects
spring-framework
119e793994796bc4e7ebfd7d57fe3b219c07c68b.json
Fix concurrency issue in TestDispatcherServlet This change fixes a timing issue in tests using Spring MVC Tests where assertions on an async result may not wait long enough. The fix involves the use of a new callback in MockAsyncContext that allows tests to detect when an async dispatch has been invoked. Issue: SPR-10838
spring-test/src/main/java/org/springframework/test/web/servlet/TestDispatcherServlet.java
@@ -25,13 +25,10 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.springframework.mock.web.MockAsyncContext; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter; -import org.springframework.web.context.request.async.DeferredResult; -import org.springframework.web.context.request.async.DeferredResultProcessingInterceptorAdapter; -import org.springframework.web.context.request.async.WebAsyncManager; -import org.springframework.web.context.request.async.WebAsyncUtils; +import org.springframework.web.context.request.async.*; import org.springframework.web.servlet.DispatcherServlet; import org.springframework.web.servlet.HandlerExecutionChain; import org.springframework.web.servlet.ModelAndView; @@ -50,44 +47,52 @@ final class TestDispatcherServlet extends DispatcherServlet { private static final String KEY = TestDispatcherServlet.class.getName() + ".interceptor"; + /** * Create a new instance with the given web application context. */ public TestDispatcherServlet(WebApplicationContext webApplicationContext) { super(webApplicationContext); } + @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - CountDownLatch latch = registerAsyncInterceptors(request); - getMvcResult(request).setAsyncResultLatch(latch); + registerAsyncResultInterceptors(request); super.service(request, response); - } - private CountDownLatch registerAsyncInterceptors(final HttpServletRequest servletRequest) { - - final CountDownLatch asyncResultLatch = new CountDownLatch(1); - - WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(servletRequest); + if (request.isAsyncStarted()) { + addAsyncResultLatch(request); + } + } + private void registerAsyncResultInterceptors(final HttpServletRequest request) { + WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request); asyncManager.registerCallableInterceptor(KEY, new CallableProcessingInterceptorAdapter() { @Override - public <T> void postProcess(NativeWebRequest request, Callable<T> task, Object value) throws Exception { - getMvcResult(servletRequest).setAsyncResult(value); - asyncResultLatch.countDown(); + public <T> void postProcess(NativeWebRequest r, Callable<T> task, Object value) throws Exception { + getMvcResult(request).setAsyncResult(value); } }); asyncManager.registerDeferredResultInterceptor(KEY, new DeferredResultProcessingInterceptorAdapter() { @Override - public <T> void postProcess(NativeWebRequest request, DeferredResult<T> result, Object value) throws Exception { - getMvcResult(servletRequest).setAsyncResult(value); - asyncResultLatch.countDown(); + public <T> void postProcess(NativeWebRequest r, DeferredResult<T> result, Object value) throws Exception { + getMvcResult(request).setAsyncResult(value); } }); + } - return asyncResultLatch; + private void addAsyncResultLatch(HttpServletRequest request) { + final CountDownLatch latch = new CountDownLatch(1); + ((MockAsyncContext) request.getAsyncContext()).addDispatchHandler(new Runnable() { + @Override + public void run() { + latch.countDown(); + } + }); + getMvcResult(request).setAsyncResultLatch(latch); } protected DefaultMvcResult getMvcResult(ServletRequest request) {
true
Other
spring-projects
spring-framework
ce3e55743f23100f0e4044320cdb1f168ca76ea3.json
Extract IdGenerator into a top-level class
spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java
@@ -0,0 +1,62 @@ +/* + * Copyright 2002-2013 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.util; + +import java.math.BigInteger; +import java.security.SecureRandom; +import java.util.Random; +import java.util.UUID; + +/** + * A variation of {@link UUID#randomUUID()} that uses {@link SecureRandom} only for + * the initial seed and {@link Random} thereafter. This provides better performance + * in exchange for less securely random id's. + * + * @author Rossen Stoyanchev + * @author Rob Winch + * @since 4.0 + */ +public class AlternativeJdkIdGenerator implements IdGenerator { + + private final Random random; + + + public AlternativeJdkIdGenerator() { + byte[] seed = new SecureRandom().generateSeed(8); + this.random = new Random(new BigInteger(seed).longValue()); + } + + + public UUID generateId() { + + byte[] randomBytes = new byte[16]; + this.random.nextBytes(randomBytes); + + long mostSigBits = 0; + for (int i = 0; i < 8; i++) { + mostSigBits = (mostSigBits << 8) | (randomBytes[i] & 0xff); + } + + long leastSigBits = 0; + for (int i = 8; i < 16; i++) { + leastSigBits = (leastSigBits << 8) | (randomBytes[i] & 0xff); + } + + return new UUID(mostSigBits, leastSigBits); + } + +}
true
Other
spring-projects
spring-framework
ce3e55743f23100f0e4044320cdb1f168ca76ea3.json
Extract IdGenerator into a top-level class
spring-core/src/main/java/org/springframework/util/IdGenerator.java
@@ -0,0 +1,35 @@ +/* + * Copyright 2002-2013 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.util; + +import java.util.UUID; + +/** + * Contract for generating {@link UUID} identifiers. + * + * @author Rossen Stoyanchev + * @since 4.0 + */ +public interface IdGenerator { + + /** + * Generate a new identifier. + * @return the generated identifier + */ + UUID generateId(); + +}
true
Other
spring-projects
spring-framework
ce3e55743f23100f0e4044320cdb1f168ca76ea3.json
Extract IdGenerator into a top-level class
spring-messaging/src/main/java/org/springframework/messaging/MessageHeaders.java
@@ -20,8 +20,6 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; -import java.math.BigInteger; -import java.security.SecureRandom; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -30,12 +28,13 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Random; import java.util.Set; import java.util.UUID; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.util.AlternativeJdkIdGenerator; +import org.springframework.util.IdGenerator; /** * The headers for a {@link Message} @@ -243,40 +242,4 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE in.defaultReadObject(); } - public static interface IdGenerator { - UUID generateId(); - } - - /** - * A variation of {@link UUID#randomUUID()} that uses {@link SecureRandom} only for - * the initial seed and {@link Random} thereafter, which provides better performance - * in exchange for less securely random id's. - */ - public static class AlternativeJdkIdGenerator implements IdGenerator { - - private final Random random; - - public AlternativeJdkIdGenerator() { - byte[] seed = new SecureRandom().generateSeed(8); - this.random = new Random(new BigInteger(seed).longValue()); - } - - public UUID generateId() { - - byte[] randomBytes = new byte[16]; - this.random.nextBytes(randomBytes); - - long mostSigBits = 0; - for (int i = 0; i < 8; i++) { - mostSigBits = (mostSigBits << 8) | (randomBytes[i] & 0xff); - } - long leastSigBits = 0; - for (int i = 8; i < 16; i++) { - leastSigBits = (leastSigBits << 8) | (randomBytes[i] & 0xff); - } - - return new UUID(mostSigBits, leastSigBits); - } - } - }
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java
@@ -67,7 +67,7 @@ public class DelegatePerTargetObjectIntroductionInterceptor extends Introduction public DelegatePerTargetObjectIntroductionInterceptor(Class<?> defaultImplType, Class<?> interfaceType) { this.defaultImplType = defaultImplType; this.interfaceType = interfaceType; - // cCeate a new delegate now (but don't store it in the map). + // Create a new delegate now (but don't store it in the map). // We do this for two reasons: // 1) to fail early if there is a problem instantiating delegates // 2) to populate the interface map once and once only
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandler.java
@@ -36,7 +36,7 @@ * it encounters a custom tag directly under a {@code &lt;bean&gt;} tag. * * <p>Developers writing their own custom element extensions typically will - * not implement this interface drectly, but rather make use of the provided + * not implement this interface directly, but rather make use of the provided * {@link NamespaceHandlerSupport} class. * * @author Rob Harrop
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-core/src/main/java/org/springframework/asm/Frame.java
@@ -585,7 +585,7 @@ private void push(final int type) { } // pushes the type on the output stack outputStack[outputStackTop++] = type; - // updates the maximun height reached by the output stack, if needed + // updates the maximum height reached by the output stack, if needed int top = owner.inputStackTop + outputStackTop; if (top > owner.outputStackMax) { owner.outputStackMax = top;
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-core/src/main/java/org/springframework/util/AutoPopulatingList.java
@@ -276,7 +276,7 @@ public ElementInstantiationException(String msg) { private final Class<? extends E> elementClass; public ReflectiveElementFactory(Class<? extends E> elementClass) { - Assert.notNull(elementClass, "Element clas must not be null"); + Assert.notNull(elementClass, "Element class must not be null"); Assert.isTrue(!elementClass.isInterface(), "Element class must not be an interface type"); Assert.isTrue(!Modifier.isAbstract(elementClass.getModifiers()), "Element class cannot be an abstract class"); this.elementClass = elementClass;
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-core/src/main/java/org/springframework/util/CompositeIterator.java
@@ -68,7 +68,7 @@ public E next() { return iterator.next(); } } - throw new NoSuchElementException("Exhaused all iterators"); + throw new NoSuchElementException("Exhausted all iterators"); } @Override
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-core/src/main/java/org/springframework/util/StringUtils.java
@@ -208,7 +208,7 @@ public static String trimWhitespace(String str) { /** * Trim <i>all</i> whitespace from the given String: - * leading, trailing, and inbetween characters. + * leading, trailing, and in between characters. * @param str the String to check * @return the trimmed String * @see java.lang.Character#isWhitespace @@ -265,7 +265,7 @@ public static String trimTrailingWhitespace(String str) { } /** - * Trim all occurences of the supplied leading character from the given String. + * Trim all occurrences of the supplied leading character from the given String. * @param str the String to check * @param leadingCharacter the leading character to be trimmed * @return the trimmed String @@ -282,7 +282,7 @@ public static String trimLeadingCharacter(String str, char leadingCharacter) { } /** - * Trim all occurences of the supplied trailing character from the given String. + * Trim all occurrences of the supplied trailing character from the given String. * @param str the String to check * @param trailingCharacter the trailing character to be trimmed * @return the trimmed String @@ -381,7 +381,7 @@ public static int countOccurrencesOf(String str, String sub) { } /** - * Replace all occurences of a substring within a string with + * Replace all occurrences of a substring within a string with * another string. * @param inString String to examine * @param oldPattern String to replace
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProvider.java
@@ -41,7 +41,7 @@ public interface CallMetaDataProvider { /** * Initialize the database specific management of procedure column meta data. - * This is only called for databases that are supported. This initalization + * This is only called for databases that are supported. This initialization * can be turned off by specifying that column meta data should not be used. * @param databaseMetaData used to retrieve database specific information * @param catalogName name of catalog to use or null
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProviderFactory.java
@@ -61,9 +61,9 @@ public class CallMetaDataProviderFactory { ); /** - * Create a CallMetaDataProvider based on the database metedata - * @param dataSource used to retrieve metedata - * @param context the class that holds configuration and metedata + * Create a CallMetaDataProvider based on the database metadata + * @param dataSource used to retrieve metadata + * @param context the class that holds configuration and metadata * @return instance of the CallMetaDataProvider implementation to be used */ static public CallMetaDataProvider createMetaDataProvider(DataSource dataSource, final CallMetaDataContext context) {
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java
@@ -340,7 +340,7 @@ private void locateTableAndProcessMetaData(DatabaseMetaData databaseMetaData, St try { tables.close(); } catch (SQLException e) { - logger.warn("Error while closing table meta data reults" + e.getMessage()); + logger.warn("Error while closing table meta data results" + e.getMessage()); } } } @@ -379,7 +379,7 @@ private void locateTableAndProcessMetaData(DatabaseMetaData databaseMetaData, St } /** - * Method supporting the metedata processing for a table's columns + * Method supporting the metadata processing for a table's columns */ private void processTableColumns(DatabaseMetaData databaseMetaData, TableMetaData tmd) { ResultSet tableColumns = null;
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/ParsedSql.java
@@ -70,7 +70,7 @@ void addNamedParameter(String parameterName, int startIndex, int endIndex) { /** * Return all of the parameters (bind variables) in the parsed SQL statement. - * Repeated occurences of the same parameter name are included here. + * Repeated occurrences of the same parameter name are included here. */ List<String> getParameterNames() { return this.parameterNames; @@ -89,15 +89,15 @@ int[] getParameterIndexes(int parameterPosition) { /** * Set the count of named parameters in the SQL statement. - * Each parameter name counts once; repeated occurences do not count here. + * Each parameter name counts once; repeated occurrences do not count here. */ void setNamedParameterCount(int namedParameterCount) { this.namedParameterCount = namedParameterCount; } /** * Return the count of named parameters in the SQL statement. - * Each parameter name counts once; repeated occurences do not count here. + * Each parameter name counts once; repeated occurrences do not count here. */ int getNamedParameterCount() { return this.namedParameterCount; @@ -119,15 +119,15 @@ int getUnnamedParameterCount() { /** * Set the total count of all of the parameters in the SQL statement. - * Repeated occurences of the same parameter name do count here. + * Repeated occurrences of the same parameter name do count here. */ void setTotalParameterCount(int totalParameterCount) { this.totalParameterCount = totalParameterCount; } /** * Return the total count of all of the parameters in the SQL statement. - * Repeated occurences of the same parameter name do count here. + * Repeated occurrences of the same parameter name do count here. */ int getTotalParameterCount() { return this.totalParameterCount;
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java
@@ -311,7 +311,7 @@ protected void checkCompiled() { } /** - * Method to check whether we are allowd to make any configuration changes at this time. + * Method to check whether we are allowed to make any configuration changes at this time. * If the class has been compiled, then no further changes to the configuration are allowed. */ protected void checkIfConfigurationModificationIsAllowed() { @@ -450,12 +450,12 @@ public PreparedStatement createPreparedStatement(Connection con) throws SQLExcep "The getGeneratedKeys feature is not supported by this database"); } if (getGeneratedKeyNames().length < 1) { - throw new InvalidDataAccessApiUsageException("Generated Key Name(s) not specificed. " + + throw new InvalidDataAccessApiUsageException("Generated Key Name(s) not specified. " + "Using the generated keys features requires specifying the name(s) of the generated column(s)"); } if (getGeneratedKeyNames().length > 1) { throw new InvalidDataAccessApiUsageException( - "Current database only supports retreiving the key for a single column. There are " + + "Current database only supports retrieving the key for a single column. There are " + getGeneratedKeyNames().length + " columns specified: " + Arrays.asList(getGeneratedKeyNames())); } // This is a hack to be able to get the generated key from a database that doesn't support @@ -615,9 +615,9 @@ private void setParameterValues(PreparedStatement preparedStatement, List<Object } /** - * Match the provided in parameter values with regitered parameters and parameters defined + * Match the provided in parameter values with registered parameters and parameters defined * via metadata processing. - * @param parameterSource the parameter vakues provided as a {@link SqlParameterSource} + * @param parameterSource the parameter values provided as a {@link SqlParameterSource} * @return Map with parameter names and values */ protected List<Object> matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource) {
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertOperations.java
@@ -40,7 +40,7 @@ public interface SimpleJdbcInsertOperations { SimpleJdbcInsertOperations withTableName(String tableName); /** - * Specify the shema name, if any, to be used for the insert. + * Specify the schema name, if any, to be used for the insert. * @param schemaName the name of the schema * @return the instance of this SimpleJdbcInsert */
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-jms/src/main/java/org/springframework/jms/listener/AbstractPollingMessageListenerContainer.java
@@ -42,7 +42,7 @@ * * <p>This listener container variant is built for repeated polling attempts, * each invoking the {@link #receiveAndExecute} method. The MessageConsumer used - * may be reobtained fo reach attempt or cached inbetween attempts; this is up + * may be reobtained fo reach attempt or cached in between attempts; this is up * to the concrete implementation. The receive timeout for each attempt can be * configured through the {@link #setReceiveTimeout "receiveTimeout"} property. *
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-messaging/src/main/java/org/springframework/messaging/simp/handler/SimpleBrokerMessageHandler.java
@@ -83,7 +83,7 @@ protected void handleMessageInternal(Message<?> message) { if (!checkDestinationPrefix(destination)) { if (logger.isTraceEnabled()) { - logger.trace("Ingoring message to destination=" + destination); + logger.trace("Ignoring message to destination=" + destination); } return; }
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamMarshaller.java
@@ -782,7 +782,7 @@ private Object doUnmarshal(HierarchicalStreamReader streamReader, DataHolder dat * {@code org.springframework.oxm} hierarchy. * <p>A boolean flag is used to indicate whether this exception occurs during marshalling or * unmarshalling, since XStream itself does not make this distinction in its exception hierarchy. - * @param ex XStream exception that occured + * @param ex XStream exception that occurred * @param marshalling indicates whether the exception occurs during marshalling ({@code true}), * or unmarshalling ({@code false}) * @return the corresponding {@code XmlMappingException}
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-web/src/main/java/org/springframework/web/context/request/async/CallableProcessingInterceptor.java
@@ -55,7 +55,7 @@ public interface CallableProcessingInterceptor { * <p> * This is useful for capturing the state of the current thread just prior to * invoking the {@link Callable}. Once the state is captured, it can then be - * transfered to the new {@link Thread} in + * transferred to the new {@link Thread} in * {@link #preProcess(NativeWebRequest, Callable)}. Capturing the state of * Spring Security's SecurityContextHolder and migrating it to the new Thread * is a concrete example of where this is useful.
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-web/src/main/java/org/springframework/web/context/support/ServletContextAwareProcessor.java
@@ -48,7 +48,7 @@ public class ServletContextAwareProcessor implements BeanPostProcessor { /** * Create a new ServletContextAwareProcessor without an initial context or config. * When this constructor is used the {@link #getServletContext()} and/or - * {@link #getServletConfig()} methods should be overriden. + * {@link #getServletConfig()} methods should be overridden. */ protected ServletContextAwareProcessor() { }
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java
@@ -41,7 +41,7 @@ * should be involved in async dispatches. However, in some cases servlet * containers assume different default configuration. Therefore sub-classes can * override the method {@link #shouldNotFilterAsyncDispatch()} to declare - * statically if they shouuld indeed be invoked, <em>once</em>, during both types + * statically if they should indeed be invoked, <em>once</em>, during both types * of dispatches in order to provide thread initialization, logging, security, * and so on. This mechanism complements and does not replace the need to * configure a filter in {@code web.xml} with dispatcher types.
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-web/src/main/java/org/springframework/web/jsf/DecoratingNavigationHandler.java
@@ -115,7 +115,7 @@ public abstract void handleNavigation( * <p>If no decorated NavigationHandler specified as constructor argument, * this instance is the last element in the chain. Hence, this method will * call the original NavigationHandler as passed into this method. If no - * original NavigantionHandler has been passed in (for example if this + * original NavigationHandler has been passed in (for example if this * instance is the last element in a chain with standard NavigationHandlers * as earlier elements), this method corresponds to a no-op. * @param facesContext the current JSF context
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-web/src/main/java/org/springframework/web/util/WebAppRootListener.java
@@ -25,7 +25,7 @@ * parameter at the servlet context level (i.e. context-param in web.xml), * the default key is "webapp.root". * - * <p>Can be used for toolkits that support substition with system properties + * <p>Can be used for toolkits that support substitution with system properties * (i.e. System.getProperty values), like log4j's "${key}" syntax within log * file locations. *
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/ResourceServlet.java
@@ -295,7 +295,7 @@ private void doInclude(HttpServletRequest request, HttpServletResponse response, * to allow for message resolution etc that influences JSP contents, * assuming that those background resources might have changed on restart. * <p>Returns the startup time of this servlet if the file that corresponds - * to the target resource URL coudln't be resolved (for example, because + * to the target resource URL couldn't be resolved (for example, because * the WAR is not expanded). * @see #determineResourceUrl * @see #getFileTimestamp
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerExceptionResolver.java
@@ -189,7 +189,7 @@ protected void logException(Exception ex, HttpServletRequest request) { } /** - * Build a log message for the given exception, occured during processing the given request. + * Build a log message for the given exception, occurred during processing the given request. * @param ex the exception that got thrown during handler execution * @param request current HTTP request (useful for obtaining metadata) * @return the log message to use
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.java
@@ -513,7 +513,7 @@ protected HttpInputMessage createHttpInputMessage(HttpServletRequest servletRequ } /** - * Template method for creating a new HttpOuputMessage instance. + * Template method for creating a new HttpOutputMessage instance. * <p>The default implementation creates a standard {@link ServletServerHttpResponse}. * This can be overridden for custom {@code HttpOutputMessage} implementations * @param servletResponse current HTTP response @@ -1197,7 +1197,7 @@ public String bestMatchedPattern() { * sorting a list with this comparator will result in: * <ul> * <li>RHIs with {@linkplain AnnotationMethodHandlerAdapter.RequestSpecificMappingInfo#matchedPatterns better matched paths} - * take prescedence over those with a weaker match (as expressed by the {@linkplain PathMatcher#getPatternComparator(String) + * take precedence over those with a weaker match (as expressed by the {@linkplain PathMatcher#getPatternComparator(String) * path pattern comparator}.) Typically, this means that patterns without wild cards and uri templates * will be ordered before those without.</li> * <li>RHIs with one single {@linkplain RequestMappingInfo#methods request method} will be
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/support/ServletUriComponentsBuilder.java
@@ -82,7 +82,7 @@ public static ServletUriComponentsBuilder fromServletMapping(HttpServletRequest /** * Prepare a builder from the host, port, scheme, and path of - * an HttpSevletRequest. + * an HttpServletRequest. */ public static ServletUriComponentsBuilder fromRequestUri(HttpServletRequest request) { ServletUriComponentsBuilder builder = fromRequest(request);
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/support/WebContentGenerator.java
@@ -211,7 +211,7 @@ public void setAlwaysMustRevalidate(boolean mustRevalidate) { } /** - * Return whether 'must-revaliate' is added to every Cache-Control header. + * Return whether 'must-revalidate' is added to every Cache-Control header. */ public boolean isAlwaysMustRevalidate() { return alwaysMustRevalidate;
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/BeanNameViewResolver.java
@@ -38,7 +38,7 @@ * application beans - such a separation will make this clear. * * <p>This ViewResolver does not support internationalization. - * Conside ResourceBundleViewResolver if you need to apply different + * Consider ResourceBundleViewResolver if you need to apply different * view resources per locale. * * <p>Note: This ViewResolver implements the Ordered interface to allow for
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java
@@ -70,7 +70,7 @@ * with the view's {@linkplain View#getContentType() content type}). The most compatible view is returned. * * <p>Additionally, this view resolver exposes the {@link #setDefaultViews(List) defaultViews} property, allowing you to - * override the views provided by the view resolvers. Note that these default views are offered as candicates, and + * override the views provided by the view resolvers. Note that these default views are offered as candidates, and * still need have the content type requested (via file extension, parameter, or {@code Accept} header, described above). * You can also set the {@linkplain #setDefaultContentType(MediaType) default content type} directly, which will be * returned when the other mechanisms ({@code Accept} header, file extension or parameter) do not result in a match.
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfStamperView.java
@@ -103,7 +103,7 @@ protected PdfReader readPdfResource() throws IOException { * e.g. setting the "formFlattening" property. * @param request in case we need locale etc. Shouldn't look at attributes. * @param response in case we need to set cookies. Shouldn't write to it. - * @throws Exception any exception that occured during document building + * @throws Exception any exception that occurred during document building */ protected abstract void mergePdfDocument(Map<String, Object> model, PdfStamper stamper, HttpServletRequest request, HttpServletResponse response) throws Exception;
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfView.java
@@ -172,7 +172,7 @@ protected void buildPdfMetadata(Map<String, Object> model, Document document, Ht * @param writer the PdfWriter to use * @param request in case we need locale etc. Shouldn't look at attributes. * @param response in case we need to set cookies. Shouldn't write to it. - * @throws Exception any exception that occured during document building + * @throws Exception any exception that occurred during document building * @see com.lowagie.text.Document#open() * @see com.lowagie.text.Document#close() */
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractAtomFeedView.java
@@ -96,7 +96,7 @@ protected final void buildFeedEntries(Map<String, Object> model, Feed feed, * @param request in case we need locale etc. Shouldn't look at attributes. * @param response in case we need to set cookies. Shouldn't write to it. * @return the feed entries to be added to the feed - * @throws Exception any exception that occured during document building + * @throws Exception any exception that occurred during document building * @see Entry */ protected abstract List<Entry> buildFeedEntries(
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractFeedView.java
@@ -91,7 +91,7 @@ protected void buildFeedMetadata(Map<String, Object> model, T feed, HttpServletR * @param feed the feed to add entries to * @param request in case we need locale etc. Shouldn't look at attributes. * @param response in case we need to set cookies. Shouldn't write to it. - * @throws Exception any exception that occured during building + * @throws Exception any exception that occurred during building */ protected abstract void buildFeedEntries(Map<String, Object> model, T feed, HttpServletRequest request, HttpServletResponse response) throws Exception;
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractRssFeedView.java
@@ -79,7 +79,7 @@ protected final void buildFeedEntries(Map<String, Object> model, Channel channel * @param request in case we need locale etc. Shouldn't look at attributes. * @param response in case we need to set cookies. Shouldn't write to it. * @return the feed items to be added to the feed - * @throws Exception any exception that occured during document building + * @throws Exception any exception that occurred during document building * @see Item */ protected abstract List<Item> buildFeedItems(
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsView.java
@@ -217,7 +217,7 @@ public void setSubReportUrls(Properties subReports) { * <p>The name specified in the list should correspond to an attribute in the * model Map, and to a sub-report data source parameter in your report file. * If you pass in {@code JRDataSource} objects as model attributes, - * specifing this list of keys is not required. + * specifying this list of keys is not required. * <p>If you specify a list of sub-report data keys, it is required to also * specify a {@code reportDataKey} for the main report, to avoid confusion * between the data source objects for the various reports involved. @@ -536,7 +536,7 @@ else if (filename.endsWith(".jrxml")) { * {@link #renderReport} method that should be implemented by the subclass. * @param model the model map, as passed in for view rendering. Must contain * a report data value that can be converted to a {@code JRDataSource}, - * acccording to the rules of the {@link #fillReport} method. + * according to the rules of the {@link #fillReport} method. */ @Override protected void renderMergedOutputModel( @@ -820,12 +820,12 @@ protected void postProcessReport(JasperPrint populatedReport, Map<String, Object /** * Subclasses should implement this method to perform the actual rendering process. - * <p>Note that the content type has not been set yet: Implementors should build + * <p>Note that the content type has not been set yet: Implementers should build * a content type String and set it via {@code response.setContentType}. * If necessary, this can include a charset clause for a specific encoding. * The latter will only be necessary for textual output onto a Writer, and only * in case of the encoding being specified in the JasperReports exporter parameters. - * <p><b>WARNING:</b> Implementors should not use {@code response.setCharacterEncoding} + * <p><b>WARNING:</b> Implementers should not use {@code response.setCharacterEncoding} * unless they are willing to depend on Servlet API 2.4 or higher. Prefer a * concatenated content type String with a charset clause instead. * @param populatedReport the populated {@code JasperPrint} to render
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityToolboxView.java
@@ -73,7 +73,7 @@ public class VelocityToolboxView extends VelocityView { * to automatically load a Velocity Tools toolbox definition file and expose * all defined tools in the specified scopes. If no config location is * specified, no toolbox will be loaded and exposed. - * <p>The specfied location string needs to refer to a ServletContext + * <p>The specified location string needs to refer to a ServletContext * resource, as expected by ServletToolboxManager which is part of * the view package of Velocity Tools. * @see org.apache.velocity.tools.view.servlet.ServletToolboxManager#getInstance
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityViewResolver.java
@@ -88,7 +88,7 @@ public void setNumberToolAttribute(String numberToolAttribute) { * to automatically load a Velocity Tools toolbox definition file and expose * all defined tools in the specified scopes. If no config location is * specified, no toolbox will be loaded and exposed. - * <p>The specfied location string needs to refer to a ServletContext + * <p>The specified location string needs to refer to a ServletContext * resource, as expected by ServletToolboxManager which is part of * the view package of Velocity Tools. * <p><b>Note:</b> Specifying a toolbox config location will lead to
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-webmvc/src/main/java/org/springframework/web/servlet/view/xslt/XsltView.java
@@ -264,7 +264,7 @@ protected Result createResult(HttpServletResponse response) throws Exception { * an object of {@link #getSourceTypes() supported type}. * @param model the merged model Map * @return the XSLT Source object (or {@code null} if none found) - * @throws Exception if an error occured during locating the source + * @throws Exception if an error occurred during locating the source * @see #setSourceKey * @see #convertSource */
true
Other
spring-projects
spring-framework
e9f78f6043d8391121ba93d496b66beaa13a1dca.json
Fix various typos Fix a variety of typos throughout the project, primarily in comments (javadoc or otherwise) but also in a handful of log messages and a couple exception messages. ISSUE: SPR-11123
spring-websocket/src/main/java/org/springframework/web/socket/server/endpoint/ServerEndpointRegistration.java
@@ -90,7 +90,7 @@ public ServerEndpointRegistration(String path, Class<? extends Endpoint> endpoin /** * Create a new {@link ServerEndpointRegistration} instance from an - * {@code javax.webscoket.Endpoint} instance. + * {@code javax.websocket.Endpoint} instance. * @param path the endpoint path * @param endpoint the endpoint instance */
true
Other
spring-projects
spring-framework
4e82416ba97abc804bd805dc4e9e10f5b3c685e7.json
Add SubProtocolCapable interface The addition of SubProtocolCapable simplifies configuration since it is no longer necessary to explicitly configure DefaultHandshakeHandler with a list of supported sub-protocols. We will not also check if the WebSocketHandler to use for the WebSocket request is an instance of SubProtocolCapable and obtain the list of sub-protocols that way. The provided SubProtocolWebSocketHandler does implement this interface. Issue: SPR-11111
spring-websocket/src/main/java/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.java
@@ -16,12 +16,7 @@ package org.springframework.web.socket.messaging; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.logging.Log; @@ -37,6 +32,7 @@ import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.WebSocketMessage; import org.springframework.web.socket.WebSocketSession; +import org.springframework.web.socket.support.SubProtocolCapable; /** @@ -55,7 +51,7 @@ * * @since 4.0 */ -public class SubProtocolWebSocketHandler implements WebSocketHandler, MessageHandler { +public class SubProtocolWebSocketHandler implements SubProtocolCapable, WebSocketHandler, MessageHandler { private final Log logger = LogFactory.getLog(SubProtocolWebSocketHandler.class); @@ -136,8 +132,8 @@ public SubProtocolHandler getDefaultProtocolHandler() { /** * Return all supported protocols. */ - public Set<String> getSupportedProtocols() { - return this.protocolHandlers.keySet(); + public List<String> getSubProtocols() { + return new ArrayList<String>(this.protocolHandlers.keySet()); } @Override
true
Other
spring-projects
spring-framework
4e82416ba97abc804bd805dc4e9e10f5b3c685e7.json
Add SubProtocolCapable interface The addition of SubProtocolCapable simplifies configuration since it is no longer necessary to explicitly configure DefaultHandshakeHandler with a list of supported sub-protocols. We will not also check if the WebSocketHandler to use for the WebSocket request is an instance of SubProtocolCapable and obtain the list of sub-protocols that way. The provided SubProtocolWebSocketHandler does implement this interface. Issue: SPR-11111
spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompEndpointRegistry.java
@@ -83,10 +83,9 @@ private static SubProtocolWebSocketHandler unwrapSubProtocolWebSocketHandler(Web public StompWebSocketEndpointRegistration addEndpoint(String... paths) { this.subProtocolWebSocketHandler.addProtocolHandler(this.stompHandler); - Set<String> subProtocols = this.subProtocolWebSocketHandler.getSupportedProtocols(); WebMvcStompWebSocketEndpointRegistration registration = new WebMvcStompWebSocketEndpointRegistration( - paths, this.webSocketHandler, subProtocols, this.sockJsScheduler); + paths, this.webSocketHandler, this.sockJsScheduler); this.registrations.add(registration); return registration;
true
Other
spring-projects
spring-framework
4e82416ba97abc804bd805dc4e9e10f5b3c685e7.json
Add SubProtocolCapable interface The addition of SubProtocolCapable simplifies configuration since it is no longer necessary to explicitly configure DefaultHandshakeHandler with a list of supported sub-protocols. We will not also check if the WebSocketHandler to use for the WebSocket request is an instance of SubProtocolCapable and obtain the list of sub-protocols that way. The provided SubProtocolWebSocketHandler does implement this interface. Issue: SPR-11111
spring-websocket/src/main/java/org/springframework/web/socket/messaging/config/WebMvcStompWebSocketEndpointRegistration.java
@@ -46,8 +46,6 @@ public class WebMvcStompWebSocketEndpointRegistration implements StompWebSocketE private final WebSocketHandler webSocketHandler; - private final String[] subProtocols; - private final TaskScheduler sockJsTaskScheduler; private HandshakeHandler handshakeHandler; @@ -56,28 +54,14 @@ public class WebMvcStompWebSocketEndpointRegistration implements StompWebSocketE public WebMvcStompWebSocketEndpointRegistration(String[] paths, WebSocketHandler webSocketHandler, - Set<String> subProtocols, TaskScheduler sockJsTaskScheduler) { + TaskScheduler sockJsTaskScheduler) { Assert.notEmpty(paths, "No paths specified"); Assert.notNull(webSocketHandler, "'webSocketHandler' is required"); - Assert.notNull(subProtocols, "'subProtocols' is required"); this.paths = paths; this.webSocketHandler = webSocketHandler; - this.subProtocols = subProtocols.toArray(new String[subProtocols.size()]); this.sockJsTaskScheduler = sockJsTaskScheduler; - - this.handshakeHandler = new DefaultHandshakeHandler(); - updateHandshakeHandler(); - } - - private void updateHandshakeHandler() { - if (handshakeHandler instanceof DefaultHandshakeHandler) { - DefaultHandshakeHandler defaultHandshakeHandler = (DefaultHandshakeHandler) handshakeHandler; - if (ObjectUtils.isEmpty(defaultHandshakeHandler.getSupportedProtocols())) { - defaultHandshakeHandler.setSupportedProtocols(this.subProtocols); - } - } } /** @@ -87,7 +71,6 @@ private void updateHandshakeHandler() { public StompWebSocketEndpointRegistration setHandshakeHandler(HandshakeHandler handshakeHandler) { Assert.notNull(handshakeHandler, "'handshakeHandler' must not be null"); this.handshakeHandler = handshakeHandler; - updateHandshakeHandler(); return this; } @@ -97,8 +80,10 @@ public StompWebSocketEndpointRegistration setHandshakeHandler(HandshakeHandler h @Override public SockJsServiceRegistration withSockJS() { this.registration = new StompSockJsServiceRegistration(this.sockJsTaskScheduler); - WebSocketTransportHandler transportHandler = new WebSocketTransportHandler(this.handshakeHandler); - this.registration.setTransportHandlerOverrides(transportHandler); + if (this.handshakeHandler != null) { + WebSocketTransportHandler transportHandler = new WebSocketTransportHandler(this.handshakeHandler); + this.registration.setTransportHandlerOverrides(transportHandler); + } return this.registration; } @@ -114,8 +99,9 @@ protected final MultiValueMap<HttpRequestHandler, String> getMappings() { } else { for (String path : this.paths) { - WebSocketHttpRequestHandler handler = - new WebSocketHttpRequestHandler(this.webSocketHandler, this.handshakeHandler); + WebSocketHttpRequestHandler handler = (this.handshakeHandler != null) ? + new WebSocketHttpRequestHandler(this.webSocketHandler, this.handshakeHandler) : + new WebSocketHttpRequestHandler(this.webSocketHandler); mappings.add(handler, path); } }
true
Other
spring-projects
spring-framework
4e82416ba97abc804bd805dc4e9e10f5b3c685e7.json
Add SubProtocolCapable interface The addition of SubProtocolCapable simplifies configuration since it is no longer necessary to explicitly configure DefaultHandshakeHandler with a list of supported sub-protocols. We will not also check if the WebSocketHandler to use for the WebSocket request is an instance of SubProtocolCapable and obtain the list of sub-protocols that way. The provided SubProtocolWebSocketHandler does implement this interface. Issue: SPR-11111
spring-websocket/src/main/java/org/springframework/web/socket/server/DefaultHandshakeHandler.java
@@ -32,8 +32,10 @@ import org.springframework.http.server.ServerHttpResponse; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; +import org.springframework.web.socket.support.SubProtocolCapable; import org.springframework.web.socket.support.WebSocketExtension; import org.springframework.web.socket.WebSocketHandler; +import org.springframework.web.socket.support.WebSocketHandlerDecorator; import org.springframework.web.socket.support.WebSocketHttpHeaders; /** @@ -122,10 +124,16 @@ public DefaultHandshakeHandler(RequestUpgradeStrategy upgradeStrategy) { } /** - * Use this property to configure a list of sub-protocols that are supported. - * The first protocol that matches what the client requested is selected. - * If no protocol matches or this property is not configured, then the - * response will not contain a Sec-WebSocket-Protocol header. + * Use this property to configure the list of supported sub-protocols. + * The first configured sub-protocol that matches a client-requested sub-protocol + * is accepted. If there are no matches the response will not contain a + * {@literal Sec-WebSocket-Protocol} header. + * <p> + * Note that if the WebSocketHandler passed in at runtime is an instance of + * {@link SubProtocolCapable} then there is not need to explicitly configure + * this property. That is certainly the case with the built-in STOMP over + * WebSocket support. Therefore this property should be configured explicitly + * only if the WebSocketHandler does not implement {@code SubProtocolCapable}. */ public void setSupportedProtocols(String... protocols) { this.supportedProtocols.clear(); @@ -187,7 +195,10 @@ public final boolean doHandshake(ServerHttpRequest request, ServerHttpResponse r "Response update failed during upgrade to WebSocket, uri=" + request.getURI(), ex); } - String subProtocol = selectProtocol(headers.getSecWebSocketProtocol()); + String subProtocol = selectProtocol(headers.getSecWebSocketProtocol(), wsHandler); + if (logger.isDebugEnabled()) { + logger.debug("Selected sub-protocol: '" + subProtocol + "'"); + } List<WebSocketExtension> requested = headers.getSecWebSocketExtensions(); List<WebSocketExtension> supported = this.requestUpgradeStrategy.getSupportedExtensions(request); @@ -246,24 +257,60 @@ protected boolean isValidOrigin(ServerHttpRequest request) { return true; } - protected String selectProtocol(List<String> requestedProtocols) { + /** + * Perform the sub-protocol negotiation based on requested and supported sub-protocols. + * For the list of supported sub-protocols, this method first checks if the target + * WebSocketHandler is a {@link SubProtocolCapable} and then also checks if any + * sub-protocols have been explicitly configured with + * {@link #setSupportedProtocols(String...)}. + * + * @param requestedProtocols the requested sub-protocols + * @param webSocketHandler the WebSocketHandler that will be used + * @return the selected protocols or {@code null} + * + * @see #determineHandlerSupportedProtocols(org.springframework.web.socket.WebSocketHandler) + */ + protected String selectProtocol(List<String> requestedProtocols, WebSocketHandler webSocketHandler) { if (requestedProtocols != null) { + List<String> handlerProtocols = determineHandlerSupportedProtocols(webSocketHandler); if (logger.isDebugEnabled()) { - logger.debug("Requested sub-protocol(s): " + requestedProtocols - + ", supported sub-protocol(s): " + this.supportedProtocols); + logger.debug("Requested sub-protocol(s): " + requestedProtocols + + ", WebSocketHandler supported sub-protocol(s): " + handlerProtocols + + ", configured sub-protocol(s): " + this.supportedProtocols); } for (String protocol : requestedProtocols) { + if (handlerProtocols.contains(protocol.toLowerCase())) { + return protocol; + } if (this.supportedProtocols.contains(protocol.toLowerCase())) { - if (logger.isDebugEnabled()) { - logger.debug("Selected sub-protocol: '" + protocol + "'"); - } return protocol; } } } return null; } + /** + * Determine the sub-protocols supported by the given WebSocketHandler by checking + * whether it is an instance of {@link SubProtocolCapable}. + * + * @param handler the handler to check + * @return a list of supported protocols or an empty list + */ + protected final List<String> determineHandlerSupportedProtocols(WebSocketHandler handler) { + List<String> subProtocols = null; + if (handler instanceof SubProtocolCapable) { + subProtocols = ((SubProtocolCapable) handler).getSubProtocols(); + } + else if (handler instanceof WebSocketHandlerDecorator) { + WebSocketHandler lastHandler = ((WebSocketHandlerDecorator) handler).getLastHandler(); + if (lastHandler instanceof SubProtocolCapable) { + subProtocols = ((SubProtocolCapable) lastHandler).getSubProtocols();; + } + } + return (subProtocols != null) ? subProtocols : Collections.<String>emptyList(); + } + /** * Filter the list of requested WebSocket extensions. * <p>
true
Other
spring-projects
spring-framework
4e82416ba97abc804bd805dc4e9e10f5b3c685e7.json
Add SubProtocolCapable interface The addition of SubProtocolCapable simplifies configuration since it is no longer necessary to explicitly configure DefaultHandshakeHandler with a list of supported sub-protocols. We will not also check if the WebSocketHandler to use for the WebSocket request is an instance of SubProtocolCapable and obtain the list of sub-protocols that way. The provided SubProtocolWebSocketHandler does implement this interface. Issue: SPR-11111
spring-websocket/src/main/java/org/springframework/web/socket/support/SubProtocolCapable.java
@@ -0,0 +1,19 @@ +package org.springframework.web.socket.support; + +import java.util.List; + +/** + * An interface for WebSocket handlers that support sub-protocols as defined in RFC 6455. + * + * @author Rossen Stoyanchev + * @since 4.0 + * + * @see <a href="http://tools.ietf.org/html/rfc6455#section-1.9">RFC-6455 section 1.9</a> + */ +public interface SubProtocolCapable { + + /** + * Return the list of supported sub-protocols. + */ + List<String> getSubProtocols(); +}
true
Other
spring-projects
spring-framework
4e82416ba97abc804bd805dc4e9e10f5b3c685e7.json
Add SubProtocolCapable interface The addition of SubProtocolCapable simplifies configuration since it is no longer necessary to explicitly configure DefaultHandshakeHandler with a list of supported sub-protocols. We will not also check if the WebSocketHandler to use for the WebSocket request is an instance of SubProtocolCapable and obtain the list of sub-protocols that way. The provided SubProtocolWebSocketHandler does implement this interface. Issue: SPR-11111
spring-websocket/src/test/java/org/springframework/web/socket/messaging/config/WebMvcStompEndpointRegistrationTests.java
@@ -17,7 +17,6 @@ package org.springframework.web.socket.messaging.config; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Map; @@ -62,7 +61,7 @@ public void minimalRegistration() { WebMvcStompWebSocketEndpointRegistration registration = new WebMvcStompWebSocketEndpointRegistration( - new String[] {"/foo"}, this.wsHandler, Collections.<String>emptySet(), this.scheduler); + new String[] {"/foo"}, this.wsHandler, this.scheduler); MultiValueMap<HttpRequestHandler, String> mappings = registration.getMappings(); assertEquals(1, mappings.size()); @@ -78,7 +77,7 @@ public void customHandshakeHandler() { DefaultHandshakeHandler handshakeHandler = new DefaultHandshakeHandler(); WebMvcStompWebSocketEndpointRegistration registration = new WebMvcStompWebSocketEndpointRegistration( - new String[] {"/foo"}, this.wsHandler, Collections.<String>emptySet(), this.scheduler); + new String[] {"/foo"}, this.wsHandler, this.scheduler); registration.setHandshakeHandler(handshakeHandler); @@ -99,7 +98,7 @@ public void customHandshakeHandlerPassedToSockJsService() { DefaultHandshakeHandler handshakeHandler = new DefaultHandshakeHandler(); WebMvcStompWebSocketEndpointRegistration registration = new WebMvcStompWebSocketEndpointRegistration( - new String[] {"/foo"}, this.wsHandler, Collections.<String>emptySet(), this.scheduler); + new String[] {"/foo"}, this.wsHandler, this.scheduler); registration.setHandshakeHandler(handshakeHandler); registration.withSockJS();
true
Other
spring-projects
spring-framework
4e82416ba97abc804bd805dc4e9e10f5b3c685e7.json
Add SubProtocolCapable interface The addition of SubProtocolCapable simplifies configuration since it is no longer necessary to explicitly configure DefaultHandshakeHandler with a list of supported sub-protocols. We will not also check if the WebSocketHandler to use for the WebSocket request is an instance of SubProtocolCapable and obtain the list of sub-protocols that way. The provided SubProtocolWebSocketHandler does implement this interface. Issue: SPR-11111
spring-websocket/src/test/java/org/springframework/web/socket/server/DefaultHandshakeHandlerTests.java
@@ -16,19 +16,23 @@ package org.springframework.web.socket.server; +import java.util.Arrays; import java.util.Collections; +import java.util.List; import java.util.Map; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.springframework.web.socket.AbstractHttpRequestTests; +import org.springframework.web.socket.support.SubProtocolCapable; import org.springframework.web.socket.support.WebSocketExtension; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.adapter.TextWebSocketHandlerAdapter; import org.springframework.web.socket.support.WebSocketHttpHeaders; +import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.*; @@ -53,15 +57,15 @@ public void setup() throws Exception { @Test - public void selectSubProtocol() throws Exception { + public void supportedSubProtocols() throws Exception { this.handshakeHandler.setSupportedProtocols("stomp", "mqtt"); when(this.upgradeStrategy.getSupportedVersions()).thenReturn(new String[] { "13" }); - WebSocketHttpHeaders headers = new WebSocketHttpHeaders(this.request.getHeaders()); - this.servletRequest.setMethod("GET"); + + WebSocketHttpHeaders headers = new WebSocketHttpHeaders(this.request.getHeaders()); headers.setUpgrade("WebSocket"); headers.setConnection("Upgrade"); headers.setSecWebSocketVersion("13"); @@ -70,11 +74,70 @@ public void selectSubProtocol() throws Exception { WebSocketHandler handler = new TextWebSocketHandlerAdapter(); Map<String, Object> attributes = Collections.<String, Object>emptyMap(); - this.handshakeHandler.doHandshake(this.request, this.response, handler, attributes); verify(this.upgradeStrategy).upgrade(this.request, this.response, "STOMP", Collections.<WebSocketExtension>emptyList(), handler, attributes); } + @Test + public void subProtocolCapableHandler() throws Exception { + + when(this.upgradeStrategy.getSupportedVersions()).thenReturn(new String[]{"13"}); + + this.servletRequest.setMethod("GET"); + + WebSocketHttpHeaders headers = new WebSocketHttpHeaders(this.request.getHeaders()); + headers.setUpgrade("WebSocket"); + headers.setConnection("Upgrade"); + headers.setSecWebSocketVersion("13"); + headers.setSecWebSocketKey("82/ZS2YHjEnUN97HLL8tbw=="); + headers.setSecWebSocketProtocol("v11.stomp"); + + WebSocketHandler handler = new SubProtocolCapableHandler("v12.stomp", "v11.stomp"); + Map<String, Object> attributes = Collections.<String, Object>emptyMap(); + this.handshakeHandler.doHandshake(this.request, this.response, handler, attributes); + + verify(this.upgradeStrategy).upgrade(this.request, this.response, + "v11.stomp", Collections.<WebSocketExtension>emptyList(), handler, attributes); + } + + @Test + public void subProtocolCapableHandlerNoMatch() throws Exception { + + when(this.upgradeStrategy.getSupportedVersions()).thenReturn(new String[]{"13"}); + + this.servletRequest.setMethod("GET"); + + WebSocketHttpHeaders headers = new WebSocketHttpHeaders(this.request.getHeaders()); + headers.setUpgrade("WebSocket"); + headers.setConnection("Upgrade"); + headers.setSecWebSocketVersion("13"); + headers.setSecWebSocketKey("82/ZS2YHjEnUN97HLL8tbw=="); + headers.setSecWebSocketProtocol("v10.stomp"); + + WebSocketHandler handler = new SubProtocolCapableHandler("v12.stomp", "v11.stomp"); + Map<String, Object> attributes = Collections.<String, Object>emptyMap(); + this.handshakeHandler.doHandshake(this.request, this.response, handler, attributes); + + verify(this.upgradeStrategy).upgrade(this.request, this.response, + null, Collections.<WebSocketExtension>emptyList(), handler, attributes); + } + + + private static class SubProtocolCapableHandler extends TextWebSocketHandlerAdapter implements SubProtocolCapable { + + private final List<String> subProtocols; + + + private SubProtocolCapableHandler(String... subProtocols) { + this.subProtocols = Arrays.asList(subProtocols); + } + + @Override + public List<String> getSubProtocols() { + return this.subProtocols; + } + } + }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
build.gradle
@@ -26,27 +26,21 @@ configure(allprojects) { project -> apply plugin: "test-source-set-dependencies" apply from: "${gradleScriptDir}/ide.gradle" - [compileJava, compileTestJava]*.options*.compilerArgs = [ - "-Xlint:serial", - "-Xlint:varargs", - "-Xlint:cast", - "-Xlint:classfile", - "-Xlint:dep-ann", - "-Xlint:divzero", - "-Xlint:empty", - "-Xlint:finally", - "-Xlint:overrides", - "-Xlint:path", - "-Xlint:processing", - "-Xlint:static", - "-Xlint:try", - "-Xlint:-options", // intentionally disabled - "-Xlint:-fallthrough", // intentionally disabled - "-Xlint:-rawtypes", // TODO enable and fix warnings - "-Xlint:-deprecation", // TODO enable and fix warnings - "-Xlint:-unchecked" // TODO enable and fix warnings + compileJava.options*.compilerArgs = [ + "-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile", + "-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", + "-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static", + "-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation", + "-Xlint:unchecked", "-Xlint:-options", "-Werror" ] + compileTestJava.options*.compilerArgs = [ + "-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile", + "-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", + "-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static", + "-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation", + "-Xlint:-unchecked", "-Xlint:-options"] + compileJava { sourceCompatibility=1.6 targetCompatibility=1.6
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java
@@ -39,6 +39,6 @@ public interface IntroductionAwareMethodMatcher extends MethodMatcher { * asking is the subject on one or more introductions; {@code false} otherwise * @return whether or not this method matches statically */ - boolean matches(Method method, Class targetClass, boolean hasIntroductions); + boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/IntroductionInfo.java
@@ -34,6 +34,6 @@ public interface IntroductionInfo { * Return the additional interfaces introduced by this Advisor or Advice. * @return the introduced interfaces */ - Class[] getInterfaces(); + Class<?>[] getInterfaces(); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java
@@ -35,7 +35,7 @@ private TrueClassFilter() { } @Override - public boolean matches(Class clazz) { + public boolean matches(Class<?> clazz) { return true; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java
@@ -41,12 +41,12 @@ public boolean isRuntime() { } @Override - public boolean matches(Method method, Class targetClass) { + public boolean matches(Method method, Class<?> targetClass) { return true; } @Override - public boolean matches(Method method, Class targetClass, Object[] args) { + public boolean matches(Method method, Class<?> targetClass, Object[] args) { // Should never be invoked as isRuntime returns false. throw new UnsupportedOperationException(); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java
@@ -119,9 +119,9 @@ public static JoinPoint currentJoinPoint() { /** Non-null if after returning advice binds the return value */ private String returningName = null; - private Class discoveredReturningType = Object.class; + private Class<?> discoveredReturningType = Object.class; - private Class discoveredThrowingType = Object.class; + private Class<?> discoveredThrowingType = Object.class; /** * Index for thisJoinPoint argument (currently only @@ -253,7 +253,7 @@ public void setArgumentNamesFromStringArray(String[] args) { if (argumentNames != null) { if (aspectJAdviceMethod.getParameterTypes().length == argumentNames.length + 1) { // May need to add implicit join point arg name... - Class firstArgType = aspectJAdviceMethod.getParameterTypes()[0]; + Class<?> firstArgType = aspectJAdviceMethod.getParameterTypes()[0]; if (firstArgType == JoinPoint.class || firstArgType == ProceedingJoinPoint.class || firstArgType == JoinPoint.StaticPart.class) { @@ -292,7 +292,7 @@ protected void setReturningNameNoCheck(String name) { } } - protected Class getDiscoveredReturningType() { + protected Class<?> getDiscoveredReturningType() { return this.discoveredReturningType; } @@ -326,7 +326,7 @@ protected void setThrowingNameNoCheck(String name) { } } - protected Class getDiscoveredThrowingType() { + protected Class<?> getDiscoveredThrowingType() { return this.discoveredThrowingType; } @@ -364,7 +364,7 @@ public synchronized final void calculateArgumentBindings() { } int numUnboundArgs = this.adviceInvocationArgumentCount; - Class[] parameterTypes = this.aspectJAdviceMethod.getParameterTypes(); + Class<?>[] parameterTypes = this.aspectJAdviceMethod.getParameterTypes(); if (maybeBindJoinPoint(parameterTypes[0]) || maybeBindProceedingJoinPoint(parameterTypes[0])) { numUnboundArgs--; } @@ -380,7 +380,7 @@ else if (maybeBindJoinPointStaticPart(parameterTypes[0])) { this.argumentsIntrospected = true; } - private boolean maybeBindJoinPoint(Class candidateParameterType) { + private boolean maybeBindJoinPoint(Class<?> candidateParameterType) { if (candidateParameterType.equals(JoinPoint.class)) { this.joinPointArgumentIndex = 0; return true; @@ -390,7 +390,7 @@ private boolean maybeBindJoinPoint(Class candidateParameterType) { } } - private boolean maybeBindProceedingJoinPoint(Class candidateParameterType) { + private boolean maybeBindProceedingJoinPoint(Class<?> candidateParameterType) { if (candidateParameterType.equals(ProceedingJoinPoint.class)) { if (!supportsProceedingJoinPoint()) { throw new IllegalArgumentException("ProceedingJoinPoint is only supported for around advice"); @@ -407,7 +407,7 @@ protected boolean supportsProceedingJoinPoint() { return false; } - private boolean maybeBindJoinPointStaticPart(Class candidateParameterType) { + private boolean maybeBindJoinPointStaticPart(Class<?> candidateParameterType) { if (candidateParameterType.equals(JoinPoint.StaticPart.class)) { this.joinPointStaticPartArgumentIndex = 0; return true; @@ -509,8 +509,8 @@ private void configurePointcutParameters(int argumentIndexOffset) { numParametersToRemove++; } String[] pointcutParameterNames = new String[this.argumentNames.length - numParametersToRemove]; - Class[] pointcutParameterTypes = new Class[pointcutParameterNames.length]; - Class[] methodParameterTypes = this.aspectJAdviceMethod.getParameterTypes(); + Class<?>[] pointcutParameterTypes = new Class<?>[pointcutParameterNames.length]; + Class<?>[] methodParameterTypes = this.aspectJAdviceMethod.getParameterTypes(); int index = 0; for (int i = 0; i < this.argumentNames.length; i++) { @@ -679,7 +679,7 @@ public AdviceExcludingMethodMatcher(Method adviceMethod) { } @Override - public boolean matches(Method method, Class targetClass) { + public boolean matches(Method method, Class<?> targetClass) { return !this.adviceMethod.equals(method); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java
@@ -21,15 +21,13 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.weaver.tools.PointcutParser; import org.aspectj.weaver.tools.PointcutPrimitive; - import org.springframework.core.ParameterNameDiscoverer; import org.springframework.util.StringUtils; @@ -142,9 +140,8 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov singleValuedAnnotationPcds.add("@withincode"); singleValuedAnnotationPcds.add("@annotation"); - Set pointcutPrimitives = PointcutParser.getAllSupportedPointcutPrimitives(); - for (Iterator iterator = pointcutPrimitives.iterator(); iterator.hasNext();) { - PointcutPrimitive primitive = (PointcutPrimitive) iterator.next(); + Set<PointcutPrimitive> pointcutPrimitives = PointcutParser.getAllSupportedPointcutPrimitives(); + for (PointcutPrimitive primitive : pointcutPrimitives) { nonReferencePointcutTokens.add(primitive.getName()); } nonReferencePointcutTokens.add("&&"); @@ -173,7 +170,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov */ private String pointcutExpression; - private Class[] argumentTypes; + private Class<?>[] argumentTypes; private String[] parameterNameBindings; @@ -311,7 +308,7 @@ public String[] getParameterNames(Method method) { * {@link #setRaiseExceptions(boolean) raiseExceptions} has been set to {@code true} */ @Override - public String[] getParameterNames(Constructor ctor) { + public String[] getParameterNames(Constructor<?> ctor) { if (this.raiseExceptions) { throw new UnsupportedOperationException("An advice method can never be a constructor"); } @@ -731,7 +728,7 @@ private boolean alreadyBound(String varName) { * Return {@code true} if the given argument type is a subclass * of the given supertype. */ - private boolean isSubtypeOf(Class supertype, int argumentNumber) { + private boolean isSubtypeOf(Class<?> supertype, int argumentNumber) { return supertype.isAssignableFrom(this.argumentTypes[argumentNumber]); } @@ -759,7 +756,7 @@ private int countNumberOfUnboundPrimitiveArguments() { * Find the argument index with the given type, and bind the given * {@code varName} in that position. */ - private void findAndBind(Class argumentType, String varName) { + private void findAndBind(Class<?> argumentType, String varName) { for (int i = 0; i < this.argumentTypes.length; i++) { if (isUnbound(i) && isSubtypeOf(argumentType, i)) { bindParameterName(i, varName);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterThrowingAdvice.java
@@ -70,8 +70,7 @@ public Object invoke(MethodInvocation mi) throws Throwable { * is only invoked if the thrown exception is a subtype of the given throwing type. */ private boolean shouldInvokeOnThrowing(Throwable t) { - Class throwingType = getDiscoveredThrowingType(); - return throwingType.isAssignableFrom(t.getClass()); + return getDiscoveredThrowingType().isAssignableFrom(t.getClass()); } }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
@@ -98,11 +98,11 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut private static final Log logger = LogFactory.getLog(AspectJExpressionPointcut.class); - private Class pointcutDeclarationScope; + private Class<?> pointcutDeclarationScope; private String[] pointcutParameterNames = new String[0]; - private Class[] pointcutParameterTypes = new Class[0]; + private Class<?>[] pointcutParameterTypes = new Class<?>[0]; private BeanFactory beanFactory; @@ -123,7 +123,7 @@ public AspectJExpressionPointcut() { * @param paramNames the parameter names for the pointcut * @param paramTypes the parameter types for the pointcut */ - public AspectJExpressionPointcut(Class declarationScope, String[] paramNames, Class[] paramTypes) { + public AspectJExpressionPointcut(Class<?> declarationScope, String[] paramNames, Class<?>[] paramTypes) { this.pointcutDeclarationScope = declarationScope; if (paramNames.length != paramTypes.length) { throw new IllegalStateException( @@ -137,7 +137,7 @@ public AspectJExpressionPointcut(Class declarationScope, String[] paramNames, Cl /** * Set the declaration scope for the pointcut. */ - public void setPointcutDeclarationScope(Class pointcutDeclarationScope) { + public void setPointcutDeclarationScope(Class<?> pointcutDeclarationScope) { this.pointcutDeclarationScope = pointcutDeclarationScope; } @@ -151,7 +151,7 @@ public void setParameterNames(String[] names) { /** * Set the parameter types for the pointcut. */ - public void setParameterTypes(Class[] types) { + public void setParameterTypes(Class<?>[] types) { this.pointcutParameterTypes = types; } @@ -248,7 +248,7 @@ public PointcutExpression getPointcutExpression() { } @Override - public boolean matches(Class targetClass) { + public boolean matches(Class<?> targetClass) { checkReadyToMatch(); try { return this.pointcutExpression.couldMatchJoinPointsInType(targetClass); @@ -272,7 +272,7 @@ public boolean matches(Class targetClass) { } @Override - public boolean matches(Method method, Class targetClass, boolean beanHasIntroductions) { + public boolean matches(Method method, Class<?> targetClass, boolean beanHasIntroductions) { checkReadyToMatch(); Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass); ShadowMatch shadowMatch = getShadowMatch(targetMethod, method); @@ -293,7 +293,7 @@ else if (shadowMatch.neverMatches()) { } @Override - public boolean matches(Method method, Class targetClass) { + public boolean matches(Method method, Class<?> targetClass) { return matches(method, targetClass, false); } @@ -304,7 +304,7 @@ public boolean isRuntime() { } @Override - public boolean matches(Method method, Class targetClass, Object[] args) { + public boolean matches(Method method, Class<?> targetClass, Object[] args) { checkReadyToMatch(); ShadowMatch shadowMatch = getShadowMatch(AopUtils.getMostSpecificMethod(method, targetClass), method); ShadowMatch originalShadowMatch = getShadowMatch(method, method); @@ -377,7 +377,7 @@ private boolean matchesIgnoringSubtypes(ShadowMatch shadowMatch) { return !(getRuntimeTestWalker(shadowMatch).testsSubtypeSensitiveVars()); } - private boolean matchesTarget(ShadowMatch shadowMatch, Class targetClass) { + private boolean matchesTarget(ShadowMatch shadowMatch, Class<?> targetClass) { return getRuntimeTestWalker(shadowMatch).testTargetInstanceOfResidue(targetClass); } @@ -542,11 +542,15 @@ public BeanNameContextMatcher(String expression) { } @Override + @SuppressWarnings("rawtypes") + @Deprecated public boolean couldMatchJoinPointsInType(Class someClass) { return (contextMatch(someClass) == FuzzyBoolean.YES); } @Override + @SuppressWarnings("rawtypes") + @Deprecated public boolean couldMatchJoinPointsInType(Class someClass, MatchingContext context) { return (contextMatch(someClass) == FuzzyBoolean.YES); } @@ -566,7 +570,7 @@ public boolean mayNeedDynamicTest() { return false; } - private FuzzyBoolean contextMatch(Class targetType) { + private FuzzyBoolean contextMatch(Class<?> targetType) { String advisedBeanName = getCurrentProxiedBeanName(); if (advisedBeanName == null) { // no proxy creation in progress // abstain; can't return YES, since that will make pointcut with negation fail
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java
@@ -44,7 +44,7 @@ public void setLocation(String location) { this.pointcut.setLocation(location); } - public void setParameterTypes(Class[] types) { + public void setParameterTypes(Class<?>[] types) { this.pointcut.setParameterTypes(types); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java
@@ -34,7 +34,7 @@ */ public class DeclareParentsAdvisor implements IntroductionAdvisor { - private final Class introducedInterface; + private final Class<?> introducedInterface; private final ClassFilter typePatternClassFilter; @@ -47,7 +47,7 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor { * @param typePattern type pattern the introduction is restricted to * @param defaultImpl the default implementation class */ - public DeclareParentsAdvisor(Class interfaceType, String typePattern, Class defaultImpl) { + public DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Class<?> defaultImpl) { this(interfaceType, typePattern, defaultImpl, new DelegatePerTargetObjectIntroductionInterceptor(defaultImpl, interfaceType)); } @@ -58,7 +58,7 @@ public DeclareParentsAdvisor(Class interfaceType, String typePattern, Class defa * @param typePattern type pattern the introduction is restricted to * @param delegateRef the delegate implementation object */ - public DeclareParentsAdvisor(Class interfaceType, String typePattern, Object delegateRef) { + public DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Object delegateRef) { this(interfaceType, typePattern, delegateRef.getClass(), new DelegatingIntroductionInterceptor(delegateRef)); } @@ -71,14 +71,14 @@ public DeclareParentsAdvisor(Class interfaceType, String typePattern, Object del * @param implementationClass implementation class * @param advice delegation advice */ - private DeclareParentsAdvisor(Class interfaceType, String typePattern, Class implementationClass, Advice advice) { + private DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Class<?> implementationClass, Advice advice) { this.introducedInterface = interfaceType; ClassFilter typePatternFilter = new TypePatternClassFilter(typePattern); // Excludes methods implemented. ClassFilter exclusion = new ClassFilter() { @Override - public boolean matches(Class clazz) { + public boolean matches(Class<?> clazz) { return !(introducedInterface.isAssignableFrom(clazz)); } }; @@ -109,8 +109,8 @@ public Advice getAdvice() { } @Override - public Class[] getInterfaces() { - return new Class[] {this.introducedInterface}; + public Class<?>[] getInterfaces() { + return new Class<?>[] {this.introducedInterface}; } }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java
@@ -189,7 +189,7 @@ public int getModifiers() { } @Override - public Class getDeclaringType() { + public Class<?> getDeclaringType() { return methodInvocation.getMethod().getDeclaringClass(); } @@ -199,7 +199,7 @@ public String getDeclaringTypeName() { } @Override - public Class getReturnType() { + public Class<?> getReturnType() { return methodInvocation.getMethod().getReturnType(); } @@ -209,7 +209,7 @@ public Method getMethod() { } @Override - public Class[] getParameterTypes() { + public Class<?>[] getParameterTypes() { return methodInvocation.getMethod().getParameterTypes(); } @@ -222,7 +222,7 @@ public String[] getParameterNames() { } @Override - public Class[] getExceptionTypes() { + public Class<?>[] getExceptionTypes() { return methodInvocation.getMethod().getExceptionTypes(); } @@ -256,7 +256,7 @@ private String toString(boolean includeModifier, boolean includeReturnTypeAndArg sb.append("."); sb.append(getMethod().getName()); sb.append("("); - Class[] parametersTypes = getParameterTypes(); + Class<?>[] parametersTypes = getParameterTypes(); appendTypes(sb, parametersTypes, includeReturnTypeAndArgs, useLongReturnAndArgumentTypeName); sb.append(")"); return sb.toString(); @@ -297,7 +297,7 @@ private void appendType(StringBuilder sb, Class<?> type, boolean useLongTypeName private class SourceLocationImpl implements SourceLocation { @Override - public Class getWithinType() { + public Class<?> getWithinType() { if (methodInvocation.getThis() == null) { throw new UnsupportedOperationException("No source location joinpoint available: target is null"); } @@ -315,6 +315,7 @@ public int getLine() { } @Override + @Deprecated public int getColumn() { throw new UnsupportedOperationException(); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java
@@ -87,12 +87,12 @@ public boolean testsSubtypeSensitiveVars() { new SubtypeSensitiveVarTypeTestVisitor().testsSubtypeSensitiveVars(this.runtimeTest)); } - public boolean testThisInstanceOfResidue(Class thisClass) { + public boolean testThisInstanceOfResidue(Class<?> thisClass) { return (this.runtimeTest != null && new ThisInstanceOfResidueTestVisitor(thisClass).thisInstanceOfMatches(this.runtimeTest)); } - public boolean testTargetInstanceOfResidue(Class targetClass) { + public boolean testTargetInstanceOfResidue(Class<?> targetClass) { return (this.runtimeTest != null && new TargetInstanceOfResidueTestVisitor(targetClass).targetInstanceOfMatches(this.runtimeTest)); } @@ -169,11 +169,11 @@ protected int getVarType(ReflectionVar v) { private static abstract class InstanceOfResidueTestVisitor extends TestVisitorAdapter { - private Class matchClass; + private Class<?> matchClass; private boolean matches; private int matchVarType; - public InstanceOfResidueTestVisitor(Class matchClass, boolean defaultMatches, int matchVarType) { + public InstanceOfResidueTestVisitor(Class<?> matchClass, boolean defaultMatches, int matchVarType) { this.matchClass = matchClass; this.matches = defaultMatches; this.matchVarType = matchVarType; @@ -192,7 +192,7 @@ public void visit(Instanceof i) { return; } try { - Class typeClass = ClassUtils.forName(type.getName(), this.matchClass.getClassLoader()); + Class<?> typeClass = ClassUtils.forName(type.getName(), this.matchClass.getClassLoader()); // Don't use ReflectionType.isAssignableFrom() as it won't be aware of (Spring) mixins this.matches = typeClass.isAssignableFrom(this.matchClass); } @@ -208,7 +208,7 @@ public void visit(Instanceof i) { */ private static class TargetInstanceOfResidueTestVisitor extends InstanceOfResidueTestVisitor { - public TargetInstanceOfResidueTestVisitor(Class targetClass) { + public TargetInstanceOfResidueTestVisitor(Class<?> targetClass) { super(targetClass, false, TARGET_VAR); } @@ -223,7 +223,7 @@ public boolean targetInstanceOfMatches(Test test) { */ private static class ThisInstanceOfResidueTestVisitor extends InstanceOfResidueTestVisitor { - public ThisInstanceOfResidueTestVisitor(Class thisClass) { + public ThisInstanceOfResidueTestVisitor(Class<?> thisClass) { super(thisClass, true, THIS_VAR); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java
@@ -29,22 +29,22 @@ */ public class SimpleAspectInstanceFactory implements AspectInstanceFactory { - private final Class aspectClass; + private final Class<?> aspectClass; /** * Create a new SimpleAspectInstanceFactory for the given aspect class. * @param aspectClass the aspect class */ - public SimpleAspectInstanceFactory(Class aspectClass) { + public SimpleAspectInstanceFactory(Class<?> aspectClass) { Assert.notNull(aspectClass, "Aspect class must not be null"); this.aspectClass = aspectClass; } /** * Return the specified aspect class (never {@code null}). */ - public final Class getAspectClass() { + public final Class<?> getAspectClass() { return this.aspectClass; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java
@@ -94,7 +94,7 @@ public String getTypePattern() { * @throws IllegalStateException if no {@link #setTypePattern(String)} has been set */ @Override - public boolean matches(Class clazz) { + public boolean matches(Class<?> clazz) { if (this.aspectJTypePatternMatcher == null) { throw new IllegalStateException("No 'typePattern' has been set via ctor/setter."); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java
@@ -37,11 +37,9 @@ import org.aspectj.lang.reflect.AjType; import org.aspectj.lang.reflect.AjTypeSystem; import org.aspectj.lang.reflect.PerClauseKind; - import org.springframework.aop.aspectj.AspectJExpressionPointcut; import org.springframework.aop.framework.AopConfigException; import org.springframework.core.ParameterNameDiscoverer; -import org.springframework.core.PrioritizedParameterNameDiscoverer; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.util.StringUtils; @@ -67,11 +65,11 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac * (there <i>should</i> only be one anyway...) */ @SuppressWarnings("unchecked") - protected static AspectJAnnotation findAspectJAnnotationOnMethod(Method method) { - Class<? extends Annotation>[] classesToLookFor = new Class[] { + protected static AspectJAnnotation<?> findAspectJAnnotationOnMethod(Method method) { + Class<?>[] classesToLookFor = new Class<?>[] { Before.class, Around.class, After.class, AfterReturning.class, AfterThrowing.class, Pointcut.class}; - for (Class<? extends Annotation> c : classesToLookFor) { - AspectJAnnotation foundAnnotation = findAnnotation(method, c); + for (Class<?> c : classesToLookFor) { + AspectJAnnotation<?> foundAnnotation = findAnnotation(method, (Class<Annotation>) c); if (foundAnnotation != null) { return foundAnnotation; } @@ -156,7 +154,7 @@ public void validate(Class<?> aspectClass) throws AopConfigException { * formal parameters for the pointcut. */ protected AspectJExpressionPointcut createPointcutExpression( - Method annotatedMethod, Class declarationScope, String[] pointcutParameterNames) { + Method annotatedMethod, Class<?> declarationScope, String[] pointcutParameterNames) { Class<?> [] pointcutParameterTypes = new Class<?>[0]; if (pointcutParameterNames != null) { @@ -210,8 +208,8 @@ protected enum AspectJAnnotationType { private static final String[] EXPRESSION_PROPERTIES = new String[] {"value", "pointcut"}; - private static Map<Class, AspectJAnnotationType> annotationTypes = - new HashMap<Class, AspectJAnnotationType>(); + private static Map<Class<?>, AspectJAnnotationType> annotationTypes = + new HashMap<Class<?>, AspectJAnnotationType>(); static { annotationTypes.put(Pointcut.class,AspectJAnnotationType.AtPointcut); @@ -245,7 +243,7 @@ public AspectJAnnotation(A annotation) { } private AspectJAnnotationType determineAnnotationType(A annotation) { - for (Class type : annotationTypes.keySet()) { + for (Class<?> type : annotationTypes.keySet()) { if (type.isInstance(annotation)) { return annotationTypes.get(type); } @@ -307,7 +305,7 @@ public String[] getParameterNames(Method method) { if (method.getParameterTypes().length == 0) { return new String[0]; } - AspectJAnnotation annotation = findAspectJAnnotationOnMethod(method); + AspectJAnnotation<?> annotation = findAspectJAnnotationOnMethod(method); if (annotation == null) { return null; } @@ -325,7 +323,7 @@ public String[] getParameterNames(Method method) { } @Override - public String[] getParameterNames(Constructor ctor) { + public String[] getParameterNames(Constructor<?> ctor) { throw new UnsupportedOperationException("Spring AOP cannot handle constructor advice"); } }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java
@@ -89,7 +89,7 @@ protected List<Advisor> findCandidateAdvisors() { } @Override - protected boolean isInfrastructureClass(Class beanClass) { + protected boolean isInfrastructureClass(Class<?> beanClass) { // Previously we setProxyTargetClass(true) in the constructor, but that has too // broad an impact. Instead we now override isInfrastructureClass to avoid proxying // aspects. I'm not entirely happy with that as there is no good reason not
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java
@@ -50,7 +50,7 @@ public class AspectJProxyFactory extends ProxyCreatorSupport { /** Cache for singleton aspect instances */ - private static final Map<Class, Object> aspectCache = new HashMap<Class, Object>(); + private static final Map<Class<?>, Object> aspectCache = new HashMap<Class<?>, Object>(); private final AspectJAdvisorFactory aspectFactory = new ReflectiveAspectJAdvisorFactory(); @@ -76,7 +76,7 @@ public AspectJProxyFactory(Object target) { * Create a new {@code AspectJProxyFactory}. * No target, only interfaces. Must add interceptors. */ - public AspectJProxyFactory(Class[] interfaces) { + public AspectJProxyFactory(Class<?>[] interfaces) { setInterfaces(interfaces); } @@ -89,7 +89,7 @@ public AspectJProxyFactory(Class[] interfaces) { * @param aspectInstance the AspectJ aspect instance */ public void addAspect(Object aspectInstance) { - Class aspectClass = aspectInstance.getClass(); + Class<?> aspectClass = aspectInstance.getClass(); String aspectName = aspectClass.getName(); AspectMetadata am = createAspectMetadata(aspectClass, aspectName); if (am.getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON) { @@ -104,7 +104,7 @@ public void addAspect(Object aspectInstance) { * Add an aspect of the supplied type to the end of the advice chain. * @param aspectClass the AspectJ aspect class */ - public void addAspect(Class aspectClass) { + public void addAspect(Class<?> aspectClass) { String aspectName = aspectClass.getName(); AspectMetadata am = createAspectMetadata(aspectClass, aspectName); MetadataAwareAspectInstanceFactory instanceFactory = createAspectInstanceFactory(am, aspectClass, aspectName); @@ -128,7 +128,7 @@ private void addAdvisorsFromAspectInstanceFactory(MetadataAwareAspectInstanceFac /** * Create an {@link AspectMetadata} instance for the supplied aspect type. */ - private AspectMetadata createAspectMetadata(Class aspectClass, String aspectName) { + private AspectMetadata createAspectMetadata(Class<?> aspectClass, String aspectName) { AspectMetadata am = new AspectMetadata(aspectClass, aspectName); if (!am.getAjType().isAspect()) { throw new IllegalArgumentException("Class [" + aspectClass.getName() + "] is not a valid aspect type"); @@ -142,7 +142,7 @@ private AspectMetadata createAspectMetadata(Class aspectClass, String aspectName * a {@link PrototypeAspectInstanceFactory} is returned. */ private MetadataAwareAspectInstanceFactory createAspectInstanceFactory( - AspectMetadata am, Class aspectClass, String aspectName) { + AspectMetadata am, Class<?> aspectClass, String aspectName) { MetadataAwareAspectInstanceFactory instanceFactory = null; if (am.getAjType().getPerClause().getKind() == PerClauseKind.SINGLETON) { @@ -161,7 +161,7 @@ private MetadataAwareAspectInstanceFactory createAspectInstanceFactory( * Get the singleton aspect instance for the supplied aspect type. An instance * is created if one cannot be found in the instance cache. */ - private Object getSingletonAspectInstance(Class aspectClass) { + private Object getSingletonAspectInstance(Class<?> aspectClass) { synchronized (aspectCache) { Object instance = aspectCache.get(aspectClass); if (instance != null) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java
@@ -45,7 +45,7 @@ public class AspectMetadata { /** * AspectJ reflection information (AspectJ 5 / Java 5 specific). */ - private final AjType ajType; + private final AjType<?> ajType; /** * Spring AOP pointcut corresponding to the per clause of the @@ -71,9 +71,9 @@ public AspectMetadata(Class<?> aspectClass, String aspectName) { this.aspectName = aspectName; Class<?> currClass = aspectClass; - AjType ajType = null; + AjType<?> ajType = null; while (!currClass.equals(Object.class)) { - AjType ajTypeToCheck = AjTypeSystem.getAjType(currClass); + AjType<?> ajTypeToCheck = AjTypeSystem.getAjType(currClass); if (ajTypeToCheck.isAspect()) { ajType = ajTypeToCheck; break; @@ -124,14 +124,14 @@ private String findPerClause(Class<?> aspectClass) { /** * Return AspectJ reflection information. */ - public AjType getAjType() { + public AjType<?> getAjType() { return this.ajType; } /** * Return the aspect class. */ - public Class getAspectClass() { + public Class<?> getAspectClass() { return this.ajType.getJavaClass(); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java
@@ -66,7 +66,7 @@ public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name) { * @param name the name of the bean * @param type the type that should be introspected by AspectJ */ - public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name, Class type) { + public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name, Class<?> type) { this.beanFactory = beanFactory; this.name = name; this.aspectMetadata = new AspectMetadata(type, name);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectJAdvisorsBuilder.java
@@ -96,7 +96,7 @@ public List<Advisor> buildAspectJAdvisors() { // We must be careful not to instantiate beans eagerly as in this // case they would be cached by the Spring container but would not // have been weaved - Class beanType = this.beanFactory.getType(beanName); + Class<?> beanType = this.beanFactory.getType(beanName); if (beanType == null) { continue; } @@ -134,7 +134,7 @@ public List<Advisor> buildAspectJAdvisors() { } if (aspectNames.isEmpty()) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } List<Advisor> advisors = new LinkedList<Advisor>(); for (String aspectName : aspectNames) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java
@@ -249,14 +249,14 @@ private PerTargetInstantiationModelPointcut(AspectJExpressionPointcut declaredPo } @Override - public boolean matches(Method method, Class targetClass) { + public boolean matches(Method method, Class<?> targetClass) { // We're either instantiated and matching on declared pointcut, or uninstantiated matching on either pointcut return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)) || this.preInstantiationPointcut.getMethodMatcher().matches(method, targetClass); } @Override - public boolean matches(Method method, Class targetClass, Object[] args) { + public boolean matches(Method method, Class<?> targetClass, Object[] args) { // This can match only on declared pointcut. return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java
@@ -190,7 +190,7 @@ private AspectJExpressionPointcut getPointcut(Method candidateAdviceMethod, Clas return null; } AspectJExpressionPointcut ajexp = - new AspectJExpressionPointcut(candidateAspectClass, new String[0], new Class[0]); + new AspectJExpressionPointcut(candidateAspectClass, new String[0], new Class<?>[0]); ajexp.setExpression(aspectJAnnotation.getPointcutExpression()); return ajexp; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java
@@ -40,7 +40,7 @@ public class SimpleMetadataAwareAspectInstanceFactory extends SimpleAspectInstan * @param aspectClass the aspect class * @param aspectName the aspect name */ - public SimpleMetadataAwareAspectInstanceFactory(Class aspectClass, String aspectName) { + public SimpleMetadataAwareAspectInstanceFactory(Class<?> aspectClass, String aspectName) { super(aspectClass); this.metadata = new AspectMetadata(aspectClass, aspectName); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java
@@ -46,7 +46,7 @@ @SuppressWarnings("serial") public class AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator { - private static final Comparator DEFAULT_PRECEDENCE_COMPARATOR = new AspectJPrecedenceComparator(); + private static final Comparator<Advisor> DEFAULT_PRECEDENCE_COMPARATOR = new AspectJPrecedenceComparator(); /** @@ -98,7 +98,7 @@ protected void extendAdvisors(List<Advisor> candidateAdvisors) { } @Override - protected boolean shouldSkip(Class beanClass, String beanName) { + protected boolean shouldSkip(Class<?> beanClass, String beanName) { // TODO: Consider optimization by caching the list of the aspect names List<Advisor> candidateAdvisors = findCandidateAdvisors(); for (Advisor advisor : candidateAdvisors) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java
@@ -48,7 +48,7 @@ * @author Juergen Hoeller * @since 2.0 */ -class AspectJPrecedenceComparator implements Comparator { +class AspectJPrecedenceComparator implements Comparator<Advisor> { private static final int HIGHER_PRECEDENCE = -1; private static final int SAME_PRECEDENCE = 0; @@ -76,18 +76,10 @@ public AspectJPrecedenceComparator(Comparator<? super Advisor> advisorComparator @Override - public int compare(Object o1, Object o2) { - if (!(o1 instanceof Advisor && o2 instanceof Advisor)) { - throw new IllegalArgumentException( - "AspectJPrecedenceComparator can only compare the order of Advisors, " + - "but was passed [" + o1 + "] and [" + o2 + "]"); - } - - Advisor advisor1 = (Advisor) o1; - Advisor advisor2 = (Advisor) o2; - int advisorPrecedence = this.advisorComparator.compare(advisor1, advisor2); - if (advisorPrecedence == SAME_PRECEDENCE && declaredInSameAspect(advisor1, advisor2)) { - advisorPrecedence = comparePrecedenceWithinAspect(advisor1, advisor2); + public int compare(Advisor o1, Advisor o2) { + int advisorPrecedence = this.advisorComparator.compare(o1, o2); + if (advisorPrecedence == SAME_PRECEDENCE && declaredInSameAspect(o1, o2)) { + advisorPrecedence = comparePrecedenceWithinAspect(o1, o2); } return advisorPrecedence; }
true