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
29 changes: 13 additions & 16 deletions src/gov/nasa/worldwind/retrieve/BasicRetrievalService.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,14 @@ private class RetrievalExecutor extends ThreadPoolExecutor

private RetrievalExecutor(int poolSize, int queueSize)
{
super(poolSize, poolSize, THREAD_TIMEOUT, TimeUnit.SECONDS, new PriorityBlockingQueue<Runnable>(queueSize),
new ThreadFactory()
super(poolSize, poolSize, THREAD_TIMEOUT, TimeUnit.SECONDS, new PriorityBlockingQueue<>(queueSize),
runnable ->
{
public Thread newThread(Runnable runnable)
{
Thread thread = new Thread(runnable);
thread.setDaemon(true);
thread.setPriority(Thread.MIN_PRIORITY);
thread.setUncaughtExceptionHandler(BasicRetrievalService.this);
return thread;
}
Thread thread = new Thread(runnable);
thread.setDaemon(true);
thread.setPriority(Thread.MIN_PRIORITY);
thread.setUncaughtExceptionHandler(BasicRetrievalService.this);
return thread;
}, new ThreadPoolExecutor.DiscardPolicy() // abandon task when queue is full
{
// This listener is invoked only when the executor queue is a bounded queue and runs out of room.
Expand Down Expand Up @@ -285,16 +282,16 @@ protected void afterExecute(Runnable runnable, Throwable throwable)
{
String message = Logging.getMessage("BasicRetrievalService.ExecutionExceptionDuringRetrieval",
task.getRetriever().getName());
if (e.getCause() instanceof SocketTimeoutException)
if (e.getCause() instanceof SocketTimeoutException ste)
{
Logging.logger().fine(message + " " + e.getCause().getLocalizedMessage());
Logging.logger().fine(message + " " + ste.getLocalizedMessage());
}
else if (e.getCause() instanceof SSLHandshakeException)
else if (e.getCause() instanceof SSLHandshakeException sslEx)
{
if (sslExceptionListener != null)
sslExceptionListener.onException(e.getCause(), task.getRetriever().getName());
sslExceptionListener.onException(sslEx, task.getRetriever().getName());
else
Logging.logger().fine(message + " " + e.getCause().getLocalizedMessage());
Logging.logger().fine(message + " " + sslEx.getLocalizedMessage());
}
else
{
Expand Down Expand Up @@ -327,7 +324,7 @@ public BasicRetrievalService()
this.executor = new RetrievalExecutor(poolSize, this.queueSize);

// this.activeTasks holds the list of currently executing tasks (*not* those pending on the queue)
this.activeTasks = new ConcurrentLinkedQueue<RetrievalTask>();
this.activeTasks = new ConcurrentLinkedQueue<>();
}

public void shutdown(boolean immediately)
Expand Down
4 changes: 2 additions & 2 deletions src/gov/nasa/worldwind/retrieve/URLRetriever.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ protected URLConnection openConnection() throws IOException
throw new IllegalStateException(message);
}

if (this.connection instanceof HttpsURLConnection)
this.configureSSLContext((HttpsURLConnection) this.connection);
if (this.connection instanceof HttpsURLConnection httpsConn)
this.configureSSLContext(httpsConn);

this.connection.setConnectTimeout(this.connectTimeout);
this.connection.setReadTimeout(this.readTimeout);
Expand Down