auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ModelAndView getUsersGroup(HttpServletRequest request, HttpServletResponse response) { IPerson person = personManager.getPerson(request); Set<Entity> groups = Collections.EMPTY_SET; if (person != null) { groups = groupService.getGroupsForMember(person.getUserName()); } return new ModelAndView("json", "groups", groups); }

Target:
public ModelAndView getUsersGroup(HttpServletRequest request, HttpServletResponse response) { IPerson person = personManager.getPerson(request); Set<Entity> groups = Collections.EMPTY_SET; if (person != null) { String username = person.getUserName(); if (username != null) { groups = groupService.getGroupsForMember(username); } } return new ModelAndView("json", "groups", groups); }
Source:
public void getCache() throws IOException { RestResponse r = adminSession.get("/config/server/caches/accounts"); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); CacheInfo result = newGson().fromJson(r.getReader(), new TypeToken<CacheInfo>() {}.getType()); assertEquals("accounts", result.name); assertNull(result.type); assertEquals(1, result.entries.mem.longValue()); assertNotNull(result.averageGet); assertTrue(result.averageGet.endsWith("s")); assertNull(result.entries.disk); assertNull(result.entries.space); assertTrue(result.hitRatio.mem >= 0); assertTrue(result.hitRatio.mem <= 100); assertNull(result.hitRatio.disk); userSession.get("/config/server/version").consume(); r = adminSession.get("/config/server/caches/accounts"); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); result = newGson().fromJson(r.getReader(), new TypeToken<CacheInfo>() {}.getType()); assertEquals(2, result.entries.mem.longValue()); }

Target:
public void getCache() throws IOException { RestResponse r = adminSession.get("/config/server/caches/accounts"); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); CacheInfo result = newGson().fromJson(r.getReader(), CacheInfo.class); assertEquals("accounts", result.name); assertNull(result.type); assertEquals(1, result.entries.mem.longValue()); assertNotNull(result.averageGet); assertTrue(result.averageGet.endsWith("s")); assertNull(result.entries.disk); assertNull(result.entries.space); assertTrue(result.hitRatio.mem >= 0); assertTrue(result.hitRatio.mem <= 100); assertNull(result.hitRatio.disk); userSession.get("/config/server/version").consume(); r = adminSession.get("/config/server/caches/accounts"); assertEquals(HttpStatus.SC_OK, r.getStatusCode()); result = newGson().fromJson(r.getReader(), CacheInfo.class); assertEquals(2, result.entries.mem.longValue()); }
Source:
public static Controller[] availableControllers() { try { @SuppressWarnings("unchecked") final Constructor<ControllerEnvironment> constructor = (Constructor<ControllerEnvironment>) Class.forName("net.java.games.input.DefaultControllerEnvironment").getDeclaredConstructors()[0]; constructor.setAccessible(true); return constructor.newInstance().getControllers(); } catch (final InvocationTargetException | ClassNotFoundException | IllegalAccessException | InstantiationException e) { Log.error("Unable to scan for joysticks"); return null; } }

Target:
static Controller[] availableControllers() { try { @SuppressWarnings("unchecked") final Constructor<ControllerEnvironment> constructor = (Constructor<ControllerEnvironment>) Class.forName("net.java.games.input.DefaultControllerEnvironment").getDeclaredConstructors()[0]; constructor.setAccessible(true); return constructor.newInstance().getControllers(); } catch (final InvocationTargetException | ClassNotFoundException | IllegalAccessException | InstantiationException e ) { Log.error("Unable to scan for joysticks"); return new Controller[]{}; } }
Source:
public void testFooPing() { Logger logger = Logger.getLogger(JMXMethodExecutor.class.getName()); Level originalLevel = logger.getLevel(); logger.setLevel(Level.OFF); new Weld().initialize(); logger.setLevel(originalLevel); }

Target:
public void testFooPing() { new Weld().initialize(); }
Source:
public void send(final String topic, final byte[] message) { final String combinedTopic = topicPrefix + topic; if (!healthchecker.isHealthy()) { log.warn("will not publish message to pubsub topic={} as the pubsub client " + "appears to be unhealthy"); return; } try { Futures.addCallback( JdkFutureAdapters.listenInPoolThread( pubsub.publishAsync(combinedTopic, Message.of(ByteArray.copyFrom(message)))), new FutureCallback<String>() { @Override public void onSuccess(@Nullable final String ackId) { log.debug("Sent an event to Google PubSub, topic: {}, ack: {}", combinedTopic, ackId); } @Override public void onFailure(final Throwable t) { log.warn("Unable to send an event to Google PubSub, topic: {}", combinedTopic, t); } }); } catch (Exception e) { log.warn("Failed to publish Google PubSub message, topic: {}", combinedTopic, e); } }

Target:
public void send(final String topic, final byte[] message) { final String combinedTopic = topicPrefix + topic; if (!healthchecker.isHealthy()) { log.warn("will not publish message to pubsub topic={} as the pubsub client " + "appears to be unhealthy", combinedTopic); return; } try { Futures.addCallback( JdkFutureAdapters.listenInPoolThread( pubsub.publishAsync(combinedTopic, Message.of(ByteArray.copyFrom(message)))), new FutureCallback<String>() { @Override public void onSuccess(@Nullable final String ackId) { log.debug("Sent an event to Google PubSub, topic: {}, ack: {}", combinedTopic, ackId); } @Override public void onFailure(final Throwable t) { log.warn("Unable to send an event to Google PubSub, topic: {}", combinedTopic, t); } }); } catch (Exception e) { log.warn("Failed to publish Google PubSub message, topic: {}", combinedTopic, e); } }
Source:
void assertValidUserFields(UserDto userResource, UserPurpose userPurpose) { if (StringUtils.isBlank(userResource.getFirstName())) { throw InvalidDataException.blankFirstName(); } if (StringUtils.isBlank(userResource.getLastName())) { throw InvalidDataException.blankLastName(); } if (userPurpose == UserPurpose.USER && StringUtils.isBlank(userResource.getPrivateData().getNickname())) { throw InvalidDataException.blankNickname(); } if (StringUtils.isBlank(userResource.getMobileNumber())) { throw InvalidDataException.blankMobileNumber(); } assertValidMobileNumber(userResource.getMobileNumber()); if (userPurpose == UserPurpose.BUDDY) { if (StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.blankEmailAddress(); } assertValidEmailAddress(userResource.getEmailAddress()); if (!userResource.getPrivateData().getGoals().isEmpty()) { throw InvalidDataException.excessGoals(); } } else { if (!StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.excessEmailAddress(); } } }

