Changeset 789:1232d9b06149 in livinglogic.java.ul4

Show
Ignore:
Timestamp:
01/27/13 09:47:40 (7 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

FunctionClosure? always wraps an InterpretedFunction?, so remove the cast and comment.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/main/java/com/livinglogic/ul4/FunctionClosure.java

    r788 r789  
    9494            HashMap<String, ValueMaker> v = new HashMap<String, ValueMaker>(); 
    9595            v.put("name", new ValueMaker(){public Object getValue(Object object){return ((FunctionClosure)object).getFunction().nameUL4();}}); 
    96             // The following attributes will only work if the function really is an InterpretedFunction 
    97             v.put("location", new ValueMaker(){public Object getValue(Object object){return ((InterpretedFunction)((FunctionClosure)object).getFunction()).getLocation();}}); 
    98             v.put("endlocation", new ValueMaker(){public Object getValue(Object object){return ((InterpretedFunction)((FunctionClosure)object).getFunction()).getEndLocation();}}); 
    99             v.put("content", new ValueMaker(){public Object getValue(Object object){return ((InterpretedFunction)((FunctionClosure)object).getFunction()).getContent();}}); 
    100             v.put("startdelim", new ValueMaker(){public Object getValue(Object object){return ((InterpretedFunction)((FunctionClosure)object).getFunction()).getStartDelim();}}); 
    101             v.put("enddelim", new ValueMaker(){public Object getValue(Object object){return ((InterpretedFunction)((FunctionClosure)object).getFunction()).getEndDelim();}}); 
    102             v.put("source", new ValueMaker(){public Object getValue(Object object){return ((InterpretedFunction)((FunctionClosure)object).getFunction()).getSource();}}); 
     96            v.put("location", new ValueMaker(){public Object getValue(Object object){return ((FunctionClosure)object).getFunction().getLocation();}}); 
     97            v.put("endlocation", new ValueMaker(){public Object getValue(Object object){return ((FunctionClosure)object).getFunction().getEndLocation();}}); 
     98            v.put("content", new ValueMaker(){public Object getValue(Object object){return ((FunctionClosure)object).getFunction().getContent();}}); 
     99            v.put("startdelim", new ValueMaker(){public Object getValue(Object object){return ((FunctionClosure)object).getFunction().getStartDelim();}}); 
     100            v.put("enddelim", new ValueMaker(){public Object getValue(Object object){return ((FunctionClosure)object).getFunction().getEndDelim();}}); 
     101            v.put("source", new ValueMaker(){public Object getValue(Object object){return ((FunctionClosure)object).getFunction().getSource();}}); 
    103102            valueMakers = v; 
    104103        }