]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Rewrote line endings for SCLReportingWriter.
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 26 Jan 2017 19:58:53 +0000 (21:58 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 26 Jan 2017 19:58:53 +0000 (21:58 +0200)
refs #7000

bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/reporting/SCLReportingWriter.java

index 5a12c7df810f451e4cf3be54468daf8c6f3c8511..424eeaa3806bc90409b24bf70dfc7144767732f5 100644 (file)
@@ -1,44 +1,44 @@
-package org.simantics.scl.runtime.reporting;\r
-\r
-import java.io.Writer;\r
-\r
-public class SCLReportingWriter extends Writer {\r
-       \r
-       StringBuilder builder = null;\r
-       \r
-       public SCLReportingWriter() {\r
-               builder = new StringBuilder();\r
-       }\r
-       \r
-       @Override\r
-       public void close() {\r
-               flush();\r
-       }\r
-\r
-       @Override\r
-       public void flush() {\r
-               if (builder.length() > 0) {\r
-                       SCLReporting.print(builder.toString());\r
-                       builder.setLength(0);\r
-               }\r
-       }\r
-\r
-       @Override\r
-       public void write(char[] buf, int off, int len) {\r
-               if (len == 0) return;\r
-               \r
-               if (len < 0) throw new IllegalArgumentException("Negative buffer region length");\r
-               if (off < 0) throw new IllegalArgumentException("Negative buffer region offset");\r
-               if (off + len > buf.length) throw new IllegalArgumentException("Buffer region overflow");\r
-               \r
-               for (int i = 0; i < len; i++) {\r
-                       if (buf[off + i] == '\n') {\r
-                               SCLReporting.print(builder.toString());\r
-                               builder.setLength(0);\r
-                       }\r
-                       else {\r
-                               builder.append(buf[off + i]);\r
-                       }\r
-               }\r
-       }\r
-}\r
+package org.simantics.scl.runtime.reporting;
+
+import java.io.Writer;
+
+public class SCLReportingWriter extends Writer {
+       
+       StringBuilder builder = null;
+       
+       public SCLReportingWriter() {
+               builder = new StringBuilder();
+       }
+       
+       @Override
+       public void close() {
+               flush();
+       }
+
+       @Override
+       public void flush() {
+               if (builder.length() > 0) {
+                       SCLReporting.print(builder.toString());
+                       builder.setLength(0);
+               }
+       }
+
+       @Override
+       public void write(char[] buf, int off, int len) {
+               if (len == 0) return;
+               
+               if (len < 0) throw new IllegalArgumentException("Negative buffer region length");
+               if (off < 0) throw new IllegalArgumentException("Negative buffer region offset");
+               if (off + len > buf.length) throw new IllegalArgumentException("Buffer region overflow");
+               
+               for (int i = 0; i < len; i++) {
+                       if (buf[off + i] == '\n') {
+                               SCLReporting.print(builder.toString());
+                               builder.setLength(0);
+                       }
+                       else {
+                               builder.append(buf[off + i]);
+                       }
+               }
+       }
+}