Bug 58326 - Forbidden APIs patches
Summary: Forbidden APIs patches
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.13-dev
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2015-09-04 09:28 UTC by Andreas Beeker
Modified: 2015-11-02 00:18 UTC (History)
0 users



Attachments
[PATCH] patch for forbidden apis - v1 (27.56 KB, application/zip)
2015-09-04 09:32 UTC, Andreas Beeker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Beeker 2015-09-04 09:28:26 UTC
This bug entry is used to track the patches due to the forbidden apis check.
Currently my tests run through ("ant test"), but I'd like to apply the 
forbidden apis check not only to our normal sources, but also to our tests.

As I haven't fixed all the tests, there will be either a new version of the 
patch or if you think v1 is ok, I'll commit the other changes right away ...
Comment 1 Andreas Beeker 2015-09-04 09:32:29 UTC
Created attachment 33060 [details]
[PATCH] patch for forbidden apis - v1
Comment 2 Dominik Stadler 2015-09-05 07:41:26 UTC
I like the separate LocaleUtil class which encapsulates the selection of all these items, 

I think it would be good to apply these changes now without enabling more forbidden-api-checks in order to get tests running fine again for now and then fix the remaining api-checks in the main sources. 

Then take a look at all the items in tests separately step-by-step while maintaining a green CI-build.
Comment 3 Andreas Beeker 2015-09-07 20:21:34 UTC
first set of changes for locale and timezone settings with r1701688
also includes fixes for
- name shadowing 
- unused deprecated method "getClipRect" in classes extending Graphics2d
- HexDump - replaced intermediate String.format calls with custom padding
- convert testcases to junit4
- closing resources

also tested with an arbitary timezone (PST) and locale (ru)

supresses forbidden apis check for
- LocaleUtil (the only place where Locale.getDefault() and 
TimeZone.getDefault() should be called)
- Classes using FontMetrics - without the actual text it's difficult to return 
something sane

Some usage of UTC and Locale.ROOT might be still wrong, e.g. in MapiMessage we 
don't access the
extended mapi properties, which might contain the timezone

DataFormatter has now a Observable property which need to be observed when 
custom formats are used
and the Locale changes
Comment 4 Andreas Beeker 2015-09-08 00:07:44 UTC
The charset fixes are applied with r1701713

So it looks like, there's only - a probably not so easy to catch - error with 
CellDateFormatter to fix ...
Comment 5 Andreas Beeker 2015-11-02 00:18:52 UTC
Although there are still areas where we use forbidden apis, and we probably add further method signatures to the poi custom signature file, I'm closing this for now, as the main goal seems to be reached ...