<commit_before>/*
 * Copyright 2010 FatWire Corporation. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.fatwire.gst.foundation.wra;

import COM.FutureTense.Interfaces.ICS;
import com.fatwire.assetapi.data.AssetData;
import com.fatwire.assetapi.data.AssetId;
import com.fatwire.cs.core.db.PreparedStmt;
import com.fatwire.cs.core.db.StatementParam;
import com.fatwire.gst.foundation.facade.assetapi.DirectSqlAccessTools;
import com.fatwire.gst.foundation.facade.ics.ICSFactory;
import com.fatwire.gst.foundation.facade.sql.Row;
import com.fatwire.gst.foundation.facade.sql.SqlHelper;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.Collections;

/**
 * Backdoor implementation of WraCoreFieldDao that does not utilize
 * any Asset APIs.  This class should be used sparingly and may result
 * in some dependencies, that would ordinarily be recorded, being skipped.
 * <p/>
 * User: <NAME>
 * Date: 2011-05-06
 */
public class WraCoreFieldApiBypassDao extends WraCoreFieldDao {
    public static WraCoreFieldApiBypassDao getBackdoorInstance(ICS ics) {
        if (ics == null) {
            ics = ICSFactory.getOrCreateICS();
        }

        Object o = ics.GetObj(WraCoreFieldApiBypassDao.class.getName());
        if (o == null) {
            o = new WraCoreFieldApiBypassDao(ics);
            ics.SetObj(WraCoreFieldApiBypassDao.class.getName(), o);
        }
        return (WraCoreFieldApiBypassDao) o;
    }

    private final ICS ics;
    private final DirectSqlAccessTools directSqlAccessTools;

    private WraCoreFieldApiBypassDao(ICS ics) {
        this.ics = ics;
        directSqlAccessTools = new DirectSqlAccessTools(ics);
    }

    private static final Log LOG = LogFactory.getLog(WraCoreFieldApiBypassDao.class);

    /**
     * @throws UnsupportedOperationException - not possible in this implementation
     */
    public AssetData getAsAssetData(AssetId id) {
        throw new UnsupportedOperationException("Not implemented");
    }

    /**
     * Method to test whether or not an asset is web-referenceable. todo: low
     * priority: optimize as this will be called at runtime (assest api incache
     * will mitigate the performance issue)
     *
     * @param id asset ID to check
     * @return true if the asset is a valid web-referenceable asset, false if it
     *         is not
     */
    public boolean isWebReferenceable(AssetId id) {
        try {<commit_msg>Adding correct constructor use for super class<commit_after>/*
 * Copyright 2010 FatWire Corporation. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.fatwire.gst.foundation.wra;

import COM.FutureTense.Interfaces.ICS;
import com.fatwire.assetapi.data.AssetData;
import com.fatwire.assetapi.data.AssetId;
import com.fatwire.cs.core.db.PreparedStmt;
import com.fatwire.cs.core.db.StatementParam;
import com.fatwire.gst.foundation.facade.assetapi.DirectSqlAccessTools;
import com.fatwire.gst.foundation.facade.ics.ICSFactory;
import com.fatwire.gst.foundation.facade.sql.Row;
import com.fatwire.gst.foundation.facade.sql.SqlHelper;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.Collections;

/**
 * Backdoor implementation of WraCoreFieldDao that does not utilize
 * any Asset APIs.  This class should be used sparingly and may result
 * in some dependencies, that would ordinarily be recorded, being skipped.
 * <p/>
 * User: <NAME>
 * Date: 2011-05-06
 */
public class WraCoreFieldApiBypassDao extends WraCoreFieldDao {
    public static WraCoreFieldApiBypassDao getBackdoorInstance(ICS ics) {
        if (ics == null) {
            ics = ICSFactory.getOrCreateICS();
        }

        Object o = ics.GetObj(WraCoreFieldApiBypassDao.class.getName());
        if (o == null) {
            o = new WraCoreFieldApiBypassDao(ics);
            ics.SetObj(WraCoreFieldApiBypassDao.class.getName(), o);
        }
        return (WraCoreFieldApiBypassDao) o;
    }

    private final ICS ics;
    private final DirectSqlAccessTools directSqlAccessTools;

    private WraCoreFieldApiBypassDao(ICS ics) {
        super(ics);
        this.ics = ics;
        directSqlAccessTools = new DirectSqlAccessTools(ics);
    }

    private static final Log LOG = LogFactory.getLog(WraCoreFieldApiBypassDao.class);

    /**
     * @throws UnsupportedOperationException - not possible in this implementation
     */
    public AssetData getAsAssetData(AssetId id) {
        throw new UnsupportedOperationException("Not implemented");
    }

    /**
     * Method to test whether or not an asset is web-referenceable. todo: low
     * priority: optimize as this will be called at runtime (assest api incache
     * will mitigate the performance issue)
     *
     * @param id asset ID to check
     * @return true if the asset is a valid web-referenceable asset, false if it
     *         is not
     */
    public boolean isWebReferenceable(AssetId id) {
        try {
{'fraction_non_alphanumeric': 0.08394458027709861, 'fraction_numerical': 0.0052159739201303994, 'mean_word_length': 3.427128427128427, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4048353', 'n_tokens_mistral': 1828, 'n_tokens_neox': 1778, 'n_words': 547}