auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static boolean matches(List<Protos.Resource> offeredResources, Configuration configuration) { ImmutableMap<String, Protos.Resource> resourceMap = Maps.uniqueIndex(offeredResources, new Function<Protos.Resource, String>() { @Override public String apply(Protos.Resource input) { return input.getName(); } }); Protos.Resource cpus1 = resourceMap.get("cpus"); if (cpus1.getScalar().getValue() < configuration.resourcesCpus()) { return false; } Protos.Resource mem = resourceMap.get("mem"); if (mem.getScalar().getValue() < configuration.resourcesMemory()) { return false; } Protos.Resource ports = resourceMap.get("ports"); <START> final TreeSet<Long> portsRange = newTreeSet(); <END> for (final Protos.Value.Range range : ports.getRanges().getRangeList()) { final long begin = range.getBegin(); final long end = range.getEnd(); for (long l = begin; l <= end; l++) { portsRange.add(l); } } if (!portsRange.contains(configuration.httpPort().longValue())) { return false; } return true; }</code><technical_language>avoid a portRange set/list instead check loop if httpPort falls range.getBegin/getEnd</technical_language>

Target:
public static boolean matches(List<Protos.Resource> offeredResources, Configuration configuration) { ImmutableMap<String, Protos.Resource> resourceMap = Maps.uniqueIndex(offeredResources, new Function<Protos.Resource, String>() { @Override public String apply(Protos.Resource input) { return input.getName(); } }); Protos.Resource cpus1 = resourceMap.get("cpus"); if (cpus1.getScalar().getValue() < configuration.resCpus) { return false; } Protos.Resource mem = resourceMap.get("mem"); if (mem.getScalar().getValue() < configuration.resMemory) { return false; } Protos.Resource ports = resourceMap.get("ports"); if(!checkPorts(configuration, ports)) { return false; } return true; }
Source:
<code>public final boolean isExtendedLifetimeValid() { if (mExtendedExpiresOn != null && !StringExtensions.IsNullOrBlank(mAccessToken)) { return !isTokenExpired(mExtendedExpiresOn); <START> } else { <END> return false; } }</code><technical_language>else { [](start = 10, length = 6) need this else block</technical_language>

Target:
public final boolean isExtendedLifetimeValid() { if (mExtendedExpiresOn != null && !StringExtensions.IsNullOrBlank(mAccessToken)) { return !isTokenExpired(mExtendedExpiresOn); } return false; }
Source:
<code>public void canGetExistingChatThread() { CreateChatThreadOptions threadRequest = ChatOptionsProvider.createThreadOptions( firstThreadMember.getId(), secondThreadMember.getId()); <START> ChatThreadAsyncClient chatThreadClient = client.createChatThread(threadRequest).block(); <END> StepVerifier.create(client.getChatThread(chatThreadClient.getChatThreadId())) .assertNext(chatThread -> { assertEquals(chatThreadClient.getChatThreadId(), chatThread.getId()); }) .verifyComplete(); }</code><technical_language>need remove this block. I asking Srikanta tutorial. find answer do</technical_language>

Target:
public void canGetExistingChatThread() { CreateChatThreadOptions threadRequest = ChatOptionsProvider.createThreadOptions( firstThreadMember.getId(), secondThreadMember.getId()); AtomicReference<ChatThreadAsyncClient> chatThreadClientRef = new AtomicReference<>(); StepVerifier.create( client.createChatThread(threadRequest) .flatMap(chatThreadClient -> { chatThreadClientRef.set(chatThreadClient); return client.getChatThread(chatThreadClient.getChatThreadId()); })) .assertNext(chatThread -> { assertEquals(chatThreadClientRef.get().getChatThreadId(), chatThread.getId()); }) .verifyComplete(); }
Source:
<code>protected Object doReadObject(final boolean unshared) throws ClassNotFoundException, IOException { <START> final Object obj = objectPreResolver.readResolve(doReadObject(readUnsignedByte(), unshared)); <END> if (depth == 0) { final SortedSet<Validator> validators = this.validators; if (validators != null) { this.validators = null; validatorSeq = 0; for (Validator validator : validators) { validator.getValidation().validateObject(); } } } return obj; }</code><technical_language>I this placement a problem, a number of call sites call doReadObject(int, boolean) essentially bypass this resolution. I edit main doReadObject method, capturing return statement, else wrap method a method substitution (though this reduce maximum stack depth achieved)</technical_language>

Target:
protected Object doReadObject(final boolean unshared) throws ClassNotFoundException, IOException { final Object obj = doReadObject(readUnsignedByte(), unshared); if (depth == 0) { final SortedSet<Validator> validators = this.validators; if (validators != null) { this.validators = null; validatorSeq = 0; for (Validator validator : validators) { validator.getValidation().validateObject(); } } } return obj; }
Source:
<code><START> public void dispose() { <END> clearCachedSwingEditor(); }</code><technical_language>dispose synchronized, remove volatile keyword in class member</technical_language>

Target:
public synchronized void dispose() { clearCachedSwingEditor(); }
Source:
<code>public void testFacebookLoginFlow() { List<String> providers = Arrays.asList(AuthUI.FACEBOOK_PROVIDER); AuthMethodPickerActivity authMethodPickerActivity = createActivity(providers); FirebaseUser mockFirebaseUser = TestHelper.makeMockFirebaseUser(); when(mockFirebaseUser.getProviders()) .thenReturn(Arrays.asList(FacebookAuthProvider.PROVIDER_ID)); when(ActivityHelperShadow.firebaseAuth.signInWithCredential((AuthCredential) anyObject())) .thenReturn(new AutoCompleteTask<AuthResult>( new FakeAuthResult(mockFirebaseUser), true, null)); Button facebookButton = (Button) authMethodPickerActivity.findViewById(R.id.facebook_button); assertNotNull(facebookButton); facebookButton.performClick(); <START> Intent smartLockIntent = SmartLock.getInstance(authMethodPickerActivity).getIntentForTest(); <END> verifySaveCredentialIntent(smartLockIntent, FacebookAuthProvider.PROVIDER_ID); }</code><technical_language>tests verify intent intent is created for purposes of test. nice update tests reflect changes in SmartLock, ideally checking SmartLock API is called correct credential</technical_language>

Target:
public void testFacebookLoginFlow() { List<String> providers = Arrays.asList(AuthUI.FACEBOOK_PROVIDER); AuthMethodPickerActivity authMethodPickerActivity = createActivity(providers); FirebaseUser mockFirebaseUser = TestHelper.makeMockFirebaseUser(); when(mockFirebaseUser.getProviders()) .thenReturn(Arrays.asList(FacebookAuthProvider.PROVIDER_ID)); when(ActivityHelperShadow.firebaseAuth.signInWithCredential((AuthCredential) Mockito.any())) .thenReturn(new AutoCompleteTask<AuthResult>( new FakeAuthResult(mockFirebaseUser), true, null)); SmartLockResult result = SmartLockResult.newInstance(authMethodPickerActivity, "AuthMethodPicker", null, FacebookAuthProvider.PROVIDER_ID); Button facebookButton = (Button) authMethodPickerActivity.findViewById(R.id.facebook_button); assertNotNull(facebookButton); facebookButton.performClick(); try { result.await(); } catch (InterruptedException e) { assertTrue("Interrupted waiting for result", false); } }
Source:
<code>private void insertAction(final Action action, final FilterKey key) { if (filterMap.get(key) == null) { filterMap.put(key, action); } else { <START> logger.error(MessageUtils.getMessage("DOTJ007W", key.toString()).toString()); <END> } }</code><technical_language>This logged error. this logger.warn</technical_language>

Target:
private void insertAction(final Action action, final FilterKey key) { if (filterMap.get(key) == null) { filterMap.put(key, action); } else { logger.warn(MessageUtils.getMessage("DOTJ007W", key.toString()).toString()); } }
Source:
<code><START> private void closeSegments(AbstractLogSegment... segments) { <END> for (AbstractLogSegment segment : segments) { if (segment != null) { segment.close(); } } }</code><technical_language>cleaner this function append</technical_language>

Target:
private void closeSegments(AbstractLogSegment... segments) { for (AbstractLogSegment segment : segments) { if (segment != null) { segment.close(true); } } }
Source:
<code>public QuotaRoot getQuotaRoot(MailboxPath mailboxPath) { Preconditions.checkArgument(!mailboxPath.getNamespace().contains(SEPARATOR), "Namespace should not contain " + SEPARATOR); Preconditions.checkArgument(mailboxPath.getUser() != null, "Username should not be null"); Preconditions.checkArgument(!mailboxPath.getUser().contains(SEPARATOR), "Username should not contain " + SEPARATOR); <START> User user = User.fromUsername(mailboxPath.getUser()); <END> return QuotaRoot.quotaRoot(mailboxPath.getNamespace() + SEPARATOR + user.asString(), user.getDomainPart()); }</code><technical_language>Why? succeed generate this user, apply this normalization transformation get a user</technical_language>

Target:
public QuotaRoot getQuotaRoot(MailboxPath mailboxPath) { Preconditions.checkArgument(!mailboxPath.getNamespace().contains(SEPARATOR), "Namespace should not contain " + SEPARATOR); return Optional.ofNullable(mailboxPath.getUser()) .map(user -> { Preconditions.checkArgument(!mailboxPath.getUser().contains(SEPARATOR), "Username should not contain " + SEPARATOR); return User.fromUsername(mailboxPath.getUser()); }) .map(user -> QuotaRoot.quotaRoot(mailboxPath.getNamespace() + SEPARATOR + user.asString(), user.getDomainPart())) .orElseGet(() -> QuotaRoot.quotaRoot(mailboxPath.getNamespace(), Optional.empty())); }
Source:
<code>public GatewayOrder createGatewayOrder(EpdqTemplateData templateData) { <START> templateData.setOperationType(getOperationType()); <END> List<NameValuePair> templateParams = extract(templateData); List<NameValuePair> requestParams = new ArrayList<>(templateParams); requestParams.add(new BasicNameValuePair("SHASIGN", signatureGenerator.sign(templateParams, templateData.getShaInPassphrase()))); String payload = URLEncodedUtils.format(requestParams, EPDQ_APPLICATION_X_WWW_FORM_URLENCODED_CHARSET); return new GatewayOrder( getOrderRequestType(), payload, MediaType.APPLICATION_FORM_URLENCODED_TYPE ); }</code><technical_language>for now, I concrete subclass of EpdqPayloadDefinition enough add operation type a constant added data passed here</technical_language>

Target:
public GatewayOrder createGatewayOrder(EpdqTemplateData templateData) { templateData.setOperationType(getOperationType()); ArrayList<NameValuePair> params = new ArrayList<>(extract(templateData)); String signature = SIGNATURE_GENERATOR.sign(params, templateData.getShaInPassphrase()); params.add(new BasicNameValuePair("SHASIGN", signature)); String payload = URLEncodedUtils.format(params, EPDQ_APPLICATION_X_WWW_FORM_URLENCODED_CHARSET); return new GatewayOrder( getOrderRequestType(), payload, MediaType.APPLICATION_FORM_URLENCODED_TYPE ); }
Source:
<code><START> public void terminate() <END> { while ( !queue.isEmpty() ) { PooledConnection conn = queue.poll(); if ( conn != null ) { conn.dispose(); } } for ( PooledConnection pooledConnection : acquiredConnections ) { pooledConnection.dispose(); } }</code><technical_language>want a atomic var beginning of method, flag started termination. If connection created this, close right now. If connection want _add_ queue map, drop directly</technical_language>

Target:
public void terminate() { if (isTerminating.compareAndSet( false, true )) { while ( !queue.isEmpty() ) { PooledConnection conn = queue.poll(); if ( conn != null ) { conn.dispose(); } } for ( PooledConnection pooledConnection : acquiredConnections ) { pooledConnection.dispose(); } } }
Source:
<code>public void authorizeAPI(final String emailAddress, final Activity activity, final OAuth2TokenProviderAuthCallback callback) { Account account = getAccountFromManager(emailAddress); if (account == null) { <START> callback.failure(new Exception(activity.getString(R.string.xoauth2_account_doesnt_exist))); <END> } if(account.name.equals(emailAddress)) { accountManager.getAuthToken(account, GMAIL_AUTH_TOKEN_TYPE, null, activity, new AccountManagerCallback<Bundle>() { @Override public void run(AccountManagerFuture<Bundle> future) { try { Bundle bundle = future.getResult(); if (bundle.get(AccountManager.KEY_ACCOUNT_NAME).equals(emailAddress)) { callback.success(); } } catch (OperationCanceledException e) { callback.failure(new Exception(activity.getString( R.string.xoauth2_auth_cancelled_by_user), e)); } catch (IOException e) { callback.failure(new Exception(activity.getString( R.string.xoauth2_unable_to_contact_auth_server), e)); } catch (AuthenticatorException e) { callback.failure(new Exception(activity.getString( R.string.xoauth2_error_contacting_auth_server), e)); } } }, null); } }</code><technical_language>raw Exception type? hmm</technical_language>

Target:
public void authorizeAPI(final String emailAddress, final Activity activity, final OAuth2TokenProviderAuthCallback callback) { Account account = getAccountFromManager(emailAddress); if (account == null) { callback.failure(new AuthorizationException(activity.getString(R.string.xoauth2_account_doesnt_exist))); return; } if (account.name.equals(emailAddress)) { accountManager.getAuthToken(account, GMAIL_AUTH_TOKEN_TYPE, null, activity, new AccountManagerCallback<Bundle>() { @Override public void run(AccountManagerFuture<Bundle> future) { try { Bundle bundle = future.getResult(); Object keyAccountName = bundle.get(AccountManager.KEY_ACCOUNT_NAME); if (keyAccountName == null) { callback.failure(new AuthorizationException(activity.getString( R.string.xoauth2_no_account))); return; } if (keyAccountName.equals(emailAddress)) { callback.success(); } else { callback.failure(new AuthorizationException(activity.getString( R.string.xoauth2_incorrect_auth_info_provided))); } } catch (OperationCanceledException e) { callback.failure(new AuthorizationException(activity.getString( R.string.xoauth2_auth_cancelled_by_user), e)); } catch (IOException e) { callback.failure(new AuthorizationException(activity.getString( R.string.xoauth2_unable_to_contact_auth_server), e)); } catch (AuthenticatorException e) { callback.failure(new AuthorizationException(activity.getString( R.string.xoauth2_error_contacting_auth_server), e)); } } }, null); } }
Source:
<code>private void initUi() { setTitle(R.string.dish_title); setContentView(R.layout.main_list_activity); LinearLayout galleryFrame = (LinearLayout) findViewById(R.id.gallery_frame); Button orderListButton = (Button) findViewById(R.id.orderedlist_button); orderListButton.setOnClickListener(this); LayoutInflater inflater = LayoutInflater.from(getApplicationContext()); int categoryNum = mCategoryList.size(); mCategoryGallery = new GridView[categoryNum]; for (int i = 0; i < categoryNum; i++) { LinearLayout categoryLayout = (LinearLayout) inflater.inflate(R.layout.main_list_item, <START> null); <END> TextView cagegoryNameTextView = (TextView) categoryLayout .findViewById(R.id.category_name); Category category = mCategoryList.get(i); long categoryId = category.getCategoryId(); cagegoryNameTextView.setText(category.getName()); List<Dish> dishList = mCategoryDishesMap.get(categoryId); if (dishList == null) { dishList = Collections.emptyList(); } mCategoryGallery[i] = (GridView) categoryLayout.findViewById(R.id.dish_grid); mCategoryGallery[i].setId((int) categoryId); mCategoryGallery[i].setAdapter(new GridViewAdapter(this, dishList)); mCategoryGallery[i].setOnItemClickListener(this); int dishNumber = dishList.size(); int rowNum = (dishNumber % DISHNUM_IN_ONEROW == 0) ? (dishNumber / DISHNUM_IN_ONEROW) : (dishNumber / DISHNUM_IN_ONEROW + 1); mCategoryGallery[i].getLayoutParams().height = rowNum * HEIGHT_ONEROW; galleryFrame.addView(categoryLayout); } mDbHelper.notifyObservers(); }</code><technical_language>Please style, eclipse's default formatter</technical_language>

Target:
private void initUi() { setTitle(R.string.dish_title); setContentView(R.layout.main_list_activity); LinearLayout galleryFrame = (LinearLayout) findViewById(R.id.gallery_frame); Button orderListButton = (Button) findViewById(R.id.orderedlist_button); orderListButton.setOnClickListener(this); LayoutInflater inflater = LayoutInflater.from(getApplicationContext()); int categoryNum = mCategoryList.size(); mCategoryGallery = new GridView[categoryNum]; for (int i = 0; i < categoryNum; i++) { LinearLayout categoryLayout = (LinearLayout) inflater.inflate(R.layout.main_list_item, null); TextView cagegoryNameTextView = (TextView) categoryLayout.findViewById(R.id.category_name); Category category = mCategoryList.get(i); long categoryId = category.getCategoryId(); cagegoryNameTextView.setText(category.getName()); List<Dish> dishList = mCategoryDishesMap.get(categoryId); if (dishList == null) { dishList = Collections.emptyList(); } mCategoryGallery[i] = (GridView) categoryLayout.findViewById(R.id.dish_grid); mCategoryGallery[i].setId((int) categoryId); mCategoryGallery[i].setAdapter(new GridViewAdapter(this, dishList)); mCategoryGallery[i].setOnItemClickListener(this); int dishNumber = dishList.size(); int rowNum = (dishNumber % DISHNUM_IN_ONEROW == 0) ? (dishNumber / DISHNUM_IN_ONEROW) : (dishNumber / DISHNUM_IN_ONEROW + 1); mCategoryGallery[i].getLayoutParams().height = rowNum * HEIGHT_ONEROW; galleryFrame.addView(categoryLayout); } }
Source:
<code>protected String initDomain() { if (!globalJmxRegistration.isJMXEnabled()) { if (globalJmxRegistration.mBeanServer == null) { globalJmxRegistration.mBeanServer = mBeanServer; } globalJmxRegistration.initJMX(); } return globalJmxRegistration.jmxDomain; <START> } <END></code><technical_language>do set global jmx mBeanServer cache's mBeanServer if JMX is disabled globally</technical_language>

Target:
protected String initDomain() { return globalJmxRegistration.jmxDomain; }
Source:
<code>private void serve(final HttpServletRequest req, final HttpServletResponse rsp, final boolean sendBody) throws IOException { final File obj = new File(objects(req), req.getPathInfo()); final FileSender sender; try { sender = new FileSender(obj); } catch (FileNotFoundException e) { rsp.sendError(SC_NOT_FOUND); return; } try { final String etag = etag(sender); <START> final long lastModified = sender.getLastModified() / 1000 * 1000; <END> String ifNoneMatch = req.getHeader(HDR_IF_NONE_MATCH); if (etag != null && etag.equals(ifNoneMatch)) { rsp.sendError(SC_NOT_MODIFIED); return; } long ifModifiedSince = req.getDateHeader(HDR_IF_MODIFIED_SINCE); if (0 < lastModified && lastModified < ifModifiedSince) { rsp.sendError(SC_NOT_MODIFIED); return; } if (etag != null) rsp.setHeader(HDR_ETAG, etag); if (0 < lastModified) rsp.setDateHeader(HDR_LAST_MODIFIED, lastModified); rsp.setContentType(contentType); sender.serve(req, rsp, sendBody); } finally { sender.close(); } }</code><technical_language>reason put parens in, suggested time? help</technical_language>

Target:
private void serve(final HttpServletRequest req, final HttpServletResponse rsp, final boolean sendBody) throws IOException { final File obj = new File(objects(req), req.getPathInfo()); final FileSender sender; try { sender = new FileSender(obj); } catch (FileNotFoundException e) { rsp.sendError(SC_NOT_FOUND); return; } try { final String etag = etag(sender); final long lastModified = (sender.getLastModified() / 1000) * 1000; String ifNoneMatch = req.getHeader(HDR_IF_NONE_MATCH); if (etag != null && etag.equals(ifNoneMatch)) { rsp.sendError(SC_NOT_MODIFIED); return; } long ifModifiedSince = req.getDateHeader(HDR_IF_MODIFIED_SINCE); if (0 < lastModified && lastModified < ifModifiedSince) { rsp.sendError(SC_NOT_MODIFIED); return; } if (etag != null) rsp.setHeader(HDR_ETAG, etag); if (0 < lastModified) rsp.setDateHeader(HDR_LAST_MODIFIED, lastModified); rsp.setContentType(contentType); sender.serve(req, rsp, sendBody); } finally { sender.close(); } }
Source:
<code>public Void visit(Import node, Void _) { Module module; <START> if (!node.getName().startsWith("#")) { END> module = this.getCurrentDefinition().getModulesMap().get(node.getName()); if (module == null) { String msg = "Could not find module: " + node.getName() + " imported from: " + this.getCurrentModule().getName(); throw KExceptionManager.compilerError(msg, this, node); } this.getCurrentModule().getModuleContext().addImportedModule(module); } moduleInclusion.addRelation(this.getCurrentModule().getName(), node.getName()); return null; }</code><technical_language>add a TODO name it? I want try delete Maude starting Friday, I need able track of this delete it</technical_language>

Target:
public Void visit(Import node, Void _) { Module module; if (!node.getName().startsWith("#")) { module = this.getCurrentDefinition().getDefinitionContext().getModuleByName(node.getName()); if (module == null) { String msg = "Could not find module: " + node.getName() + " imported from: " + this.getCurrentModule().getName(); throw KExceptionManager.compilerError(msg, this, node); } this.getCurrentModule().getModuleContext().addImportedModule(module); } return null; }
Source:
<code>public void testZeroExitCode() { DoNothingSoftwareProcessDriver sshRunner = mock(DoNothingSoftwareProcessDriver.class); ScriptHelper scriptHelper = new ScriptHelper(sshRunner, "test-zero-code-task"); <START> Asserts.assertTrue(scriptHelper.executeInternal() == 0, "ScriptHelper doesn't return zero code"); <END> }</code><technical_language>Asserts.assetEquals(scriptHelper.executeInternal(), 0). code, error actual exit code is, hides information</technical_language>

Target:
public void testZeroExitCode() { DoNothingSoftwareProcessDriver sshRunner = mock(DoNothingSoftwareProcessDriver.class); ScriptHelper scriptHelper = new ScriptHelper(sshRunner, "test-zero-code-task"); Assert.assertEquals(scriptHelper.executeInternal(), 0, "ScriptHelper doesn't return zero code"); }
Source:
<code>public void visitMethodInvocation(MethodInvocationTree syntaxNode) { final ExpressionTree methodSelect = syntaxNode.methodSelect(); if (isClosingResource(syntaxNode.symbol())) { if (methodSelect.is(Tree.Kind.MEMBER_SELECT)) { final ExpressionTree targetExpression = ((MemberSelectExpressionTree) methodSelect).expression(); if (targetExpression.is(Tree.Kind.IDENTIFIER)) { final IdentifierTree identifier = (IdentifierTree) targetExpression; programState = closeResource(programState, programState.getValue(identifier.symbol())); } else { programState = closeResource(programState, programState.peekValue()); } } } else if (syntaxNode.methodSelect().is(Tree.Kind.MEMBER_SELECT) && isCreatingResultSet(syntaxNode.symbol())) { final ExpressionTree targetExpression = ((MemberSelectExpressionTree) syntaxNode.methodSelect()).expression(); final SymbolicValue value; <START> if (targetExpression.is(Tree.Kind.IDENTIFIER)) { <END> final IdentifierTree identifier = (IdentifierTree) targetExpression; value = programState.getValue(identifier.symbol()); } else { value = programState.peekValue(); } constraintManager.setValueFactory(new WrappedValueFactory(value)); } else if(isClosingResultSets(syntaxNode.symbol())) { if (methodSelect.is(Tree.Kind.MEMBER_SELECT)) { final ExpressionTree targetExpression = ((MemberSelectExpressionTree) methodSelect).expression(); final SymbolicValue value; if (targetExpression.is(Tree.Kind.IDENTIFIER)) { final IdentifierTree identifier = (IdentifierTree) targetExpression; value = programState.getValue(identifier.symbol()); } else { value = programState.peekValue(); } closeResultSetsRelatedTo(value); } } else { closeArguments(syntaxNode.arguments(), 1); } }</code><technical_language>next 5 lines duplicated factorized</technical_language>

Target:
public void visitMethodInvocation(MethodInvocationTree syntaxNode) { final ExpressionTree methodSelect = syntaxNode.methodSelect(); if (isClosingResource(syntaxNode.symbol())) { if (methodSelect.is(Tree.Kind.MEMBER_SELECT)) { final ExpressionTree targetExpression = ((MemberSelectExpressionTree) methodSelect).expression(); if (targetExpression.is(Tree.Kind.IDENTIFIER)) { final IdentifierTree identifier = (IdentifierTree) targetExpression; programState = closeResource(programState, programState.getValue(identifier.symbol())); } else { programState = closeResource(programState, programState.peekValue()); } } } else if (syntaxNode.methodSelect().is(Tree.Kind.MEMBER_SELECT) && isOpeningResultSet(syntaxNode.symbol())) { final SymbolicValue value = getTargetValue(syntaxNode); constraintManager.setValueFactory(new WrappedValueFactory(value)); } else if (isClosingResultSets(syntaxNode.symbol())) { if (methodSelect.is(Tree.Kind.MEMBER_SELECT)) { final SymbolicValue value = getTargetValue(syntaxNode); closeResultSetsRelatedTo(value); } } else { closeArguments(syntaxNode.arguments(), 1); } }
Source:
<code>public AttemptResult transitionInto(WalkStateGraphContext walkStateGraphContext) throws IOException, SmackException, InterruptedException, XMPPException { connectionAttemptState = new WebsocketConnectionAttemptState( connectionInternal, discoveredWebsocketEndpoints, this); StateTransitionResult.Failure failure = connectionAttemptState.establishWebsocketConnection(); if (failure != null) { return failure; } connectionInternal.setTransport(websocketTransport); connectionInternal.newStreamOpenWaitForFeaturesSequence("stream features after initial connection", new OpenElement(connectionInternal.connection.getXMPPServiceDomain())); <START> return new WebsocketConnectedResult(); <END> }</code><technical_language>EstablishTcpConnectionState this result dynamic information established connection. For example, remote endpoint / address</technical_language>

Target:
public AttemptResult transitionInto(WalkStateGraphContext walkStateGraphContext) throws IOException, SmackException, InterruptedException, XMPPException { WebsocketConnectionAttemptState connectionAttemptState = new WebsocketConnectionAttemptState( connectionInternal, discoveredWebsocketEndpoints, this); try { websocket = connectionAttemptState.establishWebsocketConnection(); } catch (InterruptedException | WebsocketException e) { StateTransitionResult.Failure failure = new StateTransitionResult.FailureCausedByException<Exception>(e); return failure; } connectionInternal.setTransport(websocketTransport); WebsocketRemoteConnectionEndpoint connectedEndpoint = connectionAttemptState.getConnectedEndpoint(); return new WebsocketConnectedResult(connectedEndpoint); }
Source:
<code>public ListenableFuture<Map<Cell, Value>> getAsync(TableReference tableRef, Map<Cell, Long> timestampByCell) { Executable<ListenableFuture<Map<Cell, Value>>> job = executor -> { CqlQuerySpec<Optional<Value>> querySpec = ImmutableCqlQuerySpec.<Optional<Value>>builder() .rowStreamAccumulator(RowStreamAccumulators.GetQueryAccumulator::new) .supportedQuery(SupportedQuery.GET) .keySpace(config.getKeyspaceOrThrow()) .tableReference(tableRef) .build(); return Futures.transform( Futures.allAsList( KeyedStream.stream(timestampByCell).map((cell, timestamp) -> cqlClient.execute(cqlClient.<Optional<Value>>asyncQueryBuilder() .setQuerySpec(querySpec) .setArg("row", ByteBuffer.wrap(cell.getRowName())) .setArg("column", ByteBuffer.wrap(cell.getColumnName())) .setArg("timestamp", ~timestamp) <START> .build())) <END> .entries() .map(entry -> Futures.transform(entry.getValue(), val -> new AbstractMap.SimpleEntry<>(entry.getKey(), val), executor)) .collect(Collectors.toList())), resultList -> resultList.stream() .filter(entry -> entry.getValue().isPresent()) .collect(Collectors.toMap( AbstractMap.SimpleEntry::getKey, entry -> entry.getValue().get())), executor); }; return cqlClient.execute(job); }</code><technical_language>split some variables, multiple layers of nesting this unreadable</technical_language>

Target:
public ListenableFuture<Map<Cell, Value>> getAsync(TableReference tableRef, Map<Cell, Long> timestampByCell) { if (timestampByCell.isEmpty()) { log.info("Attempted get with no specified cells", LoggingArgs.tableRef(tableRef)); return Futures.immediateFuture(ImmutableMap.of()); } return asyncCellLoader.loadAllWithTimestamp(tableRef, timestampByCell); }
Source:
<code>private CloseableIterator<Record> compressedIterator(BufferSupplier bufferSupplier, boolean skipKeyValue) { final ByteBuffer buffer = this.buffer.duplicate(); buffer.position(RECORDS_OFFSET); final DataInputStream inputStream = new DataInputStream(compressionType().wrapForInput(buffer, magic(), bufferSupplier)); if (skipKeyValue) { byte[] array = new byte[MAX_SKIP_BUFFER_SIZE]; ByteBuffer skipBuffer = ByteBuffer.wrap(array); skipBuffer.limit(0); return new StreamRecordIterator(inputStream) { @Override <START> protected Record readNext(long baseOffset, long firstTimestamp, int baseSequence, Long logAppendTime) { <END> try { return DefaultRecord.readPartiallyFrom(inputStream, skipBuffer, baseOffset, firstTimestamp, baseSequence, logAppendTime); } catch (EOFException e) { throw new InvalidRecordException("Incorrect declared batch size, premature EOF reached"); } catch (IOException e) { throw new KafkaException("Failed to decompress record stream", e); } } }; } else { return new StreamRecordIterator(inputStream) { @Override protected Record readNext(long baseOffset, long firstTimestamp, int baseSequence, Long logAppendTime) { try { return DefaultRecord.readFrom(inputStream, baseOffset, firstTimestamp, baseSequence, logAppendTime); } catch (EOFException e) { throw new InvalidRecordException("Incorrect declared batch size, premature EOF reached"); } catch (IOException e) { throw new KafkaException("Failed to decompress record stream", e); } } }; } }</code><technical_language>nit: difference this branch other is readPartiallyFrom line. I move exception handling abstract class. add a method this: java abstract Record doReadRecord( long baseOffset, long firstTimestamp, int baseSequence, Long logAppendTime) throws IOException;</technical_language>

Target:
private CloseableIterator<Record> compressedIterator(BufferSupplier bufferSupplier, boolean skipKeyValue) { final ByteBuffer buffer = this.buffer.duplicate(); buffer.position(RECORDS_OFFSET); final DataInputStream inputStream = new DataInputStream(compressionType().wrapForInput(buffer, magic(), bufferSupplier)); if (skipKeyValue) { byte[] skipArray = new byte[MAX_SKIP_BUFFER_SIZE]; return new StreamRecordIterator(inputStream) { @Override protected Record doReadRecord(long baseOffset, long firstTimestamp, int baseSequence, Long logAppendTime) throws IOException { return DefaultRecord.readPartiallyFrom(inputStream, skipArray, baseOffset, firstTimestamp, baseSequence, logAppendTime); } }; } else { return new StreamRecordIterator(inputStream) { @Override protected Record doReadRecord(long baseOffset, long firstTimestamp, int baseSequence, Long logAppendTime) throws IOException { return DefaultRecord.readFrom(inputStream, baseOffset, firstTimestamp, baseSequence, logAppendTime); } }; } }
Source:
<code><START> public void increaseBombRange(){ <END> factory.increaseBlastRange(); }</code><technical_language>I this public; a method</technical_language>

Target:
private void increaseBombRange(){ factory.increaseBlastRange(); }
Source:
<code>private static Block serializeStruct(Type type, BlockBuilder builder, Object object) { if (object == null) { requireNonNull(builder, "builder is null"); builder.appendNull(); <START> return null; <END> } if (builder == null) { builder = type.createBlockBuilder(null, 1); } BlockBuilder currentBuilder = builder.beginBlockEntry(); List<Type> typeParameters = type.getTypeParameters(); for (int i = 0; i < typeParameters.size(); i++) { Optional<String> fieldName = type.getTypeSignature().getParameters().get(i).getNamedTypeSignature().getName(); String name = ""; if (fieldName.isPresent()) { name = fieldName.get().toLowerCase(ENGLISH); } Object value = ((Map) object).get(name); serializeObject(typeParameters.get(i), currentBuilder, value); } builder.closeEntry(); return (Block) type.getObject(builder, 0); }</code><technical_language>ditto: return Optional</technical_language>

Target:
private static Block serializeStruct(Type type, BlockBuilder builder, Object object) { if (object == null) { requireNonNull(builder, "builder is null"); builder.appendNull(); return builder.build(); } if (builder == null) { builder = type.createBlockBuilder(null, 1); } BlockBuilder currentBuilder = builder.beginBlockEntry(); List<Type> typeParameters = type.getTypeParameters(); for (int i = 0; i < typeParameters.size(); i++) { Optional<String> fieldName = type.getTypeSignature().getParameters().get(i).getNamedTypeSignature().getName(); String name = ""; if (fieldName.isPresent()) { name = fieldName.get().toLowerCase(ENGLISH); } Object value = ((Map) object).get(name); serializeObject(typeParameters.get(i), currentBuilder, value); } builder.closeEntry(); return (Block) type.getObject(builder, 0); }
Source:
<code>private boolean isDelemiter(char ch) { for (String <START> d : <END> TextUtilities.DELIMITERS) { if (d.length() == 1 && ch == d.charAt(0)) { return true; } } return false; }</code><technical_language>rename delim</technical_language>

Target:
private boolean isDelemiter(char ch) { for (String delim : TextUtilities.DELIMITERS) { if (delim.length() == 1 && ch == delim.charAt(0)) { return true; } } return false; }
Source:
<code>private VariantSourceEntity doRead() throws IOException { if (variantReader == null) { throw new IllegalStateException("The method VcfHeaderReader.open() should be called before reading"); } variantReader.pre(); source.addMetadata(VARIANT_FILE_HEADER_KEY, variantReader.getHeader()); List<String> sampleNames = variantReader.getSampleNames(); <START> Set<String> uniformSamples = new HashSet<String>(); <END> for (String sample : sampleNames) { if ((uniformSamples.contains(sample))) { throw new IOException("Duplicate sample name given: " + sample); } uniformSamples.add(sample); } return new VariantSourceEntity(source); }</code><technical_language>A shorter create Set List input, comparing sizes. retrieve (possibly multiple) duplicate samples, other methods in classes. I suggest renaming this variable uniqueSamples, expresses idea a bit uniform</technical_language>

Target:
private VariantSourceEntity doRead() throws DuplicateSamplesFoundException { if (variantReader == null) { throw new IllegalStateException("The method VcfHeaderReader.open() should be called before reading"); } variantReader.pre(); source.addMetadata(VARIANT_FILE_HEADER_KEY, variantReader.getHeader()); List<String> sampleNames = new ArrayList<String>(variantReader.getSampleNames()); HashSet<String> uniqueSampleNames = new HashSet<String>(sampleNames.size()); List<String> duplicateSampleNames = new ArrayList<String>(); for (String sample : sampleNames) { boolean isDuplicate = !uniqueSampleNames.add(sample); if (isDuplicate) { duplicateSampleNames.add(sample); } } if (!duplicateSampleNames.isEmpty()) { throw new DuplicateSamplesFoundException(duplicateSampleNames); } return new VariantSourceEntity(source); }
Source:
<code>public <R extends HttpRequest> R bindToRequest(R request, Object input) { <START> Iterable<CreateSubscriptionRequest> createSubscriptionRequests = (Iterable<CreateSubscriptionRequest>) input; <END> JsonArray subscriptionsJsonArray = new JsonArray(); for(CreateSubscriptionRequest createSubscriptionRequest : createSubscriptionRequests){ JsonObject sunbscriptionRequestObject = subscriptionRequestJsonObjectFunction.apply(createSubscriptionRequest); subscriptionsJsonArray.add(sunbscriptionRequestObject); } JsonObject json = new JsonObject(); json.add("objects", subscriptionsJsonArray); request.setPayload(json.toString()); request.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_JSON); return request; }</code><technical_language>checkArgument here</technical_language>

Target:
public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof List, "this binder is only valid for List<CreateSubscriptionRequest>!"); List list = List.class.cast(input); for(Object o : list){ checkArgument(o instanceof CreateSubscriptionRequest, "this binder is only valid for List<CreateSubscriptionRequest>!"); } List<CreateSubscriptionRequest> createSubscriptionRequests = (List<CreateSubscriptionRequest>) input; JsonArray subscriptionsJsonArray = new JsonArray(); for(CreateSubscriptionRequest createSubscriptionRequest : createSubscriptionRequests){ JsonObject sunbscriptionRequestObject = subscriptionRequestJsonObjectFunction.apply(createSubscriptionRequest); subscriptionsJsonArray.add(sunbscriptionRequestObject); } JsonObject json = new JsonObject(); json.add("objects", subscriptionsJsonArray); request.setPayload(json.toString()); request.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_JSON); return request; }
Source:
<code>private void checkIfInvalidRowsExpired(Context context, Map<String, Pair<Long, List<Object>>> targetPkToSourceValues) throws SQLException, IOException { long ttl = getTableTtl(); Set<Map.Entry<String, Pair<Long, List<Object>>>> entrySet = targetPkToSourceValues.entrySet(); Iterator<Map.Entry<String, Pair<Long, <START> List<Object>>>> itr = entrySet.iterator(); <END> while(itr.hasNext()) { Map.Entry<String, Pair<Long, List<Object>>> entry = itr.next(); Pair<Long, List<Object>> sourceValues = entry.getValue(); Long sourceTS = sourceValues.getFirst(); if (hasRowExpiredOnSource(sourceTS, ttl)) { context.getCounter(PhoenixScrutinyJobCounters.EXPIRED_ROW_COUNT).increment(1); itr.remove(); } } }</code><technical_language>is TTL for tables set explicitly? If LONG_MAX, please hasRowExpiredOnSource() overflow sourceTS + ttl</technical_language>

