auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void putBlob(MessageInfo messageInfo, ByteBuffer messageBuf, long size) throws CloudStorageException, IOException, GeneralSecurityException { boolean performUpload = messageInfo.getExpirationTimeInMs() == Utils.Infinite_Time && !messageInfo.isDeleted(); if (performUpload) { BlobId blobId = (BlobId) messageInfo.getStoreKey(); boolean usesCloudEncryption = false; if (cryptoService != null && (blobId.getVersion() < 4 || !BlobId.isEncrypted(blobId.getID()))) { messageBuf = cryptoService.encrypt(messageBuf); usesCloudEncryption = true; } CloudBlobMetadata blobMetadata = new CloudBlobMetadata(blobId, messageInfo.getOperationTimeMs(), messageInfo.getExpirationTimeInMs(), messageInfo.getSize(), usesCloudEncryption); cloudDestination.uploadBlob(blobId, size, blobMetadata, new ByteBufferInputStream(messageBuf)); } }

Target:
private void putBlob(MessageInfo messageInfo, ByteBuffer messageBuf, long size) throws CloudStorageException, IOException, GeneralSecurityException { if (shouldUpload(messageInfo)) { BlobId blobId = (BlobId) messageInfo.getStoreKey(); String kmsContext = cryptoService.getEncryptionContext(); CloudBlobMetadata.EncryptionType encryptionType; if (cloudConfig.vcrRequireEncryption && cryptoService != null && (blobId.getVersion() < BlobId.BLOB_ID_V4 || !BlobId.isEncrypted(blobId.getID()))) { messageBuf = cryptoService.encrypt(messageBuf); encryptionType = CloudBlobMetadata.EncryptionType.VCR; } else { kmsContext = blobId.getAccountId()+":"+blobId.getContainerId(); encryptionType = CloudBlobMetadata.EncryptionType.ROUTER; } CloudBlobMetadata blobMetadata = new CloudBlobMetadata(blobId, messageInfo.getOperationTimeMs(), messageInfo.getExpirationTimeInMs(), messageInfo.getSize(), kmsContext, encryptionType, CloudBlobMetadata.VcrEncryptionFormat.DEFAULT); cloudDestination.uploadBlob(blobId, size, blobMetadata, new ByteBufferInputStream(messageBuf)); } }
Source:
public Stream<? extends Arguments> provideArguments(ExtensionContext context) { CsvParserSettings settings = new CsvParserSettings(); settings.getFormat().setDelimiter(this.annotation.delimiter()); settings.getFormat().setLineSeparator(LINE_SEPARATOR); settings.getFormat().setQuote('\''); settings.getFormat().setQuoteEscape('\''); settings.setEmptyValue(this.annotation.emptyValue()); settings.setAutoConfigurationEnabled(false); CsvParser csvParser = new CsvParser(settings); AtomicLong index = new AtomicLong(0); final DefaultConversionProcessor processor = getConversionProcessor(); return Arrays.stream(this.annotation.value()) .map(line -> { String[] parsedLine = null; try { parsedLine = csvParser.parseLine(line + LINE_SEPARATOR); if (parsedLine != null) { parsedLine = Arrays.copyOf(processor.applyConversions(parsedLine, null), parsedLine.length, String[].class); } } catch (Throwable throwable) { handleCsvException(throwable, this.annotation); } Preconditions.notNull(parsedLine, () -> "Line at index " + index.get() + " contains invalid CSV: \"" + line + "\""); return parsedLine; }) .peek(values -> index.incrementAndGet()) .map(Arguments::of); }

Target:
public Stream<? extends Arguments> provideArguments(ExtensionContext context) { AtomicLong index = new AtomicLong(0); DefaultConversionProcessor processor = getConversionProcessor(); return Arrays.stream(this.annotation.value()) .map(line -> { String[] parsedLine = null; try { parsedLine = this.csvParser.parseLine(line + LINE_SEPARATOR); if (parsedLine != null) { parsedLine = Arrays.copyOf(processor.applyConversions(parsedLine, null), parsedLine.length, String[].class); } } catch (Throwable throwable) { handleCsvException(throwable, this.annotation); } Preconditions.notNull(parsedLine, () -> "Line at index " + index.get() + " contains invalid CSV: \"" + line + "\""); return parsedLine; }) .peek(values -> index.incrementAndGet()) .map(Arguments::of); }
Source:
public boolean isOwner() { if (isOwner == null) { AccountGroup g = groupCache.get(group.getOwnerGroupUUID()); AccountGroup.UUID ownerUUID = g != null ? g.getGroupUUID() : null; isOwner = getCurrentUser().getEffectiveGroups().contains(ownerUUID) || getCurrentUser().getCapabilities().canAdministrateServer(); } return isOwner; }

Target:
public boolean isOwner() { if (isOwner == null) { AccountGroup.UUID ownerUUID = group.getOwnerGroupUUID(); isOwner = getCurrentUser().getEffectiveGroups().contains(ownerUUID) || getCurrentUser().getCapabilities().canAdministrateServer(); } return isOwner; }
Source:
private void buildQueue(File inputFile, ArrayBlockingQueue<Metacard> metacardQueue, long start) { try { if (includeContent) { try (FileInputStream fileInputStream = new FileInputStream(inputFile)) { String alias = System.getProperty("org.codice.ddf.system.hostname"); if (verifier.verifyDigitalSignature( fileInputStream, new FileInputStream(signatureFile), alias)) { processIncludeContent(metacardQueue); } else { throw new CatalogCommandRuntimeException( "The provided signature was invalid for the provided data"); } } catch (IOException | CatalogCommandRuntimeException e) { throw new CatalogCommandRuntimeException( "An error occurred while verifying digital signature", e); } } else { try (Stream<Path> ingestStream = Files.walk(inputFile.toPath(), FileVisitOption.FOLLOW_LINKS)) { ingestStream .map(Path::toFile) .filter(file -> !file.isDirectory()) .forEach(file -> addFileToQueue(metacardQueue, start, file)); } catch (IOException e) { throw new UncheckedIOException(e); } } } finally { phaser.arriveAndDeregister(); } }

