auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof VmDevice)) { return false; } VmDevice other = (VmDevice) obj; return (ObjectUtils.objectsEqual(id, other.id) && device.equals(other.device) && type.equals(other.type) && address.equals(other.address) && bootOrder == other.bootOrder && ObjectUtils.objectsEqual(specParams, other.specParams) && isManaged == other.isManaged && getIsPlugged().equals(other.getIsPlugged()) && getIsReadOnly().equals(other.getIsReadOnly()) && alias.equals(other.alias) && ObjectUtils.objectsEqual(customProperties, other.customProperties) && ObjectUtils.objectsEqual(snapshotId, other.snapshotId) && ObjectUtils.objectsEqual(logicalName, other.logicalName) && ObjectUtils.objectsEqual(usingScsiReservation, other.usingScsiReservation)); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof VmDevice)) { return false; } VmDevice other = (VmDevice) obj; return (ObjectUtils.objectsEqual(id, other.id) && device.equals(other.device) && type.equals(other.type) && address.equals(other.address) && bootOrder == other.bootOrder && ObjectUtils.objectsEqual(specParams, other.specParams) && isManaged == other.isManaged && getIsPlugged().equals(other.getIsPlugged()) && getIsReadOnly().equals(other.getIsReadOnly()) && alias.equals(other.alias) && ObjectUtils.objectsEqual(customProperties, other.customProperties) && ObjectUtils.objectsEqual(snapshotId, other.snapshotId) && ObjectUtils.objectsEqual(logicalName, other.logicalName) && usingScsiReservation == other.usingScsiReservation); }
Source:
public Set<String> listFilenames(final RepositoryPath path) throws IOException { try (InputStream is = Files.newInputStream(path); BufferedInputStream bis = new BufferedInputStream(is); BZip2CompressorInputStream bzIs = new BZip2CompressorInputStream(bis); ArchiveInputStream tarIs = new TarArchiveInputStream(bzIs)) { return getEntriesNames(tarIs); } }

Target:
public Set<String> listFilenames(final RepositoryPath path) throws IOException { try (InputStream is = Files.newInputStream(path); BufferedInputStream bis = new BufferedInputStream(is); BZip2CompressorInputStream bzIs = new BZip2CompressorInputStream(bis); ArchiveInputStream tarIs = new TarArchiveInputStream(bzIs)) { return getEntryNames(tarIs); } }
Source:
public void testCliBatch() throws IOException { Path testPath = Paths.get(CommonsTestingUtil.tmpDirectory(CliIT.class)); testPath.toFile().mkdirs(); try { Path batchFilePath = testPath.resolve("batch.cli").toAbsolutePath(); try (PrintWriter out = new PrintWriter(Files.newBufferedWriter(batchFilePath))) { out.println("echo Hi CLI"); out.printf("connect %s:11222\n", hostAddress()); out.println("ls"); out.println("cd caches"); out.println("ls"); out.println("create cache --template=org.infinispan.DIST_SYNC batch1"); out.println("cd batch1"); out.println("put k1 batch1"); out.println("get k1"); out.println("disconnect"); out.flush(); } AeshTestShell shell = new AeshTestShell(); CLI.main(shell, new String[]{"-f", batchFilePath.toString()}); shell.assertContains("Hi CLI"); shell.assertContains("batch1"); } finally { Util.recursiveFileRemove(testPath.toFile()); } }

Target:
public void testCliBatch() { System.setProperty("serverAddress", hostAddress()); AeshTestShell shell = new AeshTestShell(); CLI.main(shell, new String[]{"-f", this.getClass().getResource("/cli/batch.cli").getPath()}); shell.assertContains("Hi CLI running on " + System.getProperty("os.arch")); shell.assertContains("batch1"); }
Source:
protected Correlate( RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, CorrelationId correlationId, ImmutableBitSet requiredColumns, JoinRelType joinType) { super(cluster, traits, left, right); this.joinType = joinType; this.correlationId = correlationId; this.requiredColumns = requiredColumns; }

Target:
protected Correlate( RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, CorrelationId correlationId, ImmutableBitSet requiredColumns, JoinRelType joinType) { super(cluster, traits, left, right); assert !joinType.generatesNullsOnLeft() : "Correlate has invalid join type " + joinType; this.joinType = joinType; this.correlationId = correlationId; this.requiredColumns = requiredColumns; }
Source:
public String getDaemonDir() { return getProperty("daemon_dir", DEFAULT_DAEMON_DIR) + "/" + keyPath.substring(0, keyPath.length() - 1).replace('.', '/'); }

Target:
public File getDaemonDir() { return new File(getProperty("daemon_dir", DEFAULT_DAEMON_DIR), keyPath.substring(0, keyPath.length() - 1).replace('.', '/')); }
Source:
private void reboot() { UIConstants constants = ConstantsManager.getInstance().getConstants(); ConfirmationModel model = new ConfirmationModel(); setWindow(model); model.setTitle(constants.rebootVirtualMachinesTitle()); model.setReasonVisible(false); model.setHelpTag(HelpTag.reboot_virtual_machine); model.setHashName("reboot_virtual_machine"); model.setMessage(constants.areYouSureYouWantToRebootTheFollowingVirtualMachinesMsg()); ArrayList<String> items = new ArrayList<>(); for (Object item : getSelectedItems()) { VM vm = (VM) item; ArrayList<VM> test = new ArrayList<>(); test.add(vm); if (AsyncDataProvider.getInstance().isRebootCommandExecutionAllowed(test)) { items.add(vm.getName()); } } model.setItems(items); UICommand tempVar = new UICommand("OnReboot", this); tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok()); tempVar.setIsDefault(true); model.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); model.getCommands().add(tempVar2); }

Target:
private void reboot() { UIConstants constants = ConstantsManager.getInstance().getConstants(); powerAction(REBOOT, constants.rebootVirtualMachinesTitle(), constants.areYouSureYouWantToRebootTheFollowingVirtualMachinesMsg(), false); }
Source:
public MemberRemovedFromGroupTotally(Member member, Group group) { this.member = member; this.group = group; this.message = formatMessage("%s was removed from %s totally", member, group); }

Target:
public MemberRemovedFromGroupTotally(Member member, Group group) { this.member = member; this.group = group; this.message = formatMessage("%s was removed from %s totally.", member, group); }
Source:
private DeltaVisit next() { if (parent != null && parent.nextChild == null) { parent.data = null; parent = parent.parent; } if (nextChild != null) return new DeltaVisit(this); if (parent != null) return new DeltaVisit(parent); return null; }

Target:
DeltaVisit next() { if (parent != null && parent.nextChild == null) { parent.data = null; parent = parent.parent; } if (nextChild != null) return new DeltaVisit(this); if (parent != null) return new DeltaVisit(parent); return null; }
Source:
protected static boolean shouldUseCompression(HttpExchange exchange) { List<String> encodings = exchange.getRequestHeaders().get("Accept-Encoding"); if (encodings == null) return false; for (String encoding: encodings) { if(encoding.contains("gzip")) { return true; } } return false; }

Target:
protected static boolean shouldUseCompression(HttpExchange exchange) { List<String> encodingHeaders = exchange.getRequestHeaders().get("Accept-Encoding"); if (encodingHeaders == null) return false; for (String encodingHeader : encodingHeaders) { String[] encodings = encodingHeader.split(","); for (String encoding : encodings) { if (encoding.trim().toLowerCase().equals("gzip")) { return true; } } } return false; }
Source:
public void testDisplayingDataSeries() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { IViewPart viewSite = getSWTBotView().getViewReference().getView(true); assertTrue(viewSite instanceof CounterView); final TmfCommonXLineChartViewer chartViewer = getChartViewer2(viewSite); assertNotNull(chartViewer); fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer)); chartViewer.setNbPoints(NUMBER_OF_POINTS); fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer)); final Chart chart = getChart(); assertNotNull(chart); assertEquals(0, chart.getSeriesSet().getSeries().length); SWTBotTree treeBot = getSWTBotView().bot().tree(); WaitUtils.waitUntil(tree -> tree.rowCount() >= 1, treeBot, "The tree viewer did not finish loading."); SWTBotTreeItem root = treeBot.getTreeItem(TRACE_NAME); SWTBotTreeItem counter = retrieveTreeItem(root, COUNTER_NAME); counter.check(); fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer)); WaitUtils.waitUntil(c -> c.getSeriesSet().getSeries().length >= 1, chart, "The data series did not load."); verifySeriesStyle(MAIN_SERIES_NAME, ISeries.SeriesType.LINE, BLUE, LineStyle.SOLID, false); WaitUtils.waitUntil(json -> isChartDataValid(chart, json, MAIN_SERIES_NAME), "resources/minor_faults-res50.json", "The chart data is not valid."); }

Target:
public void testDisplayingDataSeries() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { IViewPart viewSite = getSWTBotView().getViewReference().getView(true); assertTrue(viewSite instanceof CounterView); final TmfCommonXLineChartViewer chartViewer = (TmfCommonXLineChartViewer) getChartViewer(viewSite); assertNotNull(chartViewer); fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer)); chartViewer.setNbPoints(NUMBER_OF_POINTS); fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer)); final Chart chart = getChart(); assertNotNull(chart); assertEquals(0, chart.getSeriesSet().getSeries().length); SWTBotTree treeBot = getSWTBotView().bot().tree(); WaitUtils.waitUntil(tree -> tree.rowCount() >= 1, treeBot, "The tree viewer did not finish loading."); SWTBotTreeItem root = treeBot.getTreeItem(TRACE_NAME); SWTBotTreeItem counter = retrieveTreeItem(root, COUNTER_NAME); counter.check(); fBot.waitUntil(ConditionHelpers.xyViewerIsReadyCondition(chartViewer)); WaitUtils.waitUntil(c -> c.getSeriesSet().getSeries().length >= 1, chart, "The data series did not load."); verifySeriesStyle(MAIN_SERIES_NAME, ISeries.SeriesType.LINE, BLUE, LineStyle.SOLID, false); WaitUtils.waitUntil(json -> isChartDataValid(chart, json, MAIN_SERIES_NAME), "resources/minor_faults-res50.json", "The chart data is not valid."); }
Source:
private void register(SonarLintProjectSettings settings) { SonarQubeNotifications.get().remove(eventListener); SonarQubeServer server; try { server = bindingManager.getSonarQubeServer(); } catch (InvalidBindingException e) { return; } if (settings.isBindingEnabled() && server.enableNotifications()) { NotificationConfiguration config = createConfiguration(settings, server); SonarQubeNotifications.get().register(config); } }

Target:
private void register(SonarLintProjectSettings settings) { unregister(); SonarQubeServer server; try { server = bindingManager.getSonarQubeServer(); } catch (InvalidBindingException e) { return; } if (settings.isBindingEnabled() && server.enableNotifications()) { NotificationConfiguration config = createConfiguration(settings, server); SonarQubeNotifications.get().register(config); } }
Source:
public void setupConnection() { try { if (connection == null) { String serviceName = System.getenv("STREAMING_ANALYTICS_SERVICE_NAME"); String vcapServices = System.getenv("VCAP_SERVICES"); assumeNotNull(serviceName, vcapServices); testType = "STREAMING_ANALYTICS_SERVICE"; connection = StreamingAnalyticsConnection.createInstance(vcapServices, serviceName); } } catch (IOException e) { fail("This shouldn't cause an exception"); } }

Target:
public void setupConnection() { try { if (connection == null) { String serviceName = System.getenv("STREAMING_ANALYTICS_SERVICE_NAME"); String vcapServices = System.getenv("VCAP_SERVICES"); assumeNotNull(serviceName, vcapServices); testType = "STREAMING_ANALYTICS_SERVICE"; connection = StreamingAnalyticsConnection.createInstance(vcapServices, serviceName); } } catch (IOException e) { e.printStackTrace(); fail(e.getMessage()); } }
Source:
public <R> Single<R> scalarFlatMap(final Func1<? super T, ? extends Single<? extends R>> func) { return create(new OnSubscribe<R>() { @Override public void call(final SingleSubscriber<? super R> child) { Single<? extends R> o = func.call(value); if (o.getClass() == ScalarSynchronousSingle.class) { child.onSuccess(((ScalarSynchronousSingle<? extends R>) o).value); } else { o.unsafeSubscribe(new Subscriber<R>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { child.onError(e); } @Override public void onNext(R r) { child.onSuccess(r); } }); } } }); }

Target:
public <R> Single<R> scalarFlatMap(final Func1<? super T, ? extends Single<? extends R>> func) { return create(new OnSubscribe<R>() { @Override public void call(final SingleSubscriber<? super R> child) { Single<? extends R> o = func.call(value); if (o instanceof ScalarSynchronousSingle) { child.onSuccess(((ScalarSynchronousSingle<? extends R>) o).value); } else { Subscriber<R> subscriber = new Subscriber<R>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { child.onError(e); } @Override public void onNext(R r) { child.onSuccess(r); } }; child.add(subscriber); o.unsafeSubscribe(subscriber); } } }); }
Source:
public void testUnDeployVMReplica() throws Exception { TierInstance tierInstance = new TierInstance(); tierInstance.setTier(tier); VM vm = new VM(); vm.setHostname("hotname"); tierInstance.setVM(vm); OpenStackAccess access = new OpenStackAccess(); access.setTenantId("tenantId"); access.setToken("token"); when(openStackRegion.getTokenAdmin()).thenReturn(access); when(openStackUtil.deleteServer(anyString(), anyString(), anyString(), anyString())).thenReturn(""); when(openStackUtil.getServer(anyString(), anyString(), anyString(), anyString())).thenThrow(new OpenStackException("")); claudiaClientOpenStack.undeployVMReplica(claudiaData, tierInstance); verify(openStackUtil).deleteServer(anyString(), anyString(), anyString(), anyString()); }

Target:
public void testUnDeployVMReplica() throws Exception { TierInstance tierInstance = new TierInstance(); tierInstance.setTier(tier); VM vm = new VM(); vm.setHostname("hostname"); vm.setVmid("ID"); tierInstance.setVM(vm); OpenStackAccess access = new OpenStackAccess(); access.setTenantId("tenantId"); access.setToken("token"); when(openStackRegion.getTokenAdmin()).thenReturn(access); when(openStackUtil.deleteServer(vm.getVmid(), tierInstance.getTier().getRegion(), access.getToken(), access.getTenantId())).thenReturn("OK"); when(openStackUtil.getServer(vm.getVmid(), tierInstance.getTier().getRegion(), claudiaData.getUser().getToken(), claudiaData.getUser().getTenantId())). thenThrow(new OpenStackException("Infrastructure Error")); claudiaClientOpenStack.undeployVMReplica(claudiaData, tierInstance); verify(openStackUtil).deleteServer(anyString(), anyString(), anyString(), anyString()); }
Source:
private void decreaseNumOfStudents(int remainingNumOfStudents) { Set<String> studentsNames = testData.students.keySet(); for (String key : studentsNames) { if (testData.students.size() <= remainingNumOfStudents) { return; } testData.students.remove(key); } }

Target:
private void decreaseNumOfStudents(int remainingNumOfStudents) { Map<String, StudentAttributes> remainingStudents = new LinkedHashMap<>(); int count = 0; for (String key : testData.students.keySet()) { if (count >= remainingNumOfStudents) { return; } remainingStudents.put(key, testData.students.get(key)); count++; } testData.students = remainingStudents; }
Source:
public void removeAuthorizedClient(String clientRegistrationId, String principalName) { Assert.hasText(clientRegistrationId, "clientRegistrationId cannot be empty"); Assert.hasText(principalName, "principalName cannot be empty"); SqlParameterValue[] parameters = new SqlParameterValue[] { new SqlParameterValue(Types.VARCHAR, clientRegistrationId), new SqlParameterValue(Types.VARCHAR, principalName) }; try (LobCreator lobCreator = this.lobHandler.getLobCreator()) { PreparedStatementSetter pss = new LobCreatorArgumentPreparedStatementSetter(lobCreator, parameters); this.jdbcOperations.update(REMOVE_AUTHORIZED_CLIENT_SQL, pss); } }

Target:
public void removeAuthorizedClient(String clientRegistrationId, String principalName) { Assert.hasText(clientRegistrationId, "clientRegistrationId cannot be empty"); Assert.hasText(principalName, "principalName cannot be empty"); SqlParameterValue[] parameters = new SqlParameterValue[] { new SqlParameterValue(Types.VARCHAR, clientRegistrationId), new SqlParameterValue(Types.VARCHAR, principalName) }; PreparedStatementSetter pss = new ArgumentPreparedStatementSetter(parameters); this.jdbcOperations.update(REMOVE_AUTHORIZED_CLIENT_SQL, pss); }
Source:
public ModelAndView saveAbout(@ProjectIdentifier @PathVariable("ProjectId") String projectId, @Validated @ModelAttribute("aboutTextBean") AboutText formBean, BindingResult result, ModelAndView model, Principal principal, @InjectProject IProject project) throws QuadrigaStorageException { model = new ModelAndView("auth/editabout"); List<INetwork> networks = nwManager.getNetworksInProject(projectId, INetworkStatus.APPROVED); model.addObject("project", project); model.addObject("networks", networks); if (result.hasErrors()) { model.addObject("aboutTextBean", formBean); } else { aboutTextManager.saveAbout(projectId, formBean); model.addObject("show_success_alert", true); model.addObject("success_alert_msg", "You successfully edited the about text"); } return model; }

Target:
public ModelAndView saveAbout(@ProjectIdentifier @PathVariable("ProjectId") String projectId, @Validated @ModelAttribute("aboutTextBean") AboutText formBean, BindingResult result, ModelAndView model, Principal principal, @InjectProject IProject project) throws QuadrigaStorageException { List<INetwork> networks = nwManager.getNetworksInProject(projectId, INetworkStatus.APPROVED); model.addObject("project", project); model.addObject("networks", networks); if (result.hasErrors()) { model.addObject("aboutTextBean", formBean); } else { aboutTextManager.saveAbout(projectId, formBean); model.addObject("show_success_alert", true); model.addObject("success_alert_msg", "You successfully edited the about text"); } return model; }
Source:
private boolean hasReviewsIncoming(ITask task) { Set<String> reviewUrls = ImmutableSet.copyOf(taskReviewStore.getReviewUrls(task.getUrl())); for (String reviewUrl : reviewUrls) { AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl); String taskId = connector.getTaskIdFromTaskUrl(reviewUrl); String repositoryUrl = connector.getRepositoryUrlFromTaskUrl(reviewUrl); ITask reviewTask = taskList.getTask(repositoryUrl, taskId); if ((reviewTask.getSynchronizationState().isIncoming())) { return true; } } return false; }

