auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static DwrfProto.ColumnEncoding toColumnEncoding(ColumnEncoding columnEncodings) { <START> Preconditions.checkArgument( <END> !columnEncodings.getSequenceEncodings().isPresent(), "DWRF writer doesn't support flat map encodings: " + columnEncodings); return DwrfProto.ColumnEncoding.newBuilder() .setKind(toColumnEncoding(columnEncodings.getColumnEncodingKind())) .setDictionarySize(columnEncodings.getDictionarySize()) .build(); }</code><technical_language>nit: java checkArgument (columnEncodings.getColumnEncodingKind() != DWRF_MAP_FLAT, "Unsupported encoding: " + columnEncodings.getColumnEncodingKind()); Remember static import. other message thrown in IllegalArgumentException / IllegalStateException</technical_language>

Target:
private static DwrfProto.ColumnEncoding toColumnEncoding(ColumnEncoding columnEncodings) { checkArgument( !columnEncodings.getAdditionalSequenceEncodings().isPresent(), "DWRF writer doesn't support writing columns with non-zero sequence IDs: " + columnEncodings); return DwrfProto.ColumnEncoding.newBuilder() .setKind(toColumnEncoding(columnEncodings.getColumnEncodingKind())) .setDictionarySize(columnEncodings.getDictionarySize()) .build(); }
Source:
<code>public static boolean isSmallIde(){ <START> return PlatformUtils.isRubyMine() <END> || PlatformUtils.isPyCharm() || PlatformUtils.isPhpStorm() || PlatformUtils.isWebStorm(); }</code><technical_language>[x] more Small IDEs this now. This appears missing PlatformUtils.isCLion() for [CLion](<LINK_0>; PlatformUtils.isAppCode() for [AppCode](<LINK_1>; PlatformUtils.isDatabaseIDE() for [0xDBE](<LINK_2> If this list intellij-erlang open a PR update list too. bring PlatformUtils maintainer PlatformUtils.isSmallIde() a method plugins do this themselves</technical_language>

Target:
public static boolean isSmallIde(){ return PlatformUtils.isRubyMine() || PlatformUtils.isPyCharm() || PlatformUtils.isPhpStorm() || PlatformUtils.isWebStorm() || PlatformUtils.isAppCode() || PlatformUtils.isCLion(); }
Source:
<code>public List<RepoImage> getUserRequestForStorageDomainRepoFileList(Guid storageDomainId, ImageFileType imageType, boolean forceRefresh) { if (!isStorageDomainIdValid(storageDomainId)) { throw new EngineException(EngineError.GetIsoListError); } <START> if (forceRefresh) { if (!refreshRepos(storageDomainId, imageType)) { throw new EngineException(EngineError.IMAGES_NOT_SUPPORTED_ERROR); } } else { refreshReposIfIntervalPassed(storageDomainId, imageType); } <END> return getCachedIsoListByDomainId(storageDomainId, imageType); }</code><technical_language>code again, I is pass forceRefresh refreshReposIfIntervalPassed (and rename refreshReposIfNeeded), shouldInvalidateCache returns this: private boolean shouldInvalidateCache(long lastRefreshed, boolean foreceRefresh) { return foreceRefresh || System.currentTimeMillis() > lastRefreshed + invalidateCachePeriod; }</technical_language>

Target:
public List<RepoImage> getUserRequestForStorageDomainRepoFileList(Guid storageDomainId, ImageFileType imageType, boolean forceRefresh) { if (!isStorageDomainIdValid(storageDomainId)) { throw new EngineException(EngineError.GetIsoListError); } refreshReposIfNeeded(storageDomainId, imageType, forceRefresh); return getCachedIsoListByDomainId(storageDomainId, imageType); }
Source:
<code>public boolean eat(GlowPlayer player, ItemStack item) { PlayerItemConsumeEvent event1 = new PlayerItemConsumeEvent(player, item); EventFactory.callEvent(event1); if (event1.isCancelled()) return false; player.setUsageItem(null); player.setUsageTime(0); player.getInventory().getItemInHand().setType(Material.BUCKET); <START> for(PotionEffect potionEffect : player.getActivePotionEffects()) { <END> player.removePotionEffect(potionEffect.getType()); } return true; }</code><technical_language>for (</technical_language>

Target:
public boolean eat(GlowPlayer player, ItemStack item) { PlayerItemConsumeEvent event1 = new PlayerItemConsumeEvent(player, item); EventFactory.callEvent(event1); if (event1.isCancelled()) return false; player.setUsageItem(null); player.setUsageTime(0); for (PotionEffect potionEffect : player.getActivePotionEffects()) { player.removePotionEffect(potionEffect.getType()); } player.getInventory().getItemInHand().setType(Material.BUCKET); return true; }
Source:
<code>protected void doStart() throws Exception { for (int i = 0; i < schedulers.length; i++) { <START> schedulers[i] = Executors.newScheduledThreadPool(threadsPerScheduler, Threads.daemonThreadsNamed(threadBaseName + "-%s-lock" + i)); <END> } }</code><technical_language>'-lock'</technical_language>

Target:
protected void doStart() throws Exception { for (int i = 0; i < schedulers.length; i++) { schedulers[i] = Executors.newScheduledThreadPool(threadsPerScheduler, Threads.daemonThreadsNamed(threadBaseName + "-timeout-%s" + i)); } }
Source:
<code>public void onGenerateMapButtonClicked() { try { if (!previousMapName.getText().isEmpty()){ mapGeneratorService.generateMap(previousMapName.getText()).thenAccept(mapName -> { Platform.runLater(() -> { createGameController.initMapSelection(); createGameController.mapListView.getItems().stream() .filter(mapBean -> mapBean.getFolderName().equalsIgnoreCase(mapName)) .findAny().ifPresent(mapBean -> { <START> createGameController.mapListView.getSelectionModel().select(mapBean); createGameController.mapListView.scrollTo(mapBean); createGameController.setSelectedMap(mapBean); }); <END> }); }); } else { byte spawnCount = spawnCountSpinner.getValue().byteValue(); byte landDensity = (byte) (127 - getSliderValue(waterSlider, waterRandom)); byte plateauDensity = getSliderValue(plateauSlider, plateauRandom); byte mountainDensity = getSliderValue(mountainSlider, mountainRandom); byte rampDensity = getSliderValue(rampSlider, rampRandom); byte[] optionArray = {spawnCount, landDensity, plateauDensity, mountainDensity, rampDensity}; mapGeneratorService.generateMap(optionArray).thenAccept(mapName -> { Platform.runLater(() -> { createGameController.initMapSelection(); createGameController.mapListView.getItems().stream() .filter(mapBean -> mapBean.getFolderName().equalsIgnoreCase(mapName)) .findAny().ifPresent(mapBean -> { createGameController.mapListView.getSelectionModel().select(mapBean); createGameController.mapListView.scrollTo(mapBean); createGameController.setSelectedMap(mapBean); }); }); }); } } catch (Exception e) { notificationService.addImmediateErrorNotification(e, "mapGenerator.generationFailed"); log.error("Map generation failed", e); } onCloseButtonClickedListener.run(); }</code><technical_language>ident</technical_language>

Target:
public void onGenerateMapButtonClicked() { onGenerateMap(); }
Source:
<code>public ExecutionStrategyParameters transform(Consumer<Builder> builderConsumer) { <START> Builder builder = new Builder(this); <END> builderConsumer.accept(builder); return builder.build(); }</code><technical_language>were? Thx</technical_language>

Target:
public ExecutionStrategyParameters transform(Consumer<Builder> builderConsumer) { Builder builder = newParameters(this); builderConsumer.accept(builder); return builder.build(); }
Source:
<code>private boolean isMatchingTrigger(DockerEvent dockerEvent, Trigger trigger) { String account = dockerEvent.getContent().getAccount(); String repository = dockerEvent.getContent().getRepository(); String eventTag = dockerEvent.getContent().getTag(); String triggerTagPattern = null; <START> if(trigger.getTag() != null && trigger.getTag().trim().length() > 0) { <END> triggerTagPattern = trigger.getTag().trim(); } return trigger.getType().equals(TRIGGER_TYPE) && trigger.getRepository().equals(repository) && trigger.getAccount().equals(account) && ((triggerTagPattern == null && !eventTag.equals("latest")) || triggerTagPattern != null && matchTags(triggerTagPattern, eventTag)); }</code><technical_language>replace this if clause StringUtils.isEmpty() apache.lang. please add a space opening (</technical_language>

Target:
private boolean isMatchingTrigger(DockerEvent dockerEvent, Trigger trigger) { String account = dockerEvent.getContent().getAccount(); String repository = dockerEvent.getContent().getRepository(); String eventTag = dockerEvent.getContent().getTag(); String triggerTagPattern = null; if (StringUtils.isNotBlank(trigger.getTag())) { triggerTagPattern = trigger.getTag().trim(); } return trigger.getType().equals(TRIGGER_TYPE) && trigger.getRepository().equals(repository) && trigger.getAccount().equals(account) && ((triggerTagPattern == null && !eventTag.equals("latest")) || triggerTagPattern != null && matchTags(triggerTagPattern, eventTag)); }
Source:
<code>public IASTTranslationUnit getAST(ITranslationUnit tu, IProgressMonitor pm) throws CoreException, OperationCanceledException { if (isDisposed()) throw new IllegalStateException("CRefactoringContext is already disposed."); getIndex(); if (pm != null && pm.isCanceled()) throw new OperationCanceledException(); tu= CModelUtil.toWorkingCopy(tu); IASTTranslationUnit ast= fASTCache.get(tu); if (ast == null) { if (fSharedAST != null && tu.equals(fSharedAST.getOriginatingTranslationUnit())) { ast = fSharedAST; } else { ast = ASTProvider.getASTProvider().acquireSharedAST(tu, fIndex, <START> ASTProvider.WAIT_ACTIVE_ONLY, pm); <END> if (ast == null || ast.skippedNodes()) { if (ast != null) { ASTProvider.getASTProvider().releaseSharedAST(ast); } if (pm != null && pm.isCanceled()) throw new OperationCanceledException(); ast= tu.getAST(fIndex, PARSE_MODE); fASTCache.put(tu, ast); } else { if (fSharedAST != null) { ASTProvider.getASTProvider().releaseSharedAST(fSharedAST); } fSharedAST = ast; } } } if (pm != null) { pm.done(); } return ast; }</code><technical_language>More straightforward: if (ast != null && ast.skippedNodes()) { // incomplete AST. ASTProvider.getASTProvider().releaseSharedAST(ast); ast = null; }</technical_language>

Target:
public IASTTranslationUnit getAST(ITranslationUnit tu, IProgressMonitor pm) throws CoreException, OperationCanceledException { if (isDisposed()) throw new IllegalStateException("CRefactoringContext is already disposed."); getIndex(); if (pm != null && pm.isCanceled()) throw new OperationCanceledException(); tu= CModelUtil.toWorkingCopy(tu); IASTTranslationUnit ast= fASTCache.get(tu); if (ast == null) { if (fSharedAST != null && tu.equals(fSharedAST.getOriginatingTranslationUnit())) { ast = fSharedAST; } else { ast = ASTProvider.getASTProvider().acquireSharedAST(tu, fIndex, ASTProvider.WAIT_ACTIVE_ONLY, pm); if (ast != null && ast.hasNodesOmitted()) { ASTProvider.getASTProvider().releaseSharedAST(ast); ast = null; } if (ast == null) { if (pm != null && pm.isCanceled()) throw new OperationCanceledException(); ast= tu.getAST(fIndex, PARSE_MODE); fASTCache.put(tu, ast); } else { if (fSharedAST != null) { ASTProvider.getASTProvider().releaseSharedAST(fSharedAST); } fSharedAST = ast; } } } if (pm != null) { pm.done(); } return ast; }
Source:
<code>public CommandCallback getCallback() { <START> if (FeatureSupported.isQemuingCommitSupported(getStoragePool().getCompatibilityVersion())) { <END> return new ConcurrentChildCommandsExecutionCallback(); } if (getVm().isQualifiedForLiveSnapshotMerge() || getParameters().isUseCinderCommandCallback()) { return new ConcurrentChildCommandsExecutionCallback(); } return null; }</code><technical_language>merging condition line 505</technical_language>

Target:
public CommandCallback getCallback() { if (getVm().isQualifiedForLiveSnapshotMerge() || getParameters().isUseCinderCommandCallback() || FeatureSupported.isQemuingCommitSupported(getStoragePool().getCompatibilityVersion())) { return new ConcurrentChildCommandsExecutionCallback(); } return null; }
Source:
<code>private void handleFinishedContext(final String contextId, final Optional<ActiveContext> parentContext) { boolean needToCloseParent = false; if (contextIdToWorkerContexts.containsKey(contextId)) { handleFinishedWorkerContext(contextId); } else if (contextIdToServerContexts.containsKey(contextId)) { handleFinishedServerContext(contextId); } else if (contextIdToRootContexts.remove(contextId) != null) { LOG.log(Level.INFO, "Root context {0} is closed. Its evaluator will be released soon.", contextId); } else if (deletedWorkerContextIds.remove(contextId) || deletedServerContextIds.remove(contextId)) { LOG.log(Level.INFO, "The context {0} is closed by EM's Delete.", contextId); needToCloseParent = true; } else { LOG.log(Level.WARNING, "Untracked context: {0}", contextId); needToCloseParent = true; } if (needToCloseParent) { if (parentContext.isPresent()) { <START> LOG.log(Level.WARNING, "Close a context {0} , which is a parent of the closed context whose id is {1}", <END> new Object[]{parentContext, contextId}); parentContext.get().close(); } } }</code><technical_language>a warning message</technical_language>

Target:
private void handleFinishedContext(final String contextId, final Optional<ActiveContext> parentContext) { boolean needToCloseParent = false; if (contextIdToWorkerContexts.containsKey(contextId)) { handleFinishedWorkerContext(contextId); } else if (contextIdToServerContexts.containsKey(contextId)) { handleFinishedServerContext(contextId); } else if (contextIdToRootContexts.remove(contextId) != null) { LOG.log(Level.INFO, "Root context {0} is closed. Its evaluator will be released soon.", contextId); } else if (deletedWorkerContextIds.remove(contextId) || deletedServerContextIds.remove(contextId)) { LOG.log(Level.INFO, "The context {0} is closed by EM's Delete.", contextId); needToCloseParent = true; } else { LOG.log(Level.WARNING, "Untracked context: {0}", contextId); needToCloseParent = true; } if (needToCloseParent) { if (parentContext.isPresent()) { LOG.log(Level.INFO, "Close a context {0}, which is a parent of the closed context whose id is {1}", new Object[]{parentContext, contextId}); parentContext.get().close(); } } }
Source:
<code>public int position() { <START> return (int)mCompressedStream.getPosition(); <END> }</code><technical_language>This check for > maxInt throw in case. index file... know..</technical_language>

Target:
public long position() { if (mCompressedStream == null) { throw new SAMException("Null input stream."); } return mCompressedStream.getPosition(); }
Source:
<code>private void newSnapshot() { if (getWindow() != null) { return; } final UIConstants constants = ConstantsManager.getInstance().getConstants(); <START> GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getEntity(); <END> GlusterVolumeSnapshotModel snapshotModel = new GlusterVolumeSnapshotModel(); snapshotModel.setHelpTag(HelpTag.new_volume_snapshot); snapshotModel.setHashName("new_volume_snapshot"); snapshotModel.setTitle(ConstantsManager.getInstance().getConstants().createSnapshotTitle()); setWindow(snapshotModel); snapshotModel.getClusterName().setEntity(volumeEntity.getVdsGroupName()); snapshotModel.getVolumeName().setEntity(volumeEntity.getName()); UICommand okCommand = new UICommand("onCreateSnapshot", this); okCommand.setTitle(constants.ok()); okCommand.setIsDefault(true); snapshotModel.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("Cancel", this); cancelCommand.setTitle(constants.cancel()); cancelCommand.setIsCancel(true); snapshotModel.getCommands().add(cancelCommand); }</code><technical_language>Casting is required</technical_language>

Target:
private void newSnapshot() { if (getWindow() != null) { return; } final UIConstants constants = ConstantsManager.getInstance().getConstants(); GlusterVolumeEntity volumeEntity = getEntity(); GlusterVolumeSnapshotModel snapshotModel = new GlusterVolumeSnapshotModel(); snapshotModel.setHelpTag(HelpTag.new_volume_snapshot); snapshotModel.setHashName("new_volume_snapshot"); snapshotModel.setTitle(ConstantsManager.getInstance().getConstants().createSnapshotTitle()); setWindow(snapshotModel); snapshotModel.getClusterName().setEntity(volumeEntity.getVdsGroupName()); snapshotModel.getVolumeName().setEntity(volumeEntity.getName()); UICommand okCommand = new UICommand("onCreateSnapshot", this); okCommand.setTitle(constants.ok()); okCommand.setIsDefault(true); snapshotModel.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("Cancel", this); cancelCommand.setTitle(constants.cancel()); cancelCommand.setIsCancel(true); snapshotModel.getCommands().add(cancelCommand); }
Source:
<code>void isUserTakenToDiscussionsAfterClickOnViewAllSzl() { DiscussionsPage discussions = new MixedContentFooter().openWikiMainPage() .scrollToMCFooter() .getDiscussionsCard() .scrollToDiscussions() .clickOnViewAllLinkInDiscussions(); <START> Assertion.assertTrue(discussions.isDiscussions()); <END> }</code><technical_language>awesome rename more descriptive isDiscussionsPresent() similar</technical_language>

Target:
void isUserTakenToDiscussionsAfterClickOnViewAllSzl() { DiscussionsPage discussions = new MixedContentFooter().openWikiMainPage() .scrollToMCFooter() .getDiscussionsCard() .scrollToDiscussions() .clickOnViewAllLinkInDiscussions(); Assertion.assertTrue(discussions.isDiscussionsPresent()); }
Source:
<code>public int openInstallWizard(Collection<IInstallableUnit> initialSelections, InstallOperation operation, RemediationOperation remediationOperation, LoadMetadataRepositoryJob job) { if (operation == null) { InstallWizard wizard = new InstallWizard(this, operation, initialSelections, job); Shell[] shells = Display.getCurrent().getShells(); for (Shell shell : shells) { if (shell.getData() instanceof ProvisioningWizardDialog) { <START> shell.forceActive(); <END> return Window.OK; } } WizardDialog dialog = new ProvisioningWizardDialog(ProvUI.getDefaultParentShell(), wizard); dialog.create(); PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IProvHelpContextIds.INSTALL_WIZARD); return dialog.open(); } PreselectedIUInstallWizard wizard = new PreselectedIUInstallWizard(this, operation, initialSelections, job); wizard.setRemediationOperation(remediationOperation); WizardDialog dialog = new ProvisioningWizardDialog(ProvUI.getDefaultParentShell(), wizard); dialog.create(); PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IProvHelpContextIds.INSTALL_WIZARD); return dialog.open(); }</code><technical_language>forceActive, assign keyboard focus calling shell.setFocus()</technical_language>

Target:
public int openInstallWizard(Collection<IInstallableUnit> initialSelections, InstallOperation operation, RemediationOperation remediationOperation, LoadMetadataRepositoryJob job) { if (operation == null) { InstallWizard wizard = new InstallWizard(this, operation, initialSelections, job); Shell[] shells = Display.getCurrent().getShells(); for (Shell shell : shells) { if (shell.getData() instanceof ProvisioningWizardDialog) { shell.forceActive(); shell.setFocus(); return Window.OK; } } WizardDialog dialog = new ProvisioningWizardDialog(ProvUI.getDefaultParentShell(), wizard); dialog.create(); PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IProvHelpContextIds.INSTALL_WIZARD); return dialog.open(); } PreselectedIUInstallWizard wizard = new PreselectedIUInstallWizard(this, operation, initialSelections, job); wizard.setRemediationOperation(remediationOperation); WizardDialog dialog = new ProvisioningWizardDialog(ProvUI.getDefaultParentShell(), wizard); dialog.create(); PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IProvHelpContextIds.INSTALL_WIZARD); return dialog.open(); }
Source:
<code>public static void createServiceActivatorDeployment(File destination, String objectName, Class mbeanClass) throws IOException { final JavaArchive archive = ShrinkWrap.create(JavaArchive.class); archive.addClass(ServiceActivatorDeployment.class); archive.addClass(mbeanClass); archive.addAsServiceProvider(ServiceActivator.class, ServiceActivatorDeployment.class); StringBuilder sb = new StringBuilder(); sb.append(ServiceActivatorDeployment.MBEAN_CLASS_NAME); sb.append('='); sb.append(mbeanClass.getName()); sb.append("\n"); sb.append(ServiceActivatorDeployment.MBEAN_OBJECT_NAME); sb.append('='); sb.append(objectName); sb.append("\n"); archive.addAsManifestResource(PermissionUtils.createPermissionsXmlAsset( new MBeanPermission("org.wildfly.test.jmx.Dynamic#-[" + objectName + "]", "registerMBean"), <START> new MBeanPermission("org.wildfly.test.jmx.Dynamic#-[" + objectName + "]", "unregisterMBean"), <END> new MBeanTrustPermission("register")), "permissions.xml"); archive.addAsManifestResource(new StringAsset("Dependencies: org.jboss.msc,org.jboss.as.jmx,org.jboss.as.server,org.jboss.as.controller\n"), "MANIFEST.MF"); archive.addAsResource(new StringAsset(sb.toString()), ServiceActivatorDeployment.PROPERTIES_RESOURCE); archive.as(ZipExporter.class).exportTo(destination); }</code><technical_language>I mbeanClass.getName() instead of hard coding Dynamic</technical_language>

Target:
public static void createServiceActivatorDeployment(File destination, String objectName, Class mbeanClass) throws IOException { final JavaArchive archive = ShrinkWrap.create(JavaArchive.class); archive.addClass(ServiceActivatorDeployment.class); archive.addClass(mbeanClass); archive.addAsServiceProvider(ServiceActivator.class, ServiceActivatorDeployment.class); StringBuilder sb = new StringBuilder(); sb.append(ServiceActivatorDeployment.MBEAN_CLASS_NAME); sb.append('='); sb.append(mbeanClass.getName()); sb.append("\n"); sb.append(ServiceActivatorDeployment.MBEAN_OBJECT_NAME); sb.append('='); sb.append(objectName); sb.append("\n"); archive.addAsManifestResource(PermissionUtils.createPermissionsXmlAsset( new MBeanPermission(mbeanClass + "#-[" + objectName + "]", "registerMBean"), new MBeanPermission(mbeanClass + "#-[" + objectName + "]", "unregisterMBean"), new MBeanTrustPermission("register")), "permissions.xml"); archive.addAsManifestResource(new StringAsset("Dependencies: org.jboss.msc,org.jboss.as.jmx,org.jboss.as.server,org.jboss.as.controller\n"), "MANIFEST.MF"); archive.addAsResource(new StringAsset(sb.toString()), ServiceActivatorDeployment.PROPERTIES_RESOURCE); archive.as(ZipExporter.class).exportTo(destination); }
Source:
<code>public Class<? extends Body> getClassForType(Enum<BodyInternalTypes> modelType) { Class<? extends Body> returnType = null; BodyInternalTypes bodyType = BodyInternalTypes.valueOf(modelType.name()); switch (bodyType) { case SEMANTIC_LINK: returnType = SemanticLinkBody.class; break; case SEMANTIC_TAG: returnType = SemanticTagBody.class; break; case TAG: returnType = PlainTagBody.class; break; case TEXT: returnType = TextBody.class; break; case GEO_TAG: returnType = EdmPlaceBody.class; break; case GRAPH: returnType = RdfGraphBody.class; break; case SPECIFIC_RESOURCE: returnType = SpecificResourceBody.class; break; case FULL_TEXT_RESOURCE: returnType = FullTextResourceBody.class; break; <START> case ENTITY: <END> returnType = AgentBody.class; break; case VCARD_ADDRESS: returnType = VcardAddressBody.class; break; case LINK: throw new AnnotationInstantiationException("Bodies of type LINK must be empty!"); default: throw new AnnotationInstantiationException("unsupported (internal) body type: " + modelType); } return returnType; }</code><technical_language>Change AGENT</technical_language>

Target:
public Class<? extends Body> getClassForType(Enum<BodyInternalTypes> modelType) { Class<? extends Body> returnType = null; BodyInternalTypes bodyType = BodyInternalTypes.valueOf(modelType.name()); switch (bodyType) { case SEMANTIC_LINK: returnType = SemanticLinkBody.class; break; case SEMANTIC_TAG: returnType = SemanticTagBody.class; break; case TAG: returnType = PlainTagBody.class; break; case TEXT: returnType = TextBody.class; break; case GEO_TAG: returnType = EdmPlaceBody.class; break; case GRAPH: returnType = RdfGraphBody.class; break; case SPECIFIC_RESOURCE: returnType = SpecificResourceBody.class; break; case FULL_TEXT_RESOURCE: returnType = FullTextResourceBody.class; break; case AGENT: returnType = EdmAgentBody.class; break; case VCARD_ADDRESS: returnType = VcardAddressBody.class; break; case LINK: throw new AnnotationInstantiationException("Bodies of type LINK must be empty!"); default: throw new AnnotationInstantiationException("unsupported (internal) body type: " + modelType); } return returnType; }
Source:
<code><START> public static void generateTrace() { <END> List<String> processes = new ArrayList<String>(); for (String s : sfProcesses) { processes.add(s); } final int cpus = 25; GenerateKernelTrace gt = new GenerateKernelTrace(processes, 2l * Integer.MAX_VALUE - 100, 500000, cpus); gt.writeTrace(PATH); }</code><technical_language>delete file a new is generated? nice behavior clean mess. .deleteOnExit, if some tests file</technical_language>

Target:
public static void generateTrace() { final int cpus = 25; GenerateKernelTrace gt = new GenerateKernelTrace(2l * Integer.MAX_VALUE - 100, 500000, cpus); gt.writeTrace(PATH); }
Source:
<code>static void internalBeforeClassSetup(Map<String, String> overrides, Class clazz) throws Exception { HiveConf conf = new HiveConf(clazz); conf.set("dfs.client.use.datanode.hostname", "true"); conf.set("hadoop.proxyuser." + Utils.getUGI().getShortUserName() + ".hosts", "*"); MiniDFSCluster miniDFSCluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).format(true).build(); HashMap<String, String> acidEnableConf = new HashMap<String, String>() {{ put("fs.defaultFS", miniDFSCluster.getFileSystem().getUri().toString()); <START> put("hive.support.concurrency", "true"); <END> put("hive.txn.manager", "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager"); put("hive.metastore.client.capability.check", "false"); put("hive.repl.bootstrap.dump.open.txn.timeout", "1s"); put("hive.exec.dynamic.partition.mode", "nonstrict"); put("hive.strict.checks.bucketing", "false"); put("hive.mapred.mode", "nonstrict"); put("mapred.input.dir.recursive", "true"); put("hive.metastore.disallow.incompatible.col.type.changes", "false"); put("hive.in.repl.test", "true"); }}; acidEnableConf.putAll(overrides); primary = new WarehouseInstance(LOG, miniDFSCluster, acidEnableConf); replica = new WarehouseInstance(LOG, miniDFSCluster, acidEnableConf); }</code><technical_language>set strict managed table true</technical_language>

Target:
static void internalBeforeClassSetup(Map<String, String> overrides, Class clazz) throws Exception { HiveConf conf = new HiveConf(clazz); conf.set("dfs.client.use.datanode.hostname", "true"); conf.set("hadoop.proxyuser." + Utils.getUGI().getShortUserName() + ".hosts", "*"); MiniDFSCluster miniDFSCluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).format(true).build(); Map<String, String> acidEnableConf = new HashMap<String, String>() {{ put("fs.defaultFS", miniDFSCluster.getFileSystem().getUri().toString()); put("hive.support.concurrency", "true"); put("hive.txn.manager", "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager"); put("hive.metastore.client.capability.check", "false"); put("hive.repl.bootstrap.dump.open.txn.timeout", "1s"); put("hive.exec.dynamic.partition.mode", "nonstrict"); put("hive.strict.checks.bucketing", "false"); put("hive.mapred.mode", "nonstrict"); put("mapred.input.dir.recursive", "true"); put("hive.metastore.disallow.incompatible.col.type.changes", "false"); put("hive.strict.managed.tables", "true"); put("hive.in.repl.test", "true"); }}; acidEnableConf.putAll(overrides); primary = new WarehouseInstance(LOG, miniDFSCluster, acidEnableConf); replica = new WarehouseInstance(LOG, miniDFSCluster, acidEnableConf); }
Source:
<code>BlockedThreadChecker(long interval, long maxEventLoopExecTime, long maxWorkerExecTime, long warningExceptionTime) { timer = new Timer("vertx-blocked-thread-checker", true); timer.schedule(new TimerTask() { @Override public void run() { long now = System.nanoTime(); for (VertxThread thread: threads.keySet()) { long execStart = thread.startTime(); long dur = now - execStart; <START> if (execStart != 0 && dur > (thread.isWorker() ? maxWorkerExecTime : maxEventLoopExecTime)) { <END> long timeLimit = thread.isWorker() ? maxWorkerExecTime : maxEventLoopExecTime; final String message = "Thread " + thread + " has been blocked for " + (dur / 1000000) + " ms, time limit is " + (timeLimit / 1000000); if (dur <= warningExceptionTime) { log.warn(message); } else { VertxException stackTrace = new VertxException("Thread blocked"); stackTrace.setStackTrace(thread.getStackTrace()); log.warn(message, stackTrace); } } } } }, interval, interval); }</code><technical_language>duplicate evaulation, do once</technical_language>

Target:
BlockedThreadChecker(long interval, long maxEventLoopExecTime, long maxWorkerExecTime, long warningExceptionTime) { timer = new Timer("vertx-blocked-thread-checker", true); timer.schedule(new TimerTask() { @Override public void run() { long now = System.nanoTime(); for (VertxThread thread: threads.keySet()) { long execStart = thread.startTime(); long dur = now - execStart; final long timeLimit = thread.isWorker() ? maxWorkerExecTime : maxEventLoopExecTime; if (execStart != 0 && dur > timeLimit) { final String message = "Thread " + thread + " has been blocked for " + (dur / 1000000) + " ms, time limit is " + (timeLimit / 1000000); if (dur <= warningExceptionTime) { log.warn(message); } else { VertxException stackTrace = new VertxException("Thread blocked"); stackTrace.setStackTrace(thread.getStackTrace()); log.warn(message, stackTrace); } } } } }, interval, interval); }
Source:
<code>public void testBadNumberOfArguments() throws URISyntaxException, HiveException { ObjectInspector value1 = PrimitiveObjectInspectorFactory.javaStringObjectInspector; ObjectInspector value2 = PrimitiveObjectInspectorFactory.javaStringObjectInspector; ObjectInspector[] initArguments = new ObjectInspector[]{value1, value2}; GeocodedDataUDF geocodedDataUDF = new GeocodedDataUDF( TestGeocodedDataUDF.class.getResource(defaultDatabaseFile).getFile()); try { <START> geocodedDataUDF.initialize(initArguments); <END> fail("UDFArgumentLengthException was not thrown for invalid number of arguments"); } catch (UDFArgumentLengthException lenEx) { } }</code><technical_language>exceptions bubble get a stack trace aids debugging</technical_language>

