Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.jdt.internal.core;
 
 import java.util.Map;
 
 import  org.eclipse.core.runtime.Assert;
A requestor for the fuzzy parser, used to compute the children of an ICompilationUnit.
 
The handle to the compilation unit being parsed
 
 	protected ICompilationUnit unit;

The info object for the compilation unit being parsed
 
The import container info - null until created
 
Hashtable of children elements of the compilation unit. Children are added to the table as they are found by the parser. Keys are handles, values are corresponding info objects.
 
 	protected Map newElements;
 
 	/*
 	 * A table from a handle (with occurenceCount == 1) to the current occurence count for this handle
 	 */
 
 	/*
 	 * A table to store the occurrence count of anonymous types. The key will be the handle to the
 	 * enclosing type of the anonymous.
 	 */
Stack of parent scope info objects. The info on the top of the stack is the parent of the next element found. For example, when we locate a method, the parent info object will be the type the method is contained in.
 
 	protected Stack infoStack;
 
 	/*
 	 * Map from info to of ArrayList of IJavaElement representing the children
	 * of the given info.
	 */
	protected HashMap children;

Stack of parent handles, corresponding to the info stack. We keep both, since info objects do not have back pointers to handles.
	protected Stack handleStack;

The number of references reported thus far. Used to expand the arrays of reference kinds and names.
	protected int referenceCount= 0;

Problem requestor which will get notified of discovered problems
	protected boolean hasSyntaxErrors = false;
	/*
	 * The parser this requestor is using.
	 */
	protected Parser parser;
	this. = unit;
	this. = unitInfo;
	this. = newElements;

