Changeset 12977


Ignore:
Timestamp:
10/17/10 15:22:41 (11 years ago)
Author:
ehuelsmann
Message:

Unintern symbols with a deleted package as their
home package. This is what SBCL does too and fixes
current ANSI tests breakage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Package.java

    r12959 r12977  
    5050    private transient LispObject propertyList;
    5151
     52    /** Symbols internal to the package. */
    5253    private transient final ConcurrentHashMap<String, Symbol> internalSymbols
    5354            = new ConcurrentHashMap<String, Symbol>(16);
     55    /** Symbols exported from the package.
     56     *
     57     * Those symbols in this collection are not contained in the internalSymbols
     58     */
    5459    private transient final ConcurrentHashMap<String, Symbol> externalSymbols
    5560            = new ConcurrentHashMap<String, Symbol>(16);
     
    142147    }
    143148
     149    private void makeSymbolsUninterned(ConcurrentHashMap symbolMap) {
     150        Symbol sym;
     151        for (Iterator<Symbol> it = symbolMap.values().iterator();
     152                it.hasNext();) {
     153            sym = it.next();
     154            if (sym.getPackage() == this) {
     155                sym.setPackage(NIL);
     156            }
     157        }
     158        symbolMap.clear();
     159    }
     160
    144161    public final synchronized boolean delete()
    145162    {
    146163        if (name != null) {
    147164            Packages.deletePackage(this);
    148             internalSymbols.clear();
    149             externalSymbols.clear();
     165
     166            makeSymbolsUninterned(internalSymbols);
     167            makeSymbolsUninterned(externalSymbols); // also clears externalSymbols
    150168
    151169            name = null;
Note: See TracChangeset for help on using the changeset viewer.