Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: core/index
    • Labels:
      None
    • Environment:

      Windows variants.

    • Lucene Fields:
      New

      Description

      IndexReader.lastModified(String dir) or its variants always return NPE on 2.3, perhaps something to do with SegmentInfo.

      1. LUCENE-1082.patch
        7 kB
        Michael McCandless

        Activity

        Hide
        Michael McCandless added a comment -

        Could you provide more details here?

        That method returns a long so it can't return null. Do you mean it's returning 0?

        TestIndexReader has a case that tests this method and it seems to be working from what I can tell.

        Show
        Michael McCandless added a comment - Could you provide more details here? That method returns a long so it can't return null. Do you mean it's returning 0? TestIndexReader has a case that tests this method and it seems to be working from what I can tell.
        Hide
        Alan Boo added a comment -

        sorry, i mean i get a npe when i called IndexReader.lastModified, it's was working fine in lucene 2.1 and below.

        Show
        Alan Boo added a comment - sorry, i mean i get a npe when i called IndexReader.lastModified, it's was working fine in lucene 2.1 and below.
        Hide
        Alan Boo added a comment -

        by the way. here is the stack trace.

        java.lang.NullPointerException
        at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:534)
        at org.apache.lucene.index.IndexReader.lastModified(IndexReader.java:286)
        at org.apache.lucene.index.IndexReader.lastModified(IndexReader.java:275)
        at com.alanboo.lucene.test.AbstractCollection.getDateIndexedAsString(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:589)

        Show
        Alan Boo added a comment - by the way. here is the stack trace. java.lang.NullPointerException at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:534) at org.apache.lucene.index.IndexReader.lastModified(IndexReader.java:286) at org.apache.lucene.index.IndexReader.lastModified(IndexReader.java:275) at com.alanboo.lucene.test.AbstractCollection.getDateIndexedAsString(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:589)
        Hide
        Michael McCandless added a comment -

        OK I see this issue. I'll fix it. Thanks for reporting Alan!

        Show
        Michael McCandless added a comment - OK I see this issue. I'll fix it. Thanks for reporting Alan!
        Hide
        Michael McCandless added a comment -

        Attached patch. I will commit soon.

        This issue was caused by LUCENE-1011, so indeed only appeared in 2.3.

        Show
        Michael McCandless added a comment - Attached patch. I will commit soon. This issue was caused by LUCENE-1011 , so indeed only appeared in 2.3.
        Hide
        Michael McCandless added a comment -

        I just committed this. Thanks Alan!

        Show
        Michael McCandless added a comment - I just committed this. Thanks Alan!

          People

          • Assignee:
            Michael McCandless
            Reporter:
            Alan Boo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development