auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Test public void testDecimalNegate() { final CalciteAssert.AssertThat with = CalciteAssert.that().withSchema("s", CATCHALL); with.query("select - \"bigDecimal\" from \"s\".\"everyTypes\"") .returnsUnordered( "EXPR$0=0", "EXPR$0=null"); <START> with.query("select - \"bigDecimal\" from \"s\".\"everyTypes\"").planContains(".decimalNegate("); <END> }</code><technical_language>combine with.query(...) .planContains(...) .returns..</technical_language>

Target:
@Test void testDecimalNegate() { final CalciteAssert.AssertThat with = CalciteAssert.that().withSchema("s", CATCHALL); with.query("select - \"bigDecimal\" from \"s\".\"everyTypes\"") .planContains("negate()") .returnsUnordered( "EXPR$0=0", "EXPR$0=null"); }
Source:
<code>private RepositoryTreeNode getNodeForPath(Repository repository, String repoRelativePath) { RepositoryTreeNode workingDirNode = getRepositoryChildNode(repository, RepositoryTreeNodeType.WORKINGDIR); RepositoryTreeNode currentNode = workingDirNode; ITreeContentProvider cp = (ITreeContentProvider) getCommonViewer() .getContentProvider(); IPath relPath = new Path(repoRelativePath); for (String segment : relPath.segments()) { for (Object child : <START> cp.getChildren(workingDirNode)) <END> { @SuppressWarnings("unchecked") RepositoryTreeNode<File> childNode = (RepositoryTreeNode<File>) child; if (childNode.getObject().getName().equals(segment)) { currentNode = childNode; break; } } } return currentNode; }</code><technical_language>correct. currentNode</technical_language>

Target:
private RepositoryTreeNode getNodeForPath(Repository repository, String repoRelativePath) { RepositoryTreeNode currentNode = getRepositoryChildNode(repository, RepositoryTreeNodeType.WORKINGDIR); ITreeContentProvider cp = (ITreeContentProvider) getCommonViewer() .getContentProvider(); IPath relPath = new Path(repoRelativePath); for (String segment : relPath.segments()) { for (Object child : cp.getChildren(currentNode)) { @SuppressWarnings("unchecked") RepositoryTreeNode<File> childNode = (RepositoryTreeNode<File>) child; if (childNode.getObject().getName().equals(segment)) { currentNode = childNode; break; } } } return currentNode; }
Source:
<code>public void handleModStateEvent(FMLEvent event) { if (!eventHandlers.containsKey(event.getClass())) { return; } try { eventHandlers.get(event.getClass()) .stream() .map(eventHandler -> { try { return eventHandler.handleEvent(event); } catch (Throwable t) { CompletableFuture<Void> future = CompletableFuture.completedFuture(null); future.completeExceptionally(t); return future; } }) .reduce((future1, future2) -> future1.thenComposeAsync(aVoid -> future2)) .orElse(CompletableFuture.completedFuture(null)) <START> .toCompletableFuture() <END> .join(); } catch (Throwable t) { controller.errorOccurred(this, t); } }</code><technical_language>Is this guaranteed supported</technical_language>

Target:
public void handleModStateEvent(FMLEvent event) { if (!eventHandlers.containsKey(event.getClass())) { return; } try { CompletableFuture[] futures = eventHandlers.get(event.getClass()) .stream() .map(eventHandler -> eventHandler.apply(this.getMod(), event)) .toArray(CompletableFuture[]::new); CompletableFuture.allOf(futures).join(); } catch (Throwable t) { controller.errorOccurred(this, t); } }
Source:
<code>public KTable<Windowed<K>, V> aggregate(final Initializer<V> initializer, final Named named, final Materialized<K, V, WindowStore<Bytes, byte[]>> materialized) { Objects.requireNonNull(initializer, "initializer can't be null"); Objects.requireNonNull(named, "named can't be null"); Objects.requireNonNull(materialized, "materialized can't be null"); final MaterializedInternal<K, V, WindowStore<Bytes, byte[]>> materializedInternal = new MaterializedInternal<>( materialized, builder, AGGREGATE_NAME); return aggregateBuilder.build( groupPatterns, initializer, <START> new NamedInternal(named), <END> materialize(materializedInternal), materializedInternal.keySerde() != null ? new FullTimeWindowedSerde<>(materializedInternal.keySerde(), windows.size()) : null, materializedInternal.valueSerde(), materializedInternal.queryableStoreName(), windows, null, null); }</code><technical_language>this change</technical_language>

Target:
public KTable<Windowed<K>, V> aggregate(final Initializer<V> initializer, final Named named, final Materialized<K, V, WindowStore<Bytes, byte[]>> materialized) { Objects.requireNonNull(initializer, "initializer can't be null"); Objects.requireNonNull(named, "named can't be null"); Objects.requireNonNull(materialized, "materialized can't be null"); final MaterializedInternal<K, V, WindowStore<Bytes, byte[]>> materializedInternal = new MaterializedInternal<>( materialized, builder, CogroupedKStreamImpl.AGGREGATE_NAME); return aggregateBuilder.build( groupPatterns, initializer, new NamedInternal(named), materialize(materializedInternal), materializedInternal.keySerde() != null ? new FullTimeWindowedSerde<>(materializedInternal.keySerde(), windows.size()) : null, materializedInternal.valueSerde(), materializedInternal.queryableStoreName(), windows, null, null); }
Source:
<code>public static void main(String[] args) throws Exception { if (args.length < 2 || args.length > 3) { usage(); } final String namespace = args.length >= 3 ? args[2] : "kb"; <START> final String propFile = args.length >= 4 ? args[3] : null; <END> Journal j1 = journalFromFile(args[0], propFile), j2 = journalFromFile(args[1], propFile); try { final AbstractTripleStore ts1 = (AbstractTripleStore) j1.getResourceLocator().locate( namespace, TimestampUtility.asHistoricalRead(j1.getLastCommitTime())); final AbstractTripleStore ts2 = (AbstractTripleStore) j2.getResourceLocator().locate( namespace, TimestampUtility.asHistoricalRead(j2.getLastCommitTime())); modelsEqual(ts1, ts2); } finally { j1.close(); j2.close(); } }</code><technical_language>property configuration for journals? utility states, supports graphs lexicons (assigned namespace level), need support lexicons journals level too</technical_language>

Target:
public static void main(String[] args) throws Exception { if (args.length < 2 || args.length > 3) { usage(); } final String namespace = args.length >= 3 ? args[2] : "kb"; Journal j1 = null, j2 = null; try { j1 = journalFromFile(args[0]); j2 = journalFromFile(args[1]); final AbstractTripleStore ts1 = (AbstractTripleStore) j1.getResourceLocator().locate( namespace, TimestampUtility.asHistoricalRead(j1.getLastCommitTime())); final AbstractTripleStore ts2 = (AbstractTripleStore) j2.getResourceLocator().locate( namespace, TimestampUtility.asHistoricalRead(j2.getLastCommitTime())); modelsEqual(ts1, ts2); } finally { if (j1 != null) { j1.close(); } if (j2 != null) { j2.close(); } } }
Source:
<code>public void addTransactionAttribute( @Option(required = true, name = "type") final TransactionAttributeType transactionAttributeType, final PipeOut out) throws FileNotFoundException { JavaSource<?> ejb; if (resource instanceof JavaResource) { ejb = JavaUtils.getJavaClassFrom(resource); <START> ejb.addAnnotation(TransactionAttribute.class).setEnumValue( <END> transactionAttributeType); save(ejb); } else if (resource instanceof JavaMethodResource) { Method<? extends JavaSource<?>> m = ((JavaMethodResource) resource) .getUnderlyingResourceObject(); m.addAnnotation(TransactionAttribute.class).setEnumValue( transactionAttributeType); ejb = m.getOrigin(); save(ejb); } else { throw new RuntimeException( "Impossibile to add transactionAttribute to method " + resource.getName()); } }</code><technical_language>if a check needs done if annotation exists</technical_language>

Target:
public void addTransactionAttribute( @Option(required = true, name = "type") final TransactionAttributeType transactionAttributeType, final PipeOut out) throws FileNotFoundException { JavaSource<?> ejb; if (resource instanceof JavaResource) { ejb = getJavaClassFrom(resource); if (ejb.hasAnnotation(transactionAttributeType.getAnnotation())) { throw new RuntimeException( "Current class have already TransactionAttribute annotation!"); } ejb.addAnnotation(TransactionAttribute.class).setStringValue( transactionAttributeType.getAnnotation()); save(ejb); } else if (resource instanceof JavaMethodResource) { Method<? extends JavaSource<?>> m = ((JavaMethodResource) resource) .getUnderlyingResourceObject(); if (m.hasAnnotation(transactionAttributeType.getAnnotation())) { throw new RuntimeException( "Current method have already TransactionAttribute annotation!"); } m.addAnnotation(TransactionAttribute.class).setStringValue( transactionAttributeType.getAnnotation()); ejb = m.getOrigin(); save(ejb); } else { throw new RuntimeException( "Impossibile to add transactionAttribute to method " + resource.getName()); } }
Source:
<code>public void testSetPredecessor() { final Instruction predecessor = new Instruction( new InsnNode(Opcodes.NOP), 122); instruction.setPredecessor(predecessor, 0); assertEquals(1, predecessor.getBranches()); try { instruction.setPredecessor(predecessor, 0); fail("exception expected"); <START> } catch (IllegalStateException e) { <END> } }</code><technical_language>@Godin Ah I see. in this case I prefer a separate test case specifically for this scenario</technical_language>

Target:
public void testSetPredecessor() { final Instruction predecessor = new Instruction( new InsnNode(Opcodes.NOP), 122); instruction.setPredecessor(predecessor, 0); assertEquals(1, predecessor.getBranches()); }
Source:
<code><START> static Optional<RefundStatus> newRefundStateForRefundNotification(String notificationStatus) { <END> final EpdqNotification.StatusCode statusCode = EpdqNotification.StatusCode.byCode(notificationStatus); switch (statusCode) { case EPDQ_REFUND: case EPDQ_PAYMENT_DELETED: return Optional.of(REFUNDED); case EPDQ_REFUND_REFUSED: case EPDQ_DELETION_REFUSED: case EPDQ_REFUND_DECLINED_BY_ACQUIRER: return Optional.of(REFUND_ERROR); default: return Optional.empty(); } }</code><technical_language>is this method private? of this class</technical_language>

Target:
private static Optional<RefundStatus> newRefundStateForRefundNotification(String notificationStatus) { final EpdqNotification.StatusCode statusCode = EpdqNotification.StatusCode.byCode(notificationStatus); switch (statusCode) { case EPDQ_REFUND: case EPDQ_PAYMENT_DELETED: return Optional.of(REFUNDED); case EPDQ_REFUND_REFUSED: case EPDQ_DELETION_REFUSED: case EPDQ_REFUND_DECLINED_BY_ACQUIRER: return Optional.of(REFUND_ERROR); default: return Optional.empty(); } }
Source:
<code>public synchronized V refreshValue() { <START> value = new SoftReference<>(action.get()); <END> expiresAt = System.nanoTime() + expiry; return value.get(); }</code><technical_language>topic above: Java final V valueNew = action.get(); = new SoftReference<>(valueNew); expiresAt = System.nanoTime() + expiry; return valueNew;</technical_language>

Target:
public synchronized V refreshValue() { V freshValue = action.get(); value = new SoftReference<>(freshValue); expiresAt = System.nanoTime() + expiry; return freshValue; }
Source:
<code>private void localize(CommonApplicationConstants constants) { aliasEditor.setLabel(constants.aliasVmDiskPopup()); sizeEditor.setLabel(constants.sizeVmDiskPopup()); sizeExtendEditor.setLabel(constants.extendImageSizeBy()); descriptionEditor.setLabel(constants.descriptionVmDiskPopup()); datacenterEditor.setLabel(constants.dcVmDiskPopup()); storageDomainEditor.setLabel(constants.storageDomainVmDiskPopup()); hostListEditor.setLabel(constants.hostVmDiskPopup()); quotaEditor.setLabel(constants.quotaVmDiskPopup()); interfaceEditor.setLabel(constants.interfaceVmDiskPopup()); volumeTypeEditor.setLabel(constants.allocationDisk()); storageTypeEditor.setLabel(constants.storageTypeVmDiskPopup()); plugDiskToVmEditor.setLabel(constants.plugDiskVmDiskPopup()); wipeAfterDeleteEditor.setLabel(constants.wipeAfterDeleteVmDiskPopup()); isBootableEditor.setLabel(constants.isBootableVmDiskPopup()); isShareableEditor.setLabel(constants.isShareableVmDiskPopup()); isReadOnlyEditor.setLabel(constants.isReadOnlyVmDiskPopup()); isSgIoUnfilteredEditor.setLabel(constants.isSgIoUnfilteredEditor()); attachEditor.setLabel(constants.attachDiskVmDiskPopup()); <START> isPluggedEditor.setLabel(constants.activateVmDiskPopup()); <END> }</code><technical_language>this one</technical_language>

Target:
private void localize(CommonApplicationConstants constants) { aliasEditor.setLabel(constants.aliasVmDiskPopup()); sizeEditor.setLabel(constants.sizeVmDiskPopup()); sizeExtendEditor.setLabel(constants.extendImageSizeBy()); descriptionEditor.setLabel(constants.descriptionVmDiskPopup()); datacenterEditor.setLabel(constants.dcVmDiskPopup()); storageDomainEditor.setLabel(constants.storageDomainVmDiskPopup()); hostListEditor.setLabel(constants.hostVmDiskPopup()); quotaEditor.setLabel(constants.quotaVmDiskPopup()); interfaceEditor.setLabel(constants.interfaceVmDiskPopup()); volumeTypeEditor.setLabel(constants.allocationDisk()); storageTypeEditor.setLabel(constants.storageTypeVmDiskPopup()); plugDiskToVmEditor.setLabel(constants.activateVmDiskPopup()); wipeAfterDeleteEditor.setLabel(constants.wipeAfterDeleteVmDiskPopup()); isBootableEditor.setLabel(constants.isBootableVmDiskPopup()); isShareableEditor.setLabel(constants.isShareableVmDiskPopup()); isReadOnlyEditor.setLabel(constants.isReadOnlyVmDiskPopup()); isSgIoUnfilteredEditor.setLabel(constants.isSgIoUnfilteredEditor()); attachEditor.setLabel(constants.attachDiskVmDiskPopup()); isPluggedEditor.setLabel(constants.activateVmDiskPopup()); }
Source:
<code>private void writeTimelineDocuments(Collection<Report> reports) { for (Report report : reports) { String configName = report.getConfiguration().name; TimelineDocument timelineDocument = new TimelineDocument(timelineConfig, targetDir, configName + "_" + report.getCluster().getClusterIndex(), configName + " on " + report.getCluster(), report.getTimelines(), report.getCluster()); freemarker.template.Configuration cfg = initConfig(); try { timelineDocument.createReportDirectory(); timelineDocument.generateTimelineCharts(); Template reportTemplate = cfg.getTemplate("timelineReport.ftl"); PrintWriter printWriter = new PrintWriter(targetDir + File.separator + timelineDocument.getFileName()); Map root = new HashMap(); root.put("timelineDocument", timelineDocument); reportTemplate.process(root, printWriter); <START> printWriter.close(); <END> } catch (Exception e) { log.error("Templating exception", e); } } }</code><technical_language>more</technical_language>

Target:
private void writeTimelineDocuments(Collection<Report> reports) { for (Report report : reports) { String configName = report.getConfiguration().name; TimelineDocument timelineDocument = new TimelineDocument(timelineConfig, targetDir, configName + "_" + report.getCluster().getClusterIndex(), configName + " on " + report.getCluster(), report.getTimelines(), report.getCluster()); timelineDocument.createReportDirectory(); timelineDocument.createTestCharts(); Map root = new HashMap(); root.put("timelineDocument", timelineDocument); exposeStaticMethods(root, "java.lang.String", "String"); processTemplate(root, targetDir, timelineDocument.getFileName(), "timelineReport.ftl"); } }
Source:
<code>public void newSequence() { <START> moveSequences.add(new ArrayList<Move>()); <END> }</code><technical_language>suggestion moveSequences.add(new ArrayList<>());</technical_language>

Target:
public void newSequence() { moveSequences.add(new ArrayList<>()); }
Source:
<code><START> public void setUp() throws Throwable { <END> String json = TestFileUtil.readRawFile("announce_2016_11_21.json"); AnnouncementList content = GsonUnmarshaller.unmarshal(AnnouncementList.class, json); announcementIOS = content.items().get(0); announcementAndroid = content.items().get(1); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.ROOT); dateBefore = format.parse("2016-08-01"); dateDuring = format.parse("2016-11-20"); dateAfter = format.parse("2017-01-05"); }</code><technical_language>This missing @Override call super. surprised this works it</technical_language>

Target:
public void setUp() throws Throwable { super.setUp(); String json = TestFileUtil.readRawFile("announce_2016_11_21.json"); announcementList = GsonUnmarshaller.unmarshal(AnnouncementList.class, json); }
Source:
<code>private static <V> void randomize(List<V> list) { <START> ThreadLocalRandom random = ThreadLocalRandom.current(); <END> switch (random.nextInt(3)) { case 0: Collections.shuffle(list, random); break; case 1: Collections.reverse(list); break; case 2: } }</code><technical_language>this test is flaky a hard time reproducing. If random, control seed in test? log seed a update while running tests</technical_language>

Target:
private static <V> void randomize(List<V> list) { long seed = ThreadLocalRandom.current().nextLong(); logger.info("Seed used for randomize: " + seed); Random random = new Random(seed); switch (random.nextInt(3)) { case 0: Collections.shuffle(list, random); break; case 1: Collections.reverse(list); break; case 2: } }
Source:
<code>public void onSave(final ICalloutRecord calloutRecord) { <START> I_AD_User user = calloutRecord.getModel(I_AD_User.class); <END> if (!isMarketingChannelsUseEnforced()) { return; } if (userDAO.isSystemUser(UserId.ofRepoId(user.getAD_User_ID()))) { return; } boolean canBeSaved = true; if (mktgChannelDao.retrieveMarketingChannelsCountForUser(UserId.ofRepoId(user.getAD_User_ID())) <= 0) { canBeSaved = false; } if (!canBeSaved) { throw new AdempiereException(MSG_CAN_NOT_REMOVE_CHANNEL).markAsUserValidationError(); } }</code><technical_language>suggestion final I_AD_User user = calloutRecord.getModel(I_AD_User.class);</technical_language>

Target:
public void onSave(final ICalloutRecord calloutRecord) { final I_AD_User user = calloutRecord.getModel(I_AD_User.class); if (!isMarketingChannelsUseEnforced(user.getAD_Client_ID(), user.getAD_Org_ID())) { return; } if (userDAO.isSystemUser(UserId.ofRepoId(user.getAD_User_ID()))) { return; } boolean canBeSaved = true; if (mktgChannelDao.retrieveMarketingChannelsCountForUser(UserId.ofRepoId(user.getAD_User_ID())) <= 0) { canBeSaved = false; } if (!canBeSaved) { throw new AdempiereException(MSG_CAN_NOT_REMOVE_CHANNEL).markAsUserValidationError(); } }
Source:
<code>protected boolean mergeImpl() throws IOException { if (implicitDirCache) { dircache = nonNullRepo().lockDirCache(); } if (!inCore) { checkoutMetadata = new HashMap<>(); } try { return mergeTrees(mergeBase(), sourceTrees[0], sourceTrees[1], false); } finally { if (implicitDirCache) { dircache.unlock(); } <START> checkoutMetadata = null; <END> } }</code><technical_language>sense move unlock call? unlock throw properly unset this</technical_language>

