This commit is contained in:
Alexey Kudravtsev
2014-04-02 13:27:58 +04:00
parent 82930ae43d
commit ad25db4d2a
28 changed files with 36 additions and 36 deletions
@@ -59,7 +59,7 @@ public class StringIndex {
private static class Indexer implements DataIndexer<String, String, PathContentPair> {
@Override
@NotNull
public Map<String,String> map(final PathContentPair inputData) {
public Map<String,String> map(@NotNull final PathContentPair inputData) {
final Map<String,String> _map = new HashMap<String, String>();
final StringBuilder builder = new StringBuilder();
final String content = inputData.content;
@@ -125,7 +125,7 @@ public abstract class PlatformIdTableBuilding {
@NotNull
@Override
public Map<TodoIndexEntry, Integer> map(FileContent inputData) {
public Map<TodoIndexEntry, Integer> map(@NotNull FileContent inputData) {
Map<TodoIndexEntry, Integer> result = ContainerUtil.newTroveMap();
for (DataIndexer<TodoIndexEntry, Integer, FileContent> indexer : indexers) {
for (Map.Entry<TodoIndexEntry, Integer> entry : indexer.map(inputData).entrySet()) {
@@ -152,7 +152,7 @@ public abstract class PlatformIdTableBuilding {
@Override
@NotNull
public Map<TodoIndexEntry, Integer> map(final FileContent inputData) {
public Map<TodoIndexEntry, Integer> map(@NotNull final FileContent inputData) {
if (IndexPatternUtil.getIndexPatternCount() > 0) {
final CharSequence chars = inputData.getContentAsText();
final OccurrenceConsumer occurrenceConsumer = new OccurrenceConsumer(null, true);
@@ -204,7 +204,7 @@ public abstract class PlatformIdTableBuilding {
public static class PlainTextTodoIndexer implements DataIndexer<TodoIndexEntry, Integer, FileContent> {
@Override
@NotNull
public Map<TodoIndexEntry, Integer> map(final FileContent inputData) {
public Map<TodoIndexEntry, Integer> map(@NotNull final FileContent inputData) {
String chars = inputData.getContentAsText().toString(); // matching strings is faster than HeapCharBuffer
final IndexPattern[] indexPatterns = IndexPatternUtil.getIndexPatterns();
@@ -93,7 +93,7 @@ public class TodoIndex extends FileBasedIndexExtension<TodoIndexEntry, Integer>
private final DataIndexer<TodoIndexEntry, Integer, FileContent> myIndexer = new DataIndexer<TodoIndexEntry, Integer, FileContent>() {
@Override
@NotNull
public Map<TodoIndexEntry,Integer> map(final FileContent inputData) {
public Map<TodoIndexEntry,Integer> map(@NotNull final FileContent inputData) {
final VirtualFile file = inputData.getFile();
final DataIndexer<TodoIndexEntry, Integer, FileContent> indexer = PlatformIdTableBuilding
.getTodoIndexer(inputData.getFileType(), file);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 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,5 +26,5 @@ import java.util.Map;
*/
public interface DataIndexer<Key, Value, Data> {
@NotNull
Map<Key,Value> map(Data inputData);
Map<Key,Value> map(@NotNull Data inputData);
}
@@ -75,7 +75,7 @@ public class IdIndex extends FileBasedIndexExtension<IdIndexEntry, Integer> {
private final DataIndexer<IdIndexEntry, Integer, FileContent> myIndexer = new DataIndexer<IdIndexEntry, Integer, FileContent>() {
@Override
@NotNull
public Map<IdIndexEntry, Integer> map(final FileContent inputData) {
public Map<IdIndexEntry, Integer> map(@NotNull final FileContent inputData) {
final FileTypeIdIndexer indexer = IdTableBuilding.getFileTypeIndexer(inputData.getFileType());
if (indexer != null) {
return indexer.map(inputData);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -50,7 +50,7 @@ public class IdTableBuilding {
public static class PlainTextIndexer extends FileTypeIdIndexer {
@Override
@NotNull
public Map<IdIndexEntry, Integer> map(final FileContent inputData) {
public Map<IdIndexEntry, Integer> map(@NotNull final FileContent inputData) {
final IdDataConsumer consumer = new IdDataConsumer();
final CharSequence chars = inputData.getContentAsText();
scanWords(new ScanWordProcessor() {
@@ -132,7 +132,7 @@ public class IdTableBuilding {
@Override
@NotNull
public Map<IdIndexEntry, Integer> map(final FileContent inputData) {
public Map<IdIndexEntry, Integer> map(@NotNull final FileContent inputData) {
final CharSequence chars = inputData.getContentAsText();
final char[] charsArray = CharArrayUtil.fromSequenceWithoutCopying(chars);
final IdDataConsumer consumer = new IdDataConsumer();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -31,7 +31,7 @@ public abstract class LexerBasedIdIndexer extends FileTypeIdIndexer implements I
@Override
@NotNull
public final Map<IdIndexEntry,Integer> map(final FileContent inputData) {
public final Map<IdIndexEntry,Integer> map(@NotNull final FileContent inputData) {
return BaseFilterLexerUtil.scanContent(inputData, this).idMap;
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -32,7 +32,7 @@ public abstract class LexerBasedTodoIndexer implements DataIndexer<TodoIndexEntr
IdAndToDoScannerBasedOnFilterLexer {
@Override
@NotNull
public Map<TodoIndexEntry,Integer> map(final FileContent inputData) {
public Map<TodoIndexEntry,Integer> map(@NotNull final FileContent inputData) {
return BaseFilterLexerUtil.scanContent(inputData, this).todoMap;
}
}
@@ -117,7 +117,7 @@ public class FileTypeIndex extends ScalarIndexExtension<FileType>
@NotNull
@Override
public Map<FileType, Void> map(FileContent inputData) {
public Map<FileType, Void> map(@NotNull FileContent inputData) {
return Collections.singletonMap(inputData.getFileType(), null);
}
@@ -151,7 +151,7 @@ public class FilenameIndex extends ScalarIndexExtension<String> {
private static class MyDataIndexer implements DataIndexer<String, Void, FileContent> {
@Override
@NotNull
public Map<String, Void> map(final FileContent inputData) {
public Map<String, Void> map(@NotNull final FileContent inputData) {
return Collections.singletonMap(inputData.getFileName(), null);
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -37,7 +37,7 @@ public abstract class SingleEntryIndexer<V> implements DataIndexer<Integer, V, F
@Override
@NotNull
public final Map<Integer, V> map(FileContent inputData) {
public final Map<Integer, V> map(@NotNull FileContent inputData) {
if (inputData == null) {
return Collections.emptyMap();
}
@@ -61,7 +61,7 @@ public class TrigramIndex extends ScalarIndexExtension<Integer> {
return new DataIndexer<Integer, Void, FileContent>() {
@Override
@NotNull
public Map<Integer, Void> map(FileContent inputData) {
public Map<Integer, Void> map(@NotNull FileContent inputData) {
final Map<Integer, Void> result = new THashMap<Integer, Void>();
TIntHashSet built = TrigramBuilder.buildTrigram(inputData.getContentAsText());
built.forEach(new TIntProcedure() {
@@ -68,7 +68,7 @@ public class FrameworkDetectionIndex extends ScalarIndexExtension<Integer> {
return new DataIndexer<Integer, Void, FileContent>() {
@NotNull
@Override
public Map<Integer, Void> map(FileContent inputData) {
public Map<Integer, Void> map(@NotNull FileContent inputData) {
final FileType fileType = inputData.getFileType();
if (!detectors.containsKey(fileType)) {
return Collections.emptyMap();
@@ -82,7 +82,7 @@ public class FileIncludeIndex extends FileBasedIndexExtension<FileIncludeIndex.K
return new DataIndexer<Key, List<FileIncludeInfoImpl>, FileContent>() {
@Override
@NotNull
public Map<Key, List<FileIncludeInfoImpl>> map(FileContent inputData) {
public Map<Key, List<FileIncludeInfoImpl>> map(@NotNull FileContent inputData) {
Map<Key, List<FileIncludeInfoImpl>> map = new FactoryMap<Key, List<FileIncludeInfoImpl>>() {
@Override
@@ -38,7 +38,7 @@ public class AntImportsIndex extends ScalarIndexExtension<Integer>{
private static final DataIndexer<Integer,Void,FileContent> DATA_INDEXER = new DataIndexer<Integer, Void, FileContent>() {
@Override
@NotNull
public Map<Integer, Void> map(final FileContent inputData) {
public Map<Integer, Void> map(@NotNull final FileContent inputData) {
final Map<Integer, Void> map = new HashMap<Integer, Void>();
NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()), new NanoXmlUtil.IXMLBuilderAdapter() {
@@ -503,7 +503,7 @@ public class GroovyDslFileIndex extends ScalarIndexExtension<String> {
@Override
@NotNull
public Map<String, Void> map(final FileContent inputData) {
public Map<String, Void> map(@NotNull final FileContent inputData) {
return Collections.singletonMap(OUR_KEY, null);
}
}
@@ -37,7 +37,7 @@ import java.util.*;
public class FxmlDataIndexer implements DataIndexer<String, Set<String>, FileContent> {
@Override
@NotNull
public Map<String, Set<String>> map(final FileContent inputData) {
public Map<String, Set<String>> map(@NotNull final FileContent inputData) {
final Map<String, Set<String>> map = getIds(inputData.getContentAsText().toString(), inputData.getFile(), inputData.getProject());
if (map != null) {
return map;
@@ -83,7 +83,7 @@ public class JavaFxControllerClassIndex extends ScalarIndexExtension<String> {
private static class MyDataIndexer implements DataIndexer<String, Void, FileContent> {
@Override
@NotNull
public Map<String, Void> map(final FileContent inputData) {
public Map<String, Void> map(@NotNull final FileContent inputData) {
final String className = getControllerClassName(inputData.getContentAsText().toString());
if (className != null) {
return Collections.singletonMap(className, null);
@@ -107,7 +107,7 @@ public class XmlPropertiesIndex extends FileBasedIndexExtension<XmlPropertiesInd
@NotNull
@Override
public Map<Key, String> map(FileContent inputData) {
public Map<Key, String> map(@NotNull FileContent inputData) {
CharSequence text = inputData.getContentAsText();
if(CharArrayUtil.indexOf(text, HTTP_JAVA_SUN_COM_DTD_PROPERTIES_DTD, 0) == -1) {
return Collections.emptyMap();
@@ -80,7 +80,7 @@ public class FormClassIndex extends ScalarIndexExtension<String> {
private static class MyDataIndexer implements DataIndexer<String, Void, FileContent> {
@Override
@NotNull
public Map<String, Void> map(final FileContent inputData) {
public Map<String, Void> map(@NotNull final FileContent inputData) {
String className = null;
try {
className = Utils.getBoundClassName(inputData.getContentAsText().toString());
@@ -89,7 +89,7 @@ public class XsltSymbolIndex extends FileBasedIndexExtension<String, XsltSymbolI
return new DataIndexer<String, Kind, FileContent>() {
@Override
@NotNull
public Map<String, Kind> map(FileContent inputData) {
public Map<String, Kind> map(@NotNull FileContent inputData) {
CharSequence inputDataContentAsText = inputData.getContentAsText();
if (CharArrayUtil.indexOf(inputDataContentAsText, XsltSupport.XSLT_NS, 0) == -1) {
return Collections.emptyMap();
@@ -43,7 +43,7 @@ public class PyModuleNameIndex extends ScalarIndexExtension<String> {
private final DataIndexer<String, Void, FileContent> myDataIndexer = new DataIndexer<String, Void, FileContent>() {
@NotNull
@Override
public Map<String, Void> map(FileContent inputData) {
public Map<String, Void> map(@NotNull FileContent inputData) {
final VirtualFile file = inputData.getFile();
final String name = file.getName();
if (PyNames.INIT_DOT_PY.equals(name)) {
@@ -43,7 +43,7 @@ public class DomFileIndex extends ScalarIndexExtension<String>{
myDataIndexer = new DataIndexer<String, Void, FileContent>() {
@Override
@NotNull
public Map<String, Void> map(final FileContent inputData) {
public Map<String, Void> map(@NotNull final FileContent inputData) {
final Set<String> namespaces = new THashSet<String>();
final XmlFileHeader header = NanoXmlUtil.parseHeader(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()));
ContainerUtil.addIfNotNull(header.getPublicId(), namespaces);
@@ -46,7 +46,7 @@ public class Html5CustomAttributesIndex extends ScalarIndexExtension<String> {
private final DataIndexer<String, Void, FileContent> myIndexer = new DataIndexer<String, Void, FileContent>() {
@Override
@NotNull
public Map<String, Void> map(FileContent inputData) {
public Map<String, Void> map(@NotNull FileContent inputData) {
CharSequence input = inputData.getContentAsText();
Language language = ((LanguageFileType)inputData.getFileType()).getLanguage();
if (language == HTMLLanguage.INSTANCE || language == XHTMLLanguage.INSTANCE) {
@@ -121,7 +121,7 @@ public class SchemaTypeInheritanceIndex extends XmlIndex<Set<SchemaTypeInfo>> {
return new DataIndexer<String, Set<SchemaTypeInfo>, FileContent>() {
@NotNull
@Override
public Map<String, Set<SchemaTypeInfo>> map(FileContent inputData) {
public Map<String, Set<SchemaTypeInfo>> map(@NotNull FileContent inputData) {
final Map<String, Set<SchemaTypeInfo>> map = new HashMap<String, Set<SchemaTypeInfo>>();
final MultiMap<SchemaTypeInfo,SchemaTypeInfo> multiMap =
XsdComplexTypeInfoBuilder.parse(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()));
@@ -54,7 +54,7 @@ public class XmlTagNamesIndex extends XmlIndex<Void> {
return new DataIndexer<String, Void, FileContent>() {
@Override
@NotNull
public Map<String, Void> map(final FileContent inputData) {
public Map<String, Void> map(@NotNull final FileContent inputData) {
final Collection<String> tags = XsdTagNameBuilder.computeTagNames(CharArrayUtil.readerFromCharSequence(inputData.getContentAsText()));
if (tags != null && !tags.isEmpty()) {
final HashMap<String, Void> map = new HashMap<String, Void>(tags.size());
@@ -82,7 +82,7 @@ public class RelaxSymbolIndex extends ScalarIndexExtension<String> {
return new DataIndexer<String, Void, FileContent>() {
@Override
@NotNull
public Map<String, Void> map(FileContent inputData) {
public Map<String, Void> map(@NotNull FileContent inputData) {
final HashMap<String, Void> map = new HashMap<String, Void>();
if (inputData.getFileType() == XmlFileType.INSTANCE) {
CharSequence inputDataContentAsText = inputData.getContentAsText();
@@ -87,7 +87,7 @@ public class XmlNamespaceIndex extends XmlIndex<XsdNamespaceBuilder> {
return new DataIndexer<String, XsdNamespaceBuilder, FileContent>() {
@Override
@NotNull
public Map<String, XsdNamespaceBuilder> map(final FileContent inputData) {
public Map<String, XsdNamespaceBuilder> map(@NotNull final FileContent inputData) {
final XsdNamespaceBuilder builder;
if ("dtd".equals(inputData.getFile().getExtension())) {
builder = new XsdNamespaceBuilder(inputData.getFileName(), "", Collections.<String>emptyList());