Target:
void assertValidUserFields(UserDto userResource, UserPurpose userPurpose) { if (StringUtils.isBlank(userResource.getFirstName())) { throw InvalidDataException.blankFirstName(); } if (StringUtils.isBlank(userResource.getLastName())) { throw InvalidDataException.blankLastName(); } if (userPurpose == UserPurpose.USER && StringUtils.isBlank(userResource.getPrivateData().getNickname())) { throw InvalidDataException.blankNickname(); } if (StringUtils.isBlank(userResource.getMobileNumber())) { throw InvalidDataException.blankMobileNumber(); } assertValidMobileNumber(userResource.getMobileNumber()); if (userPurpose == UserPurpose.BUDDY) { if (StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.blankEmailAddress(); } assertValidEmailAddress(userResource.getEmailAddress()); if (!userResource.getPrivateData().getGoals().isEmpty()) { throw InvalidDataException.goalsNotSupported(); } } else { if (!StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.excessEmailAddress(); } } }
Source:
public String getResourceLoaderPath() { return "https://" + language + ".wikipedia.org/w/load.php"; }

Target:
public String getResourceLoaderPath() { return getScriptPath("load.php"); }
Source:
public void validate(Object target, Errors errors) { ValidationUtils.rejectIfEmpty(errors, "BloodTest.testName", "testName.empty", "The testName is required"); ValidationUtils.rejectIfEmpty(errors, "BloodTest.category", "category.empty", "The bloodTestCategory is required"); ValidationUtils.rejectIfEmpty(errors, "BloodTest.validResults", "validResults.empty", "The validResults is required"); ValidationUtils.rejectIfEmpty(errors, "BloodTest.testNameShort", "testNameShort.empty", "The testNameShort is required"); ValidationUtils.rejectIfEmpty(errors, "BloodTest.rankInCategory", "rankInCategory.empty", "The rankInCategory is required"); }

Target:
public void validate(Object target, Errors errors) { BloodTestBackingForm form = (BloodTestBackingForm) target; if (StringUtils.isBlank(form.getTestName())) errors.rejectValue("BloodTest.testName", "testName.empty", "The testName is required"); if (form.getBloodTestCategory() == null) errors.rejectValue("BloodTest.category", "category.empty", "The bloodTestCategory is required"); if (StringUtils.isBlank(form.getValidResults())) errors.rejectValue("BloodTest.validResults", "validResults.empty", "The validResults is required"); if (StringUtils.isBlank(form.getTestNameShort())) errors.rejectValue("BloodTest.testNameShort", "testNameShort.empty", "The testNameShort is required"); if (form.getRankInCategory() == null) errors.rejectValue("BloodTest.rankInCategory", "rankInCategory.empty", "The rankInCategory is required"); }
Source:
public void testWithQualifiedPrefix() { assertQuery("" + "WITH a AS (SELECT 123)" + "SELECT a.* FROM a", "SELECT 123"); }

Target:
public void testWithQualifiedPrefix() { assertQuery("WITH a AS (SELECT 123) SELECT a.* FROM a", "SELECT 123"); }
Source:
private Set<VCFHeaderLine> getSampleHeaderLines(){ final Set<VCFHeaderLine> sampleLines = new HashSet<>(); if (hasNormal()) { final Map<String, String> normalSampleHeaderAttributes = ImmutableMap.of("ID", "NORMAL", "Sample", MTAC.normalSampleName); sampleLines.add(new VCFSimpleHeaderLine("sample", normalSampleHeaderAttributes)); } final Map<String, String> tumorSampleHeaderAttributes = ImmutableMap.of("ID", "TUMOR", "Sample", MTAC.tumorSampleName); sampleLines.add(new VCFSimpleHeaderLine("sample", tumorSampleHeaderAttributes)); return sampleLines; }

Target:
private Set<VCFHeaderLine> getSampleHeaderLines(){ final Set<VCFHeaderLine> sampleLines = new HashSet<>(); if (hasNormal()) { final Map<String, String> normalSampleHeaderAttributes = ImmutableMap.of("ID", "NORMAL", "name", MTAC.normalSampleName); sampleLines.add(new VCFSimpleHeaderLine("sample", normalSampleHeaderAttributes)); } final Map<String, String> tumorSampleHeaderAttributes = ImmutableMap.of("ID", "TUMOR", "name", MTAC.tumorSampleName); sampleLines.add(new VCFSimpleHeaderLine("sample", tumorSampleHeaderAttributes)); return sampleLines; }
Source:
public void tearDown() throws InterruptedException { verifyNoMoreInteractions(mockedEvents); monitorByServer.clear(); previousRequestsByServer.clear(); }

Target:
public void tearDown() throws InterruptedException { verifyNoMoreInteractions(mockedEvents); }
Source:
public JobStatus getJobStatus(JobInstance jobInstance) { Job job = retriableHttpGet(baseUrl -> String.format(ResourceConstants.GET_JOBS_URL, baseUrl, jobInstance.getJobName(), jobInstance.getJobId()), new TypeReference<Job>(){}); return job.getStatus(); }

Target:
public JobStatus getJobStatus(JobInstance jobInstance) { Job job = queryJobStatusServers(baseUrl -> String.format(ResourceConstants.GET_JOBS_URL, baseUrl, jobInstance.getJobName(), jobInstance.getJobId()), new TypeReference<Job>(){}); return job.getStatus(); }
Source:
public T VALUES(String columns, String values) { sql().columns.add(columns); sql().values.add(Collections.singletonList(values)); return getSelf(); }

Target:
public T VALUES(String columns, String values) { INTO_COLUMNS(columns); INTO_VALUES(values); return getSelf(); }
Source:
public static SleepPeriod createSleepPeriod(final DateTime inBedTime){ final Integer inBedHour = inBedTime.getHourOfDay(); if (inBedHour >= 4 && inBedHour < 12){ final DateTime targetDate = inBedTime.withTimeAtStartOfDay(); return SleepPeriod.morning(targetDate); } else if (inBedHour >= 12 && inBedHour < 20){ final DateTime targetDate = inBedTime.withTimeAtStartOfDay(); return SleepPeriod.afternoonEvening(targetDate); } else { final DateTime targetDate; if (inBedHour < 4){ targetDate = inBedTime.withTimeAtStartOfDay().minusDays(1); }else{ targetDate = inBedTime.withTimeAtStartOfDay(); } return SleepPeriod.night(targetDate); } }

Target:
public static SleepPeriod createSleepPeriod(final DateTime inBedTime){ final Integer inBedHour = inBedTime.getHourOfDay(); if (inBedHour >= MORNING_START_HOUR && inBedHour < MORNING_IN_BED_END_HOUR){ final DateTime targetDate = inBedTime.withTimeAtStartOfDay(); return SleepPeriod.morning(targetDate); } else if (inBedHour >= AFTERNOON_START_HOUR && inBedHour < AFTERNOON_IN_BED_END_HOUR){ final DateTime targetDate = inBedTime.withTimeAtStartOfDay(); return SleepPeriod.afternoonEvening(targetDate); } else { final DateTime targetDate; if (inBedHour < MORNING_START_HOUR){ targetDate = inBedTime.withTimeAtStartOfDay().minusDays(1); }else{ targetDate = inBedTime.withTimeAtStartOfDay(); } return SleepPeriod.night(targetDate); } }
Source:
public static boolean validWebForm(final SurveyGroup surveyGroup, final Survey survey, final List<Question> questions){ boolean validQuestionGroups = validQuestionGroups(survey); if (!validQuestionGroups) return false; boolean validSurveyGroup = validSurveyGroup(surveyGroup); if (!validSurveyGroup) return false; List<Question> validQuestions = questions.stream().filter(i -> !unsupportedQuestionTypes().contains(i.getType().toString())).collect(Collectors.toList()); return validQuestions.size() == questions.size(); }

Target:
public static boolean validWebForm(final SurveyGroup surveyGroup, final Survey survey, final List<Question> questions) { boolean validQuestionGroups = validQuestionGroups(survey); if (!validQuestionGroups) { return false; } boolean validSurveyGroup = validForm(survey, surveyGroup); if (!validSurveyGroup) { return false; } List<Question> validQuestions = questions.stream().filter(i -> !unsupportedQuestionTypes().contains(i.getType().toString())).collect(Collectors.toList()); return validQuestions.size() == questions.size(); }
Source:
@Override public byte fieldsCount() { return 11; }

Target:
@Override public byte fieldsCount() { return 8; }
Source:
private void show(final String graphUuid, final Element<? extends Definition<?>> element, final Command callback) { if (element != null) { if (lastElement != null && lastElement.getUUID().equals(element.getUUID()) && element instanceof Node) { lastPosition = GraphUtils.getComputedPosition((Node<?, ? extends Edge>) element); return; } final String uuid = element.getUUID(); final Diagram<?, ?> diagram = formSessionHandler.getDiagram(); if (Objects.isNull(diagram)) { return; } final Metadata metadata = diagram.getMetadata(); if (Objects.isNull(metadata)) { return; } final Path diagramPath = metadata.getPath(); final Definition content = element.getContent(); if (Objects.isNull(content)) { return; } final Object definition = content.getDefinition(); final RenderMode renderMode = formSessionHandler.getSession() instanceof EditorSession ? RenderMode.EDIT_MODE : RenderMode.READ_ONLY_MODE; formsContainer.render(graphUuid, uuid, definition, diagramPath, (fieldName, newValue) -> { try { formSessionHandler.executeUpdateProperty(element, fieldName, newValue); } catch (final Exception ex) { log(Level.SEVERE, "Something wrong happened refreshing the canvas for " + "field '" + fieldName + "': " + ex.getCause()); } finally { if (null != callback) { callback.execute(); } } }, renderMode); final String name = definitionUtils.getName(definition); propertiesOpenedEvent.fire(new FormPropertiesOpened(formSessionHandler.getSession(), uuid, name)); lastElement = element; if (element instanceof Node) { lastPosition = GraphUtils.getComputedPosition((Node<?, ? extends Edge>) element); } } }

Target:
private void show(final String graphUuid, final Element<? extends Definition<?>> element, final Command callback) { if (element != null) { if (lastElement != null && lastElement.getUUID().equals(element.getUUID()) && isNode(element)) { lastPosition = GraphUtils.getComputedPosition((Node<?, ? extends Edge>) element); return; } final String uuid = element.getUUID(); final Diagram<?, ?> diagram = formSessionHandler.getDiagram(); if (Objects.isNull(diagram)) { return; } final Metadata metadata = diagram.getMetadata(); if (Objects.isNull(metadata)) { return; } final Path diagramPath = metadata.getPath(); final Definition content = element.getContent(); if (Objects.isNull(content)) { return; } final Object definition = content.getDefinition(); final RenderMode renderMode = formSessionHandler.getSession() instanceof EditorSession ? RenderMode.EDIT_MODE : RenderMode.READ_ONLY_MODE; formsContainer.render(graphUuid, uuid, definition, diagramPath, (fieldName, newValue) -> { try { formSessionHandler.executeUpdateProperty(element, fieldName, newValue); } catch (final Exception ex) { log(Level.SEVERE, "Something wrong happened refreshing the canvas for " + "field '" + fieldName + "': " + ex.getCause()); } finally { if (null != callback) { callback.execute(); } } }, renderMode); final String name = definitionUtils.getName(definition); propertiesOpenedEvent.fire(new FormPropertiesOpened(formSessionHandler.getSession(), uuid, name)); lastElement = element; if (isNode(element)) { lastPosition = GraphUtils.getComputedPosition((Node<?, ? extends Edge>) element); } } }
Source:
public void toggleTriggerFavouriteStatus(){ Context context = getActivity(); final Animation myAnim = AnimationUtils.loadAnimation(context, R.anim.bounce); MyBounceInterpolator interpolator = new MyBounceInterpolator(0.2, 20); myAnim.setInterpolator(interpolator); addButton.startAnimation(myAnim); SQLStore<Trigger> store = openStore(context); if (store.read(trigger.getId()) == null) { store.save(trigger); Toast.makeText(getContext(),"Added to Favourites", Toast.LENGTH_SHORT).show(); addButton.setColorFilter(getResources().getColor(R.color.background_primary)); addButton.startAnimation(myAnim); } else { store.remove(trigger.getId()); Toast.makeText(getContext(),"Removed from Favourites", Toast.LENGTH_SHORT).show(); addButton.setColorFilter(getResources().getColor(R.color.background_secondary)); addButton.startAnimation(myAnim); } store.close(); }

