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 | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java | @@ -183,16 +183,19 @@ public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) {
this.importBeanNameGenerator = beanNameGenerator;
}
+ @Override
public void setEnvironment(Environment environment) {
Assert.notNull(environment, "Environment must not be null");
this.environment = environment;
}
+ @Override
public void setResourceLoader(ResourceLoader resourceLoader) {
Assert.notNull(resourceLoader, "ResourceLoader must not be null");
this.resourceLoader = resourceLoader;
}
+ @Override
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = beanClassLoader;
if (!this.setMetadataReaderFactoryCalled) {
@@ -204,6 +207,7 @@ public void setBeanClassLoader(ClassLoader beanClassLoader) {
/**
* Derive further bean definitions from the configuration classes in the registry.
*/
+ @Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) {
RootBeanDefinition iabpp = new RootBeanDefinition(ImportAwareBeanPostProcessor.class);
iabpp.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
@@ -227,6 +231,7 @@ public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) {
* Prepare the Configuration classes for servicing bean requests at runtime
* by replacing them with CGLIB-enhanced subclasses.
*/
+ @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
int factoryId = System.identityHashCode(beanFactory);
if (this.factoriesPostProcessed.contains(factoryId)) {
@@ -373,10 +378,12 @@ private static class ImportAwareBeanPostProcessor implements PriorityOrdered, Be
private BeanFactory beanFactory;
+ @Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = beanFactory;
}
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof ImportAware) {
ImportRegistry importRegistry = this.beanFactory.getBean(IMPORT_REGISTRY_BEAN_NAME, ImportRegistry.class);
@@ -399,10 +406,12 @@ public Object postProcessBeforeInitialization(Object bean, String beanName) thro
return bean;
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
+ @Override
public int getOrder() {
return Ordered.HIGHEST_PRECEDENCE;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/annotation/Jsr330ScopeMetadataResolver.java | @@ -81,6 +81,7 @@ protected String resolveScopeName(String annotationType) {
}
+ @Override
public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) {
ScopeMetadata metadata = new ScopeMetadata();
metadata.setScopeName(BeanDefinition.SCOPE_PROTOTYPE); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/annotation/LoadTimeWeavingConfiguration.java | @@ -52,13 +52,15 @@ public class LoadTimeWeavingConfiguration implements ImportAware, BeanClassLoade
private ClassLoader beanClassLoader;
+ @Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
this.enableLTW = MetadataUtils.attributesFor(importMetadata, EnableLoadTimeWeaving.class);
Assert.notNull(this.enableLTW,
"@EnableLoadTimeWeaving is not present on importing class " +
importMetadata.getClassName());
}
+ @Override
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = beanClassLoader;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/annotation/MBeanExportConfiguration.java | @@ -56,13 +56,15 @@ public class MBeanExportConfiguration implements ImportAware, BeanFactoryAware {
private BeanFactory beanFactory;
+ @Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
Map<String, Object> map = importMetadata.getAnnotationAttributes(EnableMBeanExport.class.getName());
this.attributes = AnnotationAttributes.fromMap(map);
Assert.notNull(this.attributes, "@EnableMBeanExport is not present on " +
"importing class " + importMetadata.getClassName());
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = beanFactory;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/annotation/ScannedGenericBeanDefinition.java | @@ -61,6 +61,7 @@ public ScannedGenericBeanDefinition(MetadataReader metadataReader) {
}
+ @Override
public final AnnotationMetadata getMetadata() {
return this.metadata;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/config/ContextNamespaceHandler.java | @@ -30,6 +30,7 @@
*/
public class ContextNamespaceHandler extends NamespaceHandlerSupport {
+ @Override
public void init() {
registerBeanDefinitionParser("property-placeholder", new PropertyPlaceholderBeanDefinitionParser());
registerBeanDefinitionParser("property-override", new PropertyOverrideBeanDefinitionParser()); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/config/SpringConfiguredBeanDefinitionParser.java | @@ -43,6 +43,7 @@ class SpringConfiguredBeanDefinitionParser implements BeanDefinitionParser {
"org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect";
+ @Override
public BeanDefinition parse(Element element, ParserContext parserContext) {
if (!parserContext.getRegistry().containsBeanDefinition(BEAN_CONFIGURER_ASPECT_BEAN_NAME)) {
RootBeanDefinition def = new RootBeanDefinition(); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/event/AbstractApplicationEventMulticaster.java | @@ -58,34 +58,39 @@ public abstract class AbstractApplicationEventMulticaster implements Application
private BeanFactory beanFactory;
+ @Override
public void addApplicationListener(ApplicationListener listener) {
synchronized (this.defaultRetriever) {
this.defaultRetriever.applicationListeners.add(listener);
this.retrieverCache.clear();
}
}
+ @Override
public void addApplicationListenerBean(String listenerBeanName) {
synchronized (this.defaultRetriever) {
this.defaultRetriever.applicationListenerBeans.add(listenerBeanName);
this.retrieverCache.clear();
}
}
+ @Override
public void removeApplicationListener(ApplicationListener listener) {
synchronized (this.defaultRetriever) {
this.defaultRetriever.applicationListeners.remove(listener);
this.retrieverCache.clear();
}
}
+ @Override
public void removeApplicationListenerBean(String listenerBeanName) {
synchronized (this.defaultRetriever) {
this.defaultRetriever.applicationListenerBeans.remove(listenerBeanName);
this.retrieverCache.clear();
}
}
+ @Override
public void removeAllListeners() {
synchronized (this.defaultRetriever) {
this.defaultRetriever.applicationListeners.clear();
@@ -94,6 +99,7 @@ public void removeAllListeners() {
}
}
+ @Override
public final void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/event/EventPublicationInterceptor.java | @@ -77,17 +77,20 @@ public void setApplicationEventClass(Class applicationEventClass) {
}
}
+ @Override
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
this.applicationEventPublisher = applicationEventPublisher;
}
+ @Override
public void afterPropertiesSet() throws Exception {
if (this.applicationEventClassConstructor == null) {
throw new IllegalArgumentException("applicationEventClass is required");
}
}
+ @Override
public Object invoke(MethodInvocation invocation) throws Throwable {
Object retVal = invocation.proceed();
| true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/event/GenericApplicationListenerAdapter.java | @@ -46,11 +46,13 @@ public GenericApplicationListenerAdapter(ApplicationListener delegate) {
}
+ @Override
@SuppressWarnings("unchecked")
public void onApplicationEvent(ApplicationEvent event) {
this.delegate.onApplicationEvent(event);
}
+ @Override
public boolean supportsEventType(Class<? extends ApplicationEvent> eventType) {
Class typeArg = GenericTypeResolver.resolveTypeArgument(this.delegate.getClass(), ApplicationListener.class);
if (typeArg == null || typeArg.equals(ApplicationEvent.class)) {
@@ -62,10 +64,12 @@ public boolean supportsEventType(Class<? extends ApplicationEvent> eventType) {
return (typeArg == null || typeArg.isAssignableFrom(eventType));
}
+ @Override
public boolean supportsSourceType(Class<?> sourceType) {
return true;
}
+ @Override
public int getOrder() {
return (this.delegate instanceof Ordered ? ((Ordered) this.delegate).getOrder() : Ordered.LOWEST_PRECEDENCE);
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java | @@ -81,12 +81,14 @@ protected Executor getTaskExecutor() {
}
+ @Override
@SuppressWarnings("unchecked")
public void multicastEvent(final ApplicationEvent event) {
for (final ApplicationListener listener : getApplicationListeners(event)) {
Executor executor = getTaskExecutor();
if (executor != null) {
executor.execute(new Runnable() {
+ @Override
@SuppressWarnings("unchecked")
public void run() {
listener.onApplicationEvent(event); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/event/SourceFilteringListener.java | @@ -63,20 +63,24 @@ protected SourceFilteringListener(Object source) {
}
+ @Override
public void onApplicationEvent(ApplicationEvent event) {
if (event.getSource() == this.source) {
onApplicationEventInternal(event);
}
}
+ @Override
public boolean supportsEventType(Class<? extends ApplicationEvent> eventType) {
return (this.delegate == null || this.delegate.supportsEventType(eventType));
}
+ @Override
public boolean supportsSourceType(Class<?> sourceType) {
return sourceType.isInstance(this.source);
}
+ @Override
public int getOrder() {
return (this.delegate != null ? this.delegate.getOrder() : Ordered.LOWEST_PRECEDENCE);
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/expression/BeanExpressionContextAccessor.java | @@ -32,22 +32,27 @@
*/
public class BeanExpressionContextAccessor implements PropertyAccessor {
+ @Override
public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException {
return ((BeanExpressionContext) target).containsObject(name);
}
+ @Override
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
return new TypedValue(((BeanExpressionContext) target).getObject(name));
}
+ @Override
public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException {
return false;
}
+ @Override
public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException {
throw new AccessException("Beans in a BeanFactory are read-only");
}
+ @Override
public Class[] getSpecificTargetClasses() {
return new Class[] {BeanExpressionContext.class};
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/expression/BeanFactoryAccessor.java | @@ -32,22 +32,27 @@
*/
public class BeanFactoryAccessor implements PropertyAccessor {
+ @Override
public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException {
return (((BeanFactory) target).containsBean(name));
}
+ @Override
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
return new TypedValue(((BeanFactory) target).getBean(name));
}
+ @Override
public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException {
return false;
}
+ @Override
public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException {
throw new AccessException("Beans in a BeanFactory are read-only");
}
+ @Override
public Class[] getSpecificTargetClasses() {
return new Class[] {BeanFactory.class};
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/expression/BeanFactoryResolver.java | @@ -39,6 +39,7 @@ public BeanFactoryResolver(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}
+ @Override
public Object resolve(EvaluationContext context, String beanName) throws AccessException {
try {
return this.beanFactory.getBean(beanName); | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/expression/EnvironmentAccessor.java | @@ -31,6 +31,7 @@
*/
public class EnvironmentAccessor implements PropertyAccessor {
+ @Override
public Class<?>[] getSpecificTargetClasses() {
return new Class[] { Environment.class };
}
@@ -39,6 +40,7 @@ public Class<?>[] getSpecificTargetClasses() {
* Can read any {@link Environment}, thus always returns true.
* @return true
*/
+ @Override
public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException {
return true;
}
@@ -47,6 +49,7 @@ public boolean canRead(EvaluationContext context, Object target, String name) th
* Access the given target object by resolving the given property name against the given target
* environment.
*/
+ @Override
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
return new TypedValue(((Environment)target).getProperty(name));
}
@@ -55,13 +58,15 @@ public TypedValue read(EvaluationContext context, Object target, String name) th
* Read only.
* @return false
*/
+ @Override
public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException {
return false;
}
/**
* Read only. No-op.
*/
+ @Override
public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException {
}
| true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java | @@ -33,11 +33,13 @@
*/
public class MapAccessor implements PropertyAccessor {
+ @Override
public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException {
Map map = (Map) target;
return map.containsKey(name);
}
+ @Override
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
Map map = (Map) target;
Object value = map.get(name);
@@ -47,16 +49,19 @@ public TypedValue read(EvaluationContext context, Object target, String name) th
return new TypedValue(value);
}
+ @Override
public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException {
return true;
}
+ @Override
@SuppressWarnings("unchecked")
public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException {
Map map = (Map) target;
map.put(name, newValue);
}
+ @Override
public Class[] getSpecificTargetClasses() {
return new Class[] {Map.class};
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/expression/StandardBeanExpressionResolver.java | @@ -66,12 +66,15 @@ public class StandardBeanExpressionResolver implements BeanExpressionResolver {
new ConcurrentHashMap<BeanExpressionContext, StandardEvaluationContext>(8);
private final ParserContext beanExpressionParserContext = new ParserContext() {
+ @Override
public boolean isTemplate() {
return true;
}
+ @Override
public String getExpressionPrefix() {
return expressionPrefix;
}
+ @Override
public String getExpressionSuffix() {
return expressionSuffix;
}
@@ -109,6 +112,7 @@ public void setExpressionParser(ExpressionParser expressionParser) {
}
+ @Override
public Object evaluate(String value, BeanExpressionContext evalContext) throws BeansException {
if (!StringUtils.hasLength(value)) {
return value; | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/i18n/SimpleLocaleContext.java | @@ -42,6 +42,7 @@ public SimpleLocaleContext(Locale locale) {
this.locale = locale;
}
+ @Override
public Locale getLocale() {
return this.locale;
} | true |
Other | spring-projects | spring-framework | 3b40ce76bf751d788f57064bb692ceb8804a58af.json | Add @Override annotations to main sources
Issue: SPR-10130 | spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java | @@ -240,14 +240,17 @@ public AbstractApplicationContext(ApplicationContext parent) {
* of the context bean if the context is itself defined as a bean.
* @param id the unique id of the context
*/
+ @Override
public void setId(String id) {
this.id = id;
}
+ @Override
public String getId() {
return this.id;
}
+ @Override
public String getApplicationName() {
return "";
}
@@ -266,6 +269,7 @@ public void setDisplayName(String displayName) {
* Return a friendly name for this context.
* @return a display name for this context (never {@code null})
*/
+ @Override
public String getDisplayName() {
return this.displayName;
}
@@ -274,6 +278,7 @@ public String getDisplayName() {
* Return the parent context, or {@code null} if there is no parent
* (that is, this context is the root of the context hierarchy).
*/
+ @Override
public ApplicationContext getParent() {
return this.parent;
}
@@ -283,6 +288,7 @@ public ApplicationContext getParent() {
* <p>If {@code null}, a new environment will be initialized via
* {@link #createEnvironment()}.
*/
+ @Override
public ConfigurableEnvironment getEnvironment() {
if (this.environment == null) {
this.environment = createEnvironment();
@@ -298,6 +304,7 @@ public ConfigurableEnvironment getEnvironment() {
* should be performed <em>before</em> {@link #refresh()}.
* @see org.springframework.context.support.AbstractApplicationContext#createEnvironment
*/
+ @Override
public void setEnvironment(ConfigurableEnvironment environment) {
this.environment = environment;
}
@@ -307,13 +314,15 @@ public void setEnvironment(ConfigurableEnvironment environment) {
* if already available.
* @see #getBeanFactory()
*/
+ @Override
public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException {
return getBeanFactory();
}
/**
* Return the timestamp (ms) when this context was first loaded.
*/
+ @Override
public long getStartupDate() {
return this.startupDate;
}
@@ -326,6 +335,7 @@ public long getStartupDate() {
* @param event the event to publish (may be application-specific or a
* standard framework event)
*/
+ @Override
public void publishEvent(ApplicationEvent event) {
Assert.notNull(event, "Event must not be null");
if (logger.isTraceEnabled()) {
@@ -394,6 +404,7 @@ protected ResourcePatternResolver getResourcePatternResolver() {
* its environment is an instance of {@link ConfigurableEnvironment}.
* @see ConfigurableEnvironment#merge(ConfigurableEnvironment)
*/
+ @Override
public void setParent(ApplicationContext parent) {
this.parent = parent;
if (parent != null) {
@@ -404,6 +415,7 @@ public void setParent(ApplicationContext parent) {
}
}
+ @Override
public void addBeanFactoryPostProcessor(BeanFactoryPostProcessor beanFactoryPostProcessor) {
this.beanFactoryPostProcessors.add(beanFactoryPostProcessor);
}
@@ -417,6 +429,7 @@ public List<BeanFactoryPostProcessor> getBeanFactoryPostProcessors() {
return this.beanFactoryPostProcessors;
}
+ @Override
public void addApplicationListener(ApplicationListener<?> listener) {
if (this.applicationEventMulticaster != null) {
this.applicationEventMulticaster.addApplicationListener(listener);
@@ -442,6 +455,7 @@ protected ConfigurableEnvironment createEnvironment() {
return new StandardEnvironment();
}
+ @Override
public void refresh() throws BeansException, IllegalStateException {
synchronized (this.startupShutdownMonitor) {
// Prepare this context for refreshing.
@@ -971,6 +985,7 @@ protected void cancelRefresh(BeansException ex) {
* @see #close()
* @see #doClose()
*/
+ @Override
public void registerShutdownHook() {
if (this.shutdownHook == null) {
// No shutdown hook registered yet.
@@ -994,6 +1009,7 @@ public void run() {
* @see #close()
* @see org.springframework.beans.factory.access.SingletonBeanFactoryLocator
*/
+ @Override
public void destroy() {
close();
}
@@ -1005,6 +1021,7 @@ public void destroy() {
* @see #doClose()
* @see #registerShutdownHook()
*/
+ @Override
public void close() {
synchronized (this.startupShutdownMonitor) {
doClose();
@@ -1102,6 +1119,7 @@ protected void onClose() {
// For subclasses: do nothing by default.
}
+ @Override
public boolean isActive() {
synchronized (this.activeMonitor) {
return this.active;
@@ -1113,42 +1131,52 @@ public boolean isActive() {
// Implementation of BeanFactory interface
//---------------------------------------------------------------------
+ @Override
public Object getBean(String name) throws BeansException {
return getBeanFactory().getBean(name);
}
+ @Override
public <T> T getBean(String name, Class<T> requiredType) throws BeansException {
return getBeanFactory().getBean(name, requiredType);
}
+ @Override
public <T> T getBean(Class<T> requiredType) throws BeansException {
return getBeanFactory().getBean(requiredType);
}
+ @Override
public Object getBean(String name, Object... args) throws BeansException {
return getBeanFactory().getBean(name, args);
}
+ @Override
public boolean containsBean(String name) {
return getBeanFactory().containsBean(name);
}
+ @Override
public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
return getBeanFactory().isSingleton(name);
}
+ @Override
public boolean isPrototype(String name) throws NoSuchBeanDefinitionException {
return getBeanFactory().isPrototype(name);
}
+ @Override
public boolean isTypeMatch(String name, Class<?> targetType) throws NoSuchBeanDefinitionException {
return getBeanFactory().isTypeMatch(name, targetType);
}
+ @Override
public Class<?> getType(String name) throws NoSuchBeanDefinitionException {
return getBeanFactory().getType(name);
}
+ @Override
public String[] getAliases(String name) {
return getBeanFactory().getAliases(name);
}
@@ -1158,42 +1186,51 @@ public String[] getAliases(String name) {
// Implementation of ListableBeanFactory interface
//---------------------------------------------------------------------
+ @Override
public boolean containsBeanDefinition(String beanName) {
return getBeanFactory().containsBeanDefinition(beanName);
}
+ @Override
public int getBeanDefinitionCount() {
return getBeanFactory().getBeanDefinitionCount();
}
+ @Override
public String[] getBeanDefinitionNames() {
return getBeanFactory().getBeanDefinitionNames();
}
+ @Override
public String[] getBeanNamesForType(Class<?> type) {
return getBeanFactory().getBeanNamesForType(type);
}
+ @Override
public String[] getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit) {
return getBeanFactory().getBeanNamesForType(type, includeNonSingletons, allowEagerInit);
}
+ @Override
public <T> Map<String, T> getBeansOfType(Class<T> type) throws BeansException {
return getBeanFactory().getBeansOfType(type);
}
+ @Override
public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
throws BeansException {
return getBeanFactory().getBeansOfType(type, includeNonSingletons, allowEagerInit);
}
+ @Override
public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
throws BeansException {
return getBeanFactory().getBeansWithAnnotation(annotationType);
}
+ @Override
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) {
return getBeanFactory().findAnnotationOnBean(beanName, annotationType);
}
@@ -1203,10 +1240,12 @@ public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> a
// Implementation of HierarchicalBeanFactory interface
//---------------------------------------------------------------------
+ @Override
public BeanFactory getParentBeanFactory() {
return getParent();
}
+ @Override
public boolean containsLocalBean(String name) {
return getBeanFactory().containsLocalBean(name);
}
@@ -1226,14 +1265,17 @@ protected BeanFactory getInternalParentBeanFactory() {
// Implementation of MessageSource interface
//---------------------------------------------------------------------
+ @Override
public String getMessage(String code, Object args[], String defaultMessage, Locale locale) {
return getMessageSource().getMessage(code, args, defaultMessage, locale);
}
+ @Override
public String getMessage(String code, Object args[], Locale locale) throws NoSuchMessageException {
return getMessageSource().getMessage(code, args, locale);
}
+ @Override
public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
return getMessageSource().getMessage(resolvable, locale);
}
@@ -1265,6 +1307,7 @@ protected MessageSource getInternalParentMessageSource() {
// Implementation of ResourcePatternResolver interface
//---------------------------------------------------------------------
+ @Override
public Resource[] getResources(String locationPattern) throws IOException {
return this.resourcePatternResolver.getResources(locationPattern);
}
@@ -1274,16 +1317,19 @@ public Resource[] getResources(String locationPattern) throws IOException {
// Implementation of Lifecycle interface
//---------------------------------------------------------------------
+ @Override
public void start() {
getLifecycleProcessor().start();
publishEvent(new ContextStartedEvent(this));
}
+ @Override
public void stop() {
getLifecycleProcessor().stop();
publishEvent(new ContextStoppedEvent(this));
}
+ @Override
public boolean isRunning() {
return getLifecycleProcessor().isRunning();
}
@@ -1325,6 +1371,7 @@ public boolean isRunning() {
* @see #refreshBeanFactory()
* @see #closeBeanFactory()
*/
+ @Override
public abstract ConfigurableListableBeanFactory getBeanFactory() throws IllegalStateException;
@@ -1363,10 +1410,12 @@ public BeanPostProcessorChecker(ConfigurableListableBeanFactory beanFactory, int
this.beanPostProcessorTargetCount = beanPostProcessorTargetCount;
}
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
return bean;
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
if (bean != null && !(bean instanceof BeanPostProcessor) &&
this.beanFactory.getBeanPostProcessorCount() < this.beanPostProcessorTargetCount) {
@@ -1389,16 +1438,19 @@ private class ApplicationListenerDetector implements MergedBeanDefinitionPostPro
private final Map<String, Boolean> singletonNames = new ConcurrentHashMap<String, Boolean>(64);
+ @Override
public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {
if (beanDefinition.isSingleton()) {
this.singletonNames.put(beanName, Boolean.TRUE);
}
}
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
return bean;
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
if (bean instanceof ApplicationListener) {
// potentially not detected as a listener by getBeanNamesForType retrieval | true |
Other | spring-projects | spring-framework | 584e79c677e69853a983667521a20b66331d52a6.json | Promote use of @PostConstruct and @PreDestroy
Update reference documentation to promote the use of the JSR-250
@PostConstruct and @PreDestroy annotations.
Issue: SPR-8493 | src/reference/docbook/beans-customizing.xml | @@ -13,18 +13,25 @@
<section xml:id="beans-factory-lifecycle">
<title>Lifecycle callbacks</title>
- <!-- MLP Beverly to review: Old Text: The Spring Framework provides several callback interfaces to
- change the behavior of your bean in the container; they include -->
-
<para>To interact with the container's management of the bean lifecycle, you
can implement the Spring <interfacename>InitializingBean</interfacename>
and <interfacename>DisposableBean</interfacename> interfaces. The
container calls <methodname>afterPropertiesSet()</methodname> for the
former and <methodname>destroy()</methodname> for the latter to allow the
bean to perform certain actions upon initialization and destruction of
- your beans. You can also achieve the same integration with the container
- without coupling your classes to Spring interfaces through the use of
- init-method and destroy method object definition metadata.</para>
+ your beans.</para>
+
+ <tip>
+ <para>The JSR-250 <interfacename>@PostConstruct</interfacename> and
+ <interfacename>@PreDestroy</interfacename> annotations are generally
+ considered best practice for receiving lifecycle callbacks in a modern
+ Spring application. Using these annotations means that your beans are not
+ coupled to Spring specific interfaces. For details see
+ <xref linkend="beans-postconstruct-and-predestroy-annotations"/>.</para>
+ <para>If you don't want to use the JSR-250 annotations but you are still
+ looking to remove coupling consider the use of init-method and destroy-method
+ object definition metadata.</para>
+ </tip>
<para>Internally, the Spring Framework uses
<interfacename>BeanPostProcessor</interfacename> implementations to
@@ -57,7 +64,9 @@
<para>It is recommended that you do not use the
<interfacename>InitializingBean</interfacename> interface because it
- unnecessarily couples the code to Spring. Alternatively, specify a POJO
+ unnecessarily couples the code to Spring. Alternatively, use the
+ <link linkend="beans-postconstruct-and-predestroy-annotations">
+ <interfacename>@PostConstruct</interfacename> annotation</link> or specify a POJO
initialization method. In the case of XML-based configuration metadata,
you use the <literal>init-method</literal> attribute to specify the name
of the method that has a void no-argument signature. For example, the
@@ -99,7 +108,9 @@
<para>It is recommended that you do not use the
<interfacename>DisposableBean</interfacename> callback interface because
- it unnecessarily couples the code to Spring. Alternatively, specify a
+ it unnecessarily couples the code to Spring. Alternatively, use the
+ <link linkend="beans-postconstruct-and-predestroy-annotations">
+ <interfacename>@PreDestroy</interfacename> annotation</link> or specify a
generic method that is supported by bean definitions. With XML-based
configuration metadata, you use the <literal>destroy-method</literal>
attribute on the <literal><bean/></literal>. For example, the | false |
Other | spring-projects | spring-framework | 7bbb4ec7aff9ca171f2d34f747d7e0d96a6ce1b0.json | Fix Assert.instanceOf exception message
Update the exception message used when Assert.instanceOf fails such
that it expects the provided message to end with '.'. This reverts
commit 5874383ef081bb52a872dd49d63e5b542fbf20ca which caused the
implementation to be at odds with the JavaDoc and the previous
release.
The updated code also has the benefit of protecting against a null
message.
Issue: SPR-10269 | spring-core/src/main/java/org/springframework/util/Assert.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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
@@ -334,8 +334,9 @@ public static void isInstanceOf(Class clazz, Object obj) {
public static void isInstanceOf(Class type, Object obj, String message) {
notNull(type, "Type to check against must not be null");
if (!type.isInstance(obj)) {
- throw new IllegalArgumentException(message +
- ". Object of class [" + (obj != null ? obj.getClass().getName() : "null") +
+ throw new IllegalArgumentException(
+ (StringUtils.hasLength(message) ? message + " " : "") +
+ "Object of class [" + (obj != null ? obj.getClass().getName() : "null") +
"] must be an instance of " + type);
}
} | true |
Other | spring-projects | spring-framework | 7bbb4ec7aff9ca171f2d34f747d7e0d96a6ce1b0.json | Fix Assert.instanceOf exception message
Update the exception message used when Assert.instanceOf fails such
that it expects the provided message to end with '.'. This reverts
commit 5874383ef081bb52a872dd49d63e5b542fbf20ca which caused the
implementation to be at odds with the JavaDoc and the previous
release.
The updated code also has the benefit of protecting against a null
message.
Issue: SPR-10269 | spring-core/src/test/java/org/springframework/util/AssertTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -24,7 +24,9 @@
import java.util.Map;
import java.util.Set;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.ExpectedException;
/**
* Unit tests for the {@link Assert} class.
@@ -36,13 +38,32 @@
*/
public class AssertTests {
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
@Test(expected = IllegalArgumentException.class)
public void instanceOf() {
final Set<?> set = new HashSet<Object>();
Assert.isInstanceOf(HashSet.class, set);
Assert.isInstanceOf(HashMap.class, set);
}
+ @Test
+ public void instanceOfNoMessage() throws Exception {
+ thrown.expect(IllegalArgumentException.class);
+ thrown.expectMessage("Object of class [java.lang.Object] must be an instance " +
+ "of interface java.util.Set");
+ Assert.isInstanceOf(Set.class, new Object(), null);
+ }
+
+ @Test
+ public void instanceOfMessage() throws Exception {
+ thrown.expect(IllegalArgumentException.class);
+ thrown.expectMessage("Custom message. Object of class [java.lang.Object] must " +
+ "be an instance of interface java.util.Set");
+ Assert.isInstanceOf(Set.class, new Object(), "Custom message.");
+ }
+
@Test
public void isNullDoesNotThrowExceptionIfArgumentIsNullWithMessage() {
Assert.isNull(null, "Bla"); | true |
Other | spring-projects | spring-framework | fd831bc19e493e64fc5c2f823428ea07fd5f50b6.json | Add testMany test to TestGroup.PERFORMANCE | spring-context/src/test/java/org/springframework/aop/framework/AbstractAopProxyTests.java | @@ -62,6 +62,8 @@
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
import org.springframework.aop.target.HotSwappableTargetSource;
import org.springframework.aop.target.SingletonTargetSource;
+import org.springframework.tests.Assume;
+import org.springframework.tests.TestGroup;
import org.springframework.tests.TimeStamped;
import org.springframework.tests.aop.advice.CountingAfterReturningAdvice;
import org.springframework.tests.aop.advice.CountingBeforeAdvice;
@@ -170,6 +172,7 @@ public void testValuesStick() {
*/
@Test
public void testManyProxies() {
+ Assume.group(TestGroup.PERFORMANCE);
int howMany = 10000;
StopWatch sw = new StopWatch();
sw.start("Create " + howMany + " proxies"); | false |
Other | spring-projects | spring-framework | 1c724069c3a76d1619d2fee78ded5aaf6ab1b69b.json | Improve presentation of code blocks in Javadoc
Include custom javadoc css that formats <pre class="code"> blocks.
Issue: SPR-10155 | build.gradle | @@ -817,6 +817,7 @@ configure(rootProject) {
options.author = true
options.header = rootProject.description
options.overview = "src/api/overview.html"
+ options.stylesheetFile = file("src/api/stylesheet.css")
options.splitIndex = true
options.links(project.ext.javadocLinks)
| true |
Other | spring-projects | spring-framework | 1c724069c3a76d1619d2fee78ded5aaf6ab1b69b.json | Improve presentation of code blocks in Javadoc
Include custom javadoc css that formats <pre class="code"> blocks.
Issue: SPR-10155 | src/api/stylesheet.css | @@ -0,0 +1,541 @@
+/* Javadoc style sheet */
+
+/*
+Overall document style
+*/
+body {
+ background-color:#ffffff;
+ color:#353833;
+ font-family:Arial, Helvetica, sans-serif;
+ font-size:76%;
+ margin:0;
+}
+a:link, a:visited {
+ text-decoration:none;
+ color:#4c6b87;
+}
+a:hover, a:focus {
+ text-decoration:none;
+ color:#bb7a2a;
+}
+a:active {
+ text-decoration:none;
+ color:#4c6b87;
+}
+a[name] {
+ color:#353833;
+}
+a[name]:hover {
+ text-decoration:none;
+ color:#353833;
+}
+pre {
+ font-size:1.3em;
+}
+h1 {
+ font-size:1.8em;
+}
+h2 {
+ font-size:1.5em;
+}
+h3 {
+ font-size:1.4em;
+}
+h4 {
+ font-size:1.3em;
+}
+h5 {
+ font-size:1.2em;
+}
+h6 {
+ font-size:1.1em;
+}
+ul {
+ list-style-type:disc;
+}
+code, tt {
+ font-size:1.2em;
+}
+dt code {
+ font-size:1.2em;
+}
+table tr td dt code {
+ font-size:1.2em;
+ vertical-align:top;
+}
+sup {
+ font-size:.6em;
+}
+/*
+Document title and Copyright styles
+*/
+.clear {
+ clear:both;
+ height:0px;
+ overflow:hidden;
+}
+.aboutLanguage {
+ float:right;
+ padding:0px 21px;
+ font-size:.8em;
+ z-index:200;
+ margin-top:-7px;
+}
+.legalCopy {
+ margin-left:.5em;
+}
+.bar a, .bar a:link, .bar a:visited, .bar a:active {
+ color:#FFFFFF;
+ text-decoration:none;
+}
+.bar a:hover, .bar a:focus {
+ color:#bb7a2a;
+}
+.tab {
+ background-color:#0066FF;
+ background-image:url(resources/titlebar.gif);
+ background-position:left top;
+ background-repeat:no-repeat;
+ color:#ffffff;
+ padding:8px;
+ width:5em;
+ font-weight:bold;
+}
+/*
+Navigation bar styles
+*/
+.bar {
+ background-image:url(resources/background.gif);
+ background-repeat:repeat-x;
+ color:#FFFFFF;
+ padding:.8em .5em .4em .8em;
+ height:auto;/*height:1.8em;*/
+ font-size:1em;
+ margin:0;
+}
+.topNav {
+ background-image:url(resources/background.gif);
+ background-repeat:repeat-x;
+ color:#FFFFFF;
+ float:left;
+ padding:0;
+ width:100%;
+ clear:right;
+ height:2.8em;
+ padding-top:10px;
+ overflow:hidden;
+}
+.bottomNav {
+ margin-top:10px;
+ background-image:url(resources/background.gif);
+ background-repeat:repeat-x;
+ color:#FFFFFF;
+ float:left;
+ padding:0;
+ width:100%;
+ clear:right;
+ height:2.8em;
+ padding-top:10px;
+ overflow:hidden;
+}
+.subNav {
+ background-color:#dee3e9;
+ border-bottom:1px solid #9eadc0;
+ float:left;
+ width:100%;
+ overflow:hidden;
+}
+.subNav div {
+ clear:left;
+ float:left;
+ padding:0 0 5px 6px;
+}
+ul.navList, ul.subNavList {
+ float:left;
+ margin:0 25px 0 0;
+ padding:0;
+}
+ul.navList li{
+ list-style:none;
+ float:left;
+ padding:3px 6px;
+}
+ul.subNavList li{
+ list-style:none;
+ float:left;
+ font-size:90%;
+}
+.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
+ color:#FFFFFF;
+ text-decoration:none;
+}
+.topNav a:hover, .bottomNav a:hover {
+ text-decoration:none;
+ color:#bb7a2a;
+}
+.navBarCell1Rev {
+ background-image:url(resources/tab.gif);
+ background-color:#a88834;
+ color:#FFFFFF;
+ margin: auto 5px;
+ border:1px solid #c9aa44;
+}
+/*
+Page header and footer styles
+*/
+.header, .footer {
+ clear:both;
+ margin:0 20px;
+ padding:5px 0 0 0;
+}
+.indexHeader {
+ margin:10px;
+ position:relative;
+}
+.indexHeader h1 {
+ font-size:1.3em;
+}
+.title {
+ color:#2c4557;
+ margin:10px 0;
+}
+.subTitle {
+ margin:5px 0 0 0;
+}
+.header ul {
+ margin:0 0 25px 0;
+ padding:0;
+}
+.footer ul {
+ margin:20px 0 5px 0;
+}
+.header ul li, .footer ul li {
+ list-style:none;
+ font-size:1.2em;
+}
+/*
+Heading styles
+*/
+div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+ background-color:#dee3e9;
+ border-top:1px solid #9eadc0;
+ border-bottom:1px solid #9eadc0;
+ margin:0 0 6px -8px;
+ padding:2px 5px;
+}
+ul.blockList ul.blockList ul.blockList li.blockList h3 {
+ background-color:#dee3e9;
+ border-top:1px solid #9eadc0;
+ border-bottom:1px solid #9eadc0;
+ margin:0 0 6px -8px;
+ padding:2px 5px;
+}
+ul.blockList ul.blockList li.blockList h3 {
+ padding:0;
+ margin:15px 0;
+}
+ul.blockList li.blockList h2 {
+ padding:0px 0 20px 0;
+}
+/*
+Page layout container styles
+*/
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
+ clear:both;
+ padding:10px 20px;
+ position:relative;
+}
+.indexContainer {
+ margin:10px;
+ position:relative;
+ font-size:1.0em;
+}
+.indexContainer h2 {
+ font-size:1.1em;
+ padding:0 0 3px 0;
+}
+.indexContainer ul {
+ margin:0;
+ padding:0;
+}
+.indexContainer ul li {
+ list-style:none;
+}
+.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
+ font-size:1.1em;
+ font-weight:bold;
+ margin:10px 0 0 0;
+ color:#4E4E4E;
+}
+.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
+ margin:10px 0 10px 20px;
+}
+.serializedFormContainer dl.nameValue dt {
+ margin-left:1px;
+ font-size:1.1em;
+ display:inline;
+ font-weight:bold;
+}
+.serializedFormContainer dl.nameValue dd {
+ margin:0 0 0 1px;
+ font-size:1.1em;
+ display:inline;
+}
+/*
+List styles
+*/
+ul.horizontal li {
+ display:inline;
+ font-size:0.9em;
+}
+ul.inheritance {
+ margin:0;
+ padding:0;
+}
+ul.inheritance li {
+ display:inline;
+ list-style:none;
+}
+ul.inheritance li ul.inheritance {
+ margin-left:15px;
+ padding-left:15px;
+ padding-top:1px;
+}
+ul.blockList, ul.blockListLast {
+ margin:10px 0 10px 0;
+ padding:0;
+}
+ul.blockList li.blockList, ul.blockListLast li.blockList {
+ list-style:none;
+ margin-bottom:25px;
+}
+ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
+ padding:0px 20px 5px 10px;
+ border:1px solid #9eadc0;
+ background-color:#f9f9f9;
+}
+ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
+ padding:0 0 5px 8px;
+ background-color:#ffffff;
+ border:1px solid #9eadc0;
+ border-top:none;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
+ margin-left:0;
+ padding-left:0;
+ padding-bottom:15px;
+ border:none;
+ border-bottom:1px solid #9eadc0;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
+ list-style:none;
+ border-bottom:none;
+ padding-bottom:0;
+}
+table tr td dl, table tr td dl dt, table tr td dl dd {
+ margin-top:0;
+ margin-bottom:1px;
+}
+/*
+Table styles
+*/
+.contentContainer table, .classUseContainer table, .constantValuesContainer table {
+ border-bottom:1px solid #9eadc0;
+ width:100%;
+}
+.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
+ width:100%;
+}
+.contentContainer .description table, .contentContainer .details table {
+ border-bottom:none;
+}
+.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
+ vertical-align:top;
+ padding-right:20px;
+}
+.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
+.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
+.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
+.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
+ padding-right:3px;
+}
+.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
+ position:relative;
+ text-align:left;
+ background-repeat:no-repeat;
+ color:#FFFFFF;
+ font-weight:bold;
+ clear:none;
+ overflow:hidden;
+ padding:0px;
+ margin:0px;
+}
+caption a:link, caption a:hover, caption a:active, caption a:visited {
+ color:#FFFFFF;
+}
+.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
+ white-space:nowrap;
+ padding-top:8px;
+ padding-left:8px;
+ display:block;
+ float:left;
+ background-image:url(resources/titlebar.gif);
+ height:18px;
+}
+.contentContainer ul.blockList li.blockList caption span.activeTableTab span {
+ white-space:nowrap;
+ padding-top:8px;
+ padding-left:8px;
+ display:block;
+ float:left;
+ background-image:url(resources/activetitlebar.gif);
+ height:18px;
+}
+.contentContainer ul.blockList li.blockList caption span.tableTab span {
+ white-space:nowrap;
+ padding-top:8px;
+ padding-left:8px;
+ display:block;
+ float:left;
+ background-image:url(resources/titlebar.gif);
+ height:18px;
+}
+.contentContainer ul.blockList li.blockList caption span.tableTab, .contentContainer ul.blockList li.blockList caption span.activeTableTab {
+ padding-top:0px;
+ padding-left:0px;
+ background-image:none;
+ float:none;
+ display:inline;
+}
+.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
+ width:10px;
+ background-image:url(resources/titlebar_end.gif);
+ background-repeat:no-repeat;
+ background-position:top right;
+ position:relative;
+ float:left;
+}
+.contentContainer ul.blockList li.blockList .activeTableTab .tabEnd {
+ width:10px;
+ margin-right:5px;
+ background-image:url(resources/activetitlebar_end.gif);
+ background-repeat:no-repeat;
+ background-position:top right;
+ position:relative;
+ float:left;
+}
+.contentContainer ul.blockList li.blockList .tableTab .tabEnd {
+ width:10px;
+ margin-right:5px;
+ background-image:url(resources/titlebar_end.gif);
+ background-repeat:no-repeat;
+ background-position:top right;
+ position:relative;
+ float:left;
+}
+ul.blockList ul.blockList li.blockList table {
+ margin:0 0 12px 0px;
+ width:100%;
+}
+.tableSubHeadingColor {
+ background-color: #EEEEFF;
+}
+.altColor {
+ background-color:#eeeeef;
+}
+.rowColor {
+ background-color:#ffffff;
+}
+.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
+ text-align:left;
+ padding:3px 3px 3px 7px;
+}
+th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
+ background:#dee3e9;
+ border-top:1px solid #9eadc0;
+ border-bottom:1px solid #9eadc0;
+ text-align:left;
+ padding:3px 3px 3px 7px;
+}
+td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
+ font-weight:bold;
+}
+td.colFirst, th.colFirst {
+ border-left:1px solid #9eadc0;
+ white-space:nowrap;
+}
+td.colLast, th.colLast {
+ border-right:1px solid #9eadc0;
+}
+td.colOne, th.colOne {
+ border-right:1px solid #9eadc0;
+ border-left:1px solid #9eadc0;
+}
+table.overviewSummary {
+ padding:0px;
+ margin-left:0px;
+}
+table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
+table.overviewSummary td.colOne, table.overviewSummary th.colOne {
+ width:25%;
+ vertical-align:middle;
+}
+table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
+ width:25%;
+ vertical-align:middle;
+}
+/*
+Content styles
+*/
+.description pre {
+ margin-top:0;
+}
+.deprecatedContent {
+ margin:0;
+ padding:10px 0;
+}
+.docSummary {
+ padding:0;
+}
+/*
+Formatting effect styles
+*/
+.sourceLineNo {
+ color:green;
+ padding:0 30px 0 0;
+}
+h1.hidden {
+ visibility:hidden;
+ overflow:hidden;
+ font-size:.9em;
+}
+.block {
+ display:block;
+ margin:3px 0 0 0;
+}
+.strong {
+ font-weight:bold;
+}
+
+
+/*
+Spring
+*/
+
+pre.code {
+ background-color: #F8F8F8;
+ border: 1px solid #CCCCCC;
+ border-radius: 3px 3px 3px 3px;
+ overflow: auto;
+ padding: 10px;
+ margin: 4px 20px 2px 0px;
+}
+
+pre.code code, pre.code code * {
+ font-size: 1em;
+}
+
+pre.code code, pre.code code * {
+ padding: 0 !important;
+ margin: 0 !important;
+} | true |
Other | spring-projects | spring-framework | a6b70722facc7caa52e1d73e273e639d6cce696c.json | Update Quartz documentation to use FactoryBeans
Update examples for Quartz scheduling to use SimpleTriggerFactoryBean
and CronTriggerFactoryBean instead of SimpleTriggerBean and
CronTriggerBean.
Issue: SPR-10209 | src/reference/docbook/scheduling.xml | @@ -840,9 +840,9 @@ public class ExampleJob extends QuartzJobBean {
object. Of course, we still need to schedule the jobs themselves. This
is done using triggers and a
<classname>SchedulerFactoryBean</classname>. Several triggers are
- available within Quartz. Spring offers two subclassed triggers with
- convenient defaults: <classname>CronTriggerBean</classname> and
- <classname>SimpleTriggerBean</classname>.</para>
+ available within Quartz and Spring offers two Quartz <interfacename>FactoryBean</interfacename>
+ implementations with convenient defaults: <classname>CronTriggerFactoryBean</classname> and
+ <classname>SimpleTriggerFactoryBean</classname>.</para>
<para>Triggers need to be scheduled. Spring offers a
<classname>SchedulerFactoryBean</classname> that exposes triggers to be
@@ -851,7 +851,7 @@ public class ExampleJob extends QuartzJobBean {
<para>Find below a couple of examples:</para>
- <programlisting language="xml"><bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
+ <programlisting language="xml"><bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
<!-- see the example of method invoking job above -->
<property name="jobDetail" ref="jobDetail" />
<!-- 10 seconds -->
@@ -860,7 +860,7 @@ public class ExampleJob extends QuartzJobBean {
<property name="repeatInterval" value="50000" />
</bean>
-<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
+<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="exampleJob" />
<!-- run every morning at 6 AM -->
<property name="cronExpression" value="0 0 6 * * ?" /> | false |
Other | spring-projects | spring-framework | 94a88069ac57a4a8cc69ca2d72c1a0de69efa9e6.json | Update example years to 2013 in CONTRIBUTING.md | CONTRIBUTING.md | @@ -87,7 +87,7 @@ present in the framework.
```java
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -108,16 +108,16 @@ package ...;
## Update Apache license header to modified files as necessary
Always check the date range in the license header. For example, if you've
-modified a file in 2012 whose header still reads
+modified a file in 2013 whose header still reads
```java
* Copyright 2002-2011 the original author or authors.
```
-then be sure to update it to 2012 appropriately
+then be sure to update it to 2013 appropriately
```java
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
```
## Use @since tags for newly-added public API types and methods | false |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java | @@ -404,7 +404,6 @@ public void testIntroductionOnTargetImplementingInterface() {
}
}
- @SuppressWarnings("unchecked")
@Test
public void testIntroductionOnTargetExcludedByTypePattern() {
LinkedList target = new LinkedList(); | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java | @@ -157,7 +157,6 @@ public void testGenericMapWithCollectionValue() {
GenericBean<?> gb = new GenericBean<Object>();
BeanWrapper bw = new BeanWrapperImpl(gb);
bw.registerCustomEditor(Number.class, new CustomNumberEditor(Integer.class, false));
- @SuppressWarnings("unchecked")
Map<String, Collection> input = new HashMap<String, Collection>();
HashSet<Integer> value1 = new HashSet<Integer>();
value1.add(new Integer(1)); | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java | @@ -974,7 +974,6 @@ public void shouldSupportStaticWriteMethod() throws IntrospectionException {
}
static class WithStaticWriteMethod {
- @SuppressWarnings("unused")
public static void setProp1(String prop1) {
}
} | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java | @@ -2200,7 +2200,6 @@ public void testFieldSettingWithInstantiationAwarePostProcessorWithShortCircuit(
doTestFieldSettingWithInstantiationAwarePostProcessor(true);
}
- @SuppressWarnings("unchecked")
private void doTestFieldSettingWithInstantiationAwarePostProcessor(final boolean skipPropertyPopulation) {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java | @@ -87,7 +87,6 @@ public void multicastEvent(final ApplicationEvent event) {
Executor executor = getTaskExecutor();
if (executor != null) {
executor.execute(new Runnable() {
- @SuppressWarnings("unchecked")
public void run() {
listener.onApplicationEvent(event);
} | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-context/src/test/java/example/scannable/FooServiceImpl.java | @@ -65,7 +65,6 @@ public class FooServiceImpl implements FooService {
private boolean initCalled = false;
- @SuppressWarnings("unused")
@PostConstruct
private void init() {
if (this.initCalled) { | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-context/src/test/java/org/springframework/context/annotation/AnnotationConfigApplicationContextTests.java | @@ -133,7 +133,6 @@ public void getBeanByTypeRaisesNoSuchBeanDefinitionException() {
}
}
- @SuppressWarnings("unchecked")
@Test
public void getBeanByTypeAmbiguityRaisesException() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TwoTestBeanConfig.class); | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-context/src/test/java/org/springframework/context/annotation/BeanMethodPolymorphismTests.java | @@ -47,7 +47,7 @@ public class BeanMethodPolymorphismTests {
@Test
public void beanMethodOverloadingWithoutInheritance() {
- @SuppressWarnings({ "unused", "hiding" })
+ @SuppressWarnings({ "hiding" })
@Configuration class Config {
@Bean String aString() { return "na"; }
@Bean String aString(Integer dependency) { return "na"; } | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-context/src/test/java/org/springframework/context/annotation/configuration/BeanAnnotationAttributePropagationTests.java | @@ -41,7 +41,6 @@
*
* @author Chris Beams
*/
-@SuppressWarnings("unused") // for unused @Bean methods in local classes
public class BeanAnnotationAttributePropagationTests {
@Test | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceFactoryBeanTests.java | @@ -130,7 +130,6 @@ public void testInvalidFormatter() throws Exception {
private static class TestBean {
- @SuppressWarnings("unused")
@NumberFormat(style = Style.PERCENT)
private double percent;
| true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-context/src/test/java/org/springframework/format/support/FormattingConversionServiceTests.java | @@ -393,7 +393,6 @@ public static class MyDate extends Date {
private static class ModelWithSubclassField {
- @SuppressWarnings("unused")
@org.springframework.format.annotation.DateTimeFormat(style = "S-")
public MyDate date;
} | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-context/src/test/java/org/springframework/instrument/classloading/glassfish/GlassFishLoadTimeWeaverTests.java | @@ -20,7 +20,6 @@
// converting away from old-style EasyMock APIs was problematic with this class
// glassfish dependencies no longer on classpath
-@SuppressWarnings("deprecation")
@Ignore
public class GlassFishLoadTimeWeaverTests {
| true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-context/src/test/java/org/springframework/scheduling/annotation/EnableAsyncTests.java | @@ -74,7 +74,6 @@ public AsyncBean asyncBean() {
}
- @SuppressWarnings("unchecked")
@Test
public void withAsyncBeanWithExecutorQualifiedByName() throws ExecutionException, InterruptedException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java | @@ -358,7 +358,6 @@ public void testListOfList() {
GenericConversionService service = new DefaultConversionService();
List<String> list1 = Arrays.asList("Foo", "Bar");
List<String> list2 = Arrays.asList("Baz", "Boop");
- @SuppressWarnings("unchecked")
List<List<String>> list = Arrays.asList(list1, list2);
String result = service.convert(list, String.class);
assertNotNull(result); | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java | @@ -205,7 +205,6 @@ public boolean isWrapperFor(Class<?> iface) throws SQLException {
}
// getParentLogger() is required for JDBC 4.1 compatibility
- @SuppressWarnings("unused")
public Logger getParentLogger() {
return Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
} | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-orm/src/main/java/org/springframework/orm/jdo/JdoTemplate.java | @@ -481,7 +481,6 @@ public Collection doInJdo(PersistenceManager pm) throws JDOException {
public Collection find(final String queryString) throws DataAccessException {
return execute(new JdoCallback<Collection>() {
- @SuppressWarnings("unchecked")
public Collection doInJdo(PersistenceManager pm) throws JDOException {
Query query = pm.newQuery(queryString);
prepareQuery(query); | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-test-mvc/src/main/java/org/springframework/test/web/servlet/result/FlashAttributeResultMatchers.java | @@ -57,7 +57,6 @@ public void match(MvcResult result) throws Exception {
*/
public <T> ResultMatcher attribute(final String name, final Object value) {
return new ResultMatcher() {
- @SuppressWarnings("unchecked")
public void match(MvcResult result) throws Exception {
assertEquals("Flash attribute", value, result.getFlashMap().get(name));
} | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-web/src/test/java/org/springframework/http/converter/FormHttpMessageConverterTests.java | @@ -72,7 +72,6 @@ public void canWrite() {
}
@Test
- @SuppressWarnings("unchecked")
public void readForm() throws Exception {
String body = "name+1=value+1&name+2=value+2%2B1&name+2=value+2%2B2&name+3";
Charset iso88591 = Charset.forName("ISO-8859-1"); | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-web/src/test/java/org/springframework/web/method/annotation/InitBinderDataBinderFactoryTests.java | @@ -140,29 +140,25 @@ private WebDataBinderFactory createBinderFactory(String methodName, Class<?>...
private static class InitBinderHandler {
- @SuppressWarnings("unused")
@InitBinder
public void initBinder(WebDataBinder dataBinder) {
dataBinder.setDisallowedFields("id");
}
- @SuppressWarnings("unused")
@InitBinder(value="foo")
public void initBinderWithAttributeName(WebDataBinder dataBinder) {
dataBinder.setDisallowedFields("id");
}
- @SuppressWarnings("unused")
@InitBinder
public String initBinderReturnValue(WebDataBinder dataBinder) {
return "invalid";
}
- @SuppressWarnings("unused")
@InitBinder
public void initBinderTypeConversion(WebDataBinder dataBinder, @RequestParam int requestParam) {
dataBinder.setDisallowedFields("requestParam-" + requestParam);
}
}
-}
\ No newline at end of file
+} | true |
Other | spring-projects | spring-framework | d89e30b864c3303b2ba881451c38329bd3c16a09.json | Fix unnecessary @SupressWarnings annotations | spring-web/src/test/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessorTests.java | @@ -299,7 +299,6 @@ public void modelAttribute(@ModelAttribute("attrName") @Valid TestBean annotated
}
}
- @SuppressWarnings("unused")
@ModelAttribute("modelAttrName")
private String annotatedReturnValue() {
return null;
@@ -310,4 +309,4 @@ private TestBean notAnnotatedReturnValue() {
return null;
}
-}
\ No newline at end of file
+} | true |
Other | spring-projects | spring-framework | 321004143b0941a10be10edd665c843ec1ab7967.json | Improve Javadoc for ContextLoaderUtils
- class-level Javadoc now mentions application context initializers.
- avoided and suppressed warnings in method-level Javadoc.
Issue: SPR-10232 | spring-test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -41,7 +41,8 @@
/**
* Utility methods for working with {@link ContextLoader ContextLoaders} and
* {@link SmartContextLoader SmartContextLoaders} and resolving resource locations,
- * annotated classes, and active bean definition profiles.
+ * annotated classes, active bean definition profiles, and application context
+ * initializers.
*
* @author Sam Brannen
* @since 3.1
@@ -50,6 +51,7 @@
* @see ContextConfiguration
* @see ContextConfigurationAttributes
* @see ActiveProfiles
+ * @see ApplicationContextInitializer
* @see MergedContextConfiguration
*/
abstract class ContextLoaderUtils {
@@ -78,7 +80,7 @@ private ContextLoaderUtils() {
* either {@value #DEFAULT_CONTEXT_LOADER_CLASS_NAME}
* or {@value #DEFAULT_WEB_CONTEXT_LOADER_CLASS_NAME} will be used as the
* default context loader class name. For details on the class resolution
- * process, see {@link #resolveContextLoaderClass()}.
+ * process, see {@link #resolveContextLoaderClass}.
*
* @param testClass the test class for which the {@code ContextLoader}
* should be resolved; must not be {@code null}
@@ -89,8 +91,9 @@ private ContextLoaderUtils() {
* {@code ContextLoader} class to use; may be {@code null} or <em>empty</em>
* @return the resolved {@code ContextLoader} for the supplied
* {@code testClass} (never {@code null})
- * @see #resolveContextLoaderClass()
+ * @see #resolveContextLoaderClass
*/
+ @SuppressWarnings("javadoc")
static ContextLoader resolveContextLoader(Class<?> testClass,
List<ContextConfigurationAttributes> configAttributesList, String defaultContextLoaderClassName) {
Assert.notNull(testClass, "Class must not be null");
@@ -348,11 +351,11 @@ else if (!ObjectUtils.isEmpty(valueProfiles)) {
* @param defaultContextLoaderClassName the name of the default
* {@code ContextLoader} class to use (may be {@code null})
* @return the merged context configuration
- * @see #resolveContextLoader()
- * @see #resolveContextConfigurationAttributes()
- * @see SmartContextLoader#processContextConfiguration()
- * @see ContextLoader#processLocations()
- * @see #resolveActiveProfiles()
+ * @see #resolveContextLoader
+ * @see #resolveContextConfigurationAttributes
+ * @see SmartContextLoader#processContextConfiguration
+ * @see ContextLoader#processLocations
+ * @see #resolveActiveProfiles
* @see MergedContextConfiguration
*/
static MergedContextConfiguration buildMergedContextConfiguration(Class<?> testClass, | false |
Other | spring-projects | spring-framework | b8e7314c433123be0e7b9eadcdc64be841116c82.json | Fix typo in new-in-3.2.xml document
This commit fixes a typo in the "New Features and Enhancements in Spring
Framework 3.2" chapter of the reference manual. Specifically,
ContentNegotiationStrategy is now spelled correctly. | src/reference/docbook/new-in-3.2.xml | @@ -57,7 +57,7 @@
<section xml:id="new-in-3.2-webmvc-content-negotiation">
<title>Content negotiation improvements</title>
- <para>A <interfacename>ContentNeogtiationStrategy</interfacename> is now
+ <para>A <interfacename>ContentNegotiationStrategy</interfacename> is now
available for resolving the requested media types from an incoming
request. The available implementations are based on the file extension,
query parameter, the 'Accept' header, or a fixed content type. | false |
Other | spring-projects | spring-framework | 2b0d8609231deaf1a3790334f6ffd7dae326aa0e.json | Fix Javadoc warnings | spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -56,7 +56,7 @@
* this.foo = foo;
* return this;
* }
- * }</pre>
+ * }}</pre>
* The standard JavaBeans {@code Introspector} will discover the {@code getFoo} read
* method, but will bypass the {@code #setFoo(Foo)} write method, because its non-void
* returning signature does not comply with the JavaBeans specification. | true |
Other | spring-projects | spring-framework | 2b0d8609231deaf1a3790334f6ffd7dae326aa0e.json | Fix Javadoc warnings | spring-core/src/main/java/org/springframework/util/ObjectUtils.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -481,15 +481,15 @@ public static int nullSafeHashCode(short[] array) {
}
/**
- * Return the same value as {@code {@link Boolean#hashCode()}}.
+ * Return the same value as {@link Boolean#hashCode()}}.
* @see Boolean#hashCode()
*/
public static int hashCode(boolean bool) {
return bool ? 1231 : 1237;
}
/**
- * Return the same value as {@code {@link Double#hashCode()}}.
+ * Return the same value as {@link Double#hashCode()}}.
* @see Double#hashCode()
*/
public static int hashCode(double dbl) {
@@ -498,15 +498,15 @@ public static int hashCode(double dbl) {
}
/**
- * Return the same value as {@code {@link Float#hashCode()}}.
+ * Return the same value as {@link Float#hashCode()}}.
* @see Float#hashCode()
*/
public static int hashCode(float flt) {
return Float.floatToIntBits(flt);
}
/**
- * Return the same value as {@code {@link Long#hashCode()}}.
+ * Return the same value as {@link Long#hashCode()}}.
* @see Long#hashCode()
*/
public static int hashCode(long lng) { | true |
Other | spring-projects | spring-framework | 2b0d8609231deaf1a3790334f6ffd7dae326aa0e.json | Fix Javadoc warnings | spring-core/src/test/java/org/springframework/core/type/CachingMetadataReaderLeakTest.java | @@ -31,7 +31,7 @@
import org.springframework.tests.TestGroup;
/**
- * Unit test checking the behaviour of {@link CachingMetadataReaderFactory under load.
+ * Unit test checking the behaviour of {@link CachingMetadataReaderFactory} under load.
* If the cache is not controller, this test should fail with an out of memory exception around entry
* 5k.
* | true |
Other | spring-projects | spring-framework | 2b0d8609231deaf1a3790334f6ffd7dae326aa0e.json | Fix Javadoc warnings | spring-web/src/main/java/org/springframework/web/util/UriTemplate.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -32,7 +32,7 @@
/**
* Represents a URI template. A URI template is a URI-like String that contains variables enclosed
- * by braces ({@code {}, {@code }}), which can be expanded to produce an actual URI.
+ * by braces ({@code {}}), which can be expanded to produce an actual URI.
*
* <p>See {@link #expand(Map)}, {@link #expand(Object[])}, and {@link #match(String)} for example usages.
* | true |
Other | spring-projects | spring-framework | 2b0d8609231deaf1a3790334f6ffd7dae326aa0e.json | Fix Javadoc warnings | src/test/java/org/springframework/aop/config/AopNamespaceHandlerScopeIntegrationTests.java | @@ -41,7 +41,7 @@
* Integration tests for scoped proxy use in conjunction with aop: namespace.
* Deemed an integration test because .web mocks and application contexts are required.
*
- * @see org.springframework.aop.config.AopNamespaceHandlerTests;
+ * @see org.springframework.aop.config.AopNamespaceHandlerTests
*
* @author Rob Harrop
* @author Juergen Hoeller | true |
Other | spring-projects | spring-framework | 2b0d8609231deaf1a3790334f6ffd7dae326aa0e.json | Fix Javadoc warnings | src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests.java | @@ -44,7 +44,7 @@
* Integration tests for auto proxy creation by advisor recognition working in
* conjunction with transaction managment resources.
*
- * @see org.springframework.aop.framework.autoproxy.AdvisorAutoProxyCreatorTests;
+ * @see org.springframework.aop.framework.autoproxy.AdvisorAutoProxyCreatorTests
*
* @author Rod Johnson
* @author Chris Beams | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-aspects/src/main/java/org/springframework/transaction/aspectj/AbstractTransactionAspect.aj | @@ -60,7 +60,7 @@ public abstract aspect AbstractTransactionAspect extends TransactionAspectSuppor
before(Object txObject) : transactionalMethodExecution(txObject) {
MethodSignature methodSignature = (MethodSignature) thisJoinPoint.getSignature();
Method method = methodSignature.getMethod();
- TransactionInfo txInfo = createTransactionIfNecessary(method, txObject.getClass());
+ createTransactionIfNecessary(method, txObject.getClass());
}
@SuppressAjWarnings("adviceDidNotMatch") | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerTests.java | @@ -211,6 +211,7 @@ public void testInterfaceDrivenDependencyInjectionUponDeserialization() throws E
MailClientDependencyInjectionAspect.aspectOf().setMailSender(new JavaMailSenderImpl());
Order testOrder = new Order();
Order deserializedOrder = serializeAndDeserialize(testOrder);
+ assertNotNull(deserializedOrder);
assertNotNull("Interface driven injection didn't occur for deserialization", testOrder.mailSender);
}
| true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-beans/src/test/java/org/springframework/beans/factory/config/CustomScopeConfigurerTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -45,7 +45,6 @@ public void setUp() {
@Test
public void testWithNoScopes() throws Exception {
- Scope scope = mock(Scope.class);
CustomScopeConfigurer figurer = new CustomScopeConfigurer();
figurer.postProcessBeanFactory(factory);
} | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java | @@ -17,6 +17,7 @@
package org.springframework.beans.factory.config;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
@@ -644,6 +645,7 @@ public void testPropertyPlaceholderConfigurerWithSelfReferencingPlaceholderInAli
ppc.postProcessBeanFactory(factory);
TestBean tb = (TestBean) factory.getBean("tb");
+ assertNotNull(tb);
assertEquals(0, factory.getAliases("tb").length);
}
| true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java | @@ -515,8 +515,7 @@ public void testTrustedExecution() throws Exception {
perms.add(new AuthPermission("getSubject"));
ProtectionDomain pd = new ProtectionDomain(null, perms);
- AccessControlContext acc = new AccessControlContext(
- new ProtectionDomain[] { pd });
+ new AccessControlContext(new ProtectionDomain[] { pd });
final Subject subject = new Subject();
subject.getPrincipals().add(new TestPrincipal("user1")); | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-beans/src/test/java/org/springframework/beans/factory/xml/AbstractBeanFactoryTests.java | @@ -121,7 +121,7 @@ public void testGetInstanceByMatchingClass() {
public void testGetInstanceByNonmatchingClass() {
try {
- Object o = getBeanFactory().getBean("rod", BeanFactory.class);
+ getBeanFactory().getBean("rod", BeanFactory.class);
fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException");
}
catch (BeanNotOfRequiredTypeException ex) {
@@ -155,7 +155,7 @@ public void testGetSharedInstanceByMatchingClassNoCatch() {
public void testGetSharedInstanceByNonmatchingClass() {
try {
- Object o = getBeanFactory().getBean("rod", BeanFactory.class);
+ getBeanFactory().getBean("rod", BeanFactory.class);
fail("Rod bean is not of type BeanFactory; getBeanInstance(rod, BeanFactory.class) should throw BeanNotOfRequiredTypeException");
}
catch (BeanNotOfRequiredTypeException ex) {
@@ -199,7 +199,7 @@ public void testPrototypeInstancesAreIndependent() {
public void testNotThere() {
assertFalse(getBeanFactory().containsBean("Mr Squiggle"));
try {
- Object o = getBeanFactory().getBean("Mr Squiggle");
+ getBeanFactory().getBean("Mr Squiggle");
fail("Can't find missing bean");
}
catch (BeansException ex) {
@@ -223,7 +223,7 @@ public void testValidEmpty() {
public void xtestTypeMismatch() {
try {
- Object o = getBeanFactory().getBean("typeMismatch");
+ getBeanFactory().getBean("typeMismatch");
fail("Shouldn't succeed with type mismatch");
}
catch (BeanCreationException wex) {
@@ -278,6 +278,7 @@ public void testGetFactoryItself() throws Exception {
*/
public void testFactoryIsInitialized() throws Exception {
TestBean tb = (TestBean) getBeanFactory().getBean("singletonFactory");
+ assertNotNull(tb);
DummyFactory factory = (DummyFactory) getBeanFactory().getBean("&singletonFactory");
assertTrue("Factory was initialized because it implemented InitializingBean", factory.wasInitialized());
} | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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
@@ -51,13 +51,15 @@ public void testMBeanRegistration() throws Exception {
public void testRegisterOperations() throws Exception {
IJmxTestBean bean = getBean();
+ assertNotNull(bean);
MBeanInfo inf = getMBeanInfo();
assertEquals("Incorrect number of operations registered",
getExpectedOperationCount(), inf.getOperations().length);
}
public void testRegisterAttributes() throws Exception {
IJmxTestBean bean = getBean();
+ assertNotNull(bean);
MBeanInfo inf = getMBeanInfo();
assertEquals("Incorrect number of attributes registered",
getExpectedAttributeCount(), inf.getAttributes().length); | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-context/src/test/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssemblerMappedTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -39,7 +39,7 @@ public void testGetAgeIsReadOnly() throws Exception {
public void testWithUnknownClass() throws Exception {
try {
- InterfaceBasedMBeanInfoAssembler assembler = getWithMapping("com.foo.bar.Unknown");
+ getWithMapping("com.foo.bar.Unknown");
fail("Should have thrown IllegalArgumentException");
}
catch (IllegalArgumentException ex) {
@@ -49,7 +49,7 @@ public void testWithUnknownClass() throws Exception {
public void testWithNonInterface() throws Exception {
try {
- InterfaceBasedMBeanInfoAssembler assembler = getWithMapping("JmxTestBean");
+ getWithMapping("JmxTestBean");
fail("Should have thrown IllegalArgumentException");
}
catch (IllegalArgumentException ex) { | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-core/src/test/java/org/springframework/core/enums/LabeledEnumTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -104,7 +104,7 @@ public void testLabelFoundForAbstractEnums() {
public void testDoesNotMatchWrongClass() {
try {
- LabeledEnum none = StaticLabeledEnumResolver.instance().getLabeledEnumByCode(Dog.class,
+ StaticLabeledEnumResolver.instance().getLabeledEnumByCode(Dog.class,
new Short((short) 1));
fail("Should have failed");
}
@@ -119,10 +119,11 @@ public void testEquals() {
}
- @SuppressWarnings("serial")
+ @SuppressWarnings({ "serial", "unused" })
private static class Other extends StaticLabeledEnum {
public static final Other THING1 = new Other(1, "Thing1");
+
public static final Other THING2 = new Other(2, "Thing2");
| true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-core/src/test/java/org/springframework/util/StopWatchTests.java | @@ -1,6 +1,6 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -34,7 +34,6 @@ public void testValidUsage() throws Exception {
String name1 = "Task 1";
String name2 = "Task 2";
- long fudgeFactor = 5L;
assertFalse(sw.isRunning());
sw.start(name1);
Thread.sleep(int1);
@@ -44,6 +43,7 @@ public void testValidUsage() throws Exception {
// TODO are timings off in JUnit? Why do these assertions sometimes fail
// under both Ant and Eclipse?
+ //long fudgeFactor = 5L;
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1);
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + fudgeFactor);
sw.start(name2);
@@ -72,7 +72,6 @@ public void testValidUsageNotKeepingTaskList() throws Exception {
String name1 = "Task 1";
String name2 = "Task 2";
- long fudgeFactor = 5L;
assertFalse(sw.isRunning());
sw.start(name1);
Thread.sleep(int1);
@@ -82,6 +81,7 @@ public void testValidUsageNotKeepingTaskList() throws Exception {
// TODO are timings off in JUnit? Why do these assertions sometimes fail
// under both Ant and Eclipse?
+ //long fudgeFactor = 5L;
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1);
//assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + fudgeFactor);
sw.start(name2); | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-expression/src/test/java/org/springframework/expression/spel/MapAccessTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -17,6 +17,7 @@
package org.springframework.expression.spel;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import java.util.HashMap;
import java.util.Map;
@@ -83,9 +84,10 @@ public void testGetValue(){
ExpressionParser parser = new SpelExpressionParser();
Expression exp = parser.parseExpression("testBean.properties['key2']");
- String key= (String)exp.getValue(bean);
+ String key = (String) exp.getValue(bean);
+ assertNotNull(key);
- }
+ }
public static class TestBean
{ | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-expression/src/test/java/org/springframework/expression/spel/SpelDocumentationTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -18,6 +18,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -213,9 +214,11 @@ public void testDictionaryAccess() throws Exception {
societyContext.setRootObject(new IEEE());
// Officer's Dictionary
Inventor pupin = parser.parseExpression("officers['president']").getValue(societyContext, Inventor.class);
+ assertNotNull(pupin);
// evaluates to "Idvor"
String city = parser.parseExpression("officers['president'].PlaceOfBirth.city").getValue(societyContext, String.class);
+ assertNotNull(city);
// setting values
Inventor i = parser.parseExpression("officers['advisors'][0]").getValue(societyContext,Inventor.class); | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java | @@ -19,6 +19,7 @@
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -1680,27 +1681,31 @@ public void SPR_10091_simpleTestValueType() {
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
Class<?> valueType = parser.parseExpression("simpleProperty").getValueType(evaluationContext);
+ assertNotNull(valueType);
}
@Test
public void SPR_10091_simpleTestValue() {
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
Object value = parser.parseExpression("simpleProperty").getValue(evaluationContext);
+ assertNotNull(value);
}
@Test
public void SPR_10091_primitiveTestValueType() {
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
Class<?> valueType = parser.parseExpression("primitiveProperty").getValueType(evaluationContext);
+ assertNotNull(valueType);
}
@Test
public void SPR_10091_primitiveTestValue() {
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new BooleanHolder());
Object value = parser.parseExpression("primitiveProperty").getValue(evaluationContext);
+ assertNotNull(value);
}
@Test | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLStateExceptionTranslatorTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -67,7 +67,6 @@ public void testInvalidSqlStateCode() {
* Bug 729170
*/
public void testMalformedSqlStateCodes() {
- String sql = "SELECT FOO FROM BAR";
SQLException sex = new SQLException("Message", null, 1);
testMalformedSqlStateCode(sex);
| true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-jms/src/test/java/org/springframework/jms/core/JmsTemplate102Tests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -207,7 +207,7 @@ public void testTopicSessionCallback() throws Exception {
template.execute(new SessionCallback() {
@Override
public Object doInJms(Session session) throws JMSException {
- boolean b = session.getTransacted();
+ session.getTransacted();
return null;
}
});
@@ -249,8 +249,8 @@ public void testTopicProducerCallback() throws Exception {
template.execute(new ProducerCallback() {
@Override
public Object doInJms(Session session, MessageProducer producer) throws JMSException {
- boolean b = session.getTransacted();
- int i = producer.getPriority();
+ session.getTransacted();
+ producer.getPriority();
return null;
}
}); | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-jms/src/test/java/org/springframework/jms/core/JmsTemplateTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -190,8 +190,8 @@ public void testProducerCallback() throws Exception {
template.execute(new ProducerCallback() {
@Override
public Object doInJms(Session session, MessageProducer producer) throws JMSException {
- boolean b = session.getTransacted();
- int i = producer.getPriority();
+ session.getTransacted();
+ producer.getPriority();
return null;
}
});
@@ -234,8 +234,8 @@ public void testProducerCallbackWithIdAndTimestampDisabled() throws Exception {
template.execute(new ProducerCallback() {
@Override
public Object doInJms(Session session, MessageProducer producer) throws JMSException {
- boolean b = session.getTransacted();
- int i = producer.getPriority();
+ session.getTransacted();
+ producer.getPriority();
return null;
}
});
@@ -264,7 +264,7 @@ public void testSessionCallback() throws Exception {
template.execute(new SessionCallback() {
@Override
public Object doInJms(Session session) throws JMSException {
- boolean b = session.getTransacted();
+ session.getTransacted();
return null;
}
});
@@ -303,14 +303,14 @@ public void testSessionCallbackWithinSynchronizedTransaction() throws Exception
template.execute(new SessionCallback() {
@Override
public Object doInJms(Session session) throws JMSException {
- boolean b = session.getTransacted();
+ session.getTransacted();
return null;
}
});
template.execute(new SessionCallback() {
@Override
public Object doInJms(Session session) throws JMSException {
- boolean b = session.getTransacted();
+ session.getTransacted();
return null;
}
});
@@ -321,7 +321,7 @@ public Object doInJms(Session session) throws JMSException {
TransactionAwareConnectionFactoryProxy tacf = new TransactionAwareConnectionFactoryProxy(scf);
Connection tac = tacf.createConnection();
Session tas = tac.createSession(false, Session.AUTO_ACKNOWLEDGE);
- boolean b = tas.getTransacted();
+ tas.getTransacted();
tas.close();
tac.close();
| true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-orm/src/test/java/org/springframework/orm/jpa/ApplicationManagedEntityManagerIntegrationTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -48,6 +48,7 @@ public void testEntityManagerProxyIsProxy() {
assertTrue(Proxy.isProxyClass(em.getClass()));
Query q = em.createQuery("select p from Person as p");
List<Person> people = q.getResultList();
+ assertNotNull(people);
assertTrue("Should be open to start with", em.isOpen());
em.close(); | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-tx/src/test/java/org/springframework/transaction/interceptor/AbstractTransactionAspectTests.java | @@ -539,7 +539,7 @@ public void testCannotCommitTransaction() throws Exception {
Method m = setNameMethod;
MapTransactionAttributeSource tas = new MapTransactionAttributeSource();
tas.register(m, txatt);
- Method m2 = getNameMethod;
+ // Method m2 = getNameMethod;
// No attributes for m2
MockControl ptmControl = MockControl.createControl(PlatformTransactionManager.class); | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-tx/src/test/java/org/springframework/transaction/interceptor/BeanFactoryTransactionTests.java | @@ -163,6 +163,7 @@ public void rollback(TransactionStatus status) throws TransactionException {
public void testGetBeansOfTypeWithAbstract() {
Map beansOfType = factory.getBeansOfType(ITestBean.class, true, true);
+ assertNotNull(beansOfType);
}
/**
@@ -172,7 +173,7 @@ public void testNoTransactionAttributeSource() {
try {
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("noTransactionAttributeSource.xml", getClass()));
- ITestBean testBean = (ITestBean) bf.getBean("noTransactionAttributeSource");
+ bf.getBean("noTransactionAttributeSource");
fail("Should require TransactionAttributeSource to be set");
}
catch (FatalBeanException ex) { | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-web/src/test/java/org/springframework/http/client/StreamingSimpleHttpRequestFactoryTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -81,7 +81,7 @@ public void largeFileUpload() throws Exception {
ClientHttpRequest request = factory.createRequest(new URI(baseUrl + "/methods/post"), HttpMethod.POST);
final int BUF_SIZE = 4096;
final int ITERATIONS = Integer.MAX_VALUE / BUF_SIZE;
- final int contentLength = ITERATIONS * BUF_SIZE;
+// final int contentLength = ITERATIONS * BUF_SIZE;
// request.getHeaders().setContentLength(contentLength);
OutputStream body = request.getBody();
for (int i = 0; i < ITERATIONS; i++) { | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolverTests.java | @@ -63,7 +63,7 @@ public void statusCodeAndReasonMessage() {
exceptionResolver.setMessageSource(messageSource);
StatusCodeAndReasonMessageException ex = new StatusCodeAndReasonMessageException();
- ModelAndView mav = exceptionResolver.resolveException(request, response, null, ex);
+ exceptionResolver.resolveException(request, response, null, ex);
assertEquals("Invalid status reason", "Gone reason message", response.getErrorMessage());
}
finally { | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/multiaction/MultiActionControllerTests.java | @@ -453,7 +453,7 @@ public void testCannotCallExceptionHandlerDirectly() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/handleIllegalStateException.html");
MockHttpServletResponse response = new MockHttpServletResponse();
- ModelAndView mav = mac.handleRequest(request, response);
+ mac.handleRequest(request, response);
assertEquals(HttpServletResponse.SC_NOT_FOUND, response.getStatus());
}
@@ -524,14 +524,15 @@ public ModelAndView commandNoSession(HttpServletRequest request, HttpServletResp
this.invoked.put("commandNoSession", Boolean.TRUE);
String pname = request.getParameter("name");
- String page = request.getParameter("age");
// ALLOW FOR NULL
if (pname == null) {
assertTrue("name null", command.getName() == null);
}
else {
assertTrue("name param set", pname.equals(command.getName()));
}
+
+ //String page = request.getParameter("age");
// if (page == null)
// assertTrue("age default", command.getAge() == 0);
// else | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | spring-webmvc/src/test/java/org/springframework/web/servlet/view/ResourceBundleViewResolverTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -72,14 +72,14 @@ protected boolean getCache() {
public void testParentsAreAbstract() throws Exception {
try {
- View v = rb.resolveViewName("debug.Parent", Locale.ENGLISH);
+ rb.resolveViewName("debug.Parent", Locale.ENGLISH);
fail("Should have thrown BeanIsAbstractException");
}
catch (BeanIsAbstractException ex) {
// expected
}
try {
- View v = rb.resolveViewName("testParent", Locale.ENGLISH);
+ rb.resolveViewName("testParent", Locale.ENGLISH);
fail("Should have thrown BeanIsAbstractException");
}
catch (BeanIsAbstractException ex) {
@@ -152,7 +152,7 @@ public void testOnSetContextCalledOnce() throws Exception {
public void testNoSuchBasename() throws Exception {
try {
rb.setBasename("weoriwoierqupowiuer");
- View v = rb.resolveViewName("debugView", Locale.ENGLISH);
+ rb.resolveViewName("debugView", Locale.ENGLISH);
fail("No such basename: all requests should fail with exception");
}
catch (MissingResourceException ex) { | true |
Other | spring-projects | spring-framework | 065b1c0e463e0d2b63931d487a6e29ef7c99b189.json | Fix unused local variable warnings | src/test/java/org/springframework/context/annotation/jsr330/ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -86,6 +86,7 @@ public void tearDown() throws Exception {
public void testPrototype() {
ApplicationContext context = createContext(ScopedProxyMode.NO);
ScopedTestBean bean = (ScopedTestBean) context.getBean("prototype");
+ assertNotNull(bean);
assertTrue(context.isPrototype("prototype"));
assertFalse(context.isSingleton("prototype"));
} | true |
Other | spring-projects | spring-framework | 234cb84e832da30b6f53ccca4ef28043aacfcecc.json | Release version 3.2.1.RELEASE | gradle.properties | @@ -1 +1 @@
-version=3.2.1.BUILD-SNAPSHOT
+version=3.2.1.RELEASE | false |
Other | spring-projects | spring-framework | df7bda5637a56c6d877a82d68e76027f7055fef2.json | Constrain targets for @Filter declaration
For clarity, add @Target({}) to definition of @Filter, constraining it
to complex annotation composition only; i.e. it cannot be placed on
any element, only within annotations, e.g.
@ComponentScan(includeFilters=@Filter(...))
is legal, while
@Filter
public class MyType { }
is not.
Also, widen @Retention from SOURCE to RUNTIME, even though it is not
technically necessary, as all parsing of @Filter annotations happens via
ASM, i.e. at the source level. This change is made primarily for
consistency (@ComponentScan's Retention is RUNTIME) and in avoidance of
potential confusion or surprise on the part of those casually browsing
the code. | org.springframework.context/src/main/java/org/springframework/context/annotation/ComponentScan.java | @@ -128,7 +128,8 @@
* Declares the type filter to be used as an {@linkplain ComponentScan#includeFilters()
* include filter} or {@linkplain ComponentScan#includeFilters() exclude filter}.
*/
- @Retention(RetentionPolicy.SOURCE)
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({})
@interface Filter {
/**
* The type of filter to use. | false |
Other | spring-projects | spring-framework | 26d5ef93e6ddb7d3ba5774b5e427b0dc6b61516f.json | Handle non-void write methods deterministically
This change resolves a specific issue with processing
java.math.BigDecimal via ExtendedBeanInfo. BigDecimal has a particular
constellation of #setScale methods that, prior to this change, had the
potential to cause ExtendedBeanInfo to throw an IntrospectionException
depending on the order in which the methods were processed.
Because JDK 7 no longer returns deterministic results from
Class#getDeclaredMethods, it became a genuine possibility - indeed a
statistical certainty that the 'wrong' setScale method handling order
happens sooner or later. Typically one could observe this failure once
out of every four test runs.
This commit introduces deterministic method ordering of all discovered
non-void returning write methods in such a way that solves the problem
for BigDecimal as well as for any other class having a similar method
arrangement.
Also:
- Remove unnecessary cast
- Pass no method information to PropertyDescriptor superclasses when
invoking super(...). This ensures that any 'type mismatch'
IntrospectionExceptions are handled locally in ExtendedBeanInfo and
its Simple* PropertyDescriptor variants where we have full control.
Issue: SPR-10111, SPR-9702
Backport-Commit: aa3e0be (forward-ported via cherry-pick from 3.1.x) | spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java | @@ -31,6 +31,7 @@
import java.lang.reflect.Modifier;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.List;
@@ -116,6 +117,14 @@ private List<Method> findCandidateWriteMethods(MethodDescriptor[] methodDescript
matches.add(method);
}
}
+ // sort non-void returning write methods to guard against the ill effects of
+ // non-deterministic sorting of methods returned from Class#getDeclaredMethods
+ // under JDK 7. See http://bugs.sun.com/view_bug.do?bug_id=7023180
+ Collections.sort(matches, new Comparator<Method>() {
+ public int compare(Method m1, Method m2) {
+ return m2.toString().compareTo(m1.toString());
+ }
+ });
return matches;
}
@@ -264,7 +273,7 @@ public SimpleNonIndexedPropertyDescriptor(PropertyDescriptor original)
public SimpleNonIndexedPropertyDescriptor(String propertyName,
Method readMethod, Method writeMethod) throws IntrospectionException {
- super(propertyName, readMethod, writeMethod);
+ super(propertyName, null, null);
this.setReadMethod(readMethod);
this.setWriteMethod(writeMethod);
this.propertyType = findPropertyType(readMethod, writeMethod);
@@ -353,7 +362,7 @@ public SimpleIndexedPropertyDescriptor(String propertyName,
Method indexedReadMethod, Method indexedWriteMethod)
throws IntrospectionException {
- super(propertyName, readMethod, writeMethod, indexedReadMethod, indexedWriteMethod);
+ super(propertyName, null, null, null, null);
this.setReadMethod(readMethod);
this.setWriteMethod(writeMethod);
this.propertyType = findPropertyType(readMethod, writeMethod); | true |
Other | spring-projects | spring-framework | 26d5ef93e6ddb7d3ba5774b5e427b0dc6b61516f.json | Handle non-void write methods deterministically
This change resolves a specific issue with processing
java.math.BigDecimal via ExtendedBeanInfo. BigDecimal has a particular
constellation of #setScale methods that, prior to this change, had the
potential to cause ExtendedBeanInfo to throw an IntrospectionException
depending on the order in which the methods were processed.
Because JDK 7 no longer returns deterministic results from
Class#getDeclaredMethods, it became a genuine possibility - indeed a
statistical certainty that the 'wrong' setScale method handling order
happens sooner or later. Typically one could observe this failure once
out of every four test runs.
This commit introduces deterministic method ordering of all discovered
non-void returning write methods in such a way that solves the problem
for BigDecimal as well as for any other class having a similar method
arrangement.
Also:
- Remove unnecessary cast
- Pass no method information to PropertyDescriptor superclasses when
invoking super(...). This ensures that any 'type mismatch'
IntrospectionExceptions are handled locally in ExtendedBeanInfo and
its Simple* PropertyDescriptor variants where we have full control.
Issue: SPR-10111, SPR-9702
Backport-Commit: aa3e0be (forward-ported via cherry-pick from 3.1.x) | spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java | @@ -23,6 +23,7 @@
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
+import java.math.BigDecimal;
import org.junit.Test;
@@ -192,7 +193,6 @@ public Number getProperty1() {
}
}
class Child extends Parent {
- @Override
public Integer getProperty1() {
return 2;
}
@@ -214,7 +214,6 @@ public Integer getProperty1() {
@Test
public void cornerSpr9453() throws IntrospectionException {
final class Bean implements Spr9453<Class<?>> {
- @Override
public Class<?> getProp() {
return null;
}
@@ -583,16 +582,28 @@ class C {
}
}
+ /**
+ * Prior to SPR-10111 (a follow-up fix for SPR-9702), this method would throw an
+ * IntrospectionException regarding a "type mismatch between indexed and non-indexed
+ * methods" intermittently (approximately one out of every four times) under JDK 7
+ * due to non-deterministic results from {@link Class#getDeclaredMethods()}.
+ * See http://bugs.sun.com/view_bug.do?bug_id=7023180
+ * @see #cornerSpr9702()
+ */
+ @Test
+ public void cornerSpr10111() throws Exception {
+ new ExtendedBeanInfo(Introspector.getBeanInfo(BigDecimal.class));
+ }
+
+
@Test
public void subclassWriteMethodWithCovariantReturnType() throws IntrospectionException {
@SuppressWarnings("unused") class B {
public String getFoo() { return null; }
public Number setFoo(String foo) { return null; }
}
class C extends B {
- @Override
public String getFoo() { return null; }
- @Override
public Integer setFoo(String foo) { return null; }
}
@@ -695,7 +706,7 @@ public void overloadedNonStandardWriteMethodsOnly_orderB() throws IntrospectionE
for (PropertyDescriptor pd : ebi.getPropertyDescriptors()) {
if (pd.getName().equals("foo")) {
- assertThat(pd.getWriteMethod(), is(C.class.getMethod("setFoo", int.class)));
+ assertThat(pd.getWriteMethod(), is(C.class.getMethod("setFoo", String.class)));
return;
}
}
@@ -733,7 +744,7 @@ public void reproSpr8522() throws IntrospectionException {
assertThat(hasReadMethodForProperty(ebi, "dateFormat"), is(false));
assertThat(hasWriteMethodForProperty(ebi, "dateFormat"), is(true));
assertThat(hasIndexedReadMethodForProperty(ebi, "dateFormat"), is(false));
- assertThat(hasIndexedWriteMethodForProperty(ebi, "dateFormat"), is(true));
+ assertThat(hasIndexedWriteMethodForProperty(ebi, "dateFormat"), is(trueUntilJdk17()));
}
@Test
@@ -864,7 +875,6 @@ interface BookOperations {
}
interface TextBookOperations extends BookOperations {
- @Override
TextBook getBook();
}
@@ -874,7 +884,6 @@ public void setBook(Book book) { }
}
class LawLibrary extends Library implements TextBookOperations {
- @Override
public LawBook getBook() { return null; }
}
@@ -889,7 +898,6 @@ public boolean isTargetMethod() {
}
class B extends A {
- @Override
public boolean isTargetMethod() {
return false;
} | true |
Other | spring-projects | spring-framework | 33ee0ea4a6eb4a47e4a4291e36124ec631a2f814.json | Fix broken test in ContentAssertionTests | spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/ContentAssertionTests.java | @@ -63,7 +63,7 @@ public void testContentType() throws Exception {
this.mockMvc.perform(get("/handleUtf8"))
.andExpect(content().contentType(MediaType.valueOf("text/plain;charset=UTF-8")))
.andExpect(content().contentType("text/plain;charset=UTF-8"))
- .andExpect(content().contentTypeCompatibleWith("text/plan"))
+ .andExpect(content().contentTypeCompatibleWith("text/plain"))
.andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_PLAIN));
}
| false |
Other | spring-projects | spring-framework | a16bad04f0939f04210f937fbff8fb620951fb90.json | Update Validation chapter
The Validation chapter now includes information on combining JSR-303
Bean Validation with additional Spring Validator's that don't require
the use of annotations.
Issue: SPR-9437 | src/reference/docbook/validation.xml | @@ -12,6 +12,24 @@
<section xml:id="validation-introduction">
<title>Introduction</title>
+ <sidebar xml:id="validation-beanvalidation-vs-spring-validation">
+ <title>JSR-303 Bean Validation</title>
+
+ <para>The Spring Framework supports JSR-303 Bean Validation adapting
+ it to Spring's <interfacename>Validator</interfacename> interface.</para>
+
+ <para>An application can choose to enable JSR-303 Bean Validation once globally,
+ as described in <xref linkend="validation-beanvalidation" />, and use it
+ exclusively for all validation needs.</para>
+
+ <para>An application can also register
+ additional Spring <interfacename>Validator</interfacename> instances
+ per <classname>DataBinder</classname> instance, as described in
+ <xref linkend="validation-binder" />. This may be useful for
+ plugging in validation logic without the use of annotations.</para>
+
+ </sidebar>
+
<para>There are pros and cons for considering validation as business logic,
and Spring offers a design for validation (and data binding) that does not
exclude either one of them. Specifically validation should not be tied to
@@ -1778,6 +1796,16 @@ binder.validate();
<lineannotation>// get BindingResult that includes any validation errors</lineannotation>
BindingResult results = binder.getBindingResult();</programlisting>
+
+ <para> A DataBinder can also be configured with multiple
+ <interfacename>Validator</interfacename> instances
+ via <code>dataBinder.addValidators</code>
+ and <code>dataBinder.replaceValidators</code>.
+ This is useful when combining globally configured JSR-303 Bean Validation
+ with a Spring <interfacename>Validator</interfacename> configured
+ locally on a DataBinder instance.
+ See <xref linkend="validation-mvc-configuring" />.</para>
+
</section>
<section xml:id="validation-mvc">
@@ -1847,6 +1875,20 @@ public class MyController {
<mvc:annotation-driven validator="globalValidator"/>
</beans>]]></programlisting>
+
+ <para> To combine a global and a local validator, configure the
+ global validator as shown above and then add a local validator:</para>
+
+ <programlisting language="java"><![CDATA[@Controller
+public class MyController {
+
+ @InitBinder
+ protected void initBinder(WebDataBinder binder) {
+ binder.addValidators(new FooValidator());
+ }
+
+}]]></programlisting>
+
</section>
<section xml:id="validation-mvc-jsr303"> | false |
Other | spring-projects | spring-framework | bff36fb1456ff498354960a725f63f9116ee5b74.json | Improve exceptions for multi-operand expressions
Fix SpEL expression parser and tokenizer to provide better exceptions
when dealing with operations that expect two operands. For example,
prior to this commit the expression '/foo' would throw a NPE due
to missing operands to the left of '/'.
Issue: SPR-10146 | spring-expression/src/main/java/org/springframework/expression/spel/SpelMessage.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -108,7 +108,8 @@ public enum SpelMessage {
OPERAND_NOT_INCREMENTABLE(Kind.ERROR,1066,"the expression component ''{0}'' does not support increment"), //
OPERAND_NOT_DECREMENTABLE(Kind.ERROR,1067,"the expression component ''{0}'' does not support decrement"), //
NOT_ASSIGNABLE(Kind.ERROR,1068,"the expression component ''{0}'' is not assignable"), //
- ;
+ MISSING_CHARACTER(Kind.ERROR,1069,"missing expected character ''{0}''"),
+ LEFT_OPERAND_PROBLEM(Kind.ERROR,1070, "Problem parsing left operand");
private Kind kind;
private int code; | true |
Other | spring-projects | spring-framework | bff36fb1456ff498354960a725f63f9116ee5b74.json | Improve exceptions for multi-operand expressions
Fix SpEL expression parser and tokenizer to provide better exceptions
when dealing with operations that expect two operands. For example,
prior to this commit the expression '/foo' would throw a NPE due
to missing operands to the left of '/'.
Issue: SPR-10146 | spring-expression/src/main/java/org/springframework/expression/spel/standard/InternalSpelExpressionParser.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -37,6 +37,7 @@
* Hand written SpEL parser. Instances are reusable but are not thread safe.
*
* @author Andy Clement
+ * @author Phillip Webb
* @since 3.0
*/
class InternalSpelExpressionParser extends TemplateAwareExpressionParser {
@@ -104,8 +105,8 @@ private SpelNodeImpl eatExpression() {
Token t = peekToken();
if (t.kind==TokenKind.ASSIGN) { // a=b
if (expr==null) {
- expr = new NullLiteral(toPos(t.startpos-1,t.endpos-1));
- }
+ expr = new NullLiteral(toPos(t.startpos-1,t.endpos-1));
+ }
nextToken();
SpelNodeImpl assignedValue = eatLogicalOrExpression();
return new Assign(toPos(t),expr,assignedValue);
@@ -139,7 +140,7 @@ private SpelNodeImpl eatLogicalOrExpression() {
while (peekIdentifierToken("or") || peekToken(TokenKind.SYMBOLIC_OR)) {
Token t = nextToken(); //consume OR
SpelNodeImpl rhExpr = eatLogicalAndExpression();
- checkRightOperand(t,rhExpr);
+ checkOperands(t,expr,rhExpr);
expr = new OpOr(toPos(t),expr,rhExpr);
}
return expr;
@@ -151,7 +152,7 @@ private SpelNodeImpl eatLogicalAndExpression() {
while (peekIdentifierToken("and") || peekToken(TokenKind.SYMBOLIC_AND)) {
Token t = nextToken();// consume 'AND'
SpelNodeImpl rhExpr = eatRelationalExpression();
- checkRightOperand(t,rhExpr);
+ checkOperands(t,expr,rhExpr);
expr = new OpAnd(toPos(t),expr,rhExpr);
}
return expr;
@@ -164,7 +165,7 @@ private SpelNodeImpl eatRelationalExpression() {
if (relationalOperatorToken != null) {
Token t = nextToken(); //consume relational operator token
SpelNodeImpl rhExpr = eatSumExpression();
- checkRightOperand(t,rhExpr);
+ checkOperands(t,expr,rhExpr);
TokenKind tk = relationalOperatorToken.kind;
if (relationalOperatorToken.isNumericRelationalOperator()) {
int pos = toPos(t);
@@ -217,7 +218,7 @@ private SpelNodeImpl eatProductExpression() {
while (peekToken(TokenKind.STAR,TokenKind.DIV,TokenKind.MOD)) {
Token t = nextToken(); // consume STAR/DIV/MOD
SpelNodeImpl rhExpr = eatPowerIncDecExpression();
- checkRightOperand(t,rhExpr);
+ checkOperands(t,expr,rhExpr);
if (t.kind==TokenKind.STAR) {
expr = new OpMultiply(toPos(t),expr,rhExpr);
} else if (t.kind==TokenKind.DIV) {
@@ -836,6 +837,17 @@ public String toString(Token t) {
}
}
+ private void checkOperands(Token token, SpelNodeImpl left, SpelNodeImpl right) {
+ checkLeftOperand(token, left);
+ checkRightOperand(token, right);
+ }
+
+ private void checkLeftOperand(Token token, SpelNodeImpl operandExpression) {
+ if (operandExpression==null) {
+ raiseInternalException(token.startpos,SpelMessage.LEFT_OPERAND_PROBLEM);
+ }
+ }
+
private void checkRightOperand(Token token, SpelNodeImpl operandExpression) {
if (operandExpression==null) {
raiseInternalException(token.startpos,SpelMessage.RIGHT_OPERAND_PROBLEM); | true |
Other | spring-projects | spring-framework | bff36fb1456ff498354960a725f63f9116ee5b74.json | Improve exceptions for multi-operand expressions
Fix SpEL expression parser and tokenizer to provide better exceptions
when dealing with operations that expect two operands. For example,
prior to this commit the expression '/foo' would throw a NPE due
to missing operands to the left of '/'.
Issue: SPR-10146 | spring-expression/src/main/java/org/springframework/expression/spel/standard/Tokenizer.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -29,6 +29,7 @@
* Lex some input data into a stream of tokens that can then be parsed.
*
* @author Andy Clement
+ * @author Phillip Webb
* @since 3.0
*/
class Tokenizer {
@@ -137,14 +138,20 @@ public void process() {
}
break;
case '&':
- if (isTwoCharToken(TokenKind.SYMBOLIC_AND)) {
- pushPairToken(TokenKind.SYMBOLIC_AND);
+ if (!isTwoCharToken(TokenKind.SYMBOLIC_AND)) {
+ throw new InternalParseException(new SpelParseException(
+ expressionString, pos,
+ SpelMessage.MISSING_CHARACTER, "&"));
}
+ pushPairToken(TokenKind.SYMBOLIC_AND);
break;
case '|':
- if (isTwoCharToken(TokenKind.SYMBOLIC_OR)) {
- pushPairToken(TokenKind.SYMBOLIC_OR);
+ if (!isTwoCharToken(TokenKind.SYMBOLIC_OR)) {
+ throw new InternalParseException(new SpelParseException(
+ expressionString, pos,
+ SpelMessage.MISSING_CHARACTER, "|"));
}
+ pushPairToken(TokenKind.SYMBOLIC_OR);
break;
case '?':
if (isTwoCharToken(TokenKind.SELECT)) { | true |
Other | spring-projects | spring-framework | bff36fb1456ff498354960a725f63f9116ee5b74.json | Improve exceptions for multi-operand expressions
Fix SpEL expression parser and tokenizer to provide better exceptions
when dealing with operations that expect two operands. For example,
prior to this commit the expression '/foo' would throw a NPE due
to missing operands to the left of '/'.
Issue: SPR-10146 | spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java | @@ -16,6 +16,11 @@
package org.springframework.expression.spel;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -26,8 +31,9 @@
import java.util.Properties;
import org.junit.Ignore;
+import org.junit.Rule;
import org.junit.Test;
-
+import org.junit.rules.ExpectedException;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.expression.AccessException;
import org.springframework.expression.BeanResolver;
@@ -48,8 +54,6 @@
import org.springframework.expression.spel.support.StandardTypeLocator;
import org.springframework.expression.spel.testresources.le.div.mod.reserved.Reserver;
-import static org.junit.Assert.*;
-
/**
* Reproduction tests cornering various SpEL JIRA issues.
*
@@ -60,6 +64,9 @@
*/
public class SpelReproTests extends ExpressionTestCase {
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
@Test
public void testNPE_SPR5661() {
evaluate("joinThreeStrings('a',null,'c')", "anullc", String.class);
@@ -1694,6 +1701,24 @@ public void SPR_10091_primitiveTestValue() {
Object value = parser.parseExpression("primitiveProperty").getValue(evaluationContext);
}
+ @Test
+ public void SPR_10146_malformedExpressions() throws Exception {
+ doTestSpr10146("/foo", "EL1070E:(pos 0): Problem parsing left operand");
+ doTestSpr10146("*foo", "EL1070E:(pos 0): Problem parsing left operand");
+ doTestSpr10146("%foo", "EL1070E:(pos 0): Problem parsing left operand");
+ doTestSpr10146("<foo", "EL1070E:(pos 0): Problem parsing left operand");
+ doTestSpr10146(">foo", "EL1070E:(pos 0): Problem parsing left operand");
+ doTestSpr10146("&&foo", "EL1070E:(pos 0): Problem parsing left operand");
+ doTestSpr10146("||foo", "EL1070E:(pos 0): Problem parsing left operand");
+ doTestSpr10146("&foo", "EL1069E:(pos 0): missing expected character '&'");
+ doTestSpr10146("|foo", "EL1069E:(pos 0): missing expected character '|'");
+ }
+
+ private void doTestSpr10146(String expression, String expectedMessage) {
+ thrown.expect(SpelParseException.class);
+ thrown.expectMessage(expectedMessage);
+ new SpelExpressionParser().parseExpression(expression);
+ }
public static class BooleanHolder {
| true |
Other | spring-projects | spring-framework | 8bb67149a79d20c649902eb0984b766141d94581.json | Fix eclipse .settings generation
Fix issues where gradle would not regenerate .settings files due to
the task being considered UP-TO-DATE. | gradle/ide.gradle | @@ -51,24 +51,28 @@ task eclipseSettings(type: Copy) {
"src/eclipse/org.eclipse.jdt.ui.prefs",
"src/eclipse/org.eclipse.wst.common.project.facet.core.xml")
into project.file('.settings/')
+ outputs.upToDateWhen { false }
}
task eclipseWstComponent(type: Copy) {
from rootProject.files(
"src/eclipse/org.eclipse.wst.common.component")
into project.file('.settings/')
expand(deployname: project.name)
+ outputs.upToDateWhen { false }
}
task eclipseJdtPrepare(type: Copy) {
from rootProject.file("src/eclipse/org.eclipse.jdt.core.prefs")
into project.file(".settings/")
+ outputs.upToDateWhen { false }
}
task cleanEclipseJdtUi(type: Delete) {
- delete project.file(".settings/org.eclipse.jdt.ui.prefs");
- delete project.file(".settings/org.eclipse.wst.common.component");
- delete project.file(".settings/org.eclipse.wst.common.project.facet.core.xml");
+ delete project.file(".settings/org.eclipse.jdt.ui.prefs")
+ delete project.file("org.eclipse.jdt.core.prefs")
+ delete project.file(".settings/org.eclipse.wst.common.component")
+ delete project.file(".settings/org.eclipse.wst.common.project.facet.core.xml")
}
tasks["eclipseJdt"].dependsOn(eclipseJdtPrepare) | false |
Other | spring-projects | spring-framework | 8a37521a3cd5dc0d51599abf9824c35513816fbb.json | Fix copyright year & method names in spring-test
This commit fixes the copyright year for changes made in commit
5b147bfba8d5d5837b96357a52867e433137f64b. In addition, method names
have been changed to reflect the semantic changes made in that same
commit. | spring-test/src/test/java/org/springframework/test/context/ClassLevelDirtiesContextTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -38,7 +38,7 @@
import org.springframework.test.context.support.DirtiesContextTestExecutionListener;
/**
- * JUnit 4 based integration test which verifies correct {@link ContextCache
+ * JUnit 4 based integration test which verifies correct {@linkplain ContextCache
* application context caching} in conjunction with the
* {@link SpringJUnit4ClassRunner} and the {@link DirtiesContext
* @DirtiesContext} annotation at the class level. | true |
Other | spring-projects | spring-framework | 8a37521a3cd5dc0d51599abf9824c35513816fbb.json | Fix copyright year & method names in spring-test
This commit fixes the copyright year for changes made in commit
5b147bfba8d5d5837b96357a52867e433137f64b. In addition, method names
have been changed to reflect the semantic changes made in that same
commit. | spring-test/src/test/java/org/springframework/test/context/junit4/RepeatedSpringRunnerTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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. | true |
Other | spring-projects | spring-framework | 8a37521a3cd5dc0d51599abf9824c35513816fbb.json | Fix copyright year & method names in spring-test
This commit fixes the copyright year for changes made in commit
5b147bfba8d5d5837b96357a52867e433137f64b. In addition, method names
have been changed to reflect the semantic changes made in that same
commit. | spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -64,34 +64,34 @@ public static final class TimedSpringRunnerTestCase {
// Should Pass.
@Test(timeout = 2000)
- public void testJUnitTimeoutWithNoOp() {
+ public void jUnitTimeoutWithNoOp() {
/* no-op */
}
// Should Pass.
@Test
@Timed(millis = 2000)
- public void testSpringTimeoutWithNoOp() {
+ public void springTimeoutWithNoOp() {
/* no-op */
}
// Should Fail due to timeout.
@Test(timeout = 10)
- public void testJUnitTimeoutWithOneSecondWait() throws Exception {
+ public void jUnitTimeoutWithSleep() throws Exception {
Thread.sleep(20);
}
// Should Fail due to timeout.
@Test
@Timed(millis = 10)
- public void testSpringTimeoutWithOneSecondWait() throws Exception {
+ public void springTimeoutWithSleep() throws Exception {
Thread.sleep(20);
}
// Should Fail due to duplicate configuration.
@Test(timeout = 200)
@Timed(millis = 200)
- public void testSpringAndJUnitTimeout() {
+ public void springAndJUnitTimeouts() {
/* no-op */
}
} | true |
Other | spring-projects | spring-framework | fce7adc400d4b519da40d361a1b1f62fc58e185a.json | Consider bridge methods in SpEL properties
Revert ReflectivePropertyAccessor changes from 107fafb and instead
consider all methods when resolving properties. Methods are now
sorted such that non-bridge methods are considered before bridge
methods.
Issue: SPR-10162 | spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectivePropertyAccessor.java | @@ -21,6 +21,8 @@
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.Comparator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -310,21 +312,21 @@ private Field findField(String name, Class<?> clazz, Object target) {
* Find a getter method for the specified property.
*/
protected Method findGetterForProperty(String propertyName, Class<?> clazz, boolean mustBeStatic) {
- Method[] ms = clazz.getMethods();
+ Method[] ms = getSortedClassMethods(clazz);
String propertyMethodSuffix = getPropertyMethodSuffix(propertyName);
// Try "get*" method...
String getterName = "get" + propertyMethodSuffix;
for (Method method : ms) {
- if (!method.isBridge() && method.getName().equals(getterName) && method.getParameterTypes().length == 0 &&
+ if (method.getName().equals(getterName) && method.getParameterTypes().length == 0 &&
(!mustBeStatic || Modifier.isStatic(method.getModifiers()))) {
return method;
}
}
// Try "is*" method...
getterName = "is" + propertyMethodSuffix;
for (Method method : ms) {
- if (!method.isBridge() && method.getName().equals(getterName) && method.getParameterTypes().length == 0 &&
+ if (method.getName().equals(getterName) && method.getParameterTypes().length == 0 &&
(boolean.class.equals(method.getReturnType()) || Boolean.class.equals(method.getReturnType())) &&
(!mustBeStatic || Modifier.isStatic(method.getModifiers()))) {
return method;
@@ -337,17 +339,31 @@ protected Method findGetterForProperty(String propertyName, Class<?> clazz, bool
* Find a setter method for the specified property.
*/
protected Method findSetterForProperty(String propertyName, Class<?> clazz, boolean mustBeStatic) {
- Method[] methods = clazz.getMethods();
+ Method[] methods = getSortedClassMethods(clazz);
String setterName = "set" + getPropertyMethodSuffix(propertyName);
for (Method method : methods) {
- if (!method.isBridge() && method.getName().equals(setterName) && method.getParameterTypes().length == 1 &&
+ if (method.getName().equals(setterName) && method.getParameterTypes().length == 1 &&
(!mustBeStatic || Modifier.isStatic(method.getModifiers()))) {
return method;
}
}
return null;
}
+ /**
+ * Returns class methods ordered with non bridge methods appearing higher.
+ */
+ private Method[] getSortedClassMethods(Class<?> clazz) {
+ Method[] methods = clazz.getMethods();
+ Arrays.sort(methods, new Comparator<Method>() {
+ @Override
+ public int compare(Method o1, Method o2) {
+ return (o1.isBridge() == o2.isBridge()) ? 0 : (o1.isBridge() ? 1 : -1);
+ }
+ });
+ return methods;
+ }
+
protected String getPropertyMethodSuffix(String propertyName) {
if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) {
return propertyName; | true |
Other | spring-projects | spring-framework | fce7adc400d4b519da40d361a1b1f62fc58e185a.json | Consider bridge methods in SpEL properties
Revert ReflectivePropertyAccessor changes from 107fafb and instead
consider all methods when resolving properties. Methods are now
sorted such that non-bridge methods are considered before bridge
methods.
Issue: SPR-10162 | spring-expression/src/test/java/org/springframework/expression/spel/SpelReproTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * 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.
@@ -56,6 +56,7 @@
* @author Andy Clement
* @author Juergen Hoeller
* @author Clark Duplichien
+ * @author Phillip Webb
*/
public class SpelReproTests extends ExpressionTestCase {
@@ -1656,6 +1657,15 @@ public void SPR_9994_bridgeMethodsTest() throws Exception {
assertEquals(Integer.class, value.getTypeDescriptor().getType());
}
+ @Test
+ public void SPR_10162_onlyBridgeMethodTest() throws Exception {
+ ReflectivePropertyAccessor accessor = new ReflectivePropertyAccessor();
+ StandardEvaluationContext context = new StandardEvaluationContext();
+ Object target = new OnlyBridgeMethod();
+ TypedValue value = accessor.read(context, target , "property");
+ assertEquals(Integer.class, value.getTypeDescriptor().getType());
+ }
+
@Test
public void SPR_10091_simpleTestValueType() {
ExpressionParser parser = new SpelExpressionParser();
@@ -1722,4 +1732,15 @@ public Integer getProperty() {
}
}
+ static class PackagePrivateClassWithGetter {
+
+ public Integer getProperty() {
+ return null;
+ }
+ }
+
+ public static class OnlyBridgeMethod extends PackagePrivateClassWithGetter {
+
+ }
+
} | true |
Other | spring-projects | spring-framework | 54c873b4c430a6c13698080fcde99835ca2a541b.json | Support multiple Validators in DataBinder
DataBinder now allows registering additional Validator instances.
This may be useful when adding a Spring Validator to a globally
registered JSR-303 LocalValidatorFactoryBean.
Issue: SPR-9436 | spring-context/src/main/java/org/springframework/validation/DataBinder.java | @@ -18,7 +18,11 @@
import java.beans.PropertyEditor;
import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
@@ -141,7 +145,7 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
private BindingErrorProcessor bindingErrorProcessor = new DefaultBindingErrorProcessor();
- private Validator validator;
+ private final List<Validator> validators = new ArrayList<Validator>();
private ConversionService conversionService;
@@ -493,21 +497,58 @@ public BindingErrorProcessor getBindingErrorProcessor() {
/**
* Set the Validator to apply after each binding step.
+ * @see #addValidators(Validator...)
+ * @see #replaceValidators(Validator...)
*/
public void setValidator(Validator validator) {
- if (validator != null && (getTarget() != null && !validator.supports(getTarget().getClass()))) {
- throw new IllegalStateException("Invalid target for Validator [" + validator + "]: " + getTarget());
+ assertValidators(validator);
+ this.validators.clear();
+ this.validators.add(validator);
+ }
+
+ private void assertValidators(Validator... validators) {
+ Assert.notNull(validators, "Validators required");
+ for (Validator validator : validators) {
+ if (validator != null && (getTarget() != null && !validator.supports(getTarget().getClass()))) {
+ throw new IllegalStateException("Invalid target for Validator [" + validator + "]: " + getTarget());
+ }
}
- this.validator = validator;
}
/**
- * Return the Validator to apply after each binding step, if any.
+ * Add Validators to apply after each binding step.
+ * @see #setValidator(Validator)
+ * @see #replaceValidators(Validator...)
+ */
+ public void addValidators(Validator... validators) {
+ assertValidators(validators);
+ this.validators.addAll(Arrays.asList(validators));
+ }
+
+ /**
+ * Replace the Validators to apply after each binding step.
+ * @see #setValidator(Validator)
+ * @see #addValidators(Validator...)
+ */
+ public void replaceValidators(Validator... validators) {
+ assertValidators(validators);
+ this.validators.clear();
+ this.validators.addAll(Arrays.asList(validators));
+ }
+
+ /**
+ * Return the primary Validator to apply after each binding step, if any.
*/
public Validator getValidator() {
- return this.validator;
+ return this.validators.size() > 0 ? this.validators.get(0) : null;
}
+ /**
+ * Return the Validators to apply after data binding.
+ */
+ public List<Validator> getValidators() {
+ return Collections.unmodifiableList(this.validators);
+ }
//---------------------------------------------------------------------
// Implementation of PropertyEditorRegistry/TypeConverter interface
@@ -708,28 +749,31 @@ protected void applyPropertyValues(MutablePropertyValues mpvs) {
/**
- * Invoke the specified Validator, if any.
+ * Invoke the specified Validators, if any.
* @see #setValidator(Validator)
* @see #getBindingResult()
*/
public void validate() {
- this.validator.validate(getTarget(), getBindingResult());
+ for (Validator validator : this.validators) {
+ validator.validate(getTarget(), getBindingResult());
+ }
}
/**
- * Invoke the specified Validator, if any, with the given validation hints.
+ * Invoke the specified Validators, if any, with the given validation hints.
* <p>Note: Validation hints may get ignored by the actual target Validator.
* @param validationHints one or more hint objects to be passed to a {@link SmartValidator}
* @see #setValidator(Validator)
* @see SmartValidator#validate(Object, Errors, Object...)
*/
public void validate(Object... validationHints) {
- Validator validator = getValidator();
- if (!ObjectUtils.isEmpty(validationHints) && validator instanceof SmartValidator) {
- ((SmartValidator) validator).validate(getTarget(), getBindingResult(), validationHints);
- }
- else if (validator != null) {
- validator.validate(getTarget(), getBindingResult());
+ for (Validator validator : getValidators()) {
+ if (!ObjectUtils.isEmpty(validationHints) && validator instanceof SmartValidator) {
+ ((SmartValidator) validator).validate(getTarget(), getBindingResult(), validationHints);
+ }
+ else if (validator != null) {
+ validator.validate(getTarget(), getBindingResult());
+ }
}
}
| false |
Other | spring-projects | spring-framework | 5b147bfba8d5d5837b96357a52867e433137f64b.json | Improve speed of spring-test build
- Now excluding *TestSuite classes from the JUnit test task.
- Renamed SpringJUnit4SuiteTests to SpringJUnit4TestSuite so that it is
no longer executed in the build.
- Reduced sleep time in various timing related tests. | build.gradle | @@ -655,7 +655,7 @@ project("spring-test") {
dependsOn testNG
useJUnit()
// "TestCase" classes are run by other test classes, not the build.
- exclude "**/*TestCase.class"
+ exclude(["**/*TestCase.class", "**/*TestSuite.class"])
}
dependencies { | true |
Other | spring-projects | spring-framework | 5b147bfba8d5d5837b96357a52867e433137f64b.json | Improve speed of spring-test build
- Now excluding *TestSuite classes from the JUnit test task.
- Renamed SpringJUnit4SuiteTests to SpringJUnit4TestSuite so that it is
no longer executed in the build.
- Reduced sleep time in various timing related tests. | spring-test/src/test/java/org/springframework/test/context/ClassLevelDirtiesContextTests.java | @@ -29,6 +29,7 @@
import org.junit.runners.JUnit4;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Configuration;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -179,9 +180,14 @@ public static void verifyFinalCacheState() {
@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners( { DependencyInjectionTestExecutionListener.class,
DirtiesContextTestExecutionListener.class })
- @ContextConfiguration("/org/springframework/test/context/junit4/SpringJUnit4ClassRunnerAppCtxTests-context.xml")
+ @ContextConfiguration
public static abstract class BaseTestCase {
+ @Configuration
+ static class Config {
+ /* no beans */
+ }
+
@Autowired
protected ApplicationContext applicationContext;
| true |
Other | spring-projects | spring-framework | 5b147bfba8d5d5837b96357a52867e433137f64b.json | Improve speed of spring-test build
- Now excluding *TestSuite classes from the JUnit test task.
- Renamed SpringJUnit4SuiteTests to SpringJUnit4TestSuite so that it is
no longer executed in the build.
- Reduced sleep time in various timing related tests. | spring-test/src/test/java/org/springframework/test/context/junit4/RepeatedSpringRunnerTests.java | @@ -156,34 +156,34 @@ public void repeatedFiveTimes() throws Exception {
public static final class TimedRepeatedTestCase extends AbstractRepeatedTestCase {
@Test
- @Timed(millis = 10000)
+ @Timed(millis = 1000)
@Repeat(5)
public void repeatedFiveTimesButDoesNotExceedTimeout() throws Exception {
incrementInvocationCount();
}
@Test
- @Timed(millis = 100)
+ @Timed(millis = 10)
@Repeat(1)
public void singleRepetitionExceedsTimeout() throws Exception {
incrementInvocationCount();
- Thread.sleep(250);
+ Thread.sleep(15);
}
@Test
- @Timed(millis = 200)
+ @Timed(millis = 20)
@Repeat(4)
public void firstRepetitionOfManyExceedsTimeout() throws Exception {
incrementInvocationCount();
- Thread.sleep(250);
+ Thread.sleep(25);
}
@Test
- @Timed(millis = 1000)
+ @Timed(millis = 100)
@Repeat(10)
public void collectiveRepetitionsExceedTimeout() throws Exception {
incrementInvocationCount();
- Thread.sleep(150);
+ Thread.sleep(11);
}
}
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.