auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void merge(String prefix, Map<String, Long> stats1, Map<String,Long> stats2 ) { stats1.merge(prefix+".min", stats2.get(prefix+".min"), Long::max); stats1.merge(prefix+".max", stats2.get(prefix+".max"), Long::max); stats1.merge(prefix+".sum", stats2.get(prefix+".sum"), Long::sum); <START> stats2.forEach((k,v) -> stats1.merge(k, v, Long::sum)); <END> }</code><technical_language>this sum everything, min max keys. I suspect this is intended sum log histogram keys? If needs a check for key merge. Also, test catch this</technical_language>

Target:
private static void merge(String prefix, Map<String, Long> stats1, Map<String,Long> stats2) { merge(prefix+".min", Long::min, stats1, stats2); merge(prefix+".max", Long::max, stats1, stats2); merge(prefix+".sum", Long::sum, stats1, stats2); for (int i = 0; i < 32; i++) { merge(prefix+".logHist."+i, Long::sum, stats1, stats2); } }
Source:
<code>protected int getWeight(Invoker<?> invoker, Invocation invocation) { int weight = invoker.getUrl().getMethodParameter(invocation.getMethodName(), WEIGHT_KEY, DEFAULT_WEIGHT); if (weight > 0) { <START> long timestamp = invoker.getUrl().getParameter(REMOTE_TIMESTAMP_KEY, 0L); <END> if (timestamp > 0L) { long uptime = System.currentTimeMillis() - timestamp; if (uptime >= Integer.MAX_VALUE) { return weight; } else if (uptime < 0) { return 1; } int warmup = invoker.getUrl().getParameter(WARMUP_KEY, DEFAULT_WARMUP); if (uptime > 0 && uptime < warmup) { weight = calculateWarmupWeight((int)uptime, warmup, weight); } } } return weight >= 0 ? weight : 0; }</code><technical_language>pls. change REMOTE_TIMESTAMP_KEY TIMESTAMP_KEY. Pls. remove org.apache.dubbo.rpc.cluster.Constants#REMOTE_TIMESTAMP_KEY useless</technical_language>

Target:
protected int getWeight(Invoker<?> invoker, Invocation invocation) { int weight = invoker.getUrl().getMethodParameter(invocation.getMethodName(), WEIGHT_KEY, DEFAULT_WEIGHT); if (weight > 0) { long timestamp = invoker.getUrl().getParameter(TIMESTAMP_KEY, 0L); if (timestamp > 0L) { long uptime = System.currentTimeMillis() - timestamp; if (uptime >= Integer.MAX_VALUE) { return weight; } else if (uptime < 0) { return 1; } int warmup = invoker.getUrl().getParameter(WARMUP_KEY, DEFAULT_WARMUP); if (uptime > 0 && uptime < warmup) { weight = calculateWarmupWeight((int)uptime, warmup, weight); } } } return weight >= 0 ? weight : 0; }
Source:
<code>public Task<Void> handleRegistrationIntentAsync(Intent intent) { List<Task<Void>> tasks = new ArrayList<>(); String registrationId = intent.getStringExtra(REGISTRATION_ID_EXTRA); if (registrationId != null && registrationId.length() > 0) { <START> PLog.v(TAG, "Get deviceToken " + registrationId + " from GCM."); <END> ParseInstallation installation = ParseInstallation.getCurrentInstallation(); if (!registrationId.equals(installation.getDeviceToken())) { installation.setPushType(PushType.GCM); installation.setDeviceToken(registrationId); tasks.add(installation.saveInBackground()); } tasks.add(updateLocalDeviceTokenLastModifiedAsync()); } synchronized (lock) { if (request != null) { request.onReceiveResponseIntent(intent); } } return Task.whenAll(tasks); }</code><technical_language>I part of this PR I agree is this line</technical_language>

Target:
public Task<Void> handleRegistrationIntentAsync(Intent intent) { List<Task<Void>> tasks = new ArrayList<>(); String registrationId = intent.getStringExtra(REGISTRATION_ID_EXTRA); if (registrationId != null && registrationId.length() > 0) { PLog.v(TAG, "Received deviceToken <" + registrationId + "> from GCM."); ParseInstallation installation = ParseInstallation.getCurrentInstallation(); if (!registrationId.equals(installation.getDeviceToken())) { installation.setPushType(PushType.GCM); installation.setDeviceToken(registrationId); tasks.add(installation.saveInBackground()); } tasks.add(updateLocalDeviceTokenLastModifiedAsync()); } synchronized (lock) { if (request != null) { request.onReceiveResponseIntent(intent); } } return Task.whenAll(tasks); }
Source:
<code>public RuntimeManagerFactory runtimeManagerFactory(UserGroupCallback userGroupCallback, UserInfo userInfo) { SpringRuntimeManagerFactoryImpl runtimeManager = new SpringRuntimeManagerFactoryImpl(); runtimeManager.setTransactionManager((AbstractPlatformTransactionManager) transactionManager); runtimeManager.setUserGroupCallback(userGroupCallback); runtimeManager.setUserInfo(userInfo); if (properties.getQuartz().isEnabled()) { System.setProperty("org.quartz.properties", properties.getQuartz().getConfiguration()); System.setProperty("org.jbpm.timer.quartz.delay", String.valueOf(properties.getQuartz().getFailedJobDelay())); System.setProperty("org.jbpm.timer.quartz.retries", String.valueOf(properties.getQuartz().getFailedJobRetry())); System.setProperty("org.jbpm.timer.quartz.reschedule.delay", String.valueOf(properties.getQuartz().getRescheduleDelay())); System.setProperty("org.jbpm.timer.delay", String.valueOf(properties.getQuartz().getStartDelay())); } else { System.clearProperty("org.quartz.properties"); System.clearProperty("org.jbpm.timer.quartz.delay"); System.clearProperty("org.jbpm.timer.quartz.retries"); System.clearProperty("org.jbpm.timer.quartz.reschedule.delay"); <START> System.clearProperty("org.jbpm.timer.delay"); <END> } return runtimeManager; }</code><technical_language>good if constants..</technical_language>

Target:
public RuntimeManagerFactory runtimeManagerFactory(UserGroupCallback userGroupCallback, UserInfo userInfo) { SpringRuntimeManagerFactoryImpl runtimeManager = new SpringRuntimeManagerFactoryImpl(); runtimeManager.setTransactionManager((AbstractPlatformTransactionManager) transactionManager); runtimeManager.setUserGroupCallback(userGroupCallback); runtimeManager.setUserInfo(userInfo); if (properties.getQuartz().isEnabled()) { System.setProperty(QUARTZ_PROPS, properties.getQuartz().getConfiguration()); System.setProperty(QUARTZ_FAILED_DELAY, String.valueOf(properties.getQuartz().getFailedJobDelay())); System.setProperty(QUARTZ_FAILED_RETRIES, String.valueOf(properties.getQuartz().getFailedJobRetry())); System.setProperty(QUARTZ_RESECHEDULE_DELAY, String.valueOf(properties.getQuartz().getRescheduleDelay())); System.setProperty(QUARTZ_START_DELAY, String.valueOf(properties.getQuartz().getStartDelay())); } else { System.clearProperty(QUARTZ_PROPS); System.clearProperty(QUARTZ_FAILED_DELAY); System.clearProperty(QUARTZ_FAILED_RETRIES); System.clearProperty(QUARTZ_RESECHEDULE_DELAY); System.clearProperty(QUARTZ_START_DELAY); } return runtimeManager; }
Source:
<code>protected void readData(final ISeries series, final long start, final long end, final int nb) { if (getTrace() != null) { final double y[] = new double[nb]; Thread thread = new Thread("Histogram viewer update") { @Override public void run() { double x[] = getXAxis(start, end, nb); final long yLong[] = new long[nb]; Arrays.fill(y, 0.0); <START> if (getTrace() instanceof TmfExperiment) { <END> final TmfExperiment exp = (TmfExperiment) getTrace(); for (ITmfTrace trace : exp.getTraces()) { ITmfStatistics stats = trace.getStatistics(); List<Long> values = stats.histogramQuery(start, end, nb); for (int i = 0; i < nb; i++) { yLong[i] += values.get(i); } } } else { ITmfStatistics stats = getTrace().getStatistics(); List<Long> values = stats .histogramQuery(start, end, nb); for (int i = 0; i < nb; i++) { yLong[i] += values.get(i); } } for (int i = 0; i < nb; i++) { y[i] += yLong[i]; } drawChart(series, x, y); } }; thread.start(); } return; }</code><technical_language>TmfTraceManager.getTraceSet(getTrace()) avoid instanceof check copy pasting code</technical_language>

Target:
protected void readData(final ISeries series, final long start, final long end, final int nb) { if (getTrace() != null) { final double y[] = new double[nb]; Thread thread = new Thread("Histogram viewer update") { @Override public void run() { double x[] = getXAxis(start, end, nb); final long yLong[] = new long[nb]; Arrays.fill(y, 0.0); for (ITmfTrace trace : TmfTraceManager.getTraceSet(getTrace())) { ITmfStatistics stats = trace.getStatistics(); List<Long> values = stats.histogramQuery(start, end, nb); for (int i = 0; i < nb; i++) { yLong[i] += values.get(i); } } for (int i = 0; i < nb; i++) { y[i] += yLong[i]; } drawChart(series, x, y); } }; thread.start(); } return; }
Source:
<code>private boolean checkConnection() throws SQLException { try (Connection connection = flyway.getDataSource().getConnection()) { return true; } catch (FlywaySqlException e) { <START> System.out.println("Connection failure: " + e.getMessage()); <END> return false; } }</code><technical_language>LOG. If display error in console stderr</technical_language>

Target:
private void checkConnection() { try (Connection connection = flyway.getDataSource().getConnection()) { } catch (Exception e) { throw new SchemaMigrationException(e); } }
Source:
<code>public boolean verify(byte[] data, byte[] signature) throws VerificationException { try { <START> int expectedSize = ECDSASignatureProvider.ECDSA.valueOf(super.getAlgorithm()).getSignatureLength(); <END> byte[] derSignature = expectedSize != signature.length && signature[0] == 0x30 ? signature : ECDSASignatureProvider.concatenatedRSToASN1DER(signature, expectedSize); return super.verify(data, derSignature); } catch (Exception e) { throw new VerificationException("Signing failed", e); } }</code><technical_language>suggestion int expectedSize = ECDSASignatureProvider.ECDSA.valueOf(getAlgorithm()).getSignatureLength();</technical_language>

Target:
public boolean verify(byte[] data, byte[] signature) throws VerificationException { try { int expectedSize = ECDSASignatureProvider.ECDSA.valueOf(getAlgorithm()).getSignatureLength(); byte[] derSignature = expectedSize != signature.length && signature[0] == 0x30 ? signature : ECDSASignatureProvider.concatenatedRSToASN1DER(signature, expectedSize); return super.verify(data, derSignature); } catch (Exception e) { throw new VerificationException("Signing failed", e); } }
Source:
<code><START> protected StringUtils() { <END> }</code><technical_language>curious, do need change access qualifier protected</technical_language>

Target:
private StringUtils() { }
Source:
<code>protected void executeCommand() { if (getDiskImage() != null) { if (getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveDisk) { removeImageFromDB(); } <START> <END> VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( CreateTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand())); } else { log.warn("RemoveImageCommand::ExecuteCommand: DiskImage is null, nothing to remove"); } setSucceeded(true); }</code><technical_language>If failed send a command vdsm deleted DB, why</technical_language>

Target:
protected void executeCommand() { if (getDiskImage() != null) { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( CreateTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand())); if (getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveDisk) { removeImageFromDB(); } } else { log.warn("RemoveImageCommand::ExecuteCommand: DiskImage is null, nothing to remove"); } setSucceeded(true); }
Source:
<code><START> protected void updateComplete(IStatusMonitor monitor) { <END> if (!fTableCursor.isDisposed()) { super.updateComplete(monitor); } if (!hasPendingUpdates() && !fTableCursor.isDisposed()) { attemptSetKeySelection(); fTableCursor.redraw(); if (!hasPendingSetTopIndex()) { preservingSelection(() -> { int[] coordinates = getCoordinatesFromKey(getSelectionKey()); if (coordinates.length > 0) { fTableCursor.setVisible(true); } else { fTableCursor.setVisible(false); } }); } } if (!hasPendingUpdates() && fPendingFormatViewer) { formatViewer(); resizeColumnsToPreferredSize(); } }</code><technical_language>if is disposed, sense return? is check next if check - fail too</technical_language>

Target:
protected void updateComplete(IStatusMonitor monitor) { if (fTableCursor.isDisposed()) { return; } super.updateComplete(monitor); if (!hasPendingUpdates()) { attemptSetKeySelection(); fTableCursor.redraw(); if (!hasPendingSetTopIndex()) { preservingSelection(() -> { int[] coordinates = getCoordinatesFromKey(getSelectionKey()); if (coordinates.length > 0) { fTableCursor.setVisible(true); } else { fTableCursor.setVisible(false); } }); } } if (!hasPendingUpdates() && fPendingFormatViewer) { formatViewer(); resizeColumnsToPreferredSize(); } }
Source:
<code>public void setDrawerLayout(DrawerLayout drawerLayout) { this.drawerLayout = drawerLayout; drawerLayout.setDrawerListener(new DrawerLayout.SimpleDrawerListener() { @Override public void onDrawerSlide(View drawerView, float slideOffset) { <START> Utils.hideSoftKeyboard(getActivity()); <END> ViewAnimations.ensureTranslationY(getView(), 0); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(drawerIndicator.getLayoutParams()); params.leftMargin = (int)(-4 * WikipediaApp.SCREEN_DENSITY * (slideOffset)); params.rightMargin = -params.leftMargin; params.gravity = Gravity.CENTER_VERTICAL; drawerIndicator.setLayoutParams(params); } }); }</code><technical_language>called times drawer slide. a flag execute open</technical_language>

Target:
public void setDrawerLayout(DrawerLayout drawerLayout) { this.drawerLayout = drawerLayout; drawerLayout.setDrawerListener(new DrawerLayout.SimpleDrawerListener() { boolean hideKeyboardCalled = false; @Override public void onDrawerSlide(View drawerView, float slideOffset) { if (!hideKeyboardCalled) { Utils.hideSoftKeyboard(getActivity()); hideKeyboardCalled = true; } ViewAnimations.ensureTranslationY(getView(), 0); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(drawerIndicator.getLayoutParams()); params.leftMargin = (int)(-4 * WikipediaApp.SCREEN_DENSITY * (slideOffset)); params.rightMargin = -params.leftMargin; params.gravity = Gravity.CENTER_VERTICAL; drawerIndicator.setLayoutParams(params); } @Override public void onDrawerOpened(View drawerView) { hideKeyboardCalled = false; } @Override public void onDrawerClosed(View drawerView) { hideKeyboardCalled = false; } }); }
Source:
<code>private void updateMessage() { if (commitButton == null) return; String message = null; int type = IMessageProvider.NONE; String commitMsg = commitMessageComponent.getCommitMessage(); if (commitMsg == null || commitMsg.trim().length() == 0) { message = UIText.CommitDialog_Message; type = IMessageProvider.INFORMATION; } else if (!isCommitWithoutFilesAllowed()) { message = UIText.CommitDialog_MessageNoFilesSelected; type = IMessageProvider.INFORMATION; } else { CommitStatus status = commitMessageComponent.getStatus(); message = status.getMessage(); type = status.getMessageType(); } <START> boolean noErrors = getPreferenceStore() <END> .getBoolean(UIPreferences.CHECK_BEFORE_COMMITTING) ? (ignoreErrors.getSelection() || getProblemsSeverity() < IMarker.SEVERITY_WARNING) : true; setMessage(message, type); boolean commitEnabled = (type == IMessageProvider.WARNING || type == IMessageProvider.NONE) && noErrors; commitButton.setEnabled(commitEnabled); commitAndPushButton.setEnabled(commitEnabled); }</code><technical_language>check happen defining commit status message/type, if noErrors == false message/type set warning</technical_language>

Target:
private void updateMessage() { if (commitButton == null) return; String message = null; int type = IMessageProvider.NONE; boolean hasErrorsOrWarnings = getPreferenceStore() .getBoolean(UIPreferences.CHECK_BEFORE_COMMITTING) ? (getProblemsSeverity() >= IMarker.SEVERITY_WARNING && !ignoreErrors.getSelection()) : false; if (hasErrorsOrWarnings) { message = UIText.CommitDialog_MessageErrors; type = IMessageProvider.WARNING; } else { String commitMsg = commitMessageComponent.getCommitMessage(); if (commitMsg == null || commitMsg.trim().length() == 0) { message = UIText.CommitDialog_Message; type = IMessageProvider.INFORMATION; } else if (!isCommitWithoutFilesAllowed()) { message = UIText.CommitDialog_MessageNoFilesSelected; type = IMessageProvider.INFORMATION; } else { CommitStatus status = commitMessageComponent.getStatus(); message = status.getMessage(); type = status.getMessageType(); } } setMessage(message, type); boolean commitEnabled = (type == IMessageProvider.WARNING || type == IMessageProvider.NONE) && !hasErrorsOrWarnings; updateCommitButtons(commitEnabled); }
Source:
<code>private void populateModelWithObjectStoreConfig(ModelNode operation, ModelNode objectStoreModel) throws OperationFailedException { TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO.validateAndSet(operation, objectStoreModel); TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.validateAndSet(operation, objectStoreModel); ModelNode relativeVal = objectStoreModel.get(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO.getName()); ModelNode pathVal = objectStoreModel.get(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getName()); if (!relativeVal.isDefined() && <START> (!pathVal.isDefined() || pathVal.asString().equals(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getDefaultValue().asString()))) { <END> relativeVal.set(new ModelNode().set("jboss.server.data.dir")); } }</code><technical_language>This parser is doing? is some nuance I missing</technical_language>

Target:
private void populateModelWithObjectStoreConfig(ModelNode operation, ModelNode objectStoreModel) throws OperationFailedException { TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO.validateAndSet(operation, objectStoreModel); TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.validateAndSet(operation, objectStoreModel); ModelNode relativeVal = objectStoreModel.get(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO.getName()); ModelNode pathVal = objectStoreModel.get(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getName()); if (!relativeVal.isDefined() && (!pathVal.isDefined() || pathVal.asString().equals(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getDefaultValue().asString()))) { relativeVal.set(new ModelNode().set("jboss.server.data.dir")); TransactionLogger.ROOT_LOGGER.objectStoreRelativeToIsSetToDefault(); } }
Source:
<code>void setUp() { <START> factory = shouldHaveSizeLessThanOrEqualTo(newArrayList('a', 'b'), 4, 2); <END> }</code><technical_language>CharSequence instead of Object for actual's type</technical_language>

