DS-419, fix array exception for unqualified metadata field specified

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4634 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Larry Stone
2009-12-16 21:10:55 +00:00
parent dad1166917
commit 4078f157a2

View File

@@ -391,24 +391,24 @@ public class EmbargoManager
} }
} }
// return the schema part of "schema.element.qualifier" metadata field // return the schema part of "schema.element.qualifier" metadata field spec
private static String getSchemaOf(String field) private static String getSchemaOf(String field)
{ {
String sa[] = field.split("\\.", 3); String sa[] = field.split("\\.", 3);
return sa[0]; return sa[0];
} }
// return the schema part of "schema.element.qualifier" metadata field // return the element part of "schema.element.qualifier" metadata field spec, if any
private static String getElementOf(String field) private static String getElementOf(String field)
{ {
String sa[] = field.split("\\.", 3); String sa[] = field.split("\\.", 3);
return sa.length > 0 ? sa[1] : null; return sa.length > 1 ? sa[1] : null;
} }
// return the schema part of "schema.element.qualifier" metadata field // return the qualifier part of "schema.element.qualifier" metadata field spec, if any
private static String getQualifierOf(String field) private static String getQualifierOf(String field)
{ {
String sa[] = field.split("\\.", 3); String sa[] = field.split("\\.", 3);
return sa.length > 1 ? sa[2] : null; return sa.length > 2 ? sa[2] : null;
} }
} }