From 8a9adec5741f3cd81972129919d76646f825d2f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Wed, 5 Apr 2017 16:40:35 +0300 Subject: [PATCH] Enabling ResourceFile CR filtering based on locale Change-Id: Ia16ff6a5fd090aca4f679a1d5aa1e5ae2590b37d --- .../compiler/internal/resourceFiles/ResourceFile.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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()); } } -- 2.47.1