auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void executeQuery() { if (results == null) { validateNamedParameters(); QueryOperation op = cache.getOperationsFactory().newQueryOperation(this, cache.getDataFormat()); Object response = await(op.execute()); if (response instanceof QueryResponse) { QueryResponse resp = (QueryResponse) response; totalResults = (int) resp.getTotalResults(); results = unwrapResults(resp.getProjectionSize(), resp.getResults()); } <START> if (response instanceof JsonObject) { <END> JsonObject resp = (JsonObject) response; totalResults = resp.get(JSON_TOTAL_RESULTS).getAsInt(); JsonArray hits = resp.get(JSON_HITS).getAsJsonArray(); results = stream(hits.spliterator(), false) .map(hit -> hit.getAsJsonObject().get(JSON_HIT).toString()) .collect(Collectors.toList()); } } }</code><technical_language>else here</technical_language>

Target:
private void executeQuery() { if (results == null) { validateNamedParameters(); QueryOperation op = cache.getOperationsFactory().newQueryOperation(this, cache.getDataFormat()); BaseQueryResponse response = (BaseQueryResponse) await(op.execute()); totalResults = (int) response.getTotalResults(); try { results = response.extractResults(serializationContext); } catch (IOException e) { throw new HotRodClientException(e); } } }
Source:
<code>public void purge(Condition condition, RequestContext requestContext) throws ResponseException { <START> Context.getConditionService().purgeService(condition); <END> }</code><technical_language>real method in ConditionService</technical_language>

Target:
public void purge(Condition condition, RequestContext requestContext) throws ResponseException { conditionService.purgeCondition(condition); }
Source:
<code>public boolean run() { List<Jobby> jobs = Lists.newArrayList(); ensurePaths(); if (config.isDeterminingPartitions()) { <START> if(config.getPartitionDimension() == null){ <END> jobs.add(new DetermineHashedPartitionsJob(config)); } else { jobs.add(new DeterminePartitionsJob(config)); } } else { Map<DateTime, List<HadoopyShardSpec>> shardSpecs = Maps.newTreeMap(DateTimeComparator.getInstance()); int shardCount = 0; for (Interval segmentGranularity : config.getSegmentGranularIntervals()) { DateTime bucket = segmentGranularity.getStart(); final HadoopyShardSpec spec = new HadoopyShardSpec(new NoneShardSpec(), shardCount++); shardSpecs.put(bucket, Lists.newArrayList(spec)); log.info("DateTime[%s], spec[%s]", bucket, spec); } config.setShardSpecs(shardSpecs); } indexJob = new IndexGeneratorJob(config); jobs.add(indexJob); if (dbUpdaterJob != null) { jobs.add(dbUpdaterJob); } else { log.info("No updaterJobSpec set, not uploading to database"); } String failedMessage = null; for (Jobby job : jobs) { if (failedMessage == null) { if (!job.run()) { failedMessage = String.format("Job[%s] failed!", job.getClass()); } } } if (failedMessage == null) { publishedSegments = IndexGeneratorJob.getPublishedSegments(config); } if (!config.isLeaveIntermediate()) { if (failedMessage == null || config.isCleanupOnFailure()) { Path workingPath = config.makeIntermediatePath(); log.info("Deleting path[%s]", workingPath); try { workingPath.getFileSystem(new Configuration()).delete(workingPath, true); } catch (IOException e) { log.error(e, "Failed to cleanup path[%s]", workingPath); } } } if (failedMessage != null) { throw new ISE(failedMessage); } return true; }</code><technical_language>This a good switching mechanism, partitionDimension null partitioning dimensions. (It automatically determined)</technical_language>

Target:
public boolean run() { List<Jobby> jobs = Lists.newArrayList(); JobHelper.ensurePaths(config); indexJob = new IndexGeneratorJob(config); jobs.add(indexJob); if (dbUpdaterJob != null) { jobs.add(dbUpdaterJob); } else { log.info("No updaterJobSpec set, not uploading to database"); } JobHelper.runJobs(jobs, config); publishedSegments = IndexGeneratorJob.getPublishedSegments(config); return true; }
Source:
<code>public void onPageFinishedLoading(String url) { LOG.d(TAG, "onPageFinished(" + url + ")"); clearLoadTimeoutTimer(); <START> cordova.onCordovaInit(pluginManager); <END> pluginManager.postMessage("onPageFinished", url); if (engine.getView().getVisibility() != View.VISIBLE) { Thread t = new Thread(new Runnable() { public void run() { try { Thread.sleep(2000); cordova.getActivity().runOnUiThread(new Runnable() { public void run() { pluginManager.postMessage("spinner", "stop"); } }); } catch (InterruptedException e) { } } }); t.start(); } if (url.equals("about:blank")) { pluginManager.postMessage("exit", null); } }</code><technical_language>sense wait onPageFinished dispatch onCordovaInit. dispatch end of .init() function? If concern is want able communicate JS, I onPageFinished guarantees that. Instead, plugin wait for exec() in JS in order communicate start-up</technical_language>

Target:
public void onPageFinishedLoading(String url) { LOG.d(TAG, "onPageFinished(" + url + ")"); clearLoadTimeoutTimer(); pluginManager.postMessage("onPageFinished", url); if (engine.getView().getVisibility() != View.VISIBLE) { Thread t = new Thread(new Runnable() { public void run() { try { Thread.sleep(2000); cordova.getActivity().runOnUiThread(new Runnable() { public void run() { pluginManager.postMessage("spinner", "stop"); } }); } catch (InterruptedException e) { } } }); t.start(); } if (url.equals("about:blank")) { pluginManager.postMessage("exit", null); } }
Source:
<code>public MistWatermarkEvent getLatestWatermark() { <START> if (latestWatermarkTimestamp == -1L) { <END> return null; } else { return new MistWatermarkEvent(latestWatermarkTimestamp); } }</code><technical_language>is changed</technical_language>

