Works around a bug in java.beans.Introspector, where sub-interfaces
do not return their parent's methods, in the method descriptor array.
976230
protected MethodDescriptor[] addMissingContextMethodDescriptors(
        Method[] methods, MethodDescriptor[] methodDescriptors) {

        List<Method> methodNames = new ArrayList<Method>(methodDescriptors.length);
        Vector<MethodDescriptor> mds = new Vector<MethodDescriptor>(methods.length);

        for (int i=0; i<methodDescriptors.length; i++) {
            methodNames.add(methodDescriptors[i].getMethod());
            mds.add(methodDescriptors[i]);
        }

        for (int i=0; i<methods.length; i++) {
            if (!methodNames.contains(methods[i])) {
                mds.add(new MethodDescriptor(methods[i]));
            }           
        }
        
        methodDescriptors = new MethodDescriptor[mds.size()];
        mds.copyInto(methodDescriptors);

        return methodDescriptors;
    }
107818
private void introspectCollab(String name, EJBRequestCollaborator<?>[] collabArray, IntrospectionWriter writer) {

        if (collabArray != null && collabArray.length > 0) { // d742434
            int i = 0;
            for (Object element : collabArray) {
                String outString = name + "[" + i++ + "]";
                String format = String.format("%-55s = %s", outString, Util.identity(element)); // 619922.1
                writer.println(format);
            }
        } else {
            String outString = name + "[]";
            String format = String.format("%-55s %s", outString, "is empty.");
            writer.println(format);
        }

    }
57204
@Override
    public boolean visitClass(ClassDescriptor classDescriptor, XClass xclass) {
        assert xclass != null;
        String methodSignature = xmethod.getSignature();
        XMethod bridgedFrom = xmethod.bridgeFrom();
        // See if this class has an overridden method

        XMethod xm = xclass.findMethod(xmethod.getName(), methodSignature, false);

        if (xm == null && bridgedFrom != null && !classDescriptor.equals(xmethod.getClassDescriptor())) {
            methodSignature = bridgedFrom.getSignature();
            xm = xclass.findMethod(xmethod.getName(), methodSignature, false);
        }

        if (xm != null) {
            return visitOverriddenMethod(xm) || bridgedFrom != null;
        } else {
            // Even though this particular class doesn't contain the method
            // we're
            // looking for, a superclass might, so we need to keep going.
            return true;
        }
    }
858355
private void introspectMethods(Class type, Set introspectedClasses) {
		if (type == null || Object.class.equals(type) || introspectedClasses.contains(type)) {
			return;
		}
		introspectedClasses.add(type);
		Class[] interfaces = type.getInterfaces();
		for (int i = 0; i < interfaces.length; i++) {
			introspectMethods(interfaces[i], introspectedClasses);
		}
		introspectMethods(type.getSuperclass(), introspectedClasses);
		Method[] methods = type.getDeclaredMethods();
		for (int i = 0; i < methods.length; i++) {
			String methodName = methods[i].getName();
			if (methodName.startsWith("get") && methods[i].getParameterTypes().length == 0) {
				readAccessors.put(getPropertyName(methodName, 3), methods[i]);
			}
			else if (methodName.startsWith("is") && methods[i].getParameterTypes().length == 0) {
				readAccessors.put(getPropertyName(methodName, 2), methods[i]);
			}
			else if (methodName.startsWith("set") && methods[i].getParameterTypes().length == 1) {
				writeAccessors.put(getPropertyName(methodName, 3), methods[i]);
			}
		}
	}
854659
public static MethodIntrospector instance(ProcessingEnvironment env) {
    try {
      try {
        return JavacMethodIntrospector.instance(env);
      } catch (LinkageError e) {
        return (MethodIntrospector) IntrospectorClassLoader
            .create(MethodIntrospector.class, env)
            .loadClass(JAVAC_METHOD_INTROSPECTOR)
            .getMethod("instance", ProcessingEnvironment.class)
            .invoke(null, env);
      }
    } catch (Exception | LinkageError e) {
      return new NoMethodIntrospector();
    }
  }
491003
public Method[] getArrayAccessMethods() throws IntrospectionException {
        if (!mCheckedForArrayLookup) {
            checkForArrayLookup();
        }

        return mArrayAccessMethods == null ? null :
            (Method[])mArrayAccessMethods.clone();
    }
