Skip to content

feat: Java 21 modernization — ogc - #18

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

feat: Java 21 modernization — ogc#18
devin-ai-integration[bot] wants to merge 7 commits into
developfrom
devin/java21-ogc

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown

Description of the Change

Applies conservative Java 21 pattern matching for instanceof in the gov.nasa.worldwind.ogc package.

Changed files:

  • src/gov/nasa/worldwind/ogc/OGCDCType.java
  • src/gov/nasa/worldwind/ogc/OGCRequestDescription.java
  • src/gov/nasa/worldwind/ogc/collada/ColladaAbstractObject.java
  • src/gov/nasa/worldwind/ogc/kml/KMLAbstractObject.java
  • src/gov/nasa/worldwind/ogc/kml/KMLStyleUrl.java
  • src/gov/nasa/worldwind/ogc/wms/WMSLayerCapabilities.java
  • src/gov/nasa/worldwind/ogc/wms/WMSLayerStyle.java

Before/after counts for this package scope:

  • new Runnable(): 1 → 1
  • new ActionListener(): 0 → 0
  • new Callable(): 0 → 0
  • new MouseListener(): 0 → 0
  • new KeyListener(): 0 → 0
  • new ChangeListener(): 0 → 0
  • new PropertyChangeListener(): 0 → 0
  • new WindowListener(): 0 → 0
  • instanceof locations: 147 → 147 (15 cast sites modernized)
  • Records introduced: 0
  • Sealed hierarchies introduced: 0
  • Deprecated API removals: 0
  • Text block conversions: 0

Verification:

  • ant -f release-build.xml under JDK 21: BUILD SUCCESSFUL
  • Test result: 435 tests, 0 failures, 0 errors, 7 skipped
  • Public/protected API diff check: no added public/protected declarations
  • Test files modified: none

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

Devin Review verdict: local verification passed; no automated CI checks are configured on this fork.

Flagged for human review: existing new Runnable() instance left unchanged; this PR intentionally limits OGC modernization to low-risk cast-site pattern matching.

Why Should This Be In Core?

The OGC parsers are a large part of the core SDK data model. This update modernizes safe cast paths for Java 21 while avoiding public API changes or parser behavior changes.

Benefits

  • Reduces cast boilerplate in OGC parsing code.
  • Keeps changes atomic to gov.nasa.worldwind.ogc.
  • Preserves the existing JDK 21 full-build test profile.

Potential Drawbacks

  • No functional behavior changes are intended.
  • Broader parser refactors were intentionally avoided to minimize migration risk.

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)
Open in Devin Review

@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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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