auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DiskImageConditionFieldAutoCompleter() { mVerbs.put("ALIAS", "ALIAS"); mVerbs.put("DESCRIPTION", "DESCRIPTION"); mVerbs.put("PROVISIONED_SIZE", "PROVISIONED_SIZE"); mVerbs.put("SIZE", "SIZE"); mVerbs.put("ACTUAL_SIZE", "ACTUAL_SIZE"); mVerbs.put("CREATION_DATE", "CREATION_DATE"); mVerbs.put("BOOTABLE", "BOOTABLE"); mVerbs.put("FORMAT", "FORMAT"); mVerbs.put("STATUS", "STATUS"); buildCompletions(); getTypeDictionary().put("ALIAS", String.class); getTypeDictionary().put("DESCRIPTION", String.class); getTypeDictionary().put("PROVISIONED_SIZE", Long.class); getTypeDictionary().put("SIZE", Long.class); getTypeDictionary().put("ACTUAL_SIZE", Long.class); getTypeDictionary().put("CREATION_DATE", Date.class); getTypeDictionary().put("BOOTABLE", Boolean.class); getTypeDictionary().put("FORMAT", VolumeFormat.class); getTypeDictionary().put("STATUS", ImageStatus.class); mColumnNameDict.put("ALIAS", "disk_alias"); mColumnNameDict.put("DESCRIPTION", "disk_description"); mColumnNameDict.put("PROVISIONED_SIZE", "size"); mColumnNameDict.put("SIZE", "actual_size"); mColumnNameDict.put("ACTUAL_SIZE", "actual_size"); mColumnNameDict.put("CREATION_DATE", "creation_date"); mColumnNameDict.put("BOOTABLE", "boot"); mColumnNameDict.put("FORMAT", "volume_format"); mColumnNameDict.put("STATUS", "imageStatus"); buildBasicValidationTable(); }

Target:
public DiskImageConditionFieldAutoCompleter() { mVerbs.put("ALIAS", "ALIAS"); mVerbs.put("DESCRIPTION", "DESCRIPTION"); mVerbs.put("PROVISIONED_SIZE", "PROVISIONED_SIZE"); mVerbs.put("SIZE", "SIZE"); mVerbs.put("ACTUAL_SIZE", "ACTUAL_SIZE"); mVerbs.put("CREATION_DATE", "CREATION_DATE"); mVerbs.put("BOOTABLE", "BOOTABLE"); mVerbs.put("FORMAT", "FORMAT"); mVerbs.put("STATUS", "STATUS"); buildCompletions(); getTypeDictionary().put("ALIAS", String.class); getTypeDictionary().put("DESCRIPTION", String.class); getTypeDictionary().put("PROVISIONED_SIZE", Long.class); getTypeDictionary().put("SIZE", Long.class); getTypeDictionary().put("ACTUAL_SIZE", Long.class); getTypeDictionary().put("CREATION_DATE", Date.class); getTypeDictionary().put("BOOTABLE", Boolean.class); getTypeDictionary().put("FORMAT", VolumeFormat.class); getTypeDictionary().put("STATUS", ImageStatus.class); mColumnNameDict.put("ALIAS", "disk_alias"); mColumnNameDict.put("DESCRIPTION", "disk_description"); mColumnNameDict.put("PROVISIONED_SIZE", "size"); mColumnNameDict.put("SIZE", "size"); mColumnNameDict.put("ACTUAL_SIZE", "actual_size"); mColumnNameDict.put("CREATION_DATE", "creation_date"); mColumnNameDict.put("BOOTABLE", "boot"); mColumnNameDict.put("FORMAT", "volume_format"); mColumnNameDict.put("STATUS", "imageStatus"); buildBasicValidationTable(); }
Source:
static List<Date> getDays(long endTs, @Nullable Long lookback) { List<Date> result = new ArrayList<>(); for (Long epochMillis : DateUtil.epochDays(endTs, lookback)) { result.add(new Date(epochMillis)); } return result; }

Target:
static List<Date> getDays(long endTs, @Nullable Long lookback) { List<Date> result = new ArrayList<>(); for (long epochMillis : DateUtil.epochDays(endTs, lookback)) { result.add(new Date(epochMillis)); } return result; }
Source:
protected Snapshot doPopulate(Snapshot model, org.ovirt.engine.core.common.businessentities.Snapshot entity) { if (isPopulate()) { VdcQueryReturnValue queryReturnValue = runQuery(VdcQueryType.GetVmOvfConfigurationBySnapshot, new IdQueryParameters(Guid.createGuidFromString(model.getId()))); if (queryReturnValue.getSucceeded() && queryReturnValue.getReturnValue() != null) { return SnapshotMapper.mapSnapshotConfiguration((String) queryReturnValue.getReturnValue(), ConfigurationType.OVF, model); } } return model; }

Target:
protected Snapshot doPopulate(Snapshot model, org.ovirt.engine.core.common.businessentities.Snapshot entity) { VdcQueryReturnValue queryReturnValue = runQuery(VdcQueryType.GetVmOvfConfigurationBySnapshot, new IdQueryParameters(Guid.createGuidFromString(model.getId()))); if (queryReturnValue.getSucceeded() && queryReturnValue.getReturnValue() != null) { return SnapshotMapper.mapSnapshotConfiguration((String) queryReturnValue.getReturnValue(), ConfigurationType.OVF, model); } return model; }
Source:
public void testGetDrugByMapping_shouldReturnADrugThatMatchesTheSpecifiedSourceAndBestMapType() throws Exception { Drug drugs = conceptService.getDrugByMapping("WGT234", conceptService.getConceptSource(1), Arrays.asList(conceptService.getConceptMapType(2)), false); assertNull(drugs); }

Target:
public void testGetDrugByMapping_shouldReturnADrugThatMatchesTheSpecifiedSourceAndBestMapType() throws Exception { executeDataSet(GET_DRUG_MAPPINGS); List<ConceptMapType> conceptMapTypeList = conceptService.getConceptMapTypes(false,true); Drug drug = conceptService.getDrugByMapping("CD41003", conceptService.getConceptSource(1), conceptMapTypeList, false); assertNull(drug); }
Source:
private Context(final List<G> objects, final List<M> attributes, final BinaryRelation relation) { this.objects = objects; this.attributes = attributes; this.relation = relation; }

Target:
private Context(final List<G> objects, final List<M> attributes, final BinaryRelation relation) { this.objects = ImmutableList.copyOf(objects); this.attributes = ImmutableList.copyOf(attributes); this.relation = relation; }
Source:
public static ByteBuffer handleBufferUnderflow(final SSLEngine engine, ByteBuffer buffer) { if (buffer.position() < buffer.limit()) { return buffer; } ByteBuffer replaceBuffer = enlargeBuffer(buffer, engine.getSession().getPacketBufferSize()); buffer.flip(); replaceBuffer.put(buffer); return replaceBuffer; }

Target:
public static ByteBuffer handleBufferUnderflow(final SSLEngine engine, ByteBuffer buffer) { if (engine == null || buffer == null) { return buffer; } if (buffer.position() < buffer.limit()) { return buffer; } ByteBuffer replaceBuffer = enlargeBuffer(buffer, engine.getSession().getPacketBufferSize()); buffer.flip(); replaceBuffer.put(buffer); return replaceBuffer; }
Source:
public void setError(@Nullable Throwable caught) { Resources resources = getContext().getResources(); ErrorType errorType = getErrorType(caught); icon.setImageDrawable(ContextCompat.getDrawable(getContext(), errorType.icon())); errorText.setText(resources.getString(errorType.text())); button.setText(resources.getString(errorType.buttonText())); button.setOnClickListener(errorType.buttonClickListener(this)); if (errorType.hasFooterText()) { footerLayout.setVisibility(VISIBLE); footerText.setText(resources.getString(errorType.footerText())); } }

Target:
public void setError(@Nullable Throwable caught) { Resources resources = getContext().getResources(); ErrorType errorType = getErrorType(caught); icon.setImageDrawable(ContextCompat.getDrawable(getContext(), errorType.icon())); errorText.setText(resources.getString(errorType.text())); button.setText(resources.getString(errorType.buttonText())); button.setOnClickListener(errorType.buttonClickListener(this)); if (errorType.hasFooterText()) { footerLayout.setVisibility(VISIBLE); footerText.setText(resources.getString(errorType.footerText())); } else { footerLayout.setVisibility(GONE); } }
Source:
public ApiClient(ApiClientConfiguration config) { PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); connectionManager.closeExpiredConnections(); connectionManager.closeIdleConnections(5, TimeUnit.SECONDS); StandardHttpRequestRetryHandler requestRetryHandler = new StandardHttpRequestRetryHandler(3, true); HttpClient client = HttpClientBuilder.create().setConnectionManager(connectionManager).setRetryHandler(requestRetryHandler) .setUserAgent("OktaApiClient").disableCookieManagement().build(); this.httpClient = client; this.baseUrl = config.getBaseUrl(); this.apiVersion = config.getApiVersion(); this.configuration = config; this.token = config.getApiToken(); initMarshaller(); }

Target:
public ApiClient(ApiClientConfiguration config) { StandardHttpRequestRetryHandler requestRetryHandler = new StandardHttpRequestRetryHandler(RETRY_COUNT, true); HttpClient client = HttpClientBuilder.create().setRetryHandler(requestRetryHandler) .setUserAgent("OktaSDKJava_v" + Utils.getSdkVersion()).disableCookieManagement().build(); this.httpClient = client; this.baseUrl = config.getBaseUrl(); this.apiVersion = config.getApiVersion(); this.configuration = config; this.token = config.getApiToken(); initMarshaller(); }
Source:
public CompletableFuture<RspList<Response>> invokeRemoteCommands(List<Address> recipients, ReplicableCommand command, ResponseMode mode, long timeout, RspFilter filter, DeliverOrder deliverOrder) { CompletableFuture<RspList<Response>> future; try { if (recipients != null && mode == ResponseMode.GET_FIRST && STAGGER_DELAY_NANOS > 0) { future = new CompletableFuture<>(); RspList<Response> rsps = new RspList<>(); for (Address recipient : recipients) { rsps.put(recipient, new Rsp<>(recipient)); } long nanoTimeout = timeout > 0 ? TimeUnit.MILLISECONDS.toNanos(timeout) : Long.MAX_VALUE; long deadline = System.nanoTime() + nanoTimeout; processCallsStaggered(command, filter, recipients, mode, deliverOrder, req_marshaller, future, 0, deadline, rsps); } else { future = processCalls(command, recipients == null, timeout, filter, recipients, mode, deliverOrder, req_marshaller); } return future; } catch (Exception e) { return rethrowAsCacheException(e); } }

Target:
public CompletableFuture<RspList<Response>> invokeRemoteCommands(List<Address> recipients, ReplicableCommand command, ResponseMode mode, long timeout, RspFilter filter, DeliverOrder deliverOrder) { CompletableFuture<RspList<Response>> future; try { if (recipients != null && mode == ResponseMode.GET_FIRST && STAGGER_DELAY_NANOS > 0) { future = new CompletableFuture<>(); RspList<Response> rsps = new RspList<>(); for (Address recipient : recipients) { rsps.put(recipient, new Rsp<>(recipient)); } long nanoTimeout = timeout > 0 ? TimeUnit.MILLISECONDS.toNanos(timeout) : Long.MAX_VALUE; long deadline = timeService.expectedEndTime(nanoTimeout, TimeUnit.NANOSECONDS); processCallsStaggered(command, filter, recipients, mode, deliverOrder, req_marshaller, future, 0, deadline, rsps); } else { future = processCalls(command, recipients == null, timeout, filter, recipients, mode, deliverOrder, req_marshaller); } return future; } catch (Exception e) { return rethrowAsCacheException(e); } }
Source:
private List<GlusterVolumeSnapshotEntity> prepareVolumeSnapshotsList(GlusterVolumeEntity volume, Object[] snapshotInfoDetails) { List<GlusterVolumeSnapshotEntity> newSnapshotsList = new ArrayList<GlusterVolumeSnapshotEntity>(); for (Object obj : snapshotInfoDetails) { Map<String, Object> snapshotInfo = (Map<String, Object>) obj; Object[] snapVolumes = (Object[]) (snapshotInfo.get(SNAPVOLUMES)); Map<String, Object> snapVolume = (Map<String, Object>) snapVolumes[0]; GlusterVolumeSnapshotEntity newSnapshot = new GlusterVolumeSnapshotEntity(); newSnapshot.setClusterId(volume.getClusterId()); newSnapshot.setVolumeId(volume.getId()); try { DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); newSnapshot.setCreatedAt(df.parse((String) snapshotInfo.get(CREATETIME))); } catch (Exception e) { log.error("Could not populate snapshots of volume '{}' on cluster '{}': {}", volume.getName(), volume.getClusterId(), e.getMessage()); log.debug("Exception", e); } newSnapshot.setSnapshotId(Guid.createGuidFromString((String) snapshotInfo.get(UUID))); newSnapshot.setSnapshotName((String) snapshotInfo.get(NAME)); newSnapshot.setDescription((String) snapshotInfo.get(DESCRIPTION)); newSnapshot.setStatus(GlusterSnapshotStatus.from((String) snapVolume.get(STATUS))); newSnapshotsList.add(newSnapshot); } return newSnapshotsList; }

