Remove unnecessary 'throws' declarations

pull/271/head
Mahmoud Ben Hassine 5 years ago
parent 2e6aec4035
commit b1717db85b
No known key found for this signature in database
GPG Key ID: 79FCFB0A184E0036

@ -34,7 +34,7 @@ public class AnnotatedRuleWithActionMethodHavingMoreThanOneArgumentOfTypeFacts {
}
@Action
public void then(Facts facts, Facts otherFacts) throws Exception {
public void then(Facts facts, Facts otherFacts) {
}
}

@ -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;
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithActionMethodHavingOneArgumentOfTypeFacts {
}
@Action
public void then(Facts facts) throws Exception {
public void then(Facts facts) {
}
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithActionMethodThatReturnsNonVoidType {
}
@Action
private int then() throws Exception {
private int then() {
executed = true;
return 0;
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithConditionMethodHavingNonBooleanReturnType {
}
@Action
public void then() throws Exception {
public void then() {
executed = true;
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithConditionMethodHavingOneArgumentNotOfTypeFacts {
}
@Action
public void then() throws Exception {
public void then() {
executed = true;
}

@ -32,6 +32,6 @@ public class AnnotatedRuleWithMetaRuleAnnotation {
}
@Action
public void then() throws Exception {
public void then() {
}
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithMoreThanOnePriorityMethod {
}
@Action
public void then() throws Exception {
public void then() {
executed = true;
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithNonPublicActionMethod {
}
@Action
private void then() throws Exception {
private void then() {
executed = true;
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithNonPublicConditionMethod {
}
@Action
public void then() throws Exception {
public void then() {
executed = true;
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithNonPublicPriorityMethod {
}
@Action
private void then() throws Exception {
private void then() {
executed = true;
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithPriorityMethodHavingArguments {
}
@Action
private void then() throws Exception {
private void then() {
executed = true;
}

@ -34,7 +34,7 @@ public class AnnotatedRuleWithPriorityMethodHavingNonIntegerReturnType {
}
@Action
private void then() throws Exception {
private void then() {
executed = true;
}

@ -33,7 +33,7 @@ public class AnnotatedRuleWithoutActionMethod {
return true;
}
public void then() throws Exception {
public void then() {
executed = true;
}

@ -33,7 +33,7 @@ public class AnnotatedRuleWithoutConditionMethod {
}
@Action
public void then() throws Exception {
public void then() {
executed = true;
}

@ -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);

@ -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);

@ -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);

@ -36,7 +36,7 @@ public class HelloWorldRule {
}
@Action
public void then() throws Exception {
public void then() {
System.out.println("hello world");
}

@ -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)) {

@ -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());

Loading…
Cancel
Save