auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean acquireParts() { if (!customJob) { checkForArmorSupplies(); return kitFound && !partsInTransit() && (null == newArmorSupplies || (armorNeeded - newArmorSupplies.getAmount()) <= 0); } ArrayList<Part> newShoppingList = new ArrayList<>(); for (Part part : shoppingList) { if (part instanceof AmmoStorage) { continue; } if (part instanceof IAcquisitionWork) { Part replacement = part; if (part instanceof MissingPart) { replacement = ((MissingPart) part).findReplacement(true); } if (null != replacement) { if (replacement.getQuantity() > 1) { Part actualReplacement = replacement.clone(); actualReplacement.setRefitId(oldUnit.getId()); oldUnit.getCampaign().addPart(actualReplacement, 0); newUnitParts.add(actualReplacement); replacement.decrementQuantity(); } else { replacement.setRefitId(oldUnit.getId()); newUnitParts.add(replacement); } } else { newShoppingList.add(part); } } } checkForArmorSupplies(); shoppingList = newShoppingList; if (partsInTransit()) { return false; } return shoppingList.size() == 0 <START> && (null == newArmorSupplies || (armorNeeded - newArmorSupplies.getAmount()) <= 0); <END> }</code><technical_language>suggestion && ((null == newArmorSupplies) || (armorNeeded - newArmorSupplies.getAmount()) <= 0);</technical_language>

Target:
public boolean acquireParts() { if (!customJob) { checkForArmorSupplies(); return kitFound && !partsInTransit() && (null == newArmorSupplies || (armorNeeded - newArmorSupplies.getAmount()) <= 0); } ArrayList<Part> newShoppingList = new ArrayList<>(); for (Part part : shoppingList) { if (part instanceof AmmoStorage) { continue; } if (part instanceof IAcquisitionWork) { Part replacement = part; if (part instanceof MissingPart) { replacement = ((MissingPart) part).findReplacement(true); } if (null != replacement) { if (replacement.getQuantity() > 1) { Part actualReplacement = replacement.clone(); actualReplacement.setRefitId(oldUnit.getId()); oldUnit.getCampaign().addPart(actualReplacement, 0); newUnitParts.add(actualReplacement); replacement.decrementQuantity(); } else { replacement.setRefitId(oldUnit.getId()); newUnitParts.add(replacement); } } else { newShoppingList.add(part); } } } checkForArmorSupplies(); shoppingList = newShoppingList; if (partsInTransit()) { return false; } return shoppingList.size() == 0 && ((null == newArmorSupplies) || (armorNeeded - newArmorSupplies.getAmount()) <= 0); }
Source:
<code>public void testInvalidCharacterOption() { thrown.expect(ValidationException.class); <START> thrown.expect(containsCause(new ValidationException("Option [csv.quote-character] must be a Character."))); <END> final Map<String, String> options = getModifiedOptions(opts -> opts.put("csv.quote-character", "abc")); createTableSink(options); }</code><technical_language>suggestion thrown.expect(containsCause(new ValidationException("Option 'csv.quote-character' a Character.")));</technical_language>

Target:
public void testInvalidCharacterOption() { thrown.expect(ValidationException.class); thrown.expect(containsCause(new ValidationException("Option 'csv.quote-character' must be " + "a string with single character, but was: abc"))); final Map<String, String> options = getModifiedOptions(opts -> opts.put("csv.quote-character", "abc")); createTableSink(options); }
Source:
<code>public ExecutorManager(Props props, ExecutorLoader loader, Map<String, Alerter> alters) throws ExecutorManagerException { <START> alerters = alters; <END> azkProps = props; this.executorLoader = loader; this.setupExecutors(); this.loadRunningFlows(); queuedFlows = new QueuedExecutions(props.getLong(AZKABAN_WEBSERVER_QUEUE_SIZE, 100000)); this.loadQueuedFlows(); cacheDir = new File(props.getString("cache.directory", "cache")); executingManager = new ExecutingManagerUpdaterThread(); executingManager.start(); if(isMultiExecutorMode()) { setupMultiExecutorMode(); } long executionLogsRetentionMs = props.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); cleanerThread = new CleanerThread(executionLogsRetentionMs); cleanerThread.start(); }</code><technical_language>covered in #500</technical_language>

Target:
public ExecutorManager(Props props, ExecutorLoader loader, Map<String, Alerter> alters) throws ExecutorManagerException { azkProps = props; this.executorLoader = loader; this.setupExecutors(); this.loadRunningFlows(); queuedFlows = new QueuedExecutions(props.getLong(AZKABAN_WEBSERVER_QUEUE_SIZE, 100000)); this.loadQueuedFlows(); alerters = alters; cacheDir = new File(props.getString("cache.directory", "cache")); executingManager = new ExecutingManagerUpdaterThread(); executingManager.start(); if(isMultiExecutorMode()) { setupMultiExecutorMode(); } long executionLogsRetentionMs = props.getLong("execution.logs.retention.ms", DEFAULT_EXECUTION_LOGS_RETENTION_MS); cleanerThread = new CleanerThread(executionLogsRetentionMs); cleanerThread.start(); }
Source:
<code>public boolean isTouchExplorationEnabled () { <START> return false; <END> }</code><technical_language>shadow store this in variables provide setters for them, returning false? for values actually... provide setters for them</technical_language>

Target:
public boolean isTouchExplorationEnabled () { return touchExplorationEnabled; }
Source:
<code>public String getKeywordsAsString(){ if(keywords == null){ List<String> list = PaletteInsertManager.getInstance().getKeyWords(xobject.getPath()); keywords = ""; if(list != null){ for(String word : list){ <START> keywords += word + " "; <END> } }else{ keywords = getLabel(); } } return keywords; }</code><technical_language>StringBuilder instead</technical_language>

Target:
public String getKeywordsAsString(){ if(keywords == null){ List<String> list = PaletteInsertManager.getInstance().getKeyWords(xobject.getPath()); if(list != null){ StringBuilder buffer = new StringBuilder(); for(String word : list){ buffer.append(word + " "); } keywords = buffer.toString(); }else{ keywords = getLabel(); } } return keywords; }
Source:
<code>public void uninstallFeature(String feature) { LOGGER.trace("Uninstalling feature {}", feature); <START> <END> try { syncInstaller.uninstallFeatures(feature); } catch (VirtualMachineError e) { throw e; } catch (Throwable e) { handleUninstallFeatureException(feature, e); } }</code><technical_language>ProfileInstallCommand updated syncInstaller is for automated installs. more important here</technical_language>

