auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createOptionsGroup(Composite parent) { Composite optionsGroup = new Composite(parent, SWT.NONE); optionsGroup.setLayout(new GridLayout()); optionsGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); Label descriptionLabel = new Label(optionsGroup, SWT.NONE); descriptionLabel.setText(Messages.CopyTraceDialog_Description); Button copyLinkButton = new Button(optionsGroup, SWT.RADIO); copyLinkButton.setText(Messages.CopyTraceDialog_CopyLinkButton); copyLinkButton.setSelection(true); fCopyAsLink = true; Button copyResourceButton = new Button(optionsGroup, SWT.RADIO); copyResourceButton.setText(Messages.CopyTraceDialog_CopyTraceButton); copyLinkButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { fCopyAsLink = true; } }); copyResourceButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { fCopyAsLink = false; } }); }

Target:
private void createOptionsGroup(Composite parent) { Composite optionsGroup = new Composite(parent, SWT.NONE); optionsGroup.setLayout(new GridLayout()); optionsGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); Label descriptionLabel = new Label(optionsGroup, SWT.NONE); descriptionLabel.setText(Messages.CopyTraceDialog_Description); fCopyLinkButton = new Button(optionsGroup, SWT.RADIO); fCopyLinkButton.setText(Messages.CopyTraceDialog_CopyLinkButton); fCopyLinkButton.setSelection(true); Button copyResourceButton = new Button(optionsGroup, SWT.RADIO); copyResourceButton.setText(Messages.CopyTraceDialog_CopyTraceButton); }
Source:
private void processScreensaverStateChanged(String method, Map<String, Object> json) { System.out.println(method); if ("GUI.OnScreensaverDeactivated".equals(method)) { updateScreenSaverStatus(false); }else if ("GUI.OnScreensaverActivated".equals(method)) { updateScreenSaverStatus(true); } }

Target:
private void processScreensaverStateChanged(String method, Map<String, Object> json) { if ("GUI.OnScreensaverDeactivated".equals(method)) { updateScreenSaverStatus(false); }else if ("GUI.OnScreensaverActivated".equals(method)) { updateScreenSaverStatus(true); } }
Source:
public void handleTaskCompletion(ResultAndError<AppInstallStatus> appInstallStatusResultAndError) { AppInstallStatus result = appInstallStatusResultAndError.data; if (result == AppInstallStatus.UpToDate) { onAsyncExecutionSuccess(); } else if (result == AppInstallStatus.UpdateStaged) { installPendingUpdate(); } else { updateStatus(StringUtils.getStringRobust(mActivity, R.string.recovery_measure_known_error, appInstallStatusResultAndError.errorMessage)); onAsyncExecutionFailure(appInstallStatusResultAndError.data.name()); } }

Target:
public void handleTaskCompletion(ResultAndError<AppInstallStatus> appInstallStatusResultAndError) { AppInstallStatus result = appInstallStatusResultAndError.data; if (result == AppInstallStatus.UpToDate) { UpdateActivity.OnSuccessfulUpdate(true, false); onAsyncExecutionSuccess(); } else if (result == AppInstallStatus.UpdateStaged) { installPendingUpdate(); } else { updateStatus(StringUtils.getStringRobust(mActivity, R.string.recovery_measure_known_error, appInstallStatusResultAndError.errorMessage)); onAsyncExecutionFailure(appInstallStatusResultAndError.data.name()); } }
Source:
public void addScanFilter(ScanFilter scanFilter) { if (scanFilter != null) { this.scanFilters.add(scanFilter); } }

Target:
public void addScanFilter(ScanFilter scanFilter) { this.scanFilters.add(Objects.requireNonNull(scanFilter)); }
Source:
public CompositeJob(String thingUID, List<Job> jobs) { super(thingUID); checkArgument(jobs != null, "Jobs must not be null"); checkArgument(!jobs.isEmpty(), "Jobs must not be empty"); this.thingUID = thingUID; this.jobs = jobs; boolean notMatched = jobs.stream().anyMatch(j -> !j.getThingUID().equals(thingUID)); checkArgument(!notMatched, "The jobs must associate the same thing UID"); }

Target:
public CompositeJob(String thingUID, List<Job> jobs) { super(thingUID); checkArgument(jobs != null, "Jobs must not be null"); checkArgument(!jobs.isEmpty(), "Jobs must not be empty"); this.jobs = jobs; boolean notMatched = jobs.stream().anyMatch(j -> !j.getThingUID().equals(thingUID)); checkArgument(!notMatched, "The jobs must associate the same thing UID"); }
Source:
protected void executeVmCommand() { Guid createdSnapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); getParameters().setSnapshotType(determineSnapshotType()); getParameters().setInitialVmStatus(getVm().getStatus()); getSnapshotDao().updateId(createdSnapshotId, newActiveSnapshotId); setActionReturnValue(createdSnapshotId); MemoryImageBuilder memoryImageBuilder = createMemoryImageBuilder(); addSnapshotToDB(createdSnapshotId, memoryImageBuilder); createSnapshotsForDisks(); memoryImageBuilder.build(); getParameters().setTaskGroupSuccess(false); if (getTaskIdList().isEmpty()) { incrementVmGeneration(); } if (!prepareForMemorySnapshot) { freeLock(); } setSucceeded(true); }

Target:
protected void executeVmCommand() { Guid createdSnapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); getParameters().setSnapshotType(determineSnapshotType()); getParameters().setInitialVmStatus(getVm().getStatus()); getSnapshotDao().updateId(createdSnapshotId, newActiveSnapshotId); setActionReturnValue(createdSnapshotId); MemoryImageBuilder memoryImageBuilder = createMemoryImageBuilder(); addSnapshotToDB(createdSnapshotId, memoryImageBuilder); createSnapshotsForDisks(); memoryImageBuilder.build(); if (getTaskIdList().isEmpty()) { getParameters().setTaskGroupSuccess(true); incrementVmGeneration(); } if (!prepareForMemorySnapshot) { freeLock(); } setSucceeded(true); }
Source:
public void logReport(String userId, String email, String siteId, String type, String title, String content) { Connection conn = null; try { conn = sqlService.borrowConnection(); sqlService.dbInsert(conn, insertReportSql, new String[] {userId, email, siteId, type, title, content}, "id"); } catch (Exception e) { logger.error("Failed to insert feedback report.", e); } finally { if (conn != null) { sqlService.returnConnection(conn); } } }

