auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void handle(final HttpURLConnection connection) { Assert.requireNonNull(connection, "connection"); try { clientCookieHandler.updateCookiesFromResponse(connection); <START> } catch (URISyntaxException e) { <END> throw new DolphinRuntimeException("Can not readResponseContent cookies from response", e); } }</code><technical_language>Add final keyword</technical_language>

Target:
public void handle(final HttpURLConnection connection) { Assert.requireNonNull(connection, "connection"); try { clientCookieHandler.updateCookiesFromResponse(connection); } catch (final URISyntaxException e) { throw new DolphinRuntimeException("Can not read cookies from response", e); } }
Source:
<code>private long countMapWithAtleastOneIndex(Node node) { <START> return maps.stream().filter(distributedObject -> !(node.hazelcastInstance.getMap(distributedObject.getName()).isEmpty())).count(); <END> }</code><technical_language>This counts non-empty maps, maps indexes. Please refer reference manual indexing: <LINK_0></technical_language>

Target:
private long countMapWithAtleastOneIndex(Node node) { return maps.stream().filter(distributedObject -> { MapConfig config = node.getConfig().getMapConfig(distributedObject.getName()); if (config != null) { return !config.getIndexConfigs().isEmpty(); } return false; }).count(); }
Source:
<code>public void visitMethod(MethodTree tree) { super.visitMethod(tree); Stream<Type> types; if("<init>".equals(tree.symbol().name())) { types = tree.symbol().parameterTypes().stream(); } else { <START> types = Stream.concat(Stream.of(tree.symbol().returnType().type()), tree.symbol().parameterTypes().stream()); <END> } if (tree.block() != null && types.noneMatch(Type::isUnknown)) { CFG cfg = CFG.build(tree); serializeUCFG(tree, cfg); } }</code><technical_language>tree.symbol() reused 3 times, a variable</technical_language>

Target:
public void visitMethod(MethodTree tree) { super.visitMethod(tree); List<Type> types = new ArrayList<>(tree.symbol().parameterTypes()); if (!tree.is(CONSTRUCTOR)) { types.add(tree.symbol().returnType().type()); } if (tree.block() != null && types.stream().noneMatch(Type::isUnknown)) { CFG cfg = CFG.build(tree); serializeUCFG(tree, cfg); } }
Source:
<code>public void testFew() { <START> final UnweightedDoubleReservoirSample sample = <END> new UnweightedDoubleReservoirSample(200); sample.add(1.0); sample.add(2.0); sample.add(3.0); Set<Double> samples = new HashSet<>(); sample.stream().forEach(o -> samples.add(Double.valueOf(o))); assertEquals(samples.size(), 3); assertTrue(samples.contains(Double.valueOf(1))); assertTrue(samples.contains(Double.valueOf(2))); assertTrue(samples.contains(Double.valueOf(3))); }</code><technical_language>drop final; put entire statement a single line</technical_language>

Target:
public void testFew() { UnweightedDoubleReservoirSample reservoir = new UnweightedDoubleReservoirSample(200); reservoir.add(1.0); reservoir.add(2.0); reservoir.add(3.0); assertEquals(Arrays.stream(reservoir.getSamples()).sorted().toArray(), new double[] {1.0, 2.0, 3.0}); }
Source:
<code>public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, Set<String> uris, Class<T> type) { FailoverFeignTarget<T> target = new FailoverFeignTarget<>(uris, type, backoffStrategy); Client client = clientSupplier.apply(sslSocketFactory); client = target.wrapClient(client); return Feign.builder() .contract(contract) .encoder(encoder) .decoder(decoder) .errorDecoder(errorDecoder) .client(client) .retryer(target) .options(options) <START> .logger(new Slf4jLogger(FeignClientFactory.class)) <END> .logLevel(Level.BASIC) .target(target); }</code><technical_language>prefer a string FeignClientFactory, encode a constant</technical_language>

Target:
public <T> T createProxy(Optional<SSLSocketFactory> sslSocketFactory, Set<String> uris, Class<T> type) { FailoverFeignTarget<T> target = new FailoverFeignTarget<>(uris, type, backoffStrategy); Client client = clientSupplier.apply(sslSocketFactory); client = target.wrapClient(client); return Feign.builder() .contract(contract) .encoder(encoder) .decoder(decoder) .errorDecoder(errorDecoder) .client(client) .retryer(target) .options(options) .logger(new Slf4jLogger(FeignClients.class)) .logLevel(Level.BASIC) .target(target); }
Source:
<code>public static String mapAsStringWithEncodedValues(Map<String, String> p_map) { if (p_map != null && p_map.size() != 0) { return p_map.entrySet().stream().map(e -> { try { return e.getKey() + "=" + encode(e.getValue()); } catch (UnsupportedEncodingException e1) { throw new RuntimeException(e1); } }).collect(Collectors.joining("&")); } else { <START> return null; <END> } }</code><technical_language>lets return empty string "" avoid hypothetical NPE in future code</technical_language>

Target:
public static String mapAsStringWithEncodedValues(Map<String, String> p_map) { if (p_map != null && p_map.size() != 0) { return p_map.entrySet().stream().map(e -> { try { return e.getKey() + "=" + encode(e.getValue()); } catch (UnsupportedEncodingException e1) { throw new RuntimeException(e1); } }).collect(Collectors.joining("&")); } else { return ""; } }
Source:
<code>public String execute(String container, Blob blob) { String key = blob.getMetadata().getName(); Payload payload = blob.getPayload(); algorithm <START> .calculateChunkSize(checkNotNull( <END> payload.getContentMetadata().getContentLength(), "contentLength required on all uploads to amazon s3; please invoke payload.getContentMetadata().setContentLength(length) first")); int parts = algorithm.getParts(); long chunkSize = algorithm.getChunkSize(); if (parts > 0) { String uploadId = client.initiateMultipartUpload(container, ObjectMetadataBuilder.create().key(key).build()); try { SortedMap<Integer, String> etags = Maps.newTreeMap(); int part; while ((part = algorithm.getNextPart()) <= parts) { prepareUploadPart(container, key, uploadId, part, payload, algorithm.getNextChunkOffset(), chunkSize, etags); } long remaining = algorithm.getRemaining(); if (remaining > 0) { prepareUploadPart(container, key, uploadId, part, payload, algorithm.getNextChunkOffset(), remaining, etags); } return client.completeMultipartUpload(container, key, uploadId, etags); } catch (RuntimeException ex) { client.abortMultipartUpload(container, key, uploadId); throw ex; } } else { return client.putObject(container, blobToObject.apply(blob)); } }</code><technical_language>Formatting again</technical_language>

