auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void register() { registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectArenas"), (Gauge<Integer>) () -> getNumDirectArenas()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapArenas"), (Gauge<Integer>) () -> getNumHeapArenas()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberThreadLocalCaches"), (Gauge<Integer>) () -> getNumThreadLocalCaches()); registry.register(MetricRegistry.name(NettyMetrics.class, "UsedHeapMemory"), (Gauge<Long>) () -> getUsedHeapMemory()); registry.register(MetricRegistry.name(NettyMetrics.class, "UsedDirectMemory"), (Gauge<Long>) () -> getUsedDirectMemory()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalAlloocations"), (Gauge<Long>) () -> getNumHeapTotalAllocations()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalDealloocations"), (Gauge<Long>) () -> getNumHeapTotalDeallocations()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalActiveAlloocations"), (Gauge<Long>) () -> getNumHeapTotalActiveAllocations()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalAlloocations"), (Gauge<Long>) () -> getNumDirectTotalAllocations()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalDealloocations"), (Gauge<Long>) () -> getNumDirectTotalDeallocations()); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalActiveAlloocations"), (Gauge<Long>) () -> getNumDirectTotalActiveAllocations()); }

Target:
private void register() { registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectArenas"), (Gauge<Integer>) this::getNumDirectArenas); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapArenas"), (Gauge<Integer>) this::getNumHeapArenas); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberThreadLocalCaches"), (Gauge<Integer>) this::getNumThreadLocalCaches); registry.register(MetricRegistry.name(NettyMetrics.class, "UsedHeapMemory"), (Gauge<Long>) this::getUsedHeapMemory); registry.register(MetricRegistry.name(NettyMetrics.class, "UsedDirectMemory"), (Gauge<Long>) this::getUsedDirectMemory); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalAllocations"), (Gauge<Long>) this::getNumHeapTotalAllocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalDeallocations"), (Gauge<Long>) this::getNumHeapTotalDeallocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberHeapTotalActiveAllocations"), (Gauge<Long>) this::getNumHeapTotalActiveAllocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalAllocations"), (Gauge<Long>) this::getNumDirectTotalAllocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalDeallocations"), (Gauge<Long>) this::getNumDirectTotalDeallocations); registry.register(MetricRegistry.name(NettyMetrics.class, "NumberDirectTotalActiveAllocations"), (Gauge<Long>) this::getNumDirectTotalActiveAllocations); }
Source:
private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Label lbl = p.getAssignedLabel(); String fullDisplayName = p.task.getFullDisplayName(); if (lbl != null && lbl.equals(h.getSelfLabel())) { if (h.canTake(p) == null) { return createFlyWeightTaskRunnable(p, fullDisplayName, h.toComputer()); } else { return null; } } Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); for (Node n : hash.list(fullDisplayName)) { final Computer c = n.toComputer(); if (c == null || c.isOffline()) { continue; } if (lbl!=null && !lbl.contains(n)) { continue; } if (n.canTake(p) != null) { continue; } return createFlyWeightTaskRunnable(p, fullDisplayName, c); } } return null; }

Target:
private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Label lbl = p.getAssignedLabel(); if (lbl != null && lbl.equals(h.getSelfLabel())) { if (h.canTake(p) == null) { return createFlyWeightTaskRunnable(p, h.toComputer()); } else { return null; } } Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); String fullDisplayName = p.task.getFullDisplayName(); for (Node n : hash.list(fullDisplayName)) { final Computer c = n.toComputer(); if (c == null || c.isOffline()) { continue; } if (lbl!=null && !lbl.contains(n)) { continue; } if (n.canTake(p) != null) { continue; } return createFlyWeightTaskRunnable(p, c); } } return null; }
Source:
public ProcessDefinition processDefinition(String processDefinitionId) { org.activiti.engine.repository.ProcessDefinition processDefinition = null; try { processDefinition = repositoryService.getProcessDefinition(processDefinitionId); } catch (Exception internalEx) { } if (processDefinition == null) { List<org.activiti.engine.repository.ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().processDefinitionKey(processDefinitionId).list(); if (!list.isEmpty()) { processDefinition = list.get(0); } else { throw new NotFoundException("Unable to find process definition for the given key:'" + processDefinitionId + "'"); } } if (!securityPoliciesManager.canRead(processDefinition.getKey())) { throw new ActivitiObjectNotFoundException("Unable to find process definition for the given id:'" + processDefinitionId + "'"); } return processDefinitionConverter.from(processDefinition); }

Target:
public ProcessDefinition processDefinition(String processDefinitionId) { org.activiti.engine.repository.ProcessDefinition processDefinition; List<org.activiti.engine.repository.ProcessDefinition> list = repositoryService .createProcessDefinitionQuery() .processDefinitionKey(processDefinitionId) .orderByProcessDefinitionVersion() .asc() .list(); if (!list.isEmpty()) { processDefinition = list.get(0); } else { processDefinition = repositoryService.getProcessDefinition(processDefinitionId); } if (!securityPoliciesManager.canRead(processDefinition.getKey())) { throw new ActivitiObjectNotFoundException("Unable to find process definition for the given id:'" + processDefinitionId + "'"); } return processDefinitionConverter.from(processDefinition); }
Source:
public void setMinimum(final String minimum) { if (minimum == null) { this.minimum = null; } else if (isPercent(minimum)) { this.minimum = percentToBigDecimal(minimum); } else { this.minimum = new BigDecimal(minimum); } }

Target:
public void setMinimum(final String minimum) { this.minimum = parseValue(minimum); }
Source:
private ClassData build(EntityDto entity, List<FieldDto> fields, EntityType type, Bundle bundle) { try { CtClass declaring = makeClass(entity, fields, type, bundle); switch (type) { case HISTORY: String className = type.getClassName(entity.getClassName()); String simpleName = ClassName.getSimpleName(className); TypeDto idType = TypeDto.LONG; addProperty( declaring, idType.getTypeClass(), simpleName + Constants.HistoryTrash.CURRENT_VERSION, null ); addProperty( declaring, Long.class.getName(), simpleName + Constants.HistoryTrash.SCHEMA_VERSION, null ); break; case TRASH: addProperty(declaring, Long.class.getName(), Constants.HistoryTrash.SCHEMA_VERSION, null); break; default: } return new ClassData( declaring.getName(), entity.getModule(), entity.getNamespace(), declaring.toBytecode(), type ); } catch (ReflectiveOperationException | CannotCompileException | IOException | NotFoundException e) { throw new EntityCreationException("Unable to create entity " + entity.getName(), e); } }

