auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static String getStandardDeviationString(double[] standardDeviationDoubles) { if (standardDeviationDoubles == null) { return null; } StringBuilder standardDeviationString = new StringBuilder(standardDeviationDoubles.length * 9); boolean first = true; for (double standardDeviationDouble : standardDeviationDoubles) { if (first) { first = false; } else { standardDeviationString.append("/"); } String abbreviated = Double.toString(standardDeviationDouble); int dotIndex = abbreviated.lastIndexOf('.'); <START> StringBuilder result = new StringBuilder().append(abbreviated.substring(0, dotIndex < 0 ? abbreviated.length() : dotIndex)); <END> if (dotIndex >= 0) { char[] abbreviatedChars = abbreviated.toCharArray(); for (int i = 0; i < 3; i++) { if (dotIndex + i >= abbreviatedChars.length) { break; } char currentChar = abbreviatedChars[dotIndex + i]; if (Character.isDigit(currentChar) || currentChar == '.') { result = result.append(currentChar); } } int expIndex = abbreviated.lastIndexOf('E'); if (expIndex >= 0) { result = result.append(abbreviated.substring(expIndex)); } } standardDeviationString.append(result.toString()); } return standardDeviationString.toString(); }</code><technical_language>Nitpick: StringBuilder this method: public StringBuilder append(CharSequence s, int start, int end) This avoids substring()'s string creation is trivially, completely unnoticeable faster</technical_language>

Target:
public static String getStandardDeviationString(double[] standardDeviationDoubles) { if (standardDeviationDoubles == null) { return null; } StringBuilder standardDeviationString = new StringBuilder(standardDeviationDoubles.length * 9); DecimalFormat exponentialFormat = new DecimalFormat("0.0#E0"); DecimalFormat decimalFormat = new DecimalFormat("0.0#"); boolean first = true; for (double standardDeviationDouble : standardDeviationDoubles) { if (first) { first = false; } else { standardDeviationString.append("/"); } String abbreviated; if (0.001 <= standardDeviationDouble && standardDeviationDouble <= 10000000.0) { abbreviated = decimalFormat.format(standardDeviationDouble); } else { abbreviated = exponentialFormat.format(standardDeviationDouble); } standardDeviationString.append(abbreviated); } return standardDeviationString.toString(); }
Source:
<code>public String get() { <START> return baseProducer.randomElement("C", "F", "G", "H", "J", "K") + randomNumeric(8); <END> }</code><technical_language>Please extract collection/ array</technical_language>

