Buggy code:
@ Singleton public class RegistryImpl implements Registry { public static final Id ANYONE_ID = new Id ( "world" , "anyone" ) ; public static final ArrayList < ACL > DEFAULT_ACL = new ArrayList < ACL > ( Collections . singletonList ( new ACL ( Perms . ALL , RegistryImpl . ANYONE_ID ) ) ) ; @ Inject private RegistryConfig config ; private ZooKeeper zkClient ; public RegistryImpl ( ) { } public RegistryImpl ( RegistryConfig config ) { } public RegistryConfig getRegistryConfig ( ) { } public ZooKeeper getZkClient ( ) { } public String getSessionId ( ) { } @ Inject public void init ( ) throws RegistryException { } @ Override public Registry connect ( ) throws RegistryException { } @ Override public Registry connect ( long timeout ) throws RegistryException { } @ Override public void disconnect ( ) throws RegistryException { } public void checkConnected ( ) throws RegistryException { } @ Override public boolean isConnect ( ) { } @ Override public Node create ( String path , NodeCreateMode mode ) throws RegistryException { } @ Override public void createRef ( String path , String toPath , NodeCreateMode mode ) throws RegistryException { } @ Override public Node create ( String path , byte [ ] data , NodeCreateMode mode ) throws RegistryException { } @ Override public < T > Node create ( String path , T data , NodeCreateMode mode ) throws RegistryException { } @ Override public Node createIfNotExist ( String path ) throws RegistryException { } @ Override public Node get ( String path ) throws RegistryException { } @ Override public Node getRef ( String path ) throws RegistryException { } @ Override public byte [ ] getData ( String path ) throws RegistryException { } @ Override public < T > T getDataAs ( String path , Class < T > type ) throws RegistryException { } public < T > T getDataAs ( String path , Class < T > type , DataMapperCallback < T > mapper ) throws RegistryException { } @ Override public < T > List < T > getDataAs ( List < String > paths , Class < T > type ) throws RegistryException { } @ Override public < T > List < T > getDataAs ( List < String > paths , Class < T > type , DataMapperCallback < T > mapper ) throws RegistryException { } public void setData ( String path , byte [ ] data ) throws RegistryException { } public < T > void setData ( String path , T data ) throws RegistryException { } public List < String > getChildren ( String path ) throws RegistryException { } public List < String > getChildrenPath ( String path ) throws RegistryException { } public List < String > getChildren ( String path , boolean watch ) throws RegistryException { } public < T > List < T > getChildrenAs ( String path , Class < T > type ) throws RegistryException { } @ Override public < T > List < T > getChildrenAs ( String path , Class < T > type , DataMapperCallback < T > callback ) throws RegistryException { } @ Override public < T > List < T > getRefChildrenAs ( String path , Class < T > type ) throws RegistryException { } @ Override public boolean exists ( String path ) throws RegistryException { } @ Override public void watchModify ( String path , NodeWatcher watcher ) throws RegistryException { } @ Override public void watchExists ( String path , NodeWatcher watcher ) throws RegistryException { } @ Override public void watchChildren ( String path , NodeWatcher watcher ) throws RegistryException { } @ Override public void delete ( String path ) throws RegistryException { } @ Override public void rdelete ( String path ) throws RegistryException { } public List < String > findDencendantPaths ( String path ) throws RegistryException { checkConnected ( ) ; try { <START_BUG> PathUtils . validatePath ( path ) ; <END_BUG> return ZKUtil . listSubTreeBFS ( zkClient , realPath ( path ) ) ; } catch ( InterruptedException | KeeperException e ) { throw new RegistryException ( ErrorCode . Unknown , e ) ; } } public void rcopy ( String path , String toPath ) throws RegistryException { } @ Override public Transaction getTransaction ( ) { } public < T > T executeBatch ( BatchOperations < T > ops , int retry , long timeoutThreshold ) throws RegistryException { } @ Override public Registry newRegistry ( ) throws RegistryException { } private void zkCreateIfNotExist ( String path ) throws RegistryException { } static CreateMode toCreateMode ( NodeCreateMode mode ) { } String realPath ( String path ) { } private RegistryException toRegistryException ( String message , Throwable t ) { } @ PreDestroy public void onDestroy ( ) throws RegistryException { } No newline ; at end ; of file ; }

Fix:
PathUtils . validatePath ( realPath ( path ) ) ;