<commit_before>package railo.runtime.type;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Date;

import railo.print;
import railo.commons.lang.SizeOf;
import railo.commons.lang.StringUtil;
import railo.runtime.exp.CasterException;
import railo.runtime.exp.PageException;
import railo.runtime.op.Castable;
import railo.runtime.op.Caster;
import railo.runtime.op.Operator;
import railo.runtime.op.date.DateCaster;
import railo.runtime.type.Collection.Key;
import railo.runtime.type.dt.DateTime;
import railo.runtime.type.util.KeyConstants;

public class KeyImpl implements Collection.Key,Castable,Comparable,Sizeable,Externalizable {
	//public static HashMap<String,RefIntegerImpl> log=new HashMap<String,RefIntegerImpl>();
	

	public static final Collection.Key ACTION=KeyConstants._action;
	public static final Key CFID=KeyConstants._cfid;
	public static final Key CFTOKEN=KeyConstants._cftoken;
	public static final Key DETAIL=KeyConstants._detail;
	public static final Key RETURN_FORMAT =KeyConstants._returnFormat;
	public static final Key NAME=KeyConstants._name;
	public static final Key NAME_UC=KeyConstants._NAME;
	public static final Key DATA=KeyConstants._data;
	public static final Key S3=KeyConstants._s3;
	public static final Key SIZE=KeyConstants._size;
	public static final Key SUPER=KeyConstants._super;
	public static final Key SUPER_UC=KeyConstants._SUPER;
	public static final Key TEMPLATE=KeyConstants._template;
	public static final Key THIS=KeyConstants._this;
	public static final Key THIS_UC=KeyConstants._THIS;
	public static final Key TIME=KeyConstants._time;
	public static final Key TYPE=KeyConstants._type;
	public static final Key HINT = 		KeyConstants._hint;
	public static final Key REQUIRED = 	KeyConstants._required;
	public static final Key DEFAULT = 		KeyConstants._default;
	public static final Key DATA_SOURCE = 		KeyConstants._datasource;
	

	public static final Key ARGUMENT_COLLECTION = KeyConstants._argumentCollection;
	public static final Key ACCESS = 		KeyConstants._access;
	public static final Key OUTPUT = 		KeyConstants._output;
	public static final Key RETURN_TYPE = 	KeyConstants._returntype;
	public static final Key DESCRIPTION = 	KeyConstants._description;
	public static final Key OWNER = 	KeyConstants._owner;
	public static final Key DISPLAY_NAME = KeyConstants._displayname;
	public static final Key PARAMETERS = 	KeyConstants._parameters;

	public static final Key VALUE = KeyConstants._value;
	public static final Key PATH = KeyConstants._path;
	public static final Key ENTRY = KeyConstants._entry;
	public static final Key KEY = KeyConstants._key;
	public static final Key COLUMN = KeyConstants._column;
	public static final Key ARGUMENTS = KeyConstants._arguments;
	public static final Key STATUS = KeyConstants._status;
	public static final Key THREAD = KeyConstants._thread;
	public static final Key VARIABLES = KeyConstants._variables;
	public static final Key FIELD_NAMES = KeyConstants._fieldnames;
	public static final Key LOCAL = KeyConstants._local;
	public static final Key SERVER = KeyConstants._server;
	public static final Key EXCEPTIONS = KeyConstants._exceptions;
	public static final Key BODY = KeyConstants._body;
	public static final Key TITLE = KeyConstants._title;
	public static final Key URL = KeyConstants._url;
	public static final Key LABEL = KeyConstants._label;
	public static final Key TOTAL = KeyConstants._total;

	public static final Key CLOSURE = KeyConstants._closure;
	public static final Key FUNCTION = KeyConstants._function;

	//private boolean intern;
	private String key;
	private String lcKey;
	private String ucKey;
	//private int hashcode;
	
