auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected InternalCache createCacheAndCreateJdbcMapping(String cacheXmlTestName) throws Exception { InternalCache cache = (InternalCache) new CacheFactory().set("locators", "").set("mcast-port", "0").create(); Set<DistributedMember> targetMembers = findMembers(cache, null, null); CliFunctionResult createRegionFuncResult = executeCreateRegionFunction(targetMembers); System.out.println("createRegionFuncResult=" + createRegionFuncResult); CliFunctionResult createDataStoreFuncResult = executeCreateJndiBindingFunction(targetMembers, dbRule.getConnectionUrl()); System.out.println("createDataStoreFuncArgs=" + createDataStoreFuncResult); CliFunctionResult createMappingFuncResult = executeCreateMappingFunction(Employee.class.getName(), targetMembers); System.out.println("createMappingFuncResult=" + createMappingFuncResult); return cache; }

Target:
protected InternalCache createCacheAndCreateJdbcMapping(String cacheXmlTestName) throws Exception { InternalCache cache = (InternalCache) new CacheFactory().set("locators", "").set("mcast-port", "0").create(); Set<DistributedMember> targetMembers = findMembers(cache, null, null); CliFunctionResult createRegionFuncResult = executeCreateRegionFunction(targetMembers); CliFunctionResult createDataStoreFuncResult = executeCreateJndiBindingFunction(targetMembers, dbRule.getConnectionUrl()); CliFunctionResult createMappingFuncResult = executeCreateMappingFunction(Employee.class.getName(), targetMembers); return cache; }
Source:
private void checkRssTimeNode(Node firstBuild, String nodeName) throws ParseException { String pubDate = getSingleNode(firstBuild, nodeName).getTextContent(); assertNotNull(pubDate); DateFormat formatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz"); Date date = formatter.parse("Sat, 24 Apr 2010 14:01:00 GMT"); assertNotNull(date); }

Target:
private void checkRssTimeNode(Node firstBuild, String nodeName) throws ParseException { String pubDate = getSingleNode(firstBuild, nodeName).getTextContent(); assertThat(pubDate, not(emptyString())); DateFormat formatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz"); Date date = formatter.parse(pubDate); assertNotNull(date); }
Source:
private void refresh() { final TmfTraceManager tm = TmfTraceManager.getInstance(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphViewer.getControl().isDisposed()) { return; } ITimeGraphEntry[] entries = null; synchronized (fEntryListMap) { fEntryList = fEntryListMap.get(fTrace); if (fEntryList == null) { fEntryList = new ArrayList<TraceEntry>(); } entries = fEntryList.toArray(new ITimeGraphEntry[0]); } if (entries != null) { Arrays.sort(entries, new TraceEntryComparator()); fTimeGraphViewer.setInput(entries); fTimeGraphViewer.setTimeBounds(fStartTime, fEndTime); long timestamp = fTrace == null ? 0 : tm.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long startTime = fTrace == null ? 0 : tm.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long endTime = fTrace == null ? 0 : tm.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); startTime = Math.max(startTime, fStartTime); endTime = Math.min(endTime, fEndTime); fTimeGraphViewer.setSelectedTime(timestamp, false); fTimeGraphViewer.setStartFinishTime(startTime, endTime); startZoomThread(startTime, endTime); } } }); }

Target:
private void refresh() { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphViewer.getControl().isDisposed()) { return; } ITimeGraphEntry[] entries = null; synchronized (fEntryListMap) { fEntryList = fEntryListMap.get(fTrace); if (fEntryList == null) { fEntryList = new ArrayList<TraceEntry>(); } entries = fEntryList.toArray(new ITimeGraphEntry[0]); } if (entries != null) { Arrays.sort(entries, new TraceEntryComparator()); fTimeGraphViewer.setInput(entries); fTimeGraphViewer.setTimeBounds(fStartTime, fEndTime); final TmfTraceManager tm = TmfTraceManager.getInstance(); long timestamp = fTrace == null ? 0 : tm.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long startTime = fTrace == null ? 0 : tm.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long endTime = fTrace == null ? 0 : tm.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); startTime = Math.max(startTime, fStartTime); endTime = Math.min(endTime, fEndTime); fTimeGraphViewer.setSelectedTime(timestamp, false); fTimeGraphViewer.setStartFinishTime(startTime, endTime); startZoomThread(startTime, endTime); } } }); }
Source:
private List<IDockerContainer> listContainers() throws DockerException { final List<IDockerContainer> dclist = new ArrayList<>(); synchronized (containerLock) { List<Container> list = null; try { list = client.listContainers(DockerClient.ListContainersParam .allContainers()); } catch (com.spotify.docker.client.DockerException | InterruptedException e) { throw new DockerException( NLS.bind( Messages.List_Docker_Containers_Failure, this.getName()), e); } for (Container c : list) { if (c.status().startsWith(Messages.Exited_specifier)) { if (loggingThreads.containsKey(c.id())) { loggingThreads.get(c.id()).requestStop(); loggingThreads.remove(c.id()); } } dclist.add(new DockerContainer(this, c)); } containers = dclist; } notifyContainerListeners(this, dclist); return dclist; }

Target:
private List<IDockerContainer> listContainers() throws DockerException { final List<IDockerContainer> dclist = new ArrayList<>(); synchronized (containerLock) { List<Container> list = null; try { list = client.listContainers(DockerClient.ListContainersParam .allContainers()); } catch (com.spotify.docker.client.DockerException | InterruptedException e) { throw new DockerException( NLS.bind( Messages.List_Docker_Containers_Failure, this.getName()), e); } for (Container c : list) { if (c.status().startsWith(Messages.Exited_specifier)) { if (loggingThreads.containsKey(c.id())) { loggingThreads.get(c.id()).requestStop(); loggingThreads.remove(c.id()); } } dclist.add(new DockerContainer(this, c)); } containers = dclist; } notifyContainerListeners(dclist); return dclist; }
Source:
protected List<ResourceGroupSpec> getRootGroups() { if (lastRefresh.get() == 0) { throw new PrestoException(CONFIGURATION_UNAVAILABLE, "Root groups could not be fetched from database"); } if (this.selectors.get().isEmpty()) { throw new PrestoException(CONFIGURATION_INVALID, "No root groups are configured"); } return rootGroups.get(); }

Target:
protected List<ResourceGroupSpec> getRootGroups() { if (lastRefresh.get() == 0) { throw new PrestoException(CONFIGURATION_UNAVAILABLE, "Root groups cannot be fetched from database"); } if (this.selectors.get().isEmpty()) { throw new PrestoException(CONFIGURATION_INVALID, "No root groups are configured"); } return rootGroups.get(); }
Source:
public ERXKey(String key, Type type) { _key = key; setType(type); }

Target:
public ERXKey(String key, Type type) { _key = key; _type = type; }
Source:
private RemoteClassLoader(@CheckForNull ClassLoader parent, @Nonnull IClassLoader proxy) { super(new URL[0],parent); final Channel channel = RemoteInvocationHandler.unwrap(proxy); this.channel = channel == null ? null : channel.ref(); this.underlyingProxy = proxy; final IClassLoader targetProxy; if (channel == null || !channel.remoteCapability.supportsPrefetch() || channel.getJarCache()==null) { targetProxy = new DumbClassLoaderBridge(proxy); } else { targetProxy = proxy; } this.proxy = (IClassLoader) Proxy.newProxyInstance(RemoteClassLoader.class.getClassLoader(), new Class[] { IClassLoader.class }, (p, method, methodArgs) -> { Object result; boolean interrupted = false; try { while (true) { try { result = method.invoke(targetProxy, methodArgs); break; } catch (InvocationTargetException x) { Throwable e = x.getCause(); if (e instanceof RemotingSystemException && (e.getCause() instanceof InterruptedException || e.getCause() instanceof InterruptedIOException) && !"fetchJar".equals(method.getName())) { interrupted = true; } else { throw e; } } } } finally { if (interrupted) { Thread.currentThread().interrupt(); } } return result; }); }

Target:
private RemoteClassLoader(@CheckForNull ClassLoader parent, @Nonnull IClassLoader proxy) { super(new URL[0], parent); final Channel channel = RemoteInvocationHandler.unwrap(proxy); this.channel = channel == null ? null : channel.ref(); this.underlyingProxy = proxy; final IClassLoader targetProxy; if (channel == null || !channel.remoteCapability.supportsPrefetch() || channel.getJarCache() == null) { targetProxy = new DumbClassLoaderBridge(proxy); } else { targetProxy = proxy; } if (RemoteInterruptedExceptionCatcher.shouldBeEnabled()) { this.proxy = (IClassLoader) Proxy.newProxyInstance(RemoteClassLoader.class.getClassLoader(), new Class[] { IClassLoader.class }, new RemoteInterruptedExceptionCatcher(targetProxy)); } else { this.proxy = targetProxy; } }
Source:
public void checkWillOnlyTakeBroadcastMatchingCandidatesNotAll() { EquivalenceResult equivalenceResult = itemsWithBroadcastAndScores( "4500", "2500", "9500", "4400", "6500", "9600", 5.0, 4.8, 4.9 ); assertTrue(equivalenceResult.strongEquivalences().values().size() == 2); }

Target:
public void checkWillOnlyTakeBroadcastMatchingCandidatesNotAll() { EquivalenceResult equivalenceResult = itemsWithBroadcastAndScores( new DateTime().withHourOfDay(2), new DateTime().withHourOfDay(4), new DateTime().withHourOfDay(2), new DateTime().withHourOfDay(3), new DateTime().withHourOfDay(9), new DateTime().withHourOfDay(4), new DateTime().withHourOfDay(6), new DateTime().withHourOfDay(9).withMinuteOfHour(15), 5.0, 4.8, 4.9 ); assertTrue(equivalenceResult.strongEquivalences().values().size() == 1); }
Source:
private void receivePack() throws IOException { if (timeoutIn != null) timeoutIn.setTimeout(10 * timeout * 1000); ip = IndexPack.create(db, rawIn); ip.setFixThin(true); ip.setNeedNewObjectIds(needNewObjectIds); ip.setNeedBaseObjectIds(needBaseObjectIds); ip.setObjectChecking(isCheckReceivedObjects()); ip.index(NullProgressMonitor.INSTANCE); String lockMsg = "jgit receive-pack"; if (getRefLogIdent() != null) lockMsg += " from " + getRefLogIdent().toExternalString(); packLock = ip.renameAndOpenPack(lockMsg); if (timeoutIn != null) timeoutIn.setTimeout(timeout * 1000); }

Target:
private void receivePack() throws IOException { if (timeoutIn != null) timeoutIn.setTimeout(10 * timeout * 1000); ip = IndexPack.create(db, rawIn); ip.setFixThin(true); ip.setNeedNewObjectIds(needNewObjectIds || ensureObjectsProvidedVisible); ip.setNeedBaseObjectIds(needBaseObjectIds || ensureObjectsProvidedVisible); ip.setObjectChecking(isCheckReceivedObjects()); ip.index(NullProgressMonitor.INSTANCE); String lockMsg = "jgit receive-pack"; if (getRefLogIdent() != null) lockMsg += " from " + getRefLogIdent().toExternalString(); packLock = ip.renameAndOpenPack(lockMsg); if (timeoutIn != null) timeoutIn.setTimeout(timeout * 1000); }
Source:
private Map<String, List<String>> generateHeaderMap () { Map<String, List<String>> headerMap = new HashMap<String, List<String>>(); List<String> bearerHeader = new ArrayList<String>(); bearerHeader.add("Bearer"); bearerHeader.add("sk_live_12345"); List<String> requestIdHeader = new ArrayList<String>(); requestIdHeader.add("req_12345"); headerMap.put("Request-Id", requestIdHeader); headerMap.put("Authorization", bearerHeader); headerMap.put("Empty-Header", new ArrayList<String>()); return headerMap; }