Target:
private void buildQueue(File inputFile, ArrayBlockingQueue<Metacard> metacardQueue, long start) { try { if (includeContent) { try (InputStream data = new FileInputStream(inputFile); InputStream signature = new FileInputStream(signatureFile)) { String alias = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty("org.codice.ddf.system.hostname")); if (verifier.verifyDigitalSignature(data, signature, alias)) { processIncludeContent(metacardQueue); } else { console.println("The provided signature was invalid for the provided data"); } } catch (IOException | CatalogCommandRuntimeException e) { throw new CatalogCommandRuntimeException( "An error occurred while verifying digital signature", e); } } else { try (Stream<Path> ingestStream = Files.walk(inputFile.toPath(), FileVisitOption.FOLLOW_LINKS)) { ingestStream .map(Path::toFile) .filter(file -> !file.isDirectory()) .forEach(file -> addFileToQueue(metacardQueue, start, file)); } catch (IOException e) { throw new UncheckedIOException(e); } } } finally { phaser.arriveAndDeregister(); } }
Source:
void run() throws Exception; } public static <T> boolean checkAndSleep(T expectedValue, Supplier expressionToCheck, int timeoutInMs) { int checkIntervalInMs = 100; long startTime = System.currentTimeMillis(); try { while (!Objects.equals(expectedValue, expressionToCheck.get())) { if (System.currentTimeMillis() - startTime >= timeoutInMs) { return false; } Thread.sleep(checkIntervalInMs); } } catch (InterruptedException e) { return false; } return true; }

Target:
void run() throws Exception; } public static <T> boolean checkAndSleep(T expectedValue, Supplier expressionToCheck, int timeoutInMs) { long startTime = System.currentTimeMillis(); try { while (!Objects.equals(expectedValue, expressionToCheck.get())) { if (System.currentTimeMillis() - startTime >= timeoutInMs) { return false; } Thread.sleep(CHECK_INTERVAL_IN_MS); } } catch (InterruptedException e) { return false; } return true; }
Source:
public boolean isVmRunningOnSpm() { return this.spmId.equals(this.runningVdsId); }

Target:
public boolean isVmRunningOnSpm() { return spmId.equals(this.runningVdsId); }
Source:
public String getAuthorPrincipalName(File file) { return null; }

Target:
public String getAuthorPrincipalName(File file) { return StringUtils.EMPTY; }
Source:
protected void fit(DataSet dataSet) { if (replicatedModel instanceof MultiLayerNetwork) { if (lastEtlTime == null) lastEtlTime = new AtomicLong(0); ((MultiLayerNetwork) replicatedModel).setLastEtlTime(lastEtlTime.get()); modelLock.readLock().lock(); ((MultiLayerNetwork) replicatedModel).fit(dataSet); modelLock.readLock().unlock(); } else if (replicatedModel instanceof ComputationGraph) { if (lastEtlTime == null) lastEtlTime = new AtomicLong(0); ((ComputationGraph) replicatedModel).setLastEtlTime(lastEtlTime.get()); modelLock.readLock().lock(); ((ComputationGraph) replicatedModel).fit(dataSet); modelLock.readLock().unlock(); } }

Target:
protected void fit(DataSet dataSet) { if (replicatedModel instanceof MultiLayerNetwork) { if (lastEtlTime == null) lastEtlTime = new AtomicLong(0); ((MultiLayerNetwork) replicatedModel).setLastEtlTime(lastEtlTime.get()); try { modelLock.readLock().lock(); ((MultiLayerNetwork) replicatedModel).fit(dataSet); } finally { modelLock.readLock().unlock(); } } else if (replicatedModel instanceof ComputationGraph) { if (lastEtlTime == null) lastEtlTime = new AtomicLong(0); ((ComputationGraph) replicatedModel).setLastEtlTime(lastEtlTime.get()); try { modelLock.readLock().lock(); ((ComputationGraph) replicatedModel).fit(dataSet); } finally { modelLock.readLock().unlock(); } } }
Source:
public void handleError(HttpCommand command, HttpResponse response) { byte[] data = closeClientButKeepContentStream(response); String message = data != null ? new String(data) : null; Exception exception = message != null ? new HttpResponseException(command, response, message) : new HttpResponseException(command, response); message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 400: break; case 401: case 403: exception = new AuthorizationException(message, exception); break; case 404: if (!command.getCurrentRequest().getMethod().equals("DELETE")) { exception = new ResourceNotFoundException(message, exception); } break; case 409: exception = new IllegalStateException(message, exception); break; } command.setException(exception); }

Target:
public void handleError(HttpCommand command, HttpResponse response) { byte[] data = closeClientButKeepContentStream(response); String message = data != null ? new String(data) : null; Exception exception = message != null ? new HttpResponseException(command, response, message) : new HttpResponseException(command, response); message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 400: exception = new IllegalArgumentException(message, exception); break; case 401: case 403: exception = new AuthorizationException(message, exception); break; case 404: if (!command.getCurrentRequest().getMethod().equals("DELETE")) { exception = new ResourceNotFoundException(message, exception); } break; case 409: exception = new IllegalStateException(message, exception); break; } command.setException(exception); }
Source:
public DockerAccess createDockerAccess(DockerAccessContext dockerAccessContext) throws MojoExecutionException, MojoFailureException { try { DockerConnectionDetector dockerConnectionDetector = createDockerConnectionDetector(dockerAccessContext, dockerAccessContext.getLog()); DockerConnectionDetector.ConnectionParameter connectionParam = dockerConnectionDetector.detectConnectionParameter(dockerAccessContext.getDockerHost(), dockerAccessContext.getCertPath()); String version = dockerAccessContext.getMinimalApiVersion() != null ? dockerAccessContext.getMinimalApiVersion() : DockerAccessWithHcClient.fetchApiVersionFromServer(connectionParam.getUrl(), connectionParam.getCertPath(), dockerAccessContext.getMaxConnections(), dockerAccessContext.getLog()); DockerAccess access = new DockerAccessWithHcClient("v" + version, connectionParam.getUrl(), connectionParam.getCertPath(), dockerAccessContext.getMaxConnections(), dockerAccessContext.getLog()); access.start(); setDockerHostAddressProperty(dockerAccessContext, connectionParam.getUrl()); String serverVersion = access.getServerApiVersion(); if (!EnvUtil.greaterOrEqualsVersion(serverVersion, version)) { throw new MojoExecutionException( String.format("Server API version %s is smaller than required API version %s", serverVersion, version)); } return access; } catch (IOException e) { throw new MojoExecutionException("Cannot create docker access object ", e); } }

