Buggy code:
public class SparkBitJSONRPCServiceImpl implements sparkbit { private static final Logger log = LoggerFactory . getLogger ( SparkBitJSONRPCServiceImpl . class ) ; public static final int CREATE_ADDRESSES_LIMIT = 100 ; public static final int SHUTDOWN_DELAY = ( JettyEmbeddedServer . GRACEFUL_SHUTDOWN_PERIOD ) + 1000 ; private BitcoinController controller ; private Timer stopTimer ; public SparkBitJSONRPCServiceImpl ( ) { } @ Override public Boolean stop ( ) throws RpcException { } @ Override public JSONRPCStatusResponse getstatus ( ) throws RpcException { } @ Override public String [ ] listwallets ( ) throws RpcException { } @ Override public synchronized Boolean createwallet ( String name ) throws RpcException { } @ Override public synchronized Boolean deletewallet ( String walletID ) throws RpcException { } private String getFullPathForWalletName ( String name ) { } private boolean sanityCheckName ( String name ) { } private Wallet getWalletForWalletName ( String walletID ) { } private boolean isAssetRefValid ( String s ) { } private CSAsset getAssetForAssetRefString ( Wallet w , String assetRef ) { } @ Override public synchronized Boolean setassetvisible ( String walletID , String assetRef , Boolean visibility ) throws RpcException { } @ Override public synchronized Boolean addasset ( String walletID , String assetRefString ) throws RpcException { } @ Override public Boolean deleteasset ( String walletname , String assetRef ) throws RpcException { } @ Override public synchronized Boolean refreshasset ( String walletID , String assetRef ) throws RpcException { } @ Override public JSONRPCAddressBookEntry [ ] listaddresses ( String walletID ) throws RpcException { } @ Override public synchronized JSONRPCAddressBookEntry [ ] createaddresses ( String walletID , Long quantity ) throws RpcException { } @ Override public synchronized Boolean setaddresslabel ( String walletID , String address , String label ) throws RpcException { } @ Override public JSONRPCTransaction [ ] listtransactions ( String walletID , Long limit ) throws RpcException { } private ArrayList < JSONRPCTransactionAmount > getAssetTransactionAmounts ( Wallet wallet , Transaction tx , boolean excludeBTCFee , boolean absoluteBTCFee ) { } @ Override public JSONRPCUnspentTransactionOutput [ ] listunspent ( String walletname , Long minconf , Long maxconf , String [ ] addresses ) throws RpcException { } private JSONRPCBalance createBitcoinBalance ( Wallet w ) { } private JSONRPCBalance createBitcoinBalance ( Wallet w , BigInteger rawBalanceSatoshi , BigInteger rawSpendableSatoshi ) { JSONRPCBalance balance = new JSONRPCBalance ( ) ; balance . setAsset_ref ( "bitcoin" ) ; BigDecimal rawBalanceBTC = new BigDecimal ( rawBalanceSatoshi ) . divide ( new BigDecimal ( Utils . COIN ) ) ; String rawBalanceDisplay = ( Utils . bitcoinValueToFriendlyString ( rawBalanceSatoshi ) ) + "<seq2seq4repair_space>BTC" ; JSONRPCBalanceAmount bitcoinBalanceAmount = new JSONRPCBalanceAmount ( rawBalanceSatoshi . longValue ( ) , rawBalanceBTC . doubleValue ( ) , rawBalanceDisplay ) ; if ( rawSpendableSatoshi != null ) { BigDecimal rawSpendableBTC = new BigDecimal ( rawSpendableSatoshi ) . divide ( new BigDecimal ( Utils . COIN ) ) ; <START_BUG> String rawSpendableDisplay = ( Utils . bitcoinValueToFriendlyString ( rawBalanceSatoshi ) ) + "<seq2seq4repair_space>BTC" ; <END_BUG> JSONRPCBalanceAmount bitcoinSpendableAmount = new JSONRPCBalanceAmount ( rawSpendableSatoshi . longValue ( ) , rawSpendableBTC . doubleValue ( ) , rawSpendableDisplay ) ; balance . setTotal ( bitcoinBalanceAmount ) ; balance . setSpendable ( bitcoinSpendableAmount ) ; } else { balance . setAmount ( bitcoinBalanceAmount ) ; } balance . setVisible ( true ) ; balance . setValid ( true ) ; balance . setRefreshing ( false ) ; return balance ; } private JSONRPCBalance createAssetBalance ( Wallet w , int assetID , BigInteger totalRaw , BigInteger spendableRaw ) { } @ Override public JSONRPCBalance [ ] listbalances ( String walletID , Boolean onlyVisible ) throws RpcException { } private synchronized boolean isTxOutSpendable ( Wallet w , Sha256Hash hash , int vout ) throws RpcException { } @ Override public synchronized String sendbitcoin ( String walletID , String address , Double amount ) throws RpcException { } @ Deprecated @ Override public synchronized String sendbitcoinwith ( String walletID , String txid , Long vout , String address , Double amount ) throws RpcException { } @ Override public synchronized String sendbitcoinusing ( String walletID , String txid , Long vout , String address , Double amount ) throws RpcException { } private synchronized String sendbitcoinusing_impl ( String walletID , String txid , Long vout , String address , Double amount , String message ) throws RpcException { } @ Override public synchronized String sendasset ( String walletID , String address , String assetRef , Double quantity , Boolean senderPays ) throws RpcException { } @ Deprecated @ Override public synchronized String sendassetwith ( String walletID , String txid , Long vout , String address , String assetRef , Double quantity , Boolean senderPays ) throws RpcException { } @ Override public synchronized String sendassetusing ( String walletID , String txid , Long vout , String address , String assetRef , Double quantity , Boolean senderPays ) throws RpcException { } private synchronized String sendassetusing_impl ( String walletID , String txid , Long vout , String address , String assetRef , Double quantity , Boolean senderPays , String message , Double btcAmount ) throws RpcException { } @ Override public String sendbitcoinasset ( String walletname , String address , Double btc_amount , String assetref , Double asset_qty , Boolean senderpays ) throws RpcException { } @ Override public String sendassetmessage ( String walletname , String address , String assetref , Double quantity , Boolean senderpays , String message ) throws RpcException { } @ Override public String sendbitcoinmessage ( String walletname , String address , Double amount , String message ) throws RpcException { } @ Override public String sendbitcoinassetmessage ( String walletname , String address , Double btc_amount , String assetref , Double asset_qty , Boolean senderpays , String message ) throws RpcException { } }

Fix:
String rawSpendableDisplay = ( Utils . bitcoinValueToFriendlyString ( rawSpendableSatoshi ) ) + "<seq2seq4repair_space>BTC" ;