mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
Fix for array .remove() throwing UnsupportedOperationException
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5798 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -515,14 +515,10 @@ public class SimpleHTMLFragment extends AbstractWingElement {
|
|||||||
// FIXME: This may not work for windows people who
|
// FIXME: This may not work for windows people who
|
||||||
// insist on using \r\n for line breaks.
|
// insist on using \r\n for line breaks.
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// This cast is correct
|
String[] parts = rawText.split("\n\\s*\n");
|
||||||
List<String> parts = Arrays.asList(rawText.split("\n\\s*\n"));
|
if (parts.length > 0) {
|
||||||
|
for (int partIdx = 0; partIdx < parts.length - 1; partIdx++) {
|
||||||
if (parts.size() > 0) {
|
removed.add(new Text(parts[partIdx]));
|
||||||
String lastPart = parts.remove(parts.size()-1);
|
|
||||||
|
|
||||||
for (String part : parts) {
|
|
||||||
removed.add(new Text(part));
|
|
||||||
|
|
||||||
if (paragraphWrap(parent, i+1, removed)) {
|
if (paragraphWrap(parent, i+1, removed)) {
|
||||||
removed.clear();
|
removed.clear();
|
||||||
@@ -530,7 +526,7 @@ public class SimpleHTMLFragment extends AbstractWingElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
removed.add(new Text(lastPart));
|
removed.add(new Text(parts[parts.length - 1]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
removed.add(current);
|
removed.add(current);
|
||||||
|
Reference in New Issue
Block a user