Additional catch for OOME
authorJaroslav Tulach <jtulach@netbeans.org>
Tue, 12 Aug 2008 13:47:15 +0200
changeset 273cfc5a3fd5ae8
parent 272 62bb123b51d4
child 274 e1a7420cea38
Additional catch for OOME
samples/gc/test/org/apidesign/gc/WeakListenersTest.java
     1.1 --- a/samples/gc/test/org/apidesign/gc/WeakListenersTest.java	Tue Aug 12 13:28:44 2008 +0200
     1.2 +++ b/samples/gc/test/org/apidesign/gc/WeakListenersTest.java	Tue Aug 12 13:47:15 2008 +0200
     1.3 @@ -48,6 +48,11 @@
     1.4              ex.printStackTrace();
     1.5              // of course it cannot be garbage collected. That is OK.
     1.6              return;
     1.7 +        } catch (OutOfMemoryError ex) {
     1.8 +            ex.printStackTrace();
     1.9 +            // sometimes the test fails on OOME, let's catch it
    1.10 +            // of course it cannot be garbage collected. That is OK.
    1.11 +            return;
    1.12          }
    1.13          fail("The listener cannot be GCed as it is held from long living JavaBean");
    1.14      }