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

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1d 2h 49m 1 Michael McCandless 07/Dec/07 10:13
        Resolved Resolved Closed Closed
        48d 17h 10m 1 Michael Busch 25/Jan/08 03:24
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12562358 ] jira [ 12583352 ]
        Mark Thomas made changes -
        Workflow jira [ 12418702 ] Default workflow, editable Closed status [ 12562358 ]
        Michael Busch made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Michael McCandless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 2.3 [ 12312531 ]
        Hide
        Michael McCandless added a comment -

        I just committed this. Thanks Alan!

        Show
        Michael McCandless added a comment - I just committed this. Thanks Alan!
        Michael McCandless made changes -
        Attachment LUCENE-1082.patch [ 12371165 ]
        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.
        Alan Boo made changes -
        Description IndexReader.lastModified(String dir) or its variants always return null on 2.3, perhaps something to do with SegmentInfos's read(). IndexReader.lastModified(String dir) or its variants always return NPE on 2.3, perhaps something to do with SegmentInfo.
        Summary IndexReader.lastModified - always return null IndexReader.lastModified - throws NPE
        Michael McCandless made changes -
        Field Original Value New Value
        Assignee Michael McCandless [ mikemccand ]
        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
        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
        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
        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.
        Alan Boo created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development