	public KeyImpl() {
		// DO NOT USE, JUST FOR UNSERIALIZE
	}
	
	
	public void writeExternal(ObjectOutput out) throws IOException {
		out.writeObject(key);
		out.writeObject(lcKey);
		out.writeObject(ucKey);
		//out.writeBoolean(intern);
	}
	public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException {
		key=(String) in.readObject();
		lcKey=((String) in.readObject());
		ucKey=(String) in.readObject();
		//intern= in.readBoolean();
		//if(intern)lcKey=lcKey.intern();
	}
	
	
	protected KeyImpl(String key) {
		this.key=key;
		this.lcKey=key.toLowerCase();
		//RefIntegerImpl count=log.get(key);
		//if(count!=null) count.plus(1);
		//else log.put(key, new RefIntegerImpl(1));
		
	}
	
	/*public static void print(){
		//Iterator<Entry<String, RefIntegerImpl>> it = log.entrySet().iterator();
		String[] keys = log.keySet().toArray(new String[log.size()]);
		Arrays.sort(keys);
		int total=0,big=0;
		for(int i=0;i<keys.length;i++){
			RefIntegerImpl value = log.get(keys[i]);
			if(value.toInt()>10 && keys[i].length()<=10 && keys[i].indexOf('.')==-1 && keys[i].indexOf('-')==-1) {
				print.e("public static final Key "+keys[i]+"=KeyImpl.intern(\""+keys[i]+"\");");
				big++;
			}
			total++;
		}
		print.e("total:"+total);
		print.e("big:"+big);
	}*/
	
	
	
	/*private KeyImpl(String key, boolean intern) {
		this.key=key;
		this.lcKey=intern?key.toLowerCase():key.toLowerCase();
		this.intern=intern;
	}*/	
	
	/**
	 * for dynamic loading of key objects
	 * @param string
	 * @return
	 */
	public static Collection.Key init(String key) {
		return new KeyImpl(key);
	}
	

	public static Collection.Key _const(String key) {
		return new KeyImpl(key);
	}
	

	/**
	 * used for static iniatisation of a key object (used by compiler)
	 * @param string
	 * @return
	 */
	public synchronized static Collection.Key getInstance(String key) {
		if(KeyConstants.getFieldName(key)!=null)print.ds(key);
		return new KeyImpl(key);
	}
	
<commit_msg>remove prints<commit_after>package railo.runtime.type;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Date;

import railo.print;
import railo.commons.lang.SizeOf;
import railo.commons.lang.StringUtil;
import railo.runtime.exp.CasterException;
import railo.runtime.exp.PageException;
import railo.runtime.op.Castable;
import railo.runtime.op.Caster;
import railo.runtime.op.Operator;
import railo.runtime.op.date.DateCaster;
import railo.runtime.type.Collection.Key;
import railo.runtime.type.dt.DateTime;
import railo.runtime.type.util.KeyConstants;

public class KeyImpl implements Collection.Key,Castable,Comparable,Sizeable,Externalizable {
	//public static HashMap<String,RefIntegerImpl> log=new HashMap<String,RefIntegerImpl>();
	

	public static final Collection.Key ACTION=KeyConstants._action;
	public static final Key CFID=KeyConstants._cfid;
	public static final Key CFTOKEN=KeyConstants._cftoken;
	public static final Key DETAIL=KeyConstants._detail;
	public static final Key RETURN_FORMAT =KeyConstants._returnFormat;
	public static final Key NAME=KeyConstants._name;
	public static final Key NAME_UC=KeyConstants._NAME;
	public static final Key DATA=KeyConstants._data;
	public static final Key S3=KeyConstants._s3;
	public static final Key SIZE=KeyConstants._size;
	public static final Key SUPER=KeyConstants._super;
	public static final Key SUPER_UC=KeyConstants._SUPER;
	public static final Key TEMPLATE=KeyConstants._template;
	public static final Key THIS=KeyConstants._this;
	public static final Key THIS_UC=KeyConstants._THIS;
	public static final Key TIME=KeyConstants._time;
	public static final Key TYPE=KeyConstants._type;
	public static final Key HINT = 		KeyConstants._hint;
	public static final Key REQUIRED = 	KeyConstants._required;
	public static final Key DEFAULT = 		KeyConstants._default;
	public static final Key DATA_SOURCE = 		KeyConstants._datasource;
	