Target:
public MistWatermarkEvent getLatestWatermark() { return latestWatermark; }
Source:
<code>public <M> OutputStream<M> getOutputStream(OutputDescriptor<M, ?> outputDescriptor) { <START> super.addOutputDescriptor(outputDescriptor); <END> String streamId = outputDescriptor.getStreamId(); Preconditions.checkState(!outputStreams.containsKey(streamId), "getOutputStream must not be called multiple times with the same streamId: " + streamId); Serde serde = outputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getKVSerdes(streamId, serde); if (inputOperators.containsKey(streamId)) { InputOperatorSpec inputOperatorSpec = inputOperators.get(streamId); Serde keySerde = inputOperatorSpec.getKeySerde(); Serde valueSerde = inputOperatorSpec.getValueSerde(); Preconditions.checkState(kvSerdes.getKey().equals(keySerde) && kvSerdes.getValue().equals(valueSerde), String.format("Stream %s is being used both as an input and an output stream. Serde in Samza happens at " + "stream level, so the same key and message Serde must be used for both.", streamId)); } boolean isKeyed = serde instanceof KVSerde; outputStreams.put(streamId, new OutputStreamImpl<>(streamId, kvSerdes.getKey(), kvSerdes.getValue(), isKeyed)); return outputStreams.get(streamId); }</code><technical_language>"super"</technical_language>

Target:
public <M> OutputStream<M> getOutputStream(OutputDescriptor<M, ?> outputDescriptor) { Preconditions.checkState(!outputDescriptors.containsKey(outputDescriptor.getStreamId()), String.format("add output descriptors multiple times with the same streamId: %s", outputDescriptor.getStreamId())); outputDescriptors.put(outputDescriptor.getStreamId(), outputDescriptor); addSystemDescriptor(outputDescriptor.getSystemDescriptor()); String streamId = outputDescriptor.getStreamId(); Preconditions.checkState(!outputStreams.containsKey(streamId), "getOutputStream must not be called multiple times with the same streamId: " + streamId); Serde serde = outputDescriptor.getSerde(); KV<Serde, Serde> kvSerdes = getKVSerdes(streamId, serde); if (inputOperators.containsKey(streamId)) { InputOperatorSpec inputOperatorSpec = inputOperators.get(streamId); Serde keySerde = inputOperatorSpec.getKeySerde(); Serde valueSerde = inputOperatorSpec.getValueSerde(); Preconditions.checkState(kvSerdes.getKey().equals(keySerde) && kvSerdes.getValue().equals(valueSerde), String.format("Stream %s is being used both as an input and an output stream. Serde in Samza happens at " + "stream level, so the same key and message Serde must be used for both.", streamId)); } boolean isKeyed = serde instanceof KVSerde; outputStreams.put(streamId, new OutputStreamImpl<>(streamId, kvSerdes.getKey(), kvSerdes.getValue(), isKeyed)); return outputStreams.get(streamId); }
Source:
<code>public void handleUnimprovedMilliSecondsSpentInputChange( ChangeEvent event ) { try { Long value = unimprovedMillisecondsSpentInput.getValue().isEmpty() ? null : Long.parseLong( unimprovedMillisecondsSpentInput.getValue() ); presenter.onUnimprovedMillisecondsSpentChange( value ); } catch ( NumberFormatException e ) { <START> <END> } }</code><technical_language>Likewise.</technical_language>

Target:
public void handleUnimprovedMilliSecondsSpentInputChange( ChangeEvent event ) { boolean isNumeric = unimprovedMillisecondsSpentInput.getValue().matches( "\\d+" ); if (isNumeric) { presenter.onUnimprovedMillisecondsSpentChange( Long.parseLong( unimprovedMillisecondsSpentInput.getValue() ) ); } else { presenter.onUnimprovedMillisecondsSpentChange( 0l ); unimprovedMillisecondsSpentInput.setValue( "0" ); } }
Source:
<code>public RemoteServerState getActualState(String remoteServerName) { <START> if (serverStatusTask == null) { <END> scheduledTask(); } return actualStateMap.get(remoteServerName); }</code><technical_language>scheduledTask() this check, I guess need repeat (same below)</technical_language>

Target:
public RemoteServerState getActualState(String remoteServerName) { scheduleTask(); return actualStateMap.get(remoteServerName); }
Source:
<code>ValidationResult <START> validateOverlapWithOtherPools(MacPool <END> macPool, List<MacPool> otherPools) { return ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_MAC_POOL_OVERLAPS_WITH_OTHER_POOLS) .when(otherPools.stream().anyMatch(pool -> areOverlappingPools(macPool, pool))); }</code><technical_language>code shared computeOverlappingPools</technical_language>

Target:
ValidationResult validateOverlapWithOtherPools(MacPool macPool, List<MacPool> otherPools) { return ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_MAC_POOL_OVERLAPS_WITH_OTHER_POOLS) .when(otherPools.stream().anyMatch(otherPool -> areOverlappingPools(macPool, otherPool))); }
Source:
<code>public void lineString() throws Exception { String wkt = "LINESTRING (1 2, 3 4)"; <START> assertGeometryParse(wkt, LineString.class, null); <END> assertGeometryParse(wkt, LineString.class, 4326); }</code><technical_language>save duplication a method assertGeometryParse(wkt, geometryClass) calls assertGeometryParse(wkt, geometryClass, null) assertGeometryParse(wkt, geometryClass, 4326). nice 4326 a constant for clarity</technical_language>

Target:
public void lineString() throws Exception { String wkt = "LINESTRING (1 2, 3 4)"; assertParseReferencedAndUnreferenced(wkt, LineString.class); }
Source:
<code>private ValidationResult checkVmNumaCpuAssignment(int cpuCores, List<VmNumaNode> vmNumaNodes) { <START> ArrayList<Integer> cpuIds = new ArrayList<>(); for (VmNumaNode node : vmNumaNodes) { cpuIds.addAll(node.getCpuIds()); } <END> if (cpuIds.isEmpty()) { return ValidationResult.VALID; } int minId = Collections.min(cpuIds); int maxId = Collections.max(cpuIds); if (minId < 0 || maxId >= cpuCores) { return new ValidationResult(EngineMessage.VM_NUMA_NODE_INVALID_CPU_ID, String.format("$cpuIndex %d", (minId < 0) ? minId : maxId), String.format("$cpuIndexMax %d", cpuCores - 1)); } Collections.sort(cpuIds); for (int i = 0; i < cpuIds.size() - 1; ++i) { if (cpuIds.get(i).equals(cpuIds.get(i + 1))) { return new ValidationResult(EngineMessage.VM_NUMA_NODE_DUPLICATE_CPU_ID, String.format("$cpuIndex %d", cpuIds.get(i))); } } return ValidationResult.VALID; }</code><technical_language>streams here? cpuIds = vmNumaNodes.stream().map(VmNumeNode::getCpuIds).flatMap().collect(Collectiors.toList())</technical_language>

