Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0033367 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | major | always | 2016-06-28 10:51 | 2016-08-11 18:40 | |||
Reporter | caristu | View Status | public | |||||
Assigned To | caristu | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 3.0PR16Q4 | |||
Status | closed | Fix in branch | Fixed in SCM revision | 94d8c7dd940c | ||||
Projection | none | ETA | none | Target Version | 3.0PR16Q4 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | alostale | |||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0033367: testChangedClasses method in SystemServiceTest does not calculate the past date correctly | |||||||
Description | The SystemServiceTest in testChangedClasses is not calculating the 600 days in the past date correctly. It uses the following: final Date past = new Date(System.currentTimeMillis() - (1000 * 60 * 60 * 24 * 600)); If the number of days is over 24, the resulting value is larger than Integer.MAX_VALUE and the value overflows. So, the resulting past date is a future date. More info: http://stackoverflow.com/a/6866756 [^] | |||||||
Steps To Reproduce | 1) Debug the SystemServiceTest, placing a breakpoint in the following line[1] 2) Notice that the date calculated is NOT 600 days in the past [1] https://code.openbravo.com/erp/devel/pi/file/cc5f703395d6/src-test/src/org/openbravo/test/system/SystemServiceTest.java#l87 [^] | |||||||
Proposed Solution | Apply one of the proposed solutions explained here: http://stackoverflow.com/a/6866756 [^] | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() | |||||||
![]() |
|
![]() |
|
(0088552) hgbot (developer) 2016-07-18 13:27 |
Repository: erp/devel/pi Changeset: 94d8c7dd940c035bd529a20db04407a9a82b4b23 Author: Carlos Aristu <carlos.aristu <at> openbravo.com> Date: Mon Jul 18 13:26:10 2016 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/94d8c7dd940c035bd529a20db04407a9a82b4b23 [^] fixes issue 33367: testChangedClasses doesn't calculate the past date correctly 600 days in milliseconds overflows Integer.MAX_VALUE, so the resulting past Date using that value was not correct. Now the value is turned into long before substracting it to the current time. --- M src-test/src/org/openbravo/test/system/SystemServiceTest.java --- |
(0088624) alostale (viewer) 2016-07-22 10:23 |
code reviewed |
(0089019) hudsonbot (viewer) 2016-08-11 18:40 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/edaa05b1fb18 [^] Maturity status: Test |
![]() |
|||
Date Modified | Username | Field | Change |
2016-06-28 10:51 | caristu | New Issue | |
2016-06-28 10:51 | caristu | Assigned To | => platform |
2016-06-28 10:51 | caristu | OBNetwork customer | => No |
2016-06-28 10:51 | caristu | Modules | => Core |
2016-06-28 10:51 | caristu | Triggers an Emergency Pack | => No |
2016-06-28 10:51 | caristu | Assigned To | platform => caristu |
2016-06-28 10:51 | caristu | Status | new => scheduled |
2016-06-28 10:52 | caristu | Target Version | => 3.0PR16Q4 |
2016-06-28 10:54 | caristu | File Added: issue33367.diff | |
2016-07-18 13:27 | hgbot | Checkin | |
2016-07-18 13:27 | hgbot | Note Added: 0088552 | |
2016-07-18 13:27 | hgbot | Status | scheduled => resolved |
2016-07-18 13:27 | hgbot | Resolution | open => fixed |
2016-07-18 13:27 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/94d8c7dd940c035bd529a20db04407a9a82b4b23 [^] |
2016-07-18 13:28 | caristu | Review Assigned To | => alostale |
2016-07-18 13:28 | caristu | Issue Monitored: alostale | |
2016-07-22 10:23 | alostale | Note Added: 0088624 | |
2016-07-22 10:23 | alostale | Status | resolved => closed |
2016-07-22 10:23 | alostale | Fixed in Version | => 3.0PR16Q4 |
2016-08-11 18:40 | hudsonbot | Checkin | |
2016-08-11 18:40 | hudsonbot | Note Added: 0089019 |
Copyright © 2000 - 2009 MantisBT Group |