auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ExpressionThreadPoolExecutor(final String poolName, int corePoolSize) { this(poolName, corePoolSize, new NamedThreadFactory(poolName), new ThreadPoolExecutor.DiscardPolicy() { @Override public void rejectedExecution(Runnable runnable, ThreadPoolExecutor threadPoolExecutor) { <START> LoggerFactory.getLogger(ExpressionThreadPoolExecutor.class).warn( <END> "Thread pool '{}' rejected execution of {}", new Object[] { poolName, runnable.getClass() }); super.rejectedExecution(runnable, threadPoolExecutor); } }); }</code><technical_language>create a implementation of ThreadPoolExecutor.DiscardPolicy class, add a logger implementation class implements</technical_language>

Target:
public ExpressionThreadPoolExecutor(final String poolName, int corePoolSize) { this(poolName, corePoolSize, new NamedThreadFactory(poolName), new ThreadPoolExecutor.DiscardPolicy() { private final Logger logger = LoggerFactory.getLogger(ThreadPoolExecutor.DiscardPolicy.class); @Override public void rejectedExecution(Runnable runnable, ThreadPoolExecutor threadPoolExecutor) { logger.debug("Thread pool '{}' rejected execution of {}", poolName, runnable.getClass()); super.rejectedExecution(runnable, threadPoolExecutor); } }); }
Source:
<code>public void cleanLibFolderBeforeExport() { IRunProcessService runProcessService = CorePlugin.getDefault().getRunProcessService(); ITalendProcessJavaProject talendProcessJavaProject = runProcessService <START> .getTalendJobJavaProject(nodes.get(0).getObject().getProperty()); <END> File libFolder = new File(talendProcessJavaProject.getBundleResourcesFolder().getLocation().toOSString() + File.separator + LIB); for(File file: libFolder.listFiles()) if (!file.isDirectory() && file.getName().endsWith(".jar")) file.delete(); }</code><technical_language>is enough here, select nodes, try clean lib folder for selected node</technical_language>

Target:
public void cleanLibFolderBeforeExport() { IRunProcessService runProcessService = CorePlugin.getDefault().getRunProcessService(); ITalendProcessJavaProject talendProcessJavaProject = runProcessService .getTalendJobJavaProject(nodes.get(0).getObject().getProperty()); if (talendProcessJavaProject != null) { File libFolder = new File(talendProcessJavaProject.getBundleResourcesFolder().getLocation().toOSString() + File.separator + LIB); if (libFolder.exists()) { for (File file : libFolder.listFiles()) if (!file.isDirectory() && file.getName().endsWith(".jar")) file.delete(); } } }
Source:
<code>public void testSnapshot() throws IOException { if (sharedTestEnv.isBigtable() && !enableTestForBigtable()) { return; } try (Admin admin = getConnection().getAdmin()) { createTable(tableName); Map<String, Long> values = createAndPopulateTable(tableName); checkSnapshotCount(admin, 0); <START> admin.snapshot(snapshotName, tableName); <END> checkSnapshotCount(admin, 1); admin.cloneSnapshot(snapshotName, clonedTableName); validateClone(values); checkSnapshotCount(admin, 1); admin.deleteSnapshot(snapshotName); checkSnapshotCount(admin, 0); } }</code><technical_language>please create abstract method snapshot(snapshotName, tableName) performs a synchronous async call</technical_language>

Target:
public void testSnapshot() throws IOException { if (sharedTestEnv.isBigtable() && !enableTestForBigtable()) { return; } try (Admin admin = getConnection().getAdmin()) { createTable(tableName); Map<String, Long> values = createAndPopulateTable(tableName); checkSnapshotCount(admin, 0); snapshot(snapshotName, tableName); checkSnapshotCount(admin, 1); cloneSnapshot(snapshotName, clonedTableName); validateClone(values); checkSnapshotCount(admin, 1); deleteSnapshot(snapshotName); checkSnapshotCount(admin, 0); } }
Source:
<code>public void eventDispatched(ISuspendedDMEvent e) { fExpressionCache.setContextAvailable(e.getDMContext(), true); fExpressionCache.reset(); if (e instanceof IMIDMEvent) { Object miEvent = ((IMIDMEvent)e).getMIEvent(); if (miEvent instanceof MIStoppedEvent) { IDMContext dmc = e.getDMContext(); <START> if (dmc instanceof IMIExecutionDMContext) { <END> IMIExecutionDMContext threadDmc = (IMIExecutionDMContext)dmc; if (miEvent instanceof MIFunctionFinishedEvent) { String resultVar = ((MIFunctionFinishedEvent)miEvent).getGDBResultVar(); fReturnValueAliases.createAlias(threadDmc, resultVar); } MIFrame frame = ((MIStoppedEvent)miEvent).getFrame(); if (frame != null) { fReturnValueAliases.updateStoppedLocation(threadDmc, frame.getFunction()); } } } } }</code><technical_language>Marc-Andre mentioned in Bugzilla, this code works for non-stop mode. In all-stop mode context is GDBContainerDMC is IMIExecutionDMContext</technical_language>

Target:
public void eventDispatched(ISuspendedDMEvent e) { fExpressionCache.setContextAvailable(e.getDMContext(), true); fExpressionCache.reset(); handleReturnValueAliasing(e); }
Source:
<code>private static Order.Urgency getUrgency(ProcedureRequest procedureRequest) { switch (procedureRequest.getPriority()) { case STAT: return Order.Urgency.STAT; <START> default: <END> case ROUTINE: return Order.Urgency.ROUTINE; } }</code><technical_language>is default behavior</technical_language>

Target:
private static Order.Urgency getUrgency(ProcedureRequest procedureRequest) { switch (procedureRequest.getPriority()) { case STAT: return Order.Urgency.STAT; case ROUTINE: default: return Order.Urgency.ROUTINE; } }
Source:
<code>public void testOffsetMetricsReturnsNullWhenRetriableExceptionThrown() throws Exception { final int messageCount = 10; prepareSpout(messageCount); <START> Map<String, Long> offsetMetric = (Map<String, Long>) spout.getKafkaOffsetMetric().getValueAndReset(); assertEquals(offsetMetric.get(SingleTopicKafkaSpoutConfiguration.TOPIC+"/totalEarliestTimeOffset").longValue(), 0); assertEquals(offsetMetric.get(SingleTopicKafkaSpoutConfiguration.TOPIC+"/totalLatestTimeOffset").longValue(), 10); assertEquals(offsetMetric.get(SingleTopicKafkaSpoutConfiguration.TOPIC+"/totalRecordsInPartitions").longValue(), 10); assertEquals(offsetMetric.get(SingleTopicKafkaSpoutConfiguration.TOPIC+"/totalLatestEmittedOffset").longValue(), 0); assertEquals(offsetMetric.get(SingleTopicKafkaSpoutConfiguration.TOPIC+"/totalLatestCompletedOffset").longValue(), 0); assertEquals(offsetMetric.get(SingleTopicKafkaSpoutConfiguration.TOPIC+"/totalSpoutLag").longValue(), 10); for (int i = 0; i < messageCount; i++) { nextTuple_verifyEmitted_ack_resetCollector(i); } commitAndVerifyAllMessagesCommitted(messageCount); <END> when(getKafkaConsumer().beginningOffsets(anyCollection())).thenThrow(TimeoutException.class); offsetMetric = (Map<String, Long>) spout.getKafkaOffsetMetric().getValueAndReset(); assertNull(offsetMetric); }</code><technical_language>Is this bit necessary</technical_language>

Target:
public void testOffsetMetricsReturnsNullWhenRetriableExceptionThrown() throws Exception { final int messageCount = 10; prepareSpout(messageCount); when(getKafkaConsumer().beginningOffsets(anyCollection())).thenThrow(TimeoutException.class); Map<String, Long> offsetMetric = (Map<String, Long>) spout.getKafkaOffsetMetric().getValueAndReset(); assertNull(offsetMetric); }
Source:
<code>private void checkSize(final String filePath, int totalBytes) throws IOException { if (totalBytes > runtimeOptions.getUploadSize()) { <START> Files.deleteIfExists(Paths.get(filePath)); <END> logger.error("Size file is bigger than max upload size {}", runtimeOptions.getUploadSize()); throw new IllegalArgumentException("External file size is too big."); } }</code><technical_language>reuse deleteFile method here</technical_language>

Target:
private void checkSize(final String filePath, int totalBytes) { if (totalBytes > runtimeOptions.getUploadSize()) { deleteFile(filePath); logger.error("Size file is bigger than max upload size {}", runtimeOptions.getUploadSize()); throw new IllegalArgumentException("External file size is too big."); } }
Source:
<code>public ExecutionErrorManagerImpl(ExecutionErrorStorage storage) { ServiceLoader<ExecutionErrorFilter> discoveredFilters = ServiceLoader.load(ExecutionErrorFilter.class); discoveredFilters.forEach(filter -> filters.add(filter)); filters.sort((ExecutionErrorFilter f1, ExecutionErrorFilter f2) -> { return f1.getPriority().compareTo(f2.getPriority()); }); logger.debug("Error handling filters {}", this.filters); this.storage = storage; logger.debug("Execution error storage {}", this.storage); ServiceLoader<ExecutionErrorListener> discoveredListeners = ServiceLoader.load(ExecutionErrorListener.class); logger.debug("Error event listeners {}", discoveredListeners); <START> discoveredListeners.forEach(filter -> listeners.add(filter)); <END> }</code><technical_language>iterate listeners here, filters, (listener ->..</technical_language>

Target:
public ExecutionErrorManagerImpl(ExecutionErrorStorage storage) { ServiceLoader<ExecutionErrorFilter> discoveredFilters = ServiceLoader.load(ExecutionErrorFilter.class); discoveredFilters.forEach(filter -> filters.add(filter)); filters.sort((ExecutionErrorFilter f1, ExecutionErrorFilter f2) -> { return f1.getPriority().compareTo(f2.getPriority()); }); logger.debug("Error handling filters {}", this.filters); this.storage = storage; logger.debug("Execution error storage {}", this.storage); ServiceLoader<ExecutionErrorListener> discoveredListeners = ServiceLoader.load(ExecutionErrorListener.class); logger.debug("Error event listeners {}", discoveredListeners); discoveredListeners.forEach(listener -> listeners.add(listener)); }
Source:
<code>public IndexSourceMatcher(String expectedTableName, Map<String, Domain> expectedConstraint) { this.expectedTableName = requireNonNull(expectedTableName, "expectedTableName is null"); <START> this.expectedConstraint = Optional.of(requireNonNull(expectedConstraint, "expectedConstraint is null")); <END> }</code><technical_language>ImmutableMap.copyOf()</technical_language>

Target:
public IndexSourceMatcher(String expectedTableName, Map<String, Domain> expectedConstraint) { this.expectedTableName = requireNonNull(expectedTableName, "expectedTableName is null"); this.expectedConstraint = Optional.of(ImmutableMap.copyOf(expectedConstraint)); }
Source:
<code>public void updateAccount(AccountAttributes a, boolean updateStudentProfile) throws InvalidParametersException, EntityDoesNotExistException { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, a); if (!a.isValid()) { throw new InvalidParametersException(a.getInvalidityInfo()); } Account accountToUpdate = getAccountEntity(a.googleId, updateStudentProfile); if (accountToUpdate == null) { throw new EntityDoesNotExistException(ERROR_UPDATE_NON_EXISTENT_ACCOUNT + a.googleId + ThreadHelper.getCurrentThreadStack()); } a.sanitizeForSaving(); accountToUpdate.setName(a.name); accountToUpdate.setEmail(a.email); accountToUpdate.setIsInstructor(a.isInstructor); accountToUpdate.setInstitute(a.institute); if (updateStudentProfile) { StudentProfile existingStudentProfile = accountToUpdate.getStudentProfile(); if (existingStudentProfile == null) { existingStudentProfile = new StudentProfile(a.studentProfile.googleId); } <START> StudentProfileAttributes existingProfile = new StudentProfileAttributes(existingStudentProfile); <END> a.studentProfile.modifiedDate = existingProfile.modifiedDate; if (!existingProfile.toString().equals(a.studentProfile.toString())) { StudentProfile updatedStudentProfile = a.studentProfile.toEntity(); accountToUpdate.setStudentProfile(updatedStudentProfile); profilesDb.saveEntity(updatedStudentProfile); } } saveEntity(accountToUpdate, a); }</code><technical_language>existingStudentProfile existingProfile need renaming distinguish attributes non-attributes version</technical_language>

