Summary: | Unable to execute class, but no compilation issues | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Christophe Elek <celek> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | VERIFIED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | Olivier_Thomann, srikanth_sankaran |
Version: | 3.4.2 | ||
Target Milestone: | 3.5 M7 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Christophe Elek
2009-03-20 11:13:37 EDT
I guess: private static final SimpleDateFormat formatter = new SimpleDateFormat("DD HH:mm:ss SSSS'm's'"); is all on one line ? Is this the SimpleDateFormat class for icu or java.text ? It looks like this constructor can potentially throw an exception. So the code should rather be: private static final SimpleDateFormat formatter = newFormatter(); private static SimpleDateFormat newFormatter() { SimpleDateFormat current = null; try { current = new SimpleDateFormat("DDHH:mm:ss SSSS'm's'"); } catch(IllegalArgumentException e) { // handle exception } return current; } It is not up to the compiler to check the validity of the pattern. Closing as INVALID. Yes one line, so the String is valid 'm's' ? This is an exception at runtime ? Verified to be invalid. |