Target:
protected void checkIfInvalidRowsExpired(Context context, Map<String, Pair<Long, List<Object>>> targetPkToSourceValues) { Set<Map.Entry<String, Pair<Long, List<Object>>>> entrySet = targetPkToSourceValues.entrySet(); Iterator<Map.Entry<String, Pair<Long, List<Object>>>> itr = entrySet.iterator(); while(itr.hasNext()) { Map.Entry<String, Pair<Long, List<Object>>> entry = itr.next(); Pair<Long, List<Object>> sourceValues = entry.getValue(); Long sourceTS = sourceValues.getFirst(); if (hasRowExpiredOnSource(sourceTS, ttl)) { context.getCounter(PhoenixScrutinyJobCounters.EXPIRED_ROW_COUNT).increment(1); itr.remove(); } } }
Source:
<code>MountVolumeInfo(Configuration conf) { storageTypeVolumeMap = new ConcurrentHashMap<>(); <START> reservedForArchiveDefault = conf.getDouble( <END> DFSConfigKeys.DFS_DATANODE_RESERVE_FOR_ARCHIVE_DEFAULT_PERCENTAGE, DFSConfigKeys .DFS_DATANODE_RESERVE_FOR_ARCHIVE_DEFAULT_PERCENTAGE_DEFAULT); if (reservedForArchiveDefault > 1) { FsDatasetImpl.LOG.warn("Value of reserve-for-archival is > 100%." + " Setting it to 100%."); reservedForArchiveDefault = 1; } }</code><technical_language>check if set a negative value</technical_language>

Target:
MountVolumeInfo(Configuration conf) { storageTypeVolumeMap = new ConcurrentHashMap<>(); reservedForArchiveDefault = conf.getDouble( DFSConfigKeys.DFS_DATANODE_RESERVE_FOR_ARCHIVE_DEFAULT_PERCENTAGE, DFSConfigKeys .DFS_DATANODE_RESERVE_FOR_ARCHIVE_DEFAULT_PERCENTAGE_DEFAULT); if (reservedForArchiveDefault > 1) { FsDatasetImpl.LOG.warn("Value of reserve-for-archival is > 100%." + " Setting it to 100%."); reservedForArchiveDefault = 1; } if (reservedForArchiveDefault < 0) { FsDatasetImpl.LOG.warn("Value of reserve-for-archival is < 0." + " Setting it to 0.0"); reservedForArchiveDefault = 0; } }
Source:
<code>public void testDump() { ZMsg msg = new ZMsg() .add(new byte[0]) .add(new byte[] { (byte) 0xAA }) <START> .dump(); <END> StringBuilder out = new StringBuilder(); msg.dump(out); System.out.println(msg.toString()); assertThat(out.toString(), endsWith("[000] \n[001] AA\n")); }</code><technical_language>Generally in favor of builder pattern, feels a weird include .dump() in chain here, is action perform ZMsg built. I write this: java ZMsg msg = new ZMsg() .add(new byte[0]) .add(new byte[] { (byte) 0xAA }); msg.dump(); StringBuilder out = new StringBuilder(); msg.dump(out);</technical_language>

Target:
public void testDump() { ZMsg msg = new ZMsg() .add(new byte[0]) .add(new byte[] { (byte) 0xAA }); msg.dump(); StringBuilder out = new StringBuilder(); msg.dump(out); System.out.println(msg.toString()); assertThat(out.toString(), endsWith("[000] \n[001] AA\n")); }
Source:
<code>public void waitForDependencies(DatastreamTaskImpl task, Duration timeout) { task.getDependencies().stream().forEach(previousTask -> { String lockPath = KeyBuilder.datastreamTaskLock(_cluster, task.getConnectorType(), previousTask); if (_zkclient.exists(lockPath)) { <START> waitForTaskRelease(task, timeout.toMillis(), lockPath); <END> } }); }</code><technical_language>wait forTaskRelease is buggy. swallow interruptedException return means waitForTaskRelease return thread is interrupted making caller task is released not. please care of issue</technical_language>

Target:
public void waitForDependencies(DatastreamTaskImpl task, Duration timeout) { task.getDependencies().forEach(previousTask -> { String lockPath = KeyBuilder.datastreamTaskLock(_cluster, task.getConnectorType(), previousTask); if (_zkclient.exists(lockPath)) { waitForTaskRelease(task, timeout.toMillis(), lockPath); } }); }
Source:
<code>public void configuredInterpreter() throws Exception { <START> setGlobalInterpreter("/bin/bash"); <END> Controller c = new BourneShellScript("echo $SHELL").launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); ByteArrayOutputStream baos = new ByteArrayOutputStream(); c.writeLog(ws, new TeeOutputStream(baos, System.out)); assertEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertThat(baos.toString(), containsString("echo")); assertThat(baos.toString(), containsString("/bash")); c.cleanup(ws); setGlobalInterpreter("bash"); c = new BourneShellScript("echo $SHELL").launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); baos = new ByteArrayOutputStream(); c.writeLog(ws, new TeeOutputStream(baos, System.out)); assertEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertThat(baos.toString(), containsString("echo")); assertThat(baos.toString(), containsString("/bash")); c.cleanup(ws); setGlobalInterpreter("no_such_shell"); c = new BourneShellScript("echo $SHELL").launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); baos = new ByteArrayOutputStream(); c.writeLog(ws, new TeeOutputStream(baos, System.out)); assertNotEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertThat(baos.toString(), containsString("no_such_shell")); c.cleanup(ws); }</code><technical_language>Please do do this Docker rule a reproducible environment</technical_language>

Target:
@Test public void configuredInterpreter() throws Exception { DumbSlave node = createDockerSlave(dockerSlim.get()); j.jenkins.addNode(node); j.waitOnline(node); launcher = node.createLauncher(listener); ws = node.getWorkspaceRoot().child("configuredInterpreter"); ws.mkdirs(); setGlobalInterpreter("/bin/bash"); String script = "if [ ! -z \"$BASH_VERSION\" ]; then echo 'this is bash'; else echo 'this is not'; fi"; Controller c = new BourneShellScript(script).launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); ByteArrayOutputStream baos = new ByteArrayOutputStream(); c.writeLog(ws, new TeeOutputStream(baos, System.out)); assertEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertThat(baos.toString(), containsString("this is bash")); c.cleanup(ws); setGlobalInterpreter("bash"); c = new BourneShellScript(script).launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); baos = new ByteArrayOutputStream(); c.writeLog(ws, new TeeOutputStream(baos, System.out)); assertEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertThat(baos.toString(), containsString("this is bash")); c.cleanup(ws); setGlobalInterpreter("no_such_shell"); c = new BourneShellScript(script).launch(new EnvVars(), ws, launcher, listener); awaitCompletion(c); baos = new ByteArrayOutputStream(); c.writeLog(ws, new TeeOutputStream(baos, System.out)); assertNotEquals(0, c.exitStatus(ws, launcher, listener).intValue()); assertThat(baos.toString(), containsString("no_such_shell")); c.cleanup(ws); }
Source:
<code>public Map<String, String> getEnv(URI uri) throws CoreException { IRemoteServices services = RemoteServices.getRemoteServices(uri); IRemoteConnection connection = services.getConnectionManager().getConnection(uri); <START> if(!connection.isOpen()) <END> try { connection.open(null); } catch (RemoteConnectionException e) { Status status = new Status(IStatus.ERROR, e.getMessage(), Activator.PLUGIN_ID); Activator.getDefault().getLog().log(status); return Collections.emptyMap(); } return connection.getEnv(); }</code><technical_language>I if statement curly braces flow more explicit</technical_language>

