[Demonstration 1]

[Buggy Method]
public CompilationUnitChange addCopyrightsHeader(final CompilationUnit compilationUnit) {
    final ICompilationUnit unit = (ICompilationUnit) compilationUnit.getJavaElement();
    change = new CompilationUnitChange(ADD_COPYRIGHT, unit);
    rewriter = ASTRewrite.create(compilationUnit.getAST());
    final ListRewrite listRewrite = rewriter.getListRewrite(compilationUnit.getPackage(), PackageDeclaration.ANNOTATIONS_PROPERTY);
    final Comment placeHolder = (Comment) rewriter.createStringPlaceholder(getCopyrightText(), ASTNode.BLOCK_COMMENT);
    listRewrite.insertFirst(placeHolder, null);
    rewriteCompilationUnit(unit, getNewUnitSource(unit, null));
    return change;
}

[Buggy Hunk]
final Comment placeHolder = (Comment) rewriter.createStringPlaceholder(getCopyrightText(),

[Patch]
final Comment placeHolder = (Comment) rewriter.createStringPlaceholder(getCopyrightText() + NEW_LINE_SEPARATOR,

[Demonstration 2]

[Buggy Method]
@Override
public void run() {
    if (mSplashDialog != null && mSplashDialog.isShowing() && !activity.isFinishing()) {
        mSplashDialog.dismiss();
    }
}

[Buggy Hunk]
if (mSplashDialog != null && mSplashDialog.isShowing() && !activity.isFinishing()) {

[Patch]
if (mSplashDialog != null && mSplashDialog.isShowing() && !checkActivity.isFinishing()) {

[Demonstration 3]

[Buggy Method]
private Presence enter(MucEnterConfiguration conf) throws NotConnectedException, NoResponseException, XMPPErrorException, InterruptedException, NotAMucServiceException {
    final DomainBareJid mucService = room.asDomainBareJid();
    if (!KNOWN_MUC_SERVICES.containsKey(mucService)) {
        if (multiUserChatManager.providesMucService(mucService)) {
            KNOWN_MUC_SERVICES.put(mucService, null);
        } else {
            throw new NotAMucServiceException(this);
        }
    }
    // We enter a room by sending a presence packet where the "to"
    // field is in the form "roomName@service/nickname"
    Presence joinPresence = conf.getJoinPresence(this);
    // Setup the messageListeners and presenceListeners *before* the join presence is send.
    connection.addSyncStanzaListener(messageListener, fromRoomGroupchatFilter);
    connection.addSyncStanzaListener(presenceListener, new AndFilter(fromRoomFilter, StanzaTypeFilter.PRESENCE));
    connection.addSyncStanzaListener(subjectListener, new AndFilter(fromRoomFilter, MessageWithSubjectFilter.INSTANCE, new NotFilter(MessageTypeFilter.ERROR)));
    connection.addSyncStanzaListener(declinesListener, DECLINE_FILTER);
    connection.addPacketInterceptor(presenceInterceptor, new AndFilter(new ToFilter(room), StanzaTypeFilter.PRESENCE));
    messageCollector = connection.createStanzaCollector(fromRoomGroupchatFilter);
    // Wait for a presence packet back from the server.
    // Use a bare JID filter, since the room may rewrite the nickname.
    StanzaFilter responseFilter = new AndFilter(FromMatchesFilter.createBare(getRoom()), new StanzaTypeFilter(Presence.class), MUCUserStatusCodeFilter.STATUS_110_PRESENCE_TO_SELF);
    Presence presence;
    try {
        presence = connection.createStanzaCollectorAndSend(responseFilter, joinPresence).nextResultOrThrow(conf.getTimeout());
    } catch (InterruptedException | NoResponseException | XMPPErrorException e) {
        // Ensure that all callbacks are removed if there is an exception
        removeConnectionCallbacks();
        throw e;
    }
    // This presence must be send from a full JID. We use the resourcepart of this JID as nick, since the room may
    // performed roomnick rewriting
    this.nickname = presence.getFrom().asEntityFullJidIfPossible().getResourcepart();
    joined = true;
    // Update the list of joined rooms
    multiUserChatManager.addJoinedRoom(room);
    return presence;
}

[Buggy Hunk]
catch (InterruptedException | NoResponseException | XMPPErrorException e) {

[Patch]
catch (NotConnectedException | InterruptedException | NoResponseException | XMPPErrorException e) {