Target:
private Map<String, List<String>> generateHeaderMap () { Map<String, List<String>> headerMap = new HashMap<String, List<String>>(); List<String> multiValueHeader = new ArrayList<String>(); multiValueHeader.add("FirstValue"); multiValueHeader.add("SecondValue"); List<String> requestIdHeader = new ArrayList<String>(); requestIdHeader.add("req_12345"); headerMap.put("Request-Id", requestIdHeader); headerMap.put("Multi-Val", multiValueHeader); headerMap.put("Empty-Header", new ArrayList<String>()); return headerMap; }
Source:
public void onMatch(RelOptRuleCall call) { assert matches(call); final Join join = call.rel(0); RelNode right = join.getRight(); final RelNode left = join.getLeft(); final int leftFieldCount = left.getRowType().getFieldCount(); final RelOptCluster cluster = join.getCluster(); final RexBuilder rexBuilder = cluster.getRexBuilder(); final RelBuilder relBuilder = call.builder(); final CorrelationId correlationId = cluster.createCorrel(); final RexNode corrVar = rexBuilder.makeCorrel(left.getRowType(), correlationId); final ImmutableBitSet.Builder requiredColumns = ImmutableBitSet.builder(); final RexNode joinCondition = join.getCondition().accept(new RexShuttle() { @Override public RexNode visitInputRef(RexInputRef input) { int field = input.getIndex(); if (field >= leftFieldCount) { return rexBuilder.makeInputRef(input.getType(), input.getIndex() - leftFieldCount); } requiredColumns.set(field); return rexBuilder.makeFieldAccess(corrVar, field); } }); relBuilder.push(right).filter(joinCondition); RelNode newRel = LogicalCorrelate.create(left, relBuilder.build(), correlationId, requiredColumns.build(), join instanceof SemiJoin ? SemiJoinType.SEMI : SemiJoinType.of(join.getJoinType())); call.transformTo(newRel); }

Target:
public void onMatch(RelOptRuleCall call) { assert matches(call); final Join join = call.rel(0); RelNode right = join.getRight(); final RelNode left = join.getLeft(); final int leftFieldCount = left.getRowType().getFieldCount(); final RelOptCluster cluster = join.getCluster(); final RexBuilder rexBuilder = cluster.getRexBuilder(); final RelBuilder relBuilder = call.builder(); final CorrelationId correlationId = cluster.createCorrel(); final RexNode corrVar = rexBuilder.makeCorrel(left.getRowType(), correlationId); final ImmutableBitSet.Builder requiredColumns = ImmutableBitSet.builder(); final RexNode joinCondition = join.getCondition().accept(new RexShuttle() { @Override public RexNode visitInputRef(RexInputRef input) { int field = input.getIndex(); if (field >= leftFieldCount) { return rexBuilder.makeInputRef(input.getType(), input.getIndex() - leftFieldCount); } requiredColumns.set(field); return rexBuilder.makeFieldAccess(corrVar, field); } }); relBuilder.push(right).filter(joinCondition); RelNode newRel = LogicalCorrelate.create(left, relBuilder.build(), correlationId, requiredColumns.build(), semiJoinTypeExtractor.apply(join)); call.transformTo(newRel); }
Source:
private void vmUpdateStatus(final VM vm, final VM.VMStatus status, final long delay, final String msg, final boolean updateHost) throws InterruptedException { Thread updateStatus = new Thread(new Runnable() { @Override public void run() { try { TimeUnit.MILLISECONDS.sleep(delay); vm.setStatus(status); sendNotification(msg, vm.getId()); log.info("VM set to {}", vm.getId(), msg); if (updateHost){ VdsmManager.getInstance().updateHost(vm.getHost()); } }catch (Exception e){ log.error(e.toString()); } } }); updateStatus.start(); }

Target:
private void vmUpdateStatus(final VM vm, final VM.VMStatus status, final long delay, final String msg, final boolean updateHost) throws InterruptedException { service.submit(new EventHandler(vm, status, delay, msg, updateHost)); }
Source:
protected ExecutorService buildFixedThreadPoolExecutorService(String key) { String stringProperty = System.getProperty(key); int threadLimit = stringProperty == null ? 0 : Integer.valueOf(stringProperty); if (threadLimit > 0) { return Executors.newFixedThreadPool(threadLimit, new DescriptiveThreadFactory()); } else { return Executors.newCachedThreadPool(new DescriptiveThreadFactory()); } }

