auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static IgnoredPureOperation checkExpression(Expression expression) { if (expression.is(Tree.Kind.CALL_EXPR)) { CallExpression callExpression = (CallExpression) expression; Symbol symbol = callExpression.calleeSymbol(); if (symbol == null) { return null; } String fqn = symbol.fullyQualifiedName(); if (fqn != null && PURE_FUNCTIONS.contains(fqn)) { return new IgnoredPureOperation(callExpression.callee(), fqn); } } else if (expression.is(Tree.Kind.SUBSCRIPTION)) { SubscriptionExpression subscriptionExpression = ((SubscriptionExpression) expression); InferredType type = subscriptionExpression.object().type(); if (PURE_GETITEM_TYPES.stream().anyMatch(type::canBeOrExtend)) { return new IgnoredPureOperation(subscriptionExpression, "__getitem__"); } } else if (expression.is(Tree.Kind.IN)) { InExpression inExpression = ((InExpression) expression); InferredType type = inExpression.rightOperand().type(); if (PURE_CONTAINS_TYPES.stream().anyMatch(type::canOnlyBe)) { return new IgnoredPureOperation(inExpression, "__contains__"); } } return null; }

Target:
private static IgnoredPureOperation checkExpression(Expression expression) { if (expression.is(Tree.Kind.CALL_EXPR)) { CallExpression callExpression = (CallExpression) expression; Symbol symbol = callExpression.calleeSymbol(); if (symbol == null) { return null; } String fqn = symbol.fullyQualifiedName(); if (fqn != null && PURE_FUNCTIONS.contains(fqn)) { return new IgnoredPureOperation(callExpression.callee(), fqn); } } else if (expression.is(Tree.Kind.SUBSCRIPTION)) { SubscriptionExpression subscriptionExpression = (SubscriptionExpression) expression; InferredType type = subscriptionExpression.object().type(); if (PURE_GETITEM_TYPES.stream().anyMatch(type::canOnlyBe)) { return new IgnoredPureOperation(subscriptionExpression, "__getitem__"); } } else if (expression.is(Tree.Kind.IN)) { InExpression inExpression = (InExpression) expression; InferredType type = inExpression.rightOperand().type(); if (PURE_CONTAINS_TYPES.stream().anyMatch(type::canOnlyBe)) { return new IgnoredPureOperation(inExpression, "__contains__"); } } return null; }
Source:
public void suggestDesiredDimensions(int minimumWidth, int minimumHeight) { try { int maximumTextureSize; try { maximumTextureSize = SystemProperties.getInt("sys.max_texture_size", 0); } catch (Exception e) { maximumTextureSize = 0; } if (maximumTextureSize > 0) { if (minimumWidth > maximumTextureSize) { float scale = (float) maximumTextureSize / (float)minimumWidth; minimumWidth = maximumTextureSize; minimumHeight = (int) ((float)minimumHeight * scale); } if (minimumHeight > maximumTextureSize) { float scale = (float) maximumTextureSize / (float)minimumHeight; minimumHeight = maximumTextureSize; minimumWidth = (int) ((float)minimumWidth * scale); } } if (sGlobals.mService == null) { Log.w(TAG, "WallpaperService not running"); } else { sGlobals.mService.setDimensionHints(minimumWidth, minimumHeight); } } catch (RemoteException e) { } }

Target:
public void suggestDesiredDimensions(int minimumWidth, int minimumHeight) { try { int maximumTextureSize; try { maximumTextureSize = SystemProperties.getInt("sys.max_texture_size", 0); } catch (Exception e) { maximumTextureSize = 0; } if (maximumTextureSize > 0) { if ((minimumWidth > maximumTextureSize) || (minimumHeight > maximumTextureSize)) { float aspect = (float)minimumHeight / (float)minimumWidth; if (minimumWidth > minimumHeight) { minimumWidth = maximumTextureSize; minimumHeight = (int)((minimumWidth * aspect) + 0.5); } else { minimumHeight = maximumTextureSize; minimumWidth = (int)((minimumHeight / aspect) + 0.5); } } } if (sGlobals.mService == null) { Log.w(TAG, "WallpaperService not running"); } else { sGlobals.mService.setDimensionHints(minimumWidth, minimumHeight); } } catch (RemoteException e) { } }
Source:
public Map<String, Object> getProperties() { return this.properties.size() == 0 ? null : this.properties; }

Target:
public Map<String, Object> getProperties() { return this.unmodifiableProperties; }
Source:
private AxonServerEventStore buildEventStore(Configuration c) { return AxonServerEventStore.builder() .configuration(c.getComponent(AxonServerConfiguration.class)) .platformConnectionManager(c.getComponent(AxonServerConnectionManager.class)) .build(); }

Target:
private AxonServerEventStore buildEventStore(Configuration c) { return AxonServerEventStore.builder() .configuration(c.getComponent(AxonServerConfiguration.class)) .platformConnectionManager(c.getComponent(AxonServerConnectionManager.class)) .snapshotSerializer(c.serializer()) .eventSerializer(c.eventSerializer()) .upcasterChain(c.upcasterChain()) .build(); }
Source:
private void setupEntityHeader(PreferenceScreen screen) { LayoutPreference headerPref = (LayoutPreference) screen.findPreference(KEY_HEADER); mEntityHeaderController = EntityHeaderController.newInstance( mFragment.getActivity(), mFragment, headerPref.findViewById(R.id.entity_header)); mEntityHeaderController.setIcon( mContext.getDrawable(com.android.internal.R.drawable.ic_bt_laptop)); mEntityHeaderController.setLabel(mPairedDevice.getDeviceName()); mEntityHeaderController.done(mFragment.getActivity(), true); }

Target:
private void setupEntityHeader(PreferenceScreen screen) { LayoutPreference headerPref = (LayoutPreference) screen.findPreference(KEY_HEADER); mEntityHeaderController = EntityHeaderController.newInstance( mFragment.getActivity(), mFragment, headerPref.findViewById(R.id.entity_header)); mEntityHeaderController .setIcon(mContext.getDrawable(com.android.internal.R.drawable.ic_bt_laptop)) .setLabel(mPairedDevice.getDeviceName()) .done(mFragment.getActivity(), true); }
Source:
public void testLongParseSuccess() { Long num = NumberParser.parseLong("1"); assertTrue(num == 1L); }

