auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void addTypeAnnotation(ASTRewrite astRewrite, ASTNode target, Annotation newAnnotation, TextEditGroup group) { if (target instanceof AnnotatableType) { AnnotatableType annotatableType= (AnnotatableType) target; <START> if (annotatableType.isNameQualifiedType()) <END> { ListRewrite listRewrite= astRewrite.getListRewrite(annotatableType, NameQualifiedType.ANNOTATIONS_PROPERTY); listRewrite.insertLast(newAnnotation, group); } else if (annotatableType.isSimpleType()) { SimpleType simpleType= (SimpleType) annotatableType; Name name2= simpleType.getName(); assert name2.isQualifiedName(); QualifiedName qualifiedName= (QualifiedName) name2; qualifiedName.getName(); Name qualifier= (Name) ASTNode.copySubtree(astRewrite.getAST(), qualifiedName.getQualifier()); SimpleName name= (SimpleName) ASTNode.copySubtree(astRewrite.getAST(), qualifiedName.getName()); NameQualifiedType nameQualifiedType= astRewrite.getAST().newNameQualifiedType(qualifier, name); nameQualifiedType.annotations().add(newAnnotation); astRewrite.replace(annotatableType, nameQualifiedType, group); } else if (annotatableType.isQualifiedType()) { ListRewrite listRewrite= astRewrite.getListRewrite(annotatableType, QualifiedType.ANNOTATIONS_PROPERTY); listRewrite.insertLast(newAnnotation, group); } } else if (target instanceof Dimension) { Dimension dimension= (Dimension) target; ListRewrite listRewrite= astRewrite.getListRewrite(dimension, Dimension.ANNOTATIONS_PROPERTY); listRewrite.insertLast(newAnnotation, group); } }</code><technical_language>change order of branches show similarity NameQualifiedType ~ QualifiedType</technical_language>

Target:
public static void addTypeAnnotation(ASTRewrite astRewrite, ASTNode target, Annotation newAnnotation, TextEditGroup group) { if (target instanceof AnnotatableType) { AnnotatableType annotatableType= (AnnotatableType) target; if (annotatableType.isSimpleType()) { SimpleType simpleType= (SimpleType) annotatableType; Name name2= simpleType.getName(); assert name2.isQualifiedName(); QualifiedName qualifiedName= (QualifiedName) name2; qualifiedName.getName(); Name qualifier= (Name) astRewrite.createMoveTarget(qualifiedName.getQualifier()); SimpleName name= (SimpleName) astRewrite.createMoveTarget(qualifiedName.getName()); NameQualifiedType nameQualifiedType= astRewrite.getAST().newNameQualifiedType(qualifier, name); nameQualifiedType.annotations().add(newAnnotation); astRewrite.replace(annotatableType, nameQualifiedType, group); } else if (annotatableType.isNameQualifiedType()) { ListRewrite listRewrite= astRewrite.getListRewrite(annotatableType, NameQualifiedType.ANNOTATIONS_PROPERTY); listRewrite.insertLast(newAnnotation, group); } else if (annotatableType.isQualifiedType()) { ListRewrite listRewrite= astRewrite.getListRewrite(annotatableType, QualifiedType.ANNOTATIONS_PROPERTY); listRewrite.insertLast(newAnnotation, group); } } else if (target instanceof Dimension) { Dimension dimension= (Dimension) target; ListRewrite listRewrite= astRewrite.getListRewrite(dimension, Dimension.ANNOTATIONS_PROPERTY); listRewrite.insertLast(newAnnotation, group); } }
Source:
<code>public Collection<SlotOffer> offerSlots( Collection<? extends SlotOffer> offers, TaskManagerLocation taskManagerLocation, TaskManagerGateway taskManagerGateway, long currentTime) { LOG.debug("Received slot offers from TaskExecutor {}.", offers.size(), taskManagerLocation); final Collection<SlotOffer> acceptedSlotOffers = new ArrayList<>(); final Collection<SlotOffer> candidates = new ArrayList<>(); for (SlotOffer offer : offers) { final AllocationID allocationId = offer.getAllocationId(); if (slotPool.containsSlot(allocationId)) { acceptedSlotOffers.add(offer); } else { candidates.add(offer); } } final Collection<SlotOfferMatching> matchings = matchOffersWithOutstandingRequirements(candidates); final Collection<AllocatedSlot> acceptedSlots = new ArrayList<>(); ResourceCounter acceptedResources = ResourceCounter.empty(); <START> for (SlotOfferMatching matching : matchings) { <END> if (matching.getMatching().isPresent()) { final ResourceProfile matchedResourceProfile = matching.getMatching().get(); final AllocatedSlot allocatedSlot = createAllocatedSlot( matching.getSlotOffer(), taskManagerLocation, taskManagerGateway); acceptedSlots.add(allocatedSlot); acceptedSlotOffers.add(matching.getSlotOffer()); acceptedResources = acceptedResources.add(matchedResourceProfile, 1); slotToRequirementProfileMappings.put(allocatedSlot.getAllocationId(), matchedResourceProfile); } } slotPool.addSlots(acceptedSlots, currentTime); increaseAvailableResources(acceptedResources); if (!acceptedSlots.isEmpty()) { notifyNewSlots.accept(acceptedSlots); } return acceptedSlotOffers; }</code><technical_language>then, reuse matchOffersWithOutstandingRequirements in tryToFulfillResourceRequirement</technical_language>