Target:
protected boolean mergeImpl() throws IOException { if (implicitDirCache) { dircache = nonNullRepo().lockDirCache(); } if (!inCore) { checkoutMetadata = new HashMap<>(); } try { return mergeTrees(mergeBase(), sourceTrees[0], sourceTrees[1], false); } finally { checkoutMetadata = null; if (implicitDirCache) { dircache.unlock(); } } }
Source:
<code>public <T> T invoke(Method method, Object instance, Object... args) { MethodHandle methodHandle = cache.get(method); <START> if (methodHandle == null) { <END> cache.put(method, methodHandleFactory.create(instance.getClass(), method)); } try { return (T) cache.get(method) .invokeExact(instance, args); } catch (Throwable e) { throw new MethodExecutorException(e); } }</code><technical_language>add element supplier "function" VRaptorCache. do think? like: java MethodHandle methodHandle = cache.getOrPut(method, new Supplier<>() { public MethodHandle get() { return methodHandleFactory.create(instance.getClass(), method); } });</technical_language>

Target:
public <T> T invoke(Method method, Object instance, Object... args) { MethodHandle methodHandle = cache.get(method); if (methodHandle == null) { methodHandle = methodHandleFactory.create(instance.getClass(), method); cache.put(method, methodHandle); } try { return (T) methodHandle.invokeExact(instance, args); } catch (Throwable e) { Throwables.propagateIfPossible(e); throw new MethodExecutorException(e); } }
Source:
<code>private static Stream<RelationalSymbolicValue> knownRelations(ProgramState programState) { return programState.getValuesWithConstraints(BooleanConstraint.TRUE) .stream() .filter(sv -> sv instanceof RelationalSymbolicValue) <START> .map(sv -> (RelationalSymbolicValue) sv); <END> }</code><technical_language>RelationalSymbolicValue.class::cast</technical_language>

Target:
private static Stream<RelationalSymbolicValue> knownRelations(ProgramState programState) { return programState.getValuesWithConstraints(BooleanConstraint.TRUE) .stream() .filter(RelationalSymbolicValue.class::isInstance) .map(RelationalSymbolicValue.class::cast); }
Source:
<code>protected CreateVDSCommandParameters buildCreateVmParameters() { CreateVDSCommandParameters parameters = new CreateVDSCommandParameters(getVdsId(), getVm()); <START> parameters.setPassthroughVnicToVfMap(initParametersForPassthroughVnics()); <END> parameters.setRunInUnknownStatus(getParameters().isRunInUnknownStatus()); parameters.setVmPayload(vmPayload); if (initializationType == InitializationType.Sysprep && osRepository.isWindows(getVm().getVmOsId()) && (getVm().getFloppyPath() == null || "".equals(getVm().getFloppyPath()))) { parameters.setInitializationType(InitializationType.Sysprep); } if (initializationType == InitializationType.CloudInit && !osRepository.isWindows(getVm().getVmOsId())) { parameters.setInitializationType(InitializationType.CloudInit); } return parameters; }</code><technical_language>pass parameters init method. In opinion is more readable</technical_language>

Target:
protected CreateVDSCommandParameters buildCreateVmParameters() { CreateVDSCommandParameters parameters = new CreateVDSCommandParameters(getVdsId(), getVm()); parameters.setRunInUnknownStatus(getParameters().isRunInUnknownStatus()); parameters.setVmPayload(vmPayload); parameters.setHibernationVolHandle(getMemoryFromActiveSnapshot()); parameters.setPassthroughVnicToVfMap(getPassthroughVnicToVfMap()); if (initializationType == InitializationType.Sysprep && osRepository.isWindows(getVm().getVmOsId()) && (getVm().getFloppyPath() == null || "".equals(getVm().getFloppyPath()))) { parameters.setInitializationType(InitializationType.Sysprep); } if (initializationType == InitializationType.CloudInit && !osRepository.isWindows(getVm().getVmOsId())) { parameters.setInitializationType(InitializationType.CloudInit); } return parameters; }
Source:
<code>private void assertAccountUpdateConsumers(Set<Account> expectedAccounts, int expectedNumberOfConsumers, List<Collection<Account>> accountsInConsumers) throws Exception { assertEquals("Wrong number of consumers", expectedNumberOfConsumers, accountsInConsumers.size()); for (Collection<Account> accounts : accountsInConsumers) { assertEquals("Wrong number of updated accounts received by consumers", expectedAccounts.size(), accounts.size()); for (Account account : accounts) { <START> assertTrue("Account should be received by the consumers but not.", <END> expectedAccounts.contains(adjustSnapshotVersion(account, -1))); } TestUtils.assertException(UnsupportedOperationException.class, () -> accounts.add(Account.UNKNOWN_ACCOUNT), null); } }</code><technical_language>change this message incomplete. read "Account update received consumers?"</technical_language>

Target:
private void assertAccountUpdateConsumers(Set<Account> expectedAccounts, int expectedNumberOfConsumers, List<Collection<Account>> accountsInConsumers) throws Exception { assertEquals("Wrong number of consumers", expectedNumberOfConsumers, accountsInConsumers.size()); for (Collection<Account> accounts : accountsInConsumers) { assertEquals("Wrong number of updated accounts received by consumers", expectedAccounts.size(), accounts.size()); for (Account account : accounts) { assertTrue("Account update not received by consumers", expectedAccounts.contains(account)); } TestUtils.assertException(UnsupportedOperationException.class, () -> accounts.add(Account.UNKNOWN_ACCOUNT), null); } }
Source:
<code>private boolean shouldRepartitionForIndexJoin(List<VariableReferenceExpression> joinColumns, PreferredProperties parentPreferredProperties, ActualProperties probeProperties) { if (!distributedIndexJoins) { return false; } if (probeProperties.isSingleNode()) { return false; } Optional<PartitioningProperties> parentPartitioningPreferences = parentPreferredProperties.getGlobalProperties() .flatMap(PreferredProperties.Global::getPartitioningProperties); boolean parentAlreadyPartitionedOnChild = parentPartitioningPreferences <START> .map(partitioning -> probeProperties.isStreamPartitionedOn(partitioning.getPartitioningColumns(), isExactPartitioningPreferred(session))) <END> .orElse(false); if (preferStreamingOperators && parentAlreadyPartitionedOnChild) { return false; } if (!probeProperties.isStreamPartitionedOn(joinColumns, isExactPartitioningPreferred(session))) { return true; } return probeProperties.isEffectivelySingleStream() && probeProperties.isStreamRepartitionEffective(joinColumns); }</code><technical_language>specifically avoid extra partitioning. IndexJoin extra memory, left is</technical_language>

Target:
private boolean shouldRepartitionForIndexJoin(List<VariableReferenceExpression> joinColumns, PreferredProperties parentPreferredProperties, ActualProperties probeProperties) { if (!distributedIndexJoins) { return false; } if (probeProperties.isSingleNode()) { return false; } Optional<PartitioningProperties> parentPartitioningPreferences = parentPreferredProperties.getGlobalProperties() .flatMap(PreferredProperties.Global::getPartitioningProperties); boolean parentAlreadyPartitionedOnChild = parentPartitioningPreferences .map(partitioning -> probeProperties.isStreamPartitionedOn(partitioning.getPartitioningColumns(), false)) .orElse(false); if (preferStreamingOperators && parentAlreadyPartitionedOnChild) { return false; } if (!probeProperties.isStreamPartitionedOn(joinColumns, false)) { return true; } return probeProperties.isEffectivelySingleStream() && probeProperties.isStreamRepartitionEffective(joinColumns); }
Source:
<code>public List<ListenableFuture<R>> applyBatch(List<T> arguments) { Preconditions.checkState(!closed, "Autobatcher is already shut down"); List<ListenableFuture<R>> results = new ArrayList<>(); buffer.publishEvents((EventTranslator<DefaultBatchElement<T, R>>[]) arguments.stream().map(argument -> { <START> SettableFuture<R> result = SettableFuture.create(); <END> EventTranslator<DefaultBatchElement<T, R>> translator = (refresh, sequence) -> { refresh.result = result; refresh.argument = argument; }; results.add(result); return translator; }).collect(Collectors.toList()).toArray()); return results; }</code><technical_language>DisruptorFuture, this code moved raised PR</technical_language>

Target:
public List<ListenableFuture<R>> applyBatch(List<T> arguments) { Preconditions.checkState(!closed, "Autobatcher is already shut down"); List<ListenableFuture<R>> results = new ArrayList<>(); buffer.publishEvents((EventTranslator<DefaultBatchElement<T, R>>[]) arguments.stream().map(argument -> { DisruptorFuture<R> result = new DisruptorFuture<>(safeLoggablePurpose); EventTranslator<DefaultBatchElement<T, R>> translator = (refresh, sequence) -> { refresh.result = result; refresh.argument = argument; }; results.add(result); return translator; }).toArray(EventTranslator[]::new)); return results; }
Source:
<code>public void testChildAccessors() { <START> WContainer container = new WContainer(); <END> Assert.assertEquals("Should have no child count", 0, container.getChildCount()); WComponent child = new DefaultWComponent(); container.add(child); Assert.assertEquals("Incorrect child count", 1, container.getChildCount()); Assert.assertEquals("Incorrect child index", 0, container.getIndexOfChild(child)); Assert.assertEquals("Incorrect child returned", child, container.getChildAt(0)); container.remove(child); Assert.assertEquals("Should have no child count after removing", 0, container.getChildCount()); container.add(child); Assert.assertEquals("Incorrect child count", 1, container.getChildren().size()); Assert.assertEquals("Incorrect child index", 0, container.getChildren().indexOf(child)); Assert.assertEquals("Incorrect child returned", child, container.getChildren().get(0)); try { container.getChildren().add(new DefaultWComponent()); Assert.fail("Expected getChildren() to return unmodifiable List."); } catch (UnsupportedOperationException e) { Assert.assertEquals("Incorrect child count", 1, container.getChildren().size()); } }</code><technical_language>This changed is testing WBeanContainer. Interestingly, is WContainer_Test. this change is playing in this area, worthwhile writing a WContainer_Test well</technical_language>

Target:
public void testChildAccessors() { WBeanContainer container = new WBeanContainer(); Assert.assertEquals("Should have no child count", 0, container.getChildCount()); WComponent child = new DefaultWComponent(); container.add(child); Assert.assertEquals("Incorrect child count", 1, container.getChildCount()); Assert.assertEquals("Incorrect child index", 0, container.getIndexOfChild(child)); Assert.assertEquals("Incorrect child returned", child, container.getChildAt(0)); container.remove(child); Assert.assertEquals("Should have no child count after removing", 0, container.getChildCount()); container.add(child); Assert.assertEquals("Incorrect child count", 1, container.getChildren().size()); Assert.assertEquals("Incorrect child index", 0, container.getChildren().indexOf(child)); Assert.assertEquals("Incorrect child returned", child, container.getChildren().get(0)); try { container.getChildren().add(new DefaultWComponent()); Assert.fail("Expected getChildren() to return unmodifiable List."); } catch (UnsupportedOperationException e) { Assert.assertEquals("Incorrect child count", 1, container.getChildren().size()); } }
Source:
<code>public void run() { depositStatus = getDepositStatus(); processDepositStructure(); try { listener.registerListener(this); <START> String groups = depositStatus.get(DepositField.permissionGroups.name()); <END> AccessGroupSet ags = new AccessGroupSet(); ags.addAccessGroups(groups.split(",")); GroupsThreadStore.storeGroups(ags); GroupsThreadStore.storeUsername(depositStatus.get(DepositField.depositorName.name())); String ingestPid = null; try { while ((ingestPid = ingestPids.poll()) != null) { addTopLevelToContainer(ingestPid); ingestsAwaitingConfirmation.add(ingestPid); ingestObject(ingestPid); } } catch (DepositException e) { failJob(e, Type.INGESTION, "Ingest of object {0} failed", ingestPid); return; } try { while (ingestsAwaitingConfirmation.size() > 0) { Thread.sleep(COMPLETE_CHECK_DELAY); } } catch (InterruptedException e) { log.info("Interrupted ingest of job {}", this.getJobUUID()); return; } updateDestinationEvents(); } finally { GroupsThreadStore.clearGroups(); GroupsThreadStore.clearUsername(); listener.unregisterListener(this); } }</code><technical_language>This good. I guess this is infamous wrong delimiter bug happened</technical_language>

