Skip to content
CAI
Software that uses CAICheck a score

scala/scala-collection-compat

57.3

Adequate · 7 November 2026

7.2k

lines of production code

Scala

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Added Java API collection forwarders for Scala 2.11 and 2.12

New \CollectionConverters\ objects have been added in the \scala.jdk.javaapi\ package for both Scala 2.11 and 2.12 compatibility layers. These objects provide explicit conversion methods (such as \asJava\ and \asScala\) between Scala and Java collection types, specifically designed to be used from Java code. The implementation delegates to the underlying Scala collection conversion traits (\WrapAsJava\/\WrapAsScala\ in 2.11 and \AsJavaConverters\/\AsScalaConverters\ in 2.12), ensuring consistent interoperability across supported Scala versions.

compat/src/main/scala-2.11/scala/jdk, compat/src/main/scala-2.12/scala/jdk · high confidence

Added Scala 2.11 compatibility for scala.util.Using

The \scala.util.Using\ utility for automatic resource management, previously available only in Scala 2.13, is now provided for Scala 2.11 via a backported implementation in the compatibility layer. This allows users on Scala 2.11 to use \Using.apply\ and \Using.Manager\ for safe resource handling with suppression behavior consistent with the standard library.

compat/src/main/scala-2.11/scala/util, compat/src/main/scala-2.12/scala/util · high confidence

Added Scala 2.13 migration rule outputs