Target:
public DockerAccess createDockerAccess(DockerAccessContext dockerAccessContext) throws MojoExecutionException, MojoFailureException { try { DockerConnectionDetector dockerConnectionDetector = createDockerConnectionDetector(dockerAccessContext, dockerAccessContext.getLog()); DockerConnectionDetector.ConnectionParameter connectionParam = dockerConnectionDetector.detectConnectionParameter(dockerAccessContext.getDockerHost(), dockerAccessContext.getCertPath()); DockerAccess access = new DockerAccessWithHcClient(connectionParam.getUrl(), connectionParam.getCertPath(), dockerAccessContext.getMaxConnections(), dockerAccessContext.getLog()); access.start(); setDockerHostAddressProperty(dockerAccessContext, connectionParam.getUrl()); return access; } catch (IOException e) { throw new MojoExecutionException("Cannot create docker access object ", e); } }
Source:
KinesisRecordWriter(AmazonKinesisClient kinesisClient, TaskAttemptContext context) { this.kinesisClient = kinesisClient; this.context = context; distribute = "true".equals(context.getConfiguration().get(Properties.KinesisRealtimeSink.DISTRIBUTE)); }

Target:
KinesisRecordWriter(AmazonKinesisClient kinesisClient, TaskAttemptContext context) { this.kinesisClient = kinesisClient; this.context = context; this.distribute = context.getConfiguration().getBoolean(Properties.KinesisRealtimeSink.DISTRIBUTE, true); this.streamName = context.getConfiguration().get(Properties.KinesisRealtimeSink.NAME); }
Source:
public void launch() { String command = format("%s start >/dev/null 2>&1 < /dev/null &", getRiakCmd()); command = isPackageInstall ? "sudo " + command : command; ScriptHelper launchScript = newScript(LAUNCHING) .failOnNonZeroResultCode() .body.append(command); if (!isRiakOnPath) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); launchScript.environmentVariablesReset(newPathVariable); } launchScript.execute(); }

Target:
public void launch() { String command = format("%s start >/dev/null 2>&1 < /dev/null &", getRiakCmd()); command = isPackageInstall ? "sudo " + command : command; ScriptHelper launchScript = newScript(LAUNCHING) .body.append(command); if (!isRiakOnPath) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); launchScript.environmentVariablesReset(newPathVariable); } launchScript.execute(); }
Source:
private boolean isArgumentFileSupported() { return (JavaCore.compareJavaVersions(javaVersion, JavaCore.VERSION_9) >= 0); }

Target:
private boolean isArgumentFileSupported() { return JavaCore.compareJavaVersions(javaVersion, JavaCore.VERSION_9) >= 0; }
Source:
private User getDefaultUser() { return dao.get(WORKFLOW_PROGRESS_ID_1).getUser(); }

Target:
private User getDefaultUser() { return (User) sessionFactory.getCurrentSession().get(UserImpl.class, USER_ID); }
Source:
public void validateCredentials(@NonNull final String strategy, @NonNull final String kuid, final JSONObject credentials, final Options options, @NonNull final ResponseListener<Boolean> listener) { if (listener == null) { throw new IllegalArgumentException("Security.getCredentials: listener is mandatory."); } try { JSONObject body = new JSONObject() .put("strategy", strategy) .put("credentials", credentials) .put("kuid", kuid); kuzzle.query(buildQueryArgs("security", "validateCredentials"), body, options, new OnQueryDoneListener() { @Override public void onSuccess(JSONObject response) { try { listener.onSuccess(response.getBoolean("result")); } catch (JSONException e) { throw new RuntimeException(e); } } @Override public void onError(JSONObject error) { listener.onError(error); } }); } catch (JSONException e) { throw new RuntimeException(e); } }

Target:
public void validateCredentials(@NonNull final String strategy, @NonNull final String kuid, final JSONObject credentials, final Options options, @NonNull final ResponseListener<Boolean> listener) { if (listener == null) { throw new IllegalArgumentException("Security.getCredentials: listener is mandatory."); } try { JSONObject body = new JSONObject() .put("strategy", strategy) .put("credentials", credentials) .put("_id", kuid); kuzzle.query(buildQueryArgs("security", "validateCredentials"), body, options, new OnQueryDoneListener() { @Override public void onSuccess(JSONObject response) { try { listener.onSuccess(response.getBoolean("result")); } catch (JSONException e) { throw new RuntimeException(e); } } @Override public void onError(JSONObject error) { listener.onError(error); } }); } catch (JSONException e) { throw new RuntimeException(e); } }
Source:
public void limit(TimeseriesQuery query) { setDimension("limit", toString().valueOf(query.getLimit())); }

Target:
public void limit(TimeseriesQuery query) { setDimension("limit", String.valueOf(query.getLimit())); }
Source:
public void onResume() { ActivityUtils.prepareLogging(); Logger.info(LOG_TAG, "Called SendTabActivity.onResume."); super.onResume(); final Context applicationContext = getApplicationContext(); final AccountManager accountManager = AccountManager.get(applicationContext); final Account[] fxAccounts = accountManager.getAccountsByType(FxAccountConstants.ACCOUNT_TYPE); if (fxAccounts.length > 0) { final AndroidFxAccount fxAccount = new AndroidFxAccount(applicationContext, fxAccounts[0]); if (fxAccount.getState().getNeededAction() != Action.None) { Logger.warn(LOG_TAG, "Firefox Account named like " + Utils.obfuscateEmail(fxAccounts[0].name) + " needs action before it can send a tab; redirecting to status activity."); final Intent intent = new Intent(applicationContext, FxAccountGetStartedActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); notifyAndFinish(false); return; } this.tabSender = new FxAccountTabSender(applicationContext, fxAccount); Logger.info(LOG_TAG, "Allowing tab send for Firefox Account."); registerDisplayURICommand(); return; } final Account[] syncAccounts = accountManager.getAccountsByType(SyncConstants.ACCOUNTTYPE_SYNC); if (syncAccounts.length > 0) { this.tabSender = new Sync11TabSender(applicationContext, syncAccounts[0], accountManager); Logger.info(LOG_TAG, "Allowing tab send for Sync account."); registerDisplayURICommand(); return; } final Intent intent = new Intent(applicationContext, FxAccountGetStartedActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); notifyAndFinish(false); }

