auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Aggregator factorize(ColumnSelectorFactory metricFactory) { <START> ValueType valueType = metricFactory.columnType(fieldName); <END> if (valueType == null) { return Aggregators.noopAggregator(); } if (valueType == ValueType.FLOAT) { return new VarianceAggregator.FloatVarianceAggregator( name, metricFactory.makeFloatColumnSelector(fieldName) ); } if (valueType == ValueType.LONG) { return new VarianceAggregator.LongVarianceAggregator( name, metricFactory.makeLongColumnSelector(fieldName) ); } return new VarianceAggregator.ObjectVarianceAggregator( name, metricFactory.makeObjectColumnSelector(fieldName) ); }</code><technical_language>a object column selector? clean a lot of this code</technical_language>

Target:
public Aggregator factorize(ColumnSelectorFactory metricFactory) { ObjectColumnSelector selector = metricFactory.makeObjectColumnSelector(fieldName); if (selector == null) { return Aggregators.noopAggregator(); } if ("float".equalsIgnoreCase(inputType)) { return new VarianceAggregator.FloatVarianceAggregator( name, metricFactory.makeFloatColumnSelector(fieldName) ); } else if ("long".equalsIgnoreCase(inputType)) { return new VarianceAggregator.LongVarianceAggregator( name, metricFactory.makeLongColumnSelector(fieldName) ); } else if ("variance".equalsIgnoreCase(inputType)) { return new VarianceAggregator.ObjectVarianceAggregator(name, selector); } throw new IAE( "Incompatible type for metric[%s], expected a float, long or variance, got a %s", fieldName, inputType ); }
Source:
<code>Point2D swtToPlot(int x, int y) { <START> Rectangle sdArea = PlotFrame.this.getScreenDataArea(); <END> final ValueAxis domainAxis = getChart().getXYPlot().getDomainAxis(); final ValueAxis rangeAxis = getChart().getXYPlot().getRangeAxis(); double xSize = domainAxis.getUpperBound() - domainAxis.getLowerBound(); double ySize = rangeAxis.getUpperBound() - rangeAxis.getLowerBound(); double relativeX = ((double) x - sdArea.x) / (sdArea.width); double relativeY = ((double) y - sdArea.y) / (sdArea.height); double realX = domainAxis.getLowerBound() + relativeX * xSize; double realY = rangeAxis.getUpperBound() - relativeY * ySize; return new Point2D.Double(realX, realY); }</code><technical_language>final</technical_language>