Target:
public void logReport(String userId, String email, String siteId, String type, String title, String content) { Connection conn = null; try { conn = sqlService.borrowConnection(); sqlService.dbWrite(conn, insertReportSql, new String[] {userId, email, siteId, type, title, content}); } catch (Exception e) { logger.error("Failed to insert feedback report.", e); } finally { if (conn != null) { sqlService.returnConnection(conn); } } }
Source:
public DataNode(Datacenter datacenter, JSONObject jsonObject, ClusterMapConfig clusterMapConfig) throws JSONException { if (logger.isTraceEnabled()) { logger.trace("DataNode " + jsonObject.toString()); } this.datacenter = datacenter; this.hostname = getFullyQualifiedDomainName(jsonObject.getString("hostname")); this.port = jsonObject.getInt("port"); try { ResourceStatePolicyFactory resourceStatePolicyFactory = Utils .getObj(clusterMapConfig.clusterMapResourceStatePolicyFactory, this, HardwareState.valueOf(jsonObject.getString("hardwareState")), clusterMapConfig); this.dataNodeStatePolicy = resourceStatePolicyFactory.getResourceStatePolicy(); } catch (Exception e) { logger.error("Error during start {}", e); throw new InstantiationError("Error during start " + e); } JSONArray diskJSONArray = jsonObject.getJSONArray("disks"); this.disks = new ArrayList<Disk>(diskJSONArray.length()); for (int i = 0; i < diskJSONArray.length(); ++i) { this.disks.add(new Disk(this, diskJSONArray.getJSONObject(i), clusterMapConfig)); } this.rawCapacityInBytes = calculateRawCapacityInBytes(); validate(); }

Target:
public DataNode(Datacenter datacenter, JSONObject jsonObject, ClusterMapConfig clusterMapConfig) throws JSONException { if (logger.isTraceEnabled()) { logger.trace("DataNode " + jsonObject.toString()); } this.datacenter = datacenter; this.hostname = getFullyQualifiedDomainName(jsonObject.getString("hostname")); this.port = jsonObject.getInt("port"); try { ResourceStatePolicyFactory resourceStatePolicyFactory = Utils .getObj(clusterMapConfig.clusterMapResourceStatePolicyFactory, this, HardwareState.valueOf(jsonObject.getString("hardwareState")), clusterMapConfig); this.dataNodeStatePolicy = resourceStatePolicyFactory.getResourceStatePolicy(); } catch (Exception e) { logger.error("Error creating resource state policy when instantiating a datanode " + e); throw new IllegalStateException( "Error creating resource state policy when instantiating a datanode: " + hostname + " " + port, e); } JSONArray diskJSONArray = jsonObject.getJSONArray("disks"); this.disks = new ArrayList<Disk>(diskJSONArray.length()); for (int i = 0; i < diskJSONArray.length(); ++i) { this.disks.add(new Disk(this, diskJSONArray.getJSONObject(i), clusterMapConfig)); } this.rawCapacityInBytes = calculateRawCapacityInBytes(); validate(); }
Source:
public static void getLatency(Long latency) { Long innerLatency; if (latency != (long) minimum) { innerLatency = latency; } else { innerLatency = getDelayFromXml(); } try { TimeUnit.MILLISECONDS.sleep(innerLatency); }catch (Exception e){ log.error("faild to to run getLatency error is:{}", e); } }

Target:
public static void getLatency(Long latency) { Long innerLatency; if (latency != (long) minimum) { innerLatency = latency; } else { innerLatency = getDelayFromXml(); } try { TimeUnit.MILLISECONDS.sleep(innerLatency); }catch (InterruptedException e){ log.error("failed to to run getLatency error is:{}", e); } }
Source:
private boolean doesSourceMatch(Datastream newDatastream, Datastream existingDatastream) { if ((!newDatastream.hasSource() && !existingDatastream.hasSource()) || (newDatastream.hasSource() && existingDatastream.hasSource() && newDatastream.getSource().equals(existingDatastream.getSource()))) { return true; } return false; }

Target:
private boolean doesSourceMatch(Datastream newDatastream, Datastream existingDatastream) { return ((!newDatastream.hasSource() && !existingDatastream.hasSource()) || (newDatastream.hasSource() && existingDatastream.hasSource() && newDatastream.getSource().equals(existingDatastream.getSource()))); }
Source:
public LocalVariable[] getLocals() { return locals; }

Target:
public Map<String, Object> getLocals() { if (locals == null || locals.length == 0) { return Collections.emptyMap(); } Map<String, Object> localsMap = new HashMap<>(); for (Frame.LocalVariable localVariable : locals) { if (localVariable != null) { localsMap.put(localVariable.getName(), localVariable.getValue()); } } return localsMap; }
Source:
public WhoisResources performUpdates(final UpdateContext updateContext, final Origin origin, final Collection<Update> updates, final Keyword keyword, final HttpServletRequest request) { loggerContext.log("msg-in.txt", new UpdateLogCallback(updates)); final UpdateResponse updateResponse = updateRequestHandler.handle(new UpdateRequest(origin, keyword, updates), updateContext); return performUpdates(request, updateContext, updates); }

Target:
public WhoisResources performUpdates(final UpdateContext updateContext, final Origin origin, final Collection<Update> updates, final Keyword keyword, final HttpServletRequest request) { loggerContext.log("msg-in.txt", new UpdateLogCallback(updates)); updateRequestHandler.handle(new UpdateRequest(origin, keyword, updates), updateContext); return performUpdates(request, updateContext, updates); }
Source:
protected static void addResourceToRegionServerConfiguration(final HBaseTestingUtility testUtil) { for (RegionServerThread rsThread : testUtil.getMiniHBaseCluster().getRegionServerThreads()) { rsThread.getRegionServer().getConfiguration().addResource( testUtil.getDataTestDir("hbase-site.xml")); } }

