auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public <M> OutputStream<M> getOutputStream(OutputDescriptor<M, ?> outputDescriptor) { super.addOutputDescriptor(outputDescriptor); 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); }

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:
public void handleUnimprovedMilliSecondsSpentInputChange( ChangeEvent event ) { try { Long value = unimprovedMillisecondsSpentInput.getValue().isEmpty() ? null : Long.parseLong( unimprovedMillisecondsSpentInput.getValue() ); presenter.onUnimprovedMillisecondsSpentChange( value ); } catch ( NumberFormatException e ) { } }

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:
public RemoteServerState getActualState(String remoteServerName) { if (serverStatusTask == null) { scheduledTask(); } return actualStateMap.get(remoteServerName); }

Target:
public RemoteServerState getActualState(String remoteServerName) { scheduleTask(); return actualStateMap.get(remoteServerName); }
Source:
ValidationResult validateOverlapWithOtherPools(MacPool 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))); }

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:
public void lineString() throws Exception { String wkt = "LINESTRING (1 2, 3 4)"; assertGeometryParse(wkt, LineString.class, null); assertGeometryParse(wkt, LineString.class, 4326); }

Target:
public void lineString() throws Exception { String wkt = "LINESTRING (1 2, 3 4)"; assertParseReferencedAndUnreferenced(wkt, LineString.class); }
Source:
private ValidationResult checkVmNumaCpuAssignment(int cpuCores, List<VmNumaNode> vmNumaNodes) { ArrayList<Integer> cpuIds = new ArrayList<>(); for (VmNumaNode node : vmNumaNodes) { cpuIds.addAll(node.getCpuIds()); } 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; }

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:
@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 = ((IgniteEx)ignite()).context().query().querySqlFieldsNoCache(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; }

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:
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 { labelData.addLabelItem(new LabelItem(LabelItem.LabelContent.Upstream_merged, LabelItem.LabelAction.REMOVE, LabelItem.LabelSeverity.BAD)); } } else { if (upstreamPullRequestData.isRequired()) { labelData.addLabelItem(new LabelItem(LabelItem.LabelContent.Missing_upstream_PR, LabelItem.LabelAction.REMOVE, LabelItem.LabelSeverity.BAD)); } } }

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:
private ReadingListPage(@NonNull Builder builder) { super(builder); diskStatus = builder.diskStatus; }

Target:
private ReadingListPage(@NonNull Builder builder) { super(builder); diskStatus = builder.diskStatus; filename = builder.filename; }
Source:
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()); }

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:
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; BlockRegion absoluteRegion = relativeRegion.translate(centerBlock, new BlockRegion(BlockRegion.INVALID)); absoluteRegions.add(absoluteRegion); } long delay = buildingTemplate.getComponent(CompletionTimeComponent.class).completionDelay; return new BuildingConstructionStartedEvent(absoluteRegions, buildingType, centerBlock, building, delay); }

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:
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) { 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); } } } 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; }

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:
public synchronized void cancel() { canceled = true; com.squareup.okhttp.Call rawCall = this.rawCall; if (rawCall != null) { rawCall.cancel(); } }

Target:
public void cancel() { canceled = true; com.squareup.okhttp.Call rawCall = this.rawCall; if (rawCall != null) { rawCall.cancel(); } }
Source:
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; }

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:
private static List<RunOrderWithArguments> withEmptyArguments( RunOrder[] runOrders ) { List<RunOrderWithArguments> orderWithArguments = new ArrayList<RunOrderWithArguments>(); for ( RunOrder runOrder : runOrders ) { RunOrderArguments args = new RunOrderArguments( new ArrayList<String>() ); orderWithArguments.add( new RunOrderWithArguments( runOrder, args ) ); } return orderWithArguments; }

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:
public Collection<AttributeModifier> apiStack$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(); }

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:
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; } sb.append(ch); } return sb.toString(); }

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:
public String toString() { return MoreObjects.toStringHelper(this) .add("_uuid", _uuid) .add("_version", _version) .add("_packageVersions", _packageVersions) .toString(); }

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

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:
private TestListener() { events = new HashSet<>(Arrays.asList(DOCUMENT_TRASHED)); }

Target:
private TestListener() { events = new HashSet<>(Collections.singleton(DOCUMENT_TRASHED)); }
Source:
protected void sendReadSlotDelayed(int slotNo, long delay) { java.util.TimerTask meterTask = null; 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); }

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:
public <T> T execute(Request<T> request, IProgressMonitor monitor) throws IOException, GerritException { if (!isAnonymous()) { return execute(request, true, monitor); } return execute(request, false, monitor); }

