Buggy code:
public class SparkBitJSONRPCServiceImpl implements SparkBitJSONRPCService { private BitcoinController controller ; private MultiBitFrame mainFrame ; private HashMap < String , String > walletFilenameMap ; public SparkBitJSONRPCServiceImpl ( ) { } @ Override public StatusResponse getstatus ( ) throws RpcException { } @ Override public ListWalletsResponse listwallets ( ) throws RpcException { } @ Override public Boolean createwallet ( String description ) throws RpcException { } @ Override public Boolean deletewallet ( String walletID ) throws RpcException { } private void updateWalletFilenameMap ( ) { } private String getFilenameForWalletID ( String walletID ) { } private Wallet getWalletForWalletID ( String walletID ) { } private CSAsset getAssetForAssetRefString ( Wallet w , String assetRef ) { } public Boolean setassetvisible ( String walletID , String assetRef , Boolean visibility ) throws RpcException { } public Boolean addasset ( String walletID , String assetRefString ) throws RpcException { } public Boolean refreshasset ( String walletID , String assetRef ) throws RpcException { } public AddressBookEntry [ ] listaddresses ( String walletID ) throws RpcException { } public AddressBookEntry [ ] createaddress ( String walletID , Long quantity ) throws RpcException { } public Boolean setaddresslabel ( String walletID , String address , String label ) throws RpcException { } public AssetTransaction [ ] listtransactions ( String walletID , Long limit ) throws RpcException { Wallet w = getWalletForWalletID ( walletID ) ; if ( w == null ) throw new RpcException ( 100 , "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>a<seq2seq4repair_space>wallet<seq2seq4repair_space>with<seq2seq4repair_space>that<seq2seq4repair_space>ID" ) ; if ( limit > 100 ) throw new RpcException ( 100 , "Number<seq2seq4repair_space>of<seq2seq4repair_space>transactions<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>greater<seq2seq4repair_space>than<seq2seq4repair_space>100" ) ; if ( limit <= 0 ) throw new RpcException ( 100 , "Number<seq2seq4repair_space>of<seq2seq4repair_space>transactions<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>1" ) ; List < AssetTransaction > resultList = new ArrayList < AssetTransaction > ( ) ; int lastSeenBlock = controller . getMultiBitService ( ) . getChain ( ) . getBestChainHeight ( ) ; List < Transaction > transactions = w . getRecentTransactions ( limit . intValue ( ) , false ) ; for ( Transaction tx : transactions ) { Date txDate = controller . getModel ( ) . getDateOfTransaction ( controller , tx ) ; long unixtime = txDate . getTime ( ) ; long confirmations = lastSeenBlock - ( tx . getConfidence ( ) . getAppearedAtChainHeight ( ) ) ; boolean incoming = ! ( tx . sent ( w ) ) ; BigInteger feeSatoshis = tx . calculateFee ( w ) ; Double fee = null ; <START_BUG> if ( incoming ) { <END_BUG> BigDecimal feeBTC = new BigDecimal ( feeSatoshis ) . divide ( new BigDecimal ( Utils . COIN ) ) ; fee = new Double ( feeBTC . doubleValue ( ) ) ; } String txid = tx . getHashAsString ( ) ; ArrayList < AssetTransactionAmount > amounts = getAssetTransactionAmounts ( w , tx ) ; AssetTransactionAmount [ ] amountsArray = amounts . toArray ( new AssetTransactionAmount [ 0 ] ) ; AssetTransaction atx = new AssetTransaction ( unixtime , confirmations , incoming , amountsArray , fee , txid ) ; resultList . add ( atx ) ; } AssetTransaction [ ] resultArray = resultList . toArray ( new AssetTransaction [ 0 ] ) ; return resultArray ; } private ArrayList < AssetTransactionAmount > getAssetTransactionAmounts ( Wallet wallet , Transaction tx ) { } }

Fix:
if ( ! incoming ) {