Used to create attribute accessors on the fly.

 On first call of a missing method a method is generated to avoid the missing lookup
 next time, this should be faster for repeated lookups of the same method, e.g. reg
763039
def method_missing(method, *args, &block)
      super
    rescue NoMethodError
      return regs(method) if self.has_reg?(method)
      return ports(method) if self.has_port?(method)
      if method.to_s =~ /=$/
        define_singleton_method(method) do |val|
          instance_variable_set("@#{method.to_s.sub('=', '')}", val)
        end
      else
        define_singleton_method(method) do
          instance_variable_get("@#{method}")
        end
      end
      send(method, *args, &block)
    end
1302028
def method_already_there(object_type, method_name, this_class_only=False):
    
    if this_class_only:
        return method_name in vars(object_type)  # or object_type.__dict__
    else:
        try:
            method = getattr(object_type, method_name)
        except AttributeError:
            return False
        else:
            return method is not None and method is not getattr(object, method_name, None)
1032257
public void detail(MethodNode methodNode, MethodAttributes attrs, StringBuilder output) {
        Validate.notNull(methodNode);
        Validate.notNull(attrs);
        Validate.notNull(output);

        int methodId = attrs.getSignature().getMethodId();

        output.append("Class Name: ").append(attrs.getSignature().getClassName().replace('/', '.')).append('\n');
        output.append("Method Name: ").append(attrs.getSignature().getMethodName()).append('\n');
        output.append("Method Params: ").append(attrs.getSignature().getMethodDescriptor()).append('\n');
        output.append("Method Return: ").append(attrs.getSignature().getReturnType()).append('\n');
        output.append("Method ID: ").append(methodId).append('\n');
        output.append("------------------------------------\n");

        UnmodifiableList<ContinuationPoint> cps = attrs.getContinuationPoints();
        for (int i = 0; i < cps.size(); i++) {
            ContinuationPoint cp = cps.get(i);

            int line = cp.getLineNumber() == null ? -1 : cp.getLineNumber();
            String header = String.format("Continuation Point ID: %-4d Line: %-4d Type: %s",
                    i,
                    line,
                    cp.getClass().getSimpleName());
            output.append(header).append('\n');

            // Check out PackStateGenerators class for how things are organized. Brief overview follows...
            // container[0] has local variables that are bytes/shorts/ints
            // container[1] has local variables that are floats
            // container[2] has local variables that are longs
            // container[3] has local variables that are doubles
            // container[4] has local variables that are Objects
            // container[5] has operands that are bytes/shorts/ints
            // container[6] has operands that are floats
            // container[7] has operands that are longs
            // container[8] has operands that are doubles
            // container[9] has operands that are Objects
            detailLocals(cp, methodNode, output);
            detailOperands(cp, output);

            output.append('\n');
        }
        
        output.append('\n');
    }
781497
def method_missing(sym, *args, &block)
      cache_method_call(sym) if ::Builder::XmlBase.cache_method_calls
      tag!(sym, *args, &block)
    end
597262
def method_missing(*args, &block)
      if Namespace.exists?(args.first)
        create_namespace(args.first)
      else
        call_method(args, &block)
      end
    end
149180
def attr_accessor_with_default(name, val)
      ivar_sym = "@#{name}"
      define_method name do
        unless instance_variable_defined?(ivar_sym)
          instance_variable_set(ivar_sym, val)
        end
        instance_variable_get ivar_sym
      end
      attr_writer name
    end
334247
def accessor(self):
        
        if isinstance(self.attr, Accessor):
            return self.attr

        if callable(self.attr):
            return Accessor(getter=self.attr)

        attr = self.attr or self.name
        return Accessor(getter=attr, setter=attr)
823174
Method getSetter(Method getter) {
        synchronized (setterCache) {
            if ( !setterCache.containsKey(getter) ) {
                String attributeName = null;
                if ( getter.getName().startsWith("get") ) {
                    attributeName = getter.getName().substring("get".length());
                } else if ( getter.getName().startsWith("is") ) {
                    attributeName = getter.getName().substring("is".length());
                } else {
                    // should be impossible to reach this exception
                    throw new RuntimeException("Getter method must start with 'is' or 'get'");
                }
                String setterName = "set" + attributeName;
                Method setter = null;
                try {
                    setter = getter.getDeclaringClass().getMethod(setterName, getter.getReturnType());
                } catch ( NoSuchMethodException e ) {
                    throw new DynamoDBMappingException("Expected a public, one-argument method called " + setterName
                            + " on class " + getter.getDeclaringClass(), e);
                } catch ( SecurityException e ) {
                    throw new DynamoDBMappingException("No access to public, one-argument method called " + setterName
                            + " on class " + getter.getDeclaringClass(), e);
                }
                setterCache.put(getter, setter);
            }
        }
        
        return setterCache.get(getter);
    }
1116176
def method_missing(sym, *args)
      method_name = sym.to_s
      debug "Base#method_missing: #{method_name}, #{attributes}"
      if m = /(.*)=$/.match(method_name)
        if args.size == 1
          val = args.shift
          attribute_name = m[1]
          write_value(attribute_name, val)
          debug "Base#method_missing (at end), write #{attribute_name} = #{val}"
          return
        end
      else
        if args.size == 0
          val = read_value(method_name)
          debug "Base#method_missing (at end), val = #{val}"
          return val
        end
      end

      super
    end
