Skip to content

Incorrect bidder id when generating a bid #30

Description

@absoludity

The current code for BidGenerator.nextBid incorrectly adds the FIRST_PERSON_ID two times to the value returned by nextBase0PersonId() call (see lines 84 and 100 below):

bidder += GeneratorConfig.FIRST_PERSON_ID;
long price = PriceGenerator.nextPrice(random);
String channel;
String url;
if (random.nextInt(HOT_CHANNELS_RATIO) > 0) {
int i = random.nextInt(HOT_CHANNELS.length);
channel = HOT_CHANNELS[i];
url = HOT_URLS[i];
} else {
Tuple2<String, String> channelAndUrl = CHANNEL_URL_CACHE.get(random.nextInt(CHANNELS_NUMBER));
channel = channelAndUrl.f0;
url = channelAndUrl.f1;
}
bidder += GeneratorConfig.FIRST_PERSON_ID;

I only noticed because I'm writing unit-tests (to better understand what each function intends) while porting the data source to rust and my test failed :P.

Or if there is some reason why the FIRST_PERSON_ID is added twice intentionally, perhaps place those together with a comment - but as it is, I'm assuming it's unintended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions