本文整理了Java中org.eclipse.jdt.internal.compiler.lookup.BlockScope.problemReporter()
方法的一些代码示例,展示了BlockScope.problemReporter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlockScope.problemReporter()
方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.lookup.BlockScope
类名称:BlockScope
方法名:problemReporter
暂无
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
private void checkAndSetModifiersForVariable(LocalVariableBinding varBinding) {
int modifiers = varBinding.modifiers;
if ((modifiers & ExtraCompilerModifiers.AccAlternateModifierProblem) != 0 && varBinding.declaration != null){
problemReporter().duplicateModifierForVariable(varBinding.declaration, this instanceof MethodScope);
}
int realModifiers = modifiers & ExtraCompilerModifiers.AccJustFlag;
int unexpectedModifiers = ~ClassFileConstants.AccFinal;
if ((realModifiers & unexpectedModifiers) != 0 && varBinding.declaration != null){
problemReporter().illegalModifierForVariable(varBinding.declaration, this instanceof MethodScope);
}
varBinding.modifiers = modifiers;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
public void checkAndSetModifiers() {
int realModifiers = this.modifiers & ExtraCompilerModifiers.AccJustFlag;
int expectedModifiers = ClassFileConstants.ACC_OPEN | ClassFileConstants.ACC_SYNTHETIC;
if ((realModifiers & ~(expectedModifiers)) != 0) {
this.scope.problemReporter().illegalModifierForModule(this);
realModifiers &= expectedModifiers;
}
int effectiveModifiers = ClassFileConstants.AccModule | realModifiers;
this.modifiers = this.binding.modifiers = effectiveModifiers;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
public TypeBinding reportError(BlockScope scope) {
//=====error cases=======
this.constant = Constant.NotAConstant;
if (this.binding instanceof ProblemFieldBinding) {
scope.problemReporter().invalidField(this, (FieldBinding) this.binding);
} else if (this.binding instanceof ProblemReferenceBinding || this.binding instanceof MissingTypeBinding) {
scope.problemReporter().invalidType(this, (TypeBinding) this.binding);
} else {
scope.problemReporter().unresolvableReference(this, this.binding);
}
return null;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
private void reportResourceLeak(FakedTrackingVariable trackingVar, ASTNode location, int nullStatus) {
if (location != null)
trackingVar.recordErrorLocation(location, nullStatus);
else
trackingVar.reportError(problemReporter(), null, nullStatus);
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
@Override
public boolean checkNPE(BlockScope scope, FlowContext flowContext, FlowInfo flowInfo, int ttlForFieldCheck) {
if ((this.resolvedType.tagBits & TagBits.AnnotationNullable) != 0) {
scope.problemReporter().arrayReferencePotentialNullReference(this);
return true;
} else {
return super.checkNPE(scope, flowContext, flowInfo, ttlForFieldCheck);
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
public void resolveUsing(BlockScope givenScope) {
if ((this.bits & UndocumentedEmptyBlock) != 0) {
givenScope.problemReporter().undocumentedEmptyBlock(this.sourceStart, this.sourceEnd);
}
// this optimized resolve(...) is sent only on none empty blocks
this.scope = givenScope;
if (this.statements != null) {
for (int i = 0, length = this.statements.length; i < length; i++) {
this.statements[i].resolve(this.scope);
}
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
public void resolveUsing(BlockScope givenScope) {
if ((this.bits & UndocumentedEmptyBlock) != 0) {
givenScope.problemReporter().undocumentedEmptyBlock(this.sourceStart, this.sourceEnd);
}
// this optimized resolve(...) is sent only on none empty blocks
this.scope = givenScope;
if (this.statements != null) {
for (int i = 0, length = this.statements.length; i < length; i++) {
this.statements[i].resolve(this.scope);
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
public void resolveUsing(BlockScope givenScope) {
if ((this.bits & UndocumentedEmptyBlock) != 0) {
givenScope.problemReporter().undocumentedEmptyBlock(this.sourceStart, this.sourceEnd);
}
// this optimized resolve(...) is sent only on none empty blocks
this.scope = givenScope;
if (this.statements != null) {
for (int i = 0, length = this.statements.length; i < length; i++) {
this.statements[i].resolve(this.scope);
}
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
public boolean checkNPE(BlockScope scope, FlowContext flowContext, FlowInfo flowInfo) {
if ((this.resolvedType.tagBits & TagBits.AnnotationNullable) != 0) {
scope.problemReporter().arrayReferencePotentialNullReference(this);
return true;
} else {
return super.checkNPE(scope, flowContext, flowInfo);
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
public void resolveUsing(BlockScope givenScope) {
if ((this.bits & UndocumentedEmptyBlock) != 0) {
givenScope.problemReporter().undocumentedEmptyBlock(this.sourceStart, this.sourceEnd);
}
// this optimized resolve(...) is sent only on none empty blocks
this.scope = givenScope;
if (this.statements != null) {
for (int i = 0, length = this.statements.length; i < length; i++) {
this.statements[i].resolve(this.scope);
}
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
void checkAssignment(BlockScope scope, TypeBinding lhsType, TypeBinding rhsType) {
FieldBinding leftField = getLastField(this.lhs);
if (leftField != null && rhsType != TypeBinding.NULL && (lhsType.kind() == Binding.WILDCARD_TYPE) && ((WildcardBinding)lhsType).boundKind != Wildcard.SUPER) {
scope.problemReporter().wildcardAssignment(lhsType, rhsType, this.expression);
} else if (leftField != null && !leftField.isStatic() && leftField.declaringClass != null /*length pseudo field*/&& leftField.declaringClass.isRawType()) {
scope.problemReporter().unsafeRawFieldAssignment(leftField, rhsType, this.lhs);
} else if (rhsType.needsUncheckedConversion(lhsType)) {
scope.problemReporter().unsafeTypeConversion(this.expression, rhsType, lhsType);
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
void checkAssignment(BlockScope scope, TypeBinding lhsType, TypeBinding rhsType) {
FieldBinding leftField = getLastField(this.lhs);
if (leftField != null && rhsType != TypeBinding.NULL && (lhsType.kind() == Binding.WILDCARD_TYPE) && ((WildcardBinding)lhsType).boundKind != Wildcard.SUPER) {
scope.problemReporter().wildcardAssignment(lhsType, rhsType, this.expression);
} else if (leftField != null && !leftField.isStatic() && leftField.declaringClass != null /*length pseudo field*/&& leftField.declaringClass.isRawType()) {
scope.problemReporter().unsafeRawFieldAssignment(leftField, rhsType, this.lhs);
} else if (rhsType.needsUncheckedConversion(lhsType)) {
scope.problemReporter().unsafeTypeConversion(this.expression, rhsType, lhsType);
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
static void checkAnnotationTarget(Annotation annotation, BlockScope scope, ReferenceBinding annotationType, int kind, Binding recipient, long tagBitsToRevert) {
// check (meta)target compatibility
if (!annotationType.isValidBinding()) {
// no need to check annotation usage if missing
return;
}
if (! isAnnotationTargetAllowed(annotation, scope, annotationType, kind)) {
scope.problemReporter().disallowedTargetForAnnotation(annotation);
if (recipient instanceof TypeBinding)
((TypeBinding)recipient).tagBits &= ~tagBitsToRevert;
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
public TypeBinding resolveType(BlockScope scope) {
// compute the real value, which must range its type's range
this.resolvedType = literalType(scope);
// in case of error, constant did remain null
computeConstant();
if (this.constant == null) {
scope.problemReporter().constantOutOfRange(this, this.resolvedType);
this.constant = Constant.NotAConstant;
}
return this.resolvedType;
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
public TypeBinding resolveType(BlockScope scope) {
this.constant = Constant.NotAConstant;
ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType();
if (!checkAccess(scope, enclosingReceiverType))
return null;
if (enclosingReceiverType.id == T_JavaLangObject) {
scope.problemReporter().cannotUseSuperInJavaLangObject(this);
return null;
}
return this.resolvedType = enclosingReceiverType.superclass();
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
public static void checkContainingAnnotationTargetAtUse(Annotation repeatingAnnotation, BlockScope scope, TypeBinding containerAnnotationType, TypeBinding repeatingAnnotationType) {
// check (meta)target compatibility
if (!repeatingAnnotationType.isValidBinding()) {
// no need to check annotation usage if missing
return;
}
if (! isAnnotationTargetAllowed(repeatingAnnotation, scope, containerAnnotationType, repeatingAnnotation.recipient.kind())) {
scope.problemReporter().disallowedTargetForContainerAnnotation(repeatingAnnotation, containerAnnotationType);
}
}
代码示例来源:origin: org.eclipse.jdt.core.compiler/ecj
void checkLabelValidity(BlockScope scope) {
// check if label was already defined above
FlowContext current = this.getLocalParent();
while (current != null) {
char[] currentLabelName;
if (((currentLabelName = current.labelName()) != null)
&& CharOperation.equals(currentLabelName, this.labelName)) {
scope.problemReporter().alreadyDefinedLabel(this.labelName, this.associatedNode);
}
current = current.getLocalParent();
}
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
void checkLabelValidity(BlockScope scope) {
// check if label was already defined above
FlowContext current = this.getLocalParent();
while (current != null) {
char[] currentLabelName;
if (((currentLabelName = current.labelName()) != null)
&& CharOperation.equals(currentLabelName, this.labelName)) {
scope.problemReporter().alreadyDefinedLabel(this.labelName, this.associatedNode);
}
current = current.getLocalParent();
}
}
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
public TypeBinding resolveType(BlockScope scope) {
this.constant = Constant.NotAConstant;
if (!checkAccess(scope.methodScope()))
return null;
ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType();
if (enclosingReceiverType.id == T_JavaLangObject) {
scope.problemReporter().cannotUseSuperInJavaLangObject(this);
return null;
}
return this.resolvedType = enclosingReceiverType.superclass();
}
代码示例来源:origin: org.eclipse.jetty.orbit/org.eclipse.jdt.core
void checkLabelValidity(BlockScope scope) {
// check if label was already defined above
FlowContext current = this.getLocalParent();
while (current != null) {
char[] currentLabelName;
if (((currentLabelName = current.labelName()) != null)
&& CharOperation.equals(currentLabelName, this.labelName)) {
scope.problemReporter().alreadyDefinedLabel(this.labelName, this.associatedNode);
}
current = current.getLocalParent();
}
}
内容来源于网络,如有侵权,请联系作者删除!