Target:
private boolean hasReviewsIncoming(ITask task) { for (String reviewUrl : taskReviewStore.getReviewUrls(task.getUrl())) { AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl); String taskId = connector.getTaskIdFromTaskUrl(reviewUrl); String repositoryUrl = connector.getRepositoryUrlFromTaskUrl(reviewUrl); ITask reviewTask = taskList.getTask(repositoryUrl, taskId); if ((reviewTask.getSynchronizationState().isIncoming())) { return true; } } return false; }
Source:
public static VdsStatic map(Host model, VdsStatic template) { VdsStatic entity = template != null ? template : new VdsStatic(); if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setVdsName(model.getName()); } if (model.isSetCluster() && model.getCluster().isSetId()) { entity.setVdsGroupId(GuidUtils.asGuid(model.getCluster().getId())); } if (model.isSetAddress()) { entity.setHostName(model.getAddress()); } if (model.isSetPort() && model.getPort() > 0) { entity.setPort(model.getPort()); } else { entity.setPort(DEFAULT_VDSM_PORT); } if (model.isSetProtocol()) { entity.setProtocol(VdsProtocol.fromValue(model.getProtocol())); } if (model.isSetSsh()) { map(model.getSsh(), entity); } if (model.isSetPowerManagement()) { entity = map(model.getPowerManagement(), entity); } if (model.isSetStorageManager()) { if (model.getStorageManager().getPriority() != null) { entity.setVdsSpmPriority(model.getStorageManager().getPriority()); } } if (model.isSetSpm()) { if (model.getSpm().getPriority() != null) { entity.setVdsSpmPriority(model.getSpm().getPriority()); } } if (model.isSetDisplay() && model.getDisplay().isSetAddress()) { entity.setConsoleAddress("".equals(model.getDisplay().getAddress()) ? null : model.getDisplay().getAddress()); } if (model.isSetComment()) { entity.setComment(model.getComment()); } return entity; }

Target:
public static VdsStatic map(Host model, VdsStatic template) { VdsStatic entity = template != null ? template : new VdsStatic(); if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setVdsName(model.getName()); } if (model.isSetCluster() && model.getCluster().isSetId()) { entity.setVdsGroupId(GuidUtils.asGuid(model.getCluster().getId())); } if (model.isSetAddress()) { entity.setHostName(model.getAddress()); } if (model.isSetPort() && model.getPort() > 0) { entity.setPort(model.getPort()); } else { entity.setPort(DEFAULT_VDSM_PORT); } if (model.isSetProtocol()) { map(model.getProtocol(), entity); } if (model.isSetSsh()) { map(model.getSsh(), entity); } if (model.isSetPowerManagement()) { entity = map(model.getPowerManagement(), entity); } if (model.isSetStorageManager()) { if (model.getStorageManager().getPriority() != null) { entity.setVdsSpmPriority(model.getStorageManager().getPriority()); } } if (model.isSetSpm()) { if (model.getSpm().getPriority() != null) { entity.setVdsSpmPriority(model.getSpm().getPriority()); } } if (model.isSetDisplay() && model.getDisplay().isSetAddress()) { entity.setConsoleAddress("".equals(model.getDisplay().getAddress()) ? null : model.getDisplay().getAddress()); } if (model.isSetComment()) { entity.setComment(model.getComment()); } return entity; }
Source:
private int getTotalPaddingHorizontal() { return getPaddingLeft() + getPaddingRight() + extraHorizontalPadding * 2; }

Target:
private int getTotalPaddingHorizontal() { return getPaddingLeft() + getPaddingRight() + extraHorizontalPadding * BOTH_SIDES; }
Source:
public void handleNewSession() throws Exception { autoRegistration(); for (PreConnectCallback callback : _preConnectCallbacks) { callback.onPreConnect(); } createLiveInstance(); carryOverPreviousCurrentState(); setupMsgHandler(); }

Target:
public void handleNewSession() throws Exception { joinCluster(); for (PreConnectCallback callback : _preConnectCallbacks) { callback.onPreConnect(); } createLiveInstance(); carryOverPreviousCurrentState(); setupMsgHandler(); }
Source:
public static void fmlPostInit() { netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel("bc-lib"); netWrapper.registerMessage(MessageZonePlannerMapChunkRequest.Handler.class, MessageZonePlannerMapChunkRequest.class, 123, Side.SERVER); netWrapper.registerMessage(MessageZonePlannerMapChunkResponse.Handler.class, MessageZonePlannerMapChunkResponse.class, 124, Side.CLIENT); Collections.sort(handlers); if (DEBUG) { BCLog.logger.info("[lib.messages] Sorted list of messages:"); for (int i = 0; i < handlers.size(); i++) { final MessageTypeData<?, ?> handler = handlers.get(i); BCLog.logger.info(" " + i + " = " + handler.messageClass.getName() + " " + Arrays.toString(handler.sides)); } BCLog.logger.info("[lib.messages] Total of " + handlers.size() + " messages"); } for (int i = 0; i < handlers.size(); i++) { addInternal(handlers.get(i), i); } }

Target:
public static void fmlPostInit() { netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel("bc-lib"); Collections.sort(handlers); if (DEBUG) { BCLog.logger.info("[lib.messages] Sorted list of messages:"); for (int i = 0; i < handlers.size(); i++) { final MessageTypeData<?, ?> handler = handlers.get(i); BCLog.logger.info(" " + i + " = " + handler.messageClass.getName() + " " + Arrays.toString(handler.sides)); } BCLog.logger.info("[lib.messages] Total of " + handlers.size() + " messages"); } for (int i = 0; i < handlers.size(); i++) { addInternal(handlers.get(i), i); } }
Source:
public void testDynamicTaskLoadingNonexistingTaskFactory() throws Exception { List<String> taskClasses = new ArrayList<String>(); taskClasses.add("com.mycompany.mocktask.MockTask"); DynamicTaskConfig taskConfig = new DynamicTaskConfig("Reindex", "src/test/resources/Reindex.jar", "1.0.0", taskClasses, "com.mycompany.mocktask.RandomTaskFactory"); String path = TaskConstants.DYNAMICALLY_LOADED_TASK_PATH + "/Reindex"; removePathIfExists(path); _manager.getHelixDataAccessor().getBaseDataAccessor() .create(path, taskConfig.getTaskConfigZNRecord(), AccessOption.PERSISTENT); TaskDriver driver = new TaskDriver(_manager); String workflowName = TestHelper.getTestMethodName(); submitWorkflow(workflowName, driver); try { TaskState finalState = driver.pollForWorkflowState(workflowName, TaskState.COMPLETED, TaskState.FAILED); AssertJUnit.assertEquals(finalState, TaskState.FAILED); } catch (HelixException e) { AssertJUnit.fail(e.getMessage()); } }

Target:
public void testDynamicTaskLoadingNonexistingTaskFactory() throws Exception { String taskCommand = "Reindex"; String taskJarPath = "src/test/resources/Random.jar"; String taskVersion = "1.0.0"; String fullyQualifiedTaskClassName = "com.mycompany.mocktask.MockTask"; String fullyQualifiedTaskFactoryClassName = "com.mycompany.mocktask.RandomTaskFactory"; List<String> taskClasses = new ArrayList(); taskClasses.add(fullyQualifiedTaskClassName); DynamicTaskConfig taskConfig = new DynamicTaskConfig(taskCommand, taskJarPath, taskVersion, taskClasses, fullyQualifiedTaskFactoryClassName); String path = TaskConstants.DYNAMICALLY_LOADED_TASK_PATH + "/" + taskCommand; removePathIfExists(path); _manager.getHelixDataAccessor().getBaseDataAccessor() .create(path, taskConfig.getTaskConfigZNRecord(), AccessOption.PERSISTENT); TaskDriver driver = new TaskDriver(_manager); String workflowName = TestHelper.getTestMethodName(); submitWorkflow(workflowName, driver); TaskState finalState = driver.pollForWorkflowState(workflowName, TaskState.COMPLETED, TaskState.FAILED); Assert.assertEquals(finalState, TaskState.FAILED); }
Source:
private void parseEntry(boolean forward) { currentEntry = cache.getEntry(ptr); final byte[] cep = currentEntry.path; if (!forward) { if (nextSubtreePos > 0) { final DirCacheTree p = tree.getChild(nextSubtreePos - 1); if (p.contains(cep, pathOffset, cep.length)) { nextSubtreePos--; currentSubtree = p; } } } if (nextSubtreePos != tree.getChildCount()) { final DirCacheTree s = tree.getChild(nextSubtreePos); if (s.contains(cep, pathOffset, cep.length)) { currentSubtree = s; nextSubtreePos++; if (s.isValid()) s.getObjectId().copyRawTo(subtreeId, 0); mode = FileMode.TREE.getBits(); path = cep; pathLen = pathOffset + s.nameLength(); return; } } mode = currentEntry.getRawMode(); path = cep; pathLen = cep.length; currentSubtree = null; String pathString = currentEntry.getPathString(); if (pathString != null) { if (pathString.endsWith(Constants.DOT_GIT_ATTRIBUTES)) attributesNode = new LazyLoadingAttributesNode( currentEntry.getObjectId()); } }

Target:
private void parseEntry(boolean forward) { currentEntry = cache.getEntry(ptr); final byte[] cep = currentEntry.path; if (!forward) { if (nextSubtreePos > 0) { final DirCacheTree p = tree.getChild(nextSubtreePos - 1); if (p.contains(cep, pathOffset, cep.length)) { nextSubtreePos--; currentSubtree = p; } } } if (nextSubtreePos != tree.getChildCount()) { final DirCacheTree s = tree.getChild(nextSubtreePos); if (s.contains(cep, pathOffset, cep.length)) { currentSubtree = s; nextSubtreePos++; if (s.isValid()) s.getObjectId().copyRawTo(subtreeId, 0); mode = FileMode.TREE.getBits(); path = cep; pathLen = pathOffset + s.nameLength(); return; } } mode = currentEntry.getRawMode(); path = cep; pathLen = cep.length; currentSubtree = null; byte[] entryName = new byte[pathLen - pathOffset]; System.arraycopy(path, pathOffset, entryName, 0, pathLen - pathOffset); if (Arrays.equals(entryName, DOT_GIT_ATTRIBUTES_BYTES)) attributesNode = new LazyLoadingAttributesNode( currentEntry.getObjectId()); }
Source:
public static String formatReplaceabledHTML(String text, String id) { StringBuilder sb = new StringBuilder(); sb.append("\n<div "); if (id != null && !id.trim().isEmpty()) { sb.append("id=\""); sb.append(escapeIdString(id)); sb.append("\" "); } sb.append("class=\""); sb.append(REPLACEABLE_LICENSE_TEXT_CLASS); sb.append("\" style=\"display: inline\">"); sb.append(SpdxLicenseTemplateHelper.formatEscapeHTML(text)); sb.append("</div>\n"); return sb.toString(); }

Target:
public static String formatReplaceabledHTML(String text, String id) { StringBuilder sb = new StringBuilder(); sb.append("\n<span "); if (id != null && !id.trim().isEmpty()) { sb.append("id=\""); sb.append(escapeIdString(id)); sb.append("\" "); } sb.append("class=\""); sb.append(REPLACEABLE_LICENSE_TEXT_CLASS); sb.append("\">"); sb.append(SpdxLicenseTemplateHelper.formatEscapeHTML(text)); sb.append("</span>\n"); return sb.toString(); }
Source:
private void updateStorageDomainBackup(){ if(getStorageDomain().getStorageStaticData().isBackup() == false) { getStorageDomain().setBackup(true); } }

Target:
private void updateStorageDomainBackup() { if(!getStorageDomain().getStorageStaticData().isBackup()) { getStorageDomain().setBackup(true); } }
Source:
public String getDisplayName() { return "Email User ID Resolver"; }

Target:
public String getDisplayName() { return "Slack email User ID Resolver"; }
Source:
private SecretKey tryGenerateStrongBoxSecurityKey(String service) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, NoSuchProviderException { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { return null; } try { return generateKey(getKeyGenSpecBuilder(service).setIsStrongBoxBacked(true).build()); } catch (Exception e) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && e instanceof StrongBoxUnavailableException) { Log.i(TAG, "StrongBox is unavailable on this device"); } else { Log.e(TAG, "An error occurred when trying to generate a StrongBoxSecurityKey: " + e.getMessage()); } return null; } }

