diff --git a/java/java-impl/src/com/intellij/psi/impl/source/PsiExpressionCodeFragmentImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/PsiExpressionCodeFragmentImpl.java index 299abf842186..1db3bac0bcd2 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/PsiExpressionCodeFragmentImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/PsiExpressionCodeFragmentImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,16 +25,17 @@ import com.intellij.psi.PsiType; import com.intellij.psi.impl.source.tree.ElementType; import com.intellij.psi.impl.source.tree.JavaElementType; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class PsiExpressionCodeFragmentImpl extends PsiCodeFragmentImpl implements PsiExpressionCodeFragment { private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.PsiExpressionCodeFragmentImpl"); private PsiType myExpectedType; - public PsiExpressionCodeFragmentImpl(Project project, + public PsiExpressionCodeFragmentImpl(@NotNull Project project, boolean isPhysical, @NonNls String name, - CharSequence text, + @NotNull CharSequence text, @Nullable final PsiType expectedType, @Nullable PsiElement context) { super(project, JavaElementType.EXPRESSION_TEXT, isPhysical, name, text, context); diff --git a/java/java-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceCodeFragmentImpl.java b/java/java-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceCodeFragmentImpl.java index 333894257d04..0748a6f52a80 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceCodeFragmentImpl.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceCodeFragmentImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import com.intellij.psi.PsiJavaCodeReferenceElement; import com.intellij.psi.impl.source.tree.CompositeElement; import com.intellij.psi.impl.source.tree.JavaElementType; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** @@ -32,10 +33,10 @@ public class PsiJavaCodeReferenceCodeFragmentImpl extends PsiCodeFragmentImpl im private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.PsiJavaCodeReferenceCodeFragmentImpl"); private final boolean myIsClassesAccepted; - public PsiJavaCodeReferenceCodeFragmentImpl(final Project project, + public PsiJavaCodeReferenceCodeFragmentImpl(@NotNull Project project, final boolean isPhysical, - @NonNls final String name, - final CharSequence text, + @NonNls @NotNull String name, + @NotNull CharSequence text, boolean isClassesAccepted, @Nullable PsiElement context) { super(project, JavaElementType.REFERENCE_TEXT, isPhysical, name, text, context); diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/CoreJavaASTFactory.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/CoreJavaASTFactory.java index 9c888c006b99..4f796dce93e6 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/CoreJavaASTFactory.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/CoreJavaASTFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ public class CoreJavaASTFactory extends ASTFactory implements Constants { private final DefaultASTFactory myDefaultASTFactory = ServiceManager.getService(DefaultASTFactory.class); @Override - public LeafElement createLeaf(@NotNull final IElementType type, final CharSequence text) { + public LeafElement createLeaf(@NotNull final IElementType type, @NotNull final CharSequence text) { if (type == C_STYLE_COMMENT || type == END_OF_LINE_COMMENT) { return myDefaultASTFactory.createComment(type, text); } diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaDocElementType.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaDocElementType.java index b046de964cdf..793ad40dead4 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaDocElementType.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/JavaDocElementType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,7 @@ public interface JavaDocElementType { } @Override - public ASTNode createNode(final CharSequence text) { + public ASTNode createNode(CharSequence text) { return new LazyParseablePsiElement(this, text); } } diff --git a/java/java-tests/testSrc/com/intellij/lang/java/parser/JavaParsingTestCase.java b/java/java-tests/testSrc/com/intellij/lang/java/parser/JavaParsingTestCase.java index 861745fba66d..084d34c2194e 100644 --- a/java/java-tests/testSrc/com/intellij/lang/java/parser/JavaParsingTestCase.java +++ b/java/java-tests/testSrc/com/intellij/lang/java/parser/JavaParsingTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,7 +105,7 @@ public abstract class JavaParsingTestCase extends ParsingTestCase { return new PsiJavaFileImpl(viewProvider) { @NotNull @Override - protected FileElement createFileElement(final CharSequence text) { + protected FileElement createFileElement(@NotNull final CharSequence text) { return new FileElement(TEST_FILE_ELEMENT_TYPE, text); } }; diff --git a/platform/core-api/src/com/intellij/psi/tree/ILazyParseableElementType.java b/platform/core-api/src/com/intellij/psi/tree/ILazyParseableElementType.java index 5a6da8aa18ca..8821a1fc27b1 100644 --- a/platform/core-api/src/com/intellij/psi/tree/ILazyParseableElementType.java +++ b/platform/core-api/src/com/intellij/psi/tree/ILazyParseableElementType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/platform/core-api/src/com/intellij/testFramework/LightVirtualFile.java b/platform/core-api/src/com/intellij/testFramework/LightVirtualFile.java index fc3404e9c598..719c23b46865 100644 --- a/platform/core-api/src/com/intellij/testFramework/LightVirtualFile.java +++ b/platform/core-api/src/com/intellij/testFramework/LightVirtualFile.java @@ -39,30 +39,30 @@ public class LightVirtualFile extends LightVirtualFileBase { this(""); } - public LightVirtualFile(@NonNls String name) { + public LightVirtualFile(@NonNls @NotNull String name) { this(name, ""); } - public LightVirtualFile(@NonNls String name, CharSequence content) { + public LightVirtualFile(@NonNls @NotNull String name, @NotNull CharSequence content) { this(name, null, content, LocalTimeCounter.currentTime()); } - public LightVirtualFile(final String name, final FileType fileType, final CharSequence text) { + public LightVirtualFile(@NotNull String name, final FileType fileType, @NotNull CharSequence text) { this(name, fileType, text, LocalTimeCounter.currentTime()); } - public LightVirtualFile(VirtualFile original, final CharSequence text, long modificationStamp) { + public LightVirtualFile(VirtualFile original, @NotNull CharSequence text, long modificationStamp) { this(original.getName(), original.getFileType(), text, modificationStamp); setCharset(original.getCharset()); } - public LightVirtualFile(final String name, final FileType fileType, final CharSequence text, final long modificationStamp) { + public LightVirtualFile(@NotNull String name, final FileType fileType, @NotNull CharSequence text, final long modificationStamp) { this(name, fileType, text, CharsetUtil.extractCharsetFromFileContent(null, null, fileType, text), modificationStamp); } - public LightVirtualFile(final String name, + public LightVirtualFile(@NotNull String name, final FileType fileType, - final CharSequence text, + @NotNull CharSequence text, Charset charset, final long modificationStamp) { super(name, fileType, modificationStamp); @@ -70,7 +70,7 @@ public class LightVirtualFile extends LightVirtualFileBase { setCharset(charset); } - public LightVirtualFile(final String name, final Language language, final CharSequence text) { + public LightVirtualFile(@NotNull String name, final Language language, @NotNull CharSequence text) { super(name, null, LocalTimeCounter.currentTime()); setContent(text); setLanguage(language); @@ -121,16 +121,17 @@ public class LightVirtualFile extends LightVirtualFileBase { return s.getBytes(charset.name()); } - public void setContent(Object requestor, CharSequence content, boolean fireEvent) { + public void setContent(Object requestor, @NotNull CharSequence content, boolean fireEvent) { setContent(content); setModificationStamp(LocalTimeCounter.currentTime()); } - private void setContent(CharSequence content) { + private void setContent(@NotNull CharSequence content) { //StringUtil.assertValidSeparators(content); myContent = content; } + @NotNull public CharSequence getContent() { return myContent; } diff --git a/platform/core-impl/src/com/intellij/core/CoreASTFactory.java b/platform/core-impl/src/com/intellij/core/CoreASTFactory.java index d4e19d280bb9..16d2c1423d58 100644 --- a/platform/core-impl/src/com/intellij/core/CoreASTFactory.java +++ b/platform/core-impl/src/com/intellij/core/CoreASTFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public class CoreASTFactory extends ASTFactory implements DefaultASTFactory { @Override @NotNull - public LeafElement createLeaf(@NotNull final IElementType type, final CharSequence text) { + public LeafElement createLeaf(@NotNull final IElementType type, @NotNull final CharSequence text) { final Language lang = type.getLanguage(); final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(lang); if (parserDefinition != null) { @@ -60,8 +60,9 @@ public class CoreASTFactory extends ASTFactory implements DefaultASTFactory { return new LeafPsiElement(type, text); } + @NotNull @Override - public LeafElement createComment(@NotNull IElementType type, CharSequence text) { + public LeafElement createComment(@NotNull IElementType type, @NotNull CharSequence text) { return new PsiCoreCommentImpl(type, text); } } diff --git a/platform/core-impl/src/com/intellij/lang/ASTFactory.java b/platform/core-impl/src/com/intellij/lang/ASTFactory.java index d923204915b3..e50feb7dcf22 100644 --- a/platform/core-impl/src/com/intellij/lang/ASTFactory.java +++ b/platform/core-impl/src/com/intellij/lang/ASTFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +21,14 @@ import com.intellij.psi.impl.source.CharTableImpl; import com.intellij.psi.impl.source.CodeFragmentElement; import com.intellij.psi.impl.source.DummyHolderElement; import com.intellij.psi.impl.source.codeStyle.CodeEditUtil; -import com.intellij.psi.impl.source.tree.*; -import com.intellij.psi.tree.*; +import com.intellij.psi.impl.source.tree.CompositeElement; +import com.intellij.psi.impl.source.tree.LazyParseableElement; +import com.intellij.psi.impl.source.tree.LeafElement; +import com.intellij.psi.impl.source.tree.PsiWhiteSpaceImpl; +import com.intellij.psi.tree.ICompositeElementType; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.tree.ILazyParseableElementType; +import com.intellij.psi.tree.ILeafElementType; import com.intellij.util.CharTable; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -46,14 +52,14 @@ public abstract class ASTFactory { } @Nullable - public LeafElement createLeaf(@NotNull IElementType type, final CharSequence text) { + public LeafElement createLeaf(@NotNull IElementType type, @NotNull CharSequence text) { return null; } // factory methods @NotNull - public static LazyParseableElement lazy(@NotNull final ILazyParseableElementType type, final CharSequence text) { + public static LazyParseableElement lazy(@NotNull final ILazyParseableElementType type, CharSequence text) { final ASTNode node = type.createNode(text); if (node != null) return (LazyParseableElement)node; @@ -79,7 +85,7 @@ public abstract class ASTFactory { } @NotNull - public static LeafElement leaf(@NotNull final IElementType type, final CharSequence text) { + public static LeafElement leaf(@NotNull final IElementType type, @NotNull CharSequence text) { if (type == TokenType.WHITE_SPACE) { return new PsiWhiteSpaceImpl(text); } @@ -105,11 +111,7 @@ public abstract class ASTFactory { } public static class DefaultFactoryHolder { - public static final ASTFactory DEFAULT = def(); - - private static ASTFactory def() { - return (ASTFactory)ServiceManager.getService(DefaultASTFactory.class); - } + public static final ASTFactory DEFAULT = (ASTFactory)ServiceManager.getService(DefaultASTFactory.class); private DefaultFactoryHolder() { } diff --git a/platform/core-impl/src/com/intellij/lang/DefaultASTFactory.java b/platform/core-impl/src/com/intellij/lang/DefaultASTFactory.java index 60c12c327854..f97c4119bccf 100644 --- a/platform/core-impl/src/com/intellij/lang/DefaultASTFactory.java +++ b/platform/core-impl/src/com/intellij/lang/DefaultASTFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package com.intellij.lang; import com.intellij.psi.impl.source.tree.LeafElement; import com.intellij.psi.tree.IElementType; +import org.jetbrains.annotations.NotNull; /** * Marker interface for retrieving the service which provides a default implementation of ASTFactory. @@ -24,5 +25,6 @@ import com.intellij.psi.tree.IElementType; * @author yole */ public interface DefaultASTFactory { - LeafElement createComment(IElementType type, CharSequence text); + @NotNull + LeafElement createComment(@NotNull IElementType type, @NotNull CharSequence text); } diff --git a/platform/core-impl/src/com/intellij/lang/ForeignLeafType.java b/platform/core-impl/src/com/intellij/lang/ForeignLeafType.java index f6e8f3065333..3431f247b82e 100644 --- a/platform/core-impl/src/com/intellij/lang/ForeignLeafType.java +++ b/platform/core-impl/src/com/intellij/lang/ForeignLeafType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import com.intellij.psi.tree.ILeafElementType; import org.jetbrains.annotations.NotNull; public class ForeignLeafType extends TokenWrapper implements ILeafElementType { - public ForeignLeafType(IElementType delegate, CharSequence value) { + public ForeignLeafType(@NotNull IElementType delegate, @NotNull CharSequence value) { super(delegate, value); } diff --git a/platform/core-impl/src/com/intellij/lang/TokenWrapper.java b/platform/core-impl/src/com/intellij/lang/TokenWrapper.java index ade2dc884314..2126a92bd497 100644 --- a/platform/core-impl/src/com/intellij/lang/TokenWrapper.java +++ b/platform/core-impl/src/com/intellij/lang/TokenWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ public class TokenWrapper extends IElementType { private final IElementType myDelegate; private final String myValue; - public TokenWrapper(@NotNull IElementType delegate, CharSequence value) { + public TokenWrapper(@NotNull IElementType delegate, @NotNull CharSequence value) { super("Wrapper", delegate.getLanguage(), false); myDelegate = delegate; myValue = value.toString(); diff --git a/platform/core-impl/src/com/intellij/pom/core/impl/PomModelImpl.java b/platform/core-impl/src/com/intellij/pom/core/impl/PomModelImpl.java index b9fc9429d5ee..78d52db956b7 100644 --- a/platform/core-impl/src/com/intellij/pom/core/impl/PomModelImpl.java +++ b/platform/core-impl/src/com/intellij/pom/core/impl/PomModelImpl.java @@ -21,6 +21,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.progress.EmptyProgressIndicator; +import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressIndicatorProvider; import com.intellij.openapi.project.Project; @@ -150,6 +151,9 @@ public class PomModelImpl extends UserDataHolderBase implements PomModel { transaction.run(); event = transaction.getAccumulatedEvent(); } + catch (ProcessCanceledException e) { + throw e; + } catch(Exception e){ LOG.error(e); return; @@ -186,6 +190,9 @@ public class PomModelImpl extends UserDataHolderBase implements PomModel { } } } + catch (ProcessCanceledException e) { + throw e; + } catch (Throwable t) { throwables.add(t); } @@ -193,6 +200,9 @@ public class PomModelImpl extends UserDataHolderBase implements PomModel { try { commitTransaction(transaction); } + catch (ProcessCanceledException e) { + throw e; + } catch (Throwable t) { throwables.add(t); } diff --git a/platform/core-impl/src/com/intellij/psi/impl/PsiFileFactoryImpl.java b/platform/core-impl/src/com/intellij/psi/impl/PsiFileFactoryImpl.java index 7f4febb38c48..cc62319d3894 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/PsiFileFactoryImpl.java +++ b/platform/core-impl/src/com/intellij/psi/impl/PsiFileFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,7 +108,8 @@ public class PsiFileFactoryImpl extends PsiFileFactory { } @Nullable - public PsiFile trySetupPsiForFile(final LightVirtualFile virtualFile, Language language, + public PsiFile trySetupPsiForFile(@NotNull LightVirtualFile virtualFile, + @NotNull Language language, final boolean physical, final boolean markAsCopy) { final FileViewProviderFactory factory = LanguageFileViewProviders.INSTANCE.forLanguage(language); FileViewProvider viewProvider = factory != null ? factory.createFileViewProvider(virtualFile, language, myManager, physical) : null; diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/DummyHolderElement.java b/platform/core-impl/src/com/intellij/psi/impl/source/DummyHolderElement.java index 4ee148c09841..11dbbbccbbef 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/source/DummyHolderElement.java +++ b/platform/core-impl/src/com/intellij/psi/impl/source/DummyHolderElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,10 @@ package com.intellij.psi.impl.source; import com.intellij.psi.TokenType; import com.intellij.psi.impl.source.tree.FileElement; +import org.jetbrains.annotations.NotNull; public class DummyHolderElement extends FileElement { - public DummyHolderElement(CharSequence text) { + public DummyHolderElement(@NotNull CharSequence text) { super(TokenType.DUMMY_HOLDER, text); } } diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/tree/FileElement.java b/platform/core-impl/src/com/intellij/psi/impl/source/tree/FileElement.java index 8192070f97c6..894d0295870c 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/source/tree/FileElement.java +++ b/platform/core-impl/src/com/intellij/psi/impl/source/tree/FileElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,17 +55,13 @@ public class FileElement extends LazyParseableElement implements FileASTNode, Ge final IFileElementType contentType = (IFileElementType)getElementType(); assert contentType instanceof ILightStubFileElementType:contentType; - LighterAST tree; if (!isParsed()) { return new FCTSBackedLighterAST(getCharTable(), ((ILightStubFileElementType)contentType).parseContentsLight(this)); } - else { - tree = new TreeBackedLighterAST(this); - } - return tree; + return new TreeBackedLighterAST(this); } - public FileElement(IElementType type, CharSequence text) { + public FileElement(@NotNull IElementType type, CharSequence text) { super(type, text); } diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/tree/OwnBufferLeafPsiElement.java b/platform/core-impl/src/com/intellij/psi/impl/source/tree/OwnBufferLeafPsiElement.java index 7d1abe377f1a..5a9cf378a950 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/source/tree/OwnBufferLeafPsiElement.java +++ b/platform/core-impl/src/com/intellij/psi/impl/source/tree/OwnBufferLeafPsiElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ import org.jetbrains.annotations.NotNull; public class OwnBufferLeafPsiElement extends LeafElement implements PsiElement { private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.source.tree.LeafPsiElement"); - public OwnBufferLeafPsiElement(@NotNull IElementType type, CharSequence text) { + public OwnBufferLeafPsiElement(@NotNull IElementType type, @NotNull CharSequence text) { super(type, text); } diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/tree/PlainTextASTFactory.java b/platform/core-impl/src/com/intellij/psi/impl/source/tree/PlainTextASTFactory.java index 8674773ac469..5f09bbb81ca7 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/source/tree/PlainTextASTFactory.java +++ b/platform/core-impl/src/com/intellij/psi/impl/source/tree/PlainTextASTFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ public class PlainTextASTFactory extends ASTFactory { @Override @Nullable - public LeafElement createLeaf(@NotNull final IElementType type, CharSequence text) { + public LeafElement createLeaf(@NotNull final IElementType type, @NotNull CharSequence text) { if (type == PlainTextTokenTypes.PLAIN_TEXT) { return new PsiPlainTextImpl(text); } diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/tree/PsiPlainTextImpl.java b/platform/core-impl/src/com/intellij/psi/impl/source/tree/PsiPlainTextImpl.java index 4bb8c6214cd6..fd0e83240347 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/source/tree/PsiPlainTextImpl.java +++ b/platform/core-impl/src/com/intellij/psi/impl/source/tree/PsiPlainTextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import com.intellij.psi.PsiPlainText; import org.jetbrains.annotations.NotNull; public class PsiPlainTextImpl extends OwnBufferLeafPsiElement implements PsiPlainText { - protected PsiPlainTextImpl(CharSequence text) { + protected PsiPlainTextImpl(@NotNull CharSequence text) { super(PlainTextTokenTypes.PLAIN_TEXT, text); } diff --git a/platform/indexing-api/src/com/intellij/psi/stubs/SerializationManager.java b/platform/indexing-api/src/com/intellij/psi/stubs/SerializationManager.java index 228b14ff6b17..a0534413f902 100644 --- a/platform/indexing-api/src/com/intellij/psi/stubs/SerializationManager.java +++ b/platform/indexing-api/src/com/intellij/psi/stubs/SerializationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.extensions.Extensions; import com.intellij.psi.tree.IElementType; import com.intellij.psi.tree.IStubFileElementType; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; @@ -49,7 +50,7 @@ public abstract class SerializationManager { } final IElementType[] stubElementTypes = IElementType.enumerate(new IElementType.Predicate() { @Override - public boolean matches(final IElementType type) { + public boolean matches(@NotNull final IElementType type) { return type instanceof StubSerializer; } }); diff --git a/platform/lang-impl/src/com/intellij/lang/DefaultASTFactoryImpl.java b/platform/lang-impl/src/com/intellij/lang/DefaultASTFactoryImpl.java index 84b79498e050..1b07b367e78f 100644 --- a/platform/lang-impl/src/com/intellij/lang/DefaultASTFactoryImpl.java +++ b/platform/lang-impl/src/com/intellij/lang/DefaultASTFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,9 @@ import com.intellij.psi.tree.IElementType; import org.jetbrains.annotations.NotNull; public class DefaultASTFactoryImpl extends CoreASTFactory implements DefaultASTFactory { + @NotNull @Override - public LeafElement createComment(@NotNull IElementType type, CharSequence text) { + public LeafElement createComment(@NotNull IElementType type, @NotNull CharSequence text) { return new PsiCommentImpl(type, text); } } diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertiesASTFactory.java b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertiesASTFactory.java index 2f202fe8ba9a..a3d8e5ddb967 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertiesASTFactory.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertiesASTFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ public class PropertiesASTFactory extends ASTFactory { @Override @Nullable - public LeafElement createLeaf(@NotNull final IElementType type, CharSequence text) { + public LeafElement createLeaf(@NotNull final IElementType type, @NotNull CharSequence text) { if (type == PropertiesTokenTypes.KEY_CHARACTERS) { return new PropertyKeyImpl(type, text); } diff --git a/python/src/com/jetbrains/python/formatter/PythonFormattingModelBuilder.java b/python/src/com/jetbrains/python/formatter/PythonFormattingModelBuilder.java index 04d0c69547da..d399dbec75a1 100644 --- a/python/src/com/jetbrains/python/formatter/PythonFormattingModelBuilder.java +++ b/python/src/com/jetbrains/python/formatter/PythonFormattingModelBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -151,7 +151,7 @@ public class PythonFormattingModelBuilder implements FormattingModelBuilderEx, C final PythonLanguage pythonLanguage = PythonLanguage.getInstance(); return TokenSet.create(IElementType.enumerate(new IElementType.Predicate() { @Override - public boolean matches(IElementType type) { + public boolean matches(@NotNull IElementType type) { return type != LAMBDA_KEYWORD && type.getLanguage().isKindOf(pythonLanguage); } })); diff --git a/xml/xml-psi-impl/src/com/intellij/lang/xml/XmlASTFactory.java b/xml/xml-psi-impl/src/com/intellij/lang/xml/XmlASTFactory.java index b8dac87836b2..7fdcc6c41502 100644 --- a/xml/xml-psi-impl/src/com/intellij/lang/xml/XmlASTFactory.java +++ b/xml/xml-psi-impl/src/com/intellij/lang/xml/XmlASTFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -136,7 +136,7 @@ public class XmlASTFactory extends ASTFactory { } @Override - public LeafElement createLeaf(@NotNull final IElementType type, CharSequence text) { + public LeafElement createLeaf(@NotNull final IElementType type, @NotNull CharSequence text) { if (type instanceof IXmlLeafElementType) { if (type == XML_REAL_WHITE_SPACE) { return new PsiWhiteSpaceImpl(text);