/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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 com.hp.hpl.jena.sparql.algebra.optimize;

import com.hp.hpl.jena.sparql.algebra.Op;
import com.hp.hpl.jena.sparql.algebra.TransformCopy;
import com.hp.hpl.jena.sparql.algebra.Transformer;
import com.hp.hpl.jena.sparql.engine.binding.Binding;
import com.hp.hpl.jena.sparql.expr.Expr;
import com.hp.hpl.jena.sparql.expr.ExprFunction1;
import com.hp.hpl.jena.sparql.expr.ExprFunction2;
import com.hp.hpl.jena.sparql.expr.ExprFunction3;
import com.hp.hpl.jena.sparql.expr.ExprFunctionN;
import com.hp.hpl.jena.sparql.expr.ExprFunctionOp;
import com.hp.hpl.jena.sparql.expr.ExprList;
import com.hp.hpl.jena.sparql.expr.ExprTransformCopy;

/**
 * An expression transform that simplifies expressions by constant folding
 * wherever possible
 * 
 */
public class ExprTransformConstantFold extends ExprTransformCopy {

    private Binding b = null;

    @Override
    public Expr transform(ExprFunction1 func, Expr expr1) {
        return func.copySubstitute(this.b, true);
    }

    @Override
    public Expr transform(ExprFunction2 func, Expr expr1, Expr expr2) {
        return func.copySubstitute(this.b, true);
    }

    @Override
    public Expr transform(ExprFunction3 func, Expr expr1, Expr expr2, Expr expr3) {
        return func.copySubstitute(this.b, true);
    }

    @Override
    public Expr transform(ExprFunctionN func, ExprList args) {
        return func.copySubstitute(this.b, true);
    }

    @Override
    public Expr transform(ExprFunctionOp funcOp, ExprList args, Op opArg) {
        return funcOp.copySubstitute(this.b, true);
    }

}

@@ -894,557 +894,103 @@
 a.Op
-;%0Aimport com.hp.hpl.jena.sparql.algebra.TransformCopy;%0Aimport com.hp.hpl.jena.sparql.algebra.Transformer;%0Aimport com.hp.hpl.jena.sparql.engine.binding.Binding;%0Aimport com.hp.hpl.jena.sparql.expr.Expr;%0Aimport com.hp.hpl.jena.sparql.expr.ExprFunction1;%0Aimport com.hp.hpl.jena.sparql.expr.ExprFunction2;%0Aimport com.hp.hpl.jena.sparql.expr.ExprFunction3;%0Aimport com.hp.hpl.jena.sparql.expr.ExprFunctionN;%0Aimport com.hp.hpl.jena.sparql.expr.ExprFunctionOp;%0Aimport com.hp.hpl.jena.sparql.expr.ExprList;%0Aimport com.hp.hpl.jena.sparql.expr.ExprTransformCopy
+ ;%0Aimport com.hp.hpl.jena.sparql.engine.binding.Binding ;%0Aimport com.hp.hpl.jena.sparql.expr.* 
 ;%0A%0A/
@@ -1067,16 +1067,16 @@
 folding%0A
+
  * where
@@ -1092,12 +1092,8 @@
 ble%0A
- * %0A
  */%0A

Remove warning about unused imports.