public void updateBean(AlbumBean newBean, AlbumBean oldBean) throws LibraryException { synchronized (libraryList) { // Find the bean int index = libraryList.indexOf(oldBean); if (index == -1) { LibraryException le = new LibraryException(Utils.getResourceString(ERROR_BEAN_NOT_FOUND)); throw le; } // Set the new bean libraryList.set(index, newBean); setChanged(); fireLibraryChangeEvent( new LibraryChangeEvent(this, new AlbumBean[] {oldBean}, LibraryChangeEvent.UPDATE)); } }