Target:
public void testBadNumberOfArguments() throws HiveException { ObjectInspector value1 = PrimitiveObjectInspectorFactory.javaStringObjectInspector; ObjectInspector value2 = PrimitiveObjectInspectorFactory.javaStringObjectInspector; ObjectInspector[] initArguments = new ObjectInspector[]{value1, value2}; GeocodedDataUDF geocodedDataUDF = new GeocodedDataUDF(); geocodedDataUDF.initialize(initArguments); }
Source:
<code>public void onUpdate(CounterEvent event) { try { queue.put(event); <START> log.tracef("[%s] add event %s", name, event); <END> } catch (InterruptedException e) { log.errorf(e, "[%s] interrupted while adding event %s", name, event); } }</code><technical_language>isTraceEnabled is necessary</technical_language>

Target:
public void onUpdate(CounterEvent event) { try { queue.put(event); if (trace) { log.tracef("[%s] add event %s", name, event); } } catch (InterruptedException e) { log.errorf(e, "[%s] interrupted while adding event %s", name, event); } }
Source:
<code>protected static boolean isSerializableAndValueBased(Type type) { JavaType javaType = (JavaType)type; if (javaType.isParameterized()) { ParametrizedTypeJavaType parameterizedType = (ParametrizedTypeJavaType)javaType; return isSubtypeOfCollectionApi(parameterizedType) && parameterizedType.typeParameters().stream() .anyMatch(t -> isSerializableAndValueBased(parameterizedType.substitution(t))); <START> } else { <END> return ValueBasedUtils.isValueBased(javaType); } }</code><technical_language>need for else here</technical_language>