Target:
public void updateAccount(AccountAttributes a, boolean updateStudentProfile) throws InvalidParametersException, EntityDoesNotExistException { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, a); if (!a.isValid()) { throw new InvalidParametersException(a.getInvalidityInfo()); } Account accountToUpdate = getAccountEntity(a.googleId, updateStudentProfile); if (accountToUpdate == null) { throw new EntityDoesNotExistException(ERROR_UPDATE_NON_EXISTENT_ACCOUNT + a.googleId + ThreadHelper.getCurrentThreadStack()); } a.sanitizeForSaving(); accountToUpdate.setName(a.name); accountToUpdate.setEmail(a.email); accountToUpdate.setIsInstructor(a.isInstructor); accountToUpdate.setInstitute(a.institute); if (updateStudentProfile) { StudentProfile existingProfile = accountToUpdate.getStudentProfile(); if (existingProfile == null) { existingProfile = new StudentProfile(a.studentProfile.googleId); } StudentProfileAttributes existingProfileAttributes = new StudentProfileAttributes(existingProfile); a.studentProfile.modifiedDate = existingProfileAttributes.modifiedDate; if (!existingProfileAttributes.toString().equals(a.studentProfile.toString())) { StudentProfile updatedProfile = a.studentProfile.toEntity(); accountToUpdate.setStudentProfile(updatedProfile); profilesDb.saveEntity(updatedProfile); } } saveEntity(accountToUpdate, a); }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE__SELECT_CONTENT_FROM_APPS && (resultCode == RESULT_OK || resultCode == UploadFilesActivity.RESULT_OK_AND_MOVE)) { requestUploadOfContentFromApps(data, resultCode); } else if (requestCode == REQUEST_CODE__SELECT_FILES_FROM_FILE_SYSTEM && (resultCode == RESULT_OK || resultCode == UploadFilesActivity.RESULT_OK_AND_MOVE)) { requestUploadOfFilesFromFileSystem(data, resultCode); } else if(requestCode == REQUEST_CODE__UPLOAD_FROM_CAMERA && (resultCode == RESULT_OK || requestCode == UploadFilesActivity.RESULT_OK_AND_MOVE)){ requestUploadOfFilesFromFileSystem(data,resultCode); <START> Log.e("#PointerValue",""+1); <END> }else if (requestCode == REQUEST_CODE__MOVE_FILES && resultCode == RESULT_OK) { final Intent fData = data; getHandler().postDelayed( new Runnable() { @Override public void run() { requestMoveOperation(fData); } }, DELAY_TO_REQUEST_OPERATIONS_LATER ); } else if (requestCode == REQUEST_CODE__COPY_FILES && resultCode == RESULT_OK) { final Intent fData = data; final int fResultCode = resultCode; getHandler().postDelayed( new Runnable() { @Override public void run() { requestCopyOperation(fData); } }, DELAY_TO_REQUEST_OPERATIONS_LATER ); } else { super.onActivityResult(requestCode, resultCode, data); } }</code><technical_language>Log_OC.d instead</technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE__SELECT_CONTENT_FROM_APPS && (resultCode == RESULT_OK || resultCode == UploadFilesActivity.RESULT_OK_AND_MOVE)) { requestUploadOfContentFromApps(data, resultCode); } else if (requestCode == REQUEST_CODE__SELECT_FILES_FROM_FILE_SYSTEM && (resultCode == RESULT_OK || resultCode == UploadFilesActivity.RESULT_OK_AND_MOVE)) { requestUploadOfFilesFromFileSystem(data, resultCode); } else if(requestCode == REQUEST_CODE__UPLOAD_FROM_CAMERA && (resultCode == RESULT_OK || resultCode == UploadFilesActivity.RESULT_OK_AND_MOVE)){ requestUploadOfFilesFromFileSystem(data,resultCode); } else if (requestCode == REQUEST_CODE__MOVE_FILES && resultCode == RESULT_OK) { final Intent fData = data; getHandler().postDelayed( new Runnable() { @Override public void run() { requestMoveOperation(fData); } }, DELAY_TO_REQUEST_OPERATIONS_LATER ); } else if (requestCode == REQUEST_CODE__COPY_FILES && resultCode == RESULT_OK) { final Intent fData = data; final int fResultCode = resultCode; getHandler().postDelayed( new Runnable() { @Override public void run() { requestCopyOperation(fData); } }, DELAY_TO_REQUEST_OPERATIONS_LATER ); } else { super.onActivityResult(requestCode, resultCode, data); } }
Source:
<code>public void handleAction(ActionParameters params) throws ActionException { <START> <END> log.debug("Getting layer groups"); JSONArray json = getGroupJSON(-1,params, 0); log.debug("Got layer groups"); ResponseHelper.writeResponse(params, json); }</code><technical_language>This file read if handleAction getGroupJSON() handleAction is access point getGroupJSON()</technical_language>

Target:
public void handleAction(ActionParameters params) throws ActionException { log.debug("Getting layer groups"); JSONArray json = getGroupJSON(-1, params); log.debug("Got layer groups"); ResponseHelper.writeResponse(params, json); }
Source:
<code>public void destroy() throws Exception { <START> apiPublisher.deleteAPI(apiID); <END> super.cleanUpUsingRest(); }</code><technical_language>Lets previous cleanUp method discussed</technical_language>

Target:
public void destroy() throws Exception { restAPIPublisher.deleteAPI(apiID); super.cleanUp(); }
Source:
<code>public void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode == RESULT_OK) { if(requestCode == SELECT_PICTURE) { final boolean isCamera; if(data == null) { isCamera = true; } else { final String action = data.getAction(); if(action == null) { isCamera = false; } else { isCamera = action.equals(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); } } Uri selectedImageUri; if(isCamera) { selectedImageUri = imageUri; } else { selectedImageUri = data == null ? null : data.getData(); } if(BuildConfig.DEBUG) { Log.d("asdf-----------", selectedImageUri.toString()); } ImageView viewById = (ImageView) findViewById(R.id.test); <START> Picasso.with(this).load(selectedImageUri).into(viewById); <END> } } }</code><technical_language>FIXME: I this is for debug purposes loading full size photo memory, resize method</technical_language>

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode == RESULT_OK) { if(requestCode == SELECT_PICTURE) { final boolean isCamera; if(data == null) { isCamera = true; } else { final String action = data.getAction(); if(action == null) { isCamera = false; } else { isCamera = action.equals(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); } } Uri selectedImageUri; if(isCamera) { selectedImageUri = imageUri; } else { selectedImageUri = data == null ? null : data.getData(); } if(BuildConfig.DEBUG) { Log.d("asdf-----------", selectedImageUri.toString()); } adapter.refreshTestImage(selectedImageUri); } } }
Source:
<code>public int getMinutes() { Toast.makeText(this.context, this.context.getString(R.string.invalid_method_call) + "getMinutes()", Toast.LENGTH_SHORT).show(); return 0; <START> } <END></code><technical_language>I unsure this. Showing a toast confuse user. @Stypox @avently please a it? Do suggestions for this</technical_language>

