You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/07/02 04:36:19 UTC
[Bug 53494] New: CellFormat throws NPE for date formats with locale
codes
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
Priority: P2
Bug ID: 53494
Assignee: dev@poi.apache.org
Summary: CellFormat throws NPE for date formats with locale
codes
Severity: normal
Classification: Unclassified
OS: All
Reporter: trejkaz@trypticon.org
Hardware: PC
Status: NEW
Version: 3.8
Component: HSSF
Product: POI
A cell format such as:
[$-409]mmmm dd yyyy h:mm AM/PM
should format explicitly in English. A cell format such as:
[$-804]mmmm dd yyyy h:mm AM/PM
should format in Chinese (although in an inappropriate order for Chinese.)
When I do this using POI though, CellFormat.apply(double) or
CellFormat.apply(Cell) throw NullPointerException for both formats.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53494] CellFormat throws NPE for date formats with locale codes
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
--- Comment #4 from Trejkaz (pen name) <tr...@trypticon.org> ---
Manually downloaded that file and another one which the build downloaded a
corrupt copy of. And no, there is no web proxy in front of me at all. There
might be one in front of the mirror server which the build is downloading from.
Looks like the issue still occurs (same NullPointerException.)
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53494] CellFormat throws NPE for date formats with locale codes
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
Nick Burch <ni...@alfresco.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #1 from Nick Burch <ni...@alfresco.com> ---
Could you try with a recent nightly build / svn checkout? There was a fix for
locales in formats a few weeks ago, which may have solved this too.
If the problem still remains with a recent build, could you please post the
full stacktrace, and ideally a unit test that highlights the problem?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53494] CellFormat throws NPE for date formats with locale codes
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
Trejkaz (pen name) <tr...@trypticon.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53494] CellFormat throws NPE for date formats with locale codes
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
--- Comment #2 from Trejkaz (pen name) <tr...@trypticon.org> ---
Current trunk build seems to be broken.
/Data/Projects/vendor/poi/trunk/build.xml:412: taskdef class
org.apache.xmlbeans.impl.tool.XMLBean cannot be found
using the classloader
AntClassLoader[/Data/Projects/vendor/poi/trunk/ooxml-lib/xmlbeans-2.3.0.jar:/Data/Projects/vendor/poi/trunk/ooxml-lib/stax-api-1.0.1.jar]
Searching on Google found a post which suggests that xmlbeans-2.3.0.jar might
be corrupt. It is in fact corrupt, but after deleting it, another corrupt copy
is downloaded the next time I run the build. :/
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53494] CellFormat throws NPE for date formats with locale codes
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
Trejkaz (pen name) <tr...@trypticon.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|3.8 |3.9
--- Comment #7 from Trejkaz (pen name) <tr...@trypticon.org> ---
Still occurs in 3.9, but the stack trace is different now, now the NPE is in
CellFormat.getApplicableFormatPart(CellFormat.java:365)
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53494] CellFormat throws NPE for date formats with locale codes
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
Nick Burch <ap...@gagravarr.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |LATER
--- Comment #8 from Nick Burch <ap...@gagravarr.org> ---
Thanks for the test
I've added a slightly modified form in r1614741, which shows that trunk is now
able to parse these style of formats without error
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53494] CellFormat throws NPE for date formats with locale codes
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
Nick Burch <ni...@alfresco.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #5 from Nick Burch <ni...@alfresco.com> ---
Any chance of the full stacktrace so we can see where the NPE is triggered, and
ideally also a unit test?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53494] CellFormat throws NPE for date formats with locale codes
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
--- Comment #3 from Nick Burch <ni...@alfresco.com> ---
Could you perhaps have a broken webproxy in front of you, which is wrecking
your downloads?
I'd suggest you either download the jar manually, or download an older
binary/source release and grab a known good jar out of that
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 53494] CellFormat throws NPE for date formats with locale codes
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53494
Trejkaz (pen name) <tr...@trypticon.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
--- Comment #6 from Trejkaz (pen name) <tr...@trypticon.org> ---
@Test
public void testCellFormatDateLocales() throws Exception
{
CellFormat englishFormat = CellFormat.getInstance("[$-409]mmmm dd yyyy
h:mm AM/PM");
assertThat(englishFormat.apply(26995.477777777778).text,
is(equalTo("November 27 1973 11:28 AM")));
CellFormat chineseFormat = CellFormat.getInstance("[$-804]mmmm dd yyyy
h:mm AM/PM");
assertThat(chineseFormat.apply(26995.477777777778).text,
is(equalTo("\u5341\u4E00\u6708 27 1973 11:28 \u4E0A\u5348")));
}
This should be enough to reproduce it. I'm not 100% sure if the expected text
is exactly correct because I took this double value from the debugger while our
own test was running and floating point often ruins precision...
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org