530776
def method_missing(method, *args, &block)
      if method[-1] == '='
        # setter
        key = method.slice(0...-1).to_sym

        unless has_key?(key)
          super
        end
        self[key] = args[0]
      else
        unless has_key?(method)
          super
        end

        prop = self[method]
        if prop.is_a? JSFunction
          prop.call_with_instance(self, *args, &block)
        else
          prop
        end
      end
    end
1116346
def create_field_check(name, meth, field)
      generated_methods.module_eval do
        re_define_method("#{meth}?") do
          attr = read_attribute(name, field)
          attr == true || attr.present?
        end
      end
    end
46157
private void setMethodsAttribute(List<String> mList, boolean omission, int attribute, String value) {
        Map<String, MethodConstraint> mapWork = null;
        if (mList == null || mList.isEmpty()) {
            mList = new ArrayList<String>();
            mList.add(ALL_METHODS);
            if (mapAllMethods == null) {
                mapAllMethods = new HashMap<String, MethodConstraint>();
            }
            mapWork = mapAllMethods;
            if (tc.isDebugEnabled())
                Tr.debug(tc, "all methods");
        } else if (!omission) {
            // http method
            if (mapMethod == null) {
                mapMethod = new HashMap<String, MethodConstraint>();
            }
            mapWork = mapMethod;
            if (tc.isDebugEnabled())
                Tr.debug(tc, "http methods");
        } else {
            // http method omission
            if (mapMethodOmission == null) {
                mapMethodOmission = new HashMap<String, MethodConstraint>();
            }
            mapWork = mapMethodOmission;
            if (tc.isDebugEnabled())
                Tr.debug(tc, "http methods omission");
        }

        for (String httpMethod : mList) {
            httpMethod = httpMethod.toUpperCase();
            MethodConstraint mc = null;
            if (mapWork.containsKey(httpMethod)) {
                mc = (mapWork.get(httpMethod));
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "method exists : " + httpMethod);
            } else {
                mc = new MethodConstraint();
                mapWork.put(httpMethod, mc);
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "method created : " + httpMethod);
            }
            switch (attribute) {
                case UNCHECKED:
                    mc.setUnchecked();
                    break;
                case EXCLUDED:
                    mc.setExcluded();
                    break;
                case ROLE:
                    mc.setRole(value);
                    break;
                case USERDATA:
                    mc.setUserData(value);
                    break;
                default:
                    break;

            }
        }
    }
1289706
def define_accessors(option, value)
      setter = proc { |val|  set option, val, true }
      getter = proc { value }

      define_singleton_method("#{option}=", setter) if setter
      define_singleton_method(option, getter) if getter
    end
101764
def method_missing(method, *args, &block)
      attribute = Ldaptic.encode(method)
      if attribute[-1] == ?=
        attribute.chop!
        if may_must(attribute)
          return write_attribute(attribute, *args, &block)
        end
      elsif attribute[-1] == ??
        attribute.chop!
        if may_must(attribute)
          if args.empty?
            return !read_attribute(attribute).empty?
          else
            return args.flatten.any? {|arg| compare(attribute, arg)}
          end
        end
      elsif attribute =~ /\A(.*)-before-type-cast\z/ && may_must($1)
        return read_attribute($1, *args, &block)
      elsif may_must(attribute)
        return read_attribute(attribute, *args, &block).one
      end
      super(method, *args, &block)
    end
473470
private String getReplicaMethodDelegationCode(Class<?> clazz, CtMethod ctMethod, String classOrInstanceToDelegateTo)
            throws NotFoundException {
        StringBuilder builder = new StringBuilder();
        builder.append("{java.lang.reflect.Method originalMethod = ");
        builder.append(clazz.getName());
        builder.append(".class.getDeclaredMethod(\"");
        builder.append(ctMethod.getName());
        builder.append("\", ");
        final String parametersAsString = getParametersAsString(getParameterTypes(ctMethod));
        if ("".equals(parametersAsString)) {
            builder.append("null");
        } else {
            builder.append(parametersAsString);
        }
        builder.append(");\n");
        builder.append("originalMethod.setAccessible(true);\n");
        final CtClass returnType = ctMethod.getReturnType();
        final boolean isVoid = returnType.equals(CtClass.voidType);
        if (!isVoid) {
            builder.append("return (");
            builder.append(returnType.getName());
            builder.append(") ");
        }
        builder.append("originalMethod.invoke(");
        if (Modifier.isStatic(ctMethod.getModifiers()) || classOrInstanceToDelegateTo == null) {
            builder.append(clazz.getName());
            builder.append(".class");
        } else {
            builder.append(classOrInstanceToDelegateTo);
        }
        builder.append(", $args);}");
        return builder.toString();
    }
351384
def method_missing(name, *args)
      if !valid_accessor?(name)
        super
      elsif self.class.prop?(name.to_s)
        self.class.build_property_reader(name)
        send(name)
      else
        self.class.build_property_writer(name)
        send(name, args.first)
      end
    end
280914
def instance_writers
      _attrs.keys.map { |m| "#{m}=".to_sym }.select { |m| method_defined?(m) }
    end