Target:
private SecretKey tryGenerateStrongBoxSecurityKey(String service) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, NoSuchProviderException { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { return null; } try { return generateKey(getKeyGenSpecBuilder(service).setIsStrongBoxBacked(true).build()); } catch (Exception e) { if (e instanceof StrongBoxUnavailableException) { Log.i(TAG, "StrongBox is unavailable on this device"); } else { Log.e(TAG, "An error occurred when trying to generate a StrongBoxSecurityKey: " + e.getMessage()); } return null; } }
Source:
public boolean checkAccess(Account account, DiskOffering dof, DataCenter zone) throws PermissionDeniedException { boolean isAccess = false; if (account == null || dof == null) { isAccess = true; } else { if (_accountService.isRootAdmin(account.getId())) { isAccess = true; } else if (_accountService.isNormalUser(account.getId()) || account.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN || _accountService.isDomainAdmin(account.getId()) || account.getType() == Account.ACCOUNT_TYPE_PROJECT) { final List<Long> doDomainIds = diskOfferingDetailsDao.findDomainIds(dof.getId()); if (doDomainIds.isEmpty()) { isAccess = true; } else { for (Long domainId : doDomainIds) { if (_domainDao.isChildDomain(domainId, account.getDomainId())) { isAccess = true; break; } } } } } if (isAccess && dof != null && zone != null) { final List<Long> doZoneIds = diskOfferingDetailsDao.findZoneIds(dof.getId()); isAccess = doZoneIds.isEmpty() || doZoneIds.contains(zone.getId()); } return isAccess; }

Target:
public boolean checkAccess(Account account, DiskOffering dof, DataCenter zone) throws PermissionDeniedException { boolean hasAccess = false; if (account == null || dof == null) { hasAccess = true; } else { if (_accountService.isRootAdmin(account.getId())) { hasAccess = true; } else if (_accountService.isNormalUser(account.getId()) || account.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN || _accountService.isDomainAdmin(account.getId()) || account.getType() == Account.ACCOUNT_TYPE_PROJECT) { final List<Long> doDomainIds = diskOfferingDetailsDao.findDomainIds(dof.getId()); if (doDomainIds.isEmpty()) { hasAccess = true; } else { for (Long domainId : doDomainIds) { if (_domainDao.isChildDomain(domainId, account.getDomainId())) { hasAccess = true; break; } } } } } if (hasAccess && dof != null && zone != null) { final List<Long> doZoneIds = diskOfferingDetailsDao.findZoneIds(dof.getId()); hasAccess = doZoneIds.isEmpty() || doZoneIds.contains(zone.getId()); } return hasAccess; }
Source:
public static boolean openRenameWizard(String newName, IStructuredSelection structuredSelection) { Map<String, Object> commandParameters = Collections.emptyMap(); commandParameters.put(LTK_RENAME_COMMAND_NEWNAME_PARAMETER_KEY, newName); return runCommand(LTK_RENAME_ID, structuredSelection, commandParameters); }

Target:
public static boolean openRenameWizard(String newName, IStructuredSelection structuredSelection) { Map<String, Object> commandParameters = new HashMap<>(); commandParameters.put(LTK_RENAME_COMMAND_NEWNAME_PARAMETER_KEY, newName); return runCommand(LTK_RENAME_ID, structuredSelection, commandParameters); }
Source:
public void apply(RuntimeIdentity identity, Environment envConfig, OpenShiftEnvironment environment) throws InfrastructureException { for (Pod pod : environment.getPods().values()) { String podName = pod.getMetadata().getName(); for (Container container : pod.getSpec().getContainers()) { String containerName = container.getName(); String machineName = podName + "/" + containerName; MachineConfig machineConf = envConfig.getMachines().get(machineName); List<String> installers = machineConf.getInstallers(); Map<String, ServerConfig> name2Server = new HashMap<>(); for (String installerId : installers) { Installer installer = getInstaller(installerId); provisionEnv(container, installer.getProperties()); name2Server.putAll(installer.getServers()); } ServerExposeUtils.expose(machineName, container, name2Server, environment, "agents"); container.getEnv().removeIf(env -> "CHE_API".equals(env.getName())); container.getEnv().add(new EnvVar("CHE_API", cheServerEndpoint, null)); if (installers.contains("org.eclipse.che.ws-agent")) { container.getEnv().removeIf(env -> "CHE_WORKSPACE_ID".equals(env.getName())); container.getEnv().add(new EnvVar("CHE_WORKSPACE_ID", identity.getWorkspaceId(), null)); } } } }

Target:
public void apply(RuntimeIdentity identity, Environment envConfig, OpenShiftEnvironment environment) throws InfrastructureException { for (Pod pod : environment.getPods().values()) { String podName = pod.getMetadata().getName(); for (Container container : pod.getSpec().getContainers()) { String containerName = container.getName(); String machineName = podName + "/" + containerName; MachineConfig machineConf = envConfig.getMachines().get(machineName); List<String> installers = machineConf.getInstallers(); Map<String, ServerConfig> name2Server = new HashMap<>(); for (String installerId : installers) { Installer installer = getInstaller(installerId); provisionEnv(container, installer.getProperties()); name2Server.putAll(installer.getServers()); } ServerExposer serverExposer = new ServerExposer(machineName, container, environment); serverExposer.expose("agents", name2Server); container.getEnv().removeIf(env -> "CHE_API".equals(env.getName())); container.getEnv().add(new EnvVar("CHE_API", cheServerEndpoint, null)); if (installers.contains("org.eclipse.che.ws-agent")) { container.getEnv().removeIf(env -> "CHE_WORKSPACE_ID".equals(env.getName())); container.getEnv().add(new EnvVar("CHE_WORKSPACE_ID", identity.getWorkspaceId(), null)); } } } }
Source:
private static boolean referenceIsSplit(String lineOne, String lineTwo) { Matcher lineOneMatcher = referenceStartPattern.matcher(lineOne); return (lineOneMatcher.find() && lineOneMatcher.end() == lineOne.length() && !referenceStartPattern.matcher(lineTwo).find()); }

