<commit_before>// Copyright (C) 2011 jOVAL.org.  All rights reserved.
// This software is licensed under the LGPL 3.0 license available at http://www.gnu.org/licenses/lgpl.txt

package jsaf.provider.windows.registry;

import jsaf.intf.windows.registry.IKey;
import jsaf.intf.windows.registry.IStringValue;

/**
 * Representation of a Windows registry string value.
 *
 * @author <NAME>
 * @version %I% %G%
 */
public class StringValue extends Value implements IStringValue {
    private String data;

    public StringValue(IKey parent, String name, String data) {
	type = Type.REG_SZ;
	this.parent = parent;
	this.name = name;
	this.data = data;
    }

    public String getData() {
	return data;<commit_msg>In certain cases, Powershell v3 will return a registry String value consisting of a single NULL character (i.e., 0x00).  This is really not valid, so we check for that and trim it off in the StringValue constructor.<commit_after>// Copyright (C) 2011 jOVAL.org.  All rights reserved.
// This software is licensed under the LGPL 3.0 license available at http://www.gnu.org/licenses/lgpl.txt

package jsaf.provider.windows.registry;

import jsaf.intf.windows.registry.IKey;
import jsaf.intf.windows.registry.IStringValue;

/**
 * Representation of a Windows registry string value.
 *
 * @author <NAME>
 * @version %I% %G%
 */
public class StringValue extends Value implements IStringValue {
    private static final char NULL = 0;

    private String data;

    public StringValue(IKey parent, String name, String data) {
	type = Type.REG_SZ;
	this.parent = parent;
	this.name = name;

	//
	// Just in case a stray null appears at the end, clip it off
	//
	int len = data.length();
	if (len > 0 && data.charAt(len-1) == NULL) {
	    this.data = data.substring(0,len-1);
	} else {
	    this.data = data;
	}
    }

    public String getData() {
	return data;
{'fraction_non_alphanumeric': 0.10735373054213634, 'fraction_numerical': 0.011272141706924315, 'mean_word_length': 3.513317191283293, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '671113', 'n_tokens_mistral': 601, 'n_tokens_neox': 569, 'n_words': 201}