Returns a {@link StaticImports} if the given import is a static single-type import. Returns
{@code null} otherwise, e.g. because the import is non-static, or an on-demand import, or
statically imports a field or method.
177861
@Nullable
  public static StaticImportInfo tryCreate(ImportTree tree, VisitorState state) {
    if (!tree.isStatic()) {
      return null;
    }
    if (!(tree.getQualifiedIdentifier() instanceof JCTree.JCFieldAccess)) {
      return null;
    }
    JCTree.JCFieldAccess access = (JCTree.JCFieldAccess) tree.getQualifiedIdentifier();
    Name identifier = access.getIdentifier();
    if (identifier.contentEquals("*")) {
      // Java doesn't allow non-canonical types inside wildcard imports,
      // so there's nothing to do here.
      return null;
    }
    Symbol importedType = ASTHelpers.getSymbol(access.getExpression());
    if (importedType == null) {
      return null;
    }

    Types types = state.getTypes();

    Type canonicalType = types.erasure(importedType.asType());
    if (canonicalType == null) {
      return null;
    }
    Symbol.TypeSymbol baseType;
    {
      Symbol sym = ASTHelpers.getSymbol(access.getExpression());
      if (!(sym instanceof Symbol.TypeSymbol)) {
        return null;
      }
      baseType = (Symbol.TypeSymbol) sym;
    }
    Symbol.PackageSymbol pkgSym =
        ((JCTree.JCCompilationUnit) state.getPath().getCompilationUnit()).packge;
    ImmutableSet<Symbol> members = lookup(baseType, baseType, identifier, types, pkgSym);
    if (members.isEmpty()) {
      return null;
    }

    /* Find the most specific subtype that defines one of the members that is imported.
     * TODO(gak): we should instead find the most specific subtype with a member that is _used_ */
    Type canonicalOwner = null;
    for (Symbol member : members) {
      Type owner = types.erasure(member.owner.type);
      if (canonicalOwner == null || types.isSubtype(owner, canonicalOwner)) {
        canonicalOwner = owner;
      }
    }

    if (canonicalOwner == null) {
      return null;
    }

    if (members.size() == 1 && getOnlyElement(members) instanceof ClassSymbol) {
      return StaticImportInfo.create(access.toString(), getOnlyElement(members).toString());
    }
    return StaticImportInfo.create(
        access.getExpression().toString(),
        canonicalOwner.toString(),
        identifier.toString(),
        members);
  }
710414
function isImportedReference(node) {
                var declaration = resolver.getReferencedImportDeclaration(node);
                return declaration && (declaration.kind === 231 /* ImportClause */ || declaration.kind === 234 /* ImportSpecifier */);
            }
411125
protected Variable getImportedVar(final String name) throws UtilEvalError {
        Variable var = null;
        // Try object imports
        for (final Object object : this.importedObjects) {
            final Invocable field = Reflect.resolveJavaField(object.getClass(),
                    name, false/* onlyStatic */);
            if (field != null)
                var = this.createVariable(name, field.getReturnType(), new LHS(object, field));
            else if (this.isClass) {
                // try find inherited loose-typed instance fields
                Class<?> supr = object.getClass();
                while (Reflect.isGeneratedClass(supr = supr.getSuperclass())) {
                    This ths = Reflect.getClassInstanceThis(object, supr.getSimpleName());
                    if (null != ths && null != (var = ths.getNameSpace().variables.get(name)))
                        break;
                }
            }
            if (null != var) {
                this.variables.put(name, var);
                return var;
            }
        }
        // Try static imports
        for (final Class<?> stat : this.importedStatic) {
            final Invocable field = Reflect.resolveJavaField(stat,
                    name, true/* onlyStatic */);
            if (field != null) {
                var = this.createVariable(name, field.getReturnType(),
                        new LHS(field));
                this.variables.put(name, var);
                return var;
            }
        }
        return null;
    }
21869
static public CommPortIdentifier getPortIdentifier(CommPort p) throws NoSuchPortException {
        LOGGER.fine("CommPortIdentifier:getPortIdentifier(CommPort)");

        CommPortIdentifier c;
        synchronized (Sync) {
            c = CommPortIndex;
            while (c != null && c.commPort != p) {
                c = c.next;
            }
        }
        if (c != null) {
            return (c);
        }

        LOGGER.fine("not found!" + p.getName());
        throw new NoSuchPortException();
    }
815162
@Nullable
	public Import find(@Nonnull final String typeName) {
		Check.notEmpty(typeName, "typeName");
		Import ret = null;
		final Type type = new Type(typeName);
		for (final Import imp : imports) {
			if (imp.getType().getName().equals(type.getName())) {
				ret = imp;
				break;
			}
		}
		if (ret == null) {
			final Type javaLangType = Type.evaluateJavaLangType(typeName);
			if (javaLangType != null) {
				ret = Import.of(javaLangType);
			}
		}
		return ret;
	}
