@@ -234,27 +234,29 @@ public static String hex(String origName, String candidate) throws NoSuchAlgorit
234
234
* @param title name of the download
235
235
*/
236
236
public static void waitForResources (final JNLPClassLoader jnlpClassLoader , final ResourceTracker tracker , final URL [] resources , final String title ) {
237
- // download first initial jar : so in case of client certificate, only 1 https client handshake is done
237
+ // download first initial jar : so in case of client certificate, only 1 https client handshake is done
238
238
boolean downloadInitialJarFirst = resources .length > 1 && resources [0 ].getProtocol ().equals ("https" );
239
239
try {
240
240
final DownloadIndicator indicator = Optional .ofNullable (JNLPRuntime .getDefaultDownloadIndicator ())
241
- .orElseGet (() -> new DummyDownloadIndicator () );
241
+ .orElseGet (DummyDownloadIndicator :: new );
242
242
final DownloadServiceListener listener = getDownloadServiceListener (jnlpClassLoader , title , resources , indicator );
243
243
try {
244
244
for (URL url : resources ) {
245
245
tracker .addDownloadListener (url , resources , listener );
246
246
}
247
- if (downloadInitialJarFirst )
247
+ if (downloadInitialJarFirst ) {
248
248
tracker .waitForResources (resources [0 ]);
249
+ }
249
250
// download all remaining ones
250
251
tracker .waitForResources (resources );
251
252
} finally {
252
253
indicator .disposeListener (listener );
253
254
}
254
255
} catch (Exception ex ) {
255
256
LOG .error ("Downloading of resources ended with error" , ex );
256
- if (downloadInitialJarFirst )
257
- throw new RuntimeException (ex );
257
+ if (downloadInitialJarFirst ) {
258
+ throw new RuntimeException (ex );
259
+ }
258
260
}
259
261
}
260
262
0 commit comments