本文整理了Java中com.intellij.openapi.diagnostic.Logger.assertTrue()
方法的一些代码示例,展示了Logger.assertTrue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.assertTrue()
方法的具体详情如下:
包路径:com.intellij.openapi.diagnostic.Logger
类名称:Logger
方法名:assertTrue
暂无
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
private void perform(@NotNull List<String> packagesToImport, @NotNull PsiFile file, @Nullable Editor editor) {
LOG.assertTrue(editor != null || packagesToImport.size() == 1, "Cannot invoke fix with ambiguous imports on null editor");
if (packagesToImport.size() > 1 && editor != null) {
JBList list = new JBList(packagesToImport);
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@NotNull
public static GoImportSpec addImportSpec(@NotNull GoImportDeclaration declaration, @NotNull String packagePath, @Nullable String alias) {
PsiElement rParen = declaration.getRparen();
if (rParen == null) {
GoImportDeclaration newDeclaration = GoElementFactory.createEmptyImportDeclaration(declaration.getProject());
for (GoImportSpec spec : declaration.getImportSpecList()) {
newDeclaration.addImportSpec(spec.getPath(), spec.getAlias());
}
declaration = (GoImportDeclaration)declaration.replace(newDeclaration);
LOG.assertTrue(declaration.getRparen() != null);
return declaration.addImportSpec(packagePath, alias);
}
declaration.addBefore(GoElementFactory.createNewLine(declaration.getProject()), rParen);
GoImportSpec newImportSpace = GoElementFactory.createImportSpec(declaration.getProject(), packagePath, alias);
GoImportSpec spec = (GoImportSpec)declaration.addBefore(newImportSpace, rParen);
declaration.addBefore(GoElementFactory.createNewLine(declaration.getProject()), rParen);
return spec;
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
public boolean execute() {
Logger.getInstance(getClass()).assertTrue(!ApplicationManager.getApplication().isDispatchThread(),
"It's bad idea to run external tool on EDT");
Logger.getInstance(getClass()).assertTrue(myProcessHandler == null, "Process has already run with this executor instance");
Ref<Boolean> result = Ref.create(false);
GeneralCommandLine commandLine = null;
代码示例来源:origin: ballerina-platform/ballerina-lang
public boolean execute() {
Logger.getInstance(getClass()).assertTrue(!ApplicationManager.getApplication().isDispatchThread(),
"It's bad idea to run external tool on EDT");
Logger.getInstance(getClass()).assertTrue(myProcessHandler == null,
"Process has already run with this executor instance");
Ref<Boolean> result = Ref.create(false);
代码示例来源:origin: halirutan/Mathematica-IntelliJ-Plugin
/**
* Sets a new language level for the underlying module. Note, that you need a writable instance of
* {@link MathematicaLanguageLevelModuleExtension}.
* @param languageLevel New language level
*/
@Override
public void setMathematicaLanguageLevel(MathematicaLanguageLevel languageLevel) {
LOG.assertTrue(myWritable, "Writable model can be retrieved from writable ModifiableRootModel");
myState = languageLevel;
}
代码示例来源:origin: JetBrains/Grammar-Kit
protected void refreshElements(@NotNull PsiElement[] elements) {
LOG.assertTrue(elements.length == 1 && elements[0] instanceof BnfRule);
myRule = (BnfRule)elements[0];
}
代码示例来源:origin: JetBrains/jediterm
public Alarm(@NotNull ThreadToUse threadToUse) {
this(threadToUse, null);
LOG.assertTrue(threadToUse != ThreadToUse.POOLED_THREAD && threadToUse != ThreadToUse.OWN_THREAD,
"You must provide parent Disposable for ThreadToUse.POOLED_THREAD and ThreadToUse.OWN_THREAD Alarm");
}
代码示例来源:origin: Camelcade/Perl5-IDEA
public synchronized void setRoot(@NotNull VirtualFile root, @NotNull JpsModuleSourceRootType type) {
LOG.assertTrue(myIsWritable, "Obtain modifiableModel first");
LOG.assertTrue(type instanceof PerlSourceRootType, type + " is not a PerlSourceRootType");
myRoots.put(root, (PerlSourceRootType)type);
myModificationTracker++;
}
代码示例来源:origin: Camelcade/Perl5-IDEA
public synchronized void removeRoot(@NotNull VirtualFile root) {
LOG.assertTrue(myIsWritable, "Obtain modifiableModel first");
myRoots.remove(root);
myModificationTracker++;
}
代码示例来源:origin: com.github.adedayo.intellij.sdk/java-psi-api
@NotNull
public static PsiWildcardType createExtends(@NotNull PsiManager manager, @NotNull PsiType bound) {
LOG.assertTrue(!(bound instanceof PsiWildcardType));
LOG.assertTrue(bound != PsiType.NULL);
return new PsiWildcardType(manager, true, bound);
}
代码示例来源:origin: com.github.adedayo.intellij.sdk/java-psi-api
@NotNull
public static PsiWildcardType createSuper(@NotNull PsiManager manager, @NotNull PsiType bound) {
LOG.assertTrue(!(bound instanceof PsiWildcardType));
LOG.assertTrue(bound != PsiType.NULL);
return new PsiWildcardType(manager, false, bound);
}
代码示例来源:origin: com.github.adedayo.intellij.sdk/java-psi-api
private static void addAllIfNotPresent(@NotNull Collection<String> collection, @NotNull String... annotations) {
for (String annotation : annotations) {
LOG.assertTrue(annotation != null);
if (!collection.contains(annotation)) {
collection.add(annotation);
}
}
}
代码示例来源:origin: JetBrains/jediterm
@Contract("false->fail") // wrong, but avoid quite a few warnings in the code
public boolean assertTrue(boolean value) {
return value || assertTrue(false, null);
}
代码示例来源:origin: com.github.adedayo.intellij.sdk/java-psi-api
public void setDefaultNullable(@NotNull String defaultNullable) {
LOG.assertTrue(getNullables().contains(defaultNullable));
myDefaultNullable = defaultNullable;
}
代码示例来源:origin: JetBrains/Grammar-Kit
public static BnfAttr createAttributeFromText(Project project, String text) {
PsiElement firstChild = createFile(project, "{\n " + text + "\n}").getFirstChild();
LOG.assertTrue(firstChild instanceof BnfAttrs, text);
//noinspection ConstantConditions
List<BnfAttr> attrList = ((BnfAttrs) firstChild).getAttrList();
LOG.assertTrue(attrList.size() == 1, text);
return attrList.get(0);
}
代码示例来源:origin: com.github.adedayo.intellij.sdk/java-psi-api
@NotNull
private static PsiType unbox(@NotNull PsiType type) {
if (type instanceof PsiPrimitiveType) return type;
if (type instanceof PsiClassType) {
type = PsiPrimitiveType.getUnboxedType(type);
LOG.assertTrue(type != null);
return type;
}
LOG.error("Invalid type for unboxing "+type);
return type;
}
代码示例来源:origin: JetBrains/Grammar-Kit
public static BnfRule createRuleFromText(Project project, String text) {
PsiElement firstChild = createFile(project, text).getFirstChild();
LOG.assertTrue(firstChild instanceof BnfRule, text);
//noinspection ConstantConditions
return (BnfRule)firstChild;
}
代码示例来源:origin: BashSupport/BashSupport
private UnescapingPsiBuilder(PsiBuilderImpl builder, TextPreprocessor textProcessor, CharSequence processedText) {
super(builder);
this.textProcessor = textProcessor;
this.processedText = processedText;
LOG.assertTrue(myDelegate instanceof PsiBuilderImpl);
myBuilderDelegate = ((PsiBuilderImpl) myDelegate);
myLexer = myBuilderDelegate.getLexer();
initShrunkSequence();
}
代码示例来源:origin: com.github.adedayo.intellij.sdk/java-psi-api
private static void annotate(final PsiModifierListOwner listOwner, final PsiAnnotation annotation)
throws IncorrectOperationException {
final PsiModifierList modifierList = listOwner.getModifierList();
LOG.assertTrue(modifierList != null);
modifierList.addAfter(annotation, null);
}
代码示例来源:origin: SonarSource/sonarlint-intellij
@Override public void render(TreeCellRenderer renderer) {
renderer.setIcon(getIcon());
renderer.append(file.getName());
LOGGER.assertTrue(getIssueCount() > 0);
String issues;
if (getIssueCount() > 1) {
issues = " issues)";
} else {
issues = " issue)";
}
renderer.append(spaceAndThinSpace() + "(" + getIssueCount() + issues, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
}
}
内容来源于网络,如有侵权,请联系作者删除!