Target:
protected ExecutorService buildFixedThreadPoolExecutorService(String key) { String stringProperty = System.getProperty(key); int threadLimit = stringProperty == null ? 0 : toInteger(stringProperty); if (threadLimit > 0) { return Executors.newFixedThreadPool(threadLimit, new DescriptiveThreadFactory()); } else { return Executors.newCachedThreadPool(new DescriptiveThreadFactory()); } }
Source:
public void checkAttributeValue(PerunSessionImpl sess, Resource resource, Group group, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { List<String> emails; Object value = attribute.getValue(); if (value == null) { throw new WrongAttributeValueException(attribute, resource, group, "can't be null."); } else if (!(value instanceof List)) { throw new WrongAttributeValueException(attribute, resource, group, "is of type " + value.getClass() + ", but should be ArrayList"); } else { emails = (List<String>) value; } for (String email : emails) { Matcher emailMatcher = emailPattern.matcher(email); if (!emailMatcher.matches()) throw new WrongAttributeValueException(attribute, resource, group, "Email " + email + " is not in correct form."); } AttributesManagerBl am = sess.getPerunBl().getAttributesManagerBl(); try { Object adName = am.getAttribute(sess, resource, group, ADNAME_ATTRIBUTE).getValue(); if (adName != null && emails.isEmpty()) { throw new WrongAttributeValueException(attribute, resource, group, "at least one email must be defined"); } } catch (AttributeNotExistsException | GroupResourceMismatchException e) { throw new InternalErrorException(e.getMessage(), e); } if (hasDuplicate(emails)) { throw new WrongAttributeValueException(attribute, resource, group, "duplicate values"); } }

Target:
public void checkAttributeValue(PerunSessionImpl sess, Resource resource, Group group, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { List<String> emails; Object value = attribute.getValue(); if (value == null) { emails = Collections.emptyList(); } else if (value instanceof List) { emails = (List<String>) value; } else { throw new WrongAttributeValueException(attribute, resource, group, "is of type " + value.getClass() + ", but should be ArrayList"); } for (String email : emails) { Matcher emailMatcher = emailPattern.matcher(email); if (!emailMatcher.matches()) throw new WrongAttributeValueException(attribute, resource, group, "Email " + email + " is not in correct form."); } AttributesManagerBl am = sess.getPerunBl().getAttributesManagerBl(); try { Object adName = am.getAttribute(sess, resource, group, ADNAME_ATTRIBUTE).getValue(); if (adName != null && emails.isEmpty()) { throw new WrongAttributeValueException(attribute, resource, group, "at least one email must be defined"); } } catch (AttributeNotExistsException | GroupResourceMismatchException e) { throw new InternalErrorException(e.getMessage(), e); } if (hasDuplicate(emails)) { throw new WrongAttributeValueException(attribute, resource, group, "duplicate values"); } }
Source:
private String getSourceHostForContainer(ContainerPlacementRequestMessage requestMessage) { String sourceHost = null; String processorId = requestMessage.getProcessorId(); if (samzaApplicationState.runningProcessors.containsKey(processorId)) { SamzaResource currentResource = samzaApplicationState.runningProcessors.get(processorId); LOG.info("Processor ID: matched a running container with containerId ID: is running on host: for ContainerPlacement action: {}", processorId, currentResource.getContainerId(), currentResource.getHost(), requestMessage); sourceHost = currentResource.getHost(); } else { sourceHost = Optional.ofNullable(localityManager.readLocality().getHostLocality(processorId)) .map(HostLocality::host) .orElse(null); LOG.info("Processor ID: is not running and was last seen on host: for ContainerPlacement action: {}", processorId, sourceHost, requestMessage); } return sourceHost; }

Target:
private String getSourceHostForContainer(ContainerPlacementRequestMessage requestMessage) { String sourceHost = null; String processorId = requestMessage.getProcessorId(); if (samzaApplicationState.runningProcessors.containsKey(processorId)) { SamzaResource currentResource = samzaApplicationState.runningProcessors.get(processorId); LOG.info("Processor ID: matched a running container with containerId ID: is running on host: for ContainerPlacement action: {}", processorId, currentResource.getContainerId(), currentResource.getHost(), requestMessage); sourceHost = currentResource.getHost(); } else { sourceHost = Optional.ofNullable(localityManager.readLocality().getProcessorLocality(processorId)) .map(ProcessorLocality::host) .orElse(null); LOG.info("Processor ID: is not running and was last seen on host: for ContainerPlacement action: {}", processorId, sourceHost, requestMessage); } return sourceHost; }
Source:
private void onCloneTemplate() { final UnitVmModel model = (UnitVmModel) getWindow(); NewTemplateVmModelBehavior behavior = (NewTemplateVmModelBehavior) model.getBehavior(); Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } final VM vm = behavior.getVm(); if (!model.validate(false)) { model.setIsValid(false); } else if (model.getIsSubTemplate().getEntity()) { postNameUniqueCheck(vm); } else { String name = model.getName().getEntity(); AsyncDataProvider.getInstance().isTemplateNameUnique(new AsyncQuery<>( isNameUnique -> { if (!isNameUnique) { model.getInvalidityReasons().clear(); model.getName() .getInvalidityReasons() .add(ConstantsManager.getInstance() .getConstants() .nameMustBeUniqueInvalidReason()); model.getName().setIsValid(false); model.setIsValid(false); model.fireValidationCompleteEvent(); } else { postNameUniqueCheck(vm); } }), name, null); } }

Target:
private void onCloneTemplate() { final UnitVmModel model = (UnitVmModel) getWindow(); NewTemplateVmModelBehavior behavior = (NewTemplateVmModelBehavior) model.getBehavior(); Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } final VM vm = behavior.getVm(); if (!model.validate(false)) { model.setIsValid(false); } else if (model.getIsSubTemplate().getEntity()) { postNameUniqueCheck(vm); } else { String name = model.getName().getEntity(); AsyncDataProvider.getInstance().isTemplateNameUnique(new AsyncQuery<>( isNameUnique -> { if (!isNameUnique) { model.getInvalidityReasons().clear(); model.getName() .getInvalidityReasons() .add(ConstantsManager.getInstance() .getConstants() .nameMustBeUniqueInvalidReason()); model.getName().setIsValid(false); model.setIsValid(false); model.fireValidationCompleteEvent(); } else { postNameUniqueCheck(vm); } }), name, model.getSelectedDataCenter().getId()); } }
Source:
private void getDeprecatedContainers() { deprecatedContainers.clear(); if (accountService != null) { Set<Container> containers = accountService.getDeprecatedContainers(config.storeContainerDeletionRetentionDays); deprecatedContainers.addAll(containers.stream() .map(container -> new Pair<>(container.getParentAccountId(), container.getId())) .collect(Collectors.toSet())); } }

Target:
private void getDeprecatedContainers() { deprecatedContainers.clear(); if (accountService != null) { Set<Container> containers = AccountUtils.getDeprecatedContainers(accountService, config.storeContainerDeletionRetentionDays); deprecatedContainers.addAll(containers.stream() .map(container -> new Pair<>(container.getParentAccountId(), container.getId())) .collect(Collectors.toSet())); } }
Source:
public CombinedTypeSolver(TypeSolver... elements) { this(ExceptionFilters.IGNORE_ALL, elements); }

Target:
public CombinedTypeSolver(TypeSolver... elements) { this(ExceptionHandlers.IGNORE_NONE, elements); }
Source:
public ElideResponse(int responseCode, String body, Throwable failureReason) { this.responseCode = responseCode; this.body = body; this.failureReason = failureReason; }

