List of usage examples for org.eclipse.jdt.internal.compiler.lookup TagBits ForcedToBeRawType
long ForcedToBeRawType
To view the source code for org.eclipse.jdt.internal.compiler.lookup TagBits ForcedToBeRawType.
Click Source Link
From source file:org.eclipse.jdt.internal.compiler.lookup.MethodVerifier15.java
License:Open Source License
public void reportRawReferences(MethodBinding currentMethod, MethodBinding inheritedMethod) { CompilerOptions compilerOptions = this.type.scope.compilerOptions(); if (compilerOptions.sourceLevel < ClassFileConstants.JDK1_5 // shouldn't whine at all || compilerOptions.reportUnavoidableGenericTypeProblems) { // must have already whined return;/*from w ww.j a v a2 s. c o m*/ } AbstractMethodDeclaration methodDecl = currentMethod.sourceMethod(); if (methodDecl == null) return; TypeBinding[] parameterTypes = currentMethod.parameters; TypeBinding[] inheritedParameterTypes = inheritedMethod.parameters; Argument[] arguments = methodDecl.arguments; for (int j = 0, size = currentMethod.parameters.length; j < size; j++) { TypeBinding parameterType = parameterTypes[j]; TypeBinding inheritedParameterType = inheritedParameterTypes[j]; Argument arg = arguments[j]; if (parameterType.leafComponentType().isRawType()) { if (inheritedParameterType.leafComponentType().isRawType()) { arg.binding.tagBits |= TagBits.ForcedToBeRawType; } else { if (compilerOptions.getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore && (arg.type.bits & ASTNode.IgnoreRawTypeCheck) == 0) { methodDecl.scope.problemReporter().rawTypeReference(arg.type, parameterType); } } } } TypeReference returnType = null; if (!methodDecl.isConstructor() && methodDecl instanceof MethodDeclaration && (returnType = ((MethodDeclaration) methodDecl).returnType) != null) { final TypeBinding inheritedMethodType = inheritedMethod.returnType; final TypeBinding methodType = currentMethod.returnType; if (methodType.leafComponentType().isRawType()) { if (inheritedMethodType.leafComponentType().isRawType()) { // } else { if ((returnType.bits & ASTNode.IgnoreRawTypeCheck) == 0 && compilerOptions .getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) { methodDecl.scope.problemReporter().rawTypeReference(returnType, methodType); } } } } }