auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void controlReplicationForPartitions(List<? extends PartitionId> ids, boolean enable) { lock.lock(); try { for (PartitionId id : ids) { if (replicatedPartitions.contains(id)) { if (enable) { replicationDisabledPartitions.remove(id); allDisabled = false; pauseCondition.signal(); } else { replicationDisabledPartitions.add(id); allDisabled = replicatedPartitions.size() == replicationDisabledPartitions.size(); } logger.info("Enable status of replication of from is {}. allDisabled for is {}", id, datacenterName, replicationDisabledPartitions.contains(id), getName(), allDisabled); } } } finally { lock.unlock(); } }

Target:
void controlReplicationForPartitions(List<? extends PartitionId> ids, boolean enable) { lock.lock(); try { for (PartitionId id : ids) { if (allReplicatedPartitions.contains(id)) { if (enable) { if (replicationDisabledPartitions.remove(id)) { allDisabled = false; pauseCondition.signal(); } } else { replicationDisabledPartitions.add(id); allDisabled = allReplicatedPartitions.size() == replicationDisabledPartitions.size(); } logger.info("Enable status of replication of from is {}. allDisabled for is {}", id, datacenterName, replicationDisabledPartitions.contains(id), getName(), allDisabled); } } } finally { lock.unlock(); } }
Source:
public SSDate resetTime() { this.setHours(0); this.setMinutes(0); this.setSeconds(0); return this; }

Target:
public void resetTime() { this.setHours(0); this.setMinutes(0); this.setSeconds(0); }
Source:
private boolean readFirstLine() throws IOException { is0D0Amode = false; String line; do { line = readLine(); if (line == null) { return false; } } while (ignoreEmptyLines && line.isEmpty() || (commentMatcher != null && commentMatcher.isComment(line))); currentRow.append(line); return true; }

Target:
private boolean readFirstLine() throws IOException { String line; do { line = readLine(); if (line == null) { return false; } } while (ignoreEmptyLines && line.isEmpty() || (commentMatcher != null && commentMatcher.isComment(line))); currentRow.append(line); return true; }
Source:
public void addPartitions(String databaseName, String tableName, List<PartitionDescProto> partitions, boolean ifNotExists) throws UndefinedTableException, DuplicatePartitionException, UndefinedPartitionMethodException { try { final BlockingInterface stub = getStub(); final AddPartitionsProto.Builder builder = AddPartitionsProto.newBuilder(); final TableIdentifierProto.Builder identifier = TableIdentifierProto.newBuilder() .setDatabaseName(databaseName) .setTableName(tableName); builder.setTableIdentifier(identifier.build()); for (PartitionDescProto partition: partitions) { builder.addPartitionDesc(partition); } builder.setIfNotExists(ifNotExists); ReturnState state = stub.addPartitions(null, builder.build()); throwsIfThisError(state, UndefinedTableException.class); throwsIfThisError(state, UndefinedPartitionMethodException.class); throwsIfThisError(state, DuplicatePartitionException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }

Target:
public void addPartitions(String databaseName, String tableName, List<PartitionDescProto> partitions, boolean ifNotExists) throws UndefinedDatabaseException, UndefinedTableException, DuplicatePartitionException, UndefinedPartitionMethodException { try { final BlockingInterface stub = getStub(); final AddPartitionsProto.Builder builder = AddPartitionsProto.newBuilder(); final TableIdentifierProto.Builder identifier = TableIdentifierProto.newBuilder() .setDatabaseName(databaseName) .setTableName(tableName); builder.setTableIdentifier(identifier.build()); for (PartitionDescProto partition: partitions) { builder.addPartitionDesc(partition); } builder.setIfNotExists(ifNotExists); ReturnState state = stub.addPartitions(null, builder.build()); throwsIfThisError(state, UndefinedTableException.class); throwsIfThisError(state, UndefinedPartitionMethodException.class); throwsIfThisError(state, DuplicatePartitionException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
Source:
protected void firstListenerAdded() { if (!isDisposed() && listener == null) { listener = property.adaptListener(new ISimplePropertyListener<ListDiff<E>>() { @Override public void handleEvent(final SimplePropertyEvent<ListDiff<E>> event) { if (!isDisposed() && !updating) { getRealm().exec(new Runnable() { @Override public void run() { if (event.type == SimplePropertyEvent.CHANGE) { modCount++; notifyIfChanged(event.diff); } else if (event.type == SimplePropertyEvent.STALE && !stale) { stale = true; fireStale(); } } }); } } }); } getRealm().exec(new Runnable() { @Override public void run() { cachedList = new ArrayList<E>(getList()); stale = false; if (listener != null) listener.addTo(source); } }); }

Target:
protected void firstListenerAdded() { if (!isDisposed() && listener == null) { listener = property.adaptListener(new ISimplePropertyListener<ListDiff<E>>() { @Override public void handleEvent(final SimplePropertyEvent<ListDiff<E>> event) { if (!isDisposed() && !updating) { getRealm().exec(new Runnable() { @Override public void run() { if (event.type == SimplePropertyEvent.CHANGE) { modCount++; notifyIfChanged(event.diff); } else if (event.type == SimplePropertyEvent.STALE && !stale) { stale = true; fireStale(); } } }); } } }); } getRealm().exec(new Runnable() { @Override public void run() { cachedList = new ArrayList<>(getList()); stale = false; if (listener != null) listener.addTo(source); } }); }
Source:
@Override public Object invoke(Object proxy, final Method method, final Object[] args) { if (methodWantsSynchronousInvocation(method)) { return invokeRequest(method, args, true); } else { if (httpExecutor == null || callbackExecutor == null) { throw new NullPointerException("Asynchronous invocation requires calling setExecutors."); } httpExecutor.execute(new CallbackRunnable(obtainCallback(args), callbackExecutor) { @Override public Object obtainResponse() { return invokeRequest(method, args, false); } }); return null; } }

Target:
@Override public Object invoke(Object proxy, final Method method, final Object[] args) { if (methodWantsSynchronousInvocation(method)) { return invokeRequest(method, args, true); } else { if (httpExecutor == null || callbackExecutor == null) { throw new IllegalStateException("Asynchronous invocation requires calling setExecutors."); } httpExecutor.execute(new CallbackRunnable(obtainCallback(args), callbackExecutor) { @Override public Object obtainResponse() { return invokeRequest(method, args, false); } }); return null; } }
Source:
public void adjust(Mechanism mechanism) { if (mechanism.matches("inputs")) { List<ItemStack> ingredients = new ArrayList<>(); dList list = mechanism.getValue().asType(dList.class); if (!mechanism.hasValue() || list.filter(dItem.class).isEmpty()) { recipe.getRecipe().setIngredients(ingredients); return; } for (dItem item : list.filter(dItem.class)) { ingredients.add(item.getItemStack()); } if (ingredients.size() > 2) { dB.echoError("Trade recipe input was given " + list.size() + " items. Only using the first two items!"); ingredients = ingredients.subList(0, 2); } recipe.getRecipe().setIngredients(ingredients); } }

Target:
public void adjust(Mechanism mechanism) { if (mechanism.matches("inputs")) { List<ItemStack> ingredients = new ArrayList<>(); List<dItem> list = mechanism.getValue().asType(dList.class).filter(dItem.class); if (!mechanism.hasValue() || list.isEmpty()) { recipe.getRecipe().setIngredients(ingredients); return; } for (dItem item : list) { ingredients.add(item.getItemStack()); } if (ingredients.size() > 2) { dB.echoError("Trade recipe input was given " + list.size() + " items. Only using the first two items!"); ingredients = ingredients.subList(0, 2); } recipe.getRecipe().setIngredients(ingredients); } }
Source:
public void refreshAllUsers() { DbUserDAO dao = DbFacade.getInstance().getDbUserDao(); List<DbUser> dbUsers = dao.getAll(); List<DbGroup> dbGroups = DbFacade.getInstance().getDbGroupDao().getAll(); for (DbGroup group : dbGroups) { groupsMap.put(group.getExternalId(), group); } Map<Directory, List<DbUser>> index = new HashMap<>(); for (DbUser dbUser : dbUsers) { AuthenticationProfile profile = AuthenticationProfileRepository.getInstance().getProfile(dbUser.getDomain()); if (profile == null) { log.warn(String.format("No profile was found for user %1$s. It is possible that the relevant domain for the user was removed for the user. Marking the user as inactive", dbUser.getLoginName())); if (dbUser.isActive()) { dbUser.setActive(false); dao.update(dbUser); } continue; } Directory key = profile.getDirectory(); List<DbUser> value = index.get(key); if (value == null) { value = new ArrayList<DbUser>(); index.put(key, value); } value.add(dbUser); } List<DbUser> updates = new ArrayList<>(); for (Map.Entry<Directory, List<DbUser>> entry : index.entrySet()) { List<DbUser> refreshed = refreshUsers(entry.getValue(), entry.getKey()); updates.addAll(refreshed); } for (DbUser dbUser : updates) { dao.update(dbUser); } }

Target:
public void refreshAllUsers() { DbUserDAO dao = DbFacade.getInstance().getDbUserDao(); List<DbUser> dbUsers = dao.getAll(); List<DbGroup> dbGroups = DbFacade.getInstance().getDbGroupDao().getAll(); for (DbGroup group : dbGroups) { groupsMap.put(group.getExternalId(), group); } Map<Directory, List<DbUser>> index = new HashMap<>(); for (DbUser dbUser : dbUsers) { AuthenticationProfile profile = AuthenticationProfileRepository.getInstance().getProfile(dbUser.getDomain()); if (profile == null) { log.warn(String.format("No profile was found for user %1$s. It is possible that the relevant " + "domain for the user was removed for the user. Marking the user as inactive", dbUser.getLoginName())); if (dbUser.isActive()) { dbUser.setActive(false); dao.update(dbUser); } continue; } Directory key = profile.getDirectory(); List<DbUser> value = index.get(key); if (value == null) { value = new ArrayList<DbUser>(); index.put(key, value); } value.add(dbUser); } List<DbUser> updates = new ArrayList<>(); for (Map.Entry<Directory, List<DbUser>> entry : index.entrySet()) { List<DbUser> refreshed = refreshUsers(entry.getValue(), entry.getKey()); updates.addAll(refreshed); } for (DbUser dbUser : updates) { dao.update(dbUser); } }
Source:
public void getCashPointsByLocation_shouldReturnAllCashpointsForTheSpecifiedLocation() throws Exception { List<CashPoint> cashPoint = service.getCashPointsByLocation(Context.getLocationService().getLocation(1),false); Assert.assertNotNull(cashPoint); Assert.assertEquals(1, cashPoint.size()); }

Target:
public void getCashPointsByLocation_shouldReturnAllCashpointsForTheSpecifiedLocation() throws Exception { List<CashPoint> cashPoint = service.getCashPointsByLocation(Context.getLocationService().getLocation(0),false); Assert.assertNotNull(cashPoint); Assert.assertEquals(3, cashPoint.size()); Assert.assertEquals(0,(int)Iterators.get(cashPoint.iterator(),0).getId()); Assert.assertEquals(4,(int)Iterators.get(cashPoint.iterator(),1).getId()); Assert.assertEquals(5,(int)Iterators.get(cashPoint.iterator(),2).getId()); }
Source:
public void testWhatsNewJsonParsing() throws IOException, ParseException { final Context context = RuntimeEnvironment.application; final String whatsNewJson = FileUtil.loadTextFileFromResources(context, R.raw.whats_new); final Type type = new TypeToken<List<WhatsNew>>() {}.getType(); final List<WhatsNew> list = new Gson().fromJson(whatsNewJson, type); assertThat(list).isNotEmpty(); List<WhatsNewModel> messages; for(WhatsNew whatsNew : list) { assertThat(new Version(whatsNew.getVersion())).isNotNull(); messages = whatsNew.getMessages(); assertThat(messages).isNotEmpty(); validateWhatsNewMessages(messages); messages = WhatsNewUtil.getWhatsNewMessages(whatsNew.getVersion(), list); assertThat(messages).isNotEmpty(); } messages = WhatsNewUtil.getWhatsNewMessages("0.0.00", list); assertThat(messages).isNull(); }

Target:
public void testWhatsNewJsonParsing() throws IOException, ParseException { final Context context = RuntimeEnvironment.application; final String whatsNewJson = FileUtil.loadTextFileFromResources(context, R.raw.whats_new); final Type type = new TypeToken<List<WhatsNewModel>>() { }.getType(); final List<WhatsNewModel> whatsNewModels = new Gson().fromJson(whatsNewJson, type); assertThat(whatsNewModels).isNotEmpty(); List<WhatsNewItemModel> whatsNewItems; for (WhatsNewModel whatsNewModel : whatsNewModels) { assertThat(new Version(whatsNewModel.getVersion())).isNotNull(); whatsNewItems = whatsNewModel.getWhatsNewItems(); assertThat(whatsNewItems).isNotEmpty(); validateWhatsNewItems(whatsNewItems); whatsNewItems = WhatsNewUtil.getWhatsNewItems(whatsNewModel.getVersion(), whatsNewModels); assertThat(whatsNewItems).isNotEmpty(); } whatsNewItems = WhatsNewUtil.getWhatsNewItems("0.0.00", whatsNewModels); assertThat(whatsNewItems).isNull(); }
Source:
public void compute(Iterator<SplitRepeatMessage> msgIterator) { initVertex(); if (verbose) LOG.fine("Iteration " + getSuperstep() + " for key " + getVertexId()); if(getVertexId().toString().equals("AGACCCATGCAGCGGGTCAGG") || getVertexId().toString().equals("GGAGACCCATGCAGCGGGTCA")) System.out.println("stop"); if (getSuperstep() == 1) { restrictNeighbor(); } else if (getSuperstep() == 2) { if (msgIterator.hasNext()) voteToHalt(); else detectRepeatAndSplit(); } else if (getSuperstep() == 3) { responseToRepeat(msgIterator); voteToHalt(); } }

Target:
public void compute(Iterator<SplitRepeatMessage> msgIterator) { initVertex(); if (verbose) LOG.fine("Iteration " + getSuperstep() + " for key " + getVertexId()); if (getSuperstep() == 1) { restrictNeighbor(); } else if (getSuperstep() == 2) { if (msgIterator.hasNext()) voteToHalt(); else detectRepeatAndSplit(); } else if (getSuperstep() == 3) { responseToRepeat(msgIterator); voteToHalt(); } }
Source:
protected void createControls(Composite parent, int horizontalSpan) { if (horizontalSpan < 2) { horizontalSpan = 2; } Composite applicabilityComp = new Composite(parent, SWT.NONE); applicabilityComp.setLayout(new GridLayout(2, false)); applicabilityComp.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false)); if (toolkit != null) { toolkit.adapt(applicabilityComp); } setBranchViewButton = new Button(applicabilityComp, SWT.PUSH); setBranchViewButton.setToolTipText("Select a branch view to associate this version artifact with."); setBranchViewButton.setText("Select Branch View"); setBranchViewButton.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { String baselineBranch = artifact.getSoleAttributeValue(AtsAttributeTypes.BaselineBranchUuid); changeView(BranchId.valueOf(baselineBranch)); refresh(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); text = new Text(applicabilityComp, SWT.WRAP); text.setForeground(Displays.getSystemColor(SWT.COLOR_DARK_GRAY)); text.setText(getArtifactViewApplicabiltyText()); }

Target:
protected void createControls(Composite parent, int horizontalSpan) { if (horizontalSpan < 2) { horizontalSpan = 2; } Composite applicabilityComp = new Composite(parent, SWT.NONE); applicabilityComp.setLayout(new GridLayout(2, false)); applicabilityComp.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false)); if (toolkit != null) { toolkit.adapt(applicabilityComp); } setBranchViewButton = new Button(applicabilityComp, SWT.PUSH); setBranchViewButton.setToolTipText("Select a branch view to associate this version artifact with."); setBranchViewButton.setText("Select Branch View"); setBranchViewButton.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { try { String baselineBranch = artifact.getSoleAttributeValue(AtsAttributeTypes.BaselineBranchUuid, ""); changeView(BranchId.valueOf(baselineBranch)); refresh(); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); text = new Text(applicabilityComp, SWT.WRAP); text.setForeground(Displays.getSystemColor(SWT.COLOR_DARK_GRAY)); text.setText(getArtifactViewApplicabiltyText()); }
Source:
public boolean isDescendant(String potentialChildRelativePath) throws IOException { if (potentialChildRelativePath.equals("") && cacheDescendant) { return true; } if (new File(potentialChildRelativePath).isAbsolute()) { throw new IllegalArgumentException("Only a relative path is supported, the given path is absolute: " + potentialChildRelativePath); } File directChild = new File(f, potentialChildRelativePath); if (directChild.getParentFile().equals(f)) { if (!Util.isSymlink(directChild)) { return true; } } FilePath root = new FilePath(this.root); String relativePath = computeRelativePathToRoot(); try { boolean isDescendant = root.isDescendant(relativePath + potentialChildRelativePath); if (isDescendant && potentialChildRelativePath.equals("")) { cacheDescendant = true; } return isDescendant; } catch (InterruptedException e) { return false; } }

Target:
public boolean isDescendant(String potentialChildRelativePath) throws IOException { if (potentialChildRelativePath.isEmpty() && cacheDescendant) { return true; } if (new File(potentialChildRelativePath).isAbsolute()) { throw new IllegalArgumentException("Only a relative path is supported, the given path is absolute: " + potentialChildRelativePath); } File directChild = new File(f, potentialChildRelativePath); if (directChild.getParentFile().equals(f)) { if (!Util.isSymlink(directChild)) { return true; } } FilePath root = new FilePath(this.root); String relativePath = computeRelativePathToRoot(); try { boolean isDescendant = root.isDescendant(relativePath + potentialChildRelativePath); if (isDescendant && potentialChildRelativePath.isEmpty()) { cacheDescendant = true; } return isDescendant; } catch (InterruptedException e) { return false; } }
Source:
@POST @Path( "{job_id}/content" ) public Response getContent( @PathParam( "job_id" ) String job_id ) throws IOException { UUID uuid = null; try { uuid = UUID.fromString( job_id ); } catch ( Exception e ) { logger.error( "Content: invalid UUID: " + job_id ); return get404(); } IPentahoAsyncExecutor executor = getExecutor(); if ( executor == null ) { return Response.serverError().build(); } final IPentahoSession session = PentahoSessionHolder.getSession(); Future<InputStream> future = executor.getFuture( uuid, session ); IAsyncReportState state = executor.getReportState( uuid, session ); if ( state == null ) { return get404(); } InputStream input = null; try { input = future.get(); } catch ( Exception e ) { logger.error( "Error generating report", e ); return Response.serverError().build(); } executor.cleanFuture( uuid, session ); StreamingOutput stream = new StreamingOutputWrapper( input ); MediaType mediaType = null; Response.ResponseBuilder response = null; try { mediaType = MediaType.valueOf( state.getMimeType() ); response = Response.ok( stream, mediaType ); } catch ( Exception e ) { logger.error( "can't determine JAX-RS media type for: " + state.getMimeType() ); response = Response.ok( stream, state.getMimeType() ); } CacheControl cacheControl = new CacheControl(); cacheControl.setPrivate( true ); cacheControl.setMaxAge( 0 ); cacheControl.setMustRevalidate( true ); response.cacheControl( cacheControl ); response = calculateContentDisposition( response, state ); return response.build(); }

Target:
@POST @Path( "{job_id}/content" ) public Response getContent( @PathParam( "job_id" ) String job_id ) throws IOException { UUID uuid = null; try { uuid = UUID.fromString( job_id ); } catch ( Exception e ) { logger.error( "Content: invalid UUID: " + job_id ); return get404(); } IPentahoAsyncExecutor executor = getExecutor(); if ( executor == null ) { return Response.serverError().build(); } final IPentahoSession session = PentahoSessionHolder.getSession(); Future<InputStream> future = executor.getFuture( uuid, session ); IAsyncReportState state = executor.getReportState( uuid, session ); if ( state == null ) { return get404(); } if( !AsyncExecutionStatus.FINISHED.equals( state.getStatus() ) ){ return Response.status( Response.Status.ACCEPTED ).build(); } InputStream input = null; try { input = future.get(); } catch ( Exception e ) { logger.error( "Error generating report", e ); return Response.serverError().build(); } executor.cleanFuture( uuid, session ); StreamingOutput stream = new StreamingOutputWrapper( input ); MediaType mediaType = null; Response.ResponseBuilder response = null; try { mediaType = MediaType.valueOf( state.getMimeType() ); response = Response.ok( stream, mediaType ); } catch ( Exception e ) { logger.error( "can't determine JAX-RS media type for: " + state.getMimeType() ); response = Response.ok( stream, state.getMimeType() ); } CacheControl cacheControl = new CacheControl(); cacheControl.setPrivate( true ); cacheControl.setMaxAge( 0 ); cacheControl.setMustRevalidate( true ); response.cacheControl( cacheControl ); response = calculateContentDisposition( response, state ); return response.build(); }
Source:
protected void setUp() throws Exception { super.setUp(); manager = TasksUiPlugin.getRepositoryManager(); manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.current().getRepositoryUrl()); UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER); repository.setCredentials(AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.getUserName(), credentials.getPassword()), false); TasksUiPlugin.getRepositoryManager().addRepository(repository); TasksUiTestUtil.ensureTasksUiInitialization(); wizard = new EditRepositoryWizard(repository, TasksUiPlugin.getConnectorUi(repository.getConnectorKind())); }