Target:
private List<GlusterVolumeSnapshotEntity> prepareVolumeSnapshotsList(GlusterVolumeEntity volume, Object[] snapshotInfoDetails) { List<GlusterVolumeSnapshotEntity> newSnapshotsList = new ArrayList<GlusterVolumeSnapshotEntity>(); for (Object obj : snapshotInfoDetails) { Map<String, Object> snapshotInfo = (Map<String, Object>) obj; Object[] snapVolumes = (Object[]) (snapshotInfo.get(SNAPVOLUMES)); Map<String, Object> snapVolume = (Map<String, Object>) snapVolumes[0]; GlusterVolumeSnapshotEntity newSnapshot = new GlusterVolumeSnapshotEntity(); newSnapshot.setClusterId(volume.getClusterId()); newSnapshot.setVolumeId(volume.getId()); try { DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); newSnapshot.setCreatedAt(df.parse((String) snapshotInfo.get(CREATETIME))); } catch (Exception e) { log.info("Could not populate creation time for snapshot '{}' of volume '{}' on cluster '{}': {}", (String) snapshotInfo.get(NAME), volume.getName(), volume.getClusterId(), e.getMessage()); log.debug("Exception", e); } newSnapshot.setSnapshotId(Guid.createGuidFromString((String) snapshotInfo.get(UUID))); newSnapshot.setSnapshotName((String) snapshotInfo.get(NAME)); newSnapshot.setDescription((String) snapshotInfo.get(DESCRIPTION)); newSnapshot.setStatus(GlusterSnapshotStatus.from((String) snapVolume.get(STATUS))); newSnapshotsList.add(newSnapshot); } return newSnapshotsList; }
Source:
public SystemProducer getProducer(String systemName, Config config, MetricsRegistry registry) { jobToManager.putIfAbsent(parseJobId(config), new InMemoryManager()); return new InMemorySystemProducer(systemName, jobToManager.get(parseJobId(config))); }

Target:
public SystemProducer getProducer(String systemName, Config config, MetricsRegistry registry) { return new InMemorySystemProducer(systemName, getOrDefaultInMemoryManagerByTestId(config)); }
Source:
public Account find(final String nameOrEmail) throws OrmException { Set<Account.Id> r = findAll(nameOrEmail); if (r.size() == 1) { byId.get(r.iterator().next()).getAccount(); } else { final int lt = nameOrEmail.indexOf('<'); final int gt = nameOrEmail.indexOf('>'); if (lt >= 0 && gt > lt && nameOrEmail.contains("@")) { for (Account.Id id : r) { Account a = byId.get(id).getAccount(); if (a.getFullName().equals(nameOrEmail.substring(0, lt - 1))) { return a; } } } } return null; }

Target:
public Account find(final String nameOrEmail) throws OrmException { Set<Account.Id> r = findAll(nameOrEmail); return r.size() == 1 ? byId.get(r.iterator().next()).getAccount() : null; }
Source:
public boolean removeAttribute(PerunSession sess, User user, AttributeDefinition attribute) throws InternalErrorException { try { if (0 < jdbc.update("DELETE FROM user_attr_values WHERE attr_id=? AND user_id=?", attribute.getId(), user.getId())) { log.debug("Attribute (its value) was removed from user. Attribute={}, user={}", attribute, user); return true; } return false; } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }

Target:
public boolean removeAttribute(PerunSession sess, User user, AttributeDefinition attribute) throws InternalErrorException { try { if (0 < jdbc.update("DELETE FROM user_attr_values WHERE attr_id=? AND user_id=?", attribute.getId(), user.getId())) { log.debug("Attribute value for was removed from user {}.", attribute.getName(), user); return true; } return false; } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
protected void setSyncConfig(SyncToolConfig syncConfig) { this.syncConfig = syncConfig; this.syncConfig.setVersion(version); File exclusionListFile = this.syncConfig.getExcludeList(); if(exclusionListFile != null){ this.fileExclusionManager = new FileExclusionManager(exclusionListFile); } else{ fileExclusionManager = new FileExclusionManager(); } ChangedList.getInstance() .setFileExclusionManager(this.fileExclusionManager); }

Target:
protected void setSyncConfig(SyncToolConfig syncConfig) { this.syncConfig = syncConfig; this.syncConfig.setVersion(version); File exclusionListFile = this.syncConfig.getExcludeList(); if(exclusionListFile != null){ this.fileExclusionManager = new FileExclusionManager(exclusionListFile); } else{ this.fileExclusionManager = new FileExclusionManager(); } ChangedList.getInstance() .setFileExclusionManager(this.fileExclusionManager); }
Source:
public void handlePlayButton(View view) { if (getCurrentFragment() instanceof ScriptFragment && ((ScriptFragment) getCurrentFragment()).isCurrentlyHighlighted()) { ((ScriptFragment) getCurrentFragment()).cancelHighlighting(); } boolean isDragAndDropActiveInFragment = getCurrentFragment() instanceof DragAndDropInterface && ((DragAndDropInterface) getCurrentFragment()).isCurrentlyMoving(); if (isDragAndDropActiveInFragment) { ((DragAndDropInterface) getCurrentFragment()).highlightMovingItem(); return; } while (getSupportFragmentManager().getBackStackEntryCount() > 0) { getSupportFragmentManager().popBackStack(); } ProjectManager projectManager = ProjectManager.getInstance(); Scene currentScene = ProjectManager.getInstance().getCurrentlyEditedScene(); Scene defaultScene = projectManager.getCurrentProject().getDefaultScene(); if (currentScene.getName().equals(defaultScene.getName())) { projectManager.setCurrentlyPlayingScene(defaultScene); projectManager.setStartScene(defaultScene); startStageActivity(); } else { new PlaySceneDialog.Builder(this) .setPositiveButton(R.string.play, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { startStageActivity(); } }) .create() .show(); } }

