<commit_before>/**
 * Project pack:tag >> http://packtag.sf.net
 *
 * This software is published under the terms of the LGPL
 * License version 2.1, a copy of which has been included with this
 * distribution in the 'lgpl.txt' file.
 * 
 * Creation date: 13.11.2008 - 23:49:49
 * Last author:   $Author: danielgalan $
 * Last modified: $Date:$
 * Revision:      $Revision:$
 * 
 * $Log:$
 */
package net.sf.packtag.cache.provider;

import javax.servlet.ServletContext;

import net.sf.packtag.cache.CacheProvider;
import net.sf.packtag.cache.Resource;



/**
 * Basic CacheProvider functions
 * 
 * @author  <NAME>
 * @version $Revision:$
 */
public abstract class AbstractCacheProvider implements CacheProvider {

	public void init(final ServletContext context) {
	}


	protected void clearDependingCombinedResources(final Resource resource) {
		String absolutePath = resource.getAbsolutePath();
		Object[] keys = getAbsolutePathKeys().toArray();
		for (int i = 0; i < keys.length; i++) {
			Resource currentResource = getResourceByAbsolutePath((String)keys[i]);
			// Difference between combined and wildcard resources
			String paths = currentResource.isWildcard() ? currentResource.getWildcardAbsolutePaths() : currentResource.getAbsolutePath();
			int idx = paths.indexOf(absolutePath);
			// "> 0" because the normal resource doesn't starts with "["
			if (idx > 0) {
				removeAbsolutePath((String)keys[i]);<commit_msg>making clearDependingCombinedResources synchronized to line up with historical Rally changes<commit_after>/**
 * Project pack:tag >> http://packtag.sf.net
 *
 * This software is published under the terms of the LGPL
 * License version 2.1, a copy of which has been included with this
 * distribution in the 'lgpl.txt' file.
 * 
 * Creation date: 13.11.2008 - 23:49:49
 * Last author:   $Author: danielgalan $
 * Last modified: $Date:$
 * Revision:      $Revision:$
 * 
 * $Log:$
 */
package net.sf.packtag.cache.provider;

import javax.servlet.ServletContext;

import net.sf.packtag.cache.CacheProvider;
import net.sf.packtag.cache.Resource;



/**
 * Basic CacheProvider functions
 * 
 * @author  <NAME>
 * @version $Revision:$
 */
public abstract class AbstractCacheProvider implements CacheProvider {

	public void init(final ServletContext context) {
	}


	protected synchronized void clearDependingCombinedResources(final Resource resource) {
		String absolutePath = resource.getAbsolutePath();
		Object[] keys = getAbsolutePathKeys().toArray();
		for (int i = 0; i < keys.length; i++) {
			Resource currentResource = getResourceByAbsolutePath((String)keys[i]);
			// Difference between combined and wildcard resources
			String paths = currentResource.isWildcard() ? currentResource.getWildcardAbsolutePaths() : currentResource.getAbsolutePath();
			int idx = paths.indexOf(absolutePath);
			// "> 0" because the normal resource doesn't starts with "["
			if (idx > 0) {
				removeAbsolutePath((String)keys[i]);
{'fraction_non_alphanumeric': 0.11488783140720599, 'fraction_numerical': 0.01291638341264446, 'mean_word_length': 4.419889502762431, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '7154427', 'n_tokens_mistral': 921, 'n_tokens_neox': 818, 'n_words': 245}