auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Contact getConvReceiver(String name){ String first; String last = ""; String phoneNumber = null; String secondPhone = null; Scanner scanner = new Scanner(name); first = scanner.next(); if(scanner.hasNext()){ last = scanner.next(); } for(int i = 0; i < Global.contactAList.size(); i++){ <START> if(Global.contactAList.get(i).getFirstName().equals(first) && Global.contactAList.get(i).getLastName().equals(last)){ <END> phoneNumber = Global.contactAList.get(i).getPhoneNumber(); if(!Global.contactAList.get(i).getSecondPhone().equals(null)){ secondPhone = Global.contactAList.get(i).getSecondPhone(); } break; } } Contact receiver = new Contact(first, last,phoneNumber,secondPhone); scanner.close(); return receiver; }</code><technical_language>set variables. Right String is left null, string is left "" this comparison work</technical_language>

Target:
public static Contact getConvReceiver(String name){ String first = ""; String last = ""; String phoneNumber = null; String secondPhone = null; Scanner scanner = new Scanner(name); first = scanner.next(); if(scanner.hasNext()){ last = scanner.next(); } for(int i = 0; i < Global.contactAList.size(); i++){ if(Global.contactAList.get(i).getFirstName().equalsIgnoreCase(first) && Global.contactAList.get(i).getLastName().equalsIgnoreCase(last)){ phoneNumber = Global.contactAList.get(i).getPhoneNumber(); if(Global.contactAList.get(i).getSecondPhone() != null){ secondPhone = Global.contactAList.get(i).getSecondPhone(); } break; } } Contact receiver = new Contact(first, last,phoneNumber,secondPhone); scanner.close(); return receiver; }
Source:
<code>private RaptorSplit( String connectorId, Set<UUID> shardUuids, Map<UUID, UUID> shardDeltaMap, boolean tableSupportsDeltaDelete, OptionalInt bucketNumber, List<HostAddress> addresses, TupleDomain<RaptorColumnHandle> effectivePredicate, OptionalLong transactionId, Optional<Map<String, Type>> columnTypes) { this.connectorId = requireNonNull(connectorId, "connectorId is null"); this.shardUuids = ImmutableSet.copyOf(requireNonNull(shardUuids, "shardUuid is null")); this.shardDeltaMap = requireNonNull(shardDeltaMap, "shardUuid is null"); <START> this.tableSupportsDeltaDelete = requireNonNull(tableSupportsDeltaDelete, "tableSupportsDeltaDelete is null"); <END> this.bucketNumber = requireNonNull(bucketNumber, "bucketNumber is null"); this.addresses = ImmutableList.copyOf(requireNonNull(addresses, "addresses is null")); this.effectivePredicate = requireNonNull(effectivePredicate, "effectivePredicate is null"); this.transactionId = requireNonNull(transactionId, "transactionId is null"); this.columnTypes = requireNonNull(columnTypes, "columnTypes is null"); }</code><technical_language>requireNonNull is redundant</technical_language>

Target:
private RaptorSplit( String connectorId, Set<UUID> shardUuids, Map<UUID, UUID> shardDeltaMap, boolean tableSupportsDeltaDelete, OptionalInt bucketNumber, List<HostAddress> addresses, TupleDomain<RaptorColumnHandle> effectivePredicate, OptionalLong transactionId, Optional<Map<String, Type>> columnTypes) { this.connectorId = requireNonNull(connectorId, "connectorId is null"); this.shardUuids = ImmutableSet.copyOf(requireNonNull(shardUuids, "shardUuid is null")); this.shardDeltaMap = requireNonNull(shardDeltaMap, "shardUuid is null"); this.tableSupportsDeltaDelete = tableSupportsDeltaDelete; this.bucketNumber = requireNonNull(bucketNumber, "bucketNumber is null"); this.addresses = ImmutableList.copyOf(requireNonNull(addresses, "addresses is null")); this.effectivePredicate = requireNonNull(effectivePredicate, "effectivePredicate is null"); this.transactionId = requireNonNull(transactionId, "transactionId is null"); this.columnTypes = requireNonNull(columnTypes, "columnTypes is null"); }
Source:
<code><START> public PrivateKey parsePrivateKey(final String key) throws IOException { <END> try (final PemReader pemReader = new PemReader(new StringReader(key));) { final PemObject pemObject = pemReader.readPemObject(); final byte[] content = pemObject.getContent(); final PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(content); final KeyFactory factory = KeyFactory.getInstance("RSA", "BC"); return factory.generatePrivate(privKeySpec); } catch (NoSuchAlgorithmException | NoSuchProviderException e) { throw new IOException("No encryption provider available.", e); } catch (final InvalidKeySpecException e) { throw new IOException("Invalid Key format.", e); } }</code><technical_language>Please consider adding a Precondition.checkArgument check key is blank</technical_language>

Target:
public PrivateKey parsePrivateKey(final String key) throws IOException { Preconditions.checkArgument(!Strings.isNullOrEmpty(key)); try (final PemReader pemReader = new PemReader(new StringReader(key));) { final PemObject pemObject = pemReader.readPemObject(); final byte[] content = pemObject.getContent(); final PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(content); final KeyFactory factory = KeyFactory.getInstance("RSA", "BC"); return factory.generatePrivate(privKeySpec); } catch (NoSuchAlgorithmException | NoSuchProviderException e) { throw new IOException("No encryption provider available.", e); } catch (final InvalidKeySpecException e) { throw new IOException("Invalid Key format.", e); } }
Source:
<code>private IPluginModelBase getBestCandidate(IPluginModelBase[] models) { IPluginModelBase result = null; <START> for (final IPluginModelBase model : models) { <END> if (model.getBundleDescription() == null) continue; if (result == null) { result = model; continue; } if (!result.isEnabled() && model.isEnabled()) { result = model; continue; } final BundleDescription current = result.getBundleDescription(); final BundleDescription candidate = model.getBundleDescription(); if (!current.isResolved() && candidate.isResolved()) { result = model; continue; } if (current.getVersion().compareTo(candidate.getVersion()) < 0) { result = model; } } return result; }</code><technical_language>I suggest dropping "final". is required I personally dislike this style. Unnecessary code avoided</technical_language>

Target:
private IPluginModelBase getBestCandidate(IPluginModelBase[] models) { IPluginModelBase result = null; for (IPluginModelBase model : models) { if (model.getBundleDescription() == null) continue; if (result == null) { result = model; continue; } if (!result.isEnabled() && model.isEnabled()) { result = model; continue; } BundleDescription current = result.getBundleDescription(); BundleDescription candidate = model.getBundleDescription(); if (!current.isResolved() && candidate.isResolved()) { result = model; continue; } if (current.getVersion().compareTo(candidate.getVersion()) < 0) { result = model; } } return result; }
Source:
<code><START> public CepSink build() { <END> return new CepSink(cepSinkType, actionConfigurations); }</code><technical_language>missed this one. Please change private also</technical_language>

Target:
private CepSink build() { return new CepSink(cepSinkType, actionConfigurations); }
Source:
<code>public int hashCode() { <START> return Objects.hash(filter, leftBlocksSize, sortChannel); <END> }</code><technical_language>reorder hashing if follow order in equals. This helps verifying agree. if order of fields, change this _now_, safe side</technical_language>

Target:
public int hashCode() { return Objects.hash(leftBlocksSize, filter); }
Source:
<code>public static void main(String[] args) { try { boolean udp = true; boolean tcp = false; if (0 < args.length) { <START> tcp = args[0].equalsIgnoreCase("coap+tcp:"); <END> } HelloWorldServer server = new HelloWorldServer(); server.addEndpoints(udp, tcp); server.start(); } catch (SocketException e) { System.err.println("Failed to initialize server: " + e.getMessage()); } }</code><technical_language>do want include : in arg? arg named enable-tcp</technical_language>

Target:
public static void main(String[] args) { try { boolean udp = true; boolean tcp = false; if (0 < args.length) { tcp = args[0].equalsIgnoreCase("coap+tcp:"); if (tcp) { System.out.println("Please Note: the TCP support is currently experimental!"); } } HelloWorldServer server = new HelloWorldServer(); server.addEndpoints(udp, tcp); server.start(); } catch (SocketException e) { System.err.println("Failed to initialize server: " + e.getMessage()); } }
Source:
<code>public boolean put(long ledgerId, long entryId, ByteBuf entry) { int size = entry.readableBytes(); int alignedSize = align64(size); long offset; int localOffset; int segmentIdx; while (true) { offset = cacheSize.getAndAdd(alignedSize); <START> localOffset = (int) (offset & SegmentOffsetMask); <END> segmentIdx = (int) (offset / MaxSegmentSize); if ((offset + size) > maxCacheSize) { return false; } else if (MaxSegmentSize - localOffset < size) { continue; } else { break; } } cacheSegments[segmentIdx].setBytes(localOffset, entry, entry.readerIndex(), entry.readableBytes()); while (true) { long currentLastEntryId = lastEntryMap.get(ledgerId); if (currentLastEntryId > entryId) { break; } if (lastEntryMap.compareAndSet(ledgerId, currentLastEntryId, entryId)) { break; } } index.put(ledgerId, entryId, offset, size); cacheCount.increment(); return true; }</code><technical_language>mixture of & / a bit weird here. & requires SegmentOffsetMask a power of 2, 1. This case, segment index a bitwise shift, a division</technical_language>

Target:
public boolean put(long ledgerId, long entryId, ByteBuf entry) { int size = entry.readableBytes(); int alignedSize = align64(size); long offset; int localOffset; int segmentIdx; while (true) { offset = cacheOffset.getAndAdd(alignedSize); localOffset = (int) (offset & segmentOffsetMask); segmentIdx = (int) (offset >>> segmentOffsetBits); if ((offset + size) > maxCacheSize) { return false; } else if (maxSegmentSize - localOffset < size) { continue; } else { break; } } cacheSegments[segmentIdx].setBytes(localOffset, entry, entry.readerIndex(), entry.readableBytes()); while (true) { long currentLastEntryId = lastEntryMap.get(ledgerId); if (currentLastEntryId > entryId) { break; } if (lastEntryMap.compareAndSet(ledgerId, currentLastEntryId, entryId)) { break; } } index.put(ledgerId, entryId, offset, size); cacheCount.increment(); cacheSize.addAndGet(size); return true; }
Source:
<code>public abstract <T extends Password> boolean exists(String key, Class<T> passwordClass) throws StorageException, UnsupportedPasswordClassException; <START> public abstract <T extends Password> void store(String key, Class<T> passwordClass, Password password) throws StorageException, UnsupportedPasswordClassException; <END> public abstract <T extends Password> T retrieve(String key, Class<T> passwordClass) throws StorageException, UnsupportedPasswordClassException; public abstract <T extends Password> void remove(String key, Class<T> passwordClass) throws StorageException, UnsupportedPasswordClassException; public abstract void initialize(Map<String, String> attributes) throws StorageException; public boolean isInitialized() { return initialized; }</code><technical_language>argument of type T Password I think</technical_language>

Target:
public abstract <T extends Password> boolean exists(String key, Class<T> passwordClass) throws StorageException, UnsupportedPasswordClassException; public abstract <T extends Password> void store(String key, Class<T> passwordClass, T password) throws StorageException, UnsupportedPasswordClassException; public abstract <T extends Password> T retrieve(String key, Class<T> passwordClass) throws StorageException, UnsupportedPasswordClassException; public abstract <T extends Password> void remove(String key, Class<T> passwordClass) throws StorageException, UnsupportedPasswordClassException; public abstract void initialize(Map<String, String> attributes) throws StorageException; public boolean isInitialized() { return initialized; }
Source:
<code>public void testThreeRegionSplit() throws IOException { Admin admin = getConnection().getAdmin(); TableName tableName = TableName.valueOf("TestTableWithThreeSplits"); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); byte[] startKey = Bytes.toBytes("AAA"); byte[] endKey = Bytes.toBytes("ZZZ"); try { <START> if (admin.tableExists(tableName)) { <END> LOG.warn("Not creating the table since it exists: %s", tableName); } else { admin.createTable(descriptor, startKey, endKey, 3); List<HRegionLocation> regions = null; try (RegionLocator locator = getConnection().getRegionLocator(tableName)) { regions = locator.getAllRegionLocations(); } Assert.assertEquals(3, regions.size()); for (int i = 0; i < regions.size(); i++) { HRegionLocation region = regions.get(i); String start_key = Bytes.toString( region.getRegionInfo().getStartKey()); String end_key = Bytes.toString(region.getRegionInfo().getEndKey()); if (i == 0) { Assert.assertEquals(Bytes.toString(startKey), end_key); } else if (i == 1) { Assert.assertEquals(Bytes.toString(startKey), start_key); Assert.assertEquals(Bytes.toString(endKey), end_key); } else { Assert.assertEquals(Bytes.toString(endKey), start_key); } } } } finally { try { admin.disableTable(tableName); admin.deleteTable(tableName); } catch (Throwable t) { LOG.warn("Error cleaning up the table", t); } } }</code><technical_language>add UUID.randomUUID().toString(), remove this check</technical_language>

Target:
public void testThreeRegionSplit() throws IOException { Admin admin = getConnection().getAdmin(); TableName tableName = TableName.valueOf("TestTable" + UUID.randomUUID().toString()); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); byte[] startKey = Bytes.toBytes("AAA"); byte[] endKey = Bytes.toBytes("ZZZ"); try { admin.createTable(descriptor, startKey, endKey, 3); List<HRegionLocation> regions = null; try (RegionLocator locator = getConnection().getRegionLocator(tableName)) { regions = locator.getAllRegionLocations(); } Assert.assertEquals(3, regions.size()); for (int i = 0; i < regions.size(); i++) { HRegionLocation region = regions.get(i); String start_key = Bytes.toString( region.getRegionInfo().getStartKey()); String end_key = Bytes.toString(region.getRegionInfo().getEndKey()); if (i == 0) { Assert.assertEquals(Bytes.toString(startKey), end_key); } else if (i == 1) { Assert.assertEquals(Bytes.toString(startKey), start_key); Assert.assertEquals(Bytes.toString(endKey), end_key); } else { Assert.assertEquals(Bytes.toString(endKey), start_key); } } } finally { try { admin.disableTable(tableName); admin.deleteTable(tableName); } catch (Throwable t) { LOG.warn("Error cleaning up the table", t); } } }
Source:
<code>public static void updateCheckoutAddressAndEmail(Checkout checkout, MaskedWallet maskedWallet) { if (checkout == null) { throw new NullPointerException("checkout cannot be null"); } if (maskedWallet == null) { throw new NullPointerException("maskedWallet cannot be null"); } Address shippingAddress = AndroidPayHelper.createShopifyAddress(maskedWallet.getBuyerShippingAddress()); <START> Address billingAddress = AndroidPayHelper.createShopifyAddress(maskedWallet.getBuyerBillingAddress()); <END> if (!shippingAddress.locationsAreEqual(checkout.getShippingAddress())) { checkout.setShippingRate(null); } checkout.setShippingAddress(shippingAddress); checkout.setBillingAddress(billingAddress); checkout.setEmail(maskedWallet.getEmail()); }</code><technical_language>I guess need AndroidPayHelper. prefix</technical_language>

Target:
public static void updateCheckoutAddressAndEmail(Checkout checkout, MaskedWallet maskedWallet) { if (checkout == null) { throw new NullPointerException("checkout cannot be null"); } if (maskedWallet == null) { throw new NullPointerException("maskedWallet cannot be null"); } Address shippingAddress = createShopifyAddress(maskedWallet.getBuyerShippingAddress()); Address billingAddress = createShopifyAddress(maskedWallet.getBuyerBillingAddress()); if (!shippingAddress.locationsAreEqual(checkout.getShippingAddress())) { checkout.setShippingRate(null); } checkout.setShippingAddress(shippingAddress); checkout.setBillingAddress(billingAddress); checkout.setEmail(maskedWallet.getEmail()); }
Source:
<code>public void shouldNotValidateEmailAddress_withInvalidEmailAddresses() { final List<String> invalidEmails = new ArrayList<String>(); invalidEmails.add("Abc.example.com"); invalidEmails.add("A@b@c@example.com"); invalidEmails.add("a\"b(c)d,e:f;g<h>i[j\\k]l@example.com"); invalidEmails.add("just\"not\"right@example.com"); invalidEmails.add("this is\"not\\allowed@example.com"); invalidEmails.add("this\\ still\\\"not\\allowed@example.com"); invalidEmails.add("john.doe@example..com"); <START> final List<String> wrongValidatedEmails = new ArrayList<>(); <END> for (final String email : invalidEmails) { try { Check.isValidEmail(field, email); wrongValidatedEmails.add(email); } catch (final ValidationException e) { } } if (!wrongValidatedEmails.isEmpty()) { fail("Expected to invalidate the following email addresses, but were actually validated: " + wrongValidatedEmails); } }</code><technical_language>Rename this variable validatedEmails</technical_language>

Target:
public void shouldNotValidateEmailAddress_withInvalidEmailAddresses() { final List<String> invalidEmails = new ArrayList<String>(); invalidEmails.add("Abc.example.com"); invalidEmails.add("A@b@c@example.com"); invalidEmails.add("a\"b(c)d,e:f;g<h>i[j\\k]l@example.com"); invalidEmails.add("just\"not\"right@example.com"); invalidEmails.add("this is\"not\\allowed@example.com"); invalidEmails.add("this\\ still\\\"not\\allowed@example.com"); invalidEmails.add("john.doe@example..com"); final List<String> validatedEmails = new ArrayList<>(); for (final String email : invalidEmails) { try { Check.isValidEmail(field, email); validatedEmails.add(email); } catch (final ValidationException e) { } } if (!validatedEmails.isEmpty()) { fail("Expected to invalidate the following email addresses, but were actually validated: " + validatedEmails); } }
Source:
<code>public int hashCode() { int result = config.hashCode(); result = 31 * result + totalAmount.hashCode(); result = 31 * result + count.hashCode(); result = 31 * result + max.hashCode(); result = 31 * result + min.hashCode(); <START> result = 31 * result + monitors.hashCode(); <END> return result; }</code><technical_language>monitors list added hash code here, for BasicTimer. I change result in this case, reason consistent for both</technical_language>

