auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private void validateTypeCombination(OMElement sourceElement, OMElement targetElement) { <END> int sourceType = -1; int targetType = -1; OMAttribute sourceTypeAttr = sourceElement.getAttribute(ATT_TYPE); if (sourceTypeAttr != null && sourceTypeAttr.getAttributeValue() != null) { sourceType = convertTypeToInt(sourceTypeAttr.getAttributeValue()); if (sourceType < 0) { throw new SynapseException("Un-expected source type"); } } else { throw new SynapseException("Source type attribute can't be null"); } OMAttribute targetTypeAttr = targetElement.getAttribute(ATT_TYPE); if (targetTypeAttr != null && targetTypeAttr.getAttributeValue() != null) { targetType = convertTypeToInt(targetTypeAttr.getAttributeValue()); if (targetType < 0) { throw new SynapseException("Un-expected target type"); } if (targetType == 4) { throw new SynapseException("Inline not support for target attribute"); } } else { throw new SynapseException("Target type attribute can't be null"); } if ((sourceType == 1 && targetType == 0) || (sourceType == 1 && targetType == 2) || (sourceType == 2 && targetType == 2) || (sourceType == 0 && targetType == 1) || (sourceType == 1 && targetType == 1) || ( sourceType == 2 && targetType == 1)) { throw new SynapseException("Wrong combination of source and target type"); } }</code><technical_language>java docs explain this ? ( in etc)</technical_language>

Target:
private void validateTypeCombination(OMElement sourceElement, OMElement targetElement) { int sourceType = -1; int targetType = -1; OMAttribute sourceTypeAttr = sourceElement.getAttribute(ATT_TYPE); if (sourceTypeAttr != null && sourceTypeAttr.getAttributeValue() != null) { sourceType = convertTypeToInt(sourceTypeAttr.getAttributeValue()); if (sourceType < 0) { throw new SynapseException("Un-expected source type"); } } else { throw new SynapseException("Source type attribute can't be null"); } OMAttribute targetTypeAttr = targetElement.getAttribute(ATT_TYPE); if (targetTypeAttr != null && targetTypeAttr.getAttributeValue() != null) { targetType = convertTypeToInt(targetTypeAttr.getAttributeValue()); if (targetType < 0) { throw new SynapseException("Un-expected target type"); } if (targetType == 4) { throw new SynapseException("Inline not support for target attribute"); } } else { throw new SynapseException("Target type attribute can't be null"); } if (sourceType == 1) { if (targetType == 0 || targetType == 1 || targetType == 2) { throw new SynapseException("Wrong combination of source and target type"); } } else if (sourceType == 2) { if (targetType == 1 || targetType == 2) { throw new SynapseException("Wrong combination of source and target type"); } } else if (sourceType == 0 && targetType == 1) { throw new SynapseException("Wrong combination of source and target type"); } }
Source:
<code>private void setCustomServer(String s) { SharedPreferences userPreferences = AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance()); SharedPreferences.Editor e = userPreferences.edit(); e.putBoolean("useCustomSyncServer", true); e.putString("syncBaseUrl", s); <START> e.commit(); <END> }</code><technical_language>commit apply question here, answer answers</technical_language>

Target:
private void setCustomServer(String s) { SharedPreferences userPreferences = AnkiDroidApp.getSharedPrefs(AnkiDroidApp.getInstance()); SharedPreferences.Editor e = userPreferences.edit(); e.putBoolean("useCustomSyncServer", true); e.putString("syncBaseUrl", s); e.apply(); }
Source:
<code>private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; try { actionType = Class.forName(String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS)); } catch (ClassNotFoundException cnfe) { } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; Object tempVar = info.newInstance(null); <START> IStorageHelper currentHelper = (IStorageHelper) tempVar; <END> if (currentHelper != null) { _helpers.put(storageType, currentHelper); } } } } catch (Exception ex) { throw new ApplicationException("JTODO missing exception", ex); } }</code><technical_language>Double check this, AFAIK Constructor.newInstance() return null - throws exception if fails, if (currentHelper != null) redundant</technical_language>

Target:
private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; try { actionType = Class.forName(String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS)); } catch (ClassNotFoundException cnfe) { } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; IStorageHelper currentHelper = (IStorageHelper) info.newInstance(null); _helpers.put(storageType, currentHelper); } } } catch (Exception ex) { throw new ApplicationException("JTODO missing exception", ex); } }
Source:
<code>protected void postSaveAction(Guid networkGuid, boolean succeeded) { super.postSaveAction(networkGuid, succeeded); if (!succeeded) { return; } Guid networkId = getNetwork().getId() == null ? networkGuid : getNetwork().getId(); ArrayList<VdcActionParametersBase> actionParameters1 = new ArrayList<VdcActionParametersBase>(); for (NetworkClusterModel networkClusterModel : getClustersToAttach()) { Network tempVar = new Network(); tempVar.setId(networkId); tempVar.setName(getNetwork().getName()); NetworkCluster networkCluster = new NetworkCluster(); networkCluster.setRequired(networkClusterModel.isRequired()); tempVar.setCluster(networkCluster); actionParameters1.add(new AttachNetworkToVdsGroupParameter(networkClusterModel.getEntity(), tempVar)); } Frontend.getInstance().runMultipleAction(VdcActionType.AttachNetworkToVdsGroup, actionParameters1); <START> if ((Boolean) getExport().getEntity() && !getSubnetName().getEntity().isEmpty()) { <END> ExternalSubnet subnet = new ExternalSubnet(); subnet.setName(getSubnetName().getEntity()); subnet.setCidr(getSubnetCidr().getEntity()); subnet.setIpVersion(getSubnetIpVersion().getSelectedItem()); actionParameters1 = new ArrayList<VdcActionParametersBase>(); actionParameters1.add(new AddExternalSubnetParameters(subnet, networkId)); Frontend.getInstance().runMultipleAction(VdcActionType.AddSubnetToProvider, actionParameters1); } }</code><technical_language>initiate subnetName empty string (which can), check for null well</technical_language>

Target:
protected void postSaveAction(Guid networkGuid, boolean succeeded) { super.postSaveAction(networkGuid, succeeded); if (!succeeded) { return; } Guid networkId = getNetwork().getId() == null ? networkGuid : getNetwork().getId(); ArrayList<VdcActionParametersBase> actionParameters1 = new ArrayList<VdcActionParametersBase>(); for (NetworkClusterModel networkClusterModel : getClustersToAttach()) { Network tempVar = new Network(); tempVar.setId(networkId); tempVar.setName(getNetwork().getName()); NetworkCluster networkCluster = new NetworkCluster(); networkCluster.setRequired(networkClusterModel.isRequired()); tempVar.setCluster(networkCluster); actionParameters1.add(new AttachNetworkToVdsGroupParameter(networkClusterModel.getEntity(), tempVar)); } Frontend.getInstance().runMultipleAction(VdcActionType.AttachNetworkToVdsGroup, actionParameters1); if ((Boolean) getExport().getEntity() && !getSubnetName().getEntity().isEmpty()) { ExternalSubnet subnet = new ExternalSubnet(); subnet.setName(getSubnetName().getEntity()); subnet.setCidr(getSubnetCidr().getEntity()); subnet.setIpVersion(getSubnetIpVersion().getSelectedItem()); Frontend.getInstance().runAction(VdcActionType.AddSubnetToProvider, new AddExternalSubnetParameters(subnet, networkId)); } }
Source:
<code>protected void updateUserDistance(User user1, User user2) { if (user1 != null && user2 != null) { double miles = user1.calculateDistance(user2); double feet = MapUtil.convertMilesToFeet(miles); DecimalFormat df = new DecimalFormat("0.00"); String distanceStr = df.format(feet); <START> tvDistance.setText(distanceStr + "ft"); <END> } }</code><technical_language>String constant? :)</technical_language>

Target:
protected void updateUserDistance(User user1, User user2) { if (user1 != null && user2 != null) { double miles = user1.calculateDistance(user2); double feet = MapUtil.convertMilesToFeet(miles); DecimalFormat df = new DecimalFormat("0.00"); String distanceStr = df.format(feet); tvDistance.setText(distanceStr + getResources().getString(R.string.ft)); } }
Source:
<code>public void uncaughtException(Thread t, Throwable e) { <START> LOG.fatal("Critical thread " + t + " crashed!", e); <END> if (HAUtil.isHAEnabled(rmContext.getYarnConfiguration())) { new Thread() { @Override public void run() { rmContext.getResourceManager().handleTransitionToStandBy(); } }.start(); } else { rmContext.getDispatcher().getEventHandler().handle( new RMFatalEvent(RMFatalEventType.CRITICAL_THREAD_CRASH, new Exception(e))); } }</code><technical_language>log t.getName() instead of t itself</technical_language>

Target:
public void uncaughtException(Thread t, Throwable e) { LOG.fatal("Critical thread " + t.getName() + " crashed!", e); if (HAUtil.isHAEnabled(rmContext.getYarnConfiguration())) { rmContext.getResourceManager().handleTransitionToStandByInNewThread(); } else { rmContext.getDispatcher().getEventHandler().handle( new RMFatalEvent(RMFatalEventType.CRITICAL_THREAD_CRASH, new Exception(e))); } }
Source:
<code>private void scrapeBean(MBeanServerConnection beanConn, ObjectName mbeanName) { MBeanInfo info; try { info = beanConn.getMBeanInfo(mbeanName); } catch (IOException e) { logScrape(mbeanName.toString(), "getMBeanInfo Fail: " + e); return; } catch (JMException e) { logScrape(mbeanName.toString(), "getMBeanInfo Fail: " + e); return; } MBeanAttributeInfo[] attrInfos = info.getAttributes(); Map<String, MBeanAttributeInfo> name2AttrInfo = new LinkedHashMap<String, MBeanAttributeInfo>(); for (int idx = 0; idx < attrInfos.length; ++idx) { MBeanAttributeInfo attr = attrInfos[idx]; if (!attr.isReadable()) { logScrape(mbeanName, attr, "not readable"); continue; } name2AttrInfo.put(attr.getName(), attr); } AttributeList attributes; try { attributes = beanConn.getAttributes(mbeanName, name2AttrInfo.keySet().toArray(new String[0])); } catch (Exception e) { throw new RuntimeException("Failed to read attributes " + name2AttrInfo.keySet() + " from " + mbeanName); } for (Object o : attributes) { if (o instanceof Attribute) { Attribute attribute = (Attribute) o; MBeanAttributeInfo attr = name2AttrInfo.get(attribute.getName()); logScrape(mbeanName, attr, "process"); processBeanValue( mbeanName.getDomain(), jmxMBeanPropertyCache.getKeyPropertyList(mbeanName), new LinkedList<String>(), attr.getName(), attr.getType(), attr.getDescription(), attribute.getValue() ); <START> }else { <END> throw new IllegalStateException("Item from attribute list is not of type Attribute [" + o.getClass().getSimpleName() + "]: " + o + " from mbean: " + mbeanName); } } }</code><technical_language>space }</technical_language>

Target:
private void scrapeBean(MBeanServerConnection beanConn, ObjectName mbeanName) { MBeanInfo info; try { info = beanConn.getMBeanInfo(mbeanName); } catch (IOException e) { logScrape(mbeanName.toString(), "getMBeanInfo Fail: " + e); return; } catch (JMException e) { logScrape(mbeanName.toString(), "getMBeanInfo Fail: " + e); return; } MBeanAttributeInfo[] attrInfos = info.getAttributes(); Map<String, MBeanAttributeInfo> name2AttrInfo = new LinkedHashMap<String, MBeanAttributeInfo>(); for (int idx = 0; idx < attrInfos.length; ++idx) { MBeanAttributeInfo attr = attrInfos[idx]; if (!attr.isReadable()) { logScrape(mbeanName, attr, "not readable"); continue; } name2AttrInfo.put(attr.getName(), attr); } final AttributeList attributes; try { attributes = beanConn.getAttributes(mbeanName, name2AttrInfo.keySet().toArray(new String[0])); } catch (Exception e) { logScrape(mbeanName, name2AttrInfo.keySet(), "Fail: " + e); return; } for (Attribute attribute : attributes.asList()) { MBeanAttributeInfo attr = name2AttrInfo.get(attribute.getName()); logScrape(mbeanName, attr, "process"); processBeanValue( mbeanName.getDomain(), jmxMBeanPropertyCache.getKeyPropertyList(mbeanName), new LinkedList<String>(), attr.getName(), attr.getType(), attr.getDescription(), attribute.getValue() ); } }
Source:
<code>private void parseEvent(CommonTree eventNode) throws ParseException { List<CommonTree> children = eventNode.getChildren(); if (children == null) { throw new ParseException("Empty event block"); } EventDeclaration event = new EventDeclaration(); pushScope(); for (CommonTree child : children) { switch (child.getType()) { case CTFParser.TYPEALIAS: parseTypealias(child); break; case CTFParser.TYPEDEF: parseTypedef(child); break; case CTFParser.CTF_EXPRESSION_TYPE: case CTFParser.CTF_EXPRESSION_VAL: parseEventDeclaration(child, event); break; default: childTypeError(child); break; } } if (!event.nameIsSet()) { throw new ParseException("Event name not set"); } if (!event.streamIsSet()) { CTFStream stream = fTrace.getStream(0L); <START> <END> if (stream != null) { event.setStream(stream); } else { throw new ParseException("Event without stream_id, but there is no stream without id"); } if (fTrace.nbStreams() > 1) { throw new ParseException("Event without stream_id with more than one stream"); } } event.getStream().addEvent(event); popScope(); }</code><technical_language>set a flag : atleastoneunsetevent</technical_language>

Target:
private void parseEvent(CommonTree eventNode) throws ParseException { List<CommonTree> children = eventNode.getChildren(); if (children == null) { throw new ParseException("Empty event block"); } EventDeclaration event = new EventDeclaration(); pushScope(); for (CommonTree child : children) { switch (child.getType()) { case CTFParser.TYPEALIAS: parseTypealias(child); break; case CTFParser.TYPEDEF: parseTypedef(child); break; case CTFParser.CTF_EXPRESSION_TYPE: case CTFParser.CTF_EXPRESSION_VAL: parseEventDeclaration(child, event); break; default: childTypeError(child); break; } } if (!event.nameIsSet()) { throw new ParseException("Event name not set"); } if (!event.streamIsSet()) { fHasEventsWithUnsetStreams = true; CTFStream stream = fTrace.getStream(0L); if (stream != null) { event.setStream(stream); } else { throw new ParseException("Event without stream_id, but there is no stream without id"); } if (fTrace.nbStreams() > 1) { throw new ParseException("Event without stream_id with more than one stream"); } } event.getStream().addEvent(event); popScope(); }
Source:
<code>protected IsWidget createIcon() { Span iconSpan = new Span(); iconSpan.addStyleName(Styles.FONT_AWESOME_BASE); if (SnapshotStatus.IN_PREVIEW.equals(getEntity().getStatus())) { iconSpan.addStyleName(IconType.EYE.getCssName()); } else if (SnapshotStatus.LOCKED.equals(getEntity().getStatus())) { iconSpan.addStyleName(IconType.LOCK.getCssName()); } else { <START> iconSpan.addStyleName(getEntity().containsMemory() ? IconType.MICROCHIP.getCssName() : <END> IconType.CAMERA.getCssName()); } iconSpan.addStyleName(PatternflyConstants.PF_LIST_VIEW_ICON_SM); iconPanel.add(iconSpan); return iconPanel; }</code><technical_language>extract another 'else if' branch, consistency.</technical_language>

Target:
protected IsWidget createIcon() { Span iconSpan = new Span(); iconSpan.addStyleName(Styles.FONT_AWESOME_BASE); if (SnapshotStatus.IN_PREVIEW.equals(getEntity().getStatus())) { iconSpan.addStyleName(IconType.EYE.getCssName()); } else if (SnapshotStatus.LOCKED.equals(getEntity().getStatus())) { iconSpan.addStyleName(IconType.LOCK.getCssName()); } else if (getEntity().containsMemory()) { iconSpan.addStyleName(IconType.MICROCHIP.getCssName()); } else { iconSpan.addStyleName(IconType.CAMERA.getCssName()); } iconSpan.addStyleName(PatternflyConstants.PF_LIST_VIEW_ICON_SM); iconPanel.add(iconSpan); return iconPanel; }
Source:
<code>public void beginWindow(long windowId) { totalTuples = normalTuples = laggardsTuples = lateLaggardsTuples = errorTuples = 0; percentNormal = percentLaggards = percentLateLaggards = percentErrors = 0.0f; <START> logger.debug("bufferTime tumblingWindowTime laggardsWindowTime {}, timestampKeyName {}", <END> bufferTime, tumblingWindowTime, laggardsWindowTime, timestampKeyName); }</code><technical_language>log in beginwindow? do in setup?</technical_language>

Target:
public void beginWindow(long windowId) { totalTuples = normalTuples = laggardsTuples = lateLaggardsTuples = errorTuples = 0; }
Source:
<code>public Response postRequest(URI url, String payload, Map<String, String> headers, MediaType mediaType, String metricsPrefix) throws GatewayClientException, GatewayClientRuntimeException { Stopwatch responseTimeStopwatch = Stopwatch.createStarted(); try { Invocation.Builder clientBuilder = client.target(url.toString()) .request(); headers.keySet().forEach(headerKey -> clientBuilder.header(headerKey, headers.get(headerKey))); Response response = clientBuilder .post(Entity.entity(payload, mediaType)); throwIfErrorResponse(response, metricsPrefix); return response; } catch (RuntimeException e) { metricRegistry.counter(metricsPrefix + ".failures").inc(); logger.error(format("Exception for gateway url=%s", url.toString()), e); throw new GatewayClientRuntimeException(url.toString(), e); } finally { responseTimeStopwatch.stop(); <START> metricRegistry.histogram(metricsPrefix + ".response_time").update(responseTimeStopwatch.elapsed(TimeUnit.MILLISECONDS)); <END> } }</code><technical_language>feel uncomfortable of calls throw RuntimeException: client.target, client.target(url.toString()).request(), Entity.entity, url.toString() etc. code interested in catching ProcessingException explicitly map GatewayErrors (<LINK_0> catch other RuntimeExceptions really, automatically throw a 500 response stack trace logged</technical_language>

Target:
public Response postRequest(URI url, String payload, Map<String, String> headers, MediaType mediaType, String metricsPrefix) throws GatewayClientException, GatewayClientRuntimeException { Stopwatch responseTimeStopwatch = Stopwatch.createStarted(); Response response; try { Invocation.Builder clientBuilder = client.target(url.toString()) .request(); headers.keySet().forEach(headerKey -> clientBuilder.header(headerKey, headers.get(headerKey))); response = clientBuilder .post(Entity.entity(payload, mediaType)); } catch (Exception e) { metricRegistry.counter(metricsPrefix + ".failures").inc(); logger.error(format("Exception for gateway url=%s", url.toString()), e); throw new GatewayClientRuntimeException(url.toString(), e); } finally { responseTimeStopwatch.stop(); metricRegistry.histogram(metricsPrefix + ".response_time").update(responseTimeStopwatch.elapsed(TimeUnit.MILLISECONDS)); } throwIfErrorResponse(response, metricsPrefix); return response; }
Source:
<code>public void visitNode(Tree tree) { AnnotationTree annotation = (AnnotationTree) tree; if (annotation.symbolType().is("org.springframework.security.config.annotation.web.configuration.EnableWebSecurity")) { annotation.arguments().stream() .filter(SpringSecurityDebugModeCheck::isDebugArgument) .map(AssignmentExpressionTree.class::cast) <START> .filter(assignment -> Boolean.TRUE.equals(ConstantUtils.resolveAsBooleanConstant(assignment.expression()))) <END> .findFirst() .ifPresent(assignment -> reportIssue(assignment, "Deactivate Spring Security's debug mode.")); } }</code><technical_language>This filter part of "isDebugArgument" function avoid implicit coupling "isDebugArgument" cast AssignmentExpressionTree. I "isDebugArgument" a "getDebugArgument" possibly returning null filtering non-null values</technical_language>

Target:
public void visitNode(Tree tree) { AnnotationTree annotation = (AnnotationTree) tree; if (annotation.symbolType().is("org.springframework.security.config.annotation.web.configuration.EnableWebSecurity")) { annotation.arguments().stream() .map(SpringSecurityDebugModeCheck::getDebugArgument) .filter(Objects::nonNull) .findFirst() .filter(assignment -> Boolean.TRUE.equals(ConstantUtils.resolveAsBooleanConstant(assignment.expression()))) .ifPresent(assignment -> reportIssue(assignment, "Deactivate Spring Security's debug mode.")); } }
Source:
<code>private int computeTimeDelta(List<Metric> list) { int size = list.size(); IntSummaryStatistics stats = IntStream.range(1, size) .map( x -> (int) (list.get(size - x).getTime().getTime() - list.get(size - x - 1).getTime().getTime())) .filter(d -> (d >= 0 && d < minFrequencyMillisAllowed)) .summaryStatistics(); int result = -1; <START> if (stats.getCount() > 5) { <END> result = stats.getMin(); log.info("stats: " + stats); } return result; }</code><technical_language>is rational of 5 threshold? is hardcode threshold. Public static final int THRESHOLD = 5; if(stats.getCount() > THRESHOLD)</technical_language>

Target:
private int computeTimeDelta(List<Metric> list) { int size = list.size(); IntSummaryStatistics stats = IntStream.range(1, size) .map( x -> (int) (list.get(size - x).getTime().getTime() - list.get(size - x - 1).getTime().getTime())) .filter(d -> (d >= 0 && d < minFrequencyMillisAllowed)) .summaryStatistics(); int result = -1; if (stats.getCount() > BURST_THRESHOLD) { result = stats.getMin(); log.info("stats: " + stats); } return result; }
Source:
<code>void fireEvent(Event event, IAccount account) { <START> listeners.stream().forEach(listener -> { <END> switch (event) { case ACCOUNT_ADDED: listener.accountAdded(this, account); break; case ACCOUNT_REMOVED: listener.accountRemoved(this, account); break; } }); }</code><technical_language>call forEach once, stream()</technical_language>

Target:
void fireEvent(Event event, IAccount account) { listeners.forEach(listener -> { switch (event) { case ACCOUNT_ADDED: listener.accountAdded(this, account); break; case ACCOUNT_REMOVED: listener.accountRemoved(this, account); break; } }); }
Source:
<code>private void checkLowReplication(long now) { try { for (Entry<WAL, RollController> entry : wals.entrySet()) { WAL wal = entry.getKey(); <START> boolean needRollAlready = entry.getValue().isRollRequested(); <END> if (needRollAlready || !(wal instanceof AbstractFSWAL)) { continue; } ((AbstractFSWAL<?>) wal).checkLogLowReplication(checkLowReplicationInterval); } } catch (Throwable e) { LOG.warn("Failed checking low replication", e); } }</code><technical_language>Previously, for a roll of periodic roll, in Map TRUE right? Means checked also. of reason, WAL is marked for roll, dont do this check. is missing now</technical_language>

Target:
private void checkLowReplication(long now) { try { for (Entry<WAL, RollController> entry : wals.entrySet()) { WAL wal = entry.getKey(); boolean needRollAlready = entry.getValue().needsRoll(now); if (needRollAlready || !(wal instanceof AbstractFSWAL)) { continue; } ((AbstractFSWAL<?>) wal).checkLogLowReplication(checkLowReplicationInterval); } } catch (Throwable e) { LOG.warn("Failed checking low replication", e); } }
Source:
<code>public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key.equalsIgnoreCase("icons-pack")) { KissApplication.getIconsHandler(this).loadIconsPack(sharedPreferences.getString(key, "default")); } if (key.equalsIgnoreCase("sort-apps")) { final AppProvider provider = KissApplication.getDataHandler(this).getAppProvider(); if (provider != null) { provider.reload(); } } if(key.equalsIgnoreCase("theme")) { requireFullRestart = true; finish(); return; } if (requireRestartSettings.contains(key)) { requireFullRestart = true; <START> } <END> if ("enable-sms-history".equals(key) || "enable-phone-history".equals(key)) { if ("enable-sms-history".equals(key)) { PackageManagerUtils.enableComponent(this, IncomingSmsHandler.class, sharedPreferences.getBoolean(key, false)); } else { PackageManagerUtils.enableComponent(this, IncomingCallHandler.class, sharedPreferences.getBoolean(key, false)); } } }</code><technical_language>[PEDANTIC] leave "theme" in requireRestartSettings list move check for calling this.finish() this requireFullRestart = true; assignment? IMHO clearer changing theme special in is a more "restarty" kind of restart other values. if(requireRestartSettings.contains(key)) { this.requireFullRestart = true; // Theme changes require settings reloaded give user instant feedback if(key.equalsIgnoreCase("theme")) { this.finish(); } }</technical_language>

Target:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key.equalsIgnoreCase("icons-pack")) { KissApplication.getIconsHandler(this).loadIconsPack(sharedPreferences.getString(key, "default")); } if (key.equalsIgnoreCase("sort-apps")) { final AppProvider provider = KissApplication.getDataHandler(this).getAppProvider(); if (provider != null) { provider.reload(); } } if (requireRestartSettings.contains(key)) { requireFullRestart = true; if(key.equalsIgnoreCase("theme")) { finish(); return; } } if ("enable-sms-history".equals(key) || "enable-phone-history".equals(key)) { if ("enable-sms-history".equals(key)) { PackageManagerUtils.enableComponent(this, IncomingSmsHandler.class, sharedPreferences.getBoolean(key, false)); } else { PackageManagerUtils.enableComponent(this, IncomingCallHandler.class, sharedPreferences.getBoolean(key, false)); } } }
Source:
<code>public void testSwitchTheme() { final int theme = UserPreferences.getTheme(); int otherTheme; if (theme == de.danoeh.antennapod.core.R.style.Theme_AntennaPod_Light) { otherTheme = R.string.pref_theme_title_dark; } else { otherTheme = R.string.pref_theme_title_light; } clickPreference(R.string.user_interface_label); clickPreference(R.string.pref_set_theme_title); <START> clickPreference(otherTheme); <END> Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> UserPreferences.getTheme() != theme); }</code><technical_language>careful. This is a preference option in a dialog</technical_language>

