auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void connectionFailure() throws Exception { givenWebSocketConnects(false); webSocketConnection.connect(errorHandler); <START> Thread.sleep(50L); <END> verifyPingerNotStarted(); verifyErrorHandlerWasCalled(); }</code><technical_language>connect method return a Future, allow await in this test, avoids this ugly sleep. for other method a couple of lines</technical_language>

Target:
void connectionFailure() throws Exception { givenWebSocketConnects(false); final boolean connected = webSocketConnection.connect(errorHandler).get(); assertThat(connected, is(false)); verifyPingerNotStarted(); verifyErrorHandlerWasCalled(); }
Source:
<code>public void testConstructProcessWithGivenPid() { SystemInfo si = new SystemInfo(); OperatingSystem os = si.getOperatingSystem(); OSProcess oldProcess = os.getProcess(os.getProcessId()); <START> int givenPid = oldProcess.getProcessID(); <END> OSProcess newProcess = new OSProcess(givenPid); assertEquals(oldProcess.getPath(), newProcess.getPath()); assertEquals(oldProcess.getProcessID(), newProcess.getProcessID()); }</code><technical_language>get major bonus points for writing a testcase! curious store result of getProcessID() in a variable want test it... store os.getProcessId() lines twice? (Or a temp variable os.getProcessId().)</technical_language>

Target:
public void testConstructProcessWithGivenPid() throws InstantiationException { SystemInfo si = new SystemInfo(); OperatingSystem os = si.getOperatingSystem(); int givenPid = os.getProcessId(); OSProcess oldProcess = os.getProcess(givenPid); OSProcess newProcess = new OSProcess(os, givenPid); assertEquals(oldProcess.getPath(), newProcess.getPath()); assertEquals(oldProcess.getProcessID(), newProcess.getProcessID()); assertTrue(newProcess.updateAttributes()); oldProcess.setProcessID(-1); assertFalse(oldProcess.updateAttributes()); try { newProcess = new OSProcess(os, -1); fail("Expected an InstantiationException"); } catch (InstantiationException expected) { assertEquals("A process with ID -1 does not exist.", expected.getMessage()); } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_extrusion_light); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull final MapboxMap map) { mapboxMap = map; map.setStyle(Style.DARK, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { setupBuildings(); <START> setupLight(); <END> } }); } }); }</code><technical_language>pass Style parameter 2 methods</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_extrusion_light); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull final MapboxMap map) { map.setStyle(Style.DARK, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { setupBuildings(style); setupLight(style); } }); } }); }
Source:
<code>private void validateIndexSpecs( SchemaDefinitionContext context ) { indexSpecs= new ArrayList<>(); Database database = context.getDatabase(); for(Table table : database.getDefaultNamespace().getTables()) { Iterator<UniqueKey> keys = table.getUniqueKeyIterator(); while(keys.hasNext()) { IndexSpec indexSpec = new IndexSpec( keys.next() ); validateIndexSpec(indexSpec); <START> indexSpecs.add(indexSpec); <END> } Iterator<Index> indexes = table.getIndexIterator(); while(indexes.hasNext()) { IndexSpec indexSpec = new IndexSpec( indexes.next() ); validateIndexSpec(indexSpec); indexSpecs.add(indexSpec); } } }</code><technical_language>I if add a preProcessing(...) method initialize some variables. I validation method is responsible for initialization of fields</technical_language>

Target:
private void validateIndexSpecs( SchemaDefinitionContext context ) { indexSpecs = new ArrayList<>(); Database database = context.getDatabase(); for ( Table table : database.getDefaultNamespace().getTables() ) { Iterator<UniqueKey> keys = table.getUniqueKeyIterator(); while ( keys.hasNext() ) { IndexSpec indexSpec = new IndexSpec( keys.next() ); if ( validateIndexSpec( indexSpec ) ) { indexSpecs.add( indexSpec ); } } Iterator<Index> indexes = table.getIndexIterator(); while ( indexes.hasNext() ) { IndexSpec indexSpec = new IndexSpec( indexes.next() ); validateIndexSpec( indexSpec ); if ( validateIndexSpec( indexSpec ) ) { indexSpecs.add( indexSpec ); } } } }
Source:
<code>public void dispose() { <START> subscriberRegistrationManager.deinitialize(); <END> super.dispose(); }</code><technical_language>ping</technical_language>

Target:
public void dispose() { deinitializeSubscribers(); super.dispose(); }
Source:
<code>private Account findByUserName(final String userName) throws OrmException { AccountExternalId.Key key = new AccountExternalId.Key(SCHEME_USERNAME, userName); <START> AccountExternalId externalId = schema.get().accountExternalIds().get(key); <END> if (externalId == null) return null; return byId.get(externalId.getAccountId()).getAccount(); }</code><technical_language>avoid database lookup username cache is byId cache: AccountState = byId.getByUsername(userName); return != null ? as.getAccount() : null;</technical_language>

Target:
private Account findByUserName(final String userName) throws OrmException { AccountState as = byId.getByUsername(userName); return as != null ? as.getAccount() : null; }
Source:
<code>public void queryDocuments() { boolean qmEnabled = true; <START> String query = "SELECT sum(c.age) as sum_age, c.city FROM c group by c.city"; <END> QueryRequestOptions options = new QueryRequestOptions(); ModelBridgeInternal.setQueryRequestOptionsMaxItemCount(options, 35); options.setQueryMetricsEnabled(qmEnabled); options.setMaxDegreeOfParallelism(2); CosmosPagedFlux<JsonNode> queryObservable = createdCollection.queryItems(query, options, JsonNode.class); Map<City, Integer> resultMap = personList.stream() .collect(Collectors.groupingBy(Person::getCity, Collectors.summingInt(Person::getAge))); List<Document> expectedDocumentsList = new ArrayList<>(); resultMap.forEach((city, sum) -> { Document d = new Document(); d.set("sum_age", sum); d.set("city", city); expectedDocumentsList.add(d); }); List<FeedResponse<JsonNode>> queryResultPages = queryObservable.byPage().collectList().block(); List<JsonNode> queryResults = new ArrayList<>(); queryResultPages .forEach(feedResponse -> queryResults.addAll(feedResponse.getResults())); assertThat(expectedDocumentsList.size()).isEqualTo(queryResults.size()); for (int i = 0; i < expectedDocumentsList.size(); i++) { assertThat(expectedDocumentsList.get(i).toString().equals(queryResults.get(i).toString())); } }</code><technical_language>a lot of other cases need covered</technical_language>

Target:
public void queryDocuments() { boolean qmEnabled = true; String query = "SELECT sum(c.age) as sum_age, c.city FROM c group by c.city"; CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); ModelBridgeInternal.setQueryRequestOptionsMaxItemCount(options, 35); options.setQueryMetricsEnabled(qmEnabled); options.setMaxDegreeOfParallelism(2); CosmosPagedFlux<JsonNode> queryObservable = createdCollection.queryItems(query, options, JsonNode.class); Map<City, Integer> resultMap = personList.stream() .collect(Collectors.groupingBy(Person::getCity, Collectors.summingInt(Person::getAge))); List<Document> expectedDocumentsList = new ArrayList<>(); resultMap.forEach((city, sum) -> { Document d = new Document(); d.set("sum_age", sum); d.set("city", city); expectedDocumentsList.add(d); }); List<FeedResponse<JsonNode>> queryResultPages = queryObservable.byPage().collectList().block(); List<JsonNode> queryResults = new ArrayList<>(); queryResultPages .forEach(feedResponse -> queryResults.addAll(feedResponse.getResults())); assertThat(expectedDocumentsList.size()).isEqualTo(queryResults.size()); for (int i = 0; i < expectedDocumentsList.size(); i++) { assertThat(expectedDocumentsList.get(i).toString().equals(queryResults.get(i).toString())); } }
Source:
<code>public void testManyFiles() throws Exception { final String table = getUniqueNames(1)[0]; Connector c = getConnector(); NewTableConfiguration ntc = new NewTableConfiguration(); ntc.enableSummarization(SummarizerConfiguration.builder(FamilySummarizer.class).build()); c.tableOperations().create(table, ntc); Random rand = new Random(42); int q = 0; SortedSet<Text> partitionKeys = new TreeSet<>(); <START> for (int split = 100000; split < 1000000; split += 100000) { <END> partitionKeys.add(new Text(String.format("%06d", split))); } c.tableOperations().addSplits(table, partitionKeys); Map<String,Long> famCounts = new HashMap<>(); for (int t = 0; t < 20; t++) { try (BatchWriter bw = c.createBatchWriter(table, new BatchWriterConfig())) { for (int i = 0; i < 10000; i++) { String row = String.format("%06d", rand.nextInt(1000000)); String fam = String.format("%03d", rand.nextInt(100)); String qual = String.format("%06d", q++); write(bw, row, fam, qual, "val"); famCounts.merge(fam, 1L, Long::sum); } } List<Summary> summaries = c.tableOperations().getSummaries(table).flush(true).retrieve(); Assert.assertEquals(1, summaries.size()); CounterSummary cs = new CounterSummary(summaries.get(0)); Assert.assertEquals(famCounts, cs.getCounters()); FileStatistics fileStats = summaries.get(0).getFileStatistics(); Assert.assertEquals(0, fileStats.getInaccurate()); Assert.assertTrue("Saw " + fileStats.getTotal() + " files expected >=10", fileStats.getTotal() >= 10); } }</code><technical_language>nit: 100_000 1_000_000 for readability</technical_language>

Target:
public void testManyFiles() throws Exception { final String table = getUniqueNames(1)[0]; Connector c = getConnector(); NewTableConfiguration ntc = new NewTableConfiguration(); ntc.enableSummarization(SummarizerConfiguration.builder(FamilySummarizer.class).build()); c.tableOperations().create(table, ntc); Random rand = new Random(42); int q = 0; SortedSet<Text> partitionKeys = new TreeSet<>(); for (int split = 100_000; split < 1_000_000; split += 100_000) { partitionKeys.add(new Text(String.format("%06d", split))); } c.tableOperations().addSplits(table, partitionKeys); Map<String,Long> famCounts = new HashMap<>(); for (int t = 0; t < 20; t++) { try (BatchWriter bw = c.createBatchWriter(table, new BatchWriterConfig())) { for (int i = 0; i < 10000; i++) { String row = String.format("%06d", rand.nextInt(1_000_000)); String fam = String.format("%03d", rand.nextInt(100)); String qual = String.format("%06d", q++); write(bw, row, fam, qual, "val"); famCounts.merge(fam, 1L, Long::sum); } } List<Summary> summaries = c.tableOperations().summarize(table).flush(true).retrieve(); Assert.assertEquals(1, summaries.size()); CounterSummary cs = new CounterSummary(summaries.get(0)); Assert.assertEquals(famCounts, cs.getCounters()); FileStatistics fileStats = summaries.get(0).getFileStatistics(); Assert.assertEquals(0, fileStats.getInaccurate()); Assert.assertTrue("Saw " + fileStats.getTotal() + " files expected >=10", fileStats.getTotal() >= 10); } }
Source:
<code>public String toString() { ToStringHelper stringHelper = toStringHelper(this) .add("tableId", tableId) .add("shardId", shardId) .add("shardUuid", shardUuid) <START> .add("isDelta", isDelta) <END> .add("rowCount", rowCount) .add("compressedSize", DataSize.succinctBytes(compressedSize)) .add("uncompressedSize", DataSize.succinctBytes(uncompressedSize)); if (deltaUuid.isPresent()) { stringHelper.add("deltaUuid", deltaUuid.get()); } if (bucketNumber.isPresent()) { stringHelper.add("bucketNumber", bucketNumber.getAsInt()); } if (xxhash64.isPresent()) { stringHelper.add("xxhash64", format("%16x", xxhash64.getAsLong())); } if (rangeStart.isPresent()) { stringHelper.add("rangeStart", rangeStart.getAsLong()); } if (rangeEnd.isPresent()) { stringHelper.add("rangeEnd", rangeEnd.getAsLong()); } return stringHelper.toString(); }</code><technical_language>missed deltaUuid</technical_language>

