auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Path getCurrentLoadPath() throws IOException, SemanticException { Path loadPathBase = new Path(conf.getVar(HiveConf.ConfVars.REPLDIR), Base64.getEncoder().encodeToString(sourceDbNameOrPattern.toLowerCase() .getBytes(StandardCharsets.UTF_8.name()))); final FileSystem fs = loadPathBase.getFileSystem(conf); loadPathBase = fs.makeQualified(loadPathBase); if (!fs.exists(loadPathBase)) { LOG.error("File not found " + loadPathBase.toUri().toString()); throw new FileNotFoundException(ErrorMsg.REPL_LOAD_PATH_NOT_FOUND.getMsg()); } FileStatus[] statuses = loadPathBase.getFileSystem(conf).listStatus(loadPathBase); if (statuses.length > 0) { FileStatus latestUpdatedStatus = statuses[0]; for (FileStatus status : statuses) { if (status.getModificationTime() > latestUpdatedStatus.getModificationTime()) { latestUpdatedStatus = status; } } Path hiveDumpPath = new Path(latestUpdatedStatus.getPath(), ReplUtils.REPL_HIVE_BASE_DIR); <START> if (loadPathBase.getFileSystem(conf).exists(hiveDumpPath)) { <END> if (loadPathBase.getFileSystem(conf).exists(new Path(hiveDumpPath, ReplUtils.DUMP_ACKNOWLEDGEMENT)) && !loadPathBase.getFileSystem(conf).exists(new Path(hiveDumpPath, ReplUtils.LOAD_ACKNOWLEDGEMENT))) { return hiveDumpPath; } } } return null; }</code><technical_language>do need this check? other checks good enough</technical_language>

Target:
private Path getCurrentLoadPath() throws IOException, SemanticException { Path loadPathBase = new Path(conf.getVar(HiveConf.ConfVars.REPLDIR), Base64.getEncoder().encodeToString(sourceDbNameOrPattern.toLowerCase() .getBytes(StandardCharsets.UTF_8.name()))); final FileSystem fs = loadPathBase.getFileSystem(conf); loadPathBase = fs.makeQualified(loadPathBase); if (!fs.exists(loadPathBase)) { LOG.error("File not found " + loadPathBase.toUri().toString()); throw new FileNotFoundException(ErrorMsg.REPL_LOAD_PATH_NOT_FOUND.getMsg()); } FileStatus[] statuses = loadPathBase.getFileSystem(conf).listStatus(loadPathBase); if (statuses.length > 0) { FileStatus latestUpdatedStatus = statuses[0]; for (FileStatus status : statuses) { if (status.getModificationTime() > latestUpdatedStatus.getModificationTime()) { latestUpdatedStatus = status; } } Path hiveDumpPath = new Path(latestUpdatedStatus.getPath(), ReplUtils.REPL_HIVE_BASE_DIR); if (loadPathBase.getFileSystem(conf).exists(new Path(hiveDumpPath, ReplUtils.DUMP_ACKNOWLEDGEMENT)) && !loadPathBase.getFileSystem(conf).exists(new Path(hiveDumpPath, ReplUtils.LOAD_ACKNOWLEDGEMENT))) { return hiveDumpPath; } } return null; }
Source:
<code>public void uploadSnapshotTest_fromCurrentLive() throws IOException, InterruptedException, ExecutionException{ String indexName = getLiveIndex(); File snapshot = null; try { snapshot = esIndexAPI.createSnapshot(ESIndexAPI.BACKUP_REPOSITORY, "backup", indexName); esIndexAPI.closeIndex(indexName); esIndexAPI.delete(indexName); ZipFile file = new ZipFile(snapshot.getAbsolutePath()); String pathToRepo = Config.getStringProperty("es.path.repo","test-resources"); File tempDir = new File(pathToRepo); boolean response = esIndexAPI.uploadSnapshot(file, tempDir.getAbsolutePath(), "backup"); assertTrue(response); <START> } catch (DotStateException | IllegalArgumentException | IOException e) { <END> e.printStackTrace(); }finally{ snapshot.delete(); } }</code><technical_language>Remove catch</technical_language>

Target:
public void uploadSnapshotTest_fromCurrentLive() throws IOException, InterruptedException, ExecutionException{ String indexName = getLiveIndex(); File snapshot = null; snapshot = esIndexAPI.createSnapshot(ESIndexAPI.BACKUP_REPOSITORY, "backup", indexName); esIndexAPI.closeIndex(indexName); ZipFile file = new ZipFile(snapshot.getAbsolutePath()); String pathToRepo = Config.getStringProperty("es.path.repo","test-resources"); File tempDir = new File(pathToRepo); boolean response = esIndexAPI.uploadSnapshot(file, tempDir.getAbsolutePath()); assertTrue(response); if(snapshot!=null){ snapshot.delete(); } }
Source:
<code>ResolutionScreen(MenuLayout menuLayout, GameOptions gameOptions) { displayDimensions = SolApplication.displayDimensions; resolutionControl = new SolUiControl(menuLayout.buttonRect(-1, 1), true); resolutionControl.setDisplayName("Resolution"); controls.add(resolutionControl); fullscreenControl = new SolUiControl(menuLayout.buttonRect(-1, 2), true); fullscreenControl.setDisplayName("Fullscreen"); controls.add(fullscreenControl); nuiUIScaleControl = new SolUiControl(menuLayout.buttonRect(-1, 3), true); <START> nuiUIScaleControl.setDisplayName("Map Pan Speed"); <END> controls.add(nuiUIScaleControl); closeControl = new SolUiControl(menuLayout.buttonRect(-1, 4), true, gameOptions.getKeyEscape()); closeControl.setDisplayName("Back"); controls.add(closeControl); backgroundTexture = Assets.getAtlasRegion("engine:mainMenuBg", Texture.TextureFilter.Linear); }</code><technical_language>"Map Pan Speed" :thinking:</technical_language>

Target:
ResolutionScreen(MenuLayout menuLayout, GameOptions gameOptions) { displayDimensions = SolApplication.displayDimensions; resolutionControl = new SolUiControl(menuLayout.buttonRect(-1, 1), true); resolutionControl.setDisplayName("Resolution"); controls.add(resolutionControl); fullscreenControl = new SolUiControl(menuLayout.buttonRect(-1, 2), true); fullscreenControl.setDisplayName("Fullscreen"); controls.add(fullscreenControl); nuiUIScaleControl = new SolUiControl(menuLayout.buttonRect(-1, 3), true); nuiUIScaleControl.setDisplayName("NUI UI scale"); controls.add(nuiUIScaleControl); closeControl = new SolUiControl(menuLayout.buttonRect(-1, 4), true, gameOptions.getKeyEscape()); closeControl.setDisplayName("Back"); controls.add(closeControl); backgroundTexture = Assets.getAtlasRegion("engine:mainMenuBg", Texture.TextureFilter.Linear); }
Source:
<code>protected void createPreparedStatement(Connection db) throws SQLException { findDefaultAutoIncrementingColumn(db); ColumnId incrementingColumn = null; if (incrementingColumnName != null && !incrementingColumnName.isEmpty()) { incrementingColumn = new ColumnId(tableId, incrementingColumnName); } ExpressionBuilder builder = dialect.expressionBuilder(); switch (mode) { case TABLE: builder.append("SELECT * FROM "); builder.append(tableId); break; case QUERY: builder.append(query); break; default: throw new ConnectException("Unknown mode encountered when preparing query: " + mode); } criteria = dialect.criteriaFor(incrementingColumn, timestampColumns, suffix); <START> criteria.whereClause(builder); <END> String queryString = builder.toString(); recordQuery(queryString); log.debug("{} prepared SQL query: {}", this, queryString); stmt = dialect.createPreparedStatement(db, queryString); }</code><technical_language>I avoid passing suffix criteria if append immediately this line</technical_language>

Target:
protected void createPreparedStatement(Connection db) throws SQLException { findDefaultAutoIncrementingColumn(db); ColumnId incrementingColumn = null; if (incrementingColumnName != null && !incrementingColumnName.isEmpty()) { incrementingColumn = new ColumnId(tableId, incrementingColumnName); } ExpressionBuilder builder = dialect.expressionBuilder(); switch (mode) { case TABLE: builder.append("SELECT * FROM "); builder.append(tableId); break; case QUERY: builder.append(query); break; default: throw new ConnectException("Unknown mode encountered when preparing query: " + mode); } criteria = dialect.criteriaFor(incrementingColumn, timestampColumns); criteria.whereClause(builder); addSuffixIfPresent(builder); String queryString = builder.toString(); recordQuery(queryString); log.debug("{} prepared SQL query: {}", this, queryString); stmt = dialect.createPreparedStatement(db, queryString); }
Source:
<code>public static Wallet fromKeys(NetworkParameters params, List<ECKey> keys) { <START> for (ECKey key : keys) <END> checkArgument(key.getClass().equals(ECKey.class)); KeyChainGroup group = new KeyChainGroup(params); group.importKeys(keys); return new Wallet(params, group); }</code><technical_language>check for !instanceof DeterministicKey forbid ECKey subclasses library users invented</technical_language>

Target:
public static Wallet fromKeys(NetworkParameters params, List<ECKey> keys) { for (ECKey key : keys) checkArgument(!(key instanceof DeterministicKey)); KeyChainGroup group = new KeyChainGroup(params); group.importKeys(keys); return new Wallet(params, group); }
Source:
<code><START> public static String isRetrospectiveVisit(Visit visit) { <END> String retrospective = "false"; for (Encounter e : visit.getEncounters()) { if (e.getEncounterType().getUuid().equals(MetadataConstants.HIV_RETROSPECTIVE_ENCOUNTER_TYPE_UUID)) { retrospective = "true"; break; } } return retrospective; }</code><technical_language>This a boolean... reason Strings</technical_language>

Target:
public static boolean isRetrospectiveVisit(Visit visit) { boolean retrospective = false; for (Encounter e : visit.getEncounters()) { if (e.getEncounterType().getUuid().equals(MetadataConstants.HIV_RETROSPECTIVE_ENCOUNTER_TYPE_UUID)) { retrospective = true; break; } } return retrospective; }
Source:
<code>private String _cleanLongFilename(String fname) { int namemax = 136; int pathmax = 1024; int dirlen = fname.length(); int remaining = pathmax - dirlen; namemax = min(remaining, namemax); assert(namemax>0); if (fname.length() > namemax) { int lastSlash = fname.indexOf("/"); int lastDot = fname.indexOf("."); if (lastDot == -1 || lastDot < lastSlash) { fname = fname.substring(0, namemax); } else { String ext = fname.substring(lastDot+1); String head = fname.substring(0, lastDot); int headmax = namemax - ext.length(); head = head.substring(0, headmax); fname = head + ext; <START> assert (fname.length() <= namemax); <END> } } return fname; }</code><technical_language>Assert()</technical_language>

Target:
private String _cleanLongFilename(String fname) { int namemax = 136; int pathmax = 1024; int dirlen = fname.length(); int remaining = pathmax - dirlen; namemax = min(remaining, namemax); Assert.that(namemax>0, "The media directory is maximally long. There is no more length available for file name."); if (fname.length() > namemax) { int lastSlash = fname.indexOf("/"); int lastDot = fname.indexOf("."); if (lastDot == -1 || lastDot < lastSlash) { fname = fname.substring(0, namemax); } else { String ext = fname.substring(lastDot+1); String head = fname.substring(0, lastDot); int headmax = namemax - ext.length(); head = head.substring(0, headmax); fname = head + ext; Assert.that (fname.length() <= namemax, "The length of the file is greater than the maximal name value."); } } return fname; }
Source:
<code>private OnHeapValueHolder<V> internalGet(final K key, final boolean updateAccess) throws CacheAccessException { getObserver.begin(); try { final AtomicReference<OnHeapValueHolder<V>> expiredValue = new AtomicReference<OnHeapValueHolder<V>>(null); OnHeapValueHolder<V> result = map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { final long now = timeSource.getTimeMillis(); if (mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { onExpiration(mappedKey, mappedValue); expiredValue.set(mappedValue); return null; } if (updateAccess) { return setAccessTimeAndExpiryThenReturnMapping(key, mappedValue, now, false); } return mappedValue; } }); if (result == null) { getObserver.end(StoreOperationOutcomes.GetOutcome.MISS); if (byteSized && expiredValue.get() != null) { <START> decrementCurrentUsageInBytesIfRequired(getSizeOfKeyWithOffset(key) + getSizeOfValueWithOffset(expiredValue.get().value()) + sizeOfEngine.getCHMOffset()); <END> } } else { getObserver.end(StoreOperationOutcomes.GetOutcome.HIT); } return result; } catch (RuntimeException re) { handleRuntimeException(re); return null; } }</code><technical_language>I size recalculated mapping evicted/removed/expired. This stored in ValueHolder</technical_language>

Target:
private OnHeapValueHolder<V> internalGet(final K key, final boolean updateAccess) throws CacheAccessException { getObserver.begin(); try { final AtomicReference<OnHeapValueHolder<V>> expiredValue = new AtomicReference<OnHeapValueHolder<V>>(null); OnHeapValueHolder<V> result = map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { final long now = timeSource.getTimeMillis(); if (mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { onExpiration(mappedKey, mappedValue); expiredValue.set(mappedValue); return null; } if (updateAccess) { return setAccessTimeAndExpiryThenReturnMapping(key, mappedValue, now, false); } return mappedValue; } }); if (result == null) { getObserver.end(StoreOperationOutcomes.GetOutcome.MISS); if (expiredValue.get() != null) { decrementCurrentUsageInBytesIfRequired(expiredValue.get().size()); } } else { getObserver.end(StoreOperationOutcomes.GetOutcome.HIT); } return result; } catch (RuntimeException re) { handleRuntimeException(re); return null; } }
Source:
<code>private void initNetworkModels() { Map<String, LogicalNetworkModel> networkModels = new HashMap<>(); for (Network network : allNetworks) { ReportedConfigurations reportedConfigurations = reportedConfigurationByNetworkId(network.getId()); <START> LogicalNetworkModel networkModel = new LogicalNetworkModel(network, reportedConfigurations, this); <END> networkModels.put(network.getName(), networkModel); if (networkModel.isManagement()) { managementNetworkModel = networkModel; } if (!network.isExternal()) { String label = network.getLabel(); if (label != null) { networkLabelMap.get(label).getNetworks().add(networkModel); } } } setNetworks(networkModels); }</code><technical_language>IIUC, reportedConfigurations relevant if networks is out-of-sync. passing reported configuration of a sync network? network moved another nic, original reported configuration relevant anymore</technical_language>

Target:
private void initNetworkModels() { Map<String, LogicalNetworkModel> networkModels = new HashMap<>(); for (Network network : allNetworks) { LogicalNetworkModel networkModel = new LogicalNetworkModel(network, this); networkModels.put(network.getName(), networkModel); if (networkModel.isManagement()) { managementNetworkModel = networkModel; } if (!network.isExternal()) { String label = network.getLabel(); if (label != null) { networkLabelMap.get(label).getNetworks().add(networkModel); } } } setNetworks(networkModels); }
Source:
<code>public ClientResponse<InputStream> handleResponse(HttpResponse response, TrafficCop trafficCop) { ChannelBufferInputStream channelStream = null; try { channelStream = new ChannelBufferInputStream(response.getContent()); queue.put(channelStream); } catch (InterruptedException e) { log.error(e, "Queue appending interrupted"); Thread.currentThread().interrupt(); throw new RuntimeException(e); } finally { if (channelStream != null) { <START> try { <END> channelStream.close(); } catch (IOException e) { log.error(e, "Unable to close the channel buffer"); } } } byteCount.addAndGet(response.getContent().readableBytes()); return ClientResponse.finished( new SequenceInputStream( new Enumeration<InputStream>() { @Override public boolean hasMoreElements() { synchronized (done) { return !done.get() || !queue.isEmpty(); } } @Override public InputStream nextElement() { try { return queue.take(); } catch (InterruptedException e) { log.warn(e, "Thread interrupted while taking from queue"); Thread.currentThread().interrupt(); throw new RuntimeException(e); } } } ) ); }</code><technical_language>This block is essentially CloseQuietly.close()</technical_language>

Target:
public ClientResponse<InputStream> handleResponse(HttpResponse response, TrafficCop trafficCop) { ChannelBufferInputStream channelStream = null; try { channelStream = new ChannelBufferInputStream(response.getContent()); queue.put(channelStream); } catch (InterruptedException e) { log.error(e, "Queue appending interrupted"); Thread.currentThread().interrupt(); throw new RuntimeException(e); } finally { CloseQuietly.close(channelStream); } byteCount.addAndGet(response.getContent().readableBytes()); return ClientResponse.finished( new SequenceInputStream( new Enumeration<InputStream>() { @Override public boolean hasMoreElements() { synchronized (done) { return !done.get() || !queue.isEmpty(); } } @Override public InputStream nextElement() { try { return queue.take(); } catch (InterruptedException e) { log.warn(e, "Thread interrupted while taking from queue"); Thread.currentThread().interrupt(); throw new RuntimeException(e); } } } ) ); }
Source:
<code>public ErrorEntityWriterTestResourceConfig() { super(true, new MetricRegistry()); register(DefaultLoggingExceptionMapper.class); register(DefaultJacksonMessageBodyProvider.class); register(ExceptionResource.class); register(new ErrorEntityWriter<ErrorMessage, String>(MediaType.TEXT_HTML_TYPE, String.class) { @Override protected String getRepresentation(ErrorMessage entity) { <START> return "Uh oh: " + entity.getMessage(); <END> } }); }</code><technical_language>Is a plain string valid HTML? (no <html> tag, etc)</technical_language>

Target:
public ErrorEntityWriterTestResourceConfig() { super(true, new MetricRegistry()); register(DefaultLoggingExceptionMapper.class); register(DefaultJacksonMessageBodyProvider.class); register(ExceptionResource.class); register(new ErrorEntityWriter<ErrorMessage, String>(MediaType.TEXT_HTML_TYPE, String.class) { @Override protected String getRepresentation(ErrorMessage entity) { return "<!DOCTYPE html><html><body>" + entity.getMessage() + "</body></html>"; } }); }
Source:
<code>private void showUsageReportingDialog(RestApi restApi) { final DialogInterface.OnClickListener listener = (dialog, which) -> { <START> if (restApi == null) { <END> Toast.makeText(MainActivity.this, R.string.syncthing_terminated, Toast.LENGTH_SHORT).show(); return; } try { switch (which) { case DialogInterface.BUTTON_POSITIVE: restApi.setUsageReporting(true); restApi.restart(); break; case DialogInterface.BUTTON_NEGATIVE: restApi.setUsageReporting(false); restApi.restart(); break; case DialogInterface.BUTTON_NEUTRAL: Uri uri = Uri.parse("<LINK_0>"); startActivity(new Intent(Intent.ACTION_VIEW, uri)); break; } } catch (Exception e) { Log.e(TAG, "showUsageReportingDialog:OnClickListener", e); } }; if (restApi == null) { return; } restApi.getUsageReport(report -> { @SuppressLint("InflateParams") View v = LayoutInflater.from(MainActivity.this) .inflate(R.layout.dialog_usage_reporting, null); TextView tv = v.findViewById(R.id.example); tv.setText(report); new AlertDialog.Builder(MainActivity.this) .setTitle(R.string.usage_reporting_dialog_title) .setView(v) .setPositiveButton(R.string.yes, listener) .setNegativeButton(R.string.no, listener) .setNeutralButton(R.string.open_website, listener) .show(); }); }</code><technical_language>point for this check this get called if restApi is null in outer stack</technical_language>

Target:
private void showUsageReportingDialog(RestApi restApi) { final DialogInterface.OnClickListener listener = (dialog, which) -> { try { switch (which) { case DialogInterface.BUTTON_POSITIVE: restApi.setUsageReporting(true); restApi.saveConfigAndRestart(); break; case DialogInterface.BUTTON_NEGATIVE: restApi.setUsageReporting(false); restApi.saveConfigAndRestart(); break; case DialogInterface.BUTTON_NEUTRAL: Uri uri = Uri.parse("<LINK_0>"); startActivity(new Intent(Intent.ACTION_VIEW, uri)); break; } } catch (Exception e) { Log.e(TAG, "showUsageReportingDialog:OnClickListener", e); } }; restApi.getUsageReport(report -> { @SuppressLint("InflateParams") View v = LayoutInflater.from(MainActivity.this) .inflate(R.layout.dialog_usage_reporting, null); TextView tv = v.findViewById(R.id.example); tv.setText(report); new AlertDialog.Builder(MainActivity.this) .setTitle(R.string.usage_reporting_dialog_title) .setView(v) .setPositiveButton(R.string.yes, listener) .setNegativeButton(R.string.no, listener) .setNeutralButton(R.string.open_website, listener) .show(); }); }
Source:
<code>public boolean retainAll(Collection<?> c) { boolean changed = false; Object[] retainAll = c.toArray(); outer: for (Iterator<E> iterator = iterator(); iterator.hasNext();) { E element = iterator.next(); for (Object <START> retainAll1 : <END> retainAll) { if (element == retainAll1) { continue outer; } } iterator.remove(); changed = true; } return changed; }</code><technical_language>Rename e toRetainElem</technical_language>

Target:
public boolean retainAll(Collection<?> c) { boolean changed = false; outer: for (Iterator<E> iterator = iterator(); iterator.hasNext();) { E element = iterator.next(); for (Object retain : c) { if (element == retain) { continue outer; } } iterator.remove(); changed = true; } return changed; }
Source:
<code>@Override public void onKernalStop(boolean cancel) { cacheStartedLatch.countDown(); GridCachePartitionExchangeManager<Object, Object> exch = context().exchange(); exch.onKernalStop(cancel); for (GridCacheAdapter<?, ?> cache : caches.values()) { GridCacheAffinityManager aff = cache.context().affinity(); if (aff != null) <START> aff.onKernalStop(true); <END> } for (String cacheName : stopSeq) { GridCacheAdapter<?, ?> cache = caches.remove(maskNull(cacheName)); if (cache != null) { stoppedCaches.put(maskNull(cacheName), cache); onKernalStop(cache, cancel); } } for (Map.Entry<String, GridCacheAdapter<?, ?>> entry : caches.entrySet()) { GridCacheAdapter<?, ?> cache = entry.getValue(); if (cache == caches.remove(entry.getKey())) { stoppedCaches.put(entry.getKey(), cache); onKernalStop(entry.getValue(), cancel); } } cancelFutures(); List<? extends GridCacheSharedManager<?, ?>> sharedMgrs = sharedCtx.managers(); for (ListIterator<? extends GridCacheSharedManager<?, ?>> it = sharedMgrs.listIterator(sharedMgrs.size()); it.hasPrevious();) { GridCacheSharedManager<?, ?> mgr = it.previous(); if (mgr != exch) mgr.onKernalStop(cancel); } }</code><technical_language>Alexey, do explicitly call aff.onKernalStop() here? This is semantically wrong onKernalStop is a part of component lifecycle invoked manually</technical_language>

Target:
@Override public void onKernalStop(boolean cancel) { cacheStartedLatch.countDown(); GridCachePartitionExchangeManager<Object, Object> exch = context().exchange(); exch.onKernalStop(cancel); for (GridCacheAdapter<?, ?> cache : caches.values()) { GridCacheAffinityManager aff = cache.context().affinity(); if (aff != null) aff.cancelFutures(); } for (String cacheName : stopSeq) { GridCacheAdapter<?, ?> cache = caches.remove(maskNull(cacheName)); if (cache != null) { stoppedCaches.put(maskNull(cacheName), cache); onKernalStop(cache, cancel); } } for (Map.Entry<String, GridCacheAdapter<?, ?>> entry : caches.entrySet()) { GridCacheAdapter<?, ?> cache = entry.getValue(); if (cache == caches.remove(entry.getKey())) { stoppedCaches.put(entry.getKey(), cache); onKernalStop(entry.getValue(), cancel); } } cancelFutures(); List<? extends GridCacheSharedManager<?, ?>> sharedMgrs = sharedCtx.managers(); for (ListIterator<? extends GridCacheSharedManager<?, ?>> it = sharedMgrs.listIterator(sharedMgrs.size()); it.hasPrevious();) { GridCacheSharedManager<?, ?> mgr = it.previous(); if (mgr != exch) mgr.onKernalStop(cancel); } }
Source:
<code>public void addSiteMapEntries(SiteMapGeneratorConfiguration smgc, SiteMapBuilder siteMapBuilder) { <START> if (smgc instanceof CategorySiteMapGeneratorConfiguration) { <END> CategorySiteMapGeneratorConfiguration categorySMGC = (CategorySiteMapGeneratorConfiguration) smgc; Long rootCategoryId = categorySMGC.getRootCategory().getId(); Category rootCategory = categoryDao.readCategoryById(rootCategoryId); addCategorySiteMapEntries(rootCategory, 0, categorySMGC, siteMapBuilder); } }</code><technical_language>Change this CategorySiteMapGeneratorConfiguration.class.isAssignableFrom(smgc.getClass())</technical_language>

Target:
public void addSiteMapEntries(SiteMapGeneratorConfiguration smgc, SiteMapBuilder siteMapBuilder) { if (CategorySiteMapGeneratorConfiguration.class.isAssignableFrom(smgc.getClass())) { CategorySiteMapGeneratorConfiguration categorySMGC = (CategorySiteMapGeneratorConfiguration) smgc; Long rootCategoryId = categorySMGC.getRootCategory().getId(); Category rootCategory = categoryDao.readCategoryById(rootCategoryId); addCategorySiteMapEntries(rootCategory, 0, categorySMGC, siteMapBuilder); } }
Source:
<code>private void createPath(String parentPath, boolean removeParentsIfCreated) { try { <START> curator.create().creatingParentsIfNeeded().forPath(parentPath); <END> if (removeParentsIfCreated) { parentsIBuilt.add(parentPath); } } catch (Exception e) { log.info(e, "Problem creating parentPath[%s], someone else created it first?", parentPath); } }</code><technical_language>Is a log if parent created this call not</technical_language>

Target:
private void createPath(String parentPath, boolean removeParentsIfCreated) { try { curator.create().creatingParentsIfNeeded().forPath(parentPath); if (removeParentsIfCreated) { parentsIBuilt.add(parentPath); } log.debug("Created parentPath[%s], %s remove on stop.", parentPath, removeParentsIfCreated ? "will" : "will not"); } catch (Exception e) { log.info(e, "Problem creating parentPath[%s], someone else created it first?", parentPath); } }
Source:
<code>public AnnotationCommandHandlerAdapter(Object annotatedCommandHandler, ParameterResolverFactory parameterResolverFactory) { this(annotatedCommandHandler, parameterResolverFactory, <START> new ClasspathHandlerDefinition(Thread.currentThread().getContextClassLoader())); <END> }</code><technical_language>Actually, I expect default class loader of object inspected. expect classes class, resolvable class' class loader. Note context class loader null. Also, instead of a constructor, consider a static factory method. add caching (similar ParameterResolver is doing)</technical_language>

Target:
public AnnotationCommandHandlerAdapter(Object annotatedCommandHandler, ParameterResolverFactory parameterResolverFactory) { this(annotatedCommandHandler, parameterResolverFactory, ClasspathHandlerDefinition.forClass(annotatedCommandHandler.getClass())); }
Source:
<code>public Map<BaggageField, String> mergeState(Map<BaggageField, String> state, BaggageField field, String value) { if (equal(value, state.get(field))) return state; if (value == null) { if (!state.containsKey(field)) return state; <START> if (state.size() == 1) return null; <END> } LinkedHashMap<BaggageField, String> mergedState = new LinkedHashMap<>(state); if (value != null) { mergedState.put(field, value); } else { mergedState.remove(field); } return mergedState; }</code><technical_language>Collections.emptyMap? interface needs updated a @Nullable return means, empty map simpler overhead</technical_language>

Target:
public Map<BaggageField, String> mergeState(Map<BaggageField, String> state, BaggageField field, String value) { if (equal(value, state.get(field))) return state; if (value == null) { if (!state.containsKey(field)) return state; if (state.size() == 1) return null; } LinkedHashMap<BaggageField, String> mergedState = new LinkedHashMap<>(state); mergedState.put(field, value); return mergedState; }
Source:
<code>public static String getDecryptedData(String message) { String[] lines = splitIntoLines(message, true); int charCount = 0; for (int i = 0; i < key; ++i) { while (lines[i].contains("?")) { String letter = String.valueOf(message.charAt(charCount)); lines[i] = lines[i].replaceFirst("\\?", letter); charCount++; } } <START> String result = ""; <END> int lineCount = 0; int direction = -1; for (int i = 0; i < message.length(); ++i) { String letter = String.valueOf(lines[lineCount].charAt(0)); lines[lineCount] = lines[lineCount].substring(1); result += letter; direction *= lineCount == 0 || lineCount == key - 1 ? -1 : 1; lineCount += direction; } return result; }</code><technical_language>StringBuilder :)</technical_language>

Target:
String getDecryptedData(String message) { String[] lines = splitIntoLines(message, true); int charCount = 0; for (int i = 0; i < key; ++i) { while (lines[i].contains("?")) { String letter = String.valueOf(message.charAt(charCount)); lines[i] = lines[i].replaceFirst("\\?", letter); charCount++; } } StringBuilder result = new StringBuilder(); int lineCount = 0; int direction = -1; for (int i = 0; i < message.length(); ++i) { String letter = String.valueOf(lines[lineCount].charAt(0)); lines[lineCount] = lines[lineCount].substring(1); result.append(letter); direction *= lineCount == 0 || lineCount == key - 1 ? -1 : 1; lineCount += direction; } return result.toString(); }
Source:
<code>public MqttWillAndTestament(String topic, byte[] payload, int qos, boolean retain) { this.topic = topic; this.payload = payload; this.qos = qos; this.retain = retain; <START> if (StringUtils.isBlank(this.topic)) { <END> throw new IllegalArgumentException("Topic must be set"); } }</code><technical_language>this call/block in constructor</technical_language>

Target:
public MqttWillAndTestament(String topic, byte[] payload, int qos, boolean retain) { if (StringUtils.isBlank(topic)) { throw new IllegalArgumentException("Topic must be set"); } this.topic = topic; this.payload = payload; this.qos = qos; this.retain = retain; }
Source:
<code>public void commit() { if (!newObjects.isEmpty() || !objectsToDelete.isEmpty()) { repository().write(writer -> { writer.putAll(newObjects); writer.removeAll(objectsToDelete); writer.commit(); return null; }); if (!newObjects.isEmpty()) { WhiteListNotification.added(newObjects.keySet()).publish(service(IEventBus.class)); <START> } else if (!objectsToDelete.isEmpty()) { <END> WhiteListNotification.removed(Iterables.getOnlyElement(objectsToDelete.values())).publish(service(IEventBus.class)); } } }</code><technical_language>Sending out delete notification in if block. Change please</technical_language>

Target:
public void commit() { if (!newObjects.isEmpty() || !objectsToDelete.isEmpty()) { repository().write(writer -> { writer.putAll(newObjects); writer.removeAll(objectsToDelete); writer.commit(); return null; }); if (!newObjects.isEmpty()) { WhiteListNotification.added(newObjects.keySet()).publish(service(IEventBus.class)); } if (!objectsToDelete.isEmpty()) { WhiteListNotification.removed(Iterables.getOnlyElement(objectsToDelete.values())).publish(service(IEventBus.class)); } } }
Source:
<code>protected RelationState resolveState(List<BinaryRelation> knownRelations) { if (hasSameOperand()) { return relationStateForSameOperand(); } List<BinaryRelation> allRelations = deduce(knownRelations); <START> for (BinaryRelation relation : allRelations) { <END> RelationState result = relation.implies(this); if (result.isDetermined()) { return result; } } return RelationState.UNDETERMINED; }</code><technical_language>I this leverage stream api : deduce().stream().map().filter().firstMatch().orElse..</technical_language>

Target:
protected RelationState resolveState(List<BinaryRelation> knownRelations) { if (hasSameOperand()) { return relationStateForSameOperand(); } Set<BinaryRelation> allRelations = new HashSet<>(knownRelations); Deque<BinaryRelation> workList = new ArrayDeque<>(knownRelations); int iterations = 0; while (!workList.isEmpty()) { if (allRelations.size() > MAX_DEDUCED_RELATIONS || iterations > MAX_ITERATIONS) { throw new TransitiveRelationExceededException("Used relations: " + allRelations.size() + ". Iterations " + iterations); } iterations++; BinaryRelation relation = workList.pop(); RelationState result = relation.implies(this); if (result.isDetermined()) { return result; } List<BinaryRelation> newRelations = allRelations.stream() .map(relation::deduceTransitiveOrSimplified) .filter(Objects::nonNull) .filter(r -> !allRelations.contains(r)) .collect(Collectors.toList()); allRelations.addAll(newRelations); workList.addAll(newRelations); } return RelationState.UNDETERMINED; }
Source:
<code>public void compute(final IterableInterval<T> input, final DoubleType output) { final double[][] matrix = getCooccurrenceMatrix(input); final double[] pxminusy = coocPXMinusYFunc.calculate(matrix); double m = 0.0; for (int i = 0; i < numGreyLevels; i++) { m += i * pxminusy[i]; } double sum = 0.0d; for (int k = 0; k < numGreyLevels; k++) { <START> sum += Math.pow(k - m, 2) * pxminusy[k]; <END> } output.set(sum); }</code><technical_language>FWIW, I benchmarked Math.pow(k - m, 2) (k-m) * (k-m) is difference in performance</technical_language>

Target:
public void compute(final IterableInterval<T> input, final DoubleType output) { final double[][] matrix = getCooccurrenceMatrix(input); final double[] pxminusy = coocPXMinusYFunc.calculate(matrix); double mu = 0.0; for (int i = 0; i < numGreyLevels; i++) { mu += i * pxminusy[i]; } double sum = 0.0d; for (int k = 0; k < numGreyLevels; k++) { sum += Math.pow(k - mu, 2) * pxminusy[k]; } output.set(sum); }
Source:
<code>public void testMerge() throws Exception { cache.put("A", "B"); cache.merge("A", "C", (oldValue, newValue) -> "" + oldValue + newValue); assertEquals("BC", cache.get("A")); cache.merge("A", "C", (oldValue, newValue) -> null); <START> assertNull(cache.get("A")); <END> cache.merge("F", "42", (oldValue, newValue) -> "" + oldValue + newValue); assertEquals("42", cache.get("F")); cache.put("A", "B"); RuntimeException mergeRaisedException = new RuntimeException("hi there"); expectException(RuntimeException.class, "hi there", () -> cache.merge("A", "C", (k, v) -> { throw mergeRaisedException; })); }</code><technical_language>I prefer assertEquals(null, error message contains value; assertNull fails</technical_language>

Target:
public void testMerge() throws Exception { cache.put("A", "B"); cache.merge("A", "C", (oldValue, newValue) -> "" + oldValue + newValue); assertEquals("BC", cache.get("A")); cache.merge("A", "C", (oldValue, newValue) -> null); assertEquals(null, cache.get("A")); cache.merge("F", "42", (oldValue, newValue) -> "" + oldValue + newValue); assertEquals("42", cache.get("F")); cache.put("A", "B"); RuntimeException mergeRaisedException = new RuntimeException("hi there"); expectException(RuntimeException.class, "hi there", () -> cache.merge("A", "C", (k, v) -> { throw mergeRaisedException; })); }
Source:
<code><START> public Bindings createBindings(Entity entity, int depth) <END> { Bindings bindings = new SimpleBindings(); JSObject global = (JSObject) magmaBindings.get("nashorn.global"); JSObject magmaScript = (JSObject) global.getMember(KEY_MAGMA_SCRIPT); JSObject dollarFunction = (JSObject) magmaScript.getMember(KEY_DOLLAR); JSObject bindFunction = (JSObject) dollarFunction.getMember(BIND); Object boundDollar = bindFunction.call(dollarFunction, toScriptEngineValueMap(entity, depth)); bindings.put(KEY_DOLLAR, boundDollar); bindings.put(KEY_NEW_VALUE, magmaScript.getMember(KEY_NEW_VALUE)); bindings.put(KEY_IS_NULL, magmaScript.getMember(KEY_IS_NULL)); return bindings; }</code><technical_language>IntelliJ this method private. I expected this called AlgorithmServiceImpl. Is algorithm service benefiting performance improvements in this PR</technical_language>

Target:
private Bindings createBindings(Entity entity, int depth) { Bindings bindings = new SimpleBindings(); JSObject global = (JSObject) magmaBindings.get("nashorn.global"); JSObject magmaScript = (JSObject) global.getMember(KEY_MAGMA_SCRIPT); JSObject dollarFunction = (JSObject) magmaScript.getMember(KEY_DOLLAR); JSObject bindFunction = (JSObject) dollarFunction.getMember(BIND); Object boundDollar = bindFunction.call(dollarFunction, toScriptEngineValueMap(entity, depth)); bindings.put(KEY_DOLLAR, boundDollar); bindings.put(KEY_NEW_VALUE, magmaScript.getMember(KEY_NEW_VALUE)); bindings.put(KEY_IS_NULL, magmaScript.getMember(KEY_IS_NULL)); return bindings; }
Source:
<code>public static boolean isVolatile(IType type) { if (type instanceof ICPPReferenceType) { ICPPReferenceType refType = (ICPPReferenceType) type; return isVolatile(refType.getType()); <START> } else if (type instanceof CPPQualifierType) { <END> CPPQualifierType qualifierType = (CPPQualifierType) type; return qualifierType.isVolatile(); } return false; }</code><technical_language>Const volatile create IQualifierType, represented a flag IPointerType; ExpressionTypes.isVolatile(). Feel free public here. isConst() problem, fix too</technical_language>

Target:
public static boolean isVolatile(IType type) { if (type instanceof ICPPReferenceType) { ICPPReferenceType refType = (ICPPReferenceType) type; return isVolatile(refType.getType()); } return ExpressionTypes.isVolatile(type); }
Source:
<code>public void doAct(StaplerRequest req, StaplerResponse rsp) throws IOException { if(req.hasParameter("dismiss")) { <START> disable(true); <END> rsp.sendRedirect(req.getContextPath()+"/manage"); } else { rsp.sendRedirect(req.getContextPath()+"/pluginManager"); } }</code><technical_language>this (and survive a restart). new issues up? monitor re-appear</technical_language>

Target:
public void doAct(StaplerRequest req, StaplerResponse rsp) throws IOException { if(req.hasParameter("correct")) { rsp.sendRedirect(req.getContextPath()+"/pluginManager"); } }
Source:
<code>public synchronized void aggregate() { if (selector.getObject() instanceof Number) { histogram.add(((Number) selector.getObject()).doubleValue()); } else { throw new IAE("Expected a number, received " + selector.getObject() + " of type " <START> + selector.getObject()); <END> } }</code><technical_language>this java } else { final String msg = selector.getObject() == null ? StringUtils.format("Expected a number, received null") : StringUtils.format( "Expected a number, received [%s] of type [%s]", selector.getObject(), selector.getObject().getClass() ); throw new IAE(msg); }</technical_language>

Target:
public void aggregate() { if (selector.getObject() instanceof Number) { synchronized (this) { histogram.add(((Number) selector.getObject()).doubleValue()); } } else { TDigestSketchUtils.throwExceptionForWrongType(selector); } }
Source:
<code>public static String getDefaultBackingIndexName(String dataStreamName, long generation) { <START> return String.format(Locale.ROOT, ".ds-%s-%06d", dataStreamName, generation); <END> }</code><technical_language>turn .ds- a constant</technical_language>

Target:
public static String getDefaultBackingIndexName(String dataStreamName, long generation) { return String.format(Locale.ROOT, BACKING_INDEX_PREFIX + "%s-%06d", dataStreamName, generation); }
Source:
<code>private StreamPartitionCountMonitor getPartitionCountMonitor(Config config) { Map<String, SystemAdmin> systemAdmins = new HashMap<>(); JavaSystemConfig sysConfig = new JavaSystemConfig(config); sysConfig.getSystemFactories().entrySet().forEach(entry -> { systemAdmins.put(entry.getKey(), entry.getValue().getAdmin(entry.getKey(), config)); }); StreamMetadataCache streamMetadata = new StreamMetadataCache(Util.javaMapAsScalaMap(systemAdmins), 0, SystemClock.instance()); Set<SystemStream> inputStreamsToMonitor = new TaskConfigJava(config).getAllInputStreams(); <START> try { <END> checkArgument(!inputStreamsToMonitor.isEmpty(), "Input streams can not be empty for a job."); } catch (Exception e) { throw new SamzaException("Input streams to a job can not be empty."); } return new StreamPartitionCountMonitor( inputStreamsToMonitor, streamMetadata, this.metrics, new JobConfig(config).getMonitorPartitionChangeFrequency(), streamsChanged -> { if (this.hasDurableStores) { log.error("Input topic partition count changed in a job with durable state. Failing the job."); this.state.status.set(SamzaApplicationState.SamzaAppStatus.FAILED); } coordinatorException = new PartitionChangeException("Input topic partition count changes detected."); }); }</code><technical_language>Simpler re-write this follows? Instead of catching IllegalArgumentException returned checkArgument? if (inputStreamsToMonitor.isEmpty())) { throw new SamzaException("empty ..."); }</technical_language>

Target:
private StreamPartitionCountMonitor getPartitionCountMonitor(Config config) { Map<String, SystemAdmin> systemAdmins = new JavaSystemConfig(config).getSystemAdmins(); StreamMetadataCache streamMetadata = new StreamMetadataCache(Util.javaMapAsScalaMap(systemAdmins), 0, SystemClock.instance()); Set<SystemStream> inputStreamsToMonitor = new TaskConfigJava(config).getAllInputStreams(); if (inputStreamsToMonitor.isEmpty()) { throw new SamzaException("Input streams to a job can not be empty."); } return new StreamPartitionCountMonitor( inputStreamsToMonitor, streamMetadata, metrics, new JobConfig(config).getMonitorPartitionChangeFrequency(), streamsChanged -> { if (hasDurableStores) { log.error("Input topic partition count changed in a job with durable state. Failing the job."); state.status = SamzaApplicationState.SamzaAppStatus.FAILED; } coordinatorException = new PartitionChangeException("Input topic partition count changes detected."); }); }
Source:
<code>public void close() throws IOException { orcDataSource.close(); if (writeChecksumBuilder.isPresent()) { WriteChecksum actualChecksum = writeChecksumBuilder.get().build(); validateWrite(validation -> validation.getChecksum().getTotalRowCount() == actualChecksum.getTotalRowCount(), "Invalid row count"); List<Long> columnHashes = actualChecksum.getColumnHashes(); for (int i = 0; i < columnHashes.size(); i++) { int columnIndex = i; validateWrite(validation -> validation.getChecksum().getColumnHashes().get(columnIndex).equals(columnHashes.get(columnIndex)), "Invalid checksum for column %s", columnIndex); } validateWrite(validation -> validation.getChecksum().getStripeHash() == actualChecksum.getStripeHash(), "Invalid stripes checksum"); } if (fileStatisticsValidation.isPresent()) { List<ColumnStatistics> columnStatistics = fileStatisticsValidation.get().build(); writeValidation.get().validateFileStatistics(orcDataSource.getId(), columnStatistics); } <START> for (StreamReader column : streamReaders) { <END> if (column != null) { column.close(); } } }</code><technical_language>This close() method needs some refactoring stream readers guaranteed closed. For example, if orcDataSource.close() throws above, validations fail? com.google.common.io.Closer, examples of it</technical_language>

Target:
public void close() throws IOException { try (Closer closer = Closer.create()) { closer.register(orcDataSource); for (StreamReader column : streamReaders) { if (column != null) { closer.register(() -> column.close()); } } } if (writeChecksumBuilder.isPresent()) { WriteChecksum actualChecksum = writeChecksumBuilder.get().build(); validateWrite(validation -> validation.getChecksum().getTotalRowCount() == actualChecksum.getTotalRowCount(), "Invalid row count"); List<Long> columnHashes = actualChecksum.getColumnHashes(); for (int i = 0; i < columnHashes.size(); i++) { int columnIndex = i; validateWrite(validation -> validation.getChecksum().getColumnHashes().get(columnIndex).equals(columnHashes.get(columnIndex)), "Invalid checksum for column %s", columnIndex); } validateWrite(validation -> validation.getChecksum().getStripeHash() == actualChecksum.getStripeHash(), "Invalid stripes checksum"); } if (fileStatisticsValidation.isPresent()) { List<ColumnStatistics> columnStatistics = fileStatisticsValidation.get().build(); writeValidation.get().validateFileStatistics(orcDataSource.getId(), columnStatistics); } }
Source:
<code>public int getNumberOfPersistedEntries() { long size = CompletionStages.join(persistenceManager.size()); if (size > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } <START> return (int) size; <END> }</code><technical_language>IMO, return (int) Math.min(size, Integer.MAX_VALUE); (as above)</technical_language>

Target:
public int getNumberOfPersistedEntries() { long size = CompletionStages.join(persistenceManager.size()); return (int) Math.min(size, Integer.MAX_VALUE); }
Source:
<code>public DockerContainerWatchdog() { <START> super("Docker Container Watchdog Asynchronouse Periodic Work"); <END> this.clock = Clock.systemUTC(); }</code><technical_language>Typo: "Asynchronouse" -> "Asynchronous" Personally, tempted this super(DockerContainerWatchdog.class.getSimpleName() + " Asynchronous Periodic Work"); (exact) class name appeared in name</technical_language>

Target:
public DockerContainerWatchdog() { super(String.format("%s Asynchronous Periodic Work", DockerContainerWatchdog.class.getSimpleName())); clock = Clock.systemUTC(); }
Source:
<code>public void onTextChanged(CharSequence s, int start, int before, int count) { mEmailInput.setError(null); <START> mLoginGoogleFragment = null; <END> }</code><technical_language>This effectively turns flag "false" instance variable is null child fragment included in FragmentManager. a confusing state variable in work removing child fragment (right elsewhere, child fragment's work finish perhaps)</technical_language>

Target:
public void onTextChanged(CharSequence s, int start, int before, int count) { mEmailInput.setError(null); isSocialLogin = false; }
Source:
<code>public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("exchange.max-buffer-size", "1GB") .put("exchange.concurrent-request-multiplier", "13") .put("exchange.min-error-duration", "13s") .put("exchange.max-error-duration", "33s") .put("exchange.max-response-size", "1MB") .put("exchange.client-threads", "2") .put("exchange.page-buffer-client.max-callback-threads", "16") .put("exchange.acknowledge-pages", "false") .put("exchange.response-size-exponential-moving-average-decaying-alpha", "0.42") .put("exchange.async-page-transport-enabled", "true") .build(); ExchangeClientConfig expected = new ExchangeClientConfig() .setMaxBufferSize(new DataSize(1, Unit.GIGABYTE)) .setConcurrentRequestMultiplier(13) <START> .setMinErrorDuration(new Duration(13, TimeUnit.SECONDS)) <END> .setMaxErrorDuration(new Duration(33, TimeUnit.SECONDS)) .setMaxResponseSize(new DataSize(1, Unit.MEGABYTE)) .setClientThreads(2) .setPageBufferClientMaxCallbackThreads(16) .setAcknowledgePages(false) .setResponseSizeExponentialMovingAverageDecayingAlpha(0.42) .setAsyncPageTransportEnabled(true); assertFullMapping(properties, expected); }</code><technical_language>unrelated change</technical_language>

Target:
public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("exchange.max-buffer-size", "1GB") .put("exchange.concurrent-request-multiplier", "13") .put("exchange.min-error-duration", "13s") .put("exchange.max-error-duration", "33s") .put("exchange.async-page-transport-timeout", "30s") .put("exchange.max-response-size", "1MB") .put("exchange.client-threads", "2") .put("exchange.page-buffer-client.max-callback-threads", "16") .put("exchange.acknowledge-pages", "false") .put("exchange.response-size-exponential-moving-average-decaying-alpha", "0.42") .put("exchange.async-page-transport-enabled", "true") .build(); ExchangeClientConfig expected = new ExchangeClientConfig() .setMaxBufferSize(new DataSize(1, Unit.GIGABYTE)) .setConcurrentRequestMultiplier(13) .setMinErrorDuration(new Duration(33, TimeUnit.SECONDS)) .setMaxErrorDuration(new Duration(33, TimeUnit.SECONDS)) .setAsyncPageTransportTimeout(new Duration(30, TimeUnit.SECONDS)) .setMaxResponseSize(new DataSize(1, Unit.MEGABYTE)) .setClientThreads(2) .setPageBufferClientMaxCallbackThreads(16) .setAcknowledgePages(false) .setResponseSizeExponentialMovingAverageDecayingAlpha(0.42) .setAsyncPageTransportEnabled(true); assertFullMapping(properties, expected); }
Source:
<code>public ConnectedFuzzyContext withThreshold(float threshold) { <START> return this; <END> }</code><technical_language>Emmanuel, convinced this move. API change deprecated in fact totally ignored. a user, I prefer API break I a chance fix apps</technical_language>

Target:
public ConnectedFuzzyContext withThreshold(float threshold) { termContext.setThreshold( threshold ); return this; }