Target:
public void handlePlayButton(View view) { Fragment currentFragment = getCurrentFragment(); if (currentFragment instanceof ScriptFragment) { if (((ScriptFragment) currentFragment).isCurrentlyHighlighted()) { ((ScriptFragment) currentFragment).cancelHighlighting(); } if (((DragAndDropInterface) currentFragment).isCurrentlyMoving()) { ((DragAndDropInterface) getCurrentFragment()).highlightMovingItem(); return; } } while (getSupportFragmentManager().getBackStackEntryCount() > 0) { getSupportFragmentManager().popBackStack(); } ProjectManager projectManager = ProjectManager.getInstance(); Scene currentScene = ProjectManager.getInstance().getCurrentlyEditedScene(); Scene defaultScene = projectManager.getCurrentProject().getDefaultScene(); if (currentScene.getName().equals(defaultScene.getName())) { projectManager.setCurrentlyPlayingScene(defaultScene); projectManager.setStartScene(defaultScene); startStageActivity(); } else { new PlaySceneDialog.Builder(this) .setPositiveButton(R.string.play, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { startStageActivity(); } }) .create() .show(); } }
Source:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.MODULO, this::checkPrintfStyle); context.registerSyntaxNodeConsumer(Tree.Kind.CALL_EXPR, ctx -> { CallExpression callExpression = (CallExpression) ctx.syntaxNode(); Symbol symbol = callExpression.calleeSymbol(); if (symbol == null || symbol.fullyQualifiedName() == null) { return; } if (LOGGER_METHODS.contains(symbol.fullyQualifiedName())) { checkLoggerLog(ctx, callExpression); } else { this.checkStrFormatStyle(ctx); } }); context.registerSyntaxNodeConsumer(Tree.Kind.STRING_LITERAL, StringFormatCorrectnessCheck::checkFStringLiteral); }

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.MODULO, this::checkPrintfStyle); context.registerSyntaxNodeConsumer(Tree.Kind.CALL_EXPR, this::checkCallExpression); context.registerSyntaxNodeConsumer(Tree.Kind.STRING_LITERAL, StringFormatCorrectnessCheck::checkFStringLiteral); }
Source:
private void updateQueuesLength(long ts) { try { Integer fDriverQueueLength = fSs.getQuarkRelativeAndAdd(fDiskQuark, Attributes.DRIVER_QUEUE_LENGTH); fSs.modifyAttribute(ts, TmfStateValue.newValueLong(getDriverQueueSize()), fDriverQueueLength); Integer fWaitinQueueLength = fSs.getQuarkRelativeAndAdd(fDiskQuark, Attributes.WAITING_QUEUE_LENGTH); fSs.modifyAttribute(ts, TmfStateValue.newValueLong(getWaitingQueueSize()), fWaitinQueueLength); } catch (StateValueTypeException | AttributeNotFoundException e) { Activator.getDefault().logError("Error updating queues lengths", e); } }

Target:
private void updateQueuesLength(long ts) { try { int fDriverQueueLength = fSs.getQuarkRelativeAndAdd(fDiskQuark, Attributes.DRIVER_QUEUE_LENGTH); fSs.modifyAttribute(ts, TmfStateValue.newValueInt(getDriverQueueSize()), fDriverQueueLength); int fWaitinQueueLength = fSs.getQuarkRelativeAndAdd(fDiskQuark, Attributes.WAITING_QUEUE_LENGTH); fSs.modifyAttribute(ts, TmfStateValue.newValueInt(getWaitingQueueSize()), fWaitinQueueLength); } catch (StateValueTypeException | AttributeNotFoundException e) { Activator.getDefault().logError("Error updating queues lengths", e); } }
Source:
protected Device findActiveDevice(final String deviceIdentification) throws FunctionalException { Device device; try { device = this.deviceDomainService.searchActiveDevice(deviceIdentification); } catch (final UnregisteredDeviceException e) { throw new FunctionalException(FunctionalExceptionType.UNREGISTERED_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } catch (final InactiveDeviceException e) { throw new FunctionalException(FunctionalExceptionType.INACTIVE_DEVICE, ComponentType.DOMAIN_CORE, e); } catch (final UnknownEntityException e) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } return device; }

Target:
protected Device findActiveDevice(final String deviceIdentification) throws FunctionalException { Device device; try { device = this.deviceDomainService.searchActiveDevice(deviceIdentification); } catch (final UnregisteredDeviceException e) { throw new FunctionalException(FunctionalExceptionType.UNREGISTERED_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } catch (final InactiveDeviceException e) { throw new FunctionalException(FunctionalExceptionType.INACTIVE_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } catch (final UnknownEntityException e) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICE, ComponentType.DOMAIN_TARIFF_SWITCHING, e); } return device; }
Source:
public void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext) { logger.info("Live instance change triggered with: " + liveInstances); Set<String> liveInstancesSet = new HashSet<>(); for (LiveInstance liveInstance : liveInstances) { liveInstancesSet.add(liveInstance.getInstanceName()); instanceNameToDataNodeIdMap.get(liveInstance.getInstanceName()).setState(HardwareState.AVAILABLE); } Set<String> downInstancesSet = Sets.difference(allInstances, liveInstancesSet); for (String instanceName : downInstancesSet) { instanceNameToDataNodeIdMap.get(instanceName).setState(HardwareState.UNAVAILABLE); } if (!liveInstanceChangeTriggered) { liveInstanceChangeTriggered = true; initialized.countDown(); } helixClusterManagerMetrics.liveInstanceChangeTriggerCount.inc(); }