Target:
private static boolean isSerializableAndValueBased(Type type) { JavaType javaType = (JavaType) type; if (javaType.isParameterized()) { ParametrizedTypeJavaType parameterizedType = (ParametrizedTypeJavaType) javaType; return isSubtypeOfCollectionApi(parameterizedType) && parameterizedType.typeParameters().stream() .anyMatch(t -> isSerializableAndValueBased(parameterizedType.substitution(t))); } return ValueBasedUtils.isValueBased(javaType); }
Source:
<code>private CloudVmTypes getCloudVmTypes(CloudCredential cloudCredential, Region region, Map<String, String> filters, Predicate<VmType> enabledInstanceTypeFilter) { CloudRegions regions = regions(cloudCredential, region, filters); Map<String, Set<VmType>> cloudVmResponses = new HashMap<>(); Map<String, VmType> defaultCloudVmResponses = new HashMap<>(); List<AvailabilityZone> availabilityZones = regions.getCloudRegions().get(region); if (availabilityZones != null && !availabilityZones.isEmpty()) { for (AvailabilityZone availabilityZone : availabilityZones) { Set<VmType> types = vmTypes.get(region).stream() .filter(enabledInstanceTypeFilter) .collect(Collectors.toSet()); cloudVmResponses.put(availabilityZone.value(), types); defaultCloudVmResponses.put(availabilityZone.value(), defaultVmTypes.get(region)); } } <START> return new CloudVmTypes(cloudVmResponses, defaultCloudVmResponses); <END> }</code><technical_language>throw exception, if AZ list is empty? If not, log fact please</technical_language>

