[Demonstration 1]

[Buggy Method]
@Override
public UUID issueTask(String taskSchemeName, Map<String, String> params, String creatorIdenifier) {
    final TaskScheme taskScheme = taskSchemeRepository.findTaskScheme(taskSchemeName);
    final Task task;
    try {
        task = taskScheme.createTask(params, creatorIdenifier);
    } catch (TaskCreationRejectedBySchemeException e) {
        // TODO: add specific app exception
        throw new RuntimeException("Task creation rejected by scheme.", e);
    }
    task.addProperty(new TaskProperty(Task.SCHEME_PROPERTY_NAME, taskSchemeName));
    task.addProperty(new TaskProperty(Task.CREATOR_PROPERTY_NAME, creatorIdenifier));
    taskRepository.saveTask(task);
    taskAppEvenets.taskIssued(task.entityId());
    return task.entityId();
}

[Buggy Hunk]
} catch (TaskCreationRejectedBySchemeException e) {

[Patch]
} catch (TaskSchemeException e) {

[Demonstration 2]

[Buggy Method]
void transformAttributes(TagTransformation tagTrans) {
    boolean isPreserveSourceAtts = tagTrans.isPreserveSourceAttributes();
    boolean hasAttTransforms = tagTrans.hasAttributeTransformations();
    if (hasAttTransforms || !isPreserveSourceAtts) {
        Map newAttributes = isPreserveSourceAtts ? new LinkedHashMap(attributes) : new LinkedHashMap();
        if (hasAttTransforms) {
            Map map = tagTrans.getAttributeTransformations();
            Iterator iterator = map.entrySet().iterator();
            while (iterator.hasNext()) {
                Map.Entry entry = (Map.Entry) iterator.next();
                String attName = (String) entry.getKey();
                String template = (String) entry.getValue();
                if (template == null) {
                    newAttributes.remove(attName);
                } else {
                    String attValue = Utils.evaluateTemplate(template, attributes);
                    newAttributes.put(attName, attValue);
                }
            }
        }
        this.attributes = newAttributes;
    }
}

[Buggy Hunk]
Map newAttributes = isPreserveSourceAtts ? new LinkedHashMap(attributes) : new LinkedHashMap();

[Patch]
Map<String, String> newAttributes = isPreserveSourceAtts ? new LinkedHashMap<String, String>(attributes) : new LinkedHashMap<String, String>();

[Demonstration 3]

[Buggy Method]
public void poll() {
    synchronized (m_sync) {
        if (m_lastSelectedModel != null) {
            URI relativeUri = m_baseDirectory.toURI().relativize(m_lastSelectedModel.toURI());
            try {
                ISceneModel model = m_modelFactory.create(relativeUri);
                m_brush.setBehaviour(new PlaceSceneArtifactBrushBehaviour(model, relativeUri, Direction.XYPlus, btnTraversable.isSelected()));
            } catch (ISceneModelFactory.SceneModelConstructionException e) {
                m_logger.error("Unable to load scene model", e);
            }
        }
    }
    m_lastSelectedModel = null;
}

[Buggy Hunk]
URI relativeUri = m_baseDirectory.toURI().relativize(m_lastSelectedModel.toURI());

[Patch]
URI relativeUri = URI.create("/").resolve(m_baseDirectory.toURI().relativize(m_lastSelectedModel.toURI()));