Target:
private final Point2D swtToPlot(int x, int y) { Rectangle rectangle = PlotFrame.this.getScreenDataArea(); final ValueAxis domainAxis = getChart().getXYPlot().getDomainAxis(); final ValueAxis rangeAxis = getChart().getXYPlot().getRangeAxis(); final double widthInAxisUnits = domainAxis.getUpperBound() - domainAxis.getLowerBound(); final double heightInAxisUnits = rangeAxis.getUpperBound() - rangeAxis.getLowerBound(); double relativeX = ((double) x - rectangle.x) / (rectangle.width); double relativeY = ((double) y - rectangle.y) / (rectangle.height); double xPlot = domainAxis.getLowerBound() + relativeX * widthInAxisUnits; double yPlot = rangeAxis.getUpperBound() - relativeY * heightInAxisUnits; return new Point2D.Double(xPlot, yPlot); }
Source:
<code>public static String extractDirNameFromAbsolutePath(String path) { if (path.endsWith("/") || path.endsWith(File.separator)) { path = path.substring(0, path.length() - 1); } int startIndex = path.lastIndexOf(File.separator); if (startIndex == -1) { startIndex = path.lastIndexOf("/"); } <START> return path.substring(startIndex + 1, path.length()); <END> }</code><technical_language>If is slash start index is -1 I more clear dont substring then, if (startIndex != -1) { .. } else { // directory return file as-is return path; }</technical_language>

Target:
public static String extractDirNameFromAbsolutePath(String path) { if (path.endsWith("/") || path.endsWith(File.separator)) { path = path.substring(0, path.length() - 1); } return FileUtil.stripPath(path); }
Source:
<code>private void testResponseRate() { feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.fillQuestionBox("new question"); feedbackEditPage.clickAddQuestionButton(); FeedbackResponseAttributes feedbackResponse = new FeedbackResponseAttributes( feedbackSessionName, courseId, "1", FeedbackQuestionType.TEXT, "tmms.test@gmail.tmt", Const.DEFAULT_SECTION, "alice.b.tmms@gmail.tmt", Const.DEFAULT_SECTION, new Text("Response from instructor to Alice")); BackDoor.createFeedbackResponse(feedbackResponse); ______TS("check response rate before editing question"); AppUrl feedbacksPageUrl = createUrl(Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE).withInstructorId(instructorId); <START> InstructorFeedbacksPage feedbacksPage = AppPage.getNewPageInstance(browser, feedbacksPageUrl, InstructorFeedbacksPage.class); <END> feedbacksPage.waitForPageToLoad(); assertEquals("1 / 1", feedbacksPage.getResponseValue(courseId, feedbackSessionName)); feedbackEditPage = getFeedbackEditPage(); feedbackEditPage.clickEditQuestionButton(1); feedbackEditPage.selectRecipientTypeForQuestion1("Other teams in the course"); feedbackEditPage.clickAndConfirmSaveForQuestion1(); ______TS("check response rate after editing question"); feedbacksPage = AppPage.getNewPageInstance(browser, feedbacksPageUrl, InstructorFeedbacksPage.class); feedbacksPage.waitForPageToLoad(); assertEquals("0 / 1", feedbacksPage.getResponseValue(courseId, feedbackSessionName)); feedbackEditPage = getFeedbackEditPage(); feedbackEditPage.clickAndConfirm(feedbackEditPage.getDeleteQuestionLink(1)); }</code><technical_language>Extract this a new method. Also, check if <code>AppPage#changePageType</code> is more suitable here</technical_language>

Target:
private void testResponseRate() { feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.fillQuestionBox("new question"); feedbackEditPage.clickAddQuestionButton(); FeedbackResponseAttributes feedbackResponse = new FeedbackResponseAttributes( feedbackSessionName, courseId, "1", FeedbackQuestionType.TEXT, "tmms.test@gmail.tmt", Const.DEFAULT_SECTION, "alice.b.tmms@gmail.tmt", Const.DEFAULT_SECTION, new Text("Response from instructor to Alice")); BackDoor.createFeedbackResponse(feedbackResponse); ______TS("check response rate before editing question"); InstructorFeedbacksPage feedbacksPage = navigateToInstructorFeedbacksPage(); assertEquals("1 / 1", feedbacksPage.getResponseValue(courseId, feedbackSessionName)); feedbackEditPage = getFeedbackEditPage(); feedbackEditPage.clickEditQuestionButton(1); feedbackEditPage.selectRecipientTypeForQuestion1("Other teams in the course"); feedbackEditPage.clickAndConfirmSaveForQuestion1(); ______TS("check response rate after editing question"); feedbacksPage = navigateToInstructorFeedbacksPage(); assertEquals("0 / 1", feedbacksPage.getResponseValue(courseId, feedbackSessionName)); feedbackEditPage = getFeedbackEditPage(); feedbackEditPage.clickAndConfirm(feedbackEditPage.getDeleteQuestionLink(1)); }
Source:
<code>public static boolean publishHTMLPage(IHTMLPage htmlPage, List relatedNotPublished, User user, boolean respectFrontendRoles ) throws WebAssetException, DotSecurityException, DotDataException { Logger.debug(PublishFactory.class, "*****I'm an HTML Page -- Publishing"); ContentletAPI contentletAPI = APILocator.getContentletAPI(); for ( Object asset : relatedNotPublished ) { if ( asset instanceof Contentlet ) { Logger.debug( PublishFactory.class, "*****I'm an HTML Page -- Publishing my Contentlet Child=" + ((Contentlet) asset).getInode() ); try { Contentlet c = (Contentlet) asset; if ( !APILocator.getWorkflowAPI().findSchemeForStruct( c.getStructure() ).isMandatory() ) { contentletAPI.publish( (Contentlet) asset, user, false ); <START> ContentletServices.invalidateLive(c); <END> } } catch ( DotSecurityException e ) { Logger.debug( PublishFactory.class, "publish html page: User has no permission to publish the content inode = " + ((Contentlet) asset).getInode() + " in the page, skipping it." ); } } else if ( asset instanceof Template ) { Logger.debug( PublishFactory.class, "*****I'm an HTML Page -- Publishing Template =" + ((Template) asset).getInode() ); publishAsset( (Template) asset, user, respectFrontendRoles, false ); } } PageServices.invalidateAll(htmlPage); if ( htmlPage instanceof HTMLPageAsset ) { APILocator.getContentletAPI().publish( (HTMLPageAsset) htmlPage, user, false ); } return true; }</code><technical_language>rename c contentlet</technical_language>

Target:
public static boolean publishHTMLPage(IHTMLPage htmlPage, List relatedNotPublished, User user, boolean respectFrontendRoles ) throws WebAssetException, DotSecurityException, DotDataException { Logger.debug(PublishFactory.class, "*****I'm an HTML Page -- Publishing"); ContentletAPI contentletAPI = APILocator.getContentletAPI(); for ( Object asset : relatedNotPublished ) { if ( asset instanceof Contentlet ) { Logger.debug( PublishFactory.class, "*****I'm an HTML Page -- Publishing my Contentlet Child=" + ((Contentlet) asset).getInode() ); try { Contentlet contentlet = (Contentlet) asset; if ( !APILocator.getWorkflowAPI().findSchemeForStruct( contentlet.getStructure() ).isMandatory() ) { contentletAPI.publish( (Contentlet) asset, user, false ); ContentletServices.invalidateLive(contentlet); } } catch ( DotSecurityException e ) { Logger.debug( PublishFactory.class, "publish html page: User has no permission to publish the content inode = " + ((Contentlet) asset).getInode() + " in the page, skipping it." ); } } else if ( asset instanceof Template ) { Logger.debug( PublishFactory.class, "*****I'm an HTML Page -- Publishing Template =" + ((Template) asset).getInode() ); publishAsset( (Template) asset, user, respectFrontendRoles, false ); } } PageServices.invalidateAll(htmlPage); if ( htmlPage instanceof HTMLPageAsset ) { APILocator.getContentletAPI().publish( (HTMLPageAsset) htmlPage, user, false ); } return true; }
Source:
<code>public EncounterTransaction save(EncounterTransaction encounterTransaction) { EncounterTransaction updatedEncounterTransaction = null; DbSession session = sessionFactory.getCurrentSession(); FlushMode flushMode = session.getFlushMode(); <START> session.setFlushMode(FlushMode.MANUAL); <END> try { updatedEncounterTransaction = saveInternal(encounterTransaction); } finally { session.setFlushMode(flushMode); } return updatedEncounterTransaction; }</code><technical_language>@Gaurav-Deshkar hibernate in service layer instead of data access layer sweet. :) point a failing unit test i if i some alternative suggestions</technical_language>

Target:
public EncounterTransaction save(EncounterTransaction encounterTransaction) { EncounterTransaction updatedEncounterTransaction = null; FlushMode flushMode = DbSessionUtil.getCurrentFlushMode(); DbSessionUtil.setManualFlushMode(); try { updatedEncounterTransaction = saveInternal(encounterTransaction); } finally { DbSessionUtil.setFlushMode(flushMode); } return updatedEncounterTransaction; }
Source:
<code>public void initParam(Object obj) { OptionsParam options = (OptionsParam) obj; OptionsParamCertificate certParam = options.getCertificateParam(); if(overrideEnableClientCertificate) { <START> certParam.setEnableCertificate(true); <END> useClientCertificateCheckBox.setSelected(certParam.isUseClientCert()); useClientCertificateCheckBoxActionPerformed(null); overrideEnableClientCertificate = false; } else { useClientCertificateCheckBox.setSelected(certParam.isUseClientCert()); } enableUnsafeSSLRenegotiationCheckBox.setSelected(certParam.isAllowUnsafeSslRenegotiation()); }</code><technical_language>need call this, OptionsParamCertificate enables certificate</technical_language>

Target:
public void initParam(Object obj) { OptionsParam options = (OptionsParam) obj; OptionsParamCertificate certParam = options.getCertificateParam(); if(overrideEnableClientCertificate) { certParam.setEnableCertificate(true); overrideEnableClientCertificate = false; } useClientCertificateCheckBox.setSelected(certParam.isUseClientCert()); useClientCertificateCheckBoxActionPerformed(null); enableUnsafeSSLRenegotiationCheckBox.setSelected(certParam.isAllowUnsafeSslRenegotiation()); }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (backupService == null) { SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this); } String url = ((HttpServletRequest) request).getRequestURI(); <START> if (isFilesAPI(url)) { <END> chain.doFilter(request, response); return; } if (isBackupFinishJsonUrl(url)) { ((HttpServletResponse) response).setHeader("Cache-Control", "private, max-age=0, no-cache"); ((HttpServletResponse) response).setDateHeader("Expires", 0); generateResponseForIsBackupFinishedAPI(response); return; } if (backupService.isBackingUp()) { ((HttpServletResponse) response).setHeader("Cache-Control", "private, max-age=0, no-cache"); ((HttpServletResponse) response).setDateHeader("Expires", 0); if (isAPIUrl(url) && !isMessagesJson(url)) { generateAPIResponse(request, response); } else { generateHTMLResponse(response); } ((HttpServletResponse) response).setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } else { chain.doFilter(request, response); } }</code><technical_language>@ketan Rethinking this, if this is a good idea. calls [such this](<LINK_0> affect DB, while a backup is in progress</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (backupService == null) { SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this); } String url = ((HttpServletRequest) request).getRequestURI(); if (isBackupFinishJsonUrl(url)) { ((HttpServletResponse) response).setHeader("Cache-Control", "private, max-age=0, no-cache"); ((HttpServletResponse) response).setDateHeader("Expires", 0); generateResponseForIsBackupFinishedAPI(response); return; } if (backupService.isBackingUp()) { ((HttpServletResponse) response).setHeader("Cache-Control", "private, max-age=0, no-cache"); ((HttpServletResponse) response).setDateHeader("Expires", 0); if (isAPIUrl(url) && !isMessagesJson(url)) { generateAPIResponse(request, response); } else { generateHTMLResponse(response); } ((HttpServletResponse) response).setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } else { chain.doFilter(request, response); } }
Source:
<code>public InternalCacheEntry<WrappedBytes, WrappedBytes> put(WrappedBytes key, InternalCacheEntry<WrappedBytes, WrappedBytes> value) { InternalCacheEntry<WrappedBytes, WrappedBytes> returnedValue; int hashCode = key.hashCode(); boolean shouldFree = true; long newAddress = offHeapEntryFactory.create(key, hashCode, value.getValue(), value.getMetadata()); try { int lockOffset = getLockOffset(hashCode); Lock lock = locks.getLockWithOffset(lockOffset).writeLock(); lock.lock(); try { checkDeallocation(); ensureTransferred(lockOffset); int memoryOffset = getMemoryOffset(hashCode); long address = memoryLookup.getMemoryAddressOffset(memoryOffset); returnedValue = performPut(address, 0, newAddress, key, memoryOffset, true, false); shouldFree = false; } finally { lock.unlock(); } } finally { if (shouldFree) { <START> allocator.deallocate(newAddress, offHeapEntryFactory.getSize(newAddress, false)); <END> } } if (returnedValue == null) { checkResize(); } return returnedValue; }</code><technical_language>deallocate in catch (Throwable) remove shouldFree, method is more (the version free allocated memory if performPut failed). OTOH I wrong moving allocation lock: allocation first, allow more memory allocated eviction limit, more lockCount threads in put()</technical_language>

Target:
public InternalCacheEntry<WrappedBytes, WrappedBytes> put(WrappedBytes key, InternalCacheEntry<WrappedBytes, WrappedBytes> value) { InternalCacheEntry<WrappedBytes, WrappedBytes> returnedValue; int hashCode = key.hashCode(); int lockOffset = getLockOffset(hashCode); Lock lock = locks.getLockWithOffset(lockOffset).writeLock(); lock.lock(); try { checkDeallocation(); ensureTransferred(lockOffset); int memoryOffset = getMemoryOffset(hashCode); long address = memoryLookup.getMemoryAddressOffset(memoryOffset); long newAddress = offHeapEntryFactory.create(key, hashCode, value.getValue(), value.getMetadata()); returnedValue = performPut(address, 0, newAddress, key, memoryOffset, true, false); } finally { lock.unlock(); } if (returnedValue == null) { checkResize(); } return returnedValue; }
Source:
<code>public void batchDelete(List<Entitlement> entitlements) { for (Entitlement ent : entitlements) { <START> log.debug("Deleting entitlement: " + ent); <END> log.debug("certs.size = " + ent.getCertificates().size()); for (EntitlementCertificate cert : ent.getCertificates()) { getEntityManager().remove(cert); } ent.getCertificates().clear(); getEntityManager().remove(ent); } for (Entitlement ent : entitlements) { ent.getCertificates().clear(); ent.getConsumer().getEntitlements().remove(ent); } }</code><technical_language>Please placeholders</technical_language>

Target:
public void batchDelete(List<Entitlement> entitlements) { for (Entitlement ent : entitlements) { log.debug("Deleting entitlement: {}", ent); log.debug("certs.size = {}", ent.getCertificates().size()); for (EntitlementCertificate cert : ent.getCertificates()) { getEntityManager().remove(cert); } ent.getCertificates().clear(); getEntityManager().remove(ent); } for (Entitlement ent : entitlements) { ent.getCertificates().clear(); ent.getConsumer().getEntitlements().remove(ent); } }
Source:
<code>public void extend() { BackupFilesManager backupFilesManager = new BackupFilesManager( config.getStringProperty(MESSAGES_LOCAL_STORAGE_DIRECTORY), <START> clock); <END> if (config.getBooleanProperty(MESSAGES_LOCAL_STORAGE_V2_MIGRATION_ENABLED)) { List<File> temporaryBackupV2Files = backupFilesManager.getTemporaryBackupV2Files(); hooksHandler.addStartupHook((s) -> { temporaryBackupV2Files.forEach(f -> loadTemporaryBackupV2Messages(backupFilesManager, f)); backupMessagesLoader.clearTopicsAvailabilityCache(); }); } backupFilesManager.rolloverBackupFileIfExists(); List<File> rolledBackupFiles = backupFilesManager.getRolledBackupFiles(); if (!rolledBackupFiles.isEmpty()) { logger.info("Backup files were found. Number of files: {}. Files: {}", rolledBackupFiles.size(), rolledBackupFiles.stream().map(File::getName).collect(joining(", "))); hooksHandler.addStartupHook((s) -> { rolledBackupFiles.forEach(f -> loadOldMessages(backupFilesManager, f)); backupMessagesLoader.clearTopicsAvailabilityCache(); }); } if (config.getBooleanProperty(MESSAGES_LOCAL_STORAGE_ENABLED)) { int backupStorageSizeInBytes = config.getIntProperty(MESSAGES_LOCAL_STORAGE_SIZE_MB) * MEGABYTES_TO_BYTES_MULTIPLIER; int entries = backupStorageSizeInBytes / config.getIntProperty(MESSAGES_LOCAL_STORAGE_AVERAGE_MESSAGE_SIZE); int avgMessageSize = config.getIntProperty(MESSAGES_LOCAL_STORAGE_AVERAGE_MESSAGE_SIZE); MessageRepository repository = config.getBooleanProperty(MESSAGES_LOCAL_STORAGE_SIZE_REPORTING_ENABLED) ? ChronicleMapMessageRepository.create(backupFilesManager.getCurrentBackupFile(), hermesMetrics, entries, avgMessageSize) : ChronicleMapMessageRepository.create(backupFilesManager.getCurrentBackupFile(), entries, avgMessageSize); BrokerListener brokerListener = new BrokerListener(repository); listeners.addAcknowledgeListener(brokerListener); listeners.addErrorListener(brokerListener); listeners.addTimeoutListener(brokerListener); } }</code><technical_language>This method is long, divide smaller more readable parts</technical_language>

Target:
public void extend() { BackupFilesManager backupFilesManager = new BackupFilesManager( config.getStringProperty(MESSAGES_LOCAL_STORAGE_DIRECTORY), clock); long backupStorageSizeInBytes = config.getLongProperty(MESSAGES_LOCAL_BUFFERED_STORAGE_SIZE); entries = (int) (backupStorageSizeInBytes / config.getIntProperty(MESSAGES_LOCAL_STORAGE_AVERAGE_MESSAGE_SIZE)); avgMessageSize = config.getIntProperty(MESSAGES_LOCAL_STORAGE_AVERAGE_MESSAGE_SIZE); if (config.getBooleanProperty(MESSAGES_LOCAL_STORAGE_V2_MIGRATION_ENABLED)) { loadTemporaryBackupV2Files(backupFilesManager); } backupFilesManager.rolloverBackupFileIfExists(); List<File> rolledBackupFiles = backupFilesManager.getRolledBackupFiles(); if (!rolledBackupFiles.isEmpty()) { rollBackupFiles(backupFilesManager, rolledBackupFiles); } if (config.getBooleanProperty(MESSAGES_LOCAL_STORAGE_ENABLED)) { enableLocalStorage(backupFilesManager); } }
Source:
<code>public static void createQueue(String projectId, String locationId, String queueId) <START> throws Exception { <END> try (CloudTasksClient client = CloudTasksClient.create()) { String parent = LocationName.of(projectId, locationId).toString(); String queuePath = QueueName.of(projectId, locationId, queueId).toString(); Queue queue = client.createQueue(parent, Queue.newBuilder().setName(queuePath).build()); System.out.println("Queue created: " + queue.getName()); } }</code><technical_language>chance more specific</technical_language>

Target:
public static void createQueue(String projectId, String locationId, String queueId) throws IOException { try (CloudTasksClient client = CloudTasksClient.create()) { String parent = LocationName.of(projectId, locationId).toString(); String queuePath = QueueName.of(projectId, locationId, queueId).toString(); Queue queue = client.createQueue(parent, Queue.newBuilder().setName(queuePath).build()); System.out.println("Queue created: " + queue.getName()); } }
Source:
<code>public QueryControlResult create(final Tuple<String, AvroOperatorChainDag> tuple) { final QueryControlResult queryControlResult = new QueryControlResult(); queryControlResult.setQueryId(tuple.getKey()); try { planStore.saveAvroOpChainDag(tuple); final LogicalAndExecutionDag logicalAndExecutionDag = dagGenerator.generate(tuple); final String queryId = tuple.getKey(); logicalDagMap.putIfAbsent(queryId, logicalAndExecutionDag.getLogicalDag()); final String groupId = tuple.getValue().getGroupId(); if (!groupInfoMap.containsKey(groupId)) { <START> groupInfoMap.put(groupId, Tang.Factory.getTang().newInjector().getInstance(GroupInfo.class)); <END> } groupInfoMap.get(groupId).addQueryIdToGroup(queryId); queryStarter.start(logicalAndExecutionDag.getExecutionDag()); queryControlResult.setIsSuccess(true); queryControlResult.setMsg(ResultMessage.submitSuccess(tuple.getKey())); return queryControlResult; } catch (final Exception e) { LOG.log(Level.SEVERE, "An exception occurred while starting {0} query: {1}", new Object[] {tuple.getKey(), e.getMessage()}); queryControlResult.setIsSuccess(false); queryControlResult.setMsg(e.getMessage()); return queryControlResult; } }</code><technical_language>This executed concurrently</technical_language>

Target:
public QueryControlResult create(final Tuple<String, AvroOperatorChainDag> tuple) { final QueryControlResult queryControlResult = new QueryControlResult(); queryControlResult.setQueryId(tuple.getKey()); try { planStore.saveAvroOpChainDag(tuple); final LogicalAndExecutionDag logicalAndExecutionDag = dagGenerator.generate(tuple); final String queryId = tuple.getKey(); logicalDagMap.putIfAbsent(queryId, logicalAndExecutionDag.getLogicalDag()); final String groupId = tuple.getValue().getGroupId(); if (!groupInfoMap.containsKey(groupId)) { groupInfoMap.putIfAbsent(groupId, Tang.Factory.getTang().newInjector().getInstance(GroupInfo.class)); } groupInfoMap.get(groupId).addQueryIdToGroup(queryId); queryStarter.start(logicalAndExecutionDag.getExecutionDag()); queryControlResult.setIsSuccess(true); queryControlResult.setMsg(ResultMessage.submitSuccess(tuple.getKey())); return queryControlResult; } catch (final Exception e) { LOG.log(Level.SEVERE, "An exception occurred while starting {0} query: {1}", new Object[] {tuple.getKey(), e.toString()}); queryControlResult.setIsSuccess(false); queryControlResult.setMsg(e.getMessage()); return queryControlResult; } }
Source:
<code>private UserLayer store(SimpleFeatureCollection fc, String uuid, Map<String, String> formParams) throws ActionParamsException { try { UserLayer userLayer = createUserLayer(fc, uuid, formParams); UserLayerStyle userLayerStyle = createUserLayerStyle(formParams); List<UserLayerData> userLayerDataList = UserLayerDataService.createUserLayerData(fc, uuid); <START> userLayer.setFeatures_count(userLayerDataList.size()); <END> userLayer.setFeatures_skipped(fc.size() - userLayerDataList.size()); userLayerService.insertUserLayer(userLayer, userLayerStyle, userLayerDataList); return userLayer; } catch (JSONException e) { throw new ActionParamsException("Failed to encode feature as GeoJSON"); } catch (ServiceException e) { throw new ActionParamsException("Failed to store features to database", UserLayerHandlerHelper.createErrorJSON(e.getMessage())); } }</code><technical_language>Nice catch</technical_language>

Target:
private UserLayer store(SimpleFeatureCollection fc, String uuid, Map<String, String> formParams) throws UserLayerException { UserLayer userLayer = createUserLayer(fc, uuid, formParams); UserLayerStyle userLayerStyle = createUserLayerStyle(formParams); List<UserLayerData> userLayerDataList = UserLayerDataService.createUserLayerData(fc, uuid); userLayer.setFeatures_count(userLayerDataList.size()); userLayer.setFeatures_skipped(fc.size() - userLayerDataList.size()); userLayerService.insertUserLayer(userLayer, userLayerStyle, userLayerDataList); return userLayer; }
Source:
<code>private void clearRoutingDataPath() { for (String zkRealm : _baseAccessor <START> .getChildNames(MetadataStoreRoutingConstants.ROUTING_DATA_PATH, AccessOption.PERSISTENT)) { _baseAccessor.remove(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + zkRealm, AccessOption.PERSISTENT); <END> } }</code><technical_language>Nit: of helix-core module, try ZkClient instead of BaseDataAccessor</technical_language>

Target:
private void clearRoutingDataPath() throws Exception { Assert.assertTrue(TestHelper.verify(() -> { for (String zkRealm : _zkClient .getChildren(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)) { _zkClient.delete(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + zkRealm); } return _zkClient.getChildren(MetadataStoreRoutingConstants.ROUTING_DATA_PATH).isEmpty(); }, TestHelper.WAIT_DURATION), "Routing data path should be deleted after the tests."); }
Source:
<code>private Gateway3DSAuthorisationResponse authorise3DSSource(Auth3dsResponseGatewayRequest request) { try { Response authorisationResponse = createChargeFor3DSSource(request, request.getTransactionId().get()); StripeAuthorisationResponse stripeAuthResponse = new StripeAuthorisationResponse(authorisationResponse.readEntity(StripeCreateChargeResponse.class)); return Gateway3DSAuthorisationResponse.of(stripeAuthResponse.authoriseStatus(), stripeAuthResponse.getTransactionId()); } catch (GatewayClientException e) { Response response = e.getResponse(); <START> int status = response.getStatus(); <END> if (status == HttpStatus.SC_UNAUTHORIZED) { Gateway3DSAuthorisationResponse.of(BaseAuthoriseResponse.AuthoriseStatus.ERROR); } StripeErrorResponse stripeErrorResponse = response.readEntity(StripeErrorResponse.class); String errorId = UUID.randomUUID().toString(); logger.error("Authorisation failed for charge {}. Failure code from Stripe: {}, failure message from Stripe: {}. ErrorId: {}. Response code from Stripe: {}", request.getChargeExternalId(), stripeErrorResponse.getError().getCode(), stripeErrorResponse.getError().getMessage(), errorId, response.getStatus()); return Gateway3DSAuthorisationResponse.of(BaseAuthoriseResponse.AuthoriseStatus.REJECTED); } catch (DownstreamException e) { logger.error(format("Unexpected HTTP status code %s from gateway, error=[%s]", e.getStatusCode(), e.getMessage()), e); return Gateway3DSAuthorisationResponse.of(BaseAuthoriseResponse.AuthoriseStatus.EXCEPTION); } catch (GatewayException e) { logger.error(format("Authorisation exception for gateway url=%s, [cause=%s]", e.getUrl(), e.getCause()), e); return Gateway3DSAuthorisationResponse.of(BaseAuthoriseResponse.AuthoriseStatus.EXCEPTION); } }</code><technical_language>need do this</technical_language>

Target:
private Gateway3DSAuthorisationResponse authorise3DSSource(Auth3dsResponseGatewayRequest request) { try { Response authorisationResponse = createChargeFor3DSSource(request, request.getTransactionId().get()); StripeAuthorisationResponse stripeAuthResponse = new StripeAuthorisationResponse(authorisationResponse.readEntity(StripeCreateChargeResponse.class)); return Gateway3DSAuthorisationResponse.of(stripeAuthResponse.authoriseStatus(), stripeAuthResponse.getTransactionId()); } catch (GatewayClientException e) { Response response = e.getResponse(); if (response.getStatus() == HttpStatus.SC_UNAUTHORIZED) { return Gateway3DSAuthorisationResponse.of(BaseAuthoriseResponse.AuthoriseStatus.ERROR); } StripeErrorResponse stripeErrorResponse = response.readEntity(StripeErrorResponse.class); logger.error("3DS Authorisation failed for charge {}. Failure code from Stripe: {}, failure message from Stripe: {}. Response code from Stripe: {}", request.getChargeExternalId(), stripeErrorResponse.getError().getCode(), stripeErrorResponse.getError().getMessage(), response.getStatus()); return Gateway3DSAuthorisationResponse.of(BaseAuthoriseResponse.AuthoriseStatus.REJECTED); } catch (DownstreamException | GatewayException e) { return Gateway3DSAuthorisationResponse.of(BaseAuthoriseResponse.AuthoriseStatus.EXCEPTION); } }
Source:
<code>public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_pocketpaint_more_options, menu); <START> presenter.removeMoreOptionsItems(); <END> return true; }</code><technical_language>Please move menu arguments</technical_language>

Target:
public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_pocketpaint_more_options, menu); presenter.removeMoreOptionsItems(menu); return true; }
Source:
<code>Optional<byte []> modifyIfNecessaryDeploymentHostCount(DeploymentType deployment, int hostCount) { Optional<byte[]> deploymentBytes = Optional.empty(); if ((deployment.getCluster().getKfactor()+1) > hostCount) { VoltDB.crashLocalVoltDB( <START> "Number cluster members " + hostCount + " must greater than ksafety " <END> + deployment.getCluster().getKfactor(), false, null ); return null; } if (deployment.getCluster().getHostcount() != hostCount) { deployment.getCluster().setHostcount(hostCount); String remarshalled = null; try { remarshalled = CatalogUtil.getDeployment(deployment, true ); } catch (IOException|RuntimeException e) { VoltDB.crashLocalVoltDB("Unable to marshal deployment configuration", false, e); return null; } deploymentBytes = Optional.of(remarshalled.getBytes(StandardCharsets.UTF_8)); try (FileWriter fw = new FileWriter(getConfigLogDeployment())) { fw.write(remarshalled); } catch (IOException|RuntimeException e) { VoltDB.crashLocalVoltDB("Unable to marshal deployment configuration", false, e); return null; } } return deploymentBytes; }</code><technical_language>Number "of"</technical_language>

