auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void write(Object msg, boolean flush, ChannelPromise promise) { ObjectUtil.checkNotNull(msg, "msg"); try { if (isNotValidPromise(promise, true)) { ReferenceCountUtil.release(msg); return; } } catch (RuntimeException e) { ReferenceCountUtil.release(msg); throw e; } final AbstractChannelHandlerContext next = findContextOutbound(flush ? (MASK_WRITE | MASK_FLUSH) : MASK_WRITE); EventExecutor executor = executor(); if (executor.inEventLoop()) { if (flush) { next.invokeWriteAndFlush(msg, promise); } else { next.invokeWrite(msg, promise); } } else { final AbstractWriteTask task; if (flush) { task = WriteAndFlushTask.newInstance(this, msg, promise); } else { task = WriteTask.newInstance(this, msg, promise); } if (!safeExecute(executor, task, promise, msg)) { task.cancel(); } } }

Target:
private void write(Object msg, boolean flush, ChannelPromise promise) { ObjectUtil.checkNotNull(msg, "msg"); try { if (isNotValidPromise(promise, true)) { ReferenceCountUtil.release(msg); return; } } catch (RuntimeException e) { ReferenceCountUtil.release(msg); throw e; } EventExecutor executor = executor(); if (executor.inEventLoop()) { final AbstractChannelHandlerContext next = findContextOutbound(flush ? (MASK_WRITE | MASK_FLUSH) : MASK_WRITE); if (flush) { next.invokeWriteAndFlush(msg, promise); } else { next.invokeWrite(msg, promise); } } else { final AbstractWriteTask task; if (flush) { task = WriteAndFlushTask.newInstance(this, msg, promise); } else { task = WriteTask.newInstance(this, msg, promise); } if (!safeExecute(executor, task, promise, msg)) { task.cancel(); } } }
Source:
protected String getModFilePath() { return path.toString() + "/" + LOCAL_GO_MOD_FILENAME; }

Target:
protected String getModFilePath() { return path.toString() + File.separator + LOCAL_GO_MOD_FILENAME; }
Source:
public void stopDebugging(IServer server, IProgressMonitor monitor) throws CoreException { IDeploymentConfig dc = OpenShiftServerUtils.getDeploymentConfig(server); if(dc == null) { terminateRemoteDebugger(server); return; } DebuggingContext debugContext = getDebuggingContext(dc); IDebugListener listener = new IDebugListener() { public void onDebugChange(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { terminateRemoteDebugger(server); unMapPortForwarding(debuggingContext.getPod()); } @Override public void onPodRestart(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { } }; debugContext.setDebugListener(listener); disableDebugMode(dc, debugContext, monitor); }

Target:
public void stopDebugging(IServer server, IProgressMonitor monitor) throws CoreException { IDeploymentConfig dc = OpenShiftServerUtils.getDeploymentConfig(server); if(dc == null) { terminateRemoteDebugger(server); return; } DebuggingContext debugContext = getDebuggingContext(dc); IDebugListener listener = new IDebugListener() { @Override public void onDebugChange(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { terminateRemoteDebugger(server); unMapPortForwarding(debuggingContext.getPod()); } @Override public void onPodRestart(DebuggingContext debuggingContext, IProgressMonitor monitor) throws CoreException { } }; debugContext.setDebugListener(listener); disableDebugMode(dc, debugContext, monitor); }
Source:
public synchronized void close() { frameBuffer.clear(); try { frameBuffer.put(FRAME_BUFFER_CLOSED); } catch (InterruptedException e) { LOGGER.warn("NATS transport could not close frame buffer: " + e.getMessage()); } isOpen = false; }

Target:
public synchronized void close() { frameBuffer.clear(); try { frameBuffer.put(FRAME_BUFFER_CLOSED); } catch (InterruptedException e) { LOGGER.warn("HTTP transport could not close frame buffer: " + e.getMessage()); } isOpen = false; }
Source:
public void testUpdated() { loadTestingData(); CacheQuery cacheQuery = createCacheQuery(cache, "name", "Goat"); List<Object> found = cacheQuery.list(); assertEquals("Size of list should be 2", 2, found.size()); assertTrue("The search should have person2", found.contains(person2)); cache.put(key2, person1); cacheQuery = createCacheQuery(cache, "name", "Goat"); found = cacheQuery.list(); assertEquals("Size of list should be 1", 1, found.size()); assertTrue("Person 2 should not be found now", !found.contains(person2)); assertTrue("Person 1 should not be found because it does not meet the search criteria", !found.contains(person1)); StaticTestingErrorHandler.assertAllGood(cache); }

Target:
public void testUpdated() { loadTestingData(); CacheQuery cacheQuery = createCacheQuery(cache, "name", "Goat"); List<Object> found = cacheQuery.list(); assertPeopleInList(found, person2, person3); cache.put(key2, person1); cacheQuery = createCacheQuery(cache, "name", "Goat"); found = cacheQuery.list(); assertPeopleInList(found, person3); StaticTestingErrorHandler.assertAllGood(cache); }
Source:
private static String getTimeZoneRepresentation(TimeZone tz) { long hours = TimeUnit.MILLISECONDS.toHours(tz.getRawOffset()); long minutes = TimeUnit.MILLISECONDS.toMinutes(tz.getRawOffset()) - TimeUnit.HOURS.toMinutes(hours); minutes = Math.abs(minutes); String result = ""; if (hours > 0) { result = String.format(POSITIVE_OFFSET_FORMAT, tz.getID(), hours, minutes); } else if (hours < 0) { result = String.format(NEGATIVE_OFFSET_FORMAT, tz.getID(), hours, minutes); } else { result = String.format(NO_OFFSET_FORMAT, tz.getDisplayName(Locale.getDefault())); } return result; }

Target:
private static String getTimeZoneRepresentation(TimeZone tz) { long hours = TimeUnit.MILLISECONDS.toHours(tz.getRawOffset()); long minutes = TimeUnit.MILLISECONDS.toMinutes(tz.getRawOffset()) - TimeUnit.HOURS.toMinutes(hours); minutes = Math.abs(minutes); final String result; if (hours > 0) { result = String.format(POSITIVE_OFFSET_FORMAT, tz.getID(), hours, minutes); } else if (hours < 0) { result = String.format(NEGATIVE_OFFSET_FORMAT, tz.getID(), hours, minutes); } else { result = String.format(NO_OFFSET_FORMAT, tz.getDisplayName(Locale.getDefault())); } return result; }
Source:
private static Map<Integer, String> createExtra44Map() { Map<Integer, String> result = new HashMap<>(); result.put(1, "no CAN bus, (firmware derived from CANCMD)."); result.put(2, "integrated CANISB (firmware derived from CANCMD)."); result.put(3, "integrated CANISB (firmware derived from CANCMD)."); result.put(4, "System booster"); result.put(4, "integrated CANISB (firmware derived from CANCMD)."); result.put(6, "Isolated CANUSB and CBUS node."); return Collections.unmodifiableMap(result); }

Target:
private static Map<Integer, String> createExtra44Map() { Map<Integer, String> result = new HashMap<>(); result.put(1, "no CAN bus, (firmware derived from CANCMD)."); result.put(2, "integrated CANISB (firmware derived from CANCMD)."); result.put(3, "integrated CANISB (firmware derived from CANCMD)."); result.put(4, "System booster"); result.put(5, "integrated CANISB (firmware derived from CANCMD)."); result.put(6, "Isolated CANUSB and CBUS node."); return Collections.unmodifiableMap(result); }
Source:
public List<JSONActivity> getActivities(Date fromDate, Date toDate, Class mambuEntity, String entityId) throws MambuApiException { if (fromDate == null) { throw new IllegalArgumentException("From Date must not be NULL"); } if (toDate == null) { throw new IllegalArgumentException("To Date must not be NULL"); } if ((mambuEntity == null && entityId != null) || (mambuEntity != null && entityId == null)) { throw new IllegalArgumentException( "Mambu Entity class and its ID must be either both NULL or both NOT NULL"); } final String dateTimeFormat = APIData.yyyyMmddFormat; ParamsMap params = new ParamsMap(); try { String formattedFromDate = new SimpleDateFormat(dateTimeFormat).format(fromDate); params.put(FROM, formattedFromDate); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid From Date"); } try { String formattedToDate = new SimpleDateFormat(dateTimeFormat).format(toDate); params.put(TO, formattedToDate); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid To Date"); } String idParameterName = null; if (mambuEntity != null) { try { idParameterName = getIdParameterName(mambuEntity); } catch (IllegalArgumentException e) { throw e; } } if (idParameterName != null) { params.put(idParameterName, entityId); } String urlString = new String(mambuAPIService.createUrl(ACTIVITIES + "/")); String activitiesResposne = mambuAPIService.executeRequest(urlString, params, Method.GET); Type collectionType = new TypeToken<List<JSONActivity>>() {}.getType(); List<JSONActivity> activities = GsonUtils.createGson().fromJson(activitiesResposne, collectionType); return activities; }

Target:
public List<JSONActivity> getActivities(Date fromDate, Date toDate, Class mambuEntity, String entityId) throws MambuApiException { if (fromDate == null) { throw new IllegalArgumentException("From Date must not be NULL"); } if (toDate == null) { throw new IllegalArgumentException("To Date must not be NULL"); } if ((mambuEntity == null && entityId != null) || (mambuEntity != null && entityId == null)) { throw new IllegalArgumentException( "Mambu Entity class and its ID must be either both NULL or both NOT NULL"); } final String dateTimeFormat = APIData.yyyyMmddFormat; ParamsMap params = new ParamsMap(); try { String formattedFromDate = new SimpleDateFormat(dateTimeFormat).format(fromDate); params.put(FROM, formattedFromDate); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid From Date"); } try { String formattedToDate = new SimpleDateFormat(dateTimeFormat).format(toDate); params.put(TO, formattedToDate); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid To Date"); } if (mambuEntity != null) { params.put(getIdParameterName(mambuEntity), entityId); } String urlString = new String(mambuAPIService.createUrl(ACTIVITIES + "/")); String activitiesResposne = mambuAPIService.executeRequest(urlString, params, Method.GET); Type collectionType = new TypeToken<List<JSONActivity>>() {}.getType(); List<JSONActivity> activities = GsonUtils.createGson().fromJson(activitiesResposne, collectionType); return activities; }
Source:
public void addFiles(List<Long> fileObjectIds) throws IngestStreamClosedException, TskCoreException { synchronized(this) { if (isClosed) { throw new IngestStreamClosedException("Can not add files - ingest stream is closed"); } if (dataSource == null) { throw new TskCoreException("Files can not be added without a data source"); } fileIdQueue.addAll(fileObjectIds); } }

Target:
public void addFiles(List<Long> fileObjectIds) throws IngestStreamClosedException { synchronized(this) { if (isClosed) { throw new IngestStreamClosedException("Can not add files - ingest stream is closed"); } if (dataSource == null) { throw new IllegalStateException("Files can not be added before a data source"); } fileIdQueue.addAll(fileObjectIds); } }
Source:
private void processSourceMessage(MessageViewInfo messageViewInfo) { try { switch (action) { case REPLY: case REPLY_ALL: { processMessageToReplyTo(messageViewInfo); break; } case FORWARD: { processMessageToForward(messageViewInfo, false); break; } case FORWARD_AS_ATTACHMENT: { processMessageToForward(messageViewInfo, true); break; } case EDIT_DRAFT: { processDraftMessage(messageViewInfo); break; } default: { Timber.w("processSourceMessage() called with unsupported action"); break; } } } catch (MessagingException | IOException e) { Timber.e(e, "Error while processing source message: "); } finally { relatedMessageProcessed = true; changesMadeSinceLastSave = false; } updateMessageFormat(); }

Target:
private void processSourceMessage(MessageViewInfo messageViewInfo) { try { switch (action) { case REPLY: case REPLY_ALL: { processMessageToReplyTo(messageViewInfo); break; } case FORWARD: { processMessageToForward(messageViewInfo, false); break; } case FORWARD_AS_ATTACHMENT: { processMessageToForward(messageViewInfo, true); break; } case EDIT_DRAFT: { processDraftMessage(messageViewInfo); break; } default: { Timber.w("processSourceMessage() called with unsupported action"); break; } } } catch (MessagingException e) { Timber.e(e, "Error while processing source message: "); } finally { relatedMessageProcessed = true; changesMadeSinceLastSave = false; } updateMessageFormat(); }
Source:
private static boolean isMoving(ArrayList<Position> positions, int index, TripsConfig tripsConfig, double speedThreshold) { if (tripsConfig.getMinimalNoDataDuration() > 0 && (index < positions.size() - 1 && positions.get(index + 1).getFixTime().getTime() - positions.get(index).getFixTime().getTime() >= tripsConfig.getMinimalNoDataDuration()) || index > 0 && positions.get(index).getFixTime().getTime() - positions.get(index - 1).getFixTime().getTime() >= tripsConfig.getMinimalNoDataDuration()) { return false; } if (positions.get(index).getAttributes().containsKey(Position.KEY_MOTION) && positions.get(index).getAttributes().get(Position.KEY_MOTION) instanceof Boolean) { return positions.get(index).getBoolean(Position.KEY_MOTION); } else { return positions.get(index).getSpeed() > speedThreshold; } }

Target:
private static boolean isMoving(ArrayList<Position> positions, int index, TripsConfig tripsConfig, double speedThreshold) { if (tripsConfig.getMinimalNoDataDuration() > 0) { boolean beforeGap = index < positions.size() - 1 && positions.get(index + 1).getFixTime().getTime() - positions.get(index).getFixTime().getTime() >= tripsConfig.getMinimalNoDataDuration(); boolean afterGap = index > 0 && positions.get(index).getFixTime().getTime() - positions.get(index - 1).getFixTime().getTime() >= tripsConfig.getMinimalNoDataDuration(); if (beforeGap || afterGap) { return false; } } if (positions.get(index).getAttributes().containsKey(Position.KEY_MOTION) && positions.get(index).getAttributes().get(Position.KEY_MOTION) instanceof Boolean) { return positions.get(index).getBoolean(Position.KEY_MOTION); } else { return positions.get(index).getSpeed() > speedThreshold; } }
Source:
public Construct exec(Target t, com.laytonsmith.core.environments.Environment environment, Construct... args) throws ConfigRuntimeException { MCLocation loc = ObjectGenerator.GetGenerator().location(args[0], null, t); if(loc.getBlock().isCommandBlock()) { MCCommandBlock cb = loc.getBlock().getCommandBlock(); String cmd = ""; if(args.length == 2) { if(!(args[1] instanceof CString)) { throw new ConfigRuntimeException("Parameter 2 of " + getName() + " must be a string", ExceptionType.CastException, t); } cmd = args[1].val(); } cb.setCommand(cmd); return new CVoid(t); } else { throw new ConfigRuntimeException("The block at the specified location is not a command block", ExceptionType.FormatException, t); } }

Target:
public Construct exec(Target t, com.laytonsmith.core.environments.Environment environment, Construct... args) throws ConfigRuntimeException { String cmd = null; if(args.length == 2 && !(args[1] instanceof CNull)) { if(!(args[1] instanceof CString)) { throw new ConfigRuntimeException("Parameter 2 of " + getName() + " must be a string or null", ExceptionType.CastException, t); } cmd = args[1].val(); } MCLocation loc = ObjectGenerator.GetGenerator().location(args[0], null, t); if(loc.getBlock().isCommandBlock()) { MCCommandBlock cb = loc.getBlock().getCommandBlock(); cb.setCommand(cmd); return new CVoid(t); } else { throw new ConfigRuntimeException("The block at the specified location is not a command block", ExceptionType.FormatException, t); } }
Source:
public void setup() { metadata = createTestMetadataManager(); domainTranslator = new RowExpressionDomainTranslator(metadata); columnExtractor = new SubfieldExtractor( new FunctionResolution(metadata.getFunctionManager()), (rowExpression, level, session) -> rowExpression, TestingSession.SESSION, true).toColumnExtractor(); }

Target:
public void setup() { metadata = createTestMetadataManager(); domainTranslator = new RowExpressionDomainTranslator(metadata); columnExtractor = new SubfieldExtractor( new FunctionResolution(metadata.getFunctionManager()), (rowExpression, level, session) -> rowExpression, new TestingConnectorSession( new HiveSessionProperties( new HiveClientConfig().setNestedColumnsFilterEnabled(true), new OrcFileWriterConfig(), new ParquetFileWriterConfig()).getSessionProperties())).toColumnExtractor(); }
Source:
public Page getOutput() { if (state != State.HAS_OUTPUT) { return null; } if (!mergedPages.process() || mergedPages.isFinished()) { state = State.FINISHED; return null; } Page resultPage = mergedPages.getResult(); Block[] blocksArray = new Block[outputChannels.length]; updateMemoryUsage(false); for (int i = 0; i < outputChannels.length; i++) { blocksArray[i] = resultPage.getBlock(outputChannels[i]); } return new Page(resultPage.getPositionCount(), blocksArray); }

Target:
public Page getOutput() { if (state != State.HAS_OUTPUT) { return null; } if (!sortedPages.hasNext()) { state = State.FINISHED; return null; } Page resultPage = sortedPages.next(); Block[] blocksArray = new Block[outputChannels.length]; for (int i = 0; i < outputChannels.length; i++) { blocksArray[i] = resultPage.getBlock(outputChannels[i]); } return new Page(resultPage.getPositionCount(), blocksArray); }
Source:
private FilePosition(int line, int column) { this.line = line; this.column = column; }

Target:
private FilePosition(int line, int column) { Preconditions.condition(line > 0, "line number must be greater than zero"); Preconditions.condition(column > 0, "column number must be greater than zero"); this.line = line; this.column = Integer.valueOf(column); }
Source:
public boolean equals(LogicalWindow window) { if(normal_.equals(window.normal_)) return true; return false; }

Target:
public boolean equals(LogicalWindow window) { return normal_.equals(window.normal_); }
Source:
List<PermissionRule> getOverridden(String permissionName) { List<PermissionRule> r = overridden.get(permissionName); return r != null ? r : Collections.<PermissionRule> emptyList(); }

Target:
List<PermissionRule> getOverridden(String permissionName) { return firstNonNull( overridden.get(permissionName), Collections.<PermissionRule> emptyList()); }
Source:
private void renameApplicationToApplicationName() throws DeploymentException { if (!FilenameUtils.getBaseName(deploymentConfiguration.getApplication().getName()) .equals(deploymentConfiguration.getApplicationName())) { try { File destApplication = new File(deploymentConfiguration.getApplication().getParentFile(), deploymentConfiguration.getApplicationName() + ".jar"); FileUtils.copyFile(deploymentConfiguration.getApplication(), destApplication); deploymentConfiguration.setApplication(destApplication); } catch (IOException e) { throw new DeploymentException("Couldn't rename [" + deploymentConfiguration.getApplication() + "] to [" + deploymentConfiguration.getApplicationName() + "]"); } } }

Target:
private void renameApplicationToApplicationName() throws DeploymentException { if (!FilenameUtils.getBaseName(deploymentConfiguration.getApplication().getName()) .equals(deploymentConfiguration.getApplicationName())) { try { File destApplication = new File(deploymentConfiguration.getApplication().getParentFile(), deploymentConfiguration.getApplicationName() + ".jar"); FileUtils.copyFile(deploymentConfiguration.getApplication(), destApplication); deploymentConfiguration.setApplication(destApplication); } catch (IOException e) { throw new DeploymentException("Fail to rename [" + deploymentConfiguration.getApplication() + "] to [" + deploymentConfiguration.getApplicationName() + "]"); } } }
Source:
public void onClickIdentifierOptions(final int position, View view) { PopupMenu popup = new PopupMenu(getContext(), view); popup.getMenuInflater().inflate(R.menu.menu_client_identifier, popup.getMenu()); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.menu_remove_identifier: new AlertDialog.Builder(getActivity(), R.style.MaterialAlertDialogStyle) .setMessage("Do you really want to delete?") .setPositiveButton("Delete", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { mClientIdentifiersPresenter. deleteIdentifier(clientId, identifiers. get(position).getId(), position); } }) .setNegativeButton("Cancel", null).show(); break; case R.id.menu_identifier_documents: DocumentListFragment documentListFragment = DocumentListFragment .newInstance( Constants.ENTITY_TYPE_CLIENT_IDENTIFIERS, identifiers.get(position).getId()); FragmentTransaction fragmentTransaction = getActivity().getSupportFragmentManager().beginTransaction(); fragmentTransaction.addToBackStack(FragmentConstants .FRAG_CLIENT_IDENTIFIER); fragmentTransaction.replace(R.id.container, documentListFragment); fragmentTransaction.commit(); break; default: break; } return true; } }); popup.show(); }