Target:
public String toString() { ToStringHelper stringHelper = toStringHelper(this) .add("tableId", tableId) .add("shardId", shardId) .add("shardUuid", shardUuid) .add("isDelta", isDelta) .add("rowCount", rowCount) .add("compressedSize", DataSize.succinctBytes(compressedSize)) .add("uncompressedSize", DataSize.succinctBytes(uncompressedSize)); deltaUuid.ifPresent(uuid -> stringHelper.add("deltaUuid", uuid)); if (bucketNumber.isPresent()) { stringHelper.add("bucketNumber", bucketNumber.getAsInt()); } if (xxhash64.isPresent()) { stringHelper.add("xxhash64", format("%16x", xxhash64.getAsLong())); } if (rangeStart.isPresent()) { stringHelper.add("rangeStart", rangeStart.getAsLong()); } if (rangeEnd.isPresent()) { stringHelper.add("rangeEnd", rangeEnd.getAsLong()); } return stringHelper.toString(); }
Source:
<code>NullableRowBasedKeySerdeHelper(RowBasedKeySerdeHelper delegate, int keyBufferPosition) { this.delegate = delegate; this.keyBufferPosition = keyBufferPosition; BufferComparator delegateBufferComparator = this.delegate.getBufferComparator(); this.comparator = (lhsBuffer, rhsBuffer, lhsPosition, rhsPosition) -> { boolean isLhsNull = (lhsBuffer.get(lhsPosition + keyBufferPosition) == NullHandling.IS_NULL_BYTE); <START> boolean isrhsNull = (rhsBuffer.get(rhsPosition + keyBufferPosition) == NullHandling.IS_NULL_BYTE); <END> if (isLhsNull && isrhsNull) { return 0; } if (isLhsNull) { return -1; } if (isrhsNull) { return 1; } return delegateBufferComparator.compare( lhsBuffer, rhsBuffer, lhsPosition, rhsPosition ); }; }</code><technical_language>is**R**hsNull</technical_language>

Target:
NullableRowBasedKeySerdeHelper(RowBasedKeySerdeHelper delegate, int keyBufferPosition) { this.delegate = delegate; this.keyBufferPosition = keyBufferPosition; BufferComparator delegateBufferComparator = this.delegate.getBufferComparator(); this.comparator = (lhsBuffer, rhsBuffer, lhsPosition, rhsPosition) -> { boolean isLhsNull = (lhsBuffer.get(lhsPosition + keyBufferPosition) == NullHandling.IS_NULL_BYTE); boolean isRhsNull = (rhsBuffer.get(rhsPosition + keyBufferPosition) == NullHandling.IS_NULL_BYTE); if (isLhsNull && isRhsNull) { return 0; } if (isLhsNull) { return -1; } if (isRhsNull) { return 1; } return delegateBufferComparator.compare( lhsBuffer, rhsBuffer, lhsPosition, rhsPosition ); }; }
Source:
<code>protected Collection<String> getInAppFrames(Dsn dsn) { String inAppFramesOption = Lookup.lookup(IN_APP_FRAMES_OPTION, dsn); if (Util.isNullOrEmpty(inAppFramesOption)) { logger.warn("No '" + IN_APP_FRAMES_OPTION + "' was configured, this option is highly recommended " + "as it affects stacktrace grouping and display on Sentry. See documentation: " + "<LINK_0>"); return Collections.emptyList(); } List<String> inAppPackages = new ArrayList<>(); for (String inAppPackage : inAppFramesOption.split(",")) { if (!inAppPackage.trim().equals("")) { inAppPackages.add(inAppPackage); } } for (String inAppPackage : inAppPackages) { FrameCache.addAppPackage(inAppPackage); <START> } <END> return inAppPackages; }</code><technical_language>This implicit behavior updating global state a weird I put a lot of thought - expect issues in practice smell a weird. I right do wrong place do</technical_language>

Target:
protected Collection<String> getInAppFrames(Dsn dsn) { String inAppFramesOption = Lookup.lookup(IN_APP_FRAMES_OPTION, dsn); if (Util.isNullOrEmpty(inAppFramesOption)) { logger.warn("No '" + IN_APP_FRAMES_OPTION + "' was configured, this option is highly recommended " + "as it affects stacktrace grouping and display on Sentry. See documentation: " + "<LINK_0>"); return Collections.emptyList(); } List<String> inAppPackages = new ArrayList<>(); for (String inAppPackage : inAppFramesOption.split(",")) { if (!inAppPackage.trim().equals("")) { inAppPackages.add(inAppPackage); } } return inAppPackages; }
Source:
<code>private void refreshOnUpdate(String path) { try { Map<String, Map<String, Long>> storageUsage = fetchContainerStorageUsageFromPath(path); <START> System.out.println("Getting this from update: " + storageUsage); <END> containerStorageUsageRef.set(storageUsage); if (callback.get() != null) { callback.get().onNewContainerStorageUsage(Collections.unmodifiableMap(storageUsage)); } } catch (Exception e) { logger.error("Failed to refresh storage usage on update of path = {}", path, e); containerStorageUsageRef.compareAndSet(null, Collections.EMPTY_MAP); } }</code><technical_language>Remove this</technical_language>

Target:
private void refreshOnUpdate(String path) { try { Map<String, Map<String, Long>> storageUsage = fetchContainerStorageUsageFromPath(path); containerStorageUsageRef.set(storageUsage); if (callback.get() != null) { callback.get().onNewContainerStorageUsage(Collections.unmodifiableMap(storageUsage)); } } catch (Exception e) { logger.error("Failed to refresh storage usage on update of path = {}", path, e); containerStorageUsageRef.compareAndSet(null, Collections.EMPTY_MAP); } }
Source:
<code>public void testListDeployments() { List<Deployment> deployments = api().list(); <START> assertTrue(deployments.size() > 0); <END> }</code><technical_language>Verify created deployment exists</technical_language>

Target:
public void testListDeployments() { List<Deployment> deployments = api().list(); assertTrue(deployments.size() > 0); boolean deploymentFound = false; for (Deployment d : deployments) { if (d.name().equals(deploymentName)) { deploymentFound = true; break; } } assertTrue(deploymentFound); }
Source:
<code>public void setUp() throws Exception { File genomeFile = new File(this.getClass() <START> .getResource(testGenomeFilename + ".gff").toURI()); <END> genomes = GeneAnnotationParser.parseGeneAnnotations(genomeFile); }</code><technical_language>add extension directly</technical_language>

Target:
public void setUp() throws Exception { File genomesFile = new File(this.getClass() .getResource(testGenomesFilename).toURI()); File genomeFile = new File(this.getClass() .getResource(testGenomeFilename).toURI()); genomes = GeneAnnotationParser.parseGeneAnnotations(genomesFile); genome = GeneAnnotationParser.parseGeneAnnotations(genomeFile); }
Source:
<code>public boolean matchesSafely(PostDonationCounselling actual) { return Objects.equals(actual.getId(), expected.getId()) && actual.isFlaggedForCounselling() == expected.isFlaggedForCounselling() && actual.isIsDeleted() == expected.isIsDeleted() && Objects.equals(actual.getCreatedBy(), expected.getCreatedBy()) && actual.getCreatedDate() == expected.getCreatedDate() && Objects.equals(actual.getLastUpdatedBy(), expected.getLastUpdatedBy()) && <START> actual.getLastUpdated() == expected.getLastUpdated() && <END> Objects.equals(actual.getDonation(), expected.getDonation()) && Objects.equals(actual.getCounsellingDate(), expected.getCounsellingDate()) && Objects.equals(actual.getCounsellingStatus(), expected.getCounsellingStatus()); }</code><technical_language>checking reference equality for objects. Please Objects.equals instead</technical_language>

Target:
public boolean matchesSafely(PostDonationCounselling actual) { return Objects.equals(actual.getId(), expected.getId()) && Objects.equals(actual.isFlaggedForCounselling(), expected.isFlaggedForCounselling()) && Objects.equals(actual.isIsDeleted(), expected.isIsDeleted()) && Objects.equals(actual.getCreatedBy(), expected.getCreatedBy()) && Objects.equals(actual.getCreatedDate(), expected.getCreatedDate()) && Objects.equals(actual.getLastUpdatedBy(), expected.getLastUpdatedBy()) && Objects.equals(actual.getLastUpdated(), expected.getLastUpdated()) && Objects.equals(actual.getDonation(), expected.getDonation()) && Objects.equals(actual.getCounsellingDate(), expected.getCounsellingDate()) && Objects.equals(actual.getCounsellingStatus(), expected.getCounsellingStatus()); }
Source:
<code>public void test(Container container, PackingPlan.InstancePlan instancePlan) throws ResourceExceededException { Resource usedResource = container.getTotalUsedResources(); Resource newUsedResource = usedResource.plus(instancePlan.getResource()); Resource capacity = container.getCapacity(); <START> if (Double.compare(capacity.getCpu(), newUsedResource.getCpu()) < 0) { <END> throw new ResourceExceededException(String.format("Adding instance %s with %.3f cores " + "to container %d with existing %.3f cores " + "would exceed its capacity of %.3f cores", instancePlan.getComponentName(), instancePlan.getResource().getCpu(), container.getContainerId(), usedResource.getCpu(), capacity.getCpu())); } if (capacity.getRam().lessThan(newUsedResource.getRam())) { throw new ResourceExceededException(String.format("Adding instance %s with %s RAM " + "to container %d with existing %s RAM " + "would exceed its capacity of %s RAM", instancePlan.getComponentName(), instancePlan.getResource().getRam().toString(), container.getContainerId(), usedResource.getRam().toString(), capacity.getRam().toString())); } if (capacity.getDisk().lessThan(newUsedResource.getDisk())) { throw new ResourceExceededException(String.format("Adding instance %s with %s disk " + "to container %d with existing %s disk " + "would exceed its capacity of %s disk", instancePlan.getComponentName(), instancePlan.getResource().getDisk().toString(), container.getContainerId(), usedResource.getDisk().toString(), capacity.getDisk().toString())); } }</code><technical_language>lessThan instead of compare() < 0</technical_language>

Target:
public void test(Container container, PackingPlan.InstancePlan instancePlan) throws ResourceExceededException { Resource usedResource = container.getTotalUsedResources(); Resource newUsedResource = usedResource.plus(instancePlan.getResource()); Resource capacity = container.getCapacity(); if (capacity.getCpu() < newUsedResource.getCpu()) { throw new ResourceExceededException(String.format("Adding instance %s with %.3f cores " + "to container %d with existing %.3f cores " + "would exceed its capacity of %.3f cores", instancePlan.getComponentName(), instancePlan.getResource().getCpu(), container.getContainerId(), usedResource.getCpu(), capacity.getCpu())); } if (capacity.getRam().lessThan(newUsedResource.getRam())) { throw new ResourceExceededException(String.format("Adding instance %s with %s RAM " + "to container %d with existing %s RAM " + "would exceed its capacity of %s RAM", instancePlan.getComponentName(), instancePlan.getResource().getRam().toString(), container.getContainerId(), usedResource.getRam().toString(), capacity.getRam().toString())); } if (capacity.getDisk().lessThan(newUsedResource.getDisk())) { throw new ResourceExceededException(String.format("Adding instance %s with %s disk " + "to container %d with existing %s disk " + "would exceed its capacity of %s disk", instancePlan.getComponentName(), instancePlan.getResource().getDisk().toString(), container.getContainerId(), usedResource.getDisk().toString(), capacity.getDisk().toString())); } }
Source:
<code>public void updateStorageUsage(short partitionId, short accountId, short containerId, long storageUsage) { try { long startTimeMs = System.currentTimeMillis(); PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql, true); insertStatement.setString(1, clustername); insertStatement.setString(2, hostname); insertStatement.setInt(3, partitionId); insertStatement.setInt(4, accountId); insertStatement.setInt(5, containerId); insertStatement.setLong(6, storageUsage); insertStatement.executeUpdate(); dataAccessor.onSuccess(Write, System.currentTimeMillis() - startTimeMs); } catch (SQLException e) { <START> dataAccessor.onException(e, Write); <END> logger.error(String.format("Failed to execute updated on %s, with parameter %d %d %d %d", ACCOUNT_REPORTS_TABLE, partitionId, accountId, containerId, storageUsage), e); } }</code><technical_language>suspicious method is eating exception called a function. raises question: if mysql instance is report run - report complete successfully sql update failed logged error</technical_language>

