Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ language: java

# Configure the build to use Oracle JDK 9
jdk:
- openjdk11
- openjdk21

# Install the Ant JUnit package, which is missing from the Travis CI environment. See the Travis documentation: https://docs.travis-ci.com/user/installing-dependencies/#Adding-APT-Packages
addons:
Expand Down
4 changes: 2 additions & 2 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ javac.modulepath=
javac.processormodulepath=
javac.processorpath=\
${javac.classpath}
javac.source=11
javac.target=11
javac.source=21
javac.target=21
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
Expand Down
2 changes: 1 addition & 1 deletion release-build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ worldwind.classes.dir=${worldwind.build.dir}/classes
worldwind.doc.dir=${worldwind.build.dir}/doc
worldwind.jar.dir=${worldwind.build.dir}/jar
worldwind.test.results.dir=${worldwind.build.dir}/test-results
worldwind.jdk=11
worldwind.jdk=21
#worldwind.exclude.jackson=true

# MIL-STD-2525 package build properties
Expand Down
2 changes: 1 addition & 1 deletion release-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<pathelement location="gluegen-rt.jar"/>
<pathelement location="gdal.jar"/>
</classpath>
<link href="http://download.oracle.com/javase/8/docs/api/"/>
<link href="https://docs.oracle.com/en/java/javase/21/docs/api/"/>
<link href="https://jogamp.org/deployment/v2.4.0-rc-20200307/javadoc/"/>
</javadoc>
</target>
Expand Down
12 changes: 6 additions & 6 deletions src/gov/nasa/worldwind/terrain/CompoundElevationModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ public boolean containsElevationModel(ElevationModel em)
// Check if the elevation model is a child of any CompoundElevationModels in our list.
for (ElevationModel child : this.elevationModels)
{
if (child instanceof CompoundElevationModel)
if (child instanceof CompoundElevationModel compoundChild)
{
if (((CompoundElevationModel) child).containsElevationModel(em))
if (compoundChild.containsElevationModel(em))
return true;
}
}
Expand Down Expand Up @@ -174,8 +174,8 @@ public void removeElevationModel(ElevationModel em)

for (ElevationModel child : this.elevationModels)
{
if (child instanceof CompoundElevationModel)
((CompoundElevationModel) child).removeElevationModel(em);
if (child instanceof CompoundElevationModel compoundChild)
compoundChild.removeElevationModel(em);
}

this.elevationModels.remove(em);
Expand Down Expand Up @@ -743,9 +743,9 @@ public double getUnmappedLocalSourceElevation(Angle latitude, Angle longitude)
for (int i = this.elevationModels.size() - 1; i >= 0; i--)
{
ElevationModel em = this.elevationModels.get(i);
if (em instanceof BasicElevationModel && em.isEnabled())
if (em instanceof BasicElevationModel basicElevationModel && em.isEnabled())
{
double e = ((BasicElevationModel) em).getUnmappedLocalSourceElevation(latitude, longitude);
double e = basicElevationModel.getUnmappedLocalSourceElevation(latitude, longitude);
if (e != em.getMissingDataSignal())
{
elevation = e;
Expand Down
8 changes: 4 additions & 4 deletions src/gov/nasa/worldwind/terrain/LocalElevationModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,11 @@ public void addElevations(ByteBuffer byteBuffer, Sector sector, int width, int h
Double minElevation = null;
Double maxElevation = null;
Object o = bufferParams.getValue(AVKey.ELEVATION_MIN);
if (o instanceof Double)
minElevation = (Double) o;
if (o instanceof Double min)
minElevation = min;
o = bufferParams.getValue(AVKey.ELEVATION_MAX);
if (o instanceof Double)
maxElevation = (Double) o;
if (o instanceof Double max)
maxElevation = max;

String dataType = bufferParams.getStringValue(AVKey.DATA_TYPE);
if (WWUtil.isEmpty(dataType))
Expand Down
11 changes: 5 additions & 6 deletions src/gov/nasa/worldwind/terrain/RectangularTessellator.java
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,8 @@ protected void renderVA(DrawContext dc, RectTile tile, int numTextureUnits)
gl.glClientActiveTexture(GL2.GL_TEXTURE0 + i);
gl.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
Object texCoords = dc.getValue(AVKey.TEXTURE_COORDINATES);
if (texCoords != null && texCoords instanceof DoubleBuffer)
gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, ((DoubleBuffer) texCoords).rewind());
if (texCoords instanceof DoubleBuffer doubleBuffer)
gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, doubleBuffer.rewind());
else
gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, tile.ri.texCoords.rewind());
}
Expand Down Expand Up @@ -1121,8 +1121,8 @@ protected void renderBoundingVolume(DrawContext dc, RectTile tile)
if (extent == null)
return;

if (extent instanceof Renderable)
((Renderable) extent).render(dc);
if (extent instanceof Renderable renderable)
renderable.render(dc);
}

protected void renderTileID(DrawContext dc, RectTile tile)
Expand Down Expand Up @@ -1565,9 +1565,8 @@ protected Intersection[] intersect(RectTile tile, double elevation)

// Check whether the tile includes the intersection elevation - assume cylinder as Extent
// TODO: replace this test with a generic test against Extent
if (tile.getExtent() instanceof Cylinder)
if (tile.getExtent() instanceof Cylinder cylinder)
{
Cylinder cylinder = ((Cylinder) tile.getExtent());
if (!(globe.isPointAboveElevation(cylinder.getBottomCenter(), elevation)
^ globe.isPointAboveElevation(cylinder.getTopCenter(), elevation)))
return null;
Expand Down
8 changes: 4 additions & 4 deletions src/gov/nasa/worldwind/terrain/SectorGeometryList.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ public void beginRendering(DrawContext dc) {
}

// TODO: add the beginRendering interface to Tessellator in order to eliminate this type test
if (dc.getGlobe().getTessellator() instanceof RectangularTessellator) {
((RectangularTessellator) dc.getGlobe().getTessellator()).beginRendering(dc);
if (dc.getGlobe().getTessellator() instanceof RectangularTessellator tessellator) {
tessellator.beginRendering(dc);
}
}

Expand All @@ -120,8 +120,8 @@ public void endRendering(DrawContext dc) {
throw new IllegalStateException(message);
}

if (dc.getGlobe().getTessellator() instanceof RectangularTessellator) {
((RectangularTessellator) dc.getGlobe().getTessellator()).endRendering(dc);
if (dc.getGlobe().getTessellator() instanceof RectangularTessellator tessellator) {
tessellator.endRendering(dc);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/gov/nasa/worldwind/terrain/WCSElevationModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ protected void downloadElevations(WMSBasicElevationModel.ElevationCompositionTil
public void getRestorableStateForAVPair(String key, Object value,
RestorableSupport rs, RestorableSupport.StateObject context)
{
if (value instanceof URLBuilder)
if (value instanceof URLBuilder urlBuilder)
{
rs.addStateValueAsString(context, AVKey.WCS_VERSION, ((URLBuilder) value).serviceVersion);
rs.addStateValueAsString(context, AVKey.WCS_VERSION, urlBuilder.serviceVersion);
}
else if (!(value instanceof WCS100DescribeCoverage))
{
Expand Down
4 changes: 2 additions & 2 deletions src/gov/nasa/worldwind/terrain/WMSBasicElevationModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,9 @@ protected boolean isDeleteOnExit(File outFile)
public void getRestorableStateForAVPair(String key, Object value,
RestorableSupport rs, RestorableSupport.StateObject context)
{
if (value instanceof URLBuilder)
if (value instanceof URLBuilder urlBuilder)
{
rs.addStateValueAsString(context, "wms.Version", ((URLBuilder) value).wmsVersion);
rs.addStateValueAsString(context, "wms.Version", urlBuilder.wmsVersion);
rs.addStateValueAsString(context, "wms.Crs", ((URLBuilder) value).crs);
}
else
Expand Down