Target:
void setUp() { factory = shouldHaveSizeLessThanOrEqualTo("ab", 4, 2); }
Source:
<code>public Response postExperiment(@FormParam("name") String name, <START> @FormParam("traces") List<UUID> traceUUIDs) { <END> IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IPath ipath = root.getLocation().append(EXPERIMENTS).append(name); IResource resource = root.findMember(ipath); if (Iterables.any(TmfTraceManager.getInstance().getOpenedTraces(), t -> t.getPath().equals(ipath.toOSString()))) { return Response.status(Status.CONFLICT).entity("There is already an experiment named: " + name).build(); } ITmfTrace[] array = new ITmfTrace[traceUUIDs.size()]; int i = 0; for (UUID uuid : traceUUIDs) { ITmfTrace trace = TraceManagerService.getTraceByUUID(uuid); if (trace == null) { return Response.noContent().build(); } array[i++] = trace; } TmfExperiment experiment = new TmfExperiment(ITmfEvent.class, ipath.toOSString(), array, TmfExperiment.DEFAULT_INDEX_PAGE_SIZE, resource); experiment.traceOpened(new TmfTraceOpenedSignal(this, experiment, null)); TmfTraceManager.getInstance().traceOpened(new TmfTraceOpenedSignal(this, experiment, null)); return Response.ok(experiment).build(); }</code><technical_language>in specification name list of trace uuids supposed provided path parameter, right? I sense implemented it. change spec for that. <LINK_0></technical_language>

Target:
public Response postExperiment(@FormParam("name") String name, @FormParam("traces") List<UUID> traceUUIDs) { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IPath ipath = root.getLocation().append(EXPERIMENTS).append(name); IResource resource = root.findMember(ipath); if (Iterables.any(TmfTraceManager.getInstance().getOpenedTraces(), t -> t.getPath().equals(ipath.toOSString()))) { return Response.status(Status.CONFLICT).entity("There is already an experiment named: " + name).build(); } ITmfTrace[] array = new ITmfTrace[traceUUIDs.size()]; int i = 0; for (UUID uuid : traceUUIDs) { ITmfTrace trace = TraceManagerService.getTraceByUUID(uuid); if (trace == null) { return Response.noContent().build(); } try { ITmfTrace clone = trace.getClass().newInstance(); clone.initTrace(trace.getResource(), trace.getPath(), ITmfEvent.class, trace.getName(), trace.getTraceTypeId()); array[i++] = clone; } catch (InstantiationException | IllegalAccessException | TmfTraceException e) { return Response.serverError().entity(e.getMessage()).build(); } } TmfExperiment experiment = new TmfExperiment(ITmfEvent.class, ipath.toOSString(), array, TmfExperiment.DEFAULT_INDEX_PAGE_SIZE, resource); TmfSignalManager.dispatchSignal(new TmfTraceOpenedSignal(this, experiment, null)); return Response.ok(experiment).build(); }
Source:
<code>void removeTokenCacheItem(final TokenCacheItem tokenCacheItem, final String resource) throws AuthenticationException { final List<String> keys; final TokenEntryType tokenEntryType = tokenCacheItem.getTokenEntryType(); switch (tokenEntryType) { case REGULAR_TOKEN_ENTRY : Logger.v(TAG, "Regular RT was used to get access token, remove entries " + "for regular RT entries."); keys = getKeyListToRemoveForRT(tokenCacheItem); break; case MRRT_TOKEN_ENTRY : Logger.v(TAG, "MRRT was used to get access token, remove entries for both " + "MRRT entries and regular RT entries."); keys = getKeyListToRemoveForMRRT(tokenCacheItem, resource); final TokenCacheItem regularRTItem = new TokenCacheItem(tokenCacheItem); regularRTItem.setResource(resource); keys.addAll(getKeyListToRemoveForRT(regularRTItem)); break; case FRT_TOKEN_ENTRY : Logger.v(TAG, "FRT was used to get access token, remove entries for " + "FRT entries."); keys = getKeyListToRemoveForFRT(tokenCacheItem); break; default : <START> throw new AuthenticationException(ADALError.INVALID_TOKEN_CACHE_ITEM); <END> } for (final String key : keys) { mTokenCacheStore.removeItem(key); } }</code><technical_language>Illigal argument</technical_language>

Target:
private void removeTokenCacheItem(final TokenCacheItem tokenCacheItem, final String resource) throws AuthenticationException { final List<String> keys; final TokenEntryType tokenEntryType = tokenCacheItem.getTokenEntryType(); switch (tokenEntryType) { case REGULAR_TOKEN_ENTRY : Logger.v(TAG, "Regular RT was used to get access token, remove entries " + "for regular RT entries."); keys = getKeyListToRemoveForRT(tokenCacheItem); break; case MRRT_TOKEN_ENTRY : Logger.v(TAG, "MRRT was used to get access token, remove entries for both " + "MRRT entries and regular RT entries."); keys = getKeyListToRemoveForMRRT(tokenCacheItem, resource); final TokenCacheItem regularRTItem = new TokenCacheItem(tokenCacheItem); regularRTItem.setResource(resource); keys.addAll(getKeyListToRemoveForRT(regularRTItem)); break; case FRT_TOKEN_ENTRY : Logger.v(TAG, "FRT was used to get access token, remove entries for " + "FRT entries."); keys = getKeyListToRemoveForFRT(tokenCacheItem); break; default : throw new AuthenticationException(ADALError.INVALID_TOKEN_CACHE_ITEM); } for (final String key : keys) { mTokenCacheStore.removeItem(key); } }
Source:
<code>private File getBackupFile(int age) { List<Long> fileTimes = new ArrayList<Long>(); <START> File folder = new File(file.getParent() + File.separator + "backup"); <END> File[] files = folder.listFiles(); int count = files.length; for (int i = 0; i < count; i++) { if (files[i].isFile()) { String[] parts = files[i].getName().split(SEPARATOR); if (parts.length != 2 || !parts[1].equals(file.getName())) { continue; } long time = Long.parseLong(parts[0]); fileTimes.add(time); } } Collections.sort(fileTimes); if (fileTimes.size() < age) { return null; } return new File(file.getParent() + File.separator + "backup", fileTimes.get(fileTimes.size() - age) + SEPARATOR + file.getName()); }</code><technical_language>define "backup" a constant</technical_language>

