// Path: instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/ClassInformationRepository.java
// public interface ClassInformationRepository {
// 
//     /**
//      * Get information for a class.
//      * <p>
//      * This method returns class information as if it were encountered in a class file. In a class file, if the class is an interface, then
//      * its superclass is set to {@link Object}. Note that this is different from what {@link Class#getSuperclass() } returns when the class
//      * represents an interface (it returns {@code null}).
//      * @param internalClassName internal class name
//      * @throws NullPointerException if any argument is {@code null}
//      * @return information for that class, or {@code null} if not found
//      */
//     ClassInformation getInformation(String internalClassName);
//     
// }


import com.offbynull.coroutines.instrumenter.asm.ClassInformationRepository;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.Validate;
import org.objectweb.asm.tree.MethodNode;
/*
 * Copyright (c) 2017, Kasra Faghihi, All rights reserved.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3.0 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.
 */
package com.offbynull.coroutines.instrumenter;


final class InstrumentationState {
    private final InstrumentationSettings instrumentationSettings;
    private final ClassInformationRepository classInformationRepository;
    
    private final Map<MethodNode, MethodAttributes> methodAttributes;
    private final Map<String, byte[]> extraFiles;

    private ControlFlag stop;

    InstrumentationState(InstrumentationSettings instrumentationSettings, ClassInformationRepository classInformationRepository) {
        Validate.notNull(instrumentationSettings);
        Validate.notNull(classInformationRepository);
        this.instrumentationSettings = instrumentationSettings;
        this.classInformationRepository = classInformationRepository;
        
        this.methodAttributes = new HashMap<>();
        this.extraFiles = new HashMap<>();
        
        this.stop = ControlFlag.CONTINUE_INSTRUMENT;
    }

    InstrumentationSettings instrumentationSettings() {
        return instrumentationSettings;
    }

// Path: instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/ClassInformationRepository.java
// public interface ClassInformationRepository {
// 
//     /**
//      * Get information for a class.
//      * <p>
//      * This method returns class information as if it were encountered in a class file. In a class file, if the class is an interface, then
//      * its superclass is set to {@link Object}. Note that this is different from what {@link Class#getSuperclass() } returns when the class
//      * represents an interface (it returns {@code null}).
//      * @param internalClassName internal class name
//      * @throws NullPointerException if any argument is {@code null}
//      * @return information for that class, or {@code null} if not found
//      */
//     ClassInformation getInformation(String internalClassName);
//     
// }


// Path: instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/InstrumentationState.java
import com.offbynull.coroutines.instrumenter.asm.ClassInformationRepository;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.Validate;
import org.objectweb.asm.tree.MethodNode;

/*
 * Copyright (c) 2017, Kasra Faghihi, All rights reserved.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3.0 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.
 */
package com.offbynull.coroutines.instrumenter;


final class InstrumentationState {
    private final InstrumentationSettings instrumentationSettings;
    private final ClassInformationRepository classInformationRepository;
    
    private final Map<MethodNode, MethodAttributes> methodAttributes;
    private final Map<String, byte[]> extraFiles;

    private ControlFlag stop;

    InstrumentationState(InstrumentationSettings instrumentationSettings, ClassInformationRepository classInformationRepository) {
        Validate.notNull(instrumentationSettings);
        Validate.notNull(classInformationRepository);
        this.instrumentationSettings = instrumentationSettings;
        this.classInformationRepository = classInformationRepository;
        
        this.methodAttributes = new HashMap<>();
        this.extraFiles = new HashMap<>();
        
        this.stop = ControlFlag.CONTINUE_INSTRUMENT;
    }

    InstrumentationSettings instrumentationSettings() {
        return instrumentationSettings;
    }

    ClassInformationRepository classInformationRepository() {