Target:
public void onResume() { ActivityUtils.prepareLogging(); Logger.info(LOG_TAG, "Called SendTabActivity.onResume."); super.onResume(); final Context applicationContext = getApplicationContext(); final AccountManager accountManager = AccountManager.get(applicationContext); final Account[] fxAccounts = accountManager.getAccountsByType(FxAccountConstants.ACCOUNT_TYPE); if (fxAccounts.length > 0) { final AndroidFxAccount fxAccount = new AndroidFxAccount(applicationContext, fxAccounts[0]); if (fxAccount.getState().getNeededAction() != Action.None) { Logger.warn(LOG_TAG, "Firefox Account named like " + fxAccount.getObfuscatedEmail() + " needs action before it can send a tab; redirecting to status activity."); redirectToNewTask(FxAccountStatusActivity.class, false); return; } this.tabSender = new FxAccountTabSender(applicationContext, fxAccount); Logger.info(LOG_TAG, "Allowing tab send for Firefox Account."); registerDisplayURICommand(); return; } final Account[] syncAccounts = accountManager.getAccountsByType(SyncConstants.ACCOUNTTYPE_SYNC); if (syncAccounts.length > 0) { this.tabSender = new Sync11TabSender(applicationContext, syncAccounts[0], accountManager); Logger.info(LOG_TAG, "Allowing tab send for Sync account."); registerDisplayURICommand(); return; } redirectToNewTask(FxAccountGetStartedActivity.class, false); }
Source:
public void addMessages(List<String> messagesToAdd) { if (messagesToAdd != null) { for (String messageToAdd : messagesToAdd) { addMessage(messageToAdd); } } }

Target:
public void addMessages(List<String> messagesToAdd) { if (CollectionUtils.isNotEmpty(messagesToAdd)) { for (String messageToAdd : messagesToAdd) { addMessage(messageToAdd); } } }
Source:
public void annotationToMethodsReturnsValuesInTheMapThatAreUnmodifiable() { exception.expect(UnsupportedOperationException.class); TestClass tc = new TestClass(MethodsAnnotated.class); Map<Class<? extends Annotation>, List<FrameworkMethod>> annotationToMethods = tc.getAnnotationToMethods(); annotationToMethods.put(Ignore.class, null); }

Target:
public void annotationToMethodsReturnsValuesInTheMapThatAreUnmodifiable() { TestClass tc = new TestClass(MethodsAnnotated.class); Map<Class<? extends Annotation>, List<FrameworkMethod>> annotationToMethods = tc.getAnnotationToMethods(); List<FrameworkMethod> methods = annotationToMethods.get(Ignore.class); exception.expect(UnsupportedOperationException.class); methods.add(null); }
Source:
public void startTrackingBpForProcess(final IContainerDMContext containerDmc, final RequestMonitor rm) { final IBreakpointsTargetDMContext targetBpDmc = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class); IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(fDebugModelId); for (IBreakpoint breakpoint : breakpoints) { if (supportsBreakpoint(breakpoint) && breakpoint instanceof ICBreakpoint) { setTargetFilter((ICBreakpoint) breakpoint, containerDmc); } } startTrackingBreakpoints(targetBpDmc, rm); }

Target:
public void startTrackingBpForProcess(final IContainerDMContext containerDmc, final RequestMonitor rm) { final IBreakpointsTargetDMContext targetBpDmc = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class); IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(fDebugModelId); for (IBreakpoint breakpoint : breakpoints) { if (breakpoint instanceof ICBreakpoint && supportsBreakpoint(breakpoint)) { setTargetFilter((ICBreakpoint) breakpoint, containerDmc); } } startTrackingBreakpoints(targetBpDmc, rm); }
Source:
private static String encodeUniqueQueuedTaskName(StoredTask task) { Instant updatedAt = task.getUpdatedAt(); return Long.toString(task.getId()) + ".t" + String.format(ENGLISH, "%x%08x", updatedAt.getEpochSecond(), updatedAt.getNano()); }

Target:
private static String encodeUniqueQueuedTaskName(StoredTask task) { int retryCount = task.getRetryCount(); if (retryCount == 0) { return Long.toString(task.getId()); } else { return Long.toString(task.getId()) + ".r" + Integer.toString(retryCount); } }
Source:
private String[] getExcludeClassNamePatterns() { String[] patterns = getValueFromAnnotation(ExcludeClassNamePatterns.class, ExcludeClassNamePatterns::value, new String[0]); if (patterns.length == 0) { return new String[] {}; } Preconditions.containsNoNullElements(patterns, "ExcludeClassNamePatterns must not contain null elements"); trim(patterns); return patterns; }

Target:
private String[] getExcludeClassNamePatterns() { String[] patterns = getValueFromAnnotation(ExcludeClassNamePatterns.class, ExcludeClassNamePatterns::value, new String[0]); Preconditions.containsNoNullElements(patterns, "ExcludeClassNamePatterns must not contain null elements"); trim(patterns); return patterns; }
Source:
public ASTNode transform(KItem kItem) { if (!(kItem.kLabel() instanceof KLabel) || !(kItem.kList() instanceof KList)) { return super.transform(kItem); } assert kItem.kLabel() instanceof KLabel : "KLabel variables are not supported"; assert kItem.kList() instanceof KList : "KList must be concrete"; KLabel kLabel = (KLabel) kItem.kLabel(); KList kList = (KList) kItem.kList(); if (kLabel instanceof KLabelConstant) { KLabelConstant kLabelConstant = (KLabelConstant) kLabel; if (kLabelConstant.isBinder()) { assert kList.getContents().size()==2 && !kList.hasFrame() : "Only supporting binders of the form lambda x. e for now"; Term boundVar = kList.get(0); Term bindingExp = kList.get(1); Term variable = boundVar; Term freshBoundVars = FreshOperations.fresh(variable.sort(), context); Term current = substitution.get(boundVar); substitution.put(boundVar, freshBoundVars); Term resultBindingExp = (Term) bindingExp.accept(this); if (current != null) { substitution.put(boundVar, current); } kList = new KList(ImmutableList.<Term>of(freshBoundVars,resultBindingExp)); return new KItem(kLabel, kList, context); } } return super.transform(kItem); }

