bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

HashTable bug in the overwrite update

RESOLVED INVALID

Status

Invalid Bugs
General
P5
trivial
RESOLVED INVALID
5 years ago
4 years ago

People

(Reporter: Nadi, Unassigned)

Tracking

Details

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
Created attachment 730466 [details] [diff] [review]
This is a suggested fix for the buggy put function of the program.

The program HashTable.java is an implementation of hash table using linear open addressing and division in Java. This program has a bug, because the put function will NOT update the element associated with the given key if an entry with the same key is put. However, this hash table implementation should update the element even if the element’s key already exists in the hash table.

The test case for this bug is to call put fucntion with a duplicated key that is required to be written on the old value.

Steps to reproduce:
- Call put function with an existed key value and new element
- Instead of rewiting the old value with the new one, it only store the old value into a temporary variable and returns old value.  

---------------------
Firefox x.x
xxx operating system
x86_64 hardware
(Reporter)

Updated

5 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
(Reporter)

Comment 1

5 years ago
Created attachment 730538 [details]
The buggy original program.
(Reporter)

Updated

5 years ago
Summary: HashTable bug → HashTable bug in the overwrite update

Comment 2

5 years ago
This is a live bug database, and test bugs cause people to receive email they don't care about. Please use https://landfill.bugzilla.org/ to test out Bugzilla.

Comment 3

4 years ago
filter: yahooyahooyahoo
Component: Developer Tools: Debugger → General
Product: Firefox → Invalid Bugs
You need to log in before you can comment on or make changes to this bug.