Target:
public int getMinutes() { return this.timerMinute; }
Source:
<code>public String digestParams(RestInvocation restInvocation) { String path = restInvocation.getPath(); String queryParameters = restInvocation.getQueryString(); String toSign = "/" + path + "?" + queryParameters; Mac mac = getMac(); try { mac.update(toSign.getBytes("UTF-8")); } catch (IllegalStateException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); <START> } <END> String secondResult = bytesToHex(mac.doFinal()); return secondResult; }</code><technical_language>instead of this surround entire methods body @Override public String digestParams(RestInvocation restInvocation) { try { // ... } catch (UnsupportedEncodingException e) { throw new IllegalStateException("This JVM support HMAC_SHA_256?", e) } }</technical_language>

Target:
public String digestParams(RestInvocation restInvocation) { try { String path = restInvocation.getPath(); String queryParameters = restInvocation.getQueryString(); String toSign = "/" + path + "?" + queryParameters; Mac mac = getMac(); mac.update(toSign.getBytes("UTF-8")); return bytesToHex(mac.doFinal()); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("This JVM does not support HMAC_SHA_256?", e); } }
Source:
<code>public NavResult getNav() throws DotDataException, DotSecurityException { <START> return getNav(request.getRequestURI().replace("/api/v1/page/render/","/")); <END> }</code><technical_language>StringPool.SLASH</technical_language>

Target:
public NavResult getNav() throws DotDataException, DotSecurityException { return getNav(request.getRequestURI().replace("/api/v1/page/render/", StringPool.SLASH)); }
Source:
<code>private Map<Address, Response> invokeRemotelyInLocalSite(CacheRpcCommand command) throws Exception { commandsFactory.initializeReplicableCommand(command, false); RpcOptions options = rpcManager.getDefaultRpcOptions(true, DeliverOrder.NONE); CompletableFuture<Map<Address, Response>> remoteFuture = rpcManager.invokeRemotelyAsync(null, command, options); final Future<Response> localFuture = asyncExecutor.submit( LocalInvocation.newInstance(responseGenerator, command, commandsFactory, rpcManager.getAddress())); final Map<Address, Response> responseMap = new HashMap<>(); responseMap.put(rpcManager.getAddress(), localFuture.get()); <START> responseMap.putAll(RpcUtil.waitFor(remoteFuture, options.timeout(), options.timeUnit())); <END> return responseMap; }</code><technical_language>this async send reply remoteFuture.whenCompleted() instead</technical_language>

Target:
private Map<Address, Response> invokeRemotelyInLocalSite(CacheRpcCommand command) throws Exception { commandsFactory.initializeReplicableCommand(command, false); CompletableFuture<Map<Address, Response>> remoteFuture = rpcManager.invokeRemotelyAsync(null, command, rpcManager.getDefaultRpcOptions(true, DeliverOrder.NONE)); final Future<Response> localFuture = asyncExecutor.submit( LocalInvocation.newInstance(responseGenerator, command, commandsFactory, rpcManager.getAddress())); final Map<Address, Response> responseMap = new HashMap<>(); responseMap.put(rpcManager.getAddress(), localFuture.get()); responseMap.putAll(CompletableFutures.await(remoteFuture)); return responseMap; }
Source:
<code>protected WorkflowItemRest createAndReturn(Context context, List<String> stringList) { XmlWorkflowItem source; <START> if (stringList.isEmpty()) { <END> throw new UnprocessableEntityException("The given URI list could not be parsed and is empty as a result"); } try { source = submissionService.createWorkflowItem(context, stringList.get(0)); } catch (AuthorizeException e) { throw new RESTAuthorizationException(e); } catch (WorkflowException e) { throw new UnprocessableEntityException( "Invalid workflow action: " + e.getMessage(), e); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } if (source.getItem().isArchived()) { return null; } return converter.convert(source); }</code><technical_language>please check for null exact 1 size cover case of request body a proper uri-list multiple items</technical_language>

Target:
protected WorkflowItemRest createAndReturn(Context context, List<String> stringList) { XmlWorkflowItem source; if (stringList == null || stringList.isEmpty() || stringList.size() > 1) { throw new UnprocessableEntityException("The given URI list could not be properly parsed to one result"); } try { source = submissionService.createWorkflowItem(context, stringList.get(0)); } catch (AuthorizeException e) { throw new RESTAuthorizationException(e); } catch (WorkflowException e) { throw new UnprocessableEntityException( "Invalid workflow action: " + e.getMessage(), e); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } if (source.getItem().isArchived()) { return null; } return converter.convert(source); }
Source:
<code>public static URI discoverableBoltUri( String scheme, Config config, Setting<URI> override, ConnectorPortRegister connectorPortRegister ) { if ( config.isConfigured( override ) ) { return config.get( override ); } Optional<AdvertisedSocketAddress> boltAddress = config.enabledBoltConnectors().stream().findFirst().map( boltConnector -> config.get( boltConnector.advertised_address ) ); if ( boltAddress.isPresent() ) { AdvertisedSocketAddress advertisedSocketAddress = boltAddress.get(); if ( advertisedSocketAddress.getPort() == 0 ) { <START> int boltPort = connectorPortRegister.getLocalAddress( "bolt" ).getPort(); <END> return boltURI( scheme, advertisedSocketAddress.getHostname(), boltPort ); } return boltURI( scheme, advertisedSocketAddress.getHostname(), advertisedSocketAddress.getPort() ); } return null; }</code><technical_language>if bolt connector is named differently multiple bolt connectors</technical_language>

Target:
public static Optional<URI> discoverableBoltUri( String scheme, Config config, Setting<URI> override, ConnectorPortRegister connectorPortRegister ) { if ( config.isConfigured( override ) ) { return Optional.ofNullable( config.get( override ) ); } return config.enabledBoltConnectors().stream().findFirst().map( c -> { AdvertisedSocketAddress advertisedSocketAddress = config.get( c.advertised_address ); if ( advertisedSocketAddress.getPort() == 0 ) { int boltPort = connectorPortRegister.getLocalAddress( c.key() ).getPort(); return boltURI( scheme, advertisedSocketAddress.getHostname(), boltPort ); } return boltURI( scheme, advertisedSocketAddress.getHostname(), advertisedSocketAddress.getPort() ); } ); }
Source:
<code>void updateTitlePadding() { <START> Scheduler.get().scheduleDeferred(new ScheduledCommand() { <END> @Override public void execute() { int logoWidth = logoPanel.getOffsetWidth(); if (logoWidth > 0) { logoWidth += 10; headerTitlePanel.getParent().getElement().getStyle().setMarginLeft(logoWidth, Unit.PX); } } }); }</code><technical_language>deferred</technical_language>

Target:
void updateTitlePadding() { Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { int logoWidth = logoPanel.getOffsetWidth(); if (logoWidth > 0) { logoWidth += IMAGE_MARGIN; headerTitlePanel.getParent().getElement().getStyle().setMarginLeft(logoWidth, Unit.PX); } } }); }
Source:
<code>public DependencyPair executePlanFragment( Map<Integer, List<VoltTable>> dependencies, long fragmentId, ParameterSet params, SystemProcedureExecutionContext context) { if (fragmentId == PF_cancelShutdown) { super.run(context); VoltTable t = new VoltTable(VoltSystemProcedure.STATUS_SCHEMA); if (context.isLowestSiteId()){ VoltDB.instance().setShuttingdown(false); t.addRow(m_stat.getMzxid()); if (LOG.isDebugEnabled()) { <START> LOG.debug("@PrepareShutdown returning sigil " + ll(m_stat.getMzxid())); <END> } } return new DependencyPair.TableDependencyPair(SysProcFragmentId.PF_cancelShutdown, t); } else if (fragmentId == PF_cancelShutdownAggregate) { NavigableSet<Long> uniqueTxnIds = new TreeSet<>(); for (VoltTable t: dependencies.get(SysProcFragmentId.PF_cancelShutdown)) { while (t.advanceRow()) { uniqueTxnIds.add(t.getLong(0)); } } VoltTable t = new VoltTable(VoltSystemProcedure.STATUS_SCHEMA); for (long zktxnid: uniqueTxnIds) { t.addRow(zktxnid); } return new DependencyPair.TableDependencyPair(SysProcFragmentId.PF_cancelShutdownAggregate, t); } else { VoltDB.crashLocalVoltDB( "Received unrecognized plan fragment id " + fragmentId + " in CancelShutdown", false, null); } throw new RuntimeException("Should not reach this code"); }</code><technical_language>logging @CancelShudown</technical_language>