Target:
private ValidationResult checkVmNumaCpuAssignment(int cpuCores, List<VmNumaNode> vmNumaNodes) { List<Integer> cpuIds = vmNumaNodes.stream() .flatMap(node -> node.getCpuIds().stream()) .collect(Collectors.toList()); if (cpuIds.isEmpty()) { return ValidationResult.VALID; } int minId = Collections.min(cpuIds); int maxId = Collections.max(cpuIds); if (minId < 0 || maxId >= cpuCores) { return new ValidationResult(EngineMessage.VM_NUMA_NODE_INVALID_CPU_ID, String.format("$cpuIndex %d", (minId < 0) ? minId : maxId), String.format("$cpuIndexMax %d", cpuCores - 1)); } Collections.sort(cpuIds); for (int i = 0; i < cpuIds.size() - 1; ++i) { if (cpuIds.get(i).equals(cpuIds.get(i + 1))) { return new ValidationResult(EngineMessage.VM_NUMA_NODE_DUPLICATE_CPU_ID, String.format("$cpuIndex %d", cpuIds.get(i))); } } return ValidationResult.VALID; }
Source:
<code>@Override public boolean test(Map<Object, Object> ctx) throws Exception { long expRsSize; SqlFieldsQuery qry; if (args.sqlRange() <= 0) { qry = new SqlFieldsQuery("UPDATE test_long SET val = (val + 1)"); expRsSize = args.range(); } else if (args.sqlRange() == 1) { qry = new SqlFieldsQuery("UPDATE test_long SET val = (val + 1) WHERE id = ?"); qry.setArgs(ThreadLocalRandom.current().nextLong(args.range()) + 1); expRsSize = 1; } else { qry = new SqlFieldsQuery("UPDATE test_long SET val = (val + 1) WHERE id BETWEEN ? AND ?"); long id = ThreadLocalRandom.current().nextLong(args.range() - args.sqlRange()) + 1; long maxId = id + args.sqlRange() - 1; qry.setArgs(id, maxId); expRsSize = args.sqlRange(); } try (FieldsQueryCursor<List<?>> cursor = <START> ((IgniteEx)ignite()).context().query().querySqlFieldsNoCache(qry, false)) { <END> Iterator<List<?>> it = cursor.iterator(); List<?> cntRow = it.next(); long rsSize = (Long)cntRow.get(0); if (it.hasNext()) throw new Exception("Only one row expected on UPDATE query"); if (rsSize != expRsSize) throw new Exception("Invalid result set size [actual=" + rsSize + ", expected=" + expRsSize + ']'); } return true; }</code><technical_language>is worth move this code parent class? final FieldsQueryCursor<List<?>> execQuery(SqlFieldsQuery qry){ return ((IgniteEx)ignite()).context().query().querySqlFieldsNoCache(qry, false); }</technical_language>

Target:
@Override public boolean test(Map<Object, Object> ctx) throws Exception { long startId = idGen.nextRangeStartId(); long endId = idGen.endRangeId(startId); long expRsSize = idGen.rangeWidth(); SqlFieldsQuery qry; if (idGen.rangeWidth() == 1) { qry = new SqlFieldsQuery("UPDATE test_long SET val = (val + 1) WHERE id = ?"); qry.setArgs(startId); } else { qry = new SqlFieldsQuery("UPDATE test_long SET val = (val + 1) WHERE id BETWEEN ? AND ?"); qry.setArgs(startId, endId); } try (FieldsQueryCursor<List<?>> cursor = ((IgniteEx)ignite()).context().query() .querySqlFields(qry, false)) { Iterator<List<?>> it = cursor.iterator(); List<?> cntRow = it.next(); long rsSize = (Long)cntRow.get(0); if (it.hasNext()) throw new Exception("Only one row expected on UPDATE query"); if (rsSize != expRsSize) throw new Exception("Invalid result set size [actual=" + rsSize + ", expected=" + expRsSize + ']'); } return true; }
Source:
<code>public void eval(EvaluatorContext context, EvaluatorData data) { final PullRequestData upstreamPullRequestData = data.getAttributeValue(EvaluatorData.Attributes.PULL_REQUEST_UPSTREAM); LabelData labelData = super.getLabelData(EvaluatorData.Attributes.LABELS_UPSTREAM, data); if (upstreamPullRequestData.isDefined()) { if (upstreamPullRequestData.isMerged()) { labelData.addLabelItem(new LabelItem(LabelItem.LabelContent.Upstream_merged, LabelItem.LabelAction.SET, LabelItem.LabelSeverity.OK)); } else { <START> labelData.addLabelItem(new LabelItem(LabelItem.LabelContent.Upstream_merged, LabelItem.LabelAction.REMOVE, <END> LabelItem.LabelSeverity.BAD)); } } else { if (upstreamPullRequestData.isRequired()) { labelData.addLabelItem(new LabelItem(LabelItem.LabelContent.Missing_upstream_PR, LabelItem.LabelAction.REMOVE, LabelItem.LabelSeverity.BAD)); } } }</code><technical_language>jump else block PullRequestData.isMerged() is unimplemented</technical_language>

Target:
public void eval(EvaluatorContext context, EvaluatorData data) { final PullRequestData upstreamPullRequestData = data.getAttributeValue(EvaluatorData.Attributes.PULL_REQUEST_UPSTREAM); LabelData labelData = super.getLabelData(EvaluatorData.Attributes.LABELS_UPSTREAM, data); if (upstreamPullRequestData.isDefined()) { if (upstreamPullRequestData.isMerged()) { labelData.addLabelItem(new DefinedLabelItem(LabelContent.Upstream_merged, LabelItem.LabelAction.SET, LabelItem.LabelSeverity.OK)); } else { labelData.addLabelItem(new DefinedLabelItem(LabelContent.Upstream_merged, LabelItem.LabelAction.REMOVE, LabelItem.LabelSeverity.BAD)); } } else { if (upstreamPullRequestData.isRequired()) { labelData.addLabelItem(new DefinedLabelItem(LabelContent.Missing_upstream_PR, LabelItem.LabelAction.REMOVE, LabelItem.LabelSeverity.BAD)); } } }
Source:
<code>private ReadingListPage(@NonNull Builder builder) { super(builder); <START> diskStatus = builder.diskStatus; <END> }</code><technical_language>I need a filename = builder.filename here</technical_language>