Target:
private ClassData build(EntityDto entity, List<FieldDto> fields, EntityType type, Bundle bundle) { try { CtClass declaring = makeClass(entity, fields, type, bundle); switch (type) { case HISTORY: String className = type.getClassName(entity.getClassName()); String simpleName = ClassName.getSimpleName(className); TypeDto idType = TypeDto.LONG; addProperty( declaring, idType.getTypeClass(), simpleName + Constants.Util.CURRENT_VERSION, null ); addProperty( declaring, Long.class.getName(), simpleName + StringUtils.capitalize(Constants.Util.SCHEMA_VERSION_FIELD_NAME), null ); break; case TRASH: addProperty(declaring, Long.class.getName(), Constants.Util.SCHEMA_VERSION_FIELD_NAME, null); break; default: } return new ClassData( declaring.getName(), entity.getModule(), entity.getNamespace(), declaring.toBytecode(), type ); } catch (ReflectiveOperationException | CannotCompileException | IOException | NotFoundException e) { throw new EntityCreationException("Unable to create entity " + entity.getName(), e); } }
Source:
private FilterCache() { loader = new Thread(this::loadFromPreferences); loader.setDaemon(true); loader.start(); }

Target:
private FilterCache() { }
Source:
public void handleEventFromOperator(int subtask, OperatorEvent event) throws Exception { Preconditions.checkArgument( event instanceof CollectSinkAddressEvent, "Operator event must be a CollectSinkAddressEvent"); address = ((CollectSinkAddressEvent) event).getAddress(); LOG.debug("Received sink socket server address: " + address); socket = null; }

Target:
public void handleEventFromOperator(int subtask, OperatorEvent event) throws Exception { Preconditions.checkArgument( event instanceof CollectSinkAddressEvent, "Operator event must be a CollectSinkAddressEvent"); address = ((CollectSinkAddressEvent) event).getAddress(); LOG.info("Received sink socket server address: " + address); }
Source:
public Pair<String, String> postRequestWithParams(String restPath, List<NameValuePair> params){ HttpPost httpPost = new HttpPost(prepareRequestURL(restPath, params)); CloseableHttpResponse response = null; try { httpPost.setEntity(new UrlEncodedFormEntity(params)); response = httpclient.execute(httpPost); HttpEntity entity = response.getEntity(); String content = ""; int status = response.getStatusLine().getStatusCode(); if(status == 200) { content = EntityUtils.toString(entity); }else{ content =response.getStatusLine().getReasonPhrase(); } EntityUtils.consume(entity); return new Pair<String, String>(String.valueOf(status), content); } catch (UnsupportedEncodingException e) { e.printStackTrace(); return null; } catch (ClientProtocolException e) { e.printStackTrace(); return null; } catch (IOException e) { e.printStackTrace(); return null; }finally { try { response.close(); } catch (IOException e) { e.printStackTrace(); return new Pair<>("500", "Post Exception for: " + httpPost.toString()); } } }

Target:
public Pair<String, String> postRequestWithParams(String restPath, List<NameValuePair> params){ log.info("Posting request for " + this.serviceURL + restPath); HttpPost httpPost = new HttpPost(prepareRequestURL(restPath, params)); CloseableHttpResponse response = null; try { httpPost.setEntity(new UrlEncodedFormEntity(params)); response = httpclient.execute(httpPost); HttpEntity entity = response.getEntity(); String content = ""; int status = response.getStatusLine().getStatusCode(); if(status == 200) { content = EntityUtils.toString(entity); }else{ content =response.getStatusLine().getReasonPhrase(); } EntityUtils.consume(entity); log.info("Post success"); return new Pair<String, String>(String.valueOf(status), content); } catch (UnsupportedEncodingException e) { log.error(e.getCause().getMessage(), e); return new Pair<String, String>("500", "Exception: " + e.getCause().getMessage()); } catch (ClientProtocolException e) { log.error("ClientProtocolException"); return new Pair<String, String>("500", "Exception: " + e.getCause().getMessage()); } catch (IOException e) { log.error("IOException"); return new Pair<String, String>("500", "Exception: " + e.getCause().getMessage()); }finally { try { response.close(); } catch (IOException e) { log.error("IOException", e); return new Pair<String, String>("500", "Exception: " + e.getCause().getMessage()); } } }
Source:
public void start() throws Exception { System.setProperty( "java.net.preferIPv4Stack", "true" ); System.setProperty( "io.netty.selectorAutoRebuildThreshold", "0" ); if ( System.getProperty( "io.netty.leakDetectionLevel" ) == null ) { ResourceLeakDetector.setLevel( ResourceLeakDetector.Level.DISABLED ); } eventLoops = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); workerEventLoop = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); File moduleDirectory = new File( "modules" ); moduleManager.load( this, moduleDirectory ); pluginManager.detectPlugins( moduleDirectory ); pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); pluginManager.loadPlugins(); config.load(); registerChannel( ForgeConstants.FML_TAG ); registerChannel( ForgeConstants.FML_HANDSHAKE_TAG ); registerChannel( ForgeConstants.FORGE_REGISTER ); isRunning = true; pluginManager.enablePlugins(); connectionThrottle = new ConnectionThrottle( config.getThrottle() ); startListeners(); saveThread.scheduleAtFixedRate( new TimerTask() { @Override public void run() { if ( getReconnectHandler() != null ) { getReconnectHandler().save(); } } }, 0, TimeUnit.MINUTES.toMillis( 5 ) ); metricsThread.scheduleAtFixedRate( new Metrics(), 0, TimeUnit.MINUTES.toMillis( Metrics.PING_INTERVAL ) ); }

Target:
public void start() throws Exception { System.setProperty( "java.net.preferIPv4Stack", "true" ); System.setProperty( "io.netty.selectorAutoRebuildThreshold", "0" ); if ( System.getProperty( "io.netty.leakDetectionLevel" ) == null ) { ResourceLeakDetector.setLevel( ResourceLeakDetector.Level.DISABLED ); } bossEventLoop = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Boss IO Thread #%1$d" ).build() ); workerEventLoop = PipelineUtils.newEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty Worker IO Thread #%1$d" ).build() ); File moduleDirectory = new File( "modules" ); moduleManager.load( this, moduleDirectory ); pluginManager.detectPlugins( moduleDirectory ); pluginsFolder.mkdir(); pluginManager.detectPlugins( pluginsFolder ); pluginManager.loadPlugins(); config.load(); registerChannel( ForgeConstants.FML_TAG ); registerChannel( ForgeConstants.FML_HANDSHAKE_TAG ); registerChannel( ForgeConstants.FORGE_REGISTER ); isRunning = true; pluginManager.enablePlugins(); connectionThrottle = new ConnectionThrottle( config.getThrottle() ); startListeners(); saveThread.scheduleAtFixedRate( new TimerTask() { @Override public void run() { if ( getReconnectHandler() != null ) { getReconnectHandler().save(); } } }, 0, TimeUnit.MINUTES.toMillis( 5 ) ); metricsThread.scheduleAtFixedRate( new Metrics(), 0, TimeUnit.MINUTES.toMillis( Metrics.PING_INTERVAL ) ); }
Source:
public Group groupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, NotMemberOfParentGroupException, WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, NotGroupMemberException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); if ( (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup)) ) { throw new PrivilegeException(sess, "groupUnion"); } Group result = getGroupsManagerBl().groupUnion(sess, resultGroup, operandGroup); return result; }

Target:
public Group groupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupOperationsException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, resultGroup); getGroupsManagerBl().checkGroupExists(sess, operandGroup); if ( (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, resultGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, resultGroup)) || (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, operandGroup) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, operandGroup)) ) { throw new PrivilegeException(sess, "groupUnion"); } return getGroupsManagerBl().groupUnion(sess, resultGroup, operandGroup); }
Source:
public String toString() { return new StringJoiner(", ", TimeDimension.class.getSimpleName() + "[", "]") .add("timeZone=" + getTimeZone().getDisplayName()) .add("timeGrains=" + Arrays.stream(getSupportedGrains()) .map(TimeGrainDefinition::grain) .collect(Collectors.toSet())) .add("columnType=" + getColumnType()) .add("name='" + getName() + "'") .add("longName='" + getLongName() + "'") .add("description='" + getDescription() + "'") .add("dimensionType=" + getDimensionType()) .add("dataType=" + getDataType()) .add("cardinality=" + getCardinality()) .add("friendlyName='" + getFriendlyName() + "'") .toString(); }

Target:
public String toString() { return new StringJoiner(", ", TimeDimension.class.getSimpleName() + "[", "]") .add("timeZone=" + getTimeZone().getDisplayName()) .add("timeGrains=" + getSupportedGrains() .stream() .map(TimeGrainDefinition::grain) .collect(Collectors.toSet())) .add("columnType=" + getColumnType()) .add("name='" + getName() + "'") .add("longName='" + getLongName() + "'") .add("description='" + getDescription() + "'") .add("dimensionType=" + getDimensionType()) .add("dataType=" + getDataType()) .add("cardinality=" + getCardinality()) .add("friendlyName='" + getFriendlyName() + "'") .toString(); }
Source:
public AbfsOutputStream( final AbfsClient client, final String path, final long position, final int bufferSize, final boolean supportFlush, final boolean disableOutputStreamFlush, final boolean supportAppendWithFlush, final boolean appendBlob) { this.client = client; this.path = path; this.position = position; this.closed = false; this.disableOutputStreamFlush = disableOutputStreamFlush; this.supportFlush = supportFlush; this.supportAppendWithFlush = supportAppendWithFlush; this.lastError = null; this.lastFlushOffset = 0; this.bufferSize = bufferSize; this.buffer = byteBufferPool.getBuffer(false, bufferSize).array(); this.bufferIndex = 0; this.writeOperations = new ConcurrentLinkedDeque<>(); if (appendBlob) { this.maxConcurrentRequestCount = 1; } else { this.maxConcurrentRequestCount = 4 * Runtime.getRuntime().availableProcessors(); } this.threadExecutor = new ThreadPoolExecutor(maxConcurrentRequestCount, maxConcurrentRequestCount, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue<>()); this.completionService = new ExecutorCompletionService<>(this.threadExecutor); }

Target:
public AbfsOutputStream( final AbfsClient client, final String path, final long position, final int bufferSize, final boolean supportFlush, final boolean disableOutputStreamFlush, final boolean supportAppendWithFlush, final boolean appendBlob) { this.client = client; this.path = path; this.position = position; this.closed = false; this.disableOutputStreamFlush = disableOutputStreamFlush; this.supportFlush = supportFlush; this.disableOutputStreamFlush = disableOutputStreamFlush; this.supportAppendWithFlush = supportAppendWithFlush; this.appendBlob = appendBlob; this.lastError = null; this.lastFlushOffset = 0; this.bufferSize = bufferSize; this.buffer = byteBufferPool.getBuffer(false, bufferSize).array(); this.bufferIndex = 0; this.writeOperations = new ConcurrentLinkedDeque<>(); this.maxConcurrentRequestCount = 4 * Runtime.getRuntime().availableProcessors(); this.threadExecutor = new ThreadPoolExecutor(maxConcurrentRequestCount, maxConcurrentRequestCount, 10L, TimeUnit.SECONDS, new LinkedBlockingQueue<>()); this.completionService = new ExecutorCompletionService<>(this.threadExecutor); }
Source:
private SafeHtml createBondTooltipMessage(HostInterfaceLineModel lineModel, InterfaceStatus interfaceStatus) { Bond bond = (Bond) lineModel.getInterface(); SafeHtml bondProperties = templates.plainTextAsSafeHtml(messages.bondStatus(interfaceStatus.toString())); if (!InterfaceStatus.UP.equals(interfaceStatus)) { return bondProperties; } String adPartnerMac = Objects.toString(bond.getAdPartnerMac(), ""); bondProperties = templates.addLineBreak(bondProperties, messages.bondAdPartnerMac(adPartnerMac)); String adAgregatorId = Objects.toString(bond.getAdAggregatorId(), ""); bondProperties = templates.addLineBreak(bondProperties, messages.bondAdAggregatorId(adAgregatorId)); for (HostInterface nic : lineModel.getInterfaces()) { String nicName = nic.getName(); String nicAggregatorId = Objects.toString(nic.getInterface().getAdAggregatorId()); bondProperties = templates.addLineBreak(bondProperties, messages.bondSlaveAdAggregatorId(nicName, nicAggregatorId)); } return bondProperties; }

Target:
private SafeHtml createBondTooltipMessage(HostInterfaceLineModel lineModel, InterfaceStatus interfaceStatus) { Bond bond = (Bond) lineModel.getInterface(); StringBuilder bondProperties = new StringBuilder(messages.bondStatus(interfaceStatus.toString())); if (InterfaceStatus.UP.equals(interfaceStatus)) { bondProperties.append("\n").append(createActiveBondTooltipMessage(bond, lineModel)); } return new SafeHtmlBuilder().appendEscapedLines(bondProperties.toString()).toSafeHtml(); }
Source:
public RealmQuery<E> in(String fieldName, String[] values, Case casing) { if (values == null || values.length == 0) { return this; } equalTo(fieldName, values[0], casing); for (int i = 1; i < values.length; ++i) { or().equalTo(fieldName, values[i], casing); } return this; }

Target:
public RealmQuery<E> in(String fieldName, String[] values, Case casing) { if (values == null || values.length == 0) { throw new IllegalArgumentException(EMPTY_VALUES); } beginGroup().equalTo(fieldName, values[0], casing); for (int i = 1; i < values.length; i++) { or().equalTo(fieldName, values[i], casing); } return endGroup(); }
Source:
public static Retry getNoRetry() { return Retry.NO_RETRY; }

Target:
public static Retry getNoRetry() { return new ExponentialRetry(Duration.ZERO, Duration.ZERO, 0); }
Source:
private void advanceIterator() { if (this.currentIterator != null) { this.currentIterator.close(); } if (!this.iterators.hasNext()) { this.currentIterator = null; return; } final Interval currInterval = this.intervals[this.currentIntervalIndex]; final Interval prevInterval = this.currentIntervalIndex == 0 ? null : this.intervals[this.currentIntervalIndex - 1]; final SamRecordFilter filter = new SamRecordFilter() { @Override public boolean filterOut(final SAMRecord record) { return record.getReadUnmappedFlag() && record.getAlignmentStart() != SAMRecord.NO_ALIGNMENT_START ? !this.acceptUnmappedRecord(record) : !this.acceptRecord(record); } @Override public boolean filterOut(final SAMRecord first, final SAMRecord second) { throw new UnsupportedOperationException(); } private boolean acceptRecord(final SAMRecord rec) { return BAMQueryChainingIterator.this.contained ? currInterval.contains(rec) && (prevInterval == null || !prevInterval.contains(rec)) : currInterval.overlaps(rec) && (prevInterval == null || !prevInterval.overlaps(rec)); } private boolean acceptUnmappedRecord(final SAMRecord rec) { final int start = rec.getStart(); final boolean matchesCurrInterval = rec.contigsMatch(currInterval) && CoordMath.encloses(currInterval.getStart(), currInterval.getEnd(), start, start); final boolean matchesPrevInterval = prevInterval != null && rec.contigsMatch(prevInterval) && CoordMath.encloses(prevInterval.getStart(), prevInterval.getEnd(), start, start); return matchesCurrInterval && !matchesPrevInterval; } }; this.currentIterator = new FilteringSamIterator(this.iterators.next().get(), filter, false); this.currentIntervalIndex++; }

Target:
private void advanceIterator() { if (this.currentIterator != null) { this.currentIterator.close(); } if (!this.iterators.hasNext()) { this.currentIterator = null; return; } final Locatable currInterval = this.intervals.get(this.currentIntervalIndex); final Locatable prevInterval = this.currentIntervalIndex == 0 ? null : this.intervals.get(this.currentIntervalIndex - 1); this.currentIterator = new FilteringSamIterator( this.iterators.next().get(), new ConsecutiveDuplicateRecordFilter(currInterval, prevInterval, contained)); this.currentIntervalIndex++; }
Source:
public PartitionedPageWriter() { checkArgument(temporalColumnIndex.isPresent() == temporalColumnType.isPresent(), "temporalColumnIndex and temporalColumnType must be both present or absent"); List<Type> bucketTypes = Arrays.stream(bucketFields) .mapToObj(columnTypes::get) .collect(toList()); this.bucketFunction = bucketCount.isPresent() ? Optional.of(new RaptorBucketFunction(bucketCount.getAsInt(), bucketTypes)) : Optional.empty(); this.temporalFunction = temporalColumnType.map(type -> temporalFunctionFactory.getTemporalFunction(type)); }

Target:
public PartitionedPageWriter() { checkArgument(temporalColumnIndex.isPresent() == temporalColumnType.isPresent(), "temporalColumnIndex and temporalColumnType must be both present or absent"); List<Type> bucketTypes = Arrays.stream(bucketFields) .mapToObj(columnTypes::get) .collect(toList()); this.bucketFunction = bucketCount.isPresent() ? Optional.of(new RaptorBucketFunction(bucketCount.getAsInt(), bucketTypes)) : Optional.empty(); }
Source:
public static URI createUri(final String jobId, final String path) throws URISyntaxException { final String encodedJobId = Base64.encodeBase64URLSafeString(jobId.getBytes()); return new URIBuilder() .setScheme(URI_SCHEME) .setHost(encodedJobId) .setPath(path) .build(); }

Target:
public static URI createUri(final String jobId, final String path) throws URISyntaxException { final String encodedJobId = Base64.encodeBase64URLSafeString(jobId.getBytes(Charset.defaultCharset())); return new URIBuilder() .setScheme(URI_SCHEME) .setHost(encodedJobId) .setPath(path) .build(); }
Source:
private Map<Guid, SubchainInfo> getDomainsToSnapshotsMap(List<SubchainInfo> snapshots) { Map<Guid, SubchainInfo> domainsToPairMap = new HashMap<>(); for (SubchainInfo subchain: snapshots) { Guid storageId = subchain.getBaseImage().getStorageIds().get(0); domainsToPairMap.put(storageId, subchain); } return domainsToPairMap; }

Target:
private Map<Guid, SubchainInfo> getDomainsToSnapshotsMap(List<SubchainInfo> snapshots) { Map<Guid, SubchainInfo> domainsToPairMap = new HashMap<>(); for (SubchainInfo subchain: snapshots) { Guid storageId = subchain.getStorageDomainId(); domainsToPairMap.put(storageId, subchain); } return domainsToPairMap; }
Source:
public void testHashSaltedPassword() throws Exception { String password = "test-password"; String salt = pwGenerator.generateSalt(); int hashIterations = 1024; String hash1 = pwGenerator.hashPassword(password, salt, hashIterations); String hash2 = pwGenerator.hashPassword(password, salt, hashIterations); Assert.assertEquals(hash1, hash2); String salt2 = pwGenerator.generateSalt(); String hash3 = pwGenerator.hashPassword(password, salt2, hashIterations); Assert.assertFalse(hash1.equals(hash3)); String hash4 = pwGenerator.hashPassword(password, salt, 1); Assert.assertFalse(hash1.equals(hash4)); }

Target:
public void testHashSaltedPassword() throws Exception { String password = "test-password"; String salt = pwGenerator.generateSalt(); int hashIterations = 1024; String hash1 = pwGenerator.hashPassword(password, salt, hashIterations); String hash2 = pwGenerator.hashPassword(password, salt, hashIterations); assertThat(hash2, is(hash1)); String salt2 = pwGenerator.generateSalt(); String hash3 = pwGenerator.hashPassword(password, salt2, hashIterations); assertThat(hash3, not(hash1)); String hash4 = pwGenerator.hashPassword(password, salt, 1); assertThat(hash4, not(hash1)); }
Source:
private Ds3ClientHelpers.Job innerStartReadJob(final String bucket, final Iterable<Ds3Object> objectsToRead, final ReadJobOptions options) throws SignatureException, IOException, XmlProcessingException { final List<Ds3Object> objects = Lists.newArrayList(objectsToRead); final BulkGetResponse prime = this.client.bulkGet(new BulkGetRequest(bucket, objects) .withChunkOrdering(ChunkClientProcessingOrderGuarantee.NONE) .withPriority(options.getPriority())); final ImmutableMultimap<String, Range> partialRanges = PartialObjectHelpers.getPartialObjectsRanges(objects); final MasterObjectList mob = prime.getResult(); final ImmutableMultimap<BulkObject, Range> blobtoRanges = PartialObjectHelpers.mapRangesToBlob(mob.getObjects(), partialRanges); return new ReadJobImpl(this.client, mob, blobtoRanges); }

Target:
private Ds3ClientHelpers.Job innerStartReadJob(final String bucket, final Iterable<Ds3Object> objectsToRead, final ReadJobOptions options) throws SignatureException, IOException, XmlProcessingException { final List<Ds3Object> objects = Lists.newArrayList(objectsToRead); final BulkGetResponse prime = this.client.bulkGet(new BulkGetRequest(bucket, objects) .withChunkOrdering(ChunkClientProcessingOrderGuarantee.NONE) .withPriority(options.getPriority())); final ImmutableMultimap<String, Range> partialRanges = PartialObjectHelpers.getPartialObjectsRanges(objects); return new ReadJobImpl(this.client, prime.getResult(), partialRanges); }
Source:
protected void showPackageFilter() { final Collection<String> packages; if (getCollector() instanceof TargetPlatformClassContributionCollector) { packages = TargetPlatformClassContributionCollector.getInstance().getPackages(); } else if (getCollector() instanceof TargetPlatformIconContributionCollector) { packages = TargetPlatformIconContributionCollector.getInstance().getPackages(); } else { return; } final ArrayList<String> sorted = new ArrayList<String>(packages); Collections.sort(sorted); TitleAreaFilterDialog dlg = new TitleAreaFilterDialog(getShell(), new ColumnLabelProvider()) { @Override protected Control createContents(Composite parent) { Control ret = super.createContents(parent); getViewer().setInput(sorted); setMessage("Select the package to filter on."); setTitle("Package Filter"); getShell().setText("Package Filter"); setTitleImage(new Image(getShell().getDisplay(), getClass().getResourceAsStream("/icons/full/wizban/package_wiz.png"))); return ret; } }; if (dlg.open() == Dialog.OK) { setFilterPackages((List<String>) dlg.asList()); refreshSearch(); } updateUiState(); }