Target:
public void run() { depositStatus = getDepositStatus(); processDepositStructure(); try { listener.registerListener(this); String groups = depositStatus.get(DepositField.permissionGroups.name()); AccessGroupSet ags = new AccessGroupSet(groups); GroupsThreadStore.storeGroups(ags); GroupsThreadStore.storeUsername(depositStatus.get(DepositField.depositorName.name())); String ingestPid = null; try { while ((ingestPid = ingestPids.poll()) != null) { addTopLevelToContainer(ingestPid); ingestsAwaitingConfirmation.add(ingestPid); ingestObject(ingestPid); } } catch (DepositException e) { failJob(e, Type.INGESTION, "Ingest of object {0} failed", ingestPid); return; } try { while (ingestsAwaitingConfirmation.size() > 0) { Thread.sleep(COMPLETE_CHECK_DELAY); } } catch (InterruptedException e) { log.info("Interrupted ingest of job {}", this.getJobUUID()); return; } updateDestinationEvents(); } finally { GroupsThreadStore.clearGroups(); GroupsThreadStore.clearUsername(); listener.unregisterListener(this); } }
Source:
<code>@JsonIgnore public ContractMetadata getContract(String contractName) { if (contractName == null && contracts.size() == 1) { return contracts.values().iterator().next(); } else if (contractName == null || contractName.isEmpty()) { throw new UnsupportedOperationException("Source contains more than 1 contact. Please specify the contract name. Available keys (" + getContractKeys() + ")."); } for (Map.Entry<String, ContractMetadata> entry : contracts.entrySet()) { String key = entry.getKey(); String name = key.substring(key.lastIndexOf(':') + 1); if (contractName.equals(name)) { return entry.getValue(); } } <START> throw new UnsupportedOperationException("Source contains more than 1 contact. Please specify a valid contract name. Available keys (" + getContractKeys() + ")."); <END> }</code><technical_language>"not found" Contract %s in compilation result this</technical_language>

Target:
@JsonIgnore public ContractMetadata getContract(String contractName) { if (contractName == null && contracts.size() == 1) { return contracts.values().iterator().next(); } else if (contractName == null || contractName.isEmpty()) { throw new UnsupportedOperationException("Source contains more than 1 contact. Please specify the contract name. Available keys (" + getContractKeys() + ")."); } for (Map.Entry<String, ContractMetadata> entry : contracts.entrySet()) { String key = entry.getKey(); String name = key.substring(key.lastIndexOf(':') + 1); if (contractName.equals(name)) { return entry.getValue(); } } throw new UnsupportedOperationException("No contract found with name '" + contractName + "'. Please specify a valid contract name. Available keys (" + getContractKeys() + ")."); }
Source:
<code>private ICPPClassType getFirstCandidateForNamingClass(IASTName name) throws DOMException { LookupData data = new LookupData(name); isUnqualifiedLookup= !data.qualified; ICPPScope scope = CPPSemantics.getLookupScope(name); while (scope != null && !(scope instanceof ICPPClassScope)) { if (scope instanceof ICPPInternalUnknownScope) { IType scopeType = ((ICPPInternalUnknownScope) scope).getScopeType(); if (scopeType instanceof ICPPDeferredClassInstance) { <START> scope = (ICPPScope) ((ICPPDeferredClassInstance) scopeType).getClassTemplate() <END> .getCompositeScope(); } } else { scope = CPPSemantics.getParentScope(scope, data.getTranslationUnit()); } } if (scope instanceof ICPPClassScope) { return ((ICPPClassScope) scope).getClassType(); } return null; }</code><technical_language>simpler return ((ICPPDeferredClassInstance) scopeType).getClassTemplate() here</technical_language>

Target:
private ICPPClassType getFirstCandidateForNamingClass(IASTName name) throws DOMException { LookupData data = new LookupData(name); isUnqualifiedLookup= !data.qualified; ICPPScope scope = CPPSemantics.getLookupScope(name); while (scope != null && !(scope instanceof ICPPClassScope)) { if (scope instanceof ICPPInternalUnknownScope) { IType scopeType = ((ICPPInternalUnknownScope) scope).getScopeType(); if (scopeType instanceof ICPPDeferredClassInstance) { return ((ICPPDeferredClassInstance) scopeType).getClassTemplate(); } } else { scope = CPPSemantics.getParentScope(scope, data.getTranslationUnit()); } } if (scope instanceof ICPPClassScope) { return ((ICPPClassScope) scope).getClassType(); } return null; }
Source:
<code>public String getActionClass( ) { return environmentVariables.get( actionClass ); <START> } <END></code><technical_language>a lot of work verify json is valid. is some 3rd party utility do for us? consider</technical_language>

Target:
public String getActionClass( ) { return actionClass; }
Source:
<code>public SameIntervalMergeTaskTest() { <START> EmittingLogger.registerEmitter(new NoopServiceEmitter()); <END> indexSpec = new IndexSpec(); TestUtils testUtils = new TestUtils(); jsonMapper = testUtils.getTestObjectMapper(); }</code><technical_language>Do need this</technical_language>

Target:
public SameIntervalMergeTaskTest() { indexSpec = new IndexSpec(); TestUtils testUtils = new TestUtils(); jsonMapper = testUtils.getTestObjectMapper(); indexIO = testUtils.getTestIndexIO(); }
Source:
<code><START> public void shouldSolveProblem20() { <END> assertThat(sumOfDigits100Factorial()).isEqualTo(648); }</code><technical_language>please test presented in example also: java assertThat(sumOfFactorialDigits(10)).isEqualTo(3 + 6 + 2 + 8 + 8 + 0 + 0);</technical_language>