Target:
public void onClickIdentifierOptions(final int position, View view) { PopupMenu popup = new PopupMenu(getContext(), view); popup.getMenuInflater().inflate(R.menu.menu_client_identifier, popup.getMenu()); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.menu_remove_identifier: new AlertDialog.Builder(getActivity(), R.style.MaterialAlertDialogStyle) .setMessage(R.string.confirm_delete_identifiers) .setPositiveButton(R.string.dialog_action_delete, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { mClientIdentifiersPresenter. deleteIdentifier(clientId, identifiers. get(position).getId(), position); } }) .setNegativeButton(R.string.cancel, null).show(); break; case R.id.menu_identifier_documents: DocumentListFragment documentListFragment = DocumentListFragment .newInstance( Constants.ENTITY_TYPE_CLIENT_IDENTIFIERS, identifiers.get(position).getId()); FragmentTransaction fragmentTransaction = getActivity().getSupportFragmentManager().beginTransaction(); fragmentTransaction.addToBackStack(FragmentConstants .FRAG_CLIENT_IDENTIFIER); fragmentTransaction.replace(R.id.container, documentListFragment); fragmentTransaction.commit(); break; default: break; } return true; } }); popup.show(); }
Source:
private void calcMedicalSupportHoursNeeded() { int activePersonnelCount = getCampaign().getActivePersonnel().size(); int numSquads = new BigDecimal(activePersonnelCount) .divide(new BigDecimal(7), 0, RoundingMode.DOWN).intValue(); int leftOver = activePersonnelCount - (numSquads * 7); medSupportNeeded = (numSquads * 4) + (new BigDecimal(leftOver).divide( new BigDecimal(5), 0, RoundingMode.HALF_EVEN).intValue()); if(medSupportNeeded != 0){ medSupportNeeded += 3; } }

