@@ -168,10 +168,9 @@ else if ( permit && ( initialSize != null &&
168168 // could only happen if the initialization threads are still
169169 // running (and we've been configured to not wait till all
170170 // 'initial' applications are put to the pool on #init())
171- while ( true ) { // thus we'll wait for another pool put ...
171+ do { // thus we'll wait for another pool put ...
172172 waitForApplication ();
173- if ( ! applicationPool .isEmpty () ) break ;
174- }
173+ } while (applicationPool .isEmpty ());
175174 app = applicationPool .remove ();
176175 }
177176 }
@@ -197,7 +196,7 @@ else if ( permit && ( initialSize != null &&
197196 protected boolean acquireApplicationPermit () throws AcquireTimeoutException {
198197 // NOTE: permits are only used if a pool maximum is specified !
199198 if (permits != null ) {
200- boolean acquired = false ;
199+ boolean acquired ;
201200 try {
202201 final long timeout = (long ) (acquireTimeout * 1000 );
203202 acquired = permits .tryAcquire (timeout , TimeUnit .MILLISECONDS );
@@ -328,7 +327,7 @@ private boolean initAndPutApplicationToPool(final RackApplication app) {
328327 }
329328
330329 protected Queue <RackApplication > createApplications () throws RackInitializationException {
331- Queue <RackApplication > apps = new LinkedList <RackApplication >();
330+ Queue <RackApplication > apps = new LinkedList <>();
332331 for (int i = 0 ; i < initialSize ; i ++) {
333332 apps .add ( createApplication (false ) );
334333 }
@@ -376,7 +375,6 @@ private void waitForApplication() {
376375 applicationPool .wait (5 * 1000 );
377376 }
378377 catch (InterruptedException ignore ) {
379- return ;
380378 }
381379 }
382380 }
0 commit comments