Target:
public void toggleTriggerFavouriteStatus(){ Context context = getActivity(); final Animation myAnim = AnimationUtils.loadAnimation(context, R.anim.bounce); MyBounceInterpolator interpolator = new MyBounceInterpolator(0.2, 20); myAnim.setInterpolator(interpolator); addButton.startAnimation(myAnim); SQLStore<Trigger> store = openStore(context); if (store.read(trigger.getId()) == null) { store.save(trigger); Snackbar snackbar = Snackbar.make(getView(),R.string.favourites_added, Snackbar.LENGTH_SHORT); snackbar.show(); addButton.setColorFilter(getResources().getColor(R.color.background_primary)); addButton.startAnimation(myAnim); } else { store.remove(trigger.getId()); Snackbar snackbar = Snackbar.make(getView(),R.string.favourites_removed, Snackbar.LENGTH_SHORT); snackbar.show(); addButton.setColorFilter(getResources().getColor(R.color.background_secondary)); addButton.startAnimation(myAnim); } store.close(); }
Source:
public InputStream getContent() throws IOException { if (!contentRead) { InputStream lowLevelResponseContent = this.response.getContent(); if (lowLevelResponseContent != null) { boolean contentProcessed = false; try { String contentEncoding = this.contentEncoding; if (!returnRawInputStream && contentEncoding != null && (CONTENT_ENCODING_GZIP.equalsIgnoreCase(contentEncoding.trim()) || CONTENT_ENCODING_XGZIP.equalsIgnoreCase(contentEncoding.trim()))) { lowLevelResponseContent = new GZIPInputStream(lowLevelResponseContent); } Logger logger = HttpTransport.LOGGER; if (loggingEnabled && logger.isLoggable(Level.CONFIG)) { lowLevelResponseContent = new LoggingInputStream( lowLevelResponseContent, logger, Level.CONFIG, contentLoggingLimit); } content = lowLevelResponseContent; contentProcessed = true; } catch (EOFException e) { } finally { if (!contentProcessed) { lowLevelResponseContent.close(); } } } contentRead = true; } return content; }

Target:
public InputStream getContent() throws IOException { if (!contentRead) { InputStream lowLevelResponseContent = this.response.getContent(); if (lowLevelResponseContent != null) { boolean contentProcessed = false; try { if (!returnRawInputStream && this.contentEncoding != null) { String oontentencoding = this.contentEncoding.trim().toLowerCase(Locale.ENGLISH); if (CONTENT_ENCODING_GZIP.equals(oontentencoding) || CONTENT_ENCODING_XGZIP.equals(oontentencoding)) { lowLevelResponseContent = new ConsumingInputStream(new GZIPInputStream(lowLevelResponseContent)); } } Logger logger = HttpTransport.LOGGER; if (loggingEnabled && logger.isLoggable(Level.CONFIG)) { lowLevelResponseContent = new LoggingInputStream( lowLevelResponseContent, logger, Level.CONFIG, contentLoggingLimit); } content = lowLevelResponseContent; contentProcessed = true; } catch (EOFException e) { } finally { if (!contentProcessed) { lowLevelResponseContent.close(); } } } contentRead = true; } return content; }
Source:
public Object getData() { if (!parsed) { throw new IllegalStateException("This method should only be called on events created through the parse method"); } if (cloudEvent.getDataBase64() != null) { return cloudEvent.getDataBase64(); } String eventType = SystemEventMappings.canonicalizeEventType(cloudEvent.getType()); if (SystemEventMappings.getSystemEventMappings().containsKey(eventType)) { return deserializer.deserialize(new ByteArrayInputStream((byte[]) this.cloudEvent.getData()), TypeReference.createInstance(SystemEventMappings.getSystemEventMappings().get(eventType))); } return cloudEvent.getData(); }

Target:
public Object getData() { if (!parsed) { throw logger.logExceptionAsError(new IllegalStateException( "This method should only be called on events created through the parse method")); } if (cloudEvent.getDataBase64() != null) { return cloudEvent.getDataBase64(); } String eventType = SystemEventMappings.canonicalizeEventType(cloudEvent.getType()); if (SystemEventMappings.getSystemEventMappings().containsKey(eventType)) { return deserializer.deserialize(new ByteArrayInputStream((byte[]) this.cloudEvent.getData()), TypeReference.createInstance(SystemEventMappings.getSystemEventMappings().get(eventType))); } return cloudEvent.getData(); }
Source:
public void start() { webServer.start(); if (config.isGrid()) { class GridRegistrationTask extends TimerTask { private final SelendroidStandaloneDriver driver; private final SelendroidConfiguration configuration; private final Logger log = Logger.getLogger(GridRegistrationTask.class.getName()); private boolean firstTime = true; GridRegistrationTask(SelendroidStandaloneDriver driver, SelendroidConfiguration configuration) { this.driver = driver; this.configuration = configuration; } @Override public void run() { try { final SelfRegisteringRemote remote = new SelfRegisteringRemote(configuration, driver); if (firstTime) { remote.performRegistrationIfNotRegistered(firstTime); firstTime = false; } else { remote.performRegistrationIfNotRegistered(firstTime); } } catch (Exception e) { log.log(Level.SEVERE, "An error occurred while registering selendroid into grid hub.", e); } } } log.info("Scheduling task for self registration in GRID."); Timer regTimer = new Timer(); GridRegistrationTask regTask = new GridRegistrationTask(driver, config); regTimer.schedule(regTask, 0, config.getRegisterCycle()); } log.info("Selendroid standalone server has been started on port: " + config.getPort()); }

Target:
public void start() { webServer.start(); if (config.isGrid()) { selfRegisterInGrid(); } log.info("Selendroid standalone server has been started on port: " + config.getPort()); }
Source:
private Pair find(T value) { retry: while (true) { Node current = head; Node next = head.currentFlagAndNext.getReference(); Node tmp; while (true) { if (next == null) { return new Pair(current, null); } tmp = next.currentFlagAndNext.getReference(); if (next.currentFlagAndNext.isMarked()) { if (!current.currentFlagAndNext.compareAndSet(next, tmp, false, false)) { continue retry; } next = tmp; } else { if (next.value.compareTo(value) >= 0) { return new Pair(current, next); } current = next; next = tmp; } } } }

