@@ -167,6 +167,16 @@ else if (!isUnsigned(blockLengthType.primitiveType()))
167
167
{
168
168
XmlSchemaParser .handleError (node , "\" blockLength\" must be unsigned type" );
169
169
}
170
+ else
171
+ {
172
+ if (blockLengthType .primitiveType () != UINT8 && blockLengthType .primitiveType () != UINT16 )
173
+ {
174
+ XmlSchemaParser .handleWarning (node , "\" blockLength\" should be UINT8 or UINT16" );
175
+ }
176
+
177
+ final PrimitiveValue blockLengthTypeMaxValue = blockLengthType .maxValue ();
178
+ validateMaxValue (node , blockLengthType .primitiveType (), blockLengthTypeMaxValue );
179
+ }
170
180
171
181
if (numInGroupType == null )
172
182
{
@@ -176,25 +186,26 @@ else if (!isUnsigned(numInGroupType.primitiveType()))
176
186
{
177
187
XmlSchemaParser .handleError (node , "\" numInGroup\" must be unsigned type" );
178
188
}
179
- else if (numInGroupType .primitiveType () != UINT8 && numInGroupType .primitiveType () != UINT16 )
180
- {
181
- XmlSchemaParser .handleWarning (node , "\" numInGroup\" should be UINT8 or UINT16" );
182
- }
183
189
else
184
190
{
185
- final PrimitiveValue maxValue = numInGroupType .maxValue ();
186
- validateMaxValue (node , numInGroupType .primitiveType (), maxValue );
191
+ if (numInGroupType .primitiveType () != UINT8 && numInGroupType .primitiveType () != UINT16 )
192
+ {
193
+ XmlSchemaParser .handleWarning (node , "\" numInGroup\" should be UINT8 or UINT16" );
194
+ }
195
+
196
+ final PrimitiveValue numInGroupMaxValue = numInGroupType .maxValue ();
197
+ validateMaxValue (node , numInGroupType .primitiveType (), numInGroupMaxValue );
187
198
188
- final PrimitiveValue minValue = numInGroupType .minValue ();
189
- if (null != minValue )
199
+ final PrimitiveValue numInGroupMinValue = numInGroupType .minValue ();
200
+ if (null != numInGroupMinValue )
190
201
{
191
- final long max = maxValue != null ?
192
- maxValue .longValue () : numInGroupType .primitiveType ().maxValue ().longValue ();
202
+ final long max = numInGroupMaxValue != null ?
203
+ numInGroupMaxValue .longValue () : numInGroupType .primitiveType ().maxValue ().longValue ();
193
204
194
- if (minValue .longValue () > max )
205
+ if (numInGroupMinValue .longValue () > max )
195
206
{
196
207
XmlSchemaParser .handleError (node , String .format (
197
- "\" numInGroup\" minValue=%s greater than maxValue=%d" , minValue , max ));
208
+ "\" numInGroup\" minValue=%s greater than maxValue=%d" , numInGroupMinValue , max ));
198
209
}
199
210
}
200
211
}
0 commit comments