sonatype-lift[bot] commented on code in PR #1979: URL: https://github.com/apache/zookeeper/pull/1979#discussion_r1097578524
########## zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java: ########## @@ -207,7 +207,7 @@ public boolean parseOptions(String[] args) { public boolean parseCommand(String cmdstring) { Matcher matcher = ARGS_PATTERN.matcher(cmdstring); - List<String> args = new LinkedList<String>(); + List<String> args = new LinkedList<>(); Review Comment: <picture><img alt="16% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/16/display.svg"></picture> *[JdkObsolete](https://errorprone.info/bugpattern/JdkObsolete):* It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not. --- ```suggestion List<String> args = new ArrayList<>(); ``` --- <details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary> You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings. | **Command** | **Usage** | | ------------- | ------------- | | `@sonatype-lift ignore` | Leave out the above finding from this PR | | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR | | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file | **Note:** When talking to LiftBot, you need to **refresh** the page to see its response. <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details> --- Was this a good recommendation? [ [đ Not relevant](https://www.sonatype.com/lift-comment-rating?comment=382039739&lift_comment_rating=1) ] - [ [đ Won't fix](https://www.sonatype.com/lift-comment-rating?comment=382039739&lift_comment_rating=2) ] - [ [đ Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=382039739&lift_comment_rating=3) ] - [ [đ Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=382039739&lift_comment_rating=4) ] - [ [đ Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=382039739&lift_comment_rating=5) ] ########## zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java: ########## @@ -781,7 +781,7 @@ public List<ACL> getACL(String path, Stat stat) throws KeeperException.NoNodeExc if (stat != null) { n.copyStat(stat); } - return new ArrayList<ACL>(aclCache.convertLong(n.acl)); + return new ArrayList<>(aclCache.convertLong(n.acl)); Review Comment: <picture><img alt="5% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/5/display.svg"></picture> *THREAD_SAFETY_VIOLATION:* Read/Write race. Non-private method `DataTree.getACL(...)` indirectly reads with synchronization from container `this.aclCache.longKeyMap` via call to `Map.get(...)`. Potentially races with unsynchronized write in method `DataTree.deserialize(...)`. Reporting because this access may occur on a background thread. --- <details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary> You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings. | **Command** | **Usage** | | ------------- | ------------- | | `@sonatype-lift ignore` | Leave out the above finding from this PR | | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR | | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file | **Note:** When talking to LiftBot, you need to **refresh** the page to see its response. <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details> --- Was this a good recommendation? [ [đ Not relevant](https://www.sonatype.com/lift-comment-rating?comment=382042639&lift_comment_rating=1) ] - [ [đ Won't fix](https://www.sonatype.com/lift-comment-rating?comment=382042639&lift_comment_rating=2) ] - [ [đ Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=382042639&lift_comment_rating=3) ] - [ [đ Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=382042639&lift_comment_rating=4) ] - [ [đ Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=382042639&lift_comment_rating=5) ] -- 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: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org