184292
private static void setImportInfo(Catalog catalog, ImportType importType) {
        if (importType == null) {
            return;
        }
        List<String> streamList = new ArrayList<>();
        List<ImportConfigurationType> kafkaConfigs = new ArrayList<>();

        for (ImportConfigurationType importConfiguration : importType.getConfiguration()) {

            boolean connectorEnabled = importConfiguration.isEnabled();
            if (!connectorEnabled) {
                continue;
            }

            if (importConfiguration.getType().equals(ServerImportEnum.KAFKA)) {
                kafkaConfigs.add(importConfiguration);
            }

            if (!streamList.contains(importConfiguration.getModule())) {
                streamList.add(importConfiguration.getModule());
            }

            buildImportProcessorConfiguration(importConfiguration, true);
        }
        validateKafkaConfig(kafkaConfigs);
    }
1000800
protected BshMethod getImportedMethod(final String name, final Class<?>[] sig)
            throws UtilEvalError {
        // Try object imports
        for (final Object object : this.importedObjects) {
            final Invocable method = Reflect.resolveJavaMethod(
                   object.getClass(), name, sig, false/* onlyStatic */);
            if (method != null)
                return new BshMethod(method, object);
        }
        // Try static imports
        for (final Class<?> stat : this.importedStatic) {
            final Invocable method = Reflect.resolveJavaMethod(
                    stat, name, sig, true/* onlyStatic */);
            if (method != null)
                return new BshMethod(method, null/* object */);
        }
        return null;
    }
34909
public java.util.List<String> getImportTablesCompleted() {
        if (importTablesCompleted == null) {
            importTablesCompleted = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return importTablesCompleted;
    }
91087
@Nullable
  static ClientTransport getTransportFromPickResult(PickResult result, boolean isWaitForReady) {
    final ClientTransport transport;
    Subchannel subchannel = result.getSubchannel();
    if (subchannel != null) {
      transport = ((AbstractSubchannel) subchannel).obtainActiveTransport();
    } else {
      transport = null;
    }
    if (transport != null) {
      final ClientStreamTracer.Factory streamTracerFactory = result.getStreamTracerFactory();
      if (streamTracerFactory == null) {
        return transport;
      }
      return new ClientTransport() {
        @Override
        public ClientStream newStream(
            MethodDescriptor<?, ?> method, Metadata headers, CallOptions callOptions) {
          return transport.newStream(
              method, headers, callOptions.withStreamTracerFactory(streamTracerFactory));
        }

        @Override
        public void ping(PingCallback callback, Executor executor) {
          transport.ping(callback, executor);
        }

        @Override
        public InternalLogId getLogId() {
          return transport.getLogId();
        }

        @Override
        public ListenableFuture<SocketStats> getStats() {
          return transport.getStats();
        }
      };
    }
    if (!result.getStatus().isOk()) {
      if (result.isDrop()) {
        return new FailingClientTransport(result.getStatus(), RpcProgress.DROPPED);
      }
      if (!isWaitForReady) {
        return new FailingClientTransport(result.getStatus(), RpcProgress.PROCESSED);
      }
    }
    return null;
  }
911349
public com.google.api.ads.admanager.axis.v201808.DateTime getImportDateTime() {
        return importDateTime;
    }
631818
public void importStatic(final Class<?> clas) {
        this.importedStatic.remove(clas);
        this.importedStatic.add(0, clas);
        this.nameSpaceChanged();
    }
167623
@Requires({
    "processingEnv != null",
    "element != null"
  })
  @Ensures("result != null")
  public static Set<String> getImportNames(ProcessingEnvironment processingEnv,
      Element element) {
    Trees treeUtils = Trees.instance(processingEnv);
    if (treeUtils == null) {
      return Collections.emptySet();
    }

    TreePath path = treeUtils.getPath(element);
    if (path == null) {
      return Collections.emptySet();
    }

    CompilationUnitTree unitTree = path.getCompilationUnit();

    HashSet<String> importNames = new HashSet<String>();
    for (ImportTree importTree : unitTree.getImports()) {
      StringBuilder buffer = new StringBuilder();
      if (importTree.isStatic()) {
        buffer.append("static ");
      }
      /* TODO(lenh): Roll our own toString()? */
      buffer.append(importTree.getQualifiedIdentifier().toString());
      importNames.add(buffer.toString());
    }

    return importNames;
  }
528363
public PortletType<PortletAppType<T>> getOrCreatePortlet()
   {
      List<Node> nodeList = childNode.get("portlet");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new PortletTypeImpl<PortletAppType<T>>(this, "portlet", childNode, nodeList.get(0));
      }
      return createPortlet();
   }