Target:
protected void setUp() throws Exception { super.setUp(); manager = TasksUiPlugin.getRepositoryManager(); manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.current().getRepositoryUrl()); UserCredentials credentials = CommonTestUtil.getCredentials(PrivilegeLevel.USER); repository.setCredentials(AuthenticationType.REPOSITORY, new AuthenticationCredentials(credentials.getUserName(), credentials.getPassword()), false); TasksUiPlugin.getRepositoryManager().addRepository(repository); TasksUiTestUtil.ensureTasksUiInitialization(); BugzillaConnectorUi connectorUi = new BugzillaConnectorUi(); wizard = new EditRepositoryWizard(repository, connectorUi); }
Source:
public String sendChat(String input) throws ChatScriptDeliveryException { if (!initialized) { return init(null); } ChatScriptMessage g = new ChatScriptMessage(this.userName, this.botName, input); return doMessage(g.toCSFormat()); }

Target:
public String sendChat(String input) throws Exception { if (!initialized) { return init(null); } ChatScriptMessage g = new ChatScriptMessage(this.userName, this.botName, input); return doMessage(g.toCSFormat()); }
Source:
private void buildDeployWithoutServerTemplate(final BuildExecutionContext context, final DeploymentMode mode) { showBuildMessage(); buildServiceCaller.call((RemoteCallback<BuildResults>) result -> { if (result.getErrorMessages().isEmpty()) { notificationEvent.fire(new NotificationEvent(CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS)); notificationEvent.fire( new NotificationEvent( CONSTANTS.DeploymentSkippedDueToNoServerTemplateConfiguredForMode( preferedKieServerMode.name().toLowerCase()), NotificationEvent.NotificationType.WARNING) .setAutoHide(false) .setNavigation(CONSTANTS.ViewDeploymentDetails(), SERVER_MANAGEMENT)); } else { notificationEvent.fire(new NotificationEvent(CONSTANTS.BuildFailed(), NotificationEvent.NotificationType.ERROR)); } buildResultsEvent.fire(result); finish(); }, (ErrorCallback<Message>) (message, throwable) -> { buildDeployWithoutServerTemplate(context, DeploymentMode.FORCED); return false; }).buildAndDeploy(context.getModule(), mode); }

