@Override public boolean onAccess(char[][] tokens, int index) { return !CharOperation.equals(tokens[index + 1], tokens[tokens.length - 1]); } });
for (int i = 0; i < packageName.length; i++) { char[] chars = packageName[i]; if (!CharOperation.equals(chars, tokens[i])) { isFound = false; break;
/** * Checks if the qualified name reference is a problem field binding and have a valid field. * * @param qualifiedNameReference * Reference which should contains a problem field binding. * @return true if the qualified name reference is a valid problem field binding. */ static boolean isValidProblemBindingField(QualifiedNameReference qualifiedNameReference) { return qualifiedNameReference.binding instanceof ProblemFieldBinding && !((FieldBinding) qualifiedNameReference.binding).declaringClass.isAnonymousType() && qualifiedNameReference.tokens.length - 1 == ((FieldBinding) qualifiedNameReference.binding).declaringClass.compoundName.length && CharOperation .equals(CharOperation.subarray(qualifiedNameReference.tokens, 0, qualifiedNameReference.tokens.length - 1), ((FieldBinding) qualifiedNameReference.binding).declaringClass.compoundName); }
public boolean equals(Object obj) { if (obj instanceof ExceptionMarker) { ExceptionMarker marker = (ExceptionMarker) obj; return this.pc == marker.pc && CharOperation.equals(this.constantPoolName, marker.constantPoolName); } return false; } public int hashCode() {
public TypeVariableBinding getTypeVariable(char[] variableName) { for (int i = this.typeVariables.length; --i >= 0;) if (CharOperation.equals(this.typeVariables[i].sourceName, variableName)) return this.typeVariables[i]; return null; }
private boolean isPackageOfQualifiedTypeName(char[][] packageName, char[][] typeName) { int length; if (typeName == null || (length = packageName.length) != typeName.length -1) return false; for (int i=0; i<length; i++) if (!CharOperation.equals(packageName[i], typeName[i])) return false; return true; }
public LocalVariableBinding findVariable(char[] variableName) { int varLength = variableName.length; for (int i = this.localIndex-1; i >= 0; i--) { // lookup backward to reach latest additions first LocalVariableBinding local; char[] localName; if ((localName = (local = this.locals[i]).name).length == varLength && CharOperation.equals(localName, variableName)) return local; } return null; }
public final boolean isDuplicateLocalVariable(char[] name) { BlockScope current = this; while (true) { for (int i = 0; i < this.localIndex; i++) { if (CharOperation.equals(name, current.locals[i].name)) return true; } if (current.kind != Scope.BLOCK_SCOPE) return false; current = (BlockScope)current.parent; } }
protected int applyCloseableInterfaceWhitelists() { switch (this.compoundName.length) { case 4: if (CharOperation.equals(this.compoundName, TypeConstants.RESOURCE_FREE_CLOSEABLE_STREAM)) return TypeIds.BitResourceFreeCloseable; break; } return 0; }
if (CharOperation.equals(argument.name, singleNameReference.token)) { CtTypeReference<?> declaringType = null; if (lambdaJDT.enclosingScope instanceof MethodScope) {
boolean isMissingType(char[] typeName) { for (int i = this.missingTypes == null ? 0 : this.missingTypes.size(); --i >= 0;) { MissingTypeBinding missingType = (MissingTypeBinding) this.missingTypes.get(i); if (CharOperation.equals(missingType.sourceName, typeName)) return true; } return false; }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof IModule.IModuleReference)) return false; IModule.IModuleReference mod = (IModule.IModuleReference) o; if (this.modifiers != mod.getModifiers()) return false; return CharOperation.equals(this.name, mod.name()); } @Override
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof IModule.IModuleReference)) return false; IModule.IModuleReference mod = (IModule.IModuleReference) o; if (this.modifiers != mod.getModifiers()) return false; return CharOperation.equals(this.refName, mod.name(), false); } @Override
@Override public boolean equals(Object o) { if (!(o instanceof FieldInfo)) { return false; } return CharOperation.equals(getName(), ((FieldInfo) o).getName()); } @Override
@Override public boolean equals(Object obj) { if (!(obj instanceof SyntheticLocalVariableBinding)) return false; return CharOperation.equals(computeUniqueKey(), ((SyntheticLocalVariableBinding) obj).computeUniqueKey()); } }
public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { if (!CharOperation.equals(sourceUnit.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) { // do not accept package-info.java as a type for completion engine // because it contains no extra info that will help in completion // https://bugs.eclipse.org/bugs/show_bug.cgi?id=343865 // Required after the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=337868 // because now we get a type corresponding to the package-info.java from the java model. super.accept(sourceUnit, accessRestriction); } }
public NameEnvironmentAnswer findSecondaryInClass(char[] typeName, String qualifiedPackageName, String qualifiedBinaryFileName) { //"package-info" is a reserved class name and can never be a secondary type (it is much faster to stop the search here). if(CharOperation.equals(TypeConstants.PACKAGE_INFO_NAME, typeName)) { return null; } String typeNameString = new String(typeName); String moduleName = this.module != null ? String.valueOf(this.module.name()) : null; // TODO(SHMOD): test for ModuleBinding.ANY & UNNAMED boolean prereqs = this.options != null && isPackage(qualifiedPackageName, moduleName) && ((this.mode & SOURCE) != 0) && doesFileExist(typeNameString + SUFFIX_STRING_java, qualifiedPackageName); return prereqs ? null : findSourceSecondaryType(typeNameString, qualifiedPackageName, qualifiedBinaryFileName); /* only secondary types */ }
if (CharOperation.equals(anImport.getImportName()[anImport.getImportName().length - 1], expectedName)) { if (anImport.isStatic()) { int indexDeclaring = 2;
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(); } }