Target:
public int hashCode() { int result = config.hashCode(); result = 31 * result + totalAmount.hashCode(); result = 31 * result + count.hashCode(); result = 31 * result + max.hashCode(); result = 31 * result + min.hashCode(); return result; }
Source:
<code>public String toString() { StringJoiner joiner = new StringJoiner(", ", "Worldpay authorisation response (", ")"); if (StringUtils.isNotBlank(getTransactionId())) { joiner.add("orderCode: " + getTransactionId()); } if (StringUtils.isNotBlank(getLastEvent())) { joiner.add("lastEvent: " + getLastEvent()); } if (StringUtils.isNotBlank(getRefusedReturnCode())) { joiner.add("ISO8583ReturnCode code: " + getRefusedReturnCode()); } if (StringUtils.isNotBlank(getRefusedReturnCodeDescription())) { joiner.add("ISO8583ReturnCode description: " + getRefusedReturnCodeDescription()); } if (StringUtils.isNotBlank(issuerUrl)) { joiner.add("issuerURL: " + issuerUrl); } if (StringUtils.isNotBlank(challengeAcsUrl)) { joiner.add("threeDSChallengeDetails acsUrl: " + challengeAcsUrl); } if (StringUtils.isNotBlank(challengeTransactionId)) { joiner.add("threeDSChallengeDetails transactionId3DS: " + challengeTransactionId); } if (StringUtils.isNotBlank(challengePayload)) { <START> joiner.add("threeDSChallengeDetails payload: " + challengePayload); <END> } if (StringUtils.isNotBlank(threeDsVersion)) { joiner.add("threeDSChallengeDetails threeDSVersion: " + threeDsVersion); } if (StringUtils.isNotBlank(getErrorCode())) { joiner.add("error code: " + getErrorCode()); } if (StringUtils.isNotBlank(getErrorMessage())) { joiner.add("error: " + getErrorMessage()); } return joiner.toString(); }</code><technical_language>Actually, payload is a long base64-encoded string is pretty opaque worth including logging etc. remove this please</technical_language>

Target:
public String toString() { StringJoiner joiner = new StringJoiner(", ", "Worldpay authorisation response (", ")"); if (StringUtils.isNotBlank(getTransactionId())) { joiner.add("orderCode: " + getTransactionId()); } if (StringUtils.isNotBlank(getLastEvent())) { joiner.add("lastEvent: " + getLastEvent()); } if (StringUtils.isNotBlank(getRefusedReturnCode())) { joiner.add("ISO8583ReturnCode code: " + getRefusedReturnCode()); } if (StringUtils.isNotBlank(getRefusedReturnCodeDescription())) { joiner.add("ISO8583ReturnCode description: " + getRefusedReturnCodeDescription()); } if (StringUtils.isNotBlank(issuerUrl)) { joiner.add("issuerURL: " + issuerUrl); } if (StringUtils.isNotBlank(challengeAcsUrl)) { joiner.add("threeDSChallengeDetails acsUrl: " + challengeAcsUrl); } if (StringUtils.isNotBlank(challengeTransactionId)) { joiner.add("threeDSChallengeDetails transactionId3DS: " + challengeTransactionId); } if (StringUtils.isNotBlank(threeDsVersion)) { joiner.add("threeDSChallengeDetails threeDSVersion: " + threeDsVersion); } if (StringUtils.isNotBlank(getErrorCode())) { joiner.add("error code: " + getErrorCode()); } if (StringUtils.isNotBlank(getErrorMessage())) { joiner.add("error: " + getErrorMessage()); } return joiner.toString(); }
Source:
<code>public void refresh() { <START> if (parent != null) parent.refresh(); <END> }</code><technical_language>Format</technical_language>

Target:
public void refresh() { if (parent != null) { parent.refresh(); } }
Source:
<code>public void handle(Request request, Response response) throws Exception { userSession.checkLoggedIn(); String projectKey = request.mandatoryParam(PARAM_PROJECT); String newBranchName = request.mandatoryParam(PARAM_NAME); try (DbSession dbSession = dbClient.openSession(false)) { ComponentDto project = componentFinder.getRootComponentByUuidOrKey(dbSession, null, projectKey); checkPermission(project); <START> Optional<BranchDto> branch = dbClient.branchDao().selectByKey(dbSession, project.uuid(), newBranchName); <END> if (branch.isPresent() && !branch.get().isMain()) { throw new IllegalArgumentException("Impossible to update branch name: a branch with name \"" + newBranchName + "\" already exists in the project."); } dbClient.branchDao().updateMainBranchName(dbSession, project.uuid(), newBranchName); dbSession.commit(); response.noContent(); } }</code><technical_language>filter + ifPresent</technical_language>

Target:
public void handle(Request request, Response response) throws Exception { userSession.checkLoggedIn(); String projectKey = request.mandatoryParam(PARAM_PROJECT); String newBranchName = request.mandatoryParam(PARAM_NAME); try (DbSession dbSession = dbClient.openSession(false)) { ComponentDto project = componentFinder.getRootComponentByUuidOrKey(dbSession, null, projectKey); checkPermission(project); Optional<BranchDto> existingBranch = dbClient.branchDao().selectByKey(dbSession, project.uuid(), newBranchName); checkArgument(!existingBranch.filter(b -> !b.isMain()).isPresent(), "Impossible to update branch name: a branch with name \"%s\" already exists in the project.", newBranchName); dbClient.branchDao().updateMainBranchName(dbSession, project.uuid(), newBranchName); dbSession.commit(); response.noContent(); } }
Source:
<code>@Test public void testInvalidUri() { try { <START> new DeepLinkAnnotatedElement("http", element, DeepLinkEntry.Type.CLASS, null); <END> fail(); } catch (MalformedURLException ignored) { } }</code><technical_language>add another constructor DeepLinkAnnotatedElement argument dont need pass dont need</technical_language>

Target:
@Test public void testInvalidUri() { try { new DeepLinkAnnotatedElement("http", element, DeepLinkEntry.Type.CLASS); fail(); } catch (MalformedURLException ignored) { } }
Source:
<code>protected void executeQueryCommand() { <START> if (FeatureSupported.isLlldpInformationSupported(getVds().getClusterCompatibilityVersion())) { <END> VDSReturnValue command = runVdsCommand(VDSCommandType.GetLldp, lldpVDSCommandParameters); getQueryReturnValue().setReturnValue(command.getReturnValue()); } }</code><technical_language>I move compatibility version check validation inputs section</technical_language>

