mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
log
This commit is contained in:
@@ -25,6 +25,7 @@ import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.DummyHolder;
|
||||
@@ -42,8 +43,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import static com.intellij.openapi.util.text.StringUtil.join;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
*/
|
||||
@@ -182,7 +181,7 @@ public class PsiJavaParserFacadeImpl extends PsiParserFacadeImpl implements PsiJ
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiDocTag createDocTagFromText(@NotNull final String text) throws IncorrectOperationException {
|
||||
return createDocCommentFromText(join("/**\n", text, "\n */")).getTags()[0];
|
||||
return createDocCommentFromText(StringUtil.join("/**\n", text, "\n */")).getTags()[0];
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -194,7 +193,7 @@ public class PsiJavaParserFacadeImpl extends PsiParserFacadeImpl implements PsiJ
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiDocComment createDocCommentFromText(@NotNull final String text) throws IncorrectOperationException {
|
||||
final PsiMethod method = createMethodFromText(join(text, "void m();"), null);
|
||||
final PsiMethod method = createMethodFromText(StringUtil.join(text, "void m();"), null);
|
||||
final PsiDocComment comment = method.getDocComment();
|
||||
assert comment != null : text;
|
||||
return comment;
|
||||
@@ -209,7 +208,7 @@ public class PsiJavaParserFacadeImpl extends PsiParserFacadeImpl implements PsiJ
|
||||
@NotNull
|
||||
@Override
|
||||
public PsiClass createClassFromText(@NotNull final String body, final PsiElement context) throws IncorrectOperationException {
|
||||
final PsiJavaFile aFile = createDummyJavaFile(join("class _Dummy_ { ", body, " }"));
|
||||
final PsiJavaFile aFile = createDummyJavaFile(StringUtil.join("class _Dummy_ { ", body, " }"));
|
||||
final PsiClass[] classes = aFile.getClasses();
|
||||
if (classes.length != 1) {
|
||||
throw new IncorrectOperationException("Incorrect class \"" + body + "\".");
|
||||
@@ -395,11 +394,12 @@ public class PsiJavaParserFacadeImpl extends PsiParserFacadeImpl implements PsiJ
|
||||
@Override
|
||||
public PsiCatchSection createCatchSection(@NotNull final PsiClassType exceptionType, @NotNull final String exceptionName,
|
||||
final PsiElement context) throws IncorrectOperationException {
|
||||
final String text = join("catch (", exceptionType.getCanonicalText(), " ", exceptionName, ") {}");
|
||||
final String text = StringUtil
|
||||
.join("catch (", exceptionType.getCanonicalText(), " ", exceptionName, ") {}");
|
||||
final DummyHolder holder = DummyHolderFactory.createHolder(myManager, new JavaDummyElement(text, CATCH_SECTION, false), context);
|
||||
final PsiElement element = SourceTreeToPsiMap.treeElementToPsi(holder.getTreeElement().getFirstChildNode());
|
||||
if (!(element instanceof PsiCatchSection)) {
|
||||
throw new IncorrectOperationException("Incorrect catch section \"" + text + "\".");
|
||||
throw new IncorrectOperationException("Incorrect catch section '" + text + "'. Parsed element: "+element);
|
||||
}
|
||||
setupCatchBlock(exceptionName, context, (PsiCatchSection)element);
|
||||
return (PsiCatchSection)myManager.getCodeStyleManager().reformat(element);
|
||||
|
||||
Reference in New Issue
Block a user