Target:
public ASTNode transform(KItem kItem) { if (!(kItem.kLabel() instanceof KLabel) || !(kItem.kList() instanceof KList)) { return super.transform(kItem); } KLabel kLabel = (KLabel) kItem.kLabel(); KList kList = (KList) kItem.kList(); if (kLabel instanceof KLabelConstant) { KLabelConstant kLabelConstant = (KLabelConstant) kLabel; if (kLabelConstant.isBinder()) { Map<Integer, Term> freshSubstitution = new HashMap<>(); Multimap<Integer, Integer> backBinding = HashMultimap.create(); Multimap<Integer, Integer> binderMap = kLabelConstant.getBinderMap(); for (Integer keyIndex : binderMap.keySet()) { Term boundVar = kList.get(keyIndex); if (!unboundedTerms.contains(boundVar) && !substitution.containsKey(boundVar)) continue; Term freshBoundVar = FreshOperations.fresh(boundVar.sort(), context); freshSubstitution.put(keyIndex, freshBoundVar); backBinding.put(keyIndex, keyIndex); for (Integer valueIndex : binderMap.get(keyIndex)) { backBinding.put(valueIndex, keyIndex); } } List<Term> termList = new ArrayList<>(); termList.addAll(kList.getContents()); for (int idx = 0; idx < termList.size(); idx++) { Map<Term, Term> newSubstitution = new HashMap<>(substitution); if (backBinding.containsKey(idx)) { for (Integer boundPosition : backBinding.get(idx)) { Term variable = kList.get(boundPosition); if (unboundedTerms.contains(variable)) { newSubstitution.put(variable, freshSubstitution.get(boundPosition)); } else if (substitution.containsKey(variable)) { newSubstitution.remove(variable); } } } Term bindingExp = termList.get(idx); Term resultBindingExp = userSubstitution(newSubstitution, bindingExp, context); termList.set(idx, resultBindingExp); } kList = new KList(ImmutableList.copyOf(termList)); kItem = new KItem(kLabel, kList, context); return new DoneTransforming(kItem); } } return super.transform(kItem); }
Source:
public static ObjectMapper createMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.setDateFormat(new ISO8601DateFormat()); mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); return mapper; }

Target:
public static ObjectMapper createMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.setDateFormat(new ISO8601DateFormat()); return mapper; }
Source:
private boolean CheckVcardSelector(String vcard, String vcardselectorop) { boolean selectedIn = true; for (PropertyMask bit : PropertyMask.values()) { if (checkbit(bit.pos, selector)) { Log.e(TAG, "checking for prop :" + bit.prop); if (vcardselectorop.equals("0")) { if (checkprop(vcard, bit.prop)) { Log.e(TAG, "bit.prop.equals current prop :" + bit.prop); selectedIn = true; break; } else { selectedIn = false; } } else if (vcardselectorop.equals("1")) { if (!checkprop(vcard, bit.prop)) { Log.e(TAG, "bit.prop.notequals current prop" + bit.prop); selectedIn = false; return selectedIn; } else { selectedIn = true; } } } } return selectedIn; }

Target:
private boolean CheckVcardSelector(String vcard, String vcardselectorop) { boolean selectedIn = true; for (PropertyMask bit : PropertyMask.values()) { if (checkbit(bit.pos, selector)) { Log.d(TAG, "checking for prop :" + bit.prop); if (vcardselectorop.equals("0")) { if (checkprop(vcard, bit.prop)) { Log.d(TAG, "bit.prop.equals current prop :" + bit.prop); selectedIn = true; break; } else { selectedIn = false; } } else if (vcardselectorop.equals("1")) { if (!checkprop(vcard, bit.prop)) { Log.d(TAG, "bit.prop.notequals current prop" + bit.prop); selectedIn = false; return selectedIn; } else { selectedIn = true; } } } } return selectedIn; }
Source:
public VMTemplateVO create(TemplateProfile profile) { VMTemplateVO template; if (profile.getTemplateType() == TemplateType.SYSTEM ){ profile.setAccountId(1L); template = persistTemplate(profile, State.Inactive); } else { template = persistTemplate(profile, State.Active); } if (template == null) { throw new CloudRuntimeException("Unable to persist the template " + profile.getTemplate()); } if (!profile.isDirectDownload()) { List<Long> zones = profile.getZoneIdList(); if (zones == null){ createTemplateWithinZone(null, profile, template); } else { for (Long zId : zones) { createTemplateWithinZone(zId, profile, template); } } } else { persistDirectDownloadTemplate(template.getId(), profile.getSize()); } _resourceLimitMgr.incrementResourceCount(profile.getAccountId(), ResourceType.template); return template; }

Target:
public VMTemplateVO create(TemplateProfile profile) { VMTemplateVO template; if (profile.getTemplateType() == TemplateType.SYSTEM ){ template = persistTemplate(profile, State.Inactive); } else { template = persistTemplate(profile, State.Active); } if (template == null) { throw new CloudRuntimeException("Unable to persist the template " + profile.getTemplate()); } if (!profile.isDirectDownload()) { List<Long> zones = profile.getZoneIdList(); if (zones == null){ createTemplateWithinZone(null, profile, template); } else { for (Long zId : zones) { createTemplateWithinZone(zId, profile, template); } } } else { persistDirectDownloadTemplate(template.getId(), profile.getSize()); } _resourceLimitMgr.incrementResourceCount(profile.getAccountId(), ResourceType.template); return template; }
Source:
private String getFileDownloadURL(final Supplier<Path> pathSupplier) { return GWT.getModuleBaseURL() + "defaulteditor/download?path=" + URIUtil.encodeQueryString(URIUtil.decode(pathSupplier.get().toURI())); }