Target:
protected void showPackageFilter() { final Collection<String> packages; if (getCollector() instanceof TargetPlatformClassContributionCollector) { packages = TargetPlatformClassContributionCollector.getInstance().getPackages(); } else if (getCollector() instanceof TargetPlatformIconContributionCollector) { packages = TargetPlatformIconContributionCollector.getInstance().getPackages(); } else { return; } final ArrayList<String> sorted = new ArrayList<String>(packages); Collections.sort(sorted); TitleAreaFilterDialog dlg = new TitleAreaFilterDialog(getShell(), new ColumnLabelProvider()) { @Override protected Control createContents(Composite parent) { Control ret = super.createContents(parent); getViewer().setInput(sorted); setMessage("Select the package to filter on."); setTitle("Package Filter"); getShell().setText("Package Filter"); setTitleImage(imageCache.create("/icons/full/wizban/package_wiz.png")); return ret; } }; if (dlg.open() == Dialog.OK) { setFilterPackages((List<String>) dlg.asList()); refreshSearch(); } updateUiState(); }
Source:
public Collection<RepositoryMapping> find(IProgressMonitor m, boolean searchLinkedFolders) throws CoreException { IProgressMonitor monitor; if (m == null) monitor = new NullProgressMonitor(); else monitor = m; find(monitor, proj, searchLinkedFolders); return results; }

Target:
public List<RepositoryMapping> find(IProgressMonitor m, boolean searchLinkedFolders) throws CoreException { find(m, proj, searchLinkedFolders); return results; }
Source:
public void testEdgeLabelMoveFromBorder() { String diagramName = "EdgeWith3SegmentsHVH"; diagramEditor = setUpEditorAccordingToDimensions(diagramName, ZoomLevel.ZOOM_100); SWTBotGefEditPart editPart = diagramEditor.getEditPart("refToBBegin"); GraphicalEditPart part = (GraphicalEditPart) editPart.part(); diagramEditor.click("refToBBegin"); SWTBotUtils.waitAllUiEvents(); IFigure figure = part.getFigure(); figure.translateToAbsolute(figure.getBounds()); diagramEditor.dragWithKey(part.getFigure().getBounds().x, part.getFigure().getBounds().y, part.getFigure().getBounds().x - 10, part.getFigure().getBounds().y - 10, SWT.None); SWTBotUtils.waitAllUiEvents(); assertEquals(172, part.getFigure().getBounds().x); assertEquals(94, part.getFigure().getBounds().y); }

Target:
public void testEdgeLabelMoveFromBorder() { String diagramName = "EdgeWith3SegmentsHVH"; diagramEditor = setUpEditorAccordingToDimensions(diagramName, ZoomLevel.ZOOM_100); SWTBotGefEditPart editPart = diagramEditor.getEditPart("refToBBegin"); GraphicalEditPart part = (GraphicalEditPart) editPart.part(); IFigure figure = part.getFigure(); figure.translateToAbsolute(figure.getBounds()); int originalX = part.getFigure().getBounds().x; int originalY = part.getFigure().getBounds().y; CheckEditPartMoved checkEditPartMoved = new CheckEditPartMoved(editPart); diagramEditor.dragWithKey(part.getFigure().getBounds().x, part.getFigure().getBounds().y, part.getFigure().getBounds().x - 10, part.getFigure().getBounds().y - 10, SWT.None); bot.waitUntil(checkEditPartMoved); assertEquals(originalX - 10, part.getFigure().getBounds().x); assertEquals(originalY - 10, part.getFigure().getBounds().y); }
Source:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); setHasOptionsMenu(true); View rootView = inflater.inflate(R.layout.pager_fragment, container, false); viewPager = rootView.findViewById(R.id.viewpager); toolbar = rootView.findViewById(R.id.toolbar); viewPager.setAdapter(new StatisticsPagerAdapter(this)); tabLayout = rootView.findViewById(R.id.sliding_tabs); new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> { switch (position) { case POS_LISTENED_HOURS: tab.setText(R.string.playback_statistics_label); break; case POS_SPACE_TAKEN: tab.setText(R.string.download_statistics_label); break; default: break; } }).attach(); if (getActivity().getClass() == PreferenceActivity.class) { rootView.findViewById(R.id.toolbar).setVisibility(View.GONE); } else { toolbar.setTitle(getString(R.string.statistics_label)); } return rootView; }

Target:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); setHasOptionsMenu(true); View rootView = inflater.inflate(R.layout.pager_fragment, container, false); viewPager = rootView.findViewById(R.id.viewpager); toolbar = rootView.findViewById(R.id.toolbar); viewPager.setAdapter(new StatisticsPagerAdapter(this)); tabLayout = rootView.findViewById(R.id.sliding_tabs); new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> { switch (position) { case POS_LISTENED_HOURS: tab.setText(R.string.playback_statistics_label); break; case POS_SPACE_TAKEN: tab.setText(R.string.download_statistics_label); break; default: break; } }).attach(); if (getActivity().getClass() == PreferenceActivity.class) { rootView.findViewById(R.id.toolbar).setVisibility(View.GONE); } else { toolbar.setTitle(getString(R.string.statistics_label)); toolbar.setNavigationOnClickListener(v -> getParentFragmentManager().popBackStack()); } return rootView; }
Source:
public void testLeftJoinMissingStats() { PlanNodeStatsEstimate leftStats = planNodeStats( 0, new SymbolStatistics(LEFT_JOIN_COLUMN, SymbolStatsEstimate.unknown()), new SymbolStatistics(LEFT_OTHER_COLUMN, SymbolStatsEstimate.unknown())); PlanNodeStatsEstimate rightStats = planNodeStats( 0, new SymbolStatistics(RIGHT_JOIN_COLUMN, SymbolStatsEstimate.unknown()), new SymbolStatistics(RIGHT_OTHER_COLUMN, SymbolStatsEstimate.unknown())); assertJoinStats(LEFT, leftStats, rightStats, leftStats); }

