<commit_before>package com.comandante.creeper.merchant.bank.commands;


import com.comandante.creeper.command.Command;
import com.comandante.creeper.managers.GameManager;
import com.comandante.creeper.server.Color;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.MessageEvent;

import java.text.NumberFormat;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;

public class DepositCommand extends BankCommand {

    final static List<String> validTriggers = Arrays.asList("deposit", "d");
    final static String description = "Deposit gold.";

    public DepositCommand(GameManager gameManager) {
        super(gameManager, validTriggers, description);
    }

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
        configure(e);
        try {
            if (originalMessageParts.size() > 1 && Command.isInteger(originalMessageParts.get(1))) {
                int depositAmt = Integer.parseInt(originalMessageParts.get(1));
                if (areFundsAvailable(depositAmt)) {
                    player.transferGoldToBank(depositAmt);
                    write("Your funds of " + NumberFormat.getNumberInstance(Locale.US).format(depositAmt) + Color.YELLOW + " gold " + Color.RESET + "have been transferred to your bank account."+ "\r\n");<commit_msg>changed parseInt, isInt to parseLong, isLong etc.<commit_after>package com.comandante.creeper.merchant.bank.commands;


import com.comandante.creeper.command.Command;
import com.comandante.creeper.managers.GameManager;
import com.comandante.creeper.server.Color;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.MessageEvent;

import java.text.NumberFormat;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;

public class DepositCommand extends BankCommand {

    final static List<String> validTriggers = Arrays.asList("deposit", "d");
    final static String description = "Deposit gold.";

    public DepositCommand(GameManager gameManager) {
        super(gameManager, validTriggers, description);
    }

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
        configure(e);
        try {
            if (originalMessageParts.size() > 1 && Command.isLong(originalMessageParts.get(1))) {
                long depositAmt = Long.parseLong(originalMessageParts.get(1));
                if (areFundsAvailable(depositAmt)) {
                    player.transferGoldToBank(depositAmt);
                    write("Your funds of " + NumberFormat.getNumberInstance(Locale.US).format(depositAmt) + Color.YELLOW + " gold " + Color.RESET + "have been transferred to your bank account."+ "\r\n");
{'fraction_non_alphanumeric': 0.10410662824207492, 'fraction_numerical': 0.002161383285302594, 'mean_word_length': 3.787931034482759, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3231594', 'n_tokens_mistral': 817, 'n_tokens_neox': 784, 'n_words': 163}