devicemap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From re...@apache.org
Subject svn commit: r1693337 - in /devicemap/trunk/clients/2.0/reference/src: DeviceMapClient.java JsonFile.java Main.java TransformerReplaceAll.java
Date Wed, 29 Jul 2015 19:28:03 GMT
Author: rezan
Date: Wed Jul 29 19:28:02 2015
New Revision: 1693337

URL: http://svn.apache.org/r1693337
Log:
hints

Modified:
    devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java
    devicemap/trunk/clients/2.0/reference/src/JsonFile.java
    devicemap/trunk/clients/2.0/reference/src/Main.java
    devicemap/trunk/clients/2.0/reference/src/TransformerReplaceAll.java

Modified: devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java?rev=1693337&r1=1693336&r2=1693337&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java Wed Jul 29 19:28:02 2015
@@ -42,8 +42,8 @@ public class DeviceMapClient {
     domain = null;
     domainVersion = null;
 
-    transformers = new ArrayList<Transformer>();
-    tokenSeperators = new ArrayList<byte[]>();
+    transformers = new ArrayList<>();
+    tokenSeperators = new ArrayList<>();
     ngramConcatSize = 1;
 
     defaultId = null;
@@ -78,7 +78,7 @@ public class DeviceMapClient {
 
       if(get(inputParser, "transformers").isArray()) {
         if(patch) {
-          transformers = new ArrayList<Transformer>();
+          transformers = new ArrayList<>();
         }
 
         for(Iterator<JsonNode> i = inputParser.get("transformers").iterator(); i.hasNext();)
{
@@ -96,7 +96,7 @@ public class DeviceMapClient {
 
       if(get(inputParser, "tokenSeperators").isArray()) {
         if(patch) {
-          tokenSeperators = new ArrayList<byte[]>();
+          tokenSeperators = new ArrayList<>();
         }
         
         for(Iterator<JsonNode> i = inputParser.get("tokenSeperators").iterator(); i.hasNext();)
{
@@ -259,7 +259,7 @@ public class DeviceMapClient {
     Main.log("Transformed: '" + transformed + "'", 3);
 
     //tokenization using bytes
-    List<String> tokens = new ArrayList<String>();
+    List<String> tokens = new ArrayList<>();
 
     byte[] source = transformed.getBytes();
     int sourcePos = 0;
@@ -298,11 +298,11 @@ public class DeviceMapClient {
 
     Main.log("Tokens: " + tokens, 3);
 
-    List<String> ngrams = new ArrayList<String>();
+    List<String> ngrams = new ArrayList<>();
 
     for(int i = 0; i < tokens.size(); i++) {
       String ngram = "";
-      List<String> ngramParts = new ArrayList<String>();
+      List<String> ngramParts = new ArrayList<>();
 
       for(int size = ngramConcatSize; size > 0 && i + ngramConcatSize - size <
tokens.size(); size--) {
         ngram += tokens.get(i + ngramConcatSize - size);

Modified: devicemap/trunk/clients/2.0/reference/src/JsonFile.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/JsonFile.java?rev=1693337&r1=1693336&r2=1693337&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/JsonFile.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/JsonFile.java Wed Jul 29 19:28:02 2015
@@ -23,11 +23,11 @@ import org.codehaus.jackson.map.ObjectMa
 
 public class JsonFile {
   
-  private JsonNode json;
+  private final JsonNode json;
 
-  private String type;
-  private String domain;
-  private String domainVersion;
+  private final String type;
+  private final String domain;
+  private final String domainVersion;
 
   public JsonFile(String path) throws Exception {
     ObjectMapper mapper = new ObjectMapper();

Modified: devicemap/trunk/clients/2.0/reference/src/Main.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/Main.java?rev=1693337&r1=1693336&r2=1693337&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/Main.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/Main.java Wed Jul 29 19:28:02 2015
@@ -31,9 +31,9 @@ public class Main {
 
     DeviceMapClient client = new DeviceMapClient();
 
-    List<String> patterns = new ArrayList<String>();
-    List<String> attributes = new ArrayList<String>();
-    List<String> tests = new ArrayList<String>();
+    List<String> patterns = new ArrayList<>();
+    List<String> attributes = new ArrayList<>();
+    List<String> tests = new ArrayList<>();
 
     String testString = null;
 

Modified: devicemap/trunk/clients/2.0/reference/src/TransformerReplaceAll.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/TransformerReplaceAll.java?rev=1693337&r1=1693336&r2=1693337&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/TransformerReplaceAll.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/TransformerReplaceAll.java Wed Jul 29 19:28:02
2015
@@ -20,8 +20,8 @@
 import org.codehaus.jackson.JsonNode;
 
 public class TransformerReplaceAll implements Transformer {
-  private String find;
-  private String replaceWith;
+  private final String find;
+  private final String replaceWith;
 
   public TransformerReplaceAll(JsonNode transformer) throws Exception {
     if(transformer.get("find") == null || transformer.get("find").asText().isEmpty()) {



Mime
View raw message