Target:
public String execute(String container, Blob blob) { String key = blob.getMetadata().getName(); Payload payload = blob.getPayload(); Long length = payload.getContentMetadata().getContentLength(); checkNotNull(length, "please invoke payload.getContentMetadata().setContentLength(length) prior to multipart upload"); long chunkSize = algorithm.calculateChunkSize(length); int partCount = algorithm.getParts(); if (partCount > 0) { String uploadId = client.initiateMultipartUpload(container, ObjectMetadataBuilder.create().key(key).build()); try { SortedMap<Integer, String> etags = Maps.newTreeMap(); int part; while ((part = algorithm.getNextPart()) <= partCount) { prepareUploadPart(container, key, uploadId, part, payload, algorithm.getNextChunkOffset(), chunkSize, etags); } long remaining = algorithm.getRemaining(); if (remaining > 0) { prepareUploadPart(container, key, uploadId, part, payload, algorithm.getNextChunkOffset(), remaining, etags); } return client.completeMultipartUpload(container, key, uploadId, etags); } catch (RuntimeException ex) { client.abortMultipartUpload(container, key, uploadId); throw ex; } } else { return client.putObject(container, blobToObject.apply(blob)); } }
Source:
<code>protected void updateKernelCmdlineCheckboxesChangeability() { final CpuVendor cpuVendor = getCurrentCpuVendor(); if (cpuVendor == null) { return; } switch (cpuVendor) { case INTEL: case AMD: case IBMS390: setKernelCmdlineCheckboxesChangeability( isKernelCmdlineParsable(), constants.kernelCmdlineCheckboxesAndDirectCustomizationNotAllowed()); break; case IBM: <START> setKernelCmdlineCheckboxesChangeability( <END> false, constants.kernelCmdlineNotAvailableInClusterWithIbmCpu()); getKernelCmdlineFips().setIsChangeable(true); getKernelCmdlineSmtDisabled().setIsChangeable(true); break; default: throw new RuntimeException("Unknown CpuVendor type: " + cpuVendor); } }</code><technical_language>this show a wrong message</technical_language>

Target:
protected void updateKernelCmdlineCheckboxesChangeability() { final CpuVendor cpuVendor = getCurrentCpuVendor(); if (cpuVendor == null) { return; } switch (cpuVendor) { case INTEL: case AMD: case IBMS390: setKernelCmdlineCheckboxesChangeability( isKernelCmdlineParsable(), constants.kernelCmdlineCheckboxesAndDirectCustomizationNotAllowed()); break; case IBM: setKernelCmdlineCheckboxesChangeability( false, constants.kernelCmdlineNotAvailableInClusterWithIbmCpu()); getKernelCmdlineFips().setIsChangeable(isKernelCmdlineParsable()); getKernelCmdlineSmtDisabled().setIsChangeable(isKernelCmdlineParsable()); break; default: throw new RuntimeException("Unknown CpuVendor type: " + cpuVendor); } }
Source:
<code><START> public List<Pair<Task, ListenableFuture<TaskStatus>>> restore() <END> { final File restoreFile = getRestoreFile(); final TaskRestoreInfo taskRestoreInfo; if (restoreFile.exists()) { try { taskRestoreInfo = jsonMapper.readValue(restoreFile, TaskRestoreInfo.class); } catch (Exception e) { log.warn(e, "Failed to restore tasks from file[%s]. Skipping restore.", restoreFile); return ImmutableList.of(); } } else { return ImmutableList.of(); } final List<Pair<Task, ListenableFuture<TaskStatus>>> retVal = Lists.newArrayList(); for (final String taskId : taskRestoreInfo.getRunningTasks()) { try { final File taskFile = new File(taskConfig.getTaskDir(taskId), "task.json"); final Task task = jsonMapper.readValue(taskFile, Task.class); if (task.canRestore()) { log.info("Restoring task[%s].", task.getId()); retVal.add(Pair.of(task, run(task))); } } catch (Exception e) { log.warn(e, "Failed to restore task[%s]. Trying to restore other tasks.", taskId); } } log.info("Restored %,d tasks.", retVal.size()); return retVal; }</code><technical_language>this restore a clean shutdown, right</technical_language>

Target:
public List<Pair<Task, ListenableFuture<TaskStatus>>> restore() { final File restoreFile = getRestoreFile(); final TaskRestoreInfo taskRestoreInfo; if (restoreFile.exists()) { try { taskRestoreInfo = jsonMapper.readValue(restoreFile, TaskRestoreInfo.class); } catch (Exception e) { log.error(e, "Failed to read restorable tasks from file[%s]. Skipping restore.", restoreFile); return ImmutableList.of(); } } else { return ImmutableList.of(); } final List<Pair<Task, ListenableFuture<TaskStatus>>> retVal = Lists.newArrayList(); for (final String taskId : taskRestoreInfo.getRunningTasks()) { try { final File taskFile = new File(taskConfig.getTaskDir(taskId), "task.json"); final Task task = jsonMapper.readValue(taskFile, Task.class); if (!task.getId().equals(taskId)) { throw new ISE("WTF?! Task[%s] restore file had wrong id[%s].", taskId, task.getId()); } if (task.canRestore()) { log.info("Restoring task[%s].", task.getId()); retVal.add(Pair.of(task, run(task))); } } catch (Exception e) { log.warn(e, "Failed to restore task[%s]. Trying to restore other tasks.", taskId); } } log.info("Restored %,d tasks.", retVal.size()); return retVal; }
Source:
<code>public int compareTo(Object o) { if(Objects.equals(key, ((CacheKey<?>)o).key)) { return 0; } else { if (key instanceof String) { return ((String) key).compareTo((String) ((CacheKey<?>)o).key); } else { <START> return key.toString().compareTo((((CacheKey<?>) o).key).toString()); <END> } } }</code><technical_language>this happen</technical_language>

Target:
public int compareTo(Object o) { if(Objects.equals(key, ((CacheKey<?>)o).key)) { return 0; } else { return key.toString().compareTo((((CacheKey<?>) o).key).toString()); } }
Source:
<code>private MethodInvocationGateway doCreateMethodInvocationGateway(Method method, @Nullable Expression payloadExpression, Map<String, Expression> headerExpressions, @Nullable String requestChannelName, @Nullable String replyChannelName, @Nullable Expression requestTimeout, @Nullable Expression replyTimeout) { GatewayMethodInboundMessageMapper messageMapper = createGatewayMessageMapper(method, headerExpressions); MethodInvocationGateway gateway = new MethodInvocationGateway(messageMapper); gateway.setupReturnType(this.serviceInterface, method); if (method.getParameterTypes().length == 0 && !findPayloadExpression(method)) { gateway.setPollable(); } JavaUtils.INSTANCE .acceptIfNotNull(payloadExpression, messageMapper::setPayloadExpression) .acceptIfNotNull(getTaskScheduler(), gateway::setTaskScheduler); channels(requestChannelName, replyChannelName, gateway); timeouts(requestTimeout, replyTimeout, messageMapper, gateway); String gatewayMethodBeanName = getComponentName() + '#' + method.getName() + '(' + Arrays.stream(method.getParameterTypes()) <START> .map(Class::getName) <END> .collect(Collectors.joining(", ")) + ')'; gateway.setBeanName(gatewayMethodBeanName); gateway.setBeanFactory(getBeanFactory()); gateway.setShouldTrack(this.shouldTrack); gateway.registerMetricsCaptor(this.metricsCaptor); gateway.afterPropertiesSet(); return gateway; }</code><technical_language>Class::getSimpleName ?</technical_language>

Target:
private MethodInvocationGateway doCreateMethodInvocationGateway(Method method, @Nullable Expression payloadExpression, Map<String, Expression> headerExpressions, @Nullable String requestChannelName, @Nullable String replyChannelName, @Nullable Expression requestTimeout, @Nullable Expression replyTimeout) { GatewayMethodInboundMessageMapper messageMapper = createGatewayMessageMapper(method, headerExpressions); MethodInvocationGateway gateway = new MethodInvocationGateway(messageMapper); gateway.setupReturnType(this.serviceInterface, method); if (method.getParameterTypes().length == 0 && !findPayloadExpression(method)) { gateway.setPollable(); } JavaUtils.INSTANCE .acceptIfNotNull(payloadExpression, messageMapper::setPayloadExpression) .acceptIfNotNull(getTaskScheduler(), gateway::setTaskScheduler); channels(requestChannelName, replyChannelName, gateway); timeouts(requestTimeout, replyTimeout, messageMapper, gateway); String gatewayMethodBeanName = getComponentName() + '#' + method.getName() + '(' + Arrays.stream(method.getParameterTypes()) .map(Class::getSimpleName) .collect(Collectors.joining(", ")) + ')'; gateway.setBeanName(gatewayMethodBeanName); gateway.setBeanFactory(getBeanFactory()); gateway.setShouldTrack(this.shouldTrack); gateway.registerMetricsCaptor(this.metricsCaptor); gateway.afterPropertiesSet(); return gateway; }
Source:
<code>public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException { CallContext ctx = CallContext.current(); long vmId = cmd.getId(); boolean expunge = cmd.getExpunge(); UserVmVO vm = _vmDao.findById(vmId); List<VolumeVO> listVolumes = _volsDao.findRootVolumeByInstance(vmId); for (VolumeVO volume : listVolumes) { List<SnapshotVO> activeSnapshots = _snapshotDao.listByStatus(volume.getInstanceId(), Snapshot.State.Creating, Snapshot.State.CreatedOnPrimary, Snapshot.State.BackingUp); if (activeSnapshots.size() > 0) { <START> throw new CloudRuntimeException("There is active snapshot on ROOT volume, vm destroy is not permitted, please try again later."); <END> } if (vm.getHypervisorType() == HypervisorType.KVM && volume.getFormat() != ImageFormat.QCOW2) { throw new CloudRuntimeException("We only support create vm snapshots from vm with QCOW2 image"); } } if (expunge && !_accountMgr.isAdmin(ctx.getCallingAccount().getId()) && !AllowUserExpungeRecoverVm.valueIn(cmd.getEntityOwnerId())) { throw new PermissionDeniedException("Parameter " + ApiConstants.EXPUNGE + " can be passed by Admin only. Or when the allow.user.expunge.recover.vm key is set."); } UserVm destroyedVm = destroyVm(vmId, expunge); if (expunge) { if (!expunge(vm, ctx.getCallingUserId(), ctx.getCallingAccount())) { throw new CloudRuntimeException("Failed to expunge vm " + destroyedVm); } } return destroyedVm; }</code><technical_language>is meaning of 'active snapshot'? Try a phrase</technical_language>

