本文整理汇总了Java中org.eclipse.jdt.internal.compiler.lookup.TypeBinding.shortReadableName方法的典型用法代码示例。如果您正苦于以下问题:Java TypeBinding.shortReadableName方法的具体用法?Java TypeBinding.shortReadableName怎么用?Java TypeBinding.shortReadableName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.compiler.lookup.TypeBinding
的用法示例。
在下文中一共展示了TypeBinding.shortReadableName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: operatorOnlyValidOnNumericType
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void operatorOnlyValidOnNumericType(CompoundAssignment assignment, TypeBinding leftType, TypeBinding rightType) {
String leftName = new String(leftType.readableName());
String rightName = new String(rightType.readableName());
String leftShortName = new String(leftType.shortReadableName());
String rightShortName = new String(rightType.shortReadableName());
if (leftShortName.equals(rightShortName)){
leftShortName = leftName;
rightShortName = rightName;
}
this.handle(
IProblem.TypeMismatch,
new String[] {leftName, rightName },
new String[] {leftShortName, rightShortName },
assignment.sourceStart,
assignment.sourceEnd);
}
示例2: invalidOperator
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void invalidOperator(BinaryExpression expression, TypeBinding leftType, TypeBinding rightType) {
String leftName = new String(leftType.readableName());
String rightName = new String(rightType.readableName());
String leftShortName = new String(leftType.shortReadableName());
String rightShortName = new String(rightType.shortReadableName());
if (leftShortName.equals(rightShortName)){
leftShortName = leftName;
rightShortName = rightName;
}
this.handle(
IProblem.InvalidOperator,
new String[] {
expression.operatorToString(),
leftName + ", " + rightName}, //$NON-NLS-1$
new String[] {
expression.operatorToString(),
leftShortName + ", " + rightShortName}, //$NON-NLS-1$
expression.sourceStart,
expression.sourceEnd);
}
示例3: notCompatibleTypesError
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void notCompatibleTypesError(EqualExpression expression, TypeBinding leftType, TypeBinding rightType) {
String leftName = new String(leftType.readableName());
String rightName = new String(rightType.readableName());
String leftShortName = new String(leftType.shortReadableName());
String rightShortName = new String(rightType.shortReadableName());
if (leftShortName.equals(rightShortName)){
leftShortName = leftName;
rightShortName = rightName;
}
this.handle(
IProblem.IncompatibleTypesInEqualityOperator,
new String[] {leftName, rightName },
new String[] {leftShortName, rightShortName },
expression.sourceStart,
expression.sourceEnd);
}
示例4: notCompatibleTypesErrorInForeach
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void notCompatibleTypesErrorInForeach(Expression expression, TypeBinding leftType, TypeBinding rightType) {
String leftName = new String(leftType.readableName());
String rightName = new String(rightType.readableName());
String leftShortName = new String(leftType.shortReadableName());
String rightShortName = new String(rightType.shortReadableName());
if (leftShortName.equals(rightShortName)){
leftShortName = leftName;
rightShortName = rightName;
}
this.handle(
IProblem.IncompatibleTypesInForeach,
new String[] {leftName, rightName },
new String[] {leftShortName, rightShortName },
expression.sourceStart,
expression.sourceEnd);
}
示例5: typeCastError
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void typeCastError(CastExpression expression, TypeBinding leftType, TypeBinding rightType) {
String leftName = new String(leftType.readableName());
String rightName = new String(rightType.readableName());
String leftShortName = new String(leftType.shortReadableName());
String rightShortName = new String(rightType.shortReadableName());
if (leftShortName.equals(rightShortName)){
leftShortName = leftName;
rightShortName = rightName;
}
this.handle(
IProblem.IllegalCast,
new String[] { rightName, leftName },
new String[] { rightShortName, leftShortName },
expression.sourceStart,
expression.sourceEnd);
}
示例6: superTypeCannotUseWildcard
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void superTypeCannotUseWildcard(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) {
String name = new String(type.sourceName());
String superTypeFullName = new String(superTypeBinding.readableName());
String superTypeShortName = new String(superTypeBinding.shortReadableName());
if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName;
this.handle(
IProblem.SuperTypeUsingWildcard,
new String[] {superTypeFullName, name},
new String[] {superTypeShortName, name},
superclass.sourceStart,
superclass.sourceEnd);
}
示例7: lambdaParameterTypeMismatched
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void lambdaParameterTypeMismatched(Argument argument, TypeReference type, TypeBinding expectedParameterType) {
String name = new String(argument.name);
String expectedTypeFullName = new String(expectedParameterType.readableName());
String expectedTypeShortName = new String(expectedParameterType.shortReadableName());
this.handle(
expectedParameterType.isTypeVariable() ? IProblem.IncompatibleLambdaParameterType : IProblem.lambdaParameterTypeMismatched,
new String[] { name, expectedTypeFullName },
new String[] { name, expectedTypeShortName },
type.sourceStart,
type.sourceEnd);
}
示例8: shortAnnotatedTypeName
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
private String shortAnnotatedTypeName(TypeBinding type, char[][] annotationName) {
if ((type.tagBits & TagBits.AnnotationNullMASK) != 0)
return String.valueOf(type.nullAnnotatedReadableName(this.options, true));
int dims = 0;
char[] typeName = type.shortReadableName();
char[] annotationDisplayName = annotationName[annotationName.length-1];
return internalAnnotatedTypeName(annotationDisplayName, typeName, dims);
}
示例9: cannotExtendEnum
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void cannotExtendEnum(SourceTypeBinding type, TypeReference superclass, TypeBinding superTypeBinding) {
String name = new String(type.sourceName());
String superTypeFullName = new String(superTypeBinding.readableName());
String superTypeShortName = new String(superTypeBinding.shortReadableName());
if (superTypeShortName.equals(name)) superTypeShortName = superTypeFullName;
this.handle(
IProblem.CannotExtendEnum,
new String[] {superTypeFullName, name},
new String[] {superTypeShortName, name},
superclass.sourceStart,
superclass.sourceEnd);
}
示例10: typeMismatchError
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void typeMismatchError(TypeBinding actualType, TypeBinding expectedType, ASTNode location, ASTNode expectingLocation) {
if (this.options.sourceLevel < ClassFileConstants.JDK1_5) { // don't expose type variable names, complain on erased types
if (actualType instanceof TypeVariableBinding)
actualType = actualType.erasure();
if (expectedType instanceof TypeVariableBinding)
expectedType = expectedType.erasure();
}
if (actualType != null && (actualType.tagBits & TagBits.HasMissingType) != 0) { // improve secondary error
if (location instanceof Annotation) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376977
return; // Already reported, don't report a secondary error
}
this.handle(
IProblem.UndefinedType,
new String[] {new String(actualType.leafComponentType().readableName())},
new String[] {new String(actualType.leafComponentType().shortReadableName())},
location.sourceStart,
location.sourceEnd);
return;
}
if (expectingLocation != null && (expectedType.tagBits & TagBits.HasMissingType) != 0) { // improve secondary error
this.handle(
IProblem.UndefinedType,
new String[] {new String(expectedType.leafComponentType().readableName())},
new String[] {new String(expectedType.leafComponentType().shortReadableName())},
expectingLocation.sourceStart,
expectingLocation.sourceEnd);
return;
}
char[] actualShortReadableName = actualType.shortReadableName();
char[] expectedShortReadableName = expectedType.shortReadableName();
if (CharOperation.equals(actualShortReadableName, expectedShortReadableName)) {
actualShortReadableName = actualType.readableName();
expectedShortReadableName = expectedType.readableName();
}
this.handle(
IProblem.TypeMismatch,
new String[] {new String(actualType.readableName()), new String(expectedType.readableName())},
new String[] {new String(actualShortReadableName), new String(expectedShortReadableName)},
location.sourceStart,
location.sourceEnd);
}
示例11: typeMismatchError
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; //导入方法依赖的package包/类
public void typeMismatchError(TypeBinding actualType, TypeBinding expectedType, ASTNode location, ASTNode expectingLocation) {
if (this.options.sourceLevel < ClassFileConstants.JDK1_5) { // don't expose type variable names, complain on erased types
if (actualType instanceof TypeVariableBinding)
actualType = actualType.erasure();
if (expectedType instanceof TypeVariableBinding)
expectedType = expectedType.erasure();
}
if (actualType != null && (actualType.tagBits & TagBits.HasMissingType) != 0) { // improve secondary error
if (location instanceof Annotation) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=376977
return; // Already reported, don't report a secondary error
}
this.handle(
IProblem.UndefinedType,
new String[] {new String(actualType.leafComponentType().readableName())},
new String[] {new String(actualType.leafComponentType().shortReadableName())},
location.sourceStart,
location.sourceEnd);
return;
}
if (expectingLocation != null && (expectedType.tagBits & TagBits.HasMissingType) != 0) { // improve secondary error
this.handle(
IProblem.UndefinedType,
new String[] {new String(expectedType.leafComponentType().readableName())},
new String[] {new String(expectedType.leafComponentType().shortReadableName())},
expectingLocation.sourceStart,
expectingLocation.sourceEnd);
return;
}
char[] actualShortReadableName = actualType.shortReadableName();
char[] expectedShortReadableName = expectedType.shortReadableName();
char[] actualReadableName = actualType.readableName();
char[] expectedReadableName = expectedType.readableName();
if (CharOperation.equals(actualShortReadableName, expectedShortReadableName)) {
if (CharOperation.equals(actualReadableName, expectedReadableName)) {
// if full type names are equal, assume the incompatibility is due to mismatching null annotations:
actualReadableName = actualType.nullAnnotatedReadableName(this.options, false);
expectedReadableName = expectedType.nullAnnotatedReadableName(this.options, false);
actualShortReadableName = actualType.nullAnnotatedReadableName(this.options, true);
expectedShortReadableName = expectedType.nullAnnotatedReadableName(this.options, true);
} else {
actualShortReadableName = actualReadableName;
expectedShortReadableName = expectedReadableName;
}
}
this.handle(
expectingLocation instanceof ReturnStatement ? IProblem.ReturnTypeMismatch : IProblem.TypeMismatch,
new String[] {new String(actualReadableName), new String(expectedReadableName)},
new String[] {new String(actualShortReadableName), new String(expectedShortReadableName)},
location.sourceStart,
location.sourceEnd);
}