Target:
public void updateStorageUsage(short partitionId, short accountId, short containerId, long storageUsage) throws SQLException { try { long startTimeMs = System.currentTimeMillis(); PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql, true); insertStatement.setString(1, clusterName); insertStatement.setString(2, hostname); insertStatement.setInt(3, partitionId); insertStatement.setInt(4, accountId); insertStatement.setInt(5, containerId); insertStatement.setLong(6, storageUsage); insertStatement.executeUpdate(); dataAccessor.onSuccess(Write, System.currentTimeMillis() - startTimeMs); } catch (SQLException e) { dataAccessor.onException(e, Write); logger.error(String.format("Failed to execute updated on %s, with parameter %d %d %d %d", ACCOUNT_REPORTS_TABLE, partitionId, accountId, containerId, storageUsage), e); throw e; } }
Source:
<code>protected void executeCommand() { <START> getSnapshotsNames(); <END> if (isLiveMerge()) { getParameters().setLiveMerge(true); persistCommand(getParameters().getParentCommand(), true); } removeCinderSnapshotDisks(); setSucceeded(true); }</code><technical_language>Is mandatory? names cached calling 'addAuditLogCustomValues', is invoked CommandBase's execute flow (execute -> logCommand)</technical_language>

Target:
protected void executeCommand() { if (isLiveMerge()) { getParameters().setLiveMerge(true); persistCommand(getParameters().getParentCommand(), true); } removeCinderSnapshotDisks(); setSucceeded(true); }
Source:
<code>public void testAlterTableOnGlobalIndex() throws Exception { try (Connection conn = DriverManager.getConnection(getUrl())) { conn.setAutoCommit(false); Statement stmt = conn.createStatement(); String tableName = generateUniqueName(); String globalIndexTableName = generateUniqueName(); stmt.execute("CREATE TABLE " + tableName + "(k VARCHAR PRIMARY KEY, v1 VARCHAR, v2 VARCHAR)"); <START> stmt.execute("DROP TABLE " + tableName); <END> Admin admin = conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin(); admin.disableTable(TableName.valueOf(tableName)); admin.deleteTable(TableName.valueOf(tableName)); conn.createStatement().execute("CREATE TABLE " + tableName + " (ID INTEGER PRIMARY KEY, COL1 VARCHAR(10), COL2 BOOLEAN)"); conn.createStatement().execute("CREATE INDEX " + globalIndexTableName + " on " + tableName + " (COL2)"); TableDescriptor originalDesc = admin.getDescriptor(TableName.valueOf(globalIndexTableName)); int expectedErrorCode = 0; try { conn.createStatement().execute("ALTER TABLE " + globalIndexTableName + " ADD CF1.AGE INTEGER "); conn.commit(); } catch (SQLException e) { expectedErrorCode = e.getErrorCode(); } assertEquals(expectedErrorCode, CANNOT_MUTATE_TABLE.getErrorCode()); TableDescriptor finalDesc = admin.getDescriptor(TableName.valueOf(globalIndexTableName)); assertTrue(finalDesc.equals(originalDesc)); } }</code><technical_language>do need execute create drop table statements</technical_language>

Target:
public void testAlterTableOnGlobalIndex() throws Exception { try (Connection conn = DriverManager.getConnection(getUrl()); Statement stmt = conn.createStatement()) { conn.setAutoCommit(false); Admin admin = conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin(); String tableName = generateUniqueName(); String globalIndexTableName = generateUniqueName(); stmt.execute("CREATE TABLE " + tableName + " (ID INTEGER PRIMARY KEY, COL1 VARCHAR(10), COL2 BOOLEAN)"); stmt.execute("CREATE INDEX " + globalIndexTableName + " on " + tableName + " (COL2)"); TableDescriptor originalDesc = admin.getDescriptor(TableName.valueOf(globalIndexTableName)); int expectedErrorCode = 0; try { stmt.execute("ALTER TABLE " + globalIndexTableName + " ADD CF1.AGE INTEGER "); conn.commit(); fail("The alter table did not fail as expected"); } catch (SQLException e) { assertEquals(e.getErrorCode(), CANNOT_MUTATE_TABLE.getErrorCode()); } TableDescriptor finalDesc = admin.getDescriptor(TableName.valueOf(globalIndexTableName)); assertTrue(finalDesc.equals(originalDesc)); stmt.execute("DROP TABLE " + tableName); } }
Source:
<code>public CouponModel(CouponDto couponDto) { this.shared = couponDto.isShared(); this.amount = AmountConverter.convertStringToCent(couponDto.getAmount()); this.startTime = couponDto.getStartTime() != null ? new DateTime(couponDto.getStartTime()).withTimeAtStartOfDay().toDate() : null; this.endTime = couponDto.getEndTime() != null ? new DateTime(couponDto.getEndTime()).withTimeAtStartOfDay().plusDays(1).minusSeconds(1).toDate() : null; this.deadline = couponDto.getDeadline() != null ? couponDto.getDeadline() : 0; this.totalCount = couponDto.getTotalCount() != null ? couponDto.getTotalCount() : 0; this.productTypes = couponDto.getProductTypes(); this.couponType = couponDto.getCouponType(); this.investLowerLimit = AmountConverter.convertStringToCent(couponDto.getInvestLowerLimit()); this.smsAlert = couponDto.isSmsAlert(); this.userGroup = couponDto.getUserGroup(); this.rate = couponDto.getRate() == null ? 0 : new BigDecimal(couponDto.getRate()).divide(new BigDecimal(100), 3, BigDecimal.ROUND_HALF_UP).doubleValue(); this.birthdayBenefit = couponDto.getBirthdayBenefit() == null ? 0 : new BigDecimal(couponDto.getBirthdayBenefit()).subtract(new BigDecimal(1)).doubleValue(); this.agents = couponDto.getAgents(); this.channels = couponDto.getChannels(); <START> this.multiple = (couponDto.getCouponType() == CouponType.BIRTHDAY_COUPON || <END> couponDto.getUserGroup() == UserGroup.FIRST_INVEST_ACHIEVEMENT || couponDto.getUserGroup() == UserGroup.MAX_AMOUNT_ACHIEVEMENT || couponDto.getUserGroup() == UserGroup.LAST_INVEST_ACHIEVEMENT || couponDto.getMultiple()); }</code><technical_language>List.contains</technical_language>

Target:
public CouponModel(CouponDto couponDto){ this.shared = couponDto.isShared(); this.amount = AmountConverter.convertStringToCent(couponDto.getAmount()); this.startTime = couponDto.getStartTime() != null ? new DateTime(couponDto.getStartTime()).withTimeAtStartOfDay().toDate() : null; this.endTime = couponDto.getEndTime() != null ? new DateTime(couponDto.getEndTime()).withTimeAtStartOfDay().plusDays(1).minusSeconds(1).toDate() : null; this.deadline = couponDto.getDeadline() != null ? couponDto.getDeadline() : 0; this.totalCount = couponDto.getTotalCount() != null ? couponDto.getTotalCount() : 0; this.productTypes = couponDto.getProductTypes() ; this.couponType = couponDto.getCouponType(); this.investLowerLimit = AmountConverter.convertStringToCent(couponDto.getInvestLowerLimit()); this.smsAlert = couponDto.isSmsAlert(); this.userGroup = couponDto.getUserGroup(); this.rate = couponDto.getRate() == null ? 0 : new BigDecimal(couponDto.getRate()).divide(new BigDecimal(100), 3, BigDecimal.ROUND_HALF_UP).doubleValue(); this.birthdayBenefit = couponDto.getBirthdayBenefit() == null ? 0 : new BigDecimal(couponDto.getBirthdayBenefit()).subtract(new BigDecimal(1)).doubleValue(); this.agents = couponDto.getAgents(); this.channels = couponDto.getChannels(); this.multiple = Lists.newArrayList(CouponType.BIRTHDAY_COUPON,UserGroup.FIRST_INVEST_ACHIEVEMENT,UserGroup.MAX_AMOUNT_ACHIEVEMENT,UserGroup.LAST_INVEST_ACHIEVEMENT).contains(couponDto.getUserGroup()); }
Source:
<code>protected void executeQueryCommand() { Map<Guid, List<GraphicsDevice>> result = new HashMap<>(); <START> mapDevices(result, VmDeviceType.SPICE); mapDevices(result, VmDeviceType.VNC); <END> setReturnValue(result); }</code><technical_language>created stored procedure for case adjust query a list of device types instead of firing query times</technical_language>

Target:
protected void executeQueryCommand() { Map<Guid, List<GraphicsDevice>> result = new HashMap<>(); List<VmDevice> devicesList = getDbFacade().getVmDeviceDao().getVmGraphicsDevices( getUserID(), getParameters().isFiltered()); for (VmDevice device : devicesList) { result.computeIfAbsent(device.getVmId(), guid -> new ArrayList<>()).add(new GraphicsDevice(device)); } setReturnValue(result); }
Source:
<code>public Object execute(final ExecutionEvent event) throws ExecutionException { IResource[] selected = getSelectedResources(); if (selected.length != 1 || !(selected[0] instanceof IStorage)) return null; Repository repository = getRepository(); if (repository == null) return null; <START> RepositoryMapping mapping = RepositoryMapping.getMapping(selected[0] <END> .getProject()); if (mapping == null) return null; String path = mapping.getRepoRelativePath(selected[0]); IStorage storage = (IStorage) selected[0]; Shell shell = HandlerUtil.getActiveShell(event); IWorkbenchPage page = HandlerUtil.getActiveSite(event).getPage(); JobUtil.scheduleUserJob(new BlameOperation(repository, storage, path, null, shell, page), UIText.ShowBlameHandler_JobName, null); return null; }</code><technical_language>If selected resource is non-workspace, get path element getProject() method, finally getMapping return null. change I929c3c32e getMapping for non-workspace files return proper RepositoryMapping</technical_language>

Target:
public Object execute(final ExecutionEvent event) throws ExecutionException { IResource[] selected = getSelectedResources(); if (selected.length != 1 || !(selected[0] instanceof IStorage)) return null; Repository repository = getRepository(); if (repository == null) return null; RepositoryMapping mapping = RepositoryMapping.getMapping(selected[0] .getProject()); if (mapping == null) return null; String path = mapping.getRepoRelativePath(selected[0]); IStorage storage = (IStorage) selected[0]; Shell shell = HandlerUtil.getActiveShell(event); IWorkbenchPage page = HandlerUtil.getActiveSite(event).getPage(); JobUtil.scheduleUserJob(new BlameOperation(repository, storage, path, null, shell, page), UIText.ShowBlameHandler_JobName, JobFamilies.BLAME); return null; }
Source:
<code>public int hashCode() { <START> int result = 17; <END> result = 31 * result + id.hashCode(); result = 31 * result + Long.hashCode(period); result = 31 * result + this.periodTimeUnit.hashCode(); result = 31 * result + Long.hashCode(initialDelay); return result; }</code><technical_language>hash()</technical_language>

Target:
public int hashCode() { return Objects.hash(id, period, periodTimeUnit, initialDelay); }
Source:
<code>public Object doWork() { Utils.regularReadableUserFile(vcfList); try ( FalsePositiveTableWriter writer = new FalsePositiveTableWriter(output) ) { List<String> vcfFilePaths = Files.readAllLines(Paths.get(vcfList.toString())); List<File> vcfFiles = vcfFilePaths.stream().map(File::new).collect(Collectors.toList()); <START> writer.writeAllRecords(vcfFiles); <END> } catch (IOException e){ throw new UserException(String.format("Encountered an IO exception while reading (or reading a file in) %s or %s", vcfList.toString(), output)); } return "SUCCESS"; }</code><technical_language>I preferable logic out of TableWriter, calculate false positives composeLine. This require creating another nested class called FalsePositiveRecord is basically a struct of filename snp indel counts, worth it</technical_language>