Target:
protected static void addResourceToRegionServerConfiguration(final HBaseTestingUtility testUtil) { for (RegionServerThread rsThread : testUtil.getMiniHBaseCluster().getRegionServerThreads()) { rsThread.getRegionServer().getConfiguration().addResource( testUtil.getDataTestDir(SERVER_CONFIG)); } }
Source:
public void checkSpringBootHealthCheckBoosterProjectCommands() { consoles.executeCommandFromProjectExplorer( SPRING_BOOT_HEALTH_CHECK_BOOSTER, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); consoles.executeCommandFromProjectExplorer( SPRING_BOOT_HEALTH_CHECK_BOOSTER, BUILD_GOAL, CLEAN_BUILD_COMMAND, BUILD_SUCCESS); consoles.executeCommandFromProjectExplorer( SPRING_BOOT_HEALTH_CHECK_BOOSTER, RUN_GOAL, RUN_COMMAND, "Started BoosterApplication in"); consoles.checkWebElementVisibilityAtPreviewPage( By.xpath(" consoles.closeProcessTabWithAskDialog(RUN_COMMAND); consoles.executeCommandFromProcessesArea( "dev-machine", DEBUG_GOAL, DEBUG_COMMAND, LISTENING_AT_ADDRESS); consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); }

Target:
public void checkSpringBootHealthCheckBoosterProjectCommands() { By textOnPreviewPage = By.xpath(" consoles.executeCommandFromProjectExplorer( SPRING_BOOT_HEALTH_CHECK_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); consoles.executeCommandFromProjectExplorer( SPRING_BOOT_HEALTH_CHECK_PROJECT, BUILD_GOAL, CLEAN_BUILD_COMMAND, BUILD_SUCCESS); consoles.executeCommandFromProjectExplorer( SPRING_BOOT_HEALTH_CHECK_PROJECT, RUN_GOAL, RUN_COMMAND, "Started BoosterApplication in"); consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); consoles.closeProcessTabWithAskDialog(RUN_COMMAND); consoles.executeCommandFromProcessesArea( "dev-machine", DEBUG_GOAL, DEBUG_COMMAND, LISTENING_AT_ADDRESS); consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); }
Source:
static RetryAction ofScheduledRetry(final long maxAttempts, final Function<RetryContext, Duration> durationFunction) { validateMaxAttempts(maxAttempts); return new RetryActionImpl() { @Override public RetryStrategy apply(final RetryContext retryOperationContext) { if (retryOperationContext.getAttempt() > maxAttempts) { return RetryStrategy.resume(retryOperationContext.getLatestError()); } else { final Duration duration = durationFunction.apply(retryOperationContext); final Object parameterObject = retryOperationContext.getLatestParameter(); return RetryStrategy.retryScheduled(parameterObject, duration); } } @Override protected String getDescription() { return "schedule retry retry up to " + maxAttempts + " times"; } }; }

Target:
static RetryAction ofScheduledRetry(final long maxAttempts, final Function<RetryContext, Duration> durationFunction) { validateMaxAttempts(maxAttempts); return new RetryActionImpl() { @Override public RetryStrategy apply(final RetryContext retryOperationContext) { if (retryOperationContext.getAttempt() > maxAttempts) { return RetryStrategy.resume(retryOperationContext.getLatestError()); } else { final Duration duration = durationFunction.apply(retryOperationContext); final Object parameterObject = retryOperationContext.getLatestParameter(); return RetryStrategy.retryScheduled(parameterObject, duration); } } @Override protected String getDescription() { return "schedule retry up to " + maxAttempts + " times"; } }; }
Source:
public void createMatches(Comparison comparison, Iterator<? extends EObject> leftEObjects, Iterator<? extends EObject> rightEObjects, Iterator<? extends EObject> originEObjects, Monitor monitor) { final List<EObject> leftEObjectsNoID = Lists.newArrayList(); final List<EObject> rightEObjectsNoID = Lists.newArrayList(); final List<EObject> originEObjectsNoID = Lists.newArrayList(); diagnostic = (BasicDiagnostic)Diagnostic.OK_INSTANCE; final Set<Match> matches = matchPerId(leftEObjects, rightEObjects, originEObjects, leftEObjectsNoID, rightEObjectsNoID, originEObjectsNoID); addDiagnostic(comparison); Iterables.addAll(comparison.getMatches(), matches); if (delegate.isPresent()) { doDelegation(comparison, leftEObjectsNoID, rightEObjectsNoID, originEObjectsNoID, monitor); } else { for (EObject eObject : leftEObjectsNoID) { Match match = CompareFactory.eINSTANCE.createMatch(); match.setLeft(eObject); matches.add(match); } for (EObject eObject : rightEObjectsNoID) { Match match = CompareFactory.eINSTANCE.createMatch(); match.setRight(eObject); matches.add(match); } for (EObject eObject : originEObjectsNoID) { Match match = CompareFactory.eINSTANCE.createMatch(); match.setOrigin(eObject); matches.add(match); } } }

Target:
public void createMatches(Comparison comparison, Iterator<? extends EObject> leftEObjects, Iterator<? extends EObject> rightEObjects, Iterator<? extends EObject> originEObjects, Monitor monitor) { final List<EObject> leftEObjectsNoID = Lists.newArrayList(); final List<EObject> rightEObjectsNoID = Lists.newArrayList(); final List<EObject> originEObjectsNoID = Lists.newArrayList(); diagnostic = new BasicDiagnostic(Diagnostic.OK, "org.eclipse.emf.common", 0, org.eclipse.emf.common.CommonPlugin.INSTANCE.getString("_UI_OK_diagnostic_0"), null); final Set<Match> matches = matchPerId(leftEObjects, rightEObjects, originEObjects, leftEObjectsNoID, rightEObjectsNoID, originEObjectsNoID); addDiagnostic(comparison); Iterables.addAll(comparison.getMatches(), matches); if (delegate.isPresent()) { doDelegation(comparison, leftEObjectsNoID, rightEObjectsNoID, originEObjectsNoID, monitor); } else { for (EObject eObject : leftEObjectsNoID) { Match match = CompareFactory.eINSTANCE.createMatch(); match.setLeft(eObject); matches.add(match); } for (EObject eObject : rightEObjectsNoID) { Match match = CompareFactory.eINSTANCE.createMatch(); match.setRight(eObject); matches.add(match); } for (EObject eObject : originEObjectsNoID) { Match match = CompareFactory.eINSTANCE.createMatch(); match.setOrigin(eObject); matches.add(match); } } }
Source:
private void setCancellingText(TextView titleTextView, TextView messageTextView, Button cancelButton) { titleTextView.setText(cancellingPrefixText + " '" + title + "'"); messageTextView.setText(cancellingPrefixText + "..."); cancelButton.setEnabled(false); }

Target:
private void setCancellingText(TextView titleTextView, TextView messageTextView, Button cancelButton) { titleTextView.setText(Localization.get("activity.task.cancelling.title", new String[]{title})); messageTextView.setText(Localization.get("activity.task.cancelling.message")); cancelButton.setEnabled(false); }
Source:
protected void process (Tuple input, StreamlineEvent event) { try { StreamlineEvent toProcess = null; if (inputSchemaMap == null || inputSchemaMap.isEmpty() || !inputSchemaMap.containsKey(input.getSourceStreamId())) { toProcess = event; } else { Map<String, Object> mappedEvent = new HashMap<>(); for (Map.Entry<String, String> entry: inputSchemaMap.get(input.getSourceStreamId()).entrySet()) { if (event.get(entry.getValue()) != null) { mappedEvent.put(entry.getKey(), event.get(entry.getValue())); } } toProcess = new StreamlineEventImpl(mappedEvent, event.getDataSourceId(), event.getId(), event.getHeader(), input.getSourceStreamId(), event .getAuxiliaryFieldsAndValues()); } List<StreamlineEvent> results = customProcessorRuntime.process(toProcess); if (results != null) { Schema schema = outputSchema.values().iterator().next(); String outputStream = outputSchema.keySet().iterator().next(); for (StreamlineEvent e : results) { Map<String, Object> newFieldsAndValues = new HashMap<>(); for (Schema.Field field: schema.getFields()) { newFieldsAndValues.put(field.getName(), e.containsKey(field.getName()) ? e.get(field.getName()) : event.get(field.getName())); } StreamlineEvent toEmit = new StreamlineEventImpl(newFieldsAndValues, e.getDataSourceId(), e.getId(), e.getHeader(), outputStream, e.getAuxiliaryFieldsAndValues()); collector.emit(outputStream, input, new Values(toEmit)); } } } catch (ProcessingException e) { LOG.error("Custom Processor threw a ProcessingException. ", e); throw new RuntimeException(e); } }

Target:
protected void process (Tuple input, StreamlineEvent event) { try { StreamlineEvent toProcess = null; if (inputSchemaMap == null || inputSchemaMap.isEmpty() || !inputSchemaMap.containsKey(input.getSourceStreamId())) { toProcess = event; } else { Map<String, Object> mappedEventMap = new HashMap<>(); for (Map.Entry<String, String> entry: inputSchemaMap.get(input.getSourceStreamId()).entrySet()) { if (event.get(entry.getValue()) != null) { mappedEventMap.put(entry.getKey(), event.get(entry.getValue())); } } toProcess = StreamlineEventImpl.builder() .from(event) .sourceStream(input.getSourceStreamId()) .fieldsAndValues(mappedEventMap) .build(); } List<StreamlineEvent> results = customProcessorRuntime.process(toProcess); if (results != null) { Schema schema = outputSchema.values().iterator().next(); String outputStream = outputSchema.keySet().iterator().next(); for (StreamlineEvent e : results) { Map<String, Object> newFieldsAndValues = new HashMap<>(); for (Schema.Field field: schema.getFields()) { newFieldsAndValues.put(field.getName(), e.containsKey(field.getName()) ? e.get(field.getName()) : event.get(field.getName())); } StreamlineEvent toEmit = StreamlineEventImpl.builder() .from(e) .sourceStream(outputStream) .fieldsAndValues(newFieldsAndValues) .build(); collector.emit(outputStream, input, new Values(toEmit)); } } } catch (ProcessingException e) { LOG.error("Custom Processor threw a ProcessingException. ", e); throw new RuntimeException(e); } }
Source:
protected Analyzer getWrappedAnalyzer(String fieldName) { int idx = fieldName.lastIndexOf("_"); if (idx == -1) { return defaultAnalyzer; } String lang = langTag != null ? langTag : fieldName.substring(idx+1); Analyzer analyzer = Util.getLocalizedAnalyzer(lang); analyzer = analyzer != null ? analyzer : defaultAnalyzer; log.trace("getWrappedAnalyzer langTag: {}, fieldName: {}, analyzer: {}", langTag, fieldName, analyzer); return analyzer; }

Target:
protected Analyzer getWrappedAnalyzer(String fieldName) { int idx = fieldName.lastIndexOf("_"); if (idx == -1) { return defaultAnalyzer; } String lang = ObjectUtils.defaultIfNull(langTag, fieldName.substring(idx+1)); Analyzer analyzer = Util.getLocalizedAnalyzer(lang); analyzer = ObjectUtils.defaultIfNull(analyzer, defaultAnalyzer); log.trace("getWrappedAnalyzer langTag: {}, fieldName: {}, analyzer: {}", langTag, fieldName, analyzer); return analyzer; }
Source:
private ValueHolder<V> internalGet(K key, final boolean updateAccess) { return map.compute(key, new BiFunction<K, OffHeapValueHolder<V>, OffHeapValueHolder<V>>() { @Override public OffHeapValueHolder<V> apply(K mappedKey, OffHeapValueHolder<V> mappedValue) { long now = timeSource.getTimeMillis(); if (mappedValue == null || mappedValue.isExpired(now, OffHeapValueHolder.TIME_UNIT)) { if (mappedValue != null) { eventListener.onExpiration(wrap(mappedKey, mappedValue)); } return null; } if (updateAccess) { setAccessTimeAndExpiry(mappedKey, mappedValue, now); } return mappedValue; } }, false); }

Target:
private ValueHolder<V> internalGet(K key, final boolean updateAccess) { return map.compute(key, new BiFunction<K, OffHeapValueHolder<V>, OffHeapValueHolder<V>>() { @Override public OffHeapValueHolder<V> apply(K mappedKey, OffHeapValueHolder<V> mappedValue) { long now = timeSource.getTimeMillis(); if (mappedValue == null || mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { if (mappedValue != null) { eventListener.onExpiration(wrap(mappedKey, mappedValue)); } return null; } if (updateAccess) { setAccessTimeAndExpiry(mappedKey, mappedValue, now); } return mappedValue; } }, false); }
Source:
private void updateAuditLogEventProcessed(EventAuditLogSubscriber eventSubscriber) throws SQLException { Connection connection = null; PreparedStatement ps = null; try { connection = ds.getConnection(); ps = connection.prepareStatement("UPDATE audit_log SET processed = 'true' WHERE audit_log_id = ?"); ps.setLong(1, eventSubscriber.getaudit_log_id()); int updated = ps.executeUpdate(); if (updated != 1) { log.error("Failed to mark audit_log entry as processed for audit_log_id: " + eventSubscriber.getaudit_log_id()); } } finally { DbUtils.closeQuietly(ps, connection); } }

Target:
private void updateAuditLogEventProcessed(EventAuditLogSubscriber eventSubscriber) throws SQLException { Connection connection = null; PreparedStatement ps = null; try { connection = ds.getConnection(); ps = connection.prepareStatement("update audit_log set processed = 'true' where audit_log_id = ?"); ps.setLong(1, eventSubscriber.getaudit_log_id()); int updated = ps.executeUpdate(); if (updated != 1) { log.error("Failed to mark audit_log entry as processed for audit_log_id: " + eventSubscriber.getaudit_log_id()); } } finally { DbUtils.closeQuietly(ps, connection); } }
Source:
public void allowCall(String callId) { Long token = Binder.clearCallingIdentity(); if (mCall == null || (!mCall.getId().equals(callId))) { Log.w(this, "allowCall, unknown call id: %s", callId); } mResultFuture.complete(mPriorStageResult); Binder.restoreCallingIdentity(token); unbindCallScreeningService(); }

Target:
public void allowCall(String callId) { Log.startSession("CSCR.aC"); Long token = Binder.clearCallingIdentity(); try { if (mCall == null || (!mCall.getId().equals(callId))) { Log.w(this, "allowCall, unknown call id: %s", callId); } mResultFuture.complete(mPriorStageResult); } finally { Binder.restoreCallingIdentity(token); unbindCallScreeningService(); Log.endSession(); } }
Source:
public void verifyOperation() { val policy = new OidcCustomScopeAttributeReleasePolicy("groups", CollectionUtils.wrap("groups")); assertEquals(OidcConstants.CUSTOM_SCOPE_TYPE, policy.getScopeType()); assertNotNull(policy.getAllowedAttributes()); val principal = CoreAuthenticationTestUtils.getPrincipal(CollectionUtils.wrap("groups", List.of("admin", "user"))); val attrs = policy.getAttributes(principal, CoreAuthenticationTestUtils.getService(), CoreAuthenticationTestUtils.getRegisteredService()); assertTrue(policy.getAllowedAttributes().stream().allMatch(attrs::containsKey)); }

Target:
public void verifyOperation() { val policy = new OidcCustomScopeAttributeReleasePolicy("groups", CollectionUtils.wrap("groups")); assertEquals(OidcConstants.CUSTOM_SCOPE_TYPE, policy.getScopeType()); assertNotNull(policy.getAllowedAttributes()); val principal = CoreAuthenticationTestUtils.getPrincipal(CollectionUtils.wrap("groups", List.of("admin", "user"))); val attrs = policy.getAttributes(principal, CoreAuthenticationTestUtils.getService(), CoreAuthenticationTestUtils.getRegisteredService()); assertTrue(policy.getAllowedAttributes().stream().allMatch(attrs::containsKey)); val principal2 = CoreAuthenticationTestUtils.getPrincipal(attrs); val releaseAttrs = policy.getAttributes(principal2, CoreAuthenticationTestUtils.getService(), CoreAuthenticationTestUtils.getRegisteredService()); assertTrue(policy.getAllowedAttributes().stream().allMatch(releaseAttrs::containsKey)); assertEquals(releaseAttrs.get("groups"), List.of("admin", "user")); }
Source:
protected int calculateTemplatesToKeep(final int templatesRead, final double overallProportion) { final ConstantMemoryDownsamplingIterator iter = (ConstantMemoryDownsamplingIterator) getUnderlyingIterator(); final double priorProportion = iter.getAcceptedFraction(); final double p = Math.max(0, Math.min(1, overallProportion / priorProportion)); final int retval = super.calculateTemplatesToKeep(templatesRead, p); for (long i = 0; i < iter.getDiscardedCount(); ++i) { recordDiscardedRecord(null); } return retval; }

Target:
protected int calculateTemplatesToKeep(final int templatesRead, final double overallProportion) { final ConstantMemoryDownsamplingIterator iter = (ConstantMemoryDownsamplingIterator) getUnderlyingIterator(); final double priorProportion = iter.getAcceptedFraction(); final double p = Math.max(0, Math.min(1, overallProportion / priorProportion)); final int retval = super.calculateTemplatesToKeep(templatesRead, p); recordDiscardRecords(iter.getDiscardedCount()); return retval; }
Source:
public SwrveBaseCampaign(SwrveBase<?, ?> controller, JSONObject campaignData) throws JSONException { this(); setId(campaignData.getInt("id")); setIsInbox(campaignData.optBoolean("inbox", false)); setSubject(campaignData.optString("subject", null)); setTalkController(controller); SwrveLogger.i(LOG_TAG, "Loading campaign " + getId()); this.state = new SwrveCampaignState(); this.maxImpressions = DEFAULT_MAX_IMPRESSIONS; this.minDelayBetweenMessage = DEFAULT_MIN_DELAY_BETWEEN_MSGS; this.showMessagesAfterLaunch = SwrveHelper.addTimeInterval(this.talkController.getInitialisedTime(), DEFAULT_DELAY_FIRST_MESSAGE, Calendar.SECOND); assignCampaignTriggers(this, campaignData); assignCampaignRules(this, campaignData); assignCampaignDates(this, campaignData); }

Target:
public SwrveBaseCampaign(SwrveBase<?, ?> controller, JSONObject campaignData) throws JSONException { this(); setId(campaignData.getInt("id")); setIsInbox(campaignData.optBoolean("inbox", false)); setSubject(campaignData.optString("subject", null)); setTalkController(controller); SwrveLogger.i(LOG_TAG, "Loading campaign " + getId()); this.saveableState = new SwrveCampaignState(); this.maxImpressions = DEFAULT_MAX_IMPRESSIONS; this.minDelayBetweenMessage = DEFAULT_MIN_DELAY_BETWEEN_MSGS; this.showMessagesAfterLaunch = SwrveHelper.addTimeInterval(this.talkController.getInitialisedTime(), DEFAULT_DELAY_FIRST_MESSAGE, Calendar.SECOND); assignCampaignTriggers(this, campaignData); assignCampaignRules(this, campaignData); assignCampaignDates(this, campaignData); }
Source:
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException { IProject project = type.getJavaProject().getProject(); BatchProject batchProject = (BatchProject) BatchProjectFactory.getBatchProjectWithProgress(project); if (batchProject == null) { return status; } IBatchArtifact artifact = batchProject.getArtifact(type); if (artifact != null) { IAnnotationDeclaration declaration = artifact.getNamedDeclaration(); if (declaration == null || declaration.getMemberValue(null) != null) { return status; } newName = BeanUtil.getDefaultBeanName(getArguments().getNewName()); } else { newName = type.getFullyQualifiedName().replace(type.getElementName(), getArguments().getNewName()); } searchInProject(batchProject, artifact, pm); BatchProject[] projects = batchProject.getAllDependentProjects(true); for (BatchProject p : projects) { searchInProject(p, artifact, pm); } return status; }

Target:
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException { IProject project = type.getJavaProject().getProject(); BatchProject batchProject = (BatchProject) BatchProjectFactory.getBatchProjectWithProgress(project); if (batchProject == null) { return status; } IBatchArtifact artifact = batchProject.getArtifact(type); IBatchProperty property = null; if (artifact != null) { if(field != null){ for (IBatchProperty prop : artifact.getProperties()) { if (prop.getField().equals(field)) { IAnnotationDeclaration declaration = prop.getBatchPropertyDeclaration(); if (declaration == null || declaration.getMemberValue(null) != null) { return status; } newName = getArguments().getNewName(); property = prop; } } }else{ IAnnotationDeclaration declaration = artifact.getNamedDeclaration(); if (declaration == null || declaration.getMemberValue(null) != null) { return status; } newName = BeanUtil.getDefaultBeanName(getArguments().getNewName()); } } else { String fullyQualifiedName = type.getFullyQualifiedName(); StringBuilder b = new StringBuilder(fullyQualifiedName); b.replace(fullyQualifiedName.lastIndexOf(type.getElementName()), fullyQualifiedName.lastIndexOf(type.getElementName()) + 1, getArguments().getNewName() ); newName = b.toString(); } searchInProject(batchProject, artifact, property, pm); BatchProject[] projects = batchProject.getAllDependentProjects(true); for (BatchProject p : projects) { searchInProject(p, artifact, property, pm); } return status; }
Source:
public <T extends JestResult> T execute(Action<T> clientRequest) throws IOException { Map<String,Object> params = new HashMap<>(); params.put("strict-timeout", Boolean.TRUE); TimeoutTracker timeoutTracker = new TimeoutTracker(params, m_retries, m_timeout); for (timeoutTracker.reset(); timeoutTracker.shouldRetry(); timeoutTracker.nextAttempt()) { timeoutTracker.startAttempt(); try { return m_delegate.execute(clientRequest); } catch (Throwable e) { LOG.warn("Exception while trying to execute REST operation", e); } } return null; }

Target:
public <T extends JestResult> T execute(Action<T> clientRequest) throws IOException { Map<String,Object> params = new HashMap<>(); params.put("strict-timeout", Boolean.TRUE); TimeoutTracker timeoutTracker = new TimeoutTracker(params, m_retries, m_timeout); for (timeoutTracker.reset(); timeoutTracker.shouldRetry(); timeoutTracker.nextAttempt()) { timeoutTracker.startAttempt(); try { return m_delegate.execute(clientRequest); } catch (Exception e) { LOG.warn("Exception while trying to execute REST operation (attempt {})", timeoutTracker.getAttempt() + 1, e); } } return null; }
Source:
public boolean cancelOrder(CancelOrderParams orderParams) throws IOException { if (orderParams instanceof CancelOrderByPairAndIdParams) { try { final CancelOrderByPairAndIdParams params = (CancelOrderByPairAndIdParams) orderParams; return cancelBithumbOrder(params.getOrderId(), params.getCurrencyPair()); } catch (BithumbException e) { throw BithumbErrorAdapter.adapt(e); } } else if (orderParams instanceof CancelOrderByIdParams && orderParams instanceof CancelOrderByCurrencyPair) { String orderId = ((CancelOrderByIdParams)orderParams).getOrderId(); CurrencyPair pair = ((CancelOrderByCurrencyPair)orderParams).getCurrencyPair(); return cancelBithumbOrder(orderId, pair); } else { throw new NotYetImplementedForExchangeException( "Only CancelOrderByPairAndIdParams || (CancelOrderByIdParams && CancelOrderByCurrencyPair) supported"); } }

Target:
public boolean cancelOrder(CancelOrderParams orderParams) throws IOException { try { if (!(orderParams instanceof CancelOrderByIdParams && orderParams instanceof CancelOrderByCurrencyPair)) { throw new NotYetImplementedForExchangeException( "Only CancelOrderByPairAndIdParams || (CancelOrderByIdParams && CancelOrderByCurrencyPair) supported"); } String orderId = ((CancelOrderByIdParams) orderParams).getOrderId(); CurrencyPair pair = ((CancelOrderByCurrencyPair) orderParams).getCurrencyPair(); return cancelBithumbOrder(orderId, pair); } catch (BithumbException e) { throw BithumbErrorAdapter.adapt(e); } }
Source:
public List<WorkspaceEntity> listWorkspaceEntitiesByUser(UserEntity userEntity, boolean includeUnpublished) { List<WorkspaceEntity> result = new ArrayList<>(); List<WorkspaceUserEntity> workspaceUserEntities = workspaceUserEntityController.listWorkspaceUserEntitiesByUserEntity(userEntity); for (WorkspaceUserEntity workspaceUserEntity : workspaceUserEntities) { WorkspaceEntity workspaceEntity = workspaceUserEntity.getWorkspaceEntity(); if (Boolean.TRUE.equals(workspaceEntity.getArchived())) { continue; } if (includeUnpublished || workspaceEntity.getPublished()) { if (!result.contains(workspaceEntity)) { result.add(workspaceEntity); } } } return result; }

Target:
public List<WorkspaceEntity> listWorkspaceEntitiesByUser(UserEntity userEntity, boolean includeUnpublished) { List<WorkspaceEntity> result = new ArrayList<>(); List<WorkspaceUserEntity> workspaceUserEntities = workspaceUserEntityController.listWorkspaceUserEntitiesByUserEntity(userEntity); for (WorkspaceUserEntity workspaceUserEntity : workspaceUserEntities) { if (includeUnpublished || workspaceUserEntity.getWorkspaceEntity().getPublished()) { if (!result.contains(workspaceUserEntity.getWorkspaceEntity())) { result.add(workspaceUserEntity.getWorkspaceEntity()); } } } return result; }
Source:
void testUserFormExistingUserValidEmptyPassword() { UserForm userForm = new UserForm(); userForm.setUsername(VALID_USERNAME); userForm.setPassword(StringUtils.EMPTY); Set<ConstraintViolation<UserForm>> violations = validator.validate(userForm, UserForm.ExistingUser.class); assertThat(violations.isEmpty()).as("Violations are not empty!").isTrue(); }

Target:
void testUserFormExistingUserValidEmptyPassword() { UserForm userForm = new UserForm(); userForm.setUsername(VALID_USERNAME); userForm.setPassword(StringUtils.EMPTY); Set<ConstraintViolation<UserForm>> violations = validator.validate(userForm, UserForm.ExistingUser.class); assertThat(violations).as("Violations are not empty!").isEmpty(); }
Source:
private <R, C extends ServiceCreationConfiguration<?, R>> CacheManagerBuilder<T> ensureThenUpdate(Supplier<C> supplier, UnaryOperator<R> update) { C emptyConfig = supplier.get(); @SuppressWarnings("unchecked") Class<? extends C> configType = (Class<? extends C>) emptyConfig.getClass(); if (configBuilder.getService(configType) == null) { return new CacheManagerBuilder<>(this, configBuilder.withService(emptyConfig).updateServices(configType, update)); } else { return new CacheManagerBuilder<>(this, configBuilder.updateServices(configType, update)); } }

Target:
private <R, C extends ServiceCreationConfiguration<?, R>> CacheManagerBuilder<T> ensureThenUpdate(Supplier<C> supplier, UnaryOperator<R> update) { C emptyConfig = supplier.get(); @SuppressWarnings("unchecked") Class<? extends C> configType = (Class<? extends C>) emptyConfig.getClass(); FluentConfigurationBuilder<?> fluentBuilder = configBuilder; if (configBuilder.getService(configType) == null) { fluentBuilder = fluentBuilder.withService(emptyConfig); } return new CacheManagerBuilder<>(this, fluentBuilder.updateServices(configType, update)); }
Source:
public void testGroupIncludesWildcardRule(@MavenRepository(repositoryId = REPOSITORY_RELEASES_TGIWR_1) Repository releases1, @MavenRepository(repositoryId = REPOSITORY_RELEASES_TGIWR_2) Repository releases2, @Group(repositories = { REPOSITORY_RELEASES_TGIWR_1, REPOSITORY_RELEASES_TGIWR_2 }) @MavenRepository(repositoryId = REPOSITORY_RELEASES_TGIWR_GROUP) Repository releasesGroup, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_TGIWR_1, id = "com.artifacts.in.releases.three:foo", versions = "1.2.3") Path a1, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_TGIWR_1, id = "com.artifacts.in.releases.under2:group", versions = "1.2.3") Path a2, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_TGIWR_2, id = "com.artifacts.in.releases.two:foo", versions = "1.2.4") Path a3, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_TGIWR_2, id = "com.artifacts.in.releases.under2:group", versions = "1.2.4") Path a4) throws Exception { logger.info("# Testing group includes with wildcard..."); RepositoryProvider repositoryProvider = repositoryProviderRegistry.getProvider(releasesGroup.getType()); RepositoryPath resolvedPath = repositoryPathResolver.resolve(releasesGroup, (RepositoryPath) a3.normalize()); Path repositoryPath = repositoryProvider.fetchPath(resolvedPath); try (InputStream is = repositoryProvider.getInputStream(repositoryPath)) { assertNotNull(is); } }

Target:
public void testGroupIncludesWildcardRule(@MavenRepository(repositoryId = REPOSITORY_RELEASES_TGIWR_1) Repository releases1, @MavenRepository(repositoryId = REPOSITORY_RELEASES_TGIWR_2) Repository releases2, @Group(repositories = { REPOSITORY_RELEASES_TGIWR_1, REPOSITORY_RELEASES_TGIWR_2 }) @MavenRepository(repositoryId = REPOSITORY_RELEASES_TGIWR_GROUP) Repository releasesGroup, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_TGIWR_1, id = "com.artifacts.in.releases.three:foo", versions = "1.2.3") Path a1, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_TGIWR_1, id = "com.artifacts.in.releases.under2:group", versions = "1.2.3") Path a2, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_TGIWR_2, id = "com.artifacts.in.releases.two:foo", versions = "1.2.4") Path a3, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_TGIWR_2, id = "com.artifacts.in.releases.under2:group", versions = "1.2.4") Path a4) throws Exception { logger.debug("# Testing group includes with wildcard..."); RepositoryProvider repositoryProvider = repositoryProviderRegistry.getProvider(releasesGroup.getType()); RepositoryPath resolvedPath = repositoryPathResolver.resolve(releasesGroup, (RepositoryPath) a3.normalize()); Path repositoryPath = repositoryProvider.fetchPath(resolvedPath); try (InputStream is = repositoryProvider.getInputStream(repositoryPath)) { assertNotNull(is); } }
Source:
private boolean testngXmlExistsInJar(File jarFile, List<String> classes) throws IOException { boolean foundTestngXml = false; try (JarFile jf = new JarFile(jarFile)) { Enumeration<JarEntry> entries = jf.entries(); while (entries.hasMoreElements()) { JarEntry je = entries.nextElement(); if (matchesXmlPathInJar(je)) { Collection<XmlSuite> parsedSuites = Parser.parse(jf.getInputStream(je), processor); for (XmlSuite suite : parsedSuites) { XmlSuite suiteToAdd = suite; if (testNames != null) { suiteToAdd = XmlSuiteUtils.cloneIfContainsTestsWithNamesMatchingAny(suite, testNames); } suites.add(suiteToAdd); } foundTestngXml = true; break; } else if (isJavaClass(je)) { classes.add(constructClassName(je)); } } } return foundTestngXml; }