Target:
private ReadingListPage(@NonNull Builder builder) { super(builder); diskStatus = builder.diskStatus; filename = builder.filename; }
Source:
<code>public void find_list_by_complex_predicate_hibernate() { List<String> usernames = Lists.newArrayList("dr_frank", "mike", "maggie", "liza"); List<User> users = Lists.newArrayList(); for (String username : usernames) { users.add(userRepository.save(new User(username))); } User poster = new User("duplo"); userRepository.save(poster); <START> for (int i = 0; i < 100; ++i) { <END> repository.save(new Tweet(poster, "spamming @dr_frank " + i, users.subList(0, 1), null)); } assertTrue(repository.findAllWithHibernateQuery(tweet.mentions.contains(users.get(1))).isEmpty()); assertEquals(100, repository.findAllWithHibernateQuery(tweet.mentions.contains(users.get(0))).size()); assertTrue(repository.findAllWithHibernateQuery(tweet.mentions.any().username.eq("duplo")).isEmpty()); assertEquals(100, repository.findAllWithHibernateQuery(tweet.mentions.any().username.eq("dr_frank")).size()); }</code><technical_language>++i? Unconventional</technical_language>

Target:
public void find_list_by_complex_predicate_hibernate() { List<String> usernames = Lists.newArrayList("dr_frank", "mike", "maggie", "liza"); List<User> users = Lists.newArrayList(); for (String username : usernames) { users.add(userRepository.save(new User(username))); } User poster = new User("duplo"); userRepository.save(poster); for (int i = 0; i < 100; i++) { repository.save(new Tweet(poster, "spamming @dr_frank " + i, users.subList(0, 1), null)); } assertTrue(repository.findAllWithHibernateQuery(tweet.mentions.contains(users.get(1))).isEmpty()); assertEquals(100, repository.findAllWithHibernateQuery(tweet.mentions.contains(users.get(0))).size()); assertTrue(repository.findAllWithHibernateQuery(tweet.mentions.any().username.eq("duplo")).isEmpty()); assertEquals(100, repository.findAllWithHibernateQuery(tweet.mentions.any().username.eq("dr_frank")).size()); }
Source:
<code>public BuildingConstructionStartedEvent getBuildingConstructionStartedEvent(Vector3i centerBlock, BuildingType buildingType, EntityRef building) { SpawnBlockRegionsComponent blockRegionsComponent = buildingTemplate.getComponent(SpawnBlockRegionsComponent.class); List<SpawnBlockRegionsComponent.RegionToFill> relativeRegions = blockRegionsComponent.regionsToFill; List<BlockRegion> absoluteRegions = new ArrayList<>(); for (SpawnBlockRegionsComponent.RegionToFill regionToFill : relativeRegions) { BlockRegion relativeRegion = regionToFill.region; <START> BlockRegion absoluteRegion = relativeRegion.translate(centerBlock, new BlockRegion(BlockRegion.INVALID)); <END> absoluteRegions.add(absoluteRegion); } long delay = buildingTemplate.getComponent(CompletionTimeComponent.class).completionDelay; return new BuildingConstructionStartedEvent(absoluteRegions, buildingType, centerBlock, building, delay); }</code><technical_language>stream instead, avoid INVALID</technical_language>

Target:
public BuildingConstructionStartedEvent getBuildingConstructionStartedEvent(Vector3i centerBlock, BuildingType buildingType, EntityRef building) { SpawnBlockRegionsComponent blockRegionsComponent = buildingTemplate.getComponent(SpawnBlockRegionsComponent.class); List<SpawnBlockRegionsComponent.RegionToFill> relativeRegions = blockRegionsComponent.regionsToFill; List<BlockRegion> absoluteRegions = relativeRegions.stream() .map(regionToFill -> new BlockRegion(regionToFill.region).translate(centerBlock)) .collect(Collectors.toList()); long delay = buildingTemplate.getComponent(CompletionTimeComponent.class).completionDelay; return new BuildingConstructionStartedEvent(absoluteRegions, buildingType, centerBlock, building, delay); }
Source:
<code>List<Iv2InFlight> removeHandlesForPartitionAndInitiator(Integer partitionId, Long initiatorHSId) { assert(!shouldCheckThreadIdAssertion() || m_expectedThreadId == Thread.currentThread().getId()); List<Iv2InFlight> retval = new ArrayList<Iv2InFlight>(); PartitionInFlightTracker partitionStuff = m_trackerMap.get(partitionId); if (partitionStuff != null) { <START> Iterator<Entry<Long, Iv2InFlight>> iter = partitionStuff.m_inFlights.entrySet().iterator(); <END> while (iter.hasNext()) { Entry<Long, Iv2InFlight> entry = iter.next(); if (entry.getValue().m_initiatorHSId != initiatorHSId) { tmLog.info("cleared response for handle " + entry.getKey()); iter.remove(); retval.add(entry.getValue()); m_outstandingTxns--; m_acg.reduceBackpressure(entry.getValue().m_messageSize); } } } if (partitionId == MP_PART_ID) { partitionStuff = m_trackerMap.get(SHORT_CIRCUIT_PART_ID); if (partitionStuff != null) { Iterator<Entry<Long, Iv2InFlight>> iter = partitionStuff.m_inFlights.entrySet().iterator(); while (iter.hasNext()) { Entry<Long, Iv2InFlight> entry = iter.next(); if (entry.getValue().m_initiatorHSId != initiatorHSId) { tmLog.info("cleared response for handle " + entry.getKey()); iter.remove(); retval.add(entry.getValue()); m_outstandingTxns--; m_acg.reduceBackpressure(entry.getValue().m_messageSize); } } } } return retval; }</code><technical_language>replace block of code a function reuse for "SHORT_CIRCUIT_PART_ID", void removePartitionInFlightTracker (PartitionInFlightTracker partitionStuff, Long initiatorHSId) { }</technical_language>

Target:
List<Iv2InFlight> removeHandlesForPartitionAndInitiator(Integer partitionId, Long initiatorHSId) { assert(!shouldCheckThreadIdAssertion() || m_expectedThreadId == Thread.currentThread().getId()); List<Iv2InFlight> retval = new ArrayList<Iv2InFlight>(); collectAndRemovePartitionInFlightRequests(partitionId, initiatorHSId, retval); if (partitionId == MP_PART_ID) { collectAndRemovePartitionInFlightRequests(SHORT_CIRCUIT_PART_ID, initiatorHSId, retval); } return retval; }
Source:
<code><START> public synchronized void cancel() { <END> canceled = true; com.squareup.okhttp.Call rawCall = this.rawCall; if (rawCall != null) { rawCall.cancel(); } }</code><technical_language>I hate of this ends in docs</technical_language>