Target:
private String getFileDownloadURL(final Supplier<Path> pathSupplier) { return GWT.getModuleBaseURL() + DEFAULT_EDITOR + URIUtil.encodeQueryString(URIUtil.decode(pathSupplier.get().toURI())); }
Source:
public byte[] marshal(Context context, ObjectOutputStream objectOutputStream, Object o) throws IOException { Document document = (Document) o; String updatedAttribute = document.getAttribute(Document.UPDATED_ATTRIBUTE); if ("true".equals(updatedAttribute)) { documentStorageService.saveDocument(document, document.getContent()); document.addAttribute(Document.UPDATED_ATTRIBUTE, "false"); } ByteArrayOutputStream buff = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(buff); oos.writeUTF(document.getIdentifier()); oos.writeUTF(document.getClass().getCanonicalName()); oos.writeUTF(document.getLink()); oos.close(); return buff.toByteArray(); }

Target:
public byte[] marshal(Context context, ObjectOutputStream objectOutputStream, Object o) throws IOException { Document document = (Document) o; String updatedAttribute = document.getAttribute(Document.UPDATED_ATTRIBUTE); if (Boolean.parseBoolean(updatedAttribute)) { documentStorageService.saveDocument(document, document.getContent()); document.addAttribute(Document.UPDATED_ATTRIBUTE, "false"); } ByteArrayOutputStream buff = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(buff); oos.writeUTF(document.getIdentifier()); oos.writeUTF(document.getClass().getCanonicalName()); oos.writeUTF(document.getLink()); oos.close(); return buff.toByteArray(); }
Source:
public void userCanBeKickedOutFromChat() { ChatPageObject chatUserOne = openChatForUser(userOne, userOnePassword); switchToWindow(1); new SpecialVersionPage().open(); ChatPageObject chatStaffUser = openChatForUser(userStaff, userStaffPassword); chatStaffUser.kickUserFromChat(userOne); switchToWindow(0); chatUserOne.verifyUserIsKickedFromChat(userOne); }

Target:
public void userCanBeKickedOutFromChat() { ChatPage chatUserOne = openChatForUser(userOne, userOnePassword); switchToWindow(1); new SpecialVersionPage().open(); ChatPage chatStaffUser = openChatForUser(userStaff, userStaffPassword); chatStaffUser.clickOnDifferentUser(userOne); chatStaffUser.clickOnUserOptionsKickButton(); switchToWindow(0); Assertion.assertTrue(chatUserOne.isUserKickedFromChat(), "USER IS NOT KICKED FROM CHAT"); }
Source:
private void readOffsets(TopicPartition topicPart) throws IOException { String topic = topicPart.topic(); int partition = topicPart.partition(); Path path = new Path(url + "/" + topicsDir + "/" + topic + "/" + partition); if (!fs.exists(path)) { return; } PathFilter filter = new CommittedFileFilter(); FileStatus[] committedFiles = fs.listStatus(path, filter); for (FileStatus committedFile : committedFiles) { String filename = committedFile.getPath().getName(); String[] parts = filename.split("_"); try { long endOffset = Long.parseLong(parts[1]); if (!offsets.containsKey(topicPart) || endOffset > offsets.get(topicPart)) { offsets.put(topicPart, endOffset + 1); } } catch (NumberFormatException e) { log.warn("Invalid committed file: {}", filename); } } }

Target:
private void readOffsets(TopicPartition topicPart) throws CopycatException { String path = FileUtils.directoryName(url, topicsDir, topicPart); PathFilter filter = new CommittedFileFilter(); try { if (!storage.exists(path)) { return; } FileStatus[] committedFiles = storage.listStatus(path, filter); for (FileStatus committedFile : committedFiles) { String filename = committedFile.getPath().getName(); String[] parts = filename.split("_"); try { long endOffset = Long.parseLong(parts[1]); if (!offsets.containsKey(topicPart) || endOffset > offsets.get(topicPart)) { offsets.put(topicPart, endOffset); } } catch (NumberFormatException e) { log.warn("Invalid committed file: {}", filename); } } } catch (IOException e) { throw new CopycatException(e); } }
Source:
public void requestTicketOfTypeStrings() { User user = persistUser(); TicketType type = ticketTypeRepository.findByName(TEST_TICKET).get(); TicketOption pickupOption = ticketOptionRepository.findByName(PICKUP_SERVICE_OPTION).get(); TicketOption chMemberOption = ticketOptionRepository.findByName(CH_MEMBER_OPTION).get(); List<TicketOption> options = Arrays.asList(pickupOption, chMemberOption); Set<TicketOption> optionSet = new HashSet<>(options); String typeString = TEST_TICKET; List<String> optionsString = Arrays.asList(CH_MEMBER_OPTION, PICKUP_SERVICE_OPTION); Ticket ticket = ticketService.requestTicketOfType(user, typeString, optionsString); assertEquals(user, ticket.getOwner()); assertEquals(optionSet, ticket.getEnabledOptions()); assertEquals(type, ticket.getType()); }

Target:
public void requestTicketOfTypeStrings() { User user = persistUser(); TicketType type = ticketTypeRepository.findByName(TEST_TICKET) .orElseThrow(() -> new TicketTypeNotFoundException(TEST_TICKET)); TicketOption pickupOption = ticketOptionRepository.findByName(PICKUP_SERVICE_OPTION) .orElseThrow(TicketOptionNotFoundException::new); TicketOption chMemberOption = ticketOptionRepository.findByName(CH_MEMBER_OPTION).orElseThrow(TicketOptionNotFoundException::new); List<String> optionsList = Arrays.asList(CH_MEMBER_OPTION, PICKUP_SERVICE_OPTION); Ticket ticket = ticketService.requestTicketOfType(user, TEST_TICKET, optionsList); assertEquals(user, ticket.getOwner()); assertThat(ticket.getEnabledOptions()).containsAll(Arrays.asList(pickupOption, chMemberOption)); assertEquals(type, ticket.getType()); }
Source:
public List<ThreadState> getThreads() { return config.sendThreads ? ThreadState.getLiveThreads(config) : null; }