198018
private void getImportResource() throws CmsVfsException {

        // get the import resource
        m_importResource = new File(m_importFolderName);
        // check if this is a folder or a ZIP file
        if (m_importResource.isFile()) {
            try {
                m_zipStreamIn = new ZipInputStream(new FileInputStream(m_importResource));
            } catch (IOException e) {
                // if file but no ZIP file throw an exception
                throw new CmsVfsException(
                    Messages.get().container(Messages.ERR_NO_ZIPFILE_1, m_importResource.getName()),
                    e);
            }
        }
    }
716691
@SuppressWarnings("resource")
    private boolean importModules() {

        boolean result = true;

        try {
            m_logStream.println("Checking module dependencies.");
            Multimap<String, String> dependencies = HashMultimap.create();
            Set<String> unsortedModules = Sets.newHashSet(m_modulesToExport);
            for (String module : m_modulesToExport) {
                String manifestPath = CmsStringUtil.joinPaths(
                    m_currentConfiguration.getModulesPath(),
                    module,
                    m_currentConfiguration.getResourcesSubFolder(),
                    "manifest.xml");
                Document doc = CmsXmlUtils.unmarshalHelper(
                    CmsFileUtil.readFully(new FileInputStream(manifestPath)),
                    new CmsXmlEntityResolver(null));

                List<?> depNodes = doc.getRootElement().selectNodes("//dependencies/dependency/@name");
                for (Object nodeObj : depNodes) {
                    Node node = ((Node)nodeObj);
                    String dependency = node.getText();
                    if (m_modulesToExport.contains(dependency)) {
                        // we can only handle dependencies between selected modules
                        // and just have to assume that other dependencies are fulfilled
                        dependencies.put(module, dependency);
                    }
                }
            }
            List<String> sortedModules = Lists.newArrayList();
            // if there are no cycles, this loop will find one element on each iteration
            for (int i = 0; i < m_modulesToExport.size(); i++) {
                String nextModule = null;
                for (String key : unsortedModules) {
                    if (dependencies.get(key).isEmpty()) {
                        nextModule = key;
                        break;
                    }
                }
                if (nextModule != null) {
                    sortedModules.add(nextModule);
                    unsortedModules.remove(nextModule);
                    for (String key : Sets.newHashSet(dependencies.keySet())) { // copy key set to avoid concurrent modification exception
                        dependencies.get(key).remove(nextModule);
                    }
                }
            }
            m_logStream.println("Modules sorted by dependencies: " + sortedModules);
            for (String moduleName : sortedModules) {
                String dir = CmsStringUtil.joinPaths(
                    m_currentConfiguration.getModulesPath(),
                    moduleName,
                    m_currentConfiguration.getResourcesSubFolder());
                File dirEntry = new File(dir);
                if (!dirEntry.exists()) {
                    continue;
                }
                try {
                    m_logStream.println("Creating temp file for module " + moduleName);
                    File outputFile = File.createTempFile(moduleName + "-", ".zip");
                    FileOutputStream fos = new FileOutputStream(outputFile);
                    m_logStream.println("Zipping module structure to " + outputFile.getAbsolutePath());
                    zipRfsFolder(dirEntry, fos);
                    result &= importModule(outputFile);
                    outputFile.delete();
                } catch (Exception e) {
                    LOG.error(e.getLocalizedMessage(), e);
                    e.printStackTrace(m_logStream);
                    result = false;
                }
            }
        } catch (Exception e) {

            LOG.error(e.getLocalizedMessage(), e);
            m_logStream.println("Unable to check dependencies for modules, giving up.");
            e.printStackTrace(m_logStream);
            result = false;
        }
        return result;
    }
297685
public boolean validateImportType(ImportType importType, DiagnosticChain diagnostics, Map<Object, Object> context) {
		return validate_EveryDefaultConstraint(importType, diagnostics, context);
	}
21970
static OutputType getOutputComponentType(Class<? extends CommandOutput> commandOutputClass) {

        ClassTypeInformation<? extends CommandOutput> classTypeInformation = ClassTypeInformation.from(commandOutputClass);

        TypeInformation<?> superTypeInformation = classTypeInformation.getSuperTypeInformation(CommandOutput.class);

        if (superTypeInformation == null) {
            return null;
        }

        List<TypeInformation<?>> typeArguments = superTypeInformation.getTypeArguments();

        return new OutputType(commandOutputClass, typeArguments.get(2), false) {
            @Override
            public ResolvableType withCodec(RedisCodec<?, ?> codec) {

                TypeInformation<?> typeInformation = ClassTypeInformation.from(codec.getClass());

                ResolvableType resolvableType = ResolvableType.forType(commandOutputClass, new CodecVariableTypeResolver(
                        typeInformation));

                while (!resolvableType.getRawClass().equals(CommandOutput.class)) {
                    resolvableType = resolvableType.getSuperType();
                }

                return resolvableType.getGeneric(2);
            }
        };
    }