auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private <R> R execute(OpenStackRequest<R> request) { try { return request.execute(); } catch (OpenStackResponseException e) { <START> log.error("{} (OpenStack response error code: {})", e.getMessage(), e.getStatus()); <END> throw new EngineException(EngineError.PROVIDER_FAILURE, e); } catch (RuntimeException e) { log.error("{}: {}", e.getMessage(), e.getCause() == null ? null : e.getCause().getMessage()); throw new EngineException(EngineError.PROVIDER_FAILURE, ExceptionUtils.getRootCause(e), true); } }</code><technical_language>This line is obsolete</technical_language>

Target:
private <R> R execute(OpenStackRequest<R> request) { try { return request.execute(); } catch (OpenStackResponseException e) { log.error("{} (OpenStack response error code: {})", e.getMessage(), e.getStatus()); throw new EngineException(EngineError.PROVIDER_FAILURE, ExceptionUtils.getRootCause(e), true); } catch (RuntimeException e) { log.error("{}: {}", e.getMessage(), e.getCause() == null ? null : e.getCause().getMessage()); throw new EngineException(EngineError.PROVIDER_FAILURE, ExceptionUtils.getRootCause(e), true); } }
Source:
<code>private void fireDamageEventDamage(final ArmorStandEntity self, final DamageSource source, final float amount) { try (final CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { <START> DamageEventHandler.generateCauseFor(source, frame); <END> final DamageEntityEvent event = SpongeEventFactory.createDamageEntityEvent(frame.getCurrentCause(), new ArrayList<>(), (Entity) this, amount); if (!SpongeImpl.postEvent(event)) { this.shadow$func_213817_e(source, (float) event.getFinalDamage()); } } }</code><technical_language>Multiline this annotation, long now</technical_language>

Target:
private void impl$fireDamageEventDamage(final ArmorStandEntity self, final DamageSource source, final float amount) { try (final CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { DamageEventHandler.generateCauseFor(source, frame); final DamageEntityEvent event = SpongeEventFactory.createDamageEntityEvent(frame.getCurrentCause(), new ArrayList<>(), (Entity) this, amount); if (!SpongeImpl.postEvent(event)) { this.shadow$func_213817_e(source, (float) event.getFinalDamage()); } } }
Source:
<code>public static final String formatFileSize(long size, final String[] unitStrings) { final double log1024 = Math.log10(1024); if (size <= 0) { return "0"; } int digitGroups = (int) (Math.log10(size) / log1024); return String.format(unitStrings[digitGroups], <START> new DecimalFormat("#,##0.#").format(size / Math.pow(1024, digitGroups))); <END> }</code><technical_language>so, this suggested change? NumberFormat f = NumberFormat.getInstance(); if (f instanceof DecimalFormat) { ((DecimalFormat) f).applyPattern("#,##0.#"); } return String.format(unitStrings[digitGroups], f.format(size / Math.pow(1024, digitGroups)));</technical_language>

Target:
public static final String formatFileSize(long size, final String[] unitStrings) { final double log1024 = Math.log10(1024); if (size <= 0) { return "0"; } int digitGroups = (int) (Math.log10(size) / log1024); NumberFormat f = NumberFormat.getInstance(); if (f instanceof DecimalFormat) { ((DecimalFormat) f).applyPattern("#,##0.#"); } return String.format(unitStrings[digitGroups], f.format(size / Math.pow(1024, digitGroups))); }
Source:
<code>public void logoutWhenInvokedThenWritesResponseHeaders() { ServerHttpHeadersWriter headersWriter = Mockito.mock(ServerHttpHeadersWriter.class); HeaderWriterServerLogoutHandler handler = new HeaderWriterServerLogoutHandler(headersWriter); ServerWebExchange serverWebExchange = Mockito.mock(ServerWebExchange.class); WebFilterExchange filterExchange = Mockito.mock(WebFilterExchange.class); <START> Mockito.when(filterExchange.getExchange()).thenReturn(serverWebExchange); <END> Authentication authentication = Mockito.mock(Authentication.class); handler.logout(filterExchange, authentication); Mockito.verify(headersWriter).writeHttpHeaders(serverWebExchange); }</code><technical_language>favor static imports Mockito AssertJ, reduces amount needs read in test</technical_language>

Target:
public void logoutWhenInvokedThenWritesResponseHeaders() { ServerHttpHeadersWriter headersWriter = mock(ServerHttpHeadersWriter.class); HeaderWriterServerLogoutHandler handler = new HeaderWriterServerLogoutHandler(headersWriter); ServerWebExchange serverWebExchange = mock(ServerWebExchange.class); WebFilterExchange filterExchange = mock(WebFilterExchange.class); when(filterExchange.getExchange()).thenReturn(serverWebExchange); Authentication authentication = mock(Authentication.class); handler.logout(filterExchange, authentication); verify(headersWriter).writeHttpHeaders(serverWebExchange); }
Source:
<code>private static String extractSingleCharFromText(@NotNull GoStringLiteral element) { <START> return format("'%c'", element.getText().charAt(1)); <END> }</code><technical_language>ElementManipulators#getValueTextRange</technical_language>

Target:
private static String extractSingleCharFromText(@NotNull GoStringLiteral element) { return format("'%s'", getValueTextRange(element).substring(element.getText())); }
Source:
<code>public String status(TestExecutionResult result) { switch (result.getStatus()) { case SUCCESSFUL: return successful(); case ABORTED: return aborted(); case FAILED: return failed(); } <START> return result.getStatus().name(); <END> }</code><technical_language>I this change. a switch statement for enum cover enum constants is error in book. Consequently, code remain unchanged</technical_language>

Target:
public final String status(TestExecutionResult result) { switch (result.getStatus()) { case SUCCESSFUL: return successful(); case ABORTED: return aborted(); case FAILED: return failed(); } return result.getStatus().name(); }
Source:
<code>public static void main(final String args[]) throws IOException, SignatureException { try (final Ds3Client client = Ds3ClientBuilder.create("ds3Endpoint:8080", new Credentials("accessKey", "secretKey")).withHttps(false).build()) { final GetServiceResponse response = client.getService(new GetServiceRequest()); for (final Ds3Bucket bucket : response.getListAllMyBucketsResult().getBuckets()) { System.out.println(bucket.getName()); } } catch (final UnknownHostException e) { System.out.println("Invalid Endpoint Server Name or IP Address"); } catch (final FailedRequestException e) { if (e.getStatusCode() == 403) { System.out.println("Invalid Access ID or Secret Key"); } else { System.out.println("BlackPearl return an unexpected status code we did not expect"); } <START> } <END> }</code><technical_language>good show IOException handling end demonstrate difference FailedRequestException IOExcepton. explicitly required</technical_language>

Target:
public static void main(final String args[]) throws IOException, SignatureException { try (final Ds3Client client = Ds3ClientBuilder.create("ds3Endpoint:8080", new Credentials("accessKey", "secretKey")).withHttps(false).build()) { final GetServiceResponse response = client.getService(new GetServiceRequest()); for (final Ds3Bucket bucket : response.getListAllMyBucketsResult().getBuckets()) { System.out.println(bucket.getName()); } } catch (final UnknownHostException e) { System.out.println("Invalid Endpoint Server Name or IP Address"); } catch (final FailedRequestException e) { if (e.getStatusCode() == 403) { System.out.println("Invalid Access ID or Secret Key"); } else { System.out.println("BlackPearl return an unexpected status code we did not expect"); } } catch (final IOException e) { System.out.println("Encountered a networking error"); } }
Source:
<code>@Test public void testPlusOperator() { String sql = "select SAL + 10 FROM SALES.EMP"; RelRoot relRoot = tester.convertSqlToRel(sql); RelJsonWriter jsonWriter = new RelJsonWriter(); relRoot.rel.explain(jsonWriter); String relJson = jsonWriter.asString(); <START> System.out.println(relJson); <END> final RelOptSchema[] schemas = {null}; relRoot.rel.accept(new RelShuttleImpl() { @Override public RelNode visit(TableScan scan) { schemas[0] = scan.getTable().getRelOptSchema(); return super.visit(scan); } }); String s = Frameworks.withPlanner((cluster, relOptSchema, rootSchema) -> { final RelJsonReader reader = new RelJsonReader( cluster, schemas[0], rootSchema); RelNode node; try { node = reader.read(relJson); } catch (IOException e) { throw TestUtil.rethrow(e); } return RelOptUtil.dumpPlan("", node, SqlExplainFormat.TEXT, SqlExplainLevel.EXPPLAN_ATTRIBUTES); }); assertThat(s, isLinux("LogicalProject(EXPR$0=[+($5, 10)])\n" + " LogicalTableScan(table=[[CATALOG, SALES, EMP]])\n")); }</code><technical_language>This print statement removed</technical_language>

Target:
@Test public void testPlusOperator() { final FrameworkConfig config = RelBuilderTest.config().build(); final RelBuilder builder = RelBuilder.create(config); final RelNode rel = builder .scan("EMP") .project( builder.call(SqlStdOperatorTable.PLUS, builder.field("SAL"), builder.literal(10))) .build(); RelJsonWriter jsonWriter = new RelJsonWriter(); rel.explain(jsonWriter); String relJson = jsonWriter.asString(); String s = Frameworks.withPlanner((cluster, relOptSchema, rootSchema) -> { final RelJsonReader reader = new RelJsonReader( cluster, getSchema(rel), rootSchema); RelNode node; try { node = reader.read(relJson); } catch (IOException e) { throw TestUtil.rethrow(e); } return RelOptUtil.dumpPlan("", node, SqlExplainFormat.TEXT, SqlExplainLevel.EXPPLAN_ATTRIBUTES); }); final String expected = "" + "LogicalProject($f0=[+($5, 10)])\n" + " LogicalTableScan(table=[[scott, EMP]])\n"; assertThat(s, isLinux(expected)); }
Source:
<code>public <T, E extends Exception> T runTaskWithRetry(TransactionTask<T, E> task) throws E { int failureCount = 0; UUID runId = UUID.randomUUID(); while (true) { checkOpen(); try { T result = runTaskThrowOnConflict(task); if (failureCount > 0) { log.info("[{}] Successfully completed transaction after retries.", SafeArg.of("runId", runId), SafeArg.of("failureCount", failureCount)); } return result; } catch (TransactionFailedException e) { if (!e.canTransactionBeRetried()) { log.warn("[{}] Non-retriable exception while processing transaction.", SafeArg.of("runId", runId), SafeArg.of("failureCount", failureCount)); throw e; } failureCount++; if (shouldStopRetrying(failureCount)) { log.warn("[{}] Failing after tries.", SafeArg.of("runId", runId), SafeArg.of("failureCount", failureCount), e); throw Throwables.rewrap(String.format("Failing after %d tries.", failureCount), e); } log.info("[{}] Retrying transaction after failure(s).", SafeArg.of("runId", runId), SafeArg.of("failureCount", failureCount), e); } catch (NotInitializedException e) { log.warn("Asynchronous initialization of resources is not complete. Retrying in 10 seconds.", e); Uninterruptibles.sleepUninterruptibly(AsyncInitializer.sleepInterval, TimeUnit.SECONDS); } catch (RuntimeException e) { <START> log.warn("[{}] RuntimeException while processing transaction. {}", SafeArg.of("runId", runId), e); <END> throw e; } sleepForBackoff(failureCount); } }</code><technical_language>This a bug - need (exceptions treated differently SLF4J - 3 lines above)</technical_language>

Target:
public <T, E extends Exception> T runTaskWithRetry(TransactionTask<T, E> task) throws E { int failureCount = 0; UUID runId = UUID.randomUUID(); while (true) { checkOpen(); try { T result = runTaskThrowOnConflict(task); if (failureCount > 0) { log.info("[{}] Successfully completed transaction after retries.", SafeArg.of("runId", runId), SafeArg.of("failureCount", failureCount)); } return result; } catch (TransactionFailedException e) { if (!e.canTransactionBeRetried()) { log.warn("[{}] Non-retriable exception while processing transaction.", SafeArg.of("runId", runId), SafeArg.of("failureCount", failureCount)); throw e; } failureCount++; if (shouldStopRetrying(failureCount)) { log.warn("[{}] Failing after tries.", SafeArg.of("runId", runId), SafeArg.of("failureCount", failureCount), e); throw Throwables.rewrap(String.format("Failing after %d tries.", failureCount), e); } log.info("[{}] Retrying transaction after failure(s).", SafeArg.of("runId", runId), SafeArg.of("failureCount", failureCount), e); } catch (NotInitializedException e) { log.warn("Asynchronous initialization of resources is not complete. Retrying in 10 seconds.", e); Uninterruptibles.sleepUninterruptibly(AsyncInitializer.millisUntilNextAttempt, TimeUnit.MILLISECONDS); } catch (RuntimeException e) { log.warn("[{}] RuntimeException while processing transaction.", SafeArg.of("runId", runId), e); throw e; } sleepForBackoff(failureCount); } }
Source:
<code>protected Map<Guid, KeyValuePairCompat<String, List<Guid>>> populateVmsMetadataForOvfUpdate(List<Guid> idsToProcess) { Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata = new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>(); List<VM> vms = getVmDao().getVmsByIds(idsToProcess); for (VM vm : vms) { if (VMStatus.ImageLocked != vm.getStatus()) { updateVmDisksFromDb(vm); <START> vm.setSnapshots(getSnapshotDao().getAllWithConfiguration(vm.getId())); <END> if (verifyDisksNotLocked(vm.getDiskList()) && verifySnapshotsNotLocked(vm.getSnapshots())) { loadVmData(vm); Long currentDbGeneration = getVmStaticDao().getDbGeneration(vm.getId()); if (currentDbGeneration != null && vm.getStaticData().getDbGeneration() == currentDbGeneration) { proccessedOvfConfigurationsInfo.add(buildMetadataDictionaryForVm(vm, vmsAndTemplateMetadata)); proccessedIdsInfo.add(vm.getId()); proccessedOvfGenerationsInfo.add(vm.getStaticData().getDbGeneration()); proccessDisksDomains(vm.getDiskList()); } } } } return vmsAndTemplateMetadata; }</code><technical_language>1. need load snapshots if disks checks passed succesfully, load disks if vm is locked. 2. load images for of disks IIRC, a done ExportVmCommand handle synchronization other flows preview/restore/stateless run</technical_language>

Target:
protected Map<Guid, KeyValuePairCompat<String, List<Guid>>> populateVmsMetadataForOvfUpdate(List<Guid> idsToProcess) { Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata = new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>(); List<VM> vms = getVmDao().getVmsByIds(idsToProcess); for (VM vm : vms) { if (VMStatus.ImageLocked != vm.getStatus()) { updateVmDisksFromDb(vm); ArrayList<DiskImage> vmDisks = updateSnapshotsForVM(vm); if (verifyDisksNotLocked(vm.getDiskList()) && verifySnapshotsStatus(vm.getSnapshots())) { loadVmData(vm); Long currentDbGeneration = getVmStaticDao().getDbGeneration(vm.getId()); if (currentDbGeneration != null && vm.getStaticData().getDbGeneration() == currentDbGeneration) { proccessedOvfConfigurationsInfo.add(buildMetadataDictionaryForVm(vm, vmsAndTemplateMetadata, vmDisks)); proccessedIdsInfo.add(vm.getId()); proccessedOvfGenerationsInfo.add(vm.getStaticData().getDbGeneration()); proccessDisksDomains(vm.getDiskList()); } } } } return vmsAndTemplateMetadata; }
Source:
<code><START> private void initActionContext(ActionContext actionContext) { <END> actionContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); initSession(actionContext); ActionContext.setContext(actionContext); }</code><technical_language>this method protected? This allow override needed</technical_language>

Target:
protected void initActionContext(ActionContext actionContext) { actionContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); initSession(actionContext); ActionContext.setContext(actionContext); }
Source:
<code>Mono<Void> sendEvents(Iterable<EventGridEvent> events, Context context) { return Flux.fromIterable(events) .map(EventGridEvent::toImpl) .collectList() .flatMap(list -> this.impl.publishEventsAsync(this.hostname, <START> list, context.addData(AZ_TRACING_NAMESPACE_KEY, Constants.EVENT_GRID_TRACING_NAMESPACE_VALUE))); <END> }</code><technical_language>a null check for context it</technical_language>

Target:
Mono<Void> sendEvents(Iterable<EventGridEvent> events, Context context) { final Context finalContext = context != null ? context : Context.NONE; return Flux.fromIterable(events) .map(EventGridEvent::toImpl) .collectList() .flatMap(list -> this.impl.publishEventsAsync(this.hostname, list, finalContext.addData(AZ_TRACING_NAMESPACE_KEY, Constants.EVENT_GRID_TRACING_NAMESPACE_VALUE))); }
Source:
<code>public static Optional<BackupSupportingClassesFactoryProvider> findBestProvider() { ArrayList<BackupSupportingClassesFactoryProvider> list = new ArrayList<>(); load( BackupSupportingClassesFactoryProvider.class ).forEach( list::add ); list.sort( ( l, r ) -> r.getPriority() - l.getPriority() ); <START> return list.stream().findFirst(); <END> }</code><technical_language>streams: StreamSupport.stream( load( BackupSupportingClassesFactoryProvider.class ).spliterator(), false ) .sorted( Comparator.comparing( BackupSupportingClassesFactoryProvider::getPriority ) ) .findFirst()</technical_language>

Target:
public static Optional<BackupSupportingClassesFactoryProvider> findBestProvider() { return StreamSupport.stream( load( BackupSupportingClassesFactoryProvider.class ).spliterator(), false ) .sorted( ( l, r ) -> r.getPriority() - l.getPriority() ) .findFirst(); }
Source:
<code>public DeviceWithState deserialize(Map<String, Object> map) { <START> Number num = MapUtils.getOrNull(map, "apiLevel"); Integer apiLevel = num != null ? num.intValue() : null; <END> DeviceBuildInfo buildInfo = new DeviceBuildInfo( MapUtils.<String>getOrNull(map, "manufacturer"), MapUtils.<String>getOrNull(map, "model"), MapUtils.<String>getOrNull(map, "osVersion"), apiLevel, MapUtils.<String>getOrNull(map, "osBuild"), MapUtils.<String>getOrNull(map, "fingerprint"), MapUtils.<String>getOrNull(map, "tags"), MapUtils.<String>getOrNull(map, "brand"), MapUtils.<String[]>getOrNull(map, "cpuAbis") ); String time = MapUtils.getOrNull(map, "time"); Date date = null; if (time != null) { date = DateUtils.fromIso8601(time); } return new DeviceWithState( buildInfo, MapUtils.<Boolean>getOrNull(map, "jailbroken"), MapUtils.<String>getOrNull(map, "id"), MapUtils.<String>getOrNull(map, "locale"), getLong(map, "totalMemory"), getLong(map, "freeDisk"), getLong(map, "freeMemory"), MapUtils.<String>getOrNull(map, "orientation"), date ); }</code><technical_language>Worth pushing this (and getLong) MapUtils</technical_language>