Target:
public DependencyPair executePlanFragment( Map<Integer, List<VoltTable>> dependencies, long fragmentId, ParameterSet params, SystemProcedureExecutionContext context) { if (fragmentId == PF_cancelShutdown) { if (context.isLowestSiteId()){ VoltDB.instance().setShuttingdown(false); } super.run(context); VoltTable t = new VoltTable(VoltSystemProcedure.STATUS_SCHEMA); if (context.isLowestSiteId()){ t.addRow(m_stat.getMzxid()); if (LOG.isDebugEnabled()) { LOG.debug("@CancelShutdown returning sigil " + ll(m_stat.getMzxid())); } } return new DependencyPair.TableDependencyPair(SysProcFragmentId.PF_cancelShutdown, t); } else if (fragmentId == PF_cancelShutdownAggregate) { NavigableSet<Long> uniqueTxnIds = new TreeSet<>(); for (VoltTable t: dependencies.get(SysProcFragmentId.PF_cancelShutdown)) { while (t.advanceRow()) { uniqueTxnIds.add(t.getLong(0)); } } VoltTable t = new VoltTable(VoltSystemProcedure.STATUS_SCHEMA); for (long zktxnid: uniqueTxnIds) { t.addRow(zktxnid); } return new DependencyPair.TableDependencyPair(SysProcFragmentId.PF_cancelShutdownAggregate, t); } else { VoltDB.crashLocalVoltDB( "Received unrecognized plan fragment id " + fragmentId + " in CancelShutdown", false, null); } throw new RuntimeException("Should not reach this code"); }
Source:
<code>public void onKeyPress(KeyPressEvent event) { final int i = getCurrentRow(); final Widget radioButton = table.getWidget(i, 1); if (radioButton instanceof RadioButton) { <START> ((RadioButton) radioButton).setValue(true); <END> deleteButton.setEnabled(canBeDeletedArray[i]); } }</code><technical_language>For selection of radio button in current row pressing space works fine, key focus is set another radio button. This leads a strange behaviour. If I select a radio button clicking mouse this radio button focus. If I navigate keys another row press space, radio button of this row shortly selected, right previously selected radio button focus selected of a deselection of radio button I intended select. This problem solved explicitly setting focus radio button is selected: ((RadioButton) radioButton).setFocus(true);</technical_language>

