[ 
https://issues.apache.org/jira/browse/JENA-1819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17018549#comment-17018549
 ] 

Andy Seaborne commented on JENA-1819:
-------------------------------------

Hi [~lingchao] - thanks for the feedback.

We try to migrate gracefully, and it is a compile time error. There is a 
balance between compatibility and building up technical debt. Change away from 
use of {{FastDateFormat}} was forced on the code (staying at the old version 
forever is not an option).

Sometimes, our understanding of what users do, and do not use, is incomplete. 
Formatting code is a case in point. 
Java modules might help if it were combined with a reorganisation of the code.

The removed code is a one liner: {{dateFormat.format(new Date())}}.



> Updating from 3.12 to 3.13 breaks
> ---------------------------------
>
>                 Key: JENA-1819
>                 URL: https://issues.apache.org/jira/browse/JENA-1819
>             Project: Apache Jena
>          Issue Type: Bug
>            Reporter: xia0c
>            Priority: Major
>
> When I try to upgrade jena-arq from 3.12 to 3.13. The following code breaks.
> {code:java}
> public class TestJena {
>       
>       private static FastDateFormat timestamp = 
> FastDateFormat.getInstance("HH:mm:ss.SSS") ;
>       
>       private void printQuery(Query query, QuerySolution initialBinding) {
>         String time = DateTimeUtils.nowAsString(timestamp); 
>         System.err.print("~~ ");
>         System.err.print(time);
>         System.err.println(" ~~");
>         System.err.println(initialBinding);
>         System.err.print(query);
>       }
> }
> {code}
> The code should pass, but it throws an error:
> {code:java}
> TestJena.java:[13,36] no suitable method found for 
> nowAsString(org.apache.commons.lang3.time.FastDateFormat)
> [ERROR] method 
> org.apache.jena.atlas.lib.DateTimeUtils.nowAsString(java.lang.String) is not 
> applicable
> [ERROR] (argument mismatch; org.apache.commons.lang3.time.FastDateFormat 
> cannot be converted to java.lang.String)
> [ERROR] method 
> org.apache.jena.atlas.lib.DateTimeUtils.nowAsString(java.time.format.DateTimeFormatter)
>  is not applicable
> [ERROR] (argument mismatch; org.apache.commons.lang3.time.FastDateFormat 
> cannot be converted to java.time.format.DateTimeFormatter)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to