Target:
public Object doWork() { Utils.regularReadableUserFile(vcfList); try ( FalsePositiveTableWriter writer = new FalsePositiveTableWriter(output) ) { List<String> vcfFilePaths = Files.readAllLines(Paths.get(vcfList.toString())); List<FalsePositiveRecord> falsePositiveRecords = vcfFilePaths.stream().map(str -> new FalsePositiveRecord(new File(str))).collect(Collectors.toList()); writer.writeAllRecords(falsePositiveRecords); } catch (IOException e){ throw new UserException(String.format("Encountered an IO exception while reading %s, %s, or files listed in them", vcfList.toString(), output)); } return "SUCCESS"; }
Source:
<code>public Optional<String> getCommitTemplatePath() { <START> return Optional.ofNullable(commitTemplatePath); <END> }</code><technical_language>benefit of Optional instead of returning null? In a caller's life easier? I suspect instead of simply checking for null a caller end Optional.isPresent checks (maybe hidden in ifPresent a lambda thrown in for additional complexity)</technical_language>

Target:
public String getCommitTemplatePath() { return commitTemplatePath; }
Source:
<code>public void testReadUnsignedShort() throws Exception { <START> inMockedDis.readShort(); <END> verify(mockedDis).readShort(); }</code><technical_language>test method name suggest, leave readUnsignedShort call here</technical_language>

Target:
public void testReadUnsignedShort() throws Exception { inMockedDis.readUnsignedShort(); verify(mockedDis).readShort(); }
Source:
<code>private void run(Simulation simulation, String user) { <START> Supplier<String> otherUser = () -> fileSystems.getNextUser(user); <END> Supplier<Path> randomFilePathForUser = () -> index.getRandomExistingFile(user); switch (simulation) { case READ: read(user, randomFilePathForUser.get()); break; case WRITE: write(user); break; case MKDIR: mkdir(user); break; case RM: rm(user); break; case RMDIR: rmdir(user); break; case GRANT: grantRead(user, otherUser.get(), randomFilePathForUser.get()); break; case REVOKE: revokeRead(user, otherUser.get(), fileSystems.getReferenceFileSystem(user).getRandomSharedPath(random, FileSystem.Permission.READ)); break; default: throw new IllegalStateException("Unexpected simulation " + simulation); } simulationRecord.add(simulation); }</code><technical_language>I imagine super useful a single line log op : user [path]</technical_language>

Target:
private void run(Simulation simulation, String user) { Supplier<String> otherUser = () -> fileSystems.getNextUser(user); Supplier<Path> randomFilePathForUser = () -> index.getRandomExistingFile(user); Supplier<Path> randomFolderPathForUser = () -> index.getRandomExistingDirectory(user, true); switch (simulation) { case READ: read(user, randomFilePathForUser.get()); break; case WRITE: write(user); break; case MKDIR: mkdir(user); break; case RM: rm(user); break; case RMDIR: rmdir(user); break; case GRANT_READ_FILE: case GRANT_WRITE_FILE: Path grantFilePath = randomFilePathForUser.get(); String fileGrantee = otherUser.get(); log(user, simulation, grantFilePath, " with grantee "+ fileGrantee); grantPermission(user, fileGrantee, grantFilePath, simulation.permission()); break; case GRANT_READ_DIR: case GRANT_WRITE_DIR: String dirGrantee = otherUser.get(); Path grantDirPath = randomFolderPathForUser.get(); log(user, simulation, grantDirPath, " with grantee "+ dirGrantee); grantPermission(user, dirGrantee, grantDirPath, simulation.permission()); break; case REVOKE_READ: case REVOKE_WRITE: String revokee = otherUser.get(); Path revokePath = fileSystems.getReferenceFileSystem(user).getRandomSharedPath(random, simulation.permission()); log(user, simulation, revokePath, " with revokee "+ revokee); revokePermission(user, revokee, revokePath, simulation.permission()); break; default: throw new IllegalStateException("Unexpected simulation " + simulation); } simulationRecord.add(simulation); }
Source:
<code><START> public void onPostReceive(ReceivePack rp, Collection<ReceiveCommand> commands) { <END> for (PostReceiveHook hook : hooks) { hook.onPostReceive(rp, commands); } }</code><technical_language>line-wrap? this pretty long</technical_language>

Target:
public void onPostReceive(ReceivePack rp, Collection<ReceiveCommand> commands) { for (int i = 0; i < count; i++) hooks[i].onPostReceive(rp, commands); }
Source:
<code>public void close() throws IOException { for (Thread thread : threads) { <START> if (thread != Thread.currentThread()) { <END> thread.interrupt(); } } delegate.close(); }</code><technical_language>Qu: is worth creating a variable for this currentThread() is native</technical_language>

