You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "dkropachev (via GitHub)" <gi...@apache.org> on 2026/02/24 23:52:08 UTC
[PR] Enable -Werror and fix all Scala compilation warnings [cassandra-spark-connector]
dkropachev opened a new pull request, #1385:
URL: https://github.com/apache/cassandra-spark-connector/pull/1385
## Summary
- Add `-Werror` to `scalacOptions` in `build.sbt` so the build fails on any Scala compiler warning
- Fix all existing warnings across 58 files in `driver/`, `connector/`, and `test-support/` modules
## Warning categories fixed
- **Implicit definitions without explicit types** — added return type annotations (ColumnMapper, CanBuildFrom, package.scala, Batch, RowWriterFactory, DseGraphUnionedRDD, SplitSizeEstimator, etc.)
- **Auto-application deprecation** — added explicit `()` to nullary method calls (MultiplexingSchemaListener, CassandraScanBuilder, openSession, createResultProjection, etc.)
- **Deprecated collection APIs** — `mapValues` → `.view.mapValues().toMap`, `Stream` → `LazyList`, `toIterator` → `iterator`, `toStream` → `.to(LazyList)`, `JavaConverters` → `jdk.CollectionConverters`
- **Implicit Array-to-IndexedSeq conversions** — added explicit `.toIndexedSeq` calls
- **Array varargs defensive copy** — added `.toIndexedSeq` before `: _*` splats
- **Unicode arrows** — replaced `→`/`⇒` with `->`/`=>`
- **Missing language imports** — added `implicitConversions`, `existentials`, `reflectiveCalls` where needed
- **Non-exhaustive matches** — added missing cases
- **Deprecated Java/library APIs** — suppressed with `@nowarn("cat=deprecation")` where no alternative exists (JaroWinkler, getNodeFilter, Date methods)
- **Unchecked erasure patterns** — added `@unchecked` annotations
- **Deprecated symbol literals** — replaced `'name` with `Symbol("name")`
- **Deprecated `Class.newInstance()`** — replaced with `getDeclaredConstructor().newInstance()`
## Test plan
- [x] `./sbt/sbt clean compile` succeeds with zero warnings
- [x] `./sbt/sbt clean test:compile` succeeds with zero warnings
- [x] `./sbt/sbt test` — all 320 unit tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org