This method implements the new interface by calling the old method. Note
that the input types are different between the new and old apis and this
is a bridge between the two.
192779
@Override
  public final 
  void setupTask(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext
                 ) throws IOException {
    setupTask((TaskAttemptContext) taskContext);
  }
777246
@Override
   protected void implementInterface(InterfaceCapableSource<?> source, Iterable<String> value, JavaSourceFacet facet)
   {
      for (String type : value)
      {
         source.addInterface(type);
      }
   }
727972
public void useNewSOAPServiceWithOldClient() throws Exception {
        
        URL wsdlURL = getClass().getResource("/CustomerServiceNew.wsdl");
        com.example.customerservice.CustomerServiceService service = 
            new com.example.customerservice.CustomerServiceService(wsdlURL);
        
        com.example.customerservice.CustomerService customerService = 
            service.getCustomerServicePort();

        // The outgoing new Customer data needs to be transformed for 
        // the old service to understand it and the response from the old service
        // needs to be transformed for this new client to understand it.
        Client client = ClientProxy.getClient(customerService);
        addTransformInterceptors(client.getInInterceptors(),
                                 client.getOutInterceptors(),
                                 false);
        
        System.out.println("Using new SOAP CustomerService with old client");
        
        customer.v1.Customer customer = createOldCustomer("Barry Old to New SOAP");
        customerService.updateCustomer(customer);
        customer = customerService.getCustomerByName("Barry Old to New SOAP");
        printOldCustomerDetails(customer);
    }
87284
private void defineWriteBridgeMethod()
    {
        classDefinition.addMethod(
                new MethodDefinition(a(PUBLIC, BRIDGE, SYNTHETIC), "write", null, arg("struct", Object.class), arg("protocol", TProtocol.class))
                        .addException(Exception.class)
                        .loadThis()
                        .loadVariable("struct", structType)
                        .loadVariable("protocol")
                        .invokeVirtual(
                                codecType,
                                "write",
                                type(void.class),
                                structType,
                                type(TProtocol.class)
                        )
                        .ret()
        );
    }
668041
protected static MethodType replaceWithMoreSpecificType(Object[] args, MethodType callSiteType) {
        for (int i=0; i<args.length; i++) {
            // if argument null, take the static type
            if (args[i]==null) continue;
            if (callSiteType.parameterType(i).isPrimitive()) continue;
            Class argClass = args[i].getClass();
            callSiteType = callSiteType.changeParameterType(i, argClass);
        }
        return callSiteType;
    }
623683
def add_input(self, in_name, type_or_parse=None):
        
        if type_or_parse is None:
            type_or_parse = GenericType()
        elif not isinstance(type_or_parse, GenericType) and callable(type_or_parse):
            type_or_parse = GenericType(parse=type_or_parse)
        elif not isinstance(type_or_parse, GenericType):
            raise ValueError("the given 'type_or_parse' is invalid")
        self._inputs[in_name] = type_or_parse
939960
def send(self, **kwargs):
        
        payload = self.api_payload()
        payload.update(**kwargs)
        return self.api_method()(**payload)
400332
public void doAddNew() throws DBException
    {
        if (this.lockOnDBTrxType(null, DBConstants.ADD_TYPE, false))  // ADD_TYPE = Add new; Should I do the unlock in my code?
            this.unlockIfLocked(this.getRecord(), null);    // Release any locks
    }
72687
@Override
	public OUTPUT newInstance(INPUT input, INPUT... inputs) throws FAILURE {
		
		StringBuilder builder = new StringBuilder()
		.append(getClass().getName())
		.append(".newInstance(Input, Input...) is unsupported.");
		
		throw new UnsupportedOperationException(builder.toString());
	}
666755
function (newPrototype, memberName, value) {
            if (typeof value === "function") {
                this._addMethodToPrototype(newPrototype, memberName, value);
            } else {
                newPrototype[memberName] = value;
            }
        }
145570
public void commit() throws IOException, AppPlatformException {
        final Map<String, Object> params = new HashMap<String, Object>();

        params.put("bridgeAudio", isBridgeAudio());
        final String[] callIds = getCallIds();
        params.put("callIds", callIds == null ? Collections.emptyList() : Arrays.asList(callIds));

        client.post(getUri(), params);
    }