Target:
private static boolean referenceIsSplit(String lineOne, String lineTwo) { Matcher lineOneMatcher = RegexWithTimeout.matcher(referenceStartPattern, lineOne); return (lineOneMatcher.find() && lineOneMatcher.end() == lineOne.length() && !RegexWithTimeout.matcher(referenceStartPattern, lineTwo).find()); }
Source:
public void processBatch(MappedStatement ms, Statement stmt, Object parameter) { final String[] keyProperties = ms.getKeyProperties(); if (keyProperties == null || keyProperties.length == 0) { return; } try (final ResultSet rs = stmt.getGeneratedKeys()) { final Configuration configuration = ms.getConfiguration(); if (rs.getMetaData().getColumnCount() >= keyProperties.length) { Object soleParam = getSoleParameter(parameter); if (soleParam != null) { assignKeysToParam(configuration, rs, keyProperties, soleParam); } else { assignKeysToOneOfParams(configuration, rs, keyProperties, (Map<?, ?>) parameter); } } } catch (Exception e) { throw new ExecutorException("Error getting generated key or setting result to parameter object. Cause: " + e, e); } }

Target:
public void processBatch(MappedStatement ms, Statement stmt, Object parameter) { final String[] keyProperties = ms.getKeyProperties(); if (keyProperties == null || keyProperties.length == 0) { return; } try (ResultSet rs = stmt.getGeneratedKeys()) { final Configuration configuration = ms.getConfiguration(); if (rs.getMetaData().getColumnCount() >= keyProperties.length) { Object soleParam = getSoleParameter(parameter); if (soleParam != null) { assignKeysToParam(configuration, rs, keyProperties, soleParam); } else { assignKeysToOneOfParams(configuration, rs, keyProperties, (Map<?, ?>) parameter); } } } catch (Exception e) { throw new ExecutorException("Error getting generated key or setting result to parameter object. Cause: " + e, e); } }
Source:
public int hashCode() { int result = binary != null ? binary.hashCode() : 0; result = 31 * result + (host != null ? host.hashCode() : 0); result = 31 * result + (state != null ? state.hashCode() : 0); result = 31 * result + (status != null ? status.hashCode() : 0); result = 31 * result + (disabledReason != null ? disabledReason.hashCode() : 0); result = 31 * result + (updated != null ? updated.hashCode() : 0); result = 31 * result + (zone != null ? zone.hashCode() : 0); result = 31 * result + (id != null ? id.hashCode() : 0); return result; }

Target:
public int hashCode() { return Objects.hashCode(binary, host, state, status, disabledReason, updated, zone, id); }
Source:
private void processData(final AbstractTripleStore toInsert, final String contentType, final InputStream is, final RDFHandler handler, final String baseURI) throws Exception { final RDFFormat format = RDFFormat .forMIMEType(new MiniMime(contentType).getMimeType()); final RDFParserFactory rdfParserFactory = RDFParserRegistry .getInstance().get(format); final RDFParser rdfParser = rdfParserFactory.getParser(); rdfParser.setValueFactory(toInsert.getValueFactory()); rdfParser.setVerifyData(true); rdfParser.setStopAtFirstError(true); rdfParser.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE); if (handler != null) { rdfParser.setRDFHandler(handler); } rdfParser.parse(is, baseURI); }

Target:
private void processData(final AbstractTripleStore toInsert, final String contentType, final InputStream is, final RDFHandler handler, final String baseURI) throws RDFParseException, IOException, RDFHandlerException { final RDFFormat format = RDFFormat .forMIMEType(new MiniMime(contentType).getMimeType()); final RDFParserFactory rdfParserFactory = RDFParserRegistry .getInstance().get(format); final RDFParser rdfParser = rdfParserFactory.getParser(); rdfParser.setValueFactory(toInsert.getValueFactory()); if (handler != null) { rdfParser.setRDFHandler(handler); } rdfParser.parse(is, baseURI); }
Source:
protected void onLogin(final LoginModel loginModel) { ReportInit.getInstance().init(); ReportInit.getInstance().getReportsInitEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { Frontend.setLoggedInUser(loginModel.getLoggedUser()); beforeUiCommonInitEvent(loginModel); UiCommonInitEvent.fire(eventBus); user.onUserLogin(loginModel.getLoggedUser().getUserName()); clearPassword(loginModel); } }); }

Target:
protected void onLogin(final LoginModel loginModel) { ReportInit.getInstance().init(); ReportInit.getInstance().getReportsInitEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { ApplicationInit.super.onLogin(loginModel); } }); }
Source:
public void onNewIntent(Intent intent) { checkArgument(intent != null, "intent may not be null"); this.newIntent = intent; }

Target:
public void onNewIntent(Intent intent) { checkArgument(intent != null, "intent may not be null"); if (intent.hasExtra(BACKSTACK_KEY)) { Backstack backstack = Backstack.from(intent.getParcelableExtra(BACKSTACK_KEY), parceler); flow.set(backstack, Flow.Direction.REPLACE); } }
Source:
protected int run() { Jenkins.getActiveInstance().checkPermission(Jenkins.ADMINISTER); System.setProperty("jline.terminal", UnsupportedTerminal.class.getName()); TerminalFactory.reset(); StringBuilder commandLine = new StringBuilder(); for (String arg : args) { if (commandLine.length() > 0) { commandLine.append(" "); } commandLine.append(arg); } Groovysh shell = createShell(stdin, stdout, stderr); return shell.run(commandLine.toString()); }

Target:
protected int run() { Jenkins.get().checkPermission(Jenkins.ADMINISTER); System.setProperty("jline.terminal", UnsupportedTerminal.class.getName()); TerminalFactory.reset(); StringBuilder commandLine = new StringBuilder(); for (String arg : args) { if (commandLine.length() > 0) { commandLine.append(" "); } commandLine.append(arg); } Groovysh shell = createShell(stdin, stdout, stderr); return shell.run(commandLine.toString()); }
Source:
public InstallableUnitDescription readOneIU(InputStream is) throws IOException { Parser parser = new Parser(org.eclipse.tycho.p2.maven.repository.xmlio.MetadataIO.Parser.PARSER_MODE.IU); parser.parse(is, new NullProgressMonitor()); return parser.getUnits().get(0); }