Target:
public String get() { return baseProducer.randomElement(PASSPORT_TYPE_LETTERS) + randomNumeric(8); }
Source:
<code>public List<AccountExternalId> byAccountEmail(Account.Id id, String email) { List<AccountExternalId> accIds = byAccountId.get(id).list; ArrayList<AccountExternalId> out = new ArrayList<AccountExternalId>(accIds.size()); for (AccountExternalId extId : accIds){ <START> if(extId.getEmailAddress().equals(email)){ <END> out.add(extId); } } return out; }</code><technical_language>Style-nit: Space if ( Also, getEmailAddress() return null</technical_language>

Target:
public List<AccountExternalId> byAccountEmail(Account.Id id, String email) { List<AccountExternalId> accIds = byAccountId.get(id).list; ArrayList<AccountExternalId> out = new ArrayList<AccountExternalId>(accIds.size()); for (AccountExternalId extId : accIds) { String accEmail = extId.getEmailAddress(); if (accEmail != null && accEmail.equals(email)) { out.add(extId); } } return out; }
Source:
<code>public boolean onCreateOptionsMenu(Menu menu) { try { if (googleCastDelegate != null && (googleCastDelegate.isConnected() || showGoogleCastButton())) { getMenuInflater().inflate(R.menu.google_cast_menu_item, menu); mediaRouteMenuItem = CastButtonFactory.setUpMediaRouteButton(getApplicationContext(), menu, R.id.media_route_menu_item); if (isInForeground()) { googleCastDelegate.showIntroductoryOverlay(this, mediaRouteMenuItem); } } } catch (Exception e) { <START> logger.error(e); <END> } return super.onCreateOptionsMenu(menu); }</code><technical_language>This log exception Crashlytics a non-fatal, call function follows: logger.error(e, true);</technical_language>

Target:
public boolean onCreateOptionsMenu(Menu menu) { try { if (googleCastDelegate != null && (googleCastDelegate.isConnected() || showGoogleCastButton())) { getMenuInflater().inflate(R.menu.google_cast_menu_item, menu); mediaRouteMenuItem = CastButtonFactory.setUpMediaRouteButton(getApplicationContext(), menu, R.id.media_route_menu_item); if (isInForeground()) { googleCastDelegate.showIntroductoryOverlay(this, mediaRouteMenuItem); } } } catch (Exception e) { logger.error(e, true); } return super.onCreateOptionsMenu(menu); }
Source:
<code><START> public CalenderModel getCalenderById(Long id) { <END> return modelMapper.getMapper().map(calendarRepo.findById(id), CalenderModel.class); }</code><technical_language>Calendar instead of Calender</technical_language>

Target:
public CalendarModel getCalenderById(Long id) { return modelMapper.getMapper().map(calendarRepo.findById(id), CalendarModel.class); }
Source:
<code>DiskManager(DiskId disk, List<ReplicaId> replicas, StoreConfig config, ScheduledExecutorService scheduler, StorageManagerMetrics metrics, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, Time time) { this.disk = disk; this.config = config; this.metrics = metrics; <START> DiskIOScheduler ioScheduler = new DiskIOScheduler(null); <END> for (ReplicaId replica : replicas) { if (disk.equals(replica.getDiskId())) { String storeId = replica.getPartitionId().toString(); BlobStore store = new BlobStore(storeId, config, scheduler, ioScheduler, metrics, replica.getReplicaPath(), replica.getCapacityInBytes(), keyFactory, recovery, hardDelete, time); stores.put(replica.getPartitionId(), store); } } }</code><technical_language>need remember this instance call close() shutdown</technical_language>

Target:
DiskManager(DiskId disk, List<ReplicaId> replicas, StoreConfig config, ScheduledExecutorService scheduler, StorageManagerMetrics metrics, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, Time time) { this.disk = disk; this.metrics = metrics; diskIOScheduler = new DiskIOScheduler(null); for (ReplicaId replica : replicas) { if (disk.equals(replica.getDiskId())) { String storeId = replica.getPartitionId().toString(); BlobStore store = new BlobStore(storeId, config, scheduler, diskIOScheduler, metrics, replica.getReplicaPath(), replica.getCapacityInBytes(), keyFactory, recovery, hardDelete, time); stores.put(replica.getPartitionId(), store); } } }
Source:
<code>public EJBClientContext withAddedTransportProviders(EJBTransportProvider... transportProviders) { if (transportProviders == null) { return this; } final int length = transportProviders.length; if (length == 0) { return this; } <START> log.tracef("Creating new EJBClientContext from %s with added transport providers including ", this, transportProviders[0]); <END> final Builder builder = new Builder(this); boolean construct = false; for (EJBTransportProvider transportProvider : transportProviders) { if (transportProvider != null) { builder.addTransportProvider(transportProvider); construct = true; } } return construct ? builder.build() : this; }</code><technical_language>missing a %s</technical_language>

Target:
public EJBClientContext withAddedTransportProviders(EJBTransportProvider... transportProviders) { if (transportProviders == null) { return this; } final int length = transportProviders.length; if (length == 0) { return this; } log.tracef("Creating new EJBClientContext from %s with added transport providers including %s", this, transportProviders[0]); final Builder builder = new Builder(this); boolean construct = false; for (EJBTransportProvider transportProvider : transportProviders) { if (transportProvider != null) { builder.addTransportProvider(transportProvider); construct = true; } } return construct ? builder.build() : this; }
Source:
<code>protected void configure() { super.configure(); install(new OkHttpCommandExecutorServiceModule()); bind(new TypeLiteral<Supplier<SSLContext>>() { }).to(new TypeLiteral<SSLContextWithKeysSupplier>() { }); <START> bind(OkHttpClientSupplier.class).to(new TypeLiteral<DockerOkHttpClientSupplier>() {}); <END> }</code><technical_language>Do simpler: java bind(OkHttpClientSupplier.class).to(DockerOkHttpClientSupplier.class);</technical_language>

Target:
protected void configure() { super.configure(); install(new OkHttpCommandExecutorServiceModule()); bind(OkHttpClientSupplier.class).to(DockerOkHttpClientSupplier.class); }
Source:
<code>public SDVariable get(SDIndex... indices){ int ndims = indices.length; int[] begin = new int[ndims]; int[] end = new int[ndims]; int[] strides = new int[ndims]; int[] begin_mask_arr = new int[ndims]; int[] end_mask_arr = new int[ndims]; int[] shrink_axis_mask_arr = new int[ndims]; for(int i=0; i<ndims; i++){ strides[i] = 1; SDIndex index = indices[i]; if(index.indexType == SDIndex.IndexType.ALL){ begin_mask_arr[i] = 1; end_mask_arr[i] = 1; } else if(index.indexType == SDIndex.IndexType.POINT){ if(index.point_index == null){ begin_mask_arr[i] = 1; end_mask_arr[i] = 1; } else { begin[i] = index.point_index; end[i] = index.point_index + 1; shrink_axis_mask_arr[i] = 1; } } else if(index.indexType == SDIndex.IndexType.INTERVAL){ if(index.interval_begin == null){ begin_mask_arr[i] = 1; } else{ begin[i] = index.interval_begin; } if(index.interval_end == null){ end_mask_arr[i] = 1; } else{ end[i] = index.interval_end; } if(index.interval_strides == null){ strides[i] = 1; } else{ strides[i] = index.interval_strides; } } } int begin_mask = binArrToInt(begin_mask_arr); int end_mask = binArrToInt(end_mask_arr); int shrink_axis = binArrToInt(shrink_axis_mask_arr); <START> return this.sameDiff.stridedSlice(this, begin, end, strides, <END> begin_mask, end_mask, 0, 0, shrink_axis); }</code><technical_language>need update (or overload) stridedSlice long indexing. I assume updated yet. some of args (but masks) need switched long[]</technical_language>

Target:
public SDVariable get(SDIndex... indices){ int ndims = indices.length; long[] begin = new long[ndims]; long[] end = new long[ndims]; long[] strides = new long[ndims]; int[] begin_mask_arr = new int[ndims]; int[] end_mask_arr = new int[ndims]; int[] shrink_axis_mask_arr = new int[ndims]; for(int i=0; i<ndims; i++){ strides[i] = 1; SDIndex index = indices[i]; SDIndex.IndexType indexType = index.getIndexType(); if(indexType == SDIndex.IndexType.ALL){ begin_mask_arr[i] = 1; end_mask_arr[i] = 1; } else if(indexType == SDIndex.IndexType.POINT){ long pointIndex = index.getPointIndex(); begin[i] = pointIndex; end[i] = pointIndex + 1; shrink_axis_mask_arr[i] = 1; } else if(indexType == SDIndex.IndexType.INTERVAL){ if(index.getIntervalBegin() == null){ begin_mask_arr[i] = 1; } else{ begin[i] = index.getIntervalBegin(); } if(index.getIntervalEnd() == null){ end_mask_arr[i] = 1; } else{ end[i] = index.getIntervalEnd(); } if(index.getIntervalStrides() == null){ strides[i] = 1; } else{ strides[i] = index.getIntervalStrides(); } } } int begin_mask = binArrToInt(begin_mask_arr); int end_mask = binArrToInt(end_mask_arr); int shrink_axis = binArrToInt(shrink_axis_mask_arr); return this.sameDiff.stridedSlice(this, begin, end, strides, begin_mask, end_mask, 0, 0, shrink_axis); }
Source:
<code>protected Set<String> processPoolUpdates( Map<String, EventBuilder> poolEvents, List<PoolUpdate> updatedPools) { Set<String> entitlementsToRegen = Util.newSet(); for (PoolUpdate updatedPool : updatedPools) { Pool existingPool = updatedPool.getPool(); log.info("Pool changed: {}", updatedPool.toString()); if (!poolCurator.exists(existingPool)) { log.info("Pool has already been deleted from the database."); continue; } if (existingPool.isMarkedForDelete()) { log.warn("Deleting pool as requested by rules: {}", existingPool.getId()); deletePool(existingPool); continue; } this.poolCurator.merge(existingPool); this.poolCurator.flush(); if (updatedPool.getQuantityChanged()) { <START> RevocationPlan revPlan = new RevocationPlan(poolCurator, config); <END> revPlan.setPool(existingPool); revPlan.execute(this); } if (updatedPool.getDatesChanged() || updatedPool.getProductsChanged() || updatedPool.getBrandingChanged()) { List<String> entitlements = poolCurator.retrieveFreeEntitlementIdsOfPool(existingPool); entitlementsToRegen.addAll(entitlements); } EventBuilder builder = poolEvents.get(existingPool.getId()); if (builder != null) { Event event = builder.setNewEntity(existingPool).buildEvent(); sink.queueEvent(event); } else { log.warn("Pool updated without an event builder: {}", existingPool); } } return entitlementsToRegen; }</code><technical_language>replace **only** this usage of deleteExcessEntitlements, **all** usages of it, including candlepinPoolManager.checkBonusPoolQuantities</technical_language>

Target:
protected Set<String> processPoolUpdates( Map<String, EventBuilder> poolEvents, List<PoolUpdate> updatedPools) { Set<String> entitlementsToRegen = Util.newSet(); for (PoolUpdate updatedPool : updatedPools) { Pool existingPool = updatedPool.getPool(); log.info("Pool changed: {}", updatedPool.toString()); if (!poolCurator.exists(existingPool)) { log.info("Pool has already been deleted from the database."); continue; } if (existingPool.isMarkedForDelete()) { log.warn("Deleting pool as requested by rules: {}", existingPool.getId()); deletePool(existingPool); continue; } this.poolCurator.merge(existingPool); this.poolCurator.flush(); if (updatedPool.getQuantityChanged()) { RevocationOp revPlan = new RevocationOp(poolCurator, Collections.singletonList(existingPool)); revPlan.execute(this); } if (updatedPool.getDatesChanged() || updatedPool.getProductsChanged() || updatedPool.getBrandingChanged()) { List<String> entitlements = poolCurator.retrieveOrderedEntitlementIdsOf(existingPool); entitlementsToRegen.addAll(entitlements); } EventBuilder builder = poolEvents.get(existingPool.getId()); if (builder != null) { Event event = builder.setNewEntity(existingPool).buildEvent(); sink.queueEvent(event); } else { log.warn("Pool updated without an event builder: {}", existingPool); } } return entitlementsToRegen; }
Source:
<code>public static MessageNumberSet[] buildMessageNumberSets(@Nullable final String msgNumbers) throws ImapAsyncClientException { if (msgNumbers == null || msgNumbers.isEmpty()) { return null; } final String[] msgSetStrs = msgNumbers.split(","); final MessageNumberSet[] msgSets = new MessageNumberSet[msgSetStrs.length]; int i = 0; for (final String element : msgSetStrs) { if (element.contains(":")) { final String[] elements = element.split(":"); if (elements[1].equals("*")) { msgSets[i] = new MessageNumberSet(Long.valueOf(elements[0]), LastMessage.LAST_MESSAGE); } else { msgSets[i] = new MessageNumberSet(Long.valueOf(elements[0]), Long.valueOf(elements[1])); } } else { if (element.equals("*")) { msgSets[i] = new MessageNumberSet(LastMessage.LAST_MESSAGE); } else { <START> msgSets[i] = new MessageNumberSet(Long.valueOf(element), Long.valueOf(element)); <END> } } i++; } return msgSets; }</code><technical_language>Assign of Long.valueOf(element) a tmp variable, parse string twice</technical_language>

Target:
public static MessageNumberSet[] buildMessageNumberSets(@Nullable final String msgNumbers) throws ImapAsyncClientException { if (msgNumbers == null || msgNumbers.isEmpty()) { return null; } final String[] msgSetStrs = msgNumbers.split(","); final MessageNumberSet[] msgSets = new MessageNumberSet[msgSetStrs.length]; int i = 0; for (final String element : msgSetStrs) { if (element.contains(":")) { final String[] elements = element.split(":"); if (elements[1].equals("*")) { msgSets[i] = new MessageNumberSet(Long.parseLong(elements[0]), LastMessage.LAST_MESSAGE); } else if (elements[0].equals("*")) { msgSets[i] = new MessageNumberSet(Long.parseLong(elements[1]), LastMessage.LAST_MESSAGE); } else { msgSets[i] = new MessageNumberSet(Long.parseLong(elements[0]), Long.parseLong(elements[1])); } } else { if (element.equals("*")) { msgSets[i] = new MessageNumberSet(LastMessage.LAST_MESSAGE); } else { final long num = Long.parseLong(element); msgSets[i] = new MessageNumberSet(num, num); } } i++; } return msgSets; }
Source:
<code>private List<Input> fetchDefaultBindings(Class<?> event, BindsConfiguration config) { List<Input> defaultInputs = Lists.newArrayList(); <START> Collection<Input> values = config.getBoundInputs(); <END> for (Annotation annotation : event.getAnnotationsByType(DefaultBinding.class)) { DefaultBinding defaultBinding = (DefaultBinding) annotation; Input input = defaultBinding.type().getInput(defaultBinding.id()); if (!values.contains(input)) { defaultInputs.add(input); } else { logger.warn("Input is already registered, can not use it for event {}", input, event); } } return defaultInputs; }</code><technical_language>values (generic map term) --> boundInputs (the actual content of collection)</technical_language>

Target:
private List<Input> fetchDefaultBindings(Class<?> event, BindsConfiguration config) { List<Input> defaultInputs = Lists.newArrayList(); Collection<Input> boundInputs = config.getBoundInputs(); for (Annotation annotation : event.getAnnotationsByType(DefaultBinding.class)) { DefaultBinding defaultBinding = (DefaultBinding) annotation; Input defaultInput = defaultBinding.type().getInput(defaultBinding.id()); if (!boundInputs.contains(defaultInput)) { defaultInputs.add(defaultInput); } else { logger.warn("Input is already registered, can not use it as default for event {}", defaultInput, event); } } return defaultInputs; }
Source:
<code>protected void executeVmCommand() { <START> final VmStatic VM = getVmStaticDAO().get(getParameters().getVmId()); <END> addCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); this.setVmName(VM.getName()); boolean succeeded = false; boolean macAddedToPool = false; try { if (StringUtils.isEmpty(getMacAddress())) { getInterface().setMacAddress(getMacPool().allocateNewMac()); macAddedToPool = true; } else { macAddedToPool = addMacToPool(getMacAddress()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); getInterface().setId(Guid.newGuid()); getInterface().setVmId(getParameters().getVmId()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { addInterfaceToDb(getInterface()); addInterfaceDeviceToDb(); getCompensationContext().stateChanged(); return null; } }); if (getInterface().isPlugged()) { succeeded = activateOrDeactivateNewNic(getInterface(), PlugAction.PLUG); } else { succeeded = true; } } finally { setSucceeded(succeeded); if (macAddedToPool && !succeeded) { getMacPool().freeMac(getMacAddress()); } } }</code><technical_language>necessary extract variable</technical_language>

Target:
protected void executeVmCommand() { addCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); this.setVmName(getVmStaticDAO().get(getParameters().getVmId()).getName()); boolean succeeded = false; boolean macAddedToPool = false; try { if (StringUtils.isEmpty(getMacAddress())) { getInterface().setMacAddress(getMacPool().allocateNewMac()); macAddedToPool = true; } else { macAddedToPool = addMacToPool(getMacAddress()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); getInterface().setId(Guid.newGuid()); getInterface().setVmId(getParameters().getVmId()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { addInterfaceToDb(getInterface()); addInterfaceDeviceToDb(); getCompensationContext().stateChanged(); return null; } }); if (getInterface().isPlugged()) { succeeded = activateOrDeactivateNewNic(getInterface(), PlugAction.PLUG); } else { succeeded = true; } } finally { setSucceeded(succeeded); if (macAddedToPool && !succeeded) { getMacPool().freeMac(getMacAddress()); } } }
Source:
<code>public void testSearchWithDateRange() { SearchParameterMap sp = new SearchParameterMap(); sp.setLoadSynchronous(true); sp.setLastUpdated(new DateRangeParam() .setUpperBound(new DateParam("le2019-02-22T17:50:00")) .setLowerBound(new DateParam("ge2019-02-22T13:50:00"))); IBundleProvider retrieved = myMedicationRequestDao.search(sp); List<String> queries = CaptureQueriesListener .getLastNQueries() .stream() .map(t -> t.getSql(true, true)) .collect(Collectors.toList()); ourLog.info("Queries:\n {}", queries.stream().findFirst()); String searchQuery = queries.get(0); <START> assertEquals(searchQuery, 3, StringUtils.countMatches(searchQuery.toUpperCase(), "HFJ_SPIDX_TOKEN")); <END> assertEquals(searchQuery, 5, StringUtils.countMatches(searchQuery.toUpperCase(), "LEFT OUTER JOIN")); }</code><technical_language>this is a clever test this</technical_language>

Target:
public void testSearchWithDateRange() { SearchParameterMap sp = new SearchParameterMap(); sp.setLoadSynchronous(true); sp.add(MedicationRequest.SP_INTENT, new TokenParam("FOO", "BAR")); sp.setLastUpdated(new DateRangeParam() .setUpperBound(new DateParam("le2019-02-22T17:50:00")) .setLowerBound(new DateParam("ge2019-02-22T13:50:00"))); IBundleProvider retrieved = myMedicationRequestDao.search(sp); List<String> queries = CaptureQueriesListener .getLastNQueries() .stream() .map(t -> t.getSql(true, true)) .collect(Collectors.toList()); ourLog.info("Queries:\n {}", queries.stream().findFirst()); String searchQuery = queries.get(0); assertEquals(searchQuery, 1, StringUtils.countMatches(searchQuery.toUpperCase(), "HFJ_SPIDX_TOKEN")); assertEquals(searchQuery, 1, StringUtils.countMatches(searchQuery.toUpperCase(), "LEFT OUTER JOIN")); assertEquals(searchQuery, 2, StringUtils.countMatches(searchQuery.toUpperCase(), "AND RESOURCETA0_.RES_UPDATED")); }
Source:
<code>protected boolean runKerberosLogin() { try { ShellSecurityImpl.createSecureConfiguration(getProperty(), shell); } catch (Exception e) { <START> return false; <END> } return true; }</code><technical_language>log error</technical_language>

Target:
protected boolean runKerberosLogin() { try { ShellSecurityImpl.createSecureConfiguration(getProperty(), shell); } catch (Exception e) { LOGGER.error("Unable to run kinit for zeppelin", e); return false; } return true; }
Source:
<code>private String[] getItemStrings(List<TmfEventTableColumn> columns, ITmfEvent event) { if (event == null) { return EMPTY_STRING_ARRAY; } synchronized (columns) { List<String> itemStrings = new ArrayList<>(columns.size()); int columnIndex = 0; for (TmfEventTableColumn column : columns) { ITmfEvent passedEvent = event; if (!(column instanceof TmfMarginColumn) && (event instanceof CachedEvent)) { passedEvent = ((CachedEvent) event).event; } <START> TableColumn viewColumn = fTable.getColumns()[fColumnOrder[columnIndex]]; <END> if (passedEvent == null || (!viewColumn.getResizable() && viewColumn.getWidth() == 0)) { itemStrings.add(EMPTY_STRING); } else { itemStrings.add(column.getItemString(passedEvent)); } columnIndex++; } return itemStrings.toArray(new String[0]); } }</code><technical_language>wrong index... dependent TmfEventTableColumn, assume received 'columns' list is in creation visible order</technical_language>

Target:
private String[] getItemStrings(List<TmfEventTableColumn> columns, ITmfEvent event) { if (event == null) { return EMPTY_STRING_ARRAY; } synchronized (columns) { List<String> itemStrings = new ArrayList<>(columns.size()); for (TableColumn viewColumn : fTable.getColumns()) { TmfEventTableColumn column = columns.get((int) viewColumn.getData(Key.INDEX)); ITmfEvent passedEvent = event; if (!(column instanceof TmfMarginColumn) && (event instanceof CachedEvent)) { passedEvent = ((CachedEvent) event).event; } if (passedEvent == null || (!viewColumn.getResizable() && viewColumn.getWidth() == 0)) { itemStrings.add(EMPTY_STRING); } else { itemStrings.add(column.getItemString(passedEvent)); } } return itemStrings.toArray(new String[itemStrings.size()]); } }
Source:
<code>public String getItemString(ITmfEvent event) { final String EMPTY_STRING = ""; <START> String s = NonNullUtils.nullToEmptyString(fAspect.resolve(event)); if (fAspectDuplicate.size() > 1 && s.equals(EMPTY_STRING)) { for (int i = 1; i < fAspectDuplicate.size(); i++) { String eventString = NonNullUtils.nullToEmptyString(fAspectDuplicate.get(i).resolve(event)); if (eventString != EMPTY_STRING) { s = eventString; } } } <END> return s; }</code><technical_language>if aspects in list, do for (ITmfEventAspect<?> aspect : fAspectDuplicate) { String eventString = aspect.resolve(event); ... } return string non-empty</technical_language>

