Invokes a nullary static factory method using reflection to stay backwards-compatible with older JDKs.

@param fqcn The fully qualified class name of the type to be produced.
@param methodName The name of the factory method.
@return the object produced.
161715
private static Object invokeNullaryFactoryMethod(final String fqcn, final String methodName) {
        try {
            final Class<?> type = Class.forName(fqcn);
            final Method method = type.getMethod(methodName);

            return method.invoke(null);
            // any exception is really unexpected since the type name has
            // already been verified
        } catch (final Exception e) {
            throw new InstantiationException(
                    String.format("Could not create %s#%s(): %s", fqcn, methodName, e), e);
        }
    }
837358
static JDOClass getJDOClass(Class c)
	{
		JDOClass rc = null;
		try
		{
			JavaModelFactory javaModelFactory = RuntimeJavaModelFactory.getInstance();
			JavaModel javaModel = javaModelFactory.getJavaModel(c.getClassLoader());
			JDOModel m = JDOModelFactoryImpl.getInstance().getJDOModel(javaModel);
			rc = m.getJDOClass(c.getName());
		}
		catch (RuntimeException ex)
		{
			throw new JDOFatalInternalException("Not a JDO class: " + c.getName()); 
		}
		return rc;
	}
616456
@SuppressWarnings(value = "unchecked")
  <T, K extends SharedResourceKey> SharedResourceFactoryResponse<T> getScopedFromCache(
      final SharedResourceFactory<T, K, S> factory, @Nonnull final K key,
      @Nonnull final ScopeWrapper<S> scope, final SharedResourcesBrokerImpl<S> broker)
      throws ExecutionException {
    RawJobBrokerKey fullKey = new RawJobBrokerKey(scope, factory.getName(), key);
    Object obj = this.sharedResourceCache.get(fullKey, new Callable<Object>() {
      @Override
      public Object call() throws Exception {
        return factory.createResource(broker.getScopedView(scope.getType()), broker.getConfigView(scope.getType(), key,
            factory.getName()));
      }
    });

    return (SharedResourceFactoryResponse<T>)obj;
  }
664362
void createReturnOcelotPromiseFactory(String classname, String methodName, boolean ws, String args, String keys, Writer writer) throws IOException {
		String md5 = keyMaker.getMd5(classname + DOT + methodName);
		writer.append(TAB3).append("return promiseFactory.create").append(OPENPARENTHESIS).append("_ds").append(COMMA).append(SPACEOPTIONAL)
				  .append(QUOTE).append(md5).append(UNDERSCORE).append(QUOTE)
				  .append(" + JSON.stringify([").append(keys).append("]).md5()").append(COMMA).append(SPACEOPTIONAL)
				  .append(QUOTE).append(methodName).append(QUOTE).append(COMMA).append(SPACEOPTIONAL).append(""+ws).append(COMMA)
				  .append(SPACEOPTIONAL).append(OPENBRACKET).append(args).append(CLOSEBRACKET).append(CLOSEPARENTHESIS)
				  .append(SEMICOLON).append(CR);
	}
1302127
@SuppressWarnings("unchecked")
	public static <T> Function<T, Void> nullFn() {
		return (Function<T, Void>) NULL_FN;
	}
1033463
@FFDCIgnore(value = { Throwable.class })
    // Liberty Change for CXF End
    protected static Object createProvider(String className, Bus bus) {

        try {
            Class<?> cls = ClassLoaderUtils.loadClass(className, ProviderFactory.class);
            for (Constructor<?> c : cls.getConstructors()) {
                if (c.getParameterTypes().length == 1 && c.getParameterTypes()[0] == Bus.class) {
                    return c.newInstance(bus);
                }
            }
            return cls.newInstance();
        } catch (Throwable ex) {
            String message = "Problem with creating the default provider " + className;
            if (ex.getMessage() != null) {
                message += ": " + ex.getMessage();
            } else {
                message += ", exception class : " + ex.getClass().getName();
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, message);
            }
        }
        return null;
    }
1096677
public Method getMethod(String methodName) {
        return checkNotNull(methods().get(checkNotNull(methodName)), 
        		"The method %s is not exists of object %s", methodName, delegateClass().getName());
    }
171083
public MethodInfo get(String beanName, String methodName) {
		return this.cache.get(new Key(beanName, methodName));
	}
420893
public static Object invokeMethodIfExists(Object instance, String methodName) {
        return invokeMethodIfExists(instance, methodName, NO_ARGS);
    }
297678
@Nullable
    protected final <T> T jsiiAsyncCall(final String method, final Class<T> returnType, @Nullable final Object... args) {
        JsiiClient client = engine.getClient();
        JsiiPromise promise = client.beginAsyncMethod(this.objRef, method, JsiiObjectMapper.valueToTree(args));

        engine.processAllPendingCallbacks();

        return JsiiObjectMapper.treeToValue(client.endAsyncMethod(promise), returnType);
    }
375070
public function validateReflectionMethod($classFQN, $method)
    {
        if (null === $classFQN || null === $method) {
            return false;
        }

        try {
            $reflectionMethod = new \ReflectionMethod($classFQN, $method);
        } catch (\ReflectionException $re) {
            return new CoverFishMessageError(CoverFishMessageError::PHPUNIT_REFLECTION_METHOD_NOT_FOUND, $method);
        }

        return $reflectionMethod;
    }
