Filter power mock constructor.

@param declaredConstructors the declared constructors
@return the constructor[]
2538
static Constructor<?>[] filterPowerMockConstructor(Constructor<?>[] declaredConstructors) {
        Set<Constructor<?>> constructors = new HashSet<Constructor<?>>();
        for (Constructor<?> constructor : declaredConstructors) {
            final Class<?>[] parameterTypes = constructor.getParameterTypes();
            if (parameterTypes.length >= 1
                        && parameterTypes[parameterTypes.length - 1].getName().equals(
                    "org.powermock.core.IndicateReloadClass")) {
                continue;
            } else {
                constructors.add(constructor);
            }
        }
        return constructors.toArray(new Constructor<?>[constructors.size()]);
    }
463705
private static Constructor getConstructor()
  {
    if (_tc.isEntryEnabled()) SibTr.entry(_tc, "getConstructor");
    
    if (_constructor == null)
    {
      try
      {
        Class clazz = Class.forName("com.ibm.ws.sib.exitpoint.systemcontext.SystemContextImpl");
        _constructor = clazz.getConstructor(new Class[] {JsApiMessage.class});
      }
      catch (Exception e)
      {
        com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.exitpoint.systemcontext.SystemContextFactory.getConstructor", "66");
        
        NoSuchMethodError newE = new NoSuchMethodError();
        newE.initCause(e);
        
        if (_tc.isEntryEnabled()) SibTr.exit(_tc, "getConstructor", newE);
        throw newE;
      }
    }
    
    if (_tc.isEntryEnabled()) SibTr.exit(_tc, "getConstructor", _constructor);
    return _constructor;
  }
1280415
public static Constructor<?>[] constructorsDeclaredIn(final Class<?> cls, final Class<?>... additionalClasses) {
        if (cls == null) {
            throw new IllegalArgumentException("You need to supply at least one class.");
        }
        Set<Constructor<?>> constructors = new HashSet<Constructor<?>>();
        constructors.addAll(asList(WhiteboxImpl.getAllConstructors(cls)));
        for (Class<?> klass : additionalClasses) {
            constructors.addAll(asList(WhiteboxImpl.getAllConstructors(klass)));
        }
        return constructors.toArray(new Constructor[constructors.size()]);
    }
725767
public Constructor[] getConstructors(Class clazz, int count) {
	Array con;
	Object o;
	synchronized (map) {
	    o = map.get(clazz);
	    if (o == null) {
		con = store(clazz);
	    }
	    else con = (Array) o;
	}
	o = con.get(count + 1, null);
	if (o == null) return null;
	return (Constructor[]) o;
    }
835464
public static Constructor<?>[] getAllConstructorsOfClass(final Class<?> clazz, boolean accessible) {
        if (clazz == null) {
            return null;
        }
        Constructor<?>[] constructors = clazz.getDeclaredConstructors();
        if (constructors != null && constructors.length > 0) {
            AccessibleObject.setAccessible(constructors, accessible);
        }
        return constructors;
    }
523993
public Set<Constructor> getConstructorsAnnotatedWith(final Class<? extends Annotation> annotation) {
        Iterable<String> methods = store.get(index(MethodAnnotationsScanner.class), annotation.getName());
        return getConstructorsFromDescriptors(methods, loaders());
    }
79703
@SafeVarargs
    public static <T> Constructor<T> getDeclaredConstructor(final Class<T> cls, final Class<?>... parameterTypes) {
        Map<Class<?>[], Constructor<?>> constructorPool = classDeclaredConstructorPool.get(cls);
        Constructor<T> constructor = null;

        if (constructorPool != null) {
            constructor = (Constructor<T>) constructorPool.get(parameterTypes);
        }

        if (constructor == null) {
            try {
                constructor = cls.getDeclaredConstructor(parameterTypes);

                // SHOULD NOT set it true here.
                // constructor.setAccessible(true);
            } catch (NoSuchMethodException e) {
                // ignore.
            }

            if (constructor != null) {
                if (constructorPool == null) {
                    constructorPool = new ArrayHashMap<>(ConcurrentHashMap.class);
                    classDeclaredConstructorPool.put(cls, constructorPool);
                }

                constructorPool.put(parameterTypes.clone(), constructor);
            }
        }

        return constructor;
    }
1252179
private static <T> Constructor<T> lookupConstructor(Class<T> clazz, Object[] pArguments) throws NoSuchMethodException {
        Class[] argTypes = extractArgumentTypes(pArguments);
        return clazz.getConstructor(argTypes);
    }
1280866
public static String getConstructorDesc(Constructor<?> constructor) {
        Assert.notNull(constructor);
        return getDesc(void.class, constructor.getParameterTypes());
    }
