Skip to content

Commit c588614

Browse files
committed
[Java] Improve validation of valueRef on fields.
1 parent df31e55 commit c588614

File tree

1 file changed

+2
-2
lines changed
  • sbe-tool/src/main/java/uk/co/real_logic/sbe/xml

1 file changed

+2
-2
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/Field.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ public void validate(final Node node)
102102
else
103103
{
104104
final int periodIndex = valueRef.indexOf('.');
105-
if (-1 == periodIndex)
105+
if (periodIndex < 1 || periodIndex == (valueRef.length() - 1))
106106
{
107-
handleError(node, "valueRef format not valid for constant Enum: " + valueRef);
107+
handleError(node, "valueRef format not valid for constant (enum-name.valid-value-name): " + valueRef);
108108
}
109109

110110
final String valueRefType = valueRef.substring(0, periodIndex);

0 commit comments

Comments
 (0)