Target:
public ElideResponse(int responseCode, String body, Throwable failureReason) { this.responseCode = responseCode; this.body = body; this.failureReason = Optional.ofNullable(failureReason); }
Source:
private Guid getStoragePoolId(GetVmTemplateParameters params) { return params.getStoragePoolId() != null ? params.getStoragePoolId() : params.getVdsGroupId() != null ? DbFacade.getInstance().getVdsGroupDao().get(params.getVdsGroupId()).getStoragePoolId() : null; }

Target:
private Guid getStoragePoolId(GetVmTemplateParameters params) { Guid result = null; if (params.getDataCenterId() != null) { result = params.getDataCenterId(); } else if (params.getClusterId() != null) { VDSGroup vdsGroup = DbFacade.getInstance().getVdsGroupDao().get(params.getClusterId()); if (vdsGroup != null) { result = vdsGroup.getStoragePoolId(); } } return result; }
Source:
public JSONArray coordinatesToJSONArray() throws JSONException{ JSONArray points = new JSONArray(); for (ParseGeoPoint coordinate : coordinates) { JSONArray point = new JSONArray(); point.put(coordinate.getLatitude()); point.put(coordinate.getLongitude()); points.put(point); } return points; }

Target:
protected JSONArray coordinatesToJSONArray() throws JSONException{ JSONArray points = new JSONArray(); for (ParseGeoPoint coordinate : coordinates) { JSONArray point = new JSONArray(); point.put(coordinate.getLatitude()); point.put(coordinate.getLongitude()); points.put(point); } return points; }
Source:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true)); final int suspendTimeout = HOST_SUSPEND_TIMEOUT.resolveModelAttribute(context, operation).asInt(); final BlockingTimeout blockingTimeout = BlockingTimeout.Factory.getProxyBlockingTimeout(context); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.getServiceRegistry(true); Set<String> servers = getServersForHost(model); final List<ModelNode> errorResponses = serverInventory.suspendServers(servers, suspendTimeout, blockingTimeout); if (!errorResponses.isEmpty()) { context.getFailureDescription().set(errorResponses); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, OperationContext.Stage.RUNTIME); }

Target:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); final Resource hostResource = context.readResource(PathAddress.EMPTY_ADDRESS); final int suspendTimeout = HOST_SUSPEND_TIMEOUT.resolveModelAttribute(context, operation).asInt(); final BlockingTimeout blockingTimeout = BlockingTimeout.Factory.getProxyBlockingTimeout(context); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.getServiceRegistry(true); Set<String> servers = getServersForHost(hostResource); final List<ModelNode> errorResponses = serverInventory.suspendServers(servers, suspendTimeout, blockingTimeout); if (!errorResponses.isEmpty()) { context.getFailureDescription().set(errorResponses); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, OperationContext.Stage.RUNTIME); }
Source:
public void startSpanProcessKindSend() { final SpanId parentSpanId = parentSpan.getContext().getSpanId(); final Span.Builder spanBuilder = tracer.spanBuilder(METHOD_NAME); END final Context traceContext = tracingContext.addData(ENTITY_PATH_KEY, ENTITY_PATH_VALUE) .addData(HOST_NAME_KEY, HOSTNAME_VALUE).addData(SPAN_BUILDER_KEY, spanBuilder); final Context updatedContext = openTelemetryTracer.start(METHOD_NAME, traceContext, ProcessKind.SEND); END assertSpanWithExplicitParent(updatedContext, parentSpanId); final ReadableSpan recordEventsSpan = (ReadableSpan) updatedContext.getData(PARENT_SPAN_KEY).get(); assertEquals(Span.Kind.PRODUCER, recordEventsSpan.toSpanData().getKind()); final Map<String, AttributeValue> attributeMap = recordEventsSpan.toSpanData().getAttributes(); assertEquals(attributeMap.get(COMPONENT), AttributeValue.stringAttributeValue(COMPONENT_VALUE)); assertEquals(attributeMap.get(MESSAGE_BUS_DESTINATION), AttributeValue.stringAttributeValue(ENTITY_PATH_VALUE)); assertEquals(attributeMap.get(PEER_ENDPOINT), AttributeValue.stringAttributeValue(HOSTNAME_VALUE)); }

Target:
public void startSpanProcessKindSend() { final SpanId parentSpanId = parentSpan.getContext().getSpanId(); final Span.Builder spanBuilder = tracer.spanBuilder(METHOD_NAME); END final Context traceContext = tracingContext.addData(ENTITY_PATH_KEY, ENTITY_PATH_VALUE) .addData(HOST_NAME_KEY, HOSTNAME_VALUE).addData(SPAN_BUILDER_KEY, spanBuilder); final Context updatedContext = openTelemetryTracer.start(METHOD_NAME, traceContext, ProcessKind.SEND); END assertSpanWithExplicitParent(updatedContext, parentSpanId); final ReadableSpan recordEventsSpan = (ReadableSpan) updatedContext.getData(PARENT_SPAN_KEY).get(); assertEquals(Span.Kind.PRODUCER, recordEventsSpan.toSpanData().getKind()); final Map<String, AttributeValue> attributeMap = recordEventsSpan.toSpanData().getAttributes(); verifySpanAttributes(attributeMap); }
Source:
public DonorDeferral getLastDonorDeferral(Long donorId) { List<DonorDeferral> deferrals = getDonorDeferrals(donorId); if (deferrals == null || deferrals.isEmpty()) { return null; } DonorDeferral lastDeferral = deferrals.get(0); Date lastDeferredUntil = lastDeferral.getDeferredUntil(); for (DonorDeferral deferral : deferrals) { if (deferral.getDeferredUntil() != null && deferral.getDeferredUntil().after(lastDeferredUntil)) { lastDeferral = deferral; } } return lastDeferral; }