Target:
Optional<byte []> modifyIfNecessaryDeploymentHostCount(DeploymentType deployment, int hostCount) { Optional<byte[]> deploymentBytes = Optional.empty(); if ((deployment.getCluster().getKfactor()+1) > hostCount) { VoltDB.crashLocalVoltDB( "Number of cluster members " + hostCount + " must greater than ksafety " + deployment.getCluster().getKfactor(), false, null ); return Optional.empty(); } if (deployment.getCluster().getHostcount() != hostCount) { deployment.getCluster().setHostcount(hostCount); String remarshalled = null; try { remarshalled = CatalogUtil.getDeployment(deployment, true ); } catch (IOException|RuntimeException e) { VoltDB.crashLocalVoltDB("Unable to marshal deployment configuration", false, e); return Optional.empty(); } deploymentBytes = Optional.of(remarshalled.getBytes(StandardCharsets.UTF_8)); try (FileWriter fw = new FileWriter(getConfigLogDeployment())) { fw.write(remarshalled); } catch (IOException|RuntimeException e) { VoltDB.crashLocalVoltDB("Unable to marshal deployment configuration", false, e); return Optional.empty(); } } return deploymentBytes; }
Source:
<code>public static String removeTimezone(String timeWithTimezone) throws CoreException { Matcher mb = PATTERN_TIME.matcher(timeWithTimezone); if (mb.find()) { return mb.group(); } throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, timeWithTimezone <START> + " is not a valide time")); <END> }</code><technical_language>"valid" instead of "valide". NLS.bind() construct message</technical_language>

Target:
public static String removeTimezone(String timeWithTimezone) throws CoreException { Matcher matcher = TIME_STAMP_PATTERN.matcher(timeWithTimezone); if (matcher.find()) { return matcher.group(); } throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, NLS.bind( "{0} is not a valid time", timeWithTimezone))); }
Source:
<code>private BufferedReader createBufferedReader(FileEntry fileEntry) throws IOException { if (fileEntry.file.exists() && fileEntry.file.canRead() && fileEntry.file.isFile()) { FileInputStream fis = new FileInputStream(fileEntry.file); InputStreamReader isr = null; String charsetName = fileEntry.charSetEncoding; if(!JOrphanUtils.isBlank(charsetName)) { isr = new InputStreamReader(fis, charsetName); } else { isr = new InputStreamReader(fis); } return new BufferedReader(isr); } else { <START> throw new IllegalArgumentException("File "+ fileEntry.file.getName()+ " must exist and be readable"); <END> } }</code><technical_language>Please move else branch start of method</technical_language>

Target:
private BufferedReader createBufferedReader(FileEntry fileEntry) throws IOException { if (!fileEntry.file.canRead() || !fileEntry.file.isFile()) { throw new IllegalArgumentException("File "+ fileEntry.file.getName()+ " must exist and be readable"); } FileInputStream fis = new FileInputStream(fileEntry.file); InputStreamReader isr = null; String charsetName = fileEntry.charSetEncoding; if(!JOrphanUtils.isBlank(charsetName)) { isr = new InputStreamReader(fis, charsetName); } else { isr = new InputStreamReader(fis); } return new BufferedReader(isr); }
Source:
<code>private CastType getCastType(final Type castFrom, final Type castTo) { <START> String cast = castFrom + " " + castTo; <END> switch (cast) { case "INT_TYPE STRING_TYPE": case "FLOAT_TYPE STRING_TYPE": case "DOUBLE_TYPE STRING_TYPE": case "LONG_TYPE STRING_TYPE": case "DATETIME_TYPE STRING_TYPE": return CastType.TOSTR; case "LONG_TYPE INT_TYPE": return CastType.LONGTOINT; case "FLOAT_TYPE INT_TYPE": case "DOUBLE_TYPE INT_TYPE": return CastType.FLOATSTOINT; case "INT_TYPE FLOAT_TYPE": case "LONG_TYPE FLOAT_TYPE": case "DOUBLE_TYPE FLOAT_TYPE": return CastType.NUMTOFLOAT; case "INT_TYPE DOUBLE_TYPE": case "LONG_TYPE DOUBLE_TYPE": case "FLOAT_TYPE DOUBLE_TYPE": return CastType.NUMTODOUBLE; case "INT_TYPE LONG_TYPE": return CastType.INTTOLONG; case "FLOAT_TYPE LONG_TYPE": case "DOUBLE_TYPE LONG_TYPE": return CastType.FLOATSTOLONG; case "STRING_TYPE INT_TYPE": return CastType.STRTOINT; case "STRING_TYPE FLOAT_TYPE": return CastType.STRTOFLOAT; case "STRING_TYPE DOUBLE_TYPE": return CastType.STRTODOUBLE; case "STRING_TYPE LONG_TYPE": return CastType.STRTOLONG; default: break; } return CastType.UNSUPPORTED; }</code><technical_language>I a poll (@domoritz @7andrew7 present) voted this code is good code. Suggest a series of if statements instead: java if (castTo == Type.STRING_TYPE) { return CastType.TOSTR; } etc. Also, I if CastType fields _ separating words? E.g., TO_STR instead of TOSTR</technical_language>

