Skip to content

feat: Java 21 modernization — event - #3

Open
devin-ai-integration[bot] wants to merge 3 commits into
developfrom
devin/java21-event
Open

devin-ai-integration[bot] wants to merge 3 commits into
developfrom
devin/java21-event

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented May 26, 2026 •

Copy link
Copy Markdown

Note: Filling out this template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the
maintainer's discretion.

Description of the Change

Modernizes the gov.nasa.worldwind.event package for Java 21 by converting the single safe instanceof + cast expression in BulkRetrievalEvent#getSource() to Java 21 pattern matching.

Before counts for src/gov/nasa/worldwind/event/:

new Runnable(): 0
new ActionListener(): 0
new Callable(): 0
new MouseListener(): 0
new KeyListener(): 0
new ChangeListener(): 0
new PropertyChangeListener(): 0
new WindowListener(): 0
instanceof: 1

After counts:

new Runnable(): 0
new ActionListener(): 0
new Callable(): 0
new MouseListener(): 0
new KeyListener(): 0
new ChangeListener(): 0
new PropertyChangeListener(): 0
new WindowListener(): 0
instanceof: 1

Modernization summary:

Anonymous-inner-class conversions: 0
instanceof → pattern-match conversions: 1
Records introduced: 0
Sealed hierarchies: 0
Deprecated usage removals: 0
Text-block conversions: 0
Files.readString/writeString conversions: 0

Verification:

ant -f release-build.xml
Result: BUILD SUCCESSFUL
JUnit: files=49 tests=435 failures=0 errors=0 skipped=7

Public API diff check:
git diff origin/develop -- src/gov/nasa/worldwind/event | grep -E "^\+.*public |^\+.*protected " | head -50
(no output)

Flagged for human review: none. The package had no anonymous SAM classes to convert and no skipped candidate requiring judgment.

Devin Review verdict: pending/not yet posted at PR creation time.

Devin session: https://app.devin.ai/sessions/36287b7c637242dba0a6a659737d5402

Why Should This Be In Core?

This keeps the package aligned with the Java 21 build target while preserving its public API and behavior.

Benefits

  • Removes a redundant explicit cast in favor of Java 21 pattern matching.
  • Confirms the package remains compatible with the full release build and test suite.
  • Keeps the event package modernization atomic and easy to review.

Potential Drawbacks

  • Minimal source modernization only; broader modernization is intentionally deferred to other package-scoped PRs.

Applicable Issues

N/A

Requested by: @jakexcosme


Devin Review

Status Commit
⚪ Not started —

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

@devin-ai-integration

Copy link
Copy Markdown
Author
Original prompt from Jake

#``# Overview

Migrate COG-GTM/WorldWindJava from Java 11 to Java 21 LTS. This is a federal-grade, zero-breakage migration with atomic per-package PRs, full test verification before and after, and a rollup audit document. Use parallel child sessions to accelerate. All PRs target the fork's develop branch.

#``# PHASE 0: Pre-Migration Baseline (Sequential — MUST complete before anything else)

#``#``# Step 0.1: Capture Pre-Migration Baseline Metrics
Before ANY changes, on the develop branch with JDK 11:

`#` File count
find src -name "*.java" | wc -l
`#` Anonymous inner class counts
grep -rn "new Runnable()" --include="*.java" src/ | wc -l
grep -rn "new ActionListener()" --include="*.java" src/ | wc -l
grep -rn "new Callable()" --include="*.java" src/ | wc -l
grep -rn "new MouseListener()" --include="*.java" src/ | wc -l
grep -rn "new KeyListener()" --include="*.java" src/ | wc -l  
grep -rn "new ChangeListener()" --include="*.java" src/ | wc -l
grep -rn "new PropertyChangeListener()" --include="*.java" src/ | wc -l
grep -rn "new WindowListener()" --include="*.java" src/ | wc -l
`#` instanceof pattern-match candidates
grep -rn "instanceof " --include="*.java" src/ | wc -l
`#` Deprecated usage
grep -rn "`@`Deprecated" --include="*.java" src/ | wc -l
grep -rn "new Integer(" --include="*.java" src/ | wc -l
grep -rn "new Double(" --include="*.java" src/ | wc -l
grep -rn "new Float(" --include="*.java" src/ | wc -l
grep -rn "new Long(" --include="*.java" src/ | wc -l
grep -rn "new Boolean(" --include="*.java" src/ | wc -l

Save all counts to a file BASELINE-METRICS.txt at the repo root. This is your "before" snapshot.

#``#``# Step 0.2: Run the existing test suite under JDK 11

ant -f release-build.xml

Record pass/fail counts. This establishes that the test suite is green BEFORE migration.

#``# PHASE 1: Foundational JDK 21 Retarget PR (Sequential — Wave 0)

#``#``# Step 1.1: Create branch devin/java21-foundation
Make these changes ONLY (no code changes):

  1. **`release-... (12653 chars truncated...)

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

1 participant