<commit_before>package com.cedarsoftware.ncube

import com.cedarsoftware.util.StringUtilities

import java.sql.Connection

/**
 * Created by kpartlow on 12/23/2014.
 */
abstract class AbstractJdbcTestingDatabaseManager implements TestingDatabaseManager
{
    JdbcConnectionProvider provider;
    NCubeJdbcPersister persister = new NCubeJdbcPersister();

    AbstractJdbcTestingDatabaseManager(JdbcConnectionProvider p) {
        provider = p;
    }

    void insertCubeWithNoSha1(ApplicationID appId, String username, NCube cube)
    {
        Connection c = provider.connection;
        try
        {
            byte[] cubeData = StringUtilities.getBytes(cube.toFormattedJson(), "UTF-8");
            persister.insertCube(c, appId, cube.name, 0L, cubeData, null, "Inserted without sha1-1", false, null, null, System.currentTimeMillis(), username)
    }
        finally
        {
            provider.releaseConnection(c);
        }
    }

    void addCubes(ApplicationID appId, String username, NCube[] cubes)
    {
        Connection c = provider.connection;
        try
        {
            for (NCube ncube : cubes)
            {
                persister.createCube(c, appId, ncube, username);
            }
        }
        finally
        {
            provider.releaseConnection(c);
        }
    }

    void removeBranches(ApplicationID[] appIds)
    {
        Connection c = provider.connection;
        try
        {
            for (ApplicationID appId : appIds)
            {
                persister.deleteBranch(c, appId)
            }
        }
        finally
        {
            provider.releaseConnection(c);
        }
    }

    void updateCube(ApplicationID appId, String username, NCube ncube)
    {
        Connection c = provider.connection;
        try
        {
            persister.updateCube(c, appId, ncube, username);
        }
        finally
        {
            provider.releaseConnection(c);
        }
    }
}
<commit_msg>- updated method call types to match method (Groovy being senstive to things like not liking null but wanting (byte[]) null instead.  weird.<commit_after>package com.cedarsoftware.ncube

import com.cedarsoftware.util.StringUtilities

import java.sql.Connection

/**
 * Created by kpartlow on 12/23/2014.
 */
abstract class AbstractJdbcTestingDatabaseManager implements TestingDatabaseManager
{
    JdbcConnectionProvider provider;
    NCubeJdbcPersister persister = new NCubeJdbcPersister();

    AbstractJdbcTestingDatabaseManager(JdbcConnectionProvider p) {
        provider = p;
    }

    void insertCubeWithNoSha1(ApplicationID appId, String username, NCube cube)
    {
        Connection c = provider.connection;
        try
        {
            byte[] cubeData = StringUtilities.getBytes(cube.toFormattedJson(), "UTF-8");
            persister.insertCube(c, appId, cube.name, 0L, cubeData, (byte[])null, "Inserted without sha1-1", (Boolean)false, (String)null, (String)null, System.currentTimeMillis(), username)
    }
        finally
        {
            provider.releaseConnection(c);
        }
    }

    void addCubes(ApplicationID appId, String username, NCube[] cubes)
    {
        Connection c = provider.connection;
        try
        {
            for (NCube ncube : cubes)
            {
                persister.createCube(c, appId, ncube, username);
            }
        }
        finally
        {
            provider.releaseConnection(c);
        }
    }

    void removeBranches(ApplicationID[] appIds)
    {
        Connection c = provider.connection;
        try
        {
            for (ApplicationID appId : appIds)
            {
                persister.deleteBranch(c, appId)
            }
        }
        finally
        {
            provider.releaseConnection(c);
        }
    }

    void updateCube(ApplicationID appId, String username, NCube ncube)
    {
        Connection c = provider.connection;
        try
        {
            persister.updateCube(c, appId, ncube, username);
        }
        finally
        {
            provider.releaseConnection(c);
        }
    }
}

{'fraction_non_alphanumeric': 0.08512720156555773, 'fraction_numerical': 0.006360078277886497, 'mean_word_length': 1.973818181818182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2657251', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1132, 'n_words': 242}