Target:
private CastType getCastType(final Type castFrom, final Type castTo) { switch (castFrom + "|" + castTo) { case "INT_TYPE|STRING_TYPE": case "FLOAT_TYPE|STRING_TYPE": case "DOUBLE_TYPE|STRING_TYPE": case "LONG_TYPE|STRING_TYPE": case "DATETIME_TYPE|STRING_TYPE": return CastType.TO_STR; case "LONG_TYPE|INT_TYPE": return CastType.LONG_TO_INT; case "FLOAT_TYPE|INT_TYPE": case "DOUBLE_TYPE|INT_TYPE": return CastType.FLOATS_TO_INT; case "INT_TYPE|FLOAT_TYPE": case "LONG_TYPE|FLOAT_TYPE": return CastType.INT_OR_LONG_TO_FLOAT; case "DOUBLE_TYPE|FLOAT_TYPE": return CastType.DOUBLE_TO_FLOAT; case "INT_TYPE|DOUBLE_TYPE": case "LONG_TYPE|DOUBLE_TYPE": case "FLOAT_TYPE|DOUBLE_TYPE": return CastType.NUM_TO_DOUBLE; case "INT_TYPE|LONG_TYPE": return CastType.INT_TO_LONG; case "FLOAT_TYPE|LONG_TYPE": case "DOUBLE_TYPE|LONG_TYPE": return CastType.FLOATS_TO_LONG; case "STRING_TYPE|INT_TYPE": return CastType.STR_TO_INT; case "STRING_TYPE|FLOAT_TYPE": return CastType.STR_TO_FLOAT; case "STRING_TYPE|DOUBLE_TYPE": return CastType.STR_TO_DOUBLE; case "STRING_TYPE|LONG_TYPE": return CastType.STR_TO_LONG; default: break; } return CastType.UNSUPPORTED; }
Source:
<code>public void update() { Stock updatedStock = (Stock) priceSetterSubject.getUpdate(); if (market.getStockForSymbol(updatedStock.getSymbol()) == null) { return; } <START> if (history.containsKey(updatedStock.getSymbol())) { List<Double> priceList = history.get(updatedStock.getSymbol()); priceList.add(updatedStock.getPrice()); history.put(updatedStock.getSymbol(), priceList); } else { List<Double> priceList = new ArrayList<Double>(); priceList.add(updatedStock.getPrice()); history.put(updatedStock.getSymbol(), priceList); } <END> }</code><technical_language>functionality, consider moving priceList.add() history.put() if else statement</technical_language>

Target:
public void update() { Stock updatedStock = (Stock) priceSetterSubject.getUpdate(); if (market.getStockForSymbol(updatedStock.getSymbol()) == null) { return; } if (history.containsKey(updatedStock.getSymbol())) { List<Double> priceList = history.get(updatedStock.getSymbol()); } else { List<Double> priceList = new ArrayList<Double>(); } priceList.add(updatedStock.getPrice()); history.put(updatedStock.getSymbol(), priceList); }
Source:
<code>private void runEarlyStartup(Object executableExtension) { if (executableExtension instanceof IStartup) { String methodName = executableExtension.getClass().getName() + ".earlyStartup"; try { UIStats.start(UIStats.EARLY_STARTUP, methodName); ((IStartup) executableExtension).earlyStartup(); } finally { UIStats.end(UIStats.EARLY_STARTUP, executableExtension, methodName); } } else { String message = executableExtension == null ? <START> "The startup extension from '" + extension.getNamespaceIdentifier() END> + "' does not provide a valid class attribute." : MessageFormat.format("Startup class {0} must implement org.eclipse.ui.IStartup", executableExtension.getClass().getName()); IStatus status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, message, null); WorkbenchPlugin.log(status); } }</code><technical_language>missed in review. I (I this in Gerrit review for this issue): org.eclipse.ui.IStartup extenstion instead of "The startup extension"</technical_language>

Target:
private void runEarlyStartup(Object executableExtension) { if (executableExtension instanceof IStartup) { String methodName = executableExtension.getClass().getName() + ".earlyStartup"; try { UIStats.start(UIStats.EARLY_STARTUP, methodName); ((IStartup) executableExtension).earlyStartup(); } finally { UIStats.end(UIStats.EARLY_STARTUP, executableExtension, methodName); } } else { String message = executableExtension == null ? "The org.eclipse.ui.IStartup extension from '" + extension.getNamespaceIdentifier() + "' does not provide a valid class attribute." : MessageFormat.format("Startup class {0} must implement org.eclipse.ui.IStartup", executableExtension.getClass().getName()); IStatus status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, message, null); WorkbenchPlugin.log(status); } }
Source:
<code>public void internalRun() throws Exception { if (help) { handler.logInfo("\nfull export: metadata-export -f filename"); handler.logInfo("partial export: metadata-export -i handle -f filename"); printHelp(); return; } DSpaceCSV dSpaceCSV = metadataDSpaceCsvExportService .handleExport(context, exportAllItems, exportAllMetadata, handle, handler); handler.writeFilestream(context, filename, dSpaceCSV.getInputStream(), "exportCSV"); context.restoreAuthSystemState(); <START> context.complete(); <END> }</code><technical_language>method complete() a Context create. This unintended consequences (as a completed Context longer used)</technical_language>

Target:
public void internalRun() throws Exception { if (help) { handler.logInfo("\nfull export: metadata-export -f filename"); handler.logInfo("partial export: metadata-export -i handle -f filename"); printHelp(); return; } Context context = new Context(); context.turnOffAuthorisationSystem(); try { context.setCurrentUser(ePersonService.find(context, this.getEpersonIdentifier())); } catch (SQLException e) { handler.handleException(e); } DSpaceCSV dSpaceCSV = metadataDSpaceCsvExportService .handleExport(context, exportAllItems, exportAllMetadata, handle, handler); handler.writeFilestream(context, filename, dSpaceCSV.getInputStream(), EXPORT_CSV); context.restoreAuthSystemState(); context.complete(); }
Source:
<code>protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { FirebaseConfig firebaseConfig = new FirebaseConfig.Builder( String.format("https://%s", remaining), <START> (String) parameters.get("rootReference"), <END> (String) parameters.get("serviceAccountFile")) .build(); firebaseConfig.init(); Endpoint endpoint = new FirebaseEndpoint(uri, this, firebaseConfig); setProperties(endpoint, parameters); return endpoint; }</code><technical_language>getAndRemoveParameter(parameters, "xxx") instead OOTB</technical_language>

Target:
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { FirebaseConfig firebaseConfig = new FirebaseConfig.Builder( String.format("https://%s", remaining), getAndRemoveParameter(parameters, "rootReference", String.class), getAndRemoveParameter(parameters, "serviceAccountFile", String.class)) .build(); firebaseConfig.init(); Endpoint endpoint = new FirebaseEndpoint(uri, this, firebaseConfig); setProperties(endpoint, parameters); return endpoint; }
Source:
<code>public void listsDocs() throws IOException { final String label = "lists"; final String name = "lists-exists"; <START> final Bucket bucket = this.mockBucket(label, name); <END> final List<String> expected = Arrays.asList( name, String.format("sub%sfile", File.separator) ); final List<String> names = new AwsDocs(bucket, label).names(); Collections.sort(names); MatcherAssert.assertThat(names, Matchers.equalTo(expected)); }</code><technical_language>@dmzaytsev Paths.get("sub", "file").toString()</technical_language>