Target:
private void calcMedicalSupportHoursNeeded() { int activePersonnelCount = getCampaign().getActivePersonnel().size(); int numSquads = (int) (activePersonnelCount / 7); medSupportNeeded = numSquads * 4; int leftOver = activePersonnelCount - (numSquads * 7); if (leftOver > 0) { medSupportNeeded += (int) Math.round(3 + leftOver / 5.0); } }
Source:
public void idTokenWithAudience_incorrect() throws IOException { final String accessToken1 = "1/MkSJoj1xsli0AccessToken_NKPY2"; MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); MockTokenServerTransport transport = transportFactory.transport; ServiceAccountCredentials credentials = ServiceAccountCredentials.fromPkcs8( SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID, SCOPES, transportFactory, null); transport.addServiceAccount(SA_CLIENT_EMAIL, accessToken1); TestUtils.assertContainsBearerToken(credentials.getRequestMetadata(CALL_URI), accessToken1); String targetAudience = "https://bar"; IdTokenCredentials tokenCredential = IdTokenCredentials.create(credentials, targetAudience); tokenCredential.refresh(); assertNotEquals( targetAudience, (String) tokenCredential.getIdToken().getJsonWebSignature().getPayload().getAudience()); }

Target:
public void idTokenWithAudience_incorrect() throws IOException { String accessToken1 = "1/MkSJoj1xsli0AccessToken_NKPY2"; MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); MockTokenServerTransport transport = transportFactory.transport; ServiceAccountCredentials credentials = ServiceAccountCredentials.fromPkcs8( SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID, SCOPES, transportFactory, null); transport.addServiceAccount(SA_CLIENT_EMAIL, accessToken1); TestUtils.assertContainsBearerToken(credentials.getRequestMetadata(CALL_URI), accessToken1); String targetAudience = "https://bar"; IdTokenCredentials tokenCredential = IdTokenCredentials.newBuilder() .setIdTokenProvider(credentials) .setTargetAudience(targetAudience) .build(); tokenCredential.refresh(); assertNotEquals( targetAudience, (String) tokenCredential.getIdToken().getJsonWebSignature().getPayload().getAudience()); }
Source:
public int hashCode() { return Objects.hash(getId(), getUrl(), getTitle(), _ignoreCertificateErrors, getTriggeringEventName()); }