Target:
private void buildDeployWithoutServerTemplate(final BuildExecutionContext context, final DeploymentMode mode) { showBuildMessage(); buildServiceCaller.call((RemoteCallback<BuildResults>) result -> { if (result.getErrorMessages().isEmpty()) { notificationEvent.fire(new NotificationEvent(CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS)); notificationEvent.fire( new NotificationEvent( CONSTANTS.DeploymentSkippedDueToNoServerTemplateConfiguredForMode( preferedKieServerMode.name().toLowerCase()), NotificationEvent.NotificationType.WARNING) .setAutoHide(false) .setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT))); } else { notificationEvent.fire(new NotificationEvent(CONSTANTS.BuildFailed(), NotificationEvent.NotificationType.ERROR)); } buildResultsEvent.fire(result); finish(); }, (ErrorCallback<Message>) (message, throwable) -> { buildDeployWithoutServerTemplate(context, DeploymentMode.FORCED); return false; }).buildAndDeploy(context.getModule(), mode); }
Source:
public String encrypt(String plainTextValue) throws CrypterException { if (isEmpty(plainTextValue)) { throw new CrypterException("Value to encrypt cannot be null or empty."); } if (associatedData == null) { throw new CrypterException("Associated data cannot be null."); } try { byte[] encryptedBytes = aead.encrypt(plainTextValue.getBytes(), associatedData); return Base64.getEncoder().encodeToString(encryptedBytes); } catch (GeneralSecurityException e) { LOGGER.debug("Problem encrypting.", e); throw new CrypterException("Problem encrypting.", e); } }

