Toggle navigation
Home
java.text.SimpleDateFormat to java.time.format.DateTimeFormatter
No. of Instances - 4
No. of Commits - 1
No. of Projects - {'pulsar'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Jdk -> Jdk
Mapping:
Rename Variable
f
to
formatter
Add or Remove Method invocation
cnx.sendRequestWithId(Commands.newProducer(topic,producerId,requestId,producerName),requestId).thenAccept(producerName -> { synchronized (ProducerImpl.this) { if (state.get() == State.Closing || state.get() == State.Closed) { cnx.removeProducer(producerId); cnx.channel().close(); return; } resetBackoff(); log.info("[{}] [{}] Created producer on cnx {}",topic,producerName,cnx.ctx().channel()); connectionId=cnx.ctx().channel().toString(); connectedSince=DATE_FORMAT.format(new Date(System.currentTimeMillis())); if (this.producerName == null) { this.producerName=producerName; } if (!producerCreatedFuture.isDone() && isBatchMessagingEnabled()) { client.timer().newTimeout(batchMessageAndSendTask,conf.getBatchingMaxPublishDelayMs(),TimeUnit.MILLISECONDS); } resendMessages(cnx); } } )
to
cnx.sendRequestWithId(Commands.newProducer(topic,producerId,requestId,producerName),requestId).thenAccept(producerName -> { synchronized (ProducerImpl.this) { if (state.get() == State.Closing || state.get() == State.Closed) { cnx.removeProducer(producerId); cnx.channel().close(); return; } resetBackoff(); log.info("[{}] [{}] Created producer on cnx {}",topic,producerName,cnx.ctx().channel()); connectionId=cnx.ctx().channel().toString(); connectedSince=DATE_FORMAT.format(Instant.now()); if (this.producerName == null) { this.producerName=producerName; } if (!producerCreatedFuture.isDone() && isBatchMessagingEnabled()) { client.timer().newTimeout(batchMessageAndSendTask,conf.getBatchingMaxPublishDelayMs(),TimeUnit.MILLISECONDS); } resendMessages(cnx); } } )
DATE_FORMAT.format(new Date(ml.getLastLedgerCreatedTimestamp()))
to
DATE_FORMAT.format(Instant.ofEpochMilli(ml.getLastLedgerCreatedTimestamp()))
DATE_FORMAT.format(new Date(ml.getLastLedgerCreationFailureTimestamp()))
to
DATE_FORMAT.format(Instant.ofEpochMilli(ml.getLastLedgerCreationFailureTimestamp()))
DATE_FORMAT.format(new Date(cursor.getLastLedgerSwitchTimestamp()))
to
DATE_FORMAT.format(Instant.ofEpochMilli(cursor.getLastLedgerSwitchTimestamp()))
DATE_FORMAT.format(new Date(metadata.getPublishTime()))
to
DATE_FORMAT.format(Instant.ofEpochMilli(metadata.getPublishTime()))
consumer.receiveAsync().thenAccept(msg -> { if (log.isDebugEnabled()) { log.debug("[{}] [{}] [{}] Got message {}",getSession().getRemoteAddress(),topic,subscription,msg.getMessageId()); } ConsumerMessage dm=new ConsumerMessage(); dm.messageId=Base64.getEncoder().encodeToString(msg.getMessageId().toByteArray()); dm.payload=Base64.getEncoder().encodeToString(msg.getData()); dm.properties=msg.getProperties(); dm.publishTime=DATE_FORMAT.format(msg.getPublishTime()); if (msg.hasKey()) { dm.key=msg.getKey(); } try { getSession().getRemote().sendStringByFuture(ObjectMapperFactory.getThreadLocal().writeValueAsString(dm)); } catch ( JsonProcessingException e) { close(WebSocketError.FailedToSerializeToJSON); } int pending=pendingMessages.incrementAndGet(); if (pending < maxPendingMessages) { service.getExecutor().execute(() -> receiveMessage()); } } )
to
consumer.receiveAsync().thenAccept(msg -> { if (log.isDebugEnabled()) { log.debug("[{}] [{}] [{}] Got message {}",getSession().getRemoteAddress(),topic,subscription,msg.getMessageId()); } ConsumerMessage dm=new ConsumerMessage(); dm.messageId=Base64.getEncoder().encodeToString(msg.getMessageId().toByteArray()); dm.payload=Base64.getEncoder().encodeToString(msg.getData()); dm.properties=msg.getProperties(); dm.publishTime=DATE_FORMAT.format(Instant.ofEpochMilli(msg.getPublishTime())); if (msg.hasKey()) { dm.key=msg.getKey(); } try { getSession().getRemote().sendStringByFuture(ObjectMapperFactory.getThreadLocal().writeValueAsString(dm)); } catch ( JsonProcessingException e) { close(WebSocketError.FailedToSerializeToJSON); } int pending=pendingMessages.incrementAndGet(); if (pending < maxPendingMessages) { service.getExecutor().execute(() -> receiveMessage()); } } )
Cascading Type Change (Different)
Date
to
LocalDate
Update argument list (Method invocation)
parse
to
parse