Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.dynjs.runtime.linker.java;
 
 

Author(s):
Bob McWhirter
public class ReferenceValueFilter implements Filter {
    public static ReferenceValueFilter INSTANCE = new ReferenceValueFilter();
    public static Object filter(Object obj) {
        if ( obj instanceof Reference) {
            return ((Reference)obj).getBase();
        }
        if ( obj instanceof DereferencedReference) {
            return ((DereferencedReferenceobj).getValue();
        }
        return obj;
    }
    @Override
    public MethodHandle methodHandle(MethodType inputTypethrows Exception {
        return MethodHandles.lookup().findStatic(ReferenceValueFilter.class"filter", MethodType.methodType(Object.classObject.class));
    }
New to GrepCode? Check out our FAQ X