public void removeAttributeListener(DownloadAttributeListener listener, TorrentAttribute attr, int event_type) {
String attribute = convertAttribute(attr);
if (attribute == null) {return;}
CopyOnWriteMap attr_map = this.getAttributeMapForType(event_type);
CopyOnWriteList listener_list = (CopyOnWriteList)attr_map.get(attribute);
boolean remove_self = false;
if (listener_list != null) {
listener_list.remove(listener);
remove_self = listener_list.isEmpty();
}
if (remove_self) {
download_manager.getDownloadState().removeListener(this, attribute, event_type);
}