From b1717db85b02f8975c9647c981b1995569234ae9 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Sun, 5 Apr 2020 23:45:42 +0200 Subject: [PATCH] Remove unnecessary 'throws' declarations --- ...eWithActionMethodHavingMoreThanOneArgumentOfTypeFacts.java | 2 +- ...edRuleWithActionMethodHavingOneArgumentNotOfTypeFacts.java | 2 +- ...tatedRuleWithActionMethodHavingOneArgumentOfTypeFacts.java | 2 +- .../AnnotatedRuleWithActionMethodThatReturnsNonVoidType.java | 2 +- ...atedRuleWithConditionMethodHavingNonBooleanReturnType.java | 2 +- ...uleWithConditionMethodHavingOneArgumentNotOfTypeFacts.java | 2 +- .../rules/annotation/AnnotatedRuleWithMetaRuleAnnotation.java | 2 +- .../AnnotatedRuleWithMoreThanOnePriorityMethod.java | 2 +- .../annotation/AnnotatedRuleWithNonPublicActionMethod.java | 2 +- .../annotation/AnnotatedRuleWithNonPublicConditionMethod.java | 2 +- .../annotation/AnnotatedRuleWithNonPublicPriorityMethod.java | 2 +- .../AnnotatedRuleWithPriorityMethodHavingArguments.java | 2 +- ...tatedRuleWithPriorityMethodHavingNonIntegerReturnType.java | 2 +- .../rules/annotation/AnnotatedRuleWithoutActionMethod.java | 2 +- .../rules/annotation/AnnotatedRuleWithoutConditionMethod.java | 2 +- .../src/test/java/org/jeasy/rules/api/FactsTest.java | 4 ++-- .../test/java/org/jeasy/rules/support/UnitRuleGroupTest.java | 2 +- .../rules/tutorials/airco/DecreaseTemperatureAction.java | 2 +- .../org/jeasy/rules/tutorials/helloworld/HelloWorldRule.java | 2 +- .../main/java/org/jeasy/rules/tutorials/web/IndexServlet.java | 2 +- .../jeasy/rules/tutorials/web/SuspiciousRequestFilter.java | 2 +- 21 files changed, 22 insertions(+), 22 deletions(-) diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingMoreThanOneArgumentOfTypeFacts.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingMoreThanOneArgumentOfTypeFacts.java index 4b87599..9db0230 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingMoreThanOneArgumentOfTypeFacts.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingMoreThanOneArgumentOfTypeFacts.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithActionMethodHavingMoreThanOneArgumentOfTypeFacts { } @Action - public void then(Facts facts, Facts otherFacts) throws Exception { + public void then(Facts facts, Facts otherFacts) { } } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingOneArgumentNotOfTypeFacts.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingOneArgumentNotOfTypeFacts.java index e00a052..8b97c97 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingOneArgumentNotOfTypeFacts.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingOneArgumentNotOfTypeFacts.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithActionMethodHavingOneArgumentNotOfTypeFacts { } @Action - public void then(int i) throws Exception { + public void then(int i) { if (i == 1) { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingOneArgumentOfTypeFacts.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingOneArgumentOfTypeFacts.java index d2f1709..d50da1f 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingOneArgumentOfTypeFacts.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodHavingOneArgumentOfTypeFacts.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithActionMethodHavingOneArgumentOfTypeFacts { } @Action - public void then(Facts facts) throws Exception { + public void then(Facts facts) { } } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodThatReturnsNonVoidType.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodThatReturnsNonVoidType.java index e104d0e..2b2d3d5 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodThatReturnsNonVoidType.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithActionMethodThatReturnsNonVoidType.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithActionMethodThatReturnsNonVoidType { } @Action - private int then() throws Exception { + private int then() { executed = true; return 0; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithConditionMethodHavingNonBooleanReturnType.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithConditionMethodHavingNonBooleanReturnType.java index adad6e5..dfde354 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithConditionMethodHavingNonBooleanReturnType.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithConditionMethodHavingNonBooleanReturnType.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithConditionMethodHavingNonBooleanReturnType { } @Action - public void then() throws Exception { + public void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithConditionMethodHavingOneArgumentNotOfTypeFacts.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithConditionMethodHavingOneArgumentNotOfTypeFacts.java index a191146..c5fab46 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithConditionMethodHavingOneArgumentNotOfTypeFacts.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithConditionMethodHavingOneArgumentNotOfTypeFacts.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithConditionMethodHavingOneArgumentNotOfTypeFacts { } @Action - public void then() throws Exception { + public void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithMetaRuleAnnotation.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithMetaRuleAnnotation.java index 8764fcc..f81787a 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithMetaRuleAnnotation.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithMetaRuleAnnotation.java @@ -32,6 +32,6 @@ public class AnnotatedRuleWithMetaRuleAnnotation { } @Action - public void then() throws Exception { + public void then() { } } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithMoreThanOnePriorityMethod.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithMoreThanOnePriorityMethod.java index 5cdb365..cdd53ec 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithMoreThanOnePriorityMethod.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithMoreThanOnePriorityMethod.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithMoreThanOnePriorityMethod { } @Action - public void then() throws Exception { + public void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicActionMethod.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicActionMethod.java index 90a6890..b0567b6 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicActionMethod.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicActionMethod.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithNonPublicActionMethod { } @Action - private void then() throws Exception { + private void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicConditionMethod.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicConditionMethod.java index a0be70d..3d6c028 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicConditionMethod.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicConditionMethod.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithNonPublicConditionMethod { } @Action - public void then() throws Exception { + public void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicPriorityMethod.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicPriorityMethod.java index 413e16d..f03ce48 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicPriorityMethod.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithNonPublicPriorityMethod.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithNonPublicPriorityMethod { } @Action - private void then() throws Exception { + private void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithPriorityMethodHavingArguments.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithPriorityMethodHavingArguments.java index d8c5529..dd3109f 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithPriorityMethodHavingArguments.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithPriorityMethodHavingArguments.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithPriorityMethodHavingArguments { } @Action - private void then() throws Exception { + private void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithPriorityMethodHavingNonIntegerReturnType.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithPriorityMethodHavingNonIntegerReturnType.java index 53fdc4e..059c601 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithPriorityMethodHavingNonIntegerReturnType.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithPriorityMethodHavingNonIntegerReturnType.java @@ -34,7 +34,7 @@ public class AnnotatedRuleWithPriorityMethodHavingNonIntegerReturnType { } @Action - private void then() throws Exception { + private void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithoutActionMethod.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithoutActionMethod.java index ce2f966..bee213d 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithoutActionMethod.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithoutActionMethod.java @@ -33,7 +33,7 @@ public class AnnotatedRuleWithoutActionMethod { return true; } - public void then() throws Exception { + public void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithoutConditionMethod.java b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithoutConditionMethod.java index 2bb4297..6e4dd13 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithoutConditionMethod.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/annotation/AnnotatedRuleWithoutConditionMethod.java @@ -33,7 +33,7 @@ public class AnnotatedRuleWithoutConditionMethod { } @Action - public void then() throws Exception { + public void then() { executed = true; } diff --git a/easy-rules-core/src/test/java/org/jeasy/rules/api/FactsTest.java b/easy-rules-core/src/test/java/org/jeasy/rules/api/FactsTest.java index dcc388d..68b0b26 100644 --- a/easy-rules-core/src/test/java/org/jeasy/rules/api/FactsTest.java +++ b/easy-rules-core/src/test/java/org/jeasy/rules/api/FactsTest.java @@ -53,7 +53,7 @@ public class FactsTest { } @Test - public void remove() throws Exception { + public void remove() { facts.put("foo", 1); facts.remove("foo"); @@ -71,7 +71,7 @@ public class FactsTest { } @Test - public void get() throws Exception { + public void get() { facts.put("foo", 1); Object foo = facts.get("foo"); assertThat(foo).isEqualTo(1); diff --git a/easy-rules-support/src/test/java/org/jeasy/rules/support/UnitRuleGroupTest.java b/easy-rules-support/src/test/java/org/jeasy/rules/support/UnitRuleGroupTest.java index 1983fa9..6e88135 100644 --- a/easy-rules-support/src/test/java/org/jeasy/rules/support/UnitRuleGroupTest.java +++ b/easy-rules-support/src/test/java/org/jeasy/rules/support/UnitRuleGroupTest.java @@ -55,7 +55,7 @@ public class UnitRuleGroupTest { @Before - public void setUp() throws Exception { + public void setUp() { when(rule1.evaluate(facts)).thenReturn(true); when(rule2.evaluate(facts)).thenReturn(true); when(rule2.compareTo(rule1)).thenReturn(1); diff --git a/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/airco/DecreaseTemperatureAction.java b/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/airco/DecreaseTemperatureAction.java index 8ef1dce..6982c3e 100644 --- a/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/airco/DecreaseTemperatureAction.java +++ b/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/airco/DecreaseTemperatureAction.java @@ -33,7 +33,7 @@ public class DecreaseTemperatureAction implements Action { } @Override - public void execute(Facts facts) throws Exception { + public void execute(Facts facts) { System.out.println("It is hot! cooling air.."); Integer temperature = facts.get("temperature"); facts.put("temperature", temperature - 1); diff --git a/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/helloworld/HelloWorldRule.java b/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/helloworld/HelloWorldRule.java index 41360db..2a877ea 100644 --- a/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/helloworld/HelloWorldRule.java +++ b/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/helloworld/HelloWorldRule.java @@ -36,7 +36,7 @@ public class HelloWorldRule { } @Action - public void then() throws Exception { + public void then() { System.out.println("hello world"); } diff --git a/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/web/IndexServlet.java b/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/web/IndexServlet.java index b50ef8c..b5841a4 100644 --- a/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/web/IndexServlet.java +++ b/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/web/IndexServlet.java @@ -36,7 +36,7 @@ import static org.jeasy.rules.tutorials.web.SuspiciousRequestRule.SUSPICIOUS; @WebServlet("/index") public class IndexServlet extends HttpServlet { - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setContentType("text/plain"); PrintWriter out = response.getWriter(); if (isSuspicious(request)) { diff --git a/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/web/SuspiciousRequestFilter.java b/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/web/SuspiciousRequestFilter.java index 457433c..4b9ec5b 100644 --- a/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/web/SuspiciousRequestFilter.java +++ b/easy-rules-tutorials/src/main/java/org/jeasy/rules/tutorials/web/SuspiciousRequestFilter.java @@ -44,7 +44,7 @@ public class SuspiciousRequestFilter implements Filter { private RulesEngine rulesEngine; @Override - public void init(FilterConfig filterConfig) throws ServletException { + public void init(FilterConfig filterConfig) { rulesEngine = new DefaultRulesEngine(); rules = new Rules(); rules.register(new SuspiciousRequestRule());