Skip to content

Commit 0900808

Browse files
committed
Method-level @SuppressWarnings("unchecked") for generic varargs
1 parent 873fc53 commit 0900808

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

spring-context/src/main/java/org/springframework/context/annotation/AnnotatedBeanDefinitionReader.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -127,15 +127,13 @@ public void registerBean(Class<?> annotatedClass) {
127127
registerBean(annotatedClass, null, (Class<? extends Annotation>[]) null);
128128
}
129129

130-
public void registerBean(Class<?> annotatedClass,
131-
@SuppressWarnings("unchecked") Class<? extends Annotation>... qualifiers) {
132-
130+
@SuppressWarnings("unchecked")
131+
public void registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers) {
133132
registerBean(annotatedClass, null, qualifiers);
134133
}
135134

136-
public void registerBean(Class<?> annotatedClass, String name,
137-
@SuppressWarnings("unchecked") Class<? extends Annotation>... qualifiers) {
138-
135+
@SuppressWarnings("unchecked")
136+
public void registerBean(Class<?> annotatedClass, String name, Class<? extends Annotation>... qualifiers) {
139137
AnnotatedGenericBeanDefinition abd = new AnnotatedGenericBeanDefinition(annotatedClass);
140138
if (this.conditionEvaluator.shouldSkip(abd.getMetadata())) {
141139
return;

spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcInsert.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -542,6 +542,7 @@ private PreparedStatement prepareStatementForGeneratedKeys(Connection con) throw
542542
* @param batch array of Maps with parameter names and values to be used in batch insert
543543
* @return array of number of rows affected
544544
*/
545+
@SuppressWarnings("unchecked")
545546
protected int[] doExecuteBatch(Map<String, ?>... batch) {
546547
checkCompiled();
547548
List<List<Object>> batchValues = new ArrayList<List<Object>>(batch.length);

spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsert.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -148,6 +148,7 @@ public KeyHolder executeAndReturnKeyHolder(SqlParameterSource parameterSource) {
148148
}
149149

150150
@Override
151+
@SuppressWarnings("unchecked")
151152
public int[] executeBatch(Map<String, ?>... batch) {
152153
return doExecuteBatch(batch);
153154
}

spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertOperations.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -152,6 +152,7 @@ public interface SimpleJdbcInsertOperations {
152152
* @param batch an array of Maps containing a batch of column names and corresponding value
153153
* @return the array of number of rows affected as returned by the JDBC driver
154154
*/
155+
@SuppressWarnings("unchecked")
155156
int[] executeBatch(Map<String, ?>... batch);
156157

157158
/**

0 commit comments

Comments
 (0)