auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint, Properties properties) { AddressEndpoint addressEndpoint = new AddressEndpoint(); OMAttribute name = epConfig.getAttribute( new QName(XMLConfigConstants.NULL_NAMESPACE, "name")); if (name != null) { addressEndpoint.setName(name.getAttributeValue()); } OMElement httpStatusElement = epConfig.getFirstChildWithName(new QName(SynapseConstants.SYNAPSE_NAMESPACE, "httpStatus")); if(httpStatusElement != null) { ArrayList<String> l = new ArrayList<String>(); <START> l.add("500"); <END> l.add("501"); l.add("502"); addressEndpoint.setHttpStatusCodes(l); } OMElement addressElement = epConfig.getFirstChildWithName( new QName(SynapseConstants.SYNAPSE_NAMESPACE, "address")); if (addressElement != null) { EndpointDefinition definition = createEndpointDefinition(addressElement); addressEndpoint.setDefinition(definition); processAuditStatus(definition, addressEndpoint.getName(), addressElement); } processProperties(addressEndpoint, epConfig); return addressEndpoint; }</code><technical_language>values harcoded</technical_language>

Target:
protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint, Properties properties) { AddressEndpoint addressEndpoint = new AddressEndpoint(); OMAttribute name = epConfig.getAttribute( new QName(XMLConfigConstants.NULL_NAMESPACE, "name")); if (name != null) { addressEndpoint.setName(name.getAttributeValue()); } OMElement addressElement = epConfig.getFirstChildWithName( new QName(SynapseConstants.SYNAPSE_NAMESPACE, "address")); if (addressElement != null) { EndpointDefinition definition = createEndpointDefinition(addressElement); addressEndpoint.setDefinition(definition); processAuditStatus(definition, addressEndpoint.getName(), addressElement); } processProperties(addressEndpoint, epConfig); return addressEndpoint; }
Source:
<code>private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; String formattedClassName = String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS); try { actionType = Class.forName(formattedClassName); } catch (ClassNotFoundException cnfe) { <START> if (storageType != StorageType.ALL && storageType != StorageType.UNKNOWN) <END> { log.debugFormat("StorageHelperDirector Error:: the lookup for following class has failed: {0}" , formattedClassName); } } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; IStorageHelper currentHelper = (IStorageHelper) info.newInstance(null); _helpers.put(storageType, currentHelper); } } } catch (Exception ex) { log.error("StorageHelperDirector Error:: exception was encountered during InitializeHelpers() execution", ex); throw new ApplicationException("JTODO missing exception", ex); } }</code><technical_language>skip exceptions in for loop? try run Class.forName classes in place</technical_language>

Target:
private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { if (storageType != StorageType.ALL && storageType != StorageType.UNKNOWN) { Class<?> actionType = null; String formattedClassName = String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS); try { actionType = Class.forName(formattedClassName); } catch (ClassNotFoundException cnfe) { log.debugFormat("StorageHelperDirector Error:: the lookup for following class has failed: {0}" , formattedClassName); } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; IStorageHelper currentHelper = (IStorageHelper) info.newInstance(null); _helpers.put(storageType, currentHelper); } } } } catch (Exception ex) { log.error("StorageHelperDirector Error:: exception was encountered during InitializeHelpers() execution", ex); throw new ApplicationException("JTODO missing exception", ex); } }
Source:
<code>private String sliceAddress(String assignment) { String[] tokens = assignment.split("\\p{javaSpaceChar}+"); if (tokens.length < 1) { <START> throw new RuntimeException("Could not find ip address"); <END> } return tokens[0]; }</code><technical_language>here, helps debug</technical_language>

Target:
private String sliceAddress(String assignment) { String[] tokens = assignment.split("\\p{javaSpaceChar}+"); if (tokens.length < 1) { throw new RuntimeException("Could not find ip address in " + assignment); } return tokens[0]; }
Source:
<code>public void messageReceived(IoSession ioSession, Object message) throws Exception { String messageString = (String) message; SessionID remoteSessionID = MessageUtils.getReverseSessionID(messageString); Session quickFixSession = findQFSession(ioSession, remoteSessionID); if (quickFixSession != null) { final boolean rejectGarbledMessage = quickFixSession.isRejectGarbledMessage(); final Log sessionLog = quickFixSession.getLog(); sessionLog.onIncoming(messageString); try { Message fixMessage = parse(quickFixSession, messageString); processMessage(ioSession, fixMessage); } catch (InvalidMessage e) { if (rejectGarbledMessage) { final Message fixMessage = e.getFixMessage(); if ( fixMessage != null ) { sessionLog.onErrorEvent("Processing garbled message: " + e.getMessage()); processMessage(ioSession, fixMessage); return; } } if (MessageUtils.isLogon(messageString)) { sessionLog.onErrorEvent("Invalid LOGON message, disconnecting: " + e.getMessage()); ioSession.closeNow(); } else { sessionLog.onErrorEvent("Invalid message: " + e.getMessage()); } } } else { boolean logMessageWhenSessionNotFound = true; if (sessionSettings.isSetting(Session.SETTING_LOG_MESSAGE_WHEN_SESSION_NOT_FOUND)) { logMessageWhenSessionNotFound = sessionSettings.getBool(Session.SETTING_LOG_MESSAGE_WHEN_SESSION_NOT_FOUND); } if (logMessageWhenSessionNotFound) { log.error("Disconnecting; received message for unknown session: {}", messageString); <START> } else { <END> log.error("Disconnecting; received message for unknown session. remoteSessionID: {}", remoteSessionID); } ioSession.closeNow(); } }</code><technical_language>suggestion } else {</technical_language>

Target:
public void messageReceived(IoSession ioSession, Object message) throws Exception { String messageString = (String) message; SessionID remoteSessionID = MessageUtils.getReverseSessionID(messageString); Session quickFixSession = findQFSession(ioSession, remoteSessionID); if (quickFixSession != null) { final boolean rejectGarbledMessage = quickFixSession.isRejectGarbledMessage(); final Log sessionLog = quickFixSession.getLog(); sessionLog.onIncoming(messageString); try { Message fixMessage = parse(quickFixSession, messageString); processMessage(ioSession, fixMessage); } catch (InvalidMessage e) { if (rejectGarbledMessage) { final Message fixMessage = e.getFixMessage(); if ( fixMessage != null ) { sessionLog.onErrorEvent("Processing garbled message: " + e.getMessage()); processMessage(ioSession, fixMessage); return; } } if (MessageUtils.isLogon(messageString)) { sessionLog.onErrorEvent("Invalid LOGON message, disconnecting: " + e.getMessage()); ioSession.closeNow(); } else { sessionLog.onErrorEvent("Invalid message: " + e.getMessage()); } } } else { if (logMessageWhenSessionNotFound) { log.error("Disconnecting; received message for unknown session: {}", messageString); } else { log.error("Disconnecting; received message for unknown session. remoteSessionID: {}", remoteSessionID); } ioSession.closeNow(); } }
Source:
<code>private void animateInAppMessage(WebViewManager.Position displayLocation, View messageView, View backgroundView) { final CardView messageViewCardView = messageView.findViewWithTag(IN_APP_MESSAGE_CARD_VIEW_TAG); <START> Animation.AnimationListener cardViewAnimCallback = createAnimationListenerForAndroidApi23Elevation(messageViewCardView); <END> switch (displayLocation) { case TOP_BANNER: animateTop(messageViewCardView, webView.getHeight(), cardViewAnimCallback); break; case BOTTOM_BANNER: animateBottom(messageViewCardView, webView.getHeight(), cardViewAnimCallback); break; case CENTER_MODAL: case FULL_SCREEN: animateCenter(messageView, backgroundView, cardViewAnimCallback, null); break; } }</code><technical_language>shoudn't set this for Android 6? case listen for changes</technical_language>

Target:
private void animateInAppMessage(WebViewManager.Position displayLocation, View messageView, View backgroundView) { final CardView messageViewCardView = messageView.findViewWithTag(IN_APP_MESSAGE_CARD_VIEW_TAG); Animation.AnimationListener cardViewAnimCallback = null; if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M) cardViewAnimCallback = createAnimationListenerForAndroidApi23Elevation(messageViewCardView); switch (displayLocation) { case TOP_BANNER: animateTop(messageViewCardView, webView.getHeight(), cardViewAnimCallback); break; case BOTTOM_BANNER: animateBottom(messageViewCardView, webView.getHeight(), cardViewAnimCallback); break; case CENTER_MODAL: case FULL_SCREEN: animateCenter(messageView, backgroundView, cardViewAnimCallback, null); break; } }
Source:
<code>private static Optional<CatchUp> findJob(CatchUpId id, DeliveryRunInfo deliveryInfo) { Optional<CatchUp> stateVisibileToDelivery = deliveryInfo.getCatchUpJobList() .stream() .filter((job) -> job.getId() <START> .equals(id)) <END> .findFirst(); return stateVisibileToDelivery; }</code><technical_language>Consider flipping equals(). one-line instead of two</technical_language>

Target:
private static Optional<CatchUp> findJob(CatchUpId id, DeliveryRunInfo deliveryInfo) { Optional<CatchUp> stateVisibileToDelivery = deliveryInfo.getCatchUpJobList() .stream() .filter((job) -> id.equals(job.getId())) .findFirst(); return stateVisibileToDelivery; }
Source:
<code>fromValue(String value) { try { return valueOf(value); } catch (IllegalArgumentException e) { return UNRECOGNIZED; <START> } <END> }</code><technical_language>[nit] is a cleaner approach Guava: java return Enums.getIfPresent(LoadbalancerAlgorithm.class, value).or(UNRECOGNIZED);</technical_language>

Target:
fromValue(String value) { return Enums.getIfPresent(Algorithm.class, value).or(UNRECOGNIZED); }
Source:
<code>private void doCriticalMemoryHitTestOnServer(boolean createPR, final boolean disabledQueryMonitorForLowMem, final int queryTimeout, final boolean hitCriticalThreshold) { final VM server = VM.getVM(0); final int numObjects = 200; try { final int port = AvailablePortHelper.getRandomAvailableTCPPort(); startCacheServer(server, port, disabledQueryMonitorForLowMem, queryTimeout, createPR); populateData(server); doTestCriticalHeapAndQueryTimeout(server, server, disabledQueryMonitorForLowMem, queryTimeout, hitCriticalThreshold); if (hitCriticalThreshold) { vmRecoversFromCriticalHeap(server); } server.invoke("Executing query when system is 'Normal'", () -> { try { QueryService qs = getCache().getQueryService(); Query query = qs.newQuery("Select * From /" + "portfolios"); SelectResults results = (SelectResults) query.execute(); assertThat(results.size()).isEqualTo(numObjects); <START> } catch (QueryInvocationTargetException | FunctionDomainException | TypeMismatchException <END> | NameResolutionException e) { fail(""); } }); doTestCriticalHeapAndQueryTimeout(server, server, disabledQueryMonitorForLowMem, queryTimeout, hitCriticalThreshold); if (hitCriticalThreshold) { vmRecoversFromCriticalHeap(server); } } finally { stopServer(server); } }</code><technical_language>Another catch-block delete</technical_language>

Target:
private void doCriticalMemoryHitTestOnServer(boolean createPR, final boolean disabledQueryMonitorForLowMem, final int queryTimeout, final boolean hitCriticalThreshold) throws InterruptedException { final VM server = VM.getVM(0); final int numObjects = 200; try { final int port = AvailablePortHelper.getRandomAvailableTCPPort(); startCacheServer(server, port, disabledQueryMonitorForLowMem, queryTimeout, createPR); populateData(server); doTestCriticalHeapAndQueryTimeout(server, server, disabledQueryMonitorForLowMem, queryTimeout, hitCriticalThreshold); if (hitCriticalThreshold) { vmRecoversFromCriticalHeap(server); } server.invoke("Executing query when system is 'Normal'", () -> { QueryService qs = getCache().getQueryService(); Query query = qs.newQuery("Select * From /" + "portfolios"); SelectResults results = (SelectResults) query.execute(); assertThat(results.size()).isEqualTo(numObjects); }); doTestCriticalHeapAndQueryTimeout(server, server, disabledQueryMonitorForLowMem, queryTimeout, hitCriticalThreshold); if (hitCriticalThreshold) { vmRecoversFromCriticalHeap(server); } } finally { stopServer(server); } }
Source:
<code>public Optional<ChatParticipant> lookupPlayerBySession(final Session senderSession) { <START> throw new UnsupportedOperationException("TODO"); <END> }</code><technical_language>TODO</technical_language>

