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
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedArray.java
@@ -29,7 +29,7 @@ public class ManagedArray extends ManagedList<Object> { /** Resolved element type for runtime creation of the target array */ - volatile Class resolvedElementType; + volatile Class<?> resolvedElementType; /**
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java
@@ -102,7 +102,7 @@ public List<E> merge(Object parent) { throw new IllegalArgumentException("Cannot merge with object of type [" + parent.getClass() + "]"); } List<E> merged = new ManagedList<E>(); - merged.addAll((List) parent); + merged.addAll((List<E>) parent); merged.addAll(this); return merged; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedMap.java
@@ -117,7 +117,7 @@ public Object merge(Object parent) { throw new IllegalArgumentException("Cannot merge with object of type [" + parent.getClass() + "]"); } Map<K, V> merged = new ManagedMap<K, V>(); - merged.putAll((Map) parent); + merged.putAll((Map<K, V>) parent); merged.putAll(this); return merged; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java
@@ -101,7 +101,7 @@ public Set<E> merge(Object parent) { throw new IllegalArgumentException("Cannot merge with object of type [" + parent.getClass() + "]"); } Set<E> merged = new ManagedSet<E>(); - merged.addAll((Set) parent); + merged.addAll((Set<E>) parent); merged.addAll(this); return merged; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java
@@ -290,9 +290,9 @@ public int registerBeanDefinitions(ResourceBundle rb) throws BeanDefinitionStore public int registerBeanDefinitions(ResourceBundle rb, String prefix) throws BeanDefinitionStoreException { // Simply create a map and call overloaded method. Map<String, Object> map = new HashMap<String, Object>(); - Enumeration keys = rb.getKeys(); + Enumeration<String> keys = rb.getKeys(); while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); + String key = keys.nextElement(); map.put(key, rb.getObject(key)); } return registerBeanDefinitions(map, prefix); @@ -309,7 +309,7 @@ public int registerBeanDefinitions(ResourceBundle rb, String prefix) throws Bean * @throws BeansException in case of loading or parsing errors * @see #registerBeanDefinitions(java.util.Map, String, String) */ - public int registerBeanDefinitions(Map map) throws BeansException { + public int registerBeanDefinitions(Map<?, ?> map) throws BeansException { return registerBeanDefinitions(map, null); } @@ -324,7 +324,7 @@ public int registerBeanDefinitions(Map map) throws BeansException { * @return the number of bean definitions found * @throws BeansException in case of loading or parsing errors */ - public int registerBeanDefinitions(Map map, String prefix) throws BeansException { + public int registerBeanDefinitions(Map<?, ?> map, String prefix) throws BeansException { return registerBeanDefinitions(map, prefix, "Map " + map); } @@ -342,7 +342,7 @@ public int registerBeanDefinitions(Map map, String prefix) throws BeansException * @throws BeansException in case of loading or parsing errors * @see #registerBeanDefinitions(Map, String) */ - public int registerBeanDefinitions(Map map, String prefix, String resourceDescription) + public int registerBeanDefinitions(Map<?, ?> map, String prefix, String resourceDescription) throws BeansException { if (prefix == null) { @@ -413,7 +413,7 @@ protected void registerBeanDefinition(String beanName, Map<?, ?> map, String pre ConstructorArgumentValues cas = new ConstructorArgumentValues(); MutablePropertyValues pvs = new MutablePropertyValues(); - for (Map.Entry entry : map.entrySet()) { + for (Map.Entry<?, ?> entry : map.entrySet()) { String key = StringUtils.trimWhitespace((String) entry.getKey()); if (key.startsWith(prefix + SEPARATOR)) { String property = key.substring(prefix.length() + SEPARATOR.length()); @@ -502,7 +502,7 @@ else if (property.endsWith(REF_SUFFIX)) { * Reads the value of the entry. Correctly interprets bean references for * values that are prefixed with an asterisk. */ - private Object readValue(Map.Entry entry) { + private Object readValue(Map.Entry<? ,?> entry) { Object val = entry.getValue(); if (val instanceof String) { String strVal = (String) val;
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleInstantiationStrategy.java
@@ -63,15 +63,15 @@ public Object instantiate(RootBeanDefinition beanDefinition, String beanName, Be synchronized (beanDefinition.constructorArgumentLock) { constructorToUse = (Constructor<?>) beanDefinition.resolvedConstructorOrFactoryMethod; if (constructorToUse == null) { - final Class clazz = beanDefinition.getBeanClass(); + final Class<?> clazz = beanDefinition.getBeanClass(); if (clazz.isInterface()) { throw new BeanInstantiationException(clazz, "Specified class is an interface"); } try { if (System.getSecurityManager() != null) { - constructorToUse = AccessController.doPrivileged(new PrivilegedExceptionAction<Constructor>() { + constructorToUse = AccessController.doPrivileged(new PrivilegedExceptionAction<Constructor<?>>() { @Override - public Constructor run() throws Exception { + public Constructor<?> run() throws Exception { return clazz.getDeclaredConstructor((Class[]) null); } }); @@ -136,7 +136,7 @@ public Object run() { * Instantiation should use the given constructor and parameters. */ protected Object instantiateWithMethodInjection(RootBeanDefinition beanDefinition, - String beanName, BeanFactory owner, Constructor ctor, Object[] args) { + String beanName, BeanFactory owner, Constructor<?> ctor, Object[] args) { throw new UnsupportedOperationException( "Method Injection not supported in SimpleInstantiationStrategy");
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
@@ -94,7 +94,7 @@ public Object getBean(String name) throws BeansException { if (bean instanceof FactoryBean && !BeanFactoryUtils.isFactoryDereference(name)) { try { - return ((FactoryBean) bean).getObject(); + return ((FactoryBean<?>) bean).getObject(); } catch (Exception ex) { throw new BeanCreationException(beanName, "FactoryBean threw exception on object creation", ex); @@ -147,20 +147,20 @@ public boolean containsBean(String name) { public boolean isSingleton(String name) throws NoSuchBeanDefinitionException { Object bean = getBean(name); // In case of FactoryBean, return singleton status of created object. - return (bean instanceof FactoryBean && ((FactoryBean) bean).isSingleton()); + return (bean instanceof FactoryBean && ((FactoryBean<?>) bean).isSingleton()); } @Override public boolean isPrototype(String name) throws NoSuchBeanDefinitionException { Object bean = getBean(name); // In case of FactoryBean, return prototype status of created object. - return ((bean instanceof SmartFactoryBean && ((SmartFactoryBean) bean).isPrototype()) || - (bean instanceof FactoryBean && !((FactoryBean) bean).isSingleton())); + return ((bean instanceof SmartFactoryBean && ((SmartFactoryBean<?>) bean).isPrototype()) || + (bean instanceof FactoryBean && !((FactoryBean<?>) bean).isSingleton())); } @Override - public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException { - Class type = getType(name); + public boolean isTypeMatch(String name, Class<?> targetType) throws NoSuchBeanDefinitionException { + Class<?> type = getType(name); return (targetType == null || (type != null && targetType.isAssignableFrom(type))); } @@ -176,7 +176,7 @@ public Class<?> getType(String name) throws NoSuchBeanDefinitionException { if (bean instanceof FactoryBean && !BeanFactoryUtils.isFactoryDereference(name)) { // If it's a FactoryBean, we want to look at what it creates, not the factory class. - return ((FactoryBean) bean).getObjectType(); + return ((FactoryBean<?>) bean).getObjectType(); } return bean.getClass(); } @@ -207,19 +207,19 @@ public String[] getBeanDefinitionNames() { } @Override - public String[] getBeanNamesForType(Class type) { + public String[] getBeanNamesForType(Class<?> type) { return getBeanNamesForType(type, true, true); } @Override - public String[] getBeanNamesForType(Class type, boolean includeNonSingletons, boolean includeFactoryBeans) { + public String[] getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean includeFactoryBeans) { boolean isFactoryType = (type != null && FactoryBean.class.isAssignableFrom(type)); List<String> matches = new ArrayList<String>(); for (String name : this.beans.keySet()) { Object beanInstance = this.beans.get(name); if (beanInstance instanceof FactoryBean && !isFactoryType) { if (includeFactoryBeans) { - Class objectType = ((FactoryBean) beanInstance).getObjectType(); + Class<?> objectType = ((FactoryBean<?>) beanInstance).getObjectType(); if (objectType != null && (type == null || type.isAssignableFrom(objectType))) { matches.add(name); } @@ -254,8 +254,8 @@ public <T> Map<String, T> getBeansOfType(Class<T> type, boolean includeNonSingle if (beanInstance instanceof FactoryBean && !isFactoryType) { if (includeFactoryBeans) { // Match object created by FactoryBean. - FactoryBean factory = (FactoryBean) beanInstance; - Class objectType = factory.getObjectType(); + FactoryBean<?> factory = (FactoryBean<?>) beanInstance; + Class<?> objectType = factory.getObjectType(); if ((includeNonSingletons || factory.isSingleton()) && objectType != null && (type == null || type.isAssignableFrom(objectType))) { matches.put(beanName, getBean(beanName, type));
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java
@@ -519,7 +519,7 @@ protected void checkNameUniqueness(String beanName, List<String> aliases, Elemen foundName = beanName; } if (foundName == null) { - foundName = (String) CollectionUtils.findFirstMatch(this.usedNames, aliases); + foundName = CollectionUtils.findFirstMatch(this.usedNames, aliases); } if (foundName != null) { error("Bean name '" + foundName + "' is already used in this <beans> element", beanElement); @@ -1181,7 +1181,7 @@ public Object parseArrayElement(Element arrayEle, BeanDefinition bd) { /** * Parse a list element. */ - public List parseListElement(Element collectionEle, BeanDefinition bd) { + public List<Object> parseListElement(Element collectionEle, BeanDefinition bd) { String defaultElementType = collectionEle.getAttribute(VALUE_TYPE_ATTRIBUTE); NodeList nl = collectionEle.getChildNodes(); ManagedList<Object> target = new ManagedList<Object>(nl.getLength()); @@ -1195,7 +1195,7 @@ public List parseListElement(Element collectionEle, BeanDefinition bd) { /** * Parse a set element. */ - public Set parseSetElement(Element collectionEle, BeanDefinition bd) { + public Set<Object> parseSetElement(Element collectionEle, BeanDefinition bd) { String defaultElementType = collectionEle.getAttribute(VALUE_TYPE_ATTRIBUTE); NodeList nl = collectionEle.getChildNodes(); ManagedSet<Object> target = new ManagedSet<Object>(nl.getLength()); @@ -1220,7 +1220,7 @@ protected void parseCollectionElements( /** * Parse a map element. */ - public Map parseMapElement(Element mapEle, BeanDefinition bd) { + public Map<Object, Object> parseMapElement(Element mapEle, BeanDefinition bd) { String defaultKeyType = mapEle.getAttribute(KEY_TYPE_ATTRIBUTE); String defaultValueType = mapEle.getAttribute(VALUE_TYPE_ATTRIBUTE);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/xml/ResourceEntityResolver.java
@@ -75,7 +75,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc if (source == null && systemId != null) { String resourcePath = null; try { - String decodedSystemId = URLDecoder.decode(systemId); + String decodedSystemId = URLDecoder.decode(systemId, "UTF-8"); String givenUrl = new URL(decodedSystemId).toString(); String systemRootUrl = new File("").toURI().toURL().toString(); // Try relative to resource base if currently in system root.
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/factory/xml/UtilNamespaceHandler.java
@@ -59,7 +59,7 @@ public void init() { private static class ConstantBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser { @Override - protected Class getBeanClass(Element element) { + protected Class<?> getBeanClass(Element element) { return FieldRetrievingFactoryBean.class; } @@ -77,7 +77,7 @@ protected String resolveId(Element element, AbstractBeanDefinition definition, P private static class PropertyPathBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { @Override - protected Class getBeanClass(Element element) { + protected Class<?> getBeanClass(Element element) { return PropertyPathFactoryBean.class; } @@ -114,14 +114,14 @@ protected String resolveId(Element element, AbstractBeanDefinition definition, P private static class ListBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { @Override - protected Class getBeanClass(Element element) { + protected Class<?> getBeanClass(Element element) { return ListFactoryBean.class; } @Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { String listClass = element.getAttribute("list-class"); - List parsedList = parserContext.getDelegate().parseListElement(element, builder.getRawBeanDefinition()); + List<Object> parsedList = parserContext.getDelegate().parseListElement(element, builder.getRawBeanDefinition()); builder.addPropertyValue("sourceList", parsedList); if (StringUtils.hasText(listClass)) { builder.addPropertyValue("targetListClass", listClass); @@ -137,14 +137,14 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit private static class SetBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { @Override - protected Class getBeanClass(Element element) { + protected Class<?> getBeanClass(Element element) { return SetFactoryBean.class; } @Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { String setClass = element.getAttribute("set-class"); - Set parsedSet = parserContext.getDelegate().parseSetElement(element, builder.getRawBeanDefinition()); + Set<Object> parsedSet = parserContext.getDelegate().parseSetElement(element, builder.getRawBeanDefinition()); builder.addPropertyValue("sourceSet", parsedSet); if (StringUtils.hasText(setClass)) { builder.addPropertyValue("targetSetClass", setClass); @@ -160,14 +160,14 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit private static class MapBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { @Override - protected Class getBeanClass(Element element) { + protected Class<?> getBeanClass(Element element) { return MapFactoryBean.class; } @Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { String mapClass = element.getAttribute("map-class"); - Map parsedMap = parserContext.getDelegate().parseMapElement(element, builder.getRawBeanDefinition()); + Map<Object, Object> parsedMap = parserContext.getDelegate().parseMapElement(element, builder.getRawBeanDefinition()); builder.addPropertyValue("sourceMap", parsedMap); if (StringUtils.hasText(mapClass)) { builder.addPropertyValue("targetMapClass", mapClass); @@ -183,7 +183,7 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit private static class PropertiesBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser { @Override - protected Class getBeanClass(Element element) { + protected Class<?> getBeanClass(Element element) { return PropertiesFactoryBean.class; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassArrayEditor.java
@@ -62,7 +62,7 @@ public ClassArrayEditor(ClassLoader classLoader) { public void setAsText(String text) throws IllegalArgumentException { if (StringUtils.hasText(text)) { String[] classNames = StringUtils.commaDelimitedListToStringArray(text); - Class[] classes = new Class[classNames.length]; + Class<?>[] classes = new Class<?>[classNames.length]; for (int i = 0; i < classNames.length; i++) { String className = classNames[i].trim(); classes[i] = ClassUtils.resolveClassName(className, this.classLoader); @@ -76,7 +76,7 @@ public void setAsText(String text) throws IllegalArgumentException { @Override public String getAsText() { - Class[] classes = (Class[]) getValue(); + Class<?>[] classes = (Class[]) getValue(); if (ObjectUtils.isEmpty(classes)) { return ""; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassEditor.java
@@ -69,7 +69,7 @@ public void setAsText(String text) throws IllegalArgumentException { @Override public String getAsText() { - Class clazz = (Class) getValue(); + Class<?> clazz = (Class<?>) getValue(); if (clazz != null) { return ClassUtils.getQualifiedName(clazz); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java
@@ -42,7 +42,8 @@ */ public class CustomCollectionEditor extends PropertyEditorSupport { - private final Class collectionType; + @SuppressWarnings("rawtypes") + private final Class<? extends Collection> collectionType; private final boolean nullAsEmptyCollection; @@ -57,7 +58,8 @@ public class CustomCollectionEditor extends PropertyEditorSupport { * @see java.util.TreeSet * @see java.util.LinkedHashSet */ - public CustomCollectionEditor(Class collectionType) { + @SuppressWarnings("rawtypes") + public CustomCollectionEditor(Class<? extends Collection> collectionType) { this(collectionType, false); } @@ -79,7 +81,8 @@ public CustomCollectionEditor(Class collectionType) { * @see java.util.TreeSet * @see java.util.LinkedHashSet */ - public CustomCollectionEditor(Class collectionType, boolean nullAsEmptyCollection) { + @SuppressWarnings("rawtypes") + public CustomCollectionEditor(Class<? extends Collection> collectionType, boolean nullAsEmptyCollection) { if (collectionType == null) { throw new IllegalArgumentException("Collection type is required"); } @@ -104,7 +107,6 @@ public void setAsText(String text) throws IllegalArgumentException { * Convert the given value to a Collection of the target type. */ @Override - @SuppressWarnings("unchecked") public void setValue(Object value) { if (value == null && this.nullAsEmptyCollection) { super.setValue(createCollection(this.collectionType, 0)); @@ -115,8 +117,8 @@ else if (value == null || (this.collectionType.isInstance(value) && !alwaysCreat } else if (value instanceof Collection) { // Convert Collection elements. - Collection source = (Collection) value; - Collection target = createCollection(this.collectionType, source.size()); + Collection<?> source = (Collection<?>) value; + Collection<Object> target = createCollection(this.collectionType, source.size()); for (Object elem : source) { target.add(convertElement(elem)); } @@ -125,15 +127,15 @@ else if (value instanceof Collection) { else if (value.getClass().isArray()) { // Convert array elements to Collection elements. int length = Array.getLength(value); - Collection target = createCollection(this.collectionType, length); + Collection<Object> target = createCollection(this.collectionType, length); for (int i = 0; i < length; i++) { target.add(convertElement(Array.get(value, i))); } super.setValue(target); } else { // A plain value: convert it to a Collection with a single element. - Collection target = createCollection(this.collectionType, 1); + Collection<Object> target = createCollection(this.collectionType, 1); target.add(convertElement(value)); super.setValue(target); } @@ -146,24 +148,25 @@ else if (value.getClass().isArray()) { * @param initialCapacity the initial capacity * @return the new Collection instance */ - protected Collection createCollection(Class collectionType, int initialCapacity) { + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected Collection<Object> createCollection(Class<? extends Collection> collectionType, int initialCapacity) { if (!collectionType.isInterface()) { try { - return (Collection) collectionType.newInstance(); + return collectionType.newInstance(); } catch (Exception ex) { throw new IllegalArgumentException( "Could not instantiate collection class [" + collectionType.getName() + "]: " + ex.getMessage()); } } else if (List.class.equals(collectionType)) { - return new ArrayList(initialCapacity); + return new ArrayList<Object>(initialCapacity); } else if (SortedSet.class.equals(collectionType)) { - return new TreeSet(); + return new TreeSet<Object>(); } else { - return new LinkedHashSet(initialCapacity); + return new LinkedHashSet<Object>(initialCapacity); } }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java
@@ -33,7 +33,8 @@ */ public class CustomMapEditor extends PropertyEditorSupport { - private final Class mapType; + @SuppressWarnings("rawtypes") + private final Class<? extends Map> mapType; private final boolean nullAsEmptyMap; @@ -48,7 +49,8 @@ public class CustomMapEditor extends PropertyEditorSupport { * @see java.util.TreeMap * @see java.util.LinkedHashMap */ - public CustomMapEditor(Class mapType) { + @SuppressWarnings("rawtypes") + public CustomMapEditor(Class<? extends Map> mapType) { this(mapType, false); } @@ -69,7 +71,8 @@ public CustomMapEditor(Class mapType) { * @see java.util.TreeMap * @see java.util.LinkedHashMap */ - public CustomMapEditor(Class mapType, boolean nullAsEmptyMap) { + @SuppressWarnings("rawtypes") + public CustomMapEditor(Class<? extends Map> mapType, boolean nullAsEmptyMap) { if (mapType == null) { throw new IllegalArgumentException("Map type is required"); } @@ -104,9 +107,9 @@ else if (value == null || (this.mapType.isInstance(value) && !alwaysCreateNewMap } else if (value instanceof Map) { // Convert Map elements. - Map<?, ?> source = (Map) value; - Map target = createMap(this.mapType, source.size()); - for (Map.Entry entry : source.entrySet()) { + Map<?, ?> source = (Map<?, ?>) value; + Map<Object, Object> target = createMap(this.mapType, source.size()); + for (Map.Entry<?, ?> entry : source.entrySet()) { target.put(convertKey(entry.getKey()), convertValue(entry.getValue())); } super.setValue(target); @@ -123,21 +126,22 @@ else if (value instanceof Map) { * @param initialCapacity the initial capacity * @return the new Map instance */ - protected Map createMap(Class mapType, int initialCapacity) { + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected Map<Object, Object> createMap(Class<? extends Map> mapType, int initialCapacity) { if (!mapType.isInterface()) { try { - return (Map) mapType.newInstance(); + return mapType.newInstance(); } catch (Exception ex) { throw new IllegalArgumentException( "Could not instantiate map class [" + mapType.getName() + "]: " + ex.getMessage()); } } else if (SortedMap.class.equals(mapType)) { - return new TreeMap(); + return new TreeMap<Object, Object>(); } else { - return new LinkedHashMap(initialCapacity); + return new LinkedHashMap<Object, Object>(initialCapacity); } }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/propertyeditors/PropertiesEditor.java
@@ -67,7 +67,7 @@ public void setAsText(String text) throws IllegalArgumentException { public void setValue(Object value) { if (!(value instanceof Properties) && value instanceof Map) { Properties props = new Properties(); - props.putAll((Map) value); + props.putAll((Map<?, ?>) value); super.setValue(props); } else {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.java
@@ -92,7 +92,7 @@ protected TypeConverter getDefaultTypeConverter() { * @see #setTypeConverter * @see org.springframework.beans.PropertyEditorRegistry#registerCustomEditor */ - public void registerCustomEditor(Class requiredType, PropertyEditor propertyEditor) { + public void registerCustomEditor(Class<?> requiredType, PropertyEditor propertyEditor) { TypeConverter converter = getTypeConverter(); if (!(converter instanceof PropertyEditorRegistry)) { throw new IllegalStateException( @@ -139,7 +139,7 @@ protected Method doFindMatchingMethod(Object[] arguments) { for (Method candidate : candidates) { if (candidate.getName().equals(targetMethod)) { // Check if the inspected method has the correct number of parameters. - Class[] paramTypes = candidate.getParameterTypes(); + Class<?>[] paramTypes = candidate.getParameterTypes(); if (paramTypes.length == argCount) { Object[] convertedArguments = new Object[argCount]; boolean match = true;
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java
@@ -23,7 +23,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeansException; import org.springframework.util.StringUtils; @@ -37,7 +36,7 @@ * @since 19.05.2003 * @see org.springframework.beans.BeanWrapper */ -public class PropertyComparator implements Comparator { +public class PropertyComparator<T> implements Comparator<T> { protected final Log logger = LogFactory.getLog(getClass()); @@ -73,7 +72,8 @@ public final SortDefinition getSortDefinition() { @Override - public int compare(Object o1, Object o2) { + @SuppressWarnings("unchecked") + public int compare(T o1, T o2) { Object v1 = getPropertyValue(o1); Object v2 = getPropertyValue(o2); if (this.sortDefinition.isIgnoreCase() && (v1 instanceof String) && (v2 instanceof String)) { @@ -86,7 +86,7 @@ public int compare(Object o1, Object o2) { // Put an object with null property at the end of the sort result. try { if (v1 != null) { - result = (v2 != null ? ((Comparable) v1).compareTo(v2) : -1); + result = (v2 != null ? ((Comparable<Object>) v1).compareTo(v2) : -1); } else { result = (v2 != null ? 1 : 0); @@ -130,9 +130,9 @@ private Object getPropertyValue(Object obj) { * @param sortDefinition the parameters to sort by * @throws java.lang.IllegalArgumentException in case of a missing propertyName */ - public static void sort(List source, SortDefinition sortDefinition) throws BeansException { + public static void sort(List<?> source, SortDefinition sortDefinition) throws BeansException { if (StringUtils.hasText(sortDefinition.getProperty())) { - Collections.sort(source, new PropertyComparator(sortDefinition)); + Collections.sort(source, new PropertyComparator<Object>(sortDefinition)); } } @@ -146,7 +146,7 @@ public static void sort(List source, SortDefinition sortDefinition) throws Beans */ public static void sort(Object[] source, SortDefinition sortDefinition) throws BeansException { if (StringUtils.hasText(sortDefinition.getProperty())) { - Arrays.sort(source, new PropertyComparator(sortDefinition)); + Arrays.sort(source, new PropertyComparator<Object>(sortDefinition)); } }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/test/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBeanTests.java
@@ -252,9 +252,10 @@ public void testWhenServiceLocatorExceptionClassToExceptionTypeWithOnlyNoArgCtor } @Test(expected=IllegalArgumentException.class) + @SuppressWarnings("unchecked") public void testWhenServiceLocatorExceptionClassIsNotAnExceptionSubclass() throws Exception { ServiceLocatorFactoryBean factory = new ServiceLocatorFactoryBean(); - factory.setServiceLocatorExceptionClass(getClass()); + factory.setServiceLocatorExceptionClass((Class) getClass()); // should throw, bad (non-Exception-type) serviceLocatorException class supplied }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomCollectionEditorTests.java
@@ -38,8 +38,9 @@ public void testCtorWithNullCollectionType() throws Exception { } @Test(expected=IllegalArgumentException.class) + @SuppressWarnings("unchecked") public void testCtorWithNonCollectionType() throws Exception { - new CustomCollectionEditor(String.class); + new CustomCollectionEditor((Class) String.class); } @Test(expected=IllegalArgumentException.class)
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheFactoryBean.java
@@ -31,9 +31,9 @@ import net.sf.ehcache.constructs.blocking.UpdatingCacheEntryFactory; import net.sf.ehcache.constructs.blocking.UpdatingSelfPopulatingCache; import net.sf.ehcache.event.CacheEventListener; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; @@ -85,6 +85,7 @@ public class EhCacheFactoryBean extends CacheConfiguration implements FactoryBea private Ehcache cache; + @SuppressWarnings("deprecation") public EhCacheFactoryBean() { setMaxElementsInMemory(10000); setMaxElementsOnDisk(10000000);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCacheManager.java
@@ -101,7 +101,7 @@ public void afterPropertiesSet() { protected Collection<Cache> loadCaches() { Collection<Cache> caches = new LinkedHashSet<Cache>(); for (String cacheName : this.cacheManager.getCacheNames()) { - javax.cache.Cache jcache = this.cacheManager.getCache(cacheName); + javax.cache.Cache<Object, Object> jcache = this.cacheManager.getCache(cacheName); caches.add(new JCacheCache(jcache, this.allowNullValues)); } return caches;
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerTaskScheduler.java
@@ -53,44 +53,44 @@ public void setErrorHandler(ErrorHandler errorHandler) { @Override - public ScheduledFuture schedule(Runnable task, Trigger trigger) { + public ScheduledFuture<?> schedule(Runnable task, Trigger trigger) { return new ReschedulingTimerListener(errorHandlingTask(task, true), trigger).schedule(); } @Override - public ScheduledFuture schedule(Runnable task, Date startTime) { + public ScheduledFuture<?> schedule(Runnable task, Date startTime) { TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, false)); Timer timer = getTimerManager().schedule(futureTask, startTime); futureTask.setTimer(timer); return futureTask; } @Override - public ScheduledFuture scheduleAtFixedRate(Runnable task, Date startTime, long period) { + public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Date startTime, long period) { TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); Timer timer = getTimerManager().scheduleAtFixedRate(futureTask, startTime, period); futureTask.setTimer(timer); return futureTask; } @Override - public ScheduledFuture scheduleAtFixedRate(Runnable task, long period) { + public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, long period) { TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); Timer timer = getTimerManager().scheduleAtFixedRate(futureTask, 0, period); futureTask.setTimer(timer); return futureTask; } @Override - public ScheduledFuture scheduleWithFixedDelay(Runnable task, Date startTime, long delay) { + public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Date startTime, long delay) { TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); Timer timer = getTimerManager().schedule(futureTask, startTime, delay); futureTask.setTimer(timer); return futureTask; } @Override - public ScheduledFuture scheduleWithFixedDelay(Runnable task, long delay) { + public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long delay) { TimerScheduledFuture futureTask = new TimerScheduledFuture(errorHandlingTask(task, true)); Timer timer = getTimerManager().schedule(futureTask, 0, delay); futureTask.setTimer(timer); @@ -164,7 +164,7 @@ public ReschedulingTimerListener(Runnable runnable, Trigger trigger) { this.trigger = trigger; } - public ScheduledFuture schedule() { + public ScheduledFuture<?> schedule() { this.scheduledExecutionTime = this.trigger.nextExecutionTime(this.triggerContext); if (this.scheduledExecutionTime == null) { return null;
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/commonj/WorkManagerTaskExecutor.java
@@ -20,6 +20,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.concurrent.FutureTask; + import javax.naming.NamingException; import commonj.work.Work; @@ -176,11 +177,13 @@ public WorkItem schedule(Work work, WorkListener workListener) throws WorkExcept } @Override + @SuppressWarnings("rawtypes") public boolean waitForAll(Collection workItems, long timeout) throws InterruptedException { return this.workManager.waitForAll(workItems, timeout); } @Override + @SuppressWarnings("rawtypes") public Collection waitForAny(Collection workItems, long timeout) throws InterruptedException { return this.workManager.waitForAny(workItems, timeout); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/AdaptableJobFactory.java
@@ -74,7 +74,7 @@ protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception { Method getJobDetail = bundle.getClass().getMethod("getJobDetail"); Object jobDetail = ReflectionUtils.invokeMethod(getJobDetail, bundle); Method getJobClass = jobDetail.getClass().getMethod("getJobClass"); - Class jobClass = (Class) ReflectionUtils.invokeMethod(getJobClass, jobDetail); + Class<?> jobClass = (Class<?>) ReflectionUtils.invokeMethod(getJobClass, jobDetail); return jobClass.newInstance(); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/CronTriggerFactoryBean.java
@@ -232,7 +232,7 @@ else if (this.startTime == null) { this.cronTrigger = cti; */ - Class cronTriggerClass; + Class<?> cronTriggerClass; Method jobKeyMethod; try { cronTriggerClass = getClass().getClassLoader().loadClass("org.quartz.impl.triggers.CronTriggerImpl");
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailBean.java
@@ -21,7 +21,6 @@ import org.quartz.Job; import org.quartz.JobDetail; import org.quartz.Scheduler; - import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ApplicationContext; @@ -48,11 +47,11 @@ * @see org.springframework.beans.factory.BeanNameAware * @see org.quartz.Scheduler#DEFAULT_GROUP */ -@SuppressWarnings("serial") +@SuppressWarnings({ "serial", "rawtypes" }) public class JobDetailBean extends JobDetail implements BeanNameAware, ApplicationContextAware, InitializingBean { - private Class actualJobClass; + private Class<?> actualJobClass; private String beanName;
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java
@@ -56,7 +56,7 @@ private String group; - private Class jobClass; + private Class<?> jobClass; private JobDataMap jobDataMap = new JobDataMap(); @@ -92,7 +92,7 @@ public void setGroup(String group) { /** * Specify the job's implementation class. */ - public void setJobClass(Class jobClass) { + public void setJobClass(Class<?> jobClass) { this.jobClass = jobClass; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/MethodInvokingJobDetailFactoryBean.java
@@ -92,7 +92,7 @@ public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethod jobDetailImplClass = null; } try { - Class jobExecutionContextClass = + Class<?> jobExecutionContextClass = QuartzJobBean.class.getClassLoader().loadClass("org.quartz.JobExecutionContext"); setResultMethod = jobExecutionContextClass.getMethod("setResult", Object.class); } @@ -192,7 +192,7 @@ public void setBeanFactory(BeanFactory beanFactory) { } @Override - protected Class resolveClassName(String className) throws ClassNotFoundException { + protected Class<?> resolveClassName(String className) throws ClassNotFoundException { return ClassUtils.forName(className, this.beanClassLoader); } @@ -205,7 +205,7 @@ public void afterPropertiesSet() throws ClassNotFoundException, NoSuchMethodExce String name = (this.name != null ? this.name : this.beanName); // Consider the concurrent flag to choose between stateful and stateless job. - Class jobClass = (this.concurrent ? MethodInvokingJob.class : StatefulMethodInvokingJob.class); + Class<?> jobClass = (this.concurrent ? MethodInvokingJob.class : StatefulMethodInvokingJob.class); // Build JobDetail instance. if (jobDetailImplClass != null) { @@ -253,8 +253,8 @@ protected void postProcessJobDetail(JobDetail jobDetail) { * Overridden to support the {@link #setTargetBeanName "targetBeanName"} feature. */ @Override - public Class getTargetClass() { - Class targetClass = super.getTargetClass(); + public Class<?> getTargetClass() { + Class<?> targetClass = super.getTargetClass(); if (targetClass == null && this.targetBeanName != null) { Assert.state(this.beanFactory != null, "BeanFactory must be set when using 'targetBeanName'"); targetClass = this.beanFactory.getType(this.targetBeanName);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/QuartzJobBean.java
@@ -76,7 +76,7 @@ public abstract class QuartzJobBean implements Job { static { try { - Class jobExecutionContextClass = + Class<?> jobExecutionContextClass = QuartzJobBean.class.getClassLoader().loadClass("org.quartz.JobExecutionContext"); getSchedulerMethod = jobExecutionContextClass.getMethod("getScheduler"); getMergedJobDataMapMethod = jobExecutionContextClass.getMethod("getMergedJobDataMap"); @@ -97,7 +97,7 @@ public final void execute(JobExecutionContext context) throws JobExecutionExcept try { // Reflectively adapting to differences between Quartz 1.x and Quartz 2.0... Scheduler scheduler = (Scheduler) ReflectionUtils.invokeMethod(getSchedulerMethod, context); - Map mergedJobDataMap = (Map) ReflectionUtils.invokeMethod(getMergedJobDataMapMethod, context); + Map<?, ?> mergedJobDataMap = (Map<?, ?>) ReflectionUtils.invokeMethod(getMergedJobDataMapMethod, context); BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this); MutablePropertyValues pvs = new MutablePropertyValues();
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/ResourceLoaderClassLoadHelper.java
@@ -24,7 +24,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.quartz.spi.ClassLoadHelper; - import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; @@ -73,6 +72,7 @@ public void initialize() { } @Override + @SuppressWarnings("rawtypes") public Class loadClass(String name) throws ClassNotFoundException { return this.resourceLoader.getClassLoader().loadClass(name); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java
@@ -382,7 +382,7 @@ private JobDetail findJobDetail(Trigger trigger) { } else { try { - Map jobDataMap = (Map) ReflectionUtils.invokeMethod(Trigger.class.getMethod("getJobDataMap"), trigger); + Map<?, ?> jobDataMap = (Map<?, ?>) ReflectionUtils.invokeMethod(Trigger.class.getMethod("getJobDataMap"), trigger); return (JobDetail) jobDataMap.remove(JobDetailAwareTrigger.JOB_DETAIL_KEY); } catch (NoSuchMethodException ex) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java
@@ -173,7 +173,7 @@ public static DataSource getConfigTimeNonTransactionalDataSource() { private DataSource nonTransactionalDataSource; - private Map schedulerContextMap; + private Map<? ,?> schedulerContextMap; private ApplicationContext applicationContext; @@ -208,7 +208,7 @@ public static DataSource getConfigTimeNonTransactionalDataSource() { * @see #setConfigLocation * @see #setQuartzProperties */ - public void setSchedulerFactoryClass(Class schedulerFactoryClass) { + public void setSchedulerFactoryClass(Class<?> schedulerFactoryClass) { if (schedulerFactoryClass == null || !SchedulerFactory.class.isAssignableFrom(schedulerFactoryClass)) { throw new IllegalArgumentException("schedulerFactoryClass must implement [org.quartz.SchedulerFactory]"); } @@ -313,7 +313,7 @@ public void setNonTransactionalDataSource(DataSource nonTransactionalDataSource) * values (for example Spring-managed beans) * @see JobDetailBean#setJobDataAsMap */ - public void setSchedulerContextAsMap(Map schedulerContextAsMap) { + public void setSchedulerContextAsMap(Map<?, ?> schedulerContextAsMap) { this.schedulerContextMap = schedulerContextAsMap; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/scheduling/quartz/SimpleTriggerFactoryBean.java
@@ -233,7 +233,7 @@ else if (this.startTime == null) { this.simpleTrigger = sti; */ - Class simpleTriggerClass; + Class<?> simpleTriggerClass; Method jobKeyMethod; try { simpleTriggerClass = getClass().getClassLoader().loadClass("org.quartz.impl.triggers.SimpleTriggerImpl");
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context-support/src/main/java/org/springframework/ui/jasperreports/JasperReportsUtils.java
@@ -63,7 +63,7 @@ public static JRDataSource convertReportData(Object value) throws IllegalArgumen return (JRDataSource) value; } else if (value instanceof Collection) { - return new JRBeanCollectionDataSource((Collection) value); + return new JRBeanCollectionDataSource((Collection<?>) value); } else if (value instanceof Object[]) { return new JRBeanArrayDataSource((Object[]) value);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCache.java
@@ -89,7 +89,7 @@ public String getName() { } @Override - public ConcurrentMap getNativeCache() { + public ConcurrentMap<Object, Object> getNativeCache() { return this.store; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/annotation/AnnotatedBeanDefinitionReader.java
@@ -127,11 +127,13 @@ public void registerBean(Class<?> annotatedClass) { registerBean(annotatedClass, null, (Class<? extends Annotation>[]) null); } - public void registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers) { + public void registerBean(Class<?> annotatedClass, + @SuppressWarnings("unchecked") Class<? extends Annotation>... qualifiers) { registerBean(annotatedClass, null, qualifiers); } - public void registerBean(Class<?> annotatedClass, String name, Class<? extends Annotation>... qualifiers) { + public void registerBean(Class<?> annotatedClass, String name, + @SuppressWarnings("unchecked") Class<? extends Annotation>... qualifiers) { AnnotatedGenericBeanDefinition abd = new AnnotatedGenericBeanDefinition(annotatedClass); if (this.conditionEvaluator.shouldSkip(abd.getMetadata())) { return;
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
@@ -604,7 +604,7 @@ protected Object getResourceToInject(Object target, String requestingBeanName) { } if (StringUtils.hasLength(this.wsdlLocation)) { try { - Constructor<?> ctor = this.lookupType.getConstructor(new Class[] {URL.class, QName.class}); + Constructor<?> ctor = this.lookupType.getConstructor(new Class<?>[] {URL.class, QName.class}); WebServiceClient clientAnn = this.lookupType.getAnnotation(WebServiceClient.class); if (clientAnn == null) { throw new IllegalStateException("JAX-WS Service class [" + this.lookupType.getName() +
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/annotation/ComponentScanBeanDefinitionParser.java
@@ -240,7 +240,7 @@ else if ("regex".equals(filterType)) { return new RegexPatternTypeFilter(Pattern.compile(expression)); } else if ("custom".equals(filterType)) { - Class filterClass = classLoader.loadClass(expression); + Class<?> filterClass = classLoader.loadClass(expression); if (!TypeFilter.class.isAssignableFrom(filterClass)) { throw new IllegalArgumentException( "Class is not assignable to [" + TypeFilter.class.getName() + "]: " + expression); @@ -257,7 +257,7 @@ else if ("custom".equals(filterType)) { } @SuppressWarnings("unchecked") - private Object instantiateUserDefinedStrategy(String className, Class strategyType, ClassLoader classLoader) { + private Object instantiateUserDefinedStrategy(String className, Class<?> strategyType, ClassLoader classLoader) { Object result = null; try { result = classLoader.loadClass(className).newInstance();
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java
@@ -103,7 +103,7 @@ public Class<?> enhance(Class<?> configClass) { private Enhancer newEnhancer(Class<?> superclass) { Enhancer enhancer = new Enhancer(); enhancer.setSuperclass(superclass); - enhancer.setInterfaces(new Class[] {EnhancedConfiguration.class}); + enhancer.setInterfaces(new Class<?>[] {EnhancedConfiguration.class}); enhancer.setUseFactory(false); enhancer.setCallbackFilter(CALLBACK_FILTER); enhancer.setCallbackTypes(CALLBACK_FILTER.getCallbackTypes());
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java
@@ -672,7 +672,7 @@ public Class<?> loadClass() throws ClassNotFoundException { public boolean isAssignable(Class<?> clazz) throws IOException { if (this.source instanceof Class) { - return clazz.isAssignableFrom((Class) this.source); + return clazz.isAssignableFrom((Class<?>) this.source); } return new AssignableTypeFilter(clazz).match((MetadataReader) this.source, metadataReaderFactory); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/annotation/Jsr330ScopeMetadataResolver.java
@@ -55,7 +55,7 @@ public Jsr330ScopeMetadataResolver() { * @param annotationType the JSR-330 annotation type as a Class * @param scopeName the Spring scope name */ - public final void registerScope(Class annotationType, String scopeName) { + public final void registerScope(Class<?> annotationType, String scopeName) { this.scopeMap.put(annotationType.getName(), scopeName); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/annotation/LoadTimeWeavingConfiguration.java
@@ -91,9 +91,12 @@ public LoadTimeWeaver loadTimeWeaver() { // No aop.xml present on the classpath -> treat as 'disabled' break; } - // aop.xml is present on the classpath -> fall through and enable + // aop.xml is present on the classpath -> enable + AspectJWeavingEnabler.enableAspectJWeaving(loadTimeWeaver, this.beanClassLoader); + break; case ENABLED: AspectJWeavingEnabler.enableAspectJWeaving(loadTimeWeaver, this.beanClassLoader); + break; } return loadTimeWeaver;
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/config/PropertyOverrideBeanDefinitionParser.java
@@ -31,7 +31,7 @@ class PropertyOverrideBeanDefinitionParser extends AbstractPropertyLoadingBeanDefinitionParser { @Override - protected Class getBeanClass(Element element) { + protected Class<?> getBeanClass(Element element) { return PropertyOverrideConfigurer.class; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/event/AbstractApplicationEventMulticaster.java
@@ -61,7 +61,7 @@ public abstract class AbstractApplicationEventMulticaster implements Application @Override - public void addApplicationListener(ApplicationListener listener) { + public void addApplicationListener(ApplicationListener<?> listener) { synchronized (this.defaultRetriever) { this.defaultRetriever.applicationListeners.add(listener); this.retrieverCache.clear(); @@ -77,7 +77,7 @@ public void addApplicationListenerBean(String listenerBeanName) { } @Override - public void removeApplicationListener(ApplicationListener listener) { + public void removeApplicationListener(ApplicationListener<?> listener) { synchronized (this.defaultRetriever) { this.defaultRetriever.applicationListeners.remove(listener); this.retrieverCache.clear(); @@ -120,7 +120,7 @@ private BeanFactory getBeanFactory() { * @return a Collection of ApplicationListeners * @see org.springframework.context.ApplicationListener */ - protected Collection<ApplicationListener> getApplicationListeners() { + protected Collection<ApplicationListener<?>> getApplicationListeners() { synchronized (this.defaultRetriever) { return this.defaultRetriever.getApplicationListeners(); } @@ -134,7 +134,7 @@ protected Collection<ApplicationListener> getApplicationListeners() { * @return a Collection of ApplicationListeners * @see org.springframework.context.ApplicationListener */ - protected Collection<ApplicationListener> getApplicationListeners(ApplicationEvent event) { + protected Collection<ApplicationListener<?>> getApplicationListeners(ApplicationEvent event) { Class<? extends ApplicationEvent> eventType = event.getClass(); Object source = event.getSource(); Class<?> sourceType = (source != null ? source.getClass() : null); @@ -145,14 +145,14 @@ protected Collection<ApplicationListener> getApplicationListeners(ApplicationEve } else { retriever = new ListenerRetriever(true); - LinkedList<ApplicationListener> allListeners = new LinkedList<ApplicationListener>(); - Set<ApplicationListener> listeners; + LinkedList<ApplicationListener<?>> allListeners = new LinkedList<ApplicationListener<?>>(); + Set<ApplicationListener<?>> listeners; Set<String> listenerBeans; synchronized (this.defaultRetriever) { - listeners = new LinkedHashSet<ApplicationListener>(this.defaultRetriever.applicationListeners); + listeners = new LinkedHashSet<ApplicationListener<?>>(this.defaultRetriever.applicationListeners); listenerBeans = new LinkedHashSet<String>(this.defaultRetriever.applicationListenerBeans); } - for (ApplicationListener listener : listeners) { + for (ApplicationListener<?> listener : listeners) { if (supportsEvent(listener, eventType, sourceType)) { retriever.applicationListeners.add(listener); allListeners.add(listener); @@ -162,7 +162,7 @@ protected Collection<ApplicationListener> getApplicationListeners(ApplicationEve BeanFactory beanFactory = getBeanFactory(); for (String listenerBeanName : listenerBeans) { try { - ApplicationListener listener = beanFactory.getBean(listenerBeanName, ApplicationListener.class); + ApplicationListener<?> listener = beanFactory.getBean(listenerBeanName, ApplicationListener.class); if (!allListeners.contains(listener) && supportsEvent(listener, eventType, sourceType)) { retriever.applicationListenerBeans.add(listenerBeanName); allListeners.add(listener); @@ -192,8 +192,8 @@ protected Collection<ApplicationListener> getApplicationListeners(ApplicationEve * @return whether the given listener should be included in the * candidates for the given event type */ - protected boolean supportsEvent( - ApplicationListener listener, Class<? extends ApplicationEvent> eventType, Class sourceType) { + protected boolean supportsEvent(ApplicationListener<?> listener, + Class<? extends ApplicationEvent> eventType, Class<?> sourceType) { SmartApplicationListener smartListener = (listener instanceof SmartApplicationListener ? (SmartApplicationListener) listener : new GenericApplicationListenerAdapter(listener)); @@ -239,28 +239,28 @@ public int hashCode() { */ private class ListenerRetriever { - public final Set<ApplicationListener> applicationListeners; + public final Set<ApplicationListener<?>> applicationListeners; public final Set<String> applicationListenerBeans; private final boolean preFiltered; public ListenerRetriever(boolean preFiltered) { - this.applicationListeners = new LinkedHashSet<ApplicationListener>(); + this.applicationListeners = new LinkedHashSet<ApplicationListener<?>>(); this.applicationListenerBeans = new LinkedHashSet<String>(); this.preFiltered = preFiltered; } - public Collection<ApplicationListener> getApplicationListeners() { - LinkedList<ApplicationListener> allListeners = new LinkedList<ApplicationListener>(); - for (ApplicationListener listener : this.applicationListeners) { + public Collection<ApplicationListener<?>> getApplicationListeners() { + LinkedList<ApplicationListener<?>> allListeners = new LinkedList<ApplicationListener<?>>(); + for (ApplicationListener<?> listener : this.applicationListeners) { allListeners.add(listener); } if (!this.applicationListenerBeans.isEmpty()) { BeanFactory beanFactory = getBeanFactory(); for (String listenerBeanName : this.applicationListenerBeans) { try { - ApplicationListener listener = beanFactory.getBean(listenerBeanName, ApplicationListener.class); + ApplicationListener<?> listener = beanFactory.getBean(listenerBeanName, ApplicationListener.class); if (this.preFiltered || !allListeners.contains(listener)) { allListeners.add(listener); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/event/ApplicationEventMulticaster.java
@@ -36,7 +36,7 @@ public interface ApplicationEventMulticaster { * Add a listener to be notified of all events. * @param listener the listener to add */ - void addApplicationListener(ApplicationListener listener); + void addApplicationListener(ApplicationListener<?> listener); /** * Add a listener bean to be notified of all events. @@ -48,7 +48,7 @@ public interface ApplicationEventMulticaster { * Remove a listener from the notification list. * @param listener the listener to remove */ - void removeApplicationListener(ApplicationListener listener); + void removeApplicationListener(ApplicationListener<?> listener); /** * Remove a listener bean from the notification list.
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/event/EventPublicationInterceptor.java
@@ -48,7 +48,7 @@ public class EventPublicationInterceptor implements MethodInterceptor, ApplicationEventPublisherAware, InitializingBean { - private Constructor applicationEventClassConstructor; + private Constructor<?> applicationEventClassConstructor; private ApplicationEventPublisher applicationEventPublisher; @@ -62,14 +62,14 @@ * {@code null} or if it is not an {@code ApplicationEvent} subclass or * if it does not expose a constructor that takes a single {@code Object} argument */ - public void setApplicationEventClass(Class applicationEventClass) { + public void setApplicationEventClass(Class<?> applicationEventClass) { if (ApplicationEvent.class.equals(applicationEventClass) || !ApplicationEvent.class.isAssignableFrom(applicationEventClass)) { throw new IllegalArgumentException("applicationEventClass needs to extend ApplicationEvent"); } try { this.applicationEventClassConstructor = - applicationEventClass.getConstructor(new Class[] {Object.class}); + applicationEventClass.getConstructor(new Class<?>[] {Object.class}); } catch (NoSuchMethodException ex) { throw new IllegalArgumentException("applicationEventClass [" +
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/event/GenericApplicationListenerAdapter.java
@@ -33,21 +33,21 @@ */ public class GenericApplicationListenerAdapter implements SmartApplicationListener { - private final ApplicationListener delegate; + private final ApplicationListener<ApplicationEvent> delegate; /** * Create a new GenericApplicationListener for the given delegate. * @param delegate the delegate listener to be invoked */ - public GenericApplicationListenerAdapter(ApplicationListener delegate) { + @SuppressWarnings("unchecked") + public GenericApplicationListenerAdapter(ApplicationListener<?> delegate) { Assert.notNull(delegate, "Delegate listener must not be null"); - this.delegate = delegate; + this.delegate = (ApplicationListener<ApplicationEvent>) delegate; } @Override - @SuppressWarnings("unchecked") public void onApplicationEvent(ApplicationEvent event) { this.delegate.onApplicationEvent(event); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java
@@ -82,7 +82,7 @@ protected Executor getTaskExecutor() { @Override - @SuppressWarnings("unchecked") + @SuppressWarnings({ "unchecked", "rawtypes" }) public void multicastEvent(final ApplicationEvent event) { for (final ApplicationListener listener : getApplicationListeners(event)) { Executor executor = getTaskExecutor();
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/event/SourceFilteringListener.java
@@ -45,7 +45,7 @@ public class SourceFilteringListener implements SmartApplicationListener { * @param delegate the delegate listener to invoke with event * from the specified source */ - public SourceFilteringListener(Object source, ApplicationListener delegate) { + public SourceFilteringListener(Object source, ApplicationListener<?> delegate) { this.source = source; this.delegate = (delegate instanceof SmartApplicationListener ? (SmartApplicationListener) delegate : new GenericApplicationListenerAdapter(delegate));
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/expression/BeanExpressionContextAccessor.java
@@ -53,8 +53,8 @@ public void write(EvaluationContext context, Object target, String name, Object } @Override - public Class[] getSpecificTargetClasses() { - return new Class[] {BeanExpressionContext.class}; + public Class<?>[] getSpecificTargetClasses() { + return new Class<?>[] {BeanExpressionContext.class}; } }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/expression/BeanFactoryAccessor.java
@@ -53,8 +53,8 @@ public void write(EvaluationContext context, Object target, String name, Object } @Override - public Class[] getSpecificTargetClasses() { - return new Class[] {BeanFactory.class}; + public Class<?>[] getSpecificTargetClasses() { + return new Class<?>[] {BeanFactory.class}; } }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/expression/EnvironmentAccessor.java
@@ -33,7 +33,7 @@ public class EnvironmentAccessor implements PropertyAccessor { @Override public Class<?>[] getSpecificTargetClasses() { - return new Class[] { Environment.class }; + return new Class<?>[] { Environment.class }; } /**
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java
@@ -35,13 +35,13 @@ public class MapAccessor implements PropertyAccessor { @Override public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException { - Map map = (Map) target; + Map<?, ?> map = (Map<?, ?>) target; return map.containsKey(name); } @Override public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { - Map map = (Map) target; + Map<?, ?> map = (Map<?, ?>) target; Object value = map.get(name); if (value == null && !map.containsKey(name)) { throw new MapAccessException(name); @@ -57,13 +57,13 @@ public boolean canWrite(EvaluationContext context, Object target, String name) t @Override @SuppressWarnings("unchecked") public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException { - Map map = (Map) target; + Map<Object, Object> map = (Map<Object, Object>) target; map.put(name, newValue); } @Override - public Class[] getSpecificTargetClasses() { - return new Class[] {Map.class}; + public Class<?>[] getSpecificTargetClasses() { + return new Class<?>[] {Map.class}; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/support/ApplicationObjectSupport.java
@@ -100,7 +100,7 @@ protected boolean isContextRequired() { * Can be overridden in subclasses. * @see #setApplicationContext */ - protected Class requiredContextClass() { + protected Class<?> requiredContextClass() { return ApplicationContext.class; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/support/ClassPathXmlApplicationContext.java
@@ -154,7 +154,7 @@ public ClassPathXmlApplicationContext(String[] configLocations, boolean refresh, * @see org.springframework.context.support.GenericApplicationContext * @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader */ - public ClassPathXmlApplicationContext(String path, Class clazz) throws BeansException { + public ClassPathXmlApplicationContext(String path, Class<?> clazz) throws BeansException { this(new String[] {path}, clazz); } @@ -168,7 +168,7 @@ public ClassPathXmlApplicationContext(String path, Class clazz) throws BeansExce * @see org.springframework.context.support.GenericApplicationContext * @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader */ - public ClassPathXmlApplicationContext(String[] paths, Class clazz) throws BeansException { + public ClassPathXmlApplicationContext(String[] paths, Class<?> clazz) throws BeansException { this(paths, clazz, null); } @@ -184,7 +184,7 @@ public ClassPathXmlApplicationContext(String[] paths, Class clazz) throws BeansE * @see org.springframework.context.support.GenericApplicationContext * @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader */ - public ClassPathXmlApplicationContext(String[] paths, Class clazz, ApplicationContext parent) + public ClassPathXmlApplicationContext(String[] paths, Class<?> clazz, ApplicationContext parent) throws BeansException { super(parent);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/support/ContextTypeMatchClassLoader.java
@@ -42,7 +42,7 @@ class ContextTypeMatchClassLoader extends DecoratingClassLoader implements Smart static { try { - findLoadedClassMethod = ClassLoader.class.getDeclaredMethod("findLoadedClass", new Class[] {String.class}); + findLoadedClassMethod = ClassLoader.class.getDeclaredMethod("findLoadedClass", new Class<?>[] {String.class}); } catch (NoSuchMethodException ex) { throw new IllegalStateException("Invalid [java.lang.ClassLoader] class: no 'findLoadedClass' method defined!"); @@ -59,12 +59,12 @@ public ContextTypeMatchClassLoader(ClassLoader parent) { } @Override - public Class loadClass(String name) throws ClassNotFoundException { + public Class<?> loadClass(String name) throws ClassNotFoundException { return new ContextOverridingClassLoader(getParent()).loadClass(name); } @Override - public boolean isClassReloadable(Class clazz) { + public boolean isClassReloadable(Class<?> clazz) { return (clazz.getClassLoader() instanceof ContextOverridingClassLoader); } @@ -96,7 +96,7 @@ protected boolean isEligibleForOverriding(String className) { } @Override - protected Class loadClassForOverriding(String name) throws ClassNotFoundException { + protected Class<?> loadClassForOverriding(String name) throws ClassNotFoundException { byte[] bytes = bytesCache.get(name); if (bytes == null) { bytes = loadBytesForClass(name);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/support/PostProcessorRegistrationDelegate.java
@@ -371,7 +371,7 @@ else if (flag == null) { public void postProcessBeforeDestruction(Object bean, String beanName) { if (bean instanceof ApplicationListener) { ApplicationEventMulticaster multicaster = this.applicationContext.getApplicationEventMulticaster(); - multicaster.removeApplicationListener((ApplicationListener) bean); + multicaster.removeApplicationListener((ApplicationListener<?>) bean); multicaster.removeApplicationListenerBean(beanName); } }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java
@@ -330,9 +330,9 @@ protected PropertiesHolder getMergedProperties(Locale locale) { Properties mergedProps = new Properties(); mergedHolder = new PropertiesHolder(mergedProps, -1); for (int i = this.basenames.length - 1; i >= 0; i--) { - List filenames = calculateAllFilenames(this.basenames[i], locale); + List<String> filenames = calculateAllFilenames(this.basenames[i], locale); for (int j = filenames.size() - 1; j >= 0; j--) { - String filename = (String) filenames.get(j); + String filename = filenames.get(j); PropertiesHolder propHolder = getProperties(filename); if (propHolder.getProperties() != null) { mergedProps.putAll(propHolder.getProperties());
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/support/SimpleThreadScope.java
@@ -56,7 +56,7 @@ protected Map<String, Object> initialValue() { }; @Override - public Object get(String name, ObjectFactory objectFactory) { + public Object get(String name, ObjectFactory<?> objectFactory) { Map<String, Object> scope = threadScope.get(); Object object = scope.get(name); if (object == null) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/context/support/StaticApplicationContext.java
@@ -89,7 +89,7 @@ public final StaticMessageSource getStaticMessageSource() { * <p>For more advanced needs, register with the underlying BeanFactory directly. * @see #getDefaultListableBeanFactory */ - public void registerSingleton(String name, Class clazz) throws BeansException { + public void registerSingleton(String name, Class<?> clazz) throws BeansException { GenericBeanDefinition bd = new GenericBeanDefinition(); bd.setBeanClass(clazz); getDefaultListableBeanFactory().registerBeanDefinition(name, bd); @@ -100,7 +100,7 @@ public void registerSingleton(String name, Class clazz) throws BeansException { * <p>For more advanced needs, register with the underlying BeanFactory directly. * @see #getDefaultListableBeanFactory */ - public void registerSingleton(String name, Class clazz, MutablePropertyValues pvs) throws BeansException { + public void registerSingleton(String name, Class<?> clazz, MutablePropertyValues pvs) throws BeansException { GenericBeanDefinition bd = new GenericBeanDefinition(); bd.setBeanClass(clazz); bd.setPropertyValues(pvs); @@ -112,7 +112,7 @@ public void registerSingleton(String name, Class clazz, MutablePropertyValues pv * <p>For more advanced needs, register with the underlying BeanFactory directly. * @see #getDefaultListableBeanFactory */ - public void registerPrototype(String name, Class clazz) throws BeansException { + public void registerPrototype(String name, Class<?> clazz) throws BeansException { GenericBeanDefinition bd = new GenericBeanDefinition(); bd.setScope(GenericBeanDefinition.SCOPE_PROTOTYPE); bd.setBeanClass(clazz); @@ -124,7 +124,7 @@ public void registerPrototype(String name, Class clazz) throws BeansException { * <p>For more advanced needs, register with the underlying BeanFactory directly. * @see #getDefaultListableBeanFactory */ - public void registerPrototype(String name, Class clazz, MutablePropertyValues pvs) throws BeansException { + public void registerPrototype(String name, Class<?> clazz, MutablePropertyValues pvs) throws BeansException { GenericBeanDefinition bd = new GenericBeanDefinition(); bd.setScope(GenericBeanDefinition.SCOPE_PROTOTYPE); bd.setBeanClass(clazz);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/ejb/access/AbstractRemoteSlsbInvokerInterceptor.java
@@ -43,7 +43,7 @@ */ public abstract class AbstractRemoteSlsbInvokerInterceptor extends AbstractSlsbInvokerInterceptor { - private Class homeInterface; + private Class<?> homeInterface; private boolean refreshHomeOnConnectFailure = false; @@ -60,7 +60,7 @@ public abstract class AbstractRemoteSlsbInvokerInterceptor extends AbstractSlsbI * sufficient to make a WebSphere 5.0 Remote SLSB work. On other servers, * the specific home interface for the target SLSB might be necessary. */ - public void setHomeInterface(Class homeInterface) { + public void setHomeInterface(Class<?> homeInterface) { if (homeInterface != null && !homeInterface.isInterface()) { throw new IllegalArgumentException( "Home interface class [" + homeInterface.getClass() + "] is not an interface");
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/ejb/access/LocalStatelessSessionProxyFactoryBean.java
@@ -52,7 +52,7 @@ public class LocalStatelessSessionProxyFactoryBean extends LocalSlsbInvokerInter implements FactoryBean<Object>, BeanClassLoaderAware { /** The business interface of the EJB we're proxying */ - private Class businessInterface; + private Class<?> businessInterface; private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); @@ -66,14 +66,14 @@ public class LocalStatelessSessionProxyFactoryBean extends LocalSlsbInvokerInter * Using a business methods interface is a best practice when implementing EJBs. * @param businessInterface set the business interface of the EJB */ - public void setBusinessInterface(Class businessInterface) { + public void setBusinessInterface(Class<?> businessInterface) { this.businessInterface = businessInterface; } /** * Return the business interface of the EJB we're proxying. */ - public Class getBusinessInterface() { + public Class<?> getBusinessInterface() { return this.businessInterface; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/ejb/access/SimpleRemoteStatelessSessionProxyFactoryBean.java
@@ -62,7 +62,7 @@ public class SimpleRemoteStatelessSessionProxyFactoryBean extends SimpleRemoteSl implements FactoryBean<Object>, BeanClassLoaderAware { /** The business interface of the EJB we're proxying */ - private Class businessInterface; + private Class<?> businessInterface; private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); @@ -80,14 +80,14 @@ public class SimpleRemoteStatelessSessionProxyFactoryBean extends SimpleRemoteSl * converted to Spring's generic RemoteAccessException. * @param businessInterface the business interface of the EJB */ - public void setBusinessInterface(Class businessInterface) { + public void setBusinessInterface(Class<?> businessInterface) { this.businessInterface = businessInterface; } /** * Return the business interface of the EJB we're proxying. */ - public Class getBusinessInterface() { + public Class<?> getBusinessInterface() { return this.businessInterface; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/ejb/config/JndiLookupBeanDefinitionParser.java
@@ -43,7 +43,7 @@ class JndiLookupBeanDefinitionParser extends AbstractJndiLocatingBeanDefinitionP @Override - protected Class getBeanClass(Element element) { + protected Class<?> getBeanClass(Element element) { return JndiObjectFactoryBean.class; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/format/support/FormattingConversionService.java
@@ -206,12 +206,13 @@ private class AnnotationPrinterConverter implements ConditionalGenericConverter private Class<? extends Annotation> annotationType; - private AnnotationFormatterFactory annotationFormatterFactory; + @SuppressWarnings("rawtypes") + private AnnotationFormatterFactory annotationFormatterFactory; private Class<?> fieldType; public AnnotationPrinterConverter(Class<? extends Annotation> annotationType, - AnnotationFormatterFactory annotationFormatterFactory, Class<?> fieldType) { + AnnotationFormatterFactory<?> annotationFormatterFactory, Class<?> fieldType) { this.annotationType = annotationType; this.annotationFormatterFactory = annotationFormatterFactory; this.fieldType = fieldType; @@ -254,6 +255,7 @@ private class AnnotationParserConverter implements ConditionalGenericConverter { private Class<? extends Annotation> annotationType; + @SuppressWarnings("rawtypes") private AnnotationFormatterFactory annotationFormatterFactory; private Class<?> fieldType;
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/instrument/classloading/ReflectiveLoadTimeWeaver.java
@@ -98,14 +98,14 @@ public ReflectiveLoadTimeWeaver(ClassLoader classLoader) { this.classLoader = classLoader; this.addTransformerMethod = ClassUtils.getMethodIfAvailable( this.classLoader.getClass(), ADD_TRANSFORMER_METHOD_NAME, - new Class[] {ClassFileTransformer.class}); + new Class<?>[] {ClassFileTransformer.class}); if (this.addTransformerMethod == null) { throw new IllegalStateException( "ClassLoader [" + classLoader.getClass().getName() + "] does NOT provide an " + "'addTransformer(ClassFileTransformer)' method."); } this.getThrowawayClassLoaderMethod = ClassUtils.getMethodIfAvailable( - this.classLoader.getClass(), GET_THROWAWAY_CLASS_LOADER_METHOD_NAME, new Class[0]); + this.classLoader.getClass(), GET_THROWAWAY_CLASS_LOADER_METHOD_NAME, new Class<?>[0]); // getThrowawayClassLoader method is optional if (this.getThrowawayClassLoaderMethod == null) { if (logger.isInfoEnabled()) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/instrument/classloading/ShadowingClassLoader.java
@@ -56,7 +56,7 @@ public class ShadowingClassLoader extends DecoratingClassLoader { private final List<ClassFileTransformer> classFileTransformers = new LinkedList<ClassFileTransformer>(); - private final Map<String, Class> classCache = new HashMap<String, Class>(); + private final Map<String, Class<?>> classCache = new HashMap<String, Class<?>>(); /** @@ -96,7 +96,7 @@ public void copyTransformers(ShadowingClassLoader other) { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { if (shouldShadow(name)) { - Class cls = this.classCache.get(name); + Class<?> cls = this.classCache.get(name); if (cls != null) { return cls; } @@ -129,7 +129,7 @@ protected boolean isEligibleForShadowing(String className) { } - private Class doLoadClass(String name) throws ClassNotFoundException { + private Class<?> doLoadClass(String name) throws ClassNotFoundException { String internalName = StringUtils.replace(name, ".", "/") + ".class"; InputStream is = this.enclosingClassLoader.getResourceAsStream(internalName); if (is == null) { @@ -138,7 +138,7 @@ private Class doLoadClass(String name) throws ClassNotFoundException { try { byte[] bytes = FileCopyUtils.copyToByteArray(is); bytes = applyTransformers(name, bytes); - Class cls = defineClass(name, bytes, 0, bytes.length); + Class<?> cls = defineClass(name, bytes, 0, bytes.length); // Additional check for defining the package, if not defined yet. if (cls.getPackage() == null) { int packageSeparator = name.lastIndexOf('.');
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/instrument/classloading/jboss/JBossMCAdapter.java
@@ -131,7 +131,7 @@ class JBossMCAdapter implements JBossClassLoaderAdapter { public void addTransformer(ClassFileTransformer transformer) { InvocationHandler adapter = new JBossMCTranslatorAdapter(transformer); Object adapterInstance = Proxy.newProxyInstance(this.translatorClass.getClassLoader(), - new Class[] { this.translatorClass }, adapter); + new Class<?>[] { this.translatorClass }, adapter); try { addTranslator.invoke(target, adapterInstance);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassLoaderAdapter.java
@@ -43,19 +43,19 @@ class WebLogicClassLoaderAdapter { private final ClassLoader classLoader; - private final Class wlPreProcessorClass; + private final Class<?> wlPreProcessorClass; private final Method addPreProcessorMethod; private final Method getClassFinderMethod; private final Method getParentMethod; - private final Constructor wlGenericClassLoaderConstructor; + private final Constructor<?> wlGenericClassLoaderConstructor; public WebLogicClassLoaderAdapter(ClassLoader classLoader) { - Class wlGenericClassLoaderClass = null; + Class<?> wlGenericClassLoaderClass = null; try { wlGenericClassLoaderClass = classLoader.loadClass(GENERIC_CLASS_LOADER_NAME); this.wlPreProcessorClass = classLoader.loadClass(CLASS_PRE_PROCESSOR_NAME); @@ -81,7 +81,7 @@ public void addTransformer(ClassFileTransformer transformer) { try { InvocationHandler adapter = new WebLogicClassPreProcessorAdapter(transformer, this.classLoader); Object adapterInstance = Proxy.newProxyInstance(this.wlPreProcessorClass.getClassLoader(), - new Class[] {this.wlPreProcessorClass}, adapter); + new Class<?>[] {this.wlPreProcessorClass}, adapter); this.addPreProcessorMethod.invoke(this.classLoader, adapterInstance); } catch (InvocationTargetException ex) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/instrument/classloading/weblogic/WebLogicClassPreProcessorAdapter.java
@@ -60,7 +60,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl } else if ("toString".equals(name)) { return toString(); } else if ("initialize".equals(name)) { - initialize((Hashtable) args[0]); + initialize((Hashtable<?, ?>) args[0]); return null; } else if ("preProcess".equals(name)) { return preProcess((String) args[0], (byte[]) args[1]); @@ -69,7 +69,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl } } - public void initialize(Hashtable params) { + public void initialize(Hashtable<?, ?> params) { } public byte[] preProcess(String className, byte[] classBytes) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassLoaderAdapter.java
@@ -79,7 +79,7 @@ public void addTransformer(ClassFileTransformer transformer) { try { InvocationHandler adapter = new WebSphereClassPreDefinePlugin(transformer); Object adapterInstance = Proxy.newProxyInstance(this.wsPreProcessorClass.getClassLoader(), - new Class[] { this.wsPreProcessorClass }, adapter); + new Class<?>[] { this.wsPreProcessorClass }, adapter); this.addPreDefinePlugin.invoke(this.classLoader, adapterInstance); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java
@@ -107,7 +107,7 @@ private boolean useStrictCasing = true; - private Class managementInterface; + private Class<?> managementInterface; private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); @@ -215,15 +215,15 @@ public void setUseStrictCasing(boolean useStrictCasing) { * setters and getters for MBean attributes and conventional Java methods * for MBean operations. */ - public void setManagementInterface(Class managementInterface) { + public void setManagementInterface(Class<?> managementInterface) { this.managementInterface = managementInterface; } /** * Return the management interface of the target MBean, * or {@code null} if none specified. */ - protected final Class getManagementInterface() { + protected final Class<?> getManagementInterface() { return this.managementInterface; } @@ -299,7 +299,7 @@ private void retrieveMBeanInfo() throws MBeanInfoRetrievalException { MBeanOperationInfo[] operationInfo = info.getOperations(); this.allowedOperations = new HashMap<MethodCacheKey, MBeanOperationInfo>(operationInfo.length); for (MBeanOperationInfo infoEle : operationInfo) { - Class[] paramTypes = JmxUtils.parameterInfoToTypes(infoEle.getSignature(), this.beanClassLoader); + Class<?>[] paramTypes = JmxUtils.parameterInfoToTypes(infoEle.getSignature(), this.beanClassLoader); this.allowedOperations.put(new MethodCacheKey(infoEle.getName(), paramTypes), infoEle); } } @@ -534,7 +534,7 @@ private Object invokeOperation(Method method, Object[] args) throws JMException, * is necessary */ protected Object convertResultValueIfNecessary(Object result, MethodParameter parameter) { - Class targetClass = parameter.getParameterType(); + Class<?> targetClass = parameter.getParameterType(); try { if (result == null) { return null; @@ -552,7 +552,7 @@ else if (result instanceof CompositeData[]) { return convertDataArrayToTargetArray(array, targetClass); } else if (Collection.class.isAssignableFrom(targetClass)) { - Class elementType = GenericCollectionTypeResolver.getCollectionParameterType(parameter); + Class<?> elementType = GenericCollectionTypeResolver.getCollectionParameterType(parameter); if (elementType != null) { return convertDataArrayToTargetCollection(array, targetClass, elementType); } @@ -568,7 +568,7 @@ else if (result instanceof TabularData[]) { return convertDataArrayToTargetArray(array, targetClass); } else if (Collection.class.isAssignableFrom(targetClass)) { - Class elementType = GenericCollectionTypeResolver.getCollectionParameterType(parameter); + Class<?> elementType = GenericCollectionTypeResolver.getCollectionParameterType(parameter); if (elementType != null) { return convertDataArrayToTargetCollection(array, targetClass, elementType); } @@ -584,8 +584,8 @@ else if (Collection.class.isAssignableFrom(targetClass)) { } } - private Object convertDataArrayToTargetArray(Object[] array, Class targetClass) throws NoSuchMethodException { - Class targetType = targetClass.getComponentType(); + private Object convertDataArrayToTargetArray(Object[] array, Class<?> targetClass) throws NoSuchMethodException { + Class<?> targetType = targetClass.getComponentType(); Method fromMethod = targetType.getMethod("from", array.getClass().getComponentType()); Object resultArray = Array.newInstance(targetType, array.length); for (int i = 0; i < array.length; i++) { @@ -594,12 +594,11 @@ private Object convertDataArrayToTargetArray(Object[] array, Class targetClass) return resultArray; } - @SuppressWarnings("unchecked") - private Collection convertDataArrayToTargetCollection(Object[] array, Class collectionType, Class elementType) + private Collection<?> convertDataArrayToTargetCollection(Object[] array, Class<?> collectionType, Class<?> elementType) throws NoSuchMethodException { Method fromMethod = elementType.getMethod("from", array.getClass().getComponentType()); - Collection resultColl = CollectionFactory.createCollection(collectionType, Array.getLength(array)); + Collection<Object> resultColl = CollectionFactory.createCollection(collectionType, Array.getLength(array)); for (int i = 0; i < array.length; i++) { resultColl.add(ReflectionUtils.invokeMethod(fromMethod, null, array[i])); } @@ -620,17 +619,17 @@ private static class MethodCacheKey { private final String name; - private final Class[] parameterTypes; + private final Class<?>[] parameterTypes; /** * Create a new instance of {@code MethodCacheKey} with the supplied * method name and parameter list. * @param name the name of the method * @param parameterTypes the arguments in the method signature */ - public MethodCacheKey(String name, Class[] parameterTypes) { + public MethodCacheKey(String name, Class<?>[] parameterTypes) { this.name = name; - this.parameterTypes = (parameterTypes != null ? parameterTypes : new Class[0]); + this.parameterTypes = (parameterTypes != null ? parameterTypes : new Class<?>[0]); } @Override
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/access/MBeanProxyFactoryBean.java
@@ -48,7 +48,7 @@ public class MBeanProxyFactoryBean extends MBeanClientInterceptor implements FactoryBean<Object>, BeanClassLoaderAware, InitializingBean { - private Class proxyInterface; + private Class<?> proxyInterface; private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader(); @@ -62,7 +62,7 @@ public class MBeanProxyFactoryBean extends MBeanClientInterceptor * conventional Java methods for MBean operations. * @see #setObjectName */ - public void setProxyInterface(Class proxyInterface) { + public void setProxyInterface(Class<?> proxyInterface) { this.proxyInterface = proxyInterface; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java
@@ -25,6 +25,7 @@ import java.util.List; import java.util.Map; import java.util.Set; + import javax.management.DynamicMBean; import javax.management.JMException; import javax.management.MBeanException; @@ -746,7 +747,7 @@ protected ObjectName getObjectName(Object bean, String beanKey) throws Malformed * @return whether the class qualifies as an MBean * @see org.springframework.jmx.support.JmxUtils#isMBean(Class) */ - protected boolean isMBean(Class beanClass) { + protected boolean isMBean(Class<?> beanClass) { return JmxUtils.isMBean(beanClass); } @@ -760,9 +761,9 @@ protected boolean isMBean(Class beanClass) { */ @SuppressWarnings("unchecked") protected DynamicMBean adaptMBeanIfPossible(Object bean) throws JMException { - Class targetClass = AopUtils.getTargetClass(bean); + Class<?> targetClass = AopUtils.getTargetClass(bean); if (targetClass != bean.getClass()) { - Class ifc = JmxUtils.getMXBeanInterface(targetClass); + Class<Object> ifc = (Class<Object>) JmxUtils.getMXBeanInterface(targetClass); if (ifc != null) { if (!(ifc.isInstance(bean))) { throw new NotCompliantMBeanException("Managed bean [" + bean + @@ -771,7 +772,7 @@ protected DynamicMBean adaptMBeanIfPossible(Object bean) throws JMException { return new StandardMBean(bean, ifc, true); } else { - ifc = JmxUtils.getMBeanInterface(targetClass); + ifc = (Class<Object>) JmxUtils.getMBeanInterface(targetClass); if (ifc != null) { if (!(ifc.isInstance(bean))) { throw new NotCompliantMBeanException("Managed bean [" + bean + @@ -848,7 +849,7 @@ private ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws J private void autodetectBeans(final AutodetectCapableMBeanInfoAssembler assembler) { autodetect(new AutodetectCallback() { @Override - public boolean include(Class beanClass, String beanName) { + public boolean include(Class<?> beanClass, String beanName) { return assembler.includeBean(beanClass, beanName); } }); @@ -861,7 +862,7 @@ public boolean include(Class beanClass, String beanName) { private void autodetectMBeans() { autodetect(new AutodetectCallback() { @Override - public boolean include(Class beanClass, String beanName) { + public boolean include(Class<?> beanClass, String beanName) { return isMBean(beanClass); } }); @@ -883,7 +884,7 @@ private void autodetect(AutodetectCallback callback) { for (String beanName : beanNames) { if (!isExcluded(beanName) && !isBeanDefinitionAbstract(this.beanFactory, beanName)) { try { - Class beanClass = this.beanFactory.getType(beanName); + Class<?> beanClass = this.beanFactory.getType(beanName); if (beanClass != null && callback.include(beanClass, beanName)) { boolean lazyInit = isBeanDefinitionLazyInit(this.beanFactory, beanName); Object beanInstance = (!lazyInit ? this.beanFactory.getBean(beanName) : null); @@ -1069,7 +1070,7 @@ private static interface AutodetectCallback { * @param beanClass the class of the bean * @param beanName the name of the bean */ - boolean include(Class beanClass, String beanName); + boolean include(Class<?> beanClass, String beanName); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractConfigurableMBeanInfoAssembler.java
@@ -77,7 +77,7 @@ private ModelMBeanNotificationInfo[] extractNotificationMetadata(Object mapValue return new ModelMBeanNotificationInfo[] {JmxMetadataUtils.convertToModelMBeanNotificationInfo(mn)}; } else if (mapValue instanceof Collection) { - Collection col = (Collection) mapValue; + Collection<?> col = (Collection<?>) mapValue; List<ModelMBeanNotificationInfo> result = new ArrayList<ModelMBeanNotificationInfo>(); for (Object colValue : col) { if (!(colValue instanceof ManagedNotification)) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractMBeanInfoAssembler.java
@@ -91,7 +91,7 @@ protected void checkManagedBean(Object managedBean) throws IllegalArgumentExcept * @return the bean class to expose * @see org.springframework.aop.support.AopUtils#getTargetClass(Object) */ - protected Class getTargetClass(Object managedBean) { + protected Class<?> getTargetClass(Object managedBean) { return AopUtils.getTargetClass(managedBean); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/assembler/AbstractReflectiveMBeanInfoAssembler.java
@@ -434,7 +434,7 @@ protected ModelMBeanOperationInfo createModelMBeanOperationInfo(Method method, S * @see #getClassToExpose(Class) * @see org.springframework.aop.framework.AopProxyUtils#proxiedUserInterfaces(Object) */ - protected Class getClassForDescriptor(Object managedBean) { + protected Class<?> getClassForDescriptor(Object managedBean) { if (AopUtils.isJdkDynamicProxy(managedBean)) { return AopProxyUtils.proxiedUserInterfaces(managedBean)[0]; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssembler.java
@@ -63,7 +63,7 @@ public class InterfaceBasedMBeanInfoAssembler extends AbstractConfigurableMBeanI /** * Stores the array of interfaces to use for creating the management interface. */ - private Class[] managedInterfaces; + private Class<?>[] managedInterfaces; /** * Stores the mappings of bean keys to an array of {@code Class}es. @@ -75,7 +75,7 @@ public class InterfaceBasedMBeanInfoAssembler extends AbstractConfigurableMBeanI /** * Stores the mappings of bean keys to an array of {@code Class}es. */ - private Map<String, Class[]> resolvedInterfaceMappings; + private Map<String, Class<?>[]> resolvedInterfaceMappings; /** @@ -86,7 +86,7 @@ public class InterfaceBasedMBeanInfoAssembler extends AbstractConfigurableMBeanI * Each entry <strong>MUST</strong> be an interface. * @see #setInterfaceMappings */ - public void setManagedInterfaces(Class[] managedInterfaces) { + public void setManagedInterfaces(Class<?>[] managedInterfaces) { if (managedInterfaces != null) { for (Class<?> ifc : managedInterfaces) { if (!ifc.isInterface()) { @@ -127,12 +127,12 @@ public void afterPropertiesSet() { * @param mappings the specified interface mappings * @return the resolved interface mappings (with Class objects as values) */ - private Map<String, Class[]> resolveInterfaceMappings(Properties mappings) { - Map<String, Class[]> resolvedMappings = new HashMap<String, Class[]>(mappings.size()); - for (Enumeration en = mappings.propertyNames(); en.hasMoreElements();) { + private Map<String, Class<?>[]> resolveInterfaceMappings(Properties mappings) { + Map<String, Class<?>[]> resolvedMappings = new HashMap<String, Class<?>[]>(mappings.size()); + for (Enumeration<?> en = mappings.propertyNames(); en.hasMoreElements();) { String beanKey = (String) en.nextElement(); String[] classNames = StringUtils.commaDelimitedListToStringArray(mappings.getProperty(beanKey)); - Class[] classes = resolveClassNames(classNames, beanKey); + Class<?>[] classes = resolveClassNames(classNames, beanKey); resolvedMappings.put(beanKey, classes); } return resolvedMappings; @@ -144,10 +144,10 @@ private Map<String, Class[]> resolveInterfaceMappings(Properties mappings) { * @param beanKey the bean key that the class names are associated with * @return the resolved Class */ - private Class[] resolveClassNames(String[] classNames, String beanKey) { - Class[] classes = new Class[classNames.length]; + private Class<?>[] resolveClassNames(String[] classNames, String beanKey) { + Class<?>[] classes = new Class<?>[classNames.length]; for (int x = 0; x < classes.length; x++) { - Class cls = ClassUtils.resolveClassName(classNames[x].trim(), this.beanClassLoader); + Class<?> cls = ClassUtils.resolveClassName(classNames[x].trim(), this.beanClassLoader); if (!cls.isInterface()) { throw new IllegalArgumentException( "Class [" + classNames[x] + "] mapped to bean key [" + beanKey + "] is no interface"); @@ -217,7 +217,7 @@ private boolean isPublicInInterface(Method method, String beanKey) { * interface for the given bean. */ private boolean isDeclaredInInterface(Method method, String beanKey) { - Class[] ifaces = null; + Class<?>[] ifaces = null; if (this.resolvedInterfaceMappings != null) { ifaces = this.resolvedInterfaceMappings.get(beanKey); @@ -231,7 +231,7 @@ private boolean isDeclaredInInterface(Method method, String beanKey) { } if (ifaces != null) { - for (Class ifc : ifaces) { + for (Class<?> ifc : ifaces) { for (Method ifcMethod : ifc.getMethods()) { if (ifcMethod.getName().equals(method.getName()) && Arrays.equals(ifcMethod.getParameterTypes(), method.getParameterTypes())) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java
@@ -263,7 +263,7 @@ protected MBeanParameterInfo[] getOperationParameters(Method method, String bean } MBeanParameterInfo[] parameterInfo = new MBeanParameterInfo[params.length]; - Class[] methodParameters = method.getParameterTypes(); + Class<?>[] methodParameters = method.getParameterTypes(); for (int i = 0; i < params.length; i++) { ManagedOperationParameter param = params[i]; parameterInfo[i] =
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssembler.java
@@ -81,7 +81,7 @@ public void setIgnoredMethods(String[] ignoredMethodNames) { */ public void setIgnoredMethodMappings(Properties mappings) { this.ignoredMethodMappings = new HashMap<String, Set<String>>(); - for (Enumeration en = mappings.keys(); en.hasMoreElements();) { + for (Enumeration<?> en = mappings.keys(); en.hasMoreElements();) { String beanKey = (String) en.nextElement(); String[] methodNames = StringUtils.commaDelimitedListToStringArray(mappings.getProperty(beanKey)); this.ignoredMethodMappings.put(beanKey, new HashSet<String>(Arrays.asList(methodNames)));
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodNameBasedMBeanInfoAssembler.java
@@ -85,7 +85,7 @@ public void setManagedMethods(String[] methodNames) { */ public void setMethodMappings(Properties mappings) { this.methodMappings = new HashMap<String, Set<String>>(); - for (Enumeration en = mappings.keys(); en.hasMoreElements();) { + for (Enumeration<?> en = mappings.keys(); en.hasMoreElements();) { String beanKey = (String) en.nextElement(); String[] methodNames = StringUtils.commaDelimitedListToStringArray(mappings.getProperty(beanKey)); this.methodMappings.put(beanKey, new HashSet<String>(Arrays.asList(methodNames)));
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/naming/IdentityNamingStrategy.java
@@ -50,7 +50,7 @@ public class IdentityNamingStrategy implements ObjectNamingStrategy { @Override public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException { String domain = ClassUtils.getPackageName(managedBean.getClass()); - Hashtable keys = new Hashtable(); + Hashtable<String, String> keys = new Hashtable<String, String>(); keys.put(TYPE_KEY, ClassUtils.getShortName(managedBean.getClass())); keys.put(HASH_CODE_KEY, ObjectUtils.getIdentityHexString(managedBean)); return ObjectNameManager.getInstance(domain, keys);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/export/naming/MetadataNamingStrategy.java
@@ -108,7 +108,7 @@ public void afterPropertiesSet() { */ @Override public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException { - Class managedClass = AopUtils.getTargetClass(managedBean); + Class<?> managedClass = AopUtils.getTargetClass(managedBean); ManagedResource mr = this.attributeSource.getManagedResource(managedClass); // Check that an object name has been specified.
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/support/JmxUtils.java
@@ -145,7 +145,7 @@ public static MBeanServer locateMBeanServer(String agentId) throws MBeanServerNo * @return the parameter types as classes * @throws ClassNotFoundException if a parameter type could not be resolved */ - public static Class[] parameterInfoToTypes(MBeanParameterInfo[] paramInfo) throws ClassNotFoundException { + public static Class<?>[] parameterInfoToTypes(MBeanParameterInfo[] paramInfo) throws ClassNotFoundException { return parameterInfoToTypes(paramInfo, ClassUtils.getDefaultClassLoader()); } @@ -157,12 +157,12 @@ public static Class[] parameterInfoToTypes(MBeanParameterInfo[] paramInfo) throw * @return the parameter types as classes * @throws ClassNotFoundException if a parameter type could not be resolved */ - public static Class[] parameterInfoToTypes(MBeanParameterInfo[] paramInfo, ClassLoader classLoader) + public static Class<?>[] parameterInfoToTypes(MBeanParameterInfo[] paramInfo, ClassLoader classLoader) throws ClassNotFoundException { - Class[] types = null; + Class<?>[] types = null; if (paramInfo != null && paramInfo.length > 0) { - types = new Class[paramInfo.length]; + types = new Class<?>[paramInfo.length]; for (int x = 0; x < paramInfo.length; x++) { types[x] = ClassUtils.forName(paramInfo[x].getType(), classLoader); } @@ -178,7 +178,7 @@ public static Class[] parameterInfoToTypes(MBeanParameterInfo[] paramInfo, Class * @return the signature as array of argument types */ public static String[] getMethodSignature(Method method) { - Class[] types = method.getParameterTypes(); + Class<?>[] types = method.getParameterTypes(); String[] signature = new String[types.length]; for (int x = 0; x < types.length; x++) { signature[x] = types[x].getName(); @@ -282,7 +282,7 @@ public static Class<?> getMBeanInterface(Class<?> clazz) { return null; } String mbeanInterfaceName = clazz.getName() + MBEAN_SUFFIX; - Class[] implementedInterfaces = clazz.getInterfaces(); + Class<?>[] implementedInterfaces = clazz.getInterfaces(); for (Class<?> iface : implementedInterfaces) { if (iface.getName().equals(mbeanInterfaceName)) { return iface; @@ -302,7 +302,7 @@ public static Class<?> getMXBeanInterface(Class<?> clazz) { if (clazz == null || clazz.getSuperclass() == null) { return null; } - Class[] implementedInterfaces = clazz.getInterfaces(); + Class<?>[] implementedInterfaces = clazz.getInterfaces(); for (Class<?> iface : implementedInterfaces) { boolean isMxBean = iface.getName().endsWith(MXBEAN_SUFFIX); if (mxBeanAnnotationAvailable) {
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jmx/support/WebSphereMBeanServerFactoryBean.java
@@ -61,7 +61,7 @@ public void afterPropertiesSet() throws MBeanServerNotFoundException { /* * this.mbeanServer = AdminServiceFactory.getMBeanFactory().getMBeanServer(); */ - Class adminServiceClass = getClass().getClassLoader().loadClass(ADMIN_SERVICE_FACTORY_CLASS); + Class<?> adminServiceClass = getClass().getClassLoader().loadClass(ADMIN_SERVICE_FACTORY_CLASS); Method getMBeanFactoryMethod = adminServiceClass.getMethod(GET_MBEAN_FACTORY_METHOD); Object mbeanFactory = getMBeanFactoryMethod.invoke(null); Method getMBeanServerMethod = mbeanFactory.getClass().getMethod(GET_MBEAN_SERVER_METHOD);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jndi/JndiObjectTargetSource.java
@@ -66,7 +66,7 @@ public class JndiObjectTargetSource extends JndiObjectLocator implements TargetS private Object cachedObject; - private Class targetClass; + private Class<?> targetClass; /**
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jndi/JndiTemplate.java
@@ -127,10 +127,10 @@ public void releaseContext(Context ctx) { * @throws NamingException in case of initialization errors */ protected Context createInitialContext() throws NamingException { - Hashtable icEnv = null; + Hashtable<?, ?> icEnv = null; Properties env = getEnvironment(); if (env != null) { - icEnv = new Hashtable(env.size()); + icEnv = new Hashtable<Object, Object>(env.size()); CollectionUtils.mergePropertiesIntoMap(env, icEnv); } return new InitialContext(icEnv);
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jndi/TypeMismatchNamingException.java
@@ -29,9 +29,9 @@ @SuppressWarnings("serial") public class TypeMismatchNamingException extends NamingException { - private Class requiredType; + private Class<?> requiredType; - private Class actualType; + private Class<?> actualType; /** @@ -41,7 +41,7 @@ public class TypeMismatchNamingException extends NamingException { * @param requiredType the required type for the lookup * @param actualType the actual type that the lookup returned */ - public TypeMismatchNamingException(String jndiName, Class requiredType, Class actualType) { + public TypeMismatchNamingException(String jndiName, Class<?> requiredType, Class<?> actualType) { super("Object of type [" + actualType + "] available at JNDI location [" + jndiName + "] is not assignable to [" + requiredType.getName() + "]"); this.requiredType = requiredType; @@ -60,14 +60,14 @@ public TypeMismatchNamingException(String explanation) { /** * Return the required type for the lookup, if available. */ - public final Class getRequiredType() { + public final Class<?> getRequiredType() { return this.requiredType; } /** * Return the actual type that the lookup returned, if available. */ - public final Class getActualType() { + public final Class<?> getActualType() { return this.actualType; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/jndi/support/SimpleJndiBeanFactory.java
@@ -66,7 +66,7 @@ public class SimpleJndiBeanFactory extends JndiLocatorSupport implements BeanFac private final Map<String, Object> singletonObjects = new HashMap<String, Object>(); /** Cache of the types of nonshareable resources: bean name --> bean type */ - private final Map<String, Class> resourceTypes = new HashMap<String, Class>(); + private final Map<String, Class<?>> resourceTypes = new HashMap<String, Class<?>>(); public SimpleJndiBeanFactory() { @@ -165,8 +165,8 @@ public boolean isPrototype(String name) throws NoSuchBeanDefinitionException { } @Override - public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException { - Class type = getType(name); + public boolean isTypeMatch(String name, Class<?> targetType) throws NoSuchBeanDefinitionException { + Class<?> type = getType(name); return (targetType == null || (type != null && targetType.isAssignableFrom(type))); } @@ -206,7 +206,7 @@ private <T> T doGetSingleton(String name, Class<T> requiredType) throws NamingEx } } - private Class doGetType(String name) throws NamingException { + private Class<?> doGetType(String name) throws NamingException { if (isSingleton(name)) { Object jndiObject = doGetSingleton(name, null); return (jndiObject != null ? jndiObject.getClass() : null); @@ -218,7 +218,7 @@ private Class doGetType(String name) throws NamingException { } else { Object jndiObject = lookup(name, null); - Class type = (jndiObject != null ? jndiObject.getClass() : null); + Class<?> type = (jndiObject != null ? jndiObject.getClass() : null); this.resourceTypes.put(name, type); return type; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/remoting/rmi/CodebaseAwareObjectInputStream.java
@@ -100,7 +100,7 @@ public CodebaseAwareObjectInputStream( @Override - protected Class resolveFallbackIfPossible(String className, ClassNotFoundException ex) + protected Class<?> resolveFallbackIfPossible(String className, ClassNotFoundException ex) throws IOException, ClassNotFoundException { // If codebaseUrl is set, try to load the class with the RMIClassLoader.
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/remoting/rmi/JndiRmiClientInterceptor.java
@@ -78,7 +78,7 @@ */ public class JndiRmiClientInterceptor extends JndiObjectLocator implements MethodInterceptor, InitializingBean { - private Class serviceInterface; + private Class<?> serviceInterface; private RemoteInvocationFactory remoteInvocationFactory = new DefaultRemoteInvocationFactory(); @@ -101,7 +101,7 @@ public class JndiRmiClientInterceptor extends JndiObjectLocator implements Metho * <p>Typically required to be able to create a suitable service proxy, * but can also be optional if the lookup returns a typed stub. */ - public void setServiceInterface(Class serviceInterface) { + public void setServiceInterface(Class<?> serviceInterface) { if (serviceInterface != null && !serviceInterface.isInterface()) { throw new IllegalArgumentException("'serviceInterface' must be an interface"); } @@ -111,7 +111,7 @@ public void setServiceInterface(Class serviceInterface) { /** * Return the interface of the service to access. */ - public Class getServiceInterface() { + public Class<?> getServiceInterface() { return this.serviceInterface; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/remoting/rmi/RmiInvocationWrapper.java
@@ -59,7 +59,7 @@ public RmiInvocationWrapper(Object wrappedObject, RmiBasedExporter rmiExporter) */ @Override public String getTargetInterfaceName() { - Class ifc = this.rmiExporter.getServiceInterface(); + Class<?> ifc = this.rmiExporter.getServiceInterface(); return (ifc != null ? ifc.getName() : null); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/remoting/support/RemoteAccessor.java
@@ -36,7 +36,7 @@ */ public abstract class RemoteAccessor extends RemotingSupport { - private Class serviceInterface; + private Class<?> serviceInterface; /** @@ -45,7 +45,7 @@ public abstract class RemoteAccessor extends RemotingSupport { * <p>Typically required to be able to create a suitable service proxy, * but can also be optional if the lookup returns a typed proxy. */ - public void setServiceInterface(Class serviceInterface) { + public void setServiceInterface(Class<?> serviceInterface) { if (serviceInterface != null && !serviceInterface.isInterface()) { throw new IllegalArgumentException("'serviceInterface' must be an interface"); } @@ -55,7 +55,7 @@ public void setServiceInterface(Class serviceInterface) { /** * Return the interface of the service to access. */ - public Class getServiceInterface() { + public Class<?> getServiceInterface() { return this.serviceInterface; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/remoting/support/RemoteExporter.java
@@ -36,7 +36,7 @@ public abstract class RemoteExporter extends RemotingSupport { private Object service; - private Class serviceInterface; + private Class<?> serviceInterface; private Boolean registerTraceInterceptor; @@ -62,7 +62,7 @@ public Object getService() { * Set the interface of the service to export. * The interface must be suitable for the particular service and remoting strategy. */ - public void setServiceInterface(Class serviceInterface) { + public void setServiceInterface(Class<?> serviceInterface) { if (serviceInterface != null && !serviceInterface.isInterface()) { throw new IllegalArgumentException("'serviceInterface' must be an interface"); } @@ -72,7 +72,7 @@ public void setServiceInterface(Class serviceInterface) { /** * Return the interface of the service to export. */ - public Class getServiceInterface() { + public Class<?> getServiceInterface() { return this.serviceInterface; } @@ -122,7 +122,7 @@ protected void checkService() throws IllegalArgumentException { * @see #setService */ protected void checkServiceInterface() throws IllegalArgumentException { - Class serviceInterface = getServiceInterface(); + Class<?> serviceInterface = getServiceInterface(); Object service = getService(); if (serviceInterface == null) { throw new IllegalArgumentException("Property 'serviceInterface' is required");
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/remoting/support/RemoteInvocation.java
@@ -51,7 +51,7 @@ public class RemoteInvocation implements Serializable { private String methodName; - private Class[] parameterTypes; + private Class<?>[] parameterTypes; private Object[] arguments; @@ -70,7 +70,7 @@ public RemoteInvocation() { * @param parameterTypes the parameter types of the method * @param arguments the arguments for the invocation */ - public RemoteInvocation(String methodName, Class[] parameterTypes, Object[] arguments) { + public RemoteInvocation(String methodName, Class<?>[] parameterTypes, Object[] arguments) { this.methodName = methodName; this.parameterTypes = parameterTypes; this.arguments = arguments; @@ -104,14 +104,14 @@ public String getMethodName() { /** * Set the parameter types of the target method. */ - public void setParameterTypes(Class[] parameterTypes) { + public void setParameterTypes(Class<?>[] parameterTypes) { this.parameterTypes = parameterTypes; } /** * Return the parameter types of the target method. */ - public Class[] getParameterTypes() { + public Class<?>[] getParameterTypes() { return this.parameterTypes; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/scheduling/TaskScheduler.java
@@ -62,7 +62,7 @@ public interface TaskScheduler { * for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress) * @see org.springframework.scheduling.support.CronTrigger */ - ScheduledFuture schedule(Runnable task, Trigger trigger); + ScheduledFuture<?> schedule(Runnable task, Trigger trigger); /** * Schedule the given {@link Runnable}, invoking it at the specified execution time. @@ -75,7 +75,7 @@ public interface TaskScheduler { * @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted * for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress) */ - ScheduledFuture schedule(Runnable task, Date startTime); + ScheduledFuture<?> schedule(Runnable task, Date startTime); /** * Schedule the given {@link Runnable}, invoking it at the specified execution time @@ -90,7 +90,7 @@ public interface TaskScheduler { * @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted * for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress) */ - ScheduledFuture scheduleAtFixedRate(Runnable task, Date startTime, long period); + ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Date startTime, long period); /** * Schedule the given {@link Runnable}, starting as soon as possible and @@ -103,7 +103,7 @@ public interface TaskScheduler { * @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted * for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress) */ - ScheduledFuture scheduleAtFixedRate(Runnable task, long period); + ScheduledFuture<?> scheduleAtFixedRate(Runnable task, long period); /** * Schedule the given {@link Runnable}, invoking it at the specified execution time @@ -120,7 +120,7 @@ public interface TaskScheduler { * @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted * for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress) */ - ScheduledFuture scheduleWithFixedDelay(Runnable task, Date startTime, long delay); + ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Date startTime, long delay); /** * Schedule the given {@link Runnable}, starting as soon as possible and @@ -134,6 +134,6 @@ public interface TaskScheduler { * @throws org.springframework.core.task.TaskRejectedException if the given task was not accepted * for internal reasons (e.g. a pool overload handling policy or a pool shutdown in progress) */ - ScheduledFuture scheduleWithFixedDelay(Runnable task, long delay); + ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long delay); }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java
@@ -160,7 +160,7 @@ public void setErrorHandler(ErrorHandler errorHandler) { @Override - public ScheduledFuture schedule(Runnable task, Trigger trigger) { + public ScheduledFuture<?> schedule(Runnable task, Trigger trigger) { try { if (this.enterpriseConcurrentScheduler) { return new EnterpriseConcurrentTriggerScheduler().schedule(decorateTask(task, true), trigger); @@ -176,7 +176,7 @@ public ScheduledFuture schedule(Runnable task, Trigger trigger) { } @Override - public ScheduledFuture schedule(Runnable task, Date startTime) { + public ScheduledFuture<?> schedule(Runnable task, Date startTime) { long initialDelay = startTime.getTime() - System.currentTimeMillis(); try { return this.scheduledExecutor.schedule(decorateTask(task, false), initialDelay, TimeUnit.MILLISECONDS); @@ -187,7 +187,7 @@ public ScheduledFuture schedule(Runnable task, Date startTime) { } @Override - public ScheduledFuture scheduleAtFixedRate(Runnable task, Date startTime, long period) { + public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Date startTime, long period) { long initialDelay = startTime.getTime() - System.currentTimeMillis(); try { return this.scheduledExecutor.scheduleAtFixedRate(decorateTask(task, true), initialDelay, period, TimeUnit.MILLISECONDS); @@ -198,7 +198,7 @@ public ScheduledFuture scheduleAtFixedRate(Runnable task, Date startTime, long p } @Override - public ScheduledFuture scheduleAtFixedRate(Runnable task, long period) { + public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, long period) { try { return this.scheduledExecutor.scheduleAtFixedRate(decorateTask(task, true), 0, period, TimeUnit.MILLISECONDS); } @@ -208,7 +208,7 @@ public ScheduledFuture scheduleAtFixedRate(Runnable task, long period) { } @Override - public ScheduledFuture scheduleWithFixedDelay(Runnable task, Date startTime, long delay) { + public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Date startTime, long delay) { long initialDelay = startTime.getTime() - System.currentTimeMillis(); try { return this.scheduledExecutor.scheduleWithFixedDelay(decorateTask(task, true), initialDelay, delay, TimeUnit.MILLISECONDS); @@ -219,7 +219,7 @@ public ScheduledFuture scheduleWithFixedDelay(Runnable task, Date startTime, lon } @Override - public ScheduledFuture scheduleWithFixedDelay(Runnable task, long delay) { + public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long delay) { try { return this.scheduledExecutor.scheduleWithFixedDelay(decorateTask(task, true), 0, delay, TimeUnit.MILLISECONDS); } @@ -243,7 +243,7 @@ private Runnable decorateTask(Runnable task, boolean isRepeatingTask) { */ private class EnterpriseConcurrentTriggerScheduler { - public ScheduledFuture schedule(Runnable task, final Trigger trigger) { + public ScheduledFuture<?> schedule(Runnable task, final Trigger trigger) { ManagedScheduledExecutorService executor = (ManagedScheduledExecutorService) scheduledExecutor; return executor.schedule(task, new javax.enterprise.concurrent.Trigger() { @Override
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/scheduling/concurrent/DefaultManagedAwareThreadFactory.java
@@ -41,6 +41,7 @@ * @author Juergen Hoeller * @since 4.0 */ +@SuppressWarnings("serial") public class DefaultManagedAwareThreadFactory extends CustomizableThreadFactory implements InitializingBean { protected final Log logger = LogFactory.getLog(getClass());
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/scheduling/concurrent/ReschedulingRunnable.java
@@ -49,7 +49,7 @@ class ReschedulingRunnable extends DelegatingErrorHandlingRunnable implements Sc private final ScheduledExecutorService executor; - private ScheduledFuture currentFuture; + private ScheduledFuture<?> currentFuture; private Date scheduledExecutionTime; @@ -63,7 +63,7 @@ public ReschedulingRunnable(Runnable delegate, Trigger trigger, ScheduledExecuto } - public ScheduledFuture schedule() { + public ScheduledFuture<?> schedule() { synchronized (this.triggerContextMonitor) { this.scheduledExecutionTime = this.trigger.nextExecutionTime(this.triggerContext); if (this.scheduledExecutionTime == null) { @@ -112,7 +112,7 @@ public boolean isDone() { @Override public Object get() throws InterruptedException, ExecutionException { - ScheduledFuture curr; + ScheduledFuture<?> curr; synchronized (this.triggerContextMonitor) { curr = this.currentFuture; } @@ -121,7 +121,7 @@ public Object get() throws InterruptedException, ExecutionException { @Override public Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { - ScheduledFuture curr; + ScheduledFuture<?> curr; synchronized (this.triggerContextMonitor) { curr = this.currentFuture; } @@ -130,7 +130,7 @@ public Object get(long timeout, TimeUnit unit) throws InterruptedException, Exec @Override public long getDelay(TimeUnit unit) { - ScheduledFuture curr; + ScheduledFuture<?> curr; synchronized (this.triggerContextMonitor) { curr = this.currentFuture; }
true
Other
spring-projects
spring-framework
59002f245623d758765b72d598cd78c326c6f5fa.json
Fix remaining compiler warnings Fix remaining Java compiler warnings, mainly around missing generics or deprecated code. Also add the `-Werror` compiler option to ensure that any future warnings will fail the build. Issue: SPR-11064
spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.java
@@ -209,7 +209,7 @@ public boolean prefersShortLivedTasks() { // TaskScheduler implementation @Override - public ScheduledFuture schedule(Runnable task, Trigger trigger) { + public ScheduledFuture<?> schedule(Runnable task, Trigger trigger) { ScheduledExecutorService executor = getScheduledExecutor(); try { ErrorHandler errorHandler = @@ -222,7 +222,7 @@ public ScheduledFuture schedule(Runnable task, Trigger trigger) { } @Override - public ScheduledFuture schedule(Runnable task, Date startTime) { + public ScheduledFuture<?> schedule(Runnable task, Date startTime) { ScheduledExecutorService executor = getScheduledExecutor(); long initialDelay = startTime.getTime() - System.currentTimeMillis(); try { @@ -234,7 +234,7 @@ public ScheduledFuture schedule(Runnable task, Date startTime) { } @Override - public ScheduledFuture scheduleAtFixedRate(Runnable task, Date startTime, long period) { + public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Date startTime, long period) { ScheduledExecutorService executor = getScheduledExecutor(); long initialDelay = startTime.getTime() - System.currentTimeMillis(); try { @@ -246,7 +246,7 @@ public ScheduledFuture scheduleAtFixedRate(Runnable task, Date startTime, long p } @Override - public ScheduledFuture scheduleAtFixedRate(Runnable task, long period) { + public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, long period) { ScheduledExecutorService executor = getScheduledExecutor(); try { return executor.scheduleAtFixedRate(errorHandlingTask(task, true), 0, period, TimeUnit.MILLISECONDS); @@ -257,7 +257,7 @@ public ScheduledFuture scheduleAtFixedRate(Runnable task, long period) { } @Override - public ScheduledFuture scheduleWithFixedDelay(Runnable task, Date startTime, long delay) { + public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Date startTime, long delay) { ScheduledExecutorService executor = getScheduledExecutor(); long initialDelay = startTime.getTime() - System.currentTimeMillis(); try { @@ -269,7 +269,7 @@ public ScheduledFuture scheduleWithFixedDelay(Runnable task, Date startTime, lon } @Override - public ScheduledFuture scheduleWithFixedDelay(Runnable task, long delay) { + public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long delay) { ScheduledExecutorService executor = getScheduledExecutor(); try { return executor.scheduleWithFixedDelay(errorHandlingTask(task, true), 0, delay, TimeUnit.MILLISECONDS);
true