auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void poll() { log.info("polling published segments from coordinator"); final JsonParserIterator<SegmentWithOvershadowedStatus> metadataSegments = getMetadataSegments( coordinatorDruidLeaderClient, jsonMapper, responseHandler, segmentWatcherConfig.getWatchedDataSources() ); final DateTime timestamp = DateTimes.nowUtc(); <START> while (metadataSegments.hasNext()) { <END> final SegmentWithOvershadowedStatus segment = metadataSegments.next(); final DataSegment interned = DataSegmentInterner.intern(segment.getDataSegment()); final SegmentWithOvershadowedStatus segmentWithOvershadowedStatus = new SegmentWithOvershadowedStatus( interned, segment.isOvershadowed() ); publishedSegments.put(segmentWithOvershadowedStatus, timestamp); } publishedSegments.entrySet().removeIf(e -> e.getValue() != timestamp); cachePopulated.set(true); }</code><technical_language>This introduces a bug: SegmentWithOvershadowedStatus for underlying DataSegment, segment in publishedSegments for a period of time. a ways deal this: 1. publishedSegments a TreeSet<SegmentWithOvershadowedStatus> update entire map atomically. This is a super clean solution burst higher memory usage (it need entire copies of map in memory replacing them). 2. publishedSegments a ConcurrentSkipListMap<DataSegment, CachedSegmentInfo> CachedSegmentInfo is some static class, defined in this file, updated timestamp overshadowed boolean. If do this, SegmentWithOvershadowedStatus stored long term anymore. minimize memory footprint of CachedSegmentInfo, if want, making timestamp a long DateTime. 3. publishedSegments a ConcurrentSkipListSet<SegmentWithOvershadowedStatus>, SegmentWithOvershadowedStatus mutable (in a thread-safe way), equals, hashCode, compareTo methods based dataSegment field, overshadowed field modified, add a timestamp field it. syncing cache, get current object mutate overshadowed field if necessary. Btw, a ConcurrentSkipListSet a ConcurrentSkipListMap hood, memory footprint savings of this expect relative (2). (2) is variant closest code this patch. I love is is racey: means if a set of segments is overshadowed once, callers necessarily a consistent view, map is concurrently updated. overshadowed flag get set for underlying segments a time. problem existed in code, fixing considered out of scope for this patch</technical_language>

Target:
private void poll() { log.info("polling published segments from coordinator"); final JsonParserIterator<SegmentWithOvershadowedStatus> metadataSegments = getMetadataSegments( coordinatorDruidLeaderClient, jsonMapper, responseHandler, segmentWatcherConfig.getWatchedDataSources() ); final ImmutableSortedSet.Builder<SegmentWithOvershadowedStatus> builder = ImmutableSortedSet.naturalOrder(); while (metadataSegments.hasNext()) { final SegmentWithOvershadowedStatus segment = metadataSegments.next(); final DataSegment interned = DataSegmentInterner.intern(segment.getDataSegment()); final SegmentWithOvershadowedStatus segmentWithOvershadowedStatus = new SegmentWithOvershadowedStatus( interned, segment.isOvershadowed() ); builder.add(segmentWithOvershadowedStatus); } publishedSegments = builder.build(); cachePopulated.countDown(); }
Source:
<code>protected void run() throws Exception { final int cnt = 100; final long start = System.currentTimeMillis(); for (int i = 0; i < cnt; i++) DirCache.read(db); final long end = System.currentTimeMillis(); out.println(" "); <START> out.println(CLIText.get().averageLabel); <END> out.println(" " + ((end - start) / cnt) + " "); out.println(CLIText.get().milliSecondsLabel); out.println("/"); out.println(CLIText.get().readLabel); }</code><technical_language>some line breaks more in original println</technical_language>

Target:
protected void run() throws Exception { final int cnt = 100; final long start = System.currentTimeMillis(); for (int i = 0; i < cnt; i++) DirCache.read(db); final long end = System.currentTimeMillis(); out.print(" "); out.println(MessageFormat.format(CLIText.get().averageMSPerRead, (end - start) / cnt)); }
Source:
<code>public JClass refClass(String fullyQualifiedClassName) { JClass refClass = loadedClasses.get(fullyQualifiedClassName); if (refClass == null) { if (fullyQualifiedClassName.endsWith("[]")) { <START> return refClass(fullyQualifiedClassName.substring(0, fullyQualifiedClassName.length() - 2)).array(); <END> } else { refClass = new TypeNameParser(fullyQualifiedClassName).parseTypeName(); loadedClasses.put(fullyQualifiedClassName, refClass); } } return refClass; }</code><technical_language>extract a local variable substring statement ? Thx ;)</technical_language>

Target:
public JClass refClass(String fullyQualifiedClassName) { int arrayCounter = 0; while (fullyQualifiedClassName.endsWith("[]")) { arrayCounter++; fullyQualifiedClassName = fullyQualifiedClassName.substring(0, fullyQualifiedClassName.length() - 2); } JClass refClass = loadedClasses.get(fullyQualifiedClassName); if (refClass == null) { refClass = codeModel.directClass(fullyQualifiedClassName); loadedClasses.put(fullyQualifiedClassName, refClass); } for (int i = 0; i < arrayCounter; i++) { refClass = refClass.array(); } return refClass; }
Source:
<code>public void showLinkPreview(PageTitle title, int entrySource) { if (getSupportFragmentManager().findFragmentByTag(LINK_PREVIEW_FRAGMENT_TAG) == null) { <START> DialogFragment linkPreview = app.getLinkPreviewVersion() == 0 <END> ? LinkPreviewDialog.newInstance(title, entrySource) : LinkPreviewDialogB.newInstance(title, entrySource); linkPreview.show(getSupportFragmentManager(), LINK_PREVIEW_FRAGMENT_TAG); } }</code><technical_language>link preview version die, a isExperimental isStableLinkPreviewVersionEnabled() method a constant for magic values</technical_language>

Target:
public void showLinkPreview(PageTitle title, int entrySource) { if (getSupportFragmentManager().findFragmentByTag(LINK_PREVIEW_FRAGMENT_TAG) == null) { DialogFragment linkPreview = app.isLinkPreviewExperimental() ? LinkPreviewDialogB.newInstance(title, entrySource) : LinkPreviewDialog.newInstance(title, entrySource); linkPreview.show(getSupportFragmentManager(), LINK_PREVIEW_FRAGMENT_TAG); } }
Source:
<code>public RefreshFileJob(File file, boolean derived) throws Exception { super("Refreshing " + file); this.derived = derived; this.files = new ArrayList<File>(); <START> this.files.add(file); <END> }</code><technical_language>Collections.singletonList(file) instead of creating array list adding file</technical_language>

Target:
public RefreshFileJob(File file, boolean derived) throws Exception { super("Refreshing " + file); this.derived = derived; this.files = Collections.singletonList(file); }
Source:
<code>public static String getMessageFromIntent(Intent intent) { if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction())) { <START> NdefMessage[] messages; <END> Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES); if (rawMsgs != null) { messages = new NdefMessage[rawMsgs.length]; for (int i = 0; i < rawMsgs.length; i++) { messages[i] = (NdefMessage) rawMsgs[i]; } if (messages[0] != null) { String result = ""; byte[] payload = messages[0].getRecords()[0].getPayload(); if (payload.length > 0) { int i = payloadStartContainsText(payload[0]) ? 0 : 1; for (; i < payload.length; i++) { result += (char) payload[i]; } } return result; } } } return null; }</code><technical_language>Define usage</technical_language>

Target:
public static String getMessageFromIntent(Intent intent) { if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction()) || NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction())) { Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES); if (rawMsgs != null) { NdefMessage[] messages = new NdefMessage[rawMsgs.length]; for (int i = 0; i < rawMsgs.length; i++) { messages[i] = (NdefMessage) rawMsgs[i]; } if (messages[0] != null) { String result = ""; byte[] payload = messages[0].getRecords()[0].getPayload(); if (payload.length > 0) { int i = payloadStartContainsText(payload[0]) ? 0 : 1; for (; i < payload.length; i++) { result += (char) payload[i]; } } return result; } } } return null; }
Source:
<code>public void save(OutputStream os) { <START> try (PrintStream ps = new PrintStream(os)) { <END> save(ps); } }</code><technical_language>Is this Platform dependant? Thinking EOL</technical_language>

Target:
public void save(OutputStream os) throws IOException { try (PrintStream ps = new PrintStream(os, false, UTF_8.name())) { save(ps); ps.flush(); } }
Source:
<code>private ArrayList<CategoryPill.Data> getCategories(String response, CreateCategoryContext ctxt) { Object json = Configuration.defaultConfiguration().jsonProvider().parse(response); int len = JsonPath.read(json, "$._embedded.doc:forum.length()"); <START> ArrayList<CategoryPill.Data> categories = new ArrayList<>(); <END> for (int i = 0; i < len; i++) { String id = JsonPath.read(json, "$._embedded.doc:forum[" + i + "].id"); String name = JsonPath.read(json, "$._embedded.doc:forum[" + i + "].name"); if (!id.equals(ctxt.getSiteId())) { categories.add(new CategoryPill.Data(id, name)); } } return categories; }</code><technical_language>Stick interfaces implementations: List<CategoryPill.Data> categories = new ArrayList<>();</technical_language>

Target:
private List<CategoryPill.Data> getCategories(String response, CreateCategoryContext ctxt) { Object json = Configuration.defaultConfiguration().jsonProvider().parse(response); int len = JsonPath.read(json, "$._embedded.doc:forum.length()"); List<CategoryPill.Data> categories = new ArrayList<>(); for (int i = 0; i < len; i++) { String id = JsonPath.read(json, "$._embedded.doc:forum[" + i + "].id"); String name = JsonPath.read(json, "$._embedded.doc:forum[" + i + "].name"); if (!id.equals(ctxt.getSiteId())) { categories.add(new CategoryPill.Data(id, name)); } } return categories; }
Source:
<code>public void getStorageDomainDefaultWipeAfterDelete(AsyncQuery aQuery, StorageType storageType) { aQuery.converterCallback = new IAsyncConverter<Boolean>() { @Override public Boolean Convert(Object returnValue, AsyncQuery asyncQuery) { return (Boolean) returnValue; } }; GetStorageDomainDefaultWipeAfterDeleteParameters params = new GetStorageDomainDefaultWipeAfterDeleteParameters(storageType); <START> Frontend.getInstance().runQuery(VdcQueryType.GetStorageDomainWipeAfterDelete, params, aQuery); <END> }</code><technical_language>Change VdcQueryType correct one, this exist fails compilation</technical_language>

Target:
public void getStorageDomainDefaultWipeAfterDelete(AsyncQuery aQuery, StorageType storageType) { aQuery.converterCallback = new IAsyncConverter<Boolean>() { @Override public Boolean Convert(Object returnValue, AsyncQuery asyncQuery) { return (Boolean) returnValue; } }; GetStorageDomainDefaultWipeAfterDeleteParameters params = new GetStorageDomainDefaultWipeAfterDeleteParameters(storageType); Frontend.getInstance().runQuery(VdcQueryType.GetStorageDomainDefaultWipeAfterDelete, params, aQuery); }
Source:
<code>public String getError() { <START> return ""; <END> }</code><technical_language>string</technical_language>

Target:
public String getError() { return "No lastUpdated field provided for the entry."; }
Source:
<code>protected PopupPresenter() { <START> this(null); <END> }</code><technical_language>Please null here. pass "" stateKey concatenate</technical_language>

Target:
protected PopupPresenter() { this(""); }
Source:
<code>public InfrastructureResponse listInfrastructure() { final InfrastructureResponse response = new InfrastructureResponse(); response.setZones(dataCenterDao.listAllZones().size()); response.setPods(podDao.listAllPods(null).size()); response.setClusters(clusterDao.listAllClusters(null).size()); response.setHosts(hostDao.listByType(Host.Type.Routing).size()); response.setStoragePools(storagePoolDao.listAll().size()); response.setImageStores(imageStoreDao.listImageStores().size()); response.setSystemvms(vmInstanceDao.listByTypes(VirtualMachine.Type.ConsoleProxy, VirtualMachine.Type.SecondaryStorageVm).size()); <START> response.setRouters(domainRouterDao.listByRole(VirtualRouter.Role.VIRTUAL_ROUTER).size()); <END> response.setInternalLbs(domainRouterDao.listByRole(VirtualRouter.Role.INTERNAL_LB_VM).size()); response.setAlerts(alertDao.listAll().size()); int cpuSockets = 0; for (final Host host : hostDao.listByType(Host.Type.Routing)) { if (host.getCpuSockets() != null) { cpuSockets += host.getCpuSockets(); } } response.setCpuSockets(cpuSockets); response.setManagementServers(managementServerHostDao.listAll().size()); return response; }</code><technical_language>@Pearl1594 calling listAll() i.e. rows APIs slow in a large env; this is fine explore a simply get count (instead of rows)</technical_language>

Target:
public InfrastructureResponse listInfrastructure() { final InfrastructureResponse response = new InfrastructureResponse(); response.setZones(dataCenterDao.countAll()); response.setPods(podDao.countAll()); response.setClusters(clusterDao.countAll()); response.setHosts(hostDao.countAllByType(Host.Type.Routing)); response.setStoragePools(storagePoolDao.countAll()); response.setImageStores(imageStoreDao.countAllImageStores()); response.setSystemvms(vmInstanceDao.listByTypes(VirtualMachine.Type.ConsoleProxy, VirtualMachine.Type.SecondaryStorageVm).size()); response.setRouters(domainRouterDao.countAllByRole(VirtualRouter.Role.VIRTUAL_ROUTER)); response.setInternalLbs(domainRouterDao.countAllByRole(VirtualRouter.Role.INTERNAL_LB_VM)); response.setAlerts(alertDao.countAll()); int cpuSockets = 0; for (final Host host : hostDao.listByType(Host.Type.Routing)) { if (host.getCpuSockets() != null) { cpuSockets += host.getCpuSockets(); } } response.setCpuSockets(cpuSockets); response.setManagementServers(managementServerHostDao.listAll().size()); return response; }
Source:
<code>public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { final SubMonitor subMonitor = SubMonitor.convert(monitor, 1); try { IProject[] projects = getBuildOrder(configuration, mode); if (projects == null) { return true; } <START> buildProjects(projects, subMonitor.split(1)); <END> return false; } finally { if (monitor != null) { monitor.done(); } } }</code><technical_language>do need another submonitor conversion here</technical_language>

Target:
public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { try { IProject[] projects = getBuildOrder(configuration, mode); if (projects == null) { return true; } buildProjects(projects, SubMonitor.convert(monitor, 1)); return false; } finally { if (monitor != null) { monitor.done(); } } }
Source:
<code>@Test public void maskingFreeStyleSecrets() throws Exception { String credentialsId_1 = "creds_1"; String username_1 = "s3cr3t"; String password_1 = "p4ss"; StringCredentialsImpl c_1 = new StringCredentialsImpl(CredentialsScope.GLOBAL, credentialsId_1, "sample1", Secret.fromString(password_1)); String credentialsId_2 = "creds_2"; String username_2 = "s3cr3t0"; String password_2 = "p4ss" + "EvenLonger"; StringCredentialsImpl c_2 = new StringCredentialsImpl(CredentialsScope.GLOBAL, credentialsId_2, "sample2", Secret.fromString(password_2)); CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), c_1); CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), c_2); SecretBuildWrapper bw_1 = new SecretBuildWrapper(Collections.<MultiBinding<?>>singletonList(new StringBinding("PASS_1", credentialsId_1))); SecretBuildWrapper bw_2 = new SecretBuildWrapper(Collections.<MultiBinding<?>>singletonList(new StringBinding("PASS_2", credentialsId_2))); FreeStyleProject f = r.createFreeStyleProject(); f.setConcurrentBuild(true); f.getBuildersList().add(new Shell("echo $PASS_1")); f.getBuildersList().add(new Shell("echo $PASS_2")); f.getBuildWrappersList().add(bw_1); <START> f.getBuildWrappersList().add(bw_2); <END> r.configRoundtrip((Item)f); FreeStyleBuild b = r.buildAndAssertSuccess(f); r.assertLogNotContains(password_1, b); r.assertLogNotContains(password_2, b); r.assertLogContains("echo ****", b); }</code><technical_language>realistic, in fact add of kind of BuildWrapper a Project. create wrapper, a two-element list of bindings</technical_language>

Target:
@Test public void maskingFreeStyleSecrets() throws Exception { String firstCredentialsId = "creds_1"; String firstPassword = "p4ss"; StringCredentialsImpl firstCreds = new StringCredentialsImpl(CredentialsScope.GLOBAL, firstCredentialsId, "sample1", Secret.fromString(firstPassword)); CredentialsProvider.lookupStores(r.jenkins).iterator().next().addCredentials(Domain.global(), firstCreds); SecretBuildWrapper wrapper = new SecretBuildWrapper(Collections.singletonList(new StringBinding("PASS_1", firstCredentialsId))); FreeStyleProject f = r.createFreeStyleProject(); f.setConcurrentBuild(true); f.getBuildersList().add(new Shell("echo $PASS_1")); f.getBuildWrappersList().add(wrapper); r.configRoundtrip((Item)f); FreeStyleBuild b = r.buildAndAssertSuccess(f); r.assertLogNotContains(firstPassword, b); r.assertLogContains("echo ****", b); }
Source:
<code>public String getName(ItemType itemType) { if (FMLLoader.getDist().isClient()) { final Item item = RegistryManager.ACTIVE.getRegistry(Item.class) .getValue(ResourceLocation.tryCreate(itemType.getId())); <START> if (item == null) { <END> return super.getName(itemType); } return I18n.format(item.getTranslationKey()); } return super.getName(itemType); }</code><technical_language>swap branches here, drop repeated return</technical_language>

Target:
public String getName(ItemType itemType) { if (FMLLoader.getDist().isClient()) { final Item item = RegistryManager.ACTIVE.getRegistry(Item.class) .getValue(ResourceLocation.tryCreate(itemType.getId())); if (item != null) { return I18n.format(item.getTranslationKey()); } } return super.getName(itemType); }
Source:
<code>private void buildVmData() { builder.buildVmProperties(); builder.buildVmVideoCards(); builder.buildVmCD(); builder.buildVmFloppy(); builder.buildVmDrives(); builder.buildVmNetworkInterfaces(); builder.buildVmNetworkCluster(); builder.buildVmBootSequence(); builder.buildVmBootOptions(); builder.buildVmSoundDevices(); builder.buildVmConsoleDevice(); builder.buildVmTimeZone(); builder.buildVmUsbDevices(); builder.buildVmMemoryBalloon(); builder.buildVmWatchdog(); builder.buildVmVirtioScsi(); builder.buildVmRngDevice(); builder.buildUnmanagedDevices(); builder.buildVmSerialNumber(); <START> builder.buildVmNumaProperties(getParameters().getVdsId()); <END> }</code><technical_language>please buildVmNumaProperties a void method access vdsId fron</technical_language>

Target:
private void buildVmData() { builder.buildVmProperties(); builder.buildVmVideoCards(); builder.buildVmCD(); builder.buildVmFloppy(); builder.buildVmDrives(); builder.buildVmNetworkInterfaces(); builder.buildVmNetworkCluster(); builder.buildVmBootSequence(); builder.buildVmBootOptions(); builder.buildVmSoundDevices(); builder.buildVmConsoleDevice(); builder.buildVmTimeZone(); builder.buildVmUsbDevices(); builder.buildVmMemoryBalloon(); builder.buildVmWatchdog(); builder.buildVmVirtioScsi(); builder.buildVmRngDevice(); builder.buildUnmanagedDevices(); builder.buildVmSerialNumber(); builder.buildVmNumaProperties(); }
Source:
<code>private void updateDiskVmSnapshotId() { <START> if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { <END> Guid snapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); DiskImage diskImage = ((DiskImage) disk); getImageDao().updateImageVmSnapshotId(diskImage.getImageId(), snapshotId); diskImage.setvm_snapshot_id(snapshotId); } }</code><technical_language>is this if statement function checking snapshots allowed is not? basically if of type IMAGE snapshots allowed get (looks 'if' is redundant AllowSnapshot report correctly). In addition, personally I dislike a function code 'if' statement. name reflect this (it updates if ...)</technical_language>

Target:
private void updateDiskVmSnapshotId() { Guid snapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = ((DiskImage) disk); getImageDao().updateImageVmSnapshotId(diskImage.getImageId(), snapshotId); diskImage.setvm_snapshot_id(snapshotId); } else { throw new VdcBLLException(VdcBllErrors.StorageException, "update of snapshot id was initiated for unsupported disk type"); } }
Source:
<code>public void setAsCopy(byte[] data, int offset) { clear(); int count = Marshal.getInt(data, offset); offset += HEADER_SIZE; for (int i = 0; i < count; i++) { byte activeFields = data[offset]; offset++; long uuid = Marshal.getLong(data, offset); <START> ReadHeadInfo curInfo = new ReadHeadInfo(uuid, null, null); <END> offset += ReadHeadInfo.ITEM_SIZE; if ((activeFields & READHEADINFO_FIELDS.THIS_READSEQUENCE) != 0) { curInfo.getThisReadSequence().setAsCopy(data, offset); offset += curInfo.getThisReadSequence().getLength(); } if ((activeFields & READHEADINFO_FIELDS.MATE_READSEQUENCE) != 0) { curInfo.getMateReadSequence().setAsCopy(data, offset); offset += curInfo.getMateReadSequence().getLength(); } add(curInfo); } }</code><technical_language>this block belongs in a new constructor ReadHeadInfo(byte[] data, int offset). Set's responsibility marshal members</technical_language>

Target:
public int setAsCopy(byte[] data, int offset) { clear(); int count = Marshal.getInt(data, offset); offset += HEADER_SIZE; for (int i = 0; i < count; i++) { ReadHeadInfo curInfo = new ReadHeadInfo(data, offset); offset += curInfo.getLengthInBytes(); add(curInfo); } return offset; }
Source:
<code>private PhoenixSequence resolveSequence(String name) { try { SequenceManager manager = new SequenceManager((PhoenixStatement)pc.createStatement()); <START> manager.newSequenceReference(pc.getTenantId(), TableName.createNormalized(schemaName, name) , null, SequenceValueParseNode.Op.NEXT_VALUE); <END> manager.validateSequences(Sequence.ValueOp.VALIDATE_SEQUENCE); } catch (SQLException e){ return null; } return new PhoenixSequence(schemaName, name, pc); }</code><technical_language>@JamesRTaylor a method is called right parameters? is a chance (and a need) avoid creating a new "Statement" time</technical_language>

Target:
private PhoenixSequence resolveSequence(String name) { try { SequenceManager manager = new SequenceManager(statement); manager.newSequenceReference(pc.getTenantId(), TableName.createNormalized(schemaName, name) , null, SequenceValueParseNode.Op.NEXT_VALUE); manager.validateSequences(Sequence.ValueOp.VALIDATE_SEQUENCE); } catch (SQLException e){ return null; } return new PhoenixSequence(schemaName, name, pc); }
Source:
<code>private void AES_CCM_Decrypt(AlgorithmID alg, byte[] rgbKey) throws CoseException, IllegalStateException { if (rgbKey.length != alg.getKeySize() / 8) { throw new CoseException("Key Size is incorrect"); } final int ivLen = getAES_CCM_IVSize(alg); CBORObject iv = findAttribute(HeaderKeys.IV); if (iv == null) { throw new CoseException("Missing IV during decryption"); } if (iv.getType() != CBORType.ByteString) { throw new CoseException("IV is incorrectly formed"); } if (iv.GetByteString().length != ivLen) { throw new CoseException("IV size is incorrect"); } try { rgbContent = CCMBlockCipher.decrypt(rgbKey, iv.GetByteString(), getExternal(), getEncryptedContent(), 0); } catch (NoSuchAlgorithmException ex) { throw new CoseException("Algorithm not supported", ex); } catch (InvalidKeyException ex) { <START> if (ex.getMessage() == "Illegal key size") { <END> throw new CoseException("Unsupported key size", ex); } throw new CoseException("Decryption failure", ex); } catch (Exception ex) { ex.printStackTrace(); throw new CoseException("Decryption failure", ex); } }</code><technical_language>== please change equals()</technical_language>

