Skip to content
Snippets Groups Projects
Commit 9390b9b2 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- add more debugging output to find source of nullpointer exception

- workaround, because Fixity.FixityAlgorithm.MD5.toString() returns "MD5" as
uppercase, but fixity.getAlgorithm() returns "md5" as lowercase. This is a bug
in Rosetta SDK. As a workaround, we call "toLowerCase()" methods before
comparison.
parent 290a6426
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</fr:x_form> </fr:x_form>
</pl:initParameters> </pl:initParameters>
<pl:description>SLUB Storage Plugin</pl:description> <pl:description>SLUB Storage Plugin</pl:description>
<pl:version>2.801</pl:version> <pl:version>2.803</pl:version>
<pl:materialType>DIGITAL</pl:materialType> <pl:materialType>DIGITAL</pl:materialType>
<pl:module>Repository</pl:module> <pl:module>Repository</pl:module>
<pl:generalType>TASK</pl:generalType> <pl:generalType>TASK</pl:generalType>
......
...@@ -89,17 +89,21 @@ public class SLUBStoragePlugin extends AbstractStorageHandler { ...@@ -89,17 +89,21 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
for (Fixity fixity : fixities) for (Fixity fixity : fixities)
{ {
fixity.setResult(null); fixity.setResult(null);
if (Fixity.FixityAlgorithm.MD5.toString().equals(fixity.getAlgorithm())) log.info("SLUBStoragePlugin.checkFixity() getAlgorithm=" + fixity.getAlgorithm());
log.info("SLUBStoragePlugin.checkFixity() FixityAlgorithm.MD5=" + Fixity.FixityAlgorithm.MD5.toString());
log.info("SLUBStoragePlugin.checkFixity() FixityAlgorithm.SHA1=" + Fixity.FixityAlgorithm.SHA1.toString());
log.info("SLUBStoragePlugin.checkFixity() FixityAlgorithm.CRC32=" + Fixity.FixityAlgorithm.CRC32.toString());
if (Fixity.FixityAlgorithm.MD5.toString().toLowerCase().equals(fixity.getAlgorithm().toLowerCase()))
{ {
log.info("SLUBStoragePlugin.checkFixity() calcMD5=true"); log.info("SLUBStoragePlugin.checkFixity() calcMD5=true");
calcMD5 = true; calcMD5 = true;
} }
else if (Fixity.FixityAlgorithm.SHA1.toString().equals(fixity.getAlgorithm())) else if (Fixity.FixityAlgorithm.SHA1.toString().toLowerCase().equals(fixity.getAlgorithm().toLowerCase()))
{ {
log.info("SLUBStoragePlugin.checkFixity() calcSHA1=true"); log.info("SLUBStoragePlugin.checkFixity() calcSHA1=true");
calcSHA1 = true; calcSHA1 = true;
} }
else if (Fixity.FixityAlgorithm.CRC32.toString().equals(fixity.getAlgorithm())) else if (Fixity.FixityAlgorithm.CRC32.toString().toLowerCase().equals(fixity.getAlgorithm().toLowerCase()))
{ {
log.info("SLUBStoragePlugin.checkFixity() calcCRC32=true"); log.info("SLUBStoragePlugin.checkFixity() calcCRC32=true");
calcCRC32 = true; calcCRC32 = true;
...@@ -132,7 +136,7 @@ public class SLUBStoragePlugin extends AbstractStorageHandler { ...@@ -132,7 +136,7 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
{ {
log.info("SLUBStoragePlugin.checkFixity() checksummerAlgorithmIndex=" + checksummerAlgorithmIndex); log.info("SLUBStoragePlugin.checkFixity() checksummerAlgorithmIndex=" + checksummerAlgorithmIndex);
String oldValue = fixity.getValue(); String oldValue = fixity.getValue();
log.info("SLUBStoragePlugin.checkFixity() getAlgorithm=" + fixity.getAlgorithm()); log.info("SLUBStoragePlugin.checkFixity() getAlgorithm (2)=" + fixity.getAlgorithm());
log.info("SLUBStoragePlugin.checkFixity() oldvalue=" + oldValue); log.info("SLUBStoragePlugin.checkFixity() oldvalue=" + oldValue);
fixity.setValue(checksummer.getChecksum(fixity.getAlgorithm())); fixity.setValue(checksummer.getChecksum(fixity.getAlgorithm()));
log.info("SLUBStoragePlugin.checkFixity() newvalue=" + fixity.getValue()); log.info("SLUBStoragePlugin.checkFixity() newvalue=" + fixity.getValue());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment