auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void initializeMetricCaches() { <START> timerMetricCache = CacheBuilder.newBuilder().build(new CacheLoader<Method, Timer>() { <END> @Override public Timer load(final Method method) { final String serviceInterfaceName = serviceInterface.getSimpleName(); final String methodName = method.getName(); final String timerMetricName = DOT_JOINER.join("killbill-service", "kb_plugin_latency", serviceName, serviceInterfaceName, methodName); return metricRegistry.timer(timerMetricName); } }); errorMetricCache = CacheBuilder.newBuilder().build(new CacheLoader<Method, Meter>() { @Override public Meter load(final Method method) { final String serviceInterfaceName = serviceInterface.getSimpleName(); final String methodName = method.getName(); final String counterMetricName = DOT_JOINER.join("killbill-service", "kb_plugin_errors", serviceName, serviceInterfaceName, methodName); return metricRegistry.meter(counterMetricName); } }); }</code><technical_language>Method#equals do right (assuming Guava's cache equals for keys comparison)</technical_language>

Target:
private void initializeMetricCaches() { timerMetricCache = CacheBuilder.newBuilder().build(new CacheLoader<String, Timer>() { @Override public Timer load(final String methodName) { final String timerMetricName = DOT_JOINER.join("killbill-service", "kb_plugin_latency", serviceName, serviceInterfaceName, methodName); return metricRegistry.timer(timerMetricName); } }); errorMetricCache = CacheBuilder.newBuilder().build(new CacheLoader<String, Meter>() { @Override public Meter load(final String methodName) { final String counterMetricName = DOT_JOINER.join("killbill-service", "kb_plugin_errors", serviceName, serviceInterfaceName, methodName); return metricRegistry.meter(counterMetricName); } }); }
Source:
<code>public boolean layoutDependsOn(CoordinatorLayout parent, V child, View dependency) { if (dependency instanceof Snackbar.SnackbarLayout) { if (snackBarHeight == -1) { snackBarHeight = dependency.getHeight(); } <START> dependency.setPadding(dependency.getPaddingLeft(), <END> dependency.getPaddingTop(), dependency.getPaddingRight(), snackBarHeight + child.getMeasuredHeight()); child.bringToFront(); return true; } return false; }</code><technical_language>Consider margin if works. reason is margin is a layout hint container View sits in. Padding changes View itself</technical_language>

Target:
public boolean layoutDependsOn(CoordinatorLayout parent, V child, View dependency) { if (dependency instanceof Snackbar.SnackbarLayout) { ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) dependency.getLayoutParams(); layoutParams.bottomMargin = child.getMeasuredHeight(); child.bringToFront(); return true; } return false; }
Source:
<code>private VDS getAlternateUpServerInCluster(Guid clusterId, Guid vdsId) { List<VDS> vdsList = <START> getVdsDao().getAllForClusterWithStatus(clusterId, <END> VDSStatus.Up); if (vdsList.isEmpty()) { return null; } for (VDS vds : vdsList) { if (!vdsId.equals(vds.getId()) && vds.getExternalStatus() == ExternalStatus.Ok) { return vds; } } return null; }</code><technical_language>I want call new method servers based glusterPeerStatus</technical_language>

Target:
private VDS getAlternateUpServerInCluster(Guid clusterId, Guid vdsId) { List<VDS> vdsList = getVdsDao().getAllForClusterWithStatusAndPeerStatus(clusterId, VDSStatus.Up, PeerStatus.CONNECTED); if (vdsList.isEmpty()) { return null; } for (VDS vds : vdsList) { if (!vdsId.equals(vds.getId()) && vds.getExternalStatus() == ExternalStatus.Ok) { return vds; } } return null; }
Source:
<code>public void reloadDaemonConfig(Event e) { LOG.info("reloadDaemonConfig: processing reload daemon event..."); DaemonTools.handleReloadEvent(e, DAEMON_NAME, (event)->{ m_discoveryFactory.reload(); this.stop(); this.start(); <START> }); <END> LOG.info("reloadDaemonConfig: reload daemon event processed."); }</code><technical_language>is this implementation before</technical_language>

Target:
public void reloadDaemonConfig(Event e) { LOG.info("reloadDaemonConfig: processing reload daemon event..."); if (isReloadConfigEventTarget(e)) { reloadAndReStart(); } LOG.info("reloadDaemonConfig: reload daemon event processed."); }
Source:
<code>private static String formatLocalDateTime(LocalDateTime localDateTime, String pattern) { if (localDateTime == null || pattern == null) { return ""; } String processedPattern = pattern; if (localDateTime.getHour() == 12 && localDateTime.getMinute() == 0) { processedPattern = pattern.replace("a", "'NOON'"); } <START> DateTimeFormatter formatter = DateTimeFormatter.ofPattern(processedPattern, Locale.US); <END> return localDateTime.format(formatter); }</code><technical_language>extract a TeammatesDateTimeFormatter DateTimeFormatter.withLocale(Locale.US) for use</technical_language>

Target:
private static String formatLocalDateTime(LocalDateTime localDateTime, String pattern) { if (localDateTime == null || pattern == null) { return ""; } String processedPattern = pattern; if (localDateTime.getHour() == 12 && localDateTime.getMinute() == 0) { processedPattern = pattern.replace("a", "'NOON'"); } DateTimeFormatter formatter = DateTimeFormatter.ofPattern(processedPattern); return localDateTime.format(formatter); }
Source:
<code>public double calculateHeadingPower(double humanRotationalPower) { if (humanRotationalPower > humanThreshold.get()) { inAutomaticMode = false; lastHumanInput = Timer.getFPGATimestamp(); return humanRotationalPower; } double timeSinceHumanInput = Timer.getFPGATimestamp() - lastHumanInput; if (timeSinceHumanInput < coastTime.get()) { return 0; } else if (timeSinceHumanInput >= coastTime.get() && !inAutomaticMode) { desiredHeading = pose.getCurrentHeading().getValue(); inAutomaticMode = true; headingModule.reset(); decayModule.reset(); return 0; } else { switch (headingMode) { <START> case HoldOrientation: <END> return headingModule.calculateHeadingPower(desiredHeading); case DecayVelocity: return decayModule.calculateHeadingPower(0); default: return 0; } } }</code><technical_language>_this instance_ is a painfully common intentional formatting style of switch statements; I change formatter settings fix this</technical_language>

Target:
public double calculateHeadingPower(double humanRotationalPower) { if (humanRotationalPower > humanThreshold.get()) { inAutomaticMode = false; lastHumanInput = Timer.getFPGATimestamp(); return humanRotationalPower; } double timeSinceHumanInput = Timer.getFPGATimestamp() - lastHumanInput; if (timeSinceHumanInput < coastTime.get()) { return 0; } else if (timeSinceHumanInput >= coastTime.get() && !inAutomaticMode) { desiredHeading = pose.getCurrentHeading().getValue(); inAutomaticMode = true; headingModule.reset(); decayModule.reset(); return 0; } else { if (headingMode == null) { log.warn("Heading module did not have any mode set. Forcing to HoldOrientation."); this.headingMode = HeadingAssistMode.HoldOrientation; } switch (headingMode) { case HoldOrientation: return headingModule.calculateHeadingPower(desiredHeading); case DecayVelocity: return decayModule.calculateHeadingPower(0); default: return 0; } } }
Source:
<code>private void onAddBricksInternal() { VolumeBrickModel volumeBrickModel = (VolumeBrickModel) getWindow(); cancelConfirmation(); if (!volumeBrickModel.validate()) { return; } GlusterVolumeType selectedVolumeType = (GlusterVolumeType) getTypeList().getSelectedItem(); <START> if (selectedVolumeType == GlusterVolumeType.REPLICATE <END> || selectedVolumeType == GlusterVolumeType.DISTRIBUTED_REPLICATE) { getReplicaCount().setEntity(volumeBrickModel.getReplicaCount().getEntity()); } else if (selectedVolumeType == GlusterVolumeType.STRIPE || selectedVolumeType == GlusterVolumeType.DISTRIBUTED_STRIPE) { getStripeCount().setEntity(volumeBrickModel.getStripeCount().getEntity()); } else if (selectedVolumeType == GlusterVolumeType.STRIPED_REPLICATE || selectedVolumeType == GlusterVolumeType.DISTRIBUTED_STRIPED_REPLICATE) { getReplicaCount().setEntity(volumeBrickModel.getReplicaCount().getEntity()); getStripeCount().setEntity(volumeBrickModel.getStripeCount().getEntity()); } ArrayList<EntityModel> brickList = new ArrayList<EntityModel>(); for (Object object : volumeBrickModel.getBricks().getItems()) { EntityModel entityModel = (EntityModel) object; brickList.add(entityModel); } volumeBrickModel.getBricks().setItems(null); ListModel brickListModel = new ListModel(); brickListModel.setItems(brickList); brickListModel.setSelectedItems(brickList); setBricks(brickListModel); setWindow(null); }</code><technical_language>Switch-case</technical_language>

Target:
private void onAddBricksInternal() { VolumeBrickModel volumeBrickModel = (VolumeBrickModel) getWindow(); cancelConfirmation(); if (!volumeBrickModel.validate()) { return; } GlusterVolumeType selectedVolumeType = (GlusterVolumeType) getTypeList().getSelectedItem(); if (selectedVolumeType.isReplicatedType()) { getReplicaCount().setEntity(volumeBrickModel.getReplicaCount().getEntity()); } if (selectedVolumeType.isStripedType()) { getStripeCount().setEntity(volumeBrickModel.getStripeCount().getEntity()); } ArrayList<EntityModel> brickList = new ArrayList<EntityModel>(); for (Object object : volumeBrickModel.getBricks().getItems()) { EntityModel entityModel = (EntityModel) object; brickList.add(entityModel); } volumeBrickModel.getBricks().setItems(null); ListModel brickListModel = new ListModel(); brickListModel.setItems(brickList); brickListModel.setSelectedItems(brickList); setBricks(brickListModel); setWindow(null); }
Source:
<code>public static boolean isEmptyDirectory(String location) throws Exception { String[] files = ImportUtils.getFileSystem(location).getExistingFiles(location, "*"); <START> if ((files.length == 0) || (files.length == 1 && truncateFileNameFromFullPath(files[0]).equals("_SUCCESS"))) <END> return true; else return false; }</code><technical_language>following: return files.length == 0 || (files.length == 1 && "_SUCCESS".equals(truncateFileNameFromFullPath(files[0])) Note I changed order in equals</technical_language>

Target:
public static boolean isEmptyDirectory(String location) throws Exception { String[] files = ImportUtils.getFileSystem(location).getExistingFiles(location, "*"); return ((files.length == 0) || (files.length == 1 && "_SUCCESS".equals(truncateFileNameFromFullPath(files[0])))); }
Source:
<code>public <T> T construct(Class<T> componentType) { if (componentType.equals(LockContainer.class)) { boolean notTransactional = !configuration.transaction().transactionMode().isTransactional(); LockContainer<?> lockContainer = configuration.locking().useLockStriping() ? notTransactional ? new ReentrantStripedLockContainer(configuration.locking().concurrencyLevel(), configuration.dataContainer().keyEquivalence()) : new OwnableReentrantStripedLockContainer(configuration.locking().concurrencyLevel(), configuration.dataContainer().keyEquivalence()) : notTransactional ? new ReentrantPerEntryLockContainer(configuration.locking().concurrencyLevel(), configuration.dataContainer().keyEquivalence()) : new OwnableReentrantPerEntryLockContainer(configuration.locking().concurrencyLevel(), configuration.dataContainer().keyEquivalence()); return (T) lockContainer; } <START> throw new CacheConfigurationException("Don't know how to create a " + componentType.getName()); <END> }</code><technical_language>I remove if check exception myself. Other factories do this check</technical_language>

Target:
public <T> T construct(Class<T> componentType) { boolean notTransactional = !configuration.transaction().transactionMode().isTransactional(); LockContainer<?> lockContainer = configuration.locking().useLockStriping() ? notTransactional ? new ReentrantStripedLockContainer(configuration.locking().concurrencyLevel(), configuration.dataContainer().keyEquivalence()) : new OwnableReentrantStripedLockContainer(configuration.locking().concurrencyLevel(), configuration.dataContainer().keyEquivalence()) : notTransactional ? new ReentrantPerEntryLockContainer(configuration.locking().concurrencyLevel(), configuration.dataContainer().keyEquivalence()) : new OwnableReentrantPerEntryLockContainer(configuration.locking().concurrencyLevel(), configuration.dataContainer().keyEquivalence()); return (T) lockContainer; }
Source:
<code><START> public ArtifactoryHttpClient(String artifactoryUrl, String username, String password, String accessToken, Log log) { <END> this.artifactoryUrl = StringUtils.stripEnd(artifactoryUrl, "/"); this.username = username; this.password = password; this.accessToken = accessToken; this.log = log; }</code><technical_language>reason need a constructor username/password access token? This is reflected in other constructors in code</technical_language>

Target:
private ArtifactoryHttpClient(String artifactoryUrl, String username, String password, String accessToken, Log log) { this.artifactoryUrl = StringUtils.stripEnd(artifactoryUrl, "/"); this.username = username; this.password = password; this.accessToken = accessToken; this.log = log; }
Source:
<code>public Endpoint parse() throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { <START> String id = parser.getAttributeValue(null, "id"); <END> Vector<StackOperation> stackOperations = new Vector<>(); Vector<String> arguments = new Vector<>(); while (nextTagInBlock(NAME_ENDPOINT)) { String tagName = parser.getName().toLowerCase(); if (tagName.contentEquals(NAME_ARGUMENT)) { String argumentID = parser.getAttributeValue(null, "id"); if (argumentID == null || argumentID.isEmpty()) { throw new InvalidStructureException("argument must define a non empty id", parser); } arguments.add(argumentID); } else if (tagName.contentEquals(NAME_STACK)) { StackOpParser sop = new StackOpParser(parser); while (this.nextTagInBlock(NAME_STACK)) { stackOperations.add(sop.parse()); } } } return new Endpoint(id, arguments, stackOperations); }</code><technical_language>this id null empty</technical_language>

Target:
public Endpoint parse() throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { String endpointId = parser.getAttributeValue(null, "id"); if (endpointId == null || endpointId.isEmpty()) { throw new InvalidStructureException("endpoint must define a non empty id", parser); } Vector<StackOperation> stackOperations = new Vector<>(); Vector<String> arguments = new Vector<>(); while (nextTagInBlock(NAME_ENDPOINT)) { String tagName = parser.getName().toLowerCase(); if (tagName.contentEquals(NAME_ARGUMENT)) { String argumentID = parser.getAttributeValue(null, "id"); if (argumentID == null || argumentID.isEmpty()) { throw new InvalidStructureException("argument must define a non empty id", parser); } arguments.add(argumentID); } else if (tagName.contentEquals(NAME_STACK)) { StackOpParser sop = new StackOpParser(parser); while (this.nextTagInBlock(NAME_STACK)) { stackOperations.add(sop.parse()); } } } return new Endpoint(endpointId, arguments, stackOperations); }
Source:
<code>public void shouldSearchAndReturnAListOfLogEntriesWithGivenSourceUuid() throws Exception { MockHttpServletRequest req = request(RequestMethod.GET, getURI()); <START> req.addParameter("source", "0d47284f-9e9b-4a81-a88b-8bb42bc0a901"); <END> SimpleObject result = deserialize(handle(req)); Assert.assertNotNull(result); Assert.assertEquals(3, Util.getResultsSize(result)); }</code><technical_language>declare constants top of file for source, generatedBy uuid's</technical_language>

Target:
public void shouldSearchAndReturnAListOfLogEntriesWithGivenSourceUuid() throws Exception { MockHttpServletRequest req = request(RequestMethod.GET, getURI()); req.addParameter("source", LOG_ENTRY_SOURCE_UUID); SimpleObject result = deserialize(handle(req)); Assert.assertNotNull(result); Assert.assertEquals(3, Util.getResultsSize(result)); }
Source:
<code>private void parseUrl() { try { URI uri = new URI(UriUtils.encodeURIComponent(template.getUrl())); if (uri.getScheme() != null && uri.getScheme().equalsIgnoreCase("nfs")) { srcHost = uri.getHost(); srcPath = uri.getPath(); } } catch (URISyntaxException e) { throw new CloudRuntimeException("Invalid NFS url " + template.getUrl() + " caused error: " + e.getMessage()); <START> } <END> }</code><technical_language>if passing message of exception, please log stacktrace here</technical_language>

Target:
private void parseUrl() { try { URI uri = new URI(UriUtils.encodeURIComponent(template.getUrl())); if (uri.getScheme() != null && uri.getScheme().equalsIgnoreCase("nfs")) { srcHost = uri.getHost(); srcPath = uri.getPath(); } } catch (URISyntaxException e) { s_logger.error(String.format("Invalid NFS URL: %s", template.getUrl()), e); throw new CloudRuntimeException("Invalid NFS url " + template.getUrl() + " caused error: " + e.getMessage()); } }
Source:
<code>public void scanFile(JavaFileScannerContext context) { this.context = context; <START> scan(context.getTree()); <END> }</code><technical_language>relying semantic raise issue, I verify access semantic model. - for check if semantic present: <LINK_0> - check raising issue semantic is present: <LINK_1></technical_language>

Target:
public void scanFile(JavaFileScannerContext context) { this.context = context; if (context.getSemanticModel() != null) { scan(context.getTree()); } }
Source:
<code>public void extractResponseDetails(FeedbackQuestionType questionType, FeedbackQuestionDetails questionDetails, String[] answer) { List<Integer> constSumAnswer = new ArrayList<Integer>(); <START> for (String element : answer) { <END> try { constSumAnswer.add(Integer.parseInt(element)); } catch (NumberFormatException e) { constSumAnswer.add(0); } } FeedbackConstantSumQuestionDetails constSumQd = (FeedbackConstantSumQuestionDetails) questionDetails; this.setConstantSumResponseDetails(constSumAnswer, constSumQd.getConstSumOptions(), constSumQd.isDistributeToRecipients()); }</code><technical_language>out cleaner change for (String answer : answers) {, more semantical</technical_language>

Target:
public void extractResponseDetails(FeedbackQuestionType questionType, FeedbackQuestionDetails questionDetails, String[] answer) { List<Integer> constSumAnswer = new ArrayList<Integer>(); for (String answerPart : answer) { try { constSumAnswer.add(Integer.parseInt(answerPart)); } catch (NumberFormatException e) { constSumAnswer.add(0); } } FeedbackConstantSumQuestionDetails constSumQd = (FeedbackConstantSumQuestionDetails) questionDetails; this.setConstantSumResponseDetails(constSumAnswer, constSumQd.getConstSumOptions(), constSumQd.isDistributeToRecipients()); }
Source:
<code>private void reportError(String message, Exception exception) { <START> System.out.print(message + exception.getCause()); <END> }</code><technical_language>pls addStatus(new WarnStatus(message,this)); addError(...) report failures</technical_language>

Target:
private void reportError(String message, Exception exception) { addError(message, exception); }
Source:
<code>public static Double getJoinRowCount(RelMetadataQuery mq, Join join, RexNode condition) { if (!join.getJoinType().projectsRight()) { RexNode semiJoinSelectivity = RelMdUtil.makeSemiJoinSelectivityRexNode(mq, join); Double selectivity = mq.getSelectivity(join.getLeft(), semiJoinSelectivity); return NumberUtil.multiply( join.getJoinType() == JoinRelType.SEMI ? selectivity : 1D - selectivity, mq.getRowCount(join.getLeft())); } final Double left = mq.getRowCount(join.getLeft()); final Double right = mq.getRowCount(join.getRight()); if (left == null || right == null) { return null; } if (left <= 1D || right <= 1D) { Double max = mq.getMaxRowCount(join); if (max != null && max <= 1D) { return max; } } double product = left * right; double selectivity = mq.getSelectivity(join, condition); double innerRowCount = product * selectivity; switch (join.getJoinType()) { case INNER: return innerRowCount; case LEFT: return left * (1D - selectivity) + innerRowCount; case RIGHT: return right * (1D - selectivity) + innerRowCount; case FULL: <START> return (left + right) * (1D - selectivity) + innerRowCount; <END> default: throw Util.unexpected(join.getJoinType()); } }</code><technical_language>(1D - selectivity) * left/right estimate number of row,null tuple sense (although relies a good estimation selectivity, is a hard engineering problem :-))</technical_language>

Target:
public static Double getJoinRowCount(RelMetadataQuery mq, Join join, RexNode condition) { if (!join.getJoinType().projectsRight()) { RexNode semiJoinSelectivity = RelMdUtil.makeSemiJoinSelectivityRexNode(mq, join); Double selectivity = mq.getSelectivity(join.getLeft(), semiJoinSelectivity); return NumberUtil.multiply( join.getJoinType() == JoinRelType.SEMI ? selectivity : NumberUtil.subtract(1D, selectivity), mq.getRowCount(join.getLeft())); } final Double left = mq.getRowCount(join.getLeft()); final Double right = mq.getRowCount(join.getRight()); if (left == null || right == null) { return null; } if (left <= 1D || right <= 1D) { Double max = mq.getMaxRowCount(join); if (max != null && max <= 1D) { return max; } } Double selectivity = mq.getSelectivity(join, condition); if (selectivity == null) { return null; } double innerRowCount = left * right * selectivity; switch (join.getJoinType()) { case INNER: return innerRowCount; case LEFT: return left * (1D - selectivity) + innerRowCount; case RIGHT: return right * (1D - selectivity) + innerRowCount; case FULL: return (left + right) * (1D - selectivity) + innerRowCount; default: throw Util.unexpected(join.getJoinType()); } }
Source:
<code>public Iterator<Bucket> iterator() { final int bucketCount = super.getBucketCount(); final double min = super.getMin(); final double max = super.getMax(); <START> <END> Iterator<FixedHistogram.Bucket> baseIterator = super.getIterator(); return new Iterator<Bucket>() { final Iterator<FixedHistogram.Bucket> iterator = baseIterator; @Override public boolean hasNext() { return iterator.hasNext(); } @Override public Bucket next() { if (!hasNext()) { throw new NoSuchElementException(); } final FixedHistogram.Bucket baseValue = iterator.next(); return new Bucket(baseValue.left, baseValue.right, breakdowns.get(baseValue.index)); } @Override public void remove() { throw new UnsupportedOperationException(); } }; }</code><technical_language>members used</technical_language>

Target:
public Iterator<Bucket> iterator() { final int bucketCount = super.getBucketCount(); final double min = super.getMin(); final double max = super.getMax(); Iterator<FixedHistogram.Bucket> baseIterator = super.getIterator(); return new Iterator<Bucket>() { final Iterator<FixedHistogram.Bucket> iterator = baseIterator; @Override public boolean hasNext() { return iterator.hasNext(); } @Override public Bucket next() { if (!hasNext()) { throw new NoSuchElementException(); } final FixedHistogram.Bucket baseValue = iterator.next(); return new Bucket(baseValue.left, baseValue.right, breakdowns[baseValue.index]); } @Override public void remove() { throw new UnsupportedOperationException(); } }; }
Source:
<code><START> public void cantDowngradeIfGlusterNotSupported() { <END> storagePoolVersion35(); cmd.getStoragePool().setCompatibilityVersion(Version.v3_1); StorageDomain sd = new StorageDomain(); sd.setStorageFormat(StorageFormatType.V3); sd.setStorageType(StorageType.GLUSTERFS); setAttachedDomains(sd); mcr.mockConfigValue(ConfigValues.GlusterFsStorageEnabled, cmd.getStoragePool().getCompatibilityVersion(), false); canDoActionFailed(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAINS_ARE_NOT_SUPPORTET_IN_DOWNGRADED_VERSION); }</code><technical_language>is difference gluster/posix tests besides storage type? if difference..let's share code</technical_language>

Target:
public void cantDowngradeIfGlusterNotSupported() { failOnDowngradingWithStorageType(StorageType.GLUSTERFS); }
Source:
<code>public static WebViewClient getWebViewClient(final boolean ignoreErrors, final boolean followLinks, final Form form, final Component component) { return new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { <START> EventDispatcher.dispatchEvent(this, "BeforePageLoad", url); <END> return !followLinks; } @Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { if (ignoreErrors) { handler.proceed(); } else { handler.cancel(); form.dispatchErrorOccurredEvent(component, "WebView", ErrorMessages.ERROR_WEBVIEW_SSL_ERROR); } } @Override public void onPageFinished(WebView view, String url) { EventDispatcher.dispatchEvent(component, "PageLoaded", url); } }; }</code><technical_language>component instead of this. this in this context refer WebViewClient object, Web component (which is needs be)</technical_language>

Target:
public static WebViewClient getWebViewClient(final boolean ignoreErrors, final boolean followLinks, final Form form, final Component component) { return new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { return !followLinks; } @Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { if (ignoreErrors) { handler.proceed(); } else { handler.cancel(); form.dispatchErrorOccurredEvent(component, "WebView", ErrorMessages.ERROR_WEBVIEW_SSL_ERROR); } } @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { EventDispatcher.dispatchEvent(component, "BeforePageLoad", url); } @Override public void onPageFinished(WebView view, String url) { EventDispatcher.dispatchEvent(component, "PageLoaded", url); } }; }
Source:
<code>private <T extends PubSubWebSocketClient> T build(Class<T> clazz) { Preconditions.checkState(context != null, "Context not specified"); String gatewayAddress = context.getValue(LogicalPlan.GATEWAY_CONNECT_ADDRESS); if (gatewayAddress != null) { int timeout = context.getValue(LogicalPlan.PUBSUB_CONNECT_TIMEOUT_MILLIS); boolean gatewayUseSsl = context.getValue(LogicalPlan.GATEWAY_USE_SSL); SharedPubSubWebSocketClient wsClient = null; try { wsClient = new SharedPubSubWebSocketClient((gatewayUseSsl ? "wss://" : "ws://") + gatewayAddress + "/pubsub", timeout); String gatewayUserName = context.getValue(LogicalPlan.GATEWAY_USER_NAME); String gatewayPassword = context.getValue(LogicalPlan.GATEWAY_PASSWORD); if (gatewayUserName != null && gatewayPassword != null) { wsClient.setLoginUrl((gatewayUseSsl ? "https://" : "http://") + gatewayAddress + GATEWAY_LOGIN_URL_PATH); wsClient.setUserName(gatewayUserName); wsClient.setPassword(gatewayPassword); } return (T)wsClient; } catch (URISyntaxException e) { <START> logger.warn("Error initializing websocket, gateway address {}", gatewayAddress, e); <END> } return null; } return null; }</code><technical_language>suggest changing message "Invalid gateway address {}, websocket is initialized" (it is warning error)</technical_language>

Target:
private <T extends PubSubWebSocketClient> T build(Class<T> clazz) { Preconditions.checkState(context != null, "Context not specified"); String gatewayAddress = context.getValue(LogicalPlan.GATEWAY_CONNECT_ADDRESS); if (gatewayAddress != null) { int timeout = context.getValue(LogicalPlan.PUBSUB_CONNECT_TIMEOUT_MILLIS); boolean gatewayUseSsl = context.getValue(LogicalPlan.GATEWAY_USE_SSL); SharedPubSubWebSocketClient wsClient = null; try { wsClient = new SharedPubSubWebSocketClient((gatewayUseSsl ? "wss://" : "ws://") + gatewayAddress + "/pubsub", timeout); String gatewayUserName = context.getValue(LogicalPlan.GATEWAY_USER_NAME); String gatewayPassword = context.getValue(LogicalPlan.GATEWAY_PASSWORD); if (gatewayUserName != null && gatewayPassword != null) { wsClient.setLoginUrl((gatewayUseSsl ? "https://" : "http://") + gatewayAddress + GATEWAY_LOGIN_URL_PATH); wsClient.setUserName(gatewayUserName); wsClient.setPassword(gatewayPassword); } return (T)wsClient; } catch (URISyntaxException e) { logger.warn("Unable to initialize websocket for gateway address {}", gatewayAddress, e); } return null; } return null; }
Source:
<code>private void incrementEventQueueStatistic( ChangeSet changeSet ) { <START> changesLock.lock(); <END> try { if (repositoryStatistics != null) { repositoryStatistics.increment(ValueMetric.EVENT_QUEUE_SIZE); } if (!this.changesReceivedAndDispatched.containsKey(changeSet.hashCode())) { changesReceivedAndDispatched.put(changeSet.hashCode(), new AtomicInteger(listeners.size())); } } finally { changesLock.unlock(); } }</code><technical_language>curious this change made. repositoryStatistics thread safe, lock needed update changesReceivedAndDispatched</technical_language>

Target:
private void incrementEventQueueStatistic( ChangeSet changeSet ) { if (repositoryStatistics != null) { repositoryStatistics.increment(ValueMetric.EVENT_QUEUE_SIZE); } changesLock.lock(); try { if (!this.changesReceivedAndDispatched.containsKey(changeSet.hashCode())) { changesReceivedAndDispatched.put(changeSet.hashCode(), new AtomicInteger(listeners.size())); } } finally { changesLock.unlock(); } }
Source:
<code>public void testBottom() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); checkConfig.addAttribute("option", "bottom"); final String[] expected = { "11: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "javax.swing.JComponent"), "15: " + getCheckMessage(MSG_ORDERING, "java.io.File"), "18: " + getCheckMessage(MSG_ORDERING, "java.awt.Button.ABORT"), "21: " + getCheckMessage(MSG_ORDERING, "java.io.Reader"), <START> "8: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.IOException"), <END> }; verify(checkConfig, getPath("InputImportOrder_Bottom.java"), expected); }</code><technical_language>Please line numbers ordered</technical_language>

Target:
public void testBottom() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); checkConfig.addAttribute("option", "bottom"); final String[] expected = { "8: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.IOException"), "11: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "javax.swing.JComponent"), "14: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.File.*"), "15: " + getCheckMessage(MSG_ORDERING, "java.io.File"), "17: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.File.createTempFile"), "18: " + getCheckMessage(MSG_ORDERING, "java.awt.Button.ABORT"), "21: " + getCheckMessage(MSG_ORDERING, "java.io.Reader"), "21: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.Reader"), }; verify(checkConfig, getPath("InputImportOrder_Bottom.java"), expected); }
Source:
<code>public boolean execute(BuildCommand command, BuildSession buildSession) { URLService urlService = new URLService(); String url = urlService.prefixPartialUrl(command.getStringArg("url")); String dest = command.getStringArg("dest"); String src = command.getStringArg("src"); File artifact = buildSession.resolveRelativeDir(command.getWorkingDirectory(), dest); FileHandler handler = new FileHandler(artifact, src); String checksumUrl = null; ChecksumFileHandler checksumFileHandler = null; if (command.hasArg("checksumUrl")) { checksumUrl = new URLService().prefixPartialUrl(command.getStringArg("checksumUrl")); File checksumFile; if (command.hasArg("checksumFile")) { checksumFile = buildSession.resolveRelativeDir(command.getWorkingDirectory(), command.getStringArg("checksumFile")); } else { checksumFile = TempFiles.createUniqueFile("checksum"); } checksumFileHandler = new ChecksumFileHandler(checksumFile); } boolean fileExist = artifact.exists(); LOG.debug( <START> "Requesting the file [" + artifact.getAbsolutePath() + "], exist? [" + fileExist + "]"); <END> if (fileExist && artifact.isFile()) { try { url += "?sha1=" + URLEncoder.encode(StringUtil.sha1Digest(artifact), "UTF-8"); } catch (UnsupportedEncodingException e) { LOG.error("Download error", e); return false; } } buildSession.download(handler, url, checksumFileHandler, checksumUrl); return true; }</code><technical_language>change this</technical_language>

Target:
public boolean execute(BuildCommand command, BuildSession buildSession) { URLService urlService = new URLService(); String url = urlService.prefixPartialUrl(command.getStringArg("url")); String dest = command.getStringArg("dest"); String src = command.getStringArg("src"); File artifact = buildSession.resolveRelativeDir(command.getWorkingDirectory(), dest); FileHandler handler = new FileHandler(artifact, src); String checksumUrl = null; ChecksumFileHandler checksumFileHandler = null; if (command.hasArg("checksumUrl")) { checksumUrl = new URLService().prefixPartialUrl(command.getStringArg("checksumUrl")); File checksumFile; if (command.hasArg("checksumFile")) { checksumFile = buildSession.resolveRelativeDir(command.getWorkingDirectory(), command.getStringArg("checksumFile")); } else { checksumFile = TempFiles.createUniqueFile("checksum"); } checksumFileHandler = new ChecksumFileHandler(checksumFile); } boolean fileExist = artifact.exists(); LOG.debug("Requesting the file [{}], exist? [{}]", artifact.getAbsolutePath(), fileExist); if (fileExist && artifact.isFile()) { try { url += "?sha1=" + URLEncoder.encode(StringUtil.sha1Digest(artifact), "UTF-8"); } catch (UnsupportedEncodingException e) { LOG.error("Download error", e); return false; } } buildSession.download(handler, url, checksumFileHandler, checksumUrl); return true; }
Source:
<code>public static Path createTemporaryPath(ConnectorSession session, HdfsContext context, HdfsEnvironment hdfsEnvironment, Path targetPath) { <START> String temporaryPrefix = getTemporaryStagingDirectoryLocation(session) <END> .replace("${USER}", context.getIdentity().getUser()); if (isViewFileSystem(context, hdfsEnvironment, targetPath)) { temporaryPrefix = ".hive-staging"; } Path temporaryRoot = new Path(targetPath, temporaryPrefix); Path temporaryPath = new Path(temporaryRoot, randomUUID().toString()); createDirectory(context, hdfsEnvironment, temporaryPath); return temporaryPath; }</code><technical_language>I curious temporaryRoot get formed line 563. if targetPath is hdfs://path/to/your/table, temporaryRoot hdfs://path/to/your/table/tmp/presto-userid/ ? I thought temporary path hdfs://tmp/presto-userid ?..</technical_language>

Target:
public static Path createTemporaryPath(ConnectorSession session, HdfsContext context, HdfsEnvironment hdfsEnvironment, Path targetPath) { String temporaryPrefix = getTemporaryStagingDirectoryPath(session) .replace("${USER}", context.getIdentity().getUser()); if (isViewFileSystem(context, hdfsEnvironment, targetPath)) { temporaryPrefix = ".hive-staging"; } Path temporaryRoot = new Path(targetPath, temporaryPrefix); Path temporaryPath = new Path(temporaryRoot, randomUUID().toString()); createDirectory(context, hdfsEnvironment, temporaryPath); return temporaryPath; }
Source:
<code>public Johan(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{G}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); this.power = new MageInt(5); this.toughness = new MageInt(4); Ability ability = new BeginningOfCombatTriggeredAbility(new CantAttackSourceEffect(Duration.EndOfCombat).setText("you may have {this} gain \"{this} can't attack\" until end of combat"), TargetController.YOU, true); ability.addEffect(new ConditionalContinuousEffect( <START> new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfCombat, new FilterControlledCreaturePermanent("creatures")), <END> new InvertCondition(SourceTappedCondition.instance), "If you do, attacking doesn't cause creatures you control to tap this combat if {this} is untapped")); this.addAbility(ability); }</code><technical_language>issue is creatures technically get vigilance, issue I of is Murganda Petroglyphs. fine though</technical_language>

Target:
public Johan(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{G}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); this.power = new MageInt(5); this.toughness = new MageInt(4); Condition condition = new CompoundCondition("if {this} is untapped", new InvertCondition(SourceTappedCondition.instance), SourceOnBattlefieldCondition.instance); Ability ability = new BeginningOfCombatTriggeredAbility(new CantAttackSourceEffect(Duration.EndOfCombat).setText("you may have {this} gain \"{this} can't attack\" until end of combat"), TargetController.YOU, true); ability.addEffect(new ConditionalContinuousEffect( new GainAbilityControlledEffect(JohanVigilanceAbility.getInstance(), Duration.EndOfCombat, new FilterControlledCreaturePermanent("creatures")), condition, "If you do, attacking doesn't cause creatures you control to tap this combat if {this} is untapped")); this.addAbility(ability); }
Source:
<code>public void handleIntent(Intent intent) { if (Intent.ACTION_SEND.equals(intent.getAction()) && Constants.PLAIN_TEXT_MIME_TYPE.equals(intent.getType())) { <START> new IntentFunnel(WikipediaApp.getInstance()).logShareIntent(); <END> openSearchFromIntent(intent.getStringExtra(Intent.EXTRA_TEXT), SearchFragment.InvokeSource.INTENT_SHARE); } else if (Intent.ACTION_PROCESS_TEXT.equals(intent.getAction()) && Constants.PLAIN_TEXT_MIME_TYPE.equals(intent.getType()) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { new IntentFunnel(WikipediaApp.getInstance()).logProcessTextIntent(); openSearchFromIntent(intent.getStringExtra(Intent.EXTRA_PROCESS_TEXT), SearchFragment.InvokeSource.INTENT_PROCESS_TEXT); } else if (intent.hasExtra(Constants.INTENT_SEARCH_FROM_WIDGET)) { new IntentFunnel(WikipediaApp.getInstance()).logSearchWidgetTap(); openSearchFromIntent(null, SearchFragment.InvokeSource.WIDGET); } }</code><technical_language>present in configurations, consider moving this object creation top of method occur unconditionally</technical_language>

Target:
public void handleIntent(Intent intent) { IntentFunnel funnel = new IntentFunnel(WikipediaApp.getInstance()); if (Intent.ACTION_SEND.equals(intent.getAction()) && Constants.PLAIN_TEXT_MIME_TYPE.equals(intent.getType())) { funnel.logShareIntent(); openSearchFromIntent(intent.getStringExtra(Intent.EXTRA_TEXT), SearchFragment.InvokeSource.INTENT_SHARE); } else if (Intent.ACTION_PROCESS_TEXT.equals(intent.getAction()) && Constants.PLAIN_TEXT_MIME_TYPE.equals(intent.getType()) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { funnel.logProcessTextIntent(); openSearchFromIntent(intent.getStringExtra(Intent.EXTRA_PROCESS_TEXT), SearchFragment.InvokeSource.INTENT_PROCESS_TEXT); } else if (intent.hasExtra(Constants.INTENT_SEARCH_FROM_WIDGET)) { funnel.logSearchWidgetTap(); openSearchFromIntent(null, SearchFragment.InvokeSource.WIDGET); } }
Source:
<code><START> public static ApexStream<String> fromKafka09(String name, String brokers, String topic) <END> { return null; }</code><technical_language>I discuss include fromKafka functions in this class</technical_language>

Target:
public static ApexStream<String> fromKafka09(String name, String brokers, String topic) { throw new UnsupportedOperationException(); }
Source:
<code>public void setRegexp( final String regexp ) { this.regexp = regexp; <START> } <END></code><technical_language>I propose for performance reasons: * signature of setter * Change type of regexp field pattern do assign this.regexp = Pattern.compile(regexp) * Change return type of getRegexp() Pattern In this pattern needs get compiled once, instead of n-times, (where n is number of URLs download?). WDYT</technical_language>

Target:
public void setRegexp( final String regexp ) { this.regexp = Pattern.compile( regexp ); }
Source:
<code>public List<QuotaStorageConsumptionParameter> getQuotaStorageConsumptionParameters() { List<QuotaStorageConsumptionParameter> list = new ArrayList<QuotaStorageConsumptionParameter>(); <START> for (DiskImage disk : getDisksList()) { <END> list.add(new QuotaStorageConsumptionParameter( disk.getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.CONSUME, disk.getstorage_ids().get(0), disk.getActualSize())); } return list; }</code><technical_language>please add a helper method for performing it? this code is repeating in of this patch edited classes</technical_language>

Target:
public List<QuotaConsumptionParameter> getQuotaStorageConsumptionParameters() { List<QuotaConsumptionParameter> list = new ArrayList<QuotaConsumptionParameter>(); for (DiskImage disk : getDisksList()) { list.add(new QuotaStorageConsumptionParameter( disk.getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.CONSUME, disk.getstorage_ids().get(0), disk.getActualSize())); } return list; }
Source:
<code>public void createVirtualNetwork() { Subnet subnet = Subnet.builder().name("subnetName") .properties(SubnetProperties.builder().addressPrefix(TEST_VIRTUALNETWORK_ADDRESS_PREFIX).build()).build(); final VirtualNetwork.VirtualNetworkProperties virtualNetworkProperties = VirtualNetwork.VirtualNetworkProperties .builder().subnets(ImmutableList.<Subnet> of(subnet)) .addressSpace(AddressSpace.create(Arrays.asList(TEST_VIRTUALNETWORK_ADDRESS_PREFIX))).build(); VirtualNetwork vn = api().createOrUpdate(virtualNetworkName, LOCATION, null, virtualNetworkProperties); resourceAvailable.apply(new Supplier<Provisionable>() { @Override public Provisionable get() { VirtualNetwork updated = api().get(virtualNetworkName); return updated == null ? null : updated.properties(); } <START> }); <END> assertEquals(vn.name(), virtualNetworkName); assertEquals(vn.location(), LOCATION); }</code><technical_language>is a [NetworkAvailablePredicate](<LINK_0>; ad base test class predicates instead</technical_language>

Target:
public void createVirtualNetwork() { Subnet subnet = Subnet.builder().name("subnetName") .properties(SubnetProperties.builder().addressPrefix(TEST_VIRTUALNETWORK_ADDRESS_PREFIX).build()).build(); final VirtualNetwork.VirtualNetworkProperties virtualNetworkProperties = VirtualNetwork.VirtualNetworkProperties .builder().subnets(ImmutableList.<Subnet> of(subnet)) .addressSpace(AddressSpace.create(Arrays.asList(TEST_VIRTUALNETWORK_ADDRESS_PREFIX))).build(); VirtualNetwork vn = api().createOrUpdate(virtualNetworkName, LOCATION, null, virtualNetworkProperties); networkAvailablePredicate.create(resourceGroupName).apply(virtualNetworkName); assertEquals(vn.name(), virtualNetworkName); assertEquals(vn.location(), LOCATION); }
Source:
<code>public void performAction(BasePanel panel, ParserResult parserResult) { BibDatabaseMode mode = getBibDatabaseModeFromParserResult(parserResult); <START> ImportCustomEntryTypesDialog dlg = new ImportCustomEntryTypesDialog(mode, getListOfUnknownAndUnequalCustomizations(parserResult)); <END> dlg.showAndWait(); }</code><technical_language>abbreviations</technical_language>

Target:
public void performAction(BasePanel panel, ParserResult parserResult) { BibDatabaseMode mode = getBibDatabaseModeFromParserResult(parserResult); ImportCustomEntryTypesDialog importCustomEntryTypesDialog = new ImportCustomEntryTypesDialog(mode, getListOfUnknownAndUnequalCustomizations(parserResult)); importCustomEntryTypesDialog.showAndWait(); }
Source:
<code>public Concat() { super(new Column[] { <START> new Column("org/apache/tajo/storage/text", TajoDataTypes.Type.TEXT), <END> }); }</code><technical_language>This changed while refactor 'text'</technical_language>

Target:
public Concat() { super(new Column[] { new Column("text", TajoDataTypes.Type.TEXT), }); }
Source:
<code>public AppUrl(String url) { this(Config.APP_URL, url); <START> } <END></code><technical_language>Yes, need similar factory methods. in Config, other in test code</technical_language>

Target:
public AppUrl(String url) { super(url); Assumption.assertTrue(url.startsWith("http")); }
Source:
<code>private void search (Pattern p) { try { getExtensionSearch().search(p.pattern(), ExtensionSearch.Type.All, true, false); <START> } catch (NullPointerException npe) { <END> String warningMsg = Constant.messages.getString("httpsessions.popup.find.warning"); View.getSingleton().showWarningDialog(warningMsg); LOG.warn("Unable to search. Is the search extension disabled?"); LOG.debug(npe.getMessage(), npe); } }</code><technical_language>remove this menu is added if extension is enabled</technical_language>

Target:
private void search (Pattern p) { getExtensionSearch().search(p.pattern(), ExtensionSearch.Type.All, true, false); }
Source:
<code>public SessionFunnel(WikipediaApp app) { super(app, SCHEMA_NAME, REVISION, app.isProdRelease() ? Funnel.SAMPLE_LOG_100 : Funnel.SAMPLE_LOG_ALL); sessionData = Prefs.getSessionData(); <START> if (sessionData.getLeadLatency() > 0) { <END> leadSectionLatency.addSample(sessionData.getLeadLatency()); } if (sessionData.getRestLatency() > 0) { restSectionsLatency.addSample(sessionData.getRestLatency()); } if (sessionData.getStartTime() == 0) { sessionData.setStartTime(new Date().getTime()); } touchSession(); }</code><technical_language>unconditionally update SessionData</technical_language>

Target:
public SessionFunnel(WikipediaApp app) { super(app, SCHEMA_NAME, REVISION, app.isProdRelease() ? Funnel.SAMPLE_LOG_100 : Funnel.SAMPLE_LOG_ALL); sessionData = Prefs.getSessionData(); if (sessionData.getStartTime() == 0) { sessionData.setStartTime(System.currentTimeMillis()); sessionData.setLastTouchTime(System.currentTimeMillis()); } touchSession(); }
Source:
<code><START> @SuppressWarnings("UnusedDeclaration") public void shutdown() { <END> cache.clear(); cleanupThread.shutdown(); stats.shutdown(); dispatcher.shutdown(); if (this == singleton) { singleton = null; } shutdown = true; }</code><technical_language>suppression? call shutdown twice</technical_language>

Target:
public void shutdown() { if (shutdown) { return; } cache.clear(); cleanupThread.shutdown(); stats.shutdown(); dispatcher.shutdown(); if (this == singleton) { singleton = null; } shutdown = true; }
Source:
<code>public HealthCheckHandler(RestServerState restServerState) { this.restServerState = restServerState; this.healthCheckUri = restServerState.getHealthCheckUri(); <START> logger.info("Created HealthCheckRequestHandler for restServerHealthCheckUri=" + healthCheckUri); <END> }</code><technical_language>minor: HealthCheckHandler</technical_language>

Target:
public HealthCheckHandler(RestServerState restServerState) { this.restServerState = restServerState; this.healthCheckUri = restServerState.getHealthCheckUri(); logger.info("Created HealthCheckHandler for HealthCheckUri=" + healthCheckUri); }
Source:
<code>private void enforceRing() { enforceRing(null, false); <START> } <END></code><technical_language>ringsize != -1 check done here, allow escaping inlining used., e.g. avoids need call method is lines long, inlined</technical_language>

Target:
private void enforceRing() { if (ringSize != -1) { enforceRing(null, false); } }