@@ -275,8 +275,8 @@ object IntervalUtils {
275275 }
276276 }
277277
278- def fromUnitStrings (units : Array [String ], fields : Array [String ]): CalendarInterval = {
279- assert(units.length == fields .length)
278+ def fromUnitStrings (units : Array [String ], values : Array [String ]): CalendarInterval = {
279+ assert(units.length == values .length)
280280 var months : Int = 0
281281 var days : Int = 0
282282 var microseconds : Long = 0
@@ -285,26 +285,26 @@ object IntervalUtils {
285285 try {
286286 units(i) match {
287287 case " year" =>
288- months = Math .addExact(months, Math .multiplyExact(fields (i).toInt, 12 ))
288+ months = Math .addExact(months, Math .multiplyExact(values (i).toInt, 12 ))
289289 case " month" =>
290- months = Math .addExact(months, fields (i).toInt)
290+ months = Math .addExact(months, values (i).toInt)
291291 case " week" =>
292- days = Math .addExact(days, Math .multiplyExact(fields (i).toInt, 7 ))
292+ days = Math .addExact(days, Math .multiplyExact(values (i).toInt, 7 ))
293293 case " day" =>
294- days = Math .addExact(days, fields (i).toInt)
294+ days = Math .addExact(days, values (i).toInt)
295295 case " hour" =>
296- val hoursUs = Math .multiplyExact(fields (i).toLong, MICROS_PER_HOUR )
296+ val hoursUs = Math .multiplyExact(values (i).toLong, MICROS_PER_HOUR )
297297 microseconds = Math .addExact(microseconds, hoursUs)
298298 case " minute" =>
299- val minutesUs = Math .multiplyExact(fields (i).toLong, MICROS_PER_MINUTE )
299+ val minutesUs = Math .multiplyExact(values (i).toLong, MICROS_PER_MINUTE )
300300 microseconds = Math .addExact(microseconds, minutesUs)
301301 case " second" =>
302- microseconds = Math .addExact(microseconds, parseSecondNano(fields (i)))
302+ microseconds = Math .addExact(microseconds, parseSecondNano(values (i)))
303303 case " millisecond" =>
304- val millisUs = Math .multiplyExact(fields (i).toLong, MICROS_PER_MILLIS )
304+ val millisUs = Math .multiplyExact(values (i).toLong, MICROS_PER_MILLIS )
305305 microseconds = Math .addExact(microseconds, millisUs)
306306 case " microsecond" =>
307- microseconds = Math .addExact(microseconds, fields (i).toLong)
307+ microseconds = Math .addExact(microseconds, values (i).toLong)
308308 }
309309 } catch {
310310 case e : Exception =>
0 commit comments