### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java,v retrieving revision 1.44 diff -u -r1.44 ClassLiteralAccess.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java 8 Nov 2006 04:09:42 -0000 1.44 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java 5 Apr 2007 18:21:59 -0000 @@ -78,16 +78,21 @@ if ((targetType = type.resolveType(scope, true /* check bounds*/)) == null) return null; - if (targetType.isArrayType() - && ((ArrayBinding) targetType).leafComponentType == TypeBinding.VOID) { - scope.problemReporter().cannotAllocateVoidArray(this); - return null; - } else if (targetType.isTypeVariable()) { + if (targetType.isArrayType()) { + ArrayBinding arrayBinding = (ArrayBinding) this.targetType; + TypeBinding leafComponentType = arrayBinding.leafComponentType; + if (leafComponentType == TypeBinding.VOID) { + scope.problemReporter().cannotAllocateVoidArray(this); + return null; + } else if (leafComponentType.isTypeVariable()) { + scope.problemReporter().illegalClassLiteralForTypeVariable((TypeVariableBinding)leafComponentType, this); + } + } else if (this.targetType.isTypeVariable()) { scope.problemReporter().illegalClassLiteralForTypeVariable((TypeVariableBinding)targetType, this); } ReferenceBinding classType = scope.getJavaLangClass(); if (classType.isGenericType()) { - // Integer.class --> Class, perform boxing of base types (int.class --> Class) + // Integer.class --> Class, perform boxing of base types (int.class --> Class) TypeBinding boxedType = null; if (targetType.id == T_void) { boxedType = scope.environment().getType(JAVA_LANG_VOID); @@ -97,9 +102,9 @@ } else { boxedType = scope.boxing(targetType); } - this.resolvedType = scope.environment().createParameterizedType(classType, new TypeBinding[]{ boxedType }, null/*not a member*/); + this.resolvedType = scope.environment().createParameterizedType(classType, new TypeBinding[]{ boxedType }, null/*not a member*/); } else { - this.resolvedType = classType; + this.resolvedType = classType; } return this.resolvedType; }