Target:
public void shouldSolveProblem20() { assertThat(sumOfFactorialDigits(10)).isEqualTo(3 + 6 + 2 + 8 + 8 + 0 + 0); assertThat(sumOfFactorialDigits(100)).isEqualTo(9 + 3 + 3 + 2 + 6 + 2 + 1 + 5 + 4 + 4 + 3 + 9 + 4 + 4 + 1 + 5 + 2 + 6 + 8 + 1 + 6 + 9 + 9 + 2 + 3 + 8 + 8 + 5 + 6 + 2 + 6 + 6 + 7 + 0 + 0 + 4 + 9 + 0 + 7 + 1 + 5 + 9 + 6 + 8 + 2 + 6 + 4 + 3 + 8 + 1 + 6 + 2 + 1 + 4 + 6 + 8 + 5 + 9 + 2 + 9 + 6 + 3 + 8 + 9 + 5 + 2 + 1 + 7 + 5 + 9 + 9 + 9 + 9 + 3 + 2 + 2 + 9 + 9 + 1 + 5 + 6 + 0 + 8 + 9 + 4 + 1 + 4 + 6 + 3 + 9 + 7 + 6 + 1 + 5 + 6 + 5 + 1 + 8 + 2 + 8 + 6 + 2 + 5 + 3 + 6 + 9 + 7 + 9 + 2 + 0 + 8 + 2 + 7 + 2 + 2 + 3 + 7 + 5 + 8 + 2 + 5 + 1 + 1 + 8 + 5 + 2 + 1 + 0 + 9 + 1 + 6 + 8 + 6 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0); }
Source:
<code>public void onLocationRequestFailure(@NotNull CommCareLocationListener.Failure failure) { Context context = CommCareApplication.instance(); if (failure instanceof CommCareLocationListener.Failure.ApiException) { Exception exception = ((CommCareLocationListener.Failure.ApiException) failure).getException(); if (exception instanceof ResolvableApiException) { apiException = (ResolvableApiException) exception; sendBroadcast(context); } else { } } else { noProviders = true; <START> context.registerReceiver( <END> new ProvidersChangedHandler(), new IntentFilter(LocationManager.PROVIDERS_CHANGED_ACTION) ); sendBroadcast(context); } }</code><technical_language>this receiver get fired from, Location Manager</technical_language>

Target:
public void onLocationRequestFailure(@NotNull CommCareLocationListener.Failure failure) { Context context = CommCareApplication.instance(); if (failure instanceof CommCareLocationListener.Failure.ApiException) { Exception exception = ((CommCareLocationListener.Failure.ApiException) failure).getException(); if (exception instanceof ResolvableApiException) { apiException = (ResolvableApiException) exception; broadcastLocationError(context); } else { } } else { noProviders = true; broadcastLocationError(context); } }
Source:
<code>private void registerOpenWorkspaceVersion(MenuManager menu, final ISelectionProvider selectionProvider) { FileRevisionTypedElement leftRevision = getLeftRevision(); if (leftRevision != null) { IFileRevision fileRevision = leftRevision.getFileRevision(); <START> if (fileRevision instanceof CommitFileRevision) { <END> CommitFileRevision revision = (CommitFileRevision) fileRevision; final File workspaceFile = new File(revision.getRepository() .getWorkTree(), revision.getGitPath()); if (workspaceFile.exists()) menu.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager manager) { Action action = new OpenWorkspaceVersionAction( UIText.CommitFileDiffViewer_OpenWorkingTreeVersionInEditorMenuLabel, selectionProvider, workspaceFile); manager.insertAfter("save", new Separator()); manager.insertAfter("save", action); } }); } } }</code><technical_language>nice this for IndexFileRevision</technical_language>

Target:
private void registerOpenWorkspaceVersion(MenuManager menu, final ISelectionProvider selectionProvider) { FileRevisionTypedElement leftRevision = getLeftRevision(); if (leftRevision != null) { IFileRevision fileRevision = leftRevision.getFileRevision(); if (fileRevision instanceof OpenWorkspaceVersionEnabled) { OpenWorkspaceVersionEnabled workspaceVersion = (OpenWorkspaceVersionEnabled) fileRevision; final File workspaceFile = new File(workspaceVersion .getRepository().getWorkTree(), workspaceVersion.getGitPath()); if (workspaceFile.exists()) menu.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager manager) { Action action = new OpenWorkspaceVersionAction( UIText.CommitFileDiffViewer_OpenWorkingTreeVersionInEditorMenuLabel, selectionProvider, workspaceFile); manager.insertAfter("file", action); } }); } } }
Source:
<code>protected boolean clientNeedAuthentication(final HttpServletRequest request, final HttpServletResponse response) { val clientId = OAuth20Utils.getClientIdAndClientSecret(new JEEContext(request, response)).getLeft(); val registeredService = OAuth20Utils.getRegisteredOAuthServiceByClientId(servicesManager, clientId); if (clientId.isEmpty() || registeredService == null) { return true; } <START> return !StringUtils.isBlank(registeredService.getClientSecret()); <END> }</code><technical_language>StringUtils.isNotBlank()</technical_language>

Target:
protected boolean clientNeedAuthentication(final HttpServletRequest request, final HttpServletResponse response) { val clientId = OAuth20Utils.getClientIdAndClientSecret(new JEEContext(request, response, sessionStore)).getLeft(); if (clientId.isEmpty()) { return true; } val registeredService = OAuth20Utils.getRegisteredOAuthServiceByClientId(servicesManager, clientId); if (registeredService == null) { return true; } return OAuth20Utils.doesServiceNeedAuthentication(registeredService); }
Source:
<code>protected void logInCaseOfTemplateCopyFailure(Answer copyCommandAnswer, TemplateObjectTO sourceTemplate, DataStore destDataStore) { if (copyCommandAnswer != null && !copyCommandAnswer.getResult()) { String failureDetails = StringUtils.EMPTY; if (copyCommandAnswer.getDetails() != null) { failureDetails = "; details: " + copyCommandAnswer.getDetails(); } <START> LOGGER.debug(String.format("Failed to copy template [id=%s, name=%s] to the primary storage pool [id=%s]%s", sourceTemplate.getId(), sourceTemplate.getName(), <END> destDataStore.getId(), failureDetails)); } }</code><technical_language>'ERROR'</technical_language>

Target:
protected void logInCaseOfTemplateCopyFailure(Answer copyCommandAnswer, TemplateObjectTO sourceTemplate, DataStore destDataStore) { if (copyCommandAnswer != null && !copyCommandAnswer.getResult()) { String failureDetails = StringUtils.EMPTY; if (copyCommandAnswer.getDetails() != null) { failureDetails = " Details: " + copyCommandAnswer.getDetails(); } LOGGER.error(generateFailToCopyTemplateMessage(sourceTemplate, destDataStore) + failureDetails); } }
Source:
<code>void removeTemporaryWs() throws ServerException { <START> ; <END> for (WorkspaceImpl workspace : Pages.iterate( (maxItems, skipCount) -> workspaceDao.getWorkspaces(true, maxItems, skipCount))) { try { workspaceDao.remove(workspace.getId()); } catch (ServerException e) { LOG.error( "Unable to cleanup temporary workspace {}. Reason is {}", workspace.getId(), e.getLocalizedMessage()); } } }</code><technical_language>Please check if this semicolon is needed</technical_language>