1148365
public static Method newMethod(Class<?> clazz, String name, Class<?>[] params, Class<?> returnType,
			Class<?>[] exceptions,
			int modifiers, String signature) {
		// This is what the constructor looks like:
		// Method(Class declaringClass, String name, Class[] parameterTypes, Class returnType,
		// Class[] checkedExceptions, int modifiers, int slot, String signature,
		// byte[] annotations, byte[] parameterAnnotations, byte[] annotationDefault)
		Method returnMethod;
		try {
			jlrMethodCtor.setAccessible(true);
			returnMethod = jlrMethodCtor.newInstance(clazz, name, params, returnType, exceptions, modifiers, 0,
					signature, null,
					null, null);
		}
		catch (Exception e) {
			//This shouldn't happen...
			ReflectiveInterceptor.log.log(Level.SEVERE, "Internal Error", e);
			throw new Error(e);
		}
		return returnMethod;
	}
79582
private void transferToSpecificBuilderAndReset() {

		// version
		if (currentTag == Tag.VERSION) {
			dataBuilder.setVersion(buffer.toString());
		}

		// robot browser
		addToRobotBuilder();

		// build browser
		addToBrowserBuilder();

		// build operating system
		addToOperatingSystemBuilder();

		// build browser pattern
		addToBrowserPatternBuilder();

		// build browser type
		addToBrowserTypeBuilder();

		// build browser to operating system mapping
		addToBrowserOsMappingBuilder();

		// build operating system pattern
		addToOperatingSystemPatternBuilder();

		// build browser
		addToDeviceBuilder();

		// build browser pattern
		addToDevicePatternBuilder();

		buffer = new StringBuilder();
	}
862552
def implements(*interfaces):
        
        import sys

        frame = sys._getframe(1)
        locals_ = frame.f_locals

        # Some sanity checks
        msg = 'implements() can only be used in a class definition'
        assert locals_ is not frame.f_globals and '__module__' in locals_, msg

        locals_.setdefault('_implements', []).extend(interfaces)
384789
private AptMethodSet<AptOperation> initOperations()
    {
        AptMethodSet<AptOperation> operList = new AptMethodSet<AptOperation>();

        if ( _intfDecl == null )
            return operList;

        //
        // Add the methods from the current interface and all super interfaces *other*
        // than the one from which control inheritance or extension is defined.  These
        // exceptions are handled on the super ControlInterface (the return value
        // of AptControlInterface.initSuperClass())
        //
        // Do this by:
        //  - initially populate the check vector with the control interface
        //  - iterate through the check vector, examining each interface to:
        //      * ignore the super interface
        //      * add all declared interface methods to the operations list
        //      * add any super interfaces to the Vector (avoiding recursion)
        //  - the iteration continues until all superinterfaces have been processed
        //
        Vector<InterfaceDeclaration> checkIntfs = new Vector<InterfaceDeclaration>();
        checkIntfs.add(_intfDecl);

        for (int i = 0; i < checkIntfs.size(); i++)
        {
            InterfaceDeclaration intfDecl = checkIntfs.elementAt(i);
            if (intfDecl.equals(_superDecl))
                continue;

            if ( intfDecl.getMethods() == null )
                continue;

            // Add all declared methods, but ignore the mystery <clinit> methods
            for (MethodDeclaration methodDecl : intfDecl.getMethods())
                if (!methodDecl.toString().equals("<clinit>()"))
                    operList.add(new AptOperation(this, methodDecl, _ap));

            if ( intfDecl.getSuperinterfaces() == null )
                continue;

            for (InterfaceType superType : intfDecl.getSuperinterfaces())
            {
                InterfaceDeclaration superDecl = superType.getDeclaration();
                if (superDecl != null && !checkIntfs.contains(superDecl))
                    checkIntfs.add(superDecl);
            }
        }

        return operList;
    }
20776
def method(method_name)
      new_method = super
      parameters = new_method.parameters
      if parameters.size >= 1 && parameters.last.last == :mock_method
        self.class.instance_method(method_name).bind(self)
      else
        new_method
      end
    end
854069
protected void handleClientObjectChanged (int newCloid)
    {
        // subscribe to the new client object
        _omgr.subscribeToObject(newCloid, new Subscriber<ClientObject>() {
            public void objectAvailable (ClientObject clobj) {
                // grab a reference to our old receiver registrations
                DSet<Registration> receivers = _clobj.receivers;

                // replace the client object
                _clobj = clobj;

                // add ourselves as an event listener
                _clobj.addListener(InvocationDirector.this);

                // reregister our receivers
                _clobj.startTransaction();
                try {
                    _clobj.setReceivers(new DSet<Registration>());
                    for (Registration reg : receivers) {
                        _clobj.addToReceivers(reg);
                    }
                } finally {
                    _clobj.commitTransaction();
                }

                // and report the switcheroo back to the client
                _client.clientObjectDidChange(_clobj);
            }

            public void requestFailed (int oid, ObjectAccessException cause) {
                log.warning("Aiya! Unable to subscribe to changed client object", "cloid", oid,
                            "cause", cause);
            }
        });
    }