Target:
public InstallableUnitDescription readOneIU(InputStream is) throws IOException { Parser parser = new Parser(Parser.PARSER_MODE.IU); parser.parse(is, new NullProgressMonitor()); return parser.getUnits().get(0); }
Source:
@Test public void attachMultipleRequests() throws Exception { Action action1 = mockAction(URI_KEY_1, URI_1, mockImageViewTarget()); Action action2 = mockAction(URI_KEY_1, URI_1, mockImageViewTarget()); BitmapHunter hunter = new TestableBitmapHunter(picasso, dispatcher, cache, stats, action1); assertThat(hunter.actions).isNull(); hunter.attach(action2); assertThat(hunter.actions).isNotNull(); assertThat(hunter.actions).hasSize(1); }

Target:
@Test public void attachMultipleRequests() throws Exception { Action action1 = mockAction(URI_KEY_1, URI_1, mockImageViewTarget()); Action action2 = mockAction(URI_KEY_1, URI_1, mockImageViewTarget()); BitmapHunter hunter = new TestableBitmapHunter(picasso, dispatcher, cache, stats, action1); assertThat(hunter.actions).isNull(); hunter.attach(action2); assertThat(hunter.actions).isNotNull().hasSize(1); }
Source:
protected boolean doProcess(Record record) { if (!preserveExisting) { record.removeAll(outputFieldName); } ListIterator iter = record.get(inputFieldName).listIterator(); while (iter.hasNext()) { record.put(outputFieldName, doHash(iter.next().toString())); } return super.doProcess(record); }

Target:
protected boolean doProcess(Record record) { if (!preserveExisting) { record.removeAll(outputFieldName); } ListIterator iter = record.get(inputFieldName).listIterator(); while (iter.hasNext()) { Object inputField = iter.next(); byte[] inputFieldBytes; if (inputField == null ) { inputFieldBytes = null; } else if (inputField instanceof byte[]) { inputFieldBytes = (byte[])inputField; } else { inputFieldBytes = inputField.toString().getBytes(charset); } record.put(outputFieldName, doHash(inputFieldBytes)); } return super.doProcess(record); }
Source:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin,":"); String rsType = st.nextToken(); if ("coinmarketcap".equalsIgnoreCase(rsType)) { String preferredFiatCurrency = FiatCurrency.USD.getCode(); String apiKey = null; if (st.hasMoreTokens()) { preferredFiatCurrency = st.nextToken().toUpperCase(); } if (st.hasMoreTokens()) { apiKey = st.nextToken(); } return new CoinmarketcapRateSource(apiKey, preferredFiatCurrency); } else if ("coingecko".equalsIgnoreCase(rsType)) { String preferredFiatCurrency = st.hasMoreTokens() ? st.nextToken().toUpperCase() : FiatCurrency.USD.getCode(); return new CoinGeckoRateSource(preferredFiatCurrency); } else if ("coinpaprika".equalsIgnoreCase(rsType)) { String preferredFiatCurrency = st.hasMoreTokens() ? st.nextToken().toUpperCase() : FiatCurrency.USD.getCode(); return new CoinPaprikaRateSource(preferredFiatCurrency); } } return null; }

Target:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin,":"); String exchangeType = st.nextToken(); if ("hatchfix".equalsIgnoreCase(exchangeType)) { BigDecimal rate = BigDecimal.ZERO; if (st.hasMoreTokens()) { try { rate = new BigDecimal(st.nextToken()); } catch (Throwable e) { } } String preferedFiatCurrency = FiatCurrency.USD.getCode(); if (st.hasMoreTokens()) { preferedFiatCurrency = st.nextToken().toUpperCase(); } return new FixPriceRateSource(rate,preferedFiatCurrency); } } return null; }
Source:
public final static Pair<TopicDefaultsType, Map<String, TopicProfileType>> getDeploymentTopics( DeploymentType deployment, CompoundErrors errors) { TopicsType topics = deployment.getTopics(); if (topics == null) { return Pair.of(null, null); } TopicDefaultsType defaults = topics.getDefaults(); List<TopicProfileType> profiles = topics.getProfile(); if (profiles == null) { if (hostLog.isDebugEnabled()) { hostLog.debug("No topic profiles in deployment"); } return Pair.of(defaults, null); } Map<String, TopicProfileType> profileMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (TopicProfileType profile : profiles) { if (profileMap.put(profile.getName().toUpperCase(), profile) != null) { errors.addErrorMessage("Profile " + profile.getName() + " is defined multiple times"); } } return Pair.of(defaults, profileMap); }

Target:
public final static Pair<TopicDefaultsType, Map<String, TopicProfileType>> getDeploymentTopics( DeploymentType deployment, CompoundErrors errors) { TopicsType topics = deployment.getTopics(); if (topics == null) { return Pair.of(null, null); } TopicDefaultsType defaults = topics.getDefaults(); List<TopicProfileType> profiles = topics.getProfile(); if (profiles == null) { if (hostLog.isDebugEnabled()) { hostLog.debug("No topic profiles in deployment"); } return Pair.of(defaults, null); } Map<String, TopicProfileType> profileMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (TopicProfileType profile : profiles) { if (profileMap.put(profile.getName(), profile) != null) { errors.addErrorMessage("Profile " + profile.getName() + " is defined multiple times"); } } return Pair.of(defaults, profileMap); }
Source:
public CompletionStage<Void> passivateAsync(InternalCacheEntry entry) { final Runnable before = beforePassivate; if (before != null) { before.run(); } CompletionStage<Void> stage = delegate.passivateAsync(entry); if (afterPassivate != null) { return stage.thenRun(afterPassivate); } return stage; }

Target:
public CompletionStage<Void> passivateAsync(InternalCacheEntry entry) { final Runnable before = beforePassivate; if (before != null) { before.run(); } CompletionStage<Void> stage = delegate.passivateAsync(entry); final Runnable after = afterPassivate; if (after != null) { return stage.thenRun(after); } return stage; }
Source:
public void add(ITmfStateInterval interval) { list.add(interval); start = Math.max(start, interval.getStartTime()); end = Math.min(end, interval.getStartTime()); }

Target:
public void add(ITmfStateInterval interval) { list.add(interval); start = Math.min(start, interval.getStartTime()); end = Math.max(end, interval.getEndTime()); }