private static void setDeclareErrorOrWarningLocation(AsmManager model, DeclareErrorOrWarning deow, AjAttributeFieldStruct struct) {
IHierarchy top = (model == null ? null : model.getHierarchy());
if (top != null && top.getRoot() != null) {
IProgramElement ipe = top.findElementForLabel(top.getRoot(), IProgramElement.Kind.FIELD, struct.field.getName());
if (ipe != null && ipe.getSourceLocation() != null) {
ISourceLocation sourceLocation = ipe.getSourceLocation();
int start = sourceLocation.getOffset();
int end = start + struct.field.getName().length();
deow.setLocation(struct.context, start, end);
return;
}
}