Target:
public void cancel() { canceled = true; com.squareup.okhttp.Call rawCall = this.rawCall; if (rawCall != null) { rawCall.cancel(); } }
Source:
<code>public boolean checkTraceType(Class<? extends ITmfTrace> traceClass) { List<Element> elements = getElements(TmfXmlStrings.TRACETYPE); if (elements.isEmpty()) { return true; } for (Element element : elements) { String traceTypeId = element.getAttribute(TmfXmlStrings.ID); TraceTypeHelper helper = TmfTraceType.getInstance().getTraceType(traceTypeId); <START> if (helper != null && helper.getTrace().getClass().isAssignableFrom(traceClass)) { <END> return true; } } return false; }</code><technical_language>add () avoid ambiguity please</technical_language>

Target:
public boolean checkTraceType(Class<? extends ITmfTrace> traceClass) { List<Element> elements = getElements(TmfXmlStrings.TRACETYPE); if (elements.isEmpty()) { return true; } for (Element element : elements) { String traceTypeId = element.getAttribute(TmfXmlStrings.ID); TraceTypeHelper helper = TmfTraceType.getInstance().getTraceType(traceTypeId); if ((helper != null) && helper.getTrace().getClass().isAssignableFrom(traceClass)) { return true; } } return false; }
Source:
<code>private static List<RunOrderWithArguments> withEmptyArguments( RunOrder[] runOrders ) { <START> List<RunOrderWithArguments> orderWithArguments = new ArrayList<RunOrderWithArguments>(); <END> for ( RunOrder runOrder : runOrders ) { RunOrderArguments args = new RunOrderArguments( new ArrayList<String>() ); orderWithArguments.add( new RunOrderWithArguments( runOrder, args ) ); } return orderWithArguments; }</code><technical_language>pls diamond new ArrayList<>();</technical_language>

Target:
private static List<RunOrderWithArguments> withEmptyArguments( RunOrder[] runOrders ) { List<RunOrderWithArguments> orderWithArguments = new ArrayList<>(); for ( RunOrder runOrder : runOrders ) { RunOrderArguments args = new RunOrderArguments( new ArrayList<String>() ); orderWithArguments.add( new RunOrderWithArguments( runOrder, args ) ); } return orderWithArguments; }
Source:
<code><START> public Collection<AttributeModifier> apiStack$getAttributeModifiers(final AttributeType attributeType, final EquipmentType equipmentType) { <END> Preconditions.checkNotNull(attributeType, "Attribute type cannot be null"); Preconditions.checkNotNull(equipmentType, "Equipment type cannot be null"); final ImmutableList.Builder<AttributeModifier> builder = ImmutableList.builder(); for (EquipmentSlotType equipmentSlotType : ((SpongeEquipmentType) equipmentType).getSlots()) { final Multimap<String, net.minecraft.entity.ai.attributes.AttributeModifier> modifierMultimap = this.shadow$getAttributeModifiers(equipmentSlotType); builder.addAll((Iterable) modifierMultimap.get(attributeType.getKey().getValue())); } return builder.build(); }</code><technical_language>this method? IS public for other consumers? is prefixed api adding method</technical_language>

Target:
public Collection<AttributeModifier> itemStack$getAttributeModifiers(final AttributeType attributeType, final EquipmentType equipmentType) { Preconditions.checkNotNull(attributeType, "Attribute type cannot be null"); Preconditions.checkNotNull(equipmentType, "Equipment type cannot be null"); final ImmutableList.Builder<AttributeModifier> builder = ImmutableList.builder(); for (EquipmentSlotType equipmentSlotType : ((SpongeEquipmentType) equipmentType).getSlots()) { final Multimap<String, net.minecraft.entity.ai.attributes.AttributeModifier> modifierMultimap = this.shadow$getAttributeModifiers(equipmentSlotType); builder.addAll((Iterable) modifierMultimap.get(attributeType.getKey().getValue())); } return builder.build(); }
Source:
<code>static String deleteBackslash(String s) { if (s.indexOf('\\') < 0) { return s; } StringBuilder sb = new StringBuilder(s.length()); char prev = 0; for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if ('\\' == ch) { if (i + 1 == s.length()) { continue; } char next = s.charAt(i + 1); if (prev != '\\' && !escapedByBackslash(next)) { continue; } <START> prev = ch; <END> } sb.append(ch); } return sb.toString(); }</code><technical_language>prev is reset If escaped backslash is subsequent unescaped deleted: For instance pattern "a\\b\c" match "a\bc" unescaped backslash removal stop encountering escaped backslash</technical_language>

Target:
static String deleteBackslash(String s) { if (s.indexOf('\\') < 0) { return s; } StringBuilder sb = new StringBuilder(s.length()); char prev = 0; for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if ('\\' == ch) { if (i + 1 == s.length()) { continue; } char next = s.charAt(i + 1); if (prev != '\\' && !escapedByBackslash(next)) { continue; } prev = ch; } else { prev = 0; } sb.append(ch); } return sb.toString(); }
Source:
<code>public String toString() { return MoreObjects.toStringHelper(this) .add("_uuid", _uuid) .add("_version", _version) <START> .add("_packageVersions", _packageVersions) <END> .toString(); }</code><technical_language>match conventional toString implementation</technical_language>

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("Uuid", _uuid) .add("Version", _version) .add("PackageVersions", _packageVersions) .toString(); }
Source:
<code>public void run(@Nonnull JMethod method) throws Exception { <START> if (method.isNative() || method.isAbstract() || !filter.accept(this.getClass(), method)) { <END> return; } TransformationRequest tr = new TransformationRequest(method); Visitor visitor = new Visitor(method, tr); visitor.accept(method); tr.commit(); }</code><technical_language>Check null of 5 fields</technical_language>

Target:
public void run(@Nonnull JMethod method) throws Exception { if (method.isNative() || method.isAbstract() || !filter.accept(this.getClass(), method)) { return; } if (lockClass == null || requestClass == null || resetClass == null || requestMethodId == null || resetMethodId == null) { return; } TransformationRequest tr = new TransformationRequest(method); Visitor visitor = new Visitor(method, tr); visitor.accept(method); tr.commit(); }
Source:
<code>private TestListener() { <START> events = new HashSet<>(Arrays.asList(DOCUMENT_TRASHED)); <END> }</code><technical_language>Collections#singletonList instead</technical_language>