Target:
public String encrypt(String plainTextValue) throws CrypterException { if (isBlank(plainTextValue)) { throw new CrypterException("Value to encrypt cannot be null or blank."); } if (associatedData == null) { throw new CrypterException("Associated data cannot be null."); } try { byte[] encryptedBytes = aead.encrypt(plainTextValue.getBytes(), associatedData); return Base64.getEncoder().encodeToString(encryptedBytes); } catch (GeneralSecurityException e) { LOGGER.debug("Problem encrypting.", e); throw new CrypterException("Problem encrypting.", e); } }
Source:
private Set<Method> getMethods(Class<?> controller) { Set<Method> methods = new HashSet<>(); for (Method method : new Mirror().on(controller).reflectAll().methods()) { if (!method.getDeclaringClass().equals(Object.class)) { methods.add(method); } } return methods; }

Target:
private List<Method> getMethods(Class<?> controller) { List<Method> methods = new ArrayList<>(); for (Method method : new Mirror().on(controller).reflectAll().methods()) { if (!method.getDeclaringClass().equals(Object.class)) { methods.add(method); } } sort(methods, new SortByArgumentsLengthDesc()); return methods; }
Source:
public DatastreamRecordMetadata(String checkpoint, String topic, int partition) { _checkpoint = checkpoint; _topic = topic; _partition = partition; _recordIndex = 0; }

Target:
public DatastreamRecordMetadata(String checkpoint, String topic, int partition) { _checkpoint = checkpoint; _topic = topic; _partition = partition; _eventIndex = 0; }
Source:
public int outgoingCount() { int count; if ( read.hasTxStateWithChanges() && read.txState().nodeIsAddedInThisTx( getOwningNode() ) ) { count = 0; } else if ( isBuffered() ) { count = bufferedGroup.outgoingCount; } else { count = count( outgoingRawId() ); } return read.hasTxStateWithChanges() ? read.txState().getNodeState( getOwningNode() ) .augmentDegree( Direction.OUTGOING, count, getType() ) : count; }

Target:
public int outgoingCount() { int count; if ( isBuffered() ) { count = bufferedGroup.outgoingCount; } else { count = count( outgoingRawId() ); } return read.hasTxStateWithChanges() ? read.txState().getNodeState( getOwningNode() ) .augmentDegree( RelationshipDirection.OUTGOING, count, getType() ) : count; }
Source:
protected void updatePodPath(String newPodPath, Map<String, IDeploymentResourceMapper> deploymentResourceMapperByProjectName, IService service) { this.deploymentMapperByProjectName = deploymentResourceMapperByProjectName; newPodPath = getDeploymentDirectory(service, deploymentResourceMapperByProjectName); updatePodPath(newPodPath); }

Target:
protected void updatePodPath(String newPodPath, Map<String, IDeploymentResourceMapper> deploymentResourceMapperByProjectName, IService service) { this.deploymentMapperByProjectName = deploymentResourceMapperByProjectName; String inferredPodPath = getInferredDeploymentDirectory(service, deploymentResourceMapperByProjectName, newPodPath); firePropertyChange(PROPERTY_POD_PATH_EDITABLE, this.inferredPodPath == null, (this.inferredPodPath = inferredPodPath) == null); if(inferredPodPath != null) { newPodPath = inferredPodPath; } else if (newPodPath == null) { newPodPath = DEFAULT_DEPLOYMENT_DIR; } updatePodPath(newPodPath); }
Source:
public static TenantManagementServiceClient getTenantManagementServiceClient() throws APIManagementException { AuthenticatorClient authenticatorClient = null; try { authenticatorClient = new AuthenticatorClient(keyManagerURL); URL url = new URL(keyManagerURL); String sessionCookie = authenticatorClient.login("admin", "admin", "localhost"); TenantManagementServiceClient tenantManagementServiceClient = new TenantManagementServiceClient(keyManagerURL, sessionCookie); return tenantManagementServiceClient; } catch (Exception e) { throw new APIManagementException("Unable to create new tenantManagementClient ", e); } }

Target:
public static TenantManagementServiceClient getTenantManagementServiceClient() throws APIManagementException { AuthenticatorClient authenticatorClient = null; try { authenticatorClient = new AuthenticatorClient(keyManagerURL); String sessionCookie = authenticatorClient.login("admin", "admin", "localhost"); TenantManagementServiceClient tenantManagementServiceClient = new TenantManagementServiceClient(keyManagerURL, sessionCookie); return tenantManagementServiceClient; } catch (Exception e) { throw new APIManagementException("Unable to create new tenantManagementClient ", e); } }
Source:
public void setUp() throws Exception { brickPosition = 1; Script script = BrickTestUtils.createProjectAndGetStartScript(projectName); script.addBrick(new PlaySoundAndWaitBrick()); soundInfoList = ProjectManager.getInstance().getCurrentSprite().getSoundList(); soundFile = FileTestUtils.saveFileToProject(projectName, ProjectManager.getInstance().getCurrentProject() .getDefaultScene().getName(), "longsound.mp3", org.catrobat.catroid.test.R.raw.longtestsound , InstrumentationRegistry.getContext(), FileTestUtils.FileTypes.SOUND); SoundInfo soundInfo = new SoundInfo(); soundInfo.setSoundFileName(soundFile.getName()); soundInfo.setTitle(soundName); soundInfoList.add(soundInfo); baseActivityTestRule.launchActivity(null); ProjectManager.getInstance().getFileChecksumContainer() .addChecksum(soundInfo.getChecksum(), soundInfo.getAbsolutePath()); }