Target:
public int hashCode() { return Objects.hash(_id, _uri, _title, _ignoreCertificateErrors, _triggeringEventName); }
Source:
public void onPartitionBecomeDroppedFromOffline(String partitionName) { PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); if (storageManagerListener != null) { try { storageManagerListener.onPartitionBecomeDroppedFromOffline(partitionName); } catch (Exception e) { participantMetrics.offlineCount.addAndGet(-1); participantMetrics.errorStateCount.addAndGet(1); throw e; } } participantMetrics.offlineCount.addAndGet(-1); participantMetrics.partitionDroppedCount.inc(); }

Target:
public void onPartitionBecomeDroppedFromOffline(String partitionName) { PartitionStateChangeListener storageManagerListener = partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener); try { if (storageManagerListener != null) { storageManagerListener.onPartitionBecomeDroppedFromOffline(partitionName); } } catch (Exception e) { participantMetrics.errorStateCount.addAndGet(1); throw e; } finally { participantMetrics.offlineCount.addAndGet(-1); } participantMetrics.partitionDroppedCount.inc(); }
Source:
public int hashCode() { return Objects.hash(proposalNumber, status, projectTitle, startDate, stopDate, directCostAmount, indirectCostAmount, totalAmount, grantNumber, grantDescription, federalPassThrough, federalPassThroughAgencyNumber, cfdaNumber, organizationCode, costShareRequired, finalReportDueDate, principalAndCoPrincipalInvestigators, principalAndCoPrincipalInvestigators); }

Target:
public int hashCode() { return Objects.hash(proposalNumber, status, projectTitle, startDate, stopDate, directCostAmount, indirectCostAmount, totalAmount, grantNumber, grantDescription, federalPassThrough, federalPassThroughAgencyNumber, cfdaNumber, organizationCode, costShareRequired, finalReportDueDate, principalAndCoPrincipalInvestigators); }
Source:
private List<Question> handleSaveQuestions(final Long accountId, final DateTime todayLocal, final DateTime expireDate, final List<Question> questions, final ImmutableList<AccountQuestionResponses> todayQuestionResponseList) { final List<Question> savedQuestions = Lists.newArrayList(); for (Question question : questions) { final Optional<Long> savedAccountQuestionId = savedAccountQuestion(question, todayQuestionResponseList); final Boolean alreadySaved = savedAccountQuestionId.isPresent(); if (alreadySaved) { final Question savedQuestion = Question.withAccountQId(question, savedAccountQuestionId.get()); savedQuestions.add(savedQuestion); } else if (!alreadySaved) { final Long accountQuestionId = saveQuestion(accountId, question, todayLocal, expireDate); final Question savedQuestion = Question.withAccountQId(question, accountQuestionId); savedQuestions.add(savedQuestion); } } return savedQuestions; }

Target:
private List<Question> handleSaveQuestions(final Long accountId, final DateTime todayLocal, final DateTime expireDate, final List<Question> questions, final ImmutableList<AccountQuestionResponses> todayQuestionResponseList) { final List<Question> savedQuestions = Lists.newArrayList(); for (final Question question : questions) { final Optional<Long> savedAccountQuestionId = savedAccountQuestion(question, todayQuestionResponseList); final Long accountQuestionId; if (savedAccountQuestionId.isPresent()) { accountQuestionId = savedAccountQuestionId.get(); } else { accountQuestionId = saveQuestion(accountId, question, todayLocal, expireDate); } final Question savedQuestion = Question.withAccountQId(question, accountQuestionId); savedQuestions.add(savedQuestion); } return savedQuestions; }
Source:
void createItem (TreeItem item, long parentIter, int index) { item.handle = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (item.handle == 0) error(SWT.ERROR_NO_HANDLES); if (index == 0) { GTK.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index); } else if (index == -1) { GTK.gtk_tree_store_append (modelHandle, item.handle, parentIter); } else { int count = GTK.gtk_tree_model_iter_n_children (modelHandle, parentIter); if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE); if (index == count) { GTK.gtk_tree_store_append (modelHandle, item.handle, parentIter); } else { GTK.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index); } } int id = getId (item.handle, false); items [id] = item; modelChanged = true; }

Target:
void createItem (TreeItem item, long parentIter, int index) { if (index == 0) { item.handle = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (item.handle == 0) error(SWT.ERROR_NO_HANDLES); GTK.gtk_tree_store_prepend (modelHandle, item.handle, parentIter); } else if (index == -1) { item.handle = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (item.handle == 0) error(SWT.ERROR_NO_HANDLES); GTK.gtk_tree_store_append (modelHandle, item.handle, parentIter); } else { int count = GTK.gtk_tree_model_iter_n_children (modelHandle, parentIter); if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE); item.handle = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (item.handle == 0) error(SWT.ERROR_NO_HANDLES); if (index == count) { GTK.gtk_tree_store_append (modelHandle, item.handle, parentIter); } else { GTK.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index); } } int id = getId (item.handle, false); items [id] = item; modelChanged = true; }
Source:
public boolean sessionIsValid(String ssoTicket) { return new IAMRestClient().isSSOTicketValid(iamURL + IAMConfiguration.IAM_TICKET_REQUEST + "/" + ssoTicket); }