Target:
private TestListener() { events = new HashSet<>(Collections.singleton(DOCUMENT_TRASHED)); }
Source:
<code>protected void sendReadSlotDelayed(int slotNo, long delay) { <START> java.util.TimerTask meterTask = null; meterTask = new java.util.TimerTask() { <END> int slotNumber = slotNo; @Override public void run() { try { sendReadSlot(slotNumber); } catch (Exception e) { log.error("Exception occurred sendReadSlotDelayed:", e); } } }; jmri.util.TimerUtil.schedule(meterTask, delay); }</code><technical_language>I expected Spotbugs fail this. meterTask is assigned null assigned a TimerTask. Spotbugs accept this null is used</technical_language>

Target:
protected void sendReadSlotDelayed(int slotNo, long delay) { java.util.TimerTask meterTask = new java.util.TimerTask() { int slotNumber = slotNo; @Override public void run() { try { sendReadSlot(slotNumber); } catch (Exception e) { log.error("Exception occurred sendReadSlotDelayed:", e); } } }; jmri.util.TimerUtil.schedule(meterTask, delay); }
Source:
<code>public <T> T execute(Request<T> request, IProgressMonitor monitor) throws IOException, GerritException { if (!isAnonymous()) { return execute(request, true, monitor); } <START> return execute(request, false, monitor); <END> }</code><technical_language>Lines 316-319 rewritten return execute(request, !isAnonymous(), monitor);</technical_language>

