JavaClassReference (int refIndex, @NotNull String subRefText, @NotNull TextRange textRange, boolean staticImport) { return new JavaClassReference(this, textRange, refIndex, subRefText, staticImport) { @Override public boolean isSoft() { return true; } @Override @NotNull public JavaResolveResult advancedResolve(final boolean incompleteCode) { if (isPrimitiveType) { return new CandidateInfo(element, PsiSubstitutor.EMPTY, false, false, element); } return super.advancedResolve(incompleteCode); } @Override public void processVariants(@NotNull final PsiScopeProcessor processor) { if (processor instanceof JavaCompletionProcessor) { ((JavaCompletionProcessor)processor).setCompletionElements(getVariants()); } else { super.processVariants(processor); } } @Override public Object @NotNull [] getVariants() { final Object[] variants = super.getVariants(); if (myIndex == 0) { return ArrayUtil.mergeArrays(variants, PRIMITIVES, ArrayUtil.OBJECT_ARRAY_FACTORY); } return variants; } }; }