package org.zstack.header.core;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

import static java.util.Arrays.asList;

/**
 */
public abstract class AbstractCompletion implements AsyncBackup {
    protected List<AsyncBackup> backups;
    private final AtomicBoolean successCalled = new AtomicBoolean(false);
    private final AtomicBoolean failCalled = new AtomicBoolean(false);

    public final List<AsyncBackup> getBackups() {
        return backups;
    }

    public final void setBackups(List<AsyncBackup> backups) {
        this.backups = backups;
    }

    protected AbstractCompletion(AsyncBackup one, AsyncBackup... others) {
        if (one != null) {
            backups = Collections.singletonList(one);
            Collections.addAll(backups, others);
        } else {
            backups = asList(others);
        }
    }

    public final AtomicBoolean getSuccessCalled() {
        return successCalled;
    }

    public final AtomicBoolean getFailCalled() {
        return failCalled;
    }
}

@@ -48,17 +48,20 @@
 il.Array
-s
+List
 ;%0Aimport
@@ -769,33 +769,50 @@
 s = 
-Collections.singletonList
+new ArrayList%3C%3E();%0A            backups.add
 (one

fix BAT