From 9e968ef0d383fd66b833d455e1b125a5ce6036aa Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 9 Oct 2023 10:30:38 -0400 Subject: [PATCH] Use Checkstyle to validate import order --- src/main/config/checkstyle.xml | 7 ++ .../apache/commons/jexl3/JexlArithmetic.java | 4 +- .../org/apache/commons/jexl3/JexlBuilder.java | 10 +- .../org/apache/commons/jexl3/JexlEngine.java | 4 +- .../apache/commons/jexl3/JexlException.java | 18 ++-- .../apache/commons/jexl3/JexlFeatures.java | 2 +- .../commons/jexl3/internal/ArrayBuilder.java | 6 +- .../commons/jexl3/internal/Closure.java | 6 +- .../commons/jexl3/internal/Debugger.java | 100 ++++++++++++++++-- .../apache/commons/jexl3/internal/Engine.java | 34 +++--- .../commons/jexl3/internal/FqcnResolver.java | 6 +- .../commons/jexl3/internal/Interpreter.java | 91 +++++++++++++++- .../jexl3/internal/InterpreterBase.java | 3 +- .../commons/jexl3/internal/MapBuilder.java | 1 + .../commons/jexl3/internal/Operators.java | 6 +- .../apache/commons/jexl3/internal/Script.java | 14 +-- .../commons/jexl3/internal/ScriptVisitor.java | 88 ++++++++++++++- .../commons/jexl3/internal/SetBuilder.java | 3 +- .../apache/commons/jexl3/internal/Source.java | 4 +- .../jexl3/internal/TemplateDebugger.java | 1 - .../jexl3/internal/TemplateEngine.java | 21 ++-- .../jexl3/internal/TemplateInterpreter.java | 6 +- .../jexl3/internal/TemplateScript.java | 22 ++-- .../introspection/BooleanGetExecutor.java | 1 + .../internal/introspection/ClassMap.java | 6 +- .../introspection/ConstructorMethod.java | 1 + .../introspection/DuckGetExecutor.java | 1 + .../introspection/DuckSetExecutor.java | 1 + .../introspection/EnumerationIterator.java | 2 +- .../introspection/FieldGetExecutor.java | 1 + .../introspection/FieldSetExecutor.java | 1 + .../internal/introspection/IndexedType.java | 5 +- .../internal/introspection/Introspector.java | 8 +- .../introspection/ListGetExecutor.java | 2 +- .../introspection/ListSetExecutor.java | 2 +- .../introspection/MethodExecutor.java | 3 +- .../internal/introspection/MethodKey.java | 1 - .../introspection/PropertyGetExecutor.java | 1 + .../introspection/PropertySetExecutor.java | 1 + .../introspection/SandboxUberspect.java | 6 +- .../internal/introspection/Uberspect.java | 29 +++-- .../jexl3/introspection/JexlPermissions.java | 4 +- .../jexl3/introspection/JexlUberspect.java | 6 +- .../commons/jexl3/parser/ASTJexlScript.java | 5 +- .../commons/jexl3/parser/JexlParser.java | 14 +-- .../jexl3/scripting/JexlScriptEngine.java | 1 - .../scripting/JexlScriptEngineFactory.java | 9 +- .../apache/commons/jexl3/scripting/Main.java | 2 +- .../apache/commons/jexl3/AnnotationTest.java | 1 + .../apache/commons/jexl3/AntishCallTest.java | 1 + .../commons/jexl3/ArithmeticOperatorTest.java | 15 ++- .../apache/commons/jexl3/ArithmeticTest.java | 23 ++-- .../commons/jexl3/ArrayLiteralTest.java | 1 + .../org/apache/commons/jexl3/AssignTest.java | 4 +- .../org/apache/commons/jexl3/BuilderTest.java | 4 +- .../org/apache/commons/jexl3/CacheTest.java | 5 +- .../org/apache/commons/jexl3/CaptureLog.java | 1 + .../apache/commons/jexl3/ClassCreator.java | 1 + .../commons/jexl3/CollectionLiteralTest.java | 8 +- .../commons/jexl3/ComposePermissionsTest.java | 3 +- .../commons/jexl3/ContextNamespaceTest.java | 6 +- .../org/apache/commons/jexl3/DoWhileTest.java | 6 +- .../apache/commons/jexl3/FeaturesTest.java | 1 + .../apache/commons/jexl3/Issues100Test.java | 5 +- .../apache/commons/jexl3/Issues200Test.java | 2 +- .../apache/commons/jexl3/Issues300Test.java | 14 +-- .../apache/commons/jexl3/Issues400Test.java | 6 +- .../org/apache/commons/jexl3/IssuesTest.java | 6 +- .../org/apache/commons/jexl3/JXLTTest.java | 16 +-- .../java/org/apache/commons/jexl3/Jexl.java | 3 +- .../apache/commons/jexl3/JexlEvalContext.java | 1 + .../org/apache/commons/jexl3/LambdaTest.java | 10 +- .../org/apache/commons/jexl3/LexicalTest.java | 5 +- .../apache/commons/jexl3/MapLiteralTest.java | 1 + .../org/apache/commons/jexl3/MethodTest.java | 7 +- .../org/apache/commons/jexl3/RangeTest.java | 1 + .../commons/jexl3/ScriptCallableTest.java | 1 + .../apache/commons/jexl3/SetLiteralTest.java | 1 + .../apache/commons/jexl3/SideEffectTest.java | 2 +- .../apache/commons/jexl3/StrategyTest.java | 5 +- .../jexl3/SynchronizedOverloadsTest.java | 1 + .../commons/jexl3/examples/ArrayTest.java | 10 +- .../jexl3/examples/MethodPropertyTest.java | 2 +- .../commons/jexl3/examples/StreamTest.java | 16 +-- .../commons/jexl3/internal/RangeTest.java | 3 +- .../apache/commons/jexl3/internal/Util.java | 1 + .../internal/introspection/DiscoveryTest.java | 10 +- .../introspection/MiscIntrospectionTest.java | 6 +- .../internal/introspection/NoJexlTest.java | 8 +- .../introspection/PermissionsTest.java | 22 ++-- .../jexl3/jexl342/OptionalArithmetic.java | 4 +- .../jexl3/jexl342/OptionalNullGetter.java | 4 +- .../jexl3/jexl342/OptionalNullSetter.java | 4 +- .../commons/jexl3/jexl342/OptionalTest.java | 14 +-- .../jexl3/jexl342/ReferenceUberspect.java | 18 ++-- .../apache/commons/jexl3/junit/Asserter.java | 3 +- .../JexlScriptEngineOptionalTest.java | 3 +- src/test/java/org/example/SomeTest.java | 14 +-- 98 files changed, 580 insertions(+), 299 deletions(-) diff --git a/src/main/config/checkstyle.xml b/src/main/config/checkstyle.xml index 8f367cc6e..708507206 100644 --- a/src/main/config/checkstyle.xml +++ b/src/main/config/checkstyle.xml @@ -91,6 +91,13 @@ limitations under the License. + + + + + + + diff --git a/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java b/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java index 5ed7a4240..f92a02747 100644 --- a/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java +++ b/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java @@ -17,7 +17,7 @@ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.introspection.JexlMethod; +import static java.lang.StrictMath.floor; import java.lang.reflect.Array; import java.lang.reflect.Constructor; @@ -32,7 +32,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static java.lang.StrictMath.floor; +import org.apache.commons.jexl3.introspection.JexlMethod; /** * Perform arithmetic, implements JexlOperator methods. diff --git a/src/main/java/org/apache/commons/jexl3/JexlBuilder.java b/src/main/java/org/apache/commons/jexl3/JexlBuilder.java index b27a3e862..256cd4295 100644 --- a/src/main/java/org/apache/commons/jexl3/JexlBuilder.java +++ b/src/main/java/org/apache/commons/jexl3/JexlBuilder.java @@ -17,17 +17,17 @@ package org.apache.commons.jexl3; +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; + import org.apache.commons.jexl3.internal.Engine; import org.apache.commons.jexl3.introspection.JexlPermissions; import org.apache.commons.jexl3.introspection.JexlSandbox; import org.apache.commons.jexl3.introspection.JexlUberspect; import org.apache.commons.logging.Log; -import java.util.Arrays; -import java.util.Collection; -import java.util.Map; -import java.nio.charset.Charset; - /** * Configures and builds a JexlEngine. * diff --git a/src/main/java/org/apache/commons/jexl3/JexlEngine.java b/src/main/java/org/apache/commons/jexl3/JexlEngine.java index 14932f8e8..a57050f6b 100644 --- a/src/main/java/org/apache/commons/jexl3/JexlEngine.java +++ b/src/main/java/org/apache/commons/jexl3/JexlEngine.java @@ -17,8 +17,6 @@ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.introspection.JexlUberspect; - import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -28,6 +26,8 @@ import java.net.URL; import java.nio.charset.Charset; +import org.apache.commons.jexl3.introspection.JexlUberspect; + /** * Creates and evaluates JexlExpression and JexlScript objects. * Determines the behavior of expressions and scripts during their evaluation with respect to: diff --git a/src/main/java/org/apache/commons/jexl3/JexlException.java b/src/main/java/org/apache/commons/jexl3/JexlException.java index d2f3e6ec3..0927b03e4 100644 --- a/src/main/java/org/apache/commons/jexl3/JexlException.java +++ b/src/main/java/org/apache/commons/jexl3/JexlException.java @@ -17,22 +17,20 @@ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.internal.Debugger; -import org.apache.commons.jexl3.parser.JavaccError; -import org.apache.commons.jexl3.parser.JexlNode; -import org.apache.commons.jexl3.parser.ParseException; -import org.apache.commons.jexl3.parser.TokenMgrException; - +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.UndeclaredThrowableException; - import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringReader; +import org.apache.commons.jexl3.internal.Debugger; +import org.apache.commons.jexl3.parser.JavaccError; +import org.apache.commons.jexl3.parser.JexlNode; +import org.apache.commons.jexl3.parser.ParseException; +import org.apache.commons.jexl3.parser.TokenMgrException; /** * Wraps any error that might occur during interpretation of a script or expression. diff --git a/src/main/java/org/apache/commons/jexl3/JexlFeatures.java b/src/main/java/org/apache/commons/jexl3/JexlFeatures.java index 8f643c67e..163807e90 100644 --- a/src/main/java/org/apache/commons/jexl3/JexlFeatures.java +++ b/src/main/java/org/apache/commons/jexl3/JexlFeatures.java @@ -18,9 +18,9 @@ import java.util.Collection; import java.util.Collections; +import java.util.Objects; import java.util.Set; import java.util.TreeSet; -import java.util.Objects; import java.util.function.Predicate; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/ArrayBuilder.java b/src/main/java/org/apache/commons/jexl3/internal/ArrayBuilder.java index 74a535177..30ee18cd1 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/ArrayBuilder.java +++ b/src/main/java/org/apache/commons/jexl3/internal/ArrayBuilder.java @@ -16,14 +16,14 @@ */ package org.apache.commons.jexl3.internal; -import org.apache.commons.jexl3.JexlArithmetic; - import java.lang.reflect.Array; import java.util.ArrayList; +import java.util.Arrays; import java.util.IdentityHashMap; import java.util.List; import java.util.Map; -import java.util.Arrays; + +import org.apache.commons.jexl3.JexlArithmetic; /** * Helper class to create typed arrays. diff --git a/src/main/java/org/apache/commons/jexl3/internal/Closure.java b/src/main/java/org/apache/commons/jexl3/internal/Closure.java index 2056b19e0..0915e0d43 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/Closure.java +++ b/src/main/java/org/apache/commons/jexl3/internal/Closure.java @@ -16,13 +16,13 @@ */ package org.apache.commons.jexl3.internal; +import java.util.Arrays; +import java.util.Objects; + import org.apache.commons.jexl3.JexlContext; import org.apache.commons.jexl3.JexlOptions; import org.apache.commons.jexl3.parser.ASTJexlLambda; -import java.util.Arrays; -import java.util.Objects; - /** * A Script closure. */ diff --git a/src/main/java/org/apache/commons/jexl3/internal/Debugger.java b/src/main/java/org/apache/commons/jexl3/internal/Debugger.java index 75b23c89d..b0683ecea 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/Debugger.java +++ b/src/main/java/org/apache/commons/jexl3/internal/Debugger.java @@ -17,17 +17,105 @@ package org.apache.commons.jexl3.internal; -import org.apache.commons.jexl3.JexlExpression; -import org.apache.commons.jexl3.JexlFeatures; -import org.apache.commons.jexl3.JexlInfo; -import org.apache.commons.jexl3.JexlScript; -import org.apache.commons.jexl3.parser.*; - import java.util.Collections; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; +import org.apache.commons.jexl3.JexlExpression; +import org.apache.commons.jexl3.JexlFeatures; +import org.apache.commons.jexl3.JexlInfo; +import org.apache.commons.jexl3.JexlScript; +import org.apache.commons.jexl3.parser.ASTAddNode; +import org.apache.commons.jexl3.parser.ASTAndNode; +import org.apache.commons.jexl3.parser.ASTAnnotatedStatement; +import org.apache.commons.jexl3.parser.ASTAnnotation; +import org.apache.commons.jexl3.parser.ASTArguments; +import org.apache.commons.jexl3.parser.ASTArrayAccess; +import org.apache.commons.jexl3.parser.ASTArrayLiteral; +import org.apache.commons.jexl3.parser.ASTAssignment; +import org.apache.commons.jexl3.parser.ASTBitwiseAndNode; +import org.apache.commons.jexl3.parser.ASTBitwiseComplNode; +import org.apache.commons.jexl3.parser.ASTBitwiseOrNode; +import org.apache.commons.jexl3.parser.ASTBitwiseXorNode; +import org.apache.commons.jexl3.parser.ASTBlock; +import org.apache.commons.jexl3.parser.ASTBreak; +import org.apache.commons.jexl3.parser.ASTConstructorNode; +import org.apache.commons.jexl3.parser.ASTContinue; +import org.apache.commons.jexl3.parser.ASTDecrementGetNode; +import org.apache.commons.jexl3.parser.ASTDefineVars; +import org.apache.commons.jexl3.parser.ASTDivNode; +import org.apache.commons.jexl3.parser.ASTDoWhileStatement; +import org.apache.commons.jexl3.parser.ASTEQNode; +import org.apache.commons.jexl3.parser.ASTERNode; +import org.apache.commons.jexl3.parser.ASTEWNode; +import org.apache.commons.jexl3.parser.ASTEmptyFunction; +import org.apache.commons.jexl3.parser.ASTExtendedLiteral; +import org.apache.commons.jexl3.parser.ASTFalseNode; +import org.apache.commons.jexl3.parser.ASTForeachStatement; +import org.apache.commons.jexl3.parser.ASTFunctionNode; +import org.apache.commons.jexl3.parser.ASTGENode; +import org.apache.commons.jexl3.parser.ASTGTNode; +import org.apache.commons.jexl3.parser.ASTGetDecrementNode; +import org.apache.commons.jexl3.parser.ASTGetIncrementNode; +import org.apache.commons.jexl3.parser.ASTIdentifier; +import org.apache.commons.jexl3.parser.ASTIdentifierAccess; +import org.apache.commons.jexl3.parser.ASTIfStatement; +import org.apache.commons.jexl3.parser.ASTIncrementGetNode; +import org.apache.commons.jexl3.parser.ASTJexlLambda; +import org.apache.commons.jexl3.parser.ASTJexlScript; +import org.apache.commons.jexl3.parser.ASTJxltLiteral; +import org.apache.commons.jexl3.parser.ASTLENode; +import org.apache.commons.jexl3.parser.ASTLTNode; +import org.apache.commons.jexl3.parser.ASTMapEntry; +import org.apache.commons.jexl3.parser.ASTMapLiteral; +import org.apache.commons.jexl3.parser.ASTMethodNode; +import org.apache.commons.jexl3.parser.ASTModNode; +import org.apache.commons.jexl3.parser.ASTMulNode; +import org.apache.commons.jexl3.parser.ASTNENode; +import org.apache.commons.jexl3.parser.ASTNEWNode; +import org.apache.commons.jexl3.parser.ASTNRNode; +import org.apache.commons.jexl3.parser.ASTNSWNode; +import org.apache.commons.jexl3.parser.ASTNotNode; +import org.apache.commons.jexl3.parser.ASTNullLiteral; +import org.apache.commons.jexl3.parser.ASTNullpNode; +import org.apache.commons.jexl3.parser.ASTNumberLiteral; +import org.apache.commons.jexl3.parser.ASTOrNode; +import org.apache.commons.jexl3.parser.ASTQualifiedIdentifier; +import org.apache.commons.jexl3.parser.ASTRangeNode; +import org.apache.commons.jexl3.parser.ASTReference; +import org.apache.commons.jexl3.parser.ASTReferenceExpression; +import org.apache.commons.jexl3.parser.ASTRegexLiteral; +import org.apache.commons.jexl3.parser.ASTReturnStatement; +import org.apache.commons.jexl3.parser.ASTSWNode; +import org.apache.commons.jexl3.parser.ASTSetAddNode; +import org.apache.commons.jexl3.parser.ASTSetAndNode; +import org.apache.commons.jexl3.parser.ASTSetDivNode; +import org.apache.commons.jexl3.parser.ASTSetLiteral; +import org.apache.commons.jexl3.parser.ASTSetModNode; +import org.apache.commons.jexl3.parser.ASTSetMultNode; +import org.apache.commons.jexl3.parser.ASTSetOrNode; +import org.apache.commons.jexl3.parser.ASTSetShiftLeftNode; +import org.apache.commons.jexl3.parser.ASTSetShiftRightNode; +import org.apache.commons.jexl3.parser.ASTSetShiftRightUnsignedNode; +import org.apache.commons.jexl3.parser.ASTSetSubNode; +import org.apache.commons.jexl3.parser.ASTSetXorNode; +import org.apache.commons.jexl3.parser.ASTShiftLeftNode; +import org.apache.commons.jexl3.parser.ASTShiftRightNode; +import org.apache.commons.jexl3.parser.ASTShiftRightUnsignedNode; +import org.apache.commons.jexl3.parser.ASTSizeFunction; +import org.apache.commons.jexl3.parser.ASTStringLiteral; +import org.apache.commons.jexl3.parser.ASTSubNode; +import org.apache.commons.jexl3.parser.ASTTernaryNode; +import org.apache.commons.jexl3.parser.ASTTrueNode; +import org.apache.commons.jexl3.parser.ASTUnaryMinusNode; +import org.apache.commons.jexl3.parser.ASTUnaryPlusNode; +import org.apache.commons.jexl3.parser.ASTVar; +import org.apache.commons.jexl3.parser.ASTWhileStatement; +import org.apache.commons.jexl3.parser.JexlNode; +import org.apache.commons.jexl3.parser.ParserVisitor; +import org.apache.commons.jexl3.parser.StringParser; + /** * Helps pinpoint the cause of problems in expressions that fail during evaluation. *

diff --git a/src/main/java/org/apache/commons/jexl3/internal/Engine.java b/src/main/java/org/apache/commons/jexl3/internal/Engine.java index 4cae6e548..54e5e9a20 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/Engine.java +++ b/src/main/java/org/apache/commons/jexl3/internal/Engine.java @@ -16,6 +16,23 @@ */ package org.apache.commons.jexl3.internal; +import static org.apache.commons.jexl3.parser.JexlParser.PRAGMA_IMPORT; +import static org.apache.commons.jexl3.parser.JexlParser.PRAGMA_JEXLNS; +import static org.apache.commons.jexl3.parser.JexlParser.PRAGMA_MODULE; +import static org.apache.commons.jexl3.parser.JexlParser.PRAGMA_OPTIONS; + +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Consumer; +import java.util.function.Predicate; + import org.apache.commons.jexl3.JexlArithmetic; import org.apache.commons.jexl3.JexlBuilder; import org.apache.commons.jexl3.JexlContext; @@ -45,23 +62,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Consumer; -import java.util.function.Predicate; - -import static org.apache.commons.jexl3.parser.JexlParser.PRAGMA_IMPORT; -import static org.apache.commons.jexl3.parser.JexlParser.PRAGMA_MODULE; -import static org.apache.commons.jexl3.parser.JexlParser.PRAGMA_JEXLNS; -import static org.apache.commons.jexl3.parser.JexlParser.PRAGMA_OPTIONS; - /** * A JexlEngine implementation. * @since 2.0 diff --git a/src/main/java/org/apache/commons/jexl3/internal/FqcnResolver.java b/src/main/java/org/apache/commons/jexl3/internal/FqcnResolver.java index dd8907a7e..858a84d33 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/FqcnResolver.java +++ b/src/main/java/org/apache/commons/jexl3/internal/FqcnResolver.java @@ -16,9 +16,6 @@ */ package org.apache.commons.jexl3.internal; -import org.apache.commons.jexl3.JexlContext; -import org.apache.commons.jexl3.introspection.JexlUberspect; - import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; @@ -26,6 +23,9 @@ import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.apache.commons.jexl3.JexlContext; +import org.apache.commons.jexl3.introspection.JexlUberspect; + /** * Helper resolving a simple class name into a fully-qualified class name (hence FqcnResolver) using * package names as roots of import. diff --git a/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java b/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java index af95ab770..e15880b73 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java +++ b/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java @@ -31,11 +31,96 @@ import org.apache.commons.jexl3.JexlOptions; import org.apache.commons.jexl3.JexlScript; import org.apache.commons.jexl3.JxltEngine; - import org.apache.commons.jexl3.introspection.JexlMethod; import org.apache.commons.jexl3.introspection.JexlPropertyGet; - -import org.apache.commons.jexl3.parser.*; +import org.apache.commons.jexl3.parser.ASTAddNode; +import org.apache.commons.jexl3.parser.ASTAndNode; +import org.apache.commons.jexl3.parser.ASTAnnotatedStatement; +import org.apache.commons.jexl3.parser.ASTAnnotation; +import org.apache.commons.jexl3.parser.ASTArguments; +import org.apache.commons.jexl3.parser.ASTArrayAccess; +import org.apache.commons.jexl3.parser.ASTArrayLiteral; +import org.apache.commons.jexl3.parser.ASTAssignment; +import org.apache.commons.jexl3.parser.ASTBitwiseAndNode; +import org.apache.commons.jexl3.parser.ASTBitwiseComplNode; +import org.apache.commons.jexl3.parser.ASTBitwiseOrNode; +import org.apache.commons.jexl3.parser.ASTBitwiseXorNode; +import org.apache.commons.jexl3.parser.ASTBlock; +import org.apache.commons.jexl3.parser.ASTBreak; +import org.apache.commons.jexl3.parser.ASTConstructorNode; +import org.apache.commons.jexl3.parser.ASTContinue; +import org.apache.commons.jexl3.parser.ASTDecrementGetNode; +import org.apache.commons.jexl3.parser.ASTDefineVars; +import org.apache.commons.jexl3.parser.ASTDivNode; +import org.apache.commons.jexl3.parser.ASTDoWhileStatement; +import org.apache.commons.jexl3.parser.ASTEQNode; +import org.apache.commons.jexl3.parser.ASTERNode; +import org.apache.commons.jexl3.parser.ASTEWNode; +import org.apache.commons.jexl3.parser.ASTEmptyFunction; +import org.apache.commons.jexl3.parser.ASTExtendedLiteral; +import org.apache.commons.jexl3.parser.ASTFalseNode; +import org.apache.commons.jexl3.parser.ASTForeachStatement; +import org.apache.commons.jexl3.parser.ASTFunctionNode; +import org.apache.commons.jexl3.parser.ASTGENode; +import org.apache.commons.jexl3.parser.ASTGTNode; +import org.apache.commons.jexl3.parser.ASTGetDecrementNode; +import org.apache.commons.jexl3.parser.ASTGetIncrementNode; +import org.apache.commons.jexl3.parser.ASTIdentifier; +import org.apache.commons.jexl3.parser.ASTIdentifierAccess; +import org.apache.commons.jexl3.parser.ASTIdentifierAccessJxlt; +import org.apache.commons.jexl3.parser.ASTIfStatement; +import org.apache.commons.jexl3.parser.ASTIncrementGetNode; +import org.apache.commons.jexl3.parser.ASTJexlLambda; +import org.apache.commons.jexl3.parser.ASTJexlScript; +import org.apache.commons.jexl3.parser.ASTJxltLiteral; +import org.apache.commons.jexl3.parser.ASTLENode; +import org.apache.commons.jexl3.parser.ASTLTNode; +import org.apache.commons.jexl3.parser.ASTMapEntry; +import org.apache.commons.jexl3.parser.ASTMapLiteral; +import org.apache.commons.jexl3.parser.ASTMethodNode; +import org.apache.commons.jexl3.parser.ASTModNode; +import org.apache.commons.jexl3.parser.ASTMulNode; +import org.apache.commons.jexl3.parser.ASTNENode; +import org.apache.commons.jexl3.parser.ASTNEWNode; +import org.apache.commons.jexl3.parser.ASTNRNode; +import org.apache.commons.jexl3.parser.ASTNSWNode; +import org.apache.commons.jexl3.parser.ASTNotNode; +import org.apache.commons.jexl3.parser.ASTNullLiteral; +import org.apache.commons.jexl3.parser.ASTNullpNode; +import org.apache.commons.jexl3.parser.ASTNumberLiteral; +import org.apache.commons.jexl3.parser.ASTOrNode; +import org.apache.commons.jexl3.parser.ASTQualifiedIdentifier; +import org.apache.commons.jexl3.parser.ASTRangeNode; +import org.apache.commons.jexl3.parser.ASTReference; +import org.apache.commons.jexl3.parser.ASTReferenceExpression; +import org.apache.commons.jexl3.parser.ASTRegexLiteral; +import org.apache.commons.jexl3.parser.ASTReturnStatement; +import org.apache.commons.jexl3.parser.ASTSWNode; +import org.apache.commons.jexl3.parser.ASTSetAddNode; +import org.apache.commons.jexl3.parser.ASTSetAndNode; +import org.apache.commons.jexl3.parser.ASTSetDivNode; +import org.apache.commons.jexl3.parser.ASTSetLiteral; +import org.apache.commons.jexl3.parser.ASTSetModNode; +import org.apache.commons.jexl3.parser.ASTSetMultNode; +import org.apache.commons.jexl3.parser.ASTSetOrNode; +import org.apache.commons.jexl3.parser.ASTSetShiftLeftNode; +import org.apache.commons.jexl3.parser.ASTSetShiftRightNode; +import org.apache.commons.jexl3.parser.ASTSetShiftRightUnsignedNode; +import org.apache.commons.jexl3.parser.ASTSetSubNode; +import org.apache.commons.jexl3.parser.ASTSetXorNode; +import org.apache.commons.jexl3.parser.ASTShiftLeftNode; +import org.apache.commons.jexl3.parser.ASTShiftRightNode; +import org.apache.commons.jexl3.parser.ASTShiftRightUnsignedNode; +import org.apache.commons.jexl3.parser.ASTSizeFunction; +import org.apache.commons.jexl3.parser.ASTStringLiteral; +import org.apache.commons.jexl3.parser.ASTSubNode; +import org.apache.commons.jexl3.parser.ASTTernaryNode; +import org.apache.commons.jexl3.parser.ASTTrueNode; +import org.apache.commons.jexl3.parser.ASTUnaryMinusNode; +import org.apache.commons.jexl3.parser.ASTUnaryPlusNode; +import org.apache.commons.jexl3.parser.ASTVar; +import org.apache.commons.jexl3.parser.ASTWhileStatement; +import org.apache.commons.jexl3.parser.JexlNode; /** * An interpreter of JEXL syntax. diff --git a/src/main/java/org/apache/commons/jexl3/internal/InterpreterBase.java b/src/main/java/org/apache/commons/jexl3/internal/InterpreterBase.java index 97888e29e..8b68e5c1f 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/InterpreterBase.java +++ b/src/main/java/org/apache/commons/jexl3/internal/InterpreterBase.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; + import org.apache.commons.jexl3.JexlArithmetic; import org.apache.commons.jexl3.JexlContext; import org.apache.commons.jexl3.JexlContext.NamespaceFunctor; @@ -47,8 +48,6 @@ import org.apache.commons.jexl3.parser.ASTVar; import org.apache.commons.jexl3.parser.JexlNode; import org.apache.commons.jexl3.parser.ParserVisitor; - - import org.apache.commons.logging.Log; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/MapBuilder.java b/src/main/java/org/apache/commons/jexl3/internal/MapBuilder.java index 27fd12d12..579712a62 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/MapBuilder.java +++ b/src/main/java/org/apache/commons/jexl3/internal/MapBuilder.java @@ -19,6 +19,7 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; + import org.apache.commons.jexl3.JexlArithmetic; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/Operators.java b/src/main/java/org/apache/commons/jexl3/internal/Operators.java index e4be9e82a..b1b008890 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/Operators.java +++ b/src/main/java/org/apache/commons/jexl3/internal/Operators.java @@ -16,6 +16,9 @@ */ package org.apache.commons.jexl3.internal; +import java.lang.reflect.Method; +import java.util.function.Consumer; + import org.apache.commons.jexl3.JexlArithmetic; import org.apache.commons.jexl3.JexlEngine; import org.apache.commons.jexl3.JexlException; @@ -25,9 +28,6 @@ import org.apache.commons.jexl3.introspection.JexlUberspect; import org.apache.commons.jexl3.parser.JexlNode; -import java.lang.reflect.Method; -import java.util.function.Consumer; - /** * Helper class to deal with operator overloading and specifics. * @since 3.0 diff --git a/src/main/java/org/apache/commons/jexl3/internal/Script.java b/src/main/java/org/apache/commons/jexl3/internal/Script.java index 642a9f819..d8e0f122c 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/Script.java +++ b/src/main/java/org/apache/commons/jexl3/internal/Script.java @@ -16,19 +16,19 @@ */ package org.apache.commons.jexl3.internal; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + import org.apache.commons.jexl3.JexlContext; +import org.apache.commons.jexl3.JexlEngine; +import org.apache.commons.jexl3.JexlExpression; import org.apache.commons.jexl3.JexlFeatures; import org.apache.commons.jexl3.JexlInfo; import org.apache.commons.jexl3.JexlOptions; -import org.apache.commons.jexl3.JexlEngine; import org.apache.commons.jexl3.JexlScript; -import org.apache.commons.jexl3.JexlExpression; import org.apache.commons.jexl3.parser.ASTJexlScript; - -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; /** *

A JexlScript implementation.

* @since 1.1 diff --git a/src/main/java/org/apache/commons/jexl3/internal/ScriptVisitor.java b/src/main/java/org/apache/commons/jexl3/internal/ScriptVisitor.java index 63a4db218..f9f225a34 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/ScriptVisitor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/ScriptVisitor.java @@ -18,7 +18,93 @@ import org.apache.commons.jexl3.JexlExpression; import org.apache.commons.jexl3.JexlScript; -import org.apache.commons.jexl3.parser.*; +import org.apache.commons.jexl3.parser.ASTAddNode; +import org.apache.commons.jexl3.parser.ASTAndNode; +import org.apache.commons.jexl3.parser.ASTAnnotatedStatement; +import org.apache.commons.jexl3.parser.ASTAnnotation; +import org.apache.commons.jexl3.parser.ASTArguments; +import org.apache.commons.jexl3.parser.ASTArrayAccess; +import org.apache.commons.jexl3.parser.ASTArrayLiteral; +import org.apache.commons.jexl3.parser.ASTAssignment; +import org.apache.commons.jexl3.parser.ASTBitwiseAndNode; +import org.apache.commons.jexl3.parser.ASTBitwiseComplNode; +import org.apache.commons.jexl3.parser.ASTBitwiseOrNode; +import org.apache.commons.jexl3.parser.ASTBitwiseXorNode; +import org.apache.commons.jexl3.parser.ASTBlock; +import org.apache.commons.jexl3.parser.ASTBreak; +import org.apache.commons.jexl3.parser.ASTConstructorNode; +import org.apache.commons.jexl3.parser.ASTContinue; +import org.apache.commons.jexl3.parser.ASTDecrementGetNode; +import org.apache.commons.jexl3.parser.ASTDefineVars; +import org.apache.commons.jexl3.parser.ASTDivNode; +import org.apache.commons.jexl3.parser.ASTDoWhileStatement; +import org.apache.commons.jexl3.parser.ASTEQNode; +import org.apache.commons.jexl3.parser.ASTERNode; +import org.apache.commons.jexl3.parser.ASTEWNode; +import org.apache.commons.jexl3.parser.ASTEmptyFunction; +import org.apache.commons.jexl3.parser.ASTExtendedLiteral; +import org.apache.commons.jexl3.parser.ASTFalseNode; +import org.apache.commons.jexl3.parser.ASTForeachStatement; +import org.apache.commons.jexl3.parser.ASTFunctionNode; +import org.apache.commons.jexl3.parser.ASTGENode; +import org.apache.commons.jexl3.parser.ASTGTNode; +import org.apache.commons.jexl3.parser.ASTGetDecrementNode; +import org.apache.commons.jexl3.parser.ASTGetIncrementNode; +import org.apache.commons.jexl3.parser.ASTIdentifier; +import org.apache.commons.jexl3.parser.ASTIdentifierAccess; +import org.apache.commons.jexl3.parser.ASTIfStatement; +import org.apache.commons.jexl3.parser.ASTIncrementGetNode; +import org.apache.commons.jexl3.parser.ASTJexlScript; +import org.apache.commons.jexl3.parser.ASTJxltLiteral; +import org.apache.commons.jexl3.parser.ASTLENode; +import org.apache.commons.jexl3.parser.ASTLTNode; +import org.apache.commons.jexl3.parser.ASTMapEntry; +import org.apache.commons.jexl3.parser.ASTMapLiteral; +import org.apache.commons.jexl3.parser.ASTMethodNode; +import org.apache.commons.jexl3.parser.ASTModNode; +import org.apache.commons.jexl3.parser.ASTMulNode; +import org.apache.commons.jexl3.parser.ASTNENode; +import org.apache.commons.jexl3.parser.ASTNEWNode; +import org.apache.commons.jexl3.parser.ASTNRNode; +import org.apache.commons.jexl3.parser.ASTNSWNode; +import org.apache.commons.jexl3.parser.ASTNotNode; +import org.apache.commons.jexl3.parser.ASTNullLiteral; +import org.apache.commons.jexl3.parser.ASTNullpNode; +import org.apache.commons.jexl3.parser.ASTNumberLiteral; +import org.apache.commons.jexl3.parser.ASTOrNode; +import org.apache.commons.jexl3.parser.ASTQualifiedIdentifier; +import org.apache.commons.jexl3.parser.ASTRangeNode; +import org.apache.commons.jexl3.parser.ASTReference; +import org.apache.commons.jexl3.parser.ASTReferenceExpression; +import org.apache.commons.jexl3.parser.ASTRegexLiteral; +import org.apache.commons.jexl3.parser.ASTReturnStatement; +import org.apache.commons.jexl3.parser.ASTSWNode; +import org.apache.commons.jexl3.parser.ASTSetAddNode; +import org.apache.commons.jexl3.parser.ASTSetAndNode; +import org.apache.commons.jexl3.parser.ASTSetDivNode; +import org.apache.commons.jexl3.parser.ASTSetLiteral; +import org.apache.commons.jexl3.parser.ASTSetModNode; +import org.apache.commons.jexl3.parser.ASTSetMultNode; +import org.apache.commons.jexl3.parser.ASTSetOrNode; +import org.apache.commons.jexl3.parser.ASTSetShiftLeftNode; +import org.apache.commons.jexl3.parser.ASTSetShiftRightNode; +import org.apache.commons.jexl3.parser.ASTSetShiftRightUnsignedNode; +import org.apache.commons.jexl3.parser.ASTSetSubNode; +import org.apache.commons.jexl3.parser.ASTSetXorNode; +import org.apache.commons.jexl3.parser.ASTShiftLeftNode; +import org.apache.commons.jexl3.parser.ASTShiftRightNode; +import org.apache.commons.jexl3.parser.ASTShiftRightUnsignedNode; +import org.apache.commons.jexl3.parser.ASTSizeFunction; +import org.apache.commons.jexl3.parser.ASTStringLiteral; +import org.apache.commons.jexl3.parser.ASTSubNode; +import org.apache.commons.jexl3.parser.ASTTernaryNode; +import org.apache.commons.jexl3.parser.ASTTrueNode; +import org.apache.commons.jexl3.parser.ASTUnaryMinusNode; +import org.apache.commons.jexl3.parser.ASTUnaryPlusNode; +import org.apache.commons.jexl3.parser.ASTVar; +import org.apache.commons.jexl3.parser.ASTWhileStatement; +import org.apache.commons.jexl3.parser.JexlNode; +import org.apache.commons.jexl3.parser.ParserVisitor; /** * Concrete visitor base, used for feature and operator controllers. diff --git a/src/main/java/org/apache/commons/jexl3/internal/SetBuilder.java b/src/main/java/org/apache/commons/jexl3/internal/SetBuilder.java index 0b894c0d0..edb641622 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/SetBuilder.java +++ b/src/main/java/org/apache/commons/jexl3/internal/SetBuilder.java @@ -16,11 +16,12 @@ */ package org.apache.commons.jexl3.internal; -import org.apache.commons.jexl3.JexlArithmetic; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Set; +import org.apache.commons.jexl3.JexlArithmetic; + /** * Helper class to create set literals. */ diff --git a/src/main/java/org/apache/commons/jexl3/internal/Source.java b/src/main/java/org/apache/commons/jexl3/internal/Source.java index a9d16f2b7..afe175718 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/Source.java +++ b/src/main/java/org/apache/commons/jexl3/internal/Source.java @@ -16,10 +16,10 @@ */ package org.apache.commons.jexl3.internal; -import org.apache.commons.jexl3.JexlFeatures; - import java.util.Objects; +import org.apache.commons.jexl3.JexlFeatures; + /** * Maintains the set of allowed features associated with a script/expression source. *

This is meant for caching scripts using their 'source' as key but still distinguishing diff --git a/src/main/java/org/apache/commons/jexl3/internal/TemplateDebugger.java b/src/main/java/org/apache/commons/jexl3/internal/TemplateDebugger.java index ffcd1946a..5c13f98b7 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/TemplateDebugger.java +++ b/src/main/java/org/apache/commons/jexl3/internal/TemplateDebugger.java @@ -23,7 +23,6 @@ import org.apache.commons.jexl3.internal.TemplateEngine.ImmediateExpression; import org.apache.commons.jexl3.internal.TemplateEngine.NestedExpression; import org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression; - import org.apache.commons.jexl3.parser.ASTBlock; import org.apache.commons.jexl3.parser.ASTFunctionNode; import org.apache.commons.jexl3.parser.ASTIdentifier; diff --git a/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java b/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java index b1267a3f5..b7c4d7fa9 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java +++ b/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java @@ -16,27 +16,26 @@ */ package org.apache.commons.jexl3.internal; -import org.apache.commons.jexl3.JexlContext; -import org.apache.commons.jexl3.JexlException; -import org.apache.commons.jexl3.JexlOptions; -import org.apache.commons.jexl3.JexlInfo; -import org.apache.commons.jexl3.JxltEngine; -import org.apache.commons.jexl3.parser.ASTJexlScript; -import org.apache.commons.jexl3.parser.JexlNode; -import org.apache.commons.jexl3.parser.StringParser; -import org.apache.commons.logging.Log; - import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; import java.io.StringReader; - import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Set; +import org.apache.commons.jexl3.JexlContext; +import org.apache.commons.jexl3.JexlException; +import org.apache.commons.jexl3.JexlInfo; +import org.apache.commons.jexl3.JexlOptions; +import org.apache.commons.jexl3.JxltEngine; +import org.apache.commons.jexl3.parser.ASTJexlScript; +import org.apache.commons.jexl3.parser.JexlNode; +import org.apache.commons.jexl3.parser.StringParser; +import org.apache.commons.logging.Log; + /** * A JxltEngine implementation. * @since 3.0 diff --git a/src/main/java/org/apache/commons/jexl3/internal/TemplateInterpreter.java b/src/main/java/org/apache/commons/jexl3/internal/TemplateInterpreter.java index 0db40c28d..2293e487d 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/TemplateInterpreter.java +++ b/src/main/java/org/apache/commons/jexl3/internal/TemplateInterpreter.java @@ -16,6 +16,9 @@ */ package org.apache.commons.jexl3.internal; +import java.io.Writer; +import java.util.Arrays; + import org.apache.commons.jexl3.JexlContext; import org.apache.commons.jexl3.JexlInfo; import org.apache.commons.jexl3.JexlOptions; @@ -30,9 +33,6 @@ import org.apache.commons.jexl3.parser.ASTJexlScript; import org.apache.commons.jexl3.parser.JexlNode; -import java.io.Writer; -import java.util.Arrays; - /** * The type of interpreter to use during evaluation of templates. *

This context exposes its writer as '$jexl' to the scripts.

diff --git a/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java b/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java index 8f0625e69..6b8458a6c 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java +++ b/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java @@ -16,29 +16,29 @@ */ package org.apache.commons.jexl3.internal; +import java.io.Reader; +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + import org.apache.commons.jexl3.JexlContext; +import org.apache.commons.jexl3.JexlException; import org.apache.commons.jexl3.JexlInfo; +import org.apache.commons.jexl3.JexlOptions; import org.apache.commons.jexl3.JxltEngine; import org.apache.commons.jexl3.internal.TemplateEngine.Block; import org.apache.commons.jexl3.internal.TemplateEngine.BlockType; import org.apache.commons.jexl3.internal.TemplateEngine.TemplateExpression; -import org.apache.commons.jexl3.parser.ASTJexlScript; -import org.apache.commons.jexl3.JexlException; -import org.apache.commons.jexl3.JexlOptions; import org.apache.commons.jexl3.parser.ASTArguments; import org.apache.commons.jexl3.parser.ASTFunctionNode; import org.apache.commons.jexl3.parser.ASTIdentifier; +import org.apache.commons.jexl3.parser.ASTJexlScript; import org.apache.commons.jexl3.parser.ASTNumberLiteral; import org.apache.commons.jexl3.parser.JexlNode; -import java.io.Reader; -import java.io.Writer; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - /** * A Template instance. */ diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/BooleanGetExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/BooleanGetExecutor.java index b20cbf791..3e8f04a9e 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/BooleanGetExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/BooleanGetExecutor.java @@ -17,6 +17,7 @@ package org.apache.commons.jexl3.internal.introspection; import java.lang.reflect.InvocationTargetException; + import org.apache.commons.jexl3.JexlException; /** * Specialized executor to get a boolean property from an object. diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java index 57102a239..1a6829b48 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java @@ -16,9 +16,6 @@ */ package org.apache.commons.jexl3.internal.introspection; -import org.apache.commons.jexl3.introspection.JexlPermissions; -import org.apache.commons.logging.Log; - import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -32,6 +29,9 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import org.apache.commons.jexl3.introspection.JexlPermissions; +import org.apache.commons.logging.Log; + /** * A cache of introspection information for a specific class instance. * Keys objects by an aggregation of the method name and the classes diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/ConstructorMethod.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/ConstructorMethod.java index 4b7e79e97..3b0bb0400 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/ConstructorMethod.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/ConstructorMethod.java @@ -19,6 +19,7 @@ import java.beans.IntrospectionException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; + import org.apache.commons.jexl3.JexlException; import org.apache.commons.jexl3.introspection.JexlMethod; diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/DuckGetExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/DuckGetExecutor.java index 746c185af..378770971 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/DuckGetExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/DuckGetExecutor.java @@ -17,6 +17,7 @@ package org.apache.commons.jexl3.internal.introspection; import java.lang.reflect.InvocationTargetException; + import org.apache.commons.jexl3.JexlException; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/DuckSetExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/DuckSetExecutor.java index 578f4275c..2e2173580 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/DuckSetExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/DuckSetExecutor.java @@ -17,6 +17,7 @@ package org.apache.commons.jexl3.internal.introspection; import java.lang.reflect.InvocationTargetException; + import org.apache.commons.jexl3.JexlException; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/EnumerationIterator.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/EnumerationIterator.java index 12e993159..d4d1af944 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/EnumerationIterator.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/EnumerationIterator.java @@ -18,8 +18,8 @@ package org.apache.commons.jexl3.internal.introspection; -import java.util.Iterator; import java.util.Enumeration; +import java.util.Iterator; /** * An Iterator wrapper for an Enumeration. diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/FieldGetExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/FieldGetExecutor.java index c431a6b0c..933a86711 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/FieldGetExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/FieldGetExecutor.java @@ -18,6 +18,7 @@ package org.apache.commons.jexl3.internal.introspection; import java.lang.reflect.Field; + import org.apache.commons.jexl3.introspection.JexlPropertyGet; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/FieldSetExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/FieldSetExecutor.java index 3095a21b9..33ef44dfc 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/FieldSetExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/FieldSetExecutor.java @@ -19,6 +19,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; + import org.apache.commons.jexl3.introspection.JexlPropertySet; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/IndexedType.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/IndexedType.java index 9cfba394e..40e412ab6 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/IndexedType.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/IndexedType.java @@ -18,9 +18,10 @@ package org.apache.commons.jexl3.internal.introspection; -import org.apache.commons.jexl3.introspection.JexlPropertyGet; -import java.lang.reflect.Method; import java.beans.IntrospectionException; +import java.lang.reflect.Method; + +import org.apache.commons.jexl3.introspection.JexlPropertyGet; /** * Abstract an indexed property container. diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/Introspector.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/Introspector.java index fd003d98c..54e41fdfb 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/Introspector.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/Introspector.java @@ -16,22 +16,20 @@ */ package org.apache.commons.jexl3.internal.introspection; -import org.apache.commons.jexl3.introspection.JexlPermissions; -import org.apache.commons.logging.Log; - import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; - import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; - import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import org.apache.commons.jexl3.introspection.JexlPermissions; +import org.apache.commons.logging.Log; + /** * This basic function of this class is to return a Method object for a * particular class given the name of a method and the parameters to the method diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/ListGetExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/ListGetExecutor.java index 866b1e671..2b609d21e 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/ListGetExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/ListGetExecutor.java @@ -16,8 +16,8 @@ */ package org.apache.commons.jexl3.internal.introspection; -import java.util.List; import java.lang.reflect.Array; +import java.util.List; /** * Specialized executor to get a property from a List or array. diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/ListSetExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/ListSetExecutor.java index 4938a447d..053d4a1e8 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/ListSetExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/ListSetExecutor.java @@ -16,8 +16,8 @@ */ package org.apache.commons.jexl3.internal.introspection; -import java.util.List; import java.lang.reflect.Array; +import java.util.List; /** * Specialized executor to set a property in a List or array. diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodExecutor.java index be6f4ee54..8ead74a30 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodExecutor.java @@ -16,9 +16,10 @@ */ package org.apache.commons.jexl3.internal.introspection; -import org.apache.commons.jexl3.JexlEngine; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; + +import org.apache.commons.jexl3.JexlEngine; import org.apache.commons.jexl3.JexlException; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodKey.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodKey.java index d30d87269..8bce34aec 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodKey.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodKey.java @@ -19,7 +19,6 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Executable; import java.lang.reflect.Method; - import java.util.Arrays; import java.util.Deque; import java.util.HashMap; diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertyGetExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertyGetExecutor.java index 0a4daabcc..a9e55f7f7 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertyGetExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertyGetExecutor.java @@ -17,6 +17,7 @@ package org.apache.commons.jexl3.internal.introspection; import java.lang.reflect.InvocationTargetException; + import org.apache.commons.jexl3.JexlException; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertySetExecutor.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertySetExecutor.java index 0eb4ac45f..aa9e76fd6 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertySetExecutor.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertySetExecutor.java @@ -18,6 +18,7 @@ import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; + import org.apache.commons.jexl3.JexlException; /** diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/SandboxUberspect.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/SandboxUberspect.java index 3a8e36991..83a151c82 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/SandboxUberspect.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/SandboxUberspect.java @@ -16,6 +16,9 @@ */ package org.apache.commons.jexl3.internal.introspection; +import java.util.Iterator; +import java.util.List; + import org.apache.commons.jexl3.JexlArithmetic; import org.apache.commons.jexl3.JexlOperator; import org.apache.commons.jexl3.introspection.JexlMethod; @@ -24,9 +27,6 @@ import org.apache.commons.jexl3.introspection.JexlSandbox; import org.apache.commons.jexl3.introspection.JexlUberspect; -import java.util.Iterator; -import java.util.List; - /** * An uberspect that controls usage of properties, methods and constructors through a sandbox. * @since 3.0 diff --git a/src/main/java/org/apache/commons/jexl3/internal/introspection/Uberspect.java b/src/main/java/org/apache/commons/jexl3/internal/introspection/Uberspect.java index 03b84b1fb..29a9a0756 100644 --- a/src/main/java/org/apache/commons/jexl3/internal/introspection/Uberspect.java +++ b/src/main/java/org/apache/commons/jexl3/internal/introspection/Uberspect.java @@ -16,6 +16,19 @@ */ package org.apache.commons.jexl3.internal.introspection; +import java.lang.ref.Reference; +import java.lang.ref.SoftReference; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.EnumSet; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; + import org.apache.commons.jexl3.JexlArithmetic; import org.apache.commons.jexl3.JexlEngine; import org.apache.commons.jexl3.JexlOperator; @@ -24,25 +37,9 @@ import org.apache.commons.jexl3.introspection.JexlPropertyGet; import org.apache.commons.jexl3.introspection.JexlPropertySet; import org.apache.commons.jexl3.introspection.JexlUberspect; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -import java.util.EnumSet; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.ConcurrentHashMap; - -import java.lang.ref.Reference; -import java.lang.ref.SoftReference; -import java.util.List; - /** * Implementation of Uberspect to provide the default introspective * functionality of JEXL. diff --git a/src/main/java/org/apache/commons/jexl3/introspection/JexlPermissions.java b/src/main/java/org/apache/commons/jexl3/introspection/JexlPermissions.java index 276533b35..8b26c9b8b 100644 --- a/src/main/java/org/apache/commons/jexl3/introspection/JexlPermissions.java +++ b/src/main/java/org/apache/commons/jexl3/introspection/JexlPermissions.java @@ -16,8 +16,6 @@ */ package org.apache.commons.jexl3.introspection; -import org.apache.commons.jexl3.internal.introspection.PermissionsParser; - import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -29,6 +27,8 @@ import java.util.Set; import java.util.stream.Collectors; +import org.apache.commons.jexl3.internal.introspection.PermissionsParser; + /** * This interface describes permissions used by JEXL introspection that constrain which * packages/classes/constructors/fields/methods are made visible to JEXL scripts. diff --git a/src/main/java/org/apache/commons/jexl3/introspection/JexlUberspect.java b/src/main/java/org/apache/commons/jexl3/introspection/JexlUberspect.java index efe00f541..b91c152d0 100644 --- a/src/main/java/org/apache/commons/jexl3/introspection/JexlUberspect.java +++ b/src/main/java/org/apache/commons/jexl3/introspection/JexlUberspect.java @@ -17,15 +17,15 @@ package org.apache.commons.jexl3.introspection; -import org.apache.commons.jexl3.JexlArithmetic; -import org.apache.commons.jexl3.JexlOperator; - import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; +import org.apache.commons.jexl3.JexlArithmetic; +import org.apache.commons.jexl3.JexlOperator; + /** * 'Federated' introspection/reflection interface to allow JEXL introspection * behavior to be customized. diff --git a/src/main/java/org/apache/commons/jexl3/parser/ASTJexlScript.java b/src/main/java/org/apache/commons/jexl3/parser/ASTJexlScript.java index d4a2da62c..14bd25e09 100644 --- a/src/main/java/org/apache/commons/jexl3/parser/ASTJexlScript.java +++ b/src/main/java/org/apache/commons/jexl3/parser/ASTJexlScript.java @@ -16,10 +16,11 @@ */ package org.apache.commons.jexl3.parser; -import org.apache.commons.jexl3.JexlFeatures; -import org.apache.commons.jexl3.internal.Scope; import java.util.Map; + +import org.apache.commons.jexl3.JexlFeatures; import org.apache.commons.jexl3.internal.Frame; +import org.apache.commons.jexl3.internal.Scope; /** * Enhanced script to allow parameters declaration. diff --git a/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java b/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java index ebd67ab5f..d4b83137c 100644 --- a/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java +++ b/src/main/java/org/apache/commons/jexl3/parser/JexlParser.java @@ -16,13 +16,6 @@ */ package org.apache.commons.jexl3.parser; -import org.apache.commons.jexl3.JexlEngine; -import org.apache.commons.jexl3.JexlException; -import org.apache.commons.jexl3.JexlFeatures; -import org.apache.commons.jexl3.JexlInfo; -import org.apache.commons.jexl3.internal.LexicalScope; -import org.apache.commons.jexl3.internal.Scope; - import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; @@ -37,6 +30,13 @@ import java.util.TreeMap; import java.util.function.Predicate; +import org.apache.commons.jexl3.JexlEngine; +import org.apache.commons.jexl3.JexlException; +import org.apache.commons.jexl3.JexlFeatures; +import org.apache.commons.jexl3.JexlInfo; +import org.apache.commons.jexl3.internal.LexicalScope; +import org.apache.commons.jexl3.internal.Scope; + /** * The base class for parsing, manages the parameter/local variable frame. diff --git a/src/main/java/org/apache/commons/jexl3/scripting/JexlScriptEngine.java b/src/main/java/org/apache/commons/jexl3/scripting/JexlScriptEngine.java index c0dc06ebb..d360edcd7 100644 --- a/src/main/java/org/apache/commons/jexl3/scripting/JexlScriptEngine.java +++ b/src/main/java/org/apache/commons/jexl3/scripting/JexlScriptEngine.java @@ -40,7 +40,6 @@ import org.apache.commons.jexl3.JexlEngine; import org.apache.commons.jexl3.JexlException; import org.apache.commons.jexl3.JexlScript; - import org.apache.commons.jexl3.introspection.JexlPermissions; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/src/main/java/org/apache/commons/jexl3/scripting/JexlScriptEngineFactory.java b/src/main/java/org/apache/commons/jexl3/scripting/JexlScriptEngineFactory.java index 248a49d96..ba7096cc2 100644 --- a/src/main/java/org/apache/commons/jexl3/scripting/JexlScriptEngineFactory.java +++ b/src/main/java/org/apache/commons/jexl3/scripting/JexlScriptEngineFactory.java @@ -17,14 +17,15 @@ package org.apache.commons.jexl3.scripting; -import org.apache.commons.jexl3.parser.StringParser; - -import javax.script.ScriptEngine; -import javax.script.ScriptEngineFactory; import java.util.Arrays; import java.util.Collections; import java.util.List; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineFactory; + +import org.apache.commons.jexl3.parser.StringParser; + /** * Implements the JEXL ScriptEngineFactory for JSF-223. *

diff --git a/src/main/java/org/apache/commons/jexl3/scripting/Main.java b/src/main/java/org/apache/commons/jexl3/scripting/Main.java index c48140815..68a274399 100644 --- a/src/main/java/org/apache/commons/jexl3/scripting/Main.java +++ b/src/main/java/org/apache/commons/jexl3/scripting/Main.java @@ -21,9 +21,9 @@ import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; - import java.io.PrintStream; import java.nio.charset.Charset; + import javax.script.ScriptEngine; import javax.script.ScriptException; diff --git a/src/test/java/org/apache/commons/jexl3/AnnotationTest.java b/src/test/java/org/apache/commons/jexl3/AnnotationTest.java index 6ab3aaf70..88d3f95f8 100644 --- a/src/test/java/org/apache/commons/jexl3/AnnotationTest.java +++ b/src/test/java/org/apache/commons/jexl3/AnnotationTest.java @@ -22,6 +22,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; + import org.apache.commons.jexl3.internal.Interpreter; import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/AntishCallTest.java b/src/test/java/org/apache/commons/jexl3/AntishCallTest.java index 73af92260..fd9e5e4a7 100644 --- a/src/test/java/org/apache/commons/jexl3/AntishCallTest.java +++ b/src/test/java/org/apache/commons/jexl3/AntishCallTest.java @@ -19,6 +19,7 @@ import java.math.BigInteger; import java.util.Map; import java.util.TreeMap; + import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/ArithmeticOperatorTest.java b/src/test/java/org/apache/commons/jexl3/ArithmeticOperatorTest.java index 395b0b75d..2fb019763 100644 --- a/src/test/java/org/apache/commons/jexl3/ArithmeticOperatorTest.java +++ b/src/test/java/org/apache/commons/jexl3/ArithmeticOperatorTest.java @@ -16,26 +16,25 @@ */ package org.apache.commons.jexl3; +import java.io.StringWriter; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.SortedSet; -import java.util.TreeSet; -import java.util.Calendar; -import java.util.Date; -import java.util.Locale; import java.util.TimeZone; +import java.util.TreeSet; import org.apache.commons.jexl3.junit.Asserter; -import java.io.StringWriter; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; - import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java b/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java index 1ede95d30..149809eaf 100644 --- a/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java +++ b/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java @@ -16,17 +16,6 @@ */ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.junit.Asserter; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.math.BigDecimal; @@ -40,6 +29,18 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.apache.commons.jexl3.junit.Asserter; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + @SuppressWarnings({"UnnecessaryBoxing", "AssertEqualsBetweenInconvertibleTypes"}) public class ArithmeticTest extends JexlTestCase { /** A small delta to compare doubles. */ diff --git a/src/test/java/org/apache/commons/jexl3/ArrayLiteralTest.java b/src/test/java/org/apache/commons/jexl3/ArrayLiteralTest.java index 217d9f7b0..54defbcdf 100644 --- a/src/test/java/org/apache/commons/jexl3/ArrayLiteralTest.java +++ b/src/test/java/org/apache/commons/jexl3/ArrayLiteralTest.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.List; + import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/AssignTest.java b/src/test/java/org/apache/commons/jexl3/AssignTest.java index bbbe3e798..b25ceb7c9 100644 --- a/src/test/java/org/apache/commons/jexl3/AssignTest.java +++ b/src/test/java/org/apache/commons/jexl3/AssignTest.java @@ -16,11 +16,11 @@ */ package org.apache.commons.jexl3; +import java.util.Arrays; + import org.junit.Assert; import org.junit.Test; -import java.util.Arrays; - /** * Test cases for assignment. * diff --git a/src/test/java/org/apache/commons/jexl3/BuilderTest.java b/src/test/java/org/apache/commons/jexl3/BuilderTest.java index 6b5e963a1..812a6bc96 100644 --- a/src/test/java/org/apache/commons/jexl3/BuilderTest.java +++ b/src/test/java/org/apache/commons/jexl3/BuilderTest.java @@ -16,14 +16,14 @@ */ package org.apache.commons.jexl3; +import java.nio.charset.Charset; + import org.apache.commons.jexl3.internal.introspection.SandboxUberspect; import org.apache.commons.jexl3.introspection.JexlSandbox; import org.apache.commons.jexl3.introspection.JexlUberspect; import org.junit.Assert; import org.junit.Test; -import java.nio.charset.Charset; - /** * Checking the builder basics. */ diff --git a/src/test/java/org/apache/commons/jexl3/CacheTest.java b/src/test/java/org/apache/commons/jexl3/CacheTest.java index 751ea2a70..9c1125dde 100644 --- a/src/test/java/org/apache/commons/jexl3/CacheTest.java +++ b/src/test/java/org/apache/commons/jexl3/CacheTest.java @@ -16,13 +16,14 @@ */ package org.apache.commons.jexl3; -import java.util.List; -import java.util.Map; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; + import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/org/apache/commons/jexl3/CaptureLog.java b/src/test/java/org/apache/commons/jexl3/CaptureLog.java index 0aca8512b..9b3a004a2 100644 --- a/src/test/java/org/apache/commons/jexl3/CaptureLog.java +++ b/src/test/java/org/apache/commons/jexl3/CaptureLog.java @@ -17,6 +17,7 @@ import java.util.ArrayList; import java.util.List; + import org.apache.commons.logging.Log; /** diff --git a/src/test/java/org/apache/commons/jexl3/ClassCreator.java b/src/test/java/org/apache/commons/jexl3/ClassCreator.java index 900fb3fd4..c1d2bb6e9 100644 --- a/src/test/java/org/apache/commons/jexl3/ClassCreator.java +++ b/src/test/java/org/apache/commons/jexl3/ClassCreator.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; + import javax.tools.Diagnostic; import javax.tools.DiagnosticCollector; import javax.tools.JavaCompiler; diff --git a/src/test/java/org/apache/commons/jexl3/CollectionLiteralTest.java b/src/test/java/org/apache/commons/jexl3/CollectionLiteralTest.java index 0adfd47a2..c8c75378f 100644 --- a/src/test/java/org/apache/commons/jexl3/CollectionLiteralTest.java +++ b/src/test/java/org/apache/commons/jexl3/CollectionLiteralTest.java @@ -16,15 +16,15 @@ */ package org.apache.commons.jexl3; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; + import org.apache.commons.jexl3.internal.ArrayBuilder; import org.apache.commons.jexl3.internal.MapBuilder; import org.apache.commons.jexl3.internal.SetBuilder; import org.junit.Assert; import org.junit.Test; - -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; /** * Counting the number of times map,sets,array literals are created. *

diff --git a/src/test/java/org/apache/commons/jexl3/ComposePermissionsTest.java b/src/test/java/org/apache/commons/jexl3/ComposePermissionsTest.java index 13765d85c..47328771b 100644 --- a/src/test/java/org/apache/commons/jexl3/ComposePermissionsTest.java +++ b/src/test/java/org/apache/commons/jexl3/ComposePermissionsTest.java @@ -20,11 +20,12 @@ import java.io.FileReader; import java.util.Collections; -import com.google.gson.Gson; import org.apache.commons.jexl3.introspection.JexlPermissions; import org.junit.Assert; import org.junit.Test; +import com.google.gson.Gson; + /** * Tests for pragmas */ diff --git a/src/test/java/org/apache/commons/jexl3/ContextNamespaceTest.java b/src/test/java/org/apache/commons/jexl3/ContextNamespaceTest.java index feb5db8fa..eee23108d 100644 --- a/src/test/java/org/apache/commons/jexl3/ContextNamespaceTest.java +++ b/src/test/java/org/apache/commons/jexl3/ContextNamespaceTest.java @@ -16,14 +16,14 @@ */ package org.apache.commons.jexl3; -import org.junit.Assert; -import org.junit.Test; - import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Assert; +import org.junit.Test; + /** * Tests JexlContext (advanced) features. */ diff --git a/src/test/java/org/apache/commons/jexl3/DoWhileTest.java b/src/test/java/org/apache/commons/jexl3/DoWhileTest.java index d92e03bba..39aeeb59e 100644 --- a/src/test/java/org/apache/commons/jexl3/DoWhileTest.java +++ b/src/test/java/org/apache/commons/jexl3/DoWhileTest.java @@ -16,13 +16,13 @@ */ package org.apache.commons.jexl3; -import org.junit.Assert; -import org.junit.Test; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.junit.Assert; +import org.junit.Test; + /** * Tests do while statement. * @since 3.2 diff --git a/src/test/java/org/apache/commons/jexl3/FeaturesTest.java b/src/test/java/org/apache/commons/jexl3/FeaturesTest.java index f61ee09bd..3b8e5d023 100644 --- a/src/test/java/org/apache/commons/jexl3/FeaturesTest.java +++ b/src/test/java/org/apache/commons/jexl3/FeaturesTest.java @@ -17,6 +17,7 @@ package org.apache.commons.jexl3; import java.util.Arrays; + import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/Issues100Test.java b/src/test/java/org/apache/commons/jexl3/Issues100Test.java index bea1ebb5d..7e816fb85 100644 --- a/src/test/java/org/apache/commons/jexl3/Issues100Test.java +++ b/src/test/java/org/apache/commons/jexl3/Issues100Test.java @@ -16,20 +16,19 @@ */ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.internal.Engine; - import java.io.File; import java.math.BigDecimal; import java.math.MathContext; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.Collections; +import org.apache.commons.jexl3.internal.Engine; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/Issues200Test.java b/src/test/java/org/apache/commons/jexl3/Issues200Test.java index 3ac79973c..b9ccadfaf 100644 --- a/src/test/java/org/apache/commons/jexl3/Issues200Test.java +++ b/src/test/java/org/apache/commons/jexl3/Issues200Test.java @@ -29,10 +29,10 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; - import java.util.TreeSet; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; + import org.apache.commons.jexl3.internal.TemplateDebugger; import org.apache.commons.jexl3.introspection.JexlSandbox; import org.apache.commons.logging.Log; diff --git a/src/test/java/org/apache/commons/jexl3/Issues300Test.java b/src/test/java/org/apache/commons/jexl3/Issues300Test.java index 411002f6d..c40383a6e 100644 --- a/src/test/java/org/apache/commons/jexl3/Issues300Test.java +++ b/src/test/java/org/apache/commons/jexl3/Issues300Test.java @@ -16,12 +16,9 @@ */ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.internal.Engine32; -import org.apache.commons.jexl3.internal.OptionsContext; +import static org.apache.commons.jexl3.internal.Util.debuggerCheck; import static org.apache.commons.jexl3.introspection.JexlPermissions.RESTRICTED; -import org.apache.commons.jexl3.introspection.JexlSandbox; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.Assert.assertEquals; import java.io.StringReader; import java.io.StringWriter; @@ -38,8 +35,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.apache.commons.jexl3.internal.Util.debuggerCheck; -import static org.junit.Assert.assertEquals; +import org.apache.commons.jexl3.internal.Engine32; +import org.apache.commons.jexl3.internal.OptionsContext; +import org.apache.commons.jexl3.introspection.JexlSandbox; +import org.junit.Assert; +import org.junit.Test; /** * Test cases for reported issue between JEXL-300 and JEXL-399. diff --git a/src/test/java/org/apache/commons/jexl3/Issues400Test.java b/src/test/java/org/apache/commons/jexl3/Issues400Test.java index 3aa64b61f..cb4a2a311 100644 --- a/src/test/java/org/apache/commons/jexl3/Issues400Test.java +++ b/src/test/java/org/apache/commons/jexl3/Issues400Test.java @@ -16,15 +16,15 @@ */ package org.apache.commons.jexl3; -import org.junit.Assert; -import org.junit.Test; - import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.Map; import java.util.Objects; +import org.junit.Assert; +import org.junit.Test; + /** * Test cases for reported issue between JEXL-300 and JEXL-399. */ diff --git a/src/test/java/org/apache/commons/jexl3/IssuesTest.java b/src/test/java/org/apache/commons/jexl3/IssuesTest.java index 317ab5ce2..34deb3234 100644 --- a/src/test/java/org/apache/commons/jexl3/IssuesTest.java +++ b/src/test/java/org/apache/commons/jexl3/IssuesTest.java @@ -16,11 +16,11 @@ */ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.internal.Engine; -import org.apache.commons.jexl3.internal.introspection.Uberspect; - import java.util.HashMap; import java.util.Map; + +import org.apache.commons.jexl3.internal.Engine; +import org.apache.commons.jexl3.internal.introspection.Uberspect; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/JXLTTest.java b/src/test/java/org/apache/commons/jexl3/JXLTTest.java index d61a07d5a..da68b04ee 100644 --- a/src/test/java/org/apache/commons/jexl3/JXLTTest.java +++ b/src/test/java/org/apache/commons/jexl3/JXLTTest.java @@ -16,14 +16,6 @@ */ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.internal.Debugger; -import org.apache.commons.jexl3.internal.TemplateDebugger; -import org.apache.commons.jexl3.internal.TemplateInterpreter; -import org.apache.commons.jexl3.internal.introspection.Permissions; -import org.apache.commons.jexl3.internal.introspection.Uberspect; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import java.io.PrintWriter; import java.io.StringReader; import java.io.StringWriter; @@ -33,6 +25,14 @@ import java.util.Collections; import java.util.List; import java.util.Set; + +import org.apache.commons.jexl3.internal.Debugger; +import org.apache.commons.jexl3.internal.TemplateDebugger; +import org.apache.commons.jexl3.internal.TemplateInterpreter; +import org.apache.commons.jexl3.internal.introspection.Permissions; +import org.apache.commons.jexl3.internal.introspection.Uberspect; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/org/apache/commons/jexl3/Jexl.java b/src/test/java/org/apache/commons/jexl3/Jexl.java index df3c78cb9..e979eaaa3 100644 --- a/src/test/java/org/apache/commons/jexl3/Jexl.java +++ b/src/test/java/org/apache/commons/jexl3/Jexl.java @@ -17,9 +17,10 @@ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.internal.Engine; import java.util.Map; +import org.apache.commons.jexl3.internal.Engine; + /** * Command line interface for JEXL for use in testing * @since 1.0 diff --git a/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java b/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java index 5055e1e32..4520cfb91 100644 --- a/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java +++ b/src/test/java/org/apache/commons/jexl3/JexlEvalContext.java @@ -18,6 +18,7 @@ import java.util.Collections; import java.util.Map; + import org.apache.commons.jexl3.annotations.NoJexl; /** diff --git a/src/test/java/org/apache/commons/jexl3/LambdaTest.java b/src/test/java/org/apache/commons/jexl3/LambdaTest.java index 7003a52f9..28f6fb531 100644 --- a/src/test/java/org/apache/commons/jexl3/LambdaTest.java +++ b/src/test/java/org/apache/commons/jexl3/LambdaTest.java @@ -16,16 +16,16 @@ */ package org.apache.commons.jexl3; -import org.apache.commons.jexl3.internal.Closure; -import org.apache.commons.jexl3.internal.Script; -import org.junit.Assert; -import org.junit.Test; - import java.util.Arrays; import java.util.List; import java.util.Set; import java.util.concurrent.Callable; +import org.apache.commons.jexl3.internal.Closure; +import org.apache.commons.jexl3.internal.Script; +import org.junit.Assert; +import org.junit.Test; + /** * Tests function/lambda/closure features. */ diff --git a/src/test/java/org/apache/commons/jexl3/LexicalTest.java b/src/test/java/org/apache/commons/jexl3/LexicalTest.java index 939830181..184b6e037 100644 --- a/src/test/java/org/apache/commons/jexl3/LexicalTest.java +++ b/src/test/java/org/apache/commons/jexl3/LexicalTest.java @@ -16,6 +16,8 @@ */ package org.apache.commons.jexl3; +import static org.apache.commons.jexl3.JexlTestCase.createEngine; + import java.io.StringReader; import java.io.StringWriter; import java.util.ArrayList; @@ -25,13 +27,12 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.Callable; + import org.apache.commons.jexl3.internal.LexicalScope; import org.apache.commons.jexl3.internal.Script; import org.junit.Assert; import org.junit.Test; -import static org.apache.commons.jexl3.JexlTestCase.createEngine; - /** * Test cases for lexical option and feature. */ diff --git a/src/test/java/org/apache/commons/jexl3/MapLiteralTest.java b/src/test/java/org/apache/commons/jexl3/MapLiteralTest.java index db1f3f2ce..281d4bec5 100644 --- a/src/test/java/org/apache/commons/jexl3/MapLiteralTest.java +++ b/src/test/java/org/apache/commons/jexl3/MapLiteralTest.java @@ -21,6 +21,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/MethodTest.java b/src/test/java/org/apache/commons/jexl3/MethodTest.java index 75250ac1a..d9bbbeae5 100644 --- a/src/test/java/org/apache/commons/jexl3/MethodTest.java +++ b/src/test/java/org/apache/commons/jexl3/MethodTest.java @@ -16,15 +16,16 @@ */ package org.apache.commons.jexl3; -import java.util.HashMap; -import java.util.Map; -import org.apache.commons.jexl3.junit.Asserter; import java.util.Arrays; import java.util.Date; +import java.util.HashMap; +import java.util.Map; + import org.apache.commons.jexl3.introspection.JexlMethod; import org.apache.commons.jexl3.introspection.JexlPropertyGet; import org.apache.commons.jexl3.introspection.JexlPropertySet; import org.apache.commons.jexl3.introspection.JexlUberspect; +import org.apache.commons.jexl3.junit.Asserter; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/RangeTest.java b/src/test/java/org/apache/commons/jexl3/RangeTest.java index fbcdf0b37..456b3e17c 100644 --- a/src/test/java/org/apache/commons/jexl3/RangeTest.java +++ b/src/test/java/org/apache/commons/jexl3/RangeTest.java @@ -17,6 +17,7 @@ package org.apache.commons.jexl3; import java.util.Collection; + import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java b/src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java index d0745f729..543c6216c 100644 --- a/src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java +++ b/src/test/java/org/apache/commons/jexl3/ScriptCallableTest.java @@ -28,6 +28,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; + import org.apache.commons.jexl3.internal.Script; import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/SetLiteralTest.java b/src/test/java/org/apache/commons/jexl3/SetLiteralTest.java index ccc415727..17e7c72d1 100644 --- a/src/test/java/org/apache/commons/jexl3/SetLiteralTest.java +++ b/src/test/java/org/apache/commons/jexl3/SetLiteralTest.java @@ -21,6 +21,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; + import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/SideEffectTest.java b/src/test/java/org/apache/commons/jexl3/SideEffectTest.java index 9eb779cad..6b5d9c708 100644 --- a/src/test/java/org/apache/commons/jexl3/SideEffectTest.java +++ b/src/test/java/org/apache/commons/jexl3/SideEffectTest.java @@ -20,9 +20,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.Collections; import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.jexl3.jexl342.OptionalArithmetic; diff --git a/src/test/java/org/apache/commons/jexl3/StrategyTest.java b/src/test/java/org/apache/commons/jexl3/StrategyTest.java index c10080d7a..ae20ebd41 100644 --- a/src/test/java/org/apache/commons/jexl3/StrategyTest.java +++ b/src/test/java/org/apache/commons/jexl3/StrategyTest.java @@ -16,12 +16,13 @@ */ package org.apache.commons.jexl3; +import java.util.HashMap; +import java.util.Map; + import org.apache.commons.jexl3.internal.Engine; import org.apache.commons.jexl3.introspection.JexlPropertyGet; import org.apache.commons.jexl3.introspection.JexlPropertySet; import org.apache.commons.jexl3.introspection.JexlUberspect; -import java.util.HashMap; -import java.util.Map; import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/SynchronizedOverloadsTest.java b/src/test/java/org/apache/commons/jexl3/SynchronizedOverloadsTest.java index 94960a4d0..6c0605c8e 100644 --- a/src/test/java/org/apache/commons/jexl3/SynchronizedOverloadsTest.java +++ b/src/test/java/org/apache/commons/jexl3/SynchronizedOverloadsTest.java @@ -18,6 +18,7 @@ import java.util.Map; import java.util.TreeMap; + import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/examples/ArrayTest.java b/src/test/java/org/apache/commons/jexl3/examples/ArrayTest.java index fc5991464..330fa1a3c 100644 --- a/src/test/java/org/apache/commons/jexl3/examples/ArrayTest.java +++ b/src/test/java/org/apache/commons/jexl3/examples/ArrayTest.java @@ -17,14 +17,14 @@ package org.apache.commons.jexl3.examples; -import org.apache.commons.jexl3.JexlExpression; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.jexl3.JexlBuilder; import org.apache.commons.jexl3.JexlContext; import org.apache.commons.jexl3.JexlEngine; +import org.apache.commons.jexl3.JexlExpression; import org.apache.commons.jexl3.MapContext; - -import java.util.List; -import java.util.ArrayList; -import org.apache.commons.jexl3.JexlBuilder; import org.junit.Test; /** diff --git a/src/test/java/org/apache/commons/jexl3/examples/MethodPropertyTest.java b/src/test/java/org/apache/commons/jexl3/examples/MethodPropertyTest.java index 67d1ba521..7347560a1 100644 --- a/src/test/java/org/apache/commons/jexl3/examples/MethodPropertyTest.java +++ b/src/test/java/org/apache/commons/jexl3/examples/MethodPropertyTest.java @@ -18,9 +18,9 @@ package org.apache.commons.jexl3.examples; import org.apache.commons.jexl3.JexlBuilder; -import org.apache.commons.jexl3.JexlExpression; import org.apache.commons.jexl3.JexlContext; import org.apache.commons.jexl3.JexlEngine; +import org.apache.commons.jexl3.JexlExpression; import org.apache.commons.jexl3.MapContext; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java b/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java index 6d0e15cce..a596f4969 100644 --- a/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java +++ b/src/test/java/org/apache/commons/jexl3/examples/StreamTest.java @@ -16,6 +16,14 @@ */ package org.apache.commons.jexl3.examples; +import static java.lang.Boolean.TRUE; + +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.apache.commons.jexl3.JexlBuilder; import org.apache.commons.jexl3.JexlContext; import org.apache.commons.jexl3.JexlEngine; @@ -27,14 +35,6 @@ import org.junit.Assert; import org.junit.Test; -import java.net.URI; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static java.lang.Boolean.TRUE; - /** * A test around scripting streams. */ diff --git a/src/test/java/org/apache/commons/jexl3/internal/RangeTest.java b/src/test/java/org/apache/commons/jexl3/internal/RangeTest.java index f016d9327..8e683efe1 100644 --- a/src/test/java/org/apache/commons/jexl3/internal/RangeTest.java +++ b/src/test/java/org/apache/commons/jexl3/internal/RangeTest.java @@ -16,10 +16,11 @@ */ package org.apache.commons.jexl3.internal; -import org.apache.commons.jexl3.JexlTestCase; import java.util.Collections; import java.util.Iterator; import java.util.NoSuchElementException; + +import org.apache.commons.jexl3.JexlTestCase; import org.junit.After; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/org/apache/commons/jexl3/internal/Util.java b/src/test/java/org/apache/commons/jexl3/internal/Util.java index 05c82a4a3..4b7d26100 100644 --- a/src/test/java/org/apache/commons/jexl3/internal/Util.java +++ b/src/test/java/org/apache/commons/jexl3/internal/Util.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; + import org.apache.commons.jexl3.JexlEngine; import org.apache.commons.jexl3.JexlException; import org.apache.commons.jexl3.JexlFeatures; diff --git a/src/test/java/org/apache/commons/jexl3/internal/introspection/DiscoveryTest.java b/src/test/java/org/apache/commons/jexl3/internal/introspection/DiscoveryTest.java index 1e454354a..26d32a7a8 100644 --- a/src/test/java/org/apache/commons/jexl3/internal/introspection/DiscoveryTest.java +++ b/src/test/java/org/apache/commons/jexl3/internal/introspection/DiscoveryTest.java @@ -17,16 +17,16 @@ package org.apache.commons.jexl3.internal.introspection; import java.io.Serializable; -import org.apache.commons.jexl3.JexlTestCase; -import org.apache.commons.jexl3.internal.Engine; -import org.apache.commons.jexl3.introspection.JexlPropertyGet; -import org.apache.commons.jexl3.introspection.JexlPropertySet; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + +import org.apache.commons.jexl3.JexlTestCase; +import org.apache.commons.jexl3.internal.Engine; import org.apache.commons.jexl3.introspection.JexlMethod; +import org.apache.commons.jexl3.introspection.JexlPropertyGet; +import org.apache.commons.jexl3.introspection.JexlPropertySet; import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/apache/commons/jexl3/internal/introspection/MiscIntrospectionTest.java b/src/test/java/org/apache/commons/jexl3/internal/introspection/MiscIntrospectionTest.java index 4c8d4f874..9e669147e 100644 --- a/src/test/java/org/apache/commons/jexl3/internal/introspection/MiscIntrospectionTest.java +++ b/src/test/java/org/apache/commons/jexl3/internal/introspection/MiscIntrospectionTest.java @@ -16,13 +16,13 @@ */ package org.apache.commons.jexl3.internal.introspection; +import java.util.ArrayList; +import java.util.NoSuchElementException; + import org.apache.commons.jexl3.JexlEngine; import org.junit.Assert; import org.junit.Test; -import java.util.ArrayList; -import java.util.NoSuchElementException; - /** * Checks the CacheMap.MethodKey implementation */ diff --git a/src/test/java/org/apache/commons/jexl3/internal/introspection/NoJexlTest.java b/src/test/java/org/apache/commons/jexl3/internal/introspection/NoJexlTest.java index f9f67f4e1..d4012fa6d 100644 --- a/src/test/java/org/apache/commons/jexl3/internal/introspection/NoJexlTest.java +++ b/src/test/java/org/apache/commons/jexl3/internal/introspection/NoJexlTest.java @@ -16,14 +16,14 @@ */ package org.apache.commons.jexl3.internal.introspection; -import org.apache.commons.jexl3.annotations.NoJexl; -import org.junit.Assert; -import org.junit.Test; - import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; +import org.apache.commons.jexl3.annotations.NoJexl; +import org.junit.Assert; +import org.junit.Test; + /** * Checks the CacheMap.MethodKey implementation */ diff --git a/src/test/java/org/apache/commons/jexl3/internal/introspection/PermissionsTest.java b/src/test/java/org/apache/commons/jexl3/internal/introspection/PermissionsTest.java index 8eef59815..deb44d7ec 100644 --- a/src/test/java/org/apache/commons/jexl3/internal/introspection/PermissionsTest.java +++ b/src/test/java/org/apache/commons/jexl3/internal/introspection/PermissionsTest.java @@ -16,6 +16,17 @@ */ package org.apache.commons.jexl3.internal.introspection; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.apache.commons.jexl3.JexlArithmetic; import org.apache.commons.jexl3.JexlBuilder; import org.apache.commons.jexl3.JexlContext; @@ -30,17 +41,6 @@ import org.junit.Assert; import org.junit.Test; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - /** * Checks the CacheMap.MethodKey implementation diff --git a/src/test/java/org/apache/commons/jexl3/jexl342/OptionalArithmetic.java b/src/test/java/org/apache/commons/jexl3/jexl342/OptionalArithmetic.java index 59ace86fc..4665ce9c8 100644 --- a/src/test/java/org/apache/commons/jexl3/jexl342/OptionalArithmetic.java +++ b/src/test/java/org/apache/commons/jexl3/jexl342/OptionalArithmetic.java @@ -16,14 +16,14 @@ */ package org.apache.commons.jexl3.jexl342; -import org.apache.commons.jexl3.JexlArithmetic; - import java.lang.ref.Reference; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; +import org.apache.commons.jexl3.JexlArithmetic; + /** * Unwraps Optional/Reference/AtomicReference on public and key methods. */ diff --git a/src/test/java/org/apache/commons/jexl3/jexl342/OptionalNullGetter.java b/src/test/java/org/apache/commons/jexl3/jexl342/OptionalNullGetter.java index 87780d95d..c3e471be3 100644 --- a/src/test/java/org/apache/commons/jexl3/jexl342/OptionalNullGetter.java +++ b/src/test/java/org/apache/commons/jexl3/jexl342/OptionalNullGetter.java @@ -16,13 +16,13 @@ */ package org.apache.commons.jexl3.jexl342; +import java.util.Objects; + import org.apache.commons.jexl3.JexlEngine; import org.apache.commons.jexl3.JexlException; import org.apache.commons.jexl3.introspection.JexlPropertyGet; import org.apache.commons.jexl3.introspection.JexlUberspect; -import java.util.Objects; - /** * JexlPropertyGet on a reference that pointed null. *

Performs a late discovery of the actual getter.

diff --git a/src/test/java/org/apache/commons/jexl3/jexl342/OptionalNullSetter.java b/src/test/java/org/apache/commons/jexl3/jexl342/OptionalNullSetter.java index 51eec374d..8fa0485dd 100644 --- a/src/test/java/org/apache/commons/jexl3/jexl342/OptionalNullSetter.java +++ b/src/test/java/org/apache/commons/jexl3/jexl342/OptionalNullSetter.java @@ -16,13 +16,13 @@ */ package org.apache.commons.jexl3.jexl342; +import java.util.Objects; + import org.apache.commons.jexl3.JexlEngine; import org.apache.commons.jexl3.JexlException; import org.apache.commons.jexl3.introspection.JexlPropertySet; import org.apache.commons.jexl3.introspection.JexlUberspect; -import java.util.Objects; - /** * JexlPropertySet on a reference that pointed null. *

Performs a late discovery of the actual setter.

diff --git a/src/test/java/org/apache/commons/jexl3/jexl342/OptionalTest.java b/src/test/java/org/apache/commons/jexl3/jexl342/OptionalTest.java index 27aa276ae..7e8a56027 100644 --- a/src/test/java/org/apache/commons/jexl3/jexl342/OptionalTest.java +++ b/src/test/java/org/apache/commons/jexl3/jexl342/OptionalTest.java @@ -16,6 +16,13 @@ */ package org.apache.commons.jexl3.jexl342; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + import org.apache.commons.jexl3.JexlArithmetic; import org.apache.commons.jexl3.JexlBuilder; import org.apache.commons.jexl3.JexlContext; @@ -28,13 +35,6 @@ import org.junit.Assert; import org.junit.Test; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.Stream; - public class OptionalTest { public static class Thing { diff --git a/src/test/java/org/apache/commons/jexl3/jexl342/ReferenceUberspect.java b/src/test/java/org/apache/commons/jexl3/jexl342/ReferenceUberspect.java index ee248416b..0b434cdb1 100644 --- a/src/test/java/org/apache/commons/jexl3/jexl342/ReferenceUberspect.java +++ b/src/test/java/org/apache/commons/jexl3/jexl342/ReferenceUberspect.java @@ -16,15 +16,6 @@ */ package org.apache.commons.jexl3.jexl342; -import org.apache.commons.jexl3.JexlArithmetic; -import org.apache.commons.jexl3.JexlEngine; -import org.apache.commons.jexl3.JexlException; -import org.apache.commons.jexl3.JexlOperator; -import org.apache.commons.jexl3.introspection.JexlMethod; -import org.apache.commons.jexl3.introspection.JexlPropertyGet; -import org.apache.commons.jexl3.introspection.JexlPropertySet; -import org.apache.commons.jexl3.introspection.JexlUberspect; - import java.lang.ref.Reference; import java.util.Arrays; import java.util.Collections; @@ -35,6 +26,15 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; +import org.apache.commons.jexl3.JexlArithmetic; +import org.apache.commons.jexl3.JexlEngine; +import org.apache.commons.jexl3.JexlException; +import org.apache.commons.jexl3.JexlOperator; +import org.apache.commons.jexl3.introspection.JexlMethod; +import org.apache.commons.jexl3.introspection.JexlPropertyGet; +import org.apache.commons.jexl3.introspection.JexlPropertySet; +import org.apache.commons.jexl3.introspection.JexlUberspect; + /** * An Uberspect that handles references (java.lang.ref.Reference) and optionals (java.util.Optional). *

This illustrates JEXL"e;s low level customization capabilities.

diff --git a/src/test/java/org/apache/commons/jexl3/junit/Asserter.java b/src/test/java/org/apache/commons/jexl3/junit/Asserter.java index afe1c722a..4a871755a 100644 --- a/src/test/java/org/apache/commons/jexl3/junit/Asserter.java +++ b/src/test/java/org/apache/commons/jexl3/junit/Asserter.java @@ -23,11 +23,10 @@ import java.util.Map; import java.util.function.BiPredicate; - -import org.apache.commons.jexl3.JexlEvalContext; import org.apache.commons.jexl3.JexlArithmetic; import org.apache.commons.jexl3.JexlContext; import org.apache.commons.jexl3.JexlEngine; +import org.apache.commons.jexl3.JexlEvalContext; import org.apache.commons.jexl3.JexlException; import org.apache.commons.jexl3.JexlScript; import org.junit.Assert; diff --git a/src/test/java/org/apache/commons/jexl3/scripting/JexlScriptEngineOptionalTest.java b/src/test/java/org/apache/commons/jexl3/scripting/JexlScriptEngineOptionalTest.java index de9f78785..4560cf33b 100644 --- a/src/test/java/org/apache/commons/jexl3/scripting/JexlScriptEngineOptionalTest.java +++ b/src/test/java/org/apache/commons/jexl3/scripting/JexlScriptEngineOptionalTest.java @@ -18,11 +18,12 @@ package org.apache.commons.jexl3.scripting; import java.io.StringWriter; + import javax.script.Compilable; import javax.script.CompiledScript; - import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; + import org.junit.Assert; import org.junit.Test; diff --git a/src/test/java/org/example/SomeTest.java b/src/test/java/org/example/SomeTest.java index 68468ef89..7571642ed 100644 --- a/src/test/java/org/example/SomeTest.java +++ b/src/test/java/org/example/SomeTest.java @@ -16,29 +16,23 @@ */ package org.example; -import org.apache.commons.jexl3.JexlArithmetic; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + import org.apache.commons.jexl3.JexlBuilder; import org.apache.commons.jexl3.JexlContext; import org.apache.commons.jexl3.JexlEngine; -import org.apache.commons.jexl3.JexlException; import org.apache.commons.jexl3.JexlExpression; -import org.apache.commons.jexl3.JexlOptions; import org.apache.commons.jexl3.JexlScript; import org.apache.commons.jexl3.MapContext; import org.apache.commons.jexl3.internal.Engine; -import org.apache.commons.jexl3.internal.Frame; -import org.apache.commons.jexl3.internal.Interpreter; -import org.apache.commons.jexl3.internal.TemplateEngine; import org.apache.commons.jexl3.internal.TemplateInterpreter; import org.apache.commons.jexl3.introspection.JexlPermissions; import org.apache.commons.jexl3.parser.JexlNode; import org.junit.Assert; import org.junit.Test; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; - public class SomeTest { public static class MyMath {