Target:
public DeviceWithState deserialize(Map<String, Object> map) { DeviceBuildInfo buildInfo = new DeviceBuildInfo( MapUtils.<String>getOrNull(map, "manufacturer"), MapUtils.<String>getOrNull(map, "model"), MapUtils.<String>getOrNull(map, "osVersion"), MapUtils.getInt(map, "apiLevel"), MapUtils.<String>getOrNull(map, "osBuild"), MapUtils.<String>getOrNull(map, "fingerprint"), MapUtils.<String>getOrNull(map, "tags"), MapUtils.<String>getOrNull(map, "brand"), MapUtils.<String[]>getOrNull(map, "cpuAbis") ); String time = MapUtils.getOrNull(map, "time"); Date date = null; if (time != null) { date = DateUtils.fromIso8601(time); } return new DeviceWithState( buildInfo, MapUtils.<Boolean>getOrNull(map, "jailbroken"), MapUtils.<String>getOrNull(map, "id"), MapUtils.<String>getOrNull(map, "locale"), MapUtils.getLong(map, "totalMemory"), MapUtils.getLong(map, "freeDisk"), MapUtils.getLong(map, "freeMemory"), MapUtils.<String>getOrNull(map, "orientation"), date ); }
Source:
<code>public String getDeadLetterReason() { <START> final Map<String, Object> properties = amqpAnnotatedMessage.getApplicationProperties(); <END> if (properties.containsKey(DEAD_LETTER_REASON)) { return String.valueOf(properties.get(DEAD_LETTER_REASON)); } return null; }</code><technical_language>This is common, create a private method aggregate copied lines</technical_language>

Target:
public String getDeadLetterReason() { return getStringValue(amqpAnnotatedMessage.getApplicationProperties(), DEAD_LETTER_REASON_ANNOTATION_NAME.getValue()); }
Source:
<code><START> public synchronized void start() { <END> session.addActivityConsumer(consumer, Priority.ACTIVE); session.addActivityProducer(this); }</code><technical_language>is need synchronized in stop method</technical_language>

Target:
public void start() { session.addActivityConsumer(consumer, Priority.ACTIVE); session.addActivityProducer(this); }
Source:
<code>@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (!(msg instanceof HttpRequest)) return; HttpRequest httpRequest = (HttpRequest) msg; Span span = handler.handleReceive(extractor, httpRequest.headers(), httpRequest); ctx.channel().attr(NettyHttpTracing.SPAN_ATTRIBUTE).set(span); try (SpanInScope ws = tracer.withSpanInScope(span)) { <START> super.channelRead(ctx, msg); <END> } catch (Exception | Error e) { ctx.channel().attr(NettyHttpTracing.SPAN_ATTRIBUTE).set(null); handler.handleSend(null, e, span); throw e; } }</code><technical_language>This throw</technical_language>

Target:
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) { if (!(msg instanceof HttpRequest)) { ctx.fireChannelRead(msg); return; } HttpRequest request = (HttpRequest) msg; Span span = nextSpan(extractor.extract(request.headers()), request).kind(Span.Kind.SERVER); ctx.channel().attr(NettyHttpTracing.SPAN_ATTRIBUTE).set(span); try (SpanInScope ws = tracer.withSpanInScope(span)) { if (!span.isNoop()) { parser.request(adapter, request, span); maybeParseClientAddress(ctx.channel(), request, span); span.start(); } ctx.fireChannelRead(msg); } }
Source:
<code>public int getPriority() { <START> return 60000; <END> }</code><technical_language>this number constant, provide more semantic information it</technical_language>

Target:
public int getPriority() { return Integer.MAX_VALUE; }
Source:
<code>public BearingWidget(Context context, QuestionDetails questionDetails, WaitingForDataRegistry waitingForDataRegistry, SensorManager sensorManager) { super(context, questionDetails); this.waitingForDataRegistry = waitingForDataRegistry; this.sensorManager = sensorManager; isSensorAvailable = checkForRequiredSensors(); textBackground = binding.answerText.getBackground(); binding.answerText.setBackground(null); <START> String answerText = questionDetails.getPrompt().getAnswerText(); <END> if (answerText != null && !answerText.equals("")) { binding.bearingButton.setText(getContext().getString(R.string.replace_bearing)); binding.answerText.setText(answerText); } }</code><technical_language>I remember in other widgets refactored set answer in onCreateAnswerView(), I right? If please consequent</technical_language>

Target:
public BearingWidget(Context context, QuestionDetails questionDetails, WaitingForDataRegistry waitingForDataRegistry, SensorManager sensorManager) { super(context, questionDetails); this.waitingForDataRegistry = waitingForDataRegistry; this.sensorManager = sensorManager; }
Source:
<code>private void prepareCopyNotTemplate(MoveOrCopyImageGroupParameters parameters) { parameters.setAddImageDomainMapping(false); Guid newImageId = Guid.newGuid(); Guid newId = Guid.newGuid(); DiskImage image = getImage(); image.setId(newId); image.setImageId(newImageId); image.setDiskAlias(getDiskAlias()); image.setStorageIds(new ArrayList<>()); image.getStorageIds().add(getParameters().getStorageDomainId()); image.setQuotaId(getParameters().getQuotaId()); image.setDiskProfileId(getParameters().getDiskProfileId()); image.setImageStatus(ImageStatus.LOCKED); image.setVmSnapshotId(null); image.setParentId(Guid.Empty); image.setImageTemplateId(Guid.Empty); parameters.setDestinationImageId(newImageId); parameters.setDestImageGroupId(newId); if (getParameters().getParentCommand() == ActionType.Unknown) { <START> parameters.setDestImages(Collections.singletonList(image)); <END> } }</code><technical_language>consider List.of()</technical_language>

Target:
private void prepareCopyNotTemplate(MoveOrCopyImageGroupParameters parameters) { parameters.setAddImageDomainMapping(false); Guid newImageId = Guid.newGuid(); Guid newId = Guid.newGuid(); DiskImage image = getImage(); image.setId(newId); image.setImageId(newImageId); image.setDiskAlias(getDiskAlias()); image.setStorageIds(new ArrayList<>()); image.getStorageIds().add(getParameters().getStorageDomainId()); image.setQuotaId(getParameters().getQuotaId()); image.setDiskProfileId(getParameters().getDiskProfileId()); image.setImageStatus(ImageStatus.LOCKED); image.setVmSnapshotId(null); image.setParentId(Guid.Empty); image.setImageTemplateId(Guid.Empty); parameters.setDestinationImageId(newImageId); parameters.setDestImageGroupId(newId); if (getParameters().getParentCommand() == ActionType.Unknown) { parameters.setDestImages(List.of(image)); } }
Source:
<code><START> public <K, V> BasicCache<K, V> getCache() { <END> return remoteCacheManager.getCache(); }</code><technical_language>This method return RemoteCache<K, V></technical_language>

Target:
public <K, V> RemoteCache<K, V> getCache() { return this.remoteCacheManager.getCache(); }
Source:
<code>private static String mountFileSystemRW(String path) throws ShellNotRunningException { String command = "mount"; ArrayList<String> output = RootHelper.runShellCommandToList(command); String mountPoint = "", types = null, mountArgument = null; for (String line : output) { String[] words = line.split(" "); String mountPointOutputFromShell = words[1]; String mountPointFileSystemTypeFromShell = words[2]; String mountPointArgumentFromShell = words[3]; <START> if(Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { <END> mountPointOutputFromShell = words[2]; mountPointFileSystemTypeFromShell = words[4]; mountPointArgumentFromShell = words[5]; } if (path.startsWith(mountPointOutputFromShell)) { if (mountPointOutputFromShell.length() > mountPoint.length()) { mountPoint = mountPointOutputFromShell; types = mountPointFileSystemTypeFromShell; mountArgument = mountPointArgumentFromShell; } } } if (!mountPoint.equals("") && types != null && mountArgument != null) { if (mountArgument.contains("rw")) { return null; } else if (mountArgument.contains("ro")) { String mountCommand = "mount -o rw,remount " + mountPoint; ArrayList<String> mountOutput = RootHelper.runShellCommandToList(mountCommand); if (mountOutput.size() != 0) { return null; } else return mountPoint; } } return null; }</code><technical_language>=</technical_language>

Target:
private static String mountFileSystemRW(String path) throws ShellNotRunningException { String command = "mount"; ArrayList<String> output = RootHelper.runShellCommandToList(command); String mountPoint = "", types = null, mountArgument = null; for (String line : output) { String[] words = line.split(" "); String mountPointOutputFromShell = words[1]; String mountPointFileSystemTypeFromShell = words[2]; String mountPointArgumentFromShell = words[3]; if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { mountPointOutputFromShell = words[2]; mountPointFileSystemTypeFromShell = words[4]; mountPointArgumentFromShell = words[5]; } if (path.startsWith(mountPointOutputFromShell)) { if (mountPointOutputFromShell.length() > mountPoint.length()) { mountPoint = mountPointOutputFromShell; types = mountPointFileSystemTypeFromShell; mountArgument = mountPointArgumentFromShell; } } } if (!mountPoint.equals("") && types != null && mountArgument != null) { if (mountArgument.contains("rw")) { return null; } else if (mountArgument.contains("ro")) { String mountCommand = "mount -o rw,remount " + mountPoint; ArrayList<String> mountOutput = RootHelper.runShellCommandToList(mountCommand); if (mountOutput.size() != 0) { return null; } else return mountPoint; } } return null; }
Source:
<code>public Object getImage(final Object object) { EObject element = EMFHelper.getEObject(object); <START> if (element == null) { <END> return null; } IItemLabelProvider provider = getDelegate(element); return (provider == null) ? null : provider.getImage(element); }</code><technical_language>PLease invert operande</technical_language>

Target:
public Object getImage(final Object object) { EObject element = EMFHelper.getEObject(object); if (null == element) { return null; } IItemLabelProvider provider = getDelegate(element); return (provider == null) ? null : provider.getImage(element); }
Source:
<code>public void connect() { <START> connecting = true; <END> connection = new Connection(host.getHostname(), host.getPort()); connection.addConnectionMonitor(this); try { connection.setCompression(compression); } catch (IOException e) { Log.e(TAG, "Could not enable compression!", e); } try { connectionInfo = connection.connect(new HostKeyVerifier()); connected = true; bridge.outputLine(manager.res.getString(R.string.terminal_kex_algorithm, connectionInfo.keyExchangeAlgorithm)); if (connectionInfo.clientToServerCryptoAlgorithm .equals(connectionInfo.serverToClientCryptoAlgorithm) && connectionInfo.clientToServerMACAlgorithm .equals(connectionInfo.serverToClientMACAlgorithm)) { bridge.outputLine(manager.res.getString(R.string.terminal_using_algorithm, connectionInfo.clientToServerCryptoAlgorithm, connectionInfo.clientToServerMACAlgorithm)); } else { bridge.outputLine(manager.res.getString( R.string.terminal_using_c2s_algorithm, connectionInfo.clientToServerCryptoAlgorithm, connectionInfo.clientToServerMACAlgorithm)); bridge.outputLine(manager.res.getString( R.string.terminal_using_s2c_algorithm, connectionInfo.serverToClientCryptoAlgorithm, connectionInfo.serverToClientMACAlgorithm)); } } catch (IOException e) { Log.e(TAG, "Problem in SSH connection thread during authentication", e); Throwable t = e.getCause(); do { bridge.outputLine(t.getMessage()); t = t.getCause(); } while (t != null); close(); onDisconnect(); connecting = false; return; } try { int tries = 0; while (connected && !connection.isAuthenticationComplete() && tries++ < AUTH_TRIES) { authenticate(); Thread.sleep(1000); } } catch (Exception e) { Log.e(TAG, "Problem in SSH connection thread during authentication", e); } connecting = false; }</code><technical_language>easier follow if extract this out another function like: public void connect() { connecting = true; try { connectInternal(); } finally { connecting = false; } } private void connectInternal() { // previous contents of connect() ... }</technical_language>

Target:
public void connect() { connecting = true; try { connectInternal(); } finally { connecting = false; } }
Source:
<code>private List<MemKey> getArrayOfMemKeys(InMemoryMap imm) { SortedKeyValueIterator<Key,Value> skvi = imm.compactionIterator(); List<MemKey> memKeys = new ArrayList<MemKey>(); try { skvi.seek(new Range(), new ArrayList<ByteSequence>(), false); while (skvi.hasTop()) { memKeys.add((MemKey) skvi.getTopKey()); skvi.next(); } } catch (IOException ex) { <START> java.util.logging.Logger.getLogger(InMemoryMapIT.class.getName()).log(Level.SEVERE, null, ex); <END> } return memKeys; }</code><technical_language>log this? throw IOException test methods... wrap RuntimeException rethrow</technical_language>

Target:
private List<MemKey> getArrayOfMemKeys(InMemoryMap imm) { SortedKeyValueIterator<Key,Value> skvi = imm.compactionIterator(); List<MemKey> memKeys = new ArrayList<MemKey>(); try { skvi.seek(new Range(), new ArrayList<ByteSequence>(), false); while (skvi.hasTop()) { memKeys.add((MemKey) skvi.getTopKey()); skvi.next(); } } catch (IOException ex) { log.error("Error getting memkeys", ex); throw new RuntimeException(ex); } return memKeys; }
Source:
<code>public static void main(String... args) { <START> JmhRunner.runAndReport(ArrayBenchmark.class); <END> }</code><technical_language>Nice abstraction, good job! :)</technical_language>

Target:
public static void main(String... args) { JmhRunner.run(ArrayBenchmark.class); }
Source:
<code>private String compress(String str) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); DeflaterOutputStream deflater = new DeflaterOutputStream(bytes); deflater.write(str.getBytes()); deflater.flush(); deflater.close(); <START> return new String(bytes.toByteArray()); <END> }</code><technical_language>deflated byte array a valid string, resulting in a non-inflatable other end</technical_language>

Target:
byte[] compress(String str) throws IOException { final byte[] dataToCompress = str.getBytes(); final ByteArrayOutputStream byteStream = new ByteArrayOutputStream(dataToCompress.length); try { try (GZIPOutputStream zipStream = new GZIPOutputStream(byteStream, true)) { zipStream.write(dataToCompress); } } finally { byteStream.close(); } return byteStream.toByteArray(); }
Source:
<code>private int completeDeletions() throws IOException { int numPending = deletions.size(); int numFailures = 0; if (numPending < 1) { return 0; } List<PendingFileDeletionExec> pendingExecs = deletions. parallelStream().map(f -> new PendingFileDeletionExec(f.getAbsolutePath())).collect( Collectors.toList()); AtomicInteger currentCount = new AtomicInteger(); Map<Boolean, List<PendingFileDeletionExec>> bySuccess = pendingExecs.parallelStream().collect( Collectors.groupingByConcurrent((x) -> { <START> printProgress(LOGGER, "pending deletions", <END> currentCount.incrementAndGet(), numPending); try { doDelete(x); return true; } catch (IOException e) { x.exception = e; return false; } })); deletions.clear(); List<PendingFileDeletionExec> successes = bySuccess.getOrDefault( Boolean.TRUE, null); if (successes != null) { tryDeleteParents(successes); } List<PendingFileDeletionExec> failures = bySuccess.getOrDefault( Boolean.FALSE, null); if (failures != null && failures.size() > 0) { numFailures = failures.size(); double pctFailed = 100.0 * numFailures / numPending; String exmsg = String.format( "%d failures (%.1f%%) while deleting pending files", numFailures, pctFailed); throw new IOException(exmsg, failures.get(0).exception); } return numPending - numFailures; }</code><technical_language>is due thread intertwining print higher progress progress, right? E.g. 100% printed 50%. Is okay</technical_language>

Target:
private int completeDeletions() throws IOException { int numPending = deletions.size(); int numFailures = 0; if (numPending < 1) { return 0; } List<PendingFileDeletionExec> pendingExecs = deletions. parallelStream().map(f -> new PendingFileDeletionExec(f.getAbsolutePath())).collect( Collectors.toList()); Map<Boolean, List<PendingFileDeletionExec>> bySuccess; try (Progress progress = new Progress(LOGGER, "pending deletions", numPending)) { bySuccess = pendingExecs.parallelStream().collect( Collectors.groupingByConcurrent((x) -> { progress.increment(); try { doDelete(x); return true; } catch (IOException e) { x.exception = e; return false; } })); } deletions.clear(); List<PendingFileDeletionExec> successes = bySuccess.getOrDefault( Boolean.TRUE, null); if (successes != null) { tryDeleteParents(successes); } List<PendingFileDeletionExec> failures = bySuccess.getOrDefault( Boolean.FALSE, null); if (failures != null && failures.size() > 0) { numFailures = failures.size(); double pctFailed = 100.0 * numFailures / numPending; String exmsg = String.format( "%d failures (%.1f%%) while deleting pending files", numFailures, pctFailed); throw new IOException(exmsg, failures.get(0).exception); } return numPending - numFailures; }
Source:
<code>static RowMapper<?> rowMapperFor(GetGeneratedKeys ggk, Type returnType) { if (DefaultGeneratedKeyMapper.class.equals(ggk.value())) { return new DefaultGeneratedKeyMapper(returnType, ggk.columnName()); } else { try { <START> return ggk.value().newInstance(); <END> } catch (Exception e) { throw new UnableToCreateStatementException("Unable to instantiate row mapper for statement", e, null); } } }</code><technical_language>Meh: ggk.value().getConstructor().newInstance()</technical_language>