Target:
public <T> T execute(Request<T> request, IProgressMonitor monitor) throws IOException, GerritException { return execute(request, !isAnonymous(), monitor); }
Source:
public void differentUrlForPostsAndVideo() { SearchInput searchInput = new SearchInput().searchInputValue(); 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); }

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:
static QualifiedArgumentFactory adapt(ArgumentFactory factory) { Set<Annotation> qualifiers = new Qualifiers().qualifiers(factory.getClass()); return (type, value, config) -> type.getQualifiers().equals(qualifiers) ? factory.build(type.getType(), value, config) : Optional.empty(); }

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:
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; 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; }

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:
public void throwIfNotOwner(User owner) throws IOException { if (!getCurrentUser().equals(owner)) { throw new AuthorizationException("Current user is not owner"); } }

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

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:
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 authorizeClient(requestPrincipal, requestName, requestSpiffeId); } else { return authorizeClientFromXfccHeader(possibleXfccConfig.get(), xfccHeaderValues, requestName, requestSpiffeId); } }

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:
@Override public void executeTraversal(Flow.Traversal traversal, Flow.TraversalCallback callback) { class LatchedCallback implements Flow.TraversalCallback { final Flow.TraversalCallback wrapped; final CountDownLatch latch = new CountDownLatch(2); 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); }

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:
public void performFailover(T currentProxy) { if(conf.getBoolean(RESET_PROXY_ON_FAILOVER, false)) { LOG.info("Resetting cached proxy"); resetProxyAddresses(proxies); } incrementProxyIndex(); }

Target:
public void performFailover(T currentProxy) { LOG.info("Resetting cached proxy: " + currentProxyIndex); resetProxyAddress(proxies, currentProxyIndex); incrementProxyIndex(); }
Source:
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.of(TestingHandle.INSTANCE)), 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")))); }

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:
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; }

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:
public boolean isValid(final RegistrationUser user, final ConstraintValidatorContext constraintValidatorContext) { if (registrationService.isConfirmPasswordRequired()) { constraintValidatorContext.disableDefaultConstraintViolation(); constraintValidatorContext.buildConstraintViolationWithTemplate( "{registration.validation.password.equality}").addPropertyNode("password").addConstraintViolation(); return user.getPassword() != null && user.getPassword().equals(user.getConfirmPassword()); } return true; }

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:
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)) { checker.reportError(tree, "clear.system.property"); } } if (TreeUtils.isMethodInvocation(tree, systemSetProperties, env)) { checker.reportError(tree, "clear.system.property"); } }

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:
public 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; } }

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; } }
Source:
public Mailmap getMailmap() { if (mailmap == null) { mailmap = new Mailmap(); if (!isBare() && getDirectory() != null) { File workTree = getWorkTree(); File configuredMailmapFile = Optional .ofNullable(getConfig().getString("mailmap", null, "file")) .map(filePath -> { File f = new File(filePath); if (!f.isAbsolute()) { f = new File(workTree, filePath); } return f; }) .orElse(null); if (configuredMailmapFile != null && configuredMailmapFile.exists()) { try { Mailmap configuredMailmap = MailmapParser.parse(configuredMailmapFile); mailmap.append(configuredMailmap); } catch (IOException ignored) { } } File defaultMailmapFile = new File(workTree, ".mailmap"); if (!defaultMailmapFile.equals(configuredMailmapFile) && defaultMailmapFile .exists()) { try { Mailmap defaultMailmap = MailmapParser.parse(defaultMailmapFile); mailmap.append(defaultMailmap); } catch (IOException ignored) { } } } } return mailmap; }

Target:
public Mailmap getMailmap() { if (mailmap == null) { mailmap = new Mailmap(); if (!isBare() && getDirectory() != null) { File configuredMailmapFile = Optional .ofNullable(getConfig().getString( ConfigConstants.CONFIG_MAILMAP_SECTION, null, ConfigConstants.CONFIG_KEY_FILE)) .map(filePath -> { File f = new File(filePath); if (!f.isAbsolute()) { f = new File(workTree, filePath); } return f; }) .orElse(null); if (configuredMailmapFile != null && configuredMailmapFile.exists()) { try { Mailmap configuredMailmap = MailmapParser.parse(configuredMailmapFile); mailmap.append(configuredMailmap); } catch (IOException e) { LOG.error(e.getMessage(), e); } } File defaultMailmapFile = new File(workTree, Constants.MAILMAP_FILENAME); if (!defaultMailmapFile.equals(configuredMailmapFile) && defaultMailmapFile .exists()) { try { Mailmap defaultMailmap = MailmapParser.parse(defaultMailmapFile); mailmap.append(defaultMailmap); } catch (IOException e) { LOG.error(e.getMessage(), e); } } } } return mailmap; }
Source:
public void testCreateNewUserVariableAndDeletion() { String userVariableName = "testVariable1"; String secondUserVariableName = "testVariable2"; onBrickAtPosition(0).checkShowsText(R.string.brick_when_started); onBrickAtPosition(1).checkShowsText(R.string.brick_set_variable); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).performNewVariableInitial(userVariableName); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).perform(click()); onView(withText(R.string.brick_variable_spinner_create_new_variable)) .perform(click()); onView(withId(R.id.dialog_formula_editor_data_name_edit_text)).perform(typeText(secondUserVariableName)); onView(withId(android.R.id.button1)).perform(click()); onBrickAtPosition(1).onFormulaTextField(R.id.brick_set_variable_edit_text).perform(click()); onView(withId(R.id.formula_editor_keyboard_data)).perform(click()); onView(allOf(withChild(withText(userVariableName)), withChild(withText("0.0")))).perform(longClick()); onView(withText(R.string.delete)).perform(click()); onView(withText(R.string.deletion_alert_yes)).perform(click()); pressBack(); pressBack(); onView(withText(userVariableName)).check(doesNotExist()); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).onChildView(withText(userVariableName)) .check(doesNotExist()); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).onChildView(withText(secondUserVariableName)) .check(matches(isDisplayed())); }

Target:
public void testCreateNewUserVariableAndDeletion() { String userVariableName = "testVariable1"; String secondUserVariableName = "testVariable2"; onBrickAtPosition(0).checkShowsText(R.string.brick_when_started); onBrickAtPosition(1).checkShowsText(R.string.brick_set_variable); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner) .performNewVariableInitial(userVariableName); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner) .performNewVariable(secondUserVariableName); onBrickAtPosition(1).onFormulaTextField(R.id.brick_set_variable_edit_text) .perform(click()); deleteItemWithTextFromFormulaEditorDataList(userVariableName); pressBack(); onView(withText(userVariableName)) .check(doesNotExist()); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).onChildView(withText(userVariableName)) .check(doesNotExist()); onBrickAtPosition(1).onVariableSpinner(R.id.set_variable_spinner).onChildView(withText(secondUserVariableName)) .check(matches(isDisplayed())); }
Source:
public void configure() throws Exception { onException(Exception.class) .redeliveryDelay("{{error.retryDelay}}") .maximumRedeliveries("{{error.maxRedeliveries}}") .backOffMultiplier(2) .retryAttemptedLogLevel(LoggingLevel.WARN); from("{{cdr.triplesupdate.stream.camel}}") .routeId("TripleIndexingRoute") .bean(indexingMessageProcessor) .log(INFO, "Received triple reindexing update message: ${headers[CamelFcrepoUri]}") .inOnly("{{reindexing.stream}}?disableTimeToLive=true"); from("{{reindexing.stream}}?asyncConsumer=true") .routeId("FcrepoReindexingTraverse") .log(INFO, "Reindexing ${headers[CamelFcrepoUri]}") .inOnly("{{triplestore.reindex.stream}}") .to("fcrepo:{{fcrepo.baseUrl}}?preferInclude=PreferContainment" + "&preferOmit=ServerManaged&accept=application/n-triples") .split(body().tokenize("\\n")).streaming() .removeHeader(FCREPO_URI) .removeHeader("JMSCorrelationID") .process(exchange -> { final String body = exchange.getIn().getBody(String.class); if (body != null) { final String parts[] = body.split("\\s+"); if (parts.length > 2 && parts[1].equals(LDP_CONTAINS) && parts[2].startsWith("<")) { exchange.getIn().setHeader(FCREPO_URI, parts[2].substring(1, parts[2].length() - 1)); } exchange.getIn().setBody(null); } }) .filter(header(FCREPO_URI).isNotNull()) .inOnly("{{reindexing.stream}}?disableTimeToLive=true"); }

