Pil0tXia commented on code in PR #4447:
URL: https://github.com/apache/eventmesh/pull/4447#discussion_r1331728117
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/config/FileLoad.java:
##########
@@ -70,13 +70,15 @@ class PropertiesFileLoad implements FileLoad {
public <T> T getConfig(ConfigInfo configInfo) throws IOException {
final Properties properties = new Properties();
if (StringUtils.isNotBlank(configInfo.getResourceUrl())) {
- try (BufferedReader reader = new BufferedReader(new
InputStreamReader(
-
Objects.requireNonNull(getClass().getResourceAsStream(configInfo.getResourceUrl())),
Constants.DEFAULT_CHARSET))) {
+ try (
+ BufferedReader reader = new BufferedReader(new
InputStreamReader(
+
Objects.requireNonNull(getClass().getResourceAsStream(configInfo.getResourceUrl())),
Constants.DEFAULT_CHARSET))) {
properties.load(reader);
Review Comment:
May you please resolve this kind of redundant line breaks?
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/config/ConfigService.java:
##########
@@ -149,8 +149,7 @@ public <T> T getConfig(ConfigInfo configInfo) throws
IOException {
return (T) object;
}
- private void populateConfig(Object object, Class<?> clazz, Config config)
- throws NoSuchFieldException, IOException, IllegalAccessException {
+ private void populateConfig(Object object, Class<?> clazz, Config config)
throws NoSuchFieldException, IOException, IllegalAccessException {
ConfigInfo configInfo = new ConfigInfo();
configInfo.setField(config.field());
Review Comment:
Manual line breaks applyed to method signature should not be removed.
##########
eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/RemoteSubscribeInstance.java:
##########
@@ -66,7 +66,8 @@ private static void subscribeRemote() {
private static void unsubscribeRemote() {
final RequestParam subscribeParam = buildCommonRequestParam()
- .addBody(SubscribeRequestBody.TOPIC,
JsonUtils.toJSONString(Collections.singletonList(ExampleConstants.EVENTMESH_HTTP_ASYNC_TEST_TOPIC)))
+ .addBody(SubscribeRequestBody.TOPIC,
+
JsonUtils.toJSONString(Collections.singletonList(ExampleConstants.EVENTMESH_HTTP_ASYNC_TEST_TOPIC)))
.addBody(SubscribeRequestBody.CONSUMERGROUP,
ExampleConstants.DEFAULT_EVENTMESH_TEST_CONSUMER_GROUP)
Review Comment:
Is this line break added manually by you or is it an Soptless process that
adds it? The length of this line didn't exceed the limit.
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/ThreadPoolFactory.java:
##########
@@ -35,26 +35,25 @@ public static ThreadPoolExecutor
createThreadPoolExecutor(int core, int max, fin
}
public static ThreadPoolExecutor createThreadPoolExecutor(int core, int
max, final String threadName,
- final boolean isDaemon) {
+ final boolean
isDaemon) {
return createThreadPoolExecutor(core, max, new
LinkedBlockingQueue<>(1000), threadName, isDaemon);
}
public static ThreadPoolExecutor createThreadPoolExecutor(int core, int
max, BlockingQueue<Runnable> blockingQueue,
- final String threadName, final boolean isDaemon) {
+ final String
threadName, final boolean isDaemon) {
return new ThreadPoolExecutor(core, max, 10 * 1000,
TimeUnit.MILLISECONDS, blockingQueue,
Review Comment:
I am afraid that aligning the parameters of the second line forcibly with
the starting point of the first line parameters may result in all the
parameters being piled up on the right side, especially when the method name is
long. This requires the community for their opinions.
Furthermore, when coding with IDEA, IDE will align the parameters of the
second line with the method name. Developers may place multiple parameters on
the second line, which can be passed by the CheckStyle plugin. However, when
the code is committed, Spotless will shift the parameters of the second line to
the right, causing the second line to exceed the length limit and consequently
causing the CheckStyle CI check to fail.
##########
eventmesh-connectors/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/source/connector/RocketMQSourceConnector.java:
##########
@@ -273,7 +273,7 @@ private long removeMessage(MessageQueue mq, long offset) {
private void execScheduleTask() {
commitOffsetScheduleService.scheduleAtFixedRate(this::commitOffsetSchedule,
sourceConfig.connectorConfig.getCommitOffsetIntervalMs(),
- sourceConfig.connectorConfig.getCommitOffsetIntervalMs(),
TimeUnit.MILLISECONDS);
+ sourceConfig.connectorConfig.getCommitOffsetIntervalMs(),
TimeUnit.MILLISECONDS);
}
Review Comment:
additional indentation.
##########
eventmesh-connectors/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/source/connector/RocketMQSourceConnector.java:
##########
@@ -220,7 +220,7 @@ public List<ConnectRecord> poll() {
byte[] body = messageExt.getBody();
String bodyStr = new String(body, StandardCharsets.UTF_8);
RecordPartition recordPartition =
convertToRecordPartition(messageExt.getTopic(),
- messageExt.getBrokerName(), messageExt.getQueueId());
+ messageExt.getBrokerName(), messageExt.getQueueId());
RecordOffset recordOffset =
convertToRecordOffset(messageExt.getQueueOffset());
Review Comment:
There is still additional indentation here. Is it because the rules didn't
cover it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]