Changeset 10294


Ignore:
Timestamp:
10/31/05 12:24:01 (16 years ago)
Author:
piso
Message:

Constructor: initialize OBJECT slot correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/PrintNotReadable.java

    r10202 r10294  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: PrintNotReadable.java,v 1.11 2005-10-23 16:39:49 piso Exp $
     5 * $Id: PrintNotReadable.java,v 1.12 2005-10-31 12:24:01 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class PrintNotReadable extends LispError
    2525{
    26     public final LispObject object;
    27 
    2826    public PrintNotReadable(LispObject initArgs) throws ConditionThrowable
    2927    {
    30         super(initArgs);
    31         LispObject object = NIL;
     28        super(StandardClass.PRINT_NOT_READABLE);
     29        super.initialize(initArgs);
     30        LispObject object = null;
    3231        while (initArgs != NIL) {
    3332            LispObject first = initArgs.car();
     
    4039            }
    4140        }
    42         this.object = object;
     41        if (object != null)
     42            setInstanceSlotValue(Symbol.OBJECT, object);
    4343    }
    4444
     
    6464    public String getMessage()
    6565    {
    66         StringBuffer sb = new StringBuffer();
    67         if (object != NIL) {
     66        FastStringBuffer sb = new FastStringBuffer();
     67        LispObject object = UNBOUND_VALUE;
     68        try {
     69            object = getInstanceSlotValue(Symbol.OBJECT);
     70        }
     71        catch (Throwable t) {
     72            Debug.trace(t);
     73        }
     74        if (object != UNBOUND_VALUE) {
    6875            final LispThread thread = LispThread.currentThread();
    6976            final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
     
    9299        {
    93100            try {
    94                 return ((PrintNotReadable)arg).object;
     101                return ((PrintNotReadable)arg).getInstanceSlotValue(Symbol.OBJECT);
    95102            }
    96103            catch (ClassCastException e) {
    97                 return signal(new TypeError(arg, Symbol.PRINT_NOT_READABLE));
     104                return signalTypeError(arg, Symbol.PRINT_NOT_READABLE);
    98105            }
    99106        }
Note: See TracChangeset for help on using the changeset viewer.