Target:
private void AES_CCM_Decrypt(AlgorithmID alg, byte[] rgbKey) throws CoseException, IllegalStateException { if (rgbKey.length != alg.getKeySize() / 8) { throw new CoseException("Key Size is incorrect"); } final int ivLen = getAES_CCM_IVSize(alg); CBORObject iv = findAttribute(HeaderKeys.IV); if (iv == null) { throw new CoseException("Missing IV during decryption"); } if (iv.getType() != CBORType.ByteString) { throw new CoseException("IV is incorrectly formed"); } if (iv.GetByteString().length != ivLen) { throw new CoseException("IV size is incorrect"); } try { rgbContent = CCMBlockCipher.decrypt(rgbKey, iv.GetByteString(), getExternal(), getEncryptedContent(), 0); } catch (NoSuchAlgorithmException ex) { throw new CoseException("Algorithm not supported", ex); } catch (InvalidKeyException ex) { if (ex.getMessage().equals("Illegal key size")) { throw new CoseException("Unsupported key size", ex); } throw new CoseException("Decryption failure", ex); } catch (Exception ex) { ex.printStackTrace(); throw new CoseException("Decryption failure", ex); } }
Source:
<code>public Iterable<AccountGroup> all() { <START> final List<AccountGroup> groups = new LinkedList<AccountGroup>(); <END> for (final AccountGroup.NameKey groupName : list.get(ListKey.ALL)) { final AccountGroup group = get(groupName); if (group != null) { groups.add(group); } } return Collections.unmodifiableList(groups); }</code><technical_language>If list.get(ListKey.ALL) returns a reasonable upper bounds for size, I ArrayList faster</technical_language>

Target:
public Iterable<AccountGroup> all() { final List<AccountGroup> groups = new ArrayList<AccountGroup>(); for (final AccountGroup.NameKey groupName : list.get(ListKey.ALL)) { final AccountGroup group = get(groupName); if (group != null) { groups.add(group); } } return Collections.unmodifiableList(groups); }
Source:
<code>public void prepareForNextRead(int positionCount, int[] positions) throws IOException { lengthIndex = 0; outputPositionCount = 0; int totalPositions = positions[positionCount - 1] + 1; <START> int nullValues = 0; <END> if (presentStream != null) { isNullVector = new boolean[totalPositions]; nullValues = presentStream.getUnsetBits(totalPositions, isNullVector); } lengthVector = new int[totalPositions - nullValues]; if (isNullVector == null) { lengthStream.nextIntVector(totalPositions, lengthVector, 0); totalLength = Arrays.stream(lengthVector).sum(); } else { int lengths = 0; for (int i = 0; i < totalPositions; i++) { if (!isNullVector[i]) { int currentLength = toIntExact(lengthStream.next()); lengthVector[lengths++] = currentLength; totalLength += currentLength; } } } data = new byte[totalLength]; slice = Slices.wrappedBuffer(data); }</code><technical_language>nullValues -> nullCount</technical_language>

Target:
private void prepareForNextRead(int positionCount, int[] positions) throws IOException { lengthIndex = 0; outputPositionCount = 0; int totalLength = 0; int maxLength = 0; int totalPositions = positions[positionCount - 1] + 1; int nullCount = 0; if (presentStream != null) { isNullVector = ensureCapacity(isNullVector, totalPositions); nullCount = presentStream.getUnsetBits(totalPositions, isNullVector); } if (lengthStream != null) { int nonNullCount = totalPositions - nullCount; lengthVector = ensureCapacity(lengthVector, nonNullCount); lengthStream.nextIntVector(nonNullCount, lengthVector, 0); for (int i = 0; i < nonNullCount; i++) { totalLength += lengthVector[i]; maxLength = Math.max(maxLength, lengthVector[i]); } if (totalLength > ONE_GIGABYTE) { throw new PrestoException( GENERIC_INTERNAL_ERROR, format("Values in column \"%s\" are too large to process for Presto. %s column values are larger than 1GB [%s]", streamDescriptor.getFieldName(), positionCount, streamDescriptor.getOrcDataSourceId())); } } if (outputRequired) { if (presentStream != null && nullsAllowed) { nulls = ensureCapacity(nulls, positionCount); } data = ensureCapacity(data, totalLength); offsets = ensureCapacity(offsets, totalPositions + 1); } else { data = ensureCapacity(data, maxLength); } dataAsSlice = Slices.wrappedBuffer(data); }
Source:
<code>public void dump(ReadBuffer readBuffer, PrintStream out, int depth) { <START> out.print(" type: "); out.print(getClass().getSimpleName()); <END> out.print(" name: "); out.print(name()); out.print(" decoded: ["); out.print(decode(readBuffer)); out.print("]"); }</code><technical_language>wanted append here</technical_language>

Target:
public void dump(ReadBuffer readBuffer, PrintStream out, int depth) { out.append(" type: ").append(getClass().getSimpleName()); out.append(" name: ").append(name()); T decoded = decode(readBuffer); out.append(" decoded: [").append(decoded == null ? null : decoded.toString()).append("]"); }
Source:
<code>public PropertyPathNotification extract(MultiValueMap<String, String> headers, Map<String, Object> request) { <START> if ("Push Hook".equals(headers.getFirst("x-git-oschina-event"))) { <END> if (request.get("commits") instanceof Collection && ((Collection<Map<String, Object>>) request.get("commits")).size() > 0) { return new PropertyPathNotification("application.yml"); } } return null; }</code><technical_language>spacing i some of strings good private static final vars</technical_language>

Target:
public PropertyPathNotification extract(MultiValueMap<String, String> headers, Map<String, Object> request) { if (HEADERS_VALUE.equals(headers.getFirst(HEADERS_KEY))) { if (request.get("commits") instanceof Collection && ((Collection<Map<String, Object>>) request.get("commits")).size() > 0) { return new PropertyPathNotification("application.yml"); } } return null; }
Source:
<code>private void prepareData() throws IOException { Cipher cipher = null; try { cipher = (Cipher)ReflectionUtils.newInstance( ReflectionUtils.getClassByName(jceCipherClass), props, transformation); } catch (ClassNotFoundException cnfe) { throw new IOException("Illegal crypto cipher!"); <START> } <END> ByteArrayOutputStream baos = new ByteArrayOutputStream(); OutputStream out = new CryptoOutputStream(baos, cipher, defaultBufferSize, key, iv); out.write(data); out.flush(); out.close(); encData = baos.toByteArray(); try { testDataFilepath = Files.createTempFile("encData", ".tmp"); SeekableByteChannel sbc = Files.newByteChannel(testDataFilepath, StandardOpenOption.APPEND); ByteBuffer bfSrc = ByteBuffer.wrap(encData); sbc.write(bfSrc); sbc.close(); } catch (IOException ioe) { LOG.error("Error when prepare file with encryption data.", ioe); } }</code><technical_language>Hint: private Cipher getCipher(String cipherClass) throws IOException in this class</technical_language>

Target:
private void prepareData() throws IOException { Cipher cipher = null; try { cipher = (Cipher)ReflectionUtils.newInstance( ReflectionUtils.getClassByName(jceCipherClass), props, transformation); } catch (ClassNotFoundException cnfe) { throw new IOException("Illegal crypto cipher!"); } ByteArrayOutputStream baos = new ByteArrayOutputStream(); OutputStream out = new CryptoOutputStream(baos, cipher, bufferSize, key, iv); out.write(testData); out.flush(); out.close(); encData = baos.toByteArray(); }
Source:
<code>public Object getProperty(Object object, QName name) throws Exception { <START> if ("geometryMember".equals(name.getLocalPart())) { <END> GeometryCollection multiGeometry = (GeometryCollection) object; Geometry[] members = new Geometry[multiGeometry.getNumGeometries()]; for (int i = 0; i < members.length; i++) { members[i] = (Geometry) multiGeometry.getGeometryN(i); } GML3EncodingUtils.setChildIDs(multiGeometry); return members; } return null; }</code><technical_language>Bare string "geometryMember"? GML.geometryMember.getLocalPart().equals(name.getLocalPart())? Is this change work for GML 3.1 3.2</technical_language>

Target:
public Object getProperty(Object object, QName name) throws Exception { if (GML.geometryMember.getLocalPart().equals(name.getLocalPart())) { GeometryCollection multiGeometry = (GeometryCollection) object; Geometry[] members = new Geometry[multiGeometry.getNumGeometries()]; for (int i = 0; i < members.length; i++) { members[i] = (Geometry) multiGeometry.getGeometryN(i); } GML3EncodingUtils.setChildIDs(multiGeometry); return members; } return null; }
Source:
<code><START> public static String getDefaultLintVersion(Project project) { <END> Optional<ResolvedArtifact> lintArtifact = project.getBuildscript() .getConfigurations() .getByName("classpath") .getResolvedConfiguration() .getResolvedArtifacts() .stream() .filter(LintUtil::findLint) .findFirst(); return lintArtifact.map(r -> r.getModuleVersion().getId().getVersion()).orElse(null); }</code><technical_language>@Nullable</technical_language>

Target:
public static String getDefaultLintVersion(Project project) { return project.getBuildscript() .getConfigurations() .getByName("classpath") .getResolvedConfiguration() .getResolvedArtifacts() .parallelStream() .filter(LintUtil::findLint) .findFirst() .map(r -> r.getModuleVersion().getId().getVersion()) .orElse(null); }
Source:
<code>public SchemaRepository<JsonSchema> provide() { <START> jsonSchemaFactory = JsonSchemaFactory.byDefault(); <END> return new SchemaRepository<>(schemaSourceProvider, Executors.newFixedThreadPool(2), source -> { try { return jsonSchemaFactory.getJsonSchema(objectMapper.readTree(source.value())); } catch (IOException | ProcessingException e) { throw new RuntimeException(e); } }); }</code><technical_language>create JsonSchemaFactory in constructor set variable final</technical_language>

Target:
public SchemaRepository<JsonSchema> provide() { return new SchemaRepository<>(configFactory, schemaSourceProvider, createSchemaReloadExecutorService(configFactory, "json"), source -> { try { return jsonSchemaFactory.getJsonSchema(objectMapper.readTree(source.value())); } catch (IOException | ProcessingException e) { throw new JsonSchemaCompilationFailed(e); } }); }
Source:
<code>public NodePresentation getPresentation(boolean update) { if (nodePresentation == null) { nodePresentation = new NodePresentation(); <START> updatePresentation(nodePresentation); <END> } if (update) { updatePresentation(nodePresentation); } return nodePresentation; }</code><technical_language>do updatePresentation(nodePresentation) nodePresentation == null update is true. Is OK</technical_language>

Target:
public NodePresentation getPresentation(boolean update) { if (nodePresentation == null) { nodePresentation = new NodePresentation(); updatePresentation(nodePresentation); return nodePresentation; } if (update) { updatePresentation(nodePresentation); } return nodePresentation; }
Source:
<code>private void maybeBackFillToNewStore() { if (!config.backFillAccountsToNewZNode) { return; } logger.trace("starting backfilling the new state to new store"); <START> if (backFillStore.updateAccounts( accountInfoMapRef.get().getAccounts())) { <END> logger.trace("Finish backfilling the new state to new store"); } else { logger.error("Fail to backfill the new state to new store, just skip this one"); } }</code><technical_language>format: extra space</technical_language>

Target:
private void maybeBackFillToNewStore() { if (!config.backFillAccountsToNewZNode) { return; } logger.info("Starting backfilling the new state to new store"); if (backFillStore.updateAccounts(accountInfoMapRef.get().getAccounts())) { logger.info("Finish backfilling the new state to new store"); } else { logger.error("Fail to backfill the new state to new store, just skip this one"); } }
Source:
<code>private static Pair<Integer, Integer> getRoughDimensImposedByContainer(int originalHeight, int originalWidth, int boundingHeight, int boundingWidth) { if (originalHeight < boundingHeight || originalWidth < boundingWidth) { return new Pair<>(originalWidth, originalHeight); } double heightScaleDownFactor = (double)boundingHeight / originalHeight; double widthScaleDownFactor = (double)boundingWidth / originalWidth; <START> double dominantScaleDownFactor = Math.min(widthScaleDownFactor, heightScaleDownFactor); <END> int widthImposedByContainer = (int)Math.round(originalWidth * dominantScaleDownFactor); int heightImposedByContainer = (int)Math.round(originalHeight * dominantScaleDownFactor); return new Pair<>(widthImposedByContainer, heightImposedByContainer); }</code><technical_language>Thanks for part of this work. if realted Android 10 work, nice separate this out in another PR easy revert in case of edge cases</technical_language>

Target:
private static Pair<Integer, Integer> getRoughDimensImposedByContainer(int originalHeight, int originalWidth, int boundingHeight, int boundingWidth) { if (originalHeight < boundingHeight || originalWidth < boundingWidth) { return new Pair<>(originalWidth, originalHeight); } double heightScaleDownFactor = (double)boundingHeight / originalHeight; double widthScaleDownFactor = (double)boundingWidth / originalWidth; double dominantScaleDownFactor = Math.max(widthScaleDownFactor, heightScaleDownFactor); int widthImposedByContainer = (int)Math.round(originalWidth * dominantScaleDownFactor); int heightImposedByContainer = (int)Math.round(originalHeight * dominantScaleDownFactor); return new Pair<>(widthImposedByContainer, heightImposedByContainer); }
Source:
<code>public void testVacuumDoesNotBreakStuff() throws Exception { Connection connection = spliceClassWatcher.getOrCreateConnection(); long[] conglomerateNumber = SpliceAdmin.getConglomNumbers(connection, CLASS_NAME, TABLE); String conglomerateString = Long.toString(conglomerateNumber[0]); try(PreparedStatement ps = methodWatcher.prepareStatement(String.format("drop table %s.%s", CLASS_NAME, TABLE))){ ps.execute(); } try(HBaseAdmin admin=new HBaseAdmin(new Configuration())){ Set<String> beforeTables=getConglomerateSet(admin.listTables()); try(CallableStatement callableStatement=methodRule.prepareCall("call SYSCS_UTIL.VACUUM()")){ callableStatement.execute(); } Set<String> afterTables=getConglomerateSet(admin.listTables()); Assert.assertTrue(beforeTables.contains(conglomerateString)); Assert.assertFalse(afterTables.contains(conglomerateString)); Set<String> deletedTables=getDeletedTables(beforeTables,afterTables); for(String t : deletedTables){ long conglom=new Long(t); <START> Assert.assertTrue(BasicDatabase.isSystemConglomerate(conglom)); <END> } } }</code><technical_language>do negation here</technical_language>

Target:
public void testVacuumDoesNotBreakStuff() throws Exception { Connection connection = spliceClassWatcher.getOrCreateConnection(); long[] conglomerateNumber = SpliceAdmin.getConglomNumbers(connection, CLASS_NAME, TABLE); String conglomerateString = Long.toString(conglomerateNumber[0]); try(PreparedStatement ps = methodWatcher.prepareStatement(String.format("drop table %s.%s", CLASS_NAME, TABLE))){ ps.execute(); } try(HBaseAdmin admin=new HBaseAdmin(new Configuration())){ Set<String> beforeTables=getConglomerateSet(admin.listTables()); try(CallableStatement callableStatement=methodRule.prepareCall("call SYSCS_UTIL.VACUUM()")){ callableStatement.execute(); } Set<String> afterTables=getConglomerateSet(admin.listTables()); Assert.assertTrue(beforeTables.contains(conglomerateString)); Assert.assertFalse(afterTables.contains(conglomerateString)); Set<String> deletedTables=getDeletedTables(beforeTables,afterTables); Set<String> systemConglomerates = getSystemConglomerateSet(); for(String t : deletedTables){ long conglom=new Long(t); Assert.assertTrue(!systemConglomerates.contains(conglom)); } } }
Source:
<code>public int visit(IASTExpression expression) { if (!ctorDtorStack.empty() && ctorDtorStack.peek()) { if (expression instanceof IASTFunctionCallExpression) { IASTFunctionCallExpression fCall = (IASTFunctionCallExpression) expression; IASTExpression fNameExp = fCall.getFunctionNameExpression(); IBinding fBinding = null; IASTNode problemNode = expression; boolean isQualified = false; if (fNameExp instanceof IASTIdExpression) { IASTIdExpression fName = (IASTIdExpression) fNameExp; isQualified = fName.getName() instanceof ICPPASTQualifiedName; fBinding = fName.getName().resolveBinding(); } else if (fNameExp instanceof IASTFieldReference) { IASTFieldReference fName = (IASTFieldReference) fNameExp; <START> problemNode = fName.getFieldName(); <END> if (referencesThis(fName.getFieldOwner())) fBinding = fName.getFieldName().resolveBinding(); } if (fBinding instanceof ICPPMethod) { ICPPMethod method = (ICPPMethod) fBinding; if (method.isPureVirtual() || (!isQualified && ClassTypeHelper.isVirtual(method))) { reportProblem(VIRTUAL_CALL_ID, problemNode); } } } } return PROCESS_CONTINUE; }</code><technical_language>A field reference qualified: a->B::C. often, valid</technical_language>

Target:
public int visit(IASTExpression expression) { if (!ctorDtorStack.empty() && ctorDtorStack.peek()) { if (expression instanceof IASTFunctionCallExpression) { IASTFunctionCallExpression fCall = (IASTFunctionCallExpression) expression; IASTExpression fNameExp = fCall.getFunctionNameExpression(); IBinding fBinding = null; IASTNode problemNode = expression; boolean isQualified = false; if (fNameExp instanceof IASTIdExpression) { IASTIdExpression fName = (IASTIdExpression) fNameExp; isQualified = fName.getName() instanceof ICPPASTQualifiedName; fBinding = fName.getName().resolveBinding(); } else if (fNameExp instanceof IASTFieldReference) { IASTFieldReference fName = (IASTFieldReference) fNameExp; problemNode = fName.getFieldName(); if (referencesThis(fName.getFieldOwner())) { isQualified = fName.getFieldName() instanceof ICPPASTQualifiedName; fBinding = fName.getFieldName().resolveBinding(); } } if (fBinding instanceof ICPPMethod) { ICPPMethod method = (ICPPMethod) fBinding; if (method.isPureVirtual() || (!isQualified && ClassTypeHelper.isVirtual(method))) { reportProblem(VIRTUAL_CALL_ID, problemNode); } } } } return PROCESS_CONTINUE; }
Source:
<code>public boolean normalize(List<Artifact> pluginArtifacts, File file, File packFile, boolean fork) throws IOException { JarFile jarFile = new JarFile(file); try { EclipseInf eclipseInf = EclipseInf.readEclipseInf(jarFile); assertSupportedEclipseInf(eclipseInf); if (eclipseInf == null || (eclipseInf.shouldPack() && !eclipseInf.isPackNormalized())) { if (isSigned(jarFile)) { throw new IOException("pack200:normalize cannot be called for signed jar " + file); } log.info("Pack200 normalizing jar " + file.getAbsolutePath()); File tmpFile = null; if (eclipseInf != null) { eclipseInf.setPackNormalized(); tmpFile = File.createTempFile(file.getName(), ".prepack"); updateEclipseInf(jarFile, eclipseInf, tmpFile); } try { getPackWrapper(fork).pack(pluginArtifacts, tmpFile != null ? tmpFile : file, packFile); } finally { if (tmpFile != null) { if (!tmpFile.delete()) { throw new IOException("Could not delete temporary file " + tmpFile.getAbsolutePath()); } } } return true; } } finally { try { <START> jarFile.close(); <END> } catch (IOException e) { } } return false; }</code><technical_language>I this is a good idea. I veguely remember running some weird problems jvm JarFile cache in past. if this fix problem, try-with-resource code cleaner, a good change</technical_language>

