Copilot commented on code in PR #2462:
URL: https://github.com/apache/orc/pull/2462#discussion_r2629455167
##########
java/core/src/java/org/apache/orc/TypeDescription.java:
##########
@@ -241,10 +241,14 @@ public static TypeDescription fromString(String typeName)
{
public TypeDescription withPrecision(int precision) {
if (category != Category.DECIMAL) {
throw new IllegalArgumentException("precision is only allowed on
decimal"+
- " and not " + category.name);
- } else if (precision < 1 || precision > MAX_PRECISION || scale >
precision){
- throw new IllegalArgumentException("precision " + precision +
- " is out of range 1 .. " + scale);
+ " and not " + category.name);
+ } else if (precision < 1 || precision > MAX_PRECISION) {
+ throw new IllegalArgumentException(
+ "precision " + precision + " must be between 1 and " + MAX_PRECISION
+ );
+ } else if (scale > precision) {
+ throw new IllegalArgumentException("the scale " + scale + " must be less
than" +
+ " or equal to precision " + precision);
Review Comment:
Consider removing the article "the" before "scale" for consistency with
other error messages in this class. Most error messages in this file start with
the property name directly (e.g., "precision is only allowed..." on line 243,
"scale is only allowed..." on line 264). The message could be: "scale " + scale
+ " must be less than or equal to precision " + precision
```suggestion
throw new IllegalArgumentException("scale " + scale +
" must be less than or equal to precision " + precision);
```
--
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]