Target:
private CloudVmTypes getCloudVmTypes(CloudCredential cloudCredential, Region region, Map<String, String> filters, Predicate<VmType> enabledInstanceTypeFilter) { CloudRegions regions = regions(cloudCredential, region, filters); Map<String, Set<VmType>> cloudVmResponses = new HashMap<>(); Map<String, VmType> defaultCloudVmResponses = new HashMap<>(); List<AvailabilityZone> availabilityZones = regions.getCloudRegions().get(region); if (availabilityZones != null && !availabilityZones.isEmpty()) { for (AvailabilityZone availabilityZone : availabilityZones) { Set<VmType> types = vmTypes.get(region).stream() .filter(enabledInstanceTypeFilter) .collect(Collectors.toSet()); cloudVmResponses.put(availabilityZone.value(), types); defaultCloudVmResponses.put(availabilityZone.value(), defaultVmTypes.get(region)); } } else { LOGGER.info("Availability zones is null or empty in {}", region.getRegionName()); } return new CloudVmTypes(cloudVmResponses, defaultCloudVmResponses); }
Source:
<code>public void close() { listener = null; <START> if (null != curatorFramework && !curatorFramework.isZk34CompatibilityMode()) { <END> curatorFramework.watches().remove(this); } }</code><technical_language>is safer check explicitly, remove() call next line throw IllegalStateException if in compatibility mode. If starts curator in this mode (and easy reverting zookeeper dependency version: actual _code_ changes), this start throwing exceptions</technical_language>

