<commit_before>package fi.bittiraha.walletd;

import org.bitcoinj.core.*;
import org.bitcoinj.kits.WalletAppKit;
import net.minidev.json.*;
import com.google.common.collect.ImmutableList;
import java.util.*;
import java.io.File;

/**
 * This class extends WalletAppKit to add ability to tag individual addresses
 * with account names to emulate bitcoind's accounts. However, emulation in
 * this version is incomplete and only useful in searching for incoming txs.
 */
public class WalletAccountManager extends WalletAppKit {
  WalletExtension manager;
  
  public WalletAccountManager(NetworkParameters params, File directory, String filePrefix) {
    super(params,directory,filePrefix);
    manager = new AccountManager();
  }

  protected class AccountManager extends JSONObject implements WalletExtension {
    public void deserializeWalletExtension(Wallet containingWallet, byte[] data) {
      Object parsed = JSONValue.parse(data);
      if (parsed instanceof JSONObject) {
        this.merge((JSONObject)parsed);
      } 
    }
    public String getWalletExtensionID() {
      return "fi.bittiraha.walletd.WalletAccountManager";
    }
    public boolean isWalletExtensionMandatory() {
      return true;
    }
    public byte[] serializeWalletExtension() {
      return this.toJSONString(JSONStyle.MAX_COMPRESS).getBytes();
    }
  }

  protected List<WalletExtension> provideWalletExtensions() throws Exception {
    return ImmutableList.of(manager);
  }
  
  public Map<String,Object> getAccountMap() {
    return (Map<String,Object>)manager;
  }
}<commit_msg>Fix a compile warning<commit_after>package fi.bittiraha.walletd;

import org.bitcoinj.core.*;
import org.bitcoinj.kits.WalletAppKit;
import net.minidev.json.*;
import com.google.common.collect.ImmutableList;
import java.util.*;
import java.io.File;

/**
 * This class extends WalletAppKit to add ability to tag individual addresses
 * with account names to emulate bitcoind's accounts. However, emulation in
 * this version is incomplete and only useful in searching for incoming txs.
 */
public class WalletAccountManager extends WalletAppKit {
  AccountManager manager;
  
  public WalletAccountManager(NetworkParameters params, File directory, String filePrefix) {
    super(params,directory,filePrefix);
    manager = new AccountManager();
  }

  protected class AccountManager extends JSONObject implements WalletExtension {
    public void deserializeWalletExtension(Wallet containingWallet, byte[] data) {
      Object parsed = JSONValue.parse(data);
      if (parsed instanceof JSONObject) {
        this.merge((JSONObject)parsed);
      } 
    }
    public String getWalletExtensionID() {
      return "fi.bittiraha.walletd.WalletAccountManager";
    }
    public boolean isWalletExtensionMandatory() {
      return true;
    }
    public byte[] serializeWalletExtension() {
      return this.toJSONString(JSONStyle.MAX_COMPRESS).getBytes();
    }
  }

  protected List<WalletExtension> provideWalletExtensions() throws Exception {
    return ImmutableList.of((WalletExtension)manager);
  }
  
  public Map<String,Object> getAccountMap() {
    return manager;
  }
}
{'fraction_non_alphanumeric': 0.0868320610687023, 'fraction_numerical': 0.0, 'mean_word_length': 4.276845637583893, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '366121', 'n_tokens_mistral': 857, 'n_tokens_neox': 874, 'n_words': 229}