Target:
public DonorDeferral getLastDonorDeferral(Long donorId) { List<DonorDeferral> deferrals = getDonorDeferrals(donorId); if (deferrals == null || deferrals.isEmpty()) { return null; } DonorDeferral lastDeferral = deferrals.get(0); Date lastDeferredUntil = lastDeferral.getDeferredUntil(); for (DonorDeferral deferral : deferrals) { if (deferral.getDeferredUntil() != null && deferral.getDeferredUntil().after(lastDeferredUntil)) { lastDeferral = deferral; lastDeferredUntil = lastDeferral.getDeferredUntil(); } } return lastDeferral; }
Source:
@Override public boolean isSampled(long ignoredTraceId) { long now = System.nanoTime(); long updateAt = nextUpdate.get(); if (now > updateAt || (updateAt > 0 && now < 0)) { if (nextUpdate.compareAndSet(updateAt, getNextUpdateValue(updateAt))) { usage.set(1); return true; } } return usage.getAndIncrement() < tracesPerSecond; }

Target:
@Override public boolean isSampled(long ignoredTraceId) { long now = System.nanoTime(); long updateAt = nextReset.get(); long nanosUntilReset = -(now - updateAt); boolean shouldReset = nanosUntilReset <= 0; if (shouldReset) { if (nextReset.compareAndSet(updateAt, updateAt + NANOS_PER_SECOND)) { usage.set(0); } } int max = maxFunction.max(shouldReset ? 0 : nanosUntilReset); int prev, next; do { prev = usage.get(); next = prev + 1; if (next > max) return false; } while (!usage.compareAndSet(prev, next)); return true; }
Source:
private void preMerge() throws MergeException, OrmException, InvalidNameException { openBranch(); validateChangeList(); mergeTip = branchTip; final List<MergeStrategySection> refStrategies = new ArrayList<MergeStrategySection>(projectCache.get( destProject.getNameKey()).getLocalMergeStrategySections()); refStrategies.addAll(projectCache.get(destProject.getNameKey()) .getInheritedMergeStrategySections()); final List<MergeStrategySection> refStrategiesMatchers = extractNonMatchersRefStrategies(refStrategies, destBranch.get()); if (refStrategiesMatchers.size() == 0) { throw new MergeException("No Reference Pattern matches : " + destBranch.get()); } else { Collections.sort(refStrategies, new Comparator<MergeStrategySection>() { @Override public int compare(MergeStrategySection a, MergeStrategySection b) { MostSpecificComparator regexComparator = new MostSpecificComparator(destBranch.get()); return regexComparator.compare(a.getName(), b.getName()); } }); final MergeStrategySection mostSpecific = refStrategies.get(0); MergeStrategySection.SubmitType submitType = mostSpecific.getSubmitType(); switch (submitType) { case CHERRY_PICK: cherryPickChanges(); break; case FAST_FORWARD_ONLY: case MERGE_ALWAYS: case MERGE_IF_NECESSARY: default: reduceToMinimalMerge(); mergeTopics(submitType); markCleanMerges(); break; } } }

Target:
private void preMerge() throws MergeException, OrmException, InvalidNameException { openBranch(); validateChangeList(); mergeTip = branchTip; try { final MergeStrategySection mostSpecific = projectCache.get(destProject.getNameKey()) .getMostSpecificMergeStrategy(destBranch.get()); switch (mostSpecific.getSubmitType()) { case CHERRY_PICK: cherryPickChanges(mostSpecific.isUseContentMerge()); break; case FAST_FORWARD_ONLY: case MERGE_ALWAYS: case MERGE_IF_NECESSARY: default: reduceToMinimalMerge(); mergeTopics(mostSpecific.getSubmitType(), mostSpecific.isUseContentMerge()); markCleanMerges(); break; } } catch (NoSuchRefPatternMatches e) { throw new MergeException(e.getMessage()); } }
Source:
public void deleteInvalidPath() throws Exception { if (IS_WIN) { return; } final int NB_QUEUES = 5; Name fooLog = Name.ofUrn("test/foo"); ChronicleLogManager manager = (ChronicleLogManager) createManager(); assertTrue(manager.createIfNotExists(fooLog, NB_QUEUES)); String basePath = manager.getBasePath(); assertTrue(manager.delete(fooLog)); assertTrue(manager.createIfNotExists(fooLog, NB_QUEUES)); Files.createFile(Paths.get(basePath, fooLog.getId(), "foo.txt")); try { manager.delete(fooLog); fail("Cannot delete a Log with external data"); } catch (IllegalArgumentException e) { } }

Target:
public void deleteInvalidPath() throws Exception { org.junit.Assume.assumeFalse(IS_WIN); final int NB_QUEUES = 5; Name fooLog = Name.ofUrn("test/foo"); ChronicleLogManager manager = (ChronicleLogManager) createManager(); assertTrue(manager.createIfNotExists(fooLog, NB_QUEUES)); String basePath = manager.getBasePath(); assertTrue(manager.delete(fooLog)); assertTrue(manager.createIfNotExists(fooLog, NB_QUEUES)); Files.createFile(Paths.get(basePath, fooLog.getId(), "foo.txt")); try { manager.delete(fooLog); fail("Cannot delete a Log with external data"); } catch (IllegalArgumentException e) { } }
Source:
private boolean isAnyProjectConnected() { Project[] openProjects = projectManager.getOpenProjects(); for (Project p : openProjects) { SonarLintProjectSettings projectSettings = SonarLintUtils.get(p, SonarLintProjectSettings.class); if (projectSettings.isBindingEnabled()) { return true; } } return false; }

Target:
private boolean isAnyProjectConnected() { Project[] openProjects = projectManager.getOpenProjects(); return Arrays.stream(openProjects).anyMatch(p -> SonarLintUtils.get(p, SonarLintProjectSettings.class).isBindingEnabled()); }
Source:
private ExpressionNode literalObject(final MethodBuilder builder) throws ProgramDefinitionError { String implicitClassSignature = "objL@" + lexer.getCurrentLineNumber() + "@" + lexer.getCurrentColumn(); SourceSection source = getSource(getCoordinate()); MixinBuilder implicitClassBuilder = new MixinBuilder(builder, AccessModifier.PUBLIC, symbolFor(implicitClassSignature), source, structuralProbe); MethodBuilder primaryFactory = implicitClassBuilder.getPrimaryFactoryMethodBuilder(); primaryFactory.addArgument("self", getEmptySource()); primaryFactory.setSignature(Symbols.NEW); implicitClassBuilder.setupInitializerBasedOnPrimaryFactory(source); inheritanceListAndOrBody(implicitClassBuilder); MixinDefinition mixinDef = implicitClassBuilder.assemble(source); ObjectLiteralNode objectLiteral = new ObjectLiteralNode(mixinDef, builder.getSelfRead(source), source); return SNodeFactory.createMessageSend(symbolFor("new"), new ExpressionNode[] {objectLiteral}, false, source, source); }