See also:
ISourceElementRequestor
public void acceptImport(int declarationStartint declarationEndint nameSourceStartint nameSourceEndchar[][] tokensboolean onDemandint modifiers) {
	JavaElement parentHandle= (JavaElementthis..peek();
	if (!(parentHandle.getElementType() == .)) {
		Assert.isTrue(false); // Should not happen
	}
	ICompilationUnit parentCU= (ICompilationUnit)parentHandle;
	//create the import container and its info
	if (this. == null) {
		Object parentInfo = this..peek();
		addToChildren(parentInfothis.);
	}
	String elementName = JavaModelManager.getJavaModelManager().intern(new String(CharOperation.concatWith(tokens'.')));
	ImportDeclaration handle = createImportDeclaration(this.elementNameonDemand);
	info.setSourceRangeStart(declarationStart);
	info.setSourceRangeEnd(declarationEnd);
	info.setNameSourceStart(nameSourceStart);
	info.setNameSourceEnd(nameSourceEnd);
	info.setFlags(modifiers);
	this..put(handleinfo);
/*
 * Table of line separator position. This table is passed once at the end
 * of the parse action, so as to allow computation of normalized ranges.
 *
 * A line separator might corresponds to several characters in the source,
 *
 */
public void acceptLineSeparatorPositions(int[] positions) {
	// ignore line separator positions

See also:
ISourceElementRequestor
public void acceptPackage(ImportReference importReference) {
		Object parentInfo = this..peek();
		JavaElement parentHandle= (JavaElementthis..peek();
		PackageDeclaration handle = null;
		if (parentHandle.getElementType() == .) {
			char[] name = CharOperation.concatWith(importReference.getImportName(), '.');
			handle = createPackageDeclaration(parentHandlenew String(name));
		}
		else {
			Assert.isTrue(false); // Should not happen
		}
		info.setSourceRangeStart(importReference.declarationSourceStart);
		info.setSourceRangeEnd(importReference.declarationSourceEnd);
		info.setNameSourceStart(importReference.sourceStart);
		info.setNameSourceEnd(importReference.sourceEnd);
		addToChildren(parentInfohandle);
		this..put(handleinfo);
		if (importReference.annotations != null) {
			for (int i = 0, length = importReference.annotations.lengthi < lengthi++) {
				org.eclipse.jdt.internal.compiler.ast.Annotation annotation = importReference.annotations[i];
				acceptAnnotation(annotationinfohandle);
			}
		}
public void acceptProblem(CategorizedProblem problem) {
	if ((problem.getID() & .) != 0){
		this. = true;
	}
private void addToChildren(Object parentInfoJavaElement handle) {
	ArrayList childrenList = (ArrayListthis..get(parentInfo);
	if (childrenList == null)
		this..put(parentInfochildrenList = new ArrayList());
	childrenList.add(handle);
protected Annotation createAnnotation(JavaElement parentString name) {
	return new Annotation(parentname);
protected SourceField createField(JavaElement parentFieldInfo fieldInfo) {
	String fieldName = JavaModelManager.getJavaModelManager().intern(new String(fieldInfo.name));
	return new SourceField(parentfieldName);
protected ImportDeclaration createImportDeclaration(ImportContainer parentString nameboolean onDemand) {
	return new ImportDeclaration(parentnameonDemand);
	return new Initializer(parent, 1);
protected SourceMethod createMethodHandle(JavaElement parentMethodInfo methodInfo) {
	String selector = JavaModelManager.getJavaModelManager().intern(new String(methodInfo.name));
	String[] parameterTypeSigs = convertTypeNamesToSigs(methodInfo.parameterTypes);
	return new SourceMethod(parentselectorparameterTypeSigs);
	return new PackageDeclaration((CompilationUnitparentname);
protected SourceType createTypeHandle(JavaElement parentTypeInfo typeInfo) {
	String nameStringnew String(typeInfo.name);
	return new SourceType(parentnameString);
protected TypeParameter createTypeParameter(JavaElement parentString name) {
	return new TypeParameter(parentname);
Convert these type names to signatures.

See also:
Signature
protected static String[] convertTypeNamesToSigs(char[][] typeNames) {
	if (typeNames == null)
	int n = typeNames.length;
	if (n == 0)
	JavaModelManager manager = JavaModelManager.getJavaModelManager();
	String[] typeSigs = new String[n];
	for (int i = 0; i < n; ++i) {
		typeSigs[i] = manager.intern(Signature.createTypeSignature(typeNames[i], false));
	}
	return typeSigs;
protected IAnnotation acceptAnnotation(org.eclipse.jdt.internal.compiler.ast.Annotation annotationAnnotatableInfo parentInfoJavaElement parentHandle) {
	String nameString = new String(CharOperation.concatWith(annotation.type.getTypeName(), '.'));
	Annotation handle = createAnnotation(parentHandlenameString); //NB: occurenceCount is computed in resolveDuplicates
	// populate the maps here as getValue(...) below may need them
	this..put(handleinfo);
	this..push(handle);
	info.setSourceRangeStart(annotation.sourceStart());
	info.nameStart = annotation.type.sourceStart();
	info.nameEnd = annotation.type.sourceEnd();
	MemberValuePair[] memberValuePairs = annotation.memberValuePairs();
	int membersLength = memberValuePairs.length;
	if (membersLength == 0) {
else {
		info.members = getMemberValuePairs(memberValuePairs);
	}
	if (parentInfo != null) {
		IAnnotation[] annotations = parentInfo.annotations;
		int length = annotations.length;
		System.arraycopy(annotations, 0, annotations = new IAnnotation[length+1], 0, length);
		annotations[length] = handle;
		parentInfo.annotations = annotations;
	}
	info.setSourceRangeEnd(annotation.declarationSourceEnd);
	return handle;

See also:
ISourceElementRequestor
public void enterCompilationUnit() {
	this. = new Stack();
	this. = new HashMap();
	this.new Stack();
	this..push(this.);

See also:
ISourceElementRequestor
public void enterConstructor(MethodInfo methodInfo) {
	enterMethod(methodInfo);

See also:
ISourceElementRequestor
public void enterField(FieldInfo fieldInfo) {
	TypeInfo parentInfo = (TypeInfothis..peek();
	JavaElement parentHandle= (JavaElementthis..peek();
	SourceField handle = null;
	if (parentHandle.getElementType() == .) {
		handle = createField(parentHandlefieldInfo);
	}
	else {
		Assert.isTrue(false); // Should not happen
	}
	addToChildren(parentInfohandle);
	parentInfo.childrenCategories.put(handlefieldInfo.categories);
	this..push(fieldInfo);
	this..push(handle);

See also:
ISourceElementRequestor
public void enterInitializer(int declarationSourceStartint modifiers) {
	Object parentInfo = this..peek();
	JavaElement parentHandle= (JavaElementthis..peek();
	Initializer handle = null;
	if (parentHandle.getElementType() == .) {
		handle = createInitializer(parentHandle);
	}
	else {
		Assert.isTrue(false); // Should not happen
	}
	addToChildren(parentInfohandle);
	this..push(new int[] {declarationSourceStartmodifiers});
	this..push(handle);

See also:
ISourceElementRequestor
public void enterMethod(MethodInfo methodInfo) {
	TypeInfo parentInfo = (TypeInfothis..peek();
	JavaElement parentHandle= (JavaElementthis..peek();
	SourceMethod handle = null;
	// translate nulls to empty arrays
	if (methodInfo.parameterTypes == null) {
		methodInfo.parameterTypes.;
	}
	if (methodInfo.parameterNames == null) {
		methodInfo.parameterNames.;
	}
	if (methodInfo.exceptionTypes == null) {
		methodInfo.exceptionTypes.;
	}
	if (parentHandle.getElementType() == .) {
		handle = createMethodHandle(parentHandlemethodInfo);
	}
	else {
		Assert.isTrue(false); // Should not happen
	}
	this..push(methodInfo);
	this..push(handle);
	addToChildren(parentInfohandle);
	parentInfo.childrenCategories.put(handlemethodInfo.categories);
	IJavaElement[] elements = getChildren(methodInfo);
	if (methodInfo.isConstructor) {
		info = elements.length == 0 ? new SourceConstructorInfo() : new SourceConstructorWithChildrenInfo(elements);
else if (methodInfo.isAnnotation) {
else {
		info = elements.length == 0 ? new SourceMethodInfo() : new SourceMethodWithChildrenInfo(elements);
	}
	info.setSourceRangeStart(methodInfo.declarationStart);
	int flags = methodInfo.modifiers;
	info.setNameSourceStart(methodInfo.nameSourceStart);
	info.setNameSourceEnd(methodInfo.nameSourceEnd);
	info.setFlags(flags);
	JavaModelManager manager = JavaModelManager.getJavaModelManager();
	char[][] parameterNames = methodInfo.parameterNames;
	for (int i = 0, length = parameterNames.lengthi < lengthi++)
		parameterNames[i] = manager.intern(parameterNames[i]);
	info.setArgumentNames(parameterNames);
	char[] returnType = methodInfo.returnType == null ? new char[]{'v''o','i''d'} : methodInfo.returnType;
	info.setReturnType(manager.intern(returnType));
	char[][] exceptionTypes = methodInfo.exceptionTypes;
	info.setExceptionTypeNames(exceptionTypes);
	for (int i = 0, length = exceptionTypes.lengthi < lengthi++)
		exceptionTypes[i] = manager.intern(exceptionTypes[i]);
	this..put(handleinfo);
	if (methodInfo.typeParameters != null) {
		for (int i = 0, length = methodInfo.typeParameters.lengthi < lengthi++) {
			TypeParameterInfo typeParameterInfo = methodInfo.typeParameters[i];
			acceptTypeParameter(typeParameterInfoinfo);
		}
	}
	if (methodInfo.annotations != null) {
		int length = methodInfo.annotations.length;
		this.. += length;
		for (int i = 0; i < lengthi++) {
			org.eclipse.jdt.internal.compiler.ast.Annotation annotation = methodInfo.annotations[i];
			acceptAnnotation(annotationinfohandle);
		}
	}
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334783
	// Process the parameter annotations from the arguments
	if (methodInfo.node != null && methodInfo.node.arguments != null) {
		info.arguments = acceptMethodParameters(methodInfo.node.argumentshandlemethodInfo);
	}
	return info;
private LocalVariable[] acceptMethodParameters(Argument[] argumentsJavaElement methodHandleMethodInfo methodInfo) {
	if (arguments == nullreturn null;
	LocalVariable[] result = new LocalVariable[arguments.length];
	Annotation[][] paramAnnotations = new Annotation[arguments.length][];
	for(int i = 0; i < arguments.lengthi++) {
		Argument argument = arguments[i];
		AnnotatableInfo localVarInfo = new AnnotatableInfo();
		localVarInfo.setSourceRangeStart(argument.declarationSourceStart);
		localVarInfo.setSourceRangeEnd(argument.declarationSourceStart);
		localVarInfo.setNameSourceStart(argument.sourceStart);
		localVarInfo.setNameSourceEnd(argument.sourceEnd);
		String paramTypeSig = JavaModelManager.getJavaModelManager().intern(Signature.createTypeSignature(methodInfo.parameterTypes[i], false));
		result[i] = new LocalVariable(
				methodHandle,
				new String(argument.name),
				argument.declarationSourceStart,
				argument.declarationSourceEnd,
				argument.sourceStart,
				argument.sourceEnd,
				paramTypeSig,
				argument.annotations,
				argument.modifiers
				true);
		this..put(result[i], localVarInfo);
		this..push(localVarInfo);
		this..push(result[i]);
		if (argument.annotations != null) {
			paramAnnotations[i] = new Annotation[argument.annotations.length];
			for (int  j = 0; j < argument.annotations.lengthj++ ) {
				org.eclipse.jdt.internal.compiler.ast.Annotation annotation = argument.annotations[j];
				acceptAnnotation(annotationlocalVarInforesult[i]);
			}
		}
		this..pop();
	}
	return result;

See also:
ISourceElementRequestor
public void enterType(TypeInfo typeInfo) {
	Object parentInfo = this..peek();
	JavaElement parentHandle= (JavaElementthis..peek();
	SourceType handle = createTypeHandle(parentHandletypeInfo); //NB: occurenceCount is computed in resolveDuplicates
	this..push(typeInfo);
	this..push(handle);
	if (parentHandle.getElementType() == .)
		((TypeInfoparentInfo)..put(handletypeInfo.categories);
	addToChildren(parentInfohandle);
		typeInfo.anonymousMember ?
				public boolean isAnonymousMember() {
					return true;
				}
			} :
	info.setHandle(handle);
	info.setSourceRangeStart(typeInfo.declarationStart);
	info.setFlags(typeInfo.modifiers);
	info.setNameSourceStart(typeInfo.nameSourceStart);
	info.setNameSourceEnd(typeInfo.nameSourceEnd);
	JavaModelManager manager = JavaModelManager.getJavaModelManager();
	char[] superclass = typeInfo.superclass;
	info.setSuperclassName(superclass == null ? null : manager.intern(superclass));
	char[][] superinterfaces = typeInfo.superinterfaces;
	for (int i = 0, length = superinterfaces == null ? 0 : superinterfaces.lengthi < lengthi++)
		superinterfaces[i] = manager.intern(superinterfaces[i]);
	info.setSuperInterfaceNames(superinterfaces);
	info.addCategories(handletypeInfo.categories);
	this..put(handleinfo);
	if (typeInfo.typeParameters != null) {
		for (int i = 0, length = typeInfo.typeParameters.lengthi < lengthi++) {
			TypeParameterInfo typeParameterInfo = typeInfo.typeParameters[i];
			acceptTypeParameter(typeParameterInfoinfo);
		}
	}
	if (typeInfo.annotations != null) {
		int length = typeInfo.annotations.length;
		this.. += length;
		for (int i = 0; i < lengthi++) {
			org.eclipse.jdt.internal.compiler.ast.Annotation annotation = typeInfo.annotations[i];
			acceptAnnotation(annotationinfohandle);
		}
	}
	if (typeInfo.childrenCategories != null) {
		Iterator iterator = typeInfo.childrenCategories.entrySet().iterator();
		while (iterator.hasNext()) {
			Map.Entry entry = (Map.Entryiterator.next();
			info.addCategories((IJavaElemententry.getKey(), (char[][]) entry.getValue());
		}
	}
	return info;
protected void acceptTypeParameter(TypeParameterInfo typeParameterInfoJavaElementInfo parentInfo) {
	JavaElement parentHandle = (JavaElementthis..peek();
	String nameString = new String(typeParameterInfo.name);
	TypeParameter handle = createTypeParameter(parentHandlenameString); //NB: occurenceCount is computed in resolveDuplicates
	info.setSourceRangeStart(typeParameterInfo.declarationStart);
	info.nameStart = typeParameterInfo.nameSourceStart;
	info.nameEnd = typeParameterInfo.nameSourceEnd;
	info.bounds = typeParameterInfo.bounds;
	if (parentInfo instanceof SourceTypeElementInfo) {
		SourceTypeElementInfo elementInfo = (SourceTypeElementInfoparentInfo;
		ITypeParameter[] typeParameters = elementInfo.typeParameters;
		int length = typeParameters.length;
		System.arraycopy(typeParameters, 0, typeParameters = new ITypeParameter[length+1], 0, length);
		typeParameters[length] = handle;
		elementInfo.typeParameters = typeParameters;
else {
		SourceMethodElementInfo elementInfo = (SourceMethodElementInfoparentInfo;
		ITypeParameter[] typeParameters = elementInfo.typeParameters;
		int length = typeParameters.length;
		System.arraycopy(typeParameters, 0, typeParameters = new ITypeParameter[length+1], 0, length);
		typeParameters[length] = handle;
		elementInfo.typeParameters = typeParameters;
	}
	this..put(handleinfo);
	info.setSourceRangeEnd(typeParameterInfo.declarationEnd);

See also:
ISourceElementRequestor
public void exitCompilationUnit(int declarationEnd) {
	// set import container children
	if (this. != null) {
	}
	this..setSourceLength(declarationEnd + 1);
	// determine if there were any parsing errors

See also:
ISourceElementRequestor
public void exitConstructor(int declarationEnd) {
	exitMethod(declarationEndnull);

See also:
ISourceElementRequestor
public void exitField(int initializationStartint declarationEndint declarationSourceEnd) {
	JavaElement handle = (JavaElementthis..peek();
	FieldInfo fieldInfo = (FieldInfothis..peek();
	IJavaElement[] elements = getChildren(fieldInfo);
	SourceFieldElementInfo info = elements.length == 0 ? new SourceFieldElementInfo() : new SourceFieldWithChildrenInfo(elements);
	info.setNameSourceStart(fieldInfo.nameSourceStart);
	info.setNameSourceEnd(fieldInfo.nameSourceEnd);
	info.setSourceRangeStart(fieldInfo.declarationStart);
	info.setFlags(fieldInfo.modifiers);
	char[] typeName = JavaModelManager.getJavaModelManager().intern(fieldInfo.type);
	info.setTypeName(typeName);
	this..put(handleinfo);
	if (fieldInfo.annotations != null) {
		int length = fieldInfo.annotations.length;
		this.. += length;
		for (int i = 0; i < lengthi++) {
			org.eclipse.jdt.internal.compiler.ast.Annotation annotation = fieldInfo.annotations[i];
			acceptAnnotation(annotationinfohandle);
		}
	}
	info.setSourceRangeEnd(declarationSourceEnd);
	this..pop();
	// remember initializer source if field is a constant
	if (initializationStart != -1) {
		int flags = info.flags;
		Object typeInfo;
		if (Flags.isStatic(flags) && Flags.isFinal(flags)
				|| ((typeInfo = this..peek()) instanceof TypeInfo
					 && (Flags.isInterface(((TypeInfo)typeInfo).)))) {
			int length = declarationEnd - initializationStart;
			if (length > 0) {
				char[] initializer = new char[length];
				System.arraycopy(this...initializationStartinitializer, 0, length);
				info.initializationSource = initializer;
			}
		}
	}

See also:
ISourceElementRequestor
public void exitInitializer(int declarationEnd) {
	JavaElement handle = (JavaElementthis..peek();
	int[] initializerInfo = (int[]) this..peek();
	IJavaElement[] elements = getChildren(initializerInfo);
	InitializerElementInfo info = elements.length == 0 ? new InitializerElementInfo() : new InitializerWithChildrenInfo(elements);
	info.setSourceRangeStart(initializerInfo[0]);
	info.setFlags(initializerInfo[1]);
	info.setSourceRangeEnd(declarationEnd);
	this..put(handleinfo);
	this..pop();

See also:
ISourceElementRequestor
public void exitMethod(int declarationEndExpression defaultValue) {
	MethodInfo methodInfo = (MethodInfothis..peek();
	SourceMethodElementInfo info = createMethodInfo(methodInfohandle);
	info.setSourceRangeEnd(declarationEnd);
	// remember default value of annotation method
	if (info.isAnnotationMethod() && defaultValue != null) {
		SourceAnnotationMethodInfo annotationMethodInfo = (SourceAnnotationMethodInfoinfo;
		annotationMethodInfo.defaultValueStart = defaultValue.sourceStart;
		annotationMethodInfo.defaultValueEnd = defaultValue.sourceEnd;
		JavaElement element = (JavaElementthis..peek();
		defaultMemberValuePair.value = getMemberValue(defaultMemberValuePairdefaultValue);
		annotationMethodInfo.defaultValue = defaultMemberValuePair;
	}
	this..pop();

See also:
ISourceElementRequestor
public void exitType(int declarationEnd) {
	SourceType handle = (SourceTypethis..peek();
	TypeInfo typeInfo = (TypeInfothis..peek();
	SourceTypeElementInfo info = createTypeInfo(typeInfohandle);
	info.setSourceRangeEnd(declarationEnd);
	info.children = getChildren(typeInfo);
	this..pop();
Resolves duplicate handles by incrementing the occurrence count of the handle being created.
protected void resolveDuplicates(SourceRefElement handle) {
	int occurenceCount = this..get(handle);
	if (occurenceCount == -1)
		this..put(handle, 1);
	else {
		this..put(handle, ++occurenceCount);
		handle.occurrenceCount = occurenceCount;
	}
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=342393
	// For anonymous source types, the occurrence count should be in the context
	// of the enclosing type.
	if (handle instanceof SourceType && handle.getElementName().length() == 0) {
		occurenceCount = this..get(key);
		if (occurenceCount == -1)
		else {
			this..put(key, ++occurenceCount);
			((SourceType)handle). = occurenceCount;
		}
	}
protected IMemberValuePair getMemberValuePair(MemberValuePair memberValuePair) {
	String memberName = new String(memberValuePair.name);
	result.value = getMemberValue(resultmemberValuePair.value);
	return result;
protected IMemberValuePair[] getMemberValuePairs(MemberValuePair[] memberValuePairs) {
	int membersLength = memberValuePairs.length;
	IMemberValuePair[] members = new IMemberValuePair[membersLength];
	for (int j = 0; j < membersLengthj++) {
		members[j] = getMemberValuePair(memberValuePairs[j]);
	}
	return members;
private IJavaElement[] getChildren(Object info) {
	ArrayList childrenList = (ArrayListthis..get(info);
	if (childrenList != null) {
		return (IJavaElement[]) childrenList.toArray(new IJavaElement[childrenList.size()]);
	}
/*
 * Creates the value from the given expression, and sets the valueKind on the given memberValuePair
 */
protected Object getMemberValue(org.eclipse.jdt.internal.core.MemberValuePair memberValuePairExpression expression) {
	if (expression instanceof NullLiteral) {
		return null;
else if (expression instanceof Literal) {
		((Literalexpression).computeConstant();
		return Util.getAnnotationMemberValue(memberValuePairexpression.constant);
else if (expression instanceof org.eclipse.jdt.internal.compiler.ast.Annotation) {
		Object handle = acceptAnnotation(annotationnull, (JavaElementthis..peek());
		memberValuePair.valueKind = .;
		return handle;
else if (expression instanceof ClassLiteralAccess) {
		ClassLiteralAccess classLiteral = (ClassLiteralAccessexpression;
		char[] name = CharOperation.concatWith(classLiteral.type.getTypeName(), '.');
		memberValuePair.valueKind = .;
		return new String(name);
else if (expression instanceof QualifiedNameReference) {
		char[] qualifiedName = CharOperation.concatWith(((QualifiedNameReferenceexpression).'.');
		memberValuePair.valueKind = .;
		return new String(qualifiedName);
else if (expression instanceof SingleNameReference) {
		char[] simpleName = ((SingleNameReferenceexpression).;
		if (simpleName == .) {
			memberValuePair.valueKind = .;
			return null;
		}
		memberValuePair.valueKind = .;
		return new String(simpleName);
else if (expression instanceof ArrayInitializer) {
		memberValuePair.valueKind = -1; // modified below by the first call to getMemberValue(...)
		Expression[] expressions = ((ArrayInitializerexpression).;
		int length = expressions == null ? 0 : expressions.length;
		Object[] values = new Object[length];
		for (int i = 0; i < lengthi++) {
			int previousValueKind = memberValuePair.valueKind;
			Object value = getMemberValue(memberValuePairexpressions[i]);
			if (previousValueKind != -1 && memberValuePair.valueKind != previousValueKind) {
				// values are heterogeneous, value kind is thus unknown
				memberValuePair.valueKind = .;
			}
			values[i] = value;
		}
		if (memberValuePair.valueKind == -1)
			memberValuePair.valueKind = .;
		return values;
else if (expression instanceof UnaryExpression) {			// to deal with negative numerals (see bug - 248312)
		UnaryExpression unaryExpression = (UnaryExpressionexpression;
		if ((unaryExpression.bits & .) >> . == .) {
			if (unaryExpression.expression instanceof Literal) {
				Literal subExpression = (LiteralunaryExpression.expression;
				subExpression.computeConstant();
				return Util.getNegativeAnnotationMemberValue(memberValuePairsubExpression.constant);
			}
		}
		memberValuePair.valueKind = .;
		return null;
else {
		memberValuePair.valueKind = .;
		return null;
	}
New to GrepCode? Check out our FAQ X