<commit_before>
package org.fcrepo.client.mtom;

import java.math.BigInteger;
import java.util.List;

import javax.activation.DataHandler;

import org.fcrepo.client.SwingWorker;
import org.fcrepo.server.types.gen.ArrayOfString;
import org.fcrepo.server.types.gen.Datastream;
import org.fcrepo.server.types.gen.RelationshipTuple;
import org.fcrepo.server.types.gen.Validation;

public class APIMStubWrapper
        implements org.fcrepo.server.management.FedoraAPIMMTOM {

    /** The wrapped instance */
    private final org.fcrepo.server.management.FedoraAPIMMTOM m_instance;

    public APIMStubWrapper(org.fcrepo.server.management.FedoraAPIMMTOM instance) {
        m_instance = instance;
    }

    @Override
    public String ingest(final DataHandler objectXML,
                                   final String format,
                                   final String logMessage){
        String buf = "Ingest";
        // Run the method in a SwingWorker thread
        SwingWorker<String> worker = new SwingWorker<String>() {

            @Override
            public String construct() {
                    // call wrapped method
                    return m_instance.ingest(objectXML,
                                             format,
                                             logMessage);
            }
        };
        return SwingWorker.waitForResult(worker, buf);

    }

    @Override
    public String modifyObject(final String pid,
                               final String state,
                               final String label,
                               final String ownerId,
                               final String logMessage){
        String buf = "Modify object";
        // Run the method in a SwingWorker thread
        SwingWorker<String> worker = new SwingWorker<String>() {

            @Override
            public String construct() {
                    // call wrapped method
                    return m_instance.modifyObject(pid,
                                                   state,
                                                   label,
                                                   ownerId,
                                                   logMessage);
            }
        };
        return SwingWorker.waitForResult(worker, buf);

    }

    @Override
    public DataHandler getObjectXML(final String pid){
        String buf = "Get object XML";
        // Run the method in a SwingWorker thread
        SwingWorker<DataHandler> worker = new SwingWorker<DataHandler>() {

            @Override
            public DataHandler construct() {
                    // call wrapped method
                    return m_instance.getObjectXML(pid);
            }
        };
        return SwingWorker.waitForResult(worker, buf);

    }

    @Override
    public DataHandler export(final String pid,
                         final String format,
                         final String context){
        String buf = "Export";
        // Run the method in a SwingWorker thread
        SwingWorker<DataHandler> worker = new SwingWorker<DataHandler>() {

            @Override
            public DataHandler construct() {
                    // call wrapped method
                    return m_instance.export(pid,
                                             format,
                                             context);
            }
        };
        return SwingWorker.waitForResult(worker, buf);

    }

    @Override
    public String purgeObject(final String pid,
                              final String logMessage,
                              final boolean force){
        String buf = "Purge object";
        // Run the method in a SwingWorker thread
        SwingWorker<String> worker = new SwingWorker<String>() {

            @Override
            public String construct() {
                    // call wrapped method
                    return m_instance.purgeObject((java.lang.String) parms
                            .get("pid"), (java.lang.String) parms
                            .get("logMessage"), ((Boolean) parms.get("force"))
                            .booleanValue());
            }
        };
        return SwingWorker.waitForResult(worker, buf);<commit_msg>Fix method call to purgeObject to remove NPE<commit_after>
package org.fcrepo.client.mtom;

import java.math.BigInteger;
import java.util.List;

import javax.activation.DataHandler;

import org.fcrepo.client.SwingWorker;
import org.fcrepo.server.types.gen.ArrayOfString;
import org.fcrepo.server.types.gen.Datastream;
import org.fcrepo.server.types.gen.RelationshipTuple;
import org.fcrepo.server.types.gen.Validation;

public class APIMStubWrapper
        implements org.fcrepo.server.management.FedoraAPIMMTOM {

    /** The wrapped instance */
    private final org.fcrepo.server.management.FedoraAPIMMTOM m_instance;

    public APIMStubWrapper(org.fcrepo.server.management.FedoraAPIMMTOM instance) {
        m_instance = instance;
    }

    @Override
    public String ingest(final DataHandler objectXML,
                                   final String format,
                                   final String logMessage){
        String buf = "Ingest";
        // Run the method in a SwingWorker thread
        SwingWorker<String> worker = new SwingWorker<String>() {

            @Override
            public String construct() {
                    // call wrapped method
                    return m_instance.ingest(objectXML,
                                             format,
                                             logMessage);
            }
        };
        return SwingWorker.waitForResult(worker, buf);

    }

    @Override
    public String modifyObject(final String pid,
                               final String state,
                               final String label,
                               final String ownerId,
                               final String logMessage){
        String buf = "Modify object";
        // Run the method in a SwingWorker thread
        SwingWorker<String> worker = new SwingWorker<String>() {

            @Override
            public String construct() {
                    // call wrapped method
                    return m_instance.modifyObject(pid,
                                                   state,
                                                   label,
                                                   ownerId,
                                                   logMessage);
            }
        };
        return SwingWorker.waitForResult(worker, buf);

    }

    @Override
    public DataHandler getObjectXML(final String pid){
        String buf = "Get object XML";
        // Run the method in a SwingWorker thread
        SwingWorker<DataHandler> worker = new SwingWorker<DataHandler>() {

            @Override
            public DataHandler construct() {
                    // call wrapped method
                    return m_instance.getObjectXML(pid);
            }
        };
        return SwingWorker.waitForResult(worker, buf);

    }

    @Override
    public DataHandler export(final String pid,
                         final String format,
                         final String context){
        String buf = "Export";
        // Run the method in a SwingWorker thread
        SwingWorker<DataHandler> worker = new SwingWorker<DataHandler>() {

            @Override
            public DataHandler construct() {
                    // call wrapped method
                    return m_instance.export(pid,
                                             format,
                                             context);
            }
        };
        return SwingWorker.waitForResult(worker, buf);

    }

    @Override
    public String purgeObject(final String pid,
                              final String logMessage,
                              final boolean force){
        String buf = "Purge object";
        // Run the method in a SwingWorker thread
        SwingWorker<String> worker = new SwingWorker<String>() {

            @Override
            public String construct() {
                    // call wrapped method
                    return m_instance
			    .purgeObject(pid,
                                         logMessage,
			                 force);
            }
        };
        return SwingWorker.waitForResult(worker, buf);
{'fraction_non_alphanumeric': 0.06846547010578866, 'fraction_numerical': 0.0, 'mean_word_length': 1.3007929997265517, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3638435', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1828, 'n_words': 493}