Target:
public <T> T execute(Request<T> request, IProgressMonitor monitor) throws IOException, GerritException { return execute(request, !isAnonymous(), monitor); }
Source:
<code>public void differentUrlForPostsAndVideo() { <START> SearchInput searchInput = new SearchInput().searchInputValue(); <END> SearchInput searchInputSubmit = new SearchInput().searchInputSubmit(); String URL = driver.getCurrentUrl(); Assert.assertEquals(URL, "<LINK_2>"); SearchInput postsResult = new SearchInput().searchResultsPosts(); String postUrl = driver.getCurrentUrl(); SearchInput videosResult = new SearchInput().searchResultsVideos(); String videoUrl = driver.getCurrentUrl(); Assert.assertNotEquals(postUrl, videoUrl); }</code><technical_language>![MAJOR](<LINK_0> Remove this unused "searchInput" local variable. [![rule](<LINK_1>](http://sonar-s1/coding_rules#rule_key=squid%3AS1481)</technical_language>

Target:
public void differentUrlForPostsAndVideo() { SearchInput searchInput = new SearchInput().searchInputValue(); SearchInput searchInputSubmit = new SearchInput().searchInputSubmit(); SearchInput postsResult = new SearchInput().searchResultsPosts(); String postUrl = driver.getCurrentUrl(); SearchInput videosResult = new SearchInput().searchResultsVideos(); String videoUrl = driver.getCurrentUrl(); Assert.assertNotEquals(postUrl, videoUrl); }
Source:
<code>static QualifiedArgumentFactory adapt(ArgumentFactory factory) { <START> Set<Annotation> qualifiers = new Qualifiers().qualifiers(factory.getClass()); <END> return (type, value, config) -> type.getQualifiers().equals(qualifiers) ? factory.build(type.getType(), value, config) : Optional.empty(); }</code><technical_language>qualifiers lambda previously this PR, access config registry (and qualifier cache)</technical_language>

Target:
static QualifiedArgumentFactory adapt(ArgumentFactory factory) { return (type, value, config) -> type.getQualifiers().equals( config.get(Qualifiers.class).findFor(factory.getClass())) ? factory.build(type.getType(), value, config) : Optional.empty(); }
Source:
<code>private Future<Void> dispatchAssignmentChangeIfNeeded(String connectorType, List<DatastreamTask> assignment) { ConnectorWrapper connector = _connectors.get(connectorType); List<DatastreamTask> addedTasks = new ArrayList<>(assignment); List<DatastreamTask> removedTasks; List<DatastreamTask> oldAssignment = _assignedDatastreamTasks.values() .stream() .filter(t -> t.getConnectorType().equals(connectorType)) .collect(Collectors.toList()); addedTasks.removeAll(oldAssignment); oldAssignment.removeAll(assignment); removedTasks = oldAssignment; <START> if (!addedTasks.isEmpty() || !removedTasks.isEmpty()) { <END> addedTasks.stream().filter(t -> t.getEventProducer() == null).forEach(this::initializeTask); return _assignmentChangeThreadPool.submit((Callable<Void>) () -> { try { connector.onAssignmentChange(assignment); removedTasks.forEach(this::uninitializeTask); } catch (Exception ex) { _log.warn(String.format("connector.onAssignmentChange for connector %s threw an exception, " + "Queuing up a new onAssignmentChange event for retry.", connectorType), ex); _eventQueue.put(CoordinatorEvent.createHandleInstanceErrorEvent(ExceptionUtils.getRootCauseMessage(ex))); _eventQueue.put(CoordinatorEvent.createHandleAssignmentChangeEvent()); } return null; }); } return null; }</code><technical_language>change de-dup if streams SerDes. Is part of this PR</technical_language>

Target:
private Future<Void> dispatchAssignmentChangeIfNeeded(String connectorType, List<DatastreamTask> assignment) { ConnectorInfo connectorInfo = _connectors.get(connectorType); ConnectorWrapper connector = connectorInfo.getConnector(); List<DatastreamTask> addedTasks = new ArrayList<>(assignment); List<DatastreamTask> removedTasks; List<DatastreamTask> oldAssignment = _assignedDatastreamTasks.values() .stream() .filter(t -> t.getConnectorType().equals(connectorType)) .collect(Collectors.toList()); addedTasks.removeAll(oldAssignment); oldAssignment.removeAll(assignment); removedTasks = oldAssignment; if (!addedTasks.isEmpty() || !removedTasks.isEmpty()) { addedTasks.stream().filter(t -> t.getEventProducer() == null).forEach(this::initializeTask); return _assignmentChangeThreadPool.submit((Callable<Void>) () -> { try { connector.onAssignmentChange(assignment); removedTasks.forEach(this::uninitializeTask); } catch (Exception ex) { _log.warn(String.format("connector.onAssignmentChange for connector %s threw an exception, " + "Queuing up a new onAssignmentChange event for retry.", connectorType), ex); _eventQueue.put(CoordinatorEvent.createHandleInstanceErrorEvent(ExceptionUtils.getRootCauseMessage(ex))); _eventQueue.put(CoordinatorEvent.createHandleAssignmentChangeEvent()); } return null; }); } return null; }
Source:
<code>public void throwIfNotOwner(User owner) throws IOException { <START> if (!getCurrentUser().equals(owner)) { <END> throw new AuthorizationException("Current user is not owner"); } }</code><technical_language>Compare userId instead of relying equals method</technical_language>

Target:
public void throwIfNotOwner(User owner) throws IOException { if (!getCurrentUser().getUserId().equals(owner.getUserId())) { throw new AuthorizationException("Current user is not owner"); } }
Source:
<code>private static MergedReftable merge(byte[]... <START> table) throws IOException { <END> List<ReftableReader> stack = new ArrayList<>(table.length); for (byte[] b : table) { stack.add(read(b)); } return new MergedReftable(stack); }</code><technical_language>remove unthrown exception</technical_language>

Target:
private static MergedReftable merge(byte[]... table) { List<ReftableReader> stack = new ArrayList<>(table.length); for (byte[] b : table) { stack.add(read(b)); } return new MergedReftable(stack); }
Source:
<code>public Client provide(ContainerRequest request) { int requestPort = request.getBaseUri().getPort(); Optional<XfccSourceConfig> possibleXfccConfig = getXfccConfigForPort(requestPort); List<String> xfccHeaderValues = Optional.ofNullable(request.getRequestHeader(XFCC_HEADER_NAME)).orElse(List.of()); if (possibleXfccConfig.isEmpty() != xfccHeaderValues.isEmpty()) { throw new NotAuthorizedException(format( "Port %d is configured to %s receive traffic with the %s header set", requestPort, possibleXfccConfig.isEmpty() ? "never" : "only", XFCC_HEADER_NAME)); } Principal requestPrincipal = getPrincipal(request).orElseThrow( () -> new NotAuthorizedException("Not authorized as Keywhiz client")); Optional<String> requestName = getClientName(requestPrincipal); Optional<String> requestSpiffeId = Optional.empty(); if (possibleXfccConfig.isEmpty()) { <START> return authorizeClient(requestPrincipal, requestName, requestSpiffeId); <END> } else { return authorizeClientFromXfccHeader(possibleXfccConfig.get(), xfccHeaderValues, requestName, requestSpiffeId); } }</code><technical_language>Consider renaming authorizeClientFromClientCert similar, for symmetry authorizeClientFromXfccHeader</technical_language>

Target:
public Client provide(ContainerRequest request) { int requestPort = request.getBaseUri().getPort(); Optional<XfccSourceConfig> possibleXfccConfig = getXfccConfigForPort(requestPort); List<String> xfccHeaderValues = Optional.ofNullable(request.getRequestHeader(XFCC_HEADER_NAME)).orElse(List.of()); if (possibleXfccConfig.isEmpty() != xfccHeaderValues.isEmpty()) { throw new NotAuthorizedException(format( "Port %d is configured to %s receive traffic with the %s header set", requestPort, possibleXfccConfig.isEmpty() ? "never" : "only", XFCC_HEADER_NAME)); } Principal requestPrincipal = getPrincipal(request).orElseThrow( () -> new NotAuthorizedException("Not authorized as Keywhiz client")); Optional<String> requestName = getClientName(requestPrincipal); Optional<String> requestSpiffeId = Optional.empty(); if (possibleXfccConfig.isEmpty()) { return authorizeClientFromTlsCert(requestPrincipal, requestName, requestSpiffeId); } else { return authorizeClientFromXfccHeader(possibleXfccConfig.get(), xfccHeaderValues, requestName, requestSpiffeId); } }
Source:
<code>@Override public void executeTraversal(Flow.Traversal traversal, Flow.TraversalCallback callback) { class LatchedCallback implements Flow.TraversalCallback { final Flow.TraversalCallback wrapped; <START> final CountDownLatch latch = new CountDownLatch(2); <END> LatchedCallback(Flow.TraversalCallback wrapped) { this.wrapped = wrapped; } @Override public void onTraversalCompleted() { latch.countDown(); if (latch.getCount() == 0) { disabled = false; wrapped.onTraversalCompleted(); ((IsMasterView) masterContainer.getCurrentChild()).updateSelection(); } } } disabled = true; callback = new LatchedCallback(callback); detailContainer.executeTraversal(traversal, callback); masterContainer.executeTraversal(traversal, callback); }</code><technical_language>need a latch. This is misleading, concurrency worry about. a counter</technical_language>

Target:
@Override public void executeTraversal(Flow.Traversal traversal, Flow.TraversalCallback callback) { class CountdownCallback implements Flow.TraversalCallback { final Flow.TraversalCallback wrapped; int countDown = 2; CountdownCallback(Flow.TraversalCallback wrapped) { this.wrapped = wrapped; } @Override public void onTraversalCompleted() { countDown--; if (countDown == 0) { disabled = false; wrapped.onTraversalCompleted(); ((IsMasterView) masterContainer.getCurrentChild()).updateSelection(); } } } disabled = true; callback = new CountdownCallback(callback); detailContainer.executeTraversal(traversal, callback); masterContainer.executeTraversal(traversal, callback); }
Source:
<code>public void performFailover(T currentProxy) { <START> if(conf.getBoolean(RESET_PROXY_ON_FAILOVER, false)) { <END> LOG.info("Resetting cached proxy"); resetProxyAddresses(proxies); } incrementProxyIndex(); }</code><technical_language>a unit test</technical_language>

Target:
public void performFailover(T currentProxy) { LOG.info("Resetting cached proxy: " + currentProxyIndex); resetProxyAddress(proxies, currentProxyIndex); incrementProxyIndex(); }
Source:
<code>public void testNotAllOutputsReferenced() { tester().assertThat(new PruneTableScanColumns()) .on(p -> { Symbol orderdate = p.symbol("orderdate", DATE); Symbol totalprice = p.symbol("totalprice", DOUBLE); return p.project( Assignments.of(p.symbol("x"), totalprice.toSymbolReference()), p.tableScan( new TableHandle( new ConnectorId("local"), new TpchTableHandle("orders", TINY_SCALE_FACTOR), TestingTransactionHandle.create(), <START> Optional.of(TestingHandle.INSTANCE)), <END> ImmutableList.of(orderdate, totalprice), ImmutableMap.of( orderdate, new TpchColumnHandle(orderdate.getName(), DATE), totalprice, new TpchColumnHandle(totalprice.getName(), DOUBLE)))); }) .matches( strictProject( ImmutableMap.of("x_", PlanMatchPattern.expression("totalprice_")), strictTableScan("orders", ImmutableMap.of("totalprice_", "totalprice")))); }</code><technical_language>ditto :)</technical_language>

Target:
public void testNotAllOutputsReferenced() { tester().assertThat(new PruneTableScanColumns()) .on(p -> { Symbol orderdate = p.symbol("orderdate", DATE); Symbol totalprice = p.symbol("totalprice", DOUBLE); return p.project( Assignments.of(p.symbol("x"), totalprice.toSymbolReference()), p.tableScan( new TableHandle( new ConnectorId("local"), new TpchTableHandle("orders", TINY_SCALE_FACTOR), TestingTransactionHandle.create(), Optional.empty()), ImmutableList.of(orderdate, totalprice), ImmutableMap.of( orderdate, new TpchColumnHandle(orderdate.getName(), DATE), totalprice, new TpchColumnHandle(totalprice.getName(), DOUBLE)))); }) .matches( strictProject( ImmutableMap.of("x_", PlanMatchPattern.expression("totalprice_")), strictTableScan("orders", ImmutableMap.of("totalprice_", "totalprice")))); }
Source:
<code>public static boolean isLocalVariableDef(DetailAST node) { boolean localVariableDef = false; if (node.getType() == TokenTypes.VARIABLE_DEF) { final DetailAST parent = node.getParent(); localVariableDef = TokenUtil.isOfType(parent, TokenTypes.SLIST, TokenTypes.FOR_INIT, TokenTypes.FOR_EACH_CLAUSE); } if (node.getType() == TokenTypes.PARAMETER_DEF) { final DetailAST parent = node.getParent(); localVariableDef = parent.getType() == TokenTypes.LITERAL_CATCH; } if (node.getType() == TokenTypes.RESOURCE) { <START> localVariableDef = node.getChildCount() != 1; <END> } return localVariableDef; }</code><technical_language>node.getChildCount() > 1</technical_language>

Target:
public static boolean isLocalVariableDef(DetailAST node) { boolean localVariableDef = false; if (node.getType() == TokenTypes.VARIABLE_DEF) { final DetailAST parent = node.getParent(); localVariableDef = TokenUtil.isOfType(parent, TokenTypes.SLIST, TokenTypes.FOR_INIT, TokenTypes.FOR_EACH_CLAUSE); } if (node.getType() == TokenTypes.PARAMETER_DEF) { final DetailAST parent = node.getParent(); localVariableDef = parent.getType() == TokenTypes.LITERAL_CATCH; } if (node.getType() == TokenTypes.RESOURCE) { localVariableDef = node.getChildCount() > 1; } return localVariableDef; }
Source:
<code>public boolean isValid(final RegistrationUser user, final ConstraintValidatorContext constraintValidatorContext) { if (registrationService.isConfirmPasswordRequired()) { constraintValidatorContext.disableDefaultConstraintViolation(); constraintValidatorContext.buildConstraintViolationWithTemplate( <START> "{registration.validation.password.equality}").addPropertyNode("password").addConstraintViolation(); <END> return user.getPassword() != null && user.getPassword().equals(user.getConfirmPassword()); } return true; }</code><technical_language>i confirmPassword field get invalidated password field</technical_language>

Target:
public boolean isValid(final RegistrationUser user, final ConstraintValidatorContext constraintValidatorContext) { if (registrationService.isConfirmPasswordRequired()) { constraintValidatorContext.disableDefaultConstraintViolation(); constraintValidatorContext .buildConstraintViolationWithTemplate("{registration.validation.password.equality}") .addPropertyNode("confirmPassword").addConstraintViolation(); return user.getPassword() != null && user.getPassword().equals(user.getConfirmPassword()); } return true; }
Source:
<code>public void handle(MethodInvocationTree tree, AnnotatedExecutableType method) { if (permitClearProperty) { return; } if (TreeUtils.isMethodInvocation(tree, systemGetProperty, env) || TreeUtils.isMethodInvocation(tree, systemSetProperty, env)) { String literal = literalFirstArgument(tree); if (literal != null && predefinedSystemProperties.contains(literal)) { AnnotatedTypeMirror type = method.getReturnType(); type.replaceAnnotation(factory.NONNULL); } } if (TreeUtils.isMethodInvocation(tree, systemClearProperty, env)) { String literal = literalFirstArgument(tree); if (literal == null || predefinedSystemProperties.contains(literal)) { <START> checker.reportError(tree, "clear.system.property"); <END> } } if (TreeUtils.isMethodInvocation(tree, systemSetProperties, env)) { checker.reportError(tree, "clear.system.property"); } }</code><technical_language>Errors reported in visitor annotated type factory</technical_language>

Target:
public void handle(MethodInvocationTree tree, AnnotatedExecutableType method) { if (permitClearProperty) { return; } if (TreeUtils.isMethodInvocation(tree, systemGetProperty, env) || TreeUtils.isMethodInvocation(tree, systemSetProperty, env)) { String literal = NullnessVisitor.literalFirstArgument(tree); if (literal != null && predefinedSystemProperties.contains(literal)) { AnnotatedTypeMirror type = method.getReturnType(); type.replaceAnnotation(factory.NONNULL); } } }
Source:
<code><START> public PutObjectResult putObjectDirect(PutObjectRequest putObjectRequest) <END> throws AmazonClientException, MetadataPersistenceException { long len = getPutRequestLength(putObjectRequest); LOG.debug("PUT bytes to {}", len, putObjectRequest.getKey()); incrementPutStartStatistics(len); try { PutObjectResult result = s3.putObject(putObjectRequest); incrementPutCompletedStatistics(true, len); finishedWrite(putObjectRequest.getKey(), len, result.getETag(), result.getVersionId(), null); return result; } catch (AmazonClientException e) { incrementPutCompletedStatistics(false, len); throw e; } }</code><technical_language>get a WriteOperationHelper instance invoke</technical_language>

Target:
PutObjectResult putObjectDirect(PutObjectRequest putObjectRequest) throws AmazonClientException, MetadataPersistenceException { long len = getPutRequestLength(putObjectRequest); LOG.debug("PUT bytes to {}", len, putObjectRequest.getKey()); incrementPutStartStatistics(len); try { PutObjectResult result = s3.putObject(putObjectRequest); incrementPutCompletedStatistics(true, len); finishedWrite(putObjectRequest.getKey(), len, result.getETag(), result.getVersionId(), null); return result; } catch (AmazonClientException e) { incrementPutCompletedStatistics(false, len); throw e; } }