Project

General

Profile

Actions

Task #1041

closed

Bad sum of entities in LRT

Added by Ondřej Kopr over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Ondřej Kopr
Category:
Roles
Target version:
Start date:
03/27/2018
Due date:
% Done:

100%

Estimated time:
Owner:

Description

In LRT ProcessAutomaticRoleByAttributeTaskExecutor is some bug with sum of entities, please found the problem and fix it.

Actions #1

Updated by Ondřej Kopr over 6 years ago

  • Status changed from New to Needs feedback
  • Assignee changed from Ondřej Kopr to Radek Tomiška
  • % Done changed from 0 to 90

I found the problem in ProcessAutomaticRoleByAttributeTaskExecutor. There was made sum of these entities for LRT with this behavior:

count = Long.valueOf(newNotPassedContracts.getTotalElements() + newNotPassedContracts.getTotalElements());

I fixed this by replace first value in sum with correct attribute.

count = Long.valueOf(newPassedContracts.getTotalElements() + newNotPassedContracts.getTotalElements());

Better explain of this problem: in first example we are doing sum of two same attribute. Total elements for this case can be 2 and 2, sum = 4. But when is second attribute can be different than 2 and sum will be incorrect. Explain:

2 + 2 = 4
2 + 3 = 5
4 != 5

Note for future implement: check your code better. This is copy problem.

Also thank you Radek for explore this bug and could you made a review :D ?

Commit: https://github.com/bcvsolutions/CzechIdMng/commit/52b7eaafa7275d921978e2817e564f4736fa877b (develop + hotfix/7.8.5)

Actions #2

Updated by Radek Tomiška over 6 years ago

  • Status changed from Needs feedback to Closed
  • Assignee changed from Radek Tomiška to Ondřej Kopr
  • Target version changed from Hematite (8.0.0) to Garnet (7.8.5)
  • % Done changed from 90 to 100

i did test and review, it works, thx!

Even this ticket description is awesome and beautiful!

Actions

Also available in: Atom PDF