Skip to content

Commit ae4acf0

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 3b01522 + 4a6759c commit ae4acf0

File tree

6 files changed

+966
-9
lines changed

6 files changed

+966
-9
lines changed

pom.xml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,37 +65,44 @@
6565
<pluginManagement>
6666
<plugins>
6767
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
6869
<artifactId>maven-resources-plugin</artifactId>
69-
<version>2.6</version>
70+
<version>3.0.2</version>
7071
</plugin>
7172
<plugin>
73+
<groupId>org.apache.maven.plugins</groupId>
7274
<artifactId>maven-surefire-plugin</artifactId>
73-
<version>2.12.4</version>
75+
<version>2.19.1</version>
7476
</plugin>
7577
<plugin>
78+
<groupId>org.apache.maven.plugins</groupId>
7679
<artifactId>maven-compiler-plugin</artifactId>
77-
<version>2.5.1</version>
80+
<version>3.6.1</version>
7881
</plugin>
7982
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
8084
<artifactId>maven-source-plugin</artifactId>
81-
<version>2.2.1</version>
85+
<version>3.0.1</version>
8286
</plugin>
8387
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
8489
<artifactId>maven-javadoc-plugin</artifactId>
85-
<version>2.9</version>
90+
<version>2.10.4</version>
8691
</plugin>
8792
<plugin>
93+
<groupId>org.apache.maven.plugins</groupId>
8894
<artifactId>maven-gpg-plugin</artifactId>
89-
<version>1.4</version>
95+
<version>1.6</version>
9096
</plugin>
9197
<plugin>
98+
<groupId>org.apache.maven.plugins</groupId>
9299
<artifactId>maven-deploy-plugin</artifactId>
93-
<version>2.7</version>
100+
<version>2.8.2</version>
94101
</plugin>
95102
<plugin>
96103
<groupId>org.nuiton</groupId>
97104
<artifactId>helper-maven-plugin</artifactId>
98-
<version>2.0</version>
105+
<version>2.3.2</version>
99106
</plugin>
100107
</plugins>
101108
</pluginManagement>

src/com/esotericsoftware/yamlbeans/Beans.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.lang.reflect.Modifier;
2525
import java.lang.reflect.ParameterizedType;
2626
import java.lang.reflect.Type;
27+
import java.lang.reflect.WildcardType;
2728
import java.util.ArrayList;
2829
import java.util.Collection;
2930
import java.util.Collections;
@@ -289,7 +290,18 @@ private Class getElementTypeFromGenerics (Type type) {
289290
if (isCollection(rawType) || isMap(rawType)) {
290291
Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
291292
if (actualTypeArguments.length > 0) {
292-
return (Class)actualTypeArguments[actualTypeArguments.length - 1];
293+
final Type cType = actualTypeArguments[actualTypeArguments.length - 1];
294+
if (cType instanceof Class) {
295+
return (Class) cType;
296+
} else if (cType instanceof WildcardType) {
297+
WildcardType t = (WildcardType) cType;
298+
final Type bound = t.getUpperBounds()[0];
299+
return bound instanceof Class ? (Class) bound : null;
300+
} else if (cType instanceof ParameterizedType) {
301+
ParameterizedType t = (ParameterizedType) cType;
302+
final Type rt = t.getRawType();
303+
return rt instanceof Class ? (Class) rt : null;
304+
}
293305
}
294306
}
295307
}

0 commit comments

Comments
 (0)