Target:
private Pair find(T value) { while (true) { Node current = head; Node next = head.currentFlagAndNext.getReference(); Node tmp; while (true) { if (next == null) { return new Pair(current, null); } tmp = next.currentFlagAndNext.getReference(); if (next.currentFlagAndNext.isMarked()) { if (!current.currentFlagAndNext.compareAndSet(next, tmp, false, false)) { break; } next = tmp; } else { if (next.value.compareTo(value) >= 0) { return new Pair(current, next); } current = next; next = tmp; } } } }
Source:
protected TableConfiguration getEditedTableConfiguration(final Resource resource) { TableConfiguration configuration = null; boolean isCreation = true; if (null != resource) { if (resource.getContents().get(0) instanceof TableConfiguration) { configuration = EcoreUtil.copy((TableConfiguration) resource.getContents().get(0)); isCreation = false; } } if (isCreation) { configuration = NattableconfigurationFactory.eINSTANCE.createTableConfiguration(); final TableHeaderAxisConfiguration rowHeaderAxisConfiguration = NattableaxisconfigurationFactory.eINSTANCE.createTableHeaderAxisConfiguration(); final TableHeaderAxisConfiguration columnHeaderAxisConfiguration = NattableaxisconfigurationFactory.eINSTANCE.createTableHeaderAxisConfiguration(); configuration.setColumnHeaderAxisConfiguration(columnHeaderAxisConfiguration); configuration.setRowHeaderAxisConfiguration(rowHeaderAxisConfiguration); } return configuration; }

Target:
protected TableConfiguration getEditedTableConfiguration(final Resource resource) { TableConfiguration configuration = null; boolean isCreation = true; if (null != resource) { if (!resource.getContents().isEmpty() && resource.getContents().get(0) instanceof TableConfiguration) { configuration = EcoreUtil.copy((TableConfiguration) resource.getContents().get(0)); isCreation = false; } } if (isCreation) { configuration = NattableconfigurationFactory.eINSTANCE.createTableConfiguration(); final TableHeaderAxisConfiguration rowHeaderAxisConfiguration = NattableaxisconfigurationFactory.eINSTANCE.createTableHeaderAxisConfiguration(); final TableHeaderAxisConfiguration columnHeaderAxisConfiguration = NattableaxisconfigurationFactory.eINSTANCE.createTableHeaderAxisConfiguration(); configuration.setColumnHeaderAxisConfiguration(columnHeaderAxisConfiguration); configuration.setRowHeaderAxisConfiguration(rowHeaderAxisConfiguration); } return configuration; }
Source:
public BAMFileSpan getSpanOverlapping(final Bin bin) { if(bin == null) return null; final int referenceSequence = bin.getReferenceSequence(); final BAMIndexContent queryResults = getQueryResults(referenceSequence); if(queryResults == null) return null; final int binLevel = getLevelForBin(bin); final int firstLocusInBin = getFirstLocusInBin(bin); long minimumOffset = bin instanceof BinWithOffset ? ((BinWithOffset)bin).getlOffset() : 0L; final List<Bin> binTree = new ArrayList<Bin>(); if(queryResults.containsBin(bin)) binTree.add(queryResults.getBins().getBin(bin.getBinNumber())); int currentBinLevel = binLevel; while(--currentBinLevel >= 0) { final int binStart = getFirstBinOnLevel(currentBinLevel); final int binWidth = getMaxSpan()/getLevelSize(currentBinLevel); final int parentBinNumber = firstLocusInBin/binWidth + binStart; final Bin parentBin = queryResults.getBins().getBin(parentBinNumber); if(parentBin != null && queryResults.containsBin(parentBin)) binTree.add(parentBin); } List<Chunk> chunkList = new ArrayList<Chunk>(); for(final Bin coveringBin: binTree) { for(final Chunk chunk: coveringBin.getChunkList()) chunkList.add(chunk.clone()); } chunkList = Chunk.optimizeChunkList(chunkList, minimumOffset); return new BAMFileSpan(chunkList); }

Target:
public BAMFileSpan getSpanOverlapping(final Bin bin) { if(bin == null) { return null; } final int referenceSequence = bin.getReferenceSequence(); final BAMIndexContent queryResults = getQueryResults(referenceSequence); if(queryResults == null) { return null; } final int binLevel = getLevelForBin(bin); final int firstLocusInBin = getFirstLocusInBin(bin); long minimumOffset = bin instanceof BinWithOffset ? ((BinWithOffset)bin).getlOffset() : 0L; final List<Bin> binTree = new ArrayList<Bin>(); if(queryResults.containsBin(bin)) { binTree.add(queryResults.getBins().getBin(bin.getBinNumber())); } int currentBinLevel = binLevel; while(--currentBinLevel >= 0) { final int binStart = getFirstBinInLevelForCSI(currentBinLevel); final int binWidth = getMaxSpan()/getLevelSize(currentBinLevel); final int parentBinNumber = firstLocusInBin/binWidth + binStart; final Bin parentBin = queryResults.getBins().getBin(parentBinNumber); if(parentBin != null && queryResults.containsBin(parentBin)) { binTree.add(parentBin); } } List<Chunk> chunkList = new ArrayList<Chunk>(); for(final Bin coveringBin: binTree) { for(final Chunk chunk: coveringBin.getChunkList()) chunkList.add(chunk.clone()); } chunkList = Chunk.optimizeChunkList(chunkList, minimumOffset); return new BAMFileSpan(chunkList); }
Source:
public void addPath(final String path) { Objects.requireNonNull(path, "Path cannot be null"); final String[] pathComponents = StringUtils.split(path, '/'); if (pathComponents.length == 0) { throw new IllegalArgumentException("Invalid path: " + path); } writeLock.lock(); try { TrieNode parent = rootNode; for (final String part : pathComponents) { TrieNode child = parent.getChild(part); if (child == null) { child = new TrieNode(parent, part); parent.addChild(part, child); } parent = child; } parent.setProperty(true); } finally { writeLock.lock(); } }

Target:
public void addPath(final String path) { Objects.requireNonNull(path, "Path cannot be null"); final String[] pathComponents = StringUtils.split(path, '/'); if (pathComponents.length == 0) { throw new IllegalArgumentException("Invalid path: " + path); } writeLock.lock(); try { TrieNode parent = rootNode; for (final String part : pathComponents) { TrieNode child = parent.getChild(part); if (child == null) { child = new TrieNode(parent, part); parent.addChild(part, child); } parent = child; } parent.setProperty(true); } finally { writeLock.unlock(); } }
Source:
MemoryRevokingScheduler( List<MemoryPool> memoryPools, Supplier<? extends Collection<SqlTask>> currentTasksSupplier, ScheduledExecutorService taskManagementExecutor, double memoryRevokingThreshold, double memoryRevokingTarget) { this.memoryPools = ImmutableList.copyOf(memoryPools); this.currentTasksSupplier = currentTasksSupplier; this.taskManagementExecutor = taskManagementExecutor; this.memoryRevokingThreshold = memoryRevokingThreshold; this.memoryRevokingTarget = memoryRevokingTarget; }

