Skip to content

Commit 0c07865

Browse files
authored
Fix the always null in log (#122)
1 parent 146dc04 commit 0c07865

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pathdb/datastax/src/main/java/org/commonjava/storage/pathmapped/pathdb/datastax/CassandraPathDB.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,12 @@ public boolean delete( String fileSystem, String path, boolean force )
632632
PathMap pathMap = getPathMap( fileSystem, path );
633633
if ( pathMap == null )
634634
{
635-
logger.debug( "File not exists, {}", pathMap );
635+
logger.debug( "File or directory not exists, {}", path );
636636
return true;
637637
}
638638

639639
String fileId = pathMap.getFileId();
640-
if ( fileId == null )
640+
if ( fileId == null ) // dir
641641
{
642642
// force or empty dir
643643
if ( force || isEmptyDirectory( fileSystem, path ) )
@@ -689,8 +689,8 @@ private void postDeletionActions(String fileSystem, String path, PathMap pathMap
689689

690690
private boolean isEmptyDirectory( String fileSystem, String path )
691691
{
692-
path = PathMapUtils.normalizeParentPath( path );
693-
BoundStatement bound = preparedListCheckEmpty.bind( fileSystem, path );
692+
String normalized = PathMapUtils.normalizeParentPath( path );
693+
BoundStatement bound = preparedListCheckEmpty.bind( fileSystem, normalized );
694694
ResultSet result = executeSession( bound );
695695
Row row = result.one();
696696
boolean empty = false;
@@ -699,7 +699,7 @@ private boolean isEmptyDirectory( String fileSystem, String path )
699699
long count = row.get( 0, Long.class );
700700
empty = count <= 0;
701701
}
702-
logger.trace( "Dir '{}' is {} in fileSystem '{}'", path, ( empty ? "empty" : "not empty" ), fileSystem );
702+
logger.trace( "Dir '{}' is {} in fileSystem '{}'", normalized, ( empty ? "empty" : "not empty" ), fileSystem );
703703
return empty;
704704
}
705705

0 commit comments

Comments
 (0)