Target:
protected List<ThreadState> getThreads() { return config.sendThreads ? ThreadState.getLiveThreads(config) : null; }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final int orientation = getResources().getConfiguration().orientation; MainActivity.info("NEWS: onCreateView. orientation: " + orientation); final LinearLayout rootView = (LinearLayout) inflater.inflate(R.layout.news, container, false); setupListView(rootView); final NewsDownloadHandler handler = new NewsDownloadHandler(rootView, numberFormat, getActivity().getPackageName(), getResources()); handler.setNewsListAdapter(listAdapter); final ApiDownloader task = new ApiDownloader(getActivity(), ListFragment.lameStatic.dbHelper, "news-cache.json", MainActivity.NEWS_URL, false, false, false, ApiDownloader.REQUEST_GET, new ApiListener() { @Override public void requestComplete(final JSONObject json, final boolean isCache) { handleNews(json, handler); } }); try { task.startDownload(this); } catch (WiGLEAuthException waex) return rootView; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final int orientation = getResources().getConfiguration().orientation; MainActivity.info("NEWS: onCreateView. orientation: " + orientation); final LinearLayout rootView = (LinearLayout) inflater.inflate(R.layout.news, container, false); setupListView(rootView); final NewsDownloadHandler handler = new NewsDownloadHandler(rootView, numberFormat, getActivity().getPackageName(), getResources()); handler.setNewsListAdapter(listAdapter); final ApiDownloader task = new ApiDownloader(getActivity(), ListFragment.lameStatic.dbHelper, "news-cache.json", MainActivity.NEWS_URL, false, false, false, ApiDownloader.REQUEST_GET, new ApiListener() { @Override public void requestComplete(final JSONObject json, final boolean isCache) { handleNews(json, handler); } }); try { task.startDownload(this); } catch (WiGLEAuthException waex) { MainActivity.warn("Authentication error on news load (should not happen)", waex); } return rootView; }
Source:
public static XPathReference getAbsRef(XPathReference ref, TreeReference parentRef) { TreeReference tref; if (!parentRef.isAbsolute()) { throw new RuntimeException("XFormParser.getAbsRef: parentRef must be absolute"); } if (ref != null) { tref = ref.getReference(); } else { tref = TreeReference.selfRef(); } tref = tref.parent(parentRef); if (tref == null) { throw new XFormParseException("Binding path [" + ref.getReference().toString(true) + "] not allowed with parent binding of [" + parentRef + "]"); } return new XPathReference(tref); }

Target:
public static XPathReference getAbsRef(XPathReference ref, TreeReference parentRef) { TreeReference tref; if (!parentRef.isAbsolute()) { throw new RuntimeException("XFormParser.getAbsRef: parentRef must be absolute"); } if (ref != null) { tref = ref.getReference(); } else { tref = TreeReference.selfRef(); } TreeReference refPreContextualization = tref; tref = tref.parent(parentRef); if (tref == null) { throw new XFormParseException("Binding path [" + refPreContextualization.toString(true) + "] not allowed with parent binding of [" + parentRef + "]"); } return new XPathReference(tref); }
Source:
private void loadLookupTable() throws Exception { _lookupTableWriteLock.lock(); try { List<SegmentDataManager> segmentManagers = acquireAllSegments(); if (segmentManagers.size() == 0) { _lookupTable.clear(); return; } List<File> indexDirs = new ArrayList<>(); for (SegmentDataManager segmentManager: segmentManagers) { IndexSegment indexSegment = segmentManager.getSegment(); System.out.println(indexSegment.getSegmentName()); indexDirs.add(indexSegment.getSegmentMetadata().getIndexDir()); } MultiplePinotSegmentRecordReader reader = new MultiplePinotSegmentRecordReader(indexDirs); _lookupTable.clear(); while (reader.hasNext()) { GenericRow row = reader.next(); _lookupTable.put(row.getPrimaryKey(_primaryKeyColumns), row); } } finally { _lookupTableWriteLock.unlock(); } }

Target:
private void loadLookupTable() throws Exception { _lookupTableWriteLock.lock(); try { _lookupTable.clear(); List<SegmentDataManager> segmentManagers = acquireAllSegments(); if (segmentManagers.size() == 0) { return; } try { for (SegmentDataManager segmentManager : segmentManagers) { IndexSegment indexSegment = segmentManager.getSegment(); try (PinotSegmentRecordReader reader = new PinotSegmentRecordReader( indexSegment.getSegmentMetadata().getIndexDir())) { while (reader.hasNext()) { GenericRow row = reader.next(); _lookupTable.put(row.getPrimaryKey(_primaryKeyColumns), row); } } } } finally { for (SegmentDataManager segmentManager : segmentManagers) { releaseSegment(segmentManager); } } } finally { _lookupTableWriteLock.unlock(); } }
Source:
public void writeEntityBody(BulkStatus entity, JsonGenerator jg) throws IOException { jg.writeStringField(BULK_ID, entity.getId()); jg.writeStringField(BULK_STATE, entity.getState().toString()); jg.writeStringField(BULK_CREATION, String.valueOf(entity.getCreationInstant().toString())); writeEntityField(BULK_COMMAND, entity.getCommand(), jg); if (entity.getCount() != null) { jg.writeNumberField(BULK_COUNT, entity.getCount().longValue()); } }

Target:
public void writeEntityBody(BulkStatus entity, JsonGenerator jg) throws IOException { jg.writeStringField(BULK_ID, entity.getId()); jg.writeStringField(BULK_STATE, entity.getState().toString()); jg.writeStringField(BULK_SUBMIT, entity.getSubmitTime().toString()); writeEntityField(BULK_COMMAND, entity.getCommand(), jg); if (entity.getCount() != null) { jg.writeNumberField(BULK_COUNT, entity.getCount().longValue()); } }
Source:
AbstractEslintSensor(JavaScriptChecks checks, EslintBridgeServer eslintBridgeServer, @Nullable AnalysisWarnings analysisWarnings) { this.checks = checks; this.rules = checks.eslintBasedChecks().stream() .map(check -> new EslintBridgeServer.Rule(check.eslintKey(), check.configurations())) .toArray(Rule[]::new); this.eslintBridgeServer = eslintBridgeServer; this.analysisWarnings = analysisWarnings; checks.all().stream() .filter(check -> check instanceof ParsingErrorCheck) .findFirst() .ifPresent(parsingErrorCheck -> parsingErrorRuleKey = checks.ruleKeyFor(parsingErrorCheck)); }

