From c5ffe09a4688a0af1825c9959bba52f3c1ac5720 Mon Sep 17 00:00:00 2001 From: "Fuchs, Stefan" Date: Tue, 29 Mar 2022 13:28:51 +0200 Subject: [PATCH 1/3] removed unused imports --- .../com/schibsted/spt/data/jslt/Callable.java | 2 - .../schibsted/spt/data/jslt/Expression.java | 3 +- .../spt/data/jslt/FunctionUtils.java | 3 +- .../com/schibsted/spt/data/jslt/Parser.java | 34 +++++---------- .../com/schibsted/spt/data/jslt/cli/JSLT.java | 6 +-- .../spt/data/jslt/filters/TrueJsonFilter.java | 1 - .../impl/AbstractInvocationExpression.java | 13 ++---- .../spt/data/jslt/impl/AbstractOperator.java | 5 ++- .../spt/data/jslt/impl/ArraySlicer.java | 10 ++--- .../spt/data/jslt/impl/BiggerComparison.java | 1 - .../jslt/impl/BiggerOrEqualComparison.java | 1 - .../spt/data/jslt/impl/BuiltinFunctions.java | 41 +++++-------------- .../jslt/impl/ClasspathResourceResolver.java | 9 ++-- .../spt/data/jslt/impl/DivideOperator.java | 6 +-- .../spt/data/jslt/impl/DotExpression.java | 5 ++- .../data/jslt/impl/ExperimentalModule.java | 9 ++-- .../spt/data/jslt/impl/ExpressionImpl.java | 13 +++--- .../spt/data/jslt/impl/ExpressionNode.java | 3 +- .../jslt/impl/FileSystemResourceResolver.java | 15 +++---- .../spt/data/jslt/impl/ForExpression.java | 9 ++-- .../data/jslt/impl/FunctionDeclaration.java | 2 - .../data/jslt/impl/FunctionExpression.java | 3 -- .../spt/data/jslt/impl/FunctionWrapper.java | 18 +++----- .../spt/data/jslt/impl/IfExpression.java | 8 ++-- .../spt/data/jslt/impl/JstlFile.java | 4 +- .../spt/data/jslt/impl/LetExpression.java | 8 ++-- .../spt/data/jslt/impl/LiteralExpression.java | 2 +- .../spt/data/jslt/impl/MacroExpression.java | 6 --- .../spt/data/jslt/impl/MatcherExpression.java | 5 ++- .../spt/data/jslt/impl/MinusOperator.java | 9 ---- .../spt/data/jslt/impl/ModuleImpl.java | 5 ++- .../spt/data/jslt/impl/MultiplyOperator.java | 3 -- .../spt/data/jslt/impl/NodeUtils.java | 19 +++------ .../spt/data/jslt/impl/NumericOperator.java | 3 +- .../data/jslt/impl/ObjectComprehension.java | 14 ++----- .../spt/data/jslt/impl/ObjectExpression.java | 12 +----- .../impl/OptimizedStaticContainsFunction.java | 5 ++- .../spt/data/jslt/impl/PairExpression.java | 6 +-- .../spt/data/jslt/impl/ParseContext.java | 16 ++------ .../spt/data/jslt/impl/PlusOperator.java | 6 +-- .../schibsted/spt/data/jslt/impl/Scope.java | 8 ++-- .../spt/data/jslt/impl/ScopeManager.java | 7 ++-- .../spt/data/jslt/impl/SmallerComparison.java | 1 - .../jslt/impl/SmallerOrEqualsComparison.java | 1 - .../data/jslt/impl/lambda/LambdaFunction.java | 2 +- .../spt/data/jslt/parser/ParserImpl.java | 35 +++------------- .../jslt/FileSystemResourceResolverTest.java | 13 +++--- .../spt/data/jslt/FunctionWrapperTest.java | 10 ++--- .../schibsted/spt/data/jslt/ImportTest.java | 3 +- .../spt/data/jslt/JsonParseErrorTest.java | 19 +++------ .../spt/data/jslt/JsonParseTest.java | 18 ++++---- .../spt/data/jslt/QueryErrorTest.java | 20 ++++----- .../schibsted/spt/data/jslt/QueryTest.java | 16 ++------ .../schibsted/spt/data/jslt/StaticTests.java | 39 +++++++----------- .../schibsted/spt/data/jslt/TemplateTest.java | 8 ---- .../com/schibsted/spt/data/jslt/TestBase.java | 20 ++++----- .../spt/data/jslt/TestNullFunction.java | 1 - .../schibsted/spt/data/jslt/TestUtils.java | 9 ++-- .../schibsted/spt/data/jslt/ToStringTest.java | 8 +--- 59 files changed, 198 insertions(+), 383 deletions(-) diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/Callable.java b/core/src/main/java/com/schibsted/spt/data/jslt/Callable.java index 8a6adfdb..3bd80bbf 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/Callable.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/Callable.java @@ -15,8 +15,6 @@ package com.schibsted.spt.data.jslt; -import com.fasterxml.jackson.databind.JsonNode; - /** * Common interface for macros and functions. */ diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/Expression.java b/core/src/main/java/com/schibsted/spt/data/jslt/Expression.java index 25b663cc..796a54c4 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/Expression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/Expression.java @@ -15,9 +15,10 @@ package com.schibsted.spt.data.jslt; -import java.util.Map; import com.fasterxml.jackson.databind.JsonNode; +import java.util.Map; + /** * Represents a compiled JSLT expression. */ diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/FunctionUtils.java b/core/src/main/java/com/schibsted/spt/data/jslt/FunctionUtils.java index 9ebf01c7..b25d0f00 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/FunctionUtils.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/FunctionUtils.java @@ -15,9 +15,10 @@ package com.schibsted.spt.data.jslt; -import java.lang.reflect.Method; import com.schibsted.spt.data.jslt.impl.FunctionWrapper; +import java.lang.reflect.Method; + /** * Useful methods for working with Functions. */ diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java b/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java index 7cd788fa..a9e48df0 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java @@ -15,29 +15,17 @@ package com.schibsted.spt.data.jslt; -import java.util.Map; -import java.util.List; -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.io.File; -import java.io.Reader; -import java.io.FileReader; -import java.io.StringReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.FileNotFoundException; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.DoubleNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.BooleanNode; -import com.schibsted.spt.data.jslt.parser.*; -import com.schibsted.spt.data.jslt.impl.*; -import com.schibsted.spt.data.jslt.filters.*; +import com.schibsted.spt.data.jslt.filters.DefaultJsonFilter; +import com.schibsted.spt.data.jslt.filters.JsltJsonFilter; +import com.schibsted.spt.data.jslt.filters.JsonFilter; +import com.schibsted.spt.data.jslt.impl.ClasspathResourceResolver; +import com.schibsted.spt.data.jslt.impl.ParseContext; +import com.schibsted.spt.data.jslt.impl.PreparationContext; +import com.schibsted.spt.data.jslt.parser.JsltParser; +import com.schibsted.spt.data.jslt.parser.ParserImpl; + +import java.io.*; +import java.util.*; /** * Parses JSLT expressions to Expression objects for evaluating them. diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/cli/JSLT.java b/core/src/main/java/com/schibsted/spt/data/jslt/cli/JSLT.java index 17e8f14b..055b2d01 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/cli/JSLT.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/cli/JSLT.java @@ -15,13 +15,13 @@ package com.schibsted.spt.data.jslt.cli; -import java.io.File; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.schibsted.spt.data.jslt.Parser; import com.schibsted.spt.data.jslt.Expression; -import com.schibsted.spt.data.jslt.impl.ExpressionImpl; +import com.schibsted.spt.data.jslt.Parser; + +import java.io.File; public class JSLT { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/filters/TrueJsonFilter.java b/core/src/main/java/com/schibsted/spt/data/jslt/filters/TrueJsonFilter.java index 6fe87f6b..619e2643 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/filters/TrueJsonFilter.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/filters/TrueJsonFilter.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.filters; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.impl.NodeUtils; /** * Accepts all JSON values. diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractInvocationExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractInvocationExpression.java index 586c9c8b..3668ea7e 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractInvocationExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractInvocationExpression.java @@ -15,18 +15,13 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; import com.schibsted.spt.data.jslt.Callable; -import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.JsltException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + /** * Common superclass for function and macro expressions, to avoid * having to repeat so much code. diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractOperator.java index 2d32d537..38bb638f 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractOperator.java @@ -15,10 +15,11 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; +import java.util.ArrayList; +import java.util.List; + /** * Shared abstract superclass for comparison operators and others. */ diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArraySlicer.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArraySlicer.java index ae5cb62e..2036f590 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArraySlicer.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArraySlicer.java @@ -15,15 +15,15 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.TextNode; import com.schibsted.spt.data.jslt.JsltException; +import java.util.ArrayList; +import java.util.List; + /** * Indexing and slicing of arrays and also strings. */ diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerComparison.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerComparison.java index 89fa568f..9817216e 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerComparison.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerComparison.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.JsltException; public class BiggerComparison extends ComparisonOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerOrEqualComparison.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerOrEqualComparison.java index 15c0e35d..3c72665e 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerOrEqualComparison.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerOrEqualComparison.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.JsltException; public class BiggerOrEqualComparison extends ComparisonOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BuiltinFunctions.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BuiltinFunctions.java index f87db56f..99aedc69 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BuiltinFunctions.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BuiltinFunctions.java @@ -15,46 +15,27 @@ package com.schibsted.spt.data.jslt.impl; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.node.*; +import com.schibsted.spt.data.jslt.Function; +import com.schibsted.spt.data.jslt.JsltException; + import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLDecoder; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.SimpleTimeZone; -import java.util.TimeZone; -import java.util.TreeSet; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; import static java.nio.charset.StandardCharsets.UTF_8; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.MapperFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.BooleanNode; -import com.fasterxml.jackson.databind.node.DoubleNode; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.schibsted.spt.data.jslt.Function; -import com.schibsted.spt.data.jslt.JsltException; - /** * For now contains all the various function implementations. Should diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ClasspathResourceResolver.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ClasspathResourceResolver.java index 63eb39a2..cabd8cb9 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ClasspathResourceResolver.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ClasspathResourceResolver.java @@ -15,16 +15,15 @@ package com.schibsted.spt.data.jslt.impl; -import java.io.Reader; -import java.io.IOException; +import com.schibsted.spt.data.jslt.JsltException; +import com.schibsted.spt.data.jslt.ResourceResolver; + import java.io.InputStream; import java.io.InputStreamReader; +import java.io.Reader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import com.schibsted.spt.data.jslt.JsltException; -import com.schibsted.spt.data.jslt.ResourceResolver; - public class ClasspathResourceResolver implements ResourceResolver { private Charset charset; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/DivideOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/DivideOperator.java index 94687316..bba4af5b 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/DivideOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/DivideOperator.java @@ -16,13 +16,9 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.DoubleNode; import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.DoubleNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.schibsted.spt.data.jslt.JsltException; public class DivideOperator extends NumericOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/DotExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/DotExpression.java index 71ac2bdb..e45a9f03 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/DotExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/DotExpression.java @@ -15,11 +15,12 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Collections; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.NullNode; +import java.util.Collections; +import java.util.List; + public class DotExpression extends AbstractNode { private String key; private ExpressionNode parent; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExperimentalModule.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExperimentalModule.java index f516786f..1a87c4af 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExperimentalModule.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExperimentalModule.java @@ -15,15 +15,16 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import com.schibsted.spt.data.jslt.Module; import com.schibsted.spt.data.jslt.Callable; import com.schibsted.spt.data.jslt.JsltException; +import com.schibsted.spt.data.jslt.Module; + +import java.util.HashMap; +import java.util.Map; /** * A module containing functions and macros that *may* be officially diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionImpl.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionImpl.java index 97b5fffc..d9b14275 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionImpl.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionImpl.java @@ -15,16 +15,15 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Map; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; -import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.Expression; +import com.schibsted.spt.data.jslt.Function; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; /** * Wrapper class that translates an external Expression to an diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionNode.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionNode.java index 319ed246..ae61bb66 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionNode.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionNode.java @@ -15,9 +15,10 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; import com.fasterxml.jackson.databind.JsonNode; +import java.util.List; + /** * Internal interface for the parts of a compiled JSLT expression. * Different from the external interface because we want to avoid diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java index 3842c5ba..23f228ed 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java @@ -1,19 +1,14 @@ package com.schibsted.spt.data.jslt.impl; -import java.io.File; -import java.io.Reader; -import java.io.IOException; -import java.io.InputStream; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.nio.file.Path; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; - import com.schibsted.spt.data.jslt.JsltException; import com.schibsted.spt.data.jslt.ResourceResolver; +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; + public final class FileSystemResourceResolver implements ResourceResolver { private File rootPath; // can be null private Charset charset; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ForExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ForExpression.java index 61841f61..5ede6a15 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ForExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ForExpression.java @@ -15,14 +15,15 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.NullNode; import com.schibsted.spt.data.jslt.JsltException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + public class ForExpression extends AbstractNode { private ExpressionNode valueExpr; private LetExpression[] lets; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionDeclaration.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionDeclaration.java index 7b9d271b..77126965 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionDeclaration.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionDeclaration.java @@ -15,8 +15,6 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.databind.JsonNode; import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.JsltException; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionExpression.java index 30cc16b1..f458e262 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionExpression.java @@ -16,10 +16,7 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.IntNode; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.JsltException; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionWrapper.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionWrapper.java index 5e06516f..e1609951 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionWrapper.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionWrapper.java @@ -15,22 +15,16 @@ package com.schibsted.spt.data.jslt.impl; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; -import java.util.Map; -import java.util.HashMap; - import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.FloatNode; -import com.fasterxml.jackson.databind.node.DoubleNode; -import com.fasterxml.jackson.databind.node.BooleanNode; +import com.fasterxml.jackson.databind.node.*; import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.JsltException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; + public class FunctionWrapper implements Function { private String name; private Method method; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/IfExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/IfExpression.java index 4526a67a..00f082c3 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/IfExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/IfExpression.java @@ -15,13 +15,13 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.NullNode; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + public class IfExpression extends AbstractNode { private ExpressionNode test; private LetExpression[] thenlets; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/JstlFile.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/JstlFile.java index 8a44d472..92d15009 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/JstlFile.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/JstlFile.java @@ -16,10 +16,10 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.JsltException; -import com.schibsted.spt.data.jslt.Module; import com.schibsted.spt.data.jslt.Callable; import com.schibsted.spt.data.jslt.Function; +import com.schibsted.spt.data.jslt.JsltException; +import com.schibsted.spt.data.jslt.Module; /** * Represents a JSLT source code file loaded separately. diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/LetExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/LetExpression.java index 75de41aa..60a85f3a 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/LetExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/LetExpression.java @@ -15,12 +15,10 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Collections; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; + +import java.util.Collections; +import java.util.List; public class LetExpression extends AbstractNode { private String variable; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/LiteralExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/LiteralExpression.java index 4bd1c70c..562b2e2f 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/LiteralExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/LiteralExpression.java @@ -15,8 +15,8 @@ package com.schibsted.spt.data.jslt.impl; -import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; import com.schibsted.spt.data.jslt.JsltException; public class LiteralExpression extends AbstractNode { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MacroExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MacroExpression.java index fec9bfb9..d47290a1 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MacroExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MacroExpression.java @@ -16,12 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; -import com.schibsted.spt.data.jslt.Function; -import com.schibsted.spt.data.jslt.JsltException; // not sure we actually need this ExpressionNode class. maybe macros // should be expressions in their own right? it does mean we get to diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MatcherExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MatcherExpression.java index 57fa724c..57b2eb1d 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MatcherExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MatcherExpression.java @@ -15,10 +15,11 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Collections; import com.fasterxml.jackson.databind.JsonNode; +import java.util.Collections; +import java.util.List; + /** * Represents the '* - ... : .' */ diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MinusOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MinusOperator.java index 0f4bca36..fa7ebba8 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MinusOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MinusOperator.java @@ -15,15 +15,6 @@ package com.schibsted.spt.data.jslt.impl; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.DoubleNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.schibsted.spt.data.jslt.JsltException; - public class MinusOperator extends NumericOperator { public MinusOperator(ExpressionNode left, ExpressionNode right, diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ModuleImpl.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ModuleImpl.java index 3e6d9653..ab38a5d1 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ModuleImpl.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ModuleImpl.java @@ -15,10 +15,11 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Map; -import com.schibsted.spt.data.jslt.Module; import com.schibsted.spt.data.jslt.Callable; import com.schibsted.spt.data.jslt.Function; +import com.schibsted.spt.data.jslt.Module; + +import java.util.Map; /** * In-memory module. diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MultiplyOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MultiplyOperator.java index 86f86ad8..76e0ccea 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MultiplyOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MultiplyOperator.java @@ -16,10 +16,7 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.LongNode; import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.DoubleNode; import com.schibsted.spt.data.jslt.JsltException; public class MultiplyOperator extends NumericOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java index 2d437329..09e06943 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java @@ -15,24 +15,15 @@ package com.schibsted.spt.data.jslt.impl; -import java.math.BigInteger; -import java.io.IOException; -import java.util.Map; -import java.util.Iterator; -import java.util.Collections; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.DoubleNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.BigIntegerNode; +import com.fasterxml.jackson.databind.node.*; import com.schibsted.spt.data.jslt.JsltException; +import java.math.BigInteger; +import java.util.Iterator; +import java.util.Map; + public class NodeUtils { public static final ObjectMapper mapper = new ObjectMapper(); diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NumericOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NumericOperator.java index eeccddcd..da106605 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NumericOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NumericOperator.java @@ -16,10 +16,9 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.DoubleNode; import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.DoubleNode; public abstract class NumericOperator extends AbstractOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectComprehension.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectComprehension.java index af1a75be..6dfc5c78 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectComprehension.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectComprehension.java @@ -15,21 +15,15 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Set; -import java.util.Map; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.schibsted.spt.data.jslt.JsltException; import com.schibsted.spt.data.jslt.filters.JsonFilter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + public class ObjectComprehension extends AbstractNode { private ExpressionNode loop; private LetExpression[] lets; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java index eb93ce7a..cba0d488 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java @@ -15,22 +15,14 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Set; -import java.util.Map; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.IntNode; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.schibsted.spt.data.jslt.JsltException; import com.schibsted.spt.data.jslt.filters.JsonFilter; +import java.util.*; + public class ObjectExpression extends AbstractNode { private LetExpression[] lets; private PairExpression[] children; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/OptimizedStaticContainsFunction.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/OptimizedStaticContainsFunction.java index 24a58768..ec874891 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/OptimizedStaticContainsFunction.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/OptimizedStaticContainsFunction.java @@ -15,11 +15,12 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Set; -import java.util.HashSet; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.BooleanNode; +import java.util.HashSet; +import java.util.Set; + /** * An optimized version of contains(a, b) which is used when b is an * array literal with a large number of values, so that a linear diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/PairExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/PairExpression.java index 57b068d5..66a71593 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/PairExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/PairExpression.java @@ -15,12 +15,12 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Arrays; -import java.util.Collections; import com.fasterxml.jackson.databind.JsonNode; import com.schibsted.spt.data.jslt.JsltException; +import java.util.Arrays; +import java.util.List; + /** * Represents a ("key" : expr) pair inside a JSON object. */ diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ParseContext.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ParseContext.java index 5fee02a7..8cabb9ca 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ParseContext.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ParseContext.java @@ -15,19 +15,11 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Map; -import java.util.List; -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import com.schibsted.spt.data.jslt.Module; -import com.schibsted.spt.data.jslt.Callable; -import com.schibsted.spt.data.jslt.Function; -import com.schibsted.spt.data.jslt.JsltException; -import com.schibsted.spt.data.jslt.ResourceResolver; -import com.schibsted.spt.data.jslt.filters.JsonFilter; +import com.schibsted.spt.data.jslt.*; import com.schibsted.spt.data.jslt.filters.DefaultJsonFilter; +import com.schibsted.spt.data.jslt.filters.JsonFilter; + +import java.util.*; /** * Class to encapsulate context information like available functions, diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/PlusOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/PlusOperator.java index 7565843f..1680c46d 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/PlusOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/PlusOperator.java @@ -16,13 +16,9 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.DoubleNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import com.schibsted.spt.data.jslt.JsltException; +import com.fasterxml.jackson.databind.node.TextNode; public class PlusOperator extends NumericOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/Scope.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/Scope.java index d4f2047b..6d9438af 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/Scope.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/Scope.java @@ -15,12 +15,12 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Map; -import java.util.Collections; -import java.util.Deque; -import java.util.ArrayDeque; import com.fasterxml.jackson.databind.JsonNode; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.Map; + public class Scope { public static Scope getRoot(int stackFrameSize) { return new Scope(stackFrameSize); diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ScopeManager.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ScopeManager.java index 4eb9ac73..0e840a17 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ScopeManager.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ScopeManager.java @@ -15,11 +15,12 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Map; +import com.schibsted.spt.data.jslt.JsltException; + +import java.util.ArrayDeque; import java.util.Deque; import java.util.HashMap; -import java.util.ArrayDeque; -import com.schibsted.spt.data.jslt.JsltException; +import java.util.Map; /** * Keeps track of declared variables and maps them to their slots in diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerComparison.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerComparison.java index 05fc59af..8605a074 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerComparison.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerComparison.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.JsltException; public class SmallerComparison extends ComparisonOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerOrEqualsComparison.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerOrEqualsComparison.java index e77c18df..9e01e0d3 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerOrEqualsComparison.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerOrEqualsComparison.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.JsltException; public class SmallerOrEqualsComparison extends ComparisonOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/lambda/LambdaFunction.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/lambda/LambdaFunction.java index 1b054188..30b03257 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/lambda/LambdaFunction.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/lambda/LambdaFunction.java @@ -16,8 +16,8 @@ package com.schibsted.spt.data.jslt.impl.lambda; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.Parser; import com.schibsted.spt.data.jslt.Expression; +import com.schibsted.spt.data.jslt.Parser; import com.schibsted.spt.data.jslt.impl.NodeUtils; /** diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java b/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java index f5acc006..c9554a03 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java @@ -15,37 +15,14 @@ package com.schibsted.spt.data.jslt.parser; -import java.util.Map; -import java.util.Set; -import java.util.List; -import java.util.HashMap; -import java.util.HashSet; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.io.File; -import java.io.Reader; -import java.io.FileReader; -import java.io.StringReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.FileNotFoundException; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.DoubleNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.BooleanNode; -import com.schibsted.spt.data.jslt.Module; -import com.schibsted.spt.data.jslt.Callable; -import com.schibsted.spt.data.jslt.Function; -import com.schibsted.spt.data.jslt.Expression; -import com.schibsted.spt.data.jslt.JsltException; +import com.fasterxml.jackson.databind.node.*; +import com.schibsted.spt.data.jslt.*; import com.schibsted.spt.data.jslt.impl.*; -import com.schibsted.spt.data.jslt.filters.JsonFilter; + +import java.io.IOException; +import java.io.Reader; +import java.util.*; public class ParserImpl { diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/FileSystemResourceResolverTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/FileSystemResourceResolverTest.java index 35fb765d..bf833e4a 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/FileSystemResourceResolverTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/FileSystemResourceResolverTest.java @@ -1,8 +1,5 @@ package com.schibsted.spt.data.jslt; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.NullNode; @@ -10,14 +7,16 @@ import org.junit.Test; import java.io.File; +import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStreamReader; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; -import java.nio.file.*; +import java.nio.file.Files; +import java.nio.file.Paths; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; public class FileSystemResourceResolverTest { private static final ObjectMapper mapper = new ObjectMapper(); diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/FunctionWrapperTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/FunctionWrapperTest.java index 936022ce..6d4c2b7a 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/FunctionWrapperTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/FunctionWrapperTest.java @@ -1,14 +1,14 @@ package com.schibsted.spt.data.jslt; +import com.fasterxml.jackson.databind.JsonNode; +import org.junit.Test; + import java.util.Collection; import java.util.Collections; -import org.junit.Test; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; -import com.fasterxml.jackson.databind.JsonNode; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Test cases for the function wrapper implementations. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/ImportTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/ImportTest.java index 120ca972..0824c71d 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/ImportTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/ImportTest.java @@ -1,9 +1,10 @@ package com.schibsted.spt.data.jslt; -import java.util.Collections; import org.junit.Test; +import java.util.Collections; + /** * Test cases for imports. */ diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseErrorTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseErrorTest.java index 151c5084..e04df26c 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseErrorTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseErrorTest.java @@ -1,26 +1,17 @@ package com.schibsted.spt.data.jslt; -import java.util.List; -import java.util.ArrayList; -import java.util.Collection; -import java.io.IOException; -import java.io.Reader; -import java.io.InputStream; -import java.io.InputStreamReader; - +import com.fasterxml.jackson.databind.JsonNode; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.junit.Test; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; +import static org.junit.Assert.fail; /** * JSON parsing test cases that are supposed to cause syntax error. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseTest.java index 080a9310..7252ff64 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseTest.java @@ -1,23 +1,19 @@ package com.schibsted.spt.data.jslt; -import java.util.List; -import java.util.ArrayList; -import java.util.Collection; -import java.io.IOException; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.junit.Test; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; +import static org.junit.Assert.assertEquals; /** * JSON parsing test cases. Verifies that Jackson and JSLT produce the diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/QueryErrorTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/QueryErrorTest.java index 078044ff..b989ace3 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/QueryErrorTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/QueryErrorTest.java @@ -1,25 +1,19 @@ package com.schibsted.spt.data.jslt; -import java.util.Map; -import java.util.HashMap; -import java.util.List; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Collection; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.NullNode; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Checks that JSLT queries produce certain runtime errors. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java index 221a8037..5ed8d4f5 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java @@ -1,24 +1,16 @@ package com.schibsted.spt.data.jslt; -import java.util.Map; -import java.util.HashMap; -import java.util.List; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Collection; - +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; +import java.util.*; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.JsonNode; +import static org.junit.Assert.assertEquals; /** * Test cases verifying queries against an input. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java b/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java index f09da368..a7ce0cb3 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java @@ -1,34 +1,25 @@ package com.schibsted.spt.data.jslt; -import java.util.Map; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Collections; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.*; +import com.schibsted.spt.data.jslt.filters.TrueJsonFilter; +import com.schibsted.spt.data.jslt.impl.ClasspathResourceResolver; +import com.schibsted.spt.data.jslt.impl.ModuleImpl; +import org.junit.Ignore; +import org.junit.Test; + import java.io.IOException; import java.io.StringReader; -import java.nio.charset.StandardCharsets; - -import org.junit.Test; -import org.junit.Ignore; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.FloatNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.BigIntegerNode; - -import com.schibsted.spt.data.jslt.Module; -import com.schibsted.spt.data.jslt.impl.ModuleImpl; -import com.schibsted.spt.data.jslt.impl.ClasspathResourceResolver; -import com.schibsted.spt.data.jslt.filters.*; +import static org.junit.Assert.*; /** * Tests that cannot be expressed in JSON. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/TemplateTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/TemplateTest.java index 8948f79c..f2f02372 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/TemplateTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/TemplateTest.java @@ -1,15 +1,7 @@ package com.schibsted.spt.data.jslt; -import java.io.IOException; import org.junit.Test; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.NullNode; /** * Test cases verifying templates. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java b/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java index 2eec694a..ca0a5774 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java @@ -1,21 +1,19 @@ package com.schibsted.spt.data.jslt; -import java.util.Map; -import java.util.HashMap; -import java.util.Collection; -import java.util.Collections; -import java.io.Reader; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import org.junit.Test; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; +import java.io.Reader; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; +import static org.junit.Assert.*; /** * Utilities for test cases. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/TestNullFunction.java b/core/src/test/java/com/schibsted/spt/data/jslt/TestNullFunction.java index b93d1fc6..06b3b7d6 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/TestNullFunction.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/TestNullFunction.java @@ -2,7 +2,6 @@ package com.schibsted.spt.data.jslt; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.IntNode; public class TestNullFunction implements Function { diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/TestUtils.java b/core/src/test/java/com/schibsted/spt/data/jslt/TestUtils.java index d9efbf14..3ed225d0 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/TestUtils.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/TestUtils.java @@ -1,14 +1,15 @@ package com.schibsted.spt.data.jslt; -import java.io.IOException; -import java.io.Reader; -import java.io.InputStream; -import java.io.InputStreamReader; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + public class TestUtils { private static ObjectMapper jsonMapper = new ObjectMapper(); private static ObjectMapper yamlMapper = new ObjectMapper( diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/ToStringTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/ToStringTest.java index c3f572f5..33cb1e1f 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/ToStringTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/ToStringTest.java @@ -1,15 +1,9 @@ package com.schibsted.spt.data.jslt; -import java.io.IOException; import org.junit.Test; -import org.junit.Ignore; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.NullNode; +import static org.junit.Assert.assertEquals; /** * Verifying that toString works as it should. From 9bf586d30dcffb4b536f62ff3719db4b91b2fcb1 Mon Sep 17 00:00:00 2001 From: "Fuchs, Stefan" Date: Tue, 29 Mar 2022 13:38:17 +0200 Subject: [PATCH 2/3] removed * imports --- .../com/schibsted/spt/data/jslt/Parser.java | 15 +++++- .../spt/data/jslt/impl/AbstractNode.java | 2 +- .../spt/data/jslt/impl/ArrayExpression.java | 5 +- .../spt/data/jslt/impl/BoundedCache.java | 2 +- .../spt/data/jslt/impl/BuiltinFunctions.java | 25 +++++++-- .../jslt/impl/FileSystemResourceResolver.java | 7 ++- .../spt/data/jslt/impl/FunctionWrapper.java | 8 ++- .../spt/data/jslt/impl/NodeUtils.java | 10 +++- .../spt/data/jslt/impl/ObjectExpression.java | 8 ++- .../spt/data/jslt/impl/ParseContext.java | 13 ++++- .../spt/data/jslt/parser/ParserImpl.java | 54 +++++++++++++++++-- .../schibsted/spt/data/jslt/QueryTest.java | 7 ++- .../schibsted/spt/data/jslt/StaticTests.java | 11 +++- .../com/schibsted/spt/data/jslt/TestBase.java | 4 +- 14 files changed, 148 insertions(+), 23 deletions(-) diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java b/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java index a9e48df0..12aa7399 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java @@ -24,8 +24,19 @@ import com.schibsted.spt.data.jslt.parser.JsltParser; import com.schibsted.spt.data.jslt.parser.ParserImpl; -import java.io.*; -import java.util.*; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; /** * Parses JSLT expressions to Expression objects for evaluating them. diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractNode.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractNode.java index 762ac34a..b173c5c5 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractNode.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractNode.java @@ -15,8 +15,8 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; import java.util.Collections; +import java.util.List; public abstract class AbstractNode implements ExpressionNode { protected Location location; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArrayExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArrayExpression.java index a86c094d..67ff9680 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArrayExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArrayExpression.java @@ -15,11 +15,12 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Arrays; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; +import java.util.Arrays; +import java.util.List; + public class ArrayExpression extends AbstractNode { private ExpressionNode[] children; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BoundedCache.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BoundedCache.java index 8648c3fe..5ef29bc2 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BoundedCache.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BoundedCache.java @@ -15,8 +15,8 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Map; import java.util.LinkedHashMap; +import java.util.Map; /** * A Map implementation that deletes the oldest entry once the size diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BuiltinFunctions.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BuiltinFunctions.java index 99aedc69..fb556d5a 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BuiltinFunctions.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BuiltinFunctions.java @@ -16,8 +16,19 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.*; -import com.fasterxml.jackson.databind.node.*; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.BooleanNode; +import com.fasterxml.jackson.databind.node.DoubleNode; +import com.fasterxml.jackson.databind.node.IntNode; +import com.fasterxml.jackson.databind.node.LongNode; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.JsltException; @@ -29,7 +40,15 @@ import java.security.NoSuchAlgorithmException; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.SimpleTimeZone; +import java.util.TimeZone; +import java.util.TreeSet; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java index 23f228ed..fd25e496 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java @@ -4,7 +4,12 @@ import com.schibsted.spt.data.jslt.JsltException; import com.schibsted.spt.data.jslt.ResourceResolver; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Path; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionWrapper.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionWrapper.java index e1609951..86b6d5ec 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionWrapper.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionWrapper.java @@ -16,7 +16,13 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.*; +import com.fasterxml.jackson.databind.node.BooleanNode; +import com.fasterxml.jackson.databind.node.DoubleNode; +import com.fasterxml.jackson.databind.node.FloatNode; +import com.fasterxml.jackson.databind.node.IntNode; +import com.fasterxml.jackson.databind.node.LongNode; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.TextNode; import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.JsltException; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java index 09e06943..b4459550 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java @@ -17,7 +17,15 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.*; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.BigIntegerNode; +import com.fasterxml.jackson.databind.node.BooleanNode; +import com.fasterxml.jackson.databind.node.DoubleNode; +import com.fasterxml.jackson.databind.node.IntNode; +import com.fasterxml.jackson.databind.node.LongNode; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; import com.schibsted.spt.data.jslt.JsltException; import java.math.BigInteger; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java index cba0d488..c261c781 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java @@ -21,7 +21,13 @@ import com.schibsted.spt.data.jslt.JsltException; import com.schibsted.spt.data.jslt.filters.JsonFilter; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; public class ObjectExpression extends AbstractNode { private LetExpression[] lets; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ParseContext.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ParseContext.java index 8cabb9ca..bc6995b4 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ParseContext.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ParseContext.java @@ -15,11 +15,20 @@ package com.schibsted.spt.data.jslt.impl; -import com.schibsted.spt.data.jslt.*; +import com.schibsted.spt.data.jslt.Callable; +import com.schibsted.spt.data.jslt.Function; +import com.schibsted.spt.data.jslt.JsltException; +import com.schibsted.spt.data.jslt.Module; +import com.schibsted.spt.data.jslt.ResourceResolver; import com.schibsted.spt.data.jslt.filters.DefaultJsonFilter; import com.schibsted.spt.data.jslt.filters.JsonFilter; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * Class to encapsulate context information like available functions, diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java b/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java index c9554a03..dbda45df 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java @@ -16,13 +16,59 @@ package com.schibsted.spt.data.jslt.parser; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.*; -import com.schibsted.spt.data.jslt.*; -import com.schibsted.spt.data.jslt.impl.*; +import com.fasterxml.jackson.databind.node.BooleanNode; +import com.fasterxml.jackson.databind.node.DoubleNode; +import com.fasterxml.jackson.databind.node.IntNode; +import com.fasterxml.jackson.databind.node.LongNode; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.TextNode; +import com.schibsted.spt.data.jslt.Callable; +import com.schibsted.spt.data.jslt.Expression; +import com.schibsted.spt.data.jslt.Function; +import com.schibsted.spt.data.jslt.JsltException; +import com.schibsted.spt.data.jslt.Module; +import com.schibsted.spt.data.jslt.impl.AndOperator; +import com.schibsted.spt.data.jslt.impl.ArrayExpression; +import com.schibsted.spt.data.jslt.impl.ArraySlicer; +import com.schibsted.spt.data.jslt.impl.BiggerComparison; +import com.schibsted.spt.data.jslt.impl.BiggerOrEqualComparison; +import com.schibsted.spt.data.jslt.impl.DivideOperator; +import com.schibsted.spt.data.jslt.impl.DotExpression; +import com.schibsted.spt.data.jslt.impl.EqualsComparison; +import com.schibsted.spt.data.jslt.impl.ExpressionImpl; +import com.schibsted.spt.data.jslt.impl.ExpressionNode; +import com.schibsted.spt.data.jslt.impl.ForExpression; +import com.schibsted.spt.data.jslt.impl.FunctionDeclaration; +import com.schibsted.spt.data.jslt.impl.FunctionExpression; +import com.schibsted.spt.data.jslt.impl.IfExpression; +import com.schibsted.spt.data.jslt.impl.JstlFile; +import com.schibsted.spt.data.jslt.impl.LetExpression; +import com.schibsted.spt.data.jslt.impl.LiteralExpression; +import com.schibsted.spt.data.jslt.impl.Location; +import com.schibsted.spt.data.jslt.impl.Macro; +import com.schibsted.spt.data.jslt.impl.MacroExpression; +import com.schibsted.spt.data.jslt.impl.MatcherExpression; +import com.schibsted.spt.data.jslt.impl.MinusOperator; +import com.schibsted.spt.data.jslt.impl.MultiplyOperator; +import com.schibsted.spt.data.jslt.impl.ObjectComprehension; +import com.schibsted.spt.data.jslt.impl.ObjectExpression; +import com.schibsted.spt.data.jslt.impl.OrOperator; +import com.schibsted.spt.data.jslt.impl.PairExpression; +import com.schibsted.spt.data.jslt.impl.ParseContext; +import com.schibsted.spt.data.jslt.impl.PipeOperator; +import com.schibsted.spt.data.jslt.impl.PlusOperator; +import com.schibsted.spt.data.jslt.impl.SmallerComparison; +import com.schibsted.spt.data.jslt.impl.SmallerOrEqualsComparison; +import com.schibsted.spt.data.jslt.impl.UnequalsComparison; +import com.schibsted.spt.data.jslt.impl.VariableExpression; import java.io.IOException; import java.io.Reader; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class ParserImpl { diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java index 5ed8d4f5..327f8337 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java @@ -8,7 +8,12 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; import static org.junit.Assert.assertEquals; diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java b/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java index a7ce0cb3..6121b11e 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java @@ -3,7 +3,12 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.*; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.BigIntegerNode; +import com.fasterxml.jackson.databind.node.FloatNode; +import com.fasterxml.jackson.databind.node.IntNode; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.TextNode; import com.schibsted.spt.data.jslt.filters.TrueJsonFilter; import com.schibsted.spt.data.jslt.impl.ClasspathResourceResolver; import com.schibsted.spt.data.jslt.impl.ModuleImpl; @@ -19,7 +24,9 @@ import java.util.Iterator; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Tests that cannot be expressed in JSON. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java b/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java index ca0a5774..598ed3e3 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java @@ -13,7 +13,9 @@ import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Utilities for test cases. From 431592e67fc709c8cbaf7fc2fe3a51a1245cebc6 Mon Sep 17 00:00:00 2001 From: "Fuchs, Stefan" Date: Sat, 9 Apr 2022 16:22:54 +0200 Subject: [PATCH 3/3] removed unused imports --- .../com/schibsted/spt/data/jslt/Callable.java | 2 -- .../com/schibsted/spt/data/jslt/Parser.java | 7 ------- .../com/schibsted/spt/data/jslt/cli/JSLT.java | 3 +-- .../spt/data/jslt/filters/TrueJsonFilter.java | 1 - .../impl/AbstractInvocationExpression.java | 6 ------ .../spt/data/jslt/impl/ArraySlicer.java | 1 - .../spt/data/jslt/impl/BiggerComparison.java | 1 - .../jslt/impl/BiggerOrEqualComparison.java | 1 - .../jslt/impl/ClasspathResourceResolver.java | 1 - .../spt/data/jslt/impl/ExpressionImpl.java | 2 -- .../jslt/impl/FileSystemResourceResolver.java | 12 ++++++------ .../data/jslt/impl/FunctionDeclaration.java | 2 -- .../spt/data/jslt/impl/FunctionExpression.java | 3 --- .../spt/data/jslt/impl/IfExpression.java | 1 - .../spt/data/jslt/impl/LetExpression.java | 8 +++----- .../spt/data/jslt/impl/MacroExpression.java | 6 ------ .../spt/data/jslt/impl/MinusOperator.java | 9 --------- .../spt/data/jslt/impl/MultiplyOperator.java | 3 --- .../spt/data/jslt/impl/NodeUtils.java | 2 -- .../spt/data/jslt/impl/NumericOperator.java | 3 +-- .../data/jslt/impl/ObjectComprehension.java | 7 ------- .../spt/data/jslt/impl/ObjectExpression.java | 18 ++++++++---------- .../spt/data/jslt/impl/PairExpression.java | 6 +++--- .../spt/data/jslt/impl/PlusOperator.java | 6 +----- .../schibsted/spt/data/jslt/impl/Scope.java | 1 - .../spt/data/jslt/impl/SmallerComparison.java | 1 - .../jslt/impl/SmallerOrEqualsComparison.java | 1 - .../data/jslt/impl/lambda/LambdaFunction.java | 2 +- .../spt/data/jslt/parser/ParserImpl.java | 11 ----------- .../jslt/FileSystemResourceResolverTest.java | 2 -- .../spt/data/jslt/FunctionWrapperTest.java | 1 - .../spt/data/jslt/JsonParseErrorTest.java | 8 -------- .../schibsted/spt/data/jslt/JsonParseTest.java | 3 --- .../spt/data/jslt/QueryErrorTest.java | 5 ----- .../com/schibsted/spt/data/jslt/QueryTest.java | 2 -- .../schibsted/spt/data/jslt/StaticTests.java | 1 - .../schibsted/spt/data/jslt/TemplateTest.java | 8 -------- .../com/schibsted/spt/data/jslt/TestBase.java | 1 - .../spt/data/jslt/TestNullFunction.java | 1 - .../schibsted/spt/data/jslt/ToStringTest.java | 7 ------- 40 files changed, 24 insertions(+), 142 deletions(-) diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/Callable.java b/core/src/main/java/com/schibsted/spt/data/jslt/Callable.java index 8a6adfdb..3bd80bbf 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/Callable.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/Callable.java @@ -15,8 +15,6 @@ package com.schibsted.spt.data.jslt; -import com.fasterxml.jackson.databind.JsonNode; - /** * Common interface for macros and functions. */ diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java b/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java index 7cd788fa..0083249c 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/Parser.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt; import java.util.Map; -import java.util.List; import java.util.HashMap; import java.util.ArrayList; import java.util.Collection; @@ -29,12 +28,6 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.FileNotFoundException; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.DoubleNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.BooleanNode; import com.schibsted.spt.data.jslt.parser.*; import com.schibsted.spt.data.jslt.impl.*; import com.schibsted.spt.data.jslt.filters.*; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/cli/JSLT.java b/core/src/main/java/com/schibsted/spt/data/jslt/cli/JSLT.java index 17e8f14b..32c9afc0 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/cli/JSLT.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/cli/JSLT.java @@ -19,9 +19,8 @@ import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.schibsted.spt.data.jslt.Parser; import com.schibsted.spt.data.jslt.Expression; -import com.schibsted.spt.data.jslt.impl.ExpressionImpl; +import com.schibsted.spt.data.jslt.Parser; public class JSLT { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/filters/TrueJsonFilter.java b/core/src/main/java/com/schibsted/spt/data/jslt/filters/TrueJsonFilter.java index 6fe87f6b..619e2643 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/filters/TrueJsonFilter.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/filters/TrueJsonFilter.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.filters; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.impl.NodeUtils; /** * Accepts all JSON values. diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractInvocationExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractInvocationExpression.java index 586c9c8b..4fd5d079 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractInvocationExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/AbstractInvocationExpression.java @@ -18,13 +18,7 @@ import java.util.List; import java.util.Arrays; import java.util.ArrayList; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; import com.schibsted.spt.data.jslt.Callable; -import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.JsltException; /** diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArraySlicer.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArraySlicer.java index ae5cb62e..f448c652 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArraySlicer.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ArraySlicer.java @@ -18,7 +18,6 @@ import java.util.List; import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.IntNode; import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.ArrayNode; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerComparison.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerComparison.java index 89fa568f..9817216e 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerComparison.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerComparison.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.JsltException; public class BiggerComparison extends ComparisonOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerOrEqualComparison.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerOrEqualComparison.java index 15c0e35d..3c72665e 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerOrEqualComparison.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/BiggerOrEqualComparison.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.JsltException; public class BiggerOrEqualComparison extends ComparisonOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ClasspathResourceResolver.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ClasspathResourceResolver.java index 63eb39a2..317afd6d 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ClasspathResourceResolver.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ClasspathResourceResolver.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import java.io.Reader; -import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionImpl.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionImpl.java index 97b5fffc..fdca0466 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionImpl.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ExpressionImpl.java @@ -20,9 +20,7 @@ import java.util.Arrays; import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.Expression; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java index 3842c5ba..fd25e496 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FileSystemResourceResolver.java @@ -1,18 +1,18 @@ package com.schibsted.spt.data.jslt.impl; +import com.schibsted.spt.data.jslt.JsltException; +import com.schibsted.spt.data.jslt.ResourceResolver; + import java.io.File; -import java.io.Reader; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.io.FileInputStream; import java.io.InputStreamReader; -import java.nio.file.Path; +import java.io.Reader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; - -import com.schibsted.spt.data.jslt.JsltException; -import com.schibsted.spt.data.jslt.ResourceResolver; +import java.nio.file.Path; public final class FileSystemResourceResolver implements ResourceResolver { private File rootPath; // can be null diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionDeclaration.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionDeclaration.java index 7b9d271b..77126965 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionDeclaration.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionDeclaration.java @@ -15,8 +15,6 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.databind.JsonNode; import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.JsltException; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionExpression.java index 30cc16b1..f458e262 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/FunctionExpression.java @@ -16,10 +16,7 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.IntNode; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; import com.schibsted.spt.data.jslt.Function; import com.schibsted.spt.data.jslt.JsltException; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/IfExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/IfExpression.java index 4526a67a..c6960f03 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/IfExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/IfExpression.java @@ -19,7 +19,6 @@ import java.util.Arrays; import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.NullNode; public class IfExpression extends AbstractNode { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/LetExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/LetExpression.java index 75de41aa..60a85f3a 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/LetExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/LetExpression.java @@ -15,12 +15,10 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Collections; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; + +import java.util.Collections; +import java.util.List; public class LetExpression extends AbstractNode { private String variable; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MacroExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MacroExpression.java index fec9bfb9..d47290a1 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MacroExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MacroExpression.java @@ -16,12 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.BooleanNode; -import com.schibsted.spt.data.jslt.Function; -import com.schibsted.spt.data.jslt.JsltException; // not sure we actually need this ExpressionNode class. maybe macros // should be expressions in their own right? it does mean we get to diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MinusOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MinusOperator.java index 0f4bca36..fa7ebba8 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MinusOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MinusOperator.java @@ -15,15 +15,6 @@ package com.schibsted.spt.data.jslt.impl; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.DoubleNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.schibsted.spt.data.jslt.JsltException; - public class MinusOperator extends NumericOperator { public MinusOperator(ExpressionNode left, ExpressionNode right, diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MultiplyOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MultiplyOperator.java index 86f86ad8..76e0ccea 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/MultiplyOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/MultiplyOperator.java @@ -16,10 +16,7 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.LongNode; import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.DoubleNode; import com.schibsted.spt.data.jslt.JsltException; public class MultiplyOperator extends NumericOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java index 2d437329..38b3c12b 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NodeUtils.java @@ -16,10 +16,8 @@ package com.schibsted.spt.data.jslt.impl; import java.math.BigInteger; -import java.io.IOException; import java.util.Map; import java.util.Iterator; -import java.util.Collections; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.IntNode; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NumericOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NumericOperator.java index eeccddcd..da106605 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/NumericOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/NumericOperator.java @@ -16,10 +16,9 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.DoubleNode; import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.DoubleNode; public abstract class NumericOperator extends AbstractOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectComprehension.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectComprehension.java index af1a75be..64841ce0 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectComprehension.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectComprehension.java @@ -15,17 +15,10 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Set; -import java.util.Map; -import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.IntNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.schibsted.spt.data.jslt.JsltException; import com.schibsted.spt.data.jslt.filters.JsonFilter; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java index eb93ce7a..c261c781 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/ObjectExpression.java @@ -15,22 +15,20 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.Set; -import java.util.Map; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.IntNode; import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.schibsted.spt.data.jslt.JsltException; import com.schibsted.spt.data.jslt.filters.JsonFilter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + public class ObjectExpression extends AbstractNode { private LetExpression[] lets; private PairExpression[] children; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/PairExpression.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/PairExpression.java index 57b068d5..66a71593 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/PairExpression.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/PairExpression.java @@ -15,12 +15,12 @@ package com.schibsted.spt.data.jslt.impl; -import java.util.List; -import java.util.Arrays; -import java.util.Collections; import com.fasterxml.jackson.databind.JsonNode; import com.schibsted.spt.data.jslt.JsltException; +import java.util.Arrays; +import java.util.List; + /** * Represents a ("key" : expr) pair inside a JSON object. */ diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/PlusOperator.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/PlusOperator.java index 7565843f..1680c46d 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/PlusOperator.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/PlusOperator.java @@ -16,13 +16,9 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.NullNode; -import com.fasterxml.jackson.databind.node.DoubleNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import com.schibsted.spt.data.jslt.JsltException; +import com.fasterxml.jackson.databind.node.TextNode; public class PlusOperator extends NumericOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/Scope.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/Scope.java index d4f2047b..edf5535b 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/Scope.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/Scope.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import java.util.Map; -import java.util.Collections; import java.util.Deque; import java.util.ArrayDeque; import com.fasterxml.jackson.databind.JsonNode; diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerComparison.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerComparison.java index 05fc59af..8605a074 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerComparison.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerComparison.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.JsltException; public class SmallerComparison extends ComparisonOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerOrEqualsComparison.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerOrEqualsComparison.java index e77c18df..9e01e0d3 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerOrEqualsComparison.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/SmallerOrEqualsComparison.java @@ -16,7 +16,6 @@ package com.schibsted.spt.data.jslt.impl; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.JsltException; public class SmallerOrEqualsComparison extends ComparisonOperator { diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/impl/lambda/LambdaFunction.java b/core/src/main/java/com/schibsted/spt/data/jslt/impl/lambda/LambdaFunction.java index 1b054188..30b03257 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/impl/lambda/LambdaFunction.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/impl/lambda/LambdaFunction.java @@ -16,8 +16,8 @@ package com.schibsted.spt.data.jslt.impl.lambda; import com.fasterxml.jackson.databind.JsonNode; -import com.schibsted.spt.data.jslt.Parser; import com.schibsted.spt.data.jslt.Expression; +import com.schibsted.spt.data.jslt.Parser; import com.schibsted.spt.data.jslt.impl.NodeUtils; /** diff --git a/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java b/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java index f5acc006..421f4c5b 100644 --- a/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java +++ b/core/src/main/java/com/schibsted/spt/data/jslt/parser/ParserImpl.java @@ -16,28 +16,18 @@ package com.schibsted.spt.data.jslt.parser; import java.util.Map; -import java.util.Set; import java.util.List; import java.util.HashMap; -import java.util.HashSet; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; -import java.io.File; import java.io.Reader; -import java.io.FileReader; -import java.io.StringReader; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.FileNotFoundException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.IntNode; import com.fasterxml.jackson.databind.node.LongNode; import com.fasterxml.jackson.databind.node.DoubleNode; import com.fasterxml.jackson.databind.node.NullNode; import com.fasterxml.jackson.databind.node.TextNode; -import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.BooleanNode; import com.schibsted.spt.data.jslt.Module; import com.schibsted.spt.data.jslt.Callable; @@ -45,7 +35,6 @@ import com.schibsted.spt.data.jslt.Expression; import com.schibsted.spt.data.jslt.JsltException; import com.schibsted.spt.data.jslt.impl.*; -import com.schibsted.spt.data.jslt.filters.JsonFilter; public class ParserImpl { diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/FileSystemResourceResolverTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/FileSystemResourceResolverTest.java index 35fb765d..9c3d46b4 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/FileSystemResourceResolverTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/FileSystemResourceResolverTest.java @@ -12,9 +12,7 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; -import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.InputStreamReader; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.nio.file.*; diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/FunctionWrapperTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/FunctionWrapperTest.java index 936022ce..bf2e306b 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/FunctionWrapperTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/FunctionWrapperTest.java @@ -6,7 +6,6 @@ import org.junit.Test; import static org.junit.Assert.fail; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; import com.fasterxml.jackson.databind.JsonNode; diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseErrorTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseErrorTest.java index 151c5084..07e14a3f 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseErrorTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseErrorTest.java @@ -4,23 +4,15 @@ import java.util.List; import java.util.ArrayList; import java.util.Collection; -import java.io.IOException; -import java.io.Reader; -import java.io.InputStream; -import java.io.InputStreamReader; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.junit.Test; import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; /** * JSON parsing test cases that are supposed to cause syntax error. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseTest.java index 080a9310..44b7baf8 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/JsonParseTest.java @@ -11,9 +11,6 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.junit.Test; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; import com.fasterxml.jackson.databind.JsonNode; diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/QueryErrorTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/QueryErrorTest.java index 078044ff..54489233 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/QueryErrorTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/QueryErrorTest.java @@ -1,11 +1,8 @@ package com.schibsted.spt.data.jslt; -import java.util.Map; -import java.util.HashMap; import java.util.List; import java.util.ArrayList; -import java.util.Iterator; import java.util.Collection; import org.junit.Test; @@ -15,11 +12,9 @@ import static org.junit.Assert.fail; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.NullNode; /** * Checks that JSLT queries produce certain runtime errors. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java index 221a8037..b08335d4 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/QueryTest.java @@ -13,8 +13,6 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java b/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java index f09da368..3f06a65b 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/StaticTests.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.BigIntegerNode; -import com.schibsted.spt.data.jslt.Module; import com.schibsted.spt.data.jslt.impl.ModuleImpl; import com.schibsted.spt.data.jslt.impl.ClasspathResourceResolver; import com.schibsted.spt.data.jslt.filters.*; diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/TemplateTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/TemplateTest.java index 8948f79c..f2f02372 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/TemplateTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/TemplateTest.java @@ -1,15 +1,7 @@ package com.schibsted.spt.data.jslt; -import java.io.IOException; import org.junit.Test; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.NullNode; /** * Test cases verifying templates. diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java b/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java index 2eec694a..dec7757c 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/TestBase.java @@ -9,7 +9,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import org.junit.Test; import static org.junit.Assert.fail; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/TestNullFunction.java b/core/src/test/java/com/schibsted/spt/data/jslt/TestNullFunction.java index b93d1fc6..06b3b7d6 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/TestNullFunction.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/TestNullFunction.java @@ -2,7 +2,6 @@ package com.schibsted.spt.data.jslt; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.IntNode; public class TestNullFunction implements Function { diff --git a/core/src/test/java/com/schibsted/spt/data/jslt/ToStringTest.java b/core/src/test/java/com/schibsted/spt/data/jslt/ToStringTest.java index c3f572f5..37b18b5d 100644 --- a/core/src/test/java/com/schibsted/spt/data/jslt/ToStringTest.java +++ b/core/src/test/java/com/schibsted/spt/data/jslt/ToStringTest.java @@ -1,16 +1,9 @@ package com.schibsted.spt.data.jslt; -import java.io.IOException; import org.junit.Test; -import org.junit.Ignore; -import static org.junit.Assert.fail; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.NullNode; - /** * Verifying that toString works as it should. */