Target:
MemoryRevokingScheduler( List<MemoryPool> memoryPools, Supplier<? extends Collection<SqlTask>> currentTasksSupplier, ScheduledExecutorService taskManagementExecutor, double memoryRevokingThreshold, double memoryRevokingTarget) { this.memoryPools = ImmutableList.copyOf(requireNonNull(memoryPools, "memoryPools is null")); this.currentTasksSupplier = requireNonNull(currentTasksSupplier, "currentTasksSupplier is null"); this.taskManagementExecutor = requireNonNull(taskManagementExecutor, "taskManagementExecutor is null"); this.memoryRevokingThreshold = checkFraction(memoryRevokingThreshold, "memoryRevokingThreshold"); this.memoryRevokingTarget = checkFraction(memoryRevokingTarget, "memoryRevokingTarget"); checkArgument( memoryRevokingTarget <= memoryRevokingThreshold, "memoryRevokingTarget should be less than or equal memoryRevokingThreshold, but got %s and %s respectively", memoryRevokingTarget, memoryRevokingThreshold); }
Source:
@Test public void withConstructorParameters() throws IOException { ClassWriter classWriter = ClassWriter.forClassName(className); classWriter.addField(threadName, "thread"); ConstructorWriter constructorWriter = classWriter.addConstructor(); constructorWriter.addParameter(Runnable.class, "runnable"); AnonymousClassWriter threadWriter = AnonymousClassWriter.forClassName(threadName); threadWriter.passConstructorParameters("runnable"); MethodWriter threadStartMethod = threadWriter.addMethod(void.class, "start"); threadStartMethod.annotate(Override.class); threadStartMethod.addModifiers(PUBLIC); threadStartMethod.body().addSnippet("System.out.println(\"Hello World!\");"); constructorWriter.body().addSnippet("thread = %s;", threadWriter); StringBuilder stringBuilder = new StringBuilder(); assertThat(classWriter.writeTypeToAppendable(stringBuilder).toString()).isEqualTo("" + "package com.foo;\n" + "\n" + "class Bar {\n" + " Thread thread;\n" + "\n" + " Bar(Runnable runnable) {\n" + " thread = new Thread(runnable) {\n" + " @Override\n" + " public void start() {\n" + " System.out.println(\"Hello World!\");\n" + " }\n" + " };\n" + " }\n" + "}\n"); }

Target:
@Test public void withConstructorParameters() throws IOException { ClassWriter classWriter = ClassWriter.forClassName(className); classWriter.addField(threadName, "thread"); ConstructorWriter constructorWriter = classWriter.addConstructor(); constructorWriter.addParameter(Runnable.class, "runnable"); AnonymousClassWriter threadWriter = AnonymousClassWriter.forClassName(threadName); threadWriter.setConstructorArguments("runnable"); MethodWriter threadStartMethod = threadWriter.addMethod(void.class, "start"); threadStartMethod.annotate(Override.class); threadStartMethod.addModifiers(PUBLIC); threadStartMethod.body().addSnippet("System.out.println(\"Hello World!\");"); constructorWriter.body().addSnippet("thread = %s;", threadWriter); assertThat(classWriter.toString()).isEqualTo("" + "package com.foo;\n" + "\n" + "class Bar {\n" + " Thread thread;\n" + "\n" + " Bar(Runnable runnable) {\n" + " thread = new Thread(runnable) {\n" + " @Override\n" + " public void start() {\n" + " System.out.println(\"Hello World!\");\n" + " }\n" + " };\n" + " }\n" + "}\n"); }
Source:
private event_notification_hist geteventNotificationHist(EventAuditLogSubscriber eals, boolean isNotified, String reason) { event_notification_hist eventHistory = new event_notification_hist(); eventHistory.setaudit_log_id(eals.getaudit_log_id()); eventHistory.setevent_name(eals.getevent_up_name()); eventHistory.setmethod_type(eals.getEventNotificationMethod().name()); eventHistory.setreason(reason); eventHistory.setsent_at(new Date()); eventHistory.setstatus(isNotified); eventHistory.setsubscriber_id(eals.getsubscriber_id()); return eventHistory; }

Target:
private event_notification_hist geteventNotificationHist(EventAuditLogSubscriber eals, boolean isNotified, String reason) { event_notification_hist eventHistory = new event_notification_hist(); eventHistory.setaudit_log_id(eals.getaudit_log_id()); eventHistory.setevent_name(eals.getevent_up_name()); eventHistory.setmethod_type(EventNotificationMethods.forValue(eals.getmethod_id()).name()); eventHistory.setreason(reason); eventHistory.setsent_at(new Date()); eventHistory.setstatus(isNotified); eventHistory.setsubscriber_id(eals.getsubscriber_id()); return eventHistory; }
Source:
public JsonImportDownloadReader ctjImportDownloadReader(@Value("${import.judgments.constitutionalTribunal.dir}") String importDir) { JsonImportDownloadReader ctjImportDownloadReader = new JsonImportDownloadReader(); ctjImportDownloadReader.setImportDir(importDir); ctjImportDownloadReader.setImportFileUtils(importFileUtils); ctjImportDownloadReader.setJsonFactory(jsonFactory); ctjImportDownloadReader.setJsonUtilService(jsonUtilService); return ctjImportDownloadReader; }

Target:
public JsonImportDownloadReader ctjImportDownloadReader(@Value("${import.judgments.constitutionalTribunal.dir}") String importDir) { JsonImportDownloadReader ctjImportDownloadReader = new JsonImportDownloadReader(); ctjImportDownloadReader.setImportDir(importDir); return ctjImportDownloadReader; }
Source:
private void reorderRepositories() { Collections.sort(cachedRepos, recentRepos); getActivity().runOnUiThread(new Runnable() { @Override public void run() { getListAdapter().getWrappedAdapter().setItems(cachedRepos.toArray()); updateHeaders(cachedRepos); } }); }

Target:
private void reorderRepositories() { Collections.sort(cachedRepos, recentRepos); getListAdapter().getWrappedAdapter().setItems(cachedRepos.toArray()); updateHeaders(cachedRepos); }
Source:
private void freezeVm() { if (!shouldFreezeOrThawVm()) { return; } VDSReturnValue returnValue; try { auditLogDirector.log(this, AuditLogType.FREEZE_VM_INITIATED); returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase(getVds().getId(), getVmId())); } catch (EngineException e) { handleFreezeVmFailure(e); return; } if (!returnValue.getSucceeded()) { handleFreezeVmFailure(new EngineException(EngineError.freezeErr)); } else { auditLogDirector.log(this, AuditLogType.FREEZE_VM_SUCCESS); } }