Target:
public String getItemString(ITmfEvent event) { final String EMPTY_STRING = ""; for (ITmfEventAspect<?> aspect : fAspects) { String eventString = NonNullUtils.nullToEmptyString(aspect.resolve(event)); if(eventString != EMPTY_STRING) { return eventString; } } return EMPTY_STRING; }
Source:
<code>public Account getAccountById(short accountId) { Account primaryResult = primaryAccountService.getAccountById(accountId); Account secondaryResult = secondaryAccountService.getAccountById(accountId); <START> if ((++getAccountRequestCount % 100 < config.samplingPercentageForGetAccountConsistencyCheck) <END> && primaryResult != null && !primaryResult.equals(secondaryResult)) { logger.warn("Inconsistency detected between primary and secondary for accountId ={}", accountId); accountServiceMetrics.getAccountDataInconsistencyCount.inc(); } return primaryResult; }</code><technical_language>getAccountRequestCount.addAndGet(1)</technical_language>

Target:
public Account getAccountById(short accountId) { Account primaryResult = primaryAccountService.getAccountById(accountId); if (shouldCompare()) { Account secondaryResult = secondaryAccountService.getAccountById(accountId); if (primaryResult != null && !primaryResult.equals(secondaryResult)) { logger.warn("Inconsistency detected between primary and secondary for accountId ={}", accountId); accountServiceMetrics.accountDataInconsistencyCount.inc(); } } return primaryResult; }
Source:
<code>public void testBlockAndGetWithTimeoutsAndListenableFuture() throws InterruptedException { Task<String> t = sleep(Duration.millis(100), "x"); Assert.assertFalse(t.blockUntilEnded(Duration.millis(1))); Assert.assertFalse(t.blockUntilEnded(Duration.ZERO)); boolean didNotThrow = false; <START> try { t.getUnchecked(Duration.millis(1)); didNotThrow = true; } <END> catch (Exception e) { } Assert.assertFalse(didNotThrow); try { t.getUnchecked(Duration.ZERO); didNotThrow = true; } catch (Exception e) { } Assert.assertFalse(didNotThrow); addFutureListener(t, "before"); ec.submit(t); Assert.assertFalse(t.blockUntilEnded(Duration.millis(1))); Assert.assertFalse(t.blockUntilEnded(Duration.ZERO)); try { t.getUnchecked(Duration.millis(1)); didNotThrow = true; } catch (Exception e) { } Assert.assertFalse(didNotThrow); try { t.getUnchecked(Duration.ZERO); didNotThrow = true; } catch (Exception e) { } Assert.assertFalse(didNotThrow); addFutureListener(t, "during"); synchronized (data) { Assert.assertTrue(t.blockUntilEnded(Duration.TEN_SECONDS)); Assert.assertEquals(t.getUnchecked(Duration.millis(1)), "x"); Assert.assertEquals(t.getUnchecked(Duration.ZERO), "x"); Assert.assertNull(data.get("before")); Assert.assertNull(data.get("during")); assertSoonGetsData("before"); assertSoonGetsData("during"); } synchronized (data) { addFutureListener(t, "after"); Assert.assertNull(data.get("after")); assertSoonGetsData("after"); } }</code><technical_language>Minor stylistic: I more readable code - strong feelings. try { t.getUnchecked(Duration.millis(1)); fail(); } catch (Exception e) { // expected }</technical_language>

Target:
public void testBlockAndGetWithTimeoutsAndListenableFuture() throws InterruptedException { Task<String> t = waitForSemaphore(Duration.FIVE_SECONDS, true, "x"); Assert.assertFalse(t.blockUntilEnded(Duration.millis(1))); Assert.assertFalse(t.blockUntilEnded(Duration.ZERO)); boolean didNotThrow = false; try { t.getUnchecked(Duration.millis(1)); didNotThrow = true; } catch (Exception e) { } Assert.assertFalse(didNotThrow); try { t.getUnchecked(Duration.ZERO); didNotThrow = true; } catch (Exception e) { } Assert.assertFalse(didNotThrow); addFutureListener(t, "before"); ec.submit(t); Assert.assertFalse(t.blockUntilEnded(Duration.millis(1))); Assert.assertFalse(t.blockUntilEnded(Duration.ZERO)); try { t.getUnchecked(Duration.millis(1)); didNotThrow = true; } catch (Exception e) { } Assert.assertFalse(didNotThrow); try { t.getUnchecked(Duration.ZERO); didNotThrow = true; } catch (Exception e) { } Assert.assertFalse(didNotThrow); addFutureListener(t, "during"); synchronized (data) { waitInTask.release(); Assert.assertTrue(t.blockUntilEnded(Duration.TEN_SECONDS)); Assert.assertEquals(t.getUnchecked(Duration.millis(1)), "x"); Assert.assertEquals(t.getUnchecked(Duration.ZERO), "x"); Assert.assertNull(data.get("before")); Assert.assertNull(data.get("during")); assertSoonGetsData("before"); assertSoonGetsData("during"); } synchronized (data) { addFutureListener(t, "after"); Assert.assertNull(data.get("after")); assertSoonGetsData("after"); } }
Source:
<code>public List<ResourceEntry> reserveScalarResource(ResourceType resourceType, ScalarResourceEntry requiredValue) throws ResourceNotAvailabeException { <START> if (totalAvailableResource <= requiredValue.getValue()) { <END> throw new ResourceNotAvailabeException(String.format("resourceType: is not available. Requested Available {}", resourceType, requiredValue, totalAvailableResource)); } return removeAndGet(requiredValue); }</code><technical_language><= -> <</technical_language>

Target:
public List<ResourceEntry> reserveScalarResource(ResourceType resourceType, ScalarResourceEntry requiredValue) throws ResourceNotAvailableException { if (totalAvailableResource < requiredValue.getValue()) { throw new ResourceNotAvailableException(String.format("resourceType: is not available. Requested Available {}", resourceType, requiredValue, totalAvailableResource)); } return removeAndGet(requiredValue); }
Source:
<code>@Nullable ImageDecoder getImageDecoderForSource(BufferedSource source) { <START> for (ImageDecoder decoder : decoders) { <END> if (decoder.canHandleSource(source)) { return decoder; } } return null; }</code><technical_language>call canHandleSource, avoid surprise</technical_language>

Target:
@Nullable ImageDecoder getImageDecoderForSource(BufferedSource source) { for (int i = 0, n = decoders.size(); i < n; i++) { ImageDecoder decoder = decoders.get(i); if (decoder.canHandleSource(source.peek())) { return decoder; } } return null; }
Source:
<code>public synchronized void stop() throws Throwable { stopped = true; if ( currentJob != null ) { currentJob.stop(); } if ( jobHandle != null ) { <START> jobHandle.cancel( false ); <END> try { jobHandle.waitTermination(); } catch ( CancellationException ignored ) { } } }</code><technical_language>scheduler is designed run task time this effect. is currently running completed</technical_language>

Target:
public synchronized void stop() throws Throwable { stopped = true; if ( currentJob != null ) { currentJob.stop(); } }
Source:
<code>public synchronized DataCenter getDataCenterById(String id) { DataCenter dataCenter = null; if (dataCenterMap.containsKey(id)) { return dataCenterMap.get(id); } try { dataCenter = loadObject(DataCenter.class, id) != null ? (DataCenter) loadObject(DataCenter.class, id) : reInitializeDataCenter(id); } catch <START> (NullPointerException e) <END> { log.error("failed to fetch datacenter by id, rewrite caches for DC {}", id); } finally { log.info("about to store DC: id object {}", id, dataCenter); dataCenterMap.put(id, dataCenter); } return dataCenter; }</code><technical_language>handle this exception. detect handle it. hiding bug here</technical_language>

Target:
public synchronized DataCenter getDataCenterById(String id) { DataCenter dataCenter = null; if (dataCenterMap.containsKey(id)) { return dataCenterMap.get(id); } dataCenter = (DataCenter) loadObject(DataCenter.class, id); if (dataCenter == null){ dataCenter = reInitializeDataCenter(id); } return dataCenter; }
Source:
<code>public static void initializeTests() throws Exception { Properties serverSSLProps; File trustStoreFile = File.createTempFile("truststore", ".jks"); Properties clientSSLProps = new Properties(); TestSSLUtils.addSSLProperties(clientSSLProps, "DC1,DC2,DC3", SSLFactory.Mode.CLIENT, trustStoreFile, "http2-client"); TestSSLUtils.addHttp2Properties(clientSSLProps, SSLFactory.Mode.CLIENT, false); clientSSLConfig = new SSLConfig(new VerifiableProperties(clientSSLProps)); <START> eventLoopGroup = new NioEventLoopGroup(); <END> eventLoopGroup = Epoll.isAvailable() ? new EpollEventLoopGroup() : new NioEventLoopGroup(); serverSSLProps = new Properties(); TestSSLUtils.addSSLProperties(serverSSLProps, "DC1,DC2,DC3", SSLFactory.Mode.SERVER, trustStoreFile, "http2-server"); TestSSLUtils.addHttp2Properties(serverSSLProps, SSLFactory.Mode.SERVER, false); http2Cluster = new MockCluster(serverSSLProps, false, SystemTime.getInstance(), 2, 1, 2); notificationSystem = new MockNotificationSystem(http2Cluster.getClusterMap()); http2Cluster.initializeServers(notificationSystem); http2Cluster.startServers(); }</code><technical_language>nit: this line is all</technical_language>

Target:
public static void initializeTests() throws Exception { Properties serverSSLProps; File trustStoreFile = File.createTempFile("truststore", ".jks"); Properties clientSSLProps = new Properties(); TestSSLUtils.addSSLProperties(clientSSLProps, "DC1,DC2,DC3", SSLFactory.Mode.CLIENT, trustStoreFile, "http2-client"); TestSSLUtils.addHttp2Properties(clientSSLProps, SSLFactory.Mode.CLIENT, false); clientSSLConfig = new SSLConfig(new VerifiableProperties(clientSSLProps)); eventLoopGroup = Epoll.isAvailable() ? new EpollEventLoopGroup() : new NioEventLoopGroup(); serverSSLProps = new Properties(); TestSSLUtils.addSSLProperties(serverSSLProps, "DC1,DC2,DC3", SSLFactory.Mode.SERVER, trustStoreFile, "http2-server"); TestSSLUtils.addHttp2Properties(serverSSLProps, SSLFactory.Mode.SERVER, false); http2Cluster = new MockCluster(serverSSLProps, false, SystemTime.getInstance(), 2, 1, 2); notificationSystem = new MockNotificationSystem(http2Cluster.getClusterMap()); http2Cluster.initializeServers(notificationSystem); http2Cluster.startServers(); }
Source:
<code>public String getCsvForSubQuestion(int subQuestion) { StringBuilder csv = new StringBuilder(100); String alphabeticalIndex = StringHelper.integerToLowerCaseAlphabeticalIndex(subQuestion + 1); String subQuestionString = SanitizationHelper.sanitizeForCsv(alphabeticalIndex + ") " + getRubricSubQuestions().get(subQuestion)); DecimalFormat df = new DecimalFormat("0.00"); <START> DecimalFormat dfWeight = new DecimalFormat("#.##"); <END> csv.append(recipientTeam).append(',') .append(recipientName).append(',') .append(recipientEmail).append(',') .append(subQuestionString); for (int i = 0; i < getNumOfRubricChoices(); i++) { csv.append(',').append(Integer.toString(numOfResponsesPerSubQuestionPerChoice[subQuestion][i])) .append(" [" + dfWeight.format(rubricWeightsForEachCell.get(subQuestion).get(i)) + "]"); } csv.append(',').append(df.format(totalPerSubQuestion[subQuestion])).append(',') .append(respondentsPerSubQuestion[subQuestion] == 0 ? "0.00" : df.format(totalPerSubQuestion[subQuestion] / respondentsPerSubQuestion[subQuestion])) .append(System.lineSeparator()); return csv.toString(); }</code><technical_language>formatting of weight html format (line 1207)</technical_language>

Target:
public String getCsvForSubQuestion(int subQuestion) { StringBuilder csv = new StringBuilder(100); String alphabeticalIndex = StringHelper.integerToLowerCaseAlphabeticalIndex(subQuestion + 1); String subQuestionString = SanitizationHelper.sanitizeForCsv(alphabeticalIndex + ") " + getRubricSubQuestions().get(subQuestion)); DecimalFormat df = new DecimalFormat("0.00"); DecimalFormat dfWeight = new DecimalFormat("#.##"); csv.append(recipientTeam).append(',') .append(recipientName).append(',') .append(recipientEmail).append(',') .append(subQuestionString); for (int i = 0; i < getNumOfRubricChoices(); i++) { csv.append(',').append(Integer.toString(numOfResponsesPerSubQuestionPerChoice[subQuestion][i])) .append(" [" + dfWeight.format(weights.get(subQuestion).get(i)) + "]"); } csv.append(',').append(df.format(totalPerSubQuestion[subQuestion])).append(',') .append(respondentsPerSubQuestion[subQuestion] == 0 ? "0.00" : df.format(totalPerSubQuestion[subQuestion] / respondentsPerSubQuestion[subQuestion])) .append(System.lineSeparator()); return csv.toString(); }
Source:
<code>public void calculateDerivedFields() { biSiteHeterogeneityRate = nDifferentAllelesBiDups / (double) (nDifferentAllelesBiDups + nAlternateAllelesBiDups + nReferenceAllelesBiDups); biSiteHomogeneityRate = 1 - biSiteHeterogeneityRate; this.biologicalDuplicateRateFromBiDups = 2 * biSiteHeterogeneityRate; triSiteHeterogeneityRate = nDifferentAllelesTriDups / (double) (nDifferentAllelesTriDups + nAlternateAllelesTriDups + nReferenceAllelesTriDups); triSiteHomogeneityRate = 1 - triSiteHeterogeneityRate; biologicalDuplicateRateFromTriDups = 2 * (1 - Math.sqrt(triSiteHomogeneityRate)); pSameUmiInBiologicalBiDup = nMatchingUMIsInDiffBiDups / (double) (nMismatchingUMIsInDiffBiDups + nMatchingUMIsInDiffBiDups); pSameAlleleWhenMismatchingUmi = nMismatchingUMIsInSameBiDups / (double) (nMismatchingUMIsInSameBiDups + nMismatchingUMIsInDiffBiDups); biologicalDuplicateRateFromUmi = (nMismatchingUMIsInDiffBiDups + nMismatchingUMIsInSameBiDups) / (double) nExactlyDouble; final int numberOfBigSets = nDuplicateSets - nExactlyDouble - nExactlyDouble; duplicationRateFromDuplicateSets = (nExactlyDouble + nExactlyTriple * 2 + nReadsInBigSets - numberOfBigSets) / (double) nTotalReads; <START> <END> }</code><technical_language>one</technical_language>

Target:
public void calculateDerivedFields() { biSiteHeterogeneityRate = nDifferentAllelesBiDups / (double) (nDifferentAllelesBiDups + nAlternateAllelesBiDups + nReferenceAllelesBiDups); biSiteHomogeneityRate = 1 - biSiteHeterogeneityRate; this.independentReplicationRateFromBiDups = 2 * biSiteHeterogeneityRate; triSiteHeterogeneityRate = nDifferentAllelesTriDups / (double) (nDifferentAllelesTriDups + nAlternateAllelesTriDups + nReferenceAllelesTriDups); triSiteHomogeneityRate = 1 - triSiteHeterogeneityRate; independentReplicationRateFromTriDups = 2 * (1 - Math.sqrt(triSiteHomogeneityRate)); pSameUmiInIndependentBiDup = nMatchingUMIsInDiffBiDups / (double) (nMismatchingUMIsInDiffBiDups + nMatchingUMIsInDiffBiDups); pSameAlleleWhenMismatchingUmi = nMismatchingUMIsInSameBiDups / (double) (nMismatchingUMIsInSameBiDups + nMismatchingUMIsInDiffBiDups); independentReplicationRateFromUmi = (nMismatchingUMIsInDiffBiDups + nMismatchingUMIsInSameBiDups) / (double) nExactlyDouble; final int numberOfBigSets = nDuplicateSets - nExactlyDouble - nExactlyDouble; replicationRateFromReplicateSets = (nExactlyDouble + nExactlyTriple * 2 + nReadsInBigSets - numberOfBigSets) / (double) nTotalReads; }
Source:
<code>public FlinkPod decorateFlinkPod(FlinkPod flinkPod) { final Container mainContainerWithStartCmd = new ContainerBuilder(flinkPod.getMainContainer()) .withCommand(kubernetesTaskManagerParameters.getContainerEntrypoint()) <START> .withArgs(KubernetesUtils.getStartCommandWithBashWrapper(getTaskManagerStartCommand())) <END> .build(); return new FlinkPod.Builder(flinkPod) .withMainContainer(mainContainerWithStartCmd) .build(); }</code><technical_language>here. KubernetesUtils#getStartCommandWithBashWrapper moved getTaskManagerStartCommand</technical_language>

Target:
public FlinkPod decorateFlinkPod(FlinkPod flinkPod) { final Container mainContainerWithStartCmd = new ContainerBuilder(flinkPod.getMainContainer()) .withCommand(kubernetesTaskManagerParameters.getContainerEntrypoint()) .withArgs(getTaskManagerStartCommand()) .build(); return new FlinkPod.Builder(flinkPod) .withMainContainer(mainContainerWithStartCmd) .build(); }
Source:
<code>public Plugin convert(String s) { String[] details = s.split("="); <START> assert details.length == 2; <END> return new Plugin(details[0], new VersionNumber(details[1])); }</code><technical_language>Asserts disabled in of JVM defaults. formally throw exception</technical_language>

Target:
public PCTPlugin convert(String s) { String[] details = s.split("="); return new PCTPlugin(details[0], new VersionNumber(details[1])); }
Source:
<code>protected static AudienceRestrictionType locateAudienceRestriction(ResponseType response) { try { return response.getAssertions().get(0).getAssertion().getConditions().getConditions() .stream() <START> .filter(c -> c instanceof AudienceRestrictionType) <END> .map(c -> (AudienceRestrictionType) c) .findFirst().orElse(null); } catch (NullPointerException | IndexOutOfBoundsException e) { logger.warnf("Invalid SAML ResponseType to add the audience restriction", e); return null; } }</code><technical_language>suggestion .filter(AudienceRestrictionType.class::isInstance) .map(AudienceRestrictionType.class::cast)</technical_language>

Target:
protected static AudienceRestrictionType locateAudienceRestriction(ResponseType response) { try { return response.getAssertions().get(0).getAssertion().getConditions().getConditions() .stream() .filter(AudienceRestrictionType.class::isInstance) .map(AudienceRestrictionType.class::cast) .findFirst().orElse(null); } catch (NullPointerException | IndexOutOfBoundsException e) { logger.warn("Invalid SAML ResponseType to add the audience restriction", e); return null; } }
Source:
<code>public void testPartitionedWithFilter() { assertNotFallback("select * from P1 where i = 1"); assertNotFallback("select * from P1 where 1 = i"); assertFallback("select * from P1 where i > 10"); assertFallback("select * from P1 where i <> 10"); <START> assertNotFallback("select si, v from P1 where 7=si and i=2"); <END> assertNotFallback("select si, v from P1 where 7>si and i=2 and ti<3"); assertFallback("select si, v from P1 where 7=si or i=2"); assertFallback("select si, v from P1 where 7=si or i=2 or ti=3"); assertFallback("select si, v from P1 where 7>si or (i=2 and ti<3)"); assertNotFallback("select si, v from P1 where 7>si and (i=2 and ti<3)"); assertNotFallback("select si, v from P1 where (7>si or ti=2) and i=2"); assertFallback("select si, v from P1 where (7>si or ti=2) or i=2"); assertNotFallback("select si, v from P1 where (7=si and i=2) and 1=1"); assertFallback("select si, v from P1 where (7=si and i=2) or 1=1"); assertNotFallback("select si, v from P1 where (7=si and i=2) and 1=2"); }</code><technical_language>SELECT si + 1 P1 7 = si SELECT max(v) P1 7 = si work too</technical_language>

Target:
public void testPartitionedWithFilter() { m_tester.sql("select * from P1 where i = 1").test(); m_tester.sql("select * from P1 where 1 = i").test(); m_tester.sql("select * from P1 where i > 10").testFail(); m_tester.sql("select * from P1 where i <> 10").testFail(); m_tester.sql("select si, v from P1 where 7=si and i=2").test(); m_tester.sql("select si, v from P1 where 7>si and i=2 and ti<3").test(); m_tester.sql("SELECT si + 1 FROM P1 WHERE 7 = i").test(); m_tester.sql("SELECT max(v) FROM P1 WHERE 7 = i").test(); m_tester.sql("select si, v from P1 where 7=si or i=2").testFail(); m_tester.sql("select si, v from P1 where 7>si or (i=2 and ti<3)").testFail(); m_tester.sql("select si, v from P1 where 7>si and (i=2 and ti<3)").test(); m_tester.sql("select si, v from P1 where (7>si or ti=2) and i=2").test(); m_tester.sql("select si, v from P1 where (7>si or ti=2) or i=2").testFail(); m_tester.sql("select si, v from P1 where (7=si and i=2) and 1=1").test(); m_tester.sql("select si, v from P1 where (7=si and i=2) and true").test(); m_tester.sql("select si, v from P1 where (7=si and i=2) or 1=1").testFail(); m_tester.sql("select si, v from P1 where (7=si and i=2) and 1=2").test(); m_tester.sql("select si, v from P1 where (7=si and i=2) or 1=2").test(); }
Source:
<code>public List<@NonNull Integer> getQuarks(String... pattern) { List<@NonNull Integer> quarks = new LinkedList<>(); List<String> prefix = new LinkedList<>(); List<String> suffix = new LinkedList<>(); boolean split = false; String[] prefixStr; String[] suffixStr; List<Integer> directChildren; int startingAttribute; for (String entry : pattern) { if (entry.equals("*")) { if (split) { return quarks; } split = true; continue; } if (split) { suffix.add(entry); } else { prefix.add(entry); } } prefixStr = prefix.toArray(new String[prefix.size()]); suffixStr = suffix.toArray(new String[suffix.size()]); if (!split) { int quark; try { quark = getQuarkAbsolute(prefixStr); } catch (AttributeNotFoundException e) { return quarks; } quarks.add(quark); return quarks; } <START> if (prefix.size() == 0) { <END> startingAttribute = ROOT; } else { startingAttribute = optQuarkAbsolute(prefixStr); if (startingAttribute == INVALID) { return quarks; } } try { directChildren = getSubAttributes(startingAttribute, false); } catch (AttributeNotFoundException e) { throw new IllegalStateException(); } for (int childQuark : directChildren) { int matchingQuark = optQuarkRelative(childQuark, suffixStr); if (matchingQuark != INVALID) { quarks.add(matchingQuark); } } return quarks; }</code><technical_language>isEmpty()</technical_language>

Target:
public List<@NonNull Integer> getQuarks(String... pattern) { List<@NonNull Integer> quarks = new LinkedList<>(); List<String> prefix = new LinkedList<>(); List<String> suffix = new LinkedList<>(); boolean split = false; String[] prefixStr; String[] suffixStr; List<Integer> directChildren; int startingAttribute; for (String entry : pattern) { if (entry.equals("*")) { if (split) { return quarks; } split = true; continue; } if (split) { suffix.add(entry); } else { prefix.add(entry); } } prefixStr = prefix.toArray(new String[prefix.size()]); suffixStr = suffix.toArray(new String[suffix.size()]); if (!split) { int quark; try { quark = getQuarkAbsolute(prefixStr); } catch (AttributeNotFoundException e) { return quarks; } quarks.add(quark); return quarks; } if (prefix.isEmpty()) { startingAttribute = ROOT; } else { startingAttribute = optQuarkAbsolute(prefixStr); if (startingAttribute == INVALID) { return quarks; } } try { directChildren = getSubAttributes(startingAttribute, false); } catch (AttributeNotFoundException e) { throw new IllegalStateException(); } for (int childQuark : directChildren) { int matchingQuark = optQuarkRelative(childQuark, suffixStr); if (matchingQuark != INVALID) { quarks.add(matchingQuark); } } return quarks; }
Source:
<code>private void sync() throws IOException { packDigest.update(buf, 0, bOffset); <START> if (expectDataAfterPackFooter) { <END> if (bAvail > 0) { in.reset(); IO.skipFully(in, bOffset); } in.mark(buf.length); } onStoreStream(buf, 0, bOffset); if (bAvail > 0) System.arraycopy(buf, bOffset, buf, 0, bAvail); bBase += bOffset; bOffset = 0; }</code><technical_language>nit: this packDigest.update onStoreStream calls next other operate range of buf, this matter relative calls</technical_language>

Target:
private void sync() throws IOException { packDigest.update(buf, 0, bOffset); onStoreStream(buf, 0, bOffset); if (expectDataAfterPackFooter) { if (bAvail > 0) { in.reset(); IO.skipFully(in, bOffset); bAvail = 0; } in.mark(buf.length); } else if (bAvail > 0) System.arraycopy(buf, bOffset, buf, 0, bAvail); bBase += bOffset; bOffset = 0; }
Source:
<code>public void testGetVdsCapabilities() throws InterruptedException, ExecutionException, ClientConnectionException { <START> JsonRpcClient client = JsonRpcUtils.createStompClient(HOST_ADDRESS, PORT, TIMEOUT, 0, TIMEOUT, TIMEOUT, true, "TLS"); <END> final JsonRpcRequest request = new RequestBuilder("Host.getCapabilities").build(); Map<String, Object> map = new FutureMap(client, request); assertTrue(map.isEmpty()); }</code><technical_language>TLS TLSv1</technical_language>

Target:
public void testGetVdsCapabilities() throws InterruptedException, ExecutionException, ClientConnectionException { JsonRpcClient client = JsonRpcUtils.createStompClient(HOST_ADDRESS, PORT, TIMEOUT, 0, TIMEOUT, TIMEOUT, true, "TLSv1"); final JsonRpcRequest request = new RequestBuilder("Host.getCapabilities").build(); Map<String, Object> map = new FutureMap(client, request); assertTrue(map.isEmpty()); }