commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [1/2] incubator-commonsrdf git commit: Use constants defined on StandardCharsets instead of retrieving Charsets by name
Date Fri, 31 Jul 2015 23:53:51 GMT
Repository: incubator-commonsrdf
Updated Branches:
  refs/heads/master 1103c868f -> 3b0028621


Use constants defined on StandardCharsets instead of retrieving Charsets by name


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/d9021b1a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/d9021b1a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/d9021b1a

Branch: refs/heads/master
Commit: d9021b1a37f5e957d324aa125dbc65e881757e8a
Parents: 7a0de10
Author: Benedikt Ritter <beneritter@gmail.com>
Authored: Fri May 1 23:06:14 2015 +0200
Committer: Benedikt Ritter <beneritter@gmail.com>
Committed: Fri May 1 23:06:14 2015 +0200

----------------------------------------------------------------------
 examples/src/example/UserGuideTest.java                       | 2 +-
 .../java/org/apache/commons/rdf/simple/TestWritingGraph.java  | 7 ++++---
 src/site/markdown/userguide.md.vm                             | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/d9021b1a/examples/src/example/UserGuideTest.java
----------------------------------------------------------------------
diff --git a/examples/src/example/UserGuideTest.java b/examples/src/example/UserGuideTest.java
index 3c66fbe..eab6b0d 100644
--- a/examples/src/example/UserGuideTest.java
+++ b/examples/src/example/UserGuideTest.java
@@ -214,6 +214,6 @@ public class UserGuideTest {
 
 	public static void writeGraph(Graph graph, Path graphFile) throws Exception {
         Stream<CharSequence> stream = graph.getTriples().map(UserGuideTest::tripleAsString);
-        Files.write(graphFile, stream::iterator, Charset.forName("UTF-8"));
+        Files.write(graphFile, stream::iterator, StandardCharsets.UTF_8);
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/d9021b1a/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
----------------------------------------------------------------------
diff --git a/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java b/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
index 3818e22..9862770 100644
--- a/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
+++ b/simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java
@@ -20,6 +20,7 @@ package org.apache.commons.rdf.simple;
 import static org.junit.Assert.assertEquals;
 
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.ArrayList;
@@ -123,7 +124,7 @@ public class TestWritingGraph {
         }
 
         Stream<CharSequence> stream = graph.getTriples().map(TestWritingGraph::tripleAsString);
-        Files.write(graphFile, stream::iterator, Charset.forName("UTF-8"));
+        Files.write(graphFile, stream::iterator, StandardCharsets.UTF_8);
     }
 
     @Test
@@ -139,7 +140,7 @@ public class TestWritingGraph {
         IRI predicate = factory.createIRI("pred");
         Stream<CharSequence> stream = graph
                 .getTriples(subject, predicate, null).map(TestWritingGraph::tripleAsString);
-        Files.write(graphFile, stream::iterator, Charset.forName("UTF-8"));
+        Files.write(graphFile, stream::iterator, StandardCharsets.UTF_8);
 
     }
 
@@ -156,7 +157,7 @@ public class TestWritingGraph {
         IRI predicate = factory.createIRI("pred");
         Stream<CharSequence> stream = graph
                 .getTriples(subject, predicate, null).map(Object::toString);
-        Files.write(graphFile, stream::iterator, Charset.forName("UTF-8"));
+        Files.write(graphFile, stream::iterator, StandardCharsets.UTF_8);
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/d9021b1a/src/site/markdown/userguide.md.vm
----------------------------------------------------------------------
diff --git a/src/site/markdown/userguide.md.vm b/src/site/markdown/userguide.md.vm
index cca6998..c26ae6c 100644
--- a/src/site/markdown/userguide.md.vm
+++ b/src/site/markdown/userguide.md.vm
@@ -231,7 +231,7 @@ public class NTriplesSerializer {
     }
     public static void writeGraph(Graph graph, Path graphFile) throws Exception {
         Stream<CharSequence> stream = graph.getTriples().map(NTriplesSerializer::tripleAsString);
-        Files.write(graphFile, stream::iterator, Charset.forName("UTF-8"));
+        Files.write(graphFile, stream::iterator, StandardCharsets.UTF_8);
     }
 }
 ```


Mime
View raw message