Skip to content

Commit

Permalink
Fixes failure of deployment of test-faces23-websocket in Faces TCK
Browse files Browse the repository at this point in the history
- It is just a replacement of for i loops by enhanced loops.

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Jan 29, 2023
1 parent 1143000 commit acb2a10
Showing 1 changed file with 20 additions and 20 deletions.
Expand Up @@ -1252,22 +1252,22 @@ public synchronized void stop() throws LifecycleException {
}

// Stop our child containers, if any
Container children[] = findChildren();
for (int i = 0; i < children.length; i++) {
if (children[i] instanceof Lifecycle) {
Container[] children = findChildren();
for (Container child : children) {
if (child instanceof Lifecycle) {
try {
((Lifecycle) children[i]).stop();
((Lifecycle) child).stop();
} catch (Throwable t) {
String msg = MessageFormat.format(rb.getString(LogFacade.ERROR_STOPPING_CONTAINER), children[i]);
String msg = MessageFormat.format(rb.getString(LogFacade.ERROR_STOPPING_CONTAINER), child);
log.log(Level.SEVERE, msg, t);
}
}
}

// Remove children - so next start can work
children = findChildren();
for (int i = 0; i < children.length; i++) {
removeChild(children[i]);
for (Container child : children) {
removeChild(child);
}

// Stop our subordinate components, if any
Expand Down Expand Up @@ -1499,8 +1499,8 @@ public void fireContainerEvent(String type, Object data) {
}

ContainerEvent event = new ContainerEvent(this, type, data);
for (int i = 0; i < list.length; i++) {
list[i].containerEvent(event);
for (ContainerListener listener : list) {
listener.containerEvent(event);
}
}

Expand All @@ -1511,17 +1511,17 @@ public void fireContainerEvent(String type, Object data) {
protected void startChildren() {

Container children[] = findChildren();
for (int i = 0; i < children.length; i++) {
if (children[i] instanceof Lifecycle) {
for (Container child : children) {
if (child instanceof Lifecycle) {
try {
((Lifecycle) children[i]).start();
((Lifecycle) child).start();
} catch (Throwable t) {
String msg = MessageFormat.format(rb.getString(LogFacade.CONTAINER_NOT_STARTED_EXCEPTION), children[i]);
String msg = MessageFormat.format(rb.getString(LogFacade.CONTAINER_NOT_STARTED_EXCEPTION), child);
log.log(Level.SEVERE, msg, t);
if (children[i] instanceof Context) {
((Context) children[i]).setAvailable(false);
} else if (children[i] instanceof Wrapper) {
((Wrapper) children[i]).setAvailable(Long.MAX_VALUE);
if (child instanceof Context) {
((Context) child).setAvailable(false);
} else if (child instanceof Wrapper) {
((Wrapper) child).setAvailable(Long.MAX_VALUE);
}
}
}
Expand Down Expand Up @@ -1761,9 +1761,9 @@ protected void processChildren(Container container, ClassLoader cl) {
Thread.currentThread().setContextClassLoader(cl);
}
Container[] children = container.findChildren();
for (int i = 0; i < children.length; i++) {
if (children[i].getBackgroundProcessorDelay() <= 0) {
processChildren(children[i], cl);
for (Container child : children) {
if (child.getBackgroundProcessorDelay() <= 0) {
processChildren(child, cl);
}
}
}
Expand Down

0 comments on commit acb2a10

Please sign in to comment.