JDK RFR to clean-up lint warnings in reflection implementation
Joe Darcy
joe.darcy at oracle.com
Fri Nov 8 19:40:17 UTC 2013
Hello,
Please review the simple patch below which addresses a handful of raw
types lint warning in the core reflection implementation code.
(If memory serves, this code dates back from a time during the
development of JDK 5 when wildcards could not be used with arrays;
before the release shipped, that combination was allowed.)
Thanks,
-Joe
diff -r 46982ca895b4
src/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java
---
a/src/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java
Fri Nov 08 18:54:29 2013 +0000
+++
b/src/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java
Fri Nov 08 11:37:54 2013 -0800
@@ -52,7 +52,7 @@
}
private void validateConstructorArguments() {
- TypeVariable/*<?>*/[] formals = rawType.getTypeParameters();
+ TypeVariable<?>[] formals = rawType.getTypeParameters();
// check correct arity of actual type args
if (formals.length != actualTypeArguments.length){
throw new MalformedParameterizedTypeException();
diff -r 46982ca895b4
src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java
---
a/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java
Fri Nov 08 18:54:29 2013 +0000
+++
b/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java
Fri Nov 08 11:37:54 2013 -0800
@@ -42,7 +42,7 @@
public abstract class GenericDeclRepository<S extends Signature>
extends AbstractRepository<S> {
- private TypeVariable[] typeParams; // caches the formal type parameters
+ private TypeVariable<?>[] typeParams; // caches the formal type
parameters
protected GenericDeclRepository(String rawSig, GenericsFactory f) {
super(rawSig, f);
@@ -64,7 +64,7 @@
* Return the formal type parameters of this generic declaration.
* @return the formal type parameters of this generic declaration
*/
- public TypeVariable/*<?>*/[] getTypeParameters(){
+ public TypeVariable<?>[] getTypeParameters(){
if (typeParams == null) { // lazily initialize type parameters
// first, extract type parameter subtree(s) from AST
FormalTypeParameter[] ftps =
getTree().getFormalTypeParameters();
More information about the core-libs-dev
mailing list