Get the InnerClassAccess for access method called by given INVOKESTATIC.

@param inv
the INVOKESTATIC instruction
@param cpg
the ConstantPoolGen for the method
@return the InnerClassAccess, or null if the instruction is not an
inner-class access
164405
public static InnerClassAccess getInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg) throws ClassNotFoundException {

        String className = inv.getClassName(cpg);
        String methodName = inv.getName(cpg);
        String methodSig = inv.getSignature(cpg);

        InnerClassAccess access = AnalysisContext.currentAnalysisContext().getInnerClassAccessMap()
                .getInnerClassAccess(className, methodName);
        return (access != null && access.getMethodSignature().equals(methodSig)) ? access : null;
    }
240045
public static Class getClassContextAt(int i) {
		Class[] classes = MANAGER.getClassContext();
		if (classes != null && classes.length > i) {
			return classes[i];
		}
		return null;
	}
745140
@Nullable
  public static AccessPath fromFieldAccess(FieldAccessNode fieldAccess) {
    ImmutableList.Builder<String> pathBuilder = ImmutableList.builder();

    Tree tree = fieldAccess.getTree();
    boolean isFieldAccess;
    while ((isFieldAccess = TreeUtils.isFieldAccess(tree)) || isAutoValueAccessor(tree)) {
      if (isFieldAccess) {
        pathBuilder.add(TreeUtils.getFieldName(tree));
      } else {
        // Must be an AutoValue accessor, since the `while` condition held but the `if` didn't.
        // Unwrap the method select from the call
        tree = ((MethodInvocationTree) tree).getMethodSelect();
        pathBuilder.add(TreeUtils.getMethodName(tree) + "()");
      }

      if (tree.getKind() == Kind.IDENTIFIER) {
        // Implicit `this` receiver
        return AccessPath.create(/*base=*/ null, pathBuilder.build());
      }

      tree = ((MemberSelectTree) tree).getExpression();
    }

    // Explicit `this` receiver
    if (tree.getKind() == Kind.IDENTIFIER
        && ((IdentifierTree) tree).getName().contentEquals("this")) {
      return AccessPath.create(/*base=*/ null, pathBuilder.build());
    }

    // Local variable receiver
    if (tree.getKind() == Kind.IDENTIFIER) {
      return AccessPath.create(TreeUtils.elementFromTree(tree), pathBuilder.build());
    }

    return null;
  }
1184471
@GET
    @Path("/getPrincipalClass")
    @RolesAllowed("Tester")
    public String getPrincipalClass(@Context SecurityContext sec) {
        Principal user = sec.getUserPrincipal();
        boolean isJsonWebToken = user instanceof JsonWebToken;
        return "isJsonWebToken:" + isJsonWebToken;
    }
302322
private ProtectionDomain getProtectionDomain(CodeSource cs) {
        if (cs == null)
            return null;

        ProtectionDomain pd = null;
        synchronized (pdcache) {
            pd = pdcache.get(cs);
            if (pd == null) {
                PermissionCollection perms = getPermissions(cs);
                pd = new ProtectionDomain(cs, perms, this, null);
                pdcache.put(cs, pd);
                if (debug != null) {
                    debug.println(" getPermissions "+ pd);
                    debug.println("");
                }
            }
        }
        return pd;
    }
54026
static KryoInstantiator reflect(Class<? extends KryoInstantiator> instClass, Config optConf)
    throws ConfigurationException {
    try {
      try {
        return instClass.getConstructor(Config.class).newInstance(optConf);
      } catch (NoSuchMethodException ex3) {
        return instClass.newInstance();
      }
    }
    catch(InstantiationException x) {
      throw new ConfigurationException(x);
    }
    catch(IllegalAccessException x) {
      throw new ConfigurationException(x);
    }
    catch(InvocationTargetException x) {
      throw new ConfigurationException(x);
    }
  }
943808
@Nonnull
    public BugInstance addCalledMethod(MethodGen methodGen, InvokeInstruction inv) {
        ConstantPoolGen cpg = methodGen.getConstantPool();
        return addCalledMethod(cpg, inv);
    }
1061015
public Class<? extends AccessTokenProvider> getAccessTokenProviderClass(Configuration config) {
    return config.getClass(
        configPrefix + ACCESS_TOKEN_PROVIDER_IMPL_SUFFIX, null, AccessTokenProvider.class);
  }