Target:
public void onKeyPress(KeyPressEvent event) { final int i = getCurrentRow(); final Widget radioButton = table.getWidget(i, 1); if (radioButton instanceof RadioButton) { ((RadioButton) radioButton).setFocus(true); ((RadioButton) radioButton).setValue(true); deleteButton.setEnabled(canBeDeletedArray[i]); } }
Source:
<code>public INDArray propUp(INDArray v, boolean training) { INDArray W = getParam(PretrainParamInitializer.WEIGHT_KEY); if(training) { if(conf.isUseDropConnect()) { <START> if (conf.getLayer().getDropOut() > 0) { <END> W = Dropout.applyDropConnect(this,DefaultParamInitializer.WEIGHT_KEY); } } } INDArray hBias = getParam(PretrainParamInitializer.BIAS_KEY); if(layerConf().getVisibleUnit() == org.deeplearning4j.nn.conf.layers.RBM.VisibleUnit.GAUSSIAN) this.sigma = v.var(0).divi(input.rows()); INDArray preSig = v.mmul(W).addiRowVector(hBias); switch (layerConf().getHiddenUnit()) { case RECTIFIED: preSig = max(preSig, 0.0); return preSig; case GAUSSIAN: preSig.addi(Nd4j.randn(preSig.rows(), preSig.columns(), rng)); return preSig; case BINARY: return sigmoid(preSig); case SOFTMAX: return Nd4j.getExecutioner().execAndReturn(Nd4j.getOpFactory().createTransform("softmax", preSig)); default: throw new IllegalStateException("Hidden unit type should either be binary, gaussian, or rectified linear"); } }</code><technical_language>Please put this conditional DropConnect training is true</technical_language>

Target:
public INDArray propUp(INDArray v, boolean training) { INDArray W = getParam(PretrainParamInitializer.WEIGHT_KEY); if(training && conf.isUseDropConnect() && conf.getLayer().getDropOut() > 0) { W = Dropout.applyDropConnect(this,DefaultParamInitializer.WEIGHT_KEY); } INDArray hBias = getParam(PretrainParamInitializer.BIAS_KEY); if(layerConf().getVisibleUnit() == org.deeplearning4j.nn.conf.layers.RBM.VisibleUnit.GAUSSIAN) this.sigma = v.var(0).divi(input.rows()); INDArray preSig = v.mmul(W).addiRowVector(hBias); switch (layerConf().getHiddenUnit()) { case RECTIFIED: preSig = max(preSig, 0.0); return preSig; case GAUSSIAN: preSig.addi(Nd4j.randn(preSig.rows(), preSig.columns(), rng)); return preSig; case BINARY: return sigmoid(preSig); case SOFTMAX: return Nd4j.getExecutioner().execAndReturn(Nd4j.getOpFactory().createTransform("softmax", preSig)); default: throw new IllegalStateException("Hidden unit type should either be binary, gaussian, or rectified linear"); } }
Source:
<code>protected BundleContext getContext() { <START> Bundle cxfBundle = FrameworkUtil.getBundle(TransformerLocatorImpl.class); <END> if (cxfBundle != null) { return cxfBundle.getBundleContext(); } return null; }</code><technical_language>is this called cxfBundle</technical_language>

Target:
protected BundleContext getContext() { Bundle bundle = FrameworkUtil.getBundle(TransformerLocatorImpl.class); if (bundle != null) { return bundle.getBundleContext(); } return null; }
Source:
<code>protected ActionResult execute() throws EntityDoesNotExistException { try { String userEmailToResend = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); <START> Assumption.assertNotNull(userEmailToResend); <END> statusToAdmin = "Action Student Clicked Request Resending Links" + "<br>Email: " + userEmailToResend; boolean isValid = isValidEmailAddress(userEmailToResend); if (isValid) { EmailWrapper email = new EmailGenerator().generateFeedbackSessionResendLinksEmail(userEmailToResend); emailSender.sendEmail(email); statusToUser.add(new StatusMessage(Const.StatusMessages.FEEDBACK_SESSION_ACCESS_LINKS_RESENT, StatusMessageColor.SUCCESS)); } else { statusToUser.add(new StatusMessage(Const.StatusMessages .FEEDBACK_SESSION_RESEND_ACCESS_LINKS_INVALID_EMAIL, StatusMessageColor.DANGER)); } PageData data = new FeedbackResendLinksPageData(account, sessionToken, isValid); return createAjaxResult(data); } catch (EmailSendingException e) { log.severe("Email of feedback session links failed to send: " + TeammatesException.toStringWithStackTrace(e)); } return null; }</code><technical_language>getNonNullRequestParamValue instead</technical_language>

Target:
protected ActionResult execute() throws EntityDoesNotExistException { try { FieldValidator validator = new FieldValidator(); String userEmailToResend = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); statusToAdmin = "Resend links requested" + "<br>Email: " + userEmailToResend; String error = validator.getInvalidityInfoForEmail(userEmailToResend); if (!error.isEmpty()) { statusToUser.add(new StatusMessage(error, StatusMessageColor.DANGER)); PageData data = new FeedbackResendLinksPageData(account, sessionToken, error); return createAjaxResult(data); } boolean shouldSkipVerification = getNonNullRequestParamValue( Const.ParamsNames.SHOULD_SKIP_RECAPTCHA_VERIFICATION).equals("true"); if (gateKeeper.getCurrentUser() != null && !shouldSkipVerification) { shouldSkipVerification = gateKeeper.getCurrentUser().isAdmin; } String recaptchaResponse = getNonNullRequestParamValue(Const.ParamsNames.RECAPTCHA_RESPONSE); if (!isReCaptchaValid(Config.RECAPTCHA_SECRETKEY, recaptchaResponse) && !shouldSkipVerification) { error = Const.StatusMessages.RECAPTCHA_VALIDATION_FAILED; statusToUser.add(new StatusMessage(error, StatusMessageColor.DANGER)); PageData data = new FeedbackResendLinksPageData(account, sessionToken, error); return createAjaxResult(data); } EmailWrapper email = new EmailGenerator().generateFeedbackSessionResendLinksEmail(userEmailToResend); emailSender.sendEmail(email); statusToUser.add(new StatusMessage(Const.StatusMessages.FEEDBACK_SESSION_ACCESS_LINKS_RESENT, StatusMessageColor.SUCCESS)); PageData data = new FeedbackResendLinksPageData(account, sessionToken, error); return createAjaxResult(data); } catch (EmailSendingException e) { log.severe("Email of feedback session links failed to send: " + TeammatesException.toStringWithStackTrace(e)); } return null; }
Source:
<code>public void setScanFuzzerMessages(boolean scanFuzzerMessages) { this.scanFuzzerMessages = scanFuzzerMessages; <START> getConfig().setProperty(SCAN_FUZZER_MESSAGES_KEY, Boolean.valueOf(scanFuzzerMessages)); <END> }</code><technical_language>(explicit) boxing removed (per new guidelines)</technical_language>