Target:
protected void executeQueryCommand() { if (FeatureSupported.isLlldpInformationSupported(getHost().getClusterCompatibilityVersion())) { VDSReturnValue command = runVdsCommand(VDSCommandType.GetLldp, lldpVDSCommandParameters); getQueryReturnValue().setReturnValue(command.getReturnValue()); } }
Source:
<code>public ErrorCode getCode() { <START> return SUBSCRIPTION_ALREADY_EXISTS; <END> }</code><technical_language>SUBSCRIPTION_CONSTRAINTS_ALREADY_EXIST</technical_language>

Target:
public ErrorCode getCode() { return SUBSCRIPTION_CONSTRAINTS_ALREADY_EXIST; }
Source:
<code>protected boolean hasContent(DocumentModel document, String query) throws IOException { try (SessionWrapper wrapper = ctx.getSession(document)) { DocumentModelList children = wrapper.getSession() <START> .query(String.format(query, NXQL.escapeString(document.getId())), 1); <END> return !children.isEmpty(); } }</code><technical_language>a session.queryProjection avoid fetching a doc + prefetch</technical_language>

Target:
protected boolean hasContent(DocumentModel document, String query) throws IOException { try (SessionWrapper wrapper = ctx.getSession(document)) { return wrapper.getSession() .queryProjection(String.format(query, NXQL.escapeString(document.getId())), 1, 0) .size() > 0; } }
Source:
<code><START> public static String resourceIdFromLockId(String lockId) { <END> String[] lockIdParts = lockIdParts(lockId); if (lockIdParts.length == 0) { return null; } StringBuilder resourceId = new StringBuilder(); for (int i = 0; i < lockIdParts.length - 4; i++) { if (!lockIdParts[i].isEmpty()) { resourceId.append("/").append(lockIdParts[i]); } } return resourceId.toString(); }</code><technical_language>need public? package private do</technical_language>

Target:
static String resourceIdFromLockId(String lockId) { String[] lockIdParts = lockIdParts(lockId); if (CoreUtils.isNullOrEmpty(lockIdParts)) { return null; } StringBuilder resourceId = new StringBuilder(); for (int i = 0; i < lockIdParts.length - 4; i++) { if (!lockIdParts[i].isEmpty()) { resourceId.append("/").append(lockIdParts[i]); } } return resourceId.toString(); }
Source:
<code>public static RegisteredObservers load(CuratorFramework curator) throws Exception { ObserverStore ov1 = new ObserverStoreV1(); ObserverStore ov2 = new ObserverStoreV2(); RegisteredObservers co = ov1.load(curator); if (co == null) { co = ov2.load(curator); } if (co == null) { co = new RegisteredObservers() { @Override public Observers getObservers(Environment env) { return new Observers() { @Override public void close() { } @Override public void returnObserver(Observer o) { throw new UnsupportedOperationException(); } @Override public Observer getObserver(Column col) { throw new UnsupportedOperationException(); } @Override public String getObserverId(Column col) { throw new UnsupportedOperationException(); } }; } @Override public ImmutableSet<Column> getObservedColumns(NotificationType nt) { return ImmutableSet.of(); } <START> }; <END> } return co; }</code><technical_language>I Collections.emptySet() is immutable, this change is necessary. making change hurt anything</technical_language>

Target:
public static RegisteredObservers load(CuratorFramework curator) throws Exception { ObserverStore ov1 = new ObserverStoreV1(); ObserverStore ov2 = new ObserverStoreV2(); RegisteredObservers co = ov1.load(curator); if (co == null) { co = ov2.load(curator); } if (co == null) { co = new RegisteredObservers() { @Override public Observers getObservers(Environment env) { return new Observers() { @Override public void close() { } @Override public void returnObserver(Observer o) { throw new UnsupportedOperationException(); } @Override public Observer getObserver(Column col) { throw new UnsupportedOperationException(); } @Override public String getObserverId(Column col) { throw new UnsupportedOperationException(); } }; } @Override public Set<Column> getObservedColumns(NotificationType nt) { return Collections.emptySet(); } }; } return co; }
Source:
<code>public void VisualEditorEditing_005_switchToSourceMode() { String articleName2 = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp(); VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName2); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve = ve.typeInSourceEditor(text); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve.clickPublishButton(); ve.waitForPageLoad(); ArticlePageObject article = new ArticlePageObject(); article.openVEModeWithMainEditButton(); ve.typeInSourceEditor(text); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); saveDialog.savePage(); article.verifyVEPublishComplete(); article.verifyContent("Lorem ipsum dolor sit amet, consectetur adipiscing elit."); <START> <END> }</code><technical_language>line :)</technical_language>

Target:
public void VisualEditorEditing_005_switchToSourceMode() { String articleName2 = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp(); VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName2); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve = ve.typeInSourceEditor(text); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve.clickPublishButton(); ve.waitForPageLoad(); ArticlePageObject article = new ArticlePageObject(); article.openVEModeWithMainEditButton(); ve.typeInSourceEditor(text); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); saveDialog.savePage(); article.verifyVEPublishComplete(); article.verifyContent(text); }
Source:
<code>public Table getTable(String tableId) { <START> GetTableRequest request = GetTableRequest.newBuilder() <END> .setName(instanceName.toTableNameStr(tableId)) .build(); return Table.fromProto(adminClient.getTable(request)); }</code><technical_language>avoid confusion, I good fully qualified names for raw proto types while short names for gcj models (or vice versa)</technical_language>

Target:
public Table getTable(String tableId) { GetTableRequest requestProto = GetTableRequest.newBuilder() .setName(instanceName.toTableNameStr(tableId)) .build(); return Table.fromProto(adminClient.getTable(requestProto)); }
Source:
<code>public synchronized HashSet<Guid> getDomainProblematicVdsList(Guid domainId) { HashSet<Guid> vdsList = new HashSet<>(); Map<Guid, Status> domainVdsStatus = domainsVisibility.get(domainId); for (Entry<Guid, Status> status : domainVdsStatus.entrySet()) { <START> if (status.getValue().isProblematic()) <END> vdsList.add(status.getKey()); } return vdsList; }</code><technical_language>please surround block {}</technical_language>

Target:
public synchronized HashSet<Guid> getDomainProblematicVdsList(Guid domainId) { HashSet<Guid> vdsList = new HashSet<>(); Map<Guid, Status> domainVdsStatus = domainsVisibility.get(domainId); for (Entry<Guid, Status> status : domainVdsStatus.entrySet()) { if (status.getValue().isProblematic()) { vdsList.add(status.getKey()); } } return vdsList; }
Source:
<code>public static String getLabelFromId(String directoryName, String id) { if (id == null) { return ""; } <START> try (Session directory = DirectoryHelper.getDirectoryService().open(directoryName)) { <END> DocumentModel documentModel = directory.getEntry(id); String schemaName = documentModel.getSchemas()[0]; return (String) documentModel.getProperty(schemaName, "label"); } catch (PropertyException e) { return ""; } }</code><technical_language>Call Framework.getService(DirectoryService.class) directly, need for helper</technical_language>

Target:
public static String getLabelFromId(String directoryName, String id) { if (id == null) { return ""; } try (Session directory = Framework.getService(DirectoryService.class).open(directoryName)) { DocumentModel documentModel = directory.getEntry(id); String schemaName = documentModel.getSchemas()[0]; return (String) documentModel.getProperty(schemaName, "label"); } catch (PropertyException e) { return ""; } }
Source:
<code>private URI createSubReport(final BufferedImage originalImage, final File tempTaskDirectory) throws IOException, JRException { assert (this.maxWidth != null); double scaleFactor = getScaleFactor(); BufferedImage image = originalImage; if (image.getWidth() * scaleFactor > this.maxWidth) { image = cropToMaxWidth(image, scaleFactor); } URI imageFile = writeToFile(image, tempTaskDirectory); <START> final MapSubReport subReport = new MapSubReport( <END> Lists.newArrayList(imageFile), new Dimension((int) (image.getWidth() * scaleFactor), (int) (image.getHeight() * scaleFactor)), this.dpi); final File compiledReport = File.createTempFile("legend-report-", JasperReportBuilder.JASPER_REPORT_COMPILED_FILE_EXT, tempTaskDirectory); subReport.compile(compiledReport); return compiledReport.toURI(); }</code><technical_language>If MapSubReport for maps renamed</technical_language>

Target:
private URI createSubReport(final BufferedImage originalImage, final File tempTaskDirectory) throws IOException, JRException { assert (this.maxWidth != null); double scaleFactor = getScaleFactor(); BufferedImage image = originalImage; if (image.getWidth() * scaleFactor > this.maxWidth) { image = cropToMaxWidth(image, scaleFactor); } URI imageFile = writeToFile(image, tempTaskDirectory); final ImagesSubReport subReport = new ImagesSubReport( Lists.newArrayList(imageFile), new Dimension((int) (image.getWidth() * scaleFactor), (int) (image.getHeight() * scaleFactor)), this.dpi); final File compiledReport = File.createTempFile("legend-report-", JasperReportBuilder.JASPER_REPORT_COMPILED_FILE_EXT, tempTaskDirectory); subReport.compile(compiledReport); return compiledReport.toURI(); }
Source:
<code>private ListenableFuture<Void> startAsyncUpload(HashCode hash, Chunker chunker) { try { chunker.reset(); } catch (IOException e) { return Futures.immediateFailedFuture(e); } <START> UUID uploadId = UUID.randomUUID(); <END> String resourceName = newResourceName(instanceName, uploadId, hash, chunker.getSize()); AsyncUpload newUpload = new AsyncUpload(channel, callCredentials, callTimeoutSecs, retrier, resourceName, chunker); ListenableFuture<Void> currUpload = newUpload.start(); currUpload.addListener( () -> { if (currUpload.isCancelled()) { newUpload.cancel(); } }, MoreExecutors.directExecutor()); return currUpload; }</code><technical_language>move this newResourceName</technical_language>

