protected JavaSearchPattern(int patternKind, int matchRule) { super(matchRule); this.kind = patternKind; // Use getMatchRule() instead of matchRule as super constructor may modify its value // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=81377 int rule = getMatchRule(); this.isCaseSensitive = (rule & R_CASE_SENSITIVE) != 0; this.isCamelCase = (rule & (R_CAMELCASE_MATCH | R_CAMELCASE_SAME_PART_COUNT_MATCH)) != 0; this.matchCompatibility = rule & MATCH_COMPATIBILITY_MASK; this.matchMode = rule & MATCH_MODE_MASK; }
/** * Returns whether the pattern includes type parameters information or not. * @return true if {@link #typeArguments} contains type parameters instead * type arguments signatures. */ public final boolean hasTypeParameters() { return !hasSignatures() && hasTypeArguments(); }
@Override public final String toString() { return print(new StringBuffer(30)).toString(); } }
protected StringBuffer print(StringBuffer output) { output.append(", "); //$NON-NLS-1$ if (hasTypeArguments() && hasSignatures()) { output.append("signature:\""); //$NON-NLS-1$ output.append(this.typeSignatures[0]); output.append("\", "); //$NON-NLS-1$ switch(getMatchMode()) { case R_EXACT_MATCH : output.append("exact match, "); //$NON-NLS-1$ break; if (isCaseSensitive()) output.append("case sensitive, "); //$NON-NLS-1$ else output.append(getFineGrainFlagString(this.fineGrain)); return output;
if (typeArguments != null) { boolean shouldMatchErasure= (this.pattern instanceof OrPattern) ? ((OrPattern)this.pattern).isErasureMatch() : ((JavaSearchPattern)this.pattern).isErasureMatch(); boolean hasSignatures = (this.pattern instanceof OrPattern) ? ((OrPattern)this.pattern).hasSignatures() : ((JavaSearchPattern)this.pattern).hasSignatures(); if (shouldMatchErasure || !hasSignatures) {
/** * Returns whether the pattern has signatures or not. * @return true if one at least of the stored pattern has signatures. */ public final boolean hasSignatures() { boolean isErasureMatch = isErasureMatch(); for (int i = 0, length = this.patterns.length; i < length && !isErasureMatch; i++) { if (((JavaSearchPattern) this.patterns[i]).hasSignatures()) return true; } return false; }
String signature = bindingKey.toSignature(); this.typeSignatures = Util.splitTypeLevelsSignature(signature); setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); if (++ptr < typeParameters.length) System.arraycopy(typeParameters, 0, typeParameters = new char[ptr][][], 0, ptr); setTypeArguments(typeParameters);
boolean isErasureMatch= (this.pattern instanceof OrPattern) ? ((OrPattern)this.pattern).isErasureMatch() : ((JavaSearchPattern)this.pattern).isErasureMatch(); if (!isErasureMatch) {
System.out.print(" (locator: "+this.patternLocator.mustResolve); //$NON-NLS-1$ System.out.println(", nodeSet: "+nodeSet.mustResolve+')'); //$NON-NLS-1$ System.out.println(" - fine grain flags="+ JavaSearchPattern.getFineGrainFlagString(this.patternLocator.fineGrain())); //$NON-NLS-1$
protected StringBuffer print(StringBuffer output) { output.append(", "); //$NON-NLS-1$ if (hasTypeArguments() && hasSignatures()) { output.append("signature:\""); //$NON-NLS-1$ output.append(this.typeSignatures[0]); output.append("\", "); //$NON-NLS-1$ switch(getMatchMode()) { case R_EXACT_MATCH : output.append("exact match, "); //$NON-NLS-1$ break; if (isCaseSensitive()) output.append("case sensitive, "); //$NON-NLS-1$ else output.append(getFineGrainFlagString(this.fineGrain)); return output;
if (typeArguments != null) { boolean shouldMatchErasure= (this.pattern instanceof OrPattern) ? ((OrPattern)this.pattern).isErasureMatch() : ((JavaSearchPattern)this.pattern).isErasureMatch(); boolean hasSignatures = (this.pattern instanceof OrPattern) ? ((OrPattern)this.pattern).hasSignatures() : ((JavaSearchPattern)this.pattern).hasSignatures(); if (shouldMatchErasure || !hasSignatures) {
/** * Returns whether the pattern has signatures or not. * @return true if one at least of the stored pattern has signatures. */ public final boolean hasSignatures() { boolean isErasureMatch = isErasureMatch(); for (int i = 0, length = this.patterns.length; i < length && !isErasureMatch; i++) { if (((JavaSearchPattern) this.patterns[i]).hasSignatures()) return true; } return false; }
String signature = bindingKey.toSignature(); this.typeSignatures = Util.splitTypeLevelsSignature(signature); setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); if (++ptr < typeParameters.length) System.arraycopy(typeParameters, 0, typeParameters = new char[ptr][][], 0, ptr); setTypeArguments(typeParameters);
boolean isErasureMatch= (this.pattern instanceof OrPattern) ? ((OrPattern)this.pattern).isErasureMatch() : ((JavaSearchPattern)this.pattern).isErasureMatch(); if (!isErasureMatch) {
System.out.print(" (locator: "+this.patternLocator.mustResolve); //$NON-NLS-1$ System.out.println(", nodeSet: "+nodeSet.mustResolve+')'); //$NON-NLS-1$ System.out.println(" - fine grain flags="+ JavaSearchPattern.getFineGrainFlagString(this.patternLocator.fineGrain())); //$NON-NLS-1$
protected StringBuffer print(StringBuffer output) { output.append(", "); //$NON-NLS-1$ if (hasTypeArguments() && hasSignatures()) { output.append("signature:\""); //$NON-NLS-1$ output.append(this.typeSignatures[0]); output.append("\", "); //$NON-NLS-1$ switch(getMatchMode()) { case R_EXACT_MATCH : output.append("exact match, "); //$NON-NLS-1$ break; if (isCaseSensitive()) output.append("case sensitive, "); //$NON-NLS-1$ else output.append(getFineGrainFlagString(this.fineGrain)); return output;
public final String toString() { return print(new StringBuffer(30)).toString(); } }
/** * Returns whether the pattern includes type parameters information or not. * @return true if {@link #typeArguments} contains type parameters instead * type arguments signatures. */ public final boolean hasTypeParameters() { return !hasSignatures() && hasTypeArguments(); }
if (typeArguments != null) { boolean shouldMatchErasure= (this.pattern instanceof OrPattern) ? ((OrPattern)this.pattern).isErasureMatch() : ((JavaSearchPattern)this.pattern).isErasureMatch(); boolean hasSignatures = (this.pattern instanceof OrPattern) ? ((OrPattern)this.pattern).hasSignatures() : ((JavaSearchPattern)this.pattern).hasSignatures(); if (shouldMatchErasure || !hasSignatures) {
/** * Returns whether the pattern has signatures or not. * @return true if one at least of the stored pattern has signatures. */ public final boolean hasSignatures() { boolean isErasureMatch = isErasureMatch(); for (int i = 0, length = this.patterns.length; i < length && !isErasureMatch; i++) { if (((JavaSearchPattern) this.patterns[i]).hasSignatures()) return true; } return false; }