Target:
public void configure() throws Exception { onException(Exception.class) .redeliveryDelay("{{error.retryDelay}}") .maximumRedeliveries("{{error.maxRedeliveries}}") .backOffMultiplier("{{error.backOffMultiplier}}") .retryAttemptedLogLevel(LoggingLevel.WARN); from("{{cdr.triplesupdate.stream.camel}}") .routeId("TripleIndexingRoute") .bean(indexingMessageProcessor) .log(INFO, "Received triple reindexing update message: ${headers[CamelFcrepoUri]}") .inOnly("{{reindexing.stream}}?disableTimeToLive=true"); from("{{reindexing.stream}}?asyncConsumer=true") .routeId("FcrepoReindexingTraverse") .log(INFO, "Reindexing ${headers[CamelFcrepoUri]}") .inOnly("{{triplestore.reindex.stream}}") .to("fcrepo:{{fcrepo.baseUrl}}?preferInclude=PreferContainment" + "&preferOmit=ServerManaged&accept=application/n-triples") .split(body().tokenize("\\n")).streaming() .removeHeader(FCREPO_URI) .removeHeader("JMSCorrelationID") .process(exchange -> { final String body = exchange.getIn().getBody(String.class); if (body != null) { final String parts[] = body.split("\\s+"); if (parts.length > 2 && parts[1].equals(LDP_CONTAINS) && parts[2].startsWith("<")) { exchange.getIn().setHeader(FCREPO_URI, parts[2].substring(1, parts[2].length() - 1)); } exchange.getIn().setBody(null); } }) .filter(header(FCREPO_URI).isNotNull()) .inOnly("{{reindexing.stream}}?disableTimeToLive=true"); }
Source:
private AggregationIterator(final SeekableView[] iterators, final long start_time, final long end_time, final Aggregator aggregator, final Interpolation method, final boolean rate) { LOG.debug(String.format("Aggregating %d iterators", iterators.length)); this.iterators = iterators; this.start_time = start_time; this.end_time = end_time; this.aggregator = aggregator; this.method = method; this.rate = rate; final int size = iterators.length; timestamps = new long[size * 2]; values = new long[size * 2]; int num_empty_spans = 0; for (int i = 0; i < size; i++) { SeekableView it = iterators[i]; it.seek(start_time); final DataPoint dp; try { dp = it.next(); } catch (NoSuchElementException e) { ++num_empty_spans; endReached(i); continue; } if (dp.timestamp() >= start_time) { putDataPoint(size + i, dp); } else { if (LOG.isDebugEnabled()) { LOG.debug(String.format("No DP in range for #%d: %d < %d", i, dp.timestamp(), start_time)); } endReached(i); continue; } if (rate) { if (it.hasNext()) { moveToNext(i); } else { endReached(i); } } } if (num_empty_spans > 0) { LOG.debug(String.format("%d out of %d spans are empty!", num_empty_spans, size)); } }

Target:
private AggregationIterator(final SeekableView[] iterators, final long start_time, final long end_time, final Aggregator aggregator, final Interpolation method, final boolean rate) { LOG.debug("Aggregating iterators", iterators.length); this.iterators = iterators; this.start_time = start_time; this.end_time = end_time; this.aggregator = aggregator; this.method = method; this.rate = rate; final int size = iterators.length; timestamps = new long[size * 2]; values = new long[size * 2]; int num_empty_spans = 0; for (int i = 0; i < size; i++) { SeekableView it = iterators[i]; it.seek(start_time); final DataPoint dp; try { dp = it.next(); } catch (NoSuchElementException e) { ++num_empty_spans; endReached(i); continue; } if (dp.timestamp() >= start_time) { putDataPoint(size + i, dp); } else { if (LOG.isDebugEnabled()) { LOG.debug(String.format("No DP in range for #%d: %d < %d", i, dp.timestamp(), start_time)); } endReached(i); continue; } if (rate) { if (it.hasNext()) { moveToNext(i); } else { endReached(i); } } } if (num_empty_spans > 0) { LOG.debug(String.format("%d out of %d spans are empty!", num_empty_spans, size)); } }
Source:
public static boolean isDummy(Result result) { if (result.rawCells().length != 1) { return false; } Cell cell = result.rawCells()[0]; return Bytes.compareTo(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength(), EMPTY_BYTE_ARRAY, 0, EMPTY_BYTE_ARRAY.length) == 0 && Bytes.compareTo(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength(), EMPTY_BYTE_ARRAY, 0, EMPTY_BYTE_ARRAY.length) == 0; }

Target:
public static boolean isDummy(Result result) { if (result.rawCells().length != 1) { return false; } Cell cell = result.rawCells()[0]; return CellUtil.matchingColumn(cell, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY); }
Source:
@Override protected void closeInternal() { try { idx.close(); } catch (Exception ex) { onError(ex); } super.closeInternal(); }

Target:
@Override protected void closeInternal() { try { scan.close(); } catch (Exception ex) { onError(ex); } try { idx.close(); } catch (Exception ex) { onError(ex); } super.closeInternal(); }