1211528
private String getMethodName(Map<String, Command> references) throws NoSuchMethodException, IntrospectionException, Exception
	{
		if (methodName == null)
		{
			String methodValue = null;
			if (isTag("class")) { //$NON-NLS-1$
				addArgument(new Argument(String.class, data), 0);
				methodValue = "forName"; //$NON-NLS-1$
			}
			else if (isPrimitive())
			{
				if (isTag("char")) { //$NON-NLS-1$
					if (data.length() != 1)
					{
						throw new IntrospectionException(Messages.getString("beans.43", //$NON-NLS-1$
								data));
					}
					addArgument(new Argument(char.class, Character.valueOf(data.charAt(0))), 0);
				}
				else
				{
					addArgument(new Argument(String.class, data), 0);
				}
				methodValue = "new"; //$NON-NLS-1$
			}
			else if (isConstructor() || hasAttr("method", "new")) { //$NON-NLS-1$ //$NON-NLS-2$
				methodValue = "new"; //$NON-NLS-1$
			}
			else if (isArray())
			{
				methodValue = "new"; //$NON-NLS-1$
				int length = hasAttr("length") ? Integer //$NON-NLS-1$
						.parseInt(getAttr("length")) : getArgumentsNumber(); //$NON-NLS-1$
				copyArgumentsToCommands();
				addArgument(new Argument(int.class, Integer.valueOf(length)), 0);
			}
			else if (hasAttr("property")) { //$NON-NLS-1$
				String propertyValue = getAttr("property"); //$NON-NLS-1$
				if (hasAttr("index")) { //$NON-NLS-1$
					addArgument(new Argument(int.class, new Integer(getAttr("index"))), 0); //$NON-NLS-1$
				}

				BeanInfo beanInfo = Introspector.getBeanInfo(getTarget(references).getClass());
				PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();

				boolean methodFound = false;
				Method method = null;
				for (PropertyDescriptor pd : pds)
				{
					if (propertyValue.equals(pd.getName()))
					{
						int argsNum = getArgumentsNumber();
						if (hasAttr("index")) { //$NON-NLS-1$
							IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
							if (argsNum == 1)
							{
								method = ipd.getIndexedReadMethod();
							}
							else if (argsNum == 0)
							{
								method = ipd.getReadMethod();
							}
						}
						else
						{
							method = pd.getReadMethod();
						}

						if (method != null)
						{
							methodFound = matchMethodParams(method, references);
						}

						if (methodFound == false)
						{
							if (hasAttr("index")) { //$NON-NLS-1$
								IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
								if (argsNum == 2)
								{
									method = ipd.getIndexedWriteMethod();
								}
								else if (argsNum == 1)
								{
									method = ipd.getWriteMethod();
								}
							}
							else
							{
								method = pd.getWriteMethod();
							}
						}

						if (method != null)
						{
							methodFound = matchMethodParams(method, references);
						}
					}
				}

				if (method == null)
				{
					throw new NoSuchMethodException(Messages.getString("beans.44", //$NON-NLS-1$
							propertyValue));
				}
				methodValue = method.getName();
			}
			else if (hasAttr("method")) { //$NON-NLS-1$
				if (hasAttr("index")) { //$NON-NLS-1$
					addArgument(new Argument(int.class, Integer.valueOf(getAttr("index"))), 0); //$NON-NLS-1$
				}
				methodValue = getAttr("method"); //$NON-NLS-1$
			}
			else if (hasAttr("index")) { //$NON-NLS-1$
				addArgument(new Argument(int.class, Integer.valueOf(getAttr("index"))), 0); //$NON-NLS-1$
				methodValue = getArgumentsNumber() > 1 ? "set" : "get"; //$NON-NLS-1$ //$NON-NLS-2$
				if (ctx.isArray())
				{
					addArgument(ctx.getResult(), 0);
				}
			}
			else if (hasAttr("field")) { //$NON-NLS-1$
				addArgument(new Argument(Class.forName(getAttr("class"), true, //$NON-NLS-1$
						Thread.currentThread().getContextClassLoader())), 0);

				methodValue = "get"; //$NON-NLS-1$
			}
			else
			{
				throw new Exception(Messages.getString("beans.45")); //$NON-NLS-1$
			}
			methodName = methodValue;
		}
		return methodName;
	}
227021
protected Method getGetter(Class type, String name)
    {
        return introspector(type).getGetter( toJavaIdentifierForm(name));
    }