Target:
public void testLeftJoinMissingStats() { PlanNodeStatsEstimate leftStats = planNodeStats( 0, new SymbolStatistics(LEFT_JOIN_COLUMN, SymbolStatsEstimate.unknown()), new SymbolStatistics(LEFT_OTHER_COLUMN, SymbolStatsEstimate.unknown())); PlanNodeStatsEstimate rightStats = planNodeStats( 0, new SymbolStatistics(RIGHT_JOIN_COLUMN, SymbolStatsEstimate.unknown()), new SymbolStatistics(RIGHT_OTHER_COLUMN, SymbolStatsEstimate.unknown())); assertJoinStats(LEFT, leftStats, rightStats, PlanNodeStatsEstimate.unknown()); }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK && requestCode == DirectoryChooserActivity.RESULT_CODE_DIR_SELECTED) { String dir = data.getStringExtra(DirectoryChooserActivity.RESULT_SELECTED_DIR); File path; if (dir != null) { path = new File(dir); } else { path = getActivity().getExternalFilesDir(null); } String message = null; final Context context = getActivity().getApplicationContext(); if (!path.exists()) { message = String.format(context.getString(R.string.folder_does_not_exist_error), dir); } else if (!path.canRead()) { message = String.format(context.getString(R.string.folder_not_readable_error), dir); } else if (!path.canWrite()) { message = String.format(context.getString(R.string.folder_not_writable_error), dir); } if (message == null) { Log.d(TAG, "Setting data folder: " + dir); UserPreferences.setDataFolder(dir); setDataFolderText(); } else { AlertDialog.Builder ab = new AlertDialog.Builder(getActivity()); ab.setMessage(message); ab.setPositiveButton(android.R.string.ok, null); ab.show(); } } if (resultCode == Activity.RESULT_OK && requestCode == CHOOSE_OPML_EXPORT_PATH) { Uri uri = data.getData(); export(new OpmlWriter(), uri); } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK && requestCode == DirectoryChooserActivity.RESULT_CODE_DIR_SELECTED) { String dir = data.getStringExtra(DirectoryChooserActivity.RESULT_SELECTED_DIR); File path; if (dir != null) { path = new File(dir); } else { path = getActivity().getExternalFilesDir(null); } String message = null; final Context context = getActivity().getApplicationContext(); if (!path.exists()) { message = String.format(context.getString(R.string.folder_does_not_exist_error), dir); } else if (!path.canRead()) { message = String.format(context.getString(R.string.folder_not_readable_error), dir); } else if (!path.canWrite()) { message = String.format(context.getString(R.string.folder_not_writable_error), dir); } if (message == null) { Log.d(TAG, "Setting data folder: " + dir); UserPreferences.setDataFolder(dir); setDataFolderText(); } else { AlertDialog.Builder ab = new AlertDialog.Builder(getActivity()); ab.setMessage(message); ab.setPositiveButton(android.R.string.ok, null); ab.show(); } } if (resultCode == Activity.RESULT_OK && requestCode == CHOOSE_OPML_EXPORT_PATH) { Uri uri = data.getData(); export(new OpmlWriter(), uri); } if (resultCode == Activity.RESULT_OK && requestCode == CHOOSE_HTML_EXPORT_PATH) { Uri uri = data.getData(); export(new HtmlWriter(), uri); } }
Source:
public <T> Iterator<List<T>> split(Iterator<T> inputIterator, Function<T, InputFileAttribute> inputAttributeExtractor) { return new Iterator<List<T>>() { private T peeking; @Override public boolean hasNext() { return peeking != null || inputIterator.hasNext(); } @Override public List<T> next() { final List<T> current = new ArrayList<>(); long splitSize = 0; while (splitSize < maxSplitSize && (peeking != null || inputIterator.hasNext())) { if (peeking == null) { peeking = inputIterator.next(); } final long size = inputAttributeExtractor.apply(peeking).getSize(); if (current.isEmpty()) { current.add(peeking); splitSize += size; peeking = null; } else if (splitSize + size < maxSplitSize) { current.add(peeking); splitSize += size; peeking = null; } else { break; } } assert !current.isEmpty(); return current; } }; }

Target:
public <T> Iterator<List<T>> split(Iterator<T> inputIterator, Function<T, InputFileAttribute> inputAttributeExtractor) { return new Iterator<List<T>>() { private T peeking; @Override public boolean hasNext() { return peeking != null || inputIterator.hasNext(); } @Override public List<T> next() { if (!hasNext()) { throw new NoSuchElementException(); } final List<T> current = new ArrayList<>(); long splitSize = 0; while (splitSize < maxSplitSize && (peeking != null || inputIterator.hasNext())) { if (peeking == null) { peeking = inputIterator.next(); } final long size = inputAttributeExtractor.apply(peeking).getSize(); if (current.isEmpty() || splitSize + size < maxSplitSize) { current.add(peeking); splitSize += size; peeking = null; } else { break; } } assert !current.isEmpty(); return current; } }; }
Source:
public EquipmentDefinition(int id, int index, boolean twoHanded, boolean fullBody, boolean fullHelmet, Requirement[] requirements, int[] bonuses) { this.id = id; this.index = index; this.twoHanded = twoHanded; this.fullBody = fullBody; this.fullHelmet = fullHelmet; this.requirements = List.of(requirements); this.bonuses = bonuses.clone(); }

Target:
public EquipmentDefinition(int id, int index, boolean twoHanded, boolean fullBody, boolean fullHelmet, Requirement[] requirements, int[] bonuses) { this.id = id; this.index = index; this.twoHanded = twoHanded; this.fullBody = fullBody; this.fullHelmet = fullHelmet; this.requirements = ImmutableList.copyOf(requirements); this.bonuses = Arrays.copyOf(bonuses, bonuses.length); }
Source:
private static String expandIpv6String(String ipv6Addr) { List<String> list = Stream.of(ipv6Addr.split(COLON, -1)) .collect(Collectors.toList()); int emptyIndex = list.indexOf(EMPTY_STRING); if (emptyIndex >= 0) { list = list.stream() .filter(s -> !s.isEmpty()) .collect(Collectors.toList()); int expandCount = 8 - list.size(); for (int i = 0; i < expandCount; i++) { list.add(emptyIndex, ZERO_STRING); } } return list.stream() .map(IPAddressConverter::prependZeroes) .collect(Collectors.joining()); }

