summaryrefslogtreecommitdiff
path: root/java/src/IceUtil/Assert.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2005-04-22 21:23:17 +0000
committerMark Spruiell <mes@zeroc.com>2005-04-22 21:23:17 +0000
commit86d29b725945e22736b064511331d3e694c9c6ca (patch)
tree54dec0fcb5373523443a7bae17f2b10dfe83c067 /java/src/IceUtil/Assert.java
parentsynchronizing finalize (diff)
downloadice-86d29b725945e22736b064511331d3e694c9c6ca.tar.bz2
ice-86d29b725945e22736b064511331d3e694c9c6ca.tar.xz
ice-86d29b725945e22736b064511331d3e694c9c6ca.zip
changing IceUtil.Assert.Assert to IceUtil.Assert.FinalizerAssert
Diffstat (limited to 'java/src/IceUtil/Assert.java')
-rw-r--r--java/src/IceUtil/Assert.java21
1 files changed, 6 insertions, 15 deletions
diff --git a/java/src/IceUtil/Assert.java b/java/src/IceUtil/Assert.java
index 524a87a21f6..11a9866810a 100644
--- a/java/src/IceUtil/Assert.java
+++ b/java/src/IceUtil/Assert.java
@@ -11,21 +11,13 @@ package IceUtil;
public final class Assert
{
- public static boolean
- Assert(boolean b)
+ //
+ // The JVM ignores exceptions raised in finalizers, therefore finalizers
+ // that use assertions should call this method instead of assert().
+ //
+ public static void
+ FinalizerAssert(boolean b)
{
- //
- // The JVM ignores exceptions raised in finalizers, therefore finalizers
- // that use assertions should call this method. For example:
- //
- // protected void finalize() throws Throwable
- // {
- // assert(IceUtil.Assert.Assert(condition));
- // }
- //
- // Notice that this method is called from within an assert statement,
- // which avoids the cost of the call if assertions are disabled.
- //
if(!b)
{
//
@@ -49,6 +41,5 @@ public final class Assert
System.err.println("Assertion failure (no stack trace information)");
}
}
- return true;
}
}