stevedlawrence commented on a change in pull request #460:
URL: https://github.com/apache/incubator-daffodil/pull/460#discussion_r532634956
##########
File path:
daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/dafext.xsd
##########
@@ -265,28 +302,48 @@
tunable tunable sets an upper limit for values to prevent
overflow.
</xs:documentation>
</xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:int">
+ <xs:minInclusive value="1" />
+ </xs:restriction>
+ </xs:simpleType>
</xs:element>
- <xs:element name="maximumRegexMatchLengthInCharacters" type="xs:int"
default="1048576" minOccurs="0">
+ <xs:element name="maximumRegexMatchLengthInCharacters"
default="1048576" minOccurs="0">
<xs:annotation>
<xs:documentation>
Maximum number of characters to match when performing regular
expression
matches on input data.
</xs:documentation>
</xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:int">
+ <xs:minInclusive value="1" />
+ </xs:restriction>
+ </xs:simpleType>
</xs:element>
- <xs:element name="maximumSimpleElementSizeInCharacters" type="xs:int"
default="1048576" minOccurs="0">
+ <xs:element name="maximumSimpleElementSizeInCharacters"
default="1048576" minOccurs="0">
<xs:annotation>
<xs:documentation>
Maximum number of characters to parse when parsing string data.
</xs:documentation>
</xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:int">
+ <xs:minInclusive value="1" />
+ </xs:restriction>
+ </xs:simpleType>
</xs:element>
- <xs:element name="minBinaryDecimalVirtualPoint" type="xs:int"
default="-200" minOccurs="0">
+ <xs:element name="minBinaryDecimalVirtualPoint" default="-200"
minOccurs="0">
<xs:annotation>
<xs:documentation>
The smallest allowed value of the dfdl:binaryDecimalVirtualPoint
property.
</xs:documentation>
</xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:int">
+ <xs:maxInclusive value="-1" />
+ </xs:restriction>
+ </xs:simpleType>
</xs:element>
Review comment:
The min/maxBinaryDecimalVirtualPoint tunables describe the smallest and
largest allowed values of the dfdl:binaryDecimalVirtualPoint property. The
value of this property is essentially used by doing:
```scala
val bigDec = new JBigDecimal(bigInt, binaryDecimalVirtualPoint)
```
I believe we ran into a bug where very large and very small values of
binaryDecimalVirtualPoint didn't work as expected so we put in placed an
arbitrary limit of -200 to 200. And I think the tunable was added as a way to
easily change this arbitrary limit if needed.
My thinking with min/maxBinaryDecimalVirtual point was that
minBinaryDecimalVirtualPoint should always be negative so has a max value of
-1. And maxBinaryDecimalVirtualPoint should be positive, so has a min value of
1.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]