mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +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
|
||||
// insist on using \r\n for line breaks.
|
||||
@SuppressWarnings("unchecked")
|
||||
// This cast is correct
|
||||
List<String> parts = Arrays.asList(rawText.split("\n\\s*\n"));
|
||||
|
||||
if (parts.size() > 0) {
|
||||
String lastPart = parts.remove(parts.size()-1);
|
||||
|
||||
for (String part : parts) {
|
||||
removed.add(new Text(part));
|
||||
String[] parts = rawText.split("\n\\s*\n");
|
||||
if (parts.length > 0) {
|
||||
for (int partIdx = 0; partIdx < parts.length - 1; partIdx++) {
|
||||
removed.add(new Text(parts[partIdx]));
|
||||
|
||||
if (paragraphWrap(parent, i+1, removed)) {
|
||||
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 {
|
||||
removed.add(current);
|
||||
|
Reference in New Issue
Block a user