javeme commented on code in PR #1842:
URL:
https://github.com/apache/incubator-hugegraph/pull/1842#discussion_r867430409
##########
hugegraph-test/src/main/java/com/baidu/hugegraph/unit/core/SecurityManagerTest.java:
##########
@@ -119,15 +119,21 @@ public void testExit() {
@Test
public void testFile() {
// read file
- try (FileInputStream fis = new FileInputStream(new File(""))) {
- } catch (IOException ignored) {}
+ try {
+ FileInputStream fis = new FileInputStream(new File(""));
Review Comment:
the original way is to rely on the automatic close mechanism, can we try:
```java
try (FileInputStream fis = new FileInputStream(new File(""))) {
// pass
} catch (IOException ignored) {
// ignored exception
}
```
##########
hugegraph-test/src/main/java/com/baidu/hugegraph/unit/cache/CachedGraphTransactionTest.java:
##########
@@ -209,7 +210,8 @@ public void testEdgeCacheClearWhenUpdateVertex() {
Whitebox.invoke(cache, "edgesCache", "size"));
cache.addVertexProperty(new HugeVertexProperty<>(v1,
-
cache.graph().schema().getPropertyKey("name"),
+ cache.graph().schema()
+
.getPropertyKey("name"),
Review Comment:
can align with `.graph()`
##########
hugegraph-test/src/main/java/com/baidu/hugegraph/unit/core/SecurityManagerTest.java:
##########
@@ -173,7 +182,11 @@ public void testSocket() throws IOException {
* NOTE: if remove this, gremlin job will call
System.loadLibrary("net")
* then throw exception because checkLink failed
*/
- try (ServerSocket serverSocket = new ServerSocket(8200)) {}
+ try {
+ ServerSocket serverSocket = new ServerSocket(8200);
Review Comment:
ditto
--
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]