Target:
public Optional<ChatParticipant> lookupPlayerBySession(final Session senderSession) { return Optional.ofNullable(participants.get(senderSession.getId())) .map(chatterSession -> chatterSession.chatParticipant); }
Source:
<code>public Map<String, String> getMetadata() { Map<String, String> map = new HashMap<>(); String applicationId = this.applicationId; String instanceId = this.instanceId; String serviceBaseUrl = this.serviceBaseUrl; if (StringUtils.hasText(applicationId) && StringUtils.hasText(instanceId) && StringUtils.hasText(serviceBaseUrl)) { map.put("applicationId", applicationId); <START> map.put("instanceId", instanceId); <END> } return map; }</code><technical_language>I this name chosen match DiscoveryClient, I find a unfortunate. is a instance ID, is a GUID application ID. This property is instance index, is named in VCAP application properties</technical_language>

Target:
public Map<String, String> getMetadata() { Map<String, String> map = new HashMap<>(); if (StringUtils.hasText(this.applicationId) && StringUtils.hasText(this.instanceId)) { map.put("applicationId", this.applicationId); map.put("instanceId", this.instanceId); } return map; }
Source:
<code>public ConcurrentScheduler(int schedulerCount, int threadsPerScheduler, String threadBaseName) { this.schedulers = new ScheduledThreadPoolExecutor[schedulerCount]; this.threadsPerScheduler = threadsPerScheduler; <START> this.threadBaseName = threadBaseName; <END> }</code><technical_language>requireNonNull</technical_language>

Target:
public ConcurrentScheduler(int schedulerCount, int threadsPerScheduler, String threadBaseName) { checkArgument(schedulerCount > 0, "schedulerCount must be at least one"); this.schedulers = new ScheduledThreadPoolExecutor[schedulerCount]; checkArgument(threadsPerScheduler > 0, "threadsPerScheduler must be at least one"); this.threadsPerScheduler = threadsPerScheduler; this.threadBaseName = requireNonNull(threadBaseName, "threadBaseName is null"); }
Source:
<code>private void onUserLoginFailure(Exception ex) { setLoginBtnEnabled(); email_et.setEnabled(true); password_et.setEnabled(true); forgotPassword_tv.setEnabled(true); eulaTv.setEnabled(true); if (ex != null && ex instanceof LoginException) { LoginErrorMessage error = (((LoginException) ex).getLoginErrorMessage()); showErrorMessage( error.getMessageLine1(), (error.getMessageLine2() != null) ? error.getMessageLine2() : getString(R.string.login_failed)); } else { logger.warn("Login Exception : "); <START> logger.error(ex); <END> } }</code><technical_language>Remove warning log</technical_language>

Target:
private void onUserLoginFailure(Exception ex) { setLoginBtnEnabled(); email_et.setEnabled(true); password_et.setEnabled(true); forgotPassword_tv.setEnabled(true); eulaTv.setEnabled(true); if (ex != null && ex instanceof LoginException) { LoginErrorMessage error = (((LoginException) ex).getLoginErrorMessage()); showErrorMessage( error.getMessageLine1(), (error.getMessageLine2() != null) ? error.getMessageLine2() : getString(R.string.login_failed)); } else { logger.error(ex); } }
Source:
<code>private void removeFromWorkspaceAndUpdateURiMapping(Viewpoint viewpoint) { this.viewpointsFromWorkspace.remove(viewpoint); <START> Resource res = viewpoint.eResource(); if (resourceSet.getResources().contains(res)) { res.unload(); resourceSet.getResources().remove(res); } <END> URI viewpointUri = ViewpointProtocolParser.buildViewpointUri(EcoreUtil.getURI(viewpoint)); for (Viewpoint vp : this.viewpointsFromPlugin) { if (StringUtil.equals(vp.getName(), viewpoint.getName())) { URI vpURI = ViewpointProtocolParser.buildViewpointUri(EcoreUtil.getURI(vp)); if (vpURI != null && viewpointUri != null && StringUtil.equals(vpURI.toString(), viewpointUri.toString())) { mapToSiriusProtocol(vp); return; } } } URIMappingRegistryImpl.INSTANCE.removeKey(ViewpointProtocolParser.buildViewpointUri(viewpointUri)); }</code><technical_language>I if this method is called if removing this issues</technical_language>

Target:
private void removeFromWorkspaceAndUpdateURiMapping(Viewpoint viewpoint) { this.viewpointsFromWorkspace.remove(viewpoint); URI viewpointUri = ViewpointProtocolParser.buildViewpointUri(EcoreUtil.getURI(viewpoint)); for (Viewpoint vp : this.viewpointsFromPlugin) { if (StringUtil.equals(vp.getName(), viewpoint.getName())) { URI vpURI = ViewpointProtocolParser.buildViewpointUri(EcoreUtil.getURI(vp)); if (vpURI != null && viewpointUri != null && StringUtil.equals(vpURI.toString(), viewpointUri.toString())) { mapToSiriusProtocol(vp); return; } } } URIMappingRegistryImpl.INSTANCE.removeKey(ViewpointProtocolParser.buildViewpointUri(viewpointUri)); }
Source:
<code>public DynamicTableSink createDynamicTableSink(Context context) { FactoryUtil.TableFactoryHelper helper = FactoryUtil.createTableFactoryHelper(this, context); ReadableConfig tableOptions = helper.getOptions(); EncodingFormat<SerializationSchema<RowData>> keyEncodingFormat = helper.discoverEncodingFormat( SerializationFormatFactory.class, FactoryUtil.KEY_FORMAT); EncodingFormat<SerializationSchema<RowData>> valueEncodingFormat = helper.discoverEncodingFormat( SerializationFormatFactory.class, FactoryUtil.VALUE_FORMAT); helper.validateExcept(KafkaOptions.PROPERTIES_PREFIX); TableSchema schema = context.getCatalogTable().getSchema(); TableSchema physicalSchema = TableSchemaUtils.getPhysicalSchema(schema); List<String> physicalColumns = Arrays.asList(physicalSchema.getFieldNames()); validateTableSinkOptions( tableOptions, keyEncodingFormat, valueEncodingFormat, schema); int[] keyProjection = schema.getPrimaryKey().get().getColumns().stream() .filter(name -> physicalSchema.getTableColumn(name).isPresent()) .mapToInt(physicalColumns::indexOf) .toArray(); int[] valueProjection = getValueProjection(tableOptions, keyProjection, physicalColumns.size()); final String keyPrefix = tableOptions.getOptional(FactoryUtil.KEY_FIELDS_PREFIX).orElse(null); final Optional<FlinkKafkaPartitioner<RowData>> partitioner = Optional.empty(); return new KafkaDynamicSink( schema.toPhysicalRowDataType(), SINK_CHANGELOG_MODE, keyEncodingFormat, valueEncodingFormat, keyProjection, valueProjection, keyPrefix, tableOptions.get(TOPIC).get(0), getBootstrapServers(tableOptions), partitioner, <START> getSinkSemantic(KafkaOptions.SINK_SEMANTIC_VALUE_AT_LEAST_ONCE) <END> ); }</code><technical_language>Hard code KafkaSinkSemantic.AT_LEAST_ONCE</technical_language>

Target:
public DynamicTableSink createDynamicTableSink(Context context) { FactoryUtil.TableFactoryHelper helper = FactoryUtil.createTableFactoryHelper(this, context); ReadableConfig tableOptions = helper.getOptions(); EncodingFormat<SerializationSchema<RowData>> keyEncodingFormat = helper.discoverEncodingFormat( SerializationFormatFactory.class, KEY_FORMAT); EncodingFormat<SerializationSchema<RowData>> valueEncodingFormat = helper.discoverEncodingFormat( SerializationFormatFactory.class, VALUE_FORMAT); helper.validateExcept(KafkaOptions.PROPERTIES_PREFIX); TableSchema schema = context.getCatalogTable().getSchema(); validateTableOptions(tableOptions, keyEncodingFormat, valueEncodingFormat, schema); Tuple2<int[], int[]> keyValueProjections = createKeyValueProjections(context.getCatalogTable()); final String keyPrefix = tableOptions.getOptional(KEY_FIELDS_PREFIX).orElse(null); final Properties properties = getKafkaProperties(context.getCatalogTable().getOptions()); Integer parallelism = tableOptions.get(FactoryUtil.SINK_PARALLELISM); return new KafkaDynamicSink( schema.toPhysicalRowDataType(), keyEncodingFormat, new EncodingFormatWrapper(valueEncodingFormat), keyValueProjections.f0, keyValueProjections.f1, keyPrefix, tableOptions.get(TOPIC).get(0), properties, null, KafkaSinkSemantic.AT_LEAST_ONCE, true, parallelism ); }
Source:
<code>protected File createMovieFile(Format fileFormat) throws IOException { if(!this.movieFolder.exists()) { <START> this.movieFolder.mkdirs(); <END> } else if(!this.movieFolder.isDirectory()) { throw new IOException("\"" + this.movieFolder + "\" is not a directory."); } final File f = generateOutput(fileFormat); return f; }</code><technical_language>check of <code>mkdirs()</code> result</technical_language>

Target:
protected File createMovieFile(Format fileFormat) throws IOException { if (!this.movieFolder.exists()) { if (!this.movieFolder.mkdirs()) { logger.warn("Directory could not be created. mkdirs operation returned false.", this.movieFolder); } } else { if (!this.movieFolder.isDirectory()) { logger.warn("{} is not a directory.", this.movieFolder); } } final File f = generateOutput(fileFormat); return f; }
Source:
<code><START> protected void initAndRegisterHandlerForExpressionTextArea() { checkExpressionSyntax(); DOM.sinkBitlessEvent(expressionElement, ConstantHolder.INPUT); DOM.setEventListener(expressionElement, event -> { if (ConstantHolder.INPUT.contains(event.getType())) { checkExpressionSyntax();} }); } <END></code><technical_language>I lost here. add new method @EventHandler annotation mentioning element name/id register handler do for of other elements</technical_language>

Target:
protected void initAndRegisterHandlerForExpressionTextArea() { ensureExpressionSyntax(); DOM.sinkBitlessEvent(expressionElement, ConstantHolder.INPUT); DOM.setEventListener(expressionElement, event -> { if (ConstantHolder.INPUT.contains(event.getType())) { ensureExpressionSyntax();} }); }
Source:
<code>private ISeries createSeries() { IBarSeries series = (IBarSeries) fChart.getSeriesSet().createSeries(SeriesType.BAR, Messages.AbstractSegmentStoreDensityViewer_SeriesLabel); series.setVisible(true); series.setBarPadding(0); <START> Color color = COLOR_REGISTRY.get(BAR_COLOR.toString()); if (color == null) { COLOR_REGISTRY.put(BAR_COLOR.toString(), BAR_COLOR); color = COLOR_REGISTRY.get(BAR_COLOR.toString()); } <END> series.setBarColor(color); return series; }</code><technical_language>extract static method fwiw</technical_language>

Target:
private ISeries createSeries() { IBarSeries series = (IBarSeries) fChart.getSeriesSet().createSeries(SeriesType.BAR, Messages.AbstractSegmentStoreDensityViewer_SeriesLabel); series.setVisible(true); series.setBarPadding(0); Color color = getColorForRGB(BAR_COLOR); series.setBarColor(color); return series; }
Source:
<code>private Hardware getHardware() { System.out.format(" Hardware Profiles%n"); Set<? extends Hardware> profiles = computeService.listHardwareProfiles(); Hardware result = null; for (Hardware profile : profiles) { System.out.format(" %s%n", profile); if (profile.getId().equals(ZONE + "/f1-micro")) { result = profile; } } if (result == null) { <START> System.err.println("f1-micro flavor not found. Using first flavor found:%n"); <END> result = profiles.iterator().next(); System.err.format("-> %s%n", result); } return result; }</code><technical_language>[minor] "found: %n"</technical_language>

Target:
private Hardware getHardware() { System.out.format(" Hardware Profiles%n"); Set<? extends Hardware> profiles = computeService.listHardwareProfiles(); Hardware result = null; for (Hardware profile : profiles) { System.out.format(" %s%n", profile); if (profile.getId().equals(ZONE + "/f1-micro")) { result = profile; } } if (result == null) { System.err.println("f1-micro flavor not found. Using first flavor found:"); result = profiles.iterator().next(); System.err.format("-> %s%n", result); } return result; }
Source:
<code>public void testCreateBucketedSortedTableAs() { <START> String tableName = "test_create_bucketed_sorted_table_as"; <END> @Language("SQL") String createTable = "" + "CREATE TABLE " + tableName + " " + "WITH (" + "bucketed_by = ARRAY[ 'custkey', 'custkey2' ], " + "bucket_count = 11, " + "sorted_by = ARRAY[ '+custKey' ]" + ") " + "AS " + "SELECT custkey, custkey AS custkey2, comment, orderstatus " + "FROM tpch.tiny.orders"; assertUpdate(createTable); }</code><technical_language>Inline</technical_language>

Target:
public void testCreateBucketedSortedTableAs() { assertUpdate("" + "CREATE TABLE test_create_bucketed_sorted_table_as " + "WITH (" + "bucketed_by = ARRAY['custkey', 'custkey2'], " + "bucket_count = 11, " + "sorted_by = ARRAY['+custKey']" + ") " + "AS " + "SELECT custkey, custkey AS custkey2, comment, orderstatus " + "FROM tpch.tiny.orders"); }
Source:
<code>private Map<String, Object> parseHeaderFileInfoStoreInMap(final URL headerURL) throws IOException { Scanner scanner = null; final Map<String, Object> headerMap = new CaseInsensitiveMap<>(); try (InputStream in = headerURL.openStream()) { scanner = new Scanner(in, "UTF-8"); while(scanner.hasNextLine()) { String currLine = scanner.nextLine(); if(currLine.startsWith("m-encrypt") || currLine.startsWith("content")) { <START> <END> String[] fields = currLine.split(":"); if (fields.length == 2) { headerMap.put(fields[0].trim(), fields[1].trim()); } else { LOG.error("Header Field Values parsed from the file are invalid!"); } } } } return headerMap; }</code><technical_language>assigned null here. do: final Scanner scanner;</technical_language>

Target:
private Map<String, Object> parseHeaderFileInfoStoreInMap(final URL headerURL) throws IOException { final Map<String, Object> headerMap = new CaseInsensitiveMap<>(); try (InputStream in = headerURL.openStream(); final Scanner scanner = new Scanner(in, StandardCharsets.UTF_8.name())) { while (scanner.hasNextLine()) { String currLine = scanner.nextLine(); if (currLine.startsWith("m-encrypt") || currLine.startsWith("content")) { final String[] fields = currLine.split(":", 2); if (fields.length == 2) { headerMap.put(fields[0].trim(), fields[1].trim()); } else { LOG.error("Header Field Values parsed from the file are invalid!"); } } } } return headerMap; }
Source:
<code>public String getDescription() { return <START> "Type <END> " + typeName + " in " + inputLibLoc.getDescription(); }</code><technical_language>location description a small cap</technical_language>

Target:
public String getDescription() { return "type " + typeName + " in " + inputLibLoc.getDescription(); }
Source:
<code>private boolean hasResources(String role, List<Protos.Resource> resourceList, Double cpus, Double mem, Long port) { Double actualCpu = 0.0d, actualMem = 0.0d; List<Long> expectedPorts = new ArrayList<>(); expectedPorts.add(port); List<Long> actualPorts = new ArrayList<>(); for (Protos.Resource resource : resourceList) { if (!resource.getRole().equals(role)) { continue; } ResourceType r = ResourceType.of(resource.getName()); switch (r) { case CPU: actualCpu += resource.getScalar().getValue(); break; case MEM: actualMem += resource.getScalar().getValue(); break; case PORTS: Protos.Value.Ranges ranges = resource.getRanges(); for (Protos.Value.Range range : ranges.getRangeList()) { <START> for (long i = 0; i < (range.getEnd() - range.getBegin() + 1); i++) { <END> actualPorts.add(range.getBegin() + i); } } } } boolean hasPorts = (expectedPorts.size() == actualPorts.size()) && expectedPorts.containsAll(actualPorts); return actualCpu.equals(cpus) && actualMem.equals(mem) && hasPorts; }</code><technical_language>This for loop more clear for (long i = 0; i <= (range.getEnd() - range.getBegin()); i++) (1)</technical_language>

Target:
private boolean hasResources(String role, List<Protos.Resource> resourceList, Double cpus, Double mem, Long port) { Double actualCpu = 0.0d, actualMem = 0.0d; List<Long> expectedPorts = new ArrayList<>(); expectedPorts.add(port); List<Long> actualPorts = new ArrayList<>(); for (Protos.Resource resource : resourceList) { if (!resource.getRole().equals(role)) { continue; } ResourceType r = ResourceType.of(resource.getName()); switch (r) { case CPU: actualCpu += resource.getScalar().getValue(); break; case MEM: actualMem += resource.getScalar().getValue(); break; case PORTS: Protos.Value.Ranges ranges = resource.getRanges(); for (Protos.Value.Range range : ranges.getRangeList()) { long endValue = range.getEnd(); long beginValue = range.getBegin(); while (endValue >= beginValue) { actualPorts.add(beginValue); ++beginValue; } } } } boolean hasExpectedPorts = (expectedPorts.size() == actualPorts.size()) && expectedPorts.containsAll(actualPorts); return actualCpu.equals(cpus) && actualMem.equals(mem) && hasExpectedPorts; }
Source:
<code>void update(long deltaNanos) { if (deltaNanos < 0) { <START> log.warn("Possible kernel bug: system nano time moved backwards"); <END> } else if (deltaNanos > maxSafeVmPauseNanos) { totalPauseNanos.addAndGet(deltaNanos); pauseTime.addNanos(deltaNanos); } else { currentValue.addAndGet(deltaNanos); } }</code><technical_language>"kernel JVM bug"</technical_language>

Target:
void update(long deltaNanos) { if (deltaNanos < 0) { if (badSystemNanoTime.compareAndSet(false, true)) { log.warn("Possible kernel or JVM bug: system nano time moved backwards"); } } else if (deltaNanos > maxSafeVmPauseNanos) { totalPauseNanos.addAndGet(deltaNanos); pauseTime.addNanos(deltaNanos); } else { currentValue.addAndGet(deltaNanos); } }
Source:
<code>public void handle(KeepAlive alive) throws Exception { if (server.getSentKeepAlives().getFirst().getMillis() + bungee.getConfig().getTimeout() < System.currentTimeMillis()) { <START> throw new IllegalStateException("Did not recieve keepalive in time from " + con.getName()); <END> } server.getSentKeepAlives().addLast( new ServerConnection.KeepAliveInfo( alive.getRandomId() ) ); }</code><technical_language>Short of running in generic packet handler method, not. move there, need optimized (cache )</technical_language>

Target:
public void handle(KeepAlive alive) throws Exception { server.setSentPingId( alive.getRandomId() ); con.setSentPingTime( System.currentTimeMillis() ); }
Source:
<code>private CacheStoreHolder getHolder(int grpId) { return idxCacheStores.computeIfAbsent((grpId), (key) -> { CacheGroupDescriptor gDesc = cctx.cache().cacheGroupDescriptors().get(grpId); CacheStoreHolder holder0 = null; if (gDesc != null) { Integer cacheId = F.firstValue(gDesc.caches()); if (cacheId != null) { DynamicCacheDescriptor cacheDesc = cctx.cache().cacheDescriptor(cacheId); if (CU.isPersistentCache(cacheDesc.cacheConfiguration(), cctx.gridConfig().getDataStorageConfiguration())) { try { holder0 = initForCache(cacheDesc.groupDescriptor(), cacheDesc.cacheConfiguration()); } catch (IgniteCheckedException e) { <START> throw new IgniteException(e); <END> } } } } return holder0; }); }</code><technical_language>happen if exception is thrown here? Previously initialized a clear path: node fails restore memory shuts down. this change a checked exception catch, is wrapped unchecked. call FailureHandler in this case if wrong lazy initialization of cache store</technical_language>

Target:
private CacheStoreHolder getHolder(int grpId) throws IgniteCheckedException { try { return idxCacheStores.computeIfAbsent(grpId, (key) -> { CacheGroupDescriptor gDesc = cctx.cache().cacheGroupDescriptors().get(grpId); CacheStoreHolder holder0 = null; if (gDesc != null) { if (CU.isPersistentCache(gDesc.config(), cctx.gridConfig().getDataStorageConfiguration())) { try { holder0 = initForCache(gDesc, gDesc.config()); } catch (IgniteCheckedException e) { throw new IgniteException(e); } } } return holder0; }); } catch (IgniteException ex) { if (X.hasCause(ex, IgniteCheckedException.class)) throw ex.getCause(IgniteCheckedException.class); else throw ex; } }
Source:
<code>private void addSalienceByMetadata() { final int priorityColumnIndex = getResolvedHitMetadataColumnIndex(); if ( priorityColumnIndex >= 0 ) { final RowPriorityResolver rowPriorityResolver = getRowPriorityResolver( priorityColumnIndex ); final int indexOfSalienceColumn = makeSalienceColumn(); final RowPriorities priorities = rowPriorityResolver.getPriorityRelations(); for ( final RowNumber rowNumber : priorities.getRowNumbers() ) { dtable.getData() <START> .get( rowNumber.getRowNumber() - 1 ) <END> .get( indexOfSalienceColumn ) .setNumericValue( priorities.getSalience( rowNumber ) .getSalience() ); } } }</code><technical_language>Row numbers one-based in UI, more comfortable for technical users. I zero-based row numbers. I wrote observation</technical_language>

Target:
private void addSalienceByMetadata() { final int priorityColumnIndex = getResolvedHitMetadataColumnIndex(); if ( priorityColumnIndex >= 0 ) { final RowPriorityResolver rowPriorityResolver = getRowPriorityResolver( priorityColumnIndex ); final int indexOfSalienceColumn = makeSalienceColumn(); final RowPriorities priorities = rowPriorityResolver.getPriorityRelations(); for ( final RowNumber rowNumber : priorities.getRowNumbers() ) { dtable.getData() .get( rowNumber.getRowIndex() ) .get( indexOfSalienceColumn ) .setNumericValue( priorities.getSalience( rowNumber ) .getSalience() ); } } }
Source:
<code>protected synchronized ResourceBundle getResourceBundle() { String resourceBase = localization != null ? localization : MetaTypeProviderImpl.getBundleLocalization(bundle); long bundleId = bundle.getBundleId(); String key = (locale != null) ? bundleId + ":" + locale + ":" + resourceBase : bundleId + ":" + resourceBase; <START> resourceBundle = resourceBundleMap.get(key); <END> if (resourceBundle == null) { resourceBundle = getResourceBundle(resourceBase, locale, bundle); if (resourceBundle != null) { resourceBundleMap.put(key, resourceBundle); } } return resourceBundle; }</code><technical_language>in cache this resourceBundle variable local, need a member field for it</technical_language>

Target:
protected synchronized ResourceBundle getResourceBundle() { String resourceBase = localization != null ? localization : MetaTypeProviderImpl.getBundleLocalization(bundle); long bundleId = bundle.getBundleId(); String key = (locale != null) ? bundleId + ":" + locale + ":" + resourceBase : bundleId + ":" + resourceBase; ResourceBundle resourceBundle = resourceBundleCache.get(key); if (resourceBundle == null) { resourceBundle = getResourceBundle(resourceBase, locale, bundle); if (resourceBundle != null) { resourceBundleCache.put(key, resourceBundle); } } return resourceBundle; }
Source:
<code>public void verifyListOfRunningVmsIsSameWithFailureOnGetVmStats() { prepareForRefreshVmStatsCall(); mockGetVmStatsCommand(false); updater.fetchRunningVms(); List<VM> runningAndUnchanged = updater.checkVmsStatusChanged(); <START> Assert.assertTrue("expecting the VM to be missing from the running VMs map", !updater.getRunningVms().containsKey(VM_1)); <END> Assert.assertFalse(runningAndUnchanged.contains(VM_1)); }</code><technical_language>missing? i thought leave in this list</technical_language>

Target:
public void verifyListOfRunningVmsIsSameWithFailureOnGetVmStats() { prepareForRefreshVmStatsCall(); mockGetVmStatsCommand(false); updater.fetchRunningVms(); List<VM> runningAndUnchanged = updater.checkVmsStatusChanged(); Assert.assertFalse(updater.getRunningVms().containsKey(VM_1)); Assert.assertTrue(runningAndUnchanged.contains(vm_1_db)); }
Source:
<code>public ExportAndShareTask(Context context, long trackId) { super(context, trackId); File cacheDir = context.getCacheDir(); <START> trackDir = new File(cacheDir, "trackDirectory"); <END> int i = 0; while (trackDir.exists()) trackDir = new File(cacheDir, "trackDirectory" + i++); if (trackDir.mkdir()) Log.d(TAG, "Temporary file: " + trackDir.getAbsolutePath()); else { Log.e(TAG, "Could not create temporary directory"); throw new IllegalStateException("Could not create temporary directory"); } }</code><technical_language>a constant for trackDirectory? Also, care of cleaning ourselves? concerned cache folder grow time</technical_language>

Target:
public ExportAndShareTask(Context context, long trackId) { super(context, trackId); cacheDir = context.getCacheDir(); String cacheSubDirName = "trackDirectory"; trackDir = new File(cacheDir, cacheSubDirName); int i = 0; while (trackDir.exists()) { trackDir = new File(cacheDir, cacheSubDirName + i++); } if (trackDir.mkdir()) { Log.d(TAG, "Temporary directory: " + trackDir.getAbsolutePath()); } else { Log.e(TAG, "Could not create temporary directory"); throw new IllegalStateException("Could not create temporary directory"); } }
Source:
<code>public String getPluginId() { <START> return "org.eclipse.core.tests.resources.saveparticipant3"; <END> }</code><technical_language>hard code plugin IDs in code. ID getBundle().getSymbolicName(). applies other files in this change</technical_language>

Target:
public String getPluginId() { return getBundle().getSymbolicName(); }
Source:
<code>public void removeAll(Guid vmId) { List<VmNic> interfaces = getVmNicDao().getAllForVm(vmId); if (interfaces != null) { removeFromExternalNetworks(interfaces); <START> final MacPoolManagerStrategy macPool = getMacPoolManager(vmId); <END> for (VmNic iface : interfaces) { macPool.freeMac(iface.getMacAddress()); getVmNicDao().remove(iface.getId()); getVmNetworkStatisticsDao().remove(iface.getId()); } } }</code><technical_language>need extract variable</technical_language>

Target:
public void removeAll(Guid vmId) { List<VmNic> interfaces = getVmNicDao().getAllForVm(vmId); if (interfaces != null) { removeFromExternalNetworks(interfaces); for (VmNic iface : interfaces) { macPool.freeMac(iface.getMacAddress()); getVmNicDao().remove(iface.getId()); getVmNetworkStatisticsDao().remove(iface.getId()); } } }
Source:
<code>public VariantAbstractRPCQuery() { <START> variantType = NameValuePair.TYPE_POST_DATA; <END> }</code><technical_language>call this(NameValuePair.TYPE_POST_DATA) instead</technical_language>

Target:
public VariantAbstractRPCQuery() { this(NameValuePair.TYPE_POST_DATA); }
Source:
<code>private void doFinish(String containerName, String fileName, IProgressMonitor monitor) throws CoreException { monitor.beginTask("Creating " + fileName, 2); final File newFile = new File(containerName, fileName); try { String envString = "#!/usr/bin/env stap"; ByteArrayInputStream envOut = new ByteArrayInputStream(envString.getBytes()); FileOutputStream FOS = new FileOutputStream(newFile); int character; <START> if (newFile.exists()) { <END> while((character = envOut.read())!=-1) { char ch = (char)character; FOS.write(ch); } } else { newFile.createNewFile(); while((character = envOut.read())!=-1) { char ch = (char)character; FOS.write(ch); } } FOS.close(); } catch (IOException e) { throwCoreException("Error: " + e); } monitor.worked(1); monitor.setTaskName("Opening file for editing..."); getShell().getDisplay().asyncExec(new Runnable() { public void run() { try { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getWorkbench() .showPerspective("org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective", PlatformUI.getWorkbench().getActiveWorkbenchWindow()); IDE.openEditorOnFileStore(page, EFS.getLocalFileSystem().fromLocalFile(newFile)); } catch (WorkbenchException e1) { e1.printStackTrace(); } } }); monitor.worked(1); }</code><technical_language>code need if statement</technical_language>

Target:
private void doFinish(String containerName, String fileName, IProgressMonitor monitor) throws CoreException { monitor.beginTask(Messages.getString("StapNewWizard.BeginTask") + fileName, 2); final File newFile = new File(containerName, fileName); try { String envString = "#!/usr/bin/env stap"; FileOutputStream FOS = new FileOutputStream(newFile); newFile.createNewFile(); FOS.write(envString.getBytes()); FOS.close(); } catch (IOException e) { throwCoreException("Error: " + e); } monitor.worked(1); monitor.setTaskName(Messages.getString("StapNewWizard.SetTask")); getShell().getDisplay().asyncExec(new Runnable() { public void run() { try { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getWorkbench() .showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); IDE.openEditorOnFileStore(page, EFS.getLocalFileSystem().fromLocalFile(newFile)); } catch (WorkbenchException e1) { e1.printStackTrace(); } } }); monitor.worked(1); }
Source:
<code>public void start() { cacheName = ByteString.fromString(cache.getName()); this.transactional = configuration.transaction().transactionMode().isTransactional(); this.totalOrderProtocol = configuration.transaction().transactionProtocol().isTotalOrder(); <START> this.distributedOrReplicated = configuration.clustering().cacheMode().isDistributed() || configuration.clustering().cacheMode().isReplicated(); <END> }</code><technical_language>longer well</technical_language>

Target:
public void start() { cacheName = ByteString.fromString(cache.getName()); this.transactional = configuration.transaction().transactionMode().isTransactional(); this.totalOrderProtocol = configuration.transaction().transactionProtocol().isTotalOrder(); }
Source:
<code>@Override public void perform() { RelOptCost upperBound = group.upperBound; RelOptCost upperForInput = planner.upperBoundForInputs(mExpr, upperBound); if (upperForInput.isLe(planner.zeroCost)) { <START> if (LOGGER.isDebugEnabled()) { <END> LOGGER.debug( "Skip O_INPUT because of lower bound. UB4Inputs = {}, UB = {}", upperForInput, upperBound); } return; } RelSubset input = (RelSubset) mExpr.getInput(0); tasks.push(new DeriveTrait(mExpr, group)); tasks.push(new CheckInput(null, mExpr, input, 0, upperForInput)); tasks.push(new OptimizeGroup(input, upperForInput)); }</code><technical_language>check if (LOGGER.isDebugEnabled()) { in this class redundant</technical_language>

Target:
@Override public void perform() { RelOptCost upperBound = group.upperBound; RelOptCost upperForInput = planner.upperBoundForInputs(mExpr, upperBound); if (upperForInput.isLe(planner.zeroCost)) { LOGGER.debug( "Skip O_INPUT because of lower bound. UB4Inputs = {}, UB = {}", upperForInput, upperBound); return; } RelSubset input = (RelSubset) mExpr.getInput(0); tasks.push(new DeriveTrait(mExpr, group)); tasks.push(new CheckInput(null, mExpr, input, 0, upperForInput)); tasks.push(new OptimizeGroup(input, upperForInput)); }
Source:
<code>public void testDeclarationSyntax() throws Exception { List<File> inputs = DeclarationGeneratorFileBasedTests.getTestInputFiles(); List<String> goldenFilePaths = new ArrayList<>(); for (File input : inputs) { goldenFilePaths.add(DeclarationGeneratorFileBasedTests.getGoldenFile(input).getPath()); } final List<String> tscCommand = Lists.newArrayList("/Users/martinprobst/.nvm/versions/node/v0.12.4/bin/node", "/Users/martinprobst/.homebrew/bin/tsc", "--noEmit"); tscCommand.addAll(goldenFilePaths); Process tsc = new ProcessBuilder().command(tscCommand).redirectErrorStream(true).start(); if (!tsc.waitFor(5, TimeUnit.SECONDS)) { tsc.destroyForcibly(); <START> fail("tsc process timed out"); <END> } else if (tsc.exitValue() != 0) { InputStreamReader isr = new InputStreamReader(tsc.getInputStream(), Charsets.UTF_8); String consoleOut = CharStreams.toString(isr); fail("tsc exited abnormally: " + tsc.exitValue() + " - " + consoleOut); } }</code><technical_language>tsc timeout? Hardcoded timeouts potential flaky hooked a test runner</technical_language>

Target:
public void testDeclarationSyntax() throws Exception { List<File> inputs = DeclarationGeneratorTests.getTestInputFiles(); List<String> goldenFilePaths = new ArrayList<>(); for (File input : inputs) { goldenFilePaths.add(DeclarationGeneratorTests.getGoldenFile(input).getPath()); } final List<String> tscCommand = Lists.newArrayList(TSC.toString(), "--noEmit"); tscCommand.addAll(goldenFilePaths); runChecked(tscCommand); }
Source:
<code>private void registerMetrics(Map<String, Metric> metrics) { Optional.of(metrics).ifPresent(m -> m.forEach((key, value) -> { try { _metricRegistry.register(key, value); } catch (IllegalArgumentException e) { <START> LOG.info("Metric " + key + " has already been registered.", e); <END> } })); }</code><technical_language>LOG.info -> LOG.error</technical_language>

Target:
private void registerMetrics(Map<String, Metric> metrics) { Optional.of(metrics).ifPresent(m -> m.forEach((key, value) -> { try { _metricRegistry.register(key, value); } catch (IllegalArgumentException e) { LOG.error("Metric " + key + " has already been registered.", e); } })); }
Source:
<code>private static void performWarmup() { ExecutorService connectionStartupExecutor = Executors .newCachedThreadPool(GrpcUtil.getThreadFactory("BigtableSession-startup-%d", true)); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { enableTracing(null); <START> } <END> }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { BigtableSessionSharedThreadPools.getInstance(); } }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { createSslContext(); } catch (SSLException e) { } } }); for (final String host : Arrays.asList(BigtableOptions.BIGTABLE_DATA_HOST_DEFAULT, BigtableOptions.BIGTABLE_TABLE_ADMIN_HOST_DEFAULT)) { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { InetAddress.getByName(host); } catch (UnknownHostException e) { } } }); } connectionStartupExecutor.shutdown(); }</code><technical_language>This is a bit confusing, I pay cost of reflection try prefetch reflection methods</technical_language>

Target:
private static void performWarmup() { ExecutorService connectionStartupExecutor = Executors .newCachedThreadPool(GrpcUtil.getThreadFactory("BigtableSession-startup-%d", true)); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { BigtableSessionSharedThreadPools.getInstance(); } }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { createSslContext(); } catch (SSLException e) { } } }); for (final String host : Arrays.asList(BigtableOptions.BIGTABLE_DATA_HOST_DEFAULT, BigtableOptions.BIGTABLE_TABLE_ADMIN_HOST_DEFAULT)) { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { InetAddress.getByName(host); } catch (UnknownHostException e) { } } }); } connectionStartupExecutor.shutdown(); }
Source:
<code>public String showParameters(Request req, Response res) throws IOException { PipelineTemplateConfig templateConfig = fetchEntityFromConfig(req.params("template_name")); <START> if (isGetOrHeadRequestFresh(req, templateConfig)) { <END> return notModified(res); } else { setEtagHeader(templateConfig, res); return writerForTopLevelObject(req, res, writer -> ParametersRepresenter.toJSON(writer, templateConfig.name().toString(), templateConfig.referredParams())); } }</code><technical_language>Here, checking for ETag generated based entire template config, whereas, this API is for template parameters. Imagine is a change in template config, template parameters changed. Where, API respond 412 if is change in response of API. --- options we've: 1. Compute ETag for template parameters. 2. ETag for this API?? send 200? 3. implementation is (i.e. rely entire template config for etag). @kritika-singh3 @ketan @arvindsv @maheshp @bdpiparva -- Thoughts?</technical_language>

Target:
public String showParameters(Request req, Response res) throws IOException { PipelineTemplateConfig templateConfig = fetchEntityFromConfig(req.params("template_name")); ParamsConfig paramConfigs = templateConfig.referredParams(); String etagFromServer = entityHashingService.md5ForEntity(paramConfigs); if (fresh(req, etagFromServer)) { return notModified(res); } else { setEtagHeader(templateConfig, res); return writerForTopLevelObject(req, res, writer -> { ParametersRepresenter.toJSON(writer, templateConfig.name().toString(), paramConfigs); }); } }