Target:
public Collection<SlotOffer> offerSlots( Collection<? extends SlotOffer> offers, TaskManagerLocation taskManagerLocation, TaskManagerGateway taskManagerGateway, long currentTime) { LOG.debug("Received slot offers from TaskExecutor {}.", offers.size(), taskManagerLocation); final Collection<SlotOffer> acceptedSlotOffers = new ArrayList<>(); final Collection<AllocatedSlot> acceptedSlots = new ArrayList<>(); for (SlotOffer offer : offers) { if (slotPool.containsSlot(offer.getAllocationId())) { acceptedSlotOffers.add(offer); } else { Optional<AllocatedSlot> acceptedSlot = matchOfferWithOutstandingRequirements(offer, taskManagerLocation, taskManagerGateway); if (acceptedSlot.isPresent()) { acceptedSlotOffers.add(offer); acceptedSlots.add(acceptedSlot.get()); } } } slotPool.addSlots(acceptedSlots, currentTime); if (!acceptedSlots.isEmpty()) { notifyNewSlots.accept(acceptedSlots); } return acceptedSlotOffers; }
Source:
<code>public void setError(@NonNull Context context, @Nullable Throwable caught) { Resources resources = context.getResources(); ErrorType errorType = getErrorType(context, caught); icon.setImageDrawable(ContextCompat.getDrawable(context, errorType.icon())); errorText.setText(resources.getString(errorType.text())); button.setText(resources.getString(errorType.buttonText())); button.setOnClickListener(errorType.buttonClickListener(this)); if (errorType.hasFooterText()) { footerText.setText(resources.getString(errorType.footerText())); } <START> if (context instanceof PageActivity) { PageActivity activity = (PageActivity) context; contentTopOffset.setLayoutParams(getContentTopOffsetParams(activity)); contentTopOffset.setVisibility(View.VISIBLE); tabLayoutOffset.setLayoutParams(getTabLayoutOffsetParams(activity)); tabLayoutOffset.setVisibility(View.VISIBLE); } <END> }</code><technical_language>reason this page specific logic live in PageFragment this method is invoked</technical_language>

Target:
public void setError(@NonNull Context context, @Nullable Throwable caught) { Resources resources = context.getResources(); ErrorType errorType = getErrorType(context, caught); icon.setImageDrawable(ContextCompat.getDrawable(context, errorType.icon())); errorText.setText(resources.getString(errorType.text())); button.setText(resources.getString(errorType.buttonText())); button.setOnClickListener(errorType.buttonClickListener(this)); if (errorType.hasFooterText()) { footerText.setText(resources.getString(errorType.footerText())); } }
Source:
<code>public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length != 1) { return false; } if (args[0].equalsIgnoreCase("all") || args[0].equalsIgnoreCase("everyone")) { playerMsg("Correct usage: /opall"); return true; } OfflinePlayer player = null; for (Player onlinePlayer : server.getOnlinePlayers()) { if (args[0].equalsIgnoreCase(onlinePlayer.getName())) { player = onlinePlayer; } } if (player == null) { if (TFM_AdminList.isSuperAdmin(sender) || senderIsConsole) { player = TFM_DepreciationAggregator.getOfflinePlayer(server, args[0]); } else { playerMsg("That player is not online."); playerMsg("You don't have permissions to OP offline players.", ChatColor.YELLOW); return true; } } if (!player.isOp()) + { + TFM_Util.adminAction(sender.getName(), "Opping " + player.getName(), false); + player.setOp(true); + } + else + { <START> + playerMsg("The player you are trying to OP is already OP!"); <END> + } return true; }</code><technical_language>I suggest changing this playerMsg(player.getName() + " is OP!"); (I havent put IDE need to, cleaner I think)</technical_language>

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length != 1) { return false; } if (args[0].equalsIgnoreCase("all") || args[0].equalsIgnoreCase("everyone")) { playerMsg("Correct usage: /opall"); return true; } OfflinePlayer player = null; for (Player onlinePlayer : server.getOnlinePlayers()) { if (args[0].equalsIgnoreCase(onlinePlayer.getName())) { player = onlinePlayer; } } if (player == null) { if (TFM_AdminList.isSuperAdmin(sender) || senderIsConsole) { player = TFM_DepreciationAggregator.getOfflinePlayer(server, args[0]); } else { playerMsg("That player is not online."); playerMsg("You don't have permissions to OP offline players.", ChatColor.YELLOW); return true; } } if (!player.isOp()) { TFM_Util.adminAction(sender.getName(), "Opping " + player.getName(), false); player.setOp(true); } else { playerMsg("The player you are trying to OP is already OP!"); } return true; }
Source:
<code>public void setTasksStatusDown(Process process) { <START> Task currentTask = ServiceManager.getProcessService().getCurrentTask(process); <END> setTaskStatusDown(currentTask); }</code><technical_language>getCurrentTask anymore more current task process</technical_language>

Target:
public void setTasksStatusDown(Process process) { List<Task> currentTask = ServiceManager.getProcessService().getCurrentTasks(process); if (currentTask.isEmpty()) { currentTask = getLastClosedTask(process); } setTaskStatusDown(currentTask); }
Source:
<code>public void parseConfig(List<String> configParts) throws BindingConfigParseException { String address = ""; for (int i = 0; i < configParts.size(); i++) { String paramName = configParts.get(i).split("=")[0].toLowerCase(); String paramValue = configParts.get(i).split("=")[1]; switch (paramName) { case "commandon": commandON = paramValue; break; case "commandoff": commandOFF = paramValue; break; case "address": address = paramValue; break; } } <START> if (!address.equals("")) { <END> logger.warn("The address-parameter is deprecated! Please use just commandOn and commandOff."); logger.warn("type=raw;commandOn={}{};commandOff={}{}", address, commandON, address, commandOFF); commandON = address + commandON; commandOFF = address + commandOFF; } logger.trace("commandON = {}", commandON); logger.trace("commandOFF = {}", commandOFF); }</code><technical_language>StringUtils.isEmpty(address) here</technical_language>

Target:
public void parseConfig(List<String> configParts) throws BindingConfigParseException { String address = ""; for (int i = 0; i < configParts.size(); i++) { String paramName = configParts.get(i).split("=")[0].toLowerCase(); String paramValue = configParts.get(i).split("=")[1]; switch (paramName) { case "commandon": commandON = paramValue; break; case "commandoff": commandOFF = paramValue; break; case "address": address = paramValue; break; } } if (StringUtils.isNotBlank(address)) { logger.warn("The address parameter is deprecated! Please use just commandOn and commandOff."); logger.warn("type=raw;commandOn={}{};commandOff={}{}", address, commandON, address, commandOFF); commandON = address + commandON; commandOFF = address + commandOFF; } logger.trace("commandON = {}", commandON); logger.trace("commandOFF = {}", commandOFF); }
Source:
<code>public static Slice serialize(Geometry geometry) { int spatialReferenceId = geometry.getSRID(); SliceOutput sliceOutput = new DynamicSliceOutput(100); sliceOutput.appendInt(spatialReferenceId); switch (geometry.getGeometryType()) { case JTS_POINT: writePoint((Point) geometry, sliceOutput); break; case JTS_MULTI_POINT: writeMultiPoint((MultiPoint) geometry, sliceOutput); break; case JTS_LINESTRING: case JTS_MULTI_LINESTRING: writePolyline(geometry, sliceOutput); break; case JTS_POLYGON: case JTS_MULTI_POLYGON: writePolygon(geometry, sliceOutput); break; case JTS_GEOMETRY_COLLECTION: for (int i = 0; i < geometry.getNumGeometries(); i++) { Slice slice = serialize(geometry.getGeometryN(i)); <START> sliceOutput.appendBytes(slice.getBytes(4, slice.length() - 4)); <END> } break; } return sliceOutput.slice(); }</code><technical_language>extra new line; please, remove</technical_language>

Target:
public static Slice serialize(Geometry geometry) { SliceOutput output = new DynamicSliceOutput(100); boolean inGeometryCollection = geometry.getGeometryType().equals(JTS_GEOMETRY_COLLECTION); if (inGeometryCollection) { output.writeByte(GeometryUtils.GeometryTypeName.GEOMETRY_COLLECTION.code()); for (int i = 0; i < geometry.getNumGeometries(); i++) { writeGeometry(geometry.getGeometryN(i), output, true); } } else { writeGeometry(geometry, output, false); } return output.slice(); }
Source:
<code>public void showToast(int textId, ToastUtil.ToastType toastType) { <START> if (getActivity() != null) <END> ToastUtil.showShortToast(getActivity(), toastType, getResources().getString(textId)); }</code><technical_language>put braces { } if statement advised <LINK_0></technical_language>

Target:
public void showToast(int textId, ToastUtil.ToastType toastType) { if (getActivity() != null) { ToastUtil.showShortToast(getActivity(), toastType, getResources().getString(textId)); } }
Source:
<code>Options findOptions(Object[] argv) { if (argv == null || argv.length == 0) { return this.options; } <START> return Stream.of(argv).filter(o -> o instanceof Options).findAny().map(o -> (Options) o) <END> .orElse(this.options); }</code><technical_language>I need findAny(). This simplified: java return (Options) Stream.of(argv) .filter(arg -> arg instanceof Options) .findFirst() .orElse(this.options);</technical_language>

Target:
Options findOptions(Object[] argv) { if (argv == null || argv.length == 0) { return this.options; } return (Options) Stream.of(argv) .filter(o -> o instanceof Options) .findFirst() .orElse(this.options); }
Source:
<code>public ScheduledExecutorService createRetryDriverScheduledExecutor(ThriftConnectorConfig config) { <START> return newScheduledThreadPool(config.getMetadataRefreshThreads(), threadsNamed("thrift-retry-driver-%s")); <END> }</code><technical_language>wrong parameter is</technical_language>

Target:
public ListeningScheduledExecutorService createRetryDriverScheduledExecutor(ThriftConnectorConfig config) { return listeningDecorator(newScheduledThreadPool(config.getRetryDriverThreads(), threadsNamed("thrift-retry-driver-%s"))); }
Source:
<code>public MappingJacksonValue get(@PathVariable final String id, @RequestParam(required = false) String attributes) { Group group = scimGroupProvisioning.getById(id); return buildWrapper(group, attributes); <START> <END> }</code><technical_language>Please remove empty line</technical_language>

Target:
public MappingJacksonValue get(@PathVariable final String id, @RequestParam(required = false) String attributes) { Group group = scimGroupProvisioning.getById(id); return buildResponse(group, attributes); }
Source:
<code>public static void waitUntilURLDifferentFrom(String url) { final String refurl = url; <START> log.info("Watch URL: " + refurl); <END> ExpectedCondition<Boolean> urlchanged = d -> { if (d == null) { return false; } String currentUrl = d.getCurrentUrl(); log.debug("Compared with: " + currentUrl); AbstractTest.log.debug("currentUrl is still: " + currentUrl); return !currentUrl.equals(refurl); }; WebDriverWait wait = new WebDriverWait(AbstractTest.driver, URLCHANGE_MAX_WAIT); wait.until(urlchanged); if (AbstractTest.driver.getCurrentUrl().equals(refurl)) { log.warn("Page change failed"); } }</code><technical_language>info level</technical_language>

Target:
public static void waitUntilURLDifferentFrom(String url) { final String refurl = url; AbstractTest.log.debug("Watch URL: " + refurl); ExpectedCondition<Boolean> urlchanged = d -> { if (d == null) { return false; } String currentUrl = d.getCurrentUrl(); AbstractTest.log.debug("currentUrl is still: " + currentUrl); return !currentUrl.equals(refurl); }; WebDriverWait wait = new WebDriverWait(AbstractTest.driver, URLCHANGE_MAX_WAIT); wait.until(urlchanged); if (AbstractTest.driver.getCurrentUrl().equals(refurl)) { AbstractTest.log.warn("Page change failed"); } }
Source:
<code>public void bindingChanged(BindingProvider provider, String itemName) { logger.debug("bindingChanged(): Item Name: {}", itemName); <START> logger.debug("Provider items count: {}", provider.getItemNames().size()); <END> itemUpdateDisabled = true; if (provider.getItemNames().size() >= itemCount) { triggerItemsUpdate = true; } itemCount = provider.getItemNames().size(); super.bindingChanged(provider, itemName); }</code><technical_language>log debug line here</technical_language>

Target:
public void bindingChanged(BindingProvider provider, String itemName) { logger.debug("bindingChanged(): Item Name: Provider items count: {}", itemName, provider.getItemNames().size()); itemUpdateDisabled = true; if (provider.getItemNames().size() >= itemCount) { triggerItemsUpdate = true; } itemCount = provider.getItemNames().size(); super.bindingChanged(provider, itemName); }
Source:
<code>private InfinispanContext(Map<String, String> properties) { this.infinispanConfiguration = new InfinispanConfiguration(); schemaGenerator = new SchemaGenerator(); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer() .host(properties.get(HOST)) .port(Integer.parseInt(properties.get(PORT))) .marshaller(new ProtoStreamMarshaller()) .marshaller(marshaller); cacheManager = new RemoteCacheManager(builder.build()); if (!this.getIndices().contains(TYPES_CACHE)) { cacheManager.administration().createCache(TYPES_CACHE, this.infinispanConfiguration.getConfiguration(TYPES_CACHE)); } if (!this.getIndices().contains(SCHEMAS_CACHE)) { cacheManager.administration().createCache(SCHEMAS_CACHE, this.infinispanConfiguration.getConfiguration(SCHEMAS_CACHE)); } <START> marshaller.registerMarshaller(new KieProtostreamMarshaller.KieMarshallerSupplier<KObject>() { <END> @Override public String extractTypeFromEntity(KObject entity) { return ORG_KIE + AttributesUtil.toProtobufFormat(entity.getClusterId() + "_" + entity.getType().getName()); } @Override public Class<KObject> getJavaClass() { return KObject.class; } @Override public BaseMarshaller<KObject> getMarshallerForType(String typeName) { return new KObjectMarshaller(typeName); } }); SerializationContext serializationContext = ProtoStreamMarshaller.getSerializationContext(cacheManager); addProtobufClass(serializationContext, SCHEMA_PROTO, Schema.class); }</code><technical_language>Is ok ORG_KIE contains dots, escaped</technical_language>

Target:
private InfinispanContext(Map<String, String> properties) { this.infinispanConfiguration = new InfinispanConfiguration(); schemaGenerator = new SchemaGenerator(); cacheManager = this.createRemoteCache(properties); if (!this.getIndices().contains(TYPES_CACHE)) { cacheManager.administration().createCache(TYPES_CACHE, this.infinispanConfiguration.getConfiguration(TYPES_CACHE)); } if (!this.getIndices().contains(SCHEMAS_CACHE)) { cacheManager.administration().createCache(SCHEMAS_CACHE, this.infinispanConfiguration.getConfiguration(SCHEMAS_CACHE)); } marshaller.registerMarshaller(new KieProtostreamMarshaller.KieMarshallerSupplier<KObject>() { @Override public String extractTypeFromEntity(KObject entity) { return ORG_KIE + AttributesUtil.toProtobufFormat(entity.getClusterId() + "_" + entity.getType().getName()); } @Override public Class<KObject> getJavaClass() { return KObject.class; } @Override public BaseMarshaller<KObject> getMarshallerForType(String typeName) { return new KObjectMarshaller(typeName); } }); SerializationContext serializationContext = ProtoStreamMarshaller.getSerializationContext(cacheManager); addProtobufClass(serializationContext, SCHEMA_PROTO, Schema.class); this.loadProtobufSchema(getProtobufCache()); }
Source:
<code>public HistoryTreeStub getHistoryTree() { <START> return (HistoryTreeStub) NonNullUtils.checkNotNull(super.getSHT()); <END> }</code><technical_language>getSHT() null, annotate it</technical_language>

Target:
public HistoryTreeStub getHistoryTree() { return (HistoryTreeStub) super.getSHT(); }
Source:
<code>public String build(StorageAccountParameters storageAccountParameters) { try { Map<String, Object> model = new HashMap<>(); model.put("storageAccountName", storageAccountParameters.getStorageAccountName()); model.put("location", storageAccountParameters.getStorageLocation()); model.put("skuName", storageAccountParameters.getStorageAccountSkuType().name().toString()); model.put("encrypted", storageAccountParameters.getEncrypted()); model.put("userDefinedTags", storageAccountParameters.getTags()); String generatedTemplate = freeMarkerTemplateUtils.processTemplateIntoString(getTemplate(), model); <START> LOGGER.info("Generated stroage account Arm template: {}", generatedTemplate); <END> return generatedTemplate; } catch (IOException | TemplateException e) { throw new CloudConnectorException("Failed to process the storage account ARM Template", e); } }</code><technical_language>typo</technical_language>

Target:
public String build(StorageAccountParameters storageAccountParameters) { try { Map<String, Object> model = new HashMap<>(); model.put("storageAccountName", storageAccountParameters.getStorageAccountName()); model.put("location", storageAccountParameters.getStorageLocation()); model.put("skuName", storageAccountParameters.getStorageAccountSkuType().name().toString()); model.put("encrypted", storageAccountParameters.getEncrypted()); model.put("userDefinedTags", storageAccountParameters.getTags()); String generatedTemplate = freeMarkerTemplateUtils.processTemplateIntoString(azureStorageAccoutTemplateProviderService.getTemplate(), model); LOGGER.info("Generated storage account Arm template: {}", generatedTemplate); return generatedTemplate; } catch (IOException | TemplateException e) { throw new CloudConnectorException("Failed to process the storage account ARM Template", e); } }
Source:
<code>public ApiAuthenticationResult authenticate(HttpServletRequest httpServletRequest) { Assert.notNull(httpServletRequest, "httpRequest argument cannot be null."); Assert.isInstanceOf(javax.servlet.http.HttpServletRequest.class, httpServletRequest, "The specified httpRequest argument must be an instance of " + HTTP_SERVLET_REQUEST_FQCN); com.stormpath.sdk.impl.http.ServletHttpRequest stmpHttpRequest = new com.stormpath.sdk.impl.http.ServletHttpRequest(httpServletRequest); <START> return (ApiAuthenticationResult) Applications.apiRequestAuthenticator(application).authenticate(stmpHttpRequest); <END> }</code><technical_language>ApiAuthenticationResult casting redundant</technical_language>

Target:
public ApiAuthenticationResult authenticate(HttpServletRequest httpServletRequest) { Assert.notNull(httpServletRequest, "httpRequest argument cannot be null."); Assert.isInstanceOf(javax.servlet.http.HttpServletRequest.class, httpServletRequest, "The specified httpRequest argument must be an instance of " + HTTP_SERVLET_REQUEST_FQCN); com.stormpath.sdk.impl.http.ServletHttpRequest stmpHttpRequest = new com.stormpath.sdk.impl.http.ServletHttpRequest(httpServletRequest); return Applications.apiRequestAuthenticator(application).authenticate(stmpHttpRequest); }
Source:
<code>public static List<Integer> expandVlanUri(final String vlanAuthority) { final List<Integer> expandedVlans = new ArrayList<>(); if (vlanAuthority == null || vlanAuthority.isEmpty()) { return expandedVlans; } for (final String vlanPart: vlanAuthority.split(",")) { if (vlanPart == null || vlanPart.isEmpty()) { continue; } final String[] range = vlanPart.split("-"); if (range.length == 2) { Integer start = NumbersUtil.parseInt(range[0], -1); Integer end = NumbersUtil.parseInt(range[1], -1); if (start <= end && end > -1 && start > -1) { while (start <= end) { expandedVlans.add(start++); } } } else { final Integer value = NumbersUtil.parseInt(range[0], -1); if (value > -1) { expandedVlans.add(value); <START> } <END> } } return expandedVlans; }</code><technical_language>a debug message rejecting this value, displaying of range[0], in case range[0] is a number method returns -1</technical_language>

Target:
public static List<Integer> expandVlanUri(final String vlanAuthority) { final List<Integer> expandedVlans = new ArrayList<>(); if (Strings.isNullOrEmpty(vlanAuthority)) { return expandedVlans; } for (final String vlanPart: vlanAuthority.split(",")) { if (Strings.isNullOrEmpty(vlanPart)) { continue; } final String[] range = vlanPart.split("-"); if (range.length == 2) { Integer start = NumbersUtil.parseInt(range[0], -1); Integer end = NumbersUtil.parseInt(range[1], -1); if (start <= end && end > -1 && start > -1) { while (start <= end) { expandedVlans.add(start++); } } } else { final Integer value = NumbersUtil.parseInt(range[0], -1); if (value > -1) { expandedVlans.add(value); } } } return expandedVlans; }
Source:
<code>private boolean validteHostsNumaCompatiblity(final Guid srcHost, final Guid destHost, final List<String> errMsgList){ List<Guid> srcHostList = <START> new LinkedList<Guid>(){{add(srcHost);}}; <END> List<Guid> destHostList = new LinkedList<Guid>(){{add(destHost);}}; return validator.areHostListsNumaCompatible(srcHostList, destHostList, errMsgList); }</code><technical_language>instance initializer is valid, I find readable simply Arrays.asList({srcHost})</technical_language>

Target:
private void validteHostsNumaCompatiblity(final Guid srcHost, final Guid destHost, final List<String> errMsgList){ assertTrue(hostsNumaCompatiblity(srcHost, destHost, errMsgList)); }
Source:
<code>private void init () { short[] indices = new short[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7, 0, 8, 1, 8, 2, 8, 3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 17, 17, 18, 19, 2, 2, 3, 3, 19}; int maxVertices = 20; mesh = new Mesh(false, maxVertices, indices.length, new VertexAttribute(Usage.Position, 3, "a_position"), new VertexAttribute( <START> Usage.ColorUnpacked, 4, "a_color")); <END> vertices = new float[maxVertices * (mesh.getVertexSize() / 4)]; mesh.setIndices(indices, 0, indices.length); }</code><technical_language>ColorPacked</technical_language>

Target:
private void init () { short[] indices = new short[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7, 0, 8, 1, 8, 2, 8, 3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 17, 17, 18, 19, 2, 2, 3, 3, 19}; int maxVertices = 20; mesh = new Mesh(false, maxVertices, indices.length, new VertexAttribute(Usage.Position, 3, "a_position"), new VertexAttribute(Usage.ColorPacked, 4, "a_color")); mesh.setIndices(indices, 0, indices.length); vertices = new float[maxVertices * (mesh.getVertexSize() / 4)]; renderable.meshPart.mesh = mesh; renderable.meshPart.offset = 0; renderable.meshPart.size = mesh.getNumIndices(); renderable.meshPart.primitiveType = GL20.GL_LINES; renderable.material = new Material(); }
Source:
<code>public void doAfterTest() throws Exception { <START> getGDBLaunch().terminate(); <END> fBreakpointService = null; fTraceService = null; fBreakpointsDmc = null; fTraceTargetDmc = null; if (fServicesTracker != null) { fServicesTracker.dispose(); fServicesTracker = null; } super.doAfterTest(); }</code><technical_language>This is done super.doAfterTest();</technical_language>

Target:
public void doAfterTest() throws Exception { super.doAfterTest(); fBreakpointService = null; fTraceService = null; fBreakpointsDmc = null; fTraceTargetDmc = null; if (fServicesTracker != null) { fServicesTracker.dispose(); fServicesTracker = null; } }
Source:
<code>public void updateParticipantTransfersSubstudyIdsForAdmins() { Set<String> substudies = ImmutableSet.of("substudyA", "substudyB"); StudyParticipant participant = mockSubstudiesInRequest(substudies, substudies, Roles.ADMIN); mockHealthCodeAndAccountRetrieval(); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyC", ID)); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyA", ID)); participantService.updateParticipant(STUDY, participant); <START> verify(accountDao).updateAccount(accountCaptor.capture(), any()); <END> Set<AccountSubstudy> accountSubstudies = accountCaptor.getValue().getAccountSubstudies(); assertEquals(2, accountSubstudies.size()); accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyA")).findAny().get(); accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyB")).findAny().get(); }</code><technical_language>this test</technical_language>

Target:
public void updateParticipantTransfersSubstudyIdsForAdmins() { Set<String> substudies = ImmutableSet.of("substudyA", "substudyB"); StudyParticipant participant = mockSubstudiesInRequest(substudies, substudies, Roles.ADMIN); mockHealthCodeAndAccountRetrieval(); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyC", ID)); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyA", ID)); participantService.updateParticipant(STUDY, participant); verify(accountDao).updateAccount(accountCaptor.capture(), eq(null)); Set<AccountSubstudy> accountSubstudies = accountCaptor.getValue().getAccountSubstudies(); assertEquals(2, accountSubstudies.size()); accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyA")).findAny().get(); accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyB")).findAny().get(); }
Source:
<code>public void setExpiryPolicy(Set<? extends K> keys, ExpiryPolicy expiryPolicy) { ensureOpen(); validateNotNull(keys); validateNotNull(expiryPolicy); try { int partitionCount = partitionService.getPartitionCount(); List<Data>[] keysPerPartition = groupDataToPartitions(keys, partitionCount); <START> setTTLAllPartitionsAndWaitForCompletion(keysPerPartition, serializationService.toData(expiryPolicy)); <END> } catch (Exception e) { rethrow(e); } }</code><technical_language>check cluster version immediately throw UnsupportedOperationException if < V3.11</technical_language>