Target:
public void setUp() throws Exception { String soundName = "testSound1"; String projectName = "testProject"; File soundFile; List<SoundInfo> soundInfoList; brickPosition = 1; Script script = BrickTestUtils.createProjectAndGetStartScript(projectName); script.addBrick(new PlaySoundAndWaitBrick()); soundInfoList = ProjectManager.getInstance().getCurrentSprite().getSoundList(); soundFile = FileTestUtils.saveFileToProject(projectName, ProjectManager.getInstance().getCurrentProject() .getDefaultScene().getName(), "longsound.mp3", org.catrobat.catroid.test.R.raw.longtestsound, InstrumentationRegistry.getContext(), FileTestUtils.FileTypes.SOUND); SoundInfo soundInfo = new SoundInfo(); soundInfo.setSoundFileName(soundFile.getName()); soundInfo.setTitle(soundName); soundInfoList.add(soundInfo); baseActivityTestRule.launchActivity(null); ProjectManager.getInstance().getFileChecksumContainer() .addChecksum(soundInfo.getChecksum(), soundInfo.getAbsolutePath()); }
Source:
public ResponseEntity<?> createEventType(@Valid @RequestBody final EventType eventType, final Errors errors, final NativeWebRequest nativeWebRequest) { if (featureToggleService.isFeatureEnabled(DISABLE_EVENT_TYPE_CREATION)) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } if (errors.hasErrors()) { return create(new ValidationProblem(errors), nativeWebRequest); } try { assignTopic(eventType); validateSchema(eventType); enrichment.validate(eventType); partitionResolver.validate(eventType); eventTypeRepository.saveEventType(eventType); topicRepository.createTopic(eventType.getName(), eventType.getDefaultStatistic()); return status(HttpStatus.CREATED).build(); } catch (final InvalidEventTypeException | NoSuchPartitionStrategyException | DuplicatedEventTypeNameException e) { LOG.debug("Failed to create EventType.", e); return create(e.asProblem(), nativeWebRequest); } catch (final TopicCreationException e) { LOG.error("Problem creating kafka topic. Rolling back event type database registration.", e); try { eventTypeRepository.removeEventType(eventType.getTopic()); } catch (final NakadiException e1) { return create(e.asProblem(), nativeWebRequest); } return create(e.asProblem(), nativeWebRequest); } catch (final NakadiException e) { LOG.error("Error creating event type " + eventType, e); return create(e.asProblem(), nativeWebRequest); } }

Target:
public ResponseEntity<?> createEventType(@Valid @RequestBody final EventType eventType, final Errors errors, final NativeWebRequest nativeWebRequest) { if (featureToggleService.isFeatureEnabled(DISABLE_EVENT_TYPE_CREATION)) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } if (errors.hasErrors()) { return create(new ValidationProblem(errors), nativeWebRequest); } try { assignTopic(eventType); validateSchema(eventType); enrichment.validate(eventType); partitionResolver.validate(eventType); eventTypeRepository.saveEventType(eventType); topicRepository.createTopic(eventType.getTopic(), eventType.getDefaultStatistic()); return status(HttpStatus.CREATED).build(); } catch (final InvalidEventTypeException | NoSuchPartitionStrategyException | DuplicatedEventTypeNameException e) { LOG.debug("Failed to create EventType.", e); return create(e.asProblem(), nativeWebRequest); } catch (final TopicCreationException e) { LOG.error("Problem creating kafka topic. Rolling back event type database registration.", e); try { eventTypeRepository.removeEventType(eventType.getTopic()); } catch (final NakadiException e1) { return create(e.asProblem(), nativeWebRequest); } return create(e.asProblem(), nativeWebRequest); } catch (final NakadiException e) { LOG.error("Error creating event type " + eventType, e); return create(e.asProblem(), nativeWebRequest); } }
Source:
public void testRegExpParentInSubpackageIsConsidered() { assertEquals("Invalid package", icCommonRegexpParen, icRootRegexpParent .locateFinest("com.kazgroup.courtlink.common.api")); assertEquals("Invalid package", icCommonRegexpParen, icRootRegexpParent .locateFinest("com.kazgroup.courtlink.common.api")); }

Target:
public void testRegExpParentInSubpackageIsConsidered() { assertEquals("Invalid package", icCommonRegexpParen, icRootRegexpParent .locateFinest("com.kazgroup.courtlink.common.api")); assertEquals("Invalid package", icCommonRegexpParen, icRootRegexpParent .locateFinest("com.kazgroup.courtlink.comon.api")); }
Source:
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (receiver instanceof IEditorInput) { IEditorInput editorInput = (IEditorInput) receiver; if (CONTENT_TYPE_ID.equals(property)) { String identifier = String.valueOf(expectedValue); IContentTypeManager contentTypeManager = Platform.getContentTypeManager(); IContentType expected = contentTypeManager.getContentType(identifier); if (expected != null) { IContentType[] contentTypesFor = contentTypeManager.findContentTypesFor(editorInput.getName()); for (IContentType contentType : contentTypesFor) { if (expected.equals(contentType)) { return true; } } } } } return false; }