1168405
public static void introspect(IntrospectionWriter writer)
    {
        writer.begin("Container Properties");
        writer.println("Property: AllowCachedTimerDataFor = " + AllowCachedTimerDataFor);//F001419
        writer.println("Property: AllowCustomFinderSQLForUpdate = " + AllowCustomFinderSQLForUpdate);
        writer.println("Property: AllowEarlyInsert        = " + AllowEarlyInsert);
        writer.println("Property: AllowPrimaryKeyMutation = " + AllowPrimaryKeyMutation);
        writer.println("Property: AllowSpecViolationOnRollback = " + AllowSpecViolationOnRollback); //PK87857
        writer.println("Property: AsyncResultNoResponseBackoff = " + AsyncNoResponseBackoff);
        writer.println("Property: BindToJavaGlobal        = " + BindToJavaGlobal);
        writer.println("Property: BindToServerRoot        = " + BindToServerRoot);
        writer.println("Property: BlockWorkUntilAppStarted = " + BlockWorkUntilAppStarted); // F743-15941
        writer.println("Property: BlockWorkUntilAppStartedWaitTime = " + BlockWorkUntilAppStartedWaitTime); // F743-15941
        writer.println("Property: CheckAppConfig          = " + CheckAppConfig); // F743-13921
        writer.println("Property: CreateInstanceAtStart   = " + CreateInstanceAtStart);
        writer.println("Property: DefaultSessionAccessTimeout = " + DefaultSessionAccessTimeout); // d704504
        writer.println("Property: DefaultStatefulSessionTimeout  = " + DefaultStatefulSessionTimeout); // F743-14726  d627044
        writer.println("Property: DisableAsyncMethods     = " + DisableAsyncMethods); // F743-13022
        writer.println("Property: DisableAsyncResultRetries = " + DisableAsyncResultRetries);
        writer.println("Property: DisableAutomaticLightweightMethods = " + DisableAutomaticLightweightMethods);
        writer.println("Property: DisableMDBs             = " + DisableMDBs); // F743-13023
        writer.println("Property: DisableRemote           = " + DisableRemote); // F743-13024.CdRv
        writer.println("Property: DisableShortDefaultBindings = " + DisableShortDefaultBindings);
        writer.println("Property: DisableTimers           = " + DisableTimers); // F743-13022
        writer.println("Property: DisablePersistentTimers = " + DisablePersistentTimers); // PI50798
        writer.println("Property: EE5Compatibility        = " + EE5Compatibility); // F743-14982CdRv
        writer.println("Property: EE6Compatibility        = " + EE6Compatibility); // RTC113949
        writer.println("Property: EmptyAnnotationIgnoresExplicitInterfaces = " +
                       EmptyAnnotationIgnoresExplicitInterfaces); // RTC113949
        writer.println("Property: ExcludeNestedExceptions = " + ExcludeNestedExceptions); // d672063
        writer.println("Property: ExpandCMPCFJNDIName     = " + ExpandCMPCFJNDIName); //d425164
        writer.println("Property: FbpkAlwaysReadOnly      = " + FbpkAlwaysReadOnly);
        writer.println("Property: IgnoreDuplicateEJBBindings = " + IgnoreDuplicateEJBBindings);
        writer.println("Property: IncludeNestedExceptions = " + IncludeNestedExceptions);
        writer.println("Property: IncludeNestedExceptionsExtended = " + IncludeNestedExceptionsExtended); //PK87857
        writer.println("Property: IndirectLocalProxies    = " + IndirectLocalProxies);
        writer.println("Property: InitializeEJBsAtStartup = " + InitializeEJBsAtStartup);
        writer.println("Property: MaxAsyncResultWaitTime  = " + MaxAsyncResultWaitTime);
        writer.println("Property: MaxUnclaimedAsyncResults = " + MaxUnclaimedAsyncResults); // d690014.1
        writer.println("Property: NoEJBPool               = " + NoEJBPool);
        writer.println("Property: NoPrimaryKeyMutation    = " + NoPrimaryKeyMutation);
        writer.println("Property: PassivationPolicy       = " + PassivationPolicy);
        writer.println("Property: PersistentTimerSingletonDeadlockTimeout = " + PersistentTimerSingletonDeadlockTimeout);
        writer.println("Property: PoolSize                = " + PoolSize);
        writer.println("Property: Portable                = " + Portable);
        writer.println("Property: PortableFinder          = " + PortableFinder);
        writer.println("Property: RMICCompatible          = " + RMICCompatible);
        writer.println("Property: StrictMaxCacheSize      = " + StrictMaxCacheSize);
        writer.println("Property: TimerCancelTimeout      = " + TimerCancelTimeout);
        writer.println("Property: TimerQOSAtLeastOnceForRequired = " + TimerQOSAtLeastOnceForRequired);
        writer.println("Property: ThrowRemoteFromEjb3Stub = " + ThrowRemoteFromEjb3Stub);
        writer.println("Property: UseFairSingletonLockingPolicy = " + UseFairSingletonLockingPolicy); // F743-9002
        writer.println("Property: UserInstallRoot         = " + UserInstallRoot);
        writer.println("Property: WLMAllowOptionAReadOnly = " + WLMAllowOptionAReadOnly);
        writer.println("Property: ExtendSetRollbackOnlyBehaviorBeyondInstanceFor = " +
                       ExtendSetRollbackOnlyBehaviorBeyondInstanceFor);
        writer.println("Property: LimitSetRollbackOnlyBehaviorToInstanceFor = " +
                       LimitSetRollbackOnlyBehaviorToInstanceFor);
        writer.end();
    }