Target:
public void close() { if (listener != null && !curatorFramework.isZk34CompatibilityMode()) { try { curatorFramework.watches().remove(this).forPath(key); } catch (final Exception ex) { } } listener = null; }
Source:
<code>private String copyFileToHDFS(FileSystem hdfs, String smbSourceFile, Path dest, NtlmPasswordAuthentication auth) throws IOException { SmbFile smbFile = new SmbFile(smbSourceFile, auth); String name = smbFile.getName(); <START> Path nDest = new Path(dest, name); <END> LOG.debug("Thread is accessing source file {}, dest file {}", Thread.currentThread().getName(), smbFile.getName(), nDest.getName()); if (hdfs.exists(nDest)) { LOG.info("File already exists on HDFS, Skipping", nDest.getName()); return name; } LOG.info("Copying file to {}", smbSourceFile, nDest.toString()); try (InputStream in = smbFile.getInputStream(); BufferedOutputStream out = new BufferedOutputStream(hdfs.create(nDest))) { ByteStreams.copy(in, out); } catch (IOException e) { LOG.info("Exception in getting input stream for file {}", name, e); } return name; }</code><technical_language>is 'n' in 'nDest' for</technical_language>

Target:
private String copyFileToHDFS(FileSystem hdfs, String smbSourceFile, Path dest, NtlmPasswordAuthentication auth) throws IOException { SmbFile smbFile = new SmbFile(smbSourceFile, auth); String name = smbFile.getName(); Path destFile = new Path(dest, name); LOG.debug("Thread is copying source file {}, dest file {}", Thread.currentThread().getName(), smbFile.getName(), destFile.getName()); if (hdfs.exists(destFile) && !config.overwrite) { LOG.info("File already exists on HDFS, Skipping", destFile.getName()); return null; } LOG.info("Copying file to {}", smbSourceFile, destFile.toString()); try (InputStream in = smbFile.getInputStream(); BufferedOutputStream out = new BufferedOutputStream(hdfs.create(destFile), config.bufferSize)) { ByteStreams.copy(in, out); } catch (IOException e) { LOG.warn("Exception in copying the file {}", name, e); } return name; }
Source:
<code>private String loadWorkDefinitionFromArtifact(String name) throws OseeCoreException { <START> Artifact artifact = null; <END> try { artifact = ArtifactQuery.getArtifactFromTypeAndNameNoException(AtsArtifactTypes.WorkDefinition, name, BranchManager.getCommonBranch()); if (artifact != null) { return loadWorkDefinitionFromArtifact(artifact); } } catch (OseeCoreException ex) { throw ex; } catch (Exception ex) { throw new OseeWrappedException(String.format("Error loading AtsDsl [%s] from Artifact", name), ex); } return null; }</code><technical_language>Error handling is confusing. want throw exceptions ArtifactQuery call try catch block exception want catch generated loadWorkDefinitionFromArtifact</technical_language>