1150041
@SuppressWarnings("unchecked")
    public static <T> Constructor<T> findMatchingConstructor(Class<T> classToInspect, Object... params) {
        Constructor<T> checkedConstructors = null;
        for (Constructor<?> constructor : classToInspect.getDeclaredConstructors()) {
            Type[] parameterTypes = constructor.getParameterTypes();
            if (parameterTypes.length == params.length && checkParameterTypes(parameterTypes, params)) {
                if (checkedConstructors == null) {
                    checkedConstructors = (Constructor<T>) constructor;
                } else {
                    throw BusinessException.createNew(BusinessErrorCode.AMBIGUOUS_CONSTRUCTOR_FOUND)
                            .put("constructor1", constructor)
                            .put("constructor2", checkedConstructors)
                            .put("object", classToInspect.getSimpleName())
                            .put("parameters", params);
                }
            }
        }
        return checkedConstructors;
    }
163654
private ConstructorDef<?> parseConstructorDef(final AvroConstructorDef def, final boolean isInjectable) {
    final List<ConstructorArg> args = new ArrayList<>();
    for (final AvroConstructorArg arg : def.getConstructorArgs()) {
      args.add(new ConstructorArgImpl(getString(arg.getFullArgClassName()), getString(arg.getNamedParameterName()),
              arg.getIsInjectionFuture()));
    }
    return new ConstructorDefImpl<>(getString(def.getFullClassName()), args.toArray(new ConstructorArg[0]),
            isInjectable);

  }
514662
public List<ConstructorResult<SqlResultSetMapping<T>>> getAllConstructorResult()
   {
      List<ConstructorResult<SqlResultSetMapping<T>>> list = new ArrayList<ConstructorResult<SqlResultSetMapping<T>>>();
      List<Node> nodeList = childNode.get("constructor-result");
      for(Node node: nodeList)
      {
         ConstructorResult<SqlResultSetMapping<T>>  type = new ConstructorResultImpl<SqlResultSetMapping<T>>(this, "constructor-result", childNode, node);
         list.add(type);
      }
      return list;
   }
182369
public static synchronized void suppressConstructor(Class<?> clazz, boolean excludePrivateConstructors) {
		Constructor<?>[] ctors = null;

		if (excludePrivateConstructors) {
			ctors = clazz.getConstructors();
		} else {
			ctors = clazz.getDeclaredConstructors();
		}

		for (Constructor<?> ctor : ctors) {
			MockRepository.addConstructorToSuppress(ctor);
		}
	}
515317
private static Constructor<?> getConstructor(final Class<?> genericClass, final Class<?>[] constructorParameterTypes) {
        Constructor<?> constructor = null;
        try {
            constructor = genericClass.getConstructor(constructorParameterTypes);
        } catch (final NoSuchMethodException e) {
            // Return the first constructor as a workaround
            constructor = genericClass.getConstructors()[0];
        } catch (final SecurityException e) {
            LOGGER.log(NO_CONSTRUCTOR, e);
            throw e; // Pop up the exception to let it managed by the caller method
        }
        return constructor;
    }
511627
private static <T extends Bean> Constructor<T> findConstructor(Class<T> beanType, List<Class<?>> propertyTypes) {
        Class<?>[] types = propertyTypes.toArray(new Class<?>[propertyTypes.size()]);
        try {
            Constructor<T> con = beanType.getDeclaredConstructor(types);
            return con;
            
        } catch (NoSuchMethodException ex) {
            // try a more lenient search
            // this handles cases where field is a concrete class and constructor is an interface
            @SuppressWarnings("unchecked")
            Constructor<T>[] cons = (Constructor<T>[]) beanType.getDeclaredConstructors();
            Constructor<T> match = null;
            for (int i = 0; i < cons.length; i++) {
                Constructor<T> con = cons[i];
                Class<?>[] conTypes = con.getParameterTypes();
                if (conTypes.length == types.length) {
                    for (int j = 0; j < types.length; j++) {
                        if (!conTypes[j].isAssignableFrom(types[j])) {
                            break;
                        }
                    }
                    if (match != null) {
                        throw new UnsupportedOperationException("Unable to find constructor: More than one matches");
                    }
                    match = con;
                }
            }
            if (match == null) {
                String msg = "Unable to find constructor: " + beanType.getSimpleName() + "(";
                for (Class<?> type : types) {
                    msg += Objects.toString(type.getName(), "<null>");
                }
                msg += ")";
                throw new UnsupportedOperationException(msg, ex);
            }
            return match;
        }
    }
1133911
public static Constructor<?> getEmptyConstructor(Class<?> clazz) {
        Constructor<?> c = clazz.getDeclaredConstructors()[0];
        for (int i = 0; i < clazz.getDeclaredConstructors().length; i++) {
            if (clazz.getDeclaredConstructors()[i].getParameterTypes().length < 1) {
                c = clazz.getDeclaredConstructors()[i];
                break;
            }
        }

        return c;
    }
1326459
@SuppressWarnings("unchecked")
	public static <T> Constructor<T>[] getConstructors(Class<T> beanClass) throws SecurityException {
		Assert.notNull(beanClass);
		Constructor<?>[] constructors = CONSTRUCTORS_CACHE.get(beanClass);
		if (null != constructors) {
			return (Constructor<T>[]) constructors;
		}

		constructors = getConstructorsDirectly(beanClass);
		return (Constructor<T>[]) CONSTRUCTORS_CACHE.put(beanClass, constructors);
	}