/*
 * 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 org.apache.logging.log4j.core.config;

import java.util.concurrent.Delayed;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
 *
 */
public class CronScheduledFuture<V> implements ScheduledFuture<V> {

    private volatile ScheduledFuture<?> scheduledFuture;

    public CronScheduledFuture(ScheduledFuture<V> future) {
        this.scheduledFuture = future;
    }

    void setScheduledFuture(ScheduledFuture<?> future) {
        this.scheduledFuture = future;
    }

    @Override
    public long getDelay(TimeUnit unit) {
        return scheduledFuture.getDelay(unit);
    }

    @Override
    public int compareTo(Delayed delayed) {
        return scheduledFuture.compareTo(delayed);
    }

    @Override
    public boolean cancel(boolean mayInterruptIfRunning) {
        return scheduledFuture.cancel(mayInterruptIfRunning);
    }

    @Override
    public boolean isCancelled() {
        return scheduledFuture.isCancelled();
    }

    @Override
    public boolean isDone() {
        return scheduledFuture.isDone();
    }

    @Override
    @SuppressWarnings("unchecked")
    public V get() throws InterruptedException, ExecutionException {
        return (V) scheduledFuture.get();
    }

    @Override
    @SuppressWarnings("unchecked")
    public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
        return (V) scheduledFuture.get(timeout, unit);
    }
}

@@ -1217,32 +1217,38 @@
 ScheduledFuture(
+final 
 ScheduledFuture%3C
@@ -1252,32 +1252,32 @@
 re%3CV%3E future) %7B%0A
-
         this.sch
@@ -1334,16 +1334,22 @@
 dFuture(
+final 
 Schedule
@@ -1454,16 +1454,22 @@
 etDelay(
+final 
 TimeUnit
@@ -1570,16 +1570,22 @@
 mpareTo(
+final 
 Delayed 
@@ -1659,32 +1659,32 @@
 %0A%0A    @Override%0A
-
     public boole
@@ -1693,16 +1693,22 @@
  cancel(
+final 
 boolean 
@@ -2228,16 +2228,22 @@
 c V get(
+final 
 long tim
@@ -2247,16 +2247,22 @@
 timeout,
+ final
  TimeUni

Use final.