Target:
private File getBackupFile(int age) { List<Long> fileTimes = new ArrayList<Long>(); File folder = new File(file.getParent() + File.separator + BACKUP_EXTENSION); File[] files = folder.listFiles(); int count = files.length; for (int i = 0; i < count; i++) { if (files[i].isFile()) { String[] parts = files[i].getName().split(SEPARATOR); if (parts.length != 2 || !parts[1].equals(file.getName())) { continue; } long time = Long.parseLong(parts[0]); fileTimes.add(time); } } Collections.sort(fileTimes); if (fileTimes.size() < age) { return null; } return new File(file.getParent() + File.separator + BACKUP_EXTENSION, fileTimes.get(fileTimes.size() - age) + SEPARATOR + file.getName()); }
Source:
<code>public static Long determineTotalImageInitialSize(DiskImage sourceImage, VolumeFormat destFormat, Guid srcDomain, Guid dstDomain) { if (isInitialSizeSupportedForFormat(destFormat, dstDomain)) { double totalSizeForClonedDisk = getTotalActualSizeOfDisk(sourceImage, <START> DbFacade.getInstance().getStorageDomainDao().get(srcDomain).getStorageStaticData()); <END> return computeCowImageNeededSize(sourceImage.getVolumeFormat(), Double.valueOf(totalSizeForClonedDisk).longValue()); } return null; }</code><technical_language>a problem a small disk size (less 150KB). adding 10% enough for qcow header. minimum initial size in VDSM</technical_language>

Target:
public Long determineTotalImageInitialSize(DiskImage sourceImage, VolumeFormat destFormat, Guid srcDomain, Guid dstDomain) { if (isInitialSizeSupportedForFormat(destFormat, dstDomain)) { double totalSizeForClonedDisk = getTotalActualSizeOfDisk(sourceImage, storageDomainDao.get(srcDomain).getStorageStaticData()); return computeCowImageNeededSize(sourceImage.getVolumeFormat(), Double.valueOf(totalSizeForClonedDisk).longValue()); } return null; }
Source:
<code>public String toString() { <START> return MoreObjects.toStringHelper(this) <END> .add("table", table) .add("name", name) .toString(); }</code><technical_language>;) string concatenation preferable</technical_language>

Target:
public String toString() { return "DropCheckConstraint{" + "table=" + table + ", name='" + name + '\'' + '}'; }
Source:
<code>public int parseRetryInterval() throws ConfigurationException { verifyNotEmpty("retry interval", _retryInterval); int retryInterval; try { retryInterval = Integer.parseInt(_retryInterval); } catch (NumberFormatException ex) { <START> throw new ConfigurationException("Number of retries has to be between 1 and 10"); <END> } if ((retryInterval < 0) || (retryInterval > 10000)) { throw new ConfigurationException("Number of retries has to be between 1 and 10"); } return retryInterval; }</code><technical_language>This message appears a duplication of line 258 match range line 275</technical_language>

Target:
public int parseRetryInterval() throws ConfigurationException { return verifyInRange("Retry interval", _retryInterval, 1, 10000); }
Source:
<code>private void downloadLocal() { File workerHome = newFile(getSimulatorHome(), WORKERS_HOME_NAME); <START> File targetDirectory = ensureExistingDirectory(newFile(".", WORKERS_HOME_NAME), testSuite.getId()); <END> String workerPath = workerHome.getAbsolutePath(); String targetPath = targetDirectory.getAbsolutePath(); execute(format("mv %s/%s/* %s || true", workerPath, testSuite.getId(), targetPath)); execute(format("rmdir %s/%s || true", workerPath, testSuite.getId())); execute(format("rmdir %s || true", workerPath)); execute(format("mv ./agent.err %s/ || true", targetPath)); execute(format("mv ./agent.out %s/ || true", targetPath)); execute(format("mv ./failures-%s.txt %s/ || true", testSuite.getId(), targetPath)); }</code><technical_language>re-use outputDirectory here, for local remote</technical_language>

Target:
private void downloadLocal() { echoLocal("Retrieving artifacts of local machine"); File workerHome = newFile(getSimulatorHome(), WORKERS_HOME_NAME); String workerPath = workerHome.getAbsolutePath(); execute(format("mv %s/%s/* %s || true", workerPath, testSuite.getId(), outputDirectory.getAbsolutePath())); execute(format("rmdir %s/%s || true", workerPath, testSuite.getId())); execute(format("rmdir %s || true", workerPath)); execute(format("mv ./agent.err %s/ || true", outputDirectory.getAbsolutePath())); execute(format("mv ./agent.out %s/ || true", outputDirectory.getAbsolutePath())); }
Source:
<code>public Comparable score(QueryPlan qp) { LOGGER.debug("score begin"); QueryPlanNode[] nodes = qp.getAllNodes(); QueryPlanNode[] sources = qp.getSources(); QueryPlanNode root = null; int numNodeQueries=0; for (QueryPlanNode node : nodes) { if (node.getMetadata().getParent() == null) { root = node; } if(getData(node).hasQueries()) numNodeQueries++; } if (null == root) { throw new IllegalStateException("Unable to find root metadata"); } if(numNodeQueries==0) { if(qp.isPlanMatchesMetadata()) return BigInteger.ZERO; else <START> return new BigInteger("999999999"); <END> } BigInteger penalty=BigInteger.ONE; if(sources.length>1) penalty=BigInteger.TEN; for(QueryPlanNode node:sources) if(!getData(node).hasQueries()) penalty=penalty.multiply(new BigInteger("100")); for(QueryPlanNode node:nodes) { if(!getData(node).hasQueries()) { if(aboveRoot(node,root)) { QueryPlanNode[] s=node.getSources(); if(s!=null&&s.length>0) { penalty=penalty.multiply(new BigInteger("5")); } } } } LOGGER.debug("penalty={}",penalty); BigInteger finalCost; if (sources.length == 1 && sources[0] == root) { if (getData(root).isIdentitySearch()) { finalCost = BigInteger.ZERO; } else { finalCost = computeRetrievalCost(root); } } else { CostAndSize cs = computeQueryCost(root, qp); finalCost = cs.cost.add(cs.size); } LOGGER.debug("Final cost w/o penalty:{}", finalCost); finalCost=finalCost.multiply(penalty); LOGGER.debug("Final cost:{}", finalCost); return finalCost; }</code><technical_language>Int.MaxVal</technical_language>

