Skip to content

Commit

Permalink
Use new line for multi class patch
Browse files Browse the repository at this point in the history
Signed-off-by: Ross Allan <rallanpcl@gmail.com>
  • Loading branch information
LunNova committed Jul 10, 2013
1 parent c013dad commit 7c875db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/common/nallar/tickthreading/patcher/PatchManager.java
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/common/nallar/tickthreading/util/CollectionsUtil.java
Expand Up @@ -30,7 +30,7 @@ public static List<? extends Object> newList(List<?> input, Function<Object, ?>
return newList;
}

private static List<String> split(String input, String delimiter) {
public static List<String> split(String input, String delimiter) {
if (input == null || input.isEmpty()) {
return Collections.emptyList();
}
Expand Down

0 comments on commit 7c875db

Please sign in to comment.