File tree Expand file tree Collapse file tree 3 files changed +5
-15
lines changed
aem-commons/src/main/java/com/viglet/dumont/connector/aem/commons/deserializer
aem/aem-plugin-sample/scripts/wknd Expand file tree Collapse file tree 3 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public class DumAemDates extends StdDeserializer<Date> {
3737 new SimpleDateFormat ("dd/MM/yyyy' 'HH'h'mm" , Locale .ENGLISH ) };
3838
3939 public DumAemDates () {
40- this (null );
40+ this (Date . class );
4141 }
4242
4343 public DumAemDates (Class <?> vc ) {
@@ -47,25 +47,18 @@ public DumAemDates(Class<?> vc) {
4747 @ Override
4848 public Date deserialize (JsonParser jsonParser , DeserializationContext deserializationContext )
4949 throws JacksonException {
50-
51- // No Jackson 3, evitamos getCodec().readTree().
52- // Usamos o próprio context para ler o valor como String de forma eficiente.
5350 String dateAsString = jsonParser .getValueAsString ();
5451
5552 if (dateAsString == null || dateAsString .trim ().isEmpty ()) {
5653 return null ;
5754 }
5855
5956 dateAsString = dateAsString .trim ();
60-
61- // Sincronização básica ou uso de formatadores locais (SimpleDateFormat não é
62- // thread-safe)
6357 synchronized (DATE_FORMATTERS ) {
6458 for (SimpleDateFormat formatter : DATE_FORMATTERS ) {
6559 try {
6660 return formatter .parse (dateAsString );
6761 } catch (ParseException | NumberFormatException ignored ) {
68- // Tenta o próximo formato
6962 }
7063 }
7164 }
Original file line number Diff line number Diff line change 1818
1919import java .util .Date ;
2020
21- import org .slf4j .Logger ;
22- import org .slf4j .LoggerFactory ;
23-
21+ import lombok .extern .slf4j .Slf4j ;
2422import tools .jackson .core .JacksonException ;
2523import tools .jackson .core .JsonParser ;
2624import tools .jackson .databind .DeserializationContext ;
2725import tools .jackson .databind .deser .std .StdDeserializer ;
2826
27+ @ Slf4j
2928public class DumAemUnixTimestamp extends StdDeserializer <Date > {
30- private static final Logger log = LoggerFactory .getLogger (DumAemUnixTimestamp .class );
31-
3229 public DumAemUnixTimestamp () {
33- this ( null );
30+ super ( Date . class );
3431 }
3532
3633 public DumAemUnixTimestamp (Class <?> vc ) {
Original file line number Diff line number Diff line change 11set TURING_URL = http://localhost:2700
2- set TURING_API_KEY = 09feeee9b7ce4b9eaee55aee3
2+ set TURING_API_KEY = 2f34fb8e3fbb416687543da9e
You can’t perform that action at this time.
0 commit comments