New source files have been added to the scalafix output213 directory to provide migration rules for Scala 2.13-specific features. These include handling for \LazyList\ (including syntax like \\#::\ and \lazyAppendedAll\), \filterInPlace\ on mutable collections, and the new \lazyZip\ API for zipping two or more collections. Additionally, output files for Scala 2.12+ were added to cover \SortedMap\/\TreeMap\ range methods and \Breakout\ usage.

scalafix/output213 · high confidence

Added slim OptionConverters for Scala.js and Scala Native

A new \OptionConverters\ object has been added to the \compat/jsNative\ module to provide extension methods for converting between Scala \Option\ and Java \Optional\. This implementation is tailored for Scala.js and Scala Native environments; unlike the standard JVM version, it excludes conversions for primitive \Optional\ wrappers (e.g., \OptionalInt\) which are not available in these platforms. Users can now use \toJava\ and \toScala\ methods to seamlessly interoperate with Java libraries that rely on \java.util.Optional\.

compat/jsNative · high confidence

Adds Scala 2.11 compatibility extensions for collection operations

This change introduces a new compatibility package for Scala 2.11 that provides implicit extension methods to bring modern collection features to older Scala versions. Users can now use \filterKeys\ and \mapValues\ chaining on map views, access \enqueueAll\ on mutable queues, and utilize \sizeCompare\, \sizeIs\, and \lengthIs\ for size comparisons. The update also enables lazy zipped operations for tuples and adds \groupMap\ and \groupMapReduce\ functionality, ensuring API parity with newer Scala versions.

compat/src/main/scala-2.11/scala/collection · high confidence

Adds Scala 2.12 compatibility extensions for collections

This change introduces a new \compat\ package object for Scala 2.12 that provides implicit classes and conversions to bring newer collection features to the older version. Specifically, it adds \from\ factory methods to \mutable.TreeMap\ and \mutable.SortedMap\, enables chaining of \filterKeys\ after \mapValues\ on map views, and provides extension methods for \Queue\, \Tuple2Zipped\, and general traversable-like structures. These additions allow code written for newer Scala versions to compile and run on Scala 2.12 by supplying missing implicit conversions and builder factories.

compat/src/main/scala-2.12/scala/collection · high confidence

Automated code formatting via Scalafmt pre-commit hook

Developers can now automatically format Scala code using Scalafmt version 3.7.4 before committing changes. This change introduces a pre-commit git hook that invokes a new shell script to bootstrap and run Scalafmt, ensuring consistent code style across the project without manual intervention.

admin · high confidence

Backport OptionConverters to Scala 2.11 and 2.12

Users of Scala 2.11 and 2.12 can now use the \scala.jdk.OptionConverters\ API to seamlessly convert between Scala \Option\ and Java \Optional\ types, including specialized variants like \OptionalInt\, \OptionalDouble\, and \OptionalLong\. This backport brings parity with Scala 2.13, allowing developers to use methods such as \toJava\, \toScala\, and \toJavaPrimitive\ for interoperability with Java libraries without needing to upgrade their Scala version.

compat/jvm · high confidence

Backport Scala 2.13 collection compatibility API to Scala 2.11 and 2.12

This update introduces a comprehensive set of compatibility extensions for Scala 2.11 and 2.12, bringing many Scala 2.13 collection features to older versions. Key additions include the \BuildFrom\ type class for efficient collection construction, \StringOps\ for safe parsing methods (e.g., \toIntOption\), and various collection extension methods such as \distinctBy\, \groupMap\, \groupMapReduce\, \partitionMap\, \sizeCompare\, \sizeIs\, \lengthIs\, \tapEach\, \filterKeys\, \mapValues\, \nextOption\, \enqueueAll\, \maxBefore\, \minAfter\, \minOption\, \maxOption\, \minByOption\, \maxByOption\, \unfold\, and \Random.nextLong\. The implementation also includes internal optimizations like \IdentityPreservingBuilder\ to maintain collection identity during conversions and ensures binary compatibility through careful handling of \CanBuildFrom\ and \Factory\ types.

_compat/src/main/scala-2.11\2.12/scala/collection/compat · high confidence

Backport scala.jdk.CollectionConverters to Scala 2.11 and 2.12

A new \CollectionConverters\ object has been added to the compatibility layer for Scala 2.11 and 2.12, providing the \DecorateAsJava\ and \DecorateAsScala\ traits. This allows users on these older Scala versions to use the standard \scala.jdk\ collection conversion API, ensuring parity with newer Scala releases.

_compat/src/main/scala-2.11\2.12/scala/jdk · high confidence

Backports scala.util.chaining, ControlThrowable, and RegexOps to Scala 2.11/2.12

This change adds compatibility shims for Scala 2.11 and 2.12 to bring them in line with newer Scala standard library features. Users can now use the \scala.util.chaining\ syntax (importing \scala.util.chaining.\_\) to access \tap\ and \pipe\ methods on any type, enabling more fluent code chains. Additionally, \scala.util.control.compat.ControlThrowable\ is provided to allow creating flow-control throwables with disabled suppression and stack traces, ensuring consistent behavior across versions. Finally, \scala.util.matching.compat.RegexOps\ adds a \matches\ method to \Regex\ instances for direct boolean matching against character sequences.

_compat/src/main/scala-2.11\2.12/scala/util · high confidence

Build infrastructure upgraded to sbt 1.13 and Scala 3 support added

The build system has been upgraded from sbt 0.13.13 to sbt 1.13.0, bringing significant changes to the development environment. This update introduces support for Scala 3, allowing users to build and test the library against this newer language version alongside existing Scala 2.x releases. The build now utilizes the \sbt-scala-module\ plugin (v3.4.1) to manage multi-version compilation and introduces a \MultiScalaProject\ abstraction in the build definition to simplify cross-compilation setup. Additionally, Scala.js and Scala Native support has been updated to their latest versions (1.20.1 and 0.5.8 respectively), and the Scalafix plugin has been upgraded to 0.14.7.

project · high confidence

New Scala 2.13 collection migration rules

This location introduces a new set of Scalafix rules to help migrate Scala codebases to the 2.13 collection API. The \Collection213CrossCompat\ rule handles cross-compatible changes, such as replacing deprecated \Traversable\ with \Iterable\, updating symbolic fold operators (\/:\ and \:\\\) to \foldLeft\/\foldRight\, and rewriting \breakOut\ usage. The \Collection213Upgrade\ rule (implied by the service registration and structure) likely handles stricter upgrades. The \Collection213Roughly\ rule provides a 'rough' migration for cases with potential runtime semantic differences, such as converting \Stream\ to \LazyList\ and handling strict \mapValues\/\filterKeys\ conversions. The \Collection213Experimental\ rule is also registered, suggesting additional experimental transformations. These rules are registered via the \META-INF/services/scalafix.v1.Rule\ file, making them available for use in Scalafix configurations.

scalafix/rules · high confidence

Removals

Removed Collectionstrawman\_v0 input test case

The input test case file for the Collectionstrawman\_v0 migration rule has been removed from the project. This deletion eliminates the specific example code used to verify the behavior of this particular migration rule.

input · high confidence

Removed deprecated Collectionstrawman\_v0 rewrite rule

The \Collectionstrawman\_v0\ rewrite rule, which previously handled imports for \scala.collection.immutable.List\ by adding global imports for \scala.List\ and \strawman.collection.immutable.List\, has been removed from the codebase.

rewrites · high confidence

Removed strawman collection migration output file

The generated output file for the strawman collection migration (Collectionstrawman\_v0.scala) has been removed. This file previously contained code demonstrating the migration of scala.List to strawman.collection.immutable.List, but it is no longer part of the output.

output · high confidence

Behavioural changes

Added @nowarn annotation stub for Scala 2.11 compatibility

A stub implementation of the \@nowarn\ annotation has been added to the Scala 2.11 compatibility layer. This allows codebases using \@nowarn\ to cross-compile against Scala 2.11, where the annotation is natively unavailable (it was introduced in 2.12.13 and 2.13.2). While the annotation provides no actual warning suppression functionality on Scala 2.11, its presence prevents compilation errors for users relying on this feature in newer Scala versions.

compat/src/main/scala-2.11/scala/annotation · high confidence

Added Scala 2.13 compatibility shims for control and matching utilities

New compatibility package objects have been added for Scala 2.13 to ensure API consistency with newer Scala versions. The \scala.util.control.compat\ package now exposes \ControlThrowable\ as a type alias, and the \scala.util.matching.compat\ package exposes both the \Regex\ type and its companion object, allowing code to reference these standard library components through a unified compatibility layer.

compat/src/main/scala-2.13/scala/util · high confidence

Adds Scala 2.11/2.12 compatibility shim for @unused annotation

A compatibility shim for the \@unused\ annotation has been added to the \scala.annotation\ package for Scala 2.11 and 2.12. This new file provides a polyfill that delegates to the \@deprecated\ annotation, enabling codebases to use the \@unused\ marker on older Scala versions where it is not natively supported, ensuring consistent compiler behavior across supported Scala versions.

_compat/src/main/scala-2.11\2.12/scala/annotation · high confidence

Backport Scala 2.13 collection compatibility types to Scala 2.13 runtime

This change introduces compatibility shims in the \scala.collection.compat\ package for Scala 2.13 itself, specifically adding type aliases and values for \Factory\, \BuildFrom\, \IterableOnce\, \ArraySeq\, and \LazyList\. By re-exporting these Scala 2.13 standard library types under the \compat\ namespace, the library ensures that code written against the compatibility layer can reference these types consistently, effectively backporting the 2.13 collection API surface to the 2.13 runtime environment.

compat/src/main/scala-2.13/scala/collection · high confidence

Immutable ArraySeq update method deprecated

The \update\ method on \ArraySeq\ implementations (such as \ofInt\, \ofByte\, etc.) is now deprecated as of version 2.4.2. Attempting to call \update\ on an immutable \ArraySeq\ will throw an \UnsupportedOperationException\, reinforcing that these collections are strictly immutable and preventing accidental mutation.

_compat/src/main/scala-2.11\2.12/scala/collection/compat/immutable · high confidence

LazyList backport and Future migration rules

This release backports the immutable LazyList collection to Scala 2.11 and 2.12, providing a lazy, memoized linked-list implementation compatible with Scala 2.13. Additionally, it introduces a Scalafix rule that automatically migrates deprecated Future.onFailure and Future.onSuccess callbacks to the unified onComplete method, ensuring safer and more consistent error handling in codebases targeting older Scala versions.

repository · high confidence

Repository restructured and rebranded as scala-collection-compat

The project has been renamed from 'scalafix rewrites for collection-strawman' to 'scala-collection-compat' and restructured to include both the compatibility library and the migration tool. The repository now provides a compatibility layer for Scala 2.13 APIs on Scala 2.11 and 2.12, alongside scalafix rules (\Collection213Upgrade\ and \Collection213CrossCompat\) to assist in migrating codebases. Key changes include the addition of a \CODE\_OF\_CONDUCT.md\, a \CONTRIBUTING.md\ detailing how to add migration rules, and configuration files for \scalafmt\ (v3.11.5) and \scala-steward\. The build configuration now targets Scala 2.11, 2.12, and 2.13, with the library available for JVM, Scala.js, and Scala Native. The old \readme.md\ was removed and replaced with a comprehensive \README.md\ explaining usage, migration strategies, and cross-compilation support.

(repo-wide) · high confidence

Updated collection migration rules for Scala 2.13 compatibility

The scalafix rules in this location have been rewritten to handle modern Scala collection patterns, replacing legacy \CanBuildFrom\ usage with \Factory\ and \BuildFrom\, and updating \breakOut\ syntax. The rules now cover a broader range of collection operations, including \Set\/\Map\ addition and subtraction, \Map.zip\ and \mapValues\ transformations, and \Traversable\ iterator conversions. Additionally, support has been added for \rangeFrom\, \rangeTo\, and \rangeUntil\ on sorted collections, as well as \iterableFactory\ access on companion objects.

scalafix/output/src/main/scala/fix · high confidence

Test coverage

Added JVM-specific tests for LazyList garbage collection and string parsing; Added JavaConversions data source for migration testing; Added Scala 2.12 compatibility test for collection factory access; Added Scala.js tests for OptionConverters; Added Scalafix test suite; Added binary compatibility test for collection factory migration; Added binary compatibility test using MiMa; Added input fixtures for Collection213 migration rules; Added negative test for CanBuildFrom in Scala 2.13; Added test coverage for Scala collection compatibility features; Added test fixtures for JavaConversions explicit, global, and specific import scenarios; Added test inputs for JavaConversions migration rule; Added tests for CollectionConverters; Added tests for Random.nextLong(long bound); Added tests for Scala-Java collection and Option converters; Added tests for compatibility-layer utility operations; Added tests for immutable collection conservation in ToConserve conversions; Added tests for scala.util.Using exception handling; Removed Collectionstrawman rewrite test suite.

Dependencies

Updated Scala versions to 2.12.20, 2.13.17, and 3.3.7

The build configuration has been updated to use newer versions of the Scala compiler: 2.12.20, 2.13.17, and 3.3.7. This ensures that the \scala-collection-compat\ library is built and tested against the latest stable releases of Scala 2.12, 2.13, and Scala 3, providing users with compatibility support for the most recent language features and standard library updates.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 59 → 57 (-1.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 70 → 70 (+0.0)
  • Architecture 89 → 88 (-1.7)
  • Maturity 58 → 60 (+1.6)
  • Readiness 49 → 49 (+0.0)
  • Security 79 → 65 (-13.9)

Findings

  • No change — the same findings as the prior survey.

Changes since last survey

  • 6 commits — 6 feature/other, 0 fixes

By area

  • (repo) — 2 commits
  • (root) — 1 commit
  • .github/workflows — 1 commit
  • project/build.properties — 1 commit
  • project/plugins.sbt — 1 commit

Notable commits

  • change: Bump coursier/cache-action from 8 to 9
  • change: Merge pull request #775 from scala-steward/update/scala3-library_sjs1-3.3.9
  • change: Merge pull request #779 from scala/dependabot/github_actions/coursier/cache-action-9
  • change: Update sbt, scripted-plugin to 1.13.1
  • change: Update sbt-scala-native to 0.5.12
  • change: Update scala3-library_sjs1 to 3.3.9

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

scala/scala-collection-compat was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 7 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit afa55e5f28d78362627704b497face2180d39bae — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-5f8314471808.