On 25.09.2012 23:29, Michael T. Pope wrote:
> Unit.getGoodsCapacity() is hardwired to throw an exception, and this
> is happening in BR#3571591.  The code in DefaultTransferHandler that
> calls getGoodsCapacity is a minor convenience and could be dropped,
> but I am surprised by the need for the exception.  Is this just
> something we forgot to fix when Units became GoodsLocations, or am I
> missing something important?
>
>      public int getGoodsCapacity() {
>          throw new RuntimeException("Do not call this method, unless we
> implement spoilage.");
>      }
>
> Cheers,
> Mike Pope
>    

I guess this is just something we forgot. But I understand neither the 
gist of the Exception message, nor the purpose of the method. We need to 
distinguish the cargo capacity of a goods location (i.e. the number of 
"holds" in a ship or wagon train) and the capacity for a particular type 
of goods. The DefaultTransferHandler seems to be checking the latter, 
but doesn't consider the type of goods. I think the whole capacity thing 
needs to be reviewed.

I would suggest commenting out the code in the DefaultTransferHandler 
and waiting for a rewrite of the GoodsContainer code.


Regards

Michael



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to