Target:
private boolean testngXmlExistsInJar(File jarFile, List<String> classes) throws IOException { boolean foundTestngXml = false; try (JarFile jf = new JarFile(jarFile)) { Enumeration<JarEntry> entries = jf.entries(); while (entries.hasMoreElements()) { JarEntry je = entries.nextElement(); if (matchesXmlPathInJar(je)) { Collection<XmlSuite> parsedSuites = Parser.parse(jf.getInputStream(je), processor); for (XmlSuite suite : parsedSuites) { XmlSuite suiteToAdd = suite; if (testNames != null) { suiteToAdd = XmlSuiteUtils.cloneIfContainsTestsWithNamesMatchingAny(suite, testNames); } suites.add(suiteToAdd); } return true; } else if (isJavaClass(je)) { classes.add(constructClassName(je)); } } } return foundTestngXml; }
Source:
public void init(Configuration conf, RMProxy<T> proxy, Class<T> protocol) { this.protocol = protocol; try { YarnConfiguration yarnConf = new YarnConfiguration(conf); InetSocketAddress rmAddress = proxy.getRMAddress(yarnConf, protocol); LOG.info("Connecting to ResourceManager at " + rmAddress); this.proxy = proxy.getProxy(yarnConf, protocol, rmAddress); } catch (IOException ioe) { LOG.error("Unable to create proxy to the ResourceManager ", ioe); } }

Target:
public void init(Configuration conf, RMProxy<T> proxy, Class<T> protocol) { this.protocol = protocol; try { YarnConfiguration yarnConf = new YarnConfiguration(conf); InetSocketAddress rmAddress = proxy.getRMAddress(yarnConf, protocol); LOG.info("Connecting to ResourceManager at {}", rmAddress); this.proxy = proxy.getProxy(yarnConf, protocol, rmAddress); } catch (IOException ioe) { LOG.error("Unable to create proxy to the ResourceManager ", ioe); } }
Source:
public void entityReference(String entity) { assertOpenBlock(); String literal = entityToLiteral.get(entity); if (literal == null) { literal = EntityReferences.instance().equivalentString(entity); } try { currentBlock.write(literal); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public void entityReference(String entity) { assertOpenBlock(); String literal = EntityReferences.instance().equivalentString(entity); if (literal == null) { literal = "&" + entity + ";"; } try { currentBlock.write(literal); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
private void handleIndexChangedEvent(GitEvent event) { Status status = newDto(Status.class); if (event instanceof GitCommitEvent) { status = ((GitCommitEvent) event).getStatus(); } else if (event instanceof GitResetEvent) { status = ((GitResetEvent) event).getStatus(); } else if (event instanceof GitRepositoryInitializedEvent) { status = ((GitRepositoryInitializedEvent) event).getStatus(); } for (String endpointId : endpointIds) { transmitter .newRequest() .endpointId(endpointId) .methodName("event/git-index") .paramsAsDto(status) .sendAndSkipResult(); } }

Target:
private void handleIndexChangedEvent(GitEvent event) { Status status = newDto(Status.class); if (event instanceof GitCommitEvent) { status = ((GitCommitEvent) event).getStatus(); } else if (event instanceof GitResetEvent) { status = ((GitResetEvent) event).getStatus(); } else if (event instanceof GitRepositoryInitializedEvent) { status = ((GitRepositoryInitializedEvent) event).getStatus(); } for (String endpointId : endpointIds) { transmitter .newRequest() .endpointId(endpointId) .methodName("event/git/indexChanged") .paramsAsDto(status) .sendAndSkipResult(); } }
Source:
public boolean sendEmail(final Report report, final String team) { SendGrid sendGrid = new SendGrid(apikey); SendGrid.Email email = createEmail(report, team); try { return sendGrid.send(email).getStatus(); } catch (SendGridException e) { throw new RuntimeException(e); } }

Target:
public boolean sendEmail(final Report report, final String team) throws SendGridException { SendGrid sendGrid = new SendGrid(apikey); SendGrid.Email email = createEmail(report, team); return sendGrid.send(email).getStatus(); }
Source:
public void removeAllCacheManagers(String tenantDomain) { Map<String, CacheManager> cacheManagers = globalCacheManagerMap.get(tenantDomain); for (CacheManager cacheManager : cacheManagers.values()) { if (((CarbonCacheManager) cacheManager).removeLocalCaches()) { cacheManagers.remove(cacheManager.getName()); } } }

Target:
public void removeAllCacheManagers(String tenantDomain) { Map<String, CacheManager> cacheManagers = globalCacheManagerMap.get(tenantDomain); if (cacheManagers != null) { for (CacheManager cacheManager : cacheManagers.values()) { if (((CarbonCacheManager) cacheManager).removeLocalCaches()) { cacheManagers.remove(cacheManager.getName()); } } } }
Source:
public static boolean deleteRealm(RealmConfiguration configuration) { if (configuration.isSyncConfiguration()) { throw new IllegalStateException("'deleteRealm() is not supported for sync for now."); } return BaseRealm.deleteRealm(configuration); }

Target:
public static boolean deleteRealm(RealmConfiguration configuration) { return BaseRealm.deleteRealm(configuration); }
Source:
public static JwtClaimsSet.Builder jwtClaimsSet() { String issuer = "<LINK_0>"; Instant issuedAt = Instant.now(); Instant expiresAt = issuedAt.plus(1, ChronoUnit.HOURS); return JwtClaimsSet.withClaims() .issuer(issuer) .subject("subject") .audience(Collections.singletonList("client-1")) .issuedAt(issuedAt) .notBefore(issuedAt) .expiresAt(expiresAt) .id(UUID.randomUUID().toString()) .claim("custom-claim-name", "custom-claim-value"); }

Target:
public static JwtClaimsSet.Builder jwtClaimsSet() { String issuer = "<LINK_0>"; Instant issuedAt = Instant.now(); Instant expiresAt = issuedAt.plus(1, ChronoUnit.HOURS); return JwtClaimsSet.builder() .issuer(issuer) .subject("subject") .audience(Collections.singletonList("client-1")) .issuedAt(issuedAt) .notBefore(issuedAt) .expiresAt(expiresAt) .id("jti") .claim("custom-claim-name", "custom-claim-value"); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } HistogramBucket other = (HistogramBucket) obj; if (fNbEvents != other.fNbEvents) { return false; } return (fNbEvents == 0 && Arrays.equals(fEvents, other.fEvents)); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } HistogramBucket other = (HistogramBucket) obj; if (fNbEvents != other.fNbEvents) { return false; } return !(fNbEvents != 0 && !Arrays.equals(fEvents, other.fEvents)); }
Source:
public TaskStatesPage getTaskPaginated(String jobId, int offset, int limit) throws NotConnectedException, UnknownJobException, PermissionException { TaskStatesPage taskStatesPage = null; try { List<TaskState> taskStates = restApi().getJobTaskStatesPaginated(sid, jobId, offset, limit) .getList() .stream() .map(taskStateData -> taskState(taskStateData)) .collect(Collectors.toList()); taskStatesPage = new TaskStatesPage(); taskStatesPage.setSize(limit); taskStatesPage.setTaskStates(taskStates); } catch (Exception e) { throwUJEOrNCEOrPE(e); } return taskStatesPage; }

Target:
public TaskStatesPage getTaskPaginated(String jobId, int offset, int limit) throws NotConnectedException, UnknownJobException, PermissionException { TaskStatesPage taskStatesPage = null; try { final int size = restApi().getJobTaskStates(sid, jobId).getList().size(); List<TaskState> taskStates = restApi().getJobTaskStatesPaginated(sid, jobId, offset, limit) .getList() .stream() .map(DataUtility::taskState) .collect(Collectors.toList()); taskStatesPage = new TaskStatesPage(); taskStatesPage.setSize(size); taskStatesPage.setTaskStates(taskStates); } catch (Exception e) { throwUJEOrNCEOrPE(e); } return taskStatesPage; }