AMashenkov commented on code in PR #6968:
URL: https://github.com/apache/ignite-3/pull/6968#discussion_r2538451314
##########
modules/core/src/main/java/org/apache/ignite/internal/type/NativeType.java:
##########
@@ -41,18 +41,11 @@ public class NativeType implements Comparable<NativeType> {
* @param size Type size in bytes.
*/
protected NativeType(ColumnType typeSpec, int size) {
- this.fixedSize = !((typeSpec.precisionAllowed() &&
typeSpec.scaleAllowed()) || typeSpec.lengthAllowed());
-
- if (!this.fixedSize) {
- throw new IllegalArgumentException("Size must be provided only for
fixed-length types: " + typeSpec);
- }
-
- if (size <= 0) {
- throw new IllegalArgumentException("Size must be positive
[typeSpec=" + typeSpec + ", size=" + size + ']');
- }
-
- this.typeSpec = typeSpec;
- this.size = size;
+ this(
+ typeSpec,
+ !((typeSpec.precisionAllowed() && typeSpec.scaleAllowed()) ||
typeSpec.lengthAllowed()),
Review Comment:
```suggestion
isFixedSize(typeSpec),
```
```
private static boolean isFixedSize(ColumnType typeSpec) {
return !((typeSpec.precisionAllowed() && typeSpec.scaleAllowed()) ||
typeSpec.lengthAllowed());
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]