langtools/src/share/classes/com/sun/tools/javac/code/Types.java
changeset 8032 e1aa25ccdabb
parent 7681 1f0819a3341f
child 8230 b761a23e78d8
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Mon Jan 10 14:57:59 2011 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Mon Jan 10 15:08:31 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1061,8 +1061,9 @@
                             highSub = (lowSub == null) ? null : asSub(bHigh, aHigh.tsym);
                         }
                         if (highSub != null) {
-                            assert a.tsym == highSub.tsym && a.tsym == lowSub.tsym
-                                : a.tsym + " != " + highSub.tsym + " != " + lowSub.tsym;
+                            if (!(a.tsym == highSub.tsym && a.tsym == lowSub.tsym)) {
+                                Assert.error(a.tsym + " != " + highSub.tsym + " != " + lowSub.tsym);
+                            }
                             if (!disjointTypes(aHigh.allparams(), highSub.allparams())
                                 && !disjointTypes(aHigh.allparams(), lowSub.allparams())
                                 && !disjointTypes(aLow.allparams(), highSub.allparams())
@@ -1703,9 +1704,9 @@
             bt.supertype_field = bounds.head;
             bt.interfaces_field = bounds.tail;
         }
-        assert bt.supertype_field.tsym.completer != null
-            || !bt.supertype_field.isInterface()
-            : bt.supertype_field;
+        Assert.check(bt.supertype_field.tsym.completer != null
+                || !bt.supertype_field.isInterface(),
+            bt.supertype_field);
         return bt;
     }
 
@@ -1834,7 +1835,7 @@
                         // t.interfaces_field is null after
                         // completion, we can assume that t is not the
                         // type of a class/interface declaration.
-                        assert t != t.tsym.type : t.toString();
+                        Assert.check(t != t.tsym.type, t);
                         List<Type> actuals = t.allparams();
                         List<Type> formals = t.tsym.type.allparams();
                         if (t.hasErasedSupertypes()) {
@@ -2646,7 +2647,7 @@
                 act2 = act2.tail;
                 typarams = typarams.tail;
             }
-            assert(act1.isEmpty() && act2.isEmpty() && typarams.isEmpty());
+            Assert.check(act1.isEmpty() && act2.isEmpty() && typarams.isEmpty());
             return new ClassType(class1.getEnclosingType(), merged.toList(), class1.tsym);
         }
 
@@ -2758,7 +2759,7 @@
             // calculate lub(A, B)
             while (ts.head.tag != CLASS && ts.head.tag != TYPEVAR)
                 ts = ts.tail;
-            assert !ts.isEmpty();
+            Assert.check(!ts.isEmpty());
             List<Type> cl = closure(ts.head);
             for (Type t : ts.tail) {
                 if (t.tag == CLASS || t.tag == TYPEVAR)
@@ -3138,7 +3139,7 @@
         boolean reverse = false;
         Type target = to;
         if ((to.tsym.flags() & INTERFACE) == 0) {
-            assert (from.tsym.flags() & INTERFACE) != 0;
+            Assert.check((from.tsym.flags() & INTERFACE) != 0);
             reverse = true;
             to = from;
             from = target;
@@ -3173,12 +3174,12 @@
         boolean reverse = false;
         Type target = to;
         if ((to.tsym.flags() & INTERFACE) == 0) {
-            assert (from.tsym.flags() & INTERFACE) != 0;
+            Assert.check((from.tsym.flags() & INTERFACE) != 0);
             reverse = true;
             to = from;
             from = target;
         }
-        assert (from.tsym.flags() & FINAL) != 0;
+        Assert.check((from.tsym.flags() & FINAL) != 0);
         Type t1 = asSuper(from, to.tsym);
         if (t1 == null) return false;
         Type t2 = to;