Buggy code:
@ SuppressWarnings ( "deprecation" ) public class DynamicMarket extends JavaPlugin { public static DynamicMarket plugin ; public final Logger logger = Logger . getLogger ( "Minecraft" ) ; public Configuration items ; public static BigDecimal MINVALUE = BigDecimal . valueOf ( 0.01 ) . setScale ( 2 ) ; public static BigDecimal MAXVALUE = BigDecimal . valueOf ( 10000 ) . setScale ( 2 ) ; public static BigDecimal CHANGERATE = BigDecimal . valueOf ( 0.01 ) . setScale ( 2 ) ; public static BigDecimal SPREAD = DynamicMarket . CHANGERATE ; public static File directory ; PluginDescriptionFile pdfFile ; public static Permission permission = null ; public static Economy economy = null ; @ Override public void onDisable ( ) { } @ Override public void onEnable ( ) { } private void checkEbean ( ) { } private void setupFiles ( ) { } private void switchToDatabase ( ) { } private void setupDatabase ( ) { } @ Override public List < Class < ? > > getDatabaseClasses ( ) { } private Boolean setupPermissions ( ) { } private Boolean setupEconomy ( ) { } public boolean onCommand ( CommandSender sender , Command cmd , String commandLabel , String [ ] args ) { } public boolean readCommand ( CommandSender sender , String command , String [ ] args ) { } public boolean market ( CommandSender sender , String [ ] args ) { } private boolean marketHelp ( CommandSender sender ) { } public boolean marketTop ( CommandSender sender ) { } public boolean marketBottom ( CommandSender sender ) { } public boolean buy ( Player player , String item , int amount ) { <START_BUG> if ( amount <= 0 ) { <END_BUG> player . sendMessage ( ( ( ChatColor . RED ) + "Invalid<seq2seq4repair_space>amount." ) ) ; player . sendMessage ( "No<seq2seq4repair_space>negative<seq2seq4repair_space>numbers<seq2seq4repair_space>or<seq2seq4repair_space>zero,<seq2seq4repair_space>please." ) ; return false ; } Commodities commodity = DynamicMarket . plugin . getDatabase ( ) . find ( Commodities . class ) . where ( ) . ieq ( "name" , item ) . findUnique ( ) ; if ( commodity == null ) { player . sendMessage ( ( ( ChatColor . RED ) + "Not<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>buy<seq2seq4repair_space>that<seq2seq4repair_space>item." ) ) ; player . sendMessage ( "Be<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>typed<seq2seq4repair_space>the<seq2seq4repair_space>correct<seq2seq4repair_space>name" ) ; return true ; } Invoice invoice = generateInvoice ( 1 , commodity , amount ) ; if ( DynamicMarket . economy . has ( player . getName ( ) , invoice . getTotal ( ) . doubleValue ( ) ) ) { Byte byteData = Byte . valueOf ( String . valueOf ( commodity . getData ( ) ) ) ; int id = commodity . getId ( ) ; HashMap < Integer , ItemStack > overflow = player . getInventory ( ) . addItem ( new ItemStack ( id , amount , ( ( short ) ( 0 ) ) , byteData ) ) ; for ( int a : overflow . keySet ( ) ) { player . getWorld ( ) . dropItem ( player . getLocation ( ) , overflow . get ( a ) ) ; } commodity . setValue ( invoice . getValue ( ) ) ; DynamicMarket . plugin . getDatabase ( ) . save ( commodity ) ; BigDecimal value = BigDecimal . valueOf ( commodity . getValue ( ) ) . setScale ( 2 , RoundingMode . HALF_UP ) ; player . sendMessage ( ( ( ChatColor . GREEN ) + "--------------------------------" ) ) ; player . sendMessage ( ( ( ( ( ChatColor . GREEN ) + "Old<seq2seq4repair_space>Balance:<seq2seq4repair_space>" ) + ( ChatColor . WHITE ) ) + ( BigDecimal . valueOf ( DynamicMarket . economy . getBalance ( player . getName ( ) ) ) . setScale ( 2 , RoundingMode . HALF_UP ) ) ) ) ; DynamicMarket . economy . withdrawPlayer ( player . getName ( ) , invoice . getTotal ( ) . doubleValue ( ) ) ; player . sendMessage ( ( ( ( ( ChatColor . GREEN ) + "Cost:<seq2seq4repair_space>" ) + ( ChatColor . WHITE ) ) + ( invoice . getTotal ( ) ) ) ) ; player . sendMessage ( ( ( ( ( ChatColor . GREEN ) + "New<seq2seq4repair_space>Balance:<seq2seq4repair_space>" ) + ( ChatColor . WHITE ) ) + ( BigDecimal . valueOf ( DynamicMarket . economy . getBalance ( player . getName ( ) ) ) . setScale ( 2 , RoundingMode . HALF_UP ) ) ) ) ; player . sendMessage ( ( ( ChatColor . GREEN ) + "--------------------------------" ) ) ; player . sendMessage ( ( ( ( ( ( ( ChatColor . GRAY ) + item ) + ( ChatColor . GREEN ) ) + "<seq2seq4repair_space>New<seq2seq4repair_space>Price:<seq2seq4repair_space>" ) + ( ChatColor . WHITE ) ) + value ) ) ; return true ; } else { BigDecimal difference = BigDecimal . valueOf ( ( ( DynamicMarket . economy . getBalance ( player . getName ( ) ) ) - ( invoice . getTotal ( ) . doubleValue ( ) ) ) ) . setScale ( 2 , RoundingMode . HALF_UP ) ; player . sendMessage ( ( ( ChatColor . RED ) + "You<seq2seq4repair_space>don't<seq2seq4repair_space>have<seq2seq4repair_space>enough<seq2seq4repair_space>money" ) ) ; player . sendMessage ( ( ( ( ( ChatColor . GREEN ) + "Balance:<seq2seq4repair_space>" ) + ( ChatColor . WHITE ) ) + ( BigDecimal . valueOf ( DynamicMarket . economy . getBalance ( player . getName ( ) ) ) . setScale ( 2 , RoundingMode . HALF_UP ) ) ) ) ; player . sendMessage ( ( ( ( ( ChatColor . GREEN ) + "Cost:<seq2seq4repair_space>" ) + ( ChatColor . WHITE ) ) + ( invoice . getTotal ( ) ) ) ) ; player . sendMessage ( ( ( ( ( ChatColor . GREEN ) + "Difference:<seq2seq4repair_space>" ) + ( ChatColor . RED ) ) + difference ) ) ; return true ; } } public boolean sell ( Player player , String item , int amount ) { }

Fix:
if ( amount <= 1 ) {