Target:
void removeTemporaryWs() throws ServerException { for (WorkspaceImpl workspace : Pages.iterate( (maxItems, skipCount) -> workspaceDao.getWorkspaces(true, maxItems, skipCount))) { try { workspaceDao.remove(workspace.getId()); } catch (ServerException e) { LOG.error( "Unable to cleanup temporary workspace {}. Reason is {}", workspace.getId(), e.getLocalizedMessage()); } } }
Source:
<code>public ContentEquivalenceUpdateTask(ContentLister contentLister, ContentResolver contentResolver, ScheduleTaskProgressStore progressStore, EquivalenceUpdater<Content> updater, Set<String> ignored) { super(contentLister); this.progressStore = progressStore; this.updater = RootEquivalenceUpdater.create(contentResolver, updater); this.ignored = ignored; this.telescopeProxy = OwlTelescopeReporter.create( OwlTelescopeReporters.EQUIVALENCE, Event.Type.EQUIVALENCE ); <START> } <END></code><technical_language>zero knowledge of code, this object is reused? if is a scheduled task reset recreated, reset telescope client, need a new one</technical_language>

Target:
public ContentEquivalenceUpdateTask(ContentLister contentLister, ContentResolver contentResolver, ScheduleTaskProgressStore progressStore, EquivalenceUpdater<Content> updater, Set<String> ignored) { super(contentLister); this.progressStore = progressStore; this.updater = RootEquivalenceUpdater.create(contentResolver, updater); this.ignored = ignored; this.telescope = OwlTelescopeReporter.create( OwlTelescopeReporters.EQUIVALENCE, Event.Type.EQUIVALENCE ); }
Source:
<code>public int hashCode() { int hashCode = 31; if (key != null) { <START> hashCode += key.hashCode(); <END> } if (value != null) { hashCode += value.hashCode(); } return hashCode; }</code><technical_language>missing a multiplication reduce collisions: hashCode = 31 * hashCode + key.hashCode();</technical_language>

Target:
public int hashCode() { return (key == null ? 0 : key.hashCode()) ^ (value == null ? 0 : value.hashCode()); }
Source:
<code>public int getInt(int length, boolean signed) { <START> <END> if (length == 0) { return 0; } if (!canRead(length)) { throw new BufferOverflowException(); } if (length > BIT_INT) { throw new IllegalArgumentException("Maximum size of value is 32 requested size" + length); } if (length < 0) { throw new IllegalArgumentException("Cannot handle negative reads"); } int val = 0; if (!canRead(length)) { throw new BufferOverflowException(); } boolean gotIt = false; if (this.pos % BitBuffer.BIT_CHAR == 0) { switch (length) { case BitBuffer.BIT_CHAR: val = this.buf.get((int) (this.pos / 8)); if (!signed) { val = val & 0xff; } gotIt = true; break; case BitBuffer.BIT_SHORT: val = this.buf.getShort((int) (this.pos / 8)); if (!signed) { val = val & 0xffff; } gotIt = true; break; case BitBuffer.BIT_INT: val = this.buf.getInt((int) (this.pos / 8)); gotIt = true; break; default: break; } } if (!gotIt) { if (this.byteOrder == ByteOrder.LITTLE_ENDIAN) { val = getIntLE(this.pos, length, signed); } else { val = getIntBE(this.pos, length, signed); } } this.pos += length; return val; }</code><technical_language>remove useless blank line</technical_language>

Target:
public int getInt(int length, boolean signed) { if (length == 0) { return 0; } if (!canRead(length)) { throw new BufferOverflowException(); } if (!canRead(length)) { throw new BufferOverflowException(); } int val = 0; boolean gotIt = false; if (this.pos % BitBuffer.BIT_CHAR == 0) { switch (length) { case BitBuffer.BIT_CHAR: val = this.buf.get((int) (this.pos / 8)); if (!signed) { val = val & 0xff; } gotIt = true; break; case BitBuffer.BIT_SHORT: val = this.buf.getShort((int) (this.pos / 8)); if (!signed) { val = val & 0xffff; } gotIt = true; break; case BitBuffer.BIT_INT: val = this.buf.getInt((int) (this.pos / 8)); gotIt = true; break; default: break; } } if (!gotIt) { if (this.byteOrder == ByteOrder.LITTLE_ENDIAN) { val = getIntLE(this.pos, length, signed); } else { val = getIntBE(this.pos, length, signed); } } this.pos += length; return val; }
Source:
<code>public CacheConfigHolder cacheConfigMap() { CacheConfigHolder cm = new CacheConfigHolder(); cm.addDistCache(CACHE_SAMPLING, 15, 15 , DIST , 0 , 0); cm.addDistCache(CACHE_MONITORING, 15, 15, DIST , 0 , 0); cm.addDistCache(CACHE_USERS, 30, 100 , DIST_AND_LOCAL , 30 , 100); <START> cm.addDistCache(CACHE_USER_ENTITY, 30, 100 , DIST_AND_LOCAL , 30 , 100); <END> cm.addDistCache(CACHE_FILE_ENTRIES, 1 * HOUR + 40 * MIN, 100 , DIST_AND_LOCAL, 1 * HOUR + 40 * MIN, 100); cm.addLocalCache(CACHE_RIGHT_PANEL_ENTRIES, 1 * DAY, 2); cm.addLocalCache(CACHE_LEFT_PANEL_ENTRIES, 1 * DAY, 2); cm.addLocalCache(CACHE_CURRENT_PERFTEST_STATISTICS, 5, 1); cm.addLocalCache(CACHE_LOCAL_AGENTS, 1 * HOUR, 1); return cm; }</code><technical_language>Rename CACHE_USER_ENTITY CACHE_USER_ENTITIES consistent other cache name</technical_language>

Target:
public CacheConfigHolder cacheConfigMap() { CacheConfigHolder cm = new CacheConfigHolder(); cm.addDistMap(DIST_MAP_NAME_SAMPLING, 15, 20); cm.addDistMap(DIST_MAP_NAME_MONITORING, 15, 20); cm.addDistCache(CACHE_USERS, 30, 100, 30, 100); cm.addDistCache(CACHE_FILE_ENTRIES, 1 * HOUR + 40 * MIN, 100, 1 * HOUR + 40 * MIN, 100); cm.addLocalCache(CACHE_RIGHT_PANEL_ENTRIES, 1 * DAY, 2); cm.addLocalCache(CACHE_LEFT_PANEL_ENTRIES, 1 * DAY, 2); cm.addLocalCache(CACHE_CURRENT_PERFTEST_STATISTICS, 5, 1); cm.addLocalCache(CACHE_LOCAL_AGENTS, 1 * HOUR, 1); return cm; }