Index: compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java,v --- compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java 24 Sep 2008 16:05:23 -0000 1.152 +++ compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java 8 Jan 2009 10:18:41 -0000 @@ -345,7 +345,7 @@ } // anonymous type constructor creation: rank is important since bindings already got sorted -public MethodBinding createDefaultConstructorWithBinding(MethodBinding inheritedConstructorBinding) { +public MethodBinding createDefaultConstructorWithBinding(MethodBinding inheritedConstructorBinding, boolean isUnchecked) { //Add to method'set, the default constuctor that just recall the //super constructor with the same arguments String baseName = "$anonymous"; //$NON-NLS-1$ @@ -393,11 +393,15 @@ } //============BINDING UPDATE========================== + ReferenceBinding[] thrownExceptions = isUnchecked + ? this.scope.environment().convertToRawTypes(inheritedConstructorBinding.original().thrownExceptions, true, true) + : inheritedConstructorBinding.thrownExceptions; + SourceTypeBinding sourceType = this.binding; constructor.binding = new MethodBinding( constructor.modifiers, //methodDeclaration argumentsLength == 0 ? Binding.NO_PARAMETERS : argumentTypes, //arguments bindings - inheritedConstructorBinding.thrownExceptions, //exceptions + thrownExceptions, //exceptions sourceType); //declaringClass constructor.binding.tagBits |= (inheritedConstructorBinding.tagBits & TagBits.HasMissingType); constructor.binding.modifiers |= ExtraCompilerModifiers.AccIsDefaultConstructor; Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java,v --- compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 1 Oct 2008 22:27:55 -0000 1.124 +++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 8 Jan 2009 10:18:40 -0000 @@ -609,6 +609,10 @@ // ignored } +public void setUnchecked(boolean isUnchecked) { + // ignored +} + public void traverse(ASTVisitor visitor, BlockScope scope) { if (visitor.visit(this, scope)) { this.receiver.traverse(visitor, scope); Index: compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java,v --- compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java 27 Jun 2008 16:03:55 -0000 1.33 +++ compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java 8 Jan 2009 10:18:40 -0000 @@ -128,4 +128,9 @@ public void setFieldIndex(int depth) { // do nothing by default } + + public void setUnchecked(boolean isUnchecked) { + // ignored + } + } Index: compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java,v --- compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 2 Dec 2008 10:02:46 -0000 1.124 +++ compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 8 Jan 2009 10:18:40 -0000 @@ -256,6 +256,7 @@ public void setActualReceiverType(ReferenceBinding actualReceiverType) { /* ignore */} public void setDepth(int depth) { /* ignore */} public void setFieldIndex(int depth){ /* ignore */} + public void setUnchecked(boolean isUnchecked) {/* ignore */} public int sourceStart() { return 0; } public int sourceEnd() { return 0; } }; @@ -287,7 +288,8 @@ } } for (int i = 0; i < argumentLength; i++) { - if (originalArgumentTypes[i] != alternateArgumentTypes[i]) { + if (originalArgumentTypes[i] != alternateArgumentTypes[i] + /*&& !originalArgumentTypes[i].needsUncheckedConversion(alternateArgumentTypes[i])*/) { scope.problemReporter().unnecessaryCast((CastExpression)arguments[i]); } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java,v --- compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 17 Sep 2008 11:11:09 -0000 1.76 +++ compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 8 Jan 2009 10:18:40 -0000 @@ -43,6 +43,9 @@ // record some dependency information for exception types ReferenceBinding[] thrownExceptions; if (((thrownExceptions = this.binding.thrownExceptions).length) != 0) { + if ((this.bits & ASTNode.Unchecked) != 0) { + thrownExceptions = currentScope.environment().convertToRawTypes(this.binding.original().thrownExceptions, true, true); + } // check exception handling flowContext.checkExceptionHandlers( thrownExceptions, @@ -353,7 +356,7 @@ } if (isMethodUseDeprecated(this.binding, scope, true)) scope.problemReporter().deprecatedMethod(this.binding, this); - checkInvocationArguments(scope, null, allocationType, this.binding, this.arguments, argumentTypes, argsContainCast, this); + checkInvocationArguments(scope, null, allocationType, this.binding, this.arguments, argumentTypes, argsContainCast, this, (this.bits & ASTNode.Unchecked) != 0); if (this.typeArguments != null && this.binding.original().typeVariables == Binding.NO_TYPE_VARIABLES) { scope.problemReporter().unnecessaryTypeArgumentsForMethodInvocation(this.binding, this.genericTypeArguments, this.typeArguments); } @@ -372,6 +375,15 @@ // ignored } +public void setUnchecked(boolean isUnchecked) { + if (isUnchecked) { + this.bits |= ASTNode.Unchecked; + } else { + this.bits &= ~ASTNode.Unchecked; + } + +} + public void traverse(ASTVisitor visitor, BlockScope scope) { if (visitor.visit(this, scope)) { if (this.typeArguments != null) { Index: compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java,v --- compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java 27 Jun 2008 16:03:55 -0000 1.63 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java 8 Jan 2009 10:18:40 -0000 @@ -93,7 +93,6 @@ } public TypeBinding resolveForCatch(BlockScope scope) { - // resolution on an argument of a catch clause // provide the scope with a side effect : insertion of a LOCAL // that represents the argument. The type must be from JavaThrowable Index: compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java,v --- compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 7 Jan 2009 16:32:59 -0000 1.139 +++ compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 8 Jan 2009 10:18:40 -0000 @@ -69,6 +69,9 @@ } ReferenceBinding[] thrownExceptions; if ((thrownExceptions = this.binding.thrownExceptions) != Binding.NO_EXCEPTIONS) { + if ((this.bits & ASTNode.Unchecked) != 0) { + thrownExceptions = currentScope.environment().convertToRawTypes(this.binding.original().thrownExceptions, true, true); + } // must verify that exceptions potentially thrown by this expression are caught in the method flowContext.checkExceptionHandlers(thrownExceptions, this, flowInfo.copy(), currentScope); // TODO (maxime) the copy above is needed because of a side effect into @@ -394,8 +397,7 @@ scope.problemReporter().errorNoMethodFor(this, this.actualReceiverType, argumentTypes); return null; } - this.binding = - this.receiver.isImplicitThis() + this.binding = this.receiver.isImplicitThis() ? scope.getImplicitMethod(this.selector, argumentTypes, this) : scope.getMethod(this.actualReceiverType, this.selector, argumentTypes, this); if (!this.binding.isValidBinding()) { @@ -466,7 +468,7 @@ scope.problemReporter().indirectAccessToStaticMethod(this, this.binding); } } - checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this); + checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this, (this.bits & ASTNode.Unchecked) != 0); //-------message send that are known to fail at compile time----------- if (this.binding.isAbstract()) { @@ -482,8 +484,18 @@ if (this.binding == scope.environment().arrayClone && compilerOptions.sourceLevel >= ClassFileConstants.JDK1_5) { this.resolvedType = this.actualReceiverType; } else { - TypeBinding returnType = this.binding.returnType; - if (returnType != null) returnType = returnType.capture(scope, this.sourceEnd); + TypeBinding returnType; + if ((this.bits & ASTNode.Unchecked) != 0) { + returnType = this.binding.original().returnType; + if (returnType != null) { + returnType = scope.environment().convertToRawType(returnType.erasure(), true); + } + } else { + returnType = this.binding.returnType; + if (returnType != null) { + returnType = returnType.capture(scope, this.sourceEnd); + } + } this.resolvedType = returnType; } if (this.receiver.isSuper() && compilerOptions.getSeverity(CompilerOptions.OverridingMethodWithoutSuperInvocation) != ProblemSeverities.Ignore) { @@ -527,6 +539,14 @@ // ignore for here } +public void setUnchecked(boolean isUnchecked) { + if (isUnchecked) { + this.bits |= ASTNode.Unchecked; + } else { + this.bits &= ~ASTNode.Unchecked; + } +} + public void traverse(ASTVisitor visitor, BlockScope blockScope) { if (visitor.visit(this, blockScope)) { this.receiver.traverse(visitor, blockScope); Index: compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java,v --- compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java 17 Sep 2008 11:11:09 -0000 1.67 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java 8 Jan 2009 10:18:40 -0000 @@ -81,6 +81,9 @@ ReferenceBinding[] thrownExceptions; if ((thrownExceptions = this.binding.thrownExceptions) != Binding.NO_EXCEPTIONS) { + if ((this.bits & ASTNode.Unchecked) != 0) { + thrownExceptions = currentScope.environment().convertToRawTypes(this.binding.original().thrownExceptions, true, true); + } // check exceptions flowContext.checkExceptionHandlers( thrownExceptions, @@ -397,7 +400,7 @@ if (isMethodUseDeprecated(this.binding, scope, this.accessMode != ExplicitConstructorCall.ImplicitSuper)) { scope.problemReporter().deprecatedMethod(this.binding, this); } - checkInvocationArguments(scope, null, receiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this); + checkInvocationArguments(scope, null, receiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this, (this.bits & ASTNode.Unchecked) != 0); if (this.binding.isPrivate() || receiverType.isLocalType()) { this.binding.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed; } @@ -430,6 +433,15 @@ // ignore for here } + public void setUnchecked(boolean isUnchecked) { + if (isUnchecked) { + this.bits |= ASTNode.Unchecked; + } else { + this.bits &= ~ASTNode.Unchecked; + } + + } + public void traverse(ASTVisitor visitor, BlockScope scope) { if (visitor.visit(this, scope)) { if (this.qualification != null) { Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 5 Dec 2008 12:41:29 -0000 1.346 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 8 Jan 2009 10:18:42 -0000 @@ -45,6 +45,11 @@ public int kind; public Scope parent; + protected Scope(int kind, Scope parent) { + this.kind = kind; + this.parent = parent; + } + /* Answer an int describing the relationship between the given types. * * NOT_RELATED @@ -59,7 +64,131 @@ return Scope.NOT_RELATED; } - public static TypeBinding getBaseType(char[] name) { + /** + * Returns a type where either all variables or specific ones got discarded. + * e.g. List (discarding ) will return: List> + */ + public static TypeBinding convertEliminatingTypeVariables(TypeBinding originalType, ReferenceBinding genericType, int rank, Set eliminatedVariables) { + if ((originalType.tagBits & TagBits.HasTypeVariable) != 0) { + switch (originalType.kind()) { + case Binding.ARRAY_TYPE : + ArrayBinding originalArrayType = (ArrayBinding) originalType; + TypeBinding originalLeafComponentType = originalArrayType.leafComponentType; + TypeBinding substitute = convertEliminatingTypeVariables(originalLeafComponentType, genericType, rank, eliminatedVariables); // substitute could itself be array type + if (substitute != originalLeafComponentType) { + return originalArrayType.environment.createArrayType(substitute.leafComponentType(), substitute.dimensions() + originalArrayType.dimensions()); + } + break; + case Binding.PARAMETERIZED_TYPE : + ParameterizedTypeBinding paramType = (ParameterizedTypeBinding) originalType; + ReferenceBinding originalEnclosing = paramType.enclosingType(); + ReferenceBinding substitutedEnclosing = originalEnclosing; + if (originalEnclosing != null) { + substitutedEnclosing = (ReferenceBinding) convertEliminatingTypeVariables(originalEnclosing, genericType, rank, eliminatedVariables); + } + TypeBinding[] originalArguments = paramType.arguments; + TypeBinding[] substitutedArguments = originalArguments; + for (int i = 0, length = originalArguments == null ? 0 : originalArguments.length; i < length; i++) { + TypeBinding originalArgument = originalArguments[i]; + TypeBinding substitutedArgument = convertEliminatingTypeVariables(originalArgument, paramType.genericType(), i, eliminatedVariables); + if (substitutedArgument != originalArgument) { + if (substitutedArguments == originalArguments) { + System.arraycopy(originalArguments, 0, substitutedArguments = new TypeBinding[length], 0, i); + } + substitutedArguments[i] = substitutedArgument; + } else if (substitutedArguments != originalArguments) { + substitutedArguments[i] = originalArgument; + } + } + if (originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments) { + return paramType.environment.createParameterizedType(paramType.genericType(), substitutedArguments, substitutedEnclosing); + } + break; + case Binding.TYPE_PARAMETER : + if (genericType == null) { + break; + } + TypeVariableBinding originalVariable = (TypeVariableBinding) originalType; + if (eliminatedVariables != null && eliminatedVariables.contains(originalType)) { + return originalVariable.environment.createWildcard(genericType, rank, null, null, Wildcard.UNBOUND); + } + TypeBinding originalUpperBound = originalVariable.upperBound(); + if (eliminatedVariables == null) { + eliminatedVariables = new HashSet(2); + } + eliminatedVariables.add(originalVariable); + TypeBinding substitutedUpperBound = convertEliminatingTypeVariables(originalUpperBound, genericType, rank, eliminatedVariables); + eliminatedVariables.remove(originalVariable); + return originalVariable.environment.createWildcard(genericType, rank, substitutedUpperBound, null, Wildcard.EXTENDS); + case Binding.RAW_TYPE : + break; + case Binding.GENERIC_TYPE : + ReferenceBinding currentType = (ReferenceBinding) originalType; + originalEnclosing = currentType.enclosingType(); + substitutedEnclosing = originalEnclosing; + if (originalEnclosing != null) { + substitutedEnclosing = (ReferenceBinding) convertEliminatingTypeVariables(originalEnclosing, genericType, rank, eliminatedVariables); + } + originalArguments = currentType.typeVariables(); + substitutedArguments = originalArguments; + for (int i = 0, length = originalArguments == null ? 0 : originalArguments.length; i < length; i++) { + TypeBinding originalArgument = originalArguments[i]; + TypeBinding substitutedArgument = convertEliminatingTypeVariables(originalArgument, currentType, i, eliminatedVariables); + if (substitutedArgument != originalArgument) { + if (substitutedArguments == originalArguments) { + System.arraycopy(originalArguments, 0, substitutedArguments = new TypeBinding[length], 0, i); + } + substitutedArguments[i] = substitutedArgument; + } else if (substitutedArguments != originalArguments) { + substitutedArguments[i] = originalArgument; + } + } + if (originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments) { + return ((TypeVariableBinding)originalArguments[0]).environment.createParameterizedType(genericType, substitutedArguments, substitutedEnclosing); + } + break; + case Binding.WILDCARD_TYPE : + WildcardBinding wildcard = (WildcardBinding) originalType; + TypeBinding originalBound = wildcard.bound; + TypeBinding substitutedBound = originalBound; + if (originalBound != null) { + substitutedBound = convertEliminatingTypeVariables(originalBound, genericType, rank, eliminatedVariables); + if (substitutedBound != originalBound) { + return wildcard.environment.createWildcard(wildcard.genericType, wildcard.rank, substitutedBound, null, wildcard.boundKind); + } + } + break; + case Binding.INTERSECTION_TYPE : + WildcardBinding intersection = (WildcardBinding) originalType; + originalBound = intersection.bound; + substitutedBound = originalBound; + if (originalBound != null) { + substitutedBound = convertEliminatingTypeVariables(originalBound, genericType, rank, eliminatedVariables); + } + TypeBinding[] originalOtherBounds = intersection.otherBounds; + TypeBinding[] substitutedOtherBounds = originalOtherBounds; + for (int i = 0, length = originalOtherBounds == null ? 0 : originalOtherBounds.length; i < length; i++) { + TypeBinding originalOtherBound = originalOtherBounds[i]; + TypeBinding substitutedOtherBound = convertEliminatingTypeVariables(originalOtherBound, genericType, rank, eliminatedVariables); + if (substitutedOtherBound != originalOtherBound) { + if (substitutedOtherBounds == originalOtherBounds) { + System.arraycopy(originalOtherBounds, 0, substitutedOtherBounds = new TypeBinding[length], 0, i); + } + substitutedOtherBounds[i] = substitutedOtherBound; + } else if (substitutedOtherBounds != originalOtherBounds) { + substitutedOtherBounds[i] = originalOtherBound; + } + } + if (substitutedBound != originalBound || substitutedOtherBounds != originalOtherBounds) { + return intersection.environment.createWildcard(intersection.genericType, intersection.rank, substitutedBound, substitutedOtherBounds, intersection.boundKind); + } + break; + } + } + return originalType; + } + + public static TypeBinding getBaseType(char[] name) { // list should be optimized (with most often used first) int length = name.length; if (length > 2 && length < 8) { @@ -121,7 +250,7 @@ return null; } - // 5.1.10 + // 5.1.10 public static ReferenceBinding[] greaterLowerBound(ReferenceBinding[] types) { if (types == null) return null; int length = types.length; @@ -335,11 +464,6 @@ return substitutedTypes; } - protected Scope(int kind, Scope parent) { - this.kind = kind; - this.parent = parent; - } - /* * Boxing primitive */ @@ -587,7 +711,7 @@ int count = 0; for (int i = 0; i < length; i++) { TypeParameter typeParameter = typeParameters[i]; - TypeVariableBinding parameterBinding = new TypeVariableBinding(typeParameter.name, declaringElement, i); + TypeVariableBinding parameterBinding = new TypeVariableBinding(typeParameter.name, declaringElement, i, environment()); parameterBinding.fPackage = unitPackage; typeParameter.binding = parameterBinding; @@ -2665,16 +2789,14 @@ // > void foo(T t) {} // foo(T) will show up as foo(Y#RAW) and not foo(X#RAW) // Y#RAW is not more specific than a rawified X - if (oneParam == one.original().parameters[i] - && twoParam.leafComponentType().erasure() != two.original().parameters[i].leafComponentType().erasure()) { + if (twoParam.leafComponentType().erasure() != two.original().parameters[i].leafComponentType().erasure()) return false; - } } } else if (oneParam.isCompatibleWith(twoParam)) { if (oneParam.leafComponentType().isRawType()) { - // A#RAW is not more specific than a rawified A - if (oneParam.needsUncheckedConversion(two.declaringClass.isRawType() ? twoParam : two.original().parameters[i])) - return false; + if (oneParam.needsUncheckedConversion(twoParam)) + if (oneParam.leafComponentType().erasure() != twoParam.leafComponentType().erasure()) + return false; } } else { if (i == oneParamsLength - 1 && one.isVarargs() && two.isVarargs()) { @@ -2704,7 +2826,7 @@ } return false; } - + public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java 26 Sep 2008 16:32:56 -0000 1.69 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java 8 Jan 2009 10:18:42 -0000 @@ -32,22 +32,24 @@ public ReferenceBinding superclass; public ReferenceBinding[] superInterfaces; public char[] genericTypeSignature; - - public TypeVariableBinding(char[] sourceName, Binding declaringElement, int rank) { + LookupEnvironment environment; + + public TypeVariableBinding(char[] sourceName, Binding declaringElement, int rank, LookupEnvironment environment) { this.sourceName = sourceName; this.declaringElement = declaringElement; this.rank = rank; this.modifiers = ClassFileConstants.AccPublic | ExtraCompilerModifiers.AccGenericSignature; // treat type var as public this.tagBits |= TagBits.HasTypeVariable; + this.environment = environment; } /** * Returns true if the argument type satisfies all bounds of the type parameter */ public int boundCheck(Substitution substitution, TypeBinding argumentType) { - - if (argumentType == TypeBinding.NULL || argumentType == this) + if (argumentType == TypeBinding.NULL || argumentType == this) { return TypeConstants.OK; + } boolean hasSubstitution = substitution != null; if (!(argumentType instanceof ReferenceBinding || argumentType.isArrayType())) return TypeConstants.MISMATCH; @@ -63,27 +65,27 @@ TypeBinding wildcardBound = wildcard.bound; if (wildcardBound == this) return TypeConstants.OK; - ReferenceBinding superclassBound = hasSubstitution ? (ReferenceBinding)Scope.substitute(substitution, this.superclass) : this.superclass; boolean isArrayBound = wildcardBound.isArrayType(); if (!wildcardBound.isInterface()) { - if (superclassBound.id != TypeIds.T_JavaLangObject) { + TypeBinding substitutedSuperType = hasSubstitution ? Scope.substitute(substitution, this.superclass) : this.superclass; + if (substitutedSuperType.id != TypeIds.T_JavaLangObject) { if (isArrayBound) { - if (!wildcardBound.isCompatibleWith(superclassBound)) + if (!wildcardBound.isCompatibleWith(substitutedSuperType)) return TypeConstants.MISMATCH; } else { - TypeBinding match = wildcardBound.findSuperTypeOriginatingFrom(superclassBound); + TypeBinding match = wildcardBound.findSuperTypeOriginatingFrom(substitutedSuperType); if (match != null) { - if (superclassBound.isProvablyDistinct(match)) { + if (substitutedSuperType.isProvablyDistinct(match)) { return TypeConstants.MISMATCH; } } else { - match = superclassBound.findSuperTypeOriginatingFrom(wildcardBound); + match = substitutedSuperType.findSuperTypeOriginatingFrom(wildcardBound); if (match != null) { if (match.isProvablyDistinct(wildcardBound)) { return TypeConstants.MISMATCH; } } else { - if (!wildcardBound.isTypeVariable() && !superclassBound.isTypeVariable()) { + if (!wildcardBound.isTypeVariable() && !substitutedSuperType.isTypeVariable()) { return TypeConstants.MISMATCH; } } @@ -91,18 +93,16 @@ } } } - ReferenceBinding[] superInterfaceBounds = hasSubstitution ? Scope.substitute(substitution, this.superInterfaces) : this.superInterfaces; - int length = superInterfaceBounds.length; boolean mustImplement = isArrayBound || ((ReferenceBinding)wildcardBound).isFinal(); - for (int i = 0; i < length; i++) { - TypeBinding superInterfaceBound = superInterfaceBounds[i]; + for (int i = 0, length = this.superInterfaces.length; i < length; i++) { + TypeBinding substitutedSuperType = hasSubstitution ? Scope.substitute(substitution, this.superInterfaces[i]) : this.superInterfaces[i]; if (isArrayBound) { - if (!wildcardBound.isCompatibleWith(superInterfaceBound)) + if (!wildcardBound.isCompatibleWith(substitutedSuperType)) return TypeConstants.MISMATCH; } else { - TypeBinding match = wildcardBound.findSuperTypeOriginatingFrom(superInterfaceBound); + TypeBinding match = wildcardBound.findSuperTypeOriginatingFrom(substitutedSuperType); if (match != null) { - if (superInterfaceBound.isProvablyDistinct(match)) { + if (substitutedSuperType.isProvablyDistinct(match)) { return TypeConstants.MISMATCH; } } else if (mustImplement) { @@ -380,19 +380,19 @@ public char[] readableName() { return this.sourceName; } - ReferenceBinding resolve(LookupEnvironment environment) { + ReferenceBinding resolve() { if ((this.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0) return this; TypeBinding oldSuperclass = this.superclass, oldFirstInterface = null; if (this.superclass != null) - this.superclass = (ReferenceBinding) BinaryTypeBinding.resolveType(this.superclass, environment, true /* raw conversion */); + this.superclass = (ReferenceBinding) BinaryTypeBinding.resolveType(this.superclass, this.environment, true /* raw conversion */); ReferenceBinding[] interfaces = this.superInterfaces; int length; if ((length = interfaces.length) != 0) { oldFirstInterface = interfaces[0]; for (int i = length; --i >= 0;) { - interfaces[i] = (ReferenceBinding) BinaryTypeBinding.resolveType(interfaces[i], environment, true /* raw conversion */); + interfaces[i] = (ReferenceBinding) BinaryTypeBinding.resolveType(interfaces[i], this.environment, true /* raw conversion */); } } // refresh the firstBound in case it changed Index: compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 3 Oct 2008 18:10:36 -0000 1.100 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 8 Jan 2009 10:18:41 -0000 @@ -11,9 +11,7 @@ package org.eclipse.jdt.internal.compiler.lookup; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.internal.compiler.ClassFilePool; @@ -386,123 +384,6 @@ return packageBinding; } -public TypeBinding convertEliminatingTypeVariables(TypeBinding originalType, ReferenceBinding genericType, int rank, Set eliminatedVariables) { - if ((originalType.tagBits & TagBits.HasTypeVariable) != 0) { - switch (originalType.kind()) { - case Binding.ARRAY_TYPE : - ArrayBinding originalArrayType = (ArrayBinding) originalType; - TypeBinding originalLeafComponentType = originalArrayType.leafComponentType; - TypeBinding substitute = convertEliminatingTypeVariables(originalLeafComponentType, genericType, rank, eliminatedVariables); // substitute could itself be array type - if (substitute != originalLeafComponentType) { - return createArrayType(substitute.leafComponentType(), substitute.dimensions() + originalArrayType.dimensions()); - } - break; - case Binding.PARAMETERIZED_TYPE : - ParameterizedTypeBinding paramType = (ParameterizedTypeBinding) originalType; - ReferenceBinding originalEnclosing = paramType.enclosingType(); - ReferenceBinding substitutedEnclosing = originalEnclosing; - if (originalEnclosing != null) { - substitutedEnclosing = (ReferenceBinding) convertEliminatingTypeVariables(originalEnclosing, genericType, rank, eliminatedVariables); - } - TypeBinding[] originalArguments = paramType.arguments; - TypeBinding[] substitutedArguments = originalArguments; - for (int i = 0, length = originalArguments == null ? 0 : originalArguments.length; i < length; i++) { - TypeBinding originalArgument = originalArguments[i]; - TypeBinding substitutedArgument = convertEliminatingTypeVariables(originalArgument, paramType.genericType(), i, eliminatedVariables); - if (substitutedArgument != originalArgument) { - if (substitutedArguments == originalArguments) { - System.arraycopy(originalArguments, 0, substitutedArguments = new TypeBinding[length], 0, i); - } - substitutedArguments[i] = substitutedArgument; - } else if (substitutedArguments != originalArguments) { - substitutedArguments[i] = originalArgument; - } - } - if (originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments) { - return createParameterizedType(paramType.genericType(), substitutedArguments, substitutedEnclosing); - } - break; - case Binding.TYPE_PARAMETER : - if (eliminatedVariables != null && eliminatedVariables.contains(originalType)) { - return createWildcard(genericType, rank, null, null, Wildcard.UNBOUND); - } - TypeVariableBinding variable = (TypeVariableBinding) originalType; - TypeBinding originalUpperBound = variable.upperBound(); - if (eliminatedVariables == null) { - eliminatedVariables = new HashSet(2); - } - eliminatedVariables.add(variable); - TypeBinding substitutedUpperBound = convertEliminatingTypeVariables(originalUpperBound, genericType, rank, eliminatedVariables); - eliminatedVariables.remove(variable); - return createWildcard(genericType, rank, substitutedUpperBound, null, Wildcard.EXTENDS); - case Binding.RAW_TYPE : - break; - case Binding.GENERIC_TYPE : - ReferenceBinding currentType = (ReferenceBinding) originalType; - originalEnclosing = currentType.enclosingType(); - substitutedEnclosing = originalEnclosing; - if (originalEnclosing != null) { - substitutedEnclosing = (ReferenceBinding) convertEliminatingTypeVariables(originalEnclosing, genericType, rank, eliminatedVariables); - } - originalArguments = currentType.typeVariables(); - substitutedArguments = originalArguments; - for (int i = 0, length = originalArguments == null ? 0 : originalArguments.length; i < length; i++) { - TypeBinding originalArgument = originalArguments[i]; - TypeBinding substitutedArgument = convertEliminatingTypeVariables(originalArgument, currentType, i, eliminatedVariables); - if (substitutedArgument != originalArgument) { - if (substitutedArguments == originalArguments) { - System.arraycopy(originalArguments, 0, substitutedArguments = new TypeBinding[length], 0, i); - } - substitutedArguments[i] = substitutedArgument; - } else if (substitutedArguments != originalArguments) { - substitutedArguments[i] = originalArgument; - } - } - if (originalEnclosing != substitutedEnclosing || originalArguments != substitutedArguments) { - return createParameterizedType(genericType, substitutedArguments, substitutedEnclosing); - } - break; - case Binding.WILDCARD_TYPE : - WildcardBinding wildcard = (WildcardBinding) originalType; - TypeBinding originalBound = wildcard.bound; - TypeBinding substitutedBound = originalBound; - if (originalBound != null) { - substitutedBound = convertEliminatingTypeVariables(originalBound, genericType, rank, eliminatedVariables); - if (substitutedBound != originalBound) { - return createWildcard(wildcard.genericType, wildcard.rank, substitutedBound, null, wildcard.boundKind); - } - } - break; - case Binding.INTERSECTION_TYPE : - WildcardBinding intersection = (WildcardBinding) originalType; - originalBound = intersection.bound; - substitutedBound = originalBound; - if (originalBound != null) { - substitutedBound = convertEliminatingTypeVariables(originalBound, genericType, rank, eliminatedVariables); - } - TypeBinding[] originalOtherBounds = intersection.otherBounds; - TypeBinding[] substitutedOtherBounds = originalOtherBounds; - for (int i = 0, length = originalOtherBounds == null ? 0 : originalOtherBounds.length; i < length; i++) { - TypeBinding originalOtherBound = originalOtherBounds[i]; - TypeBinding substitutedOtherBound = convertEliminatingTypeVariables(originalOtherBound, genericType, rank, eliminatedVariables); - if (substitutedOtherBound != originalOtherBound) { - if (substitutedOtherBounds == originalOtherBounds) { - System.arraycopy(originalOtherBounds, 0, substitutedOtherBounds = new TypeBinding[length], 0, i); - } - substitutedOtherBounds[i] = substitutedOtherBound; - } else if (substitutedOtherBounds != originalOtherBounds) { - substitutedOtherBounds[i] = originalOtherBound; - } - } - if (substitutedBound != originalBound || substitutedOtherBounds != originalOtherBounds) { - return createWildcard(intersection.genericType, intersection.rank, substitutedBound, substitutedOtherBounds, intersection.boundKind); - } - break; - } - } - return originalType; -} - /** * Convert a given source type into a parameterized form if generic. * generic X --> param X @@ -598,6 +479,27 @@ return type; } +/** + * Convert an array of types in raw forms. + * Only allocate an array if anything is different. + */ +public ReferenceBinding[] convertToRawTypes(ReferenceBinding[] originalTypes, boolean forceErasure, boolean forceRawEnclosingType) { + if (originalTypes == null) return null; + ReferenceBinding[] convertedTypes = originalTypes; + for (int i = 0, length = originalTypes.length; i < length; i++) { + ReferenceBinding originalType = originalTypes[i]; + ReferenceBinding convertedType = (ReferenceBinding) convertToRawType(forceErasure ? originalType.erasure() : originalType, forceRawEnclosingType); + if (convertedType != originalType) { + if (convertedTypes == originalTypes) { + System.arraycopy(originalTypes, 0, convertedTypes = new ReferenceBinding[length], 0, i); + } + convertedTypes[i] = convertedType; + } else if (convertedTypes != originalTypes) { + convertedTypes[i] = originalType; + } + } + return convertedTypes; +} // variation for unresolved types in binaries (consider generic type as raw) public TypeBinding convertUnresolvedBinaryToRawType(TypeBinding type) { @@ -657,7 +559,6 @@ } return type; } - /* * Used to guarantee annotation identity. */ @@ -667,6 +568,7 @@ } return new AnnotationBinding(annotationType, pairs); } + /* * Used to guarantee array type identity. */ @@ -708,10 +610,10 @@ this.uniqueArrayBindings[dimIndex] = arrayBindings; return arrayBindings[length] = new ArrayBinding(leafComponentType, dimensionCount, this); } - public BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) { return createBinaryTypeFrom(binaryType, packageBinding, true, accessRestriction); } + public BinaryTypeBinding createBinaryTypeFrom(IBinaryType binaryType, PackageBinding packageBinding, boolean needFieldsAndMethods, AccessRestriction accessRestriction) { BinaryTypeBinding binaryBinding = new BinaryTypeBinding(packageBinding, binaryType, this); @@ -1342,7 +1244,6 @@ return this.nameEnvironment.isPackage(null, name); return this.nameEnvironment.isPackage(compoundName, name); } - // The method verifier is lazily initialized to guarantee the receiver, the compiler & the oracle are ready. public MethodVerifier methodVerifier() { if (this.verifier == null) @@ -1351,6 +1252,7 @@ : new MethodVerifier15(this); // covariance only if sourceLevel is >= 1.5 return this.verifier; } + public void releaseClassFiles(org.eclipse.jdt.internal.compiler.ClassFile[] classFiles) { for (int i = 0, fileCount = classFiles.length; i < fileCount; i++) this.classFilePool.release(classFiles[i]); Index: compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext.java 27 Jun 2008 16:04:02 -0000 1.5 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/InferenceContext.java 8 Jan 2009 10:18:41 -0000 @@ -21,9 +21,9 @@ int status; TypeBinding expectedType; boolean hasExplicitExpectedType; // indicates whether the expectedType (if set) was explicit in code, or set by default + public boolean isUnchecked; TypeBinding[] substitutes; final static int FAILED = 1; - final static int RAW_SUBSTITUTION = 2; public InferenceContext(MethodBinding genericMethod) { this.genericMethod = genericMethod; @@ -33,16 +33,6 @@ this.substitutes = new TypeBinding[varLength]; } -public boolean checkRawSubstitution() { - // only at first level, during inference from arguments - if (this.depth > 0) return false; -// if (this.argumentIndex < 0 || this.depth != 0) { -// return false; -// } - this.status = RAW_SUBSTITUTION; - return true; -} - public TypeBinding[] getSubstitutes(TypeVariableBinding typeVariable, int constraint) { return this.collectedSubstitutes[typeVariable.rank][constraint]; } @@ -99,9 +89,6 @@ case FAILED : buffer.append("failed]");//$NON-NLS-1$ break; - case RAW_SUBSTITUTION : - buffer.append("raw-subst]");//$NON-NLS-1$ - break; } if (this.expectedType == null) { buffer.append(" [expectedType=null]"); //$NON-NLS-1$ Index: compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java 7 Jul 2008 17:08:07 -0000 1.45 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java 8 Jan 2009 10:18:41 -0000 @@ -53,7 +53,6 @@ * Answer the receiver's binding type from Binding.BindingID. */ public final int kind() { - return LOCAL; } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java,v --- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 6 Oct 2008 13:23:51 -0000 1.103 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 8 Jan 2009 10:18:42 -0000 @@ -724,7 +724,7 @@ } if (variable.firstBound == null) // unbound variable return false; - TypeBinding eliminatedType = (paramType.environment.convertEliminatingTypeVariables(variable, paramType.genericType(), rank, null)); + TypeBinding eliminatedType = Scope.convertEliminatingTypeVariables(variable, paramType.genericType(), rank, null); switch (eliminatedType.kind()) { case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : @@ -779,7 +779,7 @@ } if (otherVariable.firstBound == null) // unbound variable return false; - TypeBinding otherEliminatedType = (paramType.environment.convertEliminatingTypeVariables(otherVariable, paramType.genericType(), rank, null)); + TypeBinding otherEliminatedType = Scope.convertEliminatingTypeVariables(otherVariable, paramType.genericType(), rank, null); switch (otherEliminatedType.kind()) { case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java,v --- eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java 27 Jun 2008 16:04:06 -0000 1.20 +++ eval/org/eclipse/jdt/internal/eval/CodeSnippetSuperReference.java 8 Jan 2009 10:18:43 -0000 @@ -55,5 +55,9 @@ // ignored } +public void setUnchecked(boolean isUnchecked) { + // ignored +} + } Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java,v --- eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java 30 Sep 2008 15:31:26 -0000 1.60 +++ eval/org/eclipse/jdt/internal/eval/CodeSnippetMessageSend.java 8 Jan 2009 10:18:43 -0000 @@ -11,6 +11,7 @@ package org.eclipse.jdt.internal.eval; import org.eclipse.jdt.core.compiler.CharOperation; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.CastExpression; import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.MessageSend; @@ -311,7 +312,7 @@ } } } - checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this); + checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this, (this.bits & ASTNode.Unchecked) != 0); //-------message send that are known to fail at compile time----------- if (this.binding.isAbstract()) { @@ -331,7 +332,13 @@ this.resolvedType = this.actualReceiverType; } else { TypeBinding returnType = this.binding.returnType; - if (returnType != null) returnType = returnType.capture(scope, this.sourceEnd); + + if (returnType != null) { + if ((this.bits & ASTNode.Unchecked) != 0) { + returnType = scope.environment().convertToRawType(returnType.erasure(), true); + } + returnType = returnType.capture(scope, this.sourceEnd); + } this.resolvedType = returnType; } return this.resolvedType; Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java,v --- eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java 25 Sep 2008 23:10:29 -0000 1.35 +++ eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java 8 Jan 2009 10:18:43 -0000 @@ -41,6 +41,7 @@ this.evaluationContext = evaluationContext; this.isImplicit = isImplicit; } + public boolean checkAccess(MethodScope methodScope) { // this/super cannot be used in constructor call if (this.evaluationContext.isConstructorCall) { @@ -55,6 +56,7 @@ } return true; } + public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) { int pc = codeStream.position; if (valueRequired) { @@ -63,18 +65,22 @@ } codeStream.recordPositionsFrom(pc, this.sourceStart); } + /** * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#genericTypeArguments() */ public TypeBinding[] genericTypeArguments() { return null; } + public boolean isSuperAccess(){ return false; } + public boolean isTypeAccess(){ return false; } + public StringBuffer printExpression(int indent, StringBuffer output){ char[] declaringType = this.evaluationContext.declaringTypeName; @@ -85,8 +91,8 @@ output.append(declaringType); return output.append(")this"); //$NON-NLS-1$ } + public TypeBinding resolveType(BlockScope scope) { - // implicit this this.constant = Constant.NotAConstant; TypeBinding snippetType = null; @@ -105,13 +111,20 @@ } return this.resolvedType = this.delegateThis.type; } + public void setActualReceiverType(ReferenceBinding receiverType) { // ignored } + public void setDepth(int depth){ // ignored } + public void setFieldIndex(int index){ // ignored } + + public void setUnchecked(boolean isUnchecked) { + // ignored + } } Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v --- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 10 Dec 2008 19:39:17 -0000 1.386 +++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 8 Jan 2009 10:18:43 -0000 @@ -21,15 +21,97 @@ import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.core.compiler.IProblem; import org.eclipse.jdt.core.compiler.InvalidInputException; -import org.eclipse.jdt.internal.compiler.*; -import org.eclipse.jdt.internal.compiler.ast.*; +import org.eclipse.jdt.internal.compiler.CompilationResult; +import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; +import org.eclipse.jdt.internal.compiler.IProblemFactory; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; +import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; +import org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration; +import org.eclipse.jdt.internal.compiler.ast.AllocationExpression; +import org.eclipse.jdt.internal.compiler.ast.Annotation; +import org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration; +import org.eclipse.jdt.internal.compiler.ast.Argument; +import org.eclipse.jdt.internal.compiler.ast.ArrayAllocationExpression; +import org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference; +import org.eclipse.jdt.internal.compiler.ast.ArrayReference; +import org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference; +import org.eclipse.jdt.internal.compiler.ast.Assignment; +import org.eclipse.jdt.internal.compiler.ast.BinaryExpression; +import org.eclipse.jdt.internal.compiler.ast.Block; +import org.eclipse.jdt.internal.compiler.ast.BranchStatement; +import org.eclipse.jdt.internal.compiler.ast.CaseStatement; +import org.eclipse.jdt.internal.compiler.ast.CastExpression; +import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; +import org.eclipse.jdt.internal.compiler.ast.CompoundAssignment; +import org.eclipse.jdt.internal.compiler.ast.ConditionalExpression; +import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; +import org.eclipse.jdt.internal.compiler.ast.EqualExpression; +import org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall; +import org.eclipse.jdt.internal.compiler.ast.Expression; +import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; +import org.eclipse.jdt.internal.compiler.ast.FieldReference; +import org.eclipse.jdt.internal.compiler.ast.ImportReference; +import org.eclipse.jdt.internal.compiler.ast.Initializer; +import org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression; +import org.eclipse.jdt.internal.compiler.ast.IntLiteral; +import org.eclipse.jdt.internal.compiler.ast.LabeledStatement; +import org.eclipse.jdt.internal.compiler.ast.Literal; +import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration; +import org.eclipse.jdt.internal.compiler.ast.LongLiteral; +import org.eclipse.jdt.internal.compiler.ast.MemberValuePair; +import org.eclipse.jdt.internal.compiler.ast.MessageSend; +import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; +import org.eclipse.jdt.internal.compiler.ast.NameReference; +import org.eclipse.jdt.internal.compiler.ast.NumberLiteral; +import org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference; +import org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference; +import org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression; +import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference; +import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference; +import org.eclipse.jdt.internal.compiler.ast.Reference; +import org.eclipse.jdt.internal.compiler.ast.ReturnStatement; +import org.eclipse.jdt.internal.compiler.ast.SingleNameReference; +import org.eclipse.jdt.internal.compiler.ast.Statement; +import org.eclipse.jdt.internal.compiler.ast.SwitchStatement; +import org.eclipse.jdt.internal.compiler.ast.ThisReference; +import org.eclipse.jdt.internal.compiler.ast.TryStatement; +import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; +import org.eclipse.jdt.internal.compiler.ast.TypeParameter; +import org.eclipse.jdt.internal.compiler.ast.TypeReference; +import org.eclipse.jdt.internal.compiler.ast.UnaryExpression; +import org.eclipse.jdt.internal.compiler.ast.Wildcard; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.internal.compiler.env.AccessRestriction; import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.impl.ReferenceContext; -import org.eclipse.jdt.internal.compiler.lookup.*; -import org.eclipse.jdt.internal.compiler.parser.*; +import org.eclipse.jdt.internal.compiler.lookup.ArrayBinding; +import org.eclipse.jdt.internal.compiler.lookup.Binding; +import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers; +import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; +import org.eclipse.jdt.internal.compiler.lookup.InvocationSite; +import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; +import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; +import org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding; +import org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding; +import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; +import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; +import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; +import org.eclipse.jdt.internal.compiler.lookup.Scope; +import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; +import org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding; +import org.eclipse.jdt.internal.compiler.lookup.TagBits; +import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; +import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; +import org.eclipse.jdt.internal.compiler.lookup.TypeIds; +import org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; +import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding; +import org.eclipse.jdt.internal.compiler.parser.JavadocTagConstants; +import org.eclipse.jdt.internal.compiler.parser.Parser; +import org.eclipse.jdt.internal.compiler.parser.RecoveryScanner; +import org.eclipse.jdt.internal.compiler.parser.Scanner; +import org.eclipse.jdt.internal.compiler.parser.ScannerHelper; +import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; import org.eclipse.jdt.internal.compiler.util.Messages; public class ProblemReporter extends ProblemHandler { @@ -6828,7 +6910,7 @@ nodeSourceStart(field,location), nodeSourceEnd(field, location)); } -public void unsafeRawGenericMethodInvocation(ASTNode location, MethodBinding rawMethod) { +public void unsafeRawGenericMethodInvocation(ASTNode location, MethodBinding rawMethod, TypeBinding[] argumentTypes) { boolean isConstructor = rawMethod.isConstructor(); int severity = computeSeverity(isConstructor ? IProblem.UnsafeRawGenericConstructorInvocation : IProblem.UnsafeRawGenericMethodInvocation); if (severity == ProblemSeverities.Ignore) return; @@ -6839,13 +6921,13 @@ new String(rawMethod.declaringClass.sourceName()), typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, false), new String(rawMethod.declaringClass.readableName()), - typesAsString(rawMethod.original().isVarargs(), rawMethod.parameters, false), + typesAsString(rawMethod.original().isVarargs(), argumentTypes, false), }, new String[] { new String(rawMethod.declaringClass.sourceName()), typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, true), new String(rawMethod.declaringClass.shortReadableName()), - typesAsString(rawMethod.original().isVarargs(), rawMethod.parameters, true), + typesAsString(false, argumentTypes, true), }, severity, location.sourceStart, @@ -6857,13 +6939,13 @@ new String(rawMethod.selector), typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, false), new String(rawMethod.declaringClass.readableName()), - typesAsString(rawMethod.original().isVarargs(), rawMethod.parameters, false), + typesAsString(false, argumentTypes, false), }, new String[] { new String(rawMethod.selector), typesAsString(rawMethod.original().isVarargs(), rawMethod.original().parameters, true), new String(rawMethod.declaringClass.shortReadableName()), - typesAsString(rawMethod.original().isVarargs(), rawMethod.parameters, true), + typesAsString(false, argumentTypes, true), }, severity, location.sourceStart, Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v --- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 5 Dec 2008 15:55:50 -0000 1.382 +++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 8 Jan 2009 10:18:40 -0000 @@ -452,6 +452,7 @@ public void setActualReceiverType(ReferenceBinding receiverType) {/* empty */} public void setDepth(int depth){/* empty */} public void setFieldIndex(int depth){/* empty */} + public void setUnchecked(boolean isUnchecked) {/* empty */} public int sourceEnd() { return 0; } public int sourceStart() { return 0; } };