Target:
public Comparable score(QueryPlan qp) { LOGGER.debug("score begin"); QueryPlanNode[] nodes = qp.getAllNodes(); QueryPlanNode[] sources = qp.getSources(); QueryPlanNode root = null; int numNodeQueries=0; for (QueryPlanNode node : nodes) { if (node.getMetadata().getParent() == null) { root = node; } if(getData(node).hasQueries()) numNodeQueries++; } if (null == root) { throw new IllegalStateException("Unable to find root metadata"); } if(numNodeQueries==0) { if(qp.isPlanMatchesMetadata()) return BigInteger.ZERO; else return new BigInteger(Integer.toString(Integer.MAX_VALUE)); } BigInteger penalty=BigInteger.ONE; if(sources.length>1) penalty=BigInteger.TEN; for(QueryPlanNode node:sources) if(!getData(node).hasQueries()) penalty=penalty.multiply(new BigInteger("100")); for(QueryPlanNode node:nodes) { if(!getData(node).hasQueries()) { if(aboveRoot(node,root)) { QueryPlanNode[] s=node.getSources(); if(s!=null&&s.length>0) { penalty=penalty.multiply(new BigInteger("5")); } } } } LOGGER.debug("penalty={}",penalty); BigInteger finalCost; if (sources.length == 1 && sources[0] == root) { if (getData(root).isIdentitySearch()) { finalCost = BigInteger.ZERO; } else { finalCost = computeRetrievalCost(root); } } else { CostAndSize cs = computeQueryCost(root, qp); finalCost = cs.cost.add(cs.size); } LOGGER.debug("Final cost w/o penalty:{}", finalCost); finalCost=finalCost.multiply(penalty); LOGGER.debug("Final cost:{}", finalCost); return finalCost; }
Source:
<code>public void onUpdateRecord(Data key, Record record, Object newValue) { <START> eventJournal.writeUpdateEvent(mapContainer.getEventJournalConfig(), mapContainer.getObjectNamespace(), partitionId, <END> record.getKey(), record.getValue(), newValue); }</code><technical_language>Minor: pass in config namespace constructor event</technical_language>

Target:
public void onUpdateRecord(Data key, Record record, Object newValue) { eventJournal.writeUpdateEvent(eventJournalConfig, objectNamespace, partitionId, record.getKey(), record.getValue(), newValue); }
Source:
<code>public BufferedMultipleNodeCallField toBuffered() { <START> if(!(paramValues instanceof BufferableHandle)) <END> throw new IllegalArgumentException("Default parameter must implement BufferableHandle."); BytesHandle bytesHandle = new BytesHandle((BufferableHandle) paramValues); return new BufferedMultipleNodeCallField(super.paramName, Stream.of(bytesHandle)); }</code><technical_language>paramValues is a stream BufferableHandle items a BufferableHandle itself. So, cast fail. Instead, necessary convert items in stream individually. do a mapping lambda, in: Stream<BytesHandle> bytesHandleStream = paramValues.map(handle ->{ ... if handle is a BufferableHandle, throw exception, otherwise, construct BytesHandle ... });</technical_language>

Target:
public BufferedMultipleNodeCallField toBuffered() { Stream<BytesHandle> bytesHandleStream = paramValues.map(handle ->{ if(!(handle instanceof BufferableHandle)) throw new IllegalArgumentException("Default parameter must implement BufferableHandle."); return new BytesHandle((BufferableHandle) handle); }); return new BufferedMultipleNodeCallField(super.getParamName(), bytesHandleStream); }
Source:
<code>public static GoFunctionDeclaration createFunctionDeclarationFromText(@NotNull Project project, @NotNull String name, @NotNull String text, @Nullable String expectedType) { <START> if (expectedType == null) { <END> expectedType = ""; } else { expectedType += " "; } GoFile file = createFileFromText(project, "package a; func " + name + "(" + text + ") " + expectedType + "{\n}"); return ContainerUtil.getFirstItem(file.getFunctions()); }</code><technical_language>ternary operator</technical_language>

Target:
public static GoFunctionDeclaration createFunctionDeclarationFromText(@NotNull Project project, @NotNull String name, @NotNull String text, @Nullable String expectedType) { expectedType = expectedType == null ? "" : expectedType + " "; GoFile file = createFileFromText(project, "package a; func " + name + "(" + text + ") " + expectedType + "{\n}"); return ContainerUtil.getFirstItem(file.getFunctions()); }
Source:
<code>AuthenticationAuthority(final URL authorityUrl, final boolean validateAuthority) { this.authorityUrl = authorityUrl; this.authorityType = detectAuthorityType(); this.validateAuthority = validateAuthority; <START> proxy = Proxy.NO_PROXY; <END> validateAuthorityUrl(); setupAuthorityProperties(); }</code><technical_language>lets proxy = null</technical_language>

Target:
AuthenticationAuthority(final URL authorityUrl, final boolean validateAuthority) { this.authorityUrl = authorityUrl; this.authorityType = detectAuthorityType(); this.validateAuthority = validateAuthority; validateAuthorityUrl(); setupAuthorityProperties(); }
Source:
<code>public QueueModel updateQueue(ArrayList<Subscriber> subscribersList, ArrayList<Alert> alertsList, String pushType, String errorQueue, int retries, int retriesDelay) throws IOException { String url = "queues/" + name; <START> UpdateQueue updateQueue = new UpdateQueue(subscribersList, alertsList, pushType, errorQueue, retries, retriesDelay); <END> Gson gson = new Gson(); String jsonMessages = gson.toJson(updateQueue); Reader reader = client.patch(url, jsonMessages); QueueModel message = gson.fromJson(reader, QueueModel.class); reader.close(); return message; }</code><technical_language>UpdateQueue is wrong model. up-to-date. remove</technical_language>

Target:
public QueueModel updateQueue(ArrayList<Subscriber> subscribersList, ArrayList<Alert> alertsList, String pushType, String errorQueue, int retries, int retriesDelay) throws IOException { QueueModel model = new QueueModel(); model.setPushInfo(new QueuePushModel(subscribersList, retries, retriesDelay, errorQueue)); model.setAlerts(alertsList); model.setType(pushType); return update(model); }
Source:
<code>public void testPopulatedNewRequisitionAccount() { <START> final String accountType = "REQS"; <END> final Class<TestableRequisitionAccount> accountClass = TestableRequisitionAccount.class; validateAccount(accountType, accountClass); }</code><technical_language>If existing constants for account types, (and in other relevant test methods below)</technical_language>