Target:
static RowMapper<?> rowMapperFor(GetGeneratedKeys ggk, Type returnType) { if (DefaultGeneratedKeyMapper.class.equals(ggk.value())) { return new DefaultGeneratedKeyMapper(returnType, ggk.columnName()); } else { try { return ggk.value().getConstructor().newInstance(); } catch (Exception e) { throw new UnableToCreateStatementException("Unable to instantiate row mapper for statement", e, null); } } }
Source:
<code>public JoinMetadata readJoinMetadata(SnapshotBase tx, String nodeId) { Optional<NodeType> type = NodeType.fromNodeId(nodeId); try { checkArgument(type.isPresent() && type.get() == NodeType.JOIN); <START> LOG.debug("Retrieving Metadata from Cache: {}.", nodeId); <END> return (JoinMetadata) commonNodeMetadataCache.get(nodeId, new Callable<CommonNodeMetadata>() { @Override public CommonNodeMetadata call() throws Exception { LOG.debug("Seeking Metadata from Fluo Table: {}.", nodeId); return dao.readJoinMetadata(tx, nodeId); } }); } catch (Exception e) { throw new RuntimeException("Unable to access JoinMetadata for nodeId: " + nodeId, e); } }</code><technical_language>this catch(Exception) catch a checkArgument() failure</technical_language>

Target:
public JoinMetadata readJoinMetadata(SnapshotBase tx, String nodeId) { checkNotNull(nodeId); checkNotNull(tx); Optional<NodeType> type = NodeType.fromNodeId(nodeId); checkArgument(type.isPresent() && type.get() == NodeType.JOIN); try { LOG.debug("Retrieving Metadata from Cache: {}.", nodeId); return (JoinMetadata) commonNodeMetadataCache.get(nodeId, () -> { LOG.debug("Seeking Metadata from Fluo Table: {}.", nodeId); return dao.readJoinMetadata(tx, nodeId); }); } catch (Exception e) { throw new RuntimeException("Unable to access JoinMetadata for nodeId: " + nodeId, e); } }
Source:
<code><START> private Object expandElements(Expander expander, Object value) { <END> if (value instanceof Collection) { return expandCollection(expander, (Collection) value); } else if (value.getClass().isArray()) { return expandCollection(expander, Arrays.asList((Object[])value)); } return expander.expand(value); }</code><technical_language>For consistency I check instance of Iterable not, Collection array. Currently, special handling for arrays, while do for Iterable (HeaderMap QueryMap)</technical_language>

Target:
private Object expandElements(Expander expander, Object value) { if (value instanceof Iterable) { return expandIterable(expander, (Iterable) value); } return expander.expand(value); }
Source:
<code>public Double sample(final RandomGenerator rng, final CopyRatioState state, final CopyRatioData dataCollection) { final Function<Double, Double> logConditionalPDF = newVariance -> { double ll = 0.; int numNotOutliers = 0; for (int segment = 0; segment < dataCollection.getNumSegments(); segment++) { final int numTargetsInSegment = dataCollection.getNumTargetsInSegment(segment); final int targetStartInSegment = dataCollection.getStartTargetInSegment(segment); for (int target = 0; target < numTargetsInSegment; target++) { final double coverage = dataCollection.getCoveragesInSegment(segment).get(target); if (!state.targetOutlierIndicator(targetStartInSegment + target)) { ll -= normalTerm(coverage, state.segmentMean(segment), newVariance); <START> numNotOutliers++; <END> } } } ll -= 0.5 * Math.log(newVariance) * numNotOutliers; return ll; }; return new SliceSampler(rng, logConditionalPDF, varianceMin, varianceMax, varianceSliceSamplingWidth).sample(state.variance()); }</code><technical_language>Keeping track of numNonOutliers is messy. Instead, loop define gaussianLogNormalization = -0.5 * Math.log(newVariance) in loop ll -= normalTerm(. . .) + gaussianLogNormalization</technical_language>