Target:
private String expandIpv6String(String ipv6Addr) { List<String> list = Stream.of(ipv6Addr.split(COLON, -1)) .collect(Collectors.toList()); int emptyIndex = list.indexOf(EMPTY_STRING); if (emptyIndex >= 0) { list = list.stream() .filter(s -> !s.isEmpty()) .collect(Collectors.toList()); int expandCount = 8 - list.size(); for (int i = 0; i < expandCount; i++) { list.add(emptyIndex, ZERO_STRING); } } return list.stream() .map(this::prependZeroes) .collect(Collectors.joining()); }
Source:
public DocumentModel run(DocumentModel doc) throws OperationException, IOException { if (index != null) { Property complexProperty = doc.getProperty(xpath); ListType ltype = (ListType) complexProperty.getField().getType(); if (!ltype.getFieldType().isComplexType() && !ltype.isListType()) { throw new OperationException("Property type is not supported by this operation"); } ListProperty listProperty = (ListProperty) complexProperty; ArrayList propertiesValues = (ArrayList) listProperty.getValue(); propertiesValues.remove(index.intValue()); listProperty.clear(); listProperty.setValue(propertiesValues); } else { Property complexProperty = doc.getProperty(xpath); ListType ltype = (ListType) complexProperty.getField().getType(); if (!ltype.getFieldType().isComplexType() && !ltype.isListType()) { throw new OperationException("Property type is not supported by this operation"); } ListProperty listProperty = (ListProperty) complexProperty; listProperty.clear(); } doc = session.saveDocument(doc); if (save) { session.save(); } return doc; }

Target:
public DocumentModel run(DocumentModel doc) throws OperationException, IOException { if (index != null) { Property complexProperty = doc.getProperty(xpath); ListType listType = (ListType) complexProperty.getField().getType(); if (!listType.getFieldType().isComplexType() && !listType.isListType()) { throw new OperationException("Property type is not supported by this operation"); } ListProperty listProperty = (ListProperty) complexProperty; List<?> propertiesValues = (List<?>) listProperty.getValue(); propertiesValues.remove(index.intValue()); listProperty.clear(); listProperty.setValue(propertiesValues); } else { Property complexProperty = doc.getProperty(xpath); ListType listType = (ListType) complexProperty.getField().getType(); if (!listType.getFieldType().isComplexType() && !listType.isListType()) { throw new OperationException("Property type is not supported by this operation"); } ListProperty listProperty = (ListProperty) complexProperty; listProperty.clear(); } doc = session.saveDocument(doc); if (save) { session.save(); } return doc; }
Source:
public void tenantId() { FhirContext ctx = FhirContext.forR4(); IGenericClient genericClient = ctx.newRestfulGenericClient("http://localhost:9999/fhir"); UrlTenantSelectionInterceptor tenantSelection = new UrlTenantSelectionInterceptor(); genericClient.registerInterceptor(tenantSelection); tenantSelection.setTenantId("TENANT-A"); Patient patientA = genericClient.read().resource(Patient.class).withId("123").execute(); tenantSelection.setTenantId("TENANT-B"); Patient patientB = genericClient.read().resource(Patient.class).withId("123").execute(); END SNIPPET: tenantId }

Target:
public void tenantId() { FhirContext ctx = FhirContext.forR4(); IGenericClient genericClient = ctx.newRestfulGenericClient("http://localhost:9999/fhir"); UrlTenantSelectionInterceptor tenantSelection = new UrlTenantSelectionInterceptor(); genericClient.registerInterceptor(tenantSelection); tenantSelection.setTenantId("TENANT-A"); Patient patientA = genericClient.read().resource(Patient.class).withId("123").execute(); tenantSelection.setTenantId("TENANT-B"); Patient patientB = genericClient.read().resource(Patient.class).withId("456").execute(); END SNIPPET: tenantId }
Source:
public DropboxFileUploadResult put(String localPath, String remotePath, DropboxUploadMode mode) throws DropboxException { String dropboxPath = remotePath == null ? localPath : remotePath; UploadUploader entry; try { entry = client.files().upload(localPath); } catch (DbxException e) { throw new DropboxException(dropboxPath + " does not exist or can't obtain metadata"); } if (localPath != null) { return putFile(localPath, mode, dropboxPath, entry); } else { return putBody(exchange, mode, dropboxPath, entry); } }

Target:
public DropboxFileUploadResult put(String localPath, String remotePath, DropboxUploadMode mode) throws DropboxException { String dropboxPath = remotePath == null ? localPath : remotePath; UploadUploader entry; try { entry = client.files().upload(dropboxPath); } catch (DbxException e) { throw new DropboxException(dropboxPath + " does not exist or can't obtain metadata"); } if (localPath != null) { return putFile(localPath, mode, dropboxPath, entry); } else { return putBody(exchange, mode, dropboxPath, entry); } }
Source:
protected HttpConsumer resolve(HttpServletRequest request) { String path = request.getPathInfo(); log.trace("Request path is: {}", path); String endpointName = getEndpointNameFromPath(path); log.trace("Looking up consumer for endpoint: {}", endpointName); HttpConsumer answer = consumers.get(endpointName); if (answer == null) { if (LOGGER.isDebugEnabled()) { log.debug("Consumer Keys: {}", Arrays.toString(consumers.keySet().toArray())); } for (Entry<String, HttpConsumer> entry : consumers.entrySet()) { if (entry.getValue().getEndpoint().isMatchOnUriPrefix() && path.startsWith(entry.getKey())) { answer = consumers.get(entry.getKey()); break; } } } return answer; }

Target:
protected HttpConsumer resolve(HttpServletRequest request) { String path = request.getPathInfo(); log.trace("Request path is: {}", path); String endpointName = getEndpointNameFromPath(path); log.trace("Looking up consumer for endpoint: {}", endpointName); HttpConsumer answer = consumers.get(endpointName); if (answer == null) { if (LOGGER.isDebugEnabled()) { log.debug("Consumer Keys: {}", consumers.keySet()); } for (Entry<String, HttpConsumer> entry : consumers.entrySet()) { if (entry.getValue().getEndpoint().isMatchOnUriPrefix() && path.startsWith(entry.getKey())) { answer = consumers.get(entry.getKey()); break; } } } return answer; }