Target:
public void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext) { synchronized (notificationLock) { logger.trace("Live instance change triggered with: {}", liveInstances); Set<String> liveInstancesSet = new HashSet<>(); for (LiveInstance liveInstance : liveInstances) { liveInstancesSet.add(liveInstance.getInstanceName()); } for (String instanceName : allInstances) { if (liveInstancesSet.contains(instanceName)) { instanceNameToAmbryDataNode.get(instanceName).setState(HardwareState.AVAILABLE); } else { instanceNameToAmbryDataNode.get(instanceName).setState(HardwareState.UNAVAILABLE); } } if (!liveInstanceChangeTriggered) { liveInstanceChangeTriggered = true; initialized.countDown(); } helixClusterManagerMetrics.liveInstanceChangeTriggerCount.inc(); } }
Source:
protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { IntIterator iter = groupStates.getIndices(tb, gfields, row).intIterator(); int index; if (!iter.hasNext()) { groupStates.addTuple(tb, gfields, row, true); int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.initState(groupStates.getData(), offset); offset += agg.getStateSize(); } index = groupStates.getData().numTuples() - 1; } else { index = iter.next(); } int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.addRow(tb, row, groupStates.getData(), index, offset); offset += agg.getStateSize(); } } tb = child.nextReady(); } if (child.eos()) { if (!COUNTALL_ON_EMPTY && gfields.length == 0 && groupStates.numTuples() == 0 && internalAggs.size() == 1 && internalAggs.get(0) instanceof PrimitiveAggregator && ((PrimitiveAggregator) (internalAggs.get(0))).aggOp == AggregationOp.COUNT) { COUNTALL_ON_EMPTY = true; resultBuffer.putLong(0, 0); } generateResult(); return resultBuffer.popAny(); } return null; }

Target:
protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { IntIterator iter = groupStates.getIndices(tb, gfields, row).intIterator(); int index; if (!iter.hasNext()) { groupStates.addTuple(tb, gfields, row, true); int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.initState(groupStates.getData(), offset); offset += agg.getStateSize(); } index = groupStates.getData().numTuples() - 1; } else { index = iter.next(); } int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.addRow(tb, row, groupStates.getData(), index, offset); offset += agg.getStateSize(); } } tb = child.nextReady(); } if (child.eos()) { if (getNumOutputTuples() == 0 && groupStates.numTuples() == 0 && isCountAllOnlyAggregate()) { resultBuffer.putLong(0, 0); } generateResult(); return resultBuffer.popAny(); } return null; }
Source:
public void testGetAndAppendMappingExists() { ServerStore store = newStore(); populateStore(store); Chain chain = store.getAndAppend(1, getPayload(22)); for (Element element : chain) { assertThat(readPayLoad(element.getPayload()), is(Long.valueOf(1))); } chain = store.get(1); Iterator<Element> linkIterator = chain.iterator(); Element element1 = linkIterator.next(); assertThat(readPayLoad(element1.getPayload()), is(Long.valueOf(1))); Element element2 = linkIterator.next(); assertThat(readPayLoad(element2.getPayload()), is(Long.valueOf(22))); }

Target:
public void testGetAndAppendMappingExists() { ServerStore store = newStore(); populateStore(store); Chain chain = store.getAndAppend(1, createPayload(22)); for (Element element : chain) { assertThat(readPayLoad(element.getPayload()), is(Long.valueOf(1))); } chain = store.get(1); assertChainAndReverseChainOnlyHave(chain, 1, 22); }
Source:
public boolean match(ChangeData object) throws OrmException { Change c = object.change(dbProvider); if (c == null) { return false; } return c.isMergeable(); }

Target:
public boolean match(ChangeData object) throws OrmException { Change c = object.change(dbProvider); return c != null && c.isMergeable(); }
Source:
public void testValidateDataEnabledWithDataMismatch() throws IOException { byte[] inputData = new byte[] {1, 2, 3}; byte[] corruptedData = new byte[] {1, 3, 3}; FSDataInputStream dataTierInputStream = new TestFSDataInputStream(inputData); FileInStream fileInStream = new TestFileInStream(corruptedData); AlluxioCachingHdfsFileInputStream fileInputStream = new AlluxioCachingHdfsFileInputStream(fileInStream, Optional.of(dataTierInputStream), true); byte[] buf = new byte[3]; try { fileInputStream.readFully(0, buf, 0, buf.length); fail("Data validation didn't work for mismatched data."); } catch (VerifyException ex) { assertEquals(ex.getMessage(), "corrupted buffer at position 1"); } }

Target:
public void testValidateDataEnabledWithDataMismatch() throws IOException { byte[] inputData = new byte[] {1, 2, 3}; byte[] corruptedData = new byte[] {1, 3, 3}; FSDataInputStream dataTierInputStream = new TestFSDataInputStream(inputData); FileInStream fileInStream = new TestFileInStream(corruptedData); AlluxioCachingHdfsFileInputStream fileInputStream = new AlluxioCachingHdfsFileInputStream(fileInStream, Optional.of(dataTierInputStream), true); byte[] buffer = new byte[3]; try { fileInputStream.readFully(0, buffer, 0, buffer.length); fail("Data validation didn't work for mismatched data."); } catch (VerifyException ex) { assertEquals(ex.getMessage(), "corrupted buffer at position 1"); } }
Source:
public boolean hasDerivedMeasure() { List<Measure> measures = getMeasures(); return measures.stream().anyMatch(measure -> measure.isPop() || measure.hasComputeRatio()); }

Target:
public boolean hasDerivedMeasure() { return getMeasures().stream().anyMatch(measure -> measure.isPop() || measure.hasComputeRatio()); }
Source:
public String render(T size) { if (isUnavailable(size)) { return CONSTANTS.unAvailablePropertyLabel(); } double sizeInGB = getSizeInGigabytes(size); if (format == Format.DEFAULT) { return (sizeInGB >= 1) ? Double.valueOf(sizeInGB).longValue() + " GB" : "< 1 GB"; } else { return format(sizeInGB); } }

Target:
public String render(T size) { if (isUnavailable(size)) { return CONSTANTS.unAvailablePropertyLabel(); } String res; switch (format) { case LEGACY: res = renderLegacySize(size.longValue()); break; case HUMAN_READABLE: res = renderHumanReadableSize(size.longValue()); break; default: throw new RuntimeException("Format '" + format + "' is not supported!"); } return res; }
Source:
protected void onPreExecute() { super.onPreExecute(); if (context == null) { return; } String title = context.getString(R.string.please_wait); String message = context.getString(R.string.status_downloading); progressDialog = ProgressDialog.show(context, title, message); }

Target:
protected void onPreExecute() { super.onPreExecute(); if (context == null) { return; } String title = context.getString(R.string.please_wait); String progressMessage = context.getString(R.string.status_downloading); progressDialog = ProgressDialog.show(context, title, progressMessage); }
Source:
public void queryFile2FullHistory() throws CoreException { final List<RevCommit> expectedHistory = Arrays.asList(masterCommit2, masterCommit3); for (RevCommit ref : commits) { testRepository.checkoutBranch(ref.getName()); final IFileHistory history = historyProvider.getFileHistoryFor( iFile2, IFileHistoryProvider.NONE, new NullProgressMonitor()); assertNotNull(history); final IFileRevision[] revisions = history.getFileRevisions(); assertEquals(2, revisions.length); final List<RevCommit> commitList = new ArrayList<RevCommit>( expectedHistory); assertMatchingRevisions(Arrays.asList(revisions), commitList); } }

