public Void visitRecordDefinition(ModelDeclaration model, AstRecordDefinition node) {
LOG.debug("processing record definition: {}", node); //$NON-NLS-1$
Set<String> sawPropertyName = Sets.create();
for (AstPropertyDefinition property : node.properties) {
if (sawPropertyName.contains(property.name.identifier)) {
report(new Diagnostic(
Level.ERROR,
property.name,
Messages.getString("DmdlAnalyzer.diagnosticDuplicatedProperty"), //$NON-NLS-1$
property.name.identifier));
}
sawPropertyName.add(property.name.identifier);
Type type = context.resolveType(property.type);
if (type == null) {
report(new Diagnostic(
Level.ERROR,
property.type,
Messages.getString("DmdlAnalyzer.diagnosticUnknownTypeProperty"), //$NON-NLS-1$
property.type.toString()));
continue;
}
PropertyDeclaration other = model.findPropertyDeclaration(property.name.identifier);
if (other != null) {
LOG.debug("property {} is duplicated", property.name); //$NON-NLS-1$
if (type.equals(other.getType()) == false) {
report(new Diagnostic(
Level.ERROR,
property.name,
Messages.getString(
"DmdlAnalyzer.diagnosticInconsistentTypeRepordProperty"), //$NON-NLS-1$
property.name,