Target:
public Map<String, String> getEnv(URI uri) throws CoreException { IRemoteServices services = RemoteServices.getRemoteServices(uri); IRemoteConnection connection = services.getConnectionManager().getConnection(uri); if(!connection.isOpen()) { try { connection.open(null); } catch (RemoteConnectionException e) { Status status = new Status(IStatus.ERROR, e.getMessage(), Activator.PLUGIN_ID); Activator.getDefault().getLog().log(status); return Collections.emptyMap(); } } return connection.getEnv(); }
Source:
<code>public Builder client(@NonNull OkHttpClient client) { if (client == null) { throw new NullPointerException("client == null"); } if (downloader != null) { throw new IllegalArgumentException("Downloader already set."); } downloader = new OkHttp3Downloader(client, client.cache(), true); return this; <START> } <END></code><technical_language>Message needs changed. Retrofit do? Do care if people overwrite this? I don't, breaks newBuilder() desire</technical_language>

Target:
public Builder client(@NonNull OkHttpClient client) { if (client == null) { throw new NullPointerException("client == null"); } downloader = new OkHttp3Downloader(client, client.cache(), true); return this; }
Source:
<code>static void sleep(long ms) throws IOException { if <START> (ms < 0) { <END> return; } try { Thread.sleep(ms); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException(e); } }</code><technical_language>ms <= 0? Thread.sleep(0) a scheduling yield. undefined in platform docs</technical_language>

