From: Hannu Niemistö Date: Wed, 5 Apr 2017 13:40:35 +0000 (+0300) Subject: Enabling ResourceFile CR filtering based on locale X-Git-Tag: v1.29.0~116^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F406%2F1;p=simantics%2Fplatform.git Enabling ResourceFile CR filtering based on locale Change-Id: Ia16ff6a5fd090aca4f679a1d5aa1e5ae2590b37d --- diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/ResourceFile.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/ResourceFile.java index d9d155037..a847dbee1 100644 --- a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/ResourceFile.java +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/ResourceFile.java @@ -91,7 +91,7 @@ public class ResourceFile implements IResourceFile { @Override public InputStream getContent() { StringWriter writer = new StringWriter(); - write(new FilterCRWriter(writer)); + write(String.format("%n").length() == 1 ? new FilterCRWriter(writer) : writer); return new ByteArrayInputStream(writer.toString().getBytes(UTF8)); } @@ -108,11 +108,12 @@ public class ResourceFile implements IResourceFile { } public static void main(String[] args) { - ResourceRef Foo = new ResourceRef("Foo", "http://www.dsf.sdf/Foo"); + /*ResourceRef Foo = new ResourceRef("Foo", "http://www.dsf.sdf/Foo"); ResourceRef Bar = new ResourceRef("Foo", "http://www.dsf.sdf/Bar"); Bar.deprecated = true; new ResourceFile("org.simantics.graph", "Testi", Arrays.asList( Foo, Bar - )).write(new OutputStreamWriter(System.out)); + )).write(new OutputStreamWriter(System.out));*/ + System.out.println(String.format("%n").length()); } }