avatar

592

Small cleanups; referring to 'identifier' when the auction identifier is being used, as opposed to 'id' which is for the primary keys.

by mrs, 07 Aug, 2008 05:11 PM
526 592  
88 
99 import com.jbidwatcher.util.Currency;
1010 import com.jbidwatcher.auction.server.AuctionServer;
11 import com.jbidwatcher.auction.AuctionServerInterface;
1211 
1312 /**
1413  * Created by IntelliJ IDEA.
------
2019  * reduce duplication of the bid/buy result text.
2120  */
2221 public abstract class AuctionActionImpl implements AuctionAction {
23   protected String mId;
22   protected String mIdentifier;
2423   protected AuctionEntry mEntry;
2524   protected Currency mAmount;
2625   protected int mQuantity;
2726   int mResult = -1;
2827 
2928   protected AuctionActionImpl(String id, Currency amount, int quantity) {
30     mId = id;
29     mIdentifier = id;
3130     mEntry = null;
3231     mAmount = amount;
3332     mQuantity = quantity;
------
3534 
3635   protected AuctionActionImpl(AuctionEntry ae, Currency amount, int quantity) {
3736     mEntry = ae;
38     mId = ae.getIdentifier();
37     mIdentifier = ae.getIdentifier();
3938     mAmount = amount;
4039     mQuantity = quantity;
4140   }
4241 
4342   public String activate() {
4443     if(mEntry == null) {
45       mEntry = AuctionEntry.findByIdentifier(mId);
44       mEntry = AuctionEntry.findByIdentifier(mIdentifier);
4645       if(mEntry == null) {
4746         mResult = AuctionServer.BID_ERROR_AUCTION_GONE;
4847         return getBidResult(mAmount, mResult);