Bug 352 - Improper return values of PokerHand.compareTo(BombBase)
Summary: Improper return values of PokerHand.compareTo(BombBase)
Status: RESOLVED FIXED
Alias: None
Product: Group 8 (2019)
Classification: Unclassified
Component: PokerHand (show other bugs)
Version: Version1.0
Hardware: PC Windows
: --- normal
Assignee: SYR
URL:
Depends on:
Blocks:
 
Reported: 2019-12-05 14:30 HKT by ZLQ
Modified: 2019-12-05 15:10 HKT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ZLQ 2019-12-05 14:30:16 HKT
Steps to reproduce:
1. Create a Solo and Bomb instance, called solo and bomb resp.
2. Call solo.compareTo(bomb).

Expected Result:
It should return -1, which means the solo is smaller than the bomb.

Actual Result:
It returns -2, which means neither the solo is greater than the bomb, nor the bomb is greater than the solo.

More information:
When implementing compareTo, judge whether the parameter other is an instance of BombBase.
Comment 1 SYR 2019-12-05 15:10:59 HKT
Codes to check whether the parameter other is an instance of BombBase has been added. Hence the problem is solved now.