argSize = methodDeclaringClass.enclosingInstancesSlotSize;
SyntheticArgumentBinding[] syntheticArguments;
if ((syntheticArguments = methodDeclaringClass.syntheticEnclosingInstances()) != null) {
for (int i = 0, max = syntheticArguments.length; i < max; i++) {
LocalVariableBinding localVariable = syntheticArguments[i];
final TypeBinding localVariableTypeBinding = localVariable.type;
if (localVariableTypeBinding.isParameterizedType() || localVariableTypeBinding.isTypeVariable()) {
if (genericLocalVariables == null) {
// we cannot have more than max locals
genericLocalVariables = new LocalVariableBinding[max];
}
genericLocalVariables[genericLocalVariablesCounter++] = localVariable;
numberOfGenericEntries++;
}
if (localContentsOffset + 10 >= this.contents.length) {
resizeContents(10);
}
// now we can safely add the local entry
numberOfEntries++;
this.contents[localContentsOffset++] = 0;
this.contents[localContentsOffset++] = 0;
this.contents[localContentsOffset++] = (byte) (code_length >> 8);
this.contents[localContentsOffset++] = (byte) code_length;
nameIndex = constantPool.literalIndex(localVariable.name);
this.contents[localContentsOffset++] = (byte) (nameIndex >> 8);
this.contents[localContentsOffset++] = (byte) nameIndex;
descriptorIndex = constantPool.literalIndex(localVariableTypeBinding.signature());
this.contents[localContentsOffset++] = (byte) (descriptorIndex >> 8);
this.contents[localContentsOffset++] = (byte) descriptorIndex;
int resolvedPosition = localVariable.resolvedPosition;
this.contents[localContentsOffset++] = (byte) (resolvedPosition >> 8);
this.contents[localContentsOffset++] = (byte) resolvedPosition;
}
}
} else {
argSize = 1;
}
} else {
argSize = binding.isStatic() ? 0 : 1;
}
int genericArgumentsCounter = 0;
int[] genericArgumentsNameIndexes = null;
int[] genericArgumentsResolvedPositions = null;
TypeBinding[] genericArgumentsTypeBindings = null;
if (method.binding != null) {
TypeBinding[] parameters = method.binding.parameters;
Argument[] arguments = method.arguments;
if ((parameters != null) && (arguments != null)) {
for (int i = 0, max = parameters.length; i < max; i++) {
TypeBinding argumentBinding = parameters[i];
if (localContentsOffset + 10 >= this.contents.length) {
resizeContents(10);
}
// now we can safely add the local entry
numberOfEntries++;
this.contents[localContentsOffset++] = 0;
this.contents[localContentsOffset++] = 0;
this.contents[localContentsOffset++] = (byte) (code_length >> 8);
this.contents[localContentsOffset++] = (byte) code_length;
nameIndex = constantPool.literalIndex(arguments[i].name);
this.contents[localContentsOffset++] = (byte) (nameIndex >> 8);
this.contents[localContentsOffset++] = (byte) nameIndex;
int resolvedPosition = argSize;
if (argumentBinding.isParameterizedType() || argumentBinding.isTypeVariable()) {
if (genericArgumentsCounter == 0) {
// we cannot have more than max locals
genericArgumentsNameIndexes = new int[max];
genericArgumentsResolvedPositions = new int[max];
genericArgumentsTypeBindings = new TypeBinding[max];
}
genericArgumentsNameIndexes[genericArgumentsCounter] = nameIndex;
genericArgumentsResolvedPositions[genericArgumentsCounter] = resolvedPosition;
genericArgumentsTypeBindings[genericArgumentsCounter++] = argumentBinding;
}
descriptorIndex = constantPool.literalIndex(argumentBinding.signature());
this.contents[localContentsOffset++] = (byte) (descriptorIndex >> 8);
this.contents[localContentsOffset++] = (byte) descriptorIndex;
if ((argumentBinding == TypeBinding.LONG)
|| (argumentBinding == TypeBinding.DOUBLE))
argSize += 2;