[Demonstration 1]

[Buggy Method]
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
    EObject semantic = (EObject) parameters.get("element");
    Session session = SessionManager.INSTANCE.getSession(semantic);
    String viewpointName = (String) parameters.get("Viewpoint");
    String representationDescriptionName = (String) parameters.get("RepresentationDescription");
    Viewpoint viewpoint = SiriusCustomUtil.findViewpoint(viewpointName);
    RepresentationDescription description = SiriusCustomUtil.findDescription(viewpoint, representationDescriptionName);
    // Select viewpoint
    HashSet<Viewpoint> selectedViewpoints = new HashSet<Viewpoint>();
    selectedViewpoints.add(viewpoint);
    SiriusCustomUtil.selectViewpoints(session, selectedViewpoints, false, new NullProgressMonitor());
    // Find representations
    Collection<DRepresentation> representations = DialectManager.INSTANCE.getRepresentations(semantic, session);
    // create a new representation if none exists and open it
    if (representations.isEmpty()) {
        DRepresentation representation = SiriusCustomUtil.createRepresentation(session, "new " + description.getLabel(), description, semantic, new NullProgressMonitor());
        DialectUIManager.INSTANCE.openEditor(session, representation, new NullProgressMonitor());
    } else {
        // open available representations
        for (DRepresentation representation : representations) {
            DialectUIManager.INSTANCE.openEditor(session, representation, new NullProgressMonitor());
        }
    }
}

[Buggy Hunk]
DRepresentation representation = SiriusCustomUtil.createRepresentation(session, "new " + description.getLabel(),

[Patch]
DRepresentation representation = SiriusCustomUtil.createRepresentation(session, "new " + description.getName(),

[Demonstration 2]

[Buggy Method]
public void destroyPresenter() {
    if (presenter != null) {
        presenter.destroy();
        presenter = null;
    }
}

[Buggy Hunk]
presenter.destroy();

[Patch]
PresenterManager.getInstance().destroy(presenter);

[Demonstration 3]

[Buggy Method]
@Override
public void onServiceDisconnected(ComponentName name) {
    messageService = null;
}

[Buggy Hunk]
public void onServiceDisconnected(ComponentName name) {

[Patch]
public void onServiceDisconnected(ComponentName componentName) {