Target:
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (receiver instanceof IEditorInput) { IEditorInput editorInput = (IEditorInput) receiver; if (CONTENT_TYPE_ID.equals(property)) { String identifier = String.valueOf(expectedValue); return testContentType(editorInput, identifier, hasArgument(args, IS_KIND_OF)); } } return false; }
Source:
public SSHLauncher(String host, int port, StandardUsernameCredentials credentials, String jvmOptions, String javaPath, JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime) { this.host = host; this.jvmOptions = fixEmpty(jvmOptions); this.port = port == 0 ? 22 : port; this.username = null; this.password = null; this.privatekey = null; this.credentials = credentials; this.credentialsId = credentials == null ? null : credentials.getId(); this.javaPath = fixEmpty(javaPath); if (jdkInstaller != null) { this.jdk = jdkInstaller; } this.prefixStartSlaveCmd = fixEmpty(prefixStartSlaveCmd); this.suffixStartSlaveCmd = fixEmpty(suffixStartSlaveCmd); this.launchTimeoutSeconds = launchTimeoutSeconds == null || launchTimeoutSeconds <= 0 ? null : launchTimeoutSeconds; final Integer zero = 0; this.maxNumRetries = maxNumRetries == null || maxNumRetries <= 0 ? zero : maxNumRetries; this.retryWaitTime = retryWaitTime == null || retryWaitTime <= 0 ? zero : retryWaitTime; }

Target:
public SSHLauncher(String host, int port, StandardUsernameCredentials credentials, String jvmOptions, String javaPath, JDKInstaller jdkInstaller, String prefixStartSlaveCmd, String suffixStartSlaveCmd, Integer launchTimeoutSeconds, Integer maxNumRetries, Integer retryWaitTime) { this.host = host; this.jvmOptions = fixEmpty(jvmOptions); this.port = port == 0 ? 22 : port; this.username = null; this.password = null; this.privatekey = null; this.credentials = credentials; this.credentialsId = credentials == null ? null : credentials.getId(); this.javaPath = fixEmpty(javaPath); if (jdkInstaller != null) { this.jdk = jdkInstaller; } this.prefixStartSlaveCmd = fixEmpty(prefixStartSlaveCmd); this.suffixStartSlaveCmd = fixEmpty(suffixStartSlaveCmd); this.launchTimeoutSeconds = launchTimeoutSeconds == null || launchTimeoutSeconds <= 0 ? null : launchTimeoutSeconds; this.maxNumRetries = maxNumRetries != null && maxNumRetries > 0 ? maxNumRetries : 0; this.retryWaitTime = retryWaitTime != null && retryWaitTime > 0 ? retryWaitTime : 0; }
Source:
public void testCreateDatabase() { sql("create database db1") .ok("CREATE DATABASE `DB1` WITH (\n" + " 'is_generic' = 'false'\n" + ")"); sql("create database db1 comment 'comment db1' location '/path/to/db1'") .ok("CREATE DATABASE `DB1`\n" + "COMMENT 'comment db1' WITH (\n" + " 'is_generic' = 'false',\n" + " 'database.location_uri' = '/path/to/db1'\n" + ")"); sql("create database db1 with dbproperties ('k1'='v1','k2'='v2')") .ok("CREATE DATABASE `DB1` WITH (\n" + " 'k1' = 'v1',\n" + " 'k2' = 'v2',\n" + " 'is_generic' = 'false'\n" + ")"); }

Target:
public void testCreateDatabase() { sql("create database db1") .ok("CREATE DATABASE `DB1`"); sql("create database db1 comment 'comment db1' location '/path/to/db1'") .ok("CREATE DATABASE `DB1`\n" + "COMMENT 'comment db1'\n" + "LOCATION '/path/to/db1'"); sql("create database db1 with dbproperties ('k1'='v1','k2'='v2')") .ok("CREATE DATABASE `DB1` WITH DBPROPERTIES (\n" + " 'k1' = 'v1',\n" + " 'k2' = 'v2'\n" + ")"); }
Source:
private void initNodeIdentifier() { if (arjPropertyManager.getCoreEnvironmentBean().getNodeIdentifier() == null) { LOGGER.info("Node identifier was not set. Setting it to the default value: " + DEFAULT_NODE_IDENTIFIER); try { arjPropertyManager.getCoreEnvironmentBean().setNodeIdentifier(DEFAULT_NODE_IDENTIFIER); } catch (CoreEnvironmentBeanException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } } jtaPropertyManager.getJTAEnvironmentBean() .setXaRecoveryNodes(Collections.singletonList(arjPropertyManager.getCoreEnvironmentBean().getNodeIdentifier())); }

Target:
private void initNodeIdentifier() { if (arjPropertyManager.getCoreEnvironmentBean().getNodeIdentifier() == null) { LOGGER.warning("Node identifier was not set. Setting it to the default value: " + DEFAULT_NODE_IDENTIFIER); try { arjPropertyManager.getCoreEnvironmentBean().setNodeIdentifier(DEFAULT_NODE_IDENTIFIER); } catch (CoreEnvironmentBeanException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } } jtaPropertyManager.getJTAEnvironmentBean() .setXaRecoveryNodes(Collections.singletonList(arjPropertyManager.getCoreEnvironmentBean().getNodeIdentifier())); }
Source:
public void run() throws IOException { ui.header("Gitiles"); if (!confirm()) { return; } gitweb.unset("cgi"); gitweb.unset("pathSeparator"); gitweb.set("url", "/plugins/gitiles/"); gitweb.set("type", "custom"); gitweb.set("revision", "${project}/+/${commit}"); gitweb.set("project", "${project}"); gitweb.set("branch", "${project}/+/${branch}"); gitweb.set("filehistory", "${project}/+log/${branch}/${file}"); gitweb.set("linkname", "gitiles"); gitilesConfig.createNewFile(); }

Target:
public void run() throws IOException { ui.header("Gitiles"); if (!confirm()) { return; } gitweb.set("type", "custom"); gitweb.set("linkname", "gitiles"); gitweb.unset("cgi"); gitweb.unset("pathSeparator"); gitweb.set("url", "plugins/gitiles/"); gitweb.set("revision", "${project}/+/${commit}"); gitweb.set("project", "${project}"); gitweb.set("branch", "${project}/+/${branch}"); gitweb.set("filehistory", "${project}/+log/${branch}/${file}"); gitilesConfig.createNewFile(); }
Source:
public void run() { if (fZoomEntryList == null) { return; } for (TimeGraphEntry entry : fZoomEntryList) { if (fMonitor.isCanceled()) { break; } zoom(entry, fMonitor); } List<TimeLinkEvent> events = getLinkList(fZoomStartTime, fZoomEndTime, fResolution, fMonitor); fTimeGraphCombo.setLinks(events.toArray(new TimeLinkEvent[0])); redraw(); }