Target:
public boolean sessionIsValid(String ssoTicket) { return iamRestClient.isSSOTicketValid(iamURL + IAMConfiguration.IAM_TICKET_REQUEST + "/" + ssoTicket); }
Source:
private void printResult(PluginWrapper.PluginDisableResult oneResult, int indent) { PluginWrapper.PluginDisableStatus status = oneResult.getStatus(); if(quiet && (PluginWrapper.PluginDisableStatus.DISABLED.equals(status) || PluginWrapper.PluginDisableStatus.ALREADY_DISABLED.equals(status))) { return; } printIndented(indent, Messages.DisablePluginCommand_StatusMessage(oneResult.getPlugin(), oneResult.getStatus(), oneResult.getMessage())); if(oneResult.getDependantsDisableStatus().size() > 0) { indent = (indent == 0) ? INDENT_SPACE : indent*2; for (PluginWrapper.PluginDisableResult oneDependantResult : oneResult.getDependantsDisableStatus()) { printResult(oneDependantResult, indent); } } }

Target:
private void printResult(PluginWrapper.PluginDisableResult oneResult, int indent) { PluginWrapper.PluginDisableStatus status = oneResult.getStatus(); if (quiet && (PluginWrapper.PluginDisableStatus.DISABLED.equals(status) || PluginWrapper.PluginDisableStatus.ALREADY_DISABLED.equals(status))) { return; } printIndented(indent, Messages.DisablePluginCommand_StatusMessage(oneResult.getPlugin(), oneResult.getStatus(), oneResult.getMessage())); if (oneResult.getDependantsDisableStatus().size() > 0) { indent += INDENT_SPACE; for (PluginWrapper.PluginDisableResult oneDependantResult : oneResult.getDependantsDisableStatus()) { printResult(oneDependantResult, indent); } } }
Source:
public Optional<byte[]> checkSplit(boolean force) { if (this.getRegionInfo().isMetaRegion()) { return Optional.empty(); } if (this.isClosing()) { return Optional.empty(); } if (!force && !splitPolicy.shouldSplit()) { return null; } byte[] ret = splitPolicy.getSplitPoint(); if (ret != null) { try { checkRow(ret, "calculated split"); } catch (IOException e) { LOG.error("Ignoring invalid split for region {}", this, e); return Optional.empty(); } return Optional.of(ret); } else { return Optional.empty(); } }

Target:
public Optional<byte[]> checkSplit(boolean force) { if (this.getRegionInfo().isMetaRegion()) { return Optional.empty(); } if (this.isClosing()) { return Optional.empty(); } if (!force && !splitPolicy.shouldSplit()) { return Optional.empty(); } byte[] ret = splitPolicy.getSplitPoint(); if (ret != null) { try { checkRow(ret, "calculated split"); } catch (IOException e) { LOG.error("Ignoring invalid split for region {}", this, e); return Optional.empty(); } return Optional.of(ret); } else { return Optional.empty(); } }
Source:
public void testMultiplePositions(double maxStandardError) { DescriptiveStatistics stats = new DescriptiveStatistics(); for (int i = 0; i < 500; ++i) { int uniques = ThreadLocalRandom.current().nextInt(getUniqueValuesCount()) + 1; List<Object> values = createRandomSample(uniques, (int) (uniques * 1.5)); long actual = estimateGroupByCount(values, maxStandardError); double error = (actual - uniques) * 1.0 / uniques; stats.addValue(error); } assertLessThan(stats.getMean(), 1.0e-2); assertLessThan(Math.abs(stats.getStandardDeviation()), 1.0e-2 + maxStandardError); }

Target:
public void testMultiplePositions(double maxStandardError) { DescriptiveStatistics stats = new DescriptiveStatistics(); for (int i = 0; i < 500; ++i) { int uniques = ThreadLocalRandom.current().nextInt(getUniqueValuesCount()) + 1; List<Object> values = createRandomSample(uniques, (int) (uniques * 1.5)); long actual = estimateGroupByCount(values, maxStandardError); double error = (actual - uniques) * 1.0 / uniques; stats.addValue(error); } assertLessThan(stats.getMean(), 1.0e-2); assertLessThan(stats.getStandardDeviation(), 1.0e-2 + maxStandardError); }
Source:
private void handleFullTasksCircularBuffer(Runnable r, int sleepMillis) { final Thread currentThread = Thread.currentThread(); if (eventThread == currentThread) { int size = tasks.size(); if (size == tasks.capacity()) { try { while (size > 0) { tasks.pollUnsafe().run(); size--; } } catch (RuntimeException e) { logger.error("", e); throw e; } catch (Exception e) { logger.error("", e); throw new RuntimeException(e); } } else { logger.error("Failed to add Runnable to tasks and size is not equal to capacity {}.", r, tasks, size, tasks.capacity()); throw new IllegalStateException("size " + size + " should be equal to capacity " + tasks.capacity()); } } else { selector.wakeup(); try { sleep(sleepMillis); } catch (InterruptedException ex) { logger.error("Interrupted", ex); throw new RuntimeException(ex); } } }

Target:
private void handleFullTasksCircularBuffer(Runnable r, int sleepMillis) { final Thread currentThread = Thread.currentThread(); if (eventThread == currentThread) { int size = tasks.size(); if (size == tasks.capacity()) { while (size > 0) { tasks.pollUnsafe().run(); size--; } } else { logger.error("Failed to add Runnable to tasks and size is not equal to capacity {}.", r, tasks, size, tasks.capacity()); throw new IllegalStateException("size " + size + " should be equal to capacity " + tasks.capacity()); } } else { selector.wakeup(); try { sleep(sleepMillis); } catch (InterruptedException e) { throw new RuntimeException(e); } } }
Source:
public void setup() { if (!initialized) { registerUser(USER_NAME_1, USER_PASSWORD_1); registerUser(USER_NAME_2, USER_PASSWORD_2); registerUser(USER_NAME_3, USER_PASSWORD_3); initialized = true; } scenario = new Scenario((RandomUtilMock) randomUtil); }