Target:
public void testLongParseSuccess() { Long num = NumberParser.parseLong("1"); assertEquals(new Long(1L), num); }
Source:
public void testConstructor() { new RandomUtils(); final Constructor<?>[] cons = RandomUtils.class.getDeclaredConstructors(); assertEquals(1, cons.length); assertTrue(Modifier.isPublic(cons[0].getModifiers())); assertTrue(Modifier.isPublic(RandomUtils.class.getModifiers())); assertFalse(Modifier.isFinal(RandomUtils.class.getModifiers())); }

Target:
public void testConstructor() { CodeStructureAssertions.defaultConstructorOnly(RandomUtils.class); }
Source:
EventHubSystemConsumer(EventHubConfig config, String systemName, EventHubClientManagerFactory eventHubClientManagerFactory, Map<String, Interceptor> interceptors, MetricsRegistry registry, Clock clock) { super(registry, clock); this.config = config; this.clock = clock; this.systemName = systemName; this.interceptors = interceptors; this.eventHubClientManagerFactory = eventHubClientManagerFactory; List<String> streamIds = config.getStreams(systemName); prefetchCount = config.getPrefetchCount(systemName); retryCountWithinWindow = new SlidingTimeWindowReservoir(config.getRetryWindowMs(systemName), clock); eventReadRates = streamIds.stream().collect(Collectors.toMap(Function.identity(), x -> registry.newCounter(x, EVENT_READ_RATE))); eventByteReadRates = streamIds.stream() .collect(Collectors.toMap(Function.identity(), x -> registry.newCounter(x, EVENT_BYTE_READ_RATE))); consumptionLagMs = streamIds.stream() .collect(Collectors.toMap(Function.identity(), x -> new SamzaHistogram(registry, x, CONSUMPTION_LAG_MS))); readErrors = streamIds.stream().collect(Collectors.toMap(Function.identity(), x -> registry.newCounter(x, READ_ERRORS))); synchronized (AGGREGATE_METRICS_LOCK) { if (aggEventReadRate == null) { aggEventReadRate = registry.newCounter(AGGREGATE, EVENT_READ_RATE); aggEventByteReadRate = registry.newCounter(AGGREGATE, EVENT_BYTE_READ_RATE); aggConsumptionLagMs = new SamzaHistogram(registry, AGGREGATE, CONSUMPTION_LAG_MS); aggReadErrors = registry.newCounter(AGGREGATE, READ_ERRORS); } } }

Target:
EventHubSystemConsumer(EventHubConfig config, String systemName, EventHubClientManagerFactory eventHubClientManagerFactory, Map<String, Interceptor> interceptors, MetricsRegistry registry, Clock clock) { super(registry, clock); this.config = config; this.clock = clock; this.systemName = systemName; this.interceptors = interceptors; this.eventHubClientManagerFactory = eventHubClientManagerFactory; List<String> streamIds = config.getStreams(systemName); prefetchCount = config.getPrefetchCount(systemName); recentRetryAttempts = new SlidingTimeWindowReservoir(config.getRetryWindowMs(systemName), clock); eventReadRates = streamIds.stream().collect(Collectors.toMap(Function.identity(), x -> registry.newCounter(x, EVENT_READ_RATE))); eventByteReadRates = streamIds.stream() .collect(Collectors.toMap(Function.identity(), x -> registry.newCounter(x, EVENT_BYTE_READ_RATE))); consumptionLagMs = streamIds.stream() .collect(Collectors.toMap(Function.identity(), x -> new SamzaHistogram(registry, x, CONSUMPTION_LAG_MS))); readErrors = streamIds.stream().collect(Collectors.toMap(Function.identity(), x -> registry.newCounter(x, READ_ERRORS))); synchronized (AGGREGATE_METRICS_LOCK) { if (aggEventReadRate == null) { aggEventReadRate = registry.newCounter(AGGREGATE, EVENT_READ_RATE); aggEventByteReadRate = registry.newCounter(AGGREGATE, EVENT_BYTE_READ_RATE); aggConsumptionLagMs = new SamzaHistogram(registry, AGGREGATE, CONSUMPTION_LAG_MS); aggReadErrors = registry.newCounter(AGGREGATE, READ_ERRORS); } } }
Source:
private boolean isValidImport(String part, int executionCount) { try { CompletableFuture<Boolean> validImportFuture = new CompletableFuture<>(); kernel.executeCode("Class.forName(\"" + part + "\")", new Message(), executionCount, seo -> { validImportFuture.complete(!seo.getStatus().equals(EvaluationStatus.ERROR)); }); return validImportFuture.get(); } catch (InterruptedException | ExecutionException e) { return Boolean.FALSE; } }

Target:
private boolean isValidImport(String part, int executionCount) { try { CompletableFuture<Boolean> validImportFuture = new CompletableFuture<>(); kernel.executeCode("", new Message(), executionCount, seo -> validImportFuture.complete(!seo.getStatus().equals(EvaluationStatus.ERROR))); return validImportFuture.get(); } catch (InterruptedException | ExecutionException e) { return Boolean.FALSE; } }
Source:
public void updateClusterConfigs(@Nonnull Stack stack, @Nonnull Cluster cluster, List<String> candidateAddresses) { try { Set<Node> nodes = stackUtil.collectReachableNodes(stack); GatewayConfig primaryGatewayConfig = gatewayConfigService.getPrimaryGatewayConfig(stack); List<GatewayConfig> gatewayConfigs = gatewayConfigService.getAllGatewayConfigs(stack); SaltConfig saltConfig = createSaltConfig(stack, cluster, primaryGatewayConfig, gatewayConfigs, nodes); ExitCriteriaModel exitCriteriaModel = nonCancellableModel(); hostOrchestrator.initSaltConfig(gatewayConfigs, nodes, saltConfig, exitCriteriaModel); hostOrchestrator.runService(gatewayConfigs, nodes, saltConfig, exitCriteriaModel); } catch (CloudbreakOrchestratorException | IOException e) { throw new CloudbreakServiceException(e.getMessage(), e); } }

Target:
public void updateClusterConfigs(@Nonnull Stack stack, @Nonnull Cluster cluster, List<String> candidateAddresses) { try { Set<Node> nodes = stackUtil.collectReachableNodes(stack); GatewayConfig primaryGatewayConfig = gatewayConfigService.getPrimaryGatewayConfig(stack); List<GatewayConfig> gatewayConfigs = gatewayConfigService.getAllGatewayConfigs(stack); SaltConfig saltConfig = createSaltConfig(stack, cluster, primaryGatewayConfig, gatewayConfigs, nodes); ExitCriteriaModel exitCriteriaModel = clusterDeletionBasedModel(stack.getId(), cluster.getId()); hostOrchestrator.initSaltConfig(gatewayConfigs, nodes, saltConfig, exitCriteriaModel); hostOrchestrator.runService(gatewayConfigs, nodes, saltConfig, exitCriteriaModel); } catch (CloudbreakOrchestratorException | IOException e) { throw new CloudbreakServiceException(e.getMessage(), e); } }
Source:
public void oneDcMoreRacksThanRfAndMoreHostsThanRfSucceeds() throws TException { setTopology(defaultDcDetails(RACK_1, HOST_1), defaultDcDetails(RACK_2, HOST_2), defaultDcDetails(RACK_1, HOST_3), defaultDcDetails(RACK_2, HOST_4)); when(config.replicationFactor()).thenReturn(2); assertThat(CassandraVerifier.sanityCheckDatacenters(client, config)) .containsExactly(CassandraConstants.DEFAULT_DC); }

Target:
public void oneDcMoreRacksThanRfAndMoreHostsThanRfSucceeds() throws TException { setTopology(defaultDcDetails(RACK_1, HOST_1), defaultDcDetails(RACK_2, HOST_2), defaultDcDetails(RACK_1, HOST_3), defaultDcDetails(RACK_3, HOST_4)); when(config.replicationFactor()).thenReturn(2); assertThat(CassandraVerifier.sanityCheckDatacenters(client, config)) .containsExactly(CassandraConstants.DEFAULT_DC); }
Source:
private void setDatacenter(String rack) { this.datacenter = rack.substring(0, rack.length() - 1); }

Target:
private void setDatacenter(String rack) { this.datacenter = ConfigUtils.getDataCenter(rack); }
Source:
void createEncounter() { Encountercreate encountercreate=new Encountercreate(); encountercreate.setPatient(patient.getUuid()); encountercreate.setVisit(visit.getUuid()); encountercreate.setEncounterType(encountertype); List<Obscreate> observations=new ArrayList<>(); List<Fragment> activefrag=getActiveFragments(); for (Fragment f:activefrag) { FormPageFragment formPageFragment=(FormPageFragment)f; if(!formPageFragment.checkfields()) break; List<InputField> pageinputlist=formPageFragment.getInputFields(); inputlist.addAll(pageinputlist); } for (InputField input:inputlist) { Obscreate obscreate = new Obscreate(); obscreate.setConcept(input.getConcept()); obscreate.setValue(input.getValue()); LocalDateTime localDateTime = new LocalDateTime(); obscreate.setObsDatetime(localDateTime.toString()); obscreate.setPerson(patient.getUuid()); observations.add(obscreate); } encountercreate.setObservations(observations); Call<Encounter> call = apiService.createEncounter(encountercreate); call.enqueue(new Callback<Encounter>() { @Override public void onResponse(Call<Encounter> call, Response<Encounter> response) { if (response.isSuccessful()) { Encounter encounter = response.body(); linkvisit(encounter); } else { ToastUtil.error("Could not save encounter"); } } @Override public void onFailure(Call<Encounter> call, Throwable t) { ToastUtil.error(t.getLocalizedMessage()); } }); }

Target:
void createEncounter() { Encountercreate encountercreate=new Encountercreate(); encountercreate.setPatient(patient.getUuid()); encountercreate.setEncounterType(encountertype); List<Obscreate> observations=new ArrayList<>(); List<Fragment> activefrag=getActiveFragments(); for (Fragment f:activefrag) { FormPageFragment formPageFragment=(FormPageFragment)f; if(!formPageFragment.checkfields()) break; List<InputField> pageinputlist=formPageFragment.getInputFields(); inputlist.addAll(pageinputlist); } for (InputField input:inputlist) { Obscreate obscreate = new Obscreate(); obscreate.setConcept(input.getConcept()); obscreate.setValue(input.getValue()); LocalDateTime localDateTime = new LocalDateTime(); obscreate.setObsDatetime(localDateTime.toString()); obscreate.setPerson(patient.getUuid()); observations.add(obscreate); } encountercreate.setObservations(observations); encountercreate.setFormname(formname); encountercreate.setPatientId(mPatientID); encountercreate.setObslist(); new EncounterService().addEncounter(encountercreate); finish(); }
Source:
public Object debugStreamingSenderInputOutputAbort(ProceedingJoinPoint proceedingJoinPoint, String correlationId, String message, ParameterResolutionContext parameterResolutionContext, MessageOutputStream target) throws Throwable { if (debug) System.out.println("debugStreamingSenderInputOutputAbort thread id +Thread.currentThread().getId()+ thread name +Thread.currentThread().getName()+ correlationId ["+correlationId+"]"); return debugSenderWithParametersInputOutputAbort(proceedingJoinPoint, correlationId, message, parameterResolutionContext); }

Target:
public Object debugStreamingSenderInputOutputAbort(ProceedingJoinPoint proceedingJoinPoint, String correlationId, String message, ParameterResolutionContext parameterResolutionContext, MessageOutputStream target) throws Throwable { if (log.isDebugEnabled()) log.debug("debugStreamingSenderInputOutputAbort thread id +Thread.currentThread().getId()+ thread name +Thread.currentThread().getName()+ correlationId ["+correlationId+"]"); return debugSenderWithParametersInputOutputAbort(proceedingJoinPoint, correlationId, message, parameterResolutionContext); }
Source:
private static Set<ObjectId> refIdSet(Collection<Ref> refs) { Set<ObjectId> ids = new HashSet<ObjectId>(refs.size()); for (Ref ref : refs) { if (ref.getObjectId() != null) { ids.add(ref.getObjectId()); } if (ref.getPeeledObjectId() != null) { ids.add(ref.getPeeledObjectId()); } } return ids; }

Target:
private static Set<ObjectId> refIdSet(Collection<Ref> refs) { Set<ObjectId> ids = new HashSet<ObjectId>(refs.size()); for (Ref ref : refs) { ObjectId id = ref.getObjectId(); if (id != null) { ids.add(id); } id = ref.getPeeledObjectId(); if (id != null) { ids.add(id); } } return ids; }
Source:
public void tagEvent(ReplaceableTagEvent event) { Attribute attribute = event.getAttributes().fulfill(1); if (attribute.startsWith("weapon")) { if (attribute.hasContext(1)) { ItemStack weapon = utility.generateWeapon(attribute.getContext(1)); if (weapon != null) { event.setReplacedObject(new ItemTag(weapon).getObjectAttribute(attribute.fulfill(1))); } else { Debug.echoError("Invalid weapon name specified."); } } } }

