keeps/commons-ip

Validation assumes labels on first structMap division, and checks for wrong value (e.g. CSIP86)

prettybits opened this issue · 0 comments

I'm separating this issue out from #165 (comment) to be able to track this independently of the CSIP88 issue.

As mentioned there, with packages following version 2.1.0 of the spec, a missing label on the first CSIP structMap division leads to a NullPointerException:

Exception in thread "main" java.lang.NullPointerException
        at org.roda_project.commons_ip2.validator.component.structuralMapComponent.StructuralMapComponentValidator.validateCSIP86(StructuralMapComponentValidator.java:615)
        at org.roda_project.commons_ip2.validator.component.structuralMapComponent.StructuralMapComponentValidator.validate(StructuralMapComponentValidator.java:92)
        at org.roda_project.commons_ip2.validator.EARKSIPValidator.validateComponents(EARKSIPValidator.java:183)
        at org.roda_project.commons_ip2.validator.EARKSIPValidator.validateRootMets(EARKSIPValidator.java:275)
        at org.roda_project.commons_ip2.validator.EARKSIPValidator.validate(EARKSIPValidator.java:159)
        at org.roda_project.commons_ip2.validator.CLI.CLIValidator.validate(CLIValidator.java:213)
        at org.roda_project.commons_ip2.validator.CLI.CLIValidator.start(CLIValidator.java:157)
        at org.roda_project.commons_ip2.validator.CLI.Main.main(Main.java:30)

While the exception needs to fixed either way, assuming validation against version 2.0.4 of the spec even with a label present the specific value that's expected for the is "CSIP" where the OBJID value would have been correct. This is currently true for CSIP86, CSIP88 and CSIP105-112.