From a415c2bb1b2a643b37d5ebb1d1e4afda175435ac Mon Sep 17 00:00:00 2001 From: Eugen Berlin Date: Tue, 26 Nov 2013 16:43:31 +0100 Subject: [PATCH] Fix: preserving blank characters (tabulator and space) in Cooja serial output --- tools/cooja/java/org/contikios/cooja/dialogs/SerialUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/org/contikios/cooja/dialogs/SerialUI.java b/tools/cooja/java/org/contikios/cooja/dialogs/SerialUI.java index 08f0457e4..bcc1a0734 100644 --- a/tools/cooja/java/org/contikios/cooja/dialogs/SerialUI.java +++ b/tools/cooja/java/org/contikios/cooja/dialogs/SerialUI.java @@ -102,7 +102,7 @@ public abstract class SerialUI extends Log implements SerialPort { if (data == '\n') { /* Notify observers of new log */ lastLogMessage = newMessage.toString(); - lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}]", ""); + lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}\\p{Blank}]", ""); newMessage.setLength(0); this.setChanged(); this.notifyObservers(getMote()); @@ -111,7 +111,7 @@ public abstract class SerialUI extends Log implements SerialPort { if (newMessage.length() > MAX_LENGTH) { /*logger.warn("Dropping too large log message (>" + MAX_LENGTH + " bytes).");*/ lastLogMessage = "# [1024 bytes, no line ending]: " + newMessage.substring(0, 20) + "..."; - lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}]", ""); + lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}\\p{Blank}]", ""); newMessage.setLength(0); this.setChanged(); this.notifyObservers(getMote());