geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirk Lund <>
Subject Testing tip: Use IgnoredException as an AutoCloseable
Date Fri, 02 Nov 2018 20:27:41 GMT
The easiest way to use IgnoredException is as an AutoCloseable in a
try-with-resource block and by specifying the Exception class:

import static

import org.apache.geode.cache.client.ServerOperationException;

public void test{} {
  try (IgnoredException ie =

Another benefit is that the logged ServerOperationException is only ignored
within the tiny scope of that try-with-resource block.

Unfortunately you DO need to declare IgnoredException ie even though your
IDE will highlight it as unused. That's just the way try-with-resource

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message