Target:
public void queryFile2FullHistory() throws CoreException { final List<RevCommit> expectedHistory = Arrays.asList(masterCommit2, masterCommit3); assertFullHistoryMatches(iFile2, expectedHistory); }
Source:
protected static String getMessageId(String rawMessageHref) { return rawMessageHref.substring(rawMessageHref.lastIndexOf('/')+1); }

Target:
private static String getMessageId(String rawMessageHref) { return rawMessageHref.substring(rawMessageHref.lastIndexOf('/')+1); }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CommandEntity other = (CommandEntity) obj; return ObjectUtils.objectsEqual(commandId, other.commandId) && commandType == other.commandType && ObjectUtils.objectsEqual(getGuid(rootCommandId), getGuid(other.rootCommandId)); }

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CommandEntity other = (CommandEntity) obj; return ObjectUtils.objectsEqual(commandId, other.commandId) && commandType == other.commandType && ObjectUtils.objectsEqual(getGuid(parentCommandId), getGuid(other.parentCommandId)) && ObjectUtils.objectsEqual(getGuid(rootCommandId), getGuid(other.rootCommandId)); }
Source:
public boolean equals(Object o) { if(!(o instanceof MethodKey)) return false; MethodKey m = (MethodKey) o; if(m.k != k) return false; if(m.nArgs != nArgs) return false; if(!m.method.equals(method)) return false; return true; }

Target:
public boolean equals(Object o) { if(!(o instanceof MethodKey)) return false; MethodKey m = (MethodKey) o; if(m.k != k) return false; if(m.nArgs != nArgs) return false; return m.method.equals(method)); }
Source:
public void testResetTruncateZero() throws Exception { RaftLog log = createLog(); RaftLogWriter writer = log.writer(); RaftLogReader reader = log.openReader(1, RaftLogReader.Mode.ALL); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); writer.append(ENTRY); writer.reset(1); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); assertEquals(1, reader.next().entry().term()); writer.reset(1); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); assertEquals(1, writer.getLastIndex()); assertEquals(1, writer.getLastEntry().index()); assertTrue(reader.hasNext()); assertEquals(1, reader.next().index()); writer.truncate(0); assertEquals(0, writer.getLastIndex()); assertNull(writer.getLastEntry()); writer.append(ENTRY); assertEquals(1, writer.getLastIndex()); assertEquals(1, writer.getLastEntry().index()); assertTrue(reader.hasNext()); assertEquals(1, reader.next().index()); }

Target:
public void testResetTruncateZero() throws Exception { try (RaftLog log = createLog()) { RaftLogWriter writer = log.writer(); RaftLogReader reader = log.openReader(1, RaftLogReader.Mode.ALL); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); writer.append(ENTRY); writer.reset(1); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); assertEquals(1, reader.next().entry().term()); writer.reset(1); assertEquals(0, writer.getLastIndex()); writer.append(ENTRY); assertEquals(1, writer.getLastIndex()); assertEquals(1, writer.getLastEntry().index()); assertTrue(reader.hasNext()); assertEquals(1, reader.next().index()); writer.truncate(0); assertEquals(0, writer.getLastIndex()); assertNull(writer.getLastEntry()); writer.append(ENTRY); assertEquals(1, writer.getLastIndex()); assertEquals(1, writer.getLastEntry().index()); assertTrue(reader.hasNext()); assertEquals(1, reader.next().index()); } }
Source:
ColumnWriterBase( ColumnDescriptor path, PageWriter pageWriter, BloomFilterWriter bloomFilterWriter, ParquetProperties props ) { this(path, pageWriter, props); if (path.getPath().length != 1 || bloomFilterWriter == null) { return; } String column = path.getPath()[0]; this.bloomFilterWriter = bloomFilterWriter; Set<String> bloomFilterColumns = props.getBloomFilterColumns(); if (!bloomFilterColumns.contains(column)) { return; } int maxBloomFilterSize = props.getMaxBloomFilterBytes(); Map<String, Long> bloomFilterColumnExpectedNDVs = props.getBloomFilterColumnExpectedNDVs(); if (bloomFilterColumnExpectedNDVs.size() > 0) { if (bloomFilterColumnExpectedNDVs.keySet().contains(column)) { int optimalNumOfBits = BlockSplitBloomFilter.optimalNumOfBits(bloomFilterColumnExpectedNDVs.get(column).intValue(), BlockSplitBloomFilter.DEFAULT_FPP); this.bloomFilter = new BlockSplitBloomFilter(optimalNumOfBits / 8, maxBloomFilterSize); } } else { this.bloomFilter = new BlockSplitBloomFilter(maxBloomFilterSize); } }

Target:
ColumnWriterBase( ColumnDescriptor path, PageWriter pageWriter, BloomFilterWriter bloomFilterWriter, ParquetProperties props ) { this.path = path; this.pageWriter = pageWriter; resetStatistics(); this.repetitionLevelColumn = createRLWriter(props, path); this.definitionLevelColumn = createDLWriter(props, path); this.dataColumn = props.newValuesWriter(path); this.bloomFilterWriter = bloomFilterWriter; Set<String> bloomFilterColumns = props.getBloomFilterColumns(); String column = String.join(".", path.getPath()); if (!bloomFilterColumns.contains(column)) { this.bloomFilter = null; return; } int maxBloomFilterSize = props.getMaxBloomFilterBytes(); Map<String, Long> bloomFilterColumnExpectedNDVs = props.getBloomFilterColumnExpectedNDVs(); if (bloomFilterColumnExpectedNDVs.size() > 0) { if (bloomFilterColumnExpectedNDVs.containsKey(column)) { int optimalNumOfBits = BlockSplitBloomFilter.optimalNumOfBits( bloomFilterColumnExpectedNDVs.get(column).intValue(), BlockSplitBloomFilter.DEFAULT_FPP); this.bloomFilter = new BlockSplitBloomFilter(optimalNumOfBits / 8, maxBloomFilterSize); } else { this.bloomFilter = null; } } else { this.bloomFilter = new BlockSplitBloomFilter(maxBloomFilterSize); } }
Source:
public void initialize() { directory = System.getProperty("user.dir").toString() + "\\src\\test\\resources\\loadTest"; array = new ArrayList<String>(); }