Target:
public void setExpiryPolicy(Set<? extends K> keys, ExpiryPolicy expiryPolicy) { if (isClusterVersionLessThan(Versions.V3_11)) { throw new UnsupportedOperationException("setExpiryPolicy operation is available" + "when cluster version is 3.11 or higher"); } ensureOpen(); validateNotNull(keys); validateNotNull(expiryPolicy); try { int partitionCount = partitionService.getPartitionCount(); List<Data>[] keysPerPartition = groupDataToPartitions(keys, partitionCount); setTTLAllPartitionsAndWaitForCompletion(keysPerPartition, serializationService.toData(expiryPolicy)); } catch (Exception e) { rethrow(e); } }
Source:
<code>private void setClusterProperties() { tearDownMiniClusterAsync(1); clientProps.put(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, <START> Boolean.toString(true)); <END> clientProps.put(QueryServices.IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE, Boolean.toString(true)); serverProps.putAll(clientProps); clientProps.put(QueryServices.INDEX_REGION_OBSERVER_ENABLED_ATTRIB, Boolean.toString(!upgrade)); }</code><technical_language>Namespaces enabled default, right? set false instead</technical_language>

Target:
private void setClusterProperties() { if (Boolean.toString(upgrade).equals(clientProps .get(QueryServices.INDEX_REGION_OBSERVER_ENABLED_ATTRIB)) || Boolean.toString(!isNamespaceEnabled).equals(serverProps .get(QueryServices.IS_NAMESPACE_MAPPING_ENABLED))) { tearDownMiniClusterAsync(1); } clientProps.put(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(isNamespaceEnabled)); clientProps.put(QueryServices.IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE, Boolean.toString(isNamespaceEnabled)); serverProps.putAll(clientProps); clientProps.put(QueryServices.INDEX_REGION_OBSERVER_ENABLED_ATTRIB, Boolean.toString(!upgrade)); }
Source:
<code>public void testTimeoutsConfigured() throws Exception { final DatabaseEngine de = DatabaseFactory.getConnection(this.dbProps); int loginTimeoutInSeconds = DriverManager.getLoginTimeout(); int socketConnectionTimeoutInMs = de.getConnection().getNetworkTimeout(); int checkConnectionTimeoutInMs = de.getProperties().getCheckConnectionTimeout(); assertEquals("Is the login timeout of the DB connection the expected?", LOGIN_TIMEOUT_SECONDS, loginTimeoutInSeconds); assertEquals("Is the socket timeout of the DB connection the expected?", TimeUnit.SECONDS.toMillis(SOCKET_TIMEOUT_SECONDS), socketConnectionTimeoutInMs); <START> assertEquals("Is the check connection timeout of the DB connection the expected?", TimeUnit.SECONDS.toSeconds(CHECK_CONNECTION_TIMEOUT_SECONDS), checkConnectionTimeoutInMs); <END> }</code><technical_language>Connection timeout config is PDB stuff, "in milliseconds", checkConnectionTimeoutInMs named accordingly. Also, name implies, CHECK_CONNECTION_TIMEOUT_SECONDS is seconds, need convert seconds seconds :smile: suggestion assertEquals("Is check connection timeout of DB connection expected?", CHECK_CONNECTION_TIMEOUT_SECONDS, checkConnectionTimeout);</technical_language>

Target:
public void testTimeoutsConfigured() throws Exception { final DatabaseEngine de = DatabaseFactory.getConnection(this.dbProps); int loginTimeoutInSeconds = DriverManager.getLoginTimeout(); int socketConnectionTimeoutInMs = de.getConnection().getNetworkTimeout(); int checkConnectionTimeoutInSec = de.getProperties().getCheckConnectionTimeout(); assertEquals("Is the login timeout of the DB connection the expected?", LOGIN_TIMEOUT_SECONDS, loginTimeoutInSeconds); assertEquals("Is the socket timeout of the DB connection the expected?", TimeUnit.SECONDS.toMillis(SOCKET_TIMEOUT_SECONDS), socketConnectionTimeoutInMs); assertEquals("Is the check connection timeout of the DB connection the expected?", CHECK_CONNECTION_TIMEOUT_SECONDS, checkConnectionTimeoutInSec); }
Source:
<code>private IASTName buildName(int destructorOffset, IToken nt, boolean keywordTemplate) { IASTName name; if (destructorOffset < 0) { <START> name= keywordTemplate ? getNodeFactory().newTemplateName(nt.getCharImage()) : getNodeFactory().newName(nt.getCharImage()); <END> setRange(name, nt.getOffset(), nt.getEndOffset()); } else { char[] nchars= nt.getCharImage(); final int len= nchars.length; char[] image = new char[len + 1]; image[0]= '~'; System.arraycopy(nchars, 0, image, 1, len); name= keywordTemplate ? getNodeFactory().newTemplateName(image) : getNodeFactory().newName(image); setRange(name, destructorOffset, nt.getEndOffset()); } switch (nt.getType()) { case IToken.tEOC: case IToken.tCOMPLETION: createCompletionNode(nt).addName(name); break; } return name; }</code><technical_language>Please wrap line respect a 110 character line length limit. (You if/else.)</technical_language>

Target:
private IASTName buildName(int destructorOffset, IToken nt, boolean keywordTemplate) { IASTName name; if (destructorOffset < 0) { if (keywordTemplate) { name= getNodeFactory().newTemplateName(nt.getCharImage()); } else { name= getNodeFactory().newName(nt.getCharImage()); } setRange(name, nt.getOffset(), nt.getEndOffset()); } else { char[] nchars= nt.getCharImage(); final int len= nchars.length; char[] image = new char[len + 1]; image[0]= '~'; System.arraycopy(nchars, 0, image, 1, len); name= getNodeFactory().newName(image); setRange(name, destructorOffset, nt.getEndOffset()); } switch (nt.getType()) { case IToken.tEOC: case IToken.tCOMPLETION: createCompletionNode(nt).addName(name); break; } return name; }
Source:
<code>public LiveData<List<Feedback>> getFeedback() { if (feedbackList == null) { LiveRealmData<Feedback> feedbackLiveRealmData = RealmDataRepository.asLiveData(realmRepo.getFeedbacks()); <START> feedbackList = Transformations.map(feedbackLiveRealmData, input -> input); <END> } return feedbackList; }</code><technical_language>Why</technical_language>

