1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java Mon Jan 10 14:57:59 2011 -0800 1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java Mon Jan 10 15:08:31 2011 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -1061,8 +1061,9 @@ 1.11 highSub = (lowSub == null) ? null : asSub(bHigh, aHigh.tsym); 1.12 } 1.13 if (highSub != null) { 1.14 - assert a.tsym == highSub.tsym && a.tsym == lowSub.tsym 1.15 - : a.tsym + " != " + highSub.tsym + " != " + lowSub.tsym; 1.16 + if (!(a.tsym == highSub.tsym && a.tsym == lowSub.tsym)) { 1.17 + Assert.error(a.tsym + " != " + highSub.tsym + " != " + lowSub.tsym); 1.18 + } 1.19 if (!disjointTypes(aHigh.allparams(), highSub.allparams()) 1.20 && !disjointTypes(aHigh.allparams(), lowSub.allparams()) 1.21 && !disjointTypes(aLow.allparams(), highSub.allparams()) 1.22 @@ -1703,9 +1704,9 @@ 1.23 bt.supertype_field = bounds.head; 1.24 bt.interfaces_field = bounds.tail; 1.25 } 1.26 - assert bt.supertype_field.tsym.completer != null 1.27 - || !bt.supertype_field.isInterface() 1.28 - : bt.supertype_field; 1.29 + Assert.check(bt.supertype_field.tsym.completer != null 1.30 + || !bt.supertype_field.isInterface(), 1.31 + bt.supertype_field); 1.32 return bt; 1.33 } 1.34 1.35 @@ -1834,7 +1835,7 @@ 1.36 // t.interfaces_field is null after 1.37 // completion, we can assume that t is not the 1.38 // type of a class/interface declaration. 1.39 - assert t != t.tsym.type : t.toString(); 1.40 + Assert.check(t != t.tsym.type, t); 1.41 List<Type> actuals = t.allparams(); 1.42 List<Type> formals = t.tsym.type.allparams(); 1.43 if (t.hasErasedSupertypes()) { 1.44 @@ -2646,7 +2647,7 @@ 1.45 act2 = act2.tail; 1.46 typarams = typarams.tail; 1.47 } 1.48 - assert(act1.isEmpty() && act2.isEmpty() && typarams.isEmpty()); 1.49 + Assert.check(act1.isEmpty() && act2.isEmpty() && typarams.isEmpty()); 1.50 return new ClassType(class1.getEnclosingType(), merged.toList(), class1.tsym); 1.51 } 1.52 1.53 @@ -2758,7 +2759,7 @@ 1.54 // calculate lub(A, B) 1.55 while (ts.head.tag != CLASS && ts.head.tag != TYPEVAR) 1.56 ts = ts.tail; 1.57 - assert !ts.isEmpty(); 1.58 + Assert.check(!ts.isEmpty()); 1.59 List<Type> cl = closure(ts.head); 1.60 for (Type t : ts.tail) { 1.61 if (t.tag == CLASS || t.tag == TYPEVAR) 1.62 @@ -3138,7 +3139,7 @@ 1.63 boolean reverse = false; 1.64 Type target = to; 1.65 if ((to.tsym.flags() & INTERFACE) == 0) { 1.66 - assert (from.tsym.flags() & INTERFACE) != 0; 1.67 + Assert.check((from.tsym.flags() & INTERFACE) != 0); 1.68 reverse = true; 1.69 to = from; 1.70 from = target; 1.71 @@ -3173,12 +3174,12 @@ 1.72 boolean reverse = false; 1.73 Type target = to; 1.74 if ((to.tsym.flags() & INTERFACE) == 0) { 1.75 - assert (from.tsym.flags() & INTERFACE) != 0; 1.76 + Assert.check((from.tsym.flags() & INTERFACE) != 0); 1.77 reverse = true; 1.78 to = from; 1.79 from = target; 1.80 } 1.81 - assert (from.tsym.flags() & FINAL) != 0; 1.82 + Assert.check((from.tsym.flags() & FINAL) != 0); 1.83 Type t1 = asSuper(from, to.tsym); 1.84 if (t1 == null) return false; 1.85 Type t2 = to;