From f4830365cf15c9ad27ad1662d77be964a06c4653 Mon Sep 17 00:00:00 2001 From: Ruslan Iushchenko Date: Thu, 16 Sep 2021 16:20:56 +0200 Subject: [PATCH] #420 Make Scala 2.11 compiler happy --- .../extractors/raw/FixedBlockParameters.scala | 16 ++++++++++++++++ .../cobrix/cobol/reader/parameters/Bdw.scala | 18 +++++++++++++++++- .../parameters/CobolParametersParser.scala | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/reader/extractors/raw/FixedBlockParameters.scala b/cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/reader/extractors/raw/FixedBlockParameters.scala index b348267e..d2296196 100644 --- a/cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/reader/extractors/raw/FixedBlockParameters.scala +++ b/cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/reader/extractors/raw/FixedBlockParameters.scala @@ -1,3 +1,19 @@ +/* + * Copyright 2018 ABSA Group Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package za.co.absa.cobrix.cobol.reader.extractors.raw case class FixedBlockParameters( diff --git a/cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/reader/parameters/Bdw.scala b/cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/reader/parameters/Bdw.scala index 96120355..e772ef3b 100644 --- a/cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/reader/parameters/Bdw.scala +++ b/cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/reader/parameters/Bdw.scala @@ -1,8 +1,24 @@ +/* + * Copyright 2018 ABSA Group Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package za.co.absa.cobrix.cobol.reader.parameters case class Bdw( isBigEndian: Boolean, adjustment: Int, blockLength: Option[Int], - recordsPerBlock: Option[Int], + recordsPerBlock: Option[Int] ) diff --git a/spark-cobol/src/main/scala/za/co/absa/cobrix/spark/cobol/parameters/CobolParametersParser.scala b/spark-cobol/src/main/scala/za/co/absa/cobrix/spark/cobol/parameters/CobolParametersParser.scala index 655fcb8c..dfbae29f 100644 --- a/spark-cobol/src/main/scala/za/co/absa/cobrix/spark/cobol/parameters/CobolParametersParser.scala +++ b/spark-cobol/src/main/scala/za/co/absa/cobrix/spark/cobol/parameters/CobolParametersParser.scala @@ -320,7 +320,7 @@ object CobolParametersParser { params.getOrElse(PARAM_IS_BDW_BIG_ENDIAN, "false").toBoolean, params.getOrElse(PARAM_BDW_ADJUSTMENT, "0").toInt, params.get(PARAM_BLOCK_LENGTH).map(_.toInt), - params.get(PARAM_RECORDS_PER_BLOCK).map(_.toInt), + params.get(PARAM_RECORDS_PER_BLOCK).map(_.toInt) ) if (bdw.blockLength.nonEmpty && bdw.recordsPerBlock.nonEmpty) { throw new IllegalArgumentException(s"Options '$PARAM_BLOCK_LENGTH' and '$PARAM_RECORDS_PER_BLOCK' cannot be used together.")