Buggy code:
public class SelectPublicationStep extends AbstractProcessingStep { public static final int STATUS_INVALID_PUBLICATION_ID = 1 ; public static final int STATUS_LICENSE_NOT_ACCEPTED = 2 ; public static final int ERROR_SELECT_JOURNAL = 3 ; public static final int ERROR_INVALID_JOURNAL = 4 ; public static final int ERROR_PUBMED_DOI = 8 ; public static final int ERROR_GENERIC = 9 ; public static final int ERROR_PUBMED_NAME = 11 ; public static final int DISPLAY_MANUSCRIPT_NUMBER = 5 ; public static final int DISPLAY_CONFIRM_MANUSCRIPT_ACCEPTANCE = 6 ; public static final int ENTER_MANUSCRIPT_NUMBER = 7 ; public static final int ERROR_SELECT_COUNTRY = 10 ; private static Logger log = Logger . getLogger ( SelectPublicationStep . class ) ; public static final int ARTICLE_STATUS_PUBLISHED = 0 ; public static final int ARTICLE_STATUS_ACCEPTED = 1 ; public static final int ARTICLE_STATUS_IN_REVIEW = 2 ; public static final int ARTICLE_STATUS_NOT_YET_SUBMITTED = 3 ; public static final int UNKNOWN_DOI = 5 ; public static final int MANU_ACC = 6 ; public static final String crossRefApiRoot = "http:////api.crossref.org//works//" ; public static final String crossRefApiFormat = "//transform//application//vnd.crossref.unixref+xml" ; private static Map < String , DCValue > journalToMetadata = new HashMap < String , DCValue > ( ) ; public int doProcessing ( Context context , HttpServletRequest request , HttpServletResponse response , SubmissionInfo submissionInfo ) throws IOException , SQLException , ServletException , AuthorizeException { } private boolean processDOI ( Context context , Item item , String identifier ) { } private boolean processPubMed ( Context context , Item item , String identifier ) { } private Element retrieveXML ( String urls ) throws Exception { } private boolean isValidPubmedID ( String pmid ) { } private static boolean isAValidDOI ( Element element ) { } private void addEmailsAndEmbargoSettings ( Concept journalConcept , Item item ) { } private boolean processJournal ( String journalName , String journalShortID , String journalUuid , String manuscriptNumber , Item item , Context context , HttpServletRequest request , String articleStatus ) throws SQLException , AuthorizeException { Concept journalConcept = null ; if ( ( journalConcept == null ) && ( journalUuid != null ) ) { journalConcept = JournalUtils . getJournalConceptById ( context , journalUuid ) ; } if ( ( journalConcept == null ) && ( journalShortID != null ) ) { journalConcept = JournalUtils . getJournalConceptByShortID ( context , journalShortID ) ; } if ( ( journalConcept == null ) && ( journalName != null ) ) { journalConcept = JournalUtils . getJournalConceptByName ( context , journalName ) ; } if ( journalConcept != null ) { String title = journalConcept . getPreferredLabel ( ) ; <START_BUG> if ( ( JournalUtils . getBooleanIntegrated ( journalConcept ) ) || ( ( ( JournalUtils . getBooleanIntegrated ( journalConcept ) ) && ( manuscriptNumber != null ) ) && ( manuscriptNumber . trim ( ) . equals ( "" ) ) ) ) { <END_BUG> SelectPublicationStep . log . debug ( ( ( JournalUtils . getJournalShortID ( journalConcept ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>integrated<seq2seq4repair_space>OR<seq2seq4repair_space>manuscript<seq2seq4repair_space>number<seq2seq4repair_space>is<seq2seq4repair_space>null" ) ) ; if ( title . endsWith ( "*" ) ) { title = title . substring ( 0 , ( ( title . length ( ) ) - 1 ) ) ; } SelectPublicationStep . log . debug ( ( "adding<seq2seq4repair_space>journal<seq2seq4repair_space>title<seq2seq4repair_space>to<seq2seq4repair_space>item:<seq2seq4repair_space>" + title ) ) ; addEmailsAndEmbargoSettings ( journalConcept , item ) ; item . addMetadata ( "prism" , "publicationName" , null , null , title , journalConcept . getIdentifier ( ) , CF_ACCEPTED ) ; item . update ( ) ; } else { String journalPath = JournalUtils . getMetadataDir ( journalConcept ) ; SelectPublicationStep . log . debug ( ( "journalPath:<seq2seq4repair_space>" + journalPath ) ) ; String fileName = JournalUtils . unescapeFilename ( manuscriptNumber ) ; PublicationBean pBean = ModelPublication . getDataFromPublisherFile ( fileName , JournalUtils . getJournalShortID ( journalConcept ) , journalPath ) ; if ( pBean . getMessage ( ) . equals ( "" ) ) { if ( articleStatus != null ) { if ( ( Integer . parseInt ( articleStatus ) ) == ( SelectPublicationStep . ARTICLE_STATUS_ACCEPTED ) ) { if ( ( ( pBean . getStatus ( ) ) != null ) && ( ( pBean . getStatus ( ) . equals ( STATUS_IN_REVIEW ) ) || ( pBean . getStatus ( ) . equals ( STATUS_REJECTED ) ) ) ) { if ( pBean . getStatus ( ) . equals ( STATUS_IN_REVIEW ) ) { item . addMetadata ( WORKFLOW_SCHEMA , "submit" , "skipReviewStage" , ANY , "false" ) ; item . update ( ) ; } request . getSession ( ) . setAttribute ( "submit_error" , "Invalid<seq2seq4repair_space>manuscript<seq2seq4repair_space>number." ) ; return false ; } } else if ( ( Integer . parseInt ( articleStatus ) ) == ( SelectPublicationStep . ARTICLE_STATUS_IN_REVIEW ) ) { if ( ( ( pBean . getStatus ( ) ) != null ) && ( pBean . getStatus ( ) . equals ( STATUS_REJECTED ) ) ) { request . getSession ( ) . setAttribute ( "submit_error" , "Invalid<seq2seq4repair_space>manuscript<seq2seq4repair_space>number." ) ; return false ; } } } importJournalMetadata ( context , item , pBean ) ; addEmailsAndEmbargoSettings ( journalConcept , item ) ; item . update ( ) ; } else if ( pBean . getMessage ( ) . equals ( "Invalid<seq2seq4repair_space>manuscript<seq2seq4repair_space>number" ) ) { addEmailsAndEmbargoSettings ( journalConcept , item ) ; title = journalConcept . getPreferredLabel ( ) ; SelectPublicationStep . log . debug ( ( "invalid<seq2seq4repair_space>manuscript<seq2seq4repair_space>nubmer.<seq2seq4repair_space>Setting<seq2seq4repair_space>journal<seq2seq4repair_space>title<seq2seq4repair_space>to:<seq2seq4repair_space>" + title ) ) ; addSingleMetadataValueFromJournal ( context , item , "journalName" , title ) ; addSingleMetadataValueFromJournal ( context , item , "manuscriptNumber" , manuscriptNumber ) ; item . update ( ) ; } else { request . getSession ( ) . setAttribute ( "submit_error" , pBean . getMessage ( ) ) ; return false ; } } } else { SelectPublicationStep . log . debug ( ( "adding<seq2seq4repair_space>unknown<seq2seq4repair_space>journal<seq2seq4repair_space>title<seq2seq4repair_space>to<seq2seq4repair_space>item:<seq2seq4repair_space>" + journalName ) ) ; item . addMetadata ( "prism" , "publicationName" , null , null , journalName ) ; item . update ( ) ; } return true ; }

Fix:
if ( ( ! ( JournalUtils . getBooleanIntegrated ( journalConcept ) ) ) || ( ( ( JournalUtils . getBooleanIntegrated ( journalConcept ) ) && ( manuscriptNumber != null ) ) && ( manuscriptNumber . trim ( ) . equals ( "" ) ) ) ) {