Target:
public void testPopulatedNewRequisitionAccount() { final String accountType = PurapConstants.REQUISITION_DOCUMENT_TYPE; final Class<TestableRequisitionAccount> accountClass = TestableRequisitionAccount.class; validateAccount(accountType, accountClass); }
Source:
<code>public int getVisibility(IBinding member) { try { PDOMCPPMemberBlock members = new PDOMCPPMemberBlock(getLinkage(), record + MEMBERLIST); return members.getVisibility(member); } catch (CoreException e) { CCorePlugin.log(e); <START> throw new IllegalArgumentException(member.getName() + " is not a member of " + getName()); END> } }</code><technical_language>A CoreException necessarily member is owned class</technical_language>

Target:
public int getVisibility(IBinding member) { try { PDOMCPPMemberBlock members = new PDOMCPPMemberBlock(getLinkage(), record + MEMBERLIST); return members.getVisibility(member); } catch (CoreException e) { CCorePlugin.log(e); return v_public; } }
Source:
<code>private static boolean isGetMessageReferencedByIdentifiers(MethodInvocationTree mit) { Set<IdentifierTree> identifiersChildren = new HashSet<>(); <START> BaseTreeVisitor visitor = new BaseTreeVisitor() { <END> @Override public void visitIdentifier(IdentifierTree tree) { identifiersChildren.add(tree); } }; mit.accept(visitor); boolean invocationInInitializer = identifiersChildren.stream().anyMatch(identifierTree -> hasGetMessageMethodInvocation(getVariableInitializer(identifierTree))); return invocationInInitializer || identifiersChildren.stream() .map(IdentifierTree::symbol) .map(Symbol::usages) .flatMap(usagesList -> getAssignments(usagesList).stream()) .anyMatch(assignment -> hasGetMessageMethodInvocation(assignment.expression())); }</code><technical_language>I a dedicated class GetExceptionMessageVisitor avoid creation of class for call this method</technical_language>

Target:
private static boolean isGetMessageReferencedByIdentifiers(MethodInvocationTree mit) { ChildrenIdentifierCollector visitor = new ChildrenIdentifierCollector(); mit.accept(visitor); boolean invocationInInitializer = visitor.identifiersChildren.stream() .map(UsageStatus::getVariableInitializer) .distinct() .anyMatch(UsageStatus::hasGetMessageMethodInvocation); return invocationInInitializer || visitor.identifiersChildren.stream() .map(IdentifierTree::symbol) .map(Symbol::usages) .flatMap(usagesList -> getAssignments(usagesList).stream()) .anyMatch(assignment -> hasGetMessageMethodInvocation(assignment.expression())); }
Source:
<code>public List<Mounted> checkCriticalSlotsForEquipment(Entity entity) { List<Mounted> unallocated = new ArrayList<>(); for (Mounted m : entity.getEquipment()) { <START> if ((m.getLocation() == Entity.LOC_NONE) && !m.isOneShotAmmo() && m.getCriticals() > 0) { <END> unallocated.add(m); } } return unallocated; }</code><technical_language>suggestion if ((m.getLocation() == Entity.LOC_NONE) && !m.isOneShotAmmo() && (m.getCriticals() > 0)) {</technical_language>

Target:
public List<Mounted> checkCriticalSlotsForEquipment(Entity entity) { List<Mounted> unallocated = new ArrayList<>(); for (Mounted m : entity.getEquipment()) { if ((m.getLocation() == Entity.LOC_NONE) && !m.isOneShotAmmo() && (m.getCriticals() > 0)) { unallocated.add(m); } } return unallocated; }
Source:
<code>protected boolean isPathInContentEntry(@NotNull File path, @NotNull ContentEntry contentEntry) { VirtualFile rootFile = contentEntry.getFile(); if (rootFile == null) { return false; } <START> File rootFilePath = new File(FileUtil.toSystemDependentName(rootFile.getPath())); <END> return FileUtil.isAncestor(rootFilePath, path, false); }</code><technical_language>converting VirtualFile IO File right? Instead File rootFilePath = VfsUtilCore.virtualToIoFile(rootFile);</technical_language>

Target:
protected boolean isPathInContentEntry(@NotNull File path, @NotNull ContentEntry contentEntry) { VirtualFile rootFile = contentEntry.getFile(); if (rootFile == null) { return false; } File rootFilePath = VfsUtilCore.virtualToIoFile(rootFile); return FileUtil.isAncestor(rootFilePath, path, false); }
Source:
<code>public PrologJar (Config config, SitePaths site, Repository git) { this.git = git; <START> String s = config.getString("cache", null, "directory"); <END> cacheDir = site.resolve(config.getString("cache", null, "directory")); }</code><technical_language>This line is unused</technical_language>

Target:
public PrologJar (Config config, SitePaths site, Repository git) { this.git = git; cacheDir = site.resolve(config.getString("cache", null, "directory")); }
Source:
<code>public OrcStruct parseOrcSchema(Schema inputSchema) { StringBuilder builder = new StringBuilder(); try { HiveSchemaConverter.appendType(builder, inputSchema); } catch (UnsupportedTypeException e) { <START> LOG.debug("Not a valid Schema {}", inputSchema.toString(), e); <END> } TypeDescription schema = TypeDescription.fromString(builder.toString()); OrcStruct pair = (OrcStruct) OrcStruct.createValue(schema); return pair; }</code><technical_language>fatal</technical_language>

Target:
private OrcStruct parseOrcSchema(Schema inputSchema) { OrcStruct orcRecord; if (schemaCache.containsKey(inputSchema)) { TypeDescription schema = schemaCache.get(inputSchema); orcRecord = (OrcStruct) OrcStruct.createValue(schema); } else { StringBuilder builder = new StringBuilder(); try { HiveSchemaConverter.appendType(builder, inputSchema); } catch (UnsupportedTypeException e) { throw new IllegalArgumentException(String.format("Not a valid Schema {}", inputSchema.toString()), e); } TypeDescription schema = TypeDescription.fromString(builder.toString()); orcRecord = (OrcStruct) OrcStruct.createValue(schema); schemaCache.put(inputSchema, schema); } return orcRecord; }
Source:
<code>public static void setItemEnchantments(ItemStack itemStack, List<ItemEnchantment> value) { final NBTTagCompound compound; if (itemStack.getTagCompound() == null) { compound = new NBTTagCompound(); itemStack.setTagCompound(compound); } else { compound = itemStack.getTagCompound(); } final Map<Enchantment, Integer> valueMap = Maps.newLinkedHashMap(); for (ItemEnchantment enchantment : value) { valueMap.put(enchantment.getEnchantment(), enchantment.getLevel()); } <START> final NBTTagList newList = new NBTTagList(); END> for (Map.Entry<Enchantment, Integer> entry : valueMap.entrySet()) { final NBTTagCompound enchantmentCompound = new NBTTagCompound(); enchantmentCompound.setShort(NbtDataUtil.ITEM_ENCHANTMENT_ID, (short) net.minecraft.enchantment.Enchantment.getEnchantmentID((net.minecraft.enchantment.Enchantment) entry.getKey())); enchantmentCompound.setShort(NbtDataUtil.ITEM_ENCHANTMENT_LEVEL, entry.getValue().shortValue()); newList.appendTag(enchantmentCompound); } if (valueMap.isEmpty()) { compound.removeTag(NbtDataUtil.ITEM_ENCHANTMENT_LIST); } else { compound.setTag(NbtDataUtil.ITEM_ENCHANTMENT_LIST, newList); } }</code><technical_language>~~Move this code (newList) else below.~~ :white_check_mark:</technical_language>

Target:
public static void setItemEnchantments(ItemStack itemStack, List<ItemEnchantment> value) { final NBTTagCompound compound; if (itemStack.getTagCompound() == null) { compound = new NBTTagCompound(); itemStack.setTagCompound(compound); } else { compound = itemStack.getTagCompound(); } if (value.isEmpty()) { compound.removeTag(NbtDataUtil.ITEM_ENCHANTMENT_LIST); return; } final Map<Enchantment, Integer> valueMap = Maps.newLinkedHashMap(); for (ItemEnchantment enchantment : value) { valueMap.put(enchantment.getEnchantment(), enchantment.getLevel()); } final NBTTagList newList = new NBTTagList(); for (Map.Entry<Enchantment, Integer> entry : valueMap.entrySet()) { final NBTTagCompound enchantmentCompound = new NBTTagCompound(); enchantmentCompound.setShort(NbtDataUtil.ITEM_ENCHANTMENT_ID, (short) net.minecraft.enchantment.Enchantment.getEnchantmentID((net.minecraft.enchantment.Enchantment) entry.getKey())); enchantmentCompound.setShort(NbtDataUtil.ITEM_ENCHANTMENT_LEVEL, entry.getValue().shortValue()); newList.appendTag(enchantmentCompound); } compound.setTag(NbtDataUtil.ITEM_ENCHANTMENT_LIST, newList); }
Source:
<code>private boolean isUIThread() { <START> return PlatformUI.getWorkbench().getDisplay().getThread() == Thread <END> .currentThread(); }</code><technical_language>method static, "standard" implementation is: return PlatformUI.getWorkbench().getDisplay().getCurrent() != null;</technical_language>

Target:
private static boolean isUIThread() { return Display.getCurrent() != null; }
Source:
<code>public ICPPEvaluation computeForFunctionCall(ActivationRecord record, ConstexprEvaluationContext context) { ICPPEvaluation[] args = fArguments; for (int i = 0; i < fArguments.length; i++) { ICPPEvaluation arg = fArguments[i].computeForFunctionCall(record, context.recordStep()); if (arg != fArguments[i]) { if (args == fArguments) { args = new ICPPEvaluation[fArguments.length]; System.arraycopy(fArguments, 0, args, 0, fArguments.length); } args[i] = arg; } } ICPPFunction constructor = getConstructor(null); if (constructor != null && constructor instanceof ICPPConstructor) { <START> return new EvalConstructor(fInputType, (ICPPConstructor) constructor, fArguments, getTemplateDefinition()).computeForFunctionCall(record, context); <END> } if (args == fArguments) { return this; } EvalTypeId evalTypeId = new EvalTypeId(fInputType, getTemplateDefinition(), fRepresentsNewExpression, args); return evalTypeId; }</code><technical_language>"args", do this check computing "args"</technical_language>

Target:
public ICPPEvaluation computeForFunctionCall(ActivationRecord record, ConstexprEvaluationContext context) { ICPPEvaluation[] args = fArguments; for (int i = 0; i < fArguments.length; i++) { ICPPEvaluation arg = fArguments[i].computeForFunctionCall(record, context.recordStep()); if (arg != fArguments[i]) { if (args == fArguments) { args = new ICPPEvaluation[fArguments.length]; System.arraycopy(fArguments, 0, args, 0, fArguments.length); } args[i] = arg; } } ICPPFunction constructor = getConstructor(null); if (constructor != null && constructor instanceof ICPPConstructor) { return new EvalConstructor(fInputType, (ICPPConstructor) constructor, fArguments, getTemplateDefinition()).computeForFunctionCall(record, context); } if (args == fArguments) { return this; } EvalTypeId evalTypeId = new EvalTypeId(fInputType, getTemplateDefinition(), fRepresentsNewExpression, fUsesBracedInitList, args); return evalTypeId; }
Source:
<code>public void writeTo(Appendable appendable) throws IOException { try (JsonOutput json = new Json().newOutput(appendable)) { json.beginObject(); Map<String, Object> first = getOss(); if (first == null) { first = (Map<String, Object>) stream().findFirst() .orElse(new ImmutableCapabilities()) .asMap(); } json.name(DESIRED_CAPABILITIES); json.write(first); json.name(CAPABILITIES); json.beginObject(); <START> json.name(ALWAYS_MATCH); <END> json.write(first); json.name(FIRST_MATCH); json.beginArray(); getW3C().forEach(json::write); json.endArray(); json.endObject(); writeMetaData(json); json.endObject(); } }</code><technical_language>writing DESIRED_CAPABILITIES</technical_language>

Target:
public void writeTo(Appendable appendable) throws IOException { try (JsonOutput json = new Json().newOutput(appendable)) { json.beginObject(); Map<String, Object> first = getOss(); if (first == null) { first = (Map<String, Object>) stream().findFirst() .orElse(new ImmutableCapabilities()) .asMap(); } json.name(DESIRED_CAPABILITIES); json.write(first); json.name(CAPABILITIES); json.beginObject(); json.name(ALWAYS_MATCH); getW3C().forEach(json::write); json.name(FIRST_MATCH); json.beginArray(); json.beginObject(); json.endObject(); json.endArray(); json.endObject(); writeMetaData(json); json.endObject(); } }
Source:
<code>public boolean hasResponseInCache() { <START> return mResponses.size() != 0; <END> }</code><technical_language>mResponses.size() > 0</technical_language>

Target:
public boolean hasResponseInCache() { return mResponses.size() > 0; }