Target:
public Double sample(final RandomGenerator rng, final CopyRatioState state, final CopyRatioData dataCollection) { final Function<Double, Double> logConditionalPDF = newVariance -> { final double gaussianLogNormalization = 0.5 * Math.log(newVariance); double ll = 0.; for (int segment = 0; segment < dataCollection.getNumSegments(); segment++) { final List<CopyRatioData.IndexedCoverage> indexedCoveragesInSegment = dataCollection.getIndexedCoveragesInSegment(segment); for (final CopyRatioData.IndexedCoverage c : indexedCoveragesInSegment) { if (!state.targetOutlierIndicator(c.getTargetIndex())) { ll -= normalTerm(c.getCoverage(), state.segmentMean(segment), newVariance) + gaussianLogNormalization; } } } return ll; }; return new SliceSampler(rng, logConditionalPDF, varianceMin, varianceMax, varianceSliceSamplingWidth).sample(state.variance()); }
Source:
<code>public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { startGeoRepSession(); } else if(command.equals(getStopSessionCommand())) { stopGeoRepSession(); } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if (command.equals(getRefreshSessionsCommand())) { refreshSessions(); } else if (command.getName().equalsIgnoreCase("cancelWindow")) { setWindow(null); } else if (command.getName().equalsIgnoreCase("onStartGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StartGlusterVolumeGeoRep, true); } else if (command.getName().equalsIgnoreCase("onStopGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StopGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("onPauseGeoRepSession")) { onGeoRepSessionAction(VdcActionType.PauseGlusterVolumeGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("onResumeGeoRepSession")) { onGeoRepSessionAction(VdcActionType.ResumeGeoRepSession, true); <START> } else if (command.getName().equalsIgnoreCase("closeWindow")) { END> closeWindow(); } else if(command.equals(getPauseSessionCommand())) { pauseGeoRepSession(); } else if(command.equals(getResumeSessionCommand())) { resumeGeoRepSession(); } }</code><technical_language>duplicate of "cancelWindow"</technical_language>

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { startGeoRepSession(); } else if(command.equals(getStopSessionCommand())) { stopGeoRepSession(); } else if(command.equals(getPauseSessionCommand())) { pauseGeoRepSession(); } else if(command.equals(getResumeSessionCommand())) { resumeGeoRepSession(); } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if (command.equals(getRefreshSessionsCommand())) { refreshSessions(); } else if (command.getName().equalsIgnoreCase("onStartGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StartGlusterVolumeGeoRep, true); } else if (command.getName().equalsIgnoreCase("onStopGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StopGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("onPauseGeoRepSession")) { onGeoRepSessionAction(VdcActionType.PauseGlusterVolumeGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("onResumeGeoRepSession")) { onGeoRepSessionAction(VdcActionType.ResumeGeoRepSession, true); } else if (command.getName().equalsIgnoreCase("closeWindow")) { closeWindow(); } }
Source:
<code>private void slaveShutdown(TaskListener listener) throws DockerException, IOException { if(!getJobProperty().tagOnCompletion) { addJenkinsAction(null); return; } DockerClient client = getClient(); String repositoryName = getJobProperty().imageRepository; <START> if (Strings.isNullOrEmpty(repositoryName)) { <END> repositoryName = theRun.getParent().getDisplayName(); } DockerImageName imageName = new DockerImageName(repositoryName).makeValid(); TagName imageTag = new TagName(theRun.getDisplayName()).makeValid(); String imageId = client.commitCmd(containerId) .withRepository(imageName.toString()) .withTag(imageTag.toString()) .withAuthor("Jenkins") .exec(); addJenkinsAction(imageId); try { String tagToken = getAdditionalTag(listener); if( !Strings.isNullOrEmpty(tagToken) ) { client.tagImageCmd(imageId, imageName.toString(), tagToken) .withForce() .exec(); addJenkinsAction(tagToken); if( getJobProperty().pushOnSuccess ) { client.pushImageCmd(tagToken).exec(); } } } catch(Exception ex) { LOGGER.log(Level.SEVERE, "Could not add additional tags"); } if( getJobProperty().cleanImages ) { client.removeImageCmd(imageId) .withForce() .exec(); } }</code><technical_language>defaultIfEmpty commons-lang</technical_language>

Target:
private void slaveShutdown(TaskListener listener) throws DockerException, IOException { if (!getJobProperty().tagOnCompletion) { addJenkinsAction(null); return; } DockerClient client = getClient(); String tag_image = client.commitCmd(containerId) .withRepository(theRun.getParent().getDisplayName()) .withTag(theRun.getDisplayName().replace("#", "b")) .withAuthor("Jenkins") .exec(); addJenkinsAction(tag_image); try { String tagToken = getAdditionalTag(listener); if (!Strings.isNullOrEmpty(tagToken)) { client.tagImageCmd(tag_image, null, tagToken).exec(); addJenkinsAction(tagToken); if (getJobProperty().pushOnSuccess) { client.pushImageCmd(tagToken).exec(); } } } catch (Exception ex) { LOGGER.log(Level.SEVERE, "Could not add additional tags"); } if (getJobProperty().cleanImages) { client.removeImageCmd(tag_image) .withForce() .exec(); } }
Source:
<code>public CompletionStage<Void> commit(Xid externalXid, boolean isOnePhase) { Xid xid = convertXid(externalXid); LocalXaTransaction localTransaction = getLocalTransactionAndValidate(xid); if (localTransaction == null) { return CompletableFutures.completedExceptionFuture(new XAException(XAException.XAER_NOTA)); } CompletionStage<?> prepareStage; if (isOnePhase) { prepareStage = txCoordinator.prepare(localTransaction); } else { prepareStage = CompletableFutures.completedNull(); } CompletionStage<Boolean> commitStage = prepareStage <START> .thenCompose(ignore -> txCoordinator.commit(localTransaction, false)); <END> return commitStage.thenApply(committedInOnePhase -> { forgetSuccessfullyCompletedTransaction(recoveryManager, localTransaction.getXid(), localTransaction, committedInOnePhase); return null; }); }</code><technical_language>Nitpicking, I prefer wrapping prepareStage, return prepareStage.thenCompose(ignore -> txCoordinator.commit(localTransaction, false)) .thenApply(committedInOnePhase -> {</technical_language>

Target:
public CompletionStage<Void> commit(Xid externalXid, boolean isOnePhase) { Xid xid = convertXid(externalXid); LocalXaTransaction localTransaction = getLocalTransaction(xid); if (localTransaction == null) { return CompletableFutures.completedExceptionFuture(new XAException(XAException.XAER_NOTA)); } CompletionStage<?> prepareStage; if (isOnePhase) { prepareStage = txCoordinator.prepare(localTransaction); } else { prepareStage = CompletableFutures.completedNull(); } return prepareStage.thenCompose(ignore -> txCoordinator.commit(localTransaction, false)) .thenApply(committedInOnePhase -> { forgetSuccessfullyCompletedTransaction(recoveryManager, localTransaction.getXid(), localTransaction, committedInOnePhase); return null; }); }
Source:
<code>public static Slice castToHyperLogLog(@SqlType(SetDigestType.NAME) Slice slice) { <START> checkArgument(slice.getByte(0) == 1, "CAST only works on version 1 of SetDigest format"); <END> int hllLength = slice.getInt(SIZE_OF_BYTE); return Slices.wrappedBuffer(slice.getBytes(SIZE_OF_BYTE + SIZE_OF_INT, hllLength)); }</code><technical_language>legacy version of SetDigest cast HyperLogLog</technical_language>

Target:
public static Slice castToHyperLogLog(@SqlType(SetDigestType.NAME) Slice slice) { checkArgument(slice.getByte(0) == 1, "Legacy version of SetDigest cannot cast to HyperLogLog"); int hllLength = slice.getInt(SIZE_OF_BYTE); return Slices.wrappedBuffer(slice.getBytes(SIZE_OF_BYTE + SIZE_OF_INT, hllLength)); }