Changeset 12581


Ignore:
Timestamp:
04/05/10 21:00:13 (11 years ago)
Author:
ehuelsmann
Message:

Make LispCharacter? constructor private in favor of getInstance();

this allows checking character validity later on - and returning an appropriate value.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

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

    r12570 r12581  
    216216
    217217        if (obj instanceof Character)
    218             return new LispCharacter((Character)obj);
     218            return LispCharacter.getInstance((Character)obj);
    219219
    220220        if (obj instanceof Object[]) {
  • trunk/abcl/src/org/armedbear/lisp/LispCharacter.java

    r12580 r12581  
    6868
    6969  // This needs to be public for the compiler.
    70   public LispCharacter(char c)
     70  private LispCharacter(char c)
    7171  {
    7272    this.value = c;
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r12576 r12581  
    22702270     ;; no need to *declare-inline*: constants
    22712271    (declare-field g +lisp-character+ +field-access-private+)
    2272     (cond ((<= 0 n 255)
    2273            (emit 'getstatic +lisp-character-class+ "constants" +lisp-character-array+)
    2274            (emit-push-constant-int n)
    2275            (emit 'aaload))
    2276           (t
    2277            (emit 'new +lisp-character-class+)
    2278            (emit 'dup)
    2279            (emit-push-constant-int n)
    2280            (emit-invokespecial-init +lisp-character-class+ '("C"))))
     2272    (emit-push-constant-int n)
     2273    (emit-invokestatic +lisp-character-class+ "getInstance" '("C")
     2274                       +lisp-character+)
    22812275    (emit 'putstatic *this-class* g +lisp-character+)
    22822276    (setf *static-code* *code*)
Note: See TracChangeset for help on using the changeset viewer.