You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 clear-cut Java 21 pattern-matching opportunities in src/gov/nasa/worldwind/terrain/ only:
Converted 11 instanceof-then-cast sites to Java 21 pattern matching.
Updated 6 files: CompoundElevationModel.java, LocalElevationModel.java, RectangularTessellator.java, SectorGeometryList.java, WCSElevationModel.java, and WMSBasicElevationModel.java.
Introduced 0 records, 0 sealed hierarchies, 0 text blocks, and 0 deprecated API removals.
Made no public/protected API signature changes and no test changes.
Verification:
Before counts: new Runnable(): 3, new ActionListener(): 0, new Callable(): 0, new MouseListener(): 0, new KeyListener(): 0, new ChangeListener(): 0, new PropertyChangeListener(): 1, new WindowListener(): 0, instanceof: 19.
After counts: same aggregate instanceof count, with 11 local cast-after-check sites converted to pattern variables.
git diff origin/devin/java21-foundation -- src/gov/nasa/worldwind/terrain | grep -E "^\+.*public |^\+.*protected " returned no public/protected API additions.
ant -f release-build.xml under JDK 21: BUILD SUCCESSFUL; JUnit: 435 tests, 0 failures, 0 errors, 7 skipped.
Flagged for human review:
Remaining new Runnable() and new PropertyChangeListener() anonymous classes are retained due to threading/listener semantics and/or anonymous class shape.
Remaining instanceof checks are retained when they are pure boolean guards, negative guards, or readability-neutral cases without nearby casts.
This is one atomic package step in the Java 11 to Java 21 LTS migration. It keeps terrain/elevation behavior stable while reducing legacy cast boilerplate.
Benefits
Uses Java 21 pattern variables for clearer local type narrowing.
Preserves existing behavior and package boundaries.
Keeps the migration reviewable as a package-scoped PR.
Potential Drawbacks
This PR depends on the foundation JDK 21 build-retargeting work for compilation under Java 21.
Listener/threading anonymous classes remain intentionally unchanged for compatibility.
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:
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 clear-cut Java 21 pattern-matching opportunities in
src/gov/nasa/worldwind/terrain/only:instanceof-then-cast sites to Java 21 pattern matching.CompoundElevationModel.java,LocalElevationModel.java,RectangularTessellator.java,SectorGeometryList.java,WCSElevationModel.java, andWMSBasicElevationModel.java.Verification:
new Runnable(): 3,new ActionListener(): 0,new Callable(): 0,new MouseListener(): 0,new KeyListener(): 0,new ChangeListener(): 0,new PropertyChangeListener(): 1,new WindowListener(): 0,instanceof: 19.instanceofcount, with 11 local cast-after-check sites converted to pattern variables.git diff origin/devin/java21-foundation -- src/gov/nasa/worldwind/terrain | grep -E "^\+.*public |^\+.*protected "returned no public/protected API additions.ant -f release-build.xmlunder JDK 21:BUILD SUCCESSFUL; JUnit: 435 tests, 0 failures, 0 errors, 7 skipped.Flagged for human review:
new Runnable()andnew PropertyChangeListener()anonymous classes are retained due to threading/listener semantics and/or anonymous class shape.instanceofchecks are retained when they are pure boolean guards, negative guards, or readability-neutral cases without nearby casts.Devin session: https://app.devin.ai/sessions/36287b7c637242dba0a6a659737d5402
Devin Review verdict: ready for review; no API/test-surface changes detected locally.
Why Should This Be In Core?
This is one atomic package step in the Java 11 to Java 21 LTS migration. It keeps terrain/elevation behavior stable while reducing legacy cast boilerplate.
Benefits
Potential Drawbacks
Applicable Issues
N/A
Requested by: @jakexcosme
Devin Review