Target:
private void freezeVm() { if (!shouldFreezeOrThawVm()) { return; } VDSReturnValue returnValue; try { auditLogDirector.log(this, AuditLogType.FREEZE_VM_INITIATED); returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase( getVds().getId(), getVmId())); } catch (EngineException e) { handleFreezeVmFailure(e); return; } if (returnValue.getSucceeded()) { auditLogDirector.log(this, AuditLogType.FREEZE_VM_SUCCESS); } else { handleFreezeVmFailure(new EngineException(EngineError.freezeErr)); } }
Source:
public String getViewIndexesSql(String viewName, String schemaName, String tenantId) { return "SELECT DISTINCT COLUMN_FAMILY FROM " + "SYSTEM.CATALOG " + "WHERE TABLE_NAME = \'" + viewName + "\'" + (!StringUtil.EMPTY_STRING.equals(schemaName) ? "AND TABLE_SCHEM = \'" + schemaName + "\' " : "") + "AND LINK_TYPE = " + PTable.LinkType.INDEX_TABLE.getSerializedValue() + (tenantId != null ? " AND TENANT_ID = \'" + tenantId + "\'" : ""); }

Target:
public String getViewIndexesSql(String viewName, String schemaName, String tenantId) { return "SELECT DISTINCT COLUMN_FAMILY FROM " + "SYSTEM.CATALOG " + "WHERE TABLE_NAME = \'" + viewName + "\'" + (!Strings.isNullOrEmpty(schemaName) ? " AND TABLE_SCHEM = \'" + schemaName + "\'" : "") + " AND LINK_TYPE = " + PTable.LinkType.INDEX_TABLE.getSerializedValue() + (tenantId != null ? " AND TENANT_ID = \'" + tenantId + "\'" : ""); }
Source:
@Test public void readsHealth() throws Exception { Response response = get("/health"); assertThat(response.isSuccessful()).isTrue(); String json = response.body().string(); assertThat(readString(json, "$.status")) .isIn("UP", "DOWN", "UNKNOWN"); assertThat(readString(json, "$.zipkin.status")) .isIn("UP", "DOWN", "UNKNOWN"); assertThat(readString(json, "$.diskSpace.status")) .isIn("UP", "DOWN", "UNKNOWN"); }

Target:
@Test public void readsHealth() throws Exception { Response response = get("/health"); assertThat(response.isSuccessful()).isTrue(); String json = response.body().string(); assertThat(readString(json, "$.status")) .isIn("UP", "DOWN", "UNKNOWN"); assertThat(readString(json, "$.zipkin.status")) .isIn("UP", "DOWN", "UNKNOWN"); }
Source:
public static String toAccountQuery(final String fullname) { String user = KeyUtil.encode(fullname).replaceAll("%3[Aa]", ":"); return "/q/owner:\"" + user + "\"," + TOP; }

Target:
public static String toAccountQuery(final String fullname) { return "/q/owner:\"" + KeyUtil.encode(fullname) + "\"," + TOP; }
Source:
public void testUpdateCertificateVersion() { assertTrue(true); }

Target:
public void testUpdateCertificateVersion() { throw new SkipException("bug in requirements for function"); }
Source:
public static synchronized GoogleCastDelegate getInstance(AnalyticsRegistry analyticsRegistry) { if (delegate == null) { delegate = new GoogleCastDelegate(MainApplication.instance()); } delegate.analyticsRegistry = analyticsRegistry; return delegate; }

Target:
public static synchronized GoogleCastDelegate getInstance(AnalyticsRegistry analyticsRegistry) { if (delegate == null) { delegate = new GoogleCastDelegate(MainApplication.instance(), analyticsRegistry); } return delegate; }
Source:
public void shouldReturnFactoryFromRepositoryWithFactoryJson() throws Exception { String githubUrl = "<LINK_0>"; FactoryDto computedFactory = generateWsConfigFactory(); when(urlFactoryBuilder.createFactoryFromJson(any(RemoteFactoryUrl.class))) .thenReturn(Optional.of(computedFactory)); Map<String, String> params = new HashMap<>(); params.put(URL_PARAMETER_NAME, githubUrl); githubFactoryParametersResolver.createFactory(params); verify(urlFactoryBuilder).createFactoryFromJson(factoryUrlArgumentCaptor.capture()); verify(urlFactoryBuilder, never()).buildDefaultDevfile(eq("che")); assertEquals( factoryUrlArgumentCaptor.getValue().factoryFileLocation(), "<LINK_1>"); assertEquals(factoryUrlArgumentCaptor.getValue().getFactoryFilename(), ".factory.json"); }

Target:
public void shouldReturnFactoryFromRepositoryWithFactoryJson() throws Exception { String githubUrl = "<LINK_0>"; FactoryDto computedFactory = generateWsConfigFactory(); when(urlFactoryBuilder.createFactoryFromJson(any(RemoteFactoryUrl.class))) .thenReturn(Optional.of(computedFactory)); Map<String, String> params = ImmutableMap.of(URL_PARAMETER_NAME, githubUrl); githubFactoryParametersResolver.createFactory(params); verify(urlFactoryBuilder).createFactoryFromJson(factoryUrlArgumentCaptor.capture()); verify(urlFactoryBuilder, never()).buildDefaultDevfile(eq("che")); assertEquals( factoryUrlArgumentCaptor.getValue().factoryFileLocation(), "<LINK_1>"); assertEquals(factoryUrlArgumentCaptor.getValue().getFactoryFilename(), ".factory.json"); }
Source:
public void should_create_spans_from_stream_with_tracing_filter_not_predicate_true() throws Exception { String inputTopic = testName.getMethodName() + "-input"; String outputTopic = testName.getMethodName() + "-output"; StreamsBuilder builder = new StreamsBuilder(); builder.stream(inputTopic, Consumed.with(Serdes.String(), Serdes.String())) .transform(kafkaStreamsTracing.filterNot("filterNot-1", (key, value) -> true)) .peek((s, s2) -> { System.out.println(s + "-" + s2); }) .to(outputTopic, Produced.with(Serdes.String(), Serdes.String())); Topology topology = builder.build(); KafkaStreams streams = buildKafkaStreams(topology); producer = createProducer(); producer.send(new ProducerRecord<>(inputTopic, TEST_KEY, TEST_VALUE)).get(); waitForStreamToRun(streams); Span spanInput = takeSpan(), spanProcessor = takeSpan(); assertThat(spanInput.kind().name()).isEqualTo(brave.Span.Kind.CONSUMER.name()); assertThat(spanInput.traceId()).isEqualTo(spanProcessor.traceId()); assertThat(spanInput.tags()).containsEntry("kafka.topic", inputTopic); assertThat(spanProcessor.tags()).containsEntry(KAFKA_STREAMS_FILTERED_TAG, "true"); streams.close(); streams.cleanUp(); }