Target:
private String loadWorkDefinitionFromArtifact(String name) throws OseeCoreException { Artifact artifact = ArtifactQuery.getArtifactFromTypeAndNameNoException(AtsArtifactTypes.WorkDefinition, name, BranchManager.getCommonBranch()); return loadWorkDefinitionFromArtifact(artifact); }
Source:
<code>public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } IterableMappingMethod other = (IterableMappingMethod) obj; if ( !getResultType().equals( other.getResultType() ) ) { return false; } if ( getSourceParameters().size() != other.getSourceParameters().size() ) { return false; } for ( int i = 0; i < getSourceParameters().size(); i++ ) { <START> if ( !getSourceParameters().get( i ).getType().equals( other.getSourceParameters().get( i ) ) ) { <END> return false; } List<Type> thisTypeParameters = getSourceParameters().get( i ).getType().getTypeParameters(); List<Type> otherTypeParameters = other.getSourceParameters().get( i ).getType().getTypeParameters(); if ( !thisTypeParameters.equals( otherTypeParameters ) ) { return false; } } if ( this.selectionParameters != null ) { if ( !this.selectionParameters.equals( other.selectionParameters ) ) { return false; } } else if ( other.selectionParameters != null ) { return false; } return isMapNullToDefault() == other.isMapNullToDefault(); }</code><technical_language>I reckon its: !getSourceParameters().get( i ).getType().equals( other.getSourceParameters().get( i ).getType(), right</technical_language>

Target:
public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } IterableMappingMethod other = (IterableMappingMethod) obj; if ( !getResultType().equals( other.getResultType() ) ) { return false; } if ( getSourceParameters().size() != other.getSourceParameters().size() ) { return false; } for ( int i = 0; i < getSourceParameters().size(); i++ ) { if ( !getSourceParameters().get( i ).getType().equals( other.getSourceParameters().get( i ).getType() ) ) { return false; } List<Type> thisTypeParameters = getSourceParameters().get( i ).getType().getTypeParameters(); List<Type> otherTypeParameters = other.getSourceParameters().get( i ).getType().getTypeParameters(); if ( !thisTypeParameters.equals( otherTypeParameters ) ) { return false; } } if ( this.selectionParameters != null ) { if ( !this.selectionParameters.equals( other.selectionParameters ) ) { return false; } } else if ( other.selectionParameters != null ) { return false; } return isMapNullToDefault() == other.isMapNullToDefault(); }
Source:
<code>private synchronized void init() { if(functionNames == null) { List<ProcessFactory> factories = new ArrayList<ProcessFactory>(Processors .getProcessFactories()); Collections.sort(factories, FACTORY_COMPARATOR); processToFunction = new HashMap<Name,FunctionName>(); functionNames = new ArrayList<FunctionName>(); for (ProcessFactory factory : factories) { if( !factory.isAvailable() ) continue; for (Name processName : factory.getNames()) { try { Map<String, Parameter<?>> resultInfo = factory.getResultInfo(processName, null); Parameter<?> result = getPrimary(resultInfo); if (result != null) { Map<String, Parameter<?>> parameterInfo = factory.getParameterInfo(processName); List<String> argumentNames = new ArrayList<String>(parameterInfo.keySet()); List<org.opengis.parameter.Parameter<?>> args = new ArrayList<org.opengis.parameter.Parameter<?>>( argumentNames.size() ); for(String argumentName : argumentNames ){ args.add( parameterInfo.get(argumentName)); } FunctionName functionName = new FunctionNameImpl(processName, result, args); functionNames.add(functionName); processToFunction.put(processName, functionName); } } <START> catch (Throwable unavailable){ <END> Logger log = Logger.getLogger(factory.getClass().getName()); log.finer( "Process "+ processName + " unavailable:"+unavailable); continue; } } } functionNames.add(ParameterFunction.NAME); } }</code><technical_language>Similarly here, a space ) {</technical_language>

Target:
private synchronized void init() { if(functionNames == null) { List<ProcessFactory> factories = new ArrayList<ProcessFactory>(Processors .getProcessFactories()); Collections.sort(factories, FACTORY_COMPARATOR); processToFunction = new HashMap<Name,FunctionName>(); functionNames = new ArrayList<FunctionName>(); for (ProcessFactory factory : factories) { if (!factory.isAvailable()) { continue; } for (Name processName : factory.getNames()) { try { Map<String, Parameter<?>> resultInfo = factory.getResultInfo(processName, null); Parameter<?> result = getPrimary(resultInfo); if (result != null) { Map<String, Parameter<?>> parameterInfo = factory.getParameterInfo(processName); List<String> argumentNames = new ArrayList<String>(parameterInfo.keySet()); List<org.opengis.parameter.Parameter<?>> args = new ArrayList<org.opengis.parameter.Parameter<?>>( argumentNames.size() ); for(String argumentName : argumentNames ){ args.add( parameterInfo.get(argumentName)); } FunctionName functionName = new FunctionNameImpl(processName, result, args); functionNames.add(functionName); processToFunction.put(processName, functionName); } } catch (Throwable unavailable) { Logger log = Logger.getLogger(factory.getClass().getName()); log.finer("Process " + processName + " unavailable:" + unavailable); continue; } } } functionNames.add(ParameterFunction.NAME); } }
Source:
<code>public long hashByteBuffer(ByteBuffer input) { <START> input.flip(); <END> return LongHashFunction.xx(0).hashBytes(input); }</code><technical_language>responsibility of caller prepare buffer. A ByteBuffer in ways is caller part needs a hash from</technical_language>

Target:
public long hashByteBuffer(ByteBuffer input) { return LongHashFunction.xx(0).hashBytes(input); }
Source:
<code><START> public static Map<String, Set<String>> getRequirementValuesMap(Iterable<IAnalysisRequirementProvider> providers) { <END> Map<String, Set<String>> valuesByType = new HashMap<>(); for (IAnalysisRequirementProvider provider : providers) { for (TmfAnalysisRequirement requirement : provider.getAnalysisRequirements()) { Set<String> values = valuesByType.get(requirement.getType()); if (values == null) { values = new HashSet<>(); } values.addAll(requirement.getValues()); valuesByType.put(requirement.getType(), values); } } return valuesByType; }</code><technical_language>Guava's Multimap instead. creation a bit more simple. I 100% sure, because..</technical_language>

Target:
public static SetMultimap<String, String> getRequirementValuesMap(Iterable<IAnalysisRequirementProvider> providers) { SetMultimap<String, String> valuesByType = HashMultimap.create(); for (IAnalysisRequirementProvider provider : providers) { for (TmfAnalysisRequirement requirement : provider.getAnalysisRequirements()) { valuesByType.putAll(requirement.getType(), requirement.getValues()); } } return valuesByType; }
Source:
<code>private void createSmallBamToOutputStream(final OutputStream outputStream,boolean binary) { final SAMFileWriterFactory factory = new SAMFileWriterFactory(); factory.setCreateIndex(false); factory.setCreateMd5File(false); final File wontBeUsed = new File("wontBeUsed.tmp"); final int maxRecsInRam = 271828; factory.setMaxRecordsInRam(maxRecsInRam); <START> factory.setTempDirectory(wontBeUsed); <END> final SAMFileHeader header = new SAMFileHeader(); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); header.addSequence(new SAMSequenceRecord("chr1", 123)); final SAMFileWriter writer = (binary? factory.makeBAMWriter(header, false, outputStream): factory.makeSAMWriter(header, false, outputStream) ); Assert.assertEquals(maxRecsInRam, ((SAMFileWriterImpl) writer).getMaxRecordsInRam()); Assert.assertEquals(wontBeUsed, ((SAMFileWriterImpl) writer).getTempDirectory()); fillSmallBam(writer); writer.close(); }</code><technical_language>a separate test case test this functionality instead of modifying existing one</technical_language>