Target:
public void setup() { scenario = new Scenario((RandomUtilMock) randomUtil); if (!initialized) { scenario .registerUser(USER_NAME_1, USER_PASSWORD_1) .registerUser(USER_NAME_2, USER_PASSWORD_2) .registerUser(USER_NAME_3, USER_PASSWORD_3); initialized = true; } }
Source:
public DomainNameList(List<String> values) { this.values = values; }

Target:
public DomainNameList(List<String> values) { this.values = ImmutableList.copyOf(values); }
Source:
public void clear(final Collection<Long> records) { execute(new Callable<Void>() { @Override public Void call() throws Exception { for (Long record: records) { client.clear1(record, creds, transaction); } return null; } }); }

Target:
public void clear(final Collection<Long> records) { for (Long record: records) { clear(record); } }
Source:
private void executeRefUpdates() throws UpdateException { if (batchRefUpdate.getCommands().isEmpty()) { return; } try { inserter.flush(); batchRefUpdate.execute(revWalk, NullProgressMonitor.INSTANCE); boolean ok = true; for (ReceiveCommand cmd : batchRefUpdate.getCommands()) { if (cmd.getResult() != ReceiveCommand.Result.OK) { ok = false; break; } } if (!ok) { throw new UpdateException("BatchRefUpdate failed: " + batchRefUpdate); } gitRefUpdated.fire(project, batchRefUpdate); } catch (IOException e) { throw new UpdateException(e); } }

Target:
private void executeRefUpdates() throws UpdateException { if (batchRefUpdate.getCommands().isEmpty()) { return; } try { inserter.flush(); batchRefUpdate.execute(revWalk, NullProgressMonitor.INSTANCE); boolean ok = true; for (ReceiveCommand cmd : batchRefUpdate.getCommands()) { if (cmd.getResult() != ReceiveCommand.Result.OK) { ok = false; break; } } if (!ok) { throw new UpdateException("BatchRefUpdate failed: " + batchRefUpdate); } } catch (IOException e) { throw new UpdateException(e); } }
Source:
private String getCassandraAlias() { if (renameCassandraMetrics()) { Map<String, String> beanParameters = getBeanParameters(); String type = beanParameters.get("type"); String metricName = beanParameters.get("name"); String attributeName = getAttributeName(); if (attributeName.equals("Value")) { return "cassandra." + metricName; } return "cassandra." + metricName + "." + attributeName; } return getDomain().replace("org.apache.", "") + "." + getAttributeName(); }

Target:
private String getCassandraAlias() { if (renameCassandraMetrics()) { Map<String, String> beanParameters = getBeanParameters(); String metricName = beanParameters.get("name"); String attributeName = getAttributeName(); if (attributeName.equals("Value")) { return "cassandra." + metricName; } return "cassandra." + metricName + "." + attributeName; } return getDomain().replace("org.apache.", "") + "." + getAttributeName(); }
Source:
public void processBitmapForWrite(BitmapCommit c, Bitmap bitmap, int flags) { EWAHCompressedBitmap compressed = retrieveCompressed(bitmap); compressed.trim(); StoredBitmap newest = new StoredBitmap(c, compressed, null, flags); searchOffset.add(newest); if (searchOffset.size() > MAX_XOR_OFFSET_SEARCH) { StoredEntry writeEntry = generateStoredEntry( searchOffset.pollFirst()); bitmapsToWrite.add(writeEntry); } if (c.isAddToIndex()) { addBitmap(c, bitmap, flags); } }

Target:
public void processBitmapForWrite(BitmapCommit c, Bitmap bitmap, int flags) { EWAHCompressedBitmap compressed = retrieveCompressed(bitmap); compressed.trim(); StoredBitmap newest = new StoredBitmap(c, compressed, null, flags); bitmapsToWriteXorBuffer.add(newest); if (bitmapsToWriteXorBuffer.size() > MAX_XOR_OFFSET_SEARCH) { bitmapsToWrite.add( generateStoredEntry(bitmapsToWriteXorBuffer.pollFirst())); } if (c.isAddToIndex()) { addBitmap(c, bitmap, flags); } }
Source:
public static synchronized RegistryService getInstance() { RegistryService local = instance; if (local == null) { local = new RegistryService(); instance = local; ReporterFactory.getOrCreateReporter(); } return local; }

Target:
public static synchronized RegistryService getInstance() { if (instance == null) { instance = new RegistryService(); ReporterFactory.getOrCreateReporter(); } return instance; }
Source:
createEntityChangeBlock(Game game, Cause cause, Entity entity, BlockLoc block, BlockSnapshot replacementBlock) { Map<String, Object> values = Maps.newHashMap(); values.put("game", game); values.put("cause", Optional.fromNullable(cause)); values.put("block", block); values.put("entity", entity); values.put("replacementBlock", replacementBlock); return createEvent(EntityChangeBlockEvent.class, values); }

Target:
public static EntityChangeBlockEvent createEntityChangeBlock(Game game, Cause cause, Entity entity, BlockLoc block, BlockSnapshot replacementBlock) { Map<String, Object> values = Maps.newHashMap(); values.put("game", game); values.put("cause", Optional.fromNullable(cause)); values.put("block", block); values.put("entity", entity); values.put("replacementBlock", replacementBlock); return createEvent(EntityChangeBlockEvent.class, values); }
Source:
public SimpleTableDef[] detectTableDefs() { final List<SimpleTableDef> tableDefs = new ArrayList<>(); final String labelsJsonString = _requestWrapper.executeRestRequest(new HttpGet(_serviceRoot + "/labels")); final JSONArray labelsJsonArray; try { labelsJsonArray = new JSONArray(labelsJsonString); for (int i = 0; i < labelsJsonArray.length(); i++) { fillTableDefsFromLabel(labelsJsonArray.getString(i), tableDefs); } return tableDefs.toArray(new SimpleTableDef[tableDefs.size()]); } catch (final JSONException e) { logger.error("Error occured in parsing JSON while detecting the schema: ", e); throw new IllegalStateException(e); } }

