package de.plushnikov.intellij.lombok.util;

import com.intellij.psi.PsiType;

/**
 * Gets all of primitive types as PsiType
 * Attention: IntelliJ 11 returns PsiPrimitiveType instead of PsiType, so we need a facade here.
 * @author Plushnikov Michail
 */
public class PsiPrimitiveTypeUtil10Impl implements PsiPrimitiveTypeUtil {
  @Override
  public PsiType getBooleanType() {
    return PsiType.BOOLEAN;
  }

  @Override
  public PsiType getNullType() {
    return PsiType.NULL;
  }

  @Override
  public PsiType getVoidType() {
    return PsiType.VOID;
  }

  @Override
  public PsiType getByteType() {
    return PsiType.BYTE;
  }

  @Override
  public PsiType getCharType() {
    return PsiType.CHAR;
  }

  @Override
  public PsiType getFloatType() {
    return PsiType.FLOAT;
  }

  @Override
  public PsiType getDoubleType() {
    return PsiType.DOUBLE;
  }

  @Override
  public PsiType getShortType() {
    return PsiType.SHORT;
  }

  @Override
  public PsiType getIntType() {
    return PsiType.INT;
  }

  @Override
  public PsiType getLongType() {
    return PsiType.LONG;
  }
}

package de.plushnikov.intellij.lombok.util;

import com.intellij.psi.PsiKeyword;
import com.intellij.psi.PsiType;
import com.intellij.psi.impl.PsiElementFactoryImpl;

/**
 * Gets all of primitive types as PsiType
 * Attention: IntelliJ 11 returns PsiPrimitiveType instead of PsiType, so we need a facade here.
 * Before build 103.72 is was PsiType and after this build PsiPrimitiveType
 *
 * @author Plushnikov Michail
 */
public class PsiPrimitiveTypeUtil10Impl implements PsiPrimitiveTypeUtil {
  @Override
  public PsiType getBooleanType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.BOOLEAN);
  }

  @Override
  public PsiType getNullType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.NULL);
  }

  @Override
  public PsiType getVoidType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.VOID);
  }

  @Override
  public PsiType getByteType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.BYTE);
  }

  @Override
  public PsiType getCharType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.CHAR);
  }

  @Override
  public PsiType getFloatType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.FLOAT);
  }

  @Override
  public PsiType getDoubleType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.DOUBLE);
  }

  @Override
  public PsiType getShortType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.SHORT);
  }

  @Override
  public PsiType getIntType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.INT);
  }

  @Override
  public PsiType getLongType() {
    return PsiElementFactoryImpl.getPrimitiveType(PsiKeyword.LONG);
  }
}

Fix incompatibility between IntelliJ<=10.0.2 and >10.0.2 (build 103.72)
Fix incompatibility between IntelliJ<=10.0.2 and >10.0.2 (build 103.72)

git-svn-id: 0427e1078a53407f977bcf4fee640b7bafc12131@136 9796b3e4-e716-bb5d-d578-ca2f8dc3330c