Target:
public void setScanFuzzerMessages(boolean scanFuzzerMessages) { this.scanFuzzerMessages = scanFuzzerMessages; getConfig().setProperty(SCAN_FUZZER_MESSAGES_KEY, scanFuzzerMessages); setFuzzerOptin(scanFuzzerMessages); }
Source:
<code>private List<SingularityPendingTaskId> getOnDemandLateTasks (List<SingularityPendingTaskId> maybeOnDemandLateTasks) { List<SingularityPendingTaskId> onDemandLateTasks = new ArrayList<>(); for (SingularityPendingTaskId maybeOnDemandLateTask : maybeOnDemandLateTasks) { <START> String requestId = requestManager.getRequest(maybeOnDemandLateTask.getRequestId()).get().getRequest().getId(); <END> Optional<Integer> maybeInstancesLimit = requestManager.getRequest(maybeOnDemandLateTask.getRequestId()).get().getRequest().getInstances(); if (maybeInstancesLimit.isPresent()) { if (taskManager.getActiveTaskIdsForRequest(requestId).size() < maybeInstancesLimit.get()) { onDemandLateTasks.add(maybeOnDemandLateTask); } } } return onDemandLateTasks; }</code><technical_language>need fetch this here, requestId is SingularityPendingTaskId, fetching SingularityRequest next line</technical_language>

Target:
private List<SingularityPendingTaskId> getOnDemandLateTasks (List<SingularityPendingTaskId> maybeOnDemandLateTasks) { List<SingularityPendingTaskId> onDemandLateTasks = new ArrayList<>(); for (SingularityPendingTaskId maybeOnDemandLateTask : maybeOnDemandLateTasks) { final Optional<SingularityRequestWithState> maybeRequest = requestManager.getRequest(maybeOnDemandLateTask.getRequestId()); if (maybeRequest.isPresent()) { final Optional<Integer> maybeInstancesLimit = maybeRequest.get().getRequest().getInstances(); if (maybeInstancesLimit.isPresent()) { if (taskManager.getActiveTaskIdsForRequest(maybeOnDemandLateTask.getRequestId()).size() < maybeInstancesLimit.get()) { onDemandLateTasks.add(maybeOnDemandLateTask); } } } } return onDemandLateTasks; }
Source:
<code>public void setParent(IVertexConsumer parent) { super.setParent(parent); VertexFormat format = getVertexFormat(parent); <START> if(format.equals(getVertexFormat())) return; <END> setVertexFormat(format); for(int i = 0; i < getVertexFormat().getElementCount(); i++) { switch(getVertexFormat().getElement(i).getUsage()) { case POSITION: posIndex = i; break; case NORMAL: normalIndex = i; break; case COLOR: colorIndex = i; break; case UV: if(getVertexFormat().getElement(i).getIndex() == 1) { lightmapIndex = i; } break; default: } } if(posIndex == -1) { throw new IllegalArgumentException("vertex lighter needs format with position"); } if(lightmapIndex == -1) { throw new IllegalArgumentException("vertex lighter needs format with lightmap"); } if(colorIndex == -1) { throw new IllegalArgumentException("vertex lighter needs format with color"); } }</code><technical_language>Fry asks Objects.equal for case of NPE</technical_language>

Target:
public void setParent(IVertexConsumer parent) { super.setParent(parent); VertexFormat format = getVertexFormat(parent); if(Objects.equal(format, getVertexFormat())) return; setVertexFormat(format); for(int i = 0; i < getVertexFormat().getElementCount(); i++) { switch(getVertexFormat().getElement(i).getUsage()) { case POSITION: posIndex = i; break; case NORMAL: normalIndex = i; break; case COLOR: colorIndex = i; break; case UV: if(getVertexFormat().getElement(i).getIndex() == 1) { lightmapIndex = i; } break; default: } } if(posIndex == -1) { throw new IllegalArgumentException("vertex lighter needs format with position"); } if(lightmapIndex == -1) { throw new IllegalArgumentException("vertex lighter needs format with lightmap"); } if(colorIndex == -1) { throw new IllegalArgumentException("vertex lighter needs format with color"); } }
Source:
<code>public void webConfiguration() { <START> WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() <END> .withConfiguration( AutoConfigurations.of(RestTemplateAutoConfiguration.class, JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class, WebMvcAutoConfiguration.class, InitializrAutoConfiguration.class)); contextRunner.run((context) -> { assertThat(context).hasSingleBean(InitializrWebConfig.class); assertThat(context).hasSingleBean(MainController.class); assertThat(context).hasSingleBean(UiController.class); }); }</code><technical_language>I call webContextRunner something. I I idea of name general purpose field</technical_language>

Target:
public void webConfiguration() { WebApplicationContextRunner webContextRunner = new WebApplicationContextRunner() .withConfiguration( AutoConfigurations.of(RestTemplateAutoConfiguration.class, JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class, WebMvcAutoConfiguration.class, InitializrAutoConfiguration.class)); webContextRunner.run((context) -> { assertThat(context).hasSingleBean(InitializrWebConfig.class); assertThat(context).hasSingleBean(MainController.class); assertThat(context).hasSingleBean(UiController.class); }); }
Source:
<code>protected void stringDone(String body) { AuthContext context = serverExchange.getAttachment(AUTH_CONTEXT_KEY); context.clientResponseReceived(); if (clientExchange.getResponse().getResponseCode() == CREATED) { try { JsonNode jsonNode = objectMapper.readTree(body); JsonNode allowedNode = jsonNode == null ? null : jsonNode.get("allowed"); boolean allowed = allowedNode != null && allowedNode.asBoolean(); onRequestResult(serverExchange, connection, allowed); } catch (IOException e) { onRequestFailure(serverExchange, connection, e, true); } } else { IOException e = new IOException(StatusCodes.getReason(clientExchange.getResponse().getResponseCode())); <START> onRequestFailure(serverExchange, connection, e, false); <END> } }</code><technical_language>This call if response is other 201. some responses in want retry (eg 503) in want retry (eg 400, 401, 403, etc). I sense retry in some situations need addressed here</technical_language>

