The in-IDE Jackpot index should not attribute the files: if the index is constructed for opened source roots, Java support's caches contains enough data; for indices constructed from BatchSearch, the attribution data would be broken anyway.
authorJan Lahoda <jlahoda@netbeans.org>
Wed, 26 Jan 2011 21:11:09 +0100
changeset 534e0a0bdf664c0
parent 533 27aa58b8705b
child 535 b027defe1bcc
child 537 8969f0506ea5
The in-IDE Jackpot index should not attribute the files: if the index is constructed for opened source roots, Java support's caches contains enough data; for indices constructed from BatchSearch, the attribution data would be broken anyway.
api/src/org/netbeans/modules/jackpot30/impl/indexing/AbstractLuceneIndex.java
api/src/org/netbeans/modules/jackpot30/impl/indexing/CustomIndexerImpl.java
api/src/org/netbeans/modules/jackpot30/impl/indexing/Index.java
     1.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/AbstractLuceneIndex.java	Wed Jan 26 21:05:31 2011 +0100
     1.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/indexing/AbstractLuceneIndex.java	Wed Jan 26 21:11:09 2011 +0100
     1.3 @@ -82,6 +82,7 @@
     1.4  import org.apache.lucene.search.TermQuery;
     1.5  import org.apache.lucene.search.TopDocs;
     1.6  import org.netbeans.api.annotations.common.NonNull;
     1.7 +import org.netbeans.api.annotations.common.NullAllowed;
     1.8  import org.netbeans.modules.jackpot30.impl.pm.BulkSearch;
     1.9  import org.netbeans.modules.jackpot30.impl.pm.BulkSearch.BulkPattern;
    1.10  import org.netbeans.modules.jackpot30.impl.pm.BulkSearch.EncodingContext;
    1.11 @@ -250,7 +251,7 @@
    1.12          }
    1.13  
    1.14          @Override
    1.15 -        public void record(URL source, final CompilationUnitTree cut, final AttributionWrapper attributed) throws IOException {
    1.16 +        public void record(URL source, final CompilationUnitTree cut, final @NullAllowed AttributionWrapper attributed) throws IOException {
    1.17              String relative = source.getPath().substring(stripLength);
    1.18              ByteArrayOutputStream out = null;
    1.19              EncodingContext ec = null;
     2.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/CustomIndexerImpl.java	Wed Jan 26 21:05:31 2011 +0100
     2.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/indexing/CustomIndexerImpl.java	Wed Jan 26 21:11:09 2011 +0100
     2.3 @@ -105,10 +105,10 @@
     2.4              if (!toIndex.isEmpty()) {
     2.5                  JavaSource.create(cpInfo, toIndex).runUserActionTask(new Task<CompilationController>() {
     2.6                      public void run(final CompilationController cc) throws Exception {
     2.7 -                        if (cc.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0)
     2.8 +                        if (cc.toPhase(Phase.PARSED).compareTo(Phase.PARSED) < 0)
     2.9                              return ;
    2.10  
    2.11 -                        w[0].record(cc.getFileObject().getURL(), cc.getCompilationUnit(), new AttributionWrapper(cc));
    2.12 +                        w[0].record(cc.getFileObject().getURL(), cc.getCompilationUnit(), null);
    2.13                      }
    2.14                  }, true);
    2.15              }
     3.1 --- a/api/src/org/netbeans/modules/jackpot30/impl/indexing/Index.java	Wed Jan 26 21:05:31 2011 +0100
     3.2 +++ b/api/src/org/netbeans/modules/jackpot30/impl/indexing/Index.java	Wed Jan 26 21:11:09 2011 +0100
     3.3 @@ -53,6 +53,7 @@
     3.4  import java.util.Collections;
     3.5  import org.codeviation.pojson.Pojson;
     3.6  import org.netbeans.api.annotations.common.NonNull;
     3.7 +import org.netbeans.api.annotations.common.NullAllowed;
     3.8  import org.netbeans.api.java.source.CompilationInfo;
     3.9  import org.netbeans.modules.jackpot30.impl.pm.BulkSearch.BulkPattern;
    3.10  import org.openide.util.Exceptions;
    3.11 @@ -133,7 +134,7 @@
    3.12  
    3.13          protected IndexWriter() throws IOException {}
    3.14  
    3.15 -        public abstract void record(URL source, final CompilationUnitTree cut, AttributionWrapper attributed) throws IOException;
    3.16 +        public abstract void record(URL source, final CompilationUnitTree cut, @NullAllowed AttributionWrapper attributed) throws IOException;
    3.17  
    3.18          public abstract void remove(String relativePath) throws IOException;
    3.19