Bug 47794 - unreasonable code in org.apache.poi.ss.usermodel.DateUtil
Summary: unreasonable code in org.apache.poi.ss.usermodel.DateUtil
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-dev
Hardware: PC All
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-07 11:38 UTC by joachim.rudolph
Modified: 2015-05-20 18:19 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description joachim.rudolph 2009-09-07 11:38:38 UTC
in org.apache.poi.ss.usermodel.DateUtil.daysInPriorYears() you can find the code 

if ((!use1904windowing && yr < 1900) || (use1904windowing && yr < 1900)) {

throw new IllegalArgumentException("'year' must be 1900 or greater");

}


This does not make sense for me, i assume the secong 1900 should be 1904 or otherwise the evaluation of use1904windowing makes no sense.
Comment 1 Dominik Stadler 2015-05-20 18:19:15 UTC
I tried to fix this with r1680642.