Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed 39 build warnings due to upcoming Scala 3 changes and previously deprecated methods. #52

Merged
merged 1 commit into from
May 30, 2024

Conversation

jverbus
Copy link
Contributor

@jverbus jverbus commented May 30, 2024

Builds are generating a lot of warnings (39 in total) due to current and future deprecations. I've addressed all warnings in this PR.

Here is an example build before these changes:

(base) jv@Jamess-MBP isolation-forest % ./gradlew clean build --no-build-cache                         


> Configure project :
Building version '3.1.1'
  - reason: shipkit-auto-version deduced version based on previous tag: '3.1.0'

> Configure project :isolation-forest
Scala version: 2.13.14
Spark version: 3.5.1

> Task :isolation-forest:compileScala
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/main/scala/com/linkedin/relevance/isolationforest/IsolationForest.scala:49: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method head,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/main/scala/com/linkedin/relevance/isolationforest/IsolationForest.scala:97: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method toDS,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/main/scala/com/linkedin/relevance/isolationforest/IsolationForest.scala:109: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method get,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/main/scala/com/linkedin/relevance/isolationforest/IsolationForest.scala:127: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method get,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/main/scala/com/linkedin/relevance/isolationforest/IsolationForestModelReadWrite.scala:302: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method extractParamMap,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/main/scala/com/linkedin/relevance/isolationforest/IsolationTree.scala:127: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method nextDouble,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/main/scala/com/linkedin/relevance/isolationforest/IsolationForestModelReadWrite.scala:257: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): implicit conversions from Array to immutable.IndexedSeq are implemented by copying; use `toIndexedSeq` explicitly if you want to copy, or use the more efficient non-copying ArraySeq.unsafeWrapArray
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/main/scala/com/linkedin/relevance/isolationforest/IsolationTree.scala:50: method seq in trait Iterable is deprecated (since 2.13.0): Iterable.seq always returns the iterable itself
8 warnings found

> Task :isolation-forest:compileTestScala
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/BaggedPointTest.scala:48: procedure syntax is deprecated: instead, add `: Unit =` to explicitly declare `testRandomArrays`'s return type [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:41: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method overwrite,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:47: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method extractParamMap,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:48: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method extractParamMap,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:67: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method collect,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:68: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method collect,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:105: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method overwrite,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:111: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method extractParamMap,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:112: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method extractParamMap,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:131: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method collect,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:132: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method collect,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:185: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method overwrite,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:200: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method collect,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:201: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method collect,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:217: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method overwrite,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:223: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method extractParamMap,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestModelWriteReadTest.scala:224: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method extractParamMap,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestTest.scala:35: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method overwrite,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestTest.scala:40: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method extractParamMap,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestTest.scala:41: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method extractParamMap,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestTest.scala:151: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method collect,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestTest.scala:198: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method count,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/IsolationForestTest.scala:201: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method count,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/TestUtils.scala:31: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method builder,
or remove the empty argument list from its definition (Java-defined methods are exempt).
In Scala 3, an unapplied method like this will be eta-expanded into a function. [quickfixable]
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/BaggedPointTest.scala:66: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): implicit conversions from Array to immutable.IndexedSeq are implemented by copying; use `toIndexedSeq` explicitly if you want to copy, or use the more efficient non-copying ArraySeq.unsafeWrapArray
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/BaggedPointTest.scala:83: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): implicit conversions from Array to immutable.IndexedSeq are implemented by copying; use `toIndexedSeq` explicitly if you want to copy, or use the more efficient non-copying ArraySeq.unsafeWrapArray
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/BaggedPointTest.scala:104: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): implicit conversions from Array to immutable.IndexedSeq are implemented by copying; use `toIndexedSeq` explicitly if you want to copy, or use the more efficient non-copying ArraySeq.unsafeWrapArray
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/BaggedPointTest.scala:124: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): implicit conversions from Array to immutable.IndexedSeq are implemented by copying; use `toIndexedSeq` explicitly if you want to copy, or use the more efficient non-copying ArraySeq.unsafeWrapArray
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/BaggedPointTest.scala:145: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): implicit conversions from Array to immutable.IndexedSeq are implemented by copying; use `toIndexedSeq` explicitly if you want to copy, or use the more efficient non-copying ArraySeq.unsafeWrapArray
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/BaggedPointTest.scala:171: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): implicit conversions from Array to immutable.IndexedSeq are implemented by copying; use `toIndexedSeq` explicitly if you want to copy, or use the more efficient non-copying ArraySeq.unsafeWrapArray
[Warn] /Users/jv/Documents/git/isolation-forest/isolation-forest/src/test/scala/com/linkedin/relevance/isolationforest/BaggedPointTest.scala:190: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): implicit conversions from Array to immutable.IndexedSeq are implemented by copying; use `toIndexedSeq` explicitly if you want to copy, or use the more efficient non-copying ArraySeq.unsafeWrapArray
31 warnings found

BUILD SUCCESSFUL in 1m 39s
12 actionable tasks: 11 executed, 1 up-to-date

And here is the same build after the changes in this PR:

(base) jv@Jamess-MBP isolation-forest % ./gradlew clean build --no-build-cache


> Configure project :
Building version '3.1.1'
  - reason: shipkit-auto-version deduced version based on previous tag: '3.1.0'

> Configure project :isolation-forest
Scala version: 2.13.14
Spark version: 3.5.1

BUILD SUCCESSFUL in 1m 42s
12 actionable tasks: 11 executed, 1 up-to-date

Copy link

@angie-z angie-z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for taking care of this repo!

@jverbus jverbus merged commit 73a4a45 into master May 30, 2024
12 checks passed
@jverbus jverbus deleted the fix_build_warnings branch May 30, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants