src/share/classes/com/sun/tools/javac/util/Context.java

changeset 816
7c537f4298fb
parent 581
f2fdd52e4e87
child 893
8f0dcb9499db
equal deleted inserted replaced
815:d17f37522154 816:7c537f4298fb
1 /* 1 /*
2 * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
143 if (o instanceof Factory<?>) { 143 if (o instanceof Factory<?>) {
144 Factory<?> fac = (Factory<?>)o; 144 Factory<?> fac = (Factory<?>)o;
145 o = fac.make(); 145 o = fac.make();
146 if (o instanceof Factory<?>) 146 if (o instanceof Factory<?>)
147 throw new AssertionError("T extends Context.Factory"); 147 throw new AssertionError("T extends Context.Factory");
148 assert ht.get(key) == o; 148 Assert.check(ht.get(key) == o);
149 } 149 }
150 150
151 /* The following cast can't fail unless there was 151 /* The following cast can't fail unless there was
152 * cheating elsewhere, because of the invariant on ht. 152 * cheating elsewhere, because of the invariant on ht.
153 * Since we found a key of type Key<T>, the value must 153 * Since we found a key of type Key<T>, the value must

mercurial