Target:
public void run() { if (fZoomEntryList == null) { return; } for (TimeGraphEntry entry : fZoomEntryList) { if (fMonitor.isCanceled()) { break; } zoom(entry, fMonitor); } List<ILinkEvent> events = getLinkList(fZoomStartTime, fZoomEndTime, fResolution, fMonitor); fTimeGraphCombo.setLinks(events); redraw(); }
Source:
private boolean newValidationSetExists() { if (currentTrainingSetSize >= allTrainingData.size()) { return false; } else return true; }

Target:
private boolean newValidationSetExists() { return currentTrainingSetSize < allTrainingData.size(); }
Source:
public int compareTo(DataNodeId o) { if (getClass() != o.getClass()) { throw new IllegalStateException("Incompatible objects to compare"); } AmbryDataNode other = (AmbryDataNode) o; int compare = Integer.compare(plainTextPort.getPort(), other.plainTextPort.getPort()); if (compare == 0) { compare = hostName.compareTo(other.hostName); } return compare; }

Target:
public int compareTo(DataNodeId o) { if (getClass() != o.getClass()) { throw new IllegalStateException("Incompatible objects to compare"); } AmbryDataNode other = (AmbryDataNode) o; return Comparator.comparingInt((AmbryDataNode k) -> k.plainTextPort.getPort()). thenComparing(k -> k.hostName).compare(this, other); }
Source:
private boolean mayProceed(String studyOid , StudySubjectBean ssBean) throws Exception { boolean accessPermission = false; StudyBean study = getParentStudy(studyOid); StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource); StudyParameterValueBean pStatus = spvdao.findByHandleAndStudy(study.getId(),"participantPortal"); participantPortalRegistrar=new ParticipantPortalRegistrar(); String pManageStatus =participantPortalRegistrar.getRegistrationStatus(studyOid).toString(); ENDING , INACTIVE String participateStatus = pStatus.getValue().toString(); String studyStatus = study.getStatus().getName().toString(); logger.info("pManageStatus: "+ pManageStatus + " participantStatus: " + participateStatus+ " studyStatus: " + studyStatus + " studySubjectStatus: "+ssBean.getStatus().getName()); System.out.println("pManageStatus: "+ pManageStatus + " participantStatus: " + participateStatus+ " studyStatus: " + studyStatus + " studySubjectStatus: "+ssBean.getStatus().getName()); if (participateStatus.equals("enabled") && studyStatus.equals("available") && pManageStatus.equals("ACTIVE") && ssBean.getStatus()==Status.AVAILABLE) { accessPermission = true; } return accessPermission; }

Target:
private boolean mayProceed(String studyOid , StudySubjectBean ssBean) throws Exception { boolean accessPermission = false; logger.info( " studySubjectStatus: "+ssBean.getStatus().getName()); System.out.println( " studySubjectStatus: "+ssBean.getStatus().getName()); if (mayProceed(studyOid) && ssBean.getStatus()==Status.AVAILABLE) { accessPermission = true; } return accessPermission; }
Source:
public void validateUpdateWipeAfterDeleteForFloatingDisk() { when(diskDao.get(diskImageGuid)).thenReturn(createDiskImage()); command.getParameters().getDiskInfo().setWipeAfterDelete(true); initializeCommand(); command.getParameters().setDiskVmElement(null); mockNullVm(); ValidateTestUtils.runAndAssertValidateSuccess(command); }

Target:
public void validateUpdateWipeAfterDeleteForFloatingDisk() { validateUpdateWipeAfterDelete(null, true); }
Source:
public void addressesInHeadersAddedWithoutSlashes() throws Exception { final Socket socket = BkBasicTest.createMockSocket(); final AtomicReference<Request> ref = new AtomicReference<>(); new BkBasic( req -> { ref.set(req); return new RsOf( () -> Collections.singletonList("HTTP/1.1 200 OK"), req::body ); } ).accept(socket); final Request request = ref.get(); final RqHeaders.Smart smart = new RqHeaders.Smart( new RqHeaders.Base(request) ); MatcherAssert.assertThat( smart.single( "X-Takes-LocalAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( smart.single( "X-Takes-RemoteAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( new RqSocket(request).getLocalAddress(), Matchers.notNullValue() ); MatcherAssert.assertThat( new RqSocket(request).getRemoteAddress(), Matchers.notNullValue() ); }

Target:
public void addressesInHeadersAddedWithoutSlashes() throws Exception { final Socket socket = BkBasicTest.createMockSocket(); final AtomicReference<Request> ref = new AtomicReference<>(); new BkBasic( req -> { ref.set(req); return new ResponseOf( () -> Collections.singletonList("HTTP/1.1 200 OK"), req::body ); } ).accept(socket); final Request request = ref.get(); final RqHeaders.Smart smart = new RqHeaders.Smart( new RqHeaders.Base(request) ); MatcherAssert.assertThat( smart.single( "X-Takes-LocalAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( smart.single( "X-Takes-RemoteAddress", "" ), Matchers.not( Matchers.containsString("/") ) ); MatcherAssert.assertThat( new RqSocket(request).getLocalAddress(), Matchers.notNullValue() ); MatcherAssert.assertThat( new RqSocket(request).getRemoteAddress(), Matchers.notNullValue() ); }
Source:
public void testAttemptLoadWithFileSystemFileDNE() throws Exception { Properties testProperties = PropertiesLoader.attemptLoadWithFileSystem(NON_EXISTENT_FILENAME, null); Assert.assertEquals( "Returns empty properties", Collections.emptySet(), testProperties.entrySet()); }

Target:
public void testAttemptLoadWithFileSystemFileDNE() throws Exception { Properties testProperties = PropertiesLoader.attemptLoadWithFileSystem(NON_EXISTENT_FILENAME, null); assertThat(testProperties.entrySet(), is(empty())); }