Target:
private ListenableFuture<Void> startAsyncUpload(HashCode hash, Chunker chunker) { try { chunker.reset(); } catch (IOException e) { return Futures.immediateFailedFuture(e); } UUID uploadId = UUID.randomUUID(); String resourceName = uploadResourceName(instanceName, uploadId, hash, chunker.getSize()); AsyncUpload newUpload = new AsyncUpload(channel, callCredentials, callTimeoutSecs, retrier, resourceName, chunker); ListenableFuture<Void> currUpload = newUpload.start(); currUpload.addListener( () -> { if (currUpload.isCancelled()) { newUpload.cancel(); } }, MoreExecutors.directExecutor()); return currUpload; }
Source:
<code>public void visitToken(DetailAST ast) { final DetailAST slistToken = ast.findFirstToken(TokenTypes.SLIST); final DetailAST leftCurly; if (slistToken == null) { leftCurly = ast.findFirstToken(TokenTypes.LCURLY); } else { leftCurly = slistToken; } if (leftCurly != null) { if (option == BlockOption.STMT) { final boolean emptyBlock; if (leftCurly.getType() == TokenTypes.LCURLY) { emptyBlock = leftCurly.getNextSibling().getType() != TokenTypes.CASE_GROUP; } else { emptyBlock = leftCurly.getChildCount() <= 1; } if (emptyBlock) { log(leftCurly.getLineNo(), leftCurly.getColumnNo(), MSG_KEY_BLOCK_NO_STMT, ast.getText()); } } else if (!hasText(leftCurly)) { log(leftCurly.getLineNo(), leftCurly.getColumnNo(), MSG_KEY_BLOCK_EMPTY, ast.getText()); } } if (ast.getType() == TokenTypes.LITERAL_CASE) { checkForEmptyCase(ast); <START> } <END> }</code><technical_language>do do separate processing ? logic close if (emptyBlock) {. Please explain refactor</technical_language>

Target:
public void visitToken(DetailAST ast) { final DetailAST leftCurly = findLeftCurly(ast); if (leftCurly != null) { if (option == BlockOption.STMT) { final boolean emptyBlock; if (leftCurly.getType() == TokenTypes.LCURLY) { emptyBlock = leftCurly.getNextSibling().getType() != TokenTypes.CASE_GROUP; } else { emptyBlock = leftCurly.getChildCount() <= 1; } if (emptyBlock) { log(leftCurly.getLineNo(), leftCurly.getColumnNo(), MSG_KEY_BLOCK_NO_STMT, ast.getText()); } } else if (!hasText(leftCurly)) { log(leftCurly.getLineNo(), leftCurly.getColumnNo(), MSG_KEY_BLOCK_EMPTY, ast.getText()); } } }
Source:
<code>public AbstractApexRule() { super.setLanguage(LanguageRegistry.getLanguage(ApexLanguageModule.NAME)); definePropertyDescriptor(CODECLIMATE_CATEGORIES); definePropertyDescriptor(CODECLIMATE_REMEDIATION_MULTIPLIER); definePropertyDescriptor(CODECLIMATE_BLOCK_HIGHLIGHTING); <START> definePropertyDescriptor(new IntegerProperty("codacy_minutes_to_fix", "Codacy.com Time to fix in minutes", Integer.MIN_VALUE, Integer.MAX_VALUE, 5, 1.0f)); <END> }</code><technical_language>Property descriptors static final constants programmatically, needing retrieved name, access typed property value. PropertySource interface net.sourceforge.pmd.lang.apex.rule.complexity.AvoidDeeplyNestedIfStmtsRule example</technical_language>

Target:
public AbstractApexRule() { super.setLanguage(LanguageRegistry.getLanguage(ApexLanguageModule.NAME)); definePropertyDescriptor(CODECLIMATE_CATEGORIES); definePropertyDescriptor(CODECLIMATE_REMEDIATION_MULTIPLIER); definePropertyDescriptor(CODECLIMATE_BLOCK_HIGHLIGHTING); definePropertyDescriptor(CODACY_MINUTES_TO_FIX); }
Source:
<code>public static void writeTo(MimeMessage message, OutputStream headerOs, OutputStream bodyOs, String[] ignoreList) throws IOException, MessagingException { <START> MimeMessage testMessage = message; <END> if (testMessage instanceof MimeMessageWrapper) { MimeMessageWrapper wrapper = (MimeMessageWrapper) testMessage; if (!wrapper.isModified()) { wrapper.writeTo(headerOs, bodyOs, ignoreList); return; } } writeToInternal(message, headerOs, bodyOs, ignoreList); }</code><technical_language>this variable is longer necessary, message directlyon line 78 80 (because of return) previously is special casing for MimeMessageWrapper useful</technical_language>

Target:
public static void writeTo(MimeMessage message, OutputStream headerOs, OutputStream bodyOs, String[] ignoreList) throws IOException, MessagingException { if (message instanceof MimeMessageWrapper) { MimeMessageWrapper wrapper = (MimeMessageWrapper) message; if (!wrapper.isModified()) { wrapper.writeTo(headerOs, bodyOs, ignoreList); return; } } writeToInternal(message, headerOs, bodyOs, ignoreList); }
Source:
<code>private void validateApiKey(String value) { if (value == null || !value.matches(API_KEY_REGEX)) { if (value == null) { <START> value = ""; <END> } DebugLogger.INSTANCE.w(String.format("Invalid configuration. apiKey should be a " + "32-character hexademical string, got %s", value)); } }</code><technical_language>null empty API key throw</technical_language>

Target:
private void validateApiKey(String value) { if (Intrinsics.isEmpty(value)) { throw new IllegalArgumentException("No Bugsnag API Key set"); } if (!value.matches(API_KEY_REGEX)) { DebugLogger.INSTANCE.w(String.format("Invalid configuration. apiKey should be a " + "32-character hexademical string, got \"%s\"", value)); } }
Source:
<code>void verifyTimeDurationComputation() { final Instant banExpiry = CURRENT_TIME.plus(10, ChronoUnit.MINUTES); final String result = PlayerIsMutedMessage.muteDurationRemainingToString.apply( Clock.fixed(CURRENT_TIME, ZoneOffset.UTC), banExpiry); <START> assertThat(result, is("10 minutes")); <END> }</code><technical_language>If for some reason this test longer a minute execute run a failure</technical_language>

Target:
void verifyTimeDurationComputation() { final Instant banExpiry = CURRENT_TIME.plus(10, ChronoUnit.MINUTES); final String result = formattingFunction.apply(banExpiry); assertThat(result, is("10 minutes")); }
Source:
<code>public Managed<BigtableConnection> connection( final AsyncFramework async, final ExecutorService executorService ) { <START> Optional<Integer> batchSize = empty(); <END> return async.managed(new ManagedSetup<BigtableConnection>() { @Override public AsyncFuture<BigtableConnection> construct() throws Exception { return async.call( new BigtableConnectionBuilder(project, cluster, credentials, async, executorService, DEFAULT_DISABLE_BULK_MUTATIONS, DEFAULT_FLUSH_INTERVAL_SECONDS, batchSize)); } @Override public AsyncFuture<Void> destruct(final BigtableConnection value) throws Exception { return async.call(new Callable<Void>() { @Override public Void call() throws Exception { value.close(); return null; } }); } }); }</code><technical_language>Inline this variable, declare a default constant follow local convention</technical_language>

Target:
public Managed<BigtableConnection> connection( final AsyncFramework async, final ExecutorService executorService ) { return async.managed(new ManagedSetup<BigtableConnection>() { @Override public AsyncFuture<BigtableConnection> construct() throws Exception { return async.call( new BigtableConnectionBuilder(project, cluster, credentials, async, executorService, DEFAULT_DISABLE_BULK_MUTATIONS, DEFAULT_FLUSH_INTERVAL_SECONDS, Optional.empty())); } @Override public AsyncFuture<Void> destruct(final BigtableConnection value) throws Exception { return async.call(new Callable<Void>() { @Override public Void call() throws Exception { value.close(); return null; } }); } }); }
Source:
<code>protected void readValue(BlockBuilder blockBuilder, Type type) { if (definitionLevel == columnDescriptor.getMaxDefinitionLevel()) { Binary binary = valuesReader.readBytes(); Slice value; if (binary.length() == 0) { value = EMPTY_SLICE; } else { value = wrappedBuffer(binary.getBytes()); } if (isVarcharType(type)) { value = truncateToLength(value, type); } if (isCharType(type)) { value = truncateToLengthAndTrimSpaces(value, type); } type.writeSlice(blockBuilder, value); } else if (valueIsNull()) { blockBuilder.appendNull(); <START> } <END> }</code><technical_language>this change solve? abut cases valueIsNull() == false (the else part)</technical_language>

Target:
protected void readValue(BlockBuilder blockBuilder, Type type) { if (definitionLevel == columnDescriptor.getMaxDefinitionLevel()) { Binary binary = valuesReader.readBytes(); Slice value; if (binary.length() == 0) { value = EMPTY_SLICE; } else { value = wrappedBuffer(binary.getBytes()); } if (isVarcharType(type)) { value = truncateToLength(value, type); } if (isCharType(type)) { value = truncateToLengthAndTrimSpaces(value, type); } type.writeSlice(blockBuilder, value); } else if (isValueNull()) { blockBuilder.appendNull(); } }
Source:
<code><START> protected RexInputRef input(RelDataType type, int arg) { <END> return rexBuilder.makeInputRef(type, arg); }</code><technical_language>change this item(...) happy? I guess other around. item(...) adjusted support RexNode argument</technical_language>

Target:
protected RexNode input(RelDataType type, int arg) { return rexBuilder.makeInputRef(type, arg); }
Source:
<code>public TreeItem(MetricDto metricDto) { MetricNameDto metricName = metricDto.getMetricName(); this.key = getTestItemId(metricDto.getMetricName().getTest()) + metricDto.getMetricName().getMetricName(); put(NAME, metricName.getMetricDisplayName()); put(TEST_DESCRIPTION, metricName.getTest().getDescription()); put(TEST_NAME, getItemKey(metricName)); for (MetricValueDto metricValue : metricDto.getValues()) { put(SESSION_HEADER + metricValue.getSessionId(), metricValue.getValueRepresentation()); if (metricValue.getDecision() != null) { <START> put(DECISION + SESSION_HEADER + metricValue.getSessionId(), metricValue.getDecision().toString()); <END> } } }</code><technical_language>Propose expand getValueRepresentation method of MetricValueDto. I define presented. number - 232.33 colored number <p style="...">232.33</p></technical_language>

Target:
public TreeItem(MetricDto metricDto) { MetricNameDto metricName = metricDto.getMetricName(); this.key = getTestItemId(metricDto.getMetricName().getTest()) + metricDto.getMetricName().getMetricName(); put(NAME, metricName.getMetricDisplayName()); put(TEST_DESCRIPTION, metricName.getTest().getDescription()); put(TEST_NAME, getItemKey(metricName)); for (MetricValueDto metricValue : metricDto.getValues()) { String value = metricValue.getValueRepresentation(); if (metricValue.getDecision() != null) { String toolTip = "Decision for metric during test run. Green - value in limits. Yellow - value crossed warning limits. Red - value outside limits"; switch (metricValue.getDecision()) { case OK: value = "<p title=\"" + toolTip + "\" style=\"color:green;font-weight:700;display:inline;\">" + value + "</p>"; break; case WARNING: value = "<p title=\"" + toolTip + "\" style=\"color:#B8860B;font-weight:700;display:inline;\">" + value + "</p>"; break; default: value = "<p title=\"" + toolTip + "\" style=\"color:red;font-weight:700;display:inline;\">" + value + "</p>"; break; } } put(SESSION_HEADER + metricValue.getSessionId(),value); } }
Source:
<code>void drainLoop() { int missed = 1; JoinInnerSubscriber<T>[] s = this.subscribers; int n = s.length; Subscriber<? super T> a = this.downstream; for (;;) { long r = requested.get(); long e = 0; middle: while (e != r) { if (cancelled) { cleanup(); return; } Throwable ex = errors.get(); if (ex != null) { cleanup(); a.onError(ex); return; } boolean d = done.get() == 0; boolean empty = true; <START> for (JoinInnerSubscriber<T> inner : s) { <END> SimplePlainQueue<T> q = inner.queue; if (q != null) { T v = q.poll(); if (v != null) { empty = false; a.onNext(v); inner.requestOne(); if (++e == r) { break middle; } } } } if (d && empty) { a.onComplete(); return; } if (empty) { break; } } if (e == r) { if (cancelled) { cleanup(); return; } Throwable ex = errors.get(); if (ex != null) { cleanup(); a.onError(ex); return; } boolean d = done.get() == 0; boolean empty = true; for (JoinInnerSubscriber<T> inner : s) { SimpleQueue<T> q = inner.queue; if (q != null && !q.isEmpty()) { empty = false; break; } } if (d && empty) { a.onComplete(); return; } } if (e != 0 && r != Long.MAX_VALUE) { requested.addAndGet(-e); } int w = get(); if (w == missed) { missed = addAndGet(-missed); if (missed == 0) { break; } } else { missed = w; } } }</code><technical_language>This supposed optimization avoid reading array length over. original for (int i = 0; i < n; i++)</technical_language>

Target:
void drainLoop() { int missed = 1; JoinInnerSubscriber<T>[] s = this.subscribers; int n = s.length; Subscriber<? super T> a = this.downstream; for (;;) { long r = requested.get(); long e = 0; middle: while (e != r) { if (cancelled) { cleanup(); return; } Throwable ex = errors.get(); if (ex != null) { cleanup(); a.onError(ex); return; } boolean d = done.get() == 0; boolean empty = true; for (int i = 0; i < s.length; i++) { JoinInnerSubscriber<T> inner = s[i]; SimplePlainQueue<T> q = inner.queue; if (q != null) { T v = q.poll(); if (v != null) { empty = false; a.onNext(v); inner.requestOne(); if (++e == r) { break middle; } } } } if (d && empty) { a.onComplete(); return; } if (empty) { break; } } if (e == r) { if (cancelled) { cleanup(); return; } Throwable ex = errors.get(); if (ex != null) { cleanup(); a.onError(ex); return; } boolean d = done.get() == 0; boolean empty = true; for (int i = 0; i < n; i++) { JoinInnerSubscriber<T> inner = s[i]; SimpleQueue<T> q = inner.queue; if (q != null && !q.isEmpty()) { empty = false; break; } } if (d && empty) { a.onComplete(); return; } } if (e != 0 && r != Long.MAX_VALUE) { requested.addAndGet(-e); } int w = get(); if (w == missed) { missed = addAndGet(-missed); if (missed == 0) { break; } } else { missed = w; } } }