equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2015, 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 |
405 for (List<ScopeListener> l = listeners; l.nonEmpty(); l = l.tail) { |
405 for (List<ScopeListener> l = listeners; l.nonEmpty(); l = l.tail) { |
406 l.head.symbolAdded(sym, this); |
406 l.head.symbolAdded(sym, this); |
407 } |
407 } |
408 } |
408 } |
409 |
409 |
410 /** Remove symbol from this scope. Used when an inner class |
410 /** Remove symbol from this scope. |
411 * attribute tells us that the class isn't a package member. |
|
412 */ |
411 */ |
413 public void remove(Symbol sym) { |
412 public void remove(Symbol sym) { |
414 Assert.check(shared == 0); |
413 Assert.check(shared == 0); |
415 Entry e = lookup(sym.name); |
414 Entry e = lookup(sym.name, candidate -> candidate == sym); |
416 if (e.scope == null) return; |
415 if (e.scope == null) return; |
417 |
416 |
418 // remove e from table and shadowed list; |
417 // remove e from table and shadowed list; |
419 int i = getIndex(sym.name); |
418 int i = getIndex(sym.name); |
420 Entry te = table[i]; |
419 Entry te = table[i]; |