Target:
public void should_create_spans_from_stream_with_tracing_filter_not_predicate_true() throws Exception { String inputTopic = testName.getMethodName() + "-input"; String outputTopic = testName.getMethodName() + "-output"; StreamsBuilder builder = new StreamsBuilder(); builder.stream(inputTopic, Consumed.with(Serdes.String(), Serdes.String())) .transform(kafkaStreamsTracing.filterNot("filterNot-1", (key, value) -> true)) .to(outputTopic, Produced.with(Serdes.String(), Serdes.String())); Topology topology = builder.build(); KafkaStreams streams = buildKafkaStreams(topology); producer = createProducer(); producer.send(new ProducerRecord<>(inputTopic, TEST_KEY, TEST_VALUE)).get(); waitForStreamToRun(streams); Span spanInput = takeSpan(), spanProcessor = takeSpan(); assertThat(spanInput.kind().name()).isEqualTo(brave.Span.Kind.CONSUMER.name()); assertThat(spanInput.traceId()).isEqualTo(spanProcessor.traceId()); assertThat(spanInput.tags()).containsEntry("kafka.topic", inputTopic); assertThat(spanProcessor.tags()).containsEntry(KAFKA_STREAMS_FILTERED_TAG, "true"); streams.close(); streams.cleanUp(); }
Source:
public Object create(NewOperator operator) { Long countName = datastore.entityCount(OperatorEntity.class, Filter.where("name").is(operator.name)); if (countName != 0) { throw new OperatorException("Operator with name: " + operator.name + " already exists."); } Long countEmergency = datastore.entityCount(OperatorEntity.class, Filter.where("emergencyNumber").is(operator.emergencyNumber)); if (countEmergency != 0) { throw new EmergencyNumberException("Emergency call number: " + operator.emergencyNumber + " is already used from another operator."); } return datastore.save(adapt(operator)); }

Target:
public Object create(NewOperator operator) { Long operCount = datastore.entityCount(OperatorEntity.class, Filter.where("name").is(operator.name)); if (operCount != 0) { throw new OperatorException("Operator with name: " + operator.name + " already exists."); } Long countEmergency = datastore.entityCount(OperatorEntity.class, Filter.where("emergencyNumber").is(operator.emergencyNumber)); if (countEmergency != 0) { throw new EmergencyNumberException("Emergency call number: " + operator.emergencyNumber + " is already used from another operator."); } return datastore.save(adapt(operator)); }
Source:
public String toShortString() { if (m_map.isEmpty()) { return "Empty Map"; } StringBuilder sb = new StringBuilder(); sb.append("lastSpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastSpUniqueId)).append(" "); sb.append("lastMpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastMpUniqueId)).append(" "); if (m_map.isEmpty()) { sb.append("[empty map]"); } else { sb.append("span [").append(DRLogSegmentId.getSequenceNumberFromDRId(getFirstDrId())).append("-"); sb.append(DRLogSegmentId.getSequenceNumberFromDRId(getLastDrId())).append("]"); } return sb.toString(); }

Target:
public String toShortString() { if (m_map.isEmpty()) { return "Empty Map"; } StringBuilder sb = new StringBuilder(); sb.append("lastSpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastSpUniqueId)).append(" "); sb.append("lastMpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastMpUniqueId)).append(" "); if (m_map.isEmpty()) { sb.append("[empty map]"); } else { sb.append("span [").append(DRLogSegmentId.getSequenceNumberFromDRId(getFirstDrId())).append("-"); sb.append(DRLogSegmentId.getSequenceNumberFromDRId(getLastDrId())); sb.append(", size=").append(size()).append("]"); } return sb.toString(); }
Source:
private void getDeprecatedContainers() { deprecatedContainers.clear(); if (accountService != null) { accountService.getContainersByStatus(Container.ContainerStatus.DELETE_IN_PROGRESS).forEach((container) -> { if (container.getDeleteTriggerTime() + TimeUnit.DAYS.toMillis(config.storeContainerDeletionRetentionDays) >= System.currentTimeMillis()) { deprecatedContainers.add(new Pair<>(container.getParentAccountId(), container.getId())); } }); accountService.getContainersByStatus(Container.ContainerStatus.INACTIVE).forEach((container) -> { deprecatedContainers.add(new Pair<>(container.getParentAccountId(), container.getId())); }); } }

Target:
private void getDeprecatedContainers() { deprecatedContainers.clear(); if (accountService != null) { accountService.getContainersByStatus(Container.ContainerStatus.DELETE_IN_PROGRESS).forEach((container) -> { if (container.getDeleteTriggerTime() + TimeUnit.DAYS.toMillis(config.storeContainerDeletionRetentionDays) <= System.currentTimeMillis()) { deprecatedContainers.add(new Pair<>(container.getParentAccountId(), container.getId())); } }); accountService.getContainersByStatus(Container.ContainerStatus.INACTIVE).forEach((container) -> { deprecatedContainers.add(new Pair<>(container.getParentAccountId(), container.getId())); }); } }
Source:
public void sendError(HttpResponseStatus status, String errorMessage) { Preconditions.checkArgument(!status.equals(HttpResponseStatus.OK), "Response status cannot be OK for errors"); ChannelBuffer errorContent = ChannelBuffers.wrappedBuffer(Charsets.UTF_8.encode(errorMessage)); sendContent(status, errorContent, "text/plain; charset=utf-8", ImmutableMultimap.<String, String>of()); }

Target:
public final void sendError(HttpResponseStatus status, String errorMessage) { sendString(status, errorMessage); }
Source:
static boolean getBooleanProperty(String name) { if (System.getSecurityManager() == null) return SysProps.NON_PRIVILEGED.getBooleanProperty(name); return SysProps.PRIVILEGED.getBooleanProperty(name); }

Target:
static boolean getBooleanProperty(String name) { return doPrivileged(new GetSystemPropertyAsBooleanAction(name)); }