private TypeBinding[] varArgTypes(TypeBinding[] parameters, int k) { TypeBinding[] types = new TypeBinding[k]; int declaredLength = parameters.length-1; System.arraycopy(parameters, 0, types, 0, declaredLength); TypeBinding last = ((ArrayBinding)parameters[declaredLength]).elementsType(); for (int i = declaredLength; i < k; i++) types[i] = last; return types; }
public void invokeJavaLangEnumValues(TypeBinding enumBinding, ArrayBinding arrayBinding) { char[] signature = "()".toCharArray(); //$NON-NLS-1$ signature = CharOperation.concat(signature, arrayBinding.constantPoolName()); invoke( Opcodes.OPC_invokestatic, 0, // receiverAndArgsSize 1, // return type size enumBinding.constantPoolName(), TypeConstants.VALUES, signature); }
@Override public String toString() { return this.leafComponentType != null ? debugName() : "NULL TYPE ARRAY"; //$NON-NLS-1$ } @Override
@Override public TypeKind getKind() { ArrayBinding type = (ArrayBinding)_binding; if (!type.isValidBinding() || ((type.leafComponentType().tagBits & TagBits.HasMissingType) != 0)) { return TypeKind.ERROR; } return TypeKind.ARRAY; } }
int elementsTypeID = varArgsType.elementsType().id; int argLength = arguments == null ? 0 : arguments.length; || (varArgsType.dimensions() == lastType.dimensions() && lastType.isCompatibleWith(codeGenVarArgsType))) {
@Override public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNames) /* java.lang.Object @o.e.j.a.NonNull[] */ { if (this.nullTagBitsPerDimension == null) return shortNames ? shortReadableName() : readableName(); char[][] brackets = new char[this.dimensions][]; for (int i = 0; i < this.dimensions; i++) { if ((this.nullTagBitsPerDimension[i] & TagBits.AnnotationNullMASK) != 0) { char[][] fqAnnotationName; if ((this.nullTagBitsPerDimension[i] & TagBits.AnnotationNonNull) != 0) fqAnnotationName = options.nonNullAnnotationName; else fqAnnotationName = options.nullableAnnotationName; char[] annotationName = shortNames ? fqAnnotationName[fqAnnotationName.length-1] : CharOperation.concatWith(fqAnnotationName, '.'); brackets[i] = new char[annotationName.length+3]; brackets[i][0] = '@'; System.arraycopy(annotationName, 0, brackets[i], 1, annotationName.length); brackets[i][annotationName.length+1] = '['; brackets[i][annotationName.length+2] = ']'; } else { brackets[i] = new char[]{'[', ']'}; } } return CharOperation.concat(this.leafComponentType.nullAnnotatedReadableName(options, shortNames), CharOperation.concatWith(brackets, ' '), ' '); }
new String[] { new String(argumentType.readableName()), new String(varargsType.readableName()), new String(method.declaringClass.readableName()), typesAsString(method, false), new String(varargsType.elementsType().readableName()), }, new String[] { new String(argumentType.shortReadableName()), new String(varargsType.shortReadableName()), new String(method.declaringClass.shortReadableName()), typesAsString(method, true), new String(varargsType.elementsType().shortReadableName()), }, severity, new String[] { new String(argumentType.readableName()), new String(varargsType.readableName()), new String(method.selector), typesAsString(method, false), new String(method.declaringClass.readableName()), new String(varargsType.elementsType().readableName()), }, new String[] { new String(argumentType.shortReadableName()), new String(varargsType.shortReadableName()), new String(method.selector), typesAsString(method, true), new String(method.declaringClass.shortReadableName()),
public boolean isCompatibleWith(TypeBinding otherType, Scope captureScope) { if (equalsEquals(this, otherType)) return true; if ((otherLowerBound = otherCapture.lowerBound) != null) { if (!otherLowerBound.isArrayType()) return false; return isCompatibleWith(otherLowerBound, captureScope);
public ArrayBinding createArrayType(TypeBinding type, int dimension, AnnotationBinding[] annotations) { if (type.isValidBinding()) return environment().createArrayType(type, dimension, annotations); // do not cache obvious invalid types return new ArrayBinding(type, dimension, environment()); }
TypeBinding leafSuperType = arrayType.leafComponentType.findSuperTypeOriginatingFrom(otherType.leafComponentType()); if (leafSuperType == null) return null; return arrayType.environment().createArrayType(leafSuperType, arrayType.dimensions);
public TypeBinding closestMatch() { if (isValidBinding()) { return this; } TypeBinding leafClosestMatch = this.leafComponentType.closestMatch(); if (leafClosestMatch == null) { return null; } return this.environment.createArrayType(this.leafComponentType.closestMatch(), this.dimensions); }
private ReferenceBinding typeToRecord(TypeBinding type) { if (type == null) return null; while (type.isArrayType()) type = ((ArrayBinding) type).leafComponentType(); switch (type.kind()) { case Binding.BASE_TYPE : case Binding.TYPE_PARAMETER : case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : case Binding.INTERSECTION_TYPE18: // constituents would have been recorded. case Binding.POLY_TYPE: // not a real type, will mutate into one, hopefully soon. return null; case Binding.PARAMETERIZED_TYPE : case Binding.RAW_TYPE : type = type.erasure(); } ReferenceBinding refType = (ReferenceBinding) type; if (refType.isLocalType()) return null; return refType; } public void verifyMethods(MethodVerifier verifier) {
if ((otherLowerBound = otherCapture.lowerBound) != null) { if (!otherLowerBound.isArrayType()) return false; return isCompatibleWith(otherLowerBound);
int elementsTypeID = varArgsType.elementsType().id; int argLength = arguments == null ? 0 : arguments.length; || (varArgsType.dimensions() == lastType.dimensions() && lastType.isCompatibleWith(codeGenVarArgsType))) {
public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNames) /* java.lang.Object @o.e.j.a.NonNull[] */ { if (this.nullTagBitsPerDimension == null) return shortNames ? shortReadableName() : readableName(); char[][] brackets = new char[this.dimensions][]; for (int i = 0; i < this.dimensions; i++) { if ((this.nullTagBitsPerDimension[i] & TagBits.AnnotationNullMASK) != 0) { char[][] fqAnnotationName; if ((this.nullTagBitsPerDimension[i] & TagBits.AnnotationNonNull) != 0) fqAnnotationName = options.nonNullAnnotationName; else fqAnnotationName = options.nullableAnnotationName; char[] annotationName = shortNames ? fqAnnotationName[fqAnnotationName.length-1] : CharOperation.concatWith(fqAnnotationName, '.'); brackets[i] = new char[annotationName.length+3]; brackets[i][0] = '@'; System.arraycopy(annotationName, 0, brackets[i], 1, annotationName.length); brackets[i][annotationName.length+1] = '['; brackets[i][annotationName.length+2] = ']'; } else { brackets[i] = new char[]{'[', ']'}; } } return CharOperation.concat(this.leafComponentType.nullAnnotatedReadableName(options, shortNames), CharOperation.concatWith(brackets, ' '), ' '); }
new String[] { new String(argumentType.readableName()), new String(varargsType.readableName()), new String(method.declaringClass.readableName()), typesAsString(method, false), new String(varargsType.elementsType().readableName()), }, new String[] { new String(argumentType.shortReadableName()), new String(varargsType.shortReadableName()), new String(method.declaringClass.shortReadableName()), typesAsString(method, true), new String(varargsType.elementsType().shortReadableName()), }, severity, new String[] { new String(argumentType.readableName()), new String(varargsType.readableName()), new String(method.selector), typesAsString(method, false), new String(method.declaringClass.readableName()), new String(varargsType.elementsType().readableName()), }, new String[] { new String(argumentType.shortReadableName()), new String(varargsType.shortReadableName()), new String(method.selector), typesAsString(method, true), new String(method.declaringClass.shortReadableName()),
public boolean isCompatibleWith(TypeBinding otherType, Scope captureScope) { if (equalsEquals(this, otherType)) return true; if ((otherLowerBound = otherCapture.lowerBound) != null) { if (!otherLowerBound.isArrayType()) return false; return isCompatibleWith(otherLowerBound, captureScope);
public ArrayBinding createArrayType(TypeBinding type, int dimension, AnnotationBinding[] annotations) { if (type.isValidBinding()) return environment().createArrayType(type, dimension, annotations); // do not cache obvious invalid types return new ArrayBinding(type, dimension, environment()); }
TypeBinding leafSuperType = arrayType.leafComponentType.findSuperTypeOriginatingFrom(otherType.leafComponentType()); if (leafSuperType == null) return null; return arrayType.environment().createArrayType(leafSuperType, arrayType.dimensions);
public TypeBinding closestMatch() { if (isValidBinding()) { return this; } TypeBinding leafClosestMatch = this.leafComponentType.closestMatch(); if (leafClosestMatch == null) { return null; } return this.environment.createArrayType(this.leafComponentType.closestMatch(), this.dimensions); }