Target:
private void createSmallBamToOutputStream(final OutputStream outputStream,boolean binary) { final SAMFileWriterFactory factory = new SAMFileWriterFactory(); factory.setCreateIndex(false); factory.setCreateMd5File(false); final SAMFileHeader header = new SAMFileHeader(); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); header.addSequence(new SAMSequenceRecord("chr1", 123)); final SAMFileWriter writer = (binary? factory.makeBAMWriter(header, false, outputStream): factory.makeSAMWriter(header, false, outputStream) ); fillSmallBam(writer); writer.close(); }
Source:
<code>@Test public void connectNodeShouldSucceedOnMaster() throws Exception { <START> final Computer masterComputer = j.jenkins.get().getComputer(""); <END> CLICommandInvoker.Result result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); }</code><technical_language>suggestion final Computer masterComputer = j.jenkins.getComputer("");</technical_language>

Target:
@Test public void connectNodeShouldSucceedOnMaster() throws Exception { final Computer masterComputer = j.jenkins.getComputer(""); CLICommandInvoker.Result result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); }
Source:
<code>public void testExpirationMaxIdleInExec() throws Exception { if (cache.getCacheConfiguration().clustering().cacheMode().isClustered()) { <START> return; <END> } for (int i = 0; i < SIZE; i++) { cache.put("key-" + i, "value-" + i,-1, null, 1, TimeUnit.MILLISECONDS); } timeService.advance(2); for (int i = 0; i < SIZE; i++) { cache.getAdvancedCache().getDataContainer().executeTask(KeyFilter.ACCEPT_ALL_FILTER, (k, ice) -> { throw new RuntimeException("No task should be executed on expired entry"); }); } }</code><technical_language>IMO if executeTask() trigger maxIdle expiration, assert</technical_language>

Target:
public void testExpirationMaxIdleInExec() throws Exception { for (int i = 0; i < SIZE; i++) { cache.put("key-" + i, "value-" + i,-1, null, 1, TimeUnit.MILLISECONDS); } timeService.advance(2); if (cache.getCacheConfiguration().clustering().cacheMode().isClustered()) { AtomicInteger invocationCount = new AtomicInteger(); cache.getAdvancedCache().getDataContainer().executeTask(KeyFilter.ACCEPT_ALL_FILTER, (k, ice) -> invocationCount.incrementAndGet()); assertEquals(SIZE, invocationCount.get()); } else { cache.getAdvancedCache().getDataContainer().executeTask(KeyFilter.ACCEPT_ALL_FILTER, (k, ice) -> { throw new RuntimeException("No task should be executed on expired entry"); }); } }