Skip to content

Commit

Permalink
The stop method replaced by close, which is standard.
Browse files Browse the repository at this point in the history
- Also removed the condition about starting.
- There is several reported issues related to the cleanup.

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Jan 15, 2023
1 parent ae88cdb commit 996133c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1522,19 +1522,16 @@ public boolean isStarted() {
@Override
public void preDestroy() {
try {
stop();
close();
} catch (Exception e) {
throw new IllegalStateException("There were issues with closing " + this, e);
}
}

/**
* Stop the class loader.
*/
public void stop() throws IOException {
if (!started) {
return;
}

@Override
public void close() throws IOException {
LOG.log(DEBUG, "close()");

// Clearing references should be done before setting started to
// false, due to possible side effects.
Expand All @@ -1551,7 +1548,7 @@ public void stop() throws IOException {
}

// FIXME: close is called twice = unclear dependencies and order.
close();
super.close();

started = false;

Expand All @@ -1573,7 +1570,7 @@ public void stop() throws IOException {
}

try {
close();
super.close();
} catch (Exception e) {
// ignore
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ public void stop() throws LifecycleException {
*/
public void stopNestedClassLoader() throws LifecycleException {
try {
classLoader.stop();
classLoader.close();
} catch (Exception e) {
throw new LifecycleException(e);
}
Expand Down

0 comments on commit 996133c

Please sign in to comment.