return new SourceRange(Math.max(0, offset), length);
}
static ASTNode[] getSiblingNodes(ASTNode node) {
ASTNode parent = node.getParent();
StructuralPropertyDescriptor locationInParent = node
.getLocationInParent();
if (locationInParent.isChildListProperty()) {
List<? extends ASTNode> siblings = (List<? extends ASTNode>) parent
.getStructuralProperty(locationInParent);
return siblings.toArray(new ASTNode[siblings.size()]);
}
return null;