/*
 * Copyright 2002-2004 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.springframework.rules.closure;

import org.springframework.rules.NoArgClosure;

public abstract class NoArgBlock extends AbstractClosure implements NoArgClosure {

    public final Object call(Object argument) {
        return call();
    }

    public Object call() {
        handle();
        return NULL_VALUE;
    }

    protected Object handle() {
        throw new UnsupportedOperationException(
                "You must override handle() for a block that returns no value, or "
                        + "override call() for blocks that return a single value");
    }

}
@@ -771,16 +771,24 @@
 plements
+%0A       
  NoArgCl
@@ -795,16 +795,16 @@
 osure %7B%0A
-
 %0A    pub
@@ -967,22 +967,20 @@
 otected 
-Object
+void
  handle(
@@ -1067,22 +1067,20 @@
 verride 
-handle
+call
 () for a
@@ -1080,16 +1080,22 @@
 ) for a 
+noArg 
 block th
@@ -1105,18 +1105,17 @@
 returns 
-no
+a
  value, 
@@ -1159,25 +1159,34 @@
 ide 
-call
+handle
 () for 
+a noArg 
 block
-s
  tha
@@ -1197,17 +1197,12 @@
 turn
- a single
+s no
  val

handle contract was wrong