Target:
protected void stringDone(String body) { AuthContext context = serverExchange.getAttachment(AUTH_CONTEXT_KEY); context.clientResponseReceived(); int responseCode = clientExchange.getResponse().getResponseCode(); if (responseCode == CREATED) { try { JsonNode jsonNode = objectMapper.readTree(body); JsonNode allowedNode = jsonNode == null ? null : jsonNode.get("allowed"); boolean allowed = allowedNode != null && allowedNode.asBoolean(); onRequestResult(serverExchange, connection, allowed); } catch (IOException e) { onRequestFailure(serverExchange, connection, e, true); } } else { IOException e = new IOException(StatusCodes.getReason(responseCode)); if(responseCode >= 500) { onRequestFailure(serverExchange, connection, e, true); } else { onRequestFailure(serverExchange, connection, e, false); } } }
Source:
<code>private String getValueFromXML(String inputXML, String xPathQuery) throws XPathExpressionException, ParserConfigurationException, SAXException, IOException { DocumentBuilder builder; try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setFeature("<LINK_0>", true); } catch (Exception e) { <START> logger.warn("failed to ebable xml safe feature"); <END> } builder = factory.newDocumentBuilder(); Document document = builder.parse(new ByteArrayInputStream(inputXML.getBytes())); XPathFactory xpf = XPathFactory.newInstance(); try { xpf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (XPathFactoryConfigurationException ex) { logger.warn("failed to ebable xpath safe feature"); } XPath xpath = xpf.newXPath(); String expression = xPathQuery; Node cipherValue = (Node) xpath.evaluate(expression, document, XPathConstants.NODE); return cipherValue == null ? null : cipherValue.getTextContent(); } catch (XPathExpressionException e) { logger.error(e.getMessage()); throw e; } catch (ParserConfigurationException e) { logger.error(e.getMessage()); throw e; } catch (SAXException e) { logger.error(e.getMessage()); throw e; } catch (IOException e) { logger.error(e.getMessage()); throw e; } }</code><technical_language>"enable" "ebable". mistake below</technical_language>

Target:
private String getValueFromXML(String inputXML, String xPathQuery) throws XPathExpressionException, ParserConfigurationException, SAXException, IOException { DocumentBuilder builder; try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setFeature("<LINK_0>", true); } catch (Exception e) { logger.warn("failed to enable xml safe feature"); } builder = factory.newDocumentBuilder(); Document document = builder.parse(new ByteArrayInputStream(inputXML.getBytes())); XPathFactory xpf = XPathFactory.newInstance(); try { xpf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (XPathFactoryConfigurationException ex) { logger.warn("failed to enable xpath safe feature"); } XPath xpath = xpf.newXPath(); String expression = xPathQuery; Node cipherValue = (Node) xpath.evaluate(expression, document, XPathConstants.NODE); return cipherValue == null ? null : cipherValue.getTextContent(); } catch (XPathExpressionException e) { logger.error(e.getMessage()); throw e; } catch (ParserConfigurationException e) { logger.error(e.getMessage()); throw e; } catch (SAXException e) { logger.error(e.getMessage()); throw e; } catch (IOException e) { logger.error(e.getMessage()); throw e; } }
Source:
<code>private void migrateEntriesWithMetadata(RemoteCache<Object, Object> sourceCache, AtomicInteger counter) { try (CloseableIterator<Map.Entry<Object, MetadataValue<Object>>> iterator = sourceCache.retrieveEntriesWithMetadata(segments, readBatch)) { while (iterator.hasNext() && !Thread.currentThread().isInterrupted()) { Map.Entry<Object, MetadataValue<Object>> entry = iterator.next(); if (!Arrays.equals((byte[]) entry.getKey(), ignoredKey)) { MetadataValue<Object> metadataValue = entry.getValue(); int lifespan = metadataValue.getLifespan(); int maxIdle = metadataValue.getMaxIdle(); long version = metadataValue.getVersion(); Metadata metadata = new EmbeddedMetadata.Builder() .version(new NumericVersion(version)) .lifespan(lifespan, TimeUnit.SECONDS) .maxIdle(maxIdle, TimeUnit.SECONDS) .build(); executorService.submit(() -> { Object key = entry.getKey(); if (!deletedKeys.contains(new WrappedByteArray((byte[]) key))) { <START> cache.getAdvancedCache().withFlags(Flag.SKIP_CACHE_LOAD, Flag.ROLLING_UPGRADE).putIfAbsent(entry.getKey(), entry.getValue().getValue(), metadata); <END> } int currentCount = counter.incrementAndGet(); if (log.isDebugEnabled() && currentCount % 100 == 0) log.debugf(">> Migrated %s entries\n", currentCount); }); } } } }</code><technical_language>I need preserve timestamps here, similar hack I for ISPN-4075 replace hack of allowing InternalCacheEntry values in PutKeyValueCommand another hack, checking if metadata parameter is in fact InternalMetadata instance timestamps (without PUT_FOR_STATE_TRANSFER checks)</technical_language>

Target:
private void migrateEntriesWithMetadata(RemoteCache<Object, Object> sourceCache, AtomicInteger counter) { try (CloseableIterator<Map.Entry<Object, MetadataValue<Object>>> iterator = sourceCache.retrieveEntriesWithMetadata(segments, readBatch)) { while (iterator.hasNext() && !Thread.currentThread().isInterrupted()) { Map.Entry<Object, MetadataValue<Object>> entry = iterator.next(); if (!Arrays.equals((byte[]) entry.getKey(), ignoredKey)) { MetadataValue<Object> metadataValue = entry.getValue(); int lifespan = metadataValue.getLifespan(); int maxIdle = metadataValue.getMaxIdle(); long version = metadataValue.getVersion(); Metadata metadata = new EmbeddedMetadata.Builder() .version(new NumericVersion(version)) .lifespan(lifespan, TimeUnit.SECONDS) .maxIdle(maxIdle, TimeUnit.SECONDS) .build(); executorService.submit(() -> { Object key = entry.getKey(); if (!deletedKeys.contains(new WrappedByteArray((byte[]) key))) { InternalMetadata internalMetadata = new InternalMetadataImpl(metadata, metadataValue.getCreated(), metadataValue.getLastUsed()); cache.getAdvancedCache().withFlags(Flag.SKIP_CACHE_LOAD, Flag.ROLLING_UPGRADE).putIfAbsent(entry.getKey(), entry.getValue().getValue(), internalMetadata); } int currentCount = counter.incrementAndGet(); if (log.isDebugEnabled() && currentCount % 100 == 0) log.debugf(">> Migrated %s entries\n", currentCount); }); } } } }