Target:
public void initialize() { directory = System.getProperty("user.dir").toString() + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "loadTest"; array = new ArrayList<String>(); }
Source:
private void configureGerrit(Repository repository) { StoredConfig config = repository.getConfig(); RemoteConfig remoteConfig; try { remoteConfig = GerritUtil.findRemoteConfig(config, remoteName); if (remoteConfig == null) { return; } GerritUtil.configurePushURI(remoteConfig, new URIish(uri)); GerritUtil.configurePushRefSpec(remoteConfig, Constants.MASTER); GerritUtil.configureFetchNotes(remoteConfig); GerritUtil.setCreateChangeId(config); remoteConfig.update(config); config.save(); } catch (Exception e) { Activator.logError(e.getMessage(), e); } }

Target:
private void configureGerrit(Repository repository) throws URISyntaxException, IOException { StoredConfig config = repository.getConfig(); RemoteConfig remoteConfig; remoteConfig = GerritUtil.findRemoteConfig(config, remoteName); if (remoteConfig == null) { return; } GerritUtil.configurePushURI(remoteConfig, new URIish(uri)); GerritUtil.configurePushRefSpec(remoteConfig, Constants.MASTER); GerritUtil.configureFetchNotes(remoteConfig); GerritUtil.setCreateChangeId(config); remoteConfig.update(config); config.save(); }
Source:
public void enableDiversity() throws KuraException { synchronized (this.atLock) { CommConnection commAtConnection = null; try { String port = getUnusedAtPort(); logger.info("sendCommand enable CELL Diversity antenna :: command to port {}", TelitLe910v2AtCommands.ENABLE_CELL_DIV.getCommand(), port); commAtConnection = openSerialPort(port); if (!isAtReachable(commAtConnection)) { throw new KuraException(KuraErrorCode.NOT_CONNECTED, MODEM_NOT_AVAILABLE_FOR_AT_CMDS_MSG); } byte[] reply = commAtConnection.sendCommand( TelitLe910v2AtCommands.ENABLE_CELL_DIV.getCommand().getBytes(StandardCharsets.US_ASCII), 1000, 100); if (reply != null) { String resp = new String(reply); if (resp.contains("OK")) { logger.info("CELL DIV successfully enabled"); this.setDiversityEnabled(true); } else logger.info("Command returns : {}", resp); } else { logger.error("No answer"); } } catch (IOException e) { throw new KuraException(KuraErrorCode.CONNECTION_FAILED, e); } finally { closeSerialPort(commAtConnection); } } }

Target:
public void enableDiversity() throws KuraException { programDiversity(true); }
Source:
public static SampleAdditionalInfo to(SampleAdditionalInfoDto from) { SampleAdditionalInfo to = new SampleAdditionalInfoImpl(); to.setPassageNumber(from.getPassageNumber()); to.setTimesReceived(from.getTimesReceived()); to.setTubeNumber(from.getTubeNumber()); to.setVolume(from.getVolume()); to.setConcentration(from.getConcentration()); to.setTubeNumber(from.getTubeNumber()); return to; }

Target:
public static SampleAdditionalInfo to(SampleAdditionalInfoDto from) { SampleAdditionalInfo to = new SampleAdditionalInfoImpl(); to.setPassageNumber(from.getPassageNumber()); to.setTimesReceived(from.getTimesReceived()); to.setTubeNumber(from.getTubeNumber()); to.setVolume(from.getVolume()); to.setConcentration(from.getConcentration()); return to; }
Source:
public void compute() { List<Element> eventEls = getDocument().getRootElement().getChildren("event", PREMIS_V2_NS); for (Element eventEl: eventEls) { List<String> eventTypes = getEventTypes(eventEl); if (eventTypes.isEmpty()) { log.error("No type present on event for record {}", pid); continue; } if (eventTypes.contains(VIRUS_CHECK_TYPE)) { addVirusCheckEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.INGESTION_TYPE)) { addIngestionEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.ACCESSION_TYPE)) { transformAccessionEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.VALIDATION_TYPE)) { addValidationEvent(eventEl); } else { log.error("Unknown event types for {}: {}", pid, eventTypes); } } }

Target:
public void compute() { List<Element> eventEls = getDocument().getRootElement().getChildren("event", PREMIS_V2_NS); for (Element eventEl: eventEls) { List<String> eventTypes = getEventTypes(eventEl); if (eventTypes.isEmpty()) { log.error("No type present on event for record {}", pid); continue; } if (eventTypes.contains(VIRUS_CHECK_TYPE)) { addVirusCheckEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.INGESTION_TYPE)) { addIngestionEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.NORMALIZATION_TYPE)) { transformNormalizationEvent(eventEl); } else if (eventTypes.contains(Premis2Constants.VALIDATION_TYPE)) { addValidationEvent(eventEl); } else { log.error("Unknown event types for {}: {}", pid, eventTypes); } } }
Source:
public Response saveAuxiliaryFileWithVersion(@PathParam("fileId") Long fileId, @PathParam("formatTag") String formatTag, @PathParam("formatVersion") String formatVersion, @FormDataParam("origin") String origin, @FormDataParam("isPublic") boolean isPublic, @FormDataParam("file") InputStream fileInputStream ) { AuthenticatedUser authenticatedUser; try { authenticatedUser = findAuthenticatedUserOrDie(); } catch (WrappedResponse ex) { return error(FORBIDDEN, "Authorized users only."); } DataFile dataFile = dataFileService.find(fileId); if (dataFile == null) { return error(BAD_REQUEST, "File not found based on id " + fileId + "."); } if (!permissionService.userOn(authenticatedUser, dataFile.getOwner()).has(Permission.EditDataset)) { return error(FORBIDDEN, "User not authorized to edit the dataset."); } if (!dataFile.isTabularData()) { return error(BAD_REQUEST, "Not a tabular DataFile (db id=" + fileId + ")"); } AuxiliaryFile saved = auxiliaryFileService.processAuxiliaryFile(fileInputStream, dataFile, formatTag, formatVersion, origin, isPublic); if (saved!=null) { return created(saved.getId().toString(),JsonPrinter.json(saved)); } else { return error(BAD_REQUEST, "Error saving Auxiliary file."); } }