Target:
public boolean normalize(List<Artifact> pluginArtifacts, File file, File packFile, boolean fork) throws IOException { File jarToBePacked = file; boolean shouldNormalize = false; boolean jarToBePackedIsTempFile = false; try (JarFile jarFile = new JarFile(file)) { EclipseInf eclipseInf = EclipseInf.readEclipseInf(jarFile); assertSupportedEclipseInf(eclipseInf); if (eclipseInf == null || (eclipseInf.shouldPack() && !eclipseInf.isPackNormalized())) { if (isSigned(jarFile)) { throw new IOException("pack200:normalize cannot be called for signed jar " + file); } shouldNormalize = true; if (eclipseInf != null) { eclipseInf.setPackNormalized(); jarToBePacked = File.createTempFile(file.getName(), ".prepack"); jarToBePackedIsTempFile = true; updateEclipseInf(jarFile, eclipseInf, jarToBePacked); } } } if (shouldNormalize) { try { log.info("Pack200 normalizing jar " + file.getAbsolutePath()); getPackWrapper(fork).pack(pluginArtifacts, jarToBePacked, packFile); } finally { if (jarToBePackedIsTempFile) { if (!jarToBePacked.delete()) { throw new IOException("Could not delete temporary file " + jarToBePacked.getAbsolutePath()); } } } return true; } return false; }
Source:
<code>public void sampleConfiguration() { String property = System.getProperty("java.version"); <START> System.out.println(property); <END> ConfigurableApplicationContext context = new AnnotationConfigApplicationContext( EnableRabbitSampleConfig.class, SampleBean.class); testSampleConfiguration(context); }</code><technical_language>I is overhead. I a good testing there. recheck test tasks IO merge</technical_language>

Target:
public void sampleConfiguration() { ConfigurableApplicationContext context = new AnnotationConfigApplicationContext( EnableRabbitSampleConfig.class, SampleBean.class); testSampleConfiguration(context); }
Source:
<code>private void addRTSPProperties(RTPSession rtpSession, HashMap<String, Object> hashMapInstance, String entryId){ HashMap<String,Object> RTSPropertiesHash = new HashMap<String,Object>(); String RTSPUrl, encoder,IP, sessionId; IP = rtpSession.getIp(); sessionId = rtpSession.getSessionId(); RTSPUrl = rtpSession.getUri() + rtpSession.getQueryStr(); double timeRunningSeconds = rtpSession.getTimeRunningSeconds(); RTSPropertiesHash.put("IP", IP); <START> RTSPropertiesHash.put("sessionId", sessionId); <END> RTSPropertiesHash.put("RTSPUrl", RTSPUrl); RTSPropertiesHash.put("timeRunningSeconds" , timeRunningSeconds); hashMapInstance.put("RTPSProperties", RTSPropertiesHash); }</code><technical_language>rename sessionId id clientId id transparent</technical_language>

Target:
private void addRTSPProperties(RTPSession rtpSession, HashMap<String, Object> hashMapInstance, String entryId){ HashMap<String,Object> propertiesHash = new HashMap<String,Object>(); String RTSPUrl, encoder,IP, sessionId; IP = rtpSession.getIp(); sessionId = rtpSession.getSessionId(); RTSPUrl = rtpSession.getUri() + rtpSession.getQueryStr(); WMSProperties clientProps = rtpSession.getProperties(); encoder = clientProps.getPropertyStr(Constants.CLIENT_PROPERTY_ENCODER); double timeRunningSeconds = rtpSession.getTimeRunningSeconds(); propertiesHash.put("timeRunningSeconds" , timeRunningSeconds); propertiesHash.put("ConnectionUrl", RTSPUrl); propertiesHash.put("encoder" , encoder); propertiesHash.put("IP", IP); propertiesHash.put("Id", sessionId); hashMapInstance.put("Properties", propertiesHash); }
Source:
<code>private void setHeartRateMeasurementValue(int heartRateMeasurementValue, int expendedEnergy) { Log.d(TAG, Arrays.toString(mHeartRateMeasurementCharacteristic.getValue())); <START> mHeartRateMeasurementCharacteristic.setValue(new byte[]{1 << 3, 0, 0, 0}); <END> mHeartRateMeasurementCharacteristic.setValue(heartRateMeasurementValue, BluetoothGattCharacteristic.FORMAT_UINT8, 1); mEditTextHeartRateMeasurement.setText(Integer.toString(heartRateMeasurementValue)); mHeartRateMeasurementCharacteristic.setValue(expendedEnergy, BluetoothGattCharacteristic.FORMAT_UINT16, 2); mEditTextEnergyExpended.setText(Integer.toString(expendedEnergy)); }</code><technical_language>0b01000 work here</technical_language>

Target:
private void setHeartRateMeasurementValue(int heartRateMeasurementValue, int expendedEnergy) { Log.d(TAG, Arrays.toString(mHeartRateMeasurementCharacteristic.getValue())); mHeartRateMeasurementCharacteristic.setValue(new byte[]{0b00001000, 0, 0, 0}); mHeartRateMeasurementCharacteristic.setValue(heartRateMeasurementValue, HEART_RATE_MEASUREMENT_VALUE_FORMAT, 1); mEditTextHeartRateMeasurement.setText(Integer.toString(heartRateMeasurementValue)); mHeartRateMeasurementCharacteristic.setValue(expendedEnergy, EXPENDED_ENERGY_FORMAT, 2); mEditTextEnergyExpended.setText(Integer.toString(expendedEnergy)); }
Source:
<code>public boolean validate() { if <START> (backingFile == <END> null) { getInvalidityReasons().add(constants.uploadImageFileNotExist()); return false; } if (backingFile) { getInvalidityReasons().add(constants.uploadImageBackingFileUnsupported()); return false; } return true; }</code><technical_language>This is qcow header context, needs checked for validating a file chosen</technical_language>

Target:
public boolean validate() { if (!Boolean.TRUE.equals(fileLoaded)) { getInvalidityReasons().add(constants.uploadImageFileNotExist()); return false; } if (backingFile) { getInvalidityReasons().add(constants.uploadImageBackingFileUnsupported()); return false; } return true; }