def get_filename(directory_path):
    """
    For ./infer-out/captured directories with no child HTML
        get its filename from directory path
    Args:
        directory_path: path to a directory
                        with no child HTML
    Returns:
        The modified filename
    """
    # Get file.java.hashcode from dir1/dir2/file.java.hashcode
    fields = directory_path.split("/")
    # Get file.java from filename.java.hashcode
    filename_parts = fields[3].split(".")
    filename = filename_parts[0] + "." + filename_parts[1]

    return filename