Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-815

DCDate throws NullPointerException with mangled dates

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted / Claimed (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.7.0
    • Fix Version/s: None
    • Component/s: DSpace API
    • Labels:
      None
    • Environment:
      CentOS 5.4 with OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)
    • Attachments:
      1
    • Comments:
      12
    • Documentation Status:
      Needed

      Description

      DCDate.get*() methods throw a NullPointerException if the object has been constructed with a wrong date like "[17--?]" (DCDateTest patch attached):

      java.lang.NullPointerException
      at org.dspace.content.DCDate.getYear(DCDate.java:298)
      at org.dspace.content.DCDateTest.testDCDateString(DCDateTest.java:301)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

      It makes the browse by issue date fail in JSPUI.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mwood Mark H. Wood
              Reporter:
              alexm Àlex Magaz Graça
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: