From 7c875db3c564dee8fe42b1c3f9080bd5693ed08d Mon Sep 17 00:00:00 2001 From: Ross Allan Date: Thu, 11 Jul 2013 00:24:19 +0100 Subject: [PATCH] Use new line for multi class patch Signed-off-by: Ross Allan --- src/common/nallar/tickthreading/patcher/PatchManager.java | 6 +++--- src/common/nallar/tickthreading/util/CollectionsUtil.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/nallar/tickthreading/patcher/PatchManager.java b/src/common/nallar/tickthreading/patcher/PatchManager.java index 966a4889..dcb3aa56 100644 --- a/src/common/nallar/tickthreading/patcher/PatchManager.java +++ b/src/common/nallar/tickthreading/patcher/PatchManager.java @@ -303,10 +303,10 @@ public void save(File file) throws TransformerException { private void splitMultiClassPatches() { for (Element classElement : DomUtil.getElementsByTag(configDocument.getDocumentElement(), "class")) { String classNames = classElement.getAttribute("id"); - if (classNames.contains(",")) { - for (String className : CollectionsUtil.split(classNames.trim())) { + if (classNames.contains("\n")) { + for (String className : CollectionsUtil.split(classNames.trim(), "\n")) { Element newClassElement = (Element) classElement.cloneNode(true); - newClassElement.setAttribute("id", className); + newClassElement.setAttribute("id", className.trim()); classElement.getParentNode().insertBefore(newClassElement, classElement); } classElement.getParentNode().removeChild(classElement); diff --git a/src/common/nallar/tickthreading/util/CollectionsUtil.java b/src/common/nallar/tickthreading/util/CollectionsUtil.java index c6b2d6c5..a241f6ce 100644 --- a/src/common/nallar/tickthreading/util/CollectionsUtil.java +++ b/src/common/nallar/tickthreading/util/CollectionsUtil.java @@ -30,7 +30,7 @@ public static List newList(List input, Function return newList; } - private static List split(String input, String delimiter) { + public static List split(String input, String delimiter) { if (input == null || input.isEmpty()) { return Collections.emptyList(); }