congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
OrganizedImports.collectSuperTypeImports
Code IndexAdd Tabnine to your IDE (free)

How to use
collectSuperTypeImports
method
in
com.oracle.truffle.dsl.processor.java.transform.OrganizedImports

Best Java code snippets using com.oracle.truffle.dsl.processor.java.transform.OrganizedImports.collectSuperTypeImports (Showing top 2 results out of 315)

origin: com.oracle.truffle/truffle-dsl-processor

private boolean needsImport(Element enclosed, TypeMirror importType) {
  String importPackagName = getPackageName(importType);
  TypeElement enclosedElement = findNearestEnclosingType(enclosed);
  if (importPackagName == null) {
    return false;
  } else if (importPackagName.equals("java.lang")) {
    return false;
  } else if (importPackagName.equals(getPackageName(topLevelClass)) && ElementUtils.isTopLevelClass(importType)) {
    return false; // same package name -> no import
  }
  String enclosedElementId = ElementUtils.getUniqueIdentifier(enclosedElement.asType());
  Set<String> autoImportedTypes = autoImportCache.get(enclosedElementId);
  if (autoImportedTypes == null) {
    List<Element> elements = ElementUtils.getElementHierarchy(enclosedElement);
    autoImportedTypes = new HashSet<>();
    for (Element element : elements) {
      if (element.getKind().isClass()) {
        collectSuperTypeImports((TypeElement) element, autoImportedTypes);
        collectInnerTypeImports((TypeElement) element, autoImportedTypes);
      }
    }
    autoImportCache.put(enclosedElementId, autoImportedTypes);
  }
  String qualifiedName = getQualifiedName(importType);
  if (autoImportedTypes.contains(qualifiedName)) {
    return false;
  }
  return true;
}
origin: com.oracle/truffle-dsl-processor

private boolean needsImport(Element enclosed, TypeMirror importType) {
  String importPackagName = getPackageName(importType);
  TypeElement enclosedElement = findNearestEnclosingType(enclosed);
  if (importPackagName == null) {
    return false;
  } else if (importPackagName.equals("java.lang")) {
    return false;
  } else if (importPackagName.equals(getPackageName(topLevelClass)) && ElementUtils.isTopLevelClass(importType)) {
    return false; // same package name -> no import
  }
  String enclosedElementId = ElementUtils.getUniqueIdentifier(enclosedElement.asType());
  Set<String> autoImportedTypes = autoImportCache.get(enclosedElementId);
  if (autoImportedTypes == null) {
    List<Element> elements = ElementUtils.getElementHierarchy(enclosedElement);
    autoImportedTypes = new HashSet<>();
    for (Element element : elements) {
      if (element.getKind().isClass()) {
        collectSuperTypeImports((TypeElement) element, autoImportedTypes);
        collectInnerTypeImports((TypeElement) element, autoImportedTypes);
      }
    }
    autoImportCache.put(enclosedElementId, autoImportedTypes);
  }
  String qualifiedName = getQualifiedName(importType);
  if (autoImportedTypes.contains(qualifiedName)) {
    return false;
  }
  return true;
}
com.oracle.truffle.dsl.processor.java.transformOrganizedImportscollectSuperTypeImports

Popular methods of OrganizedImports

  • <init>
  • collectInnerTypeImports
  • createDeclaredTypeName
  • createStaticFieldReference
  • createStaticMethodReference
  • createStaticReference
  • createTypeReference
  • createWildcardName
  • generateImports
  • organize
  • organizeImpl
  • isTypeVariableDeclared
  • organizeImpl,
  • isTypeVariableDeclared

Popular in Java

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • putExtra (Intent)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now