Target:
AbstractEslintSensor(JavaScriptChecks checks, EslintBridgeServer eslintBridgeServer, @Nullable AnalysisWarnings analysisWarnings) { this.checks = checks; this.rules = checks.eslintBasedChecks().stream() .map(check -> new EslintBridgeServer.Rule(check.eslintKey(), check.configurations())) .toArray(Rule[]::new); this.eslintBridgeServer = eslintBridgeServer; this.analysisWarnings = analysisWarnings; this.parsingErrorRuleKey = checks.all().stream() .filter(check -> check instanceof ParsingErrorCheck) .findFirst() .map(checks::ruleKeyFor).orElse(null); }
Source:
public ImageData createImageData(double width, double height) { context.createImageData(width, height); return null; }

Target:
public ImageData createImageData(double width, double height) { return nativeClassConverter.convert(context.createImageData(width, height), ImageData.class); }
Source:
public void rebuildRecentBoardsMenu() throws Exception { Enumeration<AbstractButton> btns = recentBoardsButtonGroup.getElements(); while (btns.hasMoreElements()) { AbstractButton x = btns.nextElement(); if (x.isSelected()) { return; } } btns = recentBoardsButtonGroup.getElements(); while (btns.hasMoreElements()) { AbstractButton x = btns.nextElement(); boardMenu.remove(x); } int index = 0; for (TargetBoard board : BaseNoGui.getRecentlyUsedBoards()) { JMenuItem item = createBoardMenusAndCustomMenus(boardsCustomMenus, menuItemsToClickAfterStartup, buttonGroupsMap, board, board.getContainerPlatform(), board.getContainerPlatform().getContainerPackage()); boardMenu.insert(item, 3); item.setAccelerator(KeyStroke.getKeyStroke('0' + index, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | ActionEvent.SHIFT_MASK)); recentBoardsButtonGroup.add(item); boardsButtonGroup.add(item); index ++; } boardMenuScroller.setTopFixedCount(3 + index); }

Target:
public void rebuildRecentBoardsMenu() throws Exception { Enumeration<AbstractButton> btns = recentBoardsButtonGroup.getElements(); while (btns.hasMoreElements()) { AbstractButton x = btns.nextElement(); if (x.isSelected()) { return; } } btns = recentBoardsButtonGroup.getElements(); while (btns.hasMoreElements()) { AbstractButton x = btns.nextElement(); boardMenu.remove(x); } int index = 0; for (TargetBoard board : BaseNoGui.getRecentlyUsedBoards()) { JMenuItem item = createBoardMenusAndCustomMenus(boardsCustomMenus, menuItemsToClickAfterStartup, buttonGroupsMap, board, board.getContainerPlatform(), board.getContainerPlatform().getContainerPackage()); boardMenu.insert(item, 3); item.setAccelerator(KeyStroke.getKeyStroke('1' + index, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | ActionEvent.SHIFT_MASK)); recentBoardsButtonGroup.add(item); boardsButtonGroup.add(item); index ++; } boardMenuScroller.setTopFixedCount(3 + index); }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args.containsKey("filter")) { filters.put(args.getString("filter"), true); } }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args.containsKey(EXTRA_FILTER)) { filters.put(args.getString(EXTRA_FILTER), true); } }
Source:
public void cancel(Account account, OCFile file) { UploadFileOperation upload = null; synchronized (mPendingUploads) { upload = mPendingUploads.remove(buildRemoteName(account, file)); } if (upload != null) { mCurrentUpload.cancel(); } }

Target:
public void cancel(Account account, OCFile file) { UploadFileOperation upload = null; synchronized (mPendingUploads) { upload = mPendingUploads.remove(buildRemoteName(account, file)); } if (upload != null) { upload.cancel(); } }
Source:
private void persistDiffPreferences() { AccountDiffPreference diffPref = new AccountDiffPreference(); diffPref.setIgnoreWhitespace(getIgnoreWhitespace().getCode()); diffPref.setTabSize(tabWidth.getIntValue()); diffPref.setLineLength(colWidth.getIntValue()); diffPref.setSyntaxHighlighting(syntaxHighlighting.getValue()); diffPref.setShowWhitespaceErrors(whitespaceErrors.getValue()); diffPref.setIntralineDifference(intralineDifference.getValue()); diffPref.setShowTabs(showTabs.getValue()); Util.ACCOUNT_SVC.changeDiffPreferences(diffPref, new GerritCallback<VoidResult>() { @Override public void onSuccess(VoidResult result) { } }); }

Target:
private void persistDiffPreferences() { AccountDiffPreference diffPref = new AccountDiffPreference(Gerrit.getUserAccount().getId()); diffPref.setIgnoreWhitespace(getIgnoreWhitespace()); diffPref.setTabSize(tabWidth.getIntValue()); diffPref.setLineLength(colWidth.getIntValue()); diffPref.setSyntaxHighlighting(syntaxHighlighting.getValue()); diffPref.setShowWhitespaceErrors(whitespaceErrors.getValue()); diffPref.setIntralineDifference(intralineDifference.getValue()); diffPref.setShowTabs(showTabs.getValue()); Util.ACCOUNT_SVC.changeDiffPreferences(diffPref, new GerritCallback<VoidResult>() { @Override public void onSuccess(VoidResult result) { } }); Gerrit.setAccountDiffPreference(diffPref); }
Source:
private Integer generateHashCode(AndroidViewComponent component, PercentStorageRecord.Dim dim) { if (dim == PercentStorageRecord.Dim.HEIGHT) { return (component.hashCode() + dim.hashCode()) * 2 + 1; } else { return (component.hashCode() + dim.hashCode()) * 2; } }

Target:
private Integer generateHashCode(AndroidViewComponent component, PercentStorageRecord.Dim dim) { if (dim == PercentStorageRecord.Dim.HEIGHT) { return component.hashCode() * 2 + 1; } else { return component.hashCode() * 2; } }
Source:
public void hashValues(FloatColumnSelector dimSelector, HyperLogLogCollector collector) { collector.add(CardinalityAggregator.hashFn.hashUnencodedChars(String.valueOf(dimSelector.get())).asBytes()); }

Target:
public void hashValues(FloatColumnSelector dimSelector, HyperLogLogCollector collector) { collector.add(CardinalityAggregator.hashFn.hashInt(Float.floatToIntBits(dimSelector.get())).asBytes()); }