Target:
public void listsDocs() throws IOException { final String label = "lists"; final String name = "lists-exists"; final Bucket bucket = this.mockBucket(label, name); final List<String> expected = Arrays.asList( name, Paths.get("sub", "file").toString() ); final List<String> names = new AwsDocs(bucket, label).names(); Collections.sort(names); MatcherAssert.assertThat(names, Matchers.equalTo(expected)); }
Source:
<code>public static StarlarkInt add(StarlarkInt x, StarlarkInt y) { if (x instanceof Int32 && y instanceof Int32) { long xl = ((Int32) x).v; long yl = ((Int32) y).v; return StarlarkInt.of(xl + yl); } try { long xl = x.toLongFast(); long yl = y.toLongFast(); <START> long r = xl + yl; <END> boolean overflow = ((xl >= 0) != (r >= 0)) && ((yl >= 0) != (r >= 0)); if (!overflow) { return StarlarkInt.of(r); } } catch (OverflowException ignore) { } BigInteger xbig = x.toBigInteger(); BigInteger ybig = y.toBigInteger(); BigInteger zbig = xbig.add(ybig); return StarlarkInt.of(zbig); }</code><technical_language>Please consistent names: operands x y, result is z. suffixes i l denote int long</technical_language>

Target:
public static StarlarkInt add(StarlarkInt x, StarlarkInt y) { if (x instanceof Int32 && y instanceof Int32) { long xl = ((Int32) x).v; long yl = ((Int32) y).v; return StarlarkInt.of(xl + yl); } try { long xl = x.toLongFast(); long yl = y.toLongFast(); long zl = xl + yl; boolean overflow = ((xl ^ zl) & (yl ^ zl)) < 0; if (!overflow) { return StarlarkInt.of(zl); } } catch (Overflow unused) { } BigInteger xbig = x.toBigInteger(); BigInteger ybig = y.toBigInteger(); BigInteger zbig = xbig.add(ybig); return StarlarkInt.of(zbig); }
Source:
<code><START> public Iterable<String> getLinks() { <END> return EnvUtil.splitAtCommasAndTrim(links); }</code><technical_language>leave List<String> return type ? other methods in RunImageConfiguration return a List for collections, is generic type here, I uniform</technical_language>

Target:
public List<String> getLinks() { return EnvUtil.splitAtCommasAndTrim(links); }
Source:
<code>public void validateAndUpdateCertificate() throws CertificateManagerException { if (isHashTokenEmpty()) { <START> if (service.validateTrustStorePassKey(trustStorePasskey)) { <END> String hashToken = service.getHashToken(trustStorePasskey); saveHashToken(hashToken); RequestContext.getCurrentInstance().execute("PF('editPassKeyDlg').hide();"); updateSelectedCertificateTS(hashToken); trustStorePasskey = null; } else { HelperUtil.addMessageError(EDIT_PASS_ERROR_MSG, INVALID_PASS_ERR_MSG); } } else { updateSelectedCertificateTS(getHashTokenFromSession()); } }</code><technical_language>remove validation client</technical_language>

Target:
public void validateAndUpdateCertificate() throws CertificateManagerException { if (isHashTokenEmpty()) { String hashToken = service.getHashToken(trustStorePasskey); if (updateSelectedCertificateTS(hashToken)) { saveHashToken(hashToken); RequestContext.getCurrentInstance().execute("PF('editPassKeyDlg').hide();"); } else { HelperUtil.addMessageError(EDIT_PASS_ERROR_MSG, BAD_MISMATCH_TOKEN); } } else { updateSelectedCertificateTS(getHashTokenFromSession()); } trustStorePasskey = null; }
Source:
<code>public void pushNonExistentImage() throws Exception { <END> exception.expect(DockerClientException.class); dockerRule.getClient().pushImageCmd(username + "/xxx") .exec(new PushImageResultCallback()) .awaitSuccess(); }</code><technical_language>errors for api versions, i spent a lot of time in this place</technical_language>

Target:
public void pushNonExistentImage() throws Exception { if (isNotSwarm(dockerRule.getClient()) && getVersion(dockerRule.getClient()) .isGreaterOrEqual(RemoteApiVersion.VERSION_1_24)) { exception.expect(DockerClientException.class); } else { exception.expect(NotFoundException.class); } dockerRule.getClient().pushImageCmd(username + "/xxx") .exec(new PushImageResultCallback()) .awaitCompletion(30, TimeUnit.SECONDS); }
Source:
<code>public CosmosEntityInformation(Class<T> domainType) { super(domainType); this.id = getIdField(domainType); ReflectionUtils.makeAccessible(this.id); this.autoGenerateId = isIdFieldAnnotatedWithGeneratedValue(this.id); this.containerName = getContainerName(domainType); <START> this.partitionKeyPath = getPartitionKeyPathValue(domainType); <END> this.partitionKeyField = getPartitionKeyField(domainType); if (this.partitionKeyField != null) { ReflectionUtils.makeAccessible(this.partitionKeyField); } this.versionField = getVersionedField(domainType); if (this.versionField != null) { ReflectionUtils.makeAccessible(this.versionField); } this.requestUnit = getRequestUnit(domainType); this.timeToLive = getTimeToLive(domainType); this.indexingPolicy = getIndexingPolicy(domainType); this.autoCreateContainer = getIsAutoCreateContainer(domainType); }</code><technical_language>this.partitionKeyPathInDomainType = getPartitionKeyPathInDomainType(domainType);</technical_language>

Target:
public CosmosEntityInformation(Class<T> domainType) { super(domainType); this.id = getIdField(domainType); ReflectionUtils.makeAccessible(this.id); this.autoGenerateId = isIdFieldAnnotatedWithGeneratedValue(this.id); this.containerName = getContainerName(domainType); this.partitionKeyPath = getPartitionKeyPathAnnotationValue(domainType); this.partitionKeyField = getPartitionKeyField(domainType); if (this.partitionKeyField != null) { ReflectionUtils.makeAccessible(this.partitionKeyField); } this.versionField = getVersionedField(domainType); if (this.versionField != null) { ReflectionUtils.makeAccessible(this.versionField); } this.requestUnit = getRequestUnit(domainType); this.timeToLive = getTimeToLive(domainType); this.indexingPolicy = getIndexingPolicy(domainType); this.autoCreateContainer = getIsAutoCreateContainer(domainType); }