Buggy code:
public class PublicationsHelper { private static final Logger logger = Logger . getLogger ( PublicationsHelper . class ) ; private final DLibraDataSource dLibra ; private final PublicationManager publicationManager ; private final DirectoryManager directoryManager ; private final UserManager userManager ; private final FileManager fileManager ; public PublicationsHelper ( DLibraDataSource dLibraDataSource ) throws RemoteException { } public List < AbstractPublicationInfo > listUserGroupPublications ( byte groupState ) throws RemoteException , DLibraException { } public void createGroupPublication ( String groupPublicationName ) throws RemoteException , DLibraException { } public void createGroupPublication ( String parentName , String publicationName ) throws RemoteException , DLibraException { } public void deleteGroupPublication ( String groupPublicationName ) throws RemoteException , DLibraException { } public List < PublicationInfo > listPublicationsInGroup ( String groupPublicationName ) throws RemoteException , DLibraException { } public void createPublication ( String groupPublicationName , String publicationName , String basePublicationName ) throws IOException , TransformerException , DLibraException { } public void publishPublication ( String groupPublicationName , String publicationName ) throws RemoteException , DLibraException { } public void unpublishPublication ( String groupPublicationName , String publicationName ) throws RemoteException , DLibraException { } private Publication getNewPublication ( String publicationName , PublicationId groupId , byte groupStatus ) throws RemoteException , DLibraException { } private EditionId preparePublicationAsNew ( String groupPublicationName , String publicationName , PublicationId publicationId ) throws IOException , RemoteException , TransformerException , AccessDeniedException , DLibraException , IdNotFoundException { } private void preparePublicationAsACopy ( String groupPublicationName , String publicationName , PublicationId publicationId , String basePublicationName , PublicationId basePublicationId ) throws IOException , RemoteException , TransformerException , AccessDeniedException , DLibraException , IdNotFoundException { } public void deletePublication ( String groupPublicationName , String publicationName ) throws IOException , TransformerException , DLibraException { } PublicationId getGroupId ( String groupPublicationName ) throws RemoteException , DLibraException { } PublicationId getPublicationId ( PublicationId groupId , String publicationName ) throws RemoteException , DLibraException { <START_BUG> Collection < Info > resultInfos = publicationManager . getObjects ( new pl . psnc . dlibra . metadata . PublicationFilter ( null , groupId ) . setGroupStatus ( PUB_GROUP_LEAF ) . setPublicationState ( ( ( byte ) ( ( Publication . PUB_STATE_ALL ) - ( Publication . PUB_STATE_PERMANENT_DELETED ) ) ) ) , new OutputFilter ( AbstractPublicationInfo . class ) ) . getResultInfos ( ) ; <END_BUG> for ( Info info : resultInfos ) { if ( info . getLabel ( ) . equals ( publicationName ) ) { return ( ( PublicationId ) ( info . getId ( ) ) ) ; } } throw new IdNotFoundException ( publicationName ) ; } public PublicationId getPublicationId ( String groupPublicationName , String publicationName ) throws RemoteException , DLibraException { } private DirectoryId getWorkspaceDirectoryId ( ) throws RemoteException , DLibraException { } public InputStream getZippedPublication ( String groupPublicationName , String publicationName ) throws RemoteException , DLibraException { } public InputStream getZippedPublication ( EditionId editionId ) throws RemoteException , DLibraException { } }

Fix:
Collection < Info > resultInfos = publicationManager . getObjects ( new pl . psnc . dlibra . metadata . PublicationFilter ( null , groupId ) . setGroupStatus ( PUB_GROUP_ALL ) . setPublicationState ( ( ( byte ) ( ( Publication . PUB_STATE_ALL ) - ( Publication . PUB_STATE_PERMANENT_DELETED ) ) ) ) , new OutputFilter ( AbstractPublicationInfo . class ) ) . getResultInfos ( ) ;