-
Bug
-
Resolution: Timed out
-
Low
-
None
-
7.0.10, 7.1.0
-
7
-
3
-
Severity 3 - Minor
-
NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.
Expected Behavior
Fully support all operands provided by SimpleDateFormat in Java 8.
http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
Actual Behavior
The u operand cannot be parsed, even though it's accepted as valid. In the logs, we can see an InvalidArgumentException.
2016-04-05 12:56:15,382 http-nio-8710-exec-8 ERROR admin 776x101x1 1u66v39 0:0:0:0:0:0:0:1 / [c.a.j.plugin.navigation.HeaderFooterRendering] Unable to include web panel in context 'atl.header.after.scripts' from class 'com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor.ContextAwareWebPanel' because of 'java.lang.IllegalArgumentException: Illegal pattern component: u'
Suggested theory
Tomcat 8 is bundled since JIRA 7, and we are only supporting Java 8 on these versions. However, Tomcat 8 uses the Servlet 3.1 API, which is part of Java EE 7. SimpleDateFormat on Java 7 has E for day of week names and F for day of week numbers.
SimpleDateFormat on Java 8 changed some operands, including the replacement of F with u, so JIRA will not accept the input of F as an operand when setting up date formats, but will take u.
When trying to parse the header and footer of the page (see error above), JIRA takes a HttpServletRequest object, which is a class from the Servlet 3.1 API. This obviously leads to an inconsistency, where a Java 7-based class cannot understand the u operand when parsing the date.
Steps to Reproduce
Under Administration > System > Look and feel, setup any date format to use u as one of the operands.
Workaround
As of now, there's no guaranteed workaround other than opting for other operand (such as E, parsing to the name of the weekday), supported by SimpleDateFormat on both Java 7 and 8.
In case the setting is applied, it may be necessary to revert it through the database. You can use the below query to reset the format to the default.
UPDATE propertystring SET propertyvalue='dd/MMM/yy' WHERE id IN (SELECT id FROM propertyentry WHERE property_key = 'jira.lf.date.dmy');
- relates to
-
JRACLOUD-60472 Inconsistency with SimpleDateFormat
-
- Closed
-
-
JRASERVER-60583 Created Date / Updated Date displayed wrong week information
-
- Gathering Impact
-