	public static final Key ARGUMENT_COLLECTION = KeyConstants._argumentCollection;
	public static final Key ACCESS = 		KeyConstants._access;
	public static final Key OUTPUT = 		KeyConstants._output;
	public static final Key RETURN_TYPE = 	KeyConstants._returntype;
	public static final Key DESCRIPTION = 	KeyConstants._description;
	public static final Key OWNER = 	KeyConstants._owner;
	public static final Key DISPLAY_NAME = KeyConstants._displayname;
	public static final Key PARAMETERS = 	KeyConstants._parameters;

	public static final Key VALUE = KeyConstants._value;
	public static final Key PATH = KeyConstants._path;
	public static final Key ENTRY = KeyConstants._entry;
	public static final Key KEY = KeyConstants._key;
	public static final Key COLUMN = KeyConstants._column;
	public static final Key ARGUMENTS = KeyConstants._arguments;
	public static final Key STATUS = KeyConstants._status;
	public static final Key THREAD = KeyConstants._thread;
	public static final Key VARIABLES = KeyConstants._variables;
	public static final Key FIELD_NAMES = KeyConstants._fieldnames;
	public static final Key LOCAL = KeyConstants._local;
	public static final Key SERVER = KeyConstants._server;
	public static final Key EXCEPTIONS = KeyConstants._exceptions;
	public static final Key BODY = KeyConstants._body;
	public static final Key TITLE = KeyConstants._title;
	public static final Key URL = KeyConstants._url;
	public static final Key LABEL = KeyConstants._label;
	public static final Key TOTAL = KeyConstants._total;

	public static final Key CLOSURE = KeyConstants._closure;
	public static final Key FUNCTION = KeyConstants._function;

	//private boolean intern;
	private String key;
	private String lcKey;
	private String ucKey;
	//private int hashcode;
	
	public KeyImpl() {
		// DO NOT USE, JUST FOR UNSERIALIZE
	}
	
	
	public void writeExternal(ObjectOutput out) throws IOException {
		out.writeObject(key);
		out.writeObject(lcKey);
		out.writeObject(ucKey);
		//out.writeBoolean(intern);
	}
	public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException {
		key=(String) in.readObject();
		lcKey=((String) in.readObject());
		ucKey=(String) in.readObject();
		//intern= in.readBoolean();
		//if(intern)lcKey=lcKey.intern();
	}
	
	
	protected KeyImpl(String key) {
		this.key=key;
		this.lcKey=key.toLowerCase();
		//RefIntegerImpl count=log.get(key);
		//if(count!=null) count.plus(1);
		//else log.put(key, new RefIntegerImpl(1));
		
	}
	
	/*public static void print(){
		//Iterator<Entry<String, RefIntegerImpl>> it = log.entrySet().iterator();
		String[] keys = log.keySet().toArray(new String[log.size()]);
		Arrays.sort(keys);
		int total=0,big=0;
		for(int i=0;i<keys.length;i++){
			RefIntegerImpl value = log.get(keys[i]);
			if(value.toInt()>10 && keys[i].length()<=10 && keys[i].indexOf('.')==-1 && keys[i].indexOf('-')==-1) {
				print.e("public static final Key "+keys[i]+"=KeyImpl.intern(\""+keys[i]+"\");");
				big++;
			}
			total++;
		}
		print.e("total:"+total);
		print.e("big:"+big);
	}*/
	
	
	
	/*private KeyImpl(String key, boolean intern) {
		this.key=key;
		this.lcKey=intern?key.toLowerCase():key.toLowerCase();
		this.intern=intern;
	}*/	
	
	/**
	 * for dynamic loading of key objects
	 * @param string
	 * @return
	 */
	public static Collection.Key init(String key) {
		return new KeyImpl(key);
	}
	

	public static Collection.Key _const(String key) {
		return new KeyImpl(key);
	}
	

	/**
	 * used for static iniatisation of a key object (used by compiler)
	 * @param string
	 * @return
	 */
	public synchronized static Collection.Key getInstance(String key) {
		//if(KeyConstants.getFieldName(key)!=null)print.ds(key);
		return new KeyImpl(key);
	}
	

{'fraction_non_alphanumeric': 0.1050597329585383, 'fraction_numerical': 0.0022839072382290935, 'mean_word_length': 4.960732984293194, 'pattern_counts': {'":': 0, '<': 15, '<?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': '6077225', 'n_tokens_mistral': 3637, 'n_tokens_neox': 3427, 'n_words': 951}