Target:
public void uninstallFeature(String feature) { LOGGER.trace("Uninstalling feature {}", feature); try { AccessController.doPrivileged( (PrivilegedExceptionAction<Void>) () -> { syncInstaller.uninstallFeatures( EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles), feature); return null; }); } catch (VirtualMachineError e) { throw e; } catch (PrivilegedActionException e) { handleUninstallFeatureException(feature, e.getException()); } catch (Throwable e) { handleUninstallFeatureException(feature, e); } }
Source:
<code>public FloatColumnSelector makeFloatColumnSelector(String columnName) { <START> return floatColumnSelectorMap.computeIfAbsent(columnName, delegate::makeFloatColumnSelector); <END> }</code><technical_language>computeIfAbsent() majority of calls if expected find entry is present slower. I meant is code this: java FloatColumnSelector existing = floatColumnSelectorMap.get(columnName); if (existing != null) { return existing; } else { floatColumnSelectorMap.computeIfAbsent(columnName, delegate::makeFloatColumnSelector); }</technical_language>

Target:
public FloatColumnSelector makeFloatColumnSelector(String columnName) { final FloatColumnSelector existing = floatColumnSelectorMap.get(columnName); if (existing != null) { return existing; } return floatColumnSelectorMap.computeIfAbsent(columnName, delegate::makeFloatColumnSelector); }
Source:
<code>private boolean scopeUpdatePermitted(final AnalysisJobBuilder sourceAnalysisJobBuilder, final ComponentBuilder componentBuilder) { if (sourceAnalysisJobBuilder != componentBuilder.getAnalysisJobBuilder()) { if (componentBuilder.getInput().length > 0 || componentBuilder.getComponentRequirement() != null) { final String scopeText; if(sourceAnalysisJobBuilder.isRootJobBuilder()){ scopeText = " into the default scope"; } else { scopeText = " into the scope " + sourceAnalysisJobBuilder.getDatastore().getName(); } final int response = JOptionPane.showConfirmDialog(_graphContext.getVisualizationViewer(), <START> "This will move " + componentBuilder.getDescriptor().getDisplayName() + scopeText <END> + ", thereby losing its configured columns and/or requirements", "Change scope?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(response == JOptionPane.CANCEL_OPTION){ _graphContext.getJobGraph().refresh(); return false; } } } return true; }</code><technical_language>Instead of .getDisplayName() LabelUtils.getLabel(componentBuilder). respect if user done renaming etc</technical_language>

Target:
private boolean scopeUpdatePermitted(final AnalysisJobBuilder sourceAnalysisJobBuilder, final ComponentBuilder componentBuilder) { if (sourceAnalysisJobBuilder != componentBuilder.getAnalysisJobBuilder()) { if (componentBuilder.getInput().length > 0 || componentBuilder.getComponentRequirement() != null) { final String scopeText; scopeText = LabelUtils.getScopeLabel(sourceAnalysisJobBuilder); final int response = JOptionPane.showConfirmDialog(_graphContext.getVisualizationViewer(), "This will move " + LabelUtils.getLabel(componentBuilder) + " into the " + scopeText + ", thereby losing its configured columns and/or requirements", "Change scope?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if(response == JOptionPane.CANCEL_OPTION){ _graphContext.getJobGraph().refresh(); return false; } } } return true; }
Source:
<code>private static int calculateCommentCount(List<Comment> comments, String currentUser, UpdatedKind updatedKind) { int result = 0; if (updatedKind == UpdatedKind.OTHER_UPDATED) { return (int) (comments.stream().filter(c -> !isCommentBySelf(currentUser, c)).count()); } else if (updatedKind == UpdatedKind.SELF_UPDATED){ <START> return (int) (comments.stream().filter(c -> isCommentBySelf(currentUser, c)).count()); <END> } return result; }</code><technical_language>Utility.safeLongToInt instead</technical_language>

Target:
private static int calculateCommentCount(List<Comment> comments, String currentUser, UpdatedKind updatedKind) { int result = 0; if (updatedKind == UpdatedKind.UPDATED_BY_OTHER) { return Utility.safeLongToInt((comments.stream().filter(c -> !isCommentBySelf(currentUser, c)).count())); } else if (updatedKind == UpdatedKind.UPDATED_BY_SELF){ return Utility.safeLongToInt((comments.stream().filter(c -> isCommentBySelf(currentUser, c)).count())); } return result; }
Source:
<code>protected IStatus run(IProgressMonitor monitor) { if (!doReschedule) { return Status.OK_STATUS; <START> } <END> RepositoryCache repositoryCache = org.eclipse.egit.core.Activator .getDefault().getRepositoryCache(); if (repositoryCache == null) { return Status.OK_STATUS; } if (getDefault().getPreferenceStore() .getBoolean(UIPreferences.REFESH_ONLY_WHEN_ACTIVE)) { if (!isActive()) { monitor.done(); return Status.OK_STATUS; } } Repository[] repos = repositoryCache.getAllRepositories(); if (repos.length == 0) { return Status.OK_STATUS; } monitor.beginTask(UIText.Activator_scanningRepositories, repos.length); try { for (Repository repo : repos) { if (monitor.isCanceled()) { break; } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), "Scanning " + repo + " for changes"); } repo.scanForRepoChanges(); monitor.worked(1); } } catch (IOException e) { if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), "Stopped rescheduling " + getName() + "job"); } return createErrorStatus(UIText.Activator_scanError, e); } finally { monitor.done(); } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Rescheduling " + getName() + " job"); } if (doReschedule) { schedule(interval); } return Status.OK_STATUS; }</code><technical_language>removed if shouldRun is overridden</technical_language>

Target:
protected IStatus run(IProgressMonitor monitor) { if (getDefault().getPreferenceStore() .getBoolean(UIPreferences.REFESH_ONLY_WHEN_ACTIVE)) { if (!isActive()) { monitor.done(); return Status.OK_STATUS; } } Repository[] repos = repositoryCache.getAllRepositories(); if (repos.length == 0) { return Status.OK_STATUS; } monitor.beginTask(UIText.Activator_scanningRepositories, repos.length); try { for (Repository repo : repos) { if (monitor.isCanceled()) { break; } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), "Scanning " + repo + " for changes"); } repo.scanForRepoChanges(); monitor.worked(1); } } catch (IOException e) { if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER .getLocation(), "Stopped rescheduling " + getName() + "job"); } return createErrorStatus(UIText.Activator_scanError, e); } finally { monitor.done(); } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Rescheduling " + getName() + " job"); } schedule(interval); return Status.OK_STATUS; }
Source:
<code>private GlusterVolumeEntity insertTestVolume() { Guid volumeId = Guid.newGuid(); GlusterVolumeEntity volume = new GlusterVolumeEntity(); volume.setName(NEW_VOL_NAME); volume.setClusterId(CLUSTER_ID); volume.setId(volumeId); volume.setVolumeType(GlusterVolumeType.DISTRIBUTE); volume.addTransportType(TransportType.TCP); volume.setReplicaCount(0); volume.setStripeCount(0); volume.setStatus(GlusterStatus.UP); volume.setOption("auth.allow", "*"); volume.addAccessProtocol(AccessProtocol.GLUSTER); volume.addAccessProtocol(AccessProtocol.NFS); GlusterBrickEntity brick = new GlusterBrickEntity(); brick.setVolumeId(volumeId); brick.setServerId(server.getId()); brick.setServerName(server.getHostName()); brick.setBrickDirectory("/export/testVol1"); brick.setStatus(GlusterStatus.UP); brick.setBrickOrder(0); volume.addBrick(brick); volume.setSnapshotsCount(0); volume.setSnapMaxLimit(0); <START> volume.setSnapshotScheduled(false); <END> dao.save(volume); return volume; }</code><technical_language>Is this required if default is set</technical_language>

Target:
private GlusterVolumeEntity insertTestVolume() { Guid volumeId = Guid.newGuid(); GlusterVolumeEntity volume = new GlusterVolumeEntity(); volume.setName(NEW_VOL_NAME); volume.setClusterId(CLUSTER_ID); volume.setId(volumeId); volume.setVolumeType(GlusterVolumeType.DISTRIBUTE); volume.addTransportType(TransportType.TCP); volume.setReplicaCount(0); volume.setStripeCount(0); volume.setStatus(GlusterStatus.UP); volume.setOption("auth.allow", "*"); volume.addAccessProtocol(AccessProtocol.GLUSTER); volume.addAccessProtocol(AccessProtocol.NFS); GlusterBrickEntity brick = new GlusterBrickEntity(); brick.setVolumeId(volumeId); brick.setServerId(server.getId()); brick.setServerName(server.getHostName()); brick.setBrickDirectory("/export/testVol1"); brick.setStatus(GlusterStatus.UP); brick.setBrickOrder(0); volume.addBrick(brick); volume.setSnapshotsCount(0); volume.setSnapMaxLimit(0); dao.save(volume); return volume; }
Source:
<code>public String toString() { <START> return "YRange[lower=" + lower + ", upper=" + upper + "]"; END> }</code><technical_language>own, this class is restricted a "YRange". I put "AxisRange". I "lower=" "upper=" implied. output "AxisRange[10.0, 20.0]"</technical_language>

Target:
public String toString() { return String.format("AxisRange[%d, %d]", lower, upper); }
Source:
<code>public MetaParam<?> next() { try { <START> return metas[i++]; <END> } catch (ArrayIndexOutOfBoundsException e) { throw new NoSuchElementException(); } }</code><technical_language>call it.next().next() hasNext() in between, skipNulls() call here</technical_language>

Target:
public MetaParam<?> next() { if (i >= metas.length) { throw new NoSuchElementException(); } MetaParam<?> meta = metas[i++]; skipNulls(); return meta; }
Source:
<code>public void update() { if (world.isRemote) { builder.tick(); pattern.canInteract = !isLocked(); return; } sendNetworkUpdate(NET_RENDER_DATA); lockedTicks--; if (lockedTicks < 0) { lockedTicks = 0; } IFillerPattern p = pattern.get(); if (hasBox() && p != null && patternTemplate == null) { IStatementParameter[] params = new IStatementParameter[pattern.maxParams]; for (int i = 0; i < params.length; i++) { params[i] = pattern.get(i); } patternTemplate = p.createTemplate(this, params); if (patternTemplate == null) { blueprintTemplate = null; buildingInfo = null; } else { blueprintTemplate = new Template(); blueprintTemplate.size = patternTemplate.size; blueprintTemplate.offset = BlockPos.ORIGIN; int sx = patternTemplate.sizeX; int sy = patternTemplate.sizeY; int sz = patternTemplate.sizeZ; blueprintTemplate.data = new BitSet(); <START> for (int x = 0; x < sx; x++) { <END> for (int y = 0; y < sy; y++) { for (int z = 0; z < sz; z++) { blueprintTemplate.data.set(blueprintTemplate.posToIndex(x, y, z), patternTemplate.get(x, y, z) ^ invertPattern); } } } buildingInfo = blueprintTemplate.new BuildingInfo(box.min(), Rotation.NONE); builder.updateSnapshot(); } } if (mode == Mode.OFF || (mode == Mode.ON && finished)) { return; } if (buildingInfo != null) { finished = builder.tick(); } }</code><technical_language>remove SnapshotBuilder#validate SnapshotBuilder#invalidate calls</technical_language>

Target:
public void update() { if (world.isRemote) { builder.tick(); patternStatement.canInteract = !isLocked(); return; } sendNetworkUpdate(NET_RENDER_DATA); lockedTicks--; if (lockedTicks < 0) { lockedTicks = 0; } IFillerPattern p = patternStatement.get(); if (hasBox() && p != null && patternTemplate == null) { IStatementParameter[] params = new IStatementParameter[patternStatement.maxParams]; for (int i = 0; i < params.length; i++) { params[i] = patternStatement.get(i); } patternTemplate = p.createTemplate(this, params); if (patternTemplate == null) { blueprintTemplate = null; buildingInfo = null; } else { blueprintTemplate = new Template(); blueprintTemplate.size = patternTemplate.size; blueprintTemplate.offset = BlockPos.ORIGIN; blueprintTemplate.data = patternTemplate; if (invertPattern) { blueprintTemplate.data.invert(); } buildingInfo = blueprintTemplate.new BuildingInfo(patternTemplate.min, Rotation.NONE); builder.updateSnapshot(); } } if (mode == Mode.OFF || (mode == Mode.ON && finished)) { return; } if (buildingInfo != null) { finished = builder.tick(); } }
Source:
<code>public void emptyLoginTest() { final HomePage homePage = new HomePage(driver); homePage.clickSubmitButton(); <START> loggingAssert.assertTrue(homePage.getElementText(HomePageLocators.LOGIN_ERROR_MESSAGE.getBy()) <END> .contains(errorMessage), "Error message display assert"); }</code><technical_language>call in getElementText method,</technical_language>

Target:
public void emptyLoginTest() { final HomePage homePage = new HomePage(driver); homePage.clickSubmitButton(); loggingAssert.assertTrue(homePage.isElementDisplayed(HomePageLocators.LOGIN_ERROR_MESSAGE), "Error message displayed"); }
Source:
<code>public <K1, V1> KStream<K1, V1> flatTransform(final TransformerSupplier<? super K, ? super V, Iterable<KeyValue<K1, V1>>> transformerSupplier, final Named named, final String... stateStoreNames) { Objects.requireNonNull(transformerSupplier, "transformerSupplier can't be null"); Objects.requireNonNull(named, "named can't be null"); Objects.requireNonNull(stateStoreNames, "stateStoreNames can't be a null array"); for (final String stateStoreName : stateStoreNames) { <START> Objects.requireNonNull(stateStoreName, "stateStoreNames can't be null"); <END> } final String name = new NamedInternal(named).name(); final StatefulProcessorNode<? super K, ? super V> transformNode = new StatefulProcessorNode<>( name, new ProcessorParameters<>(new KStreamFlatTransform<>(transformerSupplier), name), stateStoreNames); transformNode.keyChangingOperation(true); builder.addGraphNode(streamsGraphNode, transformNode); return new KStreamImpl<>( name, null, null, sourceNodes, true, transformNode, builder); }</code><technical_language>prop: change stateStoreNames -> stateStoreName here</technical_language>

Target:
public <K1, V1> KStream<K1, V1> flatTransform(final TransformerSupplier<? super K, ? super V, Iterable<KeyValue<K1, V1>>> transformerSupplier, final Named named, final String... stateStoreNames) { Objects.requireNonNull(transformerSupplier, "transformerSupplier can't be null"); Objects.requireNonNull(named, "named can't be null"); Objects.requireNonNull(stateStoreNames, "stateStoreNames can't be a null array"); for (final String stateStoreName : stateStoreNames) { Objects.requireNonNull(stateStoreName, "stateStoreNames can't contain `null` as store name"); } final String name = new NamedInternal(named).name(); final StatefulProcessorNode<? super K, ? super V> transformNode = new StatefulProcessorNode<>( name, new ProcessorParameters<>(new KStreamFlatTransform<>(transformerSupplier), name), stateStoreNames); transformNode.keyChangingOperation(true); builder.addGraphNode(streamsGraphNode, transformNode); return new KStreamImpl<>( name, null, null, sourceNodes, true, transformNode, builder); }
Source:
<code>public @NonNull String getPagingDescription() { if (mActivity == null) return ""; if (!getShouldPageComments()) { <START> return mActivity.getString(R.string.none); <END> } int count = getPagingCount(); if (count == 0) return mActivity.getString(R.string.none); return mActivity.getResources().getQuantityString(R.plurals.site_settings_paging_summary, count, count); }</code><technical_language>display "disabled" instead of "none"? cc @tonyr59h</technical_language>

Target:
public @NonNull String getPagingDescription() { if (mActivity == null) return ""; if (!getShouldPageComments()) { return mActivity.getString(R.string.disabled); } int count = getPagingCount(); if (count == 0) return mActivity.getString(R.string.disabled); return mActivity.getResources().getQuantityString(R.plurals.site_settings_paging_summary, count, count); }
Source:
<code>public void shouldThrowExceptionIfMaxInFlightRequestsGreaterThanFiveIfEosEnabled() { props.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, EXACTLY_ONCE); <START> props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, 3); <END> final StreamsConfig streamsConfig = new StreamsConfig(props); try { streamsConfig.getProducerConfigs(clientId); fail("Should throw ConfigException when ESO is enabled and maxInFlight requests exceeds 5"); } catch (final ConfigException e) { assertEquals("Invalid value 7 for configuration max.in.flight.requests.per.connection: Can't exceed 5 when exactly-once processing is enabled", e.getMessage()); } }</code><technical_language>Hey @mjsax . Sorry, I follow this change. this test pass expects 7, 3</technical_language>

Target:
public void shouldThrowExceptionIfMaxInFlightRequestsGreaterThanFiveIfEosEnabled() { props.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, EXACTLY_ONCE); props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, 7); final StreamsConfig streamsConfig = new StreamsConfig(props); try { streamsConfig.getProducerConfigs(clientId); fail("Should throw ConfigException when ESO is enabled and maxInFlight requests exceeds 5"); } catch (final ConfigException e) { assertEquals("Invalid value 7 for configuration max.in.flight.requests.per.connection: Can't exceed 5 when exactly-once processing is enabled", e.getMessage()); } }
Source:
<code>public Collection<String> getImports() { return <START> Collections.<String> <END> unmodifiableCollection(this.imports); }</code><technical_language>ImmutableList.copyOf() creates independant copy, Collections.unmodifiableCollection() returns a wrapper a collection modified later</technical_language>

Target:
public Collection<String> getImports() { return ImmutableList.copyOf(this.imports); }
Source:
<code>public MccMncRecord networkRecordForMccMnc(final String mcc, final String mnc) throws SQLException { Cursor cursor = null; <START> if (android.os.Build.VERSION.SDK_INT == 19) { <END> return null; } if (!isPresent()) { return null; } try { if (openDataBase()) { cursor = db.rawQuery(RECORD_FOR_MCC_MNC, new String[]{mcc, mnc}); if (cursor.getCount() > 0) { cursor.moveToFirst(); MccMncRecord operator = new MccMncRecord( cursor.getString(cursor.getColumnIndex("type")), cursor.getString(cursor.getColumnIndex("countryName")), cursor.getString(cursor.getColumnIndex("countryCode")), cursor.getString(cursor.getColumnIndex("mcc")), cursor.getString(cursor.getColumnIndex("mnc")), cursor.getString(cursor.getColumnIndex("brand")), cursor.getString(cursor.getColumnIndex("operator")), cursor.getString(cursor.getColumnIndex("status")), cursor.getString(cursor.getColumnIndex("bands")), cursor.getString(cursor.getColumnIndex("notes"))); return operator; } } else { MainActivity.error("unable to open mcc/mnc database for record."); } } catch (StackOverflowError soe) { MainActivity.error("Database corruption stack overflow: ", soe); throw new SQLiteDatabaseCorruptException("Samsung-specific stack overflow on integrity check."); }finally { if (null != cursor) { cursor.close(); } if ((null != db) && (db.isOpen())) { db.close(); } } return null; }</code><technical_language><= 19</technical_language>

Target:
public MccMncRecord networkRecordForMccMnc(final String mcc, final String mnc) throws SQLException { Cursor cursor = null; if (android.os.Build.VERSION.SDK_INT <= 19) { return null; } if (!isPresent()) { return null; } try { if (openDataBase()) { cursor = db.rawQuery(RECORD_FOR_MCC_MNC, new String[]{mcc, mnc}); if (cursor.getCount() > 0) { cursor.moveToFirst(); MccMncRecord operator = new MccMncRecord( cursor.getString(cursor.getColumnIndex("type")), cursor.getString(cursor.getColumnIndex("countryName")), cursor.getString(cursor.getColumnIndex("countryCode")), cursor.getString(cursor.getColumnIndex("mcc")), cursor.getString(cursor.getColumnIndex("mnc")), cursor.getString(cursor.getColumnIndex("brand")), cursor.getString(cursor.getColumnIndex("operator")), cursor.getString(cursor.getColumnIndex("status")), cursor.getString(cursor.getColumnIndex("bands")), cursor.getString(cursor.getColumnIndex("notes"))); return operator; } } else { MainActivity.error("unable to open mcc/mnc database for record."); } } catch (StackOverflowError soe) { MainActivity.error("Database corruption stack overflow: ", soe); throw new SQLiteDatabaseCorruptException("Samsung-specific stack overflow on integrity check."); }finally { if (null != cursor) { cursor.close(); } if ((null != db) && (db.isOpen())) { db.close(); } } return null; }
Source:
<code>protected static String getMessageOrNull(AuditLogType logType) { final String key = logType.name(); try { return resourceBundle.getString(key); } catch (Exception e) { <START> log.error("Key '" + key + "' is not translated in '"+getResourceBundleName()+"'"); <END> return null; } }</code><technical_language>I prefer if String.format here. Also, hyou thought of log.debug stacktrace</technical_language>

Target:
protected static String getMessageOrNull(AuditLogType logType) { final String key = logType.name(); try { return resourceBundle.getString(key); } catch (Exception e) { log.error(String.format("Key '%1$s' is not translated in '%2$s'", key, getResourceBundleName())); log.debug("", e); return null; } }
Source:
<code>public ListenableFuture<Optional<LabelMeta>> getMeta(final LabelId id, final LabelType type) { final ListenableFuture<Optional<Row>> metas = getOptionalMeta(id, type); return transform(metas, new Function<Optional<Row>, Optional<LabelMeta>>() { @Nullable @Override public Optional<LabelMeta> apply(final Optional<Row> result) { if (!result.isPresent()) { return Optional.absent(); } final Row row = result.get(); return Optional.of( <START> LabelMeta.create(id, type, row.getString("name"), row.getString("meta"), 0)); <END> } }); }</code><technical_language>information stored in row for parameters? slightly more safe in case is a big CQL statement? creation time set creation time 0</technical_language>

Target:
public ListenableFuture<Optional<LabelMeta>> getMeta(final LabelId id, final LabelType type) { final ListenableFuture<Optional<Row>> metas = getOptionalMeta(id, type); return transform(metas, new Function<Optional<Row>, Optional<LabelMeta>>() { @Nullable @Override public Optional<LabelMeta> apply(final Optional<Row> result) { if (!result.isPresent()) { return Optional.absent(); } final Row row = result.get(); return Optional.of( LabelMeta.create(CassandraLabelId.fromLong(row.getLong("label_id")), LabelType.fromValue(row.getString("type")), row.getString("name"), row.getString("meta_description"), row.getDate("creation_time").getTime())); } }); }
Source:
<code>public void onClick(View v) { if (mListener.getMultiSelectHandler() != null && mListener.getMultiSelectHandler().isEnabled()) { mListener.getMultiSelectHandler().toggle(mItem); <START> onBindBoxItemViewHolder(this, null); <END> return; } if (mItem == null) { return; } if (mListener != null) { mListener.getOnItemClickListener().onItemClick(mItem); } }</code><technical_language>mItem</technical_language>

Target:
public void onClick(View v) { if (mListener.getMultiSelectHandler() != null && mListener.getMultiSelectHandler().isEnabled()) { mListener.getMultiSelectHandler().toggle(mItem); onBindBoxItemViewHolder(this, mItem); return; } if (mItem == null) { return; } if (mListener != null) { mListener.getOnItemClickListener().onItemClick(mItem); } }
Source:
<code><START> private void deleteDraftIdentifier(DvObject dvObject) throws IOException { <END> String baseUrl = System.getProperty("doi.baseurlstringnext"); String username = System.getProperty("doi.username"); String password = System.getProperty("doi.password"); GlobalId doi = dvObject.getGlobalId(); URL url = new URL(baseUrl + "/dois/" + doi.getAuthority() + "/" + doi.getIdentifier()); HttpURLConnection connection = null; connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("DELETE"); String userpass = username + ":" + password; String basicAuth = "Basic " + new String(Base64.getEncoder().encode(userpass.getBytes())); connection.setRequestProperty("Authorization", basicAuth); int status = connection.getResponseCode(); if(status!=HttpStatus.SC_NO_CONTENT) { throw new IOException(BundleUtil.getStringFromBundle("pids.deletePid.failureExpected", Arrays.asList(doi.asString(), Integer.toString(status)))); } logger.fine("deleteDoi status for " + doi.asString() + ": " + status); }</code><technical_language>if this deleteDraftIdentifier method is called a non-DataCite installation (Handle EZID)</technical_language>

Target:
private void deleteDraftIdentifier(DvObject dvObject) throws IOException { String baseUrl = System.getProperty("doi.baseurlstringnext"); String username = System.getProperty("doi.username"); String password = System.getProperty("doi.password"); GlobalId doi = dvObject.getGlobalId(); URL url = new URL(baseUrl + "/dois/" + doi.getAuthority() + "/" + doi.getIdentifier()); HttpURLConnection connection = null; connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("DELETE"); String userpass = username + ":" + password; String basicAuth = "Basic " + new String(Base64.getEncoder().encode(userpass.getBytes())); connection.setRequestProperty("Authorization", basicAuth); int status = connection.getResponseCode(); if(status!=HttpStatus.SC_NO_CONTENT) { logger.warning("Incorrect Response Status from DataCite: " + status + " : " + connection.getResponseMessage()); throw new HttpException("Status: " + status); } logger.fine("deleteDoi status for " + doi.asString() + ": " + status); }
Source:
<code>public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue, List<String> newLabels) { List<String> originalLabels = issue.getLabels(); logger.info("Changing labels for " + issue + " on UI"); CompletableFuture<Optional<TurboIssue>> localReplaceResult = repoOpControl.replaceIssueLabelsLocally(issue, newLabels); if (localReplaceResult.isCompletedExceptionally() || localReplaceResult.isCancelled()) { return CompletableFuture.completedFuture(false); } Optional<TurboIssue> locallyModifiedIssue = localReplaceResult.join(); if (!locallyModifiedIssue.isPresent()) { return CompletableFuture.completedFuture(false); } <START> localReplaceResult.thenRun(this::refreshUI); <END> return updateIssueLabelsOnServer(issue, newLabels) .thenApply((isUpdateSuccessful) -> handleIssueLabelsUpdateOnServerResult( isUpdateSuccessful, locallyModifiedIssue.get(), originalLabels)); }</code><technical_language>Is this this.refreshUI()? refreshing immediately, this thread</technical_language>

Target:
public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue, List<String> newLabels) { List<String> originalLabels = issue.getLabels(); logger.info("Changing labels for " + issue + " on UI"); CompletableFuture<Optional<TurboIssue>> localLabelsReplaceFuture = repoOpControl.replaceIssueLabelsLocally(issue, newLabels); localLabelsReplaceFuture.thenRun(this::refreshUI); return updateIssueLabelsOnServer(issue, newLabels) .thenCombine(localLabelsReplaceFuture, (isUpdateSuccessful, locallyModifiedIssue) -> handleIssueLabelsUpdateResult( isUpdateSuccessful, locallyModifiedIssue, originalLabels)); }
Source:
<code>private static void setUpMocks() throws IOException { RouterRpcServer spyRpcServer = Mockito.spy(routerContext.getRouter().createRpcServer()); Whitebox .setInternalState(routerContext.getRouter(), "rpcServer", spyRpcServer); Mockito.doReturn(null).when(spyRpcServer).getFileInfo(Mockito.anyString()); mockRpcClient = Mockito.spy(spyRpcServer.getRPCClient()); Whitebox .setInternalState(spyRpcServer, "rpcClient", mockRpcClient); RemoteLocation remoteLocation0 = new RemoteLocation("ns0", "/testdir", null); RemoteLocation remoteLocation1 = new RemoteLocation("ns1", "/", null); <START> mockResponse0.put(remoteLocation0, <END> new HdfsFileStatus.Builder().build()); Mockito.doReturn(mockResponse0).when(mockRpcClient).invokeConcurrent( Mockito.eq(Lists.newArrayList(remoteLocation0)), Mockito.any(RemoteMethod.class), Mockito.eq(false), Mockito.eq(false), Mockito.eq(HdfsFileStatus.class) ); mockResponse1.put(remoteLocation1, new HdfsFileStatus.Builder().build()); Mockito.doReturn(mockResponse1).when(mockRpcClient).invokeConcurrent( Mockito.eq(Lists.newArrayList(remoteLocation1)), Mockito.any(RemoteMethod.class), Mockito.eq(false), Mockito.eq(false), Mockito.eq(HdfsFileStatus.class) ); }</code><technical_language>Avoid</technical_language>

Target:
private static void setUpMocks() throws IOException, NoSuchFieldException { RouterRpcServer spyRpcServer = Mockito.spy(routerContext.getRouter().createRpcServer()); FieldSetter.setField(routerContext.getRouter(), Router.class.getDeclaredField("rpcServer"), spyRpcServer); Mockito.doReturn(null).when(spyRpcServer).getFileInfo(Mockito.anyString()); mockRpcClient = Mockito.spy(spyRpcServer.getRPCClient()); FieldSetter.setField(spyRpcServer, RouterRpcServer.class.getDeclaredField("rpcClient"), mockRpcClient); RemoteLocation remoteLocation0 = new RemoteLocation("ns0", "/testdir", null); RemoteLocation remoteLocation1 = new RemoteLocation("ns1", "/", null); final Map<RemoteLocation, HdfsFileStatus> mockResponse0 = new HashMap<>(); final Map<RemoteLocation, HdfsFileStatus> mockResponse1 = new HashMap<>(); mockResponse0.put(remoteLocation0, new HdfsFileStatus.Builder().build()); Mockito.doReturn(mockResponse0).when(mockRpcClient).invokeConcurrent( Mockito.eq(Lists.newArrayList(remoteLocation0)), Mockito.any(RemoteMethod.class), Mockito.eq(false), Mockito.eq(false), Mockito.eq(HdfsFileStatus.class) ); mockResponse1.put(remoteLocation1, new HdfsFileStatus.Builder().build()); Mockito.doReturn(mockResponse1).when(mockRpcClient).invokeConcurrent( Mockito.eq(Lists.newArrayList(remoteLocation1)), Mockito.any(RemoteMethod.class), Mockito.eq(false), Mockito.eq(false), Mockito.eq(HdfsFileStatus.class) ); }
Source:
<code>private List<String> fetchAlternativeNames(List<String> originalNames) { for (List<String> alternativeNames : alternativeNamesDictionary) { if (containsSameOrganizationName(originalNames, alternativeNames)) { <START> return filterAlreadyPresentAlternativeNames(alternativeNames, originalNames); <END> } } return Lists.newArrayList(); }</code><technical_language>Do want interrupt finding match? If dealing original English name stop finding match language package, I right? I wondering covering scenario affiliation contains English organization name while organization name organizations set is defined in some other language. case of finding non-english name set of organizations</technical_language>

Target:
private List<String> fetchAlternativeNames(List<String> originalNames) { for (Set<String> alternativeNames : alternativeNamesDictionary) { if (containsSameOrganizationName(originalNames, alternativeNames)) { return filterAlreadyPresentAlternativeNames(alternativeNames, originalNames); } } return Lists.newArrayList(); }
Source:
<code>public DocumentRevision removeAttachments(DocumentRevision rev, String[] attachmentNames) throws ConflictException { int nDeleted = 0; for (String attachmentName : attachmentNames) { SavedAttachment a = (SavedAttachment) this.getAttachment(rev, attachmentName); if (a == null) { continue; } File f = this.fileFromKey(a.key); datastore.getSQLDatabase().delete("attachments", " filename = ? and sequence = ? ", new String[]{attachmentName, String.valueOf(rev.getSequence())}); f.delete(); nDeleted++; } <START> if (nDeleted > 0) { <END> return datastore.updateDocument(rev.getId(), rev.getRevision(), rev.getBody()); } return rev; }</code><technical_language>If a datastore.delete() succeeds for some reason deleting file throws exception, this nDeleted==0 if modified attachments database. I this method needs more concerned error modes</technical_language>

Target:
protected DocumentRevision removeAttachments(DocumentRevision rev, String[] attachmentNames) throws ConflictException { boolean rowsDeleted = false; String[] args = new String[attachmentNames.length+1]; System.arraycopy(attachmentNames, 0, args, 0, attachmentNames.length); args[args.length-1] = String.valueOf(rev.getSequence()); rowsDeleted = datastore.getSQLDatabase().delete("attachments", String.format("filename in (%s) and sequence = ?", SQLDatabaseUtils.makePlaceholders(attachmentNames.length)), args) > 0; if (!rowsDeleted) { Log.w(LOG_TAG, "No attachments were deleted for rev "+rev+" with attachmentNames "+ Arrays.toString(attachmentNames)); } if (rowsDeleted) { return datastore.updateDocument(rev.getId(), rev.getRevision(), rev.getBody()); } else { return rev; } }
Source:
<code>public Datastream initializeDatastream(Datastream datastream) throws DatastreamValidationException { String connectorType = datastream.getConnectorType(); <START> List<Datastream> allDatastreams = _adapter.getAllDatastreams(); <END> ConnectorWrapper connector = _connectors.get(connectorType); if (connector == null) { throw new DatastreamValidationException("Invalid connector type: " + connectorType); } Datastream initializedDatastream = connector.initializeDatastream(datastream, allDatastreams); if (connector.hasError()) { _eventQueue.put(CoordinatorEvent.createHandleInstanceErrorEvent(connector.getLastError())); } return initializedDatastream; }</code><technical_language>I pass in list of datastreams connectorType == connector.getType()</technical_language>

Target:
public Datastream initializeDatastream(Datastream datastream) throws DatastreamValidationException { String connectorType = datastream.getConnectorType(); List<Datastream> allDatastreams = _adapter.getAllDatastreams().stream() .filter(d -> d.getConnectorType().equals(connectorType)) .collect(Collectors.toList()); ConnectorWrapper connector = _connectors.get(connectorType); if (connector == null) { throw new DatastreamValidationException("Invalid connector type: " + connectorType); } Datastream initializedDatastream = connector.initializeDatastream(datastream, allDatastreams); if (connector.hasError()) { _eventQueue.put(CoordinatorEvent.createHandleInstanceErrorEvent(connector.getLastError())); } return initializedDatastream; }
Source:
<code>protected void executeCommand() { final int oldMemoryMb = getVm().getMemSizeMb(); final int oldMinAllocatedMemoryMb = getVm().getMinAllocatedMem(); final int unpluggedSizeMB = <START> VmDeviceCommonUtils.getSizeOfMemoryDeviceMb(getDeviceToHotUnplug()).get(); <END> final int decrementedMemoryMb = oldMemoryMb - unpluggedSizeMB; final int minMemoryAfterHotUnplugMb = decrementedMemoryMb > oldMinAllocatedMemoryMb ? oldMinAllocatedMemoryMb : Math.max(0, decrementedMemoryMb); final int memoryAfterHotUnplugMb = decrementedMemoryMb >= minMemoryAfterHotUnplugMb && decrementedMemoryMb > 0 ? decrementedMemoryMb : oldMemoryMb; addCustomValue(AUDIT_LOG_VAR_NEW_MEMORY_MB, String.valueOf(memoryAfterHotUnplugMb)); addCustomValue(AUDIT_LOG_VAR_OLD_MEMORY_MB, String.valueOf(oldMemoryMb)); final VDSReturnValue vdsReturnValue = executeHotUnplug(minMemoryAfterHotUnplugMb); final boolean memoryChanged = memoryAfterHotUnplugMb != oldMemoryMb || minMemoryAfterHotUnplugMb != oldMinAllocatedMemoryMb; if (vdsReturnValue.getSucceeded() && memoryChanged) { updateVm(memoryAfterHotUnplugMb, minMemoryAfterHotUnplugMb); } setSucceeded(true); }</code><technical_language>replaced a call getUnpluggedDeviceSize</technical_language>

Target:
protected void executeCommand() { final int oldMemoryMb = getVm().getMemSizeMb(); final int oldMinAllocatedMemoryMb = getVm().getMinAllocatedMem(); final int decrementedMemoryMb = oldMemoryMb - getUnpluggedDeviceSize(); final int minMemoryAfterHotUnplugMb = decrementedMemoryMb > oldMinAllocatedMemoryMb ? oldMinAllocatedMemoryMb : Math.max(0, decrementedMemoryMb); final int memoryAfterHotUnplugMb = decrementedMemoryMb >= minMemoryAfterHotUnplugMb && decrementedMemoryMb > 0 ? decrementedMemoryMb : oldMemoryMb; addCustomValue(AUDIT_LOG_VAR_NEW_MEMORY_MB, String.valueOf(memoryAfterHotUnplugMb)); addCustomValue(AUDIT_LOG_VAR_OLD_MEMORY_MB, String.valueOf(oldMemoryMb)); final VDSReturnValue vdsReturnValue = executeHotUnplug(minMemoryAfterHotUnplugMb); final boolean memoryChanged = memoryAfterHotUnplugMb != oldMemoryMb || minMemoryAfterHotUnplugMb != oldMinAllocatedMemoryMb; if (vdsReturnValue.getSucceeded() && memoryChanged) { updateVm(memoryAfterHotUnplugMb, minMemoryAfterHotUnplugMb); } setSucceeded(true); }
Source:
<code>protected void fireChange() { if (!listeners.isEmpty()) { Object[] allListeners = listeners.getListeners(); for (Object <START> allListener : <END> allListeners) { final ICompareInputChangeListener listener = (ICompareInputChangeListener) allListener; SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { listener.compareInputChanged(AbstractCompareInput.this); } @Override public void handleException(Throwable exception) { } }); } } }</code><technical_language>listener</technical_language>

Target:
protected void fireChange() { if (!listeners.isEmpty()) { Object[] allListeners = listeners.getListeners(); for (Object l : allListeners) { final ICompareInputChangeListener listener = (ICompareInputChangeListener) l; SafeRunner.run(new ISafeRunnable() { @Override public void run() throws Exception { listener.compareInputChanged(AbstractCompareInput.this); } @Override public void handleException(Throwable exception) { } }); } } }
Source:
<code><START> public RegistrationScreenInteractor navigateToRegistrationScreen() { <END> onSignUpView().perform(ViewActions.click()); return new RegistrationScreenInteractor(); }</code><technical_language>'registration' replaced 'signUp' in usages here, existing terminology in existing onSignUpView() method, title of screen well? change name of existing method</technical_language>

Target:
public RegistrationScreenInteractor navigateToRegistrationScreen() { onRegistrationView().perform(ViewActions.click()); return new RegistrationScreenInteractor(); }
Source:
<code>public String getName() { String id = getId(); IPath xmlFile = fXmlFile; if (xmlFile == null) { return id; } <START> Element doc = XmlUtils.getElementInFile(xmlFile.makeAbsolute().toString(), TmfXmlStrings.STATE_PROVIDER, getId()); <END> List<Element> head = XmlUtils.getChildElements(doc, TmfXmlStrings.HEAD); String name = id; if (head.size() == 1) { List<Element> labels = XmlUtils.getChildElements(head.get(0), TmfXmlStrings.LABEL); if (!labels.isEmpty()) { name = labels.get(0).getAttribute(TmfXmlStrings.VALUE); } } if (name == null) { return id; } return name; }</code><technical_language>this id</technical_language>

Target:
public String getName() { String id = getId(); IPath xmlFile = fXmlFile; if (xmlFile == null) { return id; } Element doc = XmlUtils.getElementInFile(xmlFile.makeAbsolute().toString(), TmfXmlStrings.STATE_PROVIDER, id); List<Element> head = XmlUtils.getChildElements(doc, TmfXmlStrings.HEAD); String name = null; if (head.size() == 1) { List<Element> labels = XmlUtils.getChildElements(head.get(0), TmfXmlStrings.LABEL); if (!labels.isEmpty()) { name = labels.get(0).getAttribute(TmfXmlStrings.VALUE); } } return (name == null) ? id : name; }
Source:
<code>public void destroy() { String logoutrequest = ""; logoutrequest = "<BaseRequest xmlns:xsi=\"<LINK_0>\" xsi:type=\"LogoutRequest\" Version=\"" + FIRMWARE_VERSION + "\" RequestId=\"" <START> + requestId + "\" SessionId=\"" + getSessionId() + "\" />"; <END> try { executeRequest(logoutrequest, "/cmd"); } catch (RWESmarthomeSessionExpiredException e) { } sessionId = ""; }</code><technical_language>collect XML-Snippets constants substitution marks String.format() in order replace marks. This increase code readability (also change for subsequent XML Snippets)</technical_language>

Target:
public void destroy() { final String LOGOUT_REQUEST = String.format( "<BaseRequest xmlns:xsi=\"<LINK_0>\" xsi:type=\"LogoutRequest\" Version=\"%s\" RequestId=\"%s\" SessionId=\"%s\" />", FIRMWARE_VERSION, requestId, getSessionId() ); try { logger.debug("Destroying session..."); executeRequest(LOGOUT_REQUEST, "/cmd"); logger.debug("Session destroyed."); } catch (RWESmarthomeSessionExpiredException e) { } sessionId = ""; }
Source:
<code>public synchronized void handleEvaluationResponse(OtpErlangObject response) { if (myEvalCallback != null) { <START> String error = null; <END> if (response instanceof OtpErlangAtom && ((OtpErlangAtom) response).atomValue().equals("Parse error")) { error = "Parse error"; } else if (response instanceof OtpErlangTuple) { OtpErlangObject[] elements = ((OtpErlangTuple) response).elements(); if (elements.length == 2 && elements[0] instanceof OtpErlangAtom && ((OtpErlangAtom) elements[0]).atomValue().equals("EXIT")) { error = "Uncaught exception: " + elements[1]; } } if (error == null) { myEvalCallback.evaluated(ErlangXValueFactory.create(response)); } else { myEvalCallback.errorOccurred(error); } } }</code><technical_language>for me, extract a separate function assign error variable</technical_language>

Target:
public synchronized void handleEvaluationResponse(OtpErlangObject response) { if (myEvalCallback != null) { String error = maybeExtractErrorFromEvaluationResponse(response); if (error == null) { myEvalCallback.evaluated(ErlangXValueFactory.create(response)); } else { myEvalCallback.errorOccurred(error); } } }
Source:
<code>protected void scatterBytes(byte[] bytes) { if (bytes.length != this.numStreams) { <START> throw new ParquetEncodingException("Number of bytes doesn't match the number of streams."); <END> } for (int i = 0; i < bytes.length; ++i) { this.byteStreams[i].write(bytes[i]); } }</code><technical_language>Add of bytes.length this.numStreams excepton</technical_language>

Target:
protected void scatterBytes(byte[] bytes) { if (bytes.length != this.numStreams) { throw new ParquetEncodingException( String.format("Number of bytes doesn't match the number of streams. Num butes: %d, Num streams: %d", bytes.length, this.numStreams)); } for (int i = 0; i < bytes.length; ++i) { this.byteStreams[i].write(bytes[i]); } }