Skip to content

Commit 40125b2

Browse files
thaidlascboehme
authored andcommitted
Bugfix for RdfMacroPipe
Empty name parameter in literal(..)-method resulted in an StringIndexOutOfBoundsException. The parameter is checked with org.apache.commons.lang.StringUtils now and so the use of empty name parameter is possible again.
1 parent de3bbcd commit 40125b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/culturegraph/mf/stream/pipe/RdfMacroPipe.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.culturegraph.mf.stream.pipe;
1717

18+
import org.apache.commons.lang.StringUtils;
1819
import org.culturegraph.mf.framework.DefaultStreamPipe;
1920
import org.culturegraph.mf.framework.StreamReceiver;
2021
import org.culturegraph.mf.framework.annotations.Description;
@@ -76,7 +77,7 @@ public void endEntity() {
7677
@Override
7778
public void literal(final String name, final String value) {
7879
final int index = name.indexOf(LANGUAGE_MARKER);
79-
if (name.charAt(0)==REFERENCE_MARKER) {
80+
if (StringUtils.isNotEmpty(name) && name.charAt(0)==REFERENCE_MARKER) {
8081
getReceiver().startEntity(name.substring(1));
8182
getReceiver().literal(RDF_REFERENCE, value);
8283
getReceiver().endEntity();

0 commit comments

Comments
 (0)