From c403601faaa98ca179c22d28814f426b1d8619ef Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Thu, 26 Jan 2017 21:58:53 +0200 Subject: [PATCH] Rewrote line endings for SCLReportingWriter. refs #7000 --- .../runtime/reporting/SCLReportingWriter.java | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/reporting/SCLReportingWriter.java b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/reporting/SCLReportingWriter.java index 5a12c7df8..424eeaa38 100644 --- a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/reporting/SCLReportingWriter.java +++ b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/reporting/SCLReportingWriter.java @@ -1,44 +1,44 @@ -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]); - } - } - } -} +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]); + } + } + } +} -- 2.47.1