662939
@Override
    public MethodDescriptor getMethodDescriptor() {
        return DescriptorFactory.instance().getMethodDescriptor(ClassName.toSlashedClassName(getClassName()), getName(),
                getSignature(), isStatic());
    }
69664
private static boolean implementingObsoleteMethod(
      MethodTree enclosingMethod, VisitorState state, Type type) {
    MethodSymbol method = ASTHelpers.getSymbol(enclosingMethod);
    if (method == null) {
      return false;
    }
    if (ASTHelpers.findSuperMethods(method, state.getTypes()).isEmpty()) {
      // not an override
      return false;
    }
    if (!ASTHelpers.isSameType(method.getReturnType(), type, state)) {
      return false;
    }
    return true;
  }
437653
@Override
    public List<String> introspect() {
        List<String> rc = super.introspect();
        String prefix = getClass().getSimpleName() + "@" + hashCode() + ": ";
        rc.add(prefix + "callback=" + callback);
        return rc;
    }
1197631
private void processProperties(XMLStreamWriter writer, Set<Method> methodSet, Class<?> aClass) throws IntrospectionException, XMLStreamException
   {
      BeanInfo beanInfo = Introspector.getBeanInfo(aClass, aClass.getSuperclass());
      PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();

      for (int i = 0; i < propertyDescriptors.length; i++)
      {
         PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
         if (propertyDescriptor.getPropertyType() != null)
         {
            String name = propertyDescriptor.getName();
            Method readMethod = propertyDescriptor.getReadMethod();
            Method writeMethod = propertyDescriptor.getWriteMethod();

            String readMethodName = readMethod == null ? null : readMethod.getName();
            String writeMethodName = writeMethod == null ? null : writeMethod.getName();
            addProperty(writer, name, propertyDescriptor.getPropertyType(), readMethodName, writeMethodName);

            if (readMethod != null)
            {
               methodSet.add(readMethod);
            }

            if (writeMethod != null)
            {
               methodSet.add(writeMethod);
            }
         }
         else
         {
            processAmbiguousProperty(writer, methodSet, aClass, propertyDescriptor);
         }
      }
   }
763893
public static PropertyDescriptor[] propertyDescriptors(Class<?> clazz) {
        BeanInfo beanInfo = null;
        try {
            beanInfo = Introspector.getBeanInfo(clazz);

        } catch (IntrospectionException ex) {
            throw new IllegalArgumentException(
                    "Bean introspection failed: " + ex.getMessage());
        }

        return beanInfo.getPropertyDescriptors();
    }
1240053
@Override
  public void introspect(ContextH3 context)
  {
    if (_infoRef.get() != null) {
      return;
    }

    _ctor = introspectConstructor();

    introspectFields();

    FieldInfoH3[] fieldInfo = new FieldInfoH3[2];

    fieldInfo[0] = _key.info();
    fieldInfo[1] = _value.info();

    _infoRef.compareAndSet(null, new ClassInfoH3(_type.getName(), fieldInfo));
  }
116820
@Override
	public BeanInfo[] getAdditionalBeanInfo() {
		try {
			return new BeanInfo[] {
				Introspector.getBeanInfo(InputTag.class.getSuperclass())
			};
		} catch(IntrospectionException err) {
			throw new AssertionError(err);
		}
	}
179077
private static CustomPropertyDescriptor tryBuildFinal(Field field,
                                                          Class<?> clazz) throws IntrospectionException {
        String name = field.getName();
        String readMethodName;
        log.debug("尝试为final类型的字段{}创建字段说明", name);

        if (Boolean.class.isAssignableFrom(field.getType())) {
            log.debug("字段是boolean类型");
            if (name.startsWith("is")) {
                readMethodName = name;
            } else {
                readMethodName = "is" + StringUtils.toFirstUpperCase(name);
            }
        } else {
            log.debug("字段不是boolean类型");
            readMethodName = "get" + StringUtils.toFirstUpperCase(name);
        }
        log.debug("猜测final类型的字段{}的read方法名为{}", name, readMethodName);
        return convert(field, new PropertyDescriptor(name, clazz, readMethodName, null), clazz);
    }