Target:
public SimpleTableDef[] detectTableDefs() { final List<SimpleTableDef> tableDefs = new ArrayList<>(); final String labelsJsonString = _requestWrapper.executeRestRequest(new HttpGet(_serviceRoot + "/labels")); final JSONArray labelsJsonArray; try { labelsJsonArray = new JSONArray(labelsJsonString); for (int i = 0; i < labelsJsonArray.length(); i++) { final SimpleTableDef tableDefFromLabel = createTableDefFromLabel(labelsJsonArray.getString(i)); if (tableDefFromLabel != null) { tableDefs.add(tableDefFromLabel); } } return tableDefs.toArray(new SimpleTableDef[tableDefs.size()]); } catch (final JSONException e) { logger.error("Error occurred in parsing JSON while detecting the schema: ", e); throw new IllegalStateException(e); } }
Source:
private IResource copyTrace(final String newName) { WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { @Override public void execute(IProgressMonitor monitor) throws CoreException { try { monitor.beginTask("", 1000); if (monitor.isCanceled()) { throw new OperationCanceledException(); } fTrace.copy(newName, fTraceFolder, true); if (monitor.isCanceled()) { throw new OperationCanceledException(); } } finally { monitor.done(); } } }; try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(operation); } catch (InterruptedException exception) { return null; } catch (InvocationTargetException exception) { MessageDialog.openError(getShell(), "", NLS.bind("", exception.getTargetException().getMessage())); return null; } catch (RuntimeException exception) { return null; } return fTrace.getResource(); }

Target:
private IResource copyTrace(final String newName) { WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { @Override public void execute(IProgressMonitor monitor) throws CoreException { try { monitor.beginTask("", 1000); if (monitor.isCanceled()) { throw new OperationCanceledException(); } fTrace.copy(newName, true); if (monitor.isCanceled()) { throw new OperationCanceledException(); } } finally { monitor.done(); } } }; try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(operation); } catch (InterruptedException exception) { return null; } catch (InvocationTargetException exception) { MessageDialog.openError(getShell(), "", NLS.bind("", exception.getTargetException().getMessage())); return null; } catch (RuntimeException exception) { return null; } return fTrace.getResource(); }
Source:
protected void executeCommand() { List<DiskImage> imageTemplates = ImagesHandler.filterImageDisks(DbFacade.getInstance().getDiskDao().getAllForVm( getVmTemplateId()), false, false, true); for (DiskImage template : imageTemplates) { for (Guid domain : (Collection<Guid>) CollectionUtils.intersection(getParameters().getStorageDomainsList(), template.getStorageIds())) { RemoveImageParameters tempVar = new RemoveImageParameters(template.getImageId()); tempVar.setDiskImage(template); tempVar.setStorageDomainId(domain); tempVar.setStoragePoolId(template.getStoragePoolId()); tempVar.setImageGroupID(template.getId()); tempVar.setEntityInfo(getParameters().getEntityInfo()); tempVar.setWipeAfterDelete(template.isWipeAfterDelete()); tempVar.setParentCommand(getActionType()); tempVar.setParentParameters(getParameters()); VdcReturnValueBase vdcReturnValue = runInternalActionWithTasksContext( VdcActionType.RemoveImage, tempVar); if (vdcReturnValue.getSucceeded()) { getReturnValue().getInternalVdsmTaskIdList().addAll(vdcReturnValue.getInternalVdsmTaskIdList()); } else { log.error("Can't remove image id '{}' for template id '{}' from domain id '{}' due to: {}.", template.getImageId(), getVmTemplateId(), domain, vdcReturnValue.getFault().getMessage()); } } } setSucceeded(true); }

Target:
protected void executeCommand() { List<DiskImage> imageTemplates = ImagesHandler.filterImageDisks(DbFacade.getInstance().getDiskDao().getAllForVm( getVmTemplateId()), false, false, true); for (DiskImage template : imageTemplates) { for (Guid domain : (Collection<Guid>) CollectionUtils.intersection(getParameters().getStorageDomainsList(), template.getStorageIds())) { RemoveDiskParameters tempVar = new RemoveDiskParameters(template.getId()); tempVar.setStorageDomainId(domain); tempVar.setParentCommand(getActionType()); tempVar.setParentParameters(getParameters()); VdcReturnValueBase vdcReturnValue = runInternalActionWithTasksContext( VdcActionType.RemoveDisk, tempVar); if (vdcReturnValue.getSucceeded()) { getReturnValue().getInternalVdsmTaskIdList().addAll(vdcReturnValue.getInternalVdsmTaskIdList()); } else { log.error("Can't remove image id '{}' for template id '{}' from domain id '{}' due to: {}.", template.getImageId(), getVmTemplateId(), domain, vdcReturnValue.getFault().getMessage()); } } } setSucceeded(true); }
Source:
public void shouldRevertFromTrash() { RevertFromTrash testRevert = testRevertFromTrashService.create(new RevertFromTrash("revertTest")); Long testSchemaVersion = testRevertFromTrashService.getSchemaVersion(); trashService.moveToTrash(testRevert, testSchemaVersion); assertNotNull("Instance is not in trash", testRevertFromTrashService.findTrashInstanceById(testRevert.getId())); testRevertFromTrashService.revertFromTrash(testRevert.getId()); assertNull("Instance is still in the trash.",testRevertFromTrashService.findTrashInstanceById(testRevert.getId())); }

Target:
public void shouldRevertFromTrash() { HomeAddress homeAddress1 = revertFromTrashService.create(new HomeAddress("street1","city1")); HomeAddress homeAddress2 = revertFromTrashService.create(new HomeAddress("street2","city2")); revertFromTrashService.delete(homeAddress1); revertFromTrashService.delete(homeAddress2); revertFromTrashService.revertFromTrash(homeAddress1.getId()); QueryParams q = new QueryParams(1,10); Collection instancesInTrash = trashService.getInstancesFromTrash(HomeAddress.class.getName(), q); Collection<HomeAddress> instancesOutsideTrash = revertFromTrashService.retrieveAll(); assertEquals(1, instancesInTrash.size()); assertEquals(1, instancesOutsideTrash.size()); }