Buggy code:
public void handleChangeButton ( ) { } public boolean isShapefileType ( FileMetadata fm ) { } public boolean hasMapLayerMetadata ( FileMetadata fm ) { } private boolean doesDataFileHaveMapLayerMetadata ( DataFile df ) { } public MapLayerMetadata getMapLayerMetadata ( DataFile df ) { } private void loadMapLayerMetadataLookup ( ) { } public String init ( ) { } public String saveGuestbookResponse ( ) { } private String getUserName ( User user ) { } public String getApiTokenKey ( ) { } private void resetVersionUI ( ) { } public void edit ( DatasetPage . EditMode editMode ) { } public String releaseDraft ( ) { } public String releaseDataset ( ) { } public String deaccessionDataset ( ) { } public String deaccessionVersions ( ) { } private DatasetVersion setDatasetVersionDeaccessionReasonAndURL ( DatasetVersion dvIn ) { } private String releaseDataset ( boolean minor ) { } public String registerDataset ( ) { } public void refresh ( ActionEvent e ) { } public void refresh ( ) { } public String deleteDataset ( ) { } public String deleteDatasetVersion ( ) { } private List < FileMetadata > selectedFiles ; public List < FileMetadata > getSelectedFiles ( ) { } public void setSelectedFiles ( List < FileMetadata > selectedFiles ) { } public String saveLinkedDataset ( ) { } public void restrictFiles ( boolean restricted ) { } public void deleteFiles ( ) { } private List < FileMetadata > filesToBeDeleted = new ArrayList ( ) ; public String save ( ) { } public String cancel ( ) { } public boolean isDuplicate ( FileMetadata fileMetadata ) { } private HttpClient getClient ( ) { } public void handleDropBoxUpload ( ActionEvent e ) { } public void handleFileUpload ( FileUploadEvent event ) { } public boolean isLocked ( ) { } public DatasetVersionUI getDatasetVersionUI ( ) { } private List < DatasetVersion > versionTabList = new ArrayList ( ) ; public List < DatasetVersion > getVersionTabList ( ) { } public Integer getCompareVersionsCount ( ) { } public void setVersionTabList ( List < DatasetVersion > versionTabList ) { } private List < DatasetVersion > releasedVersionTabList = new ArrayList ( ) ; public List < DatasetVersion > getReleasedVersionTabList ( ) { } public void setReleasedVersionTabList ( List < DatasetVersion > releasedVersionTabList ) { } private List < DatasetVersion > selectedVersions ; public List < DatasetVersion > getSelectedVersions ( ) { } public void setSelectedVersions ( List < DatasetVersion > selectedVersions ) { } private List < DatasetVersion > selectedDeaccessionVersions ; public List < DatasetVersion > getSelectedDeaccessionVersions ( ) { } public void setSelectedDeaccessionVersions ( List < DatasetVersion > selectedDeaccessionVersions ) { } public DatasetVersionDifference getDatasetVersionDifference ( ) { } public void setDatasetVersionDifference ( DatasetVersionDifference datasetVersionDifference ) { } public void initGuestbookResponse ( FileMetadata fileMetadata ) { } private List < SelectItem > setResponseUISelectItems ( CustomQuestion cq ) { } public void compareVersionDifferences ( ) { } public void updateVersionDifferences ( DatasetVersion newVersion , DatasetVersion originalVersion ) { } private boolean canIssueUpdateCommand ( ) { } private List < DatasetVersion > resetVersionTabList ( ) { } private String getContributorsNames ( DatasetVersion version ) { } private List < DatasetVersion > resetReleasedVersionTabList ( ) { } public void downloadDatasetCitationXML ( ) { } public void downloadDatafileCitationXML ( FileMetadata fileMetadata ) { } public void downloadCitationXML ( FileMetadata fileMetadata ) { } private String getFileNameDOI ( ) { } public void downloadDatasetCitationRIS ( ) { } public void downloadDatafileCitationRIS ( FileMetadata fileMetadata ) { } public void downloadCitationRIS ( FileMetadata fileMetadata ) { } public String getDataExploreURL ( ) { } public String getDataExploreURLComplete ( Long fileid ) { } public String getVariableMetadataURL ( Long fileid ) { } public String getTabularDataFileURL ( Long fileid ) { } private FileMetadata fileMetadataSelected = null ; public void setFileMetadataSelected ( FileMetadata fm ) { } public FileMetadata getFileMetadataSelected ( ) { } public void clearFileMetadataSelected ( ) { } private List < String > tabFileTags = null ; public List < String > getTabFileTags ( ) { } public void setTabFileTags ( List < String > tabFileTags ) { } private String [ ] selectedTags = new String [ ] { } ; public String [ ] getSelectedTags ( ) { } public void setSelectedTags ( String [ ] selectedTags ) { } public boolean getUseAsDatasetThumbnail ( ) { } public void setUseAsDatasetThumbnail ( boolean useAsThumbnail ) { } private String ingestLanguageEncoding = null ; public String getIngestLanguageEncoding ( ) { } public void setIngestLanguageEncoding ( String ingestLanguageEncoding ) { } public void setIngestEncoding ( String ingestEncoding ) { } private String savedLabelsTempFile = null ; public void handleLabelsFileUpload ( FileUploadEvent event ) { } private String saveTempFile ( InputStream input ) { } public void saveAdvancedOptions ( ) { } public String getFileDateToDisplay ( FileMetadata fileMetadata ) { } private String newCategoryName = null ; public String getNewCategoryName ( ) { } public void setNewCategoryName ( String newCategoryName ) { } public void addFileCategory ( ) { } public boolean isDownloadPopupRequired ( ) { } private Set < Long > downloadSelection = new HashSet < > ( ) ; public String getSelectedDownloadIds ( ) { <START_BUG> if ( ( ( this . downloadSelection ) == null ) || ( ( this . downloadSelection . size ( ) ) < 2 ) ) { <END_BUG> return null ; } Iterator itr = this . downloadSelection . iterator ( ) ; String retlist = null ; while ( itr . hasNext ( ) ) { Long fileId = ( ( Long ) ( itr . next ( ) ) ) ; if ( retlist == null ) { retlist = fileId . toString ( ) ; } else { retlist = ( retlist + "," ) + ( fileId . toString ( ) ) ; } } DatasetPage . logger . fine ( ( "ret<seq2seq4repair_space>list:<seq2seq4repair_space>" + retlist ) ) ; return retlist ; } public void updateDownloadSelected ( ValueChangeEvent event ) { } }

Fix:
if ( ( ( this . downloadSelection ) == null ) || ( ( this . downloadSelection . size ( ) ) < 1 ) ) {