Target:
static void sleep(long ms) throws InterruptedIOException { if (ms <= 0) { return; } try { Thread.sleep(ms); } catch (InterruptedException e) { InterruptedIOException ie = new InterruptedIOException(); ie.initCause(e); throw ie; } }
Source:
<code>protected void performQueryingIntegrityCheck(Ignite ig, int key) throws Exception { IgniteCache<Object, Object> cache = ig.cache(POI_CACHE_NAME).withKeepBinary(); List<List<?>> res = cache.query(new SqlFieldsQuery( <START> String.format("DELETE FROM %s WHERE %s = %d", POI_TABLE_NAME, ID_FIELD_NAME, key)) <END> .setSchema(POI_SCHEMA_NAME)).getAll(); assertEquals(1, res.size()); assertNull(cache.get(key)); res = cache.query(new SqlFieldsQuery( String.format( "INSERT INTO %s(%s) VALUES (%s)", POI_TABLE_NAME, String.join(",", ID_FIELD_NAME, NAME_FIELD_NAME), String.join(",", String.valueOf(key),"'test'")) ).setSchema(POI_SCHEMA_NAME)).getAll(); assertEquals(1, res.size()); assertNotNull(cache.get(key)); res = cache.query(new SqlFieldsQuery(String.format("UPDATE %s SET %s = '%s' WHERE ID = %d", POI_TABLE_NAME, NAME_FIELD_NAME, "POI_" + key, key)).setSchema(POI_SCHEMA_NAME)).getAll(); assertEquals(1, res.size()); assertEquals("POI_" + key, ((BinaryObject)cache.get(key)).field(NAME_FIELD_NAME)); assertIndexUsed(cache, "SELECT * FROM " + POI_TABLE_NAME + " WHERE ID = " + key, KEY_PK_IDX_NAME); }</code><technical_language>Typo: Extra layer of indentation omitted</technical_language>

Target:
protected void performQueryingIntegrityCheck(Ignite ig, int key) throws Exception { IgniteCache<Object, Object> cache = ig.cache(POI_CACHE_NAME).withKeepBinary(); String sql = String.format("DELETE FROM %s WHERE %s = %d", POI_TABLE_NAME, ID_FIELD_NAME, key); List<List<?>> res = cache.query(new SqlFieldsQuery(sql).setSchema(POI_SCHEMA_NAME)).getAll(); assertEquals(1, res.size()); assertNull(cache.get(key)); sql = String.format("INSERT INTO %s(%s) VALUES (%s)", POI_TABLE_NAME, String.join(",", ID_FIELD_NAME, NAME_FIELD_NAME), String.join(",", String.valueOf(key), "'test'")); res = cache.query(new SqlFieldsQuery(sql).setSchema(POI_SCHEMA_NAME)).getAll(); assertEquals(1, res.size()); assertNotNull(cache.get(key)); sql = String.format("UPDATE %s SET %s = '%s' WHERE ID = %d", POI_TABLE_NAME, NAME_FIELD_NAME, "POI_" + key, key); res = cache.query(new SqlFieldsQuery(sql).setSchema(POI_SCHEMA_NAME)).getAll(); assertEquals(1, res.size()); assertEquals("POI_" + key, ((BinaryObject)cache.get(key)).field(NAME_FIELD_NAME)); assertIndexUsed(cache, "SELECT * FROM " + POI_TABLE_NAME + " WHERE ID = " + key, KEY_PK_IDX_NAME); }