Package com.intellij.pom.java

Examples of com.intellij.pom.java.LanguageLevel


                                           @NonNls List<String> commandLine,
                                           @NotNull String outputPath,
                                           @NotNull Sdk jdk,
                                           boolean isAnnotationProcessingMode) throws IOException {

    LanguageLevel languageLevel = chunk.getLanguageLevel();
    CompilerUtil.addSourceCommandLineSwitch(jdk, languageLevel, commandLine);

    commandLine.add("-verbose");

    final String bootCp = chunk.getCompilationBootClasspath();
View Full Code Here


                                           @NonNls List<String> commandLine,
                                           @NotNull String outputPath,
                                           @NotNull Sdk jdk,
                                           boolean isAnnotationProcessingMode) throws IOException {

    LanguageLevel languageLevel = chunk.getLanguageLevel();
    CompilerUtil.addSourceCommandLineSwitch(jdk, languageLevel, commandLine);

    commandLine.add("-verbose");

    final String bootCp = chunk.getCompilationBootClasspath();
View Full Code Here

   * @return the class type, or null if the current language level does not support autoboxing or
   *         it was not possible to resolve the reference to the class.
   */
  @Nullable
  public PsiClassType getBoxedType(PsiElement context) {
    LanguageLevel languageLevel = PsiUtil.getLanguageLevel(context);
    if (!languageLevel.hasEnumKeywordAndAutoboxing()) return null;
    final String boxedQName = getBoxedTypeName();

    //[ven]previous call returns null for NULL, VOID
    if (boxedQName == null) return null;

View Full Code Here

    if (toClass == null) return false;
    if (toClass instanceof PsiTypeParameter) return isNarrowingReferenceConversionAllowed(fromType, obtainSafeSuperType((PsiTypeParameter)toClass));
    //Done with type parameters

    PsiManager manager = fromClass.getManager();
    final LanguageLevel languageLevel = toClassType.getLanguageLevel();
    if (!fromClass.isInterface()) {
      if (toClass.isInterface()) {
        return !fromClass.hasModifierProperty(PsiModifier.FINAL) &&
               checkSuperTypesWithDifferentTypeArguments(toResult, fromClass, manager,
                                                         fromResult.getSubstitutor(),
                                                         new THashSet<PsiClass>(),
                                                         languageLevel);
      }
      else {
        if (manager.areElementsEquivalent(fromClass, toClass)) {
          return !areDistinctParameterTypes(fromClassType, toClassType);
        }

        if (toClass.isInheritor(fromClass, true)) {
          return checkSuperTypesWithDifferentTypeArguments(fromResult, toClass, manager, toResult.getSubstitutor(), new THashSet<PsiClass>(),
                                                           languageLevel);
        }
        else if (fromClass.isInheritor(toClass, true)) {
          return checkSuperTypesWithDifferentTypeArguments(toResult, fromClass, manager, fromResult.getSubstitutor(), new THashSet<PsiClass>(),
                                                           languageLevel);
        }

        return false;
      }
    }
    else {
      if (!toClass.isInterface()) {
        if (!toClass.hasModifierProperty(PsiModifier.FINAL)) {
          return checkSuperTypesWithDifferentTypeArguments(fromResult, toClass, manager, toResult.getSubstitutor(), new THashSet<PsiClass>(),
                                                           languageLevel);
        }
        else {
          if (!toClass.isInheritor(fromClass, true)) return false;
          PsiSubstitutor toSubstitutor = getSuperClassSubstitutor(fromClass, toClass, toResult.getSubstitutor());
          return !areDistinctArgumentTypes(fromClass, fromResult.getSubstitutor(), toSubstitutor);
        }
      }
      else {
        if (languageLevel.compareTo(LanguageLevel.JDK_1_5) < 0) {
          //In jls2 check for method in both interfaces with the same signature but different return types.
          Collection<HierarchicalMethodSignature> fromClassMethodSignatures = fromClass.getVisibleSignatures();
          Collection<HierarchicalMethodSignature> toClassMethodSignatures = toClass.getVisibleSignatures();

          for (HierarchicalMethodSignature fromMethodSignature : fromClassMethodSignatures) {
View Full Code Here

          final PsiSubstitutor substitutor;
          if (resolve instanceof PsiTypeParameter) {
            final PsiClassType parameterType = resolve.getManager().getElementFactory().createType((PsiTypeParameter) resolve);
            final PsiType superType = result.getSubstitutor().substitute(parameterType);
            if (superType instanceof PsiArrayType) {
              LanguageLevel languageLevel = getLanguageLevel(accessObject);
              return resolve.getManager().getElementFactory().getArrayClassType(((PsiArrayType)superType).getComponentType(), languageLevel).resolveGenerics();
            }
            else if (superType instanceof PsiClassType) {
              final PsiClassType type = (PsiClassType)superType;
              substitutor = type.resolveGenerics().getSubstitutor();
View Full Code Here

    return getApplicabilityLevel(method, substitutorForMethod, argList,getLanguageLevel(method)) != ApplicabilityLevel.NOT_APPLICABLE;
  }

  public static int getApplicabilityLevel(PsiMethod method, PsiSubstitutor substitutorForMethod, PsiExpressionList argList) {
    PsiExpression[] args = argList.getExpressions();
    final LanguageLevel languageLevel = getLanguageLevel(argList);
    return getApplicabilityLevel(method, substitutorForMethod, args, languageLevel);
  }
View Full Code Here

TOP

Related Classes of com.intellij.pom.java.LanguageLevel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.