Target:
public void tagEvent(ReplaceableTagEvent event) { Attribute attribute = event.getAttributes().fulfill(1); if (attribute.startsWith("weapon") && attribute.hasContext(1)) { ItemStack weapon = utility.generateWeapon(attribute.getContext(1)); if (weapon != null) { event.setReplacedObject(new ItemTag(weapon).getObjectAttribute(attribute.fulfill(1))); } else { attribute.echoError("Invalid weapon name specified."); } } }
Source:
public void testExtensionPoints() throws UserNotConnectedException { doLogin(); ExplorerHomePage home = goHome(); ArtifactHomePage ahome = home.navigateTo(home.currentExtensionPoints); assertTrue(ahome.isSelected(ahome.extensionPoints)); WebElement elt = ahome.getFirstListingElement(); WebElement link = elt.findElement(By.xpath(". assertEquals("actions", link.getText()); assertEquals("ActionService", elt.findElement(By.xpath(". assertEquals("org.nuxeo.ecm.platform.actions.ActionService", elt.findElement(By.xpath(". Locator.scrollAndForceClick(link);; ArtifactPage apage = asPage(ArtifactPage.class); assertTrue(apage.isSelected(apage.extensionPoints)); assertEquals("Extension point org.nuxeo.ecm.platform.actions.ActionService--actions", apage.getTitle()); assertEquals("Extension point actions", apage.header.getText()); assertEquals("In component org.nuxeo.ecm.platform.actions.ActionService", apage.description.getText()); doLogout(); }

Target:
public void testExtensionPoints() throws UserNotConnectedException { ExplorerHomePage home = goHome(); ArtifactHomePage ahome = home.navigateTo(home.currentExtensionPoints); assertTrue(ahome.isSelected(ahome.extensionPoints)); WebElement elt = ahome.getFirstListingElement(); WebElement link = elt.findElement(By.xpath(". assertEquals("actions", link.getText()); assertEquals("ActionService", elt.findElement(By.xpath(". assertEquals("org.nuxeo.ecm.platform.actions.ActionService", elt.findElement(By.xpath(". Locator.scrollAndForceClick(link); ArtifactPage apage = asPage(ArtifactPage.class); assertTrue(apage.isSelected(apage.extensionPoints)); assertEquals("Extension point org.nuxeo.ecm.platform.actions.ActionService--actions", apage.getTitle()); assertEquals("Extension point actions", apage.header.getText()); assertEquals("In component org.nuxeo.ecm.platform.actions.ActionService", apage.description.getText()); }
Source:
private void addTransfers(Set<Integer> segments) { log.debugf("Adding inbound state transfer for segments %s of cache %s", segments, cacheName); Set<Address> excludedSources = new HashSet<Address>(); Map<Address, Set<Integer>> sources = new HashMap<Address, Set<Integer>>(); if (isTransactional && !isTotalOrder) { requestTransactions(segments, sources, excludedSources); } if (isFetchEnabled) { requestSegments(segments, sources, excludedSources); } log.tracef("Finished adding inbound state transfer for segments %s of cache %s", segments, cacheName); }

Target:
private void addTransfers(Set<Integer> segments) { log.debugf("Adding inbound state transfer for segments %s of cache %s", segments, cacheName); Set<Address> excludedSources = new HashSet<Address>(); Map<Address, Set<Integer>> sources = new HashMap<Address, Set<Integer>>(); if (isTransactional && !isTotalOrder) { requestTransactions(segments, sources, excludedSources); } if (isFetchEnabled) { requestSegments(segments, sources, excludedSources); } if (trace) log.tracef("Finished adding inbound state transfer for segments %s of cache %s", segments, cacheName); }
Source:
public boolean areAllProcessesDead() throws IOException { Set<Long> pids = getAllPids(); String user = getRunWorkerAsUser(); boolean allDead = true; try { if (pids.isEmpty()) { return true; } if (ServerUtils.IS_ON_WINDOWS) { return allDead = !isAnyProcessAlive(pids, user); } if (!cachedUserToUidMap.containsKey(user)) { int uid = getPidPathOwnerUid(workerId, pids.iterator().next()); if (uid < 0) { uid = getUserId(user); } if (uid >= 0) { cachedUserToUidMap.put(user, uid); } } if (cachedUserToUidMap.containsKey(user)) { return allDead = !isAnyProcessAlive(pids, cachedUserToUidMap.get(user)); } else { return allDead = !isAnyProcessAlive(pids, user); } } finally { if (allDead && shutdownTimer != null) { shutdownTimer.stop(); shutdownTimer = null; } } }

Target:
public boolean areAllProcessesDead() throws IOException { Set<Long> pids = getAllPids(); String user = getRunWorkerAsUser(); boolean allDead = true; try { if (pids.isEmpty()) { return true; } if (ServerUtils.IS_ON_WINDOWS) { return allDead = !isAnyProcessAlive(pids, user); } if (!cachedUserToUidMap.containsKey(user)) { int uid = getWorkerPathOwnerUid(workerId); if (uid < 0) { uid = getUserId(user); } if (uid >= 0) { cachedUserToUidMap.put(user, uid); } } if (cachedUserToUidMap.containsKey(user)) { return allDead = !isAnyProcessAlive(pids, cachedUserToUidMap.get(user)); } else { return allDead = !isAnyProcessAlive(pids, user); } } finally { if (allDead && shutdownTimer != null) { shutdownTimer.stop(); shutdownTimer = null; } } }
Source:
public String getUrl() { return urlTemplate; }

Target:
public String getUrl() { return template; }
Source:
public void whenSchedulerPausedThenTimerNotFired() throws Exception { long processInstanceId = processService.startProcess(unit.getIdentifier(), PROCESS_ID); assertNotNull(processInstanceId); pauseScheduler(); CountDownLatch latch = new CountDownLatch(1); latch.await(20, TimeUnit.SECONDS); ProcessInstance pi = processService.getProcessInstance(processInstanceId); assertNotNull(processInstanceId); assertEquals(STATE_ACTIVE, pi.getState()); processService.abortProcessInstance(processInstanceId); }

Target:
public void whenSchedulerPausedThenTimerNotFired() throws Exception { long processInstanceId = processService.startProcess(unit.getIdentifier(), PROCESS_ID); assertNotNull(processInstanceId); pauseScheduler(); awaitWithoutInterruption(); ProcessInstance pi = processService.getProcessInstance(processInstanceId); assertNotNull(processInstanceId); assertEquals(STATE_ACTIVE, pi.getState()); processService.abortProcessInstance(processInstanceId); }
Source:
public synchronized void setCapacity(int newNumExecutors, int newWaitQueueSize) { if (newNumExecutors > configuredMaxExecutors) { throw new IllegalArgumentException("Requested newNumExecutors=" + newNumExecutors + " is greater than the configured maximum=" + configuredMaxExecutors); } if (newWaitQueueSize > configuredWaitingQueueSize) { throw new IllegalArgumentException("Requested newWaitQueueSize=" + newWaitQueueSize + " is greater than the configured maximum=" + configuredWaitingQueueSize); } numSlotsAvailable.addAndGet(newNumExecutors - maxParallelExecutors); maxParallelExecutors = newNumExecutors; waitQueue.setWaitQueueSize(newWaitQueueSize); LOG.info("TaskExecutorService is setting capacity to: numExecutors=" + newNumExecutors + ", waitQueueSize=" + newWaitQueueSize); }

Target:
public synchronized void setCapacity(int newNumExecutors, int newWaitQueueSize) { if (newNumExecutors > configuredMaxExecutors) { throw new IllegalArgumentException("Requested newNumExecutors=" + newNumExecutors + " is greater than the configured maximum=" + configuredMaxExecutors); } if (newWaitQueueSize > configuredWaitingQueueSize) { throw new IllegalArgumentException("Requested newWaitQueueSize=" + newWaitQueueSize + " is greater than the configured maximum=" + configuredWaitingQueueSize); } if (newNumExecutors < 0) { throw new IllegalArgumentException("Negative numExecutors is not allowed. Requested " + "newNumExecutors=" + newNumExecutors); } if (newWaitQueueSize < 0) { throw new IllegalArgumentException("Negative waitQueueSize is not allowed. Requested " + "newWaitQueueSize=" + newWaitQueueSize); } numSlotsAvailable.addAndGet(newNumExecutors - maxParallelExecutors); maxParallelExecutors = newNumExecutors; waitQueue.setWaitQueueSize(newWaitQueueSize); LOG.info("TaskExecutorService is setting capacity to: numExecutors=" + newNumExecutors + ", waitQueueSize=" + newWaitQueueSize); }
Source:
public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) { Map<String, String> retMap = super.getEventHoverToolTipInfo(event, hoverTime); if (retMap == null) { retMap = new LinkedHashMap<>(1); } if (!(event instanceof TimeEvent) || !((TimeEvent) event).hasValue() || !(event.getEntry() instanceof ControlFlowEntry)) { return retMap; } ControlFlowEntry entry = (ControlFlowEntry) event.getEntry(); ThreadStatusDataProvider dataProvider = (ThreadStatusDataProvider) AbstractDataProviderTimeGraphView.getProvider(entry); TmfModelResponse<@NonNull Map<@NonNull String, @NonNull String>> response = dataProvider.fetchTooltip( new SelectionTimeQueryFilter(hoverTime, hoverTime, 1, Collections.singletonList(entry.getModel().getId())), null); Map<@NonNull String, @NonNull String> map = response.getModel(); if (map != null) { String cpu = map.get(ThreadStatusDataProvider.CPU); if (cpu != null) { retMap.put(Messages.ControlFlowView_attributeCpuName, cpu); } } return retMap; }

Target:
public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) { Map<String, String> retMap = super.getEventHoverToolTipInfo(event, hoverTime); if (retMap == null) { retMap = new LinkedHashMap<>(1); } if (!(event instanceof TimeEvent) || !((TimeEvent) event).hasValue() || !(event.getEntry() instanceof ControlFlowEntry)) { return retMap; } ControlFlowEntry entry = (ControlFlowEntry) event.getEntry(); ITimeGraphDataProvider<? extends TimeGraphEntryModel> dataProvider = BaseDataProviderTimeGraphView.getProvider(entry); TmfModelResponse<@NonNull Map<@NonNull String, @NonNull String>> response = dataProvider.fetchTooltip( new SelectionTimeQueryFilter(hoverTime, hoverTime, 1, Collections.singletonList(entry.getModel().getId())), null); Map<@NonNull String, @NonNull String> map = response.getModel(); if (map != null) { String cpu = map.get(ThreadStatusDataProvider.CPU); if (cpu != null) { retMap.put(Messages.ControlFlowView_attributeCpuName, cpu); } } return retMap; }
Source:
public void addBindingProvider(BindingProvider provider) { super.addBindingProvider(provider); logger.debug("addBindingProvider: " + Arrays.toString(provider.getItemNames().toArray())); for (String itemName: provider.getItemNames()) { bindGpioPin((MCP23017BindingProvider)provider, itemName); } }

Target:
public void addBindingProvider(BindingProvider provider) { super.addBindingProvider(provider); logger.debug("addBindingProvider: {}", Arrays.toString(provider.getItemNames().toArray())); for (String itemName : provider.getItemNames()) { bindGpioPin((MCP23017BindingProvider) provider, itemName); } }
Source:
private Map<Path, String> getPaths(String pathWithWildcard) { String pathWithoutWildcards = pathWithWildcard.replace("*", ""); try { Map<Path, String> paths = Files.list(Paths.get(pathWithoutWildcards)) .filter(path -> path.toString().toLowerCase().endsWith(".jar")) .collect(Collectors.toMap(p -> p, o -> o.getFileName().toString())); if (paths == null || paths.isEmpty()) { throw new IllegalStateException("Cannot find any jars files in selected path"); } return paths; } catch (IOException e) { throw new IllegalStateException("Cannot find any jars files in selected path"); } }

Target:
private Map<Path, String> getPaths(String pathWithWildcard) { String pathWithoutWildcards = pathWithWildcard.replace("*", ""); try { return Files.list(Paths.get(pathWithoutWildcards)) .filter(path -> path.toString().toLowerCase().endsWith(".jar")) .collect(Collectors.toMap(p -> p, o -> o.getFileName().toString())); } catch (IOException e) { throw new IllegalStateException("Cannot find any jars files in selected path"); } }
Source:
public List<IMetric> transform(List<IMetric> metrics) { if (metrics.size() == 0) { return metrics; } Comparator<IMetric> compare = new Comparator<IMetric>() { public int compare(IMetric m1, IMetric m2) { return m1.getName().compareTo(m2.getName()); } }; Collections.sort(metrics,compare); AveragedMetric workingMetric = new AveragedMetric(metrics.get(0)); ArrayList<IMetric> aggedMetrics = new ArrayList<IMetric>(); for (int i = 1; i < metrics.size(); i++) { IMetric curMetric = metrics.get(i); if (workingMetric.getName() != curMetric.getName()) { aggedMetrics.add(workingMetric); workingMetric = new AveragedMetric(curMetric); } else { workingMetric.addDataPoint(curMetric.getValue()); } } return aggedMetrics; }

Target:
public List<IMetric> transform(List<IMetric> metrics) { if (metrics.size() == 0) { return metrics; } Comparator<IMetric> compare = new Comparator<IMetric>() { public int compare(IMetric m1, IMetric m2) { return m1.getName().compareTo(m2.getName()); } }; Collections.sort(metrics,compare); ArrayList<IMetric> aggedMetrics = new ArrayList<IMetric>(); AveragedMetric workingMetric = new AveragedMetric(metrics.get(0)); aggedMetrics.add(workingMetric); for (int i = 1; i < metrics.size(); i++) { IMetric curMetric = metrics.get(i); if (workingMetric.getName() != curMetric.getName()) { workingMetric = new AveragedMetric(curMetric); aggedMetrics.add(workingMetric); } else { workingMetric.addDataPoint(curMetric.getValue()); } } return aggedMetrics; }
Source:
public void setup(OperatorContext context) { valueList = new ArrayList<Map<String, T>>(); HashMap<String, T> map = new HashMap<>(); map.put(valueName, null); valueList.add(map); }

Target:
public void setup(OperatorContext context) { valueMap = new HashMap<>(); valueMap.put(valueName, null); valueList = Collections.singletonList(valueMap); }
Source:
public boolean isAbstract() { return true; }

Target:
public boolean isAbstract() { if (isDefault() || isStatic()) { return false; } else { return true; } }
Source:
public void whenGetOptionsRetentionTimeExist() throws Exception { final EventType defaultEventType = buildDefaultEventType(); final EventTypeOptions eventTypeOptions = new EventTypeOptions(); eventTypeOptions.setRetentionTime(150L); defaultEventType.setOptions(eventTypeOptions); Mockito.doReturn(Collections.singletonList(defaultEventType)).when(eventTypeRepository).list(); getEventType() .andExpect(status().is2xxSuccessful()) .andExpect(content().string(new StringContains("\"options\":{\"retention_time\":150}"))); }

Target:
public void whenGetOptionsRetentionTimeExist() throws Exception { final EventType defaultEventType = buildDefaultEventType(); defaultEventType.getOptions().setRetentionTime(TOPIC_RETENTION_TIME_MS); final String eventTypeName = defaultEventType.getName(); Mockito.doReturn(defaultEventType).when(eventTypeRepository).findByName(eventTypeName); getEventType(eventTypeName) .andExpect(status().is2xxSuccessful()) .andExpect(content().string(new StringContains("\"options\":{\"retention_time\":150}"))); }
Source:
public HashMap<Integer, ArchitectureType> getOsArchitectures() { HashMap<Integer, ArchitectureType> osArchitectures = new HashMap<Integer, ArchitectureType>(); for (int osId : getOsIds()) { String architecture = getValueByVersion(idToUnameLookup.get(osId), "cpuArchitecture", null); ArchitectureType archType = ArchitectureType.valueOf(architecture); if (architecture != null) { osArchitectures.put(osId, archType); } } return osArchitectures; }

Target:
public HashMap<Integer, ArchitectureType> getOsArchitectures() { HashMap<Integer, ArchitectureType> osArchitectures = new HashMap<Integer, ArchitectureType>(); for (int osId : getOsIds()) { String architecture = getValueByVersion(idToUnameLookup.get(osId), "cpuArchitecture", null); if (architecture != null) { osArchitectures.put(osId, ArchitectureType.valueOf(architecture)); } } return osArchitectures; }
Source:
public void onCompleted(Object companion) { AppLog.i(AppLog.T.READER, "notifications update job service > all tasks completed"); jobFinished((JobParameters) companion, false); }

Target:
public void onCompleted(Object companion) { AppLog.i(AppLog.T.NOTIFS, "notifications update job service > all tasks completed"); jobFinished((JobParameters) companion, false); }
Source:
public static boolean isUpperCamelCase(String word) { return !word.isEmpty() && word.matches(ALPHANUMERIC_REGEX) && Character.isUpperCase(word.charAt(0)); }

Target:
public static boolean isUpperCamelCase(String word) { return !word.isEmpty() && Character.isUpperCase(word.charAt(0)) && word.matches(ALPHANUMERIC_REGEX); }
Source:
public void applySelector(ClientSelector newSelector) { logger.info("Applying a new client selector :" + newSelector); clientSelector = newSelector; Collection<ClientEndpoint> endpoints = endpointManager.getEndpoints(); for (ClientEndpoint endpoint : endpoints) { if (clientSelector.select(endpoint)) { continue; } String clientUuid = endpoint.getUuid(); String memberUuid = ownershipMappings.get(clientUuid); ClientDisconnectionOperation op = new ClientDisconnectionOperation(clientUuid, memberUuid); InternalOperationService service = nodeEngine.getOperationService(); Address thisAddress = getThisAddress(); Future future = service.createInvocationBuilder(ClientEngineImpl.SERVICE_NAME, op, thisAddress).invoke(); try { future.get(); } catch (Exception e) { logger.warning("Could not applied new selector for " + endpoint); } } }

Target:
public void applySelector(ClientSelector newSelector) { logger.info("Applying a new client selector :" + newSelector); clientSelector = newSelector; Collection<ClientEndpoint> endpoints = endpointManager.getEndpoints(); for (ClientEndpoint endpoint : endpoints) { if (clientSelector.select(endpoint)) { continue; } String clientUuid = endpoint.getUuid(); String memberUuid = ownershipMappings.get(clientUuid); ClientDisconnectionOperation op = new ClientDisconnectionOperation(clientUuid, memberUuid); InternalOperationService service = nodeEngine.getOperationService(); Address thisAddress = getThisAddress(); Future future = service.createInvocationBuilder(ClientEngineImpl.SERVICE_NAME, op, thisAddress).invoke(); try { future.get(); } catch (Exception e) { logger.warning("Could not apply new selector for " + endpoint); } } }
Source:
public byte[] writeCleanUp(Set<String> removedIds){ CeleryBody body = new CeleryBody(); body.task= "cleanup"; body.expires=""; body.id="entity-CU:"+System.currentTimeMillis(); body.kwargs.put("cleanup_entities", removedIds); return writer.asCeleryTask(body); }

Target:
public byte[] writeCleanUp(Set<String> removedIds) { CeleryBody body = new CeleryBody(); body.task = "cleanup"; body.expires = ""; String uuid = UUID.randomUUID().toString(); body.id = "entity-CU:" + uuid; body.kwargs.put("cleanup_entities", removedIds); CeleryBody.EntityCleanUpArg command = new CeleryBody.EntityCleanUpArg(); command.check_id = "CU:" + uuid; body.args.add(command); body.timelimit.add(3600L); body.timelimit.add(7200L); return writer.asCeleryTask(body); }
Source:
Bundle toBundle() { Bundle bundle = new Bundle(); bundle.putString(KEY_SENDER_CONTACT_ID, senderContactId); bundle.putString(KEY_CONVERSATION_ID, conversId); bundle.putLong(KEY_TIMESTAMP, timestamp); bundle.putString(KEY_MESSAGE, message); bundle.putBundle(KEY_EXTRAS, bundle); return bundle; }}

Target:
Bundle toBundle() { Bundle bundle = new Bundle(); bundle.putString(KEY_SENDER_CONTACT_ID, senderContactId); bundle.putString(KEY_CONVERSATION_ID, conversId); bundle.putLong(KEY_TIMESTAMP, timestamp); bundle.putString(KEY_MESSAGE, message); bundle.putBundle(KEY_EXTRAS, bundle); return bundle; }
Source:
public void trade() { for (String stock : sellOrders.keySet()) { if (buyOrders.containsKey(stock)==false) { return; } ArrayList<Order> buying = buyOrders.get(stock); ArrayList<Order> selling = sellOrders.get(stock); TreeMap<Double, ArrayList<Order>> sortedOrders = new TreeMap<Double, ArrayList<Order>>(); sortOrder(buying, selling, sortedOrders); double marketPrice = m.getStockForSymbol(stock).getPrice(); ArrayList<Order> marketOrders = sortedOrders.remove(0.0); int sumofBuy = 0, sumofSell = 0; for (Order marketOrder : marketOrders) { if (marketOrder instanceof BuyOrder) { sumofBuy += marketOrder.getSize(); } else { sumofSell += marketOrder.getSize(); } } int priceSize = sortedOrders.size(); int[] sumBuyPrice = new int[priceSize]; int[] sumSellPrice = new int[priceSize]; cumulativeSellOrders(sortedOrders, sumofBuy, sumofSell, priceSize, sumBuyPrice, sumSellPrice); double matchingPrice = matchPrice(sortedOrders, marketPrice, priceSize, sumBuyPrice, sumSellPrice); updatePrice(stock, marketPrice, matchingPrice); delTrades(stock, sortedOrders, marketOrders, matchingPrice); } }

Target:
public void trade() { for (String stock : sellOrders.keySet()) { if (buyOrders.containsKey(stock)==false) { return; } ArrayList<Order> buying = buyOrders.get(stock); ArrayList<Order> selling = sellOrders.get(stock); TreeMap<Double, ArrayList<Order>> sortedOrders = new TreeMap<Double, ArrayList<Order>>(); sortOrder(buying, selling, sortedOrders); double marketPrice = m.getStockForSymbol(stock).getPrice(); ArrayList<Order> marketOrders = sortedOrders.remove(0.0); int sumOfBuy = 0, sumOfSell = 0; for (Order marketOrder : marketOrders) { if (marketOrder instanceof BuyOrder) { sumOfBuy += marketOrder.getSize(); } else { sumOfSell += marketOrder.getSize(); } } int priceSize = sortedOrders.size(); int[] sumBuyPrice = new int[priceSize]; int[] sumSellPrice = new int[priceSize]; cumulativeSellOrders(sortedOrders, sumOfBuy, sumOfSell, priceSize, sumBuyPrice, sumSellPrice); double matchingPrice = matchPrice(sortedOrders, marketPrice, priceSize, sumBuyPrice, sumSellPrice); updatePrice(stock, marketPrice, matchingPrice); delTrades(stock, sortedOrders, marketOrders, matchingPrice); } }
Source:
public void setupJob(JobContext context) throws IOException { try (DurationInfo d = new DurationInfo(LOG, "Job %s setting up", getUUID())) { jobSetup = true; Configuration c = context.getConfiguration(); c.set(FS_S3A_COMMITTER_UUID, this.getUUID()); if (getUUIDSource() == JobUUIDSource.GeneratedLocally) { c.set(SPARK_WRITE_UUID, this.getUUID()); } Path dest = getOutputPath(); if (createJobMarker){ commitOperations.deleteSuccessMarker(dest); } getDestFS().mkdirs(dest); warnOnActiveUploads(dest); } }

Target:
public void setupJob(JobContext context) throws IOException { try (DurationInfo d = new DurationInfo(LOG, "Job %s setting up", getUUID())) { jobSetup = true; Configuration c = context.getConfiguration(); c.set(FS_S3A_COMMITTER_UUID, getUUID()); c.set(FS_S3A_COMMITTER_UUID_SOURCE, getUUIDSource().getText()); Path dest = getOutputPath(); if (createJobMarker){ commitOperations.deleteSuccessMarker(dest); } getDestFS().mkdirs(dest); warnOnActiveUploads(dest); } }
Source:
public void learn(int numIters, Map<String, List<Evaluation>> evaluations) { LogInfo.begin_track("Learner.learn()"); if (!params.isEmpty()) sortOnFeedback(); for (int iter = 0; iter <= numIters; iter++) { LogInfo.begin_track("Iteration %s/%s", iter, numIters); Execution.putOutput("iter", iter); Map<String, Evaluation> meanEvaluations = Maps.newHashMap(); for (String group : dataset.groups()) meanEvaluations.put(group, new Evaluation()); for (String group : dataset.groups()) { boolean lastIter = (iter == numIters); boolean updateWeights = opts.updateWeights && group.equals("train") && !lastIter; if (parser instanceof MutatingParser) { ((MutatingParser) parser).mutate(iter, numIters, group); } Evaluation eval = processExamples( iter, group, dataset.examples(group), updateWeights); MapUtils.addToList(evaluations, group, eval); meanEvaluations.get(group).add(eval); StopWatchSet.logStats(); } String path = Execution.getFile("params." + iter); if (path != null) { params.write(path); Utils.systemHard("ln -sf params." + iter + " " + Execution.getFile("params")); } LogInfo.end_track(); } LogInfo.end_track(); }

Target:
public void learn(int numIters, Map<String, List<Evaluation>> evaluations) { LogInfo.begin_track("Learner.learn()"); if (!params.isEmpty()) sortOnFeedback(); for (int iter = 0; iter <= numIters; iter++) { LogInfo.begin_track("Iteration %s/%s", iter, numIters); Execution.putOutput("iter", iter); Map<String, Evaluation> meanEvaluations = Maps.newHashMap(); for (String group : dataset.groups()) meanEvaluations.put(group, new Evaluation()); for (String group : dataset.groups()) { boolean lastIter = (iter == numIters); boolean updateWeights = opts.updateWeights && group.equals("train") && !lastIter; parser.onBeginDataGroup(iter, numIters, group); Evaluation eval = processExamples( iter, group, dataset.examples(group), updateWeights); MapUtils.addToList(evaluations, group, eval); meanEvaluations.get(group).add(eval); StopWatchSet.logStats(); } String path = Execution.getFile("params." + iter); if (path != null) { params.write(path); Utils.systemHard("ln -sf params." + iter + " " + Execution.getFile("params")); } LogInfo.end_track(); } LogInfo.end_track(); }
Source:
PropertyValues getValues(ClassPropertyReference propertyReference, int limit, Object... filterParameters) throws XWikiRestException; default PropertyValues getValue(ClassPropertyReference propertyReference, Object rawValue) throws XWikiRestException { throw new UnsupportedOperationException(); }

Target:
PropertyValues getValues(ClassPropertyReference propertyReference, int limit, Object... filterParameters) throws XWikiRestException; default PropertyValue getValue(ClassPropertyReference propertyReference, Object rawValue) throws XWikiRestException { throw new UnsupportedOperationException(); }
Source:
public Response getDevicesInOrganization() { List<DeviceOrganizationMetadataHolder> result; DeviceOrganizationProviderService dops = new DeviceOrganizationProviderServiceImpl(); try { result = dops.getDevicesInOrganization(); if (result == null) { String msg = "No devices exist in organization"; log.error(msg); return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); } return Response.status(Response.Status.OK).entity(result).build(); } catch (DeviceOrganizationException e) { String msg = "Error occurred while retrieving devices in organization"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } catch (InvalidConfigurationException e) { log.error("failed to add operation", e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } }

Target:
public Response getDevicesInOrganization() { List<DeviceOrganizationMetadataHolder> result; DeviceOrganizationProviderService dops = new DeviceOrganizationProviderServiceImpl(); try { result = dops.getDevicesInOrganization(); if (result == null) { String msg = "No devices exist in organization"; if (log.isDebugEnabled()) { log.debug(msg); } return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); } return Response.status(Response.Status.OK).entity(result).build(); } catch (DeviceOrganizationException e) { String msg = "Error occurred while retrieving devices in organization"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } catch (InvalidConfigurationException e) { String msg = "failed to add operation"; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } }
Source:
private void showPostInfo(Post post) { StringBuilder text = new StringBuilder(); for (PostImage image : post.images) { text.append("Filename: ") .append(image.filename).append(".").append(image.extension) .append(" \nDimensions: ") .append(image.imageWidth).append("x").append(image.imageHeight) .append("\nSize: ") .append(AndroidUtils.getReadableFileSize(image.size, false)); if (image.spoiler) { text.append("\nSpoilered"); } text.append("\n"); } Date date = new Date () ; date.setTime((long)post.time*1000); text.append(new StringBuilder("Date: " + date.toString())); if (!TextUtils.isEmpty(post.id)) { text.append("\nId: ").append(post.id); } if (!TextUtils.isEmpty(post.tripcode)) { text.append("\nTripcode: ").append(post.tripcode); } if (!TextUtils.isEmpty(post.capcode)) { text.append("\nCapcode: ").append(post.capcode); } threadPresenterCallback.showPostInfo(text.toString()); }

Target:
private void showPostInfo(Post post) { StringBuilder text = new StringBuilder(); for (PostImage image : post.images) { text.append("Filename: ") .append(image.filename).append(".").append(image.extension) .append(" \nDimensions: ") .append(image.imageWidth).append("x").append(image.imageHeight) .append("\nSize: ") .append(AndroidUtils.getReadableFileSize(image.size, false)); if (image.spoiler) { text.append("\nSpoilered"); } text.append("\n"); } if (!TextUtils.isEmpty(post.id)) { text.append("\nId: ").append(post.id); } if (!TextUtils.isEmpty(post.tripcode)) { text.append("\nTripcode: ").append(post.tripcode); } if (!TextUtils.isEmpty(post.capcode)) { text.append("\nCapcode: ").append(post.capcode); } threadPresenterCallback.showPostInfo(text.toString()); }
Source:
public final void refreshItems() { final HashSet<Integer> issuesWithNewComments = updateIssueCommentCounts(Qualifier.hasUpdatedQualifier(getCurrentFilterExpression())); listView.setCellFactory(list -> new ListPanelCell(this, panelIndex, issuesWithNewComments)); listView.saveSelection(); listView.setItems(null); listView.setItems(getElementsList()); issueCount = getElementsList().size(); closedIssueCount = getClosedIssueSize(); openIssueCount = issueCount - closedIssueCount; System.out.println("closed = " + closedIssueCount + " open = " + openIssueCount); listView.restoreSelection(); this.setId(guiController.getDefaultRepo() + "_col" + panelIndex); updateFooter(); }

Target:
public final void refreshItems() { final HashSet<Integer> issuesWithNewComments = updateIssueCommentCounts(Qualifier.hasUpdatedQualifier(getCurrentFilterExpression())); listView.setCellFactory(list -> new ListPanelCell(this, panelIndex, issuesWithNewComments)); listView.saveSelection(); listView.setItems(null); listView.setItems(getElementsList()); issuesCount = getElementsList().size(); closedIssuesCount = getClosedIssuesCount(); openIssuesCount = issuesCount - closedIssuesCount; listView.restoreSelection(); this.setId(guiController.getDefaultRepo() + "_col" + panelIndex); updateFooter(); }
Source:
public String getDescription() { if (description == null || description.isEmpty()) { } return description; }

Target:
public String getDescription() { return description; }
Source:
static ByteBuf bb(int size) { ByteBuf buf = UnpooledByteBufAllocator.DEFAULT.buffer(); for (int i = 0; i < size; i++) { buf.writeByte('a'); } return buf; }

Target:
static ByteBuf bb(int size) { return UnpooledByteBufAllocator.DEFAULT.buffer().writeZero(size); }