Target:
public void close() throws IOException { closeResources(); delegate.close(); }
Source:
<code>public String apply(AccountResource rsrc) throws AuthException, ResourceNotFoundException, OrmException { if (self.get() != rsrc.getUser() && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to get http password"); } <START> AccountExternalId id = <END> dbProvider.get().accountExternalIds().get( new AccountExternalId.Key(SCHEME_USERNAME, rsrc.getUser().getUserName())); if (id == null) { throw new ResourceNotFoundException(); } return Strings.nullToEmpty(id.getPassword()); }</code><technical_language>cache for a read: AccountState s = rsrc.getUser().state(); if (s.getUserName() == null) { throw new ResourceNotFoundException(); } String p = s.getPassword(s.getUserName()); if (p == null) { throw new ResourceNotFoundException(); }</technical_language>

Target:
public String apply(AccountResource rsrc) throws AuthException, ResourceNotFoundException, OrmException { if (self.get() != rsrc.getUser() && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to get http password"); } AccountState s = rsrc.getUser().state(); if (s.getUserName() == null) { throw new ResourceNotFoundException(); } String p = s.getPassword(s.getUserName()); if (p == null) { throw new ResourceNotFoundException(); } return p; }
Source:
<code>public void contextDisposed() { <START> super.contextDisposed(); <END> eventBroker.unsubscribe(itemUpdater); eventBroker.unsubscribe(selectionUpdater); eventBroker.unsubscribe(enabledUpdater); eventBroker.unsubscribe(toBeRenderedUpdater); eventBroker.unsubscribe(childAdditionUpdater); }</code><technical_language>end of method</technical_language>

Target:
public void contextDisposed() { eventBroker.unsubscribe(itemUpdater); eventBroker.unsubscribe(selectionUpdater); eventBroker.unsubscribe(enabledUpdater); eventBroker.unsubscribe(toBeRenderedUpdater); eventBroker.unsubscribe(childAdditionUpdater); super.contextDisposed(); }
Source:
<code>public void setup() { <START> storageEraser = spy(new StorageEraser(storagePathProvider)); <END> storageMigrator = spy(new StorageMigrator(storagePathProvider, storageStateProvider, storageEraser)); doNothing().when(storageMigrator).reopenDatabases(); doNothing().when(storageEraser).clearOdkDirOnScopedStorage(); doNothing().when(storageEraser).deleteOdkDirFromUnscopedStorage(); }</code><technical_language>nice for this a mock/fake a spy</technical_language>

Target:
public void setup() { storageMigrator = spy(new StorageMigrator(storagePathProvider, storageStateProvider, storageEraser, storageMigrationRepository, generalSharedPreferences, referenceManager)); doNothing().when(storageMigrator).reopenDatabases(); doNothing().when(storageEraser).clearOdkDirOnScopedStorage(); doNothing().when(storageEraser).deleteOdkDirFromUnscopedStorage(); doReturn("/sdcard/odk/layers/countries/countries-raster.mbtiles").when(generalSharedPreferences).get(KEY_REFERENCE_LAYER); }
Source:
<code>public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { if (command.hasAnyFlag(FlagBitSets.CACHE_MODE_LOCAL | FlagBitSets.SKIP_REMOTE_LOOKUP)) { return invokeNext(ctx, command); } if (!ctx.isOriginLocal()) { for (Object key : command.getKeys()) { if (ctx.lookupEntry(key) == null) { return UnsureResponse.INSTANCE; } } return invokeNext(ctx, command); } <START> GetAllSuccessHandler getAllSuccessHandler = new GetAllSuccessHandler(command); <END> CompletableFuture<Void> allFuture = remoteGetAll(ctx, command, command.getKeys(), getAllSuccessHandler); if (allFuture == null) { return invokeNext(ctx, command); } return asyncValue(allFuture).thenApply(ctx, command, getAllSuccessHandler); }</code><technical_language>this changes related xsite</technical_language>

Target:
public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { if (command.hasAnyFlag(FlagBitSets.CACHE_MODE_LOCAL | FlagBitSets.SKIP_REMOTE_LOOKUP)) { return invokeNext(ctx, command); } if (!ctx.isOriginLocal()) { for (Object key : command.getKeys()) { if (ctx.lookupEntry(key) == null) { return UnsureResponse.INSTANCE; } } return invokeNext(ctx, command); } GetAllSuccessHandler getAllSuccessHandler = new GetAllSuccessHandler(command); CompletableFuture<Void> allFuture = remoteGetAll(ctx, command, command.getKeys(), getAllSuccessHandler); return asyncValue(allFuture).thenApply(ctx, command, getAllSuccessHandler); }
Source:
<code>default @Nonnull Map<Long, ILogData> peekAll(RuntimeLayout runtimeLayout, Set<Long> globalAddresses) { return globalAddresses.parallelStream() <START> .map(a -> new SimpleImmutableEntry<>(a, peek(runtimeLayout, a))) <END> .collect(Collectors.toMap(SimpleImmutableEntry::getKey, SimpleImmutableEntry::getValue)); }</code><technical_language>seems, need map method</technical_language>

Target:
default @Nonnull Map<Long, ILogData> peekAll(RuntimeLayout runtimeLayout, Set<Long> globalAddresses) { return globalAddresses .parallelStream() .collect(Collectors.toMap(Function.identity(), a -> peek(runtimeLayout, a))); }
Source:
<code>protected void testAccessControl_instructorSubmitStudentResponse_accessible() { <START> ______TS("Student intends to access own response, but logged in as instructor, should be accessible"); <END> loginAsInstructor(instructor1OfCourse1.getGoogleId()); assertEquals(student1InCourse1.getEmail(), student1ResponseToStudent1.getGiver()); FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student1ResponseToStudent1.getRecipient()); String[] studentAccessOwnPersonParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), }; verifyCanAccess(updateRequest, studentAccessOwnPersonParams); }</code><technical_language>A bit of a renaming, this effectively a permission issue suggestion ______TS("Instructor attempts edit student's response permission, accessible");</technical_language>

Target:
protected void testAccessControl_instructorSubmitStudentResponse_accessible() { ______TS("Instructor attempts to edit student's response with appropriate permission, should be accessible"); loginAsInstructor(instructor1OfCourse1.getGoogleId()); assertEquals(student1InCourse1.getEmail(), student1ResponseToStudent1.getGiver()); FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student1ResponseToStudent1.getRecipient()); String[] studentAccessOwnPersonParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), }; verifyCanAccess(updateRequest, studentAccessOwnPersonParams); }
Source:
<code>public static void reportInAppUpdateResult(boolean result, String failureReason) { Bundle bundle = new Bundle(); <START> bundle.putInt(FirebaseAnalytics.Param.SUCCESS, result ? 1 : 0); <END> bundle.putString(CCAnalyticsParam.REASON, failureReason); reportEvent(CCAnalyticsEvent.IN_APP_UPDATE_EVENT, bundle); }</code><technical_language>FirebaseAnalytics.Param.VALUE parameter Firebase [auto-aggregrates that](<LINK_0></technical_language>

Target:
public static void reportInAppUpdateResult(boolean result, String failureReason) { Bundle bundle = new Bundle(); bundle.putLong(FirebaseAnalytics.Param.VALUE, result ? 1 : 0); bundle.putString(CCAnalyticsParam.REASON, failureReason); reportEvent(CCAnalyticsEvent.IN_APP_UPDATE_EVENT, bundle); }
Source:
<code>public StaticPluginLocator(T... plugins) { <START> this.plugins = Collections.unmodifiableSet(new HashSet(Arrays.asList(plugins))); <END> }</code><technical_language>unmodifableSet(Sets.newHashSet.</technical_language>

Target:
public StaticPluginLocator(T... plugins) { this.plugins = new LinkedHashSet<>(plugins.length); Collections.addAll(this.plugins, plugins); }
Source:
<code>public TableType tableType() { if (isView()) { <START> return TableType.VIRTUAL_VIEW; <END> } else if (isMaterializedView()) { return TableType.MATERIALIZED_VIEW; } return table.getTableType(); }</code><technical_language>need check view type above. table.getTableType() suffice</technical_language>

Target:
public TableType tableType() { return table.getTableType(); }