Skip to content

Fix unsafe Option.get, toString typo, and deprecation warnings#2

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/improve
Draft

Fix unsafe Option.get, toString typo, and deprecation warnings#2
Copilot wants to merge 3 commits intomasterfrom
copilot/improve

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 17, 2026

General improvements to code safety and maintainability.

Bug Fixes

  • SourceStage: Replace settings.destination.get with pattern matching to prevent NoSuchElementException. Now fails fast with IllegalArgumentException when destination is missing.
  • SourceStage: Fix toString returning "StompClientSink" instead of "StompClientSource"
  • JavaConverters: Move wildcard imports to top-level to eliminate deprecation warnings for Scala 2.13+ compatibility

Documentation

Add Scaladoc to public APIs:

  • ConnectorSettings parameters and usage semantics
  • SendingFrame factory methods
  • StompClientSource/StompClientSink materialization behavior and error conditions

Example

Before (unsafe):

connection.subscribe(settings.destination.get, headers.asJava, ...)  // throws if None

After (safe):

settings.destination match {
  case Some(dest) => connection.subscribe(dest, headers.asJava, ...)
  case None => 
    val ex = new IllegalArgumentException("destination is required for StompClientSource")
    promise.tryFailure(ex)
    failStage(ex)
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)
  • piccolo.link
    • Triggering command: /usr/bin/curl curl -L REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

improve


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 17, 2026 21:17
… JavaConverters imports

Co-authored-by: nachinius <222807+nachinius@users.noreply.github.com>
Co-authored-by: nachinius <222807+nachinius@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve code quality and documentation Fix unsafe Option.get, toString typo, and deprecation warnings Jan 17, 2026
Copilot AI requested a review from nachinius January 17, 2026 21:26
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