jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/5] jena git commit: Reformat and tidy.
Date Sun, 31 Jul 2016 20:06:44 GMT
Reformat and tidy.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/86f2217a
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/86f2217a
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/86f2217a

Branch: refs/heads/master
Commit: 86f2217a8b09a20d9d0b93c83c858c83e1a974ac
Parents: 12f194a
Author: Andy Seaborne <andy@apache.org>
Authored: Sun Jul 31 14:41:46 2016 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Sun Jul 31 14:41:46 2016 +0100

----------------------------------------------------------------------
 .../org/apache/jena/atlas/json/JsonArray.java   | 86 ++++++++------------
 .../org/apache/jena/atlas/json/JsonBuilder.java |  6 +-
 .../apache/jena/riot/system/IRIResolver.java    |  2 +-
 .../org/apache/jena/atlas/json/TestJson.java    | 66 +++++++--------
 4 files changed, 66 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/86f2217a/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonArray.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonArray.java b/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonArray.java
index 023004c..7237314 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonArray.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonArray.java
@@ -52,151 +52,129 @@ public class JsonArray extends JsonValue implements List<JsonValue>
     { visitor.visit(this) ; }
 
     @Override
-    public boolean add(JsonValue e)
-    {
+    public boolean add(JsonValue e) {
         return array.add(e) ;
     }
 
-    public boolean add(String e)
-    {
+    public boolean add(String e) {
         return array.add(new JsonString(e)) ;
     }
 
-    public boolean add(long val)
-    {
+    public boolean add(long val) {
         return array.add(JsonNumber.value(val)) ;
     }
 
-    public boolean add(boolean b)
-    {
+    public boolean add(boolean b) {
         return array.add(new JsonBoolean(b)) ;
     }
 
     @Override
-    public void add(int index, JsonValue element)
-    { array.add(index, element) ; } 
+    public void add(int index, JsonValue element) {
+        array.add(index, element) ;
+    }
 
     @Override
-    public boolean addAll(Collection< ? extends JsonValue> c)
-    {
+    public boolean addAll(Collection<? extends JsonValue> c) {
         return array.addAll(c) ;
     }
 
     @Override
-    public boolean addAll(int index, Collection< ? extends JsonValue> c)
-    {
+    public boolean addAll(int index, Collection<? extends JsonValue> c) {
         return array.addAll(index, c) ;
     }
 
     @Override
-    public void clear()
-    { array.clear() ; }
+    public void clear() {
+        array.clear() ;
+    }
 
     @Override
-    public boolean contains(Object object)
-    {
+    public boolean contains(Object object) {
         return array.contains(object) ;
     }
 
     @Override
-    public boolean containsAll(Collection< ? > c)
-    {
+    public boolean containsAll(Collection<? > c) {
         return array.containsAll(c) ;
     }
 
     @Override
-    public JsonValue get(int index)
-    {
+    public JsonValue get(int index) {
         return array.get(index) ;
     }
 
     @Override
-    public int indexOf(Object o)
-    {
+    public int indexOf(Object o) {
         return array.indexOf(o) ;
     }
 
     @Override
-    public boolean isEmpty()
-    {
+    public boolean isEmpty() {
         return array.isEmpty() ;
     }
 
     @Override
-    public Iterator<JsonValue> iterator()
-    {
+    public Iterator<JsonValue> iterator() {
         return array.iterator() ;
     }
 
     @Override
-    public int lastIndexOf(Object o)
-    {
+    public int lastIndexOf(Object o) {
         return array.lastIndexOf(o) ;
     }
 
     @Override
-    public ListIterator<JsonValue> listIterator()
-    {
+    public ListIterator<JsonValue> listIterator() {
         return array.listIterator() ;
     }
 
     @Override
-    public ListIterator<JsonValue> listIterator(int index)
-    {
+    public ListIterator<JsonValue> listIterator(int index) {
         return array.listIterator(index) ;
     }
 
     @Override
-    public boolean remove(Object o)
-    {
+    public boolean remove(Object o) {
         return array.remove(o) ;
     }
 
     @Override
-    public JsonValue remove(int index)
-    {
+    public JsonValue remove(int index) {
         return array.remove(index) ;
     }
 
     @Override
-    public boolean removeAll(Collection< ? > c)
-    {
+    public boolean removeAll(Collection<? > c) {
         return array.removeAll(c) ;
     }
 
     @Override
-    public boolean retainAll(Collection< ? > c)
-    {
-        return  array.retainAll(c) ;
+    public boolean retainAll(Collection<? > c) {
+        return array.retainAll(c) ;
     }
 
     @Override
-    public JsonValue set(int index, JsonValue element)
-    {
+    public JsonValue set(int index, JsonValue element) {
         return array.set(index, element) ;
     }
 
     @Override
-    public int size()
-    {
+    public int size() {
         return array.size() ;
     }
 
     @Override
-    public List<JsonValue> subList(int fromIndex, int toIndex)
-    {
-        return array.subList(fromIndex, toIndex) ; 
+    public List<JsonValue> subList(int fromIndex, int toIndex) {
+        return array.subList(fromIndex, toIndex) ;
     }
 
     @Override
-    public Object[] toArray()
-    {
+    public Object[] toArray() {
         return array.toArray() ;
     }
 
     @Override
-    public <T> T[] toArray(T[] a)
-    {
+    public <T> T[] toArray(T[] a) {
         return array.toArray(a) ;
     }
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/86f2217a/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java b/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java
index 50336f1..d5f1ff1 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java
@@ -45,7 +45,7 @@ public class JsonBuilder {
     // The depth of this stack is the object depth. key: { key: ... } 
     private Deque<String> keys  = new ArrayDeque<>() ;
 
-    static JsonBuilder create() { return new JsonBuilder() ; }
+    public static JsonBuilder create() { return new JsonBuilder() ; }
     
     public JsonBuilder() {
 
@@ -81,7 +81,7 @@ public class JsonBuilder {
 
     public JsonBuilder finishObject(String finishMarker) {
         if ( stack.isEmpty() )
-            throw new JsonException("Alignment error : already built outer most object or
array") ; 
+            throw new JsonException("Alignment error : already built outer-most object or
array") ; 
         State state = stack.pop() ;
         if ( state != State.OBJECT )
             throw new JsonException("JSON build error : not in an object") ;
@@ -103,7 +103,7 @@ public class JsonBuilder {
 
     public JsonBuilder finishArray() {
         if ( stack.isEmpty() )
-            throw new JsonException("Alignment error : already built outer most object or
array") ; 
+            throw new JsonException("Alignment error : already built outer-most object or
array") ; 
 
         State state = stack.pop() ;
         if ( state != State.ARRAY )

http://git-wip-us.apache.org/repos/asf/jena/blob/86f2217a/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java b/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java
index 73fd775..7a199e1 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/IRIResolver.java
@@ -96,7 +96,7 @@ public abstract class IRIResolver
 
     // ---- Initialization support
     
-    /** Set the error/warnign state of a violation code.
+    /** Set the error/warning state of a violation code.
      * @param factory   IRIFactory
      * @param code      ViolationCodes constant
      * @param isError   Whether it is to be treated an error.

http://git-wip-us.apache.org/repos/asf/jena/blob/86f2217a/jena-arq/src/test/java/org/apache/jena/atlas/json/TestJson.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/atlas/json/TestJson.java b/jena-arq/src/test/java/org/apache/jena/atlas/json/TestJson.java
index 60eb248..3b6398d 100644
--- a/jena-arq/src/test/java/org/apache/jena/atlas/json/TestJson.java
+++ b/jena-arq/src/test/java/org/apache/jena/atlas/json/TestJson.java
@@ -24,81 +24,75 @@ import org.junit.Test ;
 
 public class TestJson extends BaseTest
 {
-    @Test public void js_value_1()
-    { 
+    @Test
+    public void js_value_1() {
         read("\"abc\"", new JsonString("abc")) ;
     }
-    
-    @Test public void js_value_2()
-    { 
+
+    @Test
+    public void js_value_2() {
         read("123", JsonNumber.value(123)) ;
     }
-    
-    @Test public void js_value_3()
-    { 
+
+    @Test
+    public void js_value_3() {
         read("true", new JsonBoolean(true)) ;
     }
 
-    @Test public void js_value_4()
-    { 
+    @Test
+    public void js_value_4() {
         read("{}", new JsonObject()) ;
     }
 
-    @Test public void js_value_5()
-    { 
+    @Test
+    public void js_value_5() {
         JsonObject obj = new JsonObject() ;
         obj.put("a", JsonNumber.value(123)) ;
         read("{ \"a\": 123 }", obj) ;
     }
 
-    
-    @Test public void js_value_6()
-    { 
+    @Test
+    public void js_value_6() {
         JsonArray array = new JsonArray() ;
         read("[ ]", array) ;
     }
 
-    @Test public void js_value_7()
-    { 
+    @Test
+    public void js_value_7() {
         JsonArray array = new JsonArray() ;
         array.add(JsonNumber.value(123)) ;
         read("[ 123 ]", array) ;
     }
-    
-    @Test public void js_value_8()
-    { 
+
+    @Test
+    public void js_value_8() {
         JsonObject obj = new JsonObject() ;
         JsonArray array = new JsonArray() ;
         array.add(JsonNumber.value(123)) ;
         obj.put("a", array) ;
-        read("{ \"a\" : [ 123 ] }", obj) ; 
+        read("{ \"a\" : [ 123 ] }", obj) ;
     }
 
-    
-    @Test(expected=JsonParseException.class)
-    public void js_value_9()
-    {
+    @Test(expected = JsonParseException.class)
+    public void js_value_9() {
         JSON.parse("[1 2 3]") ;
     }
-    
-    @Test(expected=JsonParseException.class)
-    public void js_value_10()
-    {
+
+    @Test(expected = JsonParseException.class)
+    public void js_value_10() {
         JSON.parse("1") ;
     }
 
-    @Test(expected=JsonParseException.class)
-    public void js_value_11()
-    {
+    @Test(expected = JsonParseException.class)
+    public void js_value_11() {
         JSON.parse("\"foo\"") ;
     }
-    
+
     @Test()
-    public void js_value_12()
-    {
+    public void js_value_12() {
         JSON.parse("{}") ;
     }
-    
+
     @Test
     public void js_value_13() {
         read("\"abc\\bd\"", new JsonString("abc\bd")) ;


Mime
View raw message