1259706
public static Object buildNewObjectInstance(ClassDescriptor cld)
    {
        Object result = null;

        // If either the factory class and/or factory method is null,
        // just follow the normal code path and create via constructor
        if ((cld.getFactoryClass() == null) || (cld.getFactoryMethod() == null))
        {
            try
            {
                // 1. create an empty Object (persistent classes need a public default constructor)
                Constructor con = cld.getZeroArgumentConstructor();
                if(con == null)
                {
                    throw new ClassNotPersistenceCapableException(
                    "A zero argument constructor was not provided! Class was '" + cld.getClassNameOfObject() + "'");
                }
                result = ConstructorHelper.instantiate(con);
            }
            catch (InstantiationException e)
            {
                throw new ClassNotPersistenceCapableException(
                        "Can't instantiate class '" + cld.getClassNameOfObject()+"'");
            }
        }
        else
        {
            try
            {
                // 1. create an empty Object by calling the no-parms factory method
                Method method = cld.getFactoryMethod();

                if (Modifier.isStatic(method.getModifiers()))
                {
                    // method is static so call it directly
                    result = method.invoke(null, null);
                }
                else
                {
                    // method is not static, so create an object of the factory first
                    // note that this requires a public no-parameter (default) constructor
                    Object factoryInstance = cld.getFactoryClass().newInstance();

                    result = method.invoke(factoryInstance, null);
                }
            }
            catch (Exception ex)
            {
                throw new PersistenceBrokerException("Unable to build object instance of class '"
                        + cld.getClassNameOfObject() + "' from factory:" + cld.getFactoryClass()
                        + "." + cld.getFactoryMethod(), ex);
            }
        }
        return result;
    }
1356546
public static String[] getMethodSigsCache(String serviceName, String methodName) {
        ConcurrentHashMap<String, String[]> methods = NOT_OVERLOAD_METHOD_SIGS_CACHE.get(serviceName);
        return methods == null ? null : methods.get(methodName);
    }
870042
public static Object invokeMethod(Class<?> type,Object instance,String methodName,Class<?>[] inputTypes,Object[] input)
    {
        Method method=null;
        try
        {
            //get method
            method=type.getDeclaredMethod(methodName,inputTypes);
        }
        catch(Exception exception)
        {
            throw new FaxException("Unable to extract method: "+methodName+" from type: "+type,exception);
        }

        //set accessible
        method.setAccessible(true);

        Object output=null;
        try
        {
            //invoke method
            output=method.invoke(instance,input);
        }
        catch(Exception exception)
        {
            throw new FaxException("Unable to invoke method: "+methodName+" of type: "+type,exception);
        }
        
        return output;
    }
245704
@Override
    protected void visitMethodCFG(MethodDescriptor methodDescriptor, CFG cfg) throws CheckedAnalysisException {
        if (METHOD != null && !methodDescriptor.getName().equals(METHOD)) {
            return;
        }

        if (methodDescriptor.getName().startsWith("access$")) {
            return;
        }

        XMethod xMethod = XFactory.createXMethod(methodDescriptor);
        if (DEBUG) {
            System.out.println("CheckTypeQualifiers: checking " + methodDescriptor.toString());
        }

        Collection<TypeQualifierValue<?>> relevantQualifiers = Analysis.getRelevantTypeQualifiers(methodDescriptor, cfg);
        for(Iterator<TypeQualifierValue<?>> i = relevantQualifiers.iterator(); i.hasNext();  ) {
            if (i.next().getTypeQualifierClassDescriptor().getClassName().equals(NONNULL_ANNOTATION)) {
                i.remove();
            }
        }
        if (relevantQualifiers.isEmpty()) {
            return;
        }
        if (DEBUG) {
            System.out.println("  Relevant type qualifiers are " + relevantQualifiers);
        }
        IAnalysisCache analysisCache = Global.getAnalysisCache();
        ForwardTypeQualifierDataflowFactory forwardDataflowFactory = analysisCache.getMethodAnalysis(
                ForwardTypeQualifierDataflowFactory.class, methodDescriptor);
        BackwardTypeQualifierDataflowFactory backwardDataflowFactory = analysisCache.getMethodAnalysis(
                BackwardTypeQualifierDataflowFactory.class, methodDescriptor);
        ValueNumberDataflow vnaDataflow = analysisCache.getMethodAnalysis(ValueNumberDataflow.class, methodDescriptor);

        for (TypeQualifierValue<?> typeQualifierValue : relevantQualifiers) {

            try {
                checkQualifier(xMethod, cfg, typeQualifierValue, forwardDataflowFactory, backwardDataflowFactory,
                        vnaDataflow);
            } catch (MissingClassException e) {
                AnalysisContext.reportMissingClass(e);
            } catch (CheckedAnalysisException e) {
                bugReporter.logError("Exception checking type qualifier " + typeQualifierValue.toString() + " on method "
                        + methodDescriptor.toString(), e);
            }
        }
    }
920808
Object getFallbackFactory(FactoryFinderInstance brokenFactoryManager, String factoryName) {
        Object result = null;
        ClassLoader cl = getClassLoader();        
        for (Map.Entry<FactoryManagerCacheKey, FactoryFinderInstance> cur : applicationMap.entrySet()) {
            if (cur.getKey().getClassLoader().equals(cl) && !cur.getValue().equals(brokenFactoryManager)) {
                result = cur.getValue().getFactory(factoryName);
                if (null != result) {
                    break;
                }
            }
        }
        return result;
    }
842211
private static Method getMethod(final Class cls, final String methodName, boolean declared) {
		$.checkNotEmpty(methodName);
		List<Method> methods = getMethodsList(cls, declared);
		for (int i = 0; i < methods.size(); i++) {
			if (methodName.equals(methods.get(i).getName())) {
				return methods.get(i);
			}
		}
		return null;
	}