-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix hugegraph-api code checkstyle #1845
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1845 +/- ##
============================================
- Coverage 66.93% 66.92% -0.02%
- Complexity 444 731 +287
============================================
Files 446 446
Lines 37966 37948 -18
Branches 5410 5410
============================================
- Hits 25413 25397 -16
+ Misses 9957 9956 -1
+ Partials 2596 2595 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution~ 👍🏻
seems a lot of the code style conflict, maybe we could use a unified rule before change it
@@ -155,7 +151,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { | |||
private void sendError(ChannelHandlerContext ctx, Object msg) { | |||
// Close the connection as soon as the error message is sent. | |||
ctx.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1, UNAUTHORIZED)) | |||
.addListener(ChannelFutureListener.CLOSE); | |||
.addListener(ChannelFutureListener.CLOSE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should keep the origin align?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the current style check specify that the code indented in multiples of 4,so we need to decide which style to use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the current style check specify that the code indented in multiples of 4,so we need to decide which style to use
yep, we'll discuss this issue in the developer group, ensure the rule
Charset.forName("UTF-8")); | ||
StandardCharsets.UTF_8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use the hugegraph-style
in the wiki (not java original style)
align the param with the highly priority
import static io.netty.handler.codec.http.HttpHeaderNames.CONNECTION; | ||
import static io.netty.handler.codec.http.HttpHeaderNames.UPGRADE; | ||
import static io.netty.handler.codec.http.HttpResponseStatus.UNAUTHORIZED; | ||
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; | ||
import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraphTokens.PROPERTY_PASSWORD; | ||
import static org.apache.tinkerpop.gremlin.groovy.jsr223.dsl.credential.CredentialGraphTokens.PROPERTY_USERNAME; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so as these import rules, u could refer the style file in root dir to improve them
System.out.println(notEmptyPrompt); | ||
LOG.info(notEmptyPrompt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems it don't print in the log file (print on the console is right?) @javeme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we need System.out sometimes like when using the console
@@ -1757,7 +1731,7 @@ public static class ContextThreadPoolExecutor extends ThreadPoolExecutor { | |||
public ContextThreadPoolExecutor(int corePoolSize, int maxPoolSize, | |||
ThreadFactory threadFactory) { | |||
super(corePoolSize, maxPoolSize, 0L, TimeUnit.MILLISECONDS, | |||
new LinkedBlockingQueue<Runnable>(), threadFactory); | |||
new LinkedBlockingQueue<>(), threadFactory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep the origin align~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
Open a new vote in #1848. we could discuss there. |
|
||
static { | ||
MetricsUtil.registerGauge(RestServer.class, "batch-write-threads", | ||
() -> batchWriteThreads.intValue()); | ||
BATCH_WRITE_THREADS::intValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align with RestServer
@@ -254,7 +248,7 @@ public static class UserJson { | |||
} | |||
} | |||
|
|||
public static class RolePerm { | |||
class RolePerm { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer to keep public static class
@@ -394,7 +388,7 @@ public static boolean match(Object role, RolePermission grant, | |||
} | |||
} | |||
|
|||
public static class RequiredPerm { | |||
class RequiredPerm { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer to keep public static class
|
||
private static final Set<String> PROTECT_METHODS = ImmutableSet.of( | ||
"instance"); | ||
"instance"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align with ImmutableSet
return verifySchemaPermission(HugePermission.READ, () -> { | ||
return this.hugegraph.propertyKey(key); | ||
}); | ||
return verifySchemaPermission(HugePermission.READ, () -> this.hugegraph.propertyKey(key)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer to keep origin style for debug and readability
System.out.println(notEmptyPrompt); | ||
LOG.info(notEmptyPrompt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we need System.out sometimes like when using the console
rt