1230272
@Override
    public void sawOpcode(int seen) {
        ImmutabilityType imType = null;

        try {
            stack.precomputation(this);

            switch (seen) {
                case Const.INVOKESTATIC:
                case Const.INVOKEINTERFACE:
                case Const.INVOKESPECIAL:
                case Const.INVOKEVIRTUAL: {
                    String className = getClassConstantOperand();
                    String methodName = getNameConstantOperand();
                    String signature = getSigConstantOperand();

                    MethodInfo mi = Statistics.getStatistics().getMethodStatistics(className, methodName, signature);
                    imType = mi.getImmutabilityType();

                    if (seen == Const.INVOKEINTERFACE) {
                        Integer collectionOffset = MODIFYING_METHODS.get(new QMethod(methodName, signature));
                        if ((collectionOffset != null) && CollectionUtils.isListSetMap(className) && (stack.getStackDepth() > collectionOffset.intValue())) {
                            OpcodeStack.Item item = stack.getStackItem(collectionOffset.intValue());
                            ImmutabilityType type = (ImmutabilityType) item.getUserValue();

                            if ((type == ImmutabilityType.IMMUTABLE)
                                    || ((type == ImmutabilityType.POSSIBLY_IMMUTABLE) && (reportedType != ImmutabilityType.POSSIBLY_IMMUTABLE))) {
                                bugReporter.reportBug(new BugInstance(this, BugType.MUC_MODIFYING_UNMODIFIABLE_COLLECTION.name(),
                                        (type == ImmutabilityType.IMMUTABLE) ? HIGH_PRIORITY : NORMAL_PRIORITY).addClass(this).addMethod(this)
                                                .addSourceLine(this));
                                if (type == ImmutabilityType.IMMUTABLE) {
                                    throw new StopOpcodeParsingException();
                                }

                                reportedType = type;
                            }
                        }
                    }
                }
                break;
                default:
                break;
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        } finally {
            stack.sawOpcode(this, seen);
            if ((imType != null) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                item.setUserValue(imType);
            }

        }
    }
1084653
Symbol accessMethod(Symbol sym,
                  DiagnosticPosition pos,
                  Symbol location,
                  Type site,
                  Name name,
                  boolean qualified,
                  List<Type> argtypes,
                  List<Type> typeargtypes) {
        return accessInternal(sym, pos, location, site, name, qualified, argtypes, typeargtypes, methodLogResolveHelper);
    }
1012337
private VariableDeclaration generateAccessorInterface(
      String className, TemplateElementNode node) {
    ImmutableList.Builder<MethodDeclaration> parameterMethods = ImmutableList.builder();
    for (TemplateParam param : node.getParams()) {
      parameterMethods.add(this.generateGetParamMethodForSoyElementClass(param, true));
    }

    ClassExpression soyElementClass =
        ClassExpression.create(ImmutableList.copyOf(parameterMethods.build()));
    VariableDeclaration classExpression =
        VariableDeclaration.builder(className)
            .setJsDoc(JsDoc.builder().addAnnotation("interface").build())
            .setRhs(soyElementClass)
            .build();
    return classExpression;
  }
1002540
public IActivation getGateActivationFromConfig(Map<String, Object> layerConfig)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
        Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
        if (!innerConfig.containsKey(conf.getLAYER_FIELD_INNER_ACTIVATION()))
            throw new InvalidKerasConfigurationException(
                    "Keras LSTM layer config missing " + conf.getLAYER_FIELD_INNER_ACTIVATION() + " field");
        return mapToIActivation((String) innerConfig.get(conf.getLAYER_FIELD_INNER_ACTIVATION()), conf);
    }
91333
@SafeVarargs
    public static Method getDeclaredMethod(final Class<?> cls, final String methodName, final Class<?>... parameterTypes) {
        Map<String, Map<Class<?>[], Method>> methodNamePool = classDeclaredMethodPool.get(cls);
        Map<Class<?>[], Method> methodPool = methodNamePool == null ? null : methodNamePool.get(methodName);

        Method method = null;

        if (methodPool != null) {
            method = methodPool.get(parameterTypes);
        }

        if (method == null) {
            method = internalGetDeclaredMethod(cls, methodName, parameterTypes);

            // SHOULD NOT set it true here.
            // if (method != null) {
            // method.setAccessible(true);
            // }

            if (method != null) {
                if (methodNamePool == null) {
                    methodNamePool = new ConcurrentHashMap<>();
                    classDeclaredMethodPool.put(cls, methodNamePool);
                }

                if (methodPool == null) {
                    methodPool = new ArrayHashMap<>(ConcurrentHashMap.class);
                    methodNamePool.put(methodName, methodPool);
                }

                methodPool.put(parameterTypes.clone(), method);
            }
        }

        return method;
    }
2519
protected String getCacheName(Invocation inv) {
		CacheName cacheName = inv.getMethod().getAnnotation(CacheName.class);
		if (cacheName != null) {
			return cacheName.value();
		}
		
		cacheName = inv.getController().getClass().getAnnotation(CacheName.class);
		if (cacheName == null) {
			throw new RuntimeException("EvictInterceptor need CacheName annotation in controller.");
		}
		
		return cacheName.value();
	}
48852
public ClassConstant getClass(String name)
  {
    for (int i = 0; i < _entries.size(); i++) {
      ConstantPoolEntry entry = _entries.get(i);

      if (! (entry instanceof ClassConstant))
        continue;

      ClassConstant classEntry = (ClassConstant) entry;

      if (classEntry.getName().equals(name))
        return classEntry;
    }

    return null;
  }
653818
public String getGetAccessor(TypedElement e, String prefix) {
		String capName = toFirstUpper(e.getName());
		if (prefix != null) {
			capName = toFirstUpper(prefix) + capName;
		}
		// Note that Boolean object type is not named with is prefix (according
		// to java beans spec)
		String result = isBooleanPrimitiveType(e) ? "is" + capName : "get" + ("Class".equals(capName) ? "Class_" : capName);
		return result;
	}
65524
public Class<?> getDispatcherClass (int invCode)
    {
        Object dispatcher = _dispatchers.get(invCode);
        return (dispatcher == null) ? null : dispatcher.getClass();
    }