Target:
public Response saveAuxiliaryFileWithVersion(@PathParam("fileId") Long fileId, @PathParam("formatTag") String formatTag, @PathParam("formatVersion") String formatVersion, @FormDataParam("origin") String origin, @FormDataParam("isPublic") boolean isPublic, @FormDataParam("file") InputStream fileInputStream ) { AuthenticatedUser authenticatedUser; try { authenticatedUser = findAuthenticatedUserOrDie(); } catch (WrappedResponse ex) { return error(FORBIDDEN, "Authorized users only."); } DataFile dataFile = dataFileService.find(fileId); if (dataFile == null) { return error(BAD_REQUEST, "File not found based on id " + fileId + "."); } if (!permissionService.userOn(authenticatedUser, dataFile.getOwner()).has(Permission.EditDataset)) { return error(FORBIDDEN, "User not authorized to edit the dataset."); } if (!dataFile.isTabularData()) { return error(BAD_REQUEST, "Not a tabular DataFile (db id=" + fileId + ")"); } AuxiliaryFile saved = auxiliaryFileService.processAuxiliaryFile(fileInputStream, dataFile, formatTag, formatVersion, origin, isPublic); if (saved!=null) { return ok(json(saved)); } else { return error(BAD_REQUEST, "Error saving Auxiliary file."); } }
Source:
public void setup() { this.literalExpression = spy(new LiteralExpression()); }

Target:
public void setup() { this.literalExpression = new LiteralExpression(); }
Source:
public void testGetData() { doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { ((DataSetReadyCallback) invocation.getArguments()[1]).callback(dataSet); return null; } }).when(dataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); dataSetQueryHelper.setCurrentTableSettings(filterSettings); when(errorHandlerBuilder.get()).thenReturn(errorHandler); when(dataSetQueryHelper.getCurrentTableSettings()).thenReturn(filterSettings); when(presenter.getDataSetQueryHelper()).thenReturn(dataSetQueryHelper); presenter.getData(new Range(0, 5)); verify(dataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); }

Target:
public void testGetData() { doAnswer(invocation -> { ((DataSetReadyCallback) invocation.getArguments()[1]).callback(dataSet); return null; }).when(dataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); dataSetQueryHelper.setCurrentTableSettings(filterSettings); when(errorHandlerBuilder.get()).thenReturn(errorHandler); when(dataSetQueryHelper.getCurrentTableSettings()).thenReturn(filterSettings); when(presenter.getDataSetQueryHelper()).thenReturn(dataSetQueryHelper); presenter.getData(new Range(0, 5)); verify(dataSetQueryHelper).lookupDataSet(anyInt(), any(DataSetReadyCallback.class)); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final WorkflowVersion other = (WorkflowVersion)obj; return Objects.equals(super.getName(), other.getName()) && Objects.equals(super.getReference(), other.getReference()) && Objects.equals(this.lastModified, other.lastModified); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final WorkflowVersion other = (WorkflowVersion)obj; return Objects.equals(this.getName(), other.getName()) && Objects.equals(this.getReference(), other.getReference()); }
Source:
private static boolean isConstant(@Nullable ExpressionTree returnedExpression) { return returnedExpression != null && returnedExpression.is(Kind.INT_LITERAL, Kind.CHAR_LITERAL, Kind.STRING_LITERAL, Kind.DOUBLE_LITERAL, Kind.FLOAT_LITERAL); }

Target:
private static boolean isConstant(@Nullable ExpressionTree returnedExpression) { return returnedExpression != null && returnedExpression.is(Kind.INT_LITERAL, Kind.LONG_LITERAL, Kind.CHAR_LITERAL, Kind.STRING_LITERAL, Kind.DOUBLE_LITERAL, Kind.FLOAT_LITERAL); }
Source:
public boolean restart(Integer containerId) { if (containerId == null || containerId == 0) { return cliController.restart(containerId); } if (stateMgrAdaptor == null) { LOG.warning("SchedulerStateManagerAdaptor not initialized"); return false; } String host = "x"; int port = -1; int offset = "stmgr-".length(); for (StMgr sm : stateMgrAdaptor.getPhysicalPlan(topologyName).getStmgrsList()) { Integer id = Integer.valueOf(sm.getId().substring(offset)); LOG.info("comparing container " + offset + " " + sm.getId() + " with " + containerId); if (containerId.equals(id)) { host = sm.getHostName(); port = sm.getShellPort(); break; } } String url = "http://" + host + ":" + port + "/killexecutor"; String payload = "secret=" + stateMgrAdaptor.getExecutionState(topologyName).getTopologyId(); LOG.info("sending `kill container` to " + url + "; payload: " + payload); HttpURLConnection con = NetworkUtils.getHttpConnection(url); try { if (NetworkUtils.sendHttpPostRequest(con, "X", payload.getBytes())) { return NetworkUtils.checkHttpResponseCode(con, 200); } else { LOG.info("heron-shell killexecutor failed; try aurora client .."); return cliController.restart(containerId); } } finally { con.disconnect(); } }

Target:
public boolean restart(Integer containerId) { if (containerId == null || containerId == 0) { return cliController.restart(containerId); } if (stateMgrAdaptor == null) { LOG.warning("SchedulerStateManagerAdaptor not initialized"); return false; } StMgr sm = searchContainer(containerId); if (sm == null) { LOG.warning("container not found in pplan " + containerId); return false; } String url = "http://" + sm.getHostName() + ":" + sm.getShellPort() + "/killexecutor"; String payload = "secret=" + stateMgrAdaptor.getExecutionState(topologyName).getTopologyId(); LOG.info("sending `kill container` to " + url + "; payload: " + payload); HttpURLConnection con = NetworkUtils.getHttpConnection(url); try { if (NetworkUtils.sendHttpPostRequest(con, "X", payload.getBytes())) { return NetworkUtils.checkHttpResponseCode(con, 200); } else { LOG.info("heron-shell killexecutor failed; try aurora client .."); return cliController.restart(containerId); } } finally { con.disconnect(); } }
Source:
private boolean canDeclare(AbstractProject owner) { String ownerClassName = owner.getClass().getName(); return DependencyGraph.class.getClasses().length > 0 && !ownerClassName.equals("hudson.plugins.promoted_builds.PromotionProcess"); }

Target:
private boolean canDeclare(AbstractProject owner) { return !owner.getClass().getName().equals("hudson.plugins.promoted_builds.PromotionProcess"); }