harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko" <alexey.a.petre...@gmail.com>
Subject Strange behavior of private static variable on Linux.
Date Wed, 19 Dec 2007 15:53:27 GMT
I'm trying to run JSPWiki [1] (it's Apache incubator project now) on
Harmony + Tomcat. It works ok on Windows but can not start on Linux.
I've described the issue in HARMONY-5327 [2]

Investigation shown that NPE happens because StringBuffer.getChars
method receives null as destination parameter from
org.apache.log4j.helpers.ISO8601DateFormat.format. This behavior is
described in spec and RI behaves in the same way.

ISO8601DateFormat.format [3] passes private static variable
lastTimeString which is initialized to new char array. And
initialization really happens. No other assignments to this variable
in the class.
But it is null right before exception...

How can this happen? Any ideas?

Removing static keyword - helps.
Adding final keyword - helps.
Works ok on Windows.

Looks like this is DRLVM Linux specific issue.

Thanks in advance for any ideas.

SY, Alexey

1. http://jspwiki.org/
2. https://issues.apache.org/jira/browse/HARMONY-5327
3. https://svn.apache.org/repos/asf/logging/log4j/trunk/src/main/java/org/apache/log4j/helpers/ISO8601DateFormat.java

Mime
View raw message