Target:
private ExpressionNode literalObject(final MethodBuilder builder) throws ProgramDefinitionError { SourceSection source = getSource(getCoordinate()); SSymbol signature = symbolFor("objL@" + lexer.getCurrentLineNumber() + "@" + lexer.getCurrentColumn()); MixinBuilder classBuilder = new MixinBuilder(builder, AccessModifier.PUBLIC, signature, source, structuralProbe, language); MethodBuilder primaryFactory = classBuilder.getPrimaryFactoryMethodBuilder(); primaryFactory.addArgument("self", getEmptySource()); primaryFactory.setSignature(Symbols.NEW); classBuilder.setupInitializerBasedOnPrimaryFactory(source); inheritanceListAndOrBody(classBuilder); MixinDefinition mixinDef = classBuilder.assemble(source); ExpressionNode outerRead = builder.getSelfRead(source); ExpressionNode newMessage = createMessageSend(symbolFor("new"), new ExpressionNode[] {builder.getSelfRead(source)}, false, source, source, language); return new ObjectLiteralNode(mixinDef, outerRead, newMessage, source); }
Source:
public String[] listPartitionNames(final String topicId) throws NakadiException { return listPartitions(topicId).stream().map(p -> p.getPartitionId()).toArray(String[]::new); }

Target:
public List<String> listPartitionNames(final String topicId) throws NakadiException { return unmodifiableList(listPartitions(topicId).stream().map(p -> p.getPartitionId()).collect(toList())); }
Source:
private void handleScanTimeout(ScanTimeoutException rte) throws IOException { logger.info("The client could not get a response in %d ms. Retrying the scan.", retryOptions.getReadPartialRowTimeoutMillis()); if (currentTimeoutBackoff == null) { currentTimeoutBackoff = new TimeoutRetryBackOff(retryOptions.getMaxScanTimeoutRetries(), BackOff.ZERO_BACKOFF); } currentErrorBackoff = null; backOffAndRetry(currentTimeoutBackoff, rte); }

Target:
private void handleScanTimeout(ScanTimeoutException rte) throws IOException { logger.info("The client could not get a response in %d ms. Retrying the scan.", retryOptions.getReadPartialRowTimeoutMillis()); if (timeoutRetryCount == null) { timeoutRetryCount = new AtomicInteger(); } currentErrorBackoff = null; if (timeoutRetryCount.incrementAndGet() <= retryOptions.getMaxScanTimeoutRetries()) { reissueRequest(); } else { throw new BigtableRetriesExhaustedException( "Exhausted streaming retries after too many timeouts", rte); } }
Source:
public CandidateDTO firstTypeToSecondType(CandidateEntity source) { Assert.notNull(source); CandidateDTO candidateDTO = CandidateDTO.builder() .id(source.getId()) .name(source.getName()) .email(source.getEmail()) .phone(source.getPhone()) .referer(source.getReferer()) .languageSkill(source.getLanguageSkill()) .description(source.getDescription()) .build(); Set<String> positions = new HashSet<>(); List<ApplicationDTO> applicationDTOs = applicationsService.getApplicationsByCandidateDTO(candidateDTO); for (ApplicationDTO applicationDTO : applicationDTOs) { PositionDTO positionDTO = positionService.getPositionById(applicationDTO.getPositionId()); positions.add(positionDTO.getName()); } candidateDTO.setPositions(positions); return candidateDTO; }

