Buggy code:
public class RtSolverBidder extends AbstractBidder < DoubleBid > implements RtSolverUser , TickListener { private static final long MAX_LOSING_TIME = ( 5 * 60 ) * 1000 ; final ObjectiveFunction objectiveFunction ; Optional < RtSimSolver > solverHandle ; final Queue < RtSolverBidder . CallForBids > cfbQueue ; Listener currentListener ; Map < Parcel , Auctioneer < DoubleBid > > parcelAuctioneers ; AtomicBoolean reauctioning ; AtomicBoolean computing ; final RtSolverBidder . BidFunction bidFunction ; long lastAuctionWinTime ; private final RealtimeSolver solver ; RtSolverBidder ( ObjectiveFunction objFunc , RealtimeSolver s , RtSolverBidder . BidFunction bidFunc ) { } @ Override public void callForBids ( final Auctioneer < DoubleBid > auctioneer , final Parcel parcel , final long time ) { } @ Override public void afterInit ( ) { } @ Override public void endOfAuction ( Auctioneer < DoubleBid > auctioneer , Parcel parcel , long time ) { } void next ( ) { } void computeBid ( final RtSolverBidder . CallForBids cfb ) { } @ SuppressWarnings ( "unused" ) @ Override public void receiveParcel ( Auctioneer < DoubleBid > auctioneer , Parcel p , long auctionStartTime ) { } @ SuppressWarnings ( { "null" , "unused" } ) void reauction ( ) { if ( assignedParcels . isEmpty ( ) ) { return ; } LOGGER . trace ( "{}<seq2seq4repair_space>Considering<seq2seq4repair_space>a<seq2seq4repair_space>reauction,<seq2seq4repair_space>assignedParcels:<seq2seq4repair_space>{}." , this , assignedParcels . size ( ) ) ; final ImmutableList < Parcel > currentRoute = ImmutableList . copyOf ( ( ( com . github . rinde . logistics . pdptw . mas . Truck ) ( vehicle . get ( ) ) ) . getRoute ( ) ) ; final GlobalStateObject state = solverHandle . get ( ) . getCurrentState ( SolveArgs . create ( ) . noCurrentRoutes ( ) . useParcels ( assignedParcels ) ) ; final StatisticsDTO stats = Solvers . computeStats ( state , ImmutableList . of ( currentRoute ) ) ; final Parcel lastReceivedParcel = Iterables . getLast ( assignedParcels ) ; if ( ! ( reauctioning . get ( ) ) ) { final Multiset < Parcel > routeMultiset = LinkedHashMultiset . create ( currentRoute ) ; final Set < Parcel > swappableParcels = new LinkedHashSet < > ( ) ; for ( final Parcel ap : assignedParcels ) { if ( ( ( ( ! ( pdpModel . get ( ) . getParcelState ( ap ) . isPickedUp ( ) ) ) && ( ! ( pdpModel . get ( ) . getParcelState ( ap ) . isTransitionState ( ) ) ) ) && ( ! ( state . getVehicles ( ) . get ( 0 ) . getDestination ( ) . asSet ( ) . contains ( ap ) ) ) ) && ( ! ( ap . equals ( lastReceivedParcel ) ) ) ) { swappableParcels . add ( ap ) ; } } final double baseline = objectiveFunction . computeCost ( stats ) ; double lowestCost = baseline ; @ Nullable Parcel toSwap = null ; LOGGER . trace ( "Compute<seq2seq4repair_space>cost<seq2seq4repair_space>of<seq2seq4repair_space>swapping" ) ; for ( final Parcel sp : swappableParcels ) { LOGGER . trace ( "try<seq2seq4repair_space>to<seq2seq4repair_space>swap<seq2seq4repair_space>{}" , sp ) ; final List < Parcel > newRoute = new ArrayList < > ( ) ; newRoute . addAll ( currentRoute ) ; newRoute . removeAll ( Collections . singleton ( sp ) ) ; final double cost = objectiveFunction . computeCost ( Solvers . computeStats ( state , ImmutableList . of ( ImmutableList . copyOf ( newRoute ) ) ) ) ; if ( cost < lowestCost ) { lowestCost = cost ; toSwap = sp ; } } if ( ( ( toSwap != null ) && ( ! ( reauctioning . get ( ) ) ) ) && ( ! ( toSwap . equals ( lastReceivedParcel ) ) ) ) { reauctioning . set ( true ) ; LOGGER . trace ( "Found<seq2seq4repair_space>most<seq2seq4repair_space>expensive<seq2seq4repair_space>parcel<seq2seq4repair_space>for<seq2seq4repair_space>reauction:<seq2seq4repair_space>{}." , toSwap ) ; final Auctioneer < DoubleBid > auct = parcelAuctioneers . get ( toSwap ) ; <START_BUG> final double bidValue = bidFunction . computeBidValue ( currentRoute . size ( ) , ( baseline - lowestCost ) ) ; <END_BUG> final DoubleBid initialBid = DoubleBid . create ( state . getTime ( ) , this , toSwap , bidValue ) ; auct . auctionParcel ( this , state . getTime ( ) , initialBid , new Listener ( ) { @ Override public void handleEvent ( Event e ) { reauctioning . set ( false ) ; } } ) ; } } } @ Override public boolean releaseParcel ( Parcel p ) { } @ Override public void tick ( TimeLapse timeLapse ) { } @ Override public void afterTick ( TimeLapse timeLapse ) { } @ Override public void setSolverProvider ( RtSimSolverBuilder builder ) { } public static StochasticSupplier < RtSolverBidder > supplier ( ObjectiveFunction objFunc , StochasticSupplier < ? extends RealtimeSolver > solverSupplier , RtSolverBidder . BidFunction bidFunction ) { } public interface BidFunction { double computeBidValue ( int numLocations , double additionalCost ) { } } public enum BidFunctions implements RtSolverBidder . BidFunction { PLAIN ( ) { @ Override public double computeBidValue ( int numLocations , double additionalCost ) { } } , BALANCED ( ) { @ Override public double computeBidValue ( int numLocations , double additionalCost ) { } } , BALANCED_LOW ( ) { @ Override public double computeBidValue ( int numLocations , double additionalCost ) { } } , BALANCED_HIGH ( ) { @ Override public double computeBidValue ( int numLocations , double additionalCost ) { } } ; static final double MUL = 10.0 ; } @ AutoValue static abstract class CallForBids { CallForBids ( ) { } abstract Auctioneer < DoubleBid > getAuctioneer ( ) { } abstract Parcel getParcel ( ) { } abstract long getTime ( ) { } static RtSolverBidder . CallForBids create ( Auctioneer < DoubleBid > auctioneer , Parcel parcel , long time ) { } }

Fix:
final double bidValue = bidFunction . computeBidValue ( currentRoute . size ( ) , ( lowestCost - baseline ) ) ;