Target:
public LiveRealmData<Feedback> getFeedback() { if (feedbackLiveRealmData == null) { feedbackLiveRealmData = RealmDataRepository.asLiveData(realmRepo.getFeedbacks()); } return feedbackLiveRealmData; }
Source:
<code>public static Node<View, Edge> getDockSourceNode(final Node<? extends View, ?> node) { return (Node<View, Edge>) node .getInEdges() .stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .findFirst() <START> .orElse(null); <END> }</code><technical_language>returning Optional<Node></technical_language>

Target:
public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { Map<String, String> m = new HashMap<String, String>(); rec = DineOnReceiver.createDineOnRecevier( this.getClass().getMethod("onCheckInCallback", m.getClass()), this, this.getClass(), "uw.cse.dineon.user.CONFIRM_DINING_SESSION", "uw.cse.dineon.user." + ParseUser.getCurrentUser().getUsername()); } catch (NoSuchMethodException e) { Log.d(TAG, "Error: " + e.getMessage()); } <START> <END> if(savedInstanceState != null) { Intent i = getIntent(); if(i != null) { mUser = (User) savedInstanceState.get(DineOnConstants.KEY_USER); if(mUser == null) { showAlertNotLoggedIn(); } } } }</code><technical_language>savedinstancestate bundle getIntent I things. Im mixing here</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { rec = DineOnReceiver.createDineOnReceiver(this.getClass().getMethod("onCheckInCallback", Map.class)); } catch (NoSuchMethodException e) { Log.d(TAG, "Error: " + e.getMessage()); } }
Source:
<code>protected void assertValidation(IType expectedReturnTypes[], IType expectedAllReturnTypes[], String serviceName, IType parameterTypes[]) { final IService service = serviceLookUp(serviceName, parameterTypes); <START> assertTrue("Service not found.", service != null); <END> Set<IType> types = service.getType(getValidationServices(), getQueryEnvironment(), Arrays .asList(parameterTypes)); assertEquals(expectedReturnTypes.length, types.size()); int i = 0; for (IType type : types) { assertEqualsITypes(expectedReturnTypes[i++], type); } final Map<List<IType>, Set<IType>> allTypes = new LinkedHashMap<List<IType>, Set<IType>>(); allTypes.put(Arrays.asList(parameterTypes), types); types = service.validateAllType(getValidationServices(), getQueryEnvironment(), allTypes); assertEquals(expectedAllReturnTypes.length, types.size()); i = 0; for (IType type : types) { assertEqualsITypes(expectedAllReturnTypes[i++], type); } }</code><technical_language>assertNull</technical_language>

Target:
protected void assertValidation(IType expectedReturnTypes[], IType expectedAllReturnTypes[], String serviceName, IType parameterTypes[]) { final IService service = serviceLookUp(serviceName, parameterTypes); assertNotNull("Service not found.", service != null); Set<IType> types = service.getType(getValidationServices(), getQueryEnvironment(), Arrays .asList(parameterTypes)); assertEquals(expectedReturnTypes.length, types.size()); int i = 0; for (IType type : types) { assertEqualsITypes(expectedReturnTypes[i++], type); } final Map<List<IType>, Set<IType>> allTypes = new LinkedHashMap<List<IType>, Set<IType>>(); allTypes.put(Arrays.asList(parameterTypes), types); types = service.validateAllType(getValidationServices(), getQueryEnvironment(), allTypes); assertEquals(expectedAllReturnTypes.length, types.size()); i = 0; for (IType type : types) { assertEqualsITypes(expectedAllReturnTypes[i++], type); } }
Source:
<code>public void writeStepdefsJson(List<String> featurePaths, URL dotCucumber) throws IOException { if (dotCucumber != null) { <START> List<CucumberFeature> features = load(new FileResourceLoader(), featurePaths, NO_FILTERS, null); <END> List<MetaStepdef> metaStepdefs = new StepdefGenerator().generate(stepDefinitionsByPattern.values(), features); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String json = gson.toJson(metaStepdefs); Writer stepdefsJson = new UTF8OutputStreamWriter(new URLOutputStream(new URL(dotCucumber, "stepdefs.json"))); stepdefsJson.append(json); stepdefsJson.close(); } }</code><technical_language>is **null** for? overload method</technical_language>

Target:
public void writeStepdefsJson(List<String> featurePaths, URL dotCucumber) throws IOException { if (dotCucumber != null) { List<CucumberFeature> features = load(new FileResourceLoader(), featurePaths, NO_FILTERS); List<MetaStepdef> metaStepdefs = new StepdefGenerator().generate(stepDefinitionsByPattern.values(), features); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String json = gson.toJson(metaStepdefs); Writer stepdefsJson = new UTF8OutputStreamWriter(new URLOutputStream(new URL(dotCucumber, "stepdefs.json"))); stepdefsJson.append(json); stepdefsJson.close(); } }
Source:
<code>public Node visitKeywordSend(KeywordSendContext ctx) { StatNode statement = (StatNode) visit(ctx.stmt()); String selector = ""; List<ExprNode> arguments = new ArrayList<>(); for (int i = 0; i < ctx.ID().size(); i += 1) { <START> selector += ctx.ID(i) + ":"; <END> arguments.add((ExprNode) visit(ctx.expr(i))); } return new SendNode(statement, selector, arguments); }</code><technical_language>nicer be: foo bar: spam:eggs: for zero-, one- n-argument methods, respectively, this matches App.mangle does</technical_language>