Target:
public void testSwitchTheme() { final int theme = UserPreferences.getTheme(); int otherTheme; if (theme == de.danoeh.antennapod.core.R.style.Theme_AntennaPod_Light) { otherTheme = R.string.pref_theme_title_dark; } else { otherTheme = R.string.pref_theme_title_light; } clickPreference(R.string.user_interface_label); clickPreference(R.string.pref_set_theme_title); onView(withText(otherTheme)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> UserPreferences.getTheme() != theme); }
Source:
<code><START> public WebSocketClientHandshaker13(URI webSocketURL, WebSocketVersion version, String subprotocol, <END> boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl) { super(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis, absoluteUpgradeUrl); this.allowExtensions = allowExtensions; this.performMasking = performMasking; this.allowMaskMismatch = allowMaskMismatch; }</code><technical_language>constructors package-private for</technical_language>

Target:
WebSocketClientHandshaker13(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl) { super(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis, absoluteUpgradeUrl); this.allowExtensions = allowExtensions; this.performMasking = performMasking; this.allowMaskMismatch = allowMaskMismatch; }
Source:
<code>public void testHealthCheck() throws IOException { <START> ProbeManager pm = Framework.getLocalService(ProbeManager.class); <END> Collection<ProbeInfo> healthCheckProbes = pm.getAllContributeToHealthCheckProbeInfos(); assertEquals(1, healthCheckProbes.size()); ProbeInfo probeInfo = (ProbeInfo) healthCheckProbes.toArray()[0]; HealthCheckResult result = pm.getOrRunHealthCheck(); assertTrue(result.isHealthy()); assertTrue(probeInfo.getStatus().isSuccess()); assertEquals("{\"healthCheck\":[{\"runtimeStatus\":[\"ok\"]}]}", result.toJson()); result = pm.getOrRunHealthCheckSingleProbe("runtimeStatus"); assertTrue(result.isHealthy()); assertTrue(probeInfo.getStatus().isSuccess()); assertEquals("{\"healthCheck\":[{\"runtimeStatus\":[\"ok\"]}]}", result.toJson()); }</code><technical_language>getLocalService for a releases, please getService instead</technical_language>

Target:
public void testHealthCheck() throws IOException { Collection<ProbeInfo> healthCheckProbes = pm.getHealthCheckProbes(); assertEquals(2, healthCheckProbes.size()); HealthCheckResult result = pm.getOrRunHealthChecks(); assertTrue(result.isHealthy()); assertEquals("{\"runtimeStatus\":\"ok\",\"repositoryStatus\":\"ok\"}", result.toJson()); }
Source:
<code>private String checkStage(EDBStage stage) { <START> if (stage != null) { <END> return stage.getStageId(); } return null; }</code><technical_language>write return stage != null ? stage.getStageId() : null; spare some lines : )</technical_language>

Target:
private String checkStage(EDBStage stage) { return stage != null ? stage.getStageId() : null; }
Source:
<code>public float[] getEmbeddingVector(String term) throws IOException { IndexSearcher searcher = new IndexSearcher(reader); <START> Query query = AnalyzerUtils.buildBagOfWordsQuery(FIELD_ID, new WhitespaceAnalyzer(), term); <END> TopDocs rs = searcher.search(query, 1); ScoredDocuments docs = ScoredDocuments.fromTopDocs(rs, searcher); byte[] val = docs.documents[0].getField(FIELD_BODY).binaryValue().bytes; FloatBuffer floatBuffer = ByteBuffer.wrap(val).asFloatBuffer(); float[] floatArray = new float[floatBuffer.limit()]; floatBuffer.get(floatArray); return floatArray; }</code><technical_language>create a singleton - static final instance creating a new object time</technical_language>

Target:
public float[] getEmbeddingVector(String term) throws IOException { Query query = AnalyzerUtils.buildBagOfWordsQuery(FIELD_ID, analyzer, term); TopDocs rs = searcher.search(query, 1); ScoredDocuments docs = ScoredDocuments.fromTopDocs(rs, searcher); byte[] val = docs.documents[0].getField(FIELD_BODY).binaryValue().bytes; FloatBuffer floatBuffer = ByteBuffer.wrap(val).asFloatBuffer(); float[] floatArray = new float[floatBuffer.limit()]; floatBuffer.get(floatArray); return floatArray; }
Source:
<code>public PatchRequestScope( String baseUrlEndPoint, String path, String apiVersion, DataStoreTransaction transaction, User user, UUID requestId, ElideSettings elideSettings) { super( baseUrlEndPoint, path, apiVersion, (JsonApiDocument) null, transaction, user, (MultivaluedMap<String, String>) null, <START> (MultivaluedMap<String, String>) null, <END> requestId, elideSettings ); }</code><technical_language>empty hashmap</technical_language>

Target:
public PatchRequestScope( String baseUrlEndPoint, String path, String apiVersion, DataStoreTransaction transaction, User user, UUID requestId, ElideSettings elideSettings) { super( baseUrlEndPoint, path, apiVersion, (JsonApiDocument) null, transaction, user, (MultivaluedMap<String, String>) null, Collections.emptyMap(), requestId, elideSettings ); }
Source:
<code>protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = getDefaultStandaloneCacheConfig(isTransactional()); c.indexing() .enable() .addIndexedEntity(TestEntity.class) .addIndexedEntity(AnotherTestEntity.class) <START> .addProperty(SearchConfig.DIRECTORY_TYPE, SearchConfig.HEAP); <END> return TestCacheManagerFactory.createCacheManager(QueryTestSCI.INSTANCE, c); }</code><technical_language>happened near-real-time error handler? latter, tests currently</technical_language>

Target:
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = getDefaultStandaloneCacheConfig(isTransactional()); c.indexing() .enable() .addIndexedEntity(TestEntity.class) .addIndexedEntity(AnotherTestEntity.class) .addProperty(SearchConfig.DIRECTORY_TYPE, SearchConfig.HEAP) .addProperty(SearchConfig.ERROR_HANDLER, StaticTestingErrorHandler.class.getName()); return TestCacheManagerFactory.createCacheManager(QueryTestSCI.INSTANCE, c); }
Source:
<code>private long getEstimatedTotalNumberOfLines(String filePath) { long fileSize = new File(filePath).length(); long singleLineSize = bodyFile.length() / MAX_NUMBER_OF_LINES; long headFileSize = headFile.length(); boolean headDeleted = headFile.delete(); <START> boolean bodyDeleted = bodyFile.delete(); <END> if (!headDeleted || !bodyDeleted) { logger.debug("Couldn't delete the temporary files used for the estimation: and {}", headFile, bodyFile); } long estimatedTotalNumberOfLines = ((fileSize - headFileSize) / singleLineSize); return estimatedTotalNumberOfLines; }</code><technical_language>[File.deleteOnExit()](<LINK_0> instead</technical_language>

Target:
private long getEstimatedTotalNumberOfLines(String filePath) { long fileSize = new File(filePath).length(); long singleLineSize = bodyFile.length() / MAX_NUMBER_OF_LINES; long headFileSize = headFile.length(); headFile.deleteOnExit(); bodyFile.deleteOnExit(); long estimatedTotalNumberOfLines = ((fileSize - headFileSize) / singleLineSize); return estimatedTotalNumberOfLines; }
Source:
<code>public void refreshModel() { modifiedSeveritySinceLastRun.clear(); Set<IResource> localDirty = new <START> HashSet<>(dirty); <END> synchronized (this.dirty) { this.dirty.removeAll(localDirty); } removeFromCache(localDirty); modifiedSeveritySinceLastRun.addAll(localDirty); try { for (IMarker marker : WorkbenchNavigatorPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)) { IResource resource = marker.getResource(); if (resource != null && (neverRan || localDirty.contains(resource))) { int severity = marker.getAttribute(IMarker.SEVERITY, 0); if (severity >= 0) { propagateSeverityToCache(resource, severity); } } } neverRan = false; } catch (CoreException e) { WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); throw new RuntimeException(e); } catch (CancellationException e) { } }</code><technical_language>this synchronized block</technical_language>

Target:
public void refreshModel() { modifiedSeveritySinceLastRun.clear(); Set<IResource> localDirty = null; synchronized (this.dirty) { localDirty = new HashSet<>(dirty); this.dirty.removeAll(localDirty); } removeFromCache(localDirty); modifiedSeveritySinceLastRun.addAll(localDirty); try { for (IMarker marker : WorkbenchNavigatorPlugin.getWorkspace().getRoot().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)) { IResource resource = marker.getResource(); if (resource != null && (neverRan || localDirty.contains(resource))) { int severity = marker.getAttribute(IMarker.SEVERITY, -1); if (severity >= 0) { propagateSeverityToCache(resource, severity); } } } neverRan = false; } catch (CoreException e) { WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); throw new RuntimeException(e); } catch (CancellationException e) { } }
Source:
<code>private static <E> View<E> load(JobContext jobContext) { Configuration conf = Hadoop.JobContext.getConfiguration.invoke(jobContext); Class<E> type = getType(jobContext); String outputUri = conf.get(KITE_OUTPUT_URI); <START> DefaultConfiguration.set(conf); <END> return Datasets.<E, View<E>>load(outputUri, type); }</code><technical_language>this done in OutputCommitter#setupTask instead of here? This method called more once, want ensure set environment config time task. setupTask methods a good place, a reason do here</technical_language>

Target:
private static <E> View<E> load(JobContext jobContext) { Configuration conf = Hadoop.JobContext.getConfiguration.invoke(jobContext); Class<E> type = getType(jobContext); String outputUri = conf.get(KITE_OUTPUT_URI); return Datasets.<E, View<E>>load(outputUri, type); }
Source:
<code>public static void sendIMCOutdatedMessage() { NBTTagCompound tag = new NBTTagCompound(); tag.setString("newVersion", newVersion); tag.setString("updateUrl", "<LINK_2>"); tag.setBoolean("isDirectLink", false); String changeLogString = ""; <START> for (String changeLogLine : changeLog) { <END> changeLogString = changeLogString + changeLogLine + "\n"; } tag.setString("changeLog", changeLogString); sentIMCMessage = FMLInterModComms.sendMessage("VersionChecker", "addUpdate", tag); }</code><technical_language><LINK_0></technical_language>

Target:
public static void sendIMCOutdatedMessage() { if (Loader.isModLoaded("VersionChecker")) { NBTTagCompound tag = new NBTTagCompound(); tag.setString("oldVersion", LogisticsPipes.VERSION); tag.setString("newVersion", newVersion); tag.setString("updateUrl", "<LINK_1>"); tag.setBoolean("isDirectLink", false); StringBuilder stringBuilder = new StringBuilder(); for (String changeLogLine : changeLog) { stringBuilder.append(changeLogLine).append("\n"); } tag.setString("changeLog", stringBuilder.toString()); FMLInterModComms.sendRuntimeMessage("LogisticsPipes", "VersionChecker", "addUpdate", tag); sentIMCMessage = true; } }
Source:
<code>public Type getValidatedType() { <START> return TypeHelper.extractType( validatorClass ); <END> }</code><technical_language>do this in constructor a final variable it</technical_language>

Target:
public Type getValidatedType() { return validatedType; }
Source:
<code>public long fastForwardDataBase() throws IOException { <START> PlayBackListener listener = new PlayBackListener(){ <END> public void onTxnLoaded(TxnHeader hdr,Record txn){ Request r = new Request(0, hdr.getCxid(), hdr.getType(), hdr, txn, hdr.getZxid()); addCommittedProposal(r); } }; long zxid = snapLog.fastForwardFromEdits(dataTree, sessionsWithTimeouts, listener); initialized = true; return zxid; }</code><technical_language>I nice extract common logic of methods a separate one</technical_language>

Target:
public long fastForwardDataBase() throws IOException { long zxid = snapLog.fastForwardFromEdits(dataTree, sessionsWithTimeouts, commitProposalPlaybackListener); initialized = true; return zxid; }
Source:
<code>private void registerContainerDeletionSyncTask(StateMachineEngine engine) { Map<String, TaskFactory> taskFactoryMap = new HashMap<>(); <START> taskFactoryMap.put(String.format("%s", CloudContainerDeletionSyncTask.class.getSimpleName()), new TaskFactory() { <END> @Override public Task createNewTask(TaskCallbackContext context) { return new CloudContainerDeletionSyncTask(accountService, storeConfig.storeContainerDeletionRetentionDays, cloudDestination); } }); if (!taskFactoryMap.isEmpty()) { engine.registerStateModelFactory(TaskConstants.STATE_MODEL_NAME, new TaskStateModelFactory(manager, taskFactoryMap)); } }</code><technical_language>String.format(...) is unnecessary</technical_language>

Target:
private void registerContainerDeletionSyncTask(StateMachineEngine engine) { Map<String, TaskFactory> taskFactoryMap = new HashMap<>(); taskFactoryMap.put(DeprecatedContainerCloudSyncTask.class.getSimpleName(), new TaskFactory() { @Override public Task createNewTask(TaskCallbackContext context) { return new DeprecatedContainerCloudSyncTask(accountService, storeConfig.storeContainerDeletionRetentionDays, cloudDestination); } }); if (!taskFactoryMap.isEmpty()) { engine.registerStateModelFactory(TaskConstants.STATE_MODEL_NAME, new TaskStateModelFactory(manager, taskFactoryMap)); } }
Source:
<code>public void TestATFDelayBTF(String wikiName, String article, int delaySec, boolean isWgVarOn) throws InterruptedException { PageObjectLogging.log("wgAdDriverDelayBelowTheFold", String.valueOf(isWgVarOn), true); String testedPage = urlBuilder.getUrlForPath(wikiName, article); AdsBaseObject adsBaseObject = new AdsBaseObject(driver, testedPage, PAGE_SIZE); adsBaseObject.waitPageLoaded(); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.MEDREC)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.TOP_LB)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.INVISIBLE_SKIN)); if (isWgVarOn) { Assertion.assertFalse(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.PREFOOTER_LEFT)); Assertion.assertFalse(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.PREFOOTER_RIGHT)); Assertion.assertFalse(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.LEFT_SKYSCRAPPER_3)); Assertion.assertFalse(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.FLOATING_MEDREC)); <START> Thread.sleep(1000 * delaySec); <END> } Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.PREFOOTER_LEFT)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.PREFOOTER_RIGHT)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.LEFT_SKYSCRAPPER_3)); Assertion.assertTrue(adsBaseObject.checkIfSlotOnPageLoaded(AdsContent.FLOATING_MEDREC)); }</code><technical_language>waiting for this vars change some delay, is this delay part of functionality? a good place for explicit wait</technical_language>