Target:
public CandidateDTO firstTypeToSecondType(CandidateEntity source) { Assert.notNull(source); CandidateDTO candidateDTO = CandidateDTO.builder() .id(source.getId()) .name(source.getName()) .email(source.getEmail()) .phone(source.getPhone()) .referer(source.getReferer()) .languageSkill(source.getLanguageSkill()) .description(source.getDescription()) .build(); Set<String> positions = new HashSet<>(); List<Long> positionIds = applicationsService.getApplicationsByCandidateDTO(candidateDTO).stream() .map(application -> application.getPositionId()) .distinct() .collect(Collectors.toList()); if (!positionIds.isEmpty()) { List<String> positionNames = positionService.getPositionsById(positionIds).stream() .map(position -> position.getName()) .collect(Collectors.toList()); positions.addAll(positionNames); } candidateDTO.setPositions(positions); return candidateDTO; }
Source:
public SCMRevisionState calcRevisionsFromBuild(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { EnvVars env = build.getEnvironment(listener); HgExe hg = new HgExe(findInstallation(getInstallation()), getCredentials(build.getParent(), env), launcher, workspaceToNode(workspace), listener, env); try { String tip = hg.tip(workspace2Repo(workspace, env), null); String rev = hg.tipNumber(workspace2Repo(workspace, env), null); String branch = revisionType == RevisionType.TAG ? hg.branch(workspace2Repo(workspace, env), null) : null; return tip != null && rev != null ? new MercurialTagAction(tip, rev, getSubdir(env), branch) : null; } finally { hg.close(); } }

Target:
public SCMRevisionState calcRevisionsFromBuild(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { EnvVars env = build.getEnvironment(listener); HgExe hg = new HgExe(findInstallation(getInstallation()), getCredentials(build.getParent(), env), launcher, workspaceToNode(workspace), listener, env); try { String tip = hg.tip(workspace2Repo(workspace, env), null); String rev = hg.tipNumber(workspace2Repo(workspace, env), null); String branch = revisionType != RevisionType.BRANCH ? hg.branch(workspace2Repo(workspace, env), null) : null; return tip != null && rev != null ? new MercurialTagAction(tip, rev, getSubdir(env), branch) : null; } finally { hg.close(); } }
Source:
public int hashCode() { return Objects.hash(version, id, samFileHeader); }

Target:
public int hashCode() { int result = Objects.hash(version, samFileHeader); result = 31 * result + Arrays.hashCode(id); return result; }
Source:
public void setTouchCalibrationForInputDevice(String inputDeviceDescriptor, int surfaceRotation, TouchCalibration calibration) { if (!checkCallingPermission(android.Manifest.permission.SET_INPUT_CALIBRATION, "setTouchCalibrationForInputDevice()")) { throw new SecurityException("Requires SET_INPUT_CALIBRATION permission"); } if (inputDeviceDescriptor == null) { throw new IllegalArgumentException("inputDeviceDescriptor must not be null"); } if (calibration == null) { throw new IllegalArgumentException("calibration must not be null"); } synchronized (mDataStore) { try { if (mDataStore.setTouchCalibration(inputDeviceDescriptor, surfaceRotation, calibration)) nativeReloadCalibration(mPtr); } finally { mDataStore.saveIfNeeded(); } } }

Target:
public void setTouchCalibrationForInputDevice(String inputDeviceDescriptor, int surfaceRotation, TouchCalibration calibration) { if (!checkCallingPermission(android.Manifest.permission.SET_INPUT_CALIBRATION, "setTouchCalibrationForInputDevice()")) { throw new SecurityException("Requires SET_INPUT_CALIBRATION permission"); } if (inputDeviceDescriptor == null) { throw new IllegalArgumentException("inputDeviceDescriptor must not be null"); } if (calibration == null) { throw new IllegalArgumentException("calibration must not be null"); } if (surfaceRotation < Surface.ROTATION_0 || surfaceRotation > Surface.ROTATION_270) { throw new IllegalArgumentException("surfaceRotation value out of bounds"); } synchronized (mDataStore) { try { if (mDataStore.setTouchCalibration(inputDeviceDescriptor, surfaceRotation, calibration)) { nativeReloadCalibration(mPtr); } } finally { mDataStore.saveIfNeeded(); } } }
Source:
public static void setURLHelperFactory(URLHelperFactory factory) { urlHelperFactory = factory; }

Target:
public static void setURLHelperFactory(URLHelperFactory factory) { if(factory == null) { throw new NullPointerException("Null URLHelperFactory"); } urlHelperFactory = factory; }
Source:
public org.apache.bookkeeper.client.api.LedgerEntry readLastEntry() throws InterruptedException, ExecutionException { long lastEntryId = getLastAddConfirmed(); if (lastEntryId < 0) { return null; } else { return readEntriesInternalAsync(lastEntryId, lastEntryId).get().getEntry(lastEntryId); } }

Target:
public LedgerEntry readLastEntry() throws InterruptedException, BKException { long lastEntryId = getLastAddConfirmed(); if (lastEntryId < 0) { throw new BKException.BKNoSuchEntryException(); } else { CompletableFuture<Enumeration<LedgerEntry>> result = new CompletableFuture<>(); asyncReadEntries(lastEntryId, lastEntryId, new SyncReadCallback(result), null); return SyncCallbackUtils.waitForResult(result).nextElement(); } }
Source:
public Summary create() { if (quantiles != null && quantiles.length > 0) { for (double q : quantiles) { if (q < 0 || q > 1) { throw new IllegalArgumentException("quantile value must be in interval [0, 1]"); } } } for (String label: labelNames) { if (label.equals(QUANTILE_LABEL)) { throw new IllegalStateException("Summary cannot have a label named '" + QUANTILE_LABEL + "'."); } } return new Summary(this); }

Target:
public Summary create() { if (quantiles != null && quantiles.length > 0) { for (double q : quantiles) { if (!isValidQuantile(q)) { throw new IllegalArgumentException("quantile value must be 0 <= q <= 1"); } } } for (String label: labelNames) { if (label.equals(QUANTILE_LABEL)) { throw new IllegalStateException("Summary cannot have a label named '" + QUANTILE_LABEL + "'."); } } dontInitializeNoLabelsChild = true; return new Summary(this); }
Source:
private boolean hasSameThingType(Thing thing) { return Objects.equal(this.getUID().getThingTypeUID(), thing.getThingTypeUID()); }

Target:
private boolean hasSameThingType(Thing thing) { return Objects.equals(this.getUID().getThingTypeUID(), thing.getThingTypeUID()); }
Source:
public UndertowCorruptionHandlerService(UndertowService service, CorruptionHealthCheck healthCheck) { this.delegate = service; this.healthCheck = healthCheck; this.wrapper = handler -> exchange -> { if (healthCheck.isHealthy()) { handler.handleRequest(exchange); } else { exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE); exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/json"); exchange.getResponseSender().send(Constants.CORRUPTION_MESSAGE); exchange.endExchange(); } }; }

Target:
public UndertowCorruptionHandlerService(UndertowService service, CorruptionHealthCheck healthCheck) { this.delegate = service; this.healthCheck = healthCheck; this.wrapper = handler -> exchange -> { if (healthCheck.isHealthy()) { handler.handleRequest(exchange); } else { exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE); exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, "0"); exchange.endExchange(); } }; }
Source:
private LargeServerMessage messageToLargeMessage(Message message) throws Exception { LargeServerMessage lsm = getStorageManager().createLargeMessage(storageManager.generateID(), message); byte[] body = message.getBodyBuffer().toByteBuffer().array(); lsm.addBytes(body); lsm.releaseResources(); lsm.putLongProperty(Message.HDR_LARGE_BODY_SIZE, body.length); return lsm; }

Target:
private LargeServerMessage messageToLargeMessage(Message message) throws Exception { ICoreMessage coreMessage = message.toCore(); LargeServerMessage lsm = getStorageManager().createLargeMessage(storageManager.generateID(), coreMessage); byte[] body = coreMessage.getReadOnlyBodyBuffer().toByteBuffer().array(); lsm.addBytes(body); lsm.releaseResources(); lsm.putLongProperty(Message.HDR_LARGE_BODY_SIZE, body.length); return lsm; }