Buggy code:
public List < BlackboardArtifact > getBlackboardArtifacts ( ARTIFACT_TYPE artifactType , BlackboardAttribute . ATTRIBUTE_TYPE attrType , String value ) throws TskCoreException { } public BlackboardArtifact getBlackboardArtifact ( long artifactID ) throws TskCoreException { } public void addBlackboardAttribute ( BlackboardAttribute attr , int artifactTypeId ) throws TskCoreException { } public void addBlackboardAttributes ( Collection < BlackboardAttribute > attributes , int artifactTypeId ) throws TskCoreException { } private void addBlackBoardAttribute ( BlackboardAttribute attr , int artifactTypeId , SleuthkitCase . CaseDbConnection connection ) throws SQLException , TskCoreException { } public int addAttrType ( String attrTypeString , String displayName ) throws TskCoreException { } public int getAttrTypeID ( String attrTypeName ) throws TskCoreException { } public String getAttrTypeString ( int attrTypeID ) throws TskCoreException { } public String getAttrTypeDisplayName ( int attrTypeID ) throws TskCoreException { } public int getArtifactTypeID ( String artifactTypeName ) throws TskCoreException { } String getArtifactTypeString ( int artifactTypeID ) throws TskCoreException { } String getArtifactTypeDisplayName ( int artifactTypeID ) throws TskCoreException { } public int addArtifactType ( String artifactTypeName , String displayName ) throws TskCoreException { } public ArrayList < BlackboardAttribute > getBlackboardAttributes ( final BlackboardArtifact artifact ) throws TskCoreException { } public ArrayList < BlackboardAttribute > getMatchingAttributes ( String whereClause ) throws TskCoreException { } public ArrayList < BlackboardArtifact > getMatchingArtifacts ( String whereClause ) throws TskCoreException { } public BlackboardArtifact newBlackboardArtifact ( int artifactTypeID , long obj_id ) throws TskCoreException { } public BlackboardArtifact newBlackboardArtifact ( ARTIFACT_TYPE artifactType , long obj_id ) throws TskCoreException { } private BlackboardArtifact newBlackboardArtifact ( int artifact_type_id , long obj_id , String artifactTypeName , String artifactDisplayName ) throws TskCoreException { } boolean getContentHasChildren ( Content content ) throws TskCoreException { } int getContentChildrenCount ( Content content ) throws TskCoreException { } List < Content > getAbstractFileChildren ( Content parent , TSK_DB_FILES_TYPE_ENUM type ) throws TskCoreException { } List < Content > getAbstractFileChildren ( Content parent ) throws TskCoreException { } List < Long > getAbstractFileChildrenIds ( Content parent , TSK_DB_FILES_TYPE_ENUM type ) throws TskCoreException { } List < Long > getAbstractFileChildrenIds ( Content parent ) throws TskCoreException { } static class ObjectInfo { long id ; ObjectType type ; ObjectInfo ( long id , ObjectType type ) { } } Collection < SleuthkitCase . ObjectInfo > getChildrenInfo ( Content c ) throws TskCoreException { } SleuthkitCase . ObjectInfo getParentInfo ( Content c ) throws TskCoreException { } SleuthkitCase . ObjectInfo getParentInfo ( long contentId ) throws TskCoreException { } Directory getParentDirectory ( FsContent fsc ) throws TskCoreException { } public Content getContentById ( long id ) throws TskCoreException { } String getFilePath ( long id ) { } String getFileParentPath ( long id ) { } String getFileName ( long id ) { } DerivedMethod getDerivedMethod ( long id ) throws TskCoreException { } public AbstractFile getAbstractFileById ( long id ) throws TskCoreException { } private long getFileSystemId ( long fileId ) { } public boolean isFileFromSource ( Content dataSource , long fileId ) throws TskCoreException { } public List < AbstractFile > findFiles ( Content dataSource , String fileName ) throws TskCoreException { } public List < AbstractFile > findFiles ( Content dataSource , String fileName , String dirName ) throws TskCoreException { } public VirtualDirectory addVirtualDirectory ( long parentId , String directoryName ) throws TskCoreException { } public VirtualDirectory addVirtualDirectory ( long parentId , String directoryName , SleuthkitCase . CaseDbTransaction trans ) throws TskCoreException { } public List < VirtualDirectory > getVirtualDirectoryRoots ( ) throws TskCoreException { } public LayoutFile addCarvedFile ( String carvedFileName , long carvedFileSize , long containerId , List < TskFileRange > data ) throws TskCoreException { } public List < LayoutFile > addCarvedFiles ( List < CarvedFileContainer > filesToAdd ) throws TskCoreException { } public DerivedFile addDerivedFile ( String fileName , String localPath , long size , long ctime , long crtime , long atime , long mtime , boolean isFile , AbstractFile parentFile , String rederiveDetails , String toolName , String toolVersion , String otherDetails ) throws TskCoreException { SleuthkitCase . CaseDbConnection connection = connections . getConnection ( ) ; acquireExclusiveLock ( ) ; ResultSet rs = null ; try { connection . beginTransaction ( ) ; final long parentId = parentFile . getId ( ) ; <START_BUG> final String parentPath = ( ( ( parentFile . getParentPath ( ) ) + "//" ) + ( parentFile . getName ( ) ) ) + '//' ; <END_BUG> PreparedStatement statement = connection . getPreparedStatement ( SleuthkitCase . CaseDbConnection . PREPARED_STATEMENT . INSERT_OBJECT , Statement . RETURN_GENERATED_KEYS ) ; statement . clearParameters ( ) ; statement . setLong ( 1 , parentId ) ; statement . setLong ( 2 , ABSTRACTFILE . getObjectType ( ) ) ; connection . executeUpdate ( statement ) ; rs = statement . getGeneratedKeys ( ) ; rs . next ( ) ; long newObjId = rs . getLong ( 1 ) ; rs . close ( ) ; rs = null ; statement = connection . getPreparedStatement ( SleuthkitCase . CaseDbConnection . PREPARED_STATEMENT . INSERT_FILE ) ; statement . clearParameters ( ) ; statement . setLong ( 1 , newObjId ) ; long fsObjId = this . getFileSystemId ( parentId ) ; if ( fsObjId != ( - 1 ) ) { statement . setLong ( 2 , fsObjId ) ; } else { statement . setNull ( 2 , Types . BIGINT ) ; } statement . setString ( 3 , fileName ) ; statement . setShort ( 4 , DERIVED . getFileType ( ) ) ; statement . setShort ( 5 , ( ( short ) ( 1 ) ) ) ; final TSK_FS_NAME_TYPE_ENUM dirType = ( isFile ) ? TSK_FS_NAME_TYPE_ENUM . REG : TSK_FS_NAME_TYPE_ENUM . DIR ; statement . setShort ( 6 , dirType . getValue ( ) ) ; final TSK_FS_META_TYPE_ENUM metaType = ( isFile ) ? TSK_FS_META_TYPE_ENUM . TSK_FS_META_TYPE_REG : TSK_FS_META_TYPE_ENUM . TSK_FS_META_TYPE_DIR ; statement . setShort ( 7 , metaType . getValue ( ) ) ; final TSK_FS_NAME_FLAG_ENUM dirFlag = TSK_FS_NAME_FLAG_ENUM . ALLOC ;

Fix:
final String parentPath = ( ( parentFile . getParentPath ( ) ) + ( parentFile . getName ( ) ) ) + '//' ;