Projects >> cuke4duke >>793f7e1551bf370eafc665c38cca114cb827efc4

Chunk
Conflicting content
public interface ClassAnalyzer {
    void populateStepDefinitionsAndHooksFor(Class clazz, ObjectFactory objectFactory, ClassLanguage classLanguage) throws Throwable;
<<<<<<< HEAD
    void addDefaultTransforms(ClassLanguage classLanguage, ObjectFactory objectFactory);
=======

    Class[] alwaysLoad();
>>>>>>> 9fd00621e2187f7755eaae2c0223e0505387e9db
}
Solution content
public interface ClassAnalyzer {
    void populateStepDefinitionsAndHooksFor(Class clazz, ObjectFactory objectFactory, ClassLanguage classLanguage) throws Throwable;
    void addDefaultTransforms(ClassLanguage classLanguage, ObjectFactory objectFactory);
    Class[] alwaysLoad();
}
File
ClassAnalyzer.java
Developer's decision
Concatenation
Kind of conflict
Method interface
Chunk
Conflicting content
    public ClassLanguage(ClassLanguageMixin languageMixin, StepMother stepMother, List analyzers) throws Throwable {
        super(languageMixin);
        this.analyzers = analyzers;
<<<<<<< HEAD
        String className = System.getProperty("cuke4duke.objectFactory");
        if(className == null) {
            throw new RuntimeException("Missing system property: cuke4duke.objectFactory");
        }
        Class ofc = Thread.currentThread().getContextClassLoader().loadClass(className);
        Constructor ctor = ofc.getConstructor();
        try {
            objectFactory = (ObjectFactory) ctor.newInstance();
            objectFactory.addStepMother(stepMother);
            objectFactory.addClass(DefaultJavaTransforms.class);
        } catch(InvocationTargetException e) {
            throw e.getTargetException();
=======
        objectFactory = createObjectFactory();
        objectFactory.addStepMother(stepMother);
        for(ClassAnalyzer analyzer : analyzers){
            for(Class clazz : analyzer.alwaysLoad()){
                objectFactory.addClass(clazz);
            }
>>>>>>> 9fd00621e2187f7755eaae2c0223e0505387e9db
        }
    }
Solution content
    public ClassLanguage(ClassLanguageMixin languageMixin, StepMother stepMother, List analyzers) throws Throwable {
        super(languageMixin);
        this.analyzers = analyzers;
        objectFactory = createObjectFactory();
        objectFactory.addStepMother(stepMother);
        objectFactory.addClass(DefaultJavaTransforms.class);
        for (ClassAnalyzer analyzer : analyzers) {
            for (Class clazz : analyzer.alwaysLoad()) {
                objectFactory.addClass(clazz);
            }
        }
    }
File
ClassLanguage.java
Developer's decision
Combination
Kind of conflict
Attribute
Cast expression
Catch clause
For statement
If statement
Method invocation
Throw statement
Try statement
Variable
Chunk
Conflicting content
        throw new ClassNotFoundException("Couldn't determine class from file: " + classFile);
    }

<<<<<<< HEAD
=======
    private ObjectFactory createObjectFactory() throws Throwable {
        String className = System.getProperty("cuke4duke.objectFactory", "cuke4duke.internal.jvmclass.PicoFactory");
        if(className == null) {
            throw new RuntimeException("Missing system property: cuke4duke.objectFactory");
        }
        Class ofc = Thread.currentThread().getContextClassLoader().loadClass(className);
        Constructor ctor = ofc.getConstructor();
        try {
            return(ObjectFactory) ctor.newInstance();
        } catch(InvocationTargetException e) {
            throw e.getTargetException();
        }
    }

>>>>>>> 9fd00621e2187f7755eaae2c0223e0505387e9db
}
Solution content
        throw new ClassNotFoundException("Couldn't determine class from file: " + classFile);
    }

    private ObjectFactory createObjectFactory() throws Throwable {
        String className = System.getProperty("cuke4duke.objectFactory", "cuke4duke.internal.jvmclass.PicoFactory");
        if (className == null) {
            throw new RuntimeException("Missing system property: cuke4duke.objectFactory");
        }
        Class ofc = Thread.currentThread().getContextClassLoader().loadClass(className);
        Constructor ctor = ofc.getConstructor();
        try {
            return (ObjectFactory) ctor.newInstance();
        } catch (InvocationTargetException e) {
            throw e.getTargetException();
        }
    }

}
File
ClassLanguage.java
Developer's decision
Version 2
Kind of conflict
Method declaration