auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void UpdateVmNumaNodes() { <START> VmNumaNodeDAO dao = DbFacade.getInstance().getVmNumaNodeDAO(); <END> List<VdsNumaNode> addList = new ArrayList<VdsNumaNode>(); List<VdsNumaNode> updateList = new ArrayList<VdsNumaNode>(); List<Guid> removeList = new ArrayList<Guid>(); List<VmNumaNode> oldList = dao.getAllVmNumaNodeByVmId(getVmId()); for (VmNumaNode oldNode : oldList) { removeList.add(oldNode.getId()); } for (VmNumaNode newNode : getParameters().getVmStaticData().getvNumaNodeList()) { boolean found = false; Guid newId = newNode.getId(); for (VmNumaNode oldNode : oldList) { if (oldNode.getId().equals(newId)) { updateList.add(newNode); removeList.remove(oldNode.getId()); found = true; break; } } if (!found) { addList.add(newNode); } } dao.massSaveNumaNode(addList, null, getVmId()); dao.massUpdateNumaNode(updateList); dao.massRemoveNumaNodeByNumaNodeId(removeList); }</code><technical_language>work list.retainAll list.removeAll, this a shorter more elegant code</technical_language>

Target:
private void UpdateVmNumaNodes() { VmNumaNodeDAO dao = DbFacade.getInstance().getVmNumaNodeDAO(); List<VmNumaNode> addList = new ArrayList<>(); List<VmNumaNode> updateList = new ArrayList<>(); List<VmNumaNode> removeList = new ArrayList<>(); List<VmNumaNode> oldList = dao.getAllVmNumaNodeByVmId(getVmId()); List<VmNumaNode> newList = getParameters().getVmStaticData().getvNumaNodeList(); addList.addAll(newList); updateList.addAll(newList); removeList.addAll(oldList); updateList.retainAll(oldList); removeList.retainAll(newList); addList.retainAll(updateList); VmNumaNodeOperationParameters params = new VmNumaNodeOperationParameters(getVmId(), addList); getBackend().runInternalAction(VdcActionType.AddVmNumaNodes, params); params = new VmNumaNodeOperationParameters(getVmId(), updateList); getBackend().runInternalAction(VdcActionType.UpdateVmNumaNodes, params); params = new VmNumaNodeOperationParameters(getVmId(), removeList); getBackend().runInternalAction(VdcActionType.RemoveVmNumaNodes, params); }
Source:
<code><START> static TestingSlotPoolImpl createAndSetUpSlotPool( <END> final ResourceManagerGateway resourceManagerGateway) throws Exception { return SlotPoolUtils.createSlotPoolBuilder(resourceManagerGateway).build(); }</code><technical_language>suggestion private static TestingSlotPoolImpl createAndSetUpSlotPool(</technical_language>

Target:
private static TestingSlotPoolImpl createAndSetUpSlotPool( final ResourceManagerGateway resourceManagerGateway) throws Exception { return new SlotPoolBuilder(mainThreadExecutor).setResourceManagerGateway(resourceManagerGateway).build(); }
Source:
<code>public void updateAlertInTree(Alert originalAlert, Alert alert) { <START> if (getView() == null || EventQueue.isDispatchThread()) { <END> return; } if (EventQueue.isDispatchThread()) { updateAlertInTreeEventHandler(originalAlert, alert); } else { try { EventQueue.invokeAndWait(new Runnable() { @Override public void run() { updateAlertInTreeEventHandler(originalAlert, alert); } }); } catch (Exception e) { logger.error(e.getMessage(), e); } } }</code><technical_language>Added wrong if statement</technical_language>

Target:
public void updateAlertInTree(Alert originalAlert, Alert alert) { if (Constant.isLowMemoryOptionSet()) { return; } if (getView() == null || EventQueue.isDispatchThread()) { updateAlertInTreeEventHandler(originalAlert, alert); } else { try { EventQueue.invokeAndWait(new Runnable() { @Override public void run() { updateAlertInTreeEventHandler(originalAlert, alert); } }); } catch (Exception e) { logger.error(e.getMessage(), e); } } }
Source:
<code>public void testAddMetadataStoreRealmNonLeader() { MockWriter mockWriter = new MockWriter(DUMMY_NAMESPACE, ZK_ADDR); mockWriter.addMetadataStoreRealm(DUMMY_REALM); <START> Assert.assertEquals(mockWriter.calledRequest.getMethod(), "PUT"); <END> List<String> expectedUrlParams = Arrays .asList(MetadataStoreRoutingConstants.MSDS_NAMESPACES_URL_PREFIX, DUMMY_NAMESPACE, MetadataStoreRoutingConstants.MSDS_GET_ALL_REALMS_ENDPOINT, DUMMY_REALM); String expectedUrl = getBaseUri().toString() + String.join("/", expectedUrlParams).replaceAll(" .substring(1); Assert.assertEquals(mockWriter.calledRequest.getURI().toString(), expectedUrl); mockWriter.close(); }</code><technical_language>a pre-defined constant instead of "PUT"? (Cue: HttpVerbs..) applies below</technical_language>

Target:
public void testAddMetadataStoreRealmNonLeader() { MockWriter mockWriter = new MockWriter(TEST_NAMESPACE, _zkAddrTestNS); mockWriter.addMetadataStoreRealm(DUMMY_REALM); Assert.assertEquals(mockWriter.calledRequest.getMethod(), HttpConstants.RestVerbs.PUT.name()); List<String> expectedUrlParams = Arrays .asList(MetadataStoreRoutingConstants.MSDS_NAMESPACES_URL_PREFIX, TEST_NAMESPACE, MetadataStoreRoutingConstants.MSDS_GET_ALL_REALMS_ENDPOINT, DUMMY_REALM); String expectedUrl = getBaseUri().toString() + String.join("/", expectedUrlParams).replaceAll(" .substring(1); Assert.assertEquals(mockWriter.calledRequest.getURI().toString(), expectedUrl); mockWriter.close(); }
Source:
<code><START> private Optional<PlanNode> tryCreatingNewScanNode(PlanNode plan) <END> { Optional<DruidQueryGenerator.DruidQueryGeneratorResult> dql = druidQueryGenerator.generate(plan, session); if (!dql.isPresent()) { return Optional.empty(); } DruidTableHandle druidTableHandle = getDruidTableHandle(tableScanNode).orElseThrow(() -> new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Expected to find a druid table handle")); DruidQueryGeneratorContext context = dql.get().getContext(); TableHandle oldTableHandle = tableScanNode.getTable(); LinkedHashMap<VariableReferenceExpression, DruidColumnHandle> assignments = context.getAssignments(); TableHandle newTableHandle = new TableHandle( oldTableHandle.getConnectorId(), new DruidTableHandle(druidTableHandle.getSchemaName(), druidTableHandle.getTableName(), Optional.of(dql.get().getGeneratedDql())), oldTableHandle.getTransaction(), oldTableHandle.getLayout()); return Optional.of( new TableScanNode( idAllocator.getNextId(), newTableHandle, ImmutableList.copyOf(assignments.keySet()), assignments.entrySet().stream().collect(toImmutableMap(Map.Entry::getKey, (e) -> (ColumnHandle) (e.getValue()))), tableScanNode.getCurrentConstraint(), tableScanNode.getEnforcedConstraint())); }</code><technical_language>I this code familiar :-)</technical_language>

Target:
private Optional<PlanNode> tryCreatingNewScanNode(PlanNode plan) { Optional<DruidQueryGenerator.DruidQueryGeneratorResult> dql = druidQueryGenerator.generate(plan, session); if (!dql.isPresent()) { return Optional.empty(); } DruidTableHandle druidTableHandle = getDruidTableHandle(tableScanNode).orElseThrow(() -> new PrestoException(DRUID_QUERY_GENERATOR_FAILURE, "Expected to find a druid table handle")); DruidQueryGeneratorContext context = dql.get().getContext(); TableHandle oldTableHandle = tableScanNode.getTable(); Map<VariableReferenceExpression, DruidColumnHandle> assignments = context.getAssignments(); TableHandle newTableHandle = new TableHandle( oldTableHandle.getConnectorId(), new DruidTableHandle(druidTableHandle.getSchemaName(), druidTableHandle.getTableName(), Optional.of(dql.get().getGeneratedDql())), oldTableHandle.getTransaction(), oldTableHandle.getLayout()); return Optional.of( new TableScanNode( idAllocator.getNextId(), newTableHandle, ImmutableList.copyOf(assignments.keySet()), assignments.entrySet().stream().collect(toImmutableMap(Map.Entry::getKey, (e) -> (ColumnHandle) (e.getValue()))), tableScanNode.getCurrentConstraint(), tableScanNode.getEnforcedConstraint())); }
Source:
<code>public void roundTripEquivalence(IonDatagram input, boolean myExpectedEquality) throws IOException { IonDatagram[] data = roundTripDatagram(input); for(int i = 0; i < data.length - 1; i++){ <START> runEquivalenceChecks(data[i], myExpectedEquality); <END> for(int j = i + 1; j < data.length; j++) { for(int sexpIndice = 0; sexpIndice < data[i].size(); sexpIndice++) { for(int timestampIndice = 0; timestampIndice < ((IonSexp)data[i].get(sexpIndice)).size(); timestampIndice++) { checkEquivalence(((IonSexp)(data[i].get(sexpIndice))).get(timestampIndice), ((IonSexp)(data[j].get(sexpIndice))).get(timestampIndice), true); } } } } }</code><technical_language>element in data array is subjected runEquivalenceChecks</technical_language>

Target:
public void roundTripEquivalence(IonDatagram input, boolean myExpectedEquality) throws IOException { IonDatagram[] data = roundTripDatagram(input); for(int i = 0; i < data.length; i++) { runEquivalenceChecks(data[i], myExpectedEquality); for(int j = i + 1; j < data.length; j++) { for(int seqIndice = 0; seqIndice < data[i].size(); seqIndice++) { int maxTimeStampIndice = ((IonSequence)data[i].get(seqIndice)).size(); for(int timeStampIndice = 0; timeStampIndice < maxTimeStampIndice; timeStampIndice++) { IonValue timeStamp1 = ((IonSequence)(data[i].get(seqIndice))).get(timeStampIndice); IonValue timeStamp2 = ((IonSequence)(data[j].get(seqIndice))).get(timeStampIndice); checkEquivalence(timeStamp1, timeStamp2, true); } } } } }
Source:
<code>public void onEvent(ArchetypeOutput event) { <START> sendArchetypeNotification(event); <END> }</code><technical_language>I need more method here, move ArchetypeOutput archetypeOutput = DtoFactory.newDto(ArchetypeOutput.class); archetypeOutput.setOutput(event.getOutput()); archetypeOutput.setState(event.getState()); endpointIds.forEach(it -> transmitter.newRequest() .endpointId(it) .methodName(MAVEN_ARCHETYPE_CHANEL_OUTPUT) .paramsAsDto(archetypeOutput) .sendAndSkipResult()); I miss reason stands this decision</technical_language>

Target:
public void onEvent(ArchetypeOutput event) { ArchetypeOutput archetypeOutput = DtoFactory.newDto(ArchetypeOutput.class); archetypeOutput.setOutput(event.getOutput()); archetypeOutput.setState(event.getState()); endpointIds.forEach(it -> transmitter.newRequest() .endpointId(it) .methodName(MAVEN_ARCHETYPE_CHANEL_OUTPUT) .paramsAsDto(archetypeOutput) .sendAndSkipResult()); }
Source:
<code>private String buildProxyUrl(String sitemapName, Widget widget, URI uri) { String wId = itemUIRegistry.getWidgetId(widget); StringBuilder sb = new StringBuilder(); sb.append(uri.getScheme()).append("://").append(uri.getHost()); <START> if (uri.getPort() >= 0 && uri.getPort() != 80) { <END> sb.append(":").append(uri.getPort()); } sb.append("/proxy?sitemap=").append(sitemapName).append(".sitemap&widgetId=").append(wId); return sb.toString(); }</code><technical_language>moved this method another method, is correct? If scheme is http default port is 80, is fine. If scheme is https default port 443 uri.getPort() checked 443. Okay, this affect strange situation if runs https port 80, run into. fixed</technical_language>

Target:
private String buildProxyUrl(String sitemapName, Widget widget, URI uri) { String wId = itemUIRegistry.getWidgetId(widget); StringBuilder sb = new StringBuilder(); sb.append(uri.getScheme()).append("://").append(uri.getHost()); if (uri.getPort() >= 0) { sb.append(":").append(uri.getPort()); } sb.append("/proxy?sitemap=").append(sitemapName).append(".sitemap&widgetId=").append(wId); return sb.toString(); }
Source:
<code>public void searchChargesByFullCardHolderNameMatch() { Long chargeId = 12L; TestCharge testCharge = DatabaseFixtures .withDatabaseTestHelper(databaseTestHelper) .aTestCharge() .withTestAccount(defaultTestAccount) .withCardDetails(defaultTestCardDetails.withChargeId(chargeId)) .withChargeId(chargeId) .insert(); ChargeSearchParams params = new ChargeSearchParams() .withCardHolderNameLike(CardHolderName.of(testCharge.cardDetails.getCardHolderName())); List<ChargeEntity> charges = chargeDao.findAllBy(params); assertThat(charges.size(), is(1)); <START> assertCharge("visa", testCharge, charges.get(0)); <END> }</code><technical_language>Surely asserting cardholder name better</technical_language>

Target:
public void searchChargesByFullCardHolderNameMatch() { Long chargeId = 12L; TestCharge testCharge = DatabaseFixtures .withDatabaseTestHelper(databaseTestHelper) .aTestCharge() .withTestAccount(defaultTestAccount) .withCardDetails(defaultTestCardDetails.withChargeId(chargeId)) .withChargeId(chargeId) .insert(); ChargeSearchParams params = new ChargeSearchParams() .withCardHolderNameLike(CardHolderName.of(testCharge.cardDetails.getCardHolderName())); List<ChargeEntity> charges = chargeDao.findAllBy(params); assertThat(charges.size(), is(1)); ChargeEntity charge = charges.get(0); assertCharge("visa", testCharge, charge); assertThat(charge.getCardDetails().getCardHolderName(), is(testCharge.cardDetails.getCardHolderName())); assertThat(charge.getCardDetails().getLastDigitsCardNumber(), is(testCharge.cardDetails.getLastDigitsCardNumber())); }
Source:
<code>private void validateLabelTemplate() { if (XmlUtils.doesNotMatchUsingXsdRegex(LABEL_TEMPLATE_FORMAT_REGEX, labelTemplate)) { addError("labelTemplate", LABEL_TEMPLATE_ERROR_MESSAGE); return; } if(validateLabelTemplateTruncation(labelTemplate)){ <START> addError("labelTemplate", String.format("Invalid label. %s length of zero not allowed",labelTemplate)); <END> return; } Set<String> templateVariables = getTemplateVariables(); List<String> materialNames = allowedTemplateVariables(); for (final String templateVariable : templateVariables) { if (!CollectionUtils.exists(materialNames, withNameSameAs(templateVariable))) { addError("labelTemplate", String.format(ERR_TEMPLATE, name(), templateVariable)); } } }</code><technical_language>a message reads - Length of zero allowed label "some-label" defined pipeline "pipelineName"</technical_language>

Target:
private void validateLabelTemplate() { if (XmlUtils.doesNotMatchUsingXsdRegex(LABEL_TEMPLATE_FORMAT_REGEX, labelTemplate)) { addError("labelTemplate", LABEL_TEMPLATE_ERROR_MESSAGE); return; } if(validateLabelTemplateTruncation(labelTemplate)){ addError("labelTemplate", String.format("Length of zero not allowed on label %s defined on pipeline %s.",labelTemplate,name)); return; } Set<String> templateVariables = getTemplateVariables(); List<String> materialNames = allowedTemplateVariables(); for (final String templateVariable : templateVariables) { if (!CollectionUtils.exists(materialNames, withNameSameAs(templateVariable))) { addError("labelTemplate", String.format(ERR_TEMPLATE, name(), templateVariable)); } } }
Source:
<code>public void toSQL(ColumnResolver resolver, StringBuilder buf) { Preconditions.checkNotNull(buf); <START> buf.append("SHOW SCHEMAS "); <END> if (schemaPattern != null) { buf.append("LIKE "); buf.append("'" + schemaPattern + "'"); } }</code><technical_language>buf.append("SHOW SCHEMAS "); if (schemaPattern != null) { buf.append("LIKE "); buf.append("SHOW SCHEMAS"); if (schemaPattern != null) { buf.append(" "); if this sense</technical_language>

Target:
public void toSQL(ColumnResolver resolver, StringBuilder buf) { Preconditions.checkNotNull(buf); buf.append("SHOW SCHEMAS"); if (schemaPattern != null) { buf.append(" LIKE "); buf.append("'").append(schemaPattern).append("'"); } }
Source:
<code>protected void execute() { logger.debug("execute() method is called!"); try { if (!connect()) { <START> logger.error("driver.K8055.accessHardware(): Unable to access hardware."); <END> return; } long inputs = sysLibrary.ReadAllDigital(); if (inputs < 0){throw new Exception("Connection failure");} for (k8055BindingProvider provider : this.providers) { for (String itemName : provider.getItemNames()) { k8055BindingConfig config = provider.getItemConfig(itemName); if (IOType.DIGITAL_IN.equals(config.ioType)){ boolean newstate = (inputs & (1 << (config.ioNumber - 1))) != 0; boolean oldstate = (lastDigitalInputs & (1 << (config.ioNumber - 1))) != 0; if (lastDigitalInputs < 0 || newstate != oldstate) { if (newstate) { eventPublisher.postUpdate(itemName, OpenClosedType.CLOSED); } else { eventPublisher.postUpdate(itemName, OpenClosedType.OPEN); } } } else if (IOType.ANALOG_IN.equals(config.ioType)) { int state = sysLibrary.ReadAnalogChannel(config.ioNumber); eventPublisher.postUpdate(itemName, new DecimalType(state)); } } } lastDigitalInputs = inputs; } catch (Exception e){ logger.error("K8055 Connection failure"); connected = false; sysLibrary.CloseDevice(); } }</code><technical_language>logstatement is a bit confusing. this point statement read "There is connection K8055" more detailed information provided connect() method</technical_language>

Target:
protected void execute() { logger.debug("execute() method is called!"); try { if (!connect()) { logger.error("Not connected to hardware. Skipping attempt to read inputs."); return; } long inputs = sysLibrary.ReadAllDigital(); if (inputs < 0) { throw new Exception( "Failed to read digital inputs from hardware"); } for (k8055BindingProvider provider : this.providers) { for (String itemName : provider.getItemNames()) { k8055BindingConfig config = provider .getItemConfig(itemName); if (IOType.DIGITAL_IN.equals(config.ioType)) { boolean newstate = (inputs & (1 << (config.ioNumber - 1))) != 0; boolean oldstate = (lastDigitalInputs & (1 << (config.ioNumber - 1))) != 0; if (lastDigitalInputs < 0 || newstate != oldstate) { if (newstate) { eventPublisher.postUpdate(itemName, OpenClosedType.CLOSED); } else { eventPublisher.postUpdate(itemName, OpenClosedType.OPEN); } } } else if (IOType.ANALOG_IN.equals(config.ioType)) { int state = sysLibrary .ReadAnalogChannel(config.ioNumber); if (inputs < 0) { throw new Exception( "Failed to read analog channel " + config.ioNumber + " from hardware"); } eventPublisher.postUpdate(itemName, new DecimalType( state)); } } } lastDigitalInputs = inputs; } catch (Exception e) { logger.error("Failed to read from hardware ", e); connected = false; sysLibrary.CloseDevice(); } }
Source:
<code>protected void setUserUnlocked(int userId) { Log.i(TAG, "User unlocked, initializing the service"); if (!SystemProperties.getBoolean(AVRCP_ENABLE_PROPERTY, false)) { Log.w(TAG, "Skipping initialization of the new AVRCP Target Player List"); sInstance = null; return; } <START> mMediaPlayerList.init(new ListCallback()); <END> }</code><technical_language>This happen a conditional basis avoid crash</technical_language>

Target:
protected void setUserUnlocked(int userId) { Log.i(TAG, "User unlocked, initializing the service"); if (!SystemProperties.getBoolean(AVRCP_ENABLE_PROPERTY, false)) { Log.w(TAG, "Skipping initialization of the new AVRCP Target Player List"); sInstance = null; return; } if (mMediaPlayerList != null) { mMediaPlayerList.init(new ListCallback()); } }
Source:
<code>private void verifyLinkExpansionButtons(StudentAttributes student, InstructorAttributes instructor) { WebElement studentRow = searchPage.getStudentRow(student); WebElement instructorRow = searchPage.getInstructorRow(instructor); searchPage.clickExpandStudentLinks(); searchPage.clickExpandInstructorLinks(); int numExpandedStudentRows = searchPage.getNumExpandedRows(studentRow); int numExpandedInstructorRows = searchPage.getNumExpandedRows(instructorRow); assertNotEquals(numExpandedStudentRows, 0); assertNotEquals(numExpandedInstructorRows, 0); searchPage.clickCollapseInstructorLinks(); numExpandedStudentRows = searchPage.getNumExpandedRows(studentRow); numExpandedInstructorRows = searchPage.getNumExpandedRows(instructorRow); assertNotEquals(numExpandedStudentRows, 0); assertEquals(numExpandedInstructorRows, 0); searchPage.clickExpandInstructorLinks(); searchPage.clickCollapseStudentLinks(); try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); <START> } <END> numExpandedStudentRows = searchPage.getNumExpandedRows(studentRow); numExpandedInstructorRows = searchPage.getNumExpandedRows(instructorRow); assertEquals(numExpandedStudentRows, 0); assertNotEquals(numExpandedInstructorRows, 0); }</code><technical_language>this works, this stable. Is another here, e.g. waiting for element appear? If abstract this out a method in AppPage. java public void waitForCollapseAnimation() { ThreadHelper.waitFor(500); }</technical_language>

Target:
private void verifyLinkExpansionButtons(StudentAttributes student, InstructorAttributes instructor) { WebElement studentRow = searchPage.getStudentRow(student); WebElement instructorRow = searchPage.getInstructorRow(instructor); searchPage.clickExpandStudentLinks(); searchPage.clickExpandInstructorLinks(); int numExpandedStudentRows = searchPage.getNumExpandedRows(studentRow); int numExpandedInstructorRows = searchPage.getNumExpandedRows(instructorRow); assertNotEquals(numExpandedStudentRows, 0); assertNotEquals(numExpandedInstructorRows, 0); searchPage.clickCollapseInstructorLinks(); numExpandedStudentRows = searchPage.getNumExpandedRows(studentRow); numExpandedInstructorRows = searchPage.getNumExpandedRows(instructorRow); assertNotEquals(numExpandedStudentRows, 0); assertEquals(numExpandedInstructorRows, 0); searchPage.clickExpandInstructorLinks(); searchPage.clickCollapseStudentLinks(); searchPage.waitUntilAnimationFinish(); numExpandedStudentRows = searchPage.getNumExpandedRows(studentRow); numExpandedInstructorRows = searchPage.getNumExpandedRows(instructorRow); assertEquals(numExpandedStudentRows, 0); assertNotEquals(numExpandedInstructorRows, 0); }
Source:
<code>private ResultScanner<Row> streamRows(ReadRowsRequest request) { boolean isGet = request.getTargetCase() == ReadRowsRequest.TargetCase.ROW_KEY; <START> int streamingBufferSize = retryOptions.getStreamingBufferSize(); <END> int batchRequestSize; Channel channel; if (isGet) { batchRequestSize = 1; streamingBufferSize = 10; channel = channelPool; } else { batchRequestSize = retryOptions.getStreamingBatchSize(); streamingBufferSize = retryOptions.getStreamingBufferSize(); channel = channelPool.reserveChannel(); } ClientCall<ReadRowsRequest, ReadRowsResponse> readRowsCall = channel.newCall(BigtableServiceGrpc.METHOD_READ_ROWS, CallOptions.DEFAULT); CancellationToken cancellationToken = createCancellationToken(channel, readRowsCall); int timeout = retryOptions.getReadPartialRowTimeoutMillis(); ResponseQueueReader responseQueueReader = new ResponseQueueReader(timeout, streamingBufferSize, batchRequestSize, batchRequestSize, readRowsCall); StreamingBigtableResultScanner resultScanner = new StreamingBigtableResultScanner(responseQueueReader, cancellationToken); clientCallService.asyncServerStreamingCall( readRowsCall, request, createClientCallListener(channel, resultScanner)); if (batchRequestSize > 1) { readRowsCall.request(batchRequestSize - 1); } return resultScanner; }</code><technical_language>Do want initialize streamingBufferSize here? for batchRequestSize channel</technical_language>

Target:
private ResultScanner<Row> streamRows(ReadRowsRequest request) { boolean isGet = request.getTargetCase() == ReadRowsRequest.TargetCase.ROW_KEY; int streamingBufferSize; int batchRequestSize; Channel channel; if (isGet) { batchRequestSize = 1; streamingBufferSize = 10; channel = channelPool; } else { batchRequestSize = retryOptions.getStreamingBatchSize(); streamingBufferSize = retryOptions.getStreamingBufferSize(); channel = channelPool.reserveChannel(); } ClientCall<ReadRowsRequest, ReadRowsResponse> readRowsCall = channel.newCall(BigtableServiceGrpc.METHOD_READ_ROWS, CallOptions.DEFAULT); CancellationToken cancellationToken = createCancellationToken(channel, readRowsCall); int timeout = retryOptions.getReadPartialRowTimeoutMillis(); ResponseQueueReader responseQueueReader = new ResponseQueueReader(timeout, streamingBufferSize, batchRequestSize, batchRequestSize, readRowsCall); StreamingBigtableResultScanner resultScanner = new StreamingBigtableResultScanner(responseQueueReader, cancellationToken); clientCallService.asyncServerStreamingCall( readRowsCall, request, createClientCallListener(channel, resultScanner)); if (batchRequestSize > 1) { readRowsCall.request(batchRequestSize - 1); } return resultScanner; }
Source:
<code><START> String getViewId() { <END> return fViewId; }</code><technical_language>private? (the outer class able access it)</technical_language>

Target:
private String getViewId() { return fViewId; }
Source:
<code>public CountsComputer( long lastCommittedTransactionId, NodeStore nodes, RelationshipStore relationships, int highLabelId, int highRelationshipTypeId ) { this( lastCommittedTransactionId, nodes, relationships, highLabelId, highRelationshipTypeId, <START> new SilentMigrationProgressMonitor().startSection( "Counts" ) ); <END> }</code><technical_language>section 'completed()' in end gonna do for this section</technical_language>

Target:
public CountsComputer( long lastCommittedTransactionId, NodeStore nodes, RelationshipStore relationships, int highLabelId, int highRelationshipTypeId ) { this( lastCommittedTransactionId, nodes, relationships, highLabelId, highRelationshipTypeId, SilentMigrationProgressMonitor.NO_OP_SECTION ); }
Source:
<code>private void ensureAccessToken() { try { <START> if(isMaterialized()) { <END> Claims claims = Jwts.parser() .setSigningKey(getDataStore().getApiKey().getSecret().getBytes("UTF-8")) .parseClaimsJws(getString(JWT)).getBody(); Assert.isTrue(Strings.hasText((String) claims.get("rti"))); } } catch (Exception e) { throw new JwtException("JWT failed validation; it cannot be trusted."); } }</code><technical_language>space if. If materialized, here. circumstance access token materialized? Is error if this method is called access token is materialized</technical_language>

Target:
private void ensureAccessToken() { if(isMaterialized()) { try { Claims claims = Jwts.parser() .setSigningKey(getDataStore().getApiKey().getSecret().getBytes("UTF-8")) .parseClaimsJws(getString(JWT)).getBody(); Assert.isTrue(Strings.hasText((String) claims.get("rti"))); } catch (Exception e) { throw new JwtException("JWT failed validation; it cannot be trusted."); } } else { String href = getStringProperty(HREF_PROP_NAME); if (href != null) { Assert.isTrue(href.contains("/accessTokens/"), "href does not belong to an access token."); } } }
Source:
<code>public void testWriteAndRead() throws IOException { Schema schema = Schema.create(Type.STRING); DataFileWriter<Utf8> w = new DataFileWriter<>(new GenericDatumWriter<>(schema)); w.setCodec(CodecFactory.deflateCodec(6)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); w.create(schema, baos); w.append(new Utf8("hello world")); w.append(new Utf8("hello moon")); w.sync(); w.append(new Utf8("bye bye world")); w.append(new Utf8("bye bye moon")); w.close(); DataFileStream<Utf8> r = new DataFileStream<>(new ByteArrayInputStream(baos.toByteArray()), new GenericDatumReader<>(schema)); assertEquals("hello world", r.next().toString()); assertEquals("hello moon", r.next().toString()); assertEquals("bye bye world", r.next().toString()); assertEquals("bye bye moon", r.next().toString()); assertFalse(r.hasNext()); <START> r.close(); <END> }</code><technical_language>a try-with-resource pattern here</technical_language>

Target:
public void testWriteAndRead() throws IOException { Schema schema = Schema.create(Type.STRING); DataFileWriter<Utf8> w = new DataFileWriter<>(new GenericDatumWriter<>(schema)); w.setCodec(CodecFactory.deflateCodec(6)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); w.create(schema, baos); w.append(new Utf8("hello world")); w.append(new Utf8("hello moon")); w.sync(); w.append(new Utf8("bye bye world")); w.append(new Utf8("bye bye moon")); w.close(); try (DataFileStream<Utf8> r = new DataFileStream<>(new ByteArrayInputStream(baos.toByteArray()), new GenericDatumReader<>(schema))) { assertEquals("hello world", r.next().toString()); assertEquals("hello moon", r.next().toString()); assertEquals("bye bye world", r.next().toString()); assertEquals("bye bye moon", r.next().toString()); assertFalse(r.hasNext()); } }
Source:
<code><START> private MutableConfiguration<Long, Product> createProductCacheConf() { <END> MutableConfiguration<Long, Product> conf = new MutableConfiguration<Long, Product>(); conf.setTypes(Long.class, Product.class); return conf; }</code><technical_language>do for test above? Possibly reusing this method type params</technical_language>

Target:
private MutableConfiguration<Long, Product> createProductCacheConf() { return createMutableConfiguration(Long.class, Product.class); }
Source:
<code>public boolean next() throws IOException { if (session.walk == null) throw new IllegalStateException( JGitText.get().blameHasNotBeenStarted); RevCommit commit = session.walk.next(); if (commit == null) { markSessionBound(); return false; } ObjectId blob = getBlob(commit); if (blob == null) { updatePath(commit); blob = getBlob(commit); } <START> if (blob == null) { <END> markSessionBound(); return false; } RawText text = getRawText(blob); EditList diffs = diffAlgorithm.diff(textComparator, text, session.text); merge(commit, text.size(), diffs); session.text = text; session.commit = commit; if (!session.merges) markSessionBound(); return session.merges; }</code><technical_language>Move this block above: if (blob == null) { updatePath(commit); blob = getBlob(commit); if (blob == null) { markSessionBound(); return false; } }</technical_language>

Target:
public boolean next() throws IOException { if (walk == null && !start()) { release(); return false; } curEdit++; if (remaining == 0) { release(); return false; } for (;;) { if (curEdit == editList.size()) { if (!nextCommit()) return false; continue; } Edit edit = editList.get(curEdit); int len = edit.getLengthB(); if (len == 0) { curEdit++; } else { remaining -= len; return true; } } }
Source:
<code>public void testFindWorkingVersionContainer() throws Exception{ Container c = new Container(); c.setFriendlyName("Versionable Container Working"); c.setTitle("Versionable Container Working"); c.setMaxContentlets(2); c.setPreLoop("preloop code"); c.setPostLoop("postloop code"); Structure st=CacheLocator.getContentTypeCache().getStructureByVelocityVarName("host"); List<ContainerStructure> csList = new ArrayList<ContainerStructure>(); ContainerStructure cs = new ContainerStructure(); cs.setStructureId(st.getInode()); cs.setCode("this is the code"); csList.add(cs); <START> c = APILocator.getContainerAPI().save(c, csList, host, user, false); <END> Versionable verAPI = APILocator.getVersionableAPI().findWorkingVersion(c.getIdentifier(), user, false); assertEquals(verAPI.getTitle(),c.getTitle()); assertEquals(verAPI.getInode(),c.getInode()); APILocator.getContainerAPI().delete(c, user, false); }</code><technical_language>Code line 84 98 replaced with: Container container = new ContainerDataGen().withStructure(st, "").nextPersisted();</technical_language>

Target:
public void testFindWorkingVersionContainer() throws Exception{ Structure structure = new StructureDataGen().nextPersisted(); Container container = new ContainerDataGen().withStructure(structure, "").nextPersisted(); Versionable verAPI = APILocator.getVersionableAPI().findWorkingVersion(container.getIdentifier(), user, false); assertEquals(verAPI.getTitle(),container.getTitle()); assertEquals(verAPI.getInode(),container.getInode()); APILocator.getContainerAPI().delete(container, user, false); APILocator.getStructureAPI().delete(structure, user); }
Source:
<code>public <T> T build(Class<T> aClass) { if (baseUri == null) { throw new IllegalStateException("baseUrl not set"); } Validator.checkValid(aClass); RegisterProvider[] providers = aClass.getAnnotationsByType(RegisterProvider.class); Configuration config = configImpl.getConfiguration(); if (providers != null) { for (RegisterProvider provider : providers) { if (!config.isRegistered(provider.value())) { if (provider.priority() == -1) { register(provider.value()); } else { register(provider.value(), provider.priority()); } } } } final String interfaceName = aClass.getName(); Optional<Long> timeout = ConfigFacade.getOptionalValue( String.format(REST_CONN_TIMEOUT_FORMAT, interfaceName), Long.class).map( timeoutValue -> { connectTimeout(timeoutValue, TimeUnit.MILLISECONDS); return timeoutValue; }); if (!timeout.isPresent() && LOG.isLoggable(Level.FINEST)) { <START> LOG.finest("connectionTimeout set by MP Config: " + timeout.get()); <END> } timeout = ConfigFacade.getOptionalValue( String.format(REST_READ_TIMEOUT_FORMAT, interfaceName), Long.class).map( timeoutValue -> { readTimeout(timeoutValue, TimeUnit.MILLISECONDS); return timeoutValue; }); if (!timeout.isPresent() && LOG.isLoggable(Level.FINEST)) { LOG.finest("readTimeout set by MP Config: " + timeout.get()); } for (RestClientListener listener : listeners()) { listener.onNewClient(aClass, this); } MicroProfileClientFactoryBean bean = new MicroProfileClientFactoryBean(configImpl, baseUri, aClass, executorService); return bean.create(aClass); }</code><technical_language>Uh ... timeout.get() blow if statement !timeout.isPresent() ... if (LOG.isLoggable(Level.FINEST)) { timeout.ifPresent(t -> LOG.finest("connectionTimeout set MP Config: " + t) ); };</technical_language>

Target:
public <T> T build(Class<T> aClass) { if (baseUri == null) { throw new IllegalStateException("baseUrl not set"); } Validator.checkValid(aClass); RegisterProvider[] providers = aClass.getAnnotationsByType(RegisterProvider.class); Configuration config = configImpl.getConfiguration(); if (providers != null) { for (RegisterProvider provider : providers) { if (!config.isRegistered(provider.value())) { if (provider.priority() == -1) { register(provider.value()); } else { register(provider.value(), provider.priority()); } } } } final String interfaceName = aClass.getName(); ConfigFacade.getOptionalLong(String.format(REST_CONN_TIMEOUT_FORMAT, interfaceName)).ifPresent( timeoutValue -> { connectTimeout(timeoutValue, TimeUnit.MILLISECONDS); if (LOG.isLoggable(Level.FINEST)) { LOG.finest("readTimeout set by MP Config: " + timeoutValue); } }); ConfigFacade.getOptionalLong(String.format(REST_READ_TIMEOUT_FORMAT, interfaceName)).ifPresent( timeoutValue -> { readTimeout(timeoutValue, TimeUnit.MILLISECONDS); if (LOG.isLoggable(Level.FINEST)) { LOG.finest("readTimeout set by MP Config: " + timeoutValue); } }); listeners().forEach(l -> l.onNewClient(aClass, this)); MicroProfileClientFactoryBean bean = new MicroProfileClientFactoryBean(configImpl, baseUri, aClass, executorService); return bean.create(aClass); }
Source:
<code>public Map<String, String> getIdfFileAttributes(String experimentAccession, String cellId) { IdfParserOutput idfParserOutput = idfParser.parse(experimentAccession); if (idfParserOutput.getMetadataFieldsOfInterest().isEmpty()) { return emptyMap(); } SingleCellAnalyticsSchemaField[] attributeFields = idfParserOutput.getMetadataFieldsOfInterest() .stream() <START> .map(attribute -> SingleCellAnalyticsCollectionProxy.characteristicAsSchemaField(attributeNameToFieldName((attribute)), attribute)) <END> .toArray(SingleCellAnalyticsSchemaField[]::new); return getCellQueryResultForMultiValueFields(experimentAccession, cellId, attributeFields) .entrySet().stream() .collect(toMap( Map.Entry::getKey, entry -> entry.getValue().stream().map(Object::toString).collect(Collectors.joining(",")))); }</code><technical_language>Lisp, double parenthesis removed</technical_language>

Target:
public Map<String, String> getIdfFileAttributes(String experimentAccession, String cellId) { IdfParserOutput idfParserOutput = idfParser.parse(experimentAccession); if (idfParserOutput.getMetadataFieldsOfInterest().isEmpty()) { return emptyMap(); } SingleCellAnalyticsSchemaField[] attributeFields = idfParserOutput.getMetadataFieldsOfInterest() .stream() .map(attribute -> SingleCellAnalyticsCollectionProxy.characteristicAsSchemaField(attributeNameToFieldName(attribute))) .toArray(SingleCellAnalyticsSchemaField[]::new); return getCellQueryResultForMultiValueFields(experimentAccession, cellId, attributeFields) .entrySet().stream() .collect(toMap( Map.Entry::getKey, entry -> entry.getValue().stream().map(Object::toString).collect(Collectors.joining(",")))); }
Source:
<code><START> public static void setUserMetadataHeaders(Map<String, String> userMetadataMap, <END> RestResponseChannel restResponseChannel) { Objects.requireNonNull(userMetadataMap, "user metadata must be supplied"); for (Map.Entry<String, String> entry : userMetadataMap.entrySet()) { String headerName = entry.getKey(); String headerValue = entry.getValue(); try { restResponseChannel.setHeader(headerName, headerValue); } catch (IllegalArgumentException iae) { try { headerName = headerName.replaceFirst(Headers.USER_META_DATA_HEADER_PREFIX, Headers.USER_META_DATA_ENCODED_HEADER_PREFIX); headerValue = URLEncoder.encode(headerValue, CHARSET.name()); restResponseChannel.setHeader(headerName, headerValue); logger.debug("Set encoded value in response header {}", headerName); } catch (Exception e) { logger.error("Unable to set response header to value {}", headerName, headerValue, e); } } } }</code><technical_language>a difference map provided in open source closed source place this is intended used. RestUtils.buildUserMetadata returns a map keys "x-ambry-um-" prefix. decoded map in closed source (without writing some code adds them). buildUserMetadata prepend prefix setUserMetadataHeaders do instead</technical_language>

Target:
public static void setUserMetadataHeaders(Map<String, String> userMetadataMap, RestResponseChannel restResponseChannel) { Objects.requireNonNull(userMetadataMap, "user metadata must be supplied"); for (Map.Entry<String, String> entry : userMetadataMap.entrySet()) { String headerName = entry.getKey(); String headerValue = entry.getValue(); if (!headerName.startsWith(Headers.USER_META_DATA_HEADER_PREFIX)) { headerName = Headers.USER_META_DATA_HEADER_PREFIX + headerName; } try { restResponseChannel.setHeader(headerName, headerValue); } catch (IllegalArgumentException iae) { try { headerName = headerName.replaceFirst(Headers.USER_META_DATA_HEADER_PREFIX, Headers.USER_META_DATA_ENCODED_HEADER_PREFIX); headerValue = URLEncoder.encode(headerValue, CHARSET.name()); restResponseChannel.setHeader(headerName, headerValue); logger.debug("Set encoded value in response header {}", headerName); } catch (Exception e) { logger.error("Unable to set response header to value {}", headerName, headerValue, e); } } } }
Source:
<code><START> public synchronized void executeSensorIncr(String sensor) { <END> executeSensorCount.scope(sensor); }</code><technical_language>Curious java-> java.util.concurrent.atomic.AtomicLong package, is thread safe performance. synchronized method code single thread multiple threads running</technical_language>

Target:
public synchronized void executeSensorIncr(String sensor) { executeSensorCount.scope(sensor).incr(); }
Source:
<code>private void addRemotePropertiesConfigurationSources(ConfigurationRegistry configuration, CorePlugin corePlugin) { <START> final ArrayList<URL> configurationUrls = new ArrayList<URL>(corePlugin.getRemotePropertiesConfigUrls()); <END> if (corePlugin.isDeactivateStagemonitorIfRemotePropertyServerIsDown()) { assertRemotePropertiesServerIsAvailable(configurationUrls.get(0)); } logger.debug("Loading RemotePropertiesConfigurationSources with: configurationUrls = " + configurationUrls); final HttpClient sharedHttpClient = new HttpClient(); for (URL configUrl : configurationUrls) { final RemotePropertiesConfigurationSource source = new RemotePropertiesConfigurationSource( sharedHttpClient, configUrl); configuration.addConfigurationSourceAfter(source, SimpleSource.class); } configuration.reloadAllConfigurationOptions(); }</code><technical_language>getRemotePropertiesConfigUrls() returns a list now, create a new array list</technical_language>

Target:
private void addRemotePropertiesConfigurationSources(ConfigurationRegistry configuration, CorePlugin corePlugin) { final List<URL> configurationUrls = corePlugin.getRemotePropertiesConfigUrls(); if (corePlugin.isDeactivateStagemonitorIfRemotePropertyServerIsDown()) { assertRemotePropertiesServerIsAvailable(configurationUrls.get(0)); } logger.debug("Loading RemotePropertiesConfigurationSources with: configurationUrls = " + configurationUrls); final HttpClient sharedHttpClient = new HttpClient(); for (URL configUrl : configurationUrls) { final RemotePropertiesConfigurationSource source = new RemotePropertiesConfigurationSource( sharedHttpClient, configUrl); configuration.addConfigurationSourceAfter(source, SimpleSource.class); } configuration.reloadAllConfigurationOptions(); }
Source:
<code>public boolean studyEntryHasSamples(final Integer studyId, final Integer entryId) { final List queryResults; try { final SQLQuery query = this.getSession().createSQLQuery(SQL_STUDY_ENTRY_HAS_SAMPLES); query.setParameter("studyId", studyId); query.setParameter("entryId", entryId); queryResults = query.list(); } catch (final HibernateException he) { throw new MiddlewareException( <START> "Unexpected error in executing hasSamples(studyId = " + studyId + ") query: " + he.getMessage(), <END> he); } return queryResults.isEmpty() ? false : true; }</code><technical_language>Fix error message, hasSamples studyEntryHasSamples</technical_language>

Target:
public boolean studyEntryHasSamples(final Integer studyId, final Integer entryId) { final List queryResults; try { final SQLQuery query = this.getSession().createSQLQuery(SQL_STUDY_ENTRY_HAS_SAMPLES); query.setParameter("studyId", studyId); query.setParameter("entryId", entryId); queryResults = query.list(); } catch (final HibernateException he) { throw new MiddlewareException( "Unexpected error in executing studyEntryHasSamples(studyId = " + studyId + ",entryId=" + entryId + ") query: " + he.getMessage(), he); } return queryResults.isEmpty() ? false : true; }
Source:
<code>public void testDynamicPropertyFilterIncludeNestedProperty() { DynamicFilterData filterData = new DynamicFilterData(); filterData.includeAttribute("owner.id"); filterData.setWhitelistMode(true); ResteasyProviderFactory.pushContext(DynamicFilterData.class, filterData); ActivationKeyDTO keyDTO = new ActivationKeyDTO(); NestedOwnerDTO ownerDTO = new NestedOwnerDTO() .key("owner_key") .id("owner_id"); keyDTO.setOwner(ownerDTO); String serializedKey = ""; try { serializedKey = ourMapper.writeValueAsString(keyDTO); } catch (JsonProcessingException e) { fail("Serializing ActivationKeyDTO failed!"); } ObjectMapper mapper = new ObjectMapper(); JsonNode akNode = null; try { akNode = mapper.readTree(serializedKey); } catch (JsonProcessingException e) { fail("Parsing serialized ActivationKeyDTO failed!"); } assertEquals(1, akNode.size()); assertTrue(akNode.has("owner"), "The 'owner' field should have been included!"); assertTrue(akNode.get("owner").has("id"), "The 'owner.id' field should have been included!"); <START> } <END></code><technical_language>For tests nested nodes, verify children nodes correct amount of elements. Applies</technical_language>

Target:
public void testDynamicPropertyFilterIncludeNestedProperty() { DynamicFilterData filterData = new DynamicFilterData(); filterData.includeAttribute("owner.id"); filterData.setWhitelistMode(true); ResteasyProviderFactory.pushContext(DynamicFilterData.class, filterData); ActivationKeyDTO keyDTO = new ActivationKeyDTO(); NestedOwnerDTO ownerDTO = new NestedOwnerDTO() .key("owner_key") .id("owner_id"); keyDTO.setOwner(ownerDTO); String serializedKey = ""; try { serializedKey = ourMapper.writeValueAsString(keyDTO); } catch (JsonProcessingException e) { fail("Serializing ActivationKeyDTO failed!"); } ObjectMapper mapper = new ObjectMapper(); JsonNode akNode = null; try { akNode = mapper.readTree(serializedKey); } catch (JsonProcessingException e) { fail("Parsing serialized ActivationKeyDTO failed!"); } assertEquals(1, akNode.size()); assertTrue(akNode.has("owner"), "The 'owner' field should have been included!"); assertEquals(1, akNode.get("owner").size()); assertTrue(akNode.get("owner").has("id"), "The 'owner.id' field should have been included!"); }
Source:
<code>protected static int findMaxLandMassSize(final GamePlayer player) { final GameData data = player.getData(); final Predicate<Territory> cond = ProMatches.territoryCanPotentiallyMoveLandUnits(player, data); class LandMassFinder extends BreadthFirstSearch { int landMassSize = 0; LandMassFinder(final Territory startTerritory) { super(startTerritory, cond); } @Override public void visit(final Territory territory) { landMassSize++; } <START> } <END> int maxLandMassSize = 1; final var fullVisited = new HashSet<Territory>(); for (final Territory t : data.getMap().getTerritories()) { if (!t.isWater() && !fullVisited.contains(t)) { final LandMassFinder finder = new LandMassFinder(t); finder.search(); fullVisited.addAll(finder.getVisited()); if (finder.landMassSize > maxLandMassSize) { maxLandMassSize = finder.landMassSize; } } } return maxLandMassSize; }</code><technical_language>Ok, I nest classes methods</technical_language>

Target:
protected static int findMaxLandMassSize(final GamePlayer player) { final GameData data = player.getData(); final Predicate<Territory> cond = ProMatches.territoryCanPotentiallyMoveLandUnits(player, data); final var visited = new HashSet<Territory>(); int maxLandMassSize = 1; for (final Territory t : data.getMap().getTerritories()) { if (!t.isWater() && !visited.contains(t)) { visited.add(t); final int[] landMassSize = new int[1]; new BreadthFirstSearch(t, cond) .traverse( new BreadthFirstSearch.Visitor() { @Override public void visit(final Territory territory) { visited.add(territory); landMassSize[0]++; } }); if (landMassSize[0] > maxLandMassSize) { maxLandMassSize = landMassSize[0]; } } } return maxLandMassSize; }
Source:
<code>public boolean equals(Object o) { <START> if (this == o) <END> { return true; } if (o == null || getClass() != o.getClass()) { return false; } ThreadMeta that = (ThreadMeta) o; return Objects.equals(threadName, that.threadName) && Objects.equals(threadId, that.threadId); }</code><technical_language>whitespace/style</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ThreadMeta that = (ThreadMeta) o; return Objects.equals(threadName, that.threadName) && Objects.equals(threadId, that.threadId); }
Source:
<code>public String getLogEntryActionsButtonClass() { String className = ""; if (message.toLowerCase(Locale.ENGLISH).contains( <START> Const.ACTION_RESULT_FAILURE.toLowerCase(Locale.ENGLISH))) { <END> className = "btn-warning"; } else if (message.toLowerCase(Locale.ENGLISH).contains( Const.ACTION_RESULT_SYSTEM_ERROR_REPORT.toLowerCase(Locale.ENGLISH))) { className = "btn-danger"; } else { className = "btn-info"; } return className; }</code><technical_language>message.toLowerCase(Locale.ENGLISH) .contains(Const.ACTION_RESULT_FAILURE.toLowerCase(Locale.ENGLISH))) { instead:)</technical_language>

Target:
public String getLogEntryActionsButtonClass() { String className = ""; if (message.toLowerCase().contains(Const.ACTION_RESULT_FAILURE.toLowerCase())) { className = "btn-warning"; } else if (message.toLowerCase().contains(Const.ACTION_RESULT_SYSTEM_ERROR_REPORT.toLowerCase())) { className = "btn-danger"; } else { className = "btn-info"; } return className; }