Target:
public Node visitKeywordSend(KeywordSendContext ctx) { ExprNode expression = (ExprNode) visit(ctx.expr()); String selector = buildSelector(ctx.ID()); List<ExprNode> arguments = visitExprArguments(ctx.subexpr()); return new SendNode(expression, selector, arguments); }
Source:
<code>private RepositoryCache() { cacheMap = new ConcurrentHashMap<Key, Reference<Repository>>(); openLocks = new Lock[4]; for (int i = 0; i < openLocks.length; i++) openLocks[i] = new Lock(); Runnable terminator = new Runnable() { @Override public void run() { try { for (Reference<Repository> ref : cache.cacheMap.values()) { Repository repository = ref.get(); if (repository != null) { <START> if (repository.useCnt.get() == 0 && (System.currentTimeMillis() - repository.closedAt.get() > 20000)) { RepositoryCache.close(repository); <END> } } } } catch (Throwable e) { LOG.error(e.getMessage(), e); } } }; AlarmQueue.getExecutor().scheduleWithFixedDelay(terminator, 10, 10, TimeUnit.SECONDS); }</code><technical_language>is a window of vulnerability useCnt == 0 check acquiring lock in line 273. detect useCnt zero another thread open repo increase useCnt. unregisterAndCloseRepository unconditionally close repo. Proposal: check for useCnt == 0 need repeated lock is acquired (between lines 273-274)</technical_language>

Target:
private RepositoryCache() { cacheMap = new ConcurrentHashMap<Key, Reference<Repository>>(); openLocks = new Lock[4]; for (int i = 0; i < openLocks.length; i++) { openLocks[i] = new Lock(); } Runnable terminator = new Runnable() { @Override public void run() { try { for (Reference<Repository> ref : cache.cacheMap .values()) { Repository db = ref.get(); if (db != null && isExpired(db)) { RepositoryCache.close(db); } } } catch (Throwable e) { LOG.error(e.getMessage(), e); } } private boolean isExpired(Repository db) { return db.useCnt.get() == 0 && (System.currentTimeMillis() - db.closedAt.get() > 20000); } }; WorkQueue.getExecutor().scheduleWithFixedDelay(terminator, 10, 10, TimeUnit.SECONDS); }
Source:
<code>public void testPushWhenLocalRepositoryIsUpToDate(GitConnectionFactory connectionFactory) throws IOException, ServerException, URISyntaxException, UnauthorizedException { GitConnection remoteConnection = connectToGitRepositoryWithContent(connectionFactory, repository); GitConnection localConnection = connectionFactory.getConnection(remoteRepo.getAbsolutePath()); localConnection.clone(newDto(CloneRequest.class).withRemoteUri(remoteConnection.getWorkingDir().getAbsolutePath())); PushResponse pushResponse = localConnection.push(newDto(PushRequest.class) .withRefSpec( <START> Collections.singletonList("refs/heads/master:refs/heads/master")) <END> .withRemote("origin") .withTimeout(-1)); assertEquals(pushResponse.getCommandOutput(), "Everything up-to-date"); }</code><technical_language>static import for singletonList change line please</technical_language>

Target:
public void testPushWhenLocalRepositoryIsUpToDate(GitConnectionFactory connectionFactory) throws IOException, ServerException, URISyntaxException, UnauthorizedException { GitConnection remoteConnection = connectToGitRepositoryWithContent(connectionFactory, repository); GitConnection localConnection = connectionFactory.getConnection(remoteRepo.getAbsolutePath()); localConnection.clone(newDto(CloneRequest.class).withRemoteUri(remoteConnection.getWorkingDir().getAbsolutePath())); PushResponse pushResponse = localConnection.push(newDto(PushRequest.class) .withRefSpec(singletonList("refs/heads/master:refs/heads/master")) .withRemote("origin") .withTimeout(-1)); assertEquals(pushResponse.getCommandOutput(), "Everything up-to-date"); }
Source:
<code>protected String inputListToIterate() { <START> return contractInput.eContainer() != null && parentBusinessObject != null && withComplexMultipleInHierarchy().apply(contractInput) <END> ? iteratorName(parentBusinessObject) + "." + Joiner.on(".").join(toAncestorNameListUntilMultipleComplex().apply(contractInput)) : super.inputListToIterate(); }</code><technical_language>if/else statements, I feel statements long readable</technical_language>

Target:
protected String inputListToIterate() { return shouldUseParentIterator() ? buildListAccessorWithIteratorName() : super.inputListToIterate(); }
Source:
<code>protected static void clipForOverlappingReads(final SAMRecord read1, final SAMRecord read2, final boolean useHardClipping) { if (!(read1.getReadUnmappedFlag() || read2.getReadUnmappedFlag())) { if (read1.getReadNegativeStrandFlag() != read2.getReadNegativeStrandFlag()) { final SAMRecord pos = (read1.getReadNegativeStrandFlag()) ? read2 : read1; final SAMRecord neg = (read1.getReadNegativeStrandFlag()) ? read1 : read2; if (pos.getAlignmentStart() < neg.getAlignmentEnd()) { final int posClipFrom = getDistanceFrom3PrimeEndToClipFrom(pos, neg.getUnclippedEnd() + 1); final int negClipFrom = getDistanceFrom3PrimeEndToClipFrom(neg, pos.getUnclippedStart() - 1); <START> final CigarOperator clippingOperator = useHardClipping ? CigarOperator.HARD_CLIP : CigarOperator.SOFT_CLIP; <END> if(posClipFrom > 0) { clipRead(pos, posClipFrom, useHardClipping); } if(negClipFrom > 0) { clipRead(neg, negClipFrom, useHardClipping); } } } } }</code><technical_language>is clippingOperator elsewhere</technical_language>

Target:
protected static void clipForOverlappingReads(final SAMRecord read1, final SAMRecord read2, final boolean useHardClipping) { if (!(read1.getReadUnmappedFlag() || read2.getReadUnmappedFlag())) { if (read1.getReadNegativeStrandFlag() != read2.getReadNegativeStrandFlag()) { final SAMRecord pos = (read1.getReadNegativeStrandFlag()) ? read2 : read1; final SAMRecord neg = (read1.getReadNegativeStrandFlag()) ? read1 : read2; if (pos.getAlignmentStart() < neg.getAlignmentEnd()) { final int posClipFrom = getReadPositionAtReferencePositionIgnoreSoftClips(pos, neg.getUnclippedEnd() + 1); int negClipFrom = getReadPositionAtReferencePositionIgnoreSoftClips(neg, pos.getUnclippedStart() - 1); negClipFrom = negClipFrom > 0 ? (neg.getReadLength() + 1) - negClipFrom : 0; if(posClipFrom > 0) { clip3PrimeEndOfRead(pos, posClipFrom, useHardClipping); } if(negClipFrom > 0) { clip3PrimeEndOfRead(neg, negClipFrom, useHardClipping); } } } } }