Skip to content

Commit

Permalink
CacheClient.close() should adhere to contract jsr107#136
Browse files Browse the repository at this point in the history
  • Loading branch information
galderz committed Dec 14, 2017
1 parent a8a814d commit 8ae2d46
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.jsr107.tck.support;

import java.io.Closeable;
import java.io.IOException;
import java.io.Serializable;
import java.net.InetAddress;

Expand Down Expand Up @@ -61,11 +62,13 @@ protected synchronized Client getClient() {
* {@inheritDoc}
*/
@Override
public synchronized void close() {
public synchronized void close() throws IOException {
if (client != null) {
try {
client.invoke(Server.CLOSE_OPERATION);
client.close();
} catch(RuntimeException e) {
throw new IOException("Error on close", e);
} finally {
client = null;
}
Expand Down

0 comments on commit 8ae2d46

Please sign in to comment.