Target:
public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException { CallContext ctx = CallContext.current(); long vmId = cmd.getId(); boolean expunge = cmd.getExpunge(); if (expunge && !_accountMgr.isAdmin(ctx.getCallingAccount().getId()) && !AllowUserExpungeRecoverVm.valueIn(cmd.getEntityOwnerId())) { throw new PermissionDeniedException("Parameter " + ApiConstants.EXPUNGE + " can be passed by Admin only. Or when the allow.user.expunge.recover.vm key is set."); } UserVmVO vm = _vmDao.findById(vmId); if (vm == null) { throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); } s_logger.debug("Checking if there are any ongoing snapshots on the ROOT volumes associated with VM with ID " + vmId); if (checkStatusOfVolumeSnapshots(vmId, Volume.Type.ROOT)) { throw new CloudRuntimeException("There is/are unbacked up snapshot(s) on ROOT volume, vm destroy is not permitted, please try again later."); } s_logger.debug("Found no ongoing snapshots on volume of type ROOT, for the vm with id " + vmId); UserVm destroyedVm = destroyVm(vmId, expunge); if (expunge) { if (!expunge(vm, ctx.getCallingUserId(), ctx.getCallingAccount())) { throw new CloudRuntimeException("Failed to expunge vm " + destroyedVm); } } return destroyedVm; }
Source:
<code>private DataGenerator<String> getNettyTextDataGenerator(final Map<CharSequence, Object> sourceConf) throws IllegalArgumentException { final Map<String, Object> sourceConfString = new HashMap<>(); for (final Map.Entry<CharSequence, Object> entry : sourceConf.entrySet()) { sourceConfString.put(entry.getKey().toString(), entry.getValue()); } final String socketHostAddress = sourceConfString.get(TextSocketSourceParameters.SOCKET_HOST_ADDRESS).toString(); final String socketHostPort = sourceConfString.get(TextSocketSourceParameters.SOCKET_HOST_PORT).toString(); try { <START> return sourceFactory.newDataGenerator(socketHostAddress, Integer.valueOf(socketHostPort)); <END> } catch (final Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }</code><technical_language>sourceFactory -> dataGeneratorFactory</technical_language>

Target:
private DataGenerator<String> getNettyTextDataGenerator(final Map<CharSequence, Object> sourceConf) throws IllegalArgumentException { final Map<String, Object> sourceConfString = new HashMap<>(); for (final Map.Entry<CharSequence, Object> entry : sourceConf.entrySet()) { sourceConfString.put(entry.getKey().toString(), entry.getValue()); } final String socketHostAddress = sourceConfString.get(TextSocketSourceParameters.SOCKET_HOST_ADDRESS).toString(); final String socketHostPort = sourceConfString.get(TextSocketSourceParameters.SOCKET_HOST_PORT).toString(); try { return dataGeneratorFactory.newDataGenerator(socketHostAddress, Integer.valueOf(socketHostPort)); } catch (final Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
Source:
<code>public CleanCommand clean_() { return new CleanCommand() { <START> private List<String> excludePatterns = Collections.emptyList(); <END> private Integer timeout = TIMEOUT; public CleanCommand excludePatterns(List<String> excludePatterns) { this.excludePatterns = excludePatterns; return this; } public CleanCommand timeout(Integer timeout) { this.timeout = timeout; return this; } public void execute() throws GitException, InterruptedException { reset(true); ArgumentListBuilder args = new ArgumentListBuilder(); args.add("clean"); args.add("-fdx"); if (excludePatterns != null) { for (String pattern : excludePatterns) { if ( !Strings.isNullOrEmpty(pattern) ) { args.add("-e"); args.add(pattern); } } } String result = launchCommandIn(args, workspace, environment, timeout); listener.getLogger().println(result); } }; }</code><technical_language>indent this line line consistent rest of method? formatting in git-client-plugin git-plugin is a mess, add more inconsistency</technical_language>

Target:
public CleanCommand clean_() { return new CleanCommand() { private List<String> excludePatterns = Collections.emptyList(); private boolean removeSubmodules = false; private Integer timeout = TIMEOUT; public CleanCommand excludePatterns(List<String> excludePatterns) { this.excludePatterns = excludePatterns; return this; } @Override public CleanCommand submodules(boolean removeSubmodules) { this.removeSubmodules = false; return this; } public CleanCommand timeout(Integer timeout) { this.timeout = timeout; return this; } public void execute() throws GitException, InterruptedException { reset(true); ArgumentListBuilder args = new ArgumentListBuilder(); args.add("clean"); if (removeSubmodules) { args.add("-ffdx"); } else { args.add("-fdx"); } if (excludePatterns != null) { for (String pattern : excludePatterns) { if ( !Strings.isNullOrEmpty(pattern) ) { args.add("-e"); args.add(pattern); } } } String result = launchCommandIn(args, workspace, environment, timeout); listener.getLogger().println(result); } }; }
Source:
<code>public final String getDefaultMetaVariable() { <START> return "PATCH-SET-ID"; <END> }</code><technical_language>this is args4j, I want "CHANGE,PATCHSET" is format expect in</technical_language>

Target:
public final String getDefaultMetaVariable() { return "CHANGE,PATCHSET"; }
Source:
<code>public BlockAndTypeBuilder(List<PinotColumnHandle> columnHandles, GeneratedPql brokerPql, List<PinotColumnHandle> expectedColumnHandles) { List<Type> expectedTypes = columnHandles.stream() .map(PinotColumnHandle::getDataType) .collect(Collectors.toList()); pageBuilder = new PageBuilder(expectedTypes); Preconditions.checkState(brokerPql.getExpectedColumnIndices().size() == expectedColumnHandles.size()); Preconditions.checkState(expectedColumnHandles.size() >= columnHandles.size()); int[] expectedToActual = new int[expectedColumnHandles.size()]; for (int i = 0; i < expectedToActual.length; ++i) { expectedToActual[i] = columnHandles.indexOf(expectedColumnHandles.get(i)); } columnBlockBuilders = new ArrayList<>(); columnTypes = new ArrayList<>(); <START> for (int expectedColIdx : brokerPql.getExpectedColumnIndices()) { <END> int actualColIdx = -1; if (expectedColIdx >= 0) { actualColIdx = expectedToActual[expectedColIdx]; } columnBlockBuilders.add(actualColIdx >= 0 ? pageBuilder.getBlockBuilder(actualColIdx) : null); columnTypes.add(actualColIdx >= 0 ? expectedTypes.get(actualColIdx) : null); } }</code><technical_language>expectedColumnIndex</technical_language>

Target:
public BlockAndTypeBuilder(List<PinotColumnHandle> columnHandles, GeneratedPql brokerPql, List<PinotColumnHandle> expectedColumnHandles) { List<Type> expectedTypes = columnHandles.stream() .map(PinotColumnHandle::getDataType) .collect(Collectors.toList()); this.pageBuilder = new PageBuilder(expectedTypes); checkState(brokerPql.getExpectedColumnIndices().size() == expectedColumnHandles.size()); checkState(expectedColumnHandles.size() >= columnHandles.size()); int[] handleMapping = new int[expectedColumnHandles.size()]; for (int i = 0; i < handleMapping.length; ++i) { handleMapping[i] = columnHandles.indexOf(expectedColumnHandles.get(i)); } this.columnBlockBuilders = new ArrayList<>(); this.columnTypes = new ArrayList<>(); for (int expectedColumnIndex : brokerPql.getExpectedColumnIndices()) { int columnIndex = -1; if (expectedColumnIndex >= 0) { columnIndex = handleMapping[expectedColumnIndex]; } this.columnBlockBuilders.add(columnIndex >= 0 ? pageBuilder.getBlockBuilder(columnIndex) : null); this.columnTypes.add(columnIndex >= 0 ? expectedTypes.get(columnIndex) : null); } }
Source:
<code>public Builder(String rootServerURL) { <START> pushConfiguration = new PushConfiguration(); <END> if (isEmpty(rootServerURL)) { throw new IllegalStateException("server can not be null"); } pushConfiguration.setServerUrl(!rootServerURL.endsWith("/") ? rootServerURL + '/' : rootServerURL); }</code><technical_language>is this usage for ctor? if so, wanna public</technical_language>

Target:
private Builder(String rootServerURL) { pushConfiguration = new PushConfiguration(); if (isEmpty(rootServerURL)) { throw new IllegalStateException("server can not be null"); } pushConfiguration.setServerUrl(!rootServerURL.endsWith("/") ? rootServerURL + '/' : rootServerURL); }
Source:
<code>public void testForNodeIds() { <START> UUID node0Id = nodeId(0); <END> UUID node1Id = nodeId(1); assertNodes(client.cluster().forNodeId(node0Id, node1Id), 0, 1); assertNodes(client.cluster().forNodeId(node0Id), 0); assertNodes(client.cluster().forNodeId(node1Id), 1); assertNodes(client.cluster().forNodeIds(F.asList(node0Id, node1Id)), 0, 1); assertNodes(client.cluster().forNodeIds(F.asList(node0Id)), 0); assertNodes(client.cluster().forNodeIds(F.asList(node0Id, node1Id)).forNodeId(node0Id), 0); assertNodes(client.cluster().forNodeId(node0Id, node1Id).forNodeIds(F.asList(node0Id, node1Id)), 0, 1); assertNodes(client.cluster().forNodeId(node0Id).forNodeIds(F.asList(node0Id, node1Id)), 0); assertNodes(client.cluster().forNodeId(node0Id).forNodeIds(F.asList(node1Id))); assertNodes(client.cluster().forNodeId(UUID.randomUUID())); assertNodes(client.cluster().forNodeIds(F.asList(UUID.randomUUID()))); }</code><technical_language>id0 id1</technical_language>

Target:
public void testForNodeIds() { UUID id0 = nodeId(0); UUID id1 = nodeId(1); assertNodes(client.cluster().forNodeId(id0, id1), 0, 1); assertNodes(client.cluster().forNodeId(id0), 0); assertNodes(client.cluster().forNodeId(id1), 1); assertNodes(client.cluster().forNodeIds(F.asList(id0, id1)), 0, 1); assertNodes(client.cluster().forNodeIds(F.asList(id0)), 0); assertNodes(client.cluster().forNodeIds(F.asList(id0, id1)).forNodeId(id0), 0); assertNodes(client.cluster().forNodeId(id0, id1).forNodeIds(F.asList(id0, id1)), 0, 1); assertNodes(client.cluster().forNodeId(id0).forNodeIds(F.asList(id0, id1)), 0); assertNodes(client.cluster().forNodeId(id0).forNodeIds(F.asList(id1))); assertNodes(client.cluster().forNodeId(UUID.randomUUID())); assertNodes(client.cluster().forNodeIds(F.asList(UUID.randomUUID()))); }
Source:
<code>public void createForwardingRule(String forwardingRuleName, String targetPoolName, String protocol, String portRange) { log.info("Creating a forwarding rule: " + forwardingRuleName); TargetPool targetPool = getTargetPool(targetPoolName); String targetPoolURL = targetPool.getSelfLink(); ForwardingRule forwardingRule = new ForwardingRule(); forwardingRule.setName(forwardingRuleName); forwardingRule.setTarget(targetPoolURL); forwardingRule.setIPProtocol(protocol); forwardingRule.setPortRange(portRange); try { Operation operation = compute.forwardingRules().insert(PROJECT_ID, REGION_NAME, forwardingRule).execute(); waitForRegionOperationCompletion(operation.getName()); } catch (Exception e) { log.warn("Could not create a forwarding rule " + forwardingRuleName + " " + e); } <START> log.info("Forwarding rule: " + forwardingRuleName + " was created"); <END> }</code><technical_language>This log.info message is relevant.IMO need try block</technical_language>

Target:
public void createForwardingRule(String forwardingRuleName, String targetPoolName, String protocol, String portRange) { log.info("Creating a forwarding rule: " + forwardingRuleName); TargetPool targetPool = getTargetPool(targetPoolName); String targetPoolURL = targetPool.getSelfLink(); ForwardingRule forwardingRule = new ForwardingRule(); forwardingRule.setName(forwardingRuleName); forwardingRule.setTarget(targetPoolURL); forwardingRule.setIPProtocol(protocol); forwardingRule.setPortRange(portRange); try { Operation operation = compute.forwardingRules().insert(PROJECT_ID, REGION_NAME, forwardingRule).execute(); waitForRegionOperationCompletion(operation.getName()); log.info("Forwarding rule: " + forwardingRuleName + " was created"); } catch (Exception e) { log.error("Could not create a forwarding rule " + forwardingRuleName, e); } }
Source:
<code>public Date getNextRunTime(LastExecution lastExecution, Date date) { Date <START> nextExecutionDate = <END> generator.next(new Date()); return nextExecutionDate; }</code><technical_language>if returned next date like: return generator.next(new Date());</technical_language>

Target:
public Date getNextRunTime(LastExecution lastExecution, Date date) { return timer.getNextTimeout(); }
Source:
<code><START> public EnumerableRepeatUnionRule() { <END> super( LogicalRepeatUnion.class, Convention.NONE, EnumerableConvention.INSTANCE, "EnumerableRepeatUnionRule"); }</code><technical_language>need public</technical_language>

Target:
EnumerableRepeatUnionRule() { super( LogicalRepeatUnion.class, Convention.NONE, EnumerableConvention.INSTANCE, "EnumerableRepeatUnionRule"); }
Source:
<code>public void testGetParent() throws Exception { final String xpath = " final List<Item> nodes = getXpathItems(xpath, rootNode); assertEquals("Invalid number of nodes", 1, nodes.size()); final AbstractNode parent = (AbstractNode) ((NodeInfo) nodes.get(0)).getParent(); <START> assertEquals("Invalid number of nodes", TokenTypes.CLASS_DEF, parent.getTokenType()); <END> }</code><technical_language>invalid token type</technical_language>

Target:
public void testGetParent() throws Exception { final String xpath = " final List<Item> nodes = getXpathItems(xpath, rootNode); assertEquals("Invalid number of nodes", 1, nodes.size()); final AbstractNode parent = (AbstractNode) ((NodeInfo) nodes.get(0)).getParent(); assertEquals("Invalid token type", TokenTypes.CLASS_DEF, parent.getTokenType()); }
Source:
<code>public void testShowStatsWithHavingFails() <START> { <END> assertQueryFails("SHOW STATS FOR (SELECT categoryid FROM orders GROUP BY categoryid HAVING categoryid < 5)", ".*HAVING is not supported in SHOW STATS SELECT clause"); }</code><technical_language>this change</technical_language>

Target:
public void testShowStatsWithHavingFails() { assertQueryFails("SHOW STATS FOR (SELECT count(nationkey) FROM nation_partitioned GROUP BY regionkey HAVING regionkey > 0)", ".*HAVING is not supported in SHOW STATS SELECT clause"); }
Source:
<code>public static String getAutoGenDDLFromJar(InMemoryJarfile jarfile) throws IOException { byte[] ddlBytes = jarfile.get(VoltCompiler.AUTOGEN_DDL_FILE_NAME); if (ddlBytes == null) { throw new IOException("Auto generated schema DDL not found - please make sure the database is initialized with valid schema."); } <START> String ddl = new String(ddlBytes, Constants.UTF8ENCODING); <END> return ddl.trim(); }</code><technical_language>StandardCharsets</technical_language>

Target:
public static String getAutoGenDDLFromJar(InMemoryJarfile jarfile) throws IOException { byte[] ddlBytes = jarfile.get(VoltCompiler.AUTOGEN_DDL_FILE_NAME); if (ddlBytes == null) { throw new IOException("Auto generated schema DDL not found - please make sure the database is initialized with valid schema."); } String ddl = new String(ddlBytes, StandardCharsets.UTF_8); return ddl.trim(); }
Source:
<code>private void createIec61850Device(final Map<String, String> settings) { final Iec61850Device iec61850Device = new Iec61850Device( getString(settings, PlatformMicrogridsKeys.KEY_DEVICE_IDENTIFICATION, PlatformMicrogridsDefaults.DEFAULT_DEVICE_IDENTIFICATION)); iec61850Device.setIcdFilename(getString(settings, PlatformMicrogridsKeys.KEY_IEC61850_ICD_FILENAME)); iec61850Device.setPort(getInteger(settings, PlatformMicrogridsKeys.KEY_IEC61850_PORT)); iec61850Device.setServerName(getString(settings, PlatformMicrogridsKeys.KEY_IEC61850_SERVERNAME)); iec61850Device.setEnableAllReportsOnConnect(Helpers.getBoolean(settings, PlatformMicrogridsKeys.ENABLE_ALL_REPORTS, PlatformMicrogridsDefaults.ENABLE_ALL_REPORTS)); <START> <END> this.iec61850DeviceRespository.save(iec61850Device); }</code><technical_language>import static Helpers.getBoolean (like getString)</technical_language>

Target:
private void createIec61850Device(final Map<String, String> settings) { final Iec61850Device iec61850Device = new Iec61850Device( getString(settings, PlatformMicrogridsKeys.KEY_DEVICE_IDENTIFICATION, PlatformMicrogridsDefaults.DEFAULT_DEVICE_IDENTIFICATION)); iec61850Device.setIcdFilename(getString(settings, PlatformMicrogridsKeys.KEY_IEC61850_ICD_FILENAME)); iec61850Device.setPort(getInteger(settings, PlatformMicrogridsKeys.KEY_IEC61850_PORT)); iec61850Device.setServerName(getString(settings, PlatformMicrogridsKeys.KEY_IEC61850_SERVERNAME)); iec61850Device.setEnableAllReportsOnConnect(getBoolean(settings, PlatformMicrogridsKeys.ENABLE_ALL_REPORTS, PlatformMicrogridsDefaults.ENABLE_ALL_REPORTS)); this.iec61850DeviceRespository.save(iec61850Device); }
Source:
<code>public LeashData copy() { <START> checkState(getValue() != null); <END> return new SpongeLeashData(getValue()); }</code><technical_language>This a null value. I need work out LeashData is work</technical_language>

Target:
public LeashData copy() { return new SpongeLeashData(getValue()); }
Source:
<code>public void fromXML( String XML, SchemaMeta localSchemaMeta ) throws PentahoMetadataException { if ( XML == null ) { throw new PentahoMetadataException( Messages.getErrorString( "MQLQuery.ERROR_0017_XML_NULL" ) ); } Document doc; try { <START> DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); <END> DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.parse( new InputSource( new java.io.StringReader( XML ) ) ); } catch ( ParserConfigurationException pcx ) { throw new PentahoMetadataException( pcx ); } catch ( SAXException sex ) { throw new PentahoMetadataException( sex ); } catch ( IOException iex ) { throw new PentahoMetadataException( iex ); } fromXML( doc, localSchemaMeta ); }</code><technical_language>XmiParser.createSecureDocBuilderFactory() well</technical_language>

Target:
public void fromXML( String XML, SchemaMeta localSchemaMeta ) throws PentahoMetadataException { if ( XML == null ) { throw new PentahoMetadataException( Messages.getErrorString( "MQLQuery.ERROR_0017_XML_NULL" ) ); } Document doc; try { DocumentBuilderFactory dbf = XmiParser.createSecureDocBuilderFactory(); DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.parse( new InputSource( new java.io.StringReader( XML ) ) ); } catch ( ParserConfigurationException pcx ) { throw new PentahoMetadataException( pcx ); } catch ( SAXException sex ) { throw new PentahoMetadataException( sex ); } catch ( IOException iex ) { throw new PentahoMetadataException( iex ); } fromXML( doc, localSchemaMeta ); }
Source:
<code>public File getContextDir() { return contextDir != null ? new File(contextDir) : (getDockerFile().getParentFile() != null ? getDockerFile().getParentFile() <START> : new File(Paths.get("").toAbsolutePath().toString())); <END> }</code><technical_language>I mean, sufficient return ".". converted absolute path later</technical_language>

Target:
public File getContextDir() { if (!isDockerFileMode()) { return null; } if (contextDir != null) { return new File(contextDir); } if (getDockerFile().getParentFile() == null) { return new File(""); } return getDockerFile().getParentFile(); }
Source:
<code>public boolean handleRedirect(int statusCode, HttpHeaders responseHeaders) { String redirectLocation = responseHeaders.getLocation(); if (getFollowRedirects() && HttpStatusCodes.isRedirect(statusCode) && redirectLocation != null) { <START> setUrl(new GenericUrl(url.toURL(redirectLocation), true)); <END> if (statusCode == HttpStatusCodes.STATUS_CODE_SEE_OTHER) { setRequestMethod(HttpMethods.GET); setContent(null); } headers.setAuthorization((String) null); headers.setIfMatch((String) null); headers.setIfNoneMatch((String) null); headers.setIfModifiedSince((String) null); headers.setIfUnmodifiedSince((String) null); headers.setIfRange((String) null); return true; } return false; }</code><technical_language>I feel preserve current behavior, verbatim behavior turned manually some option</technical_language>

Target:
public boolean handleRedirect(int statusCode, HttpHeaders responseHeaders) { String redirectLocation = responseHeaders.getLocation(); if (getFollowRedirects() && HttpStatusCodes.isRedirect(statusCode) && redirectLocation != null) { setUrl(new GenericUrl(url.toURL(redirectLocation), useRawRedirectUrls)); if (statusCode == HttpStatusCodes.STATUS_CODE_SEE_OTHER) { setRequestMethod(HttpMethods.GET); setContent(null); } headers.setAuthorization((String) null); headers.setIfMatch((String) null); headers.setIfNoneMatch((String) null); headers.setIfModifiedSince((String) null); headers.setIfUnmodifiedSince((String) null); headers.setIfRange((String) null); return true; } return false; }
Source:
<code>public String configureExternalAlert() { generateApiToken(); String httpString = "window.open('" + toolHandler.getToolUrlWithQueryParams()+ "','_blank'" +")"; <START> RequestContext.getCurrentInstance().execute(httpString); <END> JH.addMessage(FacesMessage.SEVERITY_WARN, tool.getDisplayName(), BundleUtil.getStringFromBundle("file.configure.launchMessage.details") + " " + tool.getDisplayName() + "."); return ""; }</code><technical_language>I this is deprecated. PrimeFaces.current().executeScript(httpString); do thing..</technical_language>

Target:
public String configureExternalAlert() { generateApiToken(); PrimeFaces.current().executeScript("location.reload(true)"); String httpString = "window.open('" + toolHandler.getToolUrlWithQueryParams()+ "','_blank'" +")"; PrimeFaces.current().executeScript(httpString); return ""; }
Source:
<code>public int hashCode() { int result = bitmapSerdeFactory != null ? bitmapSerdeFactory.hashCode() : 0; result = 31 * result + (dimensionCompression != null ? dimensionCompression.hashCode() : 0); result = 31 * result + (metricCompression != null ? metricCompression.hashCode() : 0); <START> result = 31 * result + (spatialDimensionDelimiter != null ? spatialDimensionDelimiter.hashCode() : 0); <END> return result; }</code><technical_language>spatialDimensionDelimiter is non-null, this line simplified</technical_language>

Target:
public int hashCode() { int result = bitmapSerdeFactory.hashCode(); result = 31 * result + dimensionCompression.hashCode(); result = 31 * result + metricCompression.hashCode(); result = 31 * result + longEncoding.hashCode(); result = 31 * result + spatialDimensionDelimiter.hashCode(); return result; }
Source:
<code>public void run(@Nonnull JSession session) throws JackUserException, LibraryIOException { OutputJackLibrary outputJackLibrary = Jack.getSession().getJackOutputLibrary(); boolean generatingLibrary = !ThreadConfig.getConfig().get(Options.GENERATE_DEX_FILE).booleanValue(); List<JDefinedClassOrInterface> types = new ArrayList<JDefinedClassOrInterface>(); for(JType type : session.getTypesToEmit()) { <START> if(type instanceof JDefinedClassOrInterface) { JDefinedClassOrInterface node = (JDefinedClassOrInterface) type; if(node.getLocation() instanceof TypeInInputLibraryLocation) { TypeInInputLibraryLocation location = (TypeInInputLibraryLocation) node.getLocation(); if(generatingLibrary || location.getInputLibraryLocation().equals(outputJackLibrary.getLocation())) { types.add(node); } } else if(node.getLocation() instanceof FileLocation) { types.add(node); } } <END> } try { OutputVFile vFile = outputJackLibrary.createFile(FileType.IDX, new VPath("index", '/')); OutputStream out = new BufferedOutputStream(vFile.openWrite()); JayceInternalWriter writer = JayceWriterFactory.get(outputJackLibrary, out); try { for(JDefinedClassOrInterface node : types) { writer.writeType(node); } } finally { out.close(); } } catch (IOException e) { throw new LibraryIOException(outputJackLibrary.getLocation(), e); } }</code><technical_language>is abnormal. Jack some hacks in this area. So, I able if is related a jack hack, a CL problem. Please, explain do here</technical_language>

Target:
public void run(@Nonnull JSession session) throws JackUserException { OutputJackLibrary outputJackLibrary = Jack.getSession().getJackOutputLibrary(); boolean generatingLibrary = !ThreadConfig.getConfig().get(Options.GENERATE_DEX_FILE).booleanValue(); List<JDefinedClassOrInterface> types = new ArrayList<JDefinedClassOrInterface>(); for (JType type : session.getTypesToEmit()) { if (type instanceof JDefinedClassOrInterface) { JDefinedClassOrInterface node = (JDefinedClassOrInterface) type; if (generatingLibrary) { types.add(node); } else { if (node.getLocation() instanceof TypeInInputLibraryLocation) { TypeInInputLibraryLocation location = (TypeInInputLibraryLocation) node.getLocation(); if (location.getInputLibraryLocation().equals(outputJackLibrary.getLocation())) { types.add(node); } } else if (node.getLocation() instanceof FileLocation) { types.add(node); } } } } OutputVFile vFile; try { vFile = outputJackLibrary.createFile(FileType.IDX, new VPath("index", '/')); OutputStream out = new BufferedOutputStream(vFile.getOutputStream()); JayceInternalWriter writer = JayceWriterFactory.get(outputJackLibrary, out); try { for (JDefinedClassOrInterface node : types) { writer.writeJNodeTypeInfo(node); } } finally { out.close(); } } catch (CannotCreateFileException e) { Jack.getSession().getReporter().report(Severity.NON_FATAL, new IndexWritingException(e)); } catch (WrongPermissionException e) { Jack.getSession().getReporter().report(Severity.NON_FATAL, new IndexWritingException(e)); } catch (IOException e) { Jack.getSession().getReporter().report(Severity.NON_FATAL, new IndexWritingException(e)); } }
Source:
<code>public final void fetchContentsAndUpdateMap(final List<String> fileNames) { String esFileQueryJson = jsonUtils.getJsonForFileContent(fileNames); String esFileResultJson; esFileResultJson = getESResultJson(esFileQueryJson, windowObjects.getEsURL() + SOURCEFILE_SEARCH); JsonObject jsonElements = getJsonElements(esFileResultJson); <START> assert jsonElements != null; <END> JsonArray hitsArray = getJsonHitsArray(jsonElements); for (JsonElement hits : hitsArray) { JsonObject hitObject = hits.getAsJsonObject(); JsonObject sourceObject = hitObject.getAsJsonObject(SOURCE); String fileContent = sourceObject.getAsJsonPrimitive(FILE_CONTENT). getAsString().replaceAll("\r", ""); String fileName = sourceObject.getAsJsonPrimitive(FILE_NAME).getAsString(); windowObjects.getFileNameContentsMap().put(fileName, fileContent); } }</code><technical_language>Please Preconditions.check\* google guava</technical_language>

Target:
public final void fetchContentsAndUpdateMap(final List<String> fileNames) { String esFileQueryJson = jsonUtils.getJsonForFileContent(fileNames); String esFileResultJson; esFileResultJson = getESResultJson(esFileQueryJson, windowObjects.getEsURL() + SOURCEFILE_SEARCH); JsonObject jsonElements = getJsonElements(esFileResultJson); if (jsonElements != null) { JsonArray hitsArray = getJsonHitsArray(jsonElements); for (JsonElement hits : hitsArray) { JsonObject hitObject = hits.getAsJsonObject(); JsonObject sourceObject = hitObject.getAsJsonObject(SOURCE); String fileContent = sourceObject.getAsJsonPrimitive(FILE_CONTENT). getAsString().replaceAll("\r", ""); String fileName = sourceObject.getAsJsonPrimitive(FILE_NAME).getAsString(); windowObjects.getFileNameContentsMap().put(fileName, fileContent); } } }
Source:
<code>K addSideCondition(K requires) { <START> return requires; <END> }</code><technical_language>this is worse. generating sort predicates all</technical_language>

Target:
K addSideCondition(K requires) { if (skipSortPredicates) return requires; else { Optional<KApply> sideCondition = casts.stream().map(k -> { return new TransformKORE() { @Override public K apply(KVariable k) { if (varToTypedVar.containsKey(k)) { return varToTypedVar.get(k); } return k; } }.apply(k); }).map(k -> KApply(KLabel("is" + getSortNameOfCast((KApply) k)), transform(k))).reduce(BooleanUtils::and); if (!sideCondition.isPresent()) { return requires; } else if (requires.equals(BooleanUtils.TRUE) && sideCondition.isPresent()) { return sideCondition.get(); } else { return BooleanUtils.and(sideCondition.get(), requires); } } }
Source:
<code>public List<Data> queryDbaseIndex(Filter filter, int maxFeatures) throws IOException { if (filter!=null && !Filter.INCLUDE.equals(filter) && !Filter.EXCLUDE.equals(filter)) { DbaseFileIndex dbaseIndex = null; <START> if (!(filter instanceof BinarySpatialOperator)) { <END> URL url = new URL(shpFiles.get(DBF)); for (DbaseFileIndexFactory factory : FACTORY_CACHE) { if ((dbaseIndex = factory.getIndexManager(url, store.getCharset(), store.getTimeZone()))!=null) { break; } } } ExpressionFilterVisitor filterVisitor = createExpressionFilterVisitor(filter); List<Integer> recnoList = null; try { if (dbaseIndex != null) { Map<String,Node> indexNodeMap = dbaseIndex.getIndexNodeMap(); if (!supportsFilter(filter, indexNodeMap)) return null; filterVisitor.setIndexNodeMap(indexNodeMap); } if (filterVisitor.fullySupports(filter)) { recnoList = DbaseFileIndex.queryDbaseIndex(filter, filterVisitor, maxFeatures); } } finally { if (dbaseIndex != null) { dbaseIndex.close(); } } return convertRecordNumbersToDataObjects(recnoList, true); } return null; }</code><technical_language>filter complex, a anded/ored mix of spatial attribute filters, check if filter is supported right here, property names, a filter capability object/visitor decide if combination is worth testing. (e.g., "bbox propertyIsEquals" is supported, "bbox intersects propertyIsEquals" too, I guess "bbox propertyIsEquals" not)</technical_language>

Target:
protected List<Data> queryDbaseIndex(Filter filter, int maxFeatures) throws IOException { if (filter!=null && !Filter.INCLUDE.equals(filter) && !Filter.EXCLUDE.equals(filter)) { DbaseFileIndex dbaseIndex = null; if (!(filter instanceof BinarySpatialOperator)) { URL url = new URL(shpFiles.get(DBF)); for (DbaseFileIndexFactory factory : getDbaseFileIndexFactories()) { if ((dbaseIndex = factory.getIndexManager(url, store.getCharset(), store.getTimeZone()))!=null) { break; } } } if (dbaseIndex == null) { return null; } ExpressionFilterVisitor filterVisitor = createExpressionFilterVisitor(filter); List<Integer> recnoList = null; try { Map<String,Node> indexNodeMap = dbaseIndex.getIndexNodeMap(); if (!supportsFilter(filter, indexNodeMap)) return null; filterVisitor.setIndexNodeMap(indexNodeMap); if (filterVisitor.fullySupports(filter)) { recnoList = DbaseFileIndex.queryDbaseIndex(filter, filterVisitor, maxFeatures); } } finally { dbaseIndex.close(); } return convertRecordNumbersToDataObjects(recnoList, true); } return null; }
Source:
<code>public CachingClusteredClient( QueryToolChestWarehouse warehouse, TimelineServerView serverView, Cache cache, @Smile ObjectMapper objectMapper, @BackgroundCaching ExecutorService backgroundExecutorService, CacheConfig cacheConfig ) { this.warehouse = warehouse; this.serverView = serverView; this.cache = cache; this.objectMapper = objectMapper; this.cacheConfig = cacheConfig; this.backgroundExecutorService = MoreExecutors.listeningDecorator(backgroundExecutorService); if (cacheConfig.isQueryCacheable(Query.GROUP_BY)) { <START> log.warn("Caching for groupBys is enabled, but they won't be cached if they are executed with the strategy v2!"); <END> } serverView.registerSegmentCallback( Execs.singleThreaded("CCClient-ServerView-CB-%d"), new ServerView.BaseSegmentCallback() { @Override public ServerView.CallbackAction segmentRemoved(DruidServerMetadata server, DataSegment segment) { CachingClusteredClient.this.cache.close(segment.getIdentifier()); return ServerView.CallbackAction.CONTINUE; } } ); }</code><technical_language>clarify cached druid brokers advise enable caching data nodes for V2 strategy helpful</technical_language>

Target:
public CachingClusteredClient( QueryToolChestWarehouse warehouse, TimelineServerView serverView, Cache cache, @Smile ObjectMapper objectMapper, @BackgroundCaching ExecutorService backgroundExecutorService, CacheConfig cacheConfig ) { this.warehouse = warehouse; this.serverView = serverView; this.cache = cache; this.objectMapper = objectMapper; this.cacheConfig = cacheConfig; this.backgroundExecutorService = MoreExecutors.listeningDecorator(backgroundExecutorService); if (cacheConfig.isQueryCacheable(Query.GROUP_BY)) { log.warn( "Even though groupBy caching is enabled, v2 groupBys will not be cached. " + "Consider disabling cache on your broker and enabling it on your data nodes to enable v2 groupBy caching." ); } serverView.registerSegmentCallback( Execs.singleThreaded("CCClient-ServerView-CB-%d"), new ServerView.BaseSegmentCallback() { @Override public ServerView.CallbackAction segmentRemoved(DruidServerMetadata server, DataSegment segment) { CachingClusteredClient.this.cache.close(segment.getIdentifier()); return ServerView.CallbackAction.CONTINUE; } } ); }