}
private ASTNode[] computeMergedMemberDeclarations(ASTNode[] nodes){
ArrayList mergedNodes = new ArrayList();
for (int i = 0, max = nodes.length; i < max; i++) {
ASTNode currentNode = nodes[i];
if (currentNode instanceof FieldDeclaration) {
FieldDeclaration currentField = (FieldDeclaration) currentNode;
if (mergedNodes.size() == 0) {
// first node
mergedNodes.add(currentNode);
} else {
// we need to check if the previous merged node is a field declaration
ASTNode previousMergedNode = (ASTNode) mergedNodes.get(mergedNodes.size() - 1);
if (previousMergedNode instanceof MultiFieldDeclaration) {
// we merge the current node
MultiFieldDeclaration multiFieldDeclaration = (MultiFieldDeclaration) previousMergedNode;
int length = multiFieldDeclaration.declarations.length;
System.arraycopy(multiFieldDeclaration.declarations, 0, multiFieldDeclaration.declarations= new FieldDeclaration[length+1], 0, length);