[TR-123] Null pointer exception while trying to index simple document. Created: 16/Oct/10  Updated: 04/Apr/11  Resolved: 06/Jan/11

Status: Resolved
Project: Terrier Core
Component/s: .indexing
Affects Version/s: 3.0, 3.5
Fix Version/s: 3.5

Type: Bug Priority: Major
Reporter: Ilya Bogunov Assignee: Craig Macdonald
Resolution: Fixed  
Labels: None


 Description   
/org/terrier/indexing/FileDocument.java

public Set<String> getFields() {
      return null;
}

creates

java.lang.NullPointerException
        at org.terrier.indexing.BasicIndexer$FieldTermProcessor.processTerm(BasicIndexer.java:112)
        at org.terrier.terms.StemmerTermPipeline.processTerm(StemmerTermPipeline.java:58)
        at org.terrier.indexing.BasicIndexer.createDirectIndex(BasicIndexer.java:240)
        at org.terrier.indexing.Indexer.index(Indexer.java:344)
        at org.terrier.applications.TRECIndexing.index(TRECIndexing.java:123)
        at org.terrier.applications.TrecTerrier.run(TrecTerrier.java:390)
        at org.terrier.applications.TrecTerrier.applyOptions(TrecTerrier.java:573)
        at org.terrier.applications.TrecTerrier.main(TrecTerrier.java:237)

should be

+ 37 import java.util.Collections;

167 return Collections.emptySet();

 Comments   
Comment by Craig Macdonald [ 06/Jan/11 ]

Good catch. I have committed this to trunk.

Comment by Craig Macdonald [ 04/Apr/11 ]

Ilya, Can you tell me your affiliation?

Thanks
Craig

Generated at Thu Dec 14 10:19:37 GMT 2017 using JIRA 7.1.1#71004-sha1:d6b2c0d9b7051e9fb5e4eb8ce177ca56d91d7bd8.