Target:
public void TestATFDelayBTF(String wikiName, String article, int delaySec, boolean isWgVarOn) throws InterruptedException { PageObjectLogging.log("wgAdDriverDelayBelowTheFold", String.valueOf(isWgVarOn), true); String testedPage = urlBuilder.getUrlForPath(wikiName, article); AdsBaseObject adsBaseObject = new AdsBaseObject(driver, testedPage, PAGE_SIZE); adsBaseObject.waitPageLoaded(); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.MEDREC)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.TOP_LB)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.INVISIBLE_SKIN)); if (isWgVarOn) { Assertion.assertFalse(adsBaseObject.isSlotOnPageLoaded(AdsContent.PREFOOTER_LEFT)); Assertion.assertFalse(adsBaseObject.isSlotOnPageLoaded(AdsContent.PREFOOTER_RIGHT)); Assertion.assertFalse(adsBaseObject.isSlotOnPageLoaded(AdsContent.LEFT_SKYSCRAPPER_3)); Assertion.assertFalse(adsBaseObject.isSlotOnPageLoaded(AdsContent.FLOATING_MEDREC)); Thread.sleep(1000 * delaySec); } Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.PREFOOTER_LEFT)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.PREFOOTER_RIGHT)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.LEFT_SKYSCRAPPER_3)); Assertion.assertTrue(adsBaseObject.isSlotOnPageLoaded(AdsContent.FLOATING_MEDREC)); }
Source:
<code>public static String validateContribQnGiverRecipient( FeedbackQuestionAttributes updatedQuestion) { if(updatedQuestion.questionType == FeedbackQuestionType.CONTRIB) { String errorMsg = ""; if(FeedbackParticipantType.STUDENTS != updatedQuestion.giverType) { log.severe("Unexpected giverType for contribution question: " + updatedQuestion.giverType + " (forced to :" + FeedbackParticipantType.STUDENTS + ")"); updatedQuestion.giverType = FeedbackParticipantType.STUDENTS; errorMsg = ERROR_CONTRIB_QN_INVALID_FEEDBACK_PATH; } if(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF != updatedQuestion.recipientType) { log.severe("Unexpected recipientType for contribution question: " + updatedQuestion.recipientType + " (forced to :" + FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF + ")"); updatedQuestion.recipientType = FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF; errorMsg = ERROR_CONTRIB_QN_INVALID_FEEDBACK_PATH; } Assumption.assertTrue("Contrib Qn Invalid visibility options", (updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER) == updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) && (updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) == updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.OWN_TEAM_MEMBERS)))); return errorMsg; <START> } else { <END> return ""; } }</code><technical_language>I else is if. Try do early return instead. e.g. if(updatedQuestion.questionType != FeedbackQuestionType.CONTRIB) { return ""; } reduces nesting too</technical_language>

Target:
public static String validateContribQnGiverRecipient( FeedbackQuestionAttributes updatedQuestion) { if(updatedQuestion.questionType != FeedbackQuestionType.CONTRIB){ return ""; } String errorMsg = ""; if(FeedbackParticipantType.STUDENTS != updatedQuestion.giverType) { log.severe("Unexpected giverType for contribution question: " + updatedQuestion.giverType + " (forced to :" + FeedbackParticipantType.STUDENTS + ")"); updatedQuestion.giverType = FeedbackParticipantType.STUDENTS; errorMsg = ERROR_CONTRIB_QN_INVALID_FEEDBACK_PATH; } if(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF != updatedQuestion.recipientType) { log.severe("Unexpected recipientType for contribution question: " + updatedQuestion.recipientType + " (forced to :" + FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF + ")"); updatedQuestion.recipientType = FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF; errorMsg = ERROR_CONTRIB_QN_INVALID_FEEDBACK_PATH; } Assumption.assertTrue("Contrib Qn Invalid visibility options", (updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER) == updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) && (updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS) == updatedQuestion.showResponsesTo.contains(FeedbackParticipantType.OWN_TEAM_MEMBERS)))); return errorMsg; }
Source:
<code>public <K> AbstractKeyedStateBackend<K> createKeyedStateBackend( Environment env, JobID jobID, String operatorIdentifier, TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, MetricGroup metricGroup, @Nonnull Collection<KeyedStateHandle> stateHandles, CloseableRegistry cancelStreamRegistry) throws BackendBuildingException { TaskStateManager taskStateManager = env.getTaskStateManager(); LocalRecoveryConfig localRecoveryConfig = taskStateManager.createLocalRecoveryConfig(); HeapPriorityQueueSetFactory priorityQueueSetFactory = new HeapPriorityQueueSetFactory(keyGroupRange, numberOfKeyGroups, 128); <START> ReadableConfig config = env.getTaskManagerInfo().getConfiguration(); int fsReadBufferSize = config.get(CheckpointingOptions.FS_READ_BUFFER_SIZE); <END> return new HeapKeyedStateBackendBuilder<>( kvStateRegistry, keySerializer, env.getUserCodeClassLoader().asClassLoader(), numberOfKeyGroups, keyGroupRange, env.getExecutionConfig(), fsReadBufferSize, ttlTimeProvider, stateHandles, AbstractStateBackend.getCompressionDecorator(env.getExecutionConfig()), localRecoveryConfig, priorityQueueSetFactory, isUsingAsynchronousSnapshots(), cancelStreamRegistry).build(); }</code><technical_language>Do do this here, config passed configure method. async flag is set</technical_language>

Target:
public <K> AbstractKeyedStateBackend<K> createKeyedStateBackend( Environment env, JobID jobID, String operatorIdentifier, TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange, TaskKvStateRegistry kvStateRegistry, TtlTimeProvider ttlTimeProvider, MetricGroup metricGroup, @Nonnull Collection<KeyedStateHandle> stateHandles, CloseableRegistry cancelStreamRegistry) throws BackendBuildingException { TaskStateManager taskStateManager = env.getTaskStateManager(); LocalRecoveryConfig localRecoveryConfig = taskStateManager.createLocalRecoveryConfig(); HeapPriorityQueueSetFactory priorityQueueSetFactory = new HeapPriorityQueueSetFactory(keyGroupRange, numberOfKeyGroups, 128); return new HeapKeyedStateBackendBuilder<>( kvStateRegistry, keySerializer, env.getUserCodeClassLoader().asClassLoader(), numberOfKeyGroups, keyGroupRange, env.getExecutionConfig(), ttlTimeProvider, stateHandles, AbstractStateBackend.getCompressionDecorator(env.getExecutionConfig()), localRecoveryConfig, priorityQueueSetFactory, isUsingAsynchronousSnapshots(), cancelStreamRegistry).build(); }
Source:
<code>public static void validateOptions(GenomicsDatasetOptions options) { <START> Preconditions.checkState(0 < options.getBinSize(), "binSize must be greater than zero"); <END> }</code><technical_language>checkArgument more here</technical_language>

Target:
public static void validateOptions(GenomicsDatasetOptions options) { Preconditions.checkArgument(0 < options.getBinSize(), "binSize must be greater than zero"); GenomicsOptions.Methods.validateOptions(options); }