auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void combinedLocksCondition_checkExternalLocksFirst() { assertThatThrownBy(() -> combinedLocksCondition.throwIfConditionInvalid(0L)) .isInstanceOf(TransactionLockTimeoutNonRetriableException.class) .hasMessageContaining("Provided external lock tokens expired. Retry is not possible"); }

Target:
public void combinedLocksCondition_checkExternalLocksFirst() { when(lockService.refreshLockRefreshTokens(Collections.singleton(EXTERNAL_LOCK_REFRESH_TOKEN))) .thenReturn(ImmutableSet.of()); when(lockService.refreshLockRefreshTokens(Collections.singleton(TRANSACTION_LOCK_REFRESH_TOKEN))) .thenReturn(ImmutableSet.of()); assertThatThrownBy(() -> combinedLocksCondition.throwIfConditionInvalid(0L)) .isInstanceOf(TransactionLockTimeoutNonRetriableException.class) .hasMessageContaining("Provided external lock tokens expired. Retry is not possible"); }
Source:
public void addsHeadersToResponse() throws IOException { MatcherAssert.assertThat( new RsPrint( new RsWithHeaders( new RsEmpty(), "Host: www.example.com", "Content-Type: text/xml" ) ).print(), Matchers.equalTo( Joiner.on("\r\n").join( "HTTP/1.1 200 OK", "Host: www.example.com", "Content-Type: text/xml", "", "" ) ) ); }

Target:
public void addsHeadersToResponse() throws IOException { final String host = "Host: www.example.com"; final String type = "Content-Type: text/xml"; MatcherAssert.assertThat( new RsPrint( new RsWithHeaders( new RsEmpty(), host, type ) ).print(), Matchers.equalTo( Joiner.on("\r\n").join( "HTTP/1.1 200 OK", host, type, "", "" ) ) ); }
Source:
protected Future<?> runCollector(Properties props, String topic) { String jobName = topic + "-" + UUID.randomUUID().toString(); props.put("tmp.path", props.getProperty(CAMUS_SWEEPER_TMP_DIR) + "/" + jobName + "_" + System.currentTimeMillis()); if (props.containsKey(REDUCE_COUNT_OVERRIDE + topic)) props.put("reducer.count", Integer.parseInt(props.getProperty(REDUCE_COUNT_OVERRIDE + topic))); LOG.info("Processing " + props.get(INPUT_PATHS)); return executorService.submit(new KafkaCollectorRunner(jobName, props, errorMessages, topic)); }

Target:
protected Future<?> runCollector(Properties props, String topic) { String jobName = topic + "-" + UUID.randomUUID().toString(); props .put("tmp.path", props.getProperty("camus.sweeper.tmp.dir") + "/" + jobName + "_" + System.currentTimeMillis()); if (props.containsKey("reduce.count.override." + topic)) props.put("reducer.count", Integer.parseInt(props.getProperty("reduce.count.override." + topic))); LOG.info("Processing " + props.get("input.paths")); return executorService.submit(new KafkaCollectorRunner(jobName, props, errorMessages, topic)); }
Source:
public Constraint getRequiredConstraint(Action.ActionEffect actionEffect, JmxAction action, JmxTarget target) { return (isApplicationType(action.composeAction()) || isApplicationType(target)) ? APPLICATION : NON_APPLICATION; }

Target:
public Constraint getRequiredConstraint(Action.ActionEffect actionEffect, JmxAction action, JmxTarget target) { return NON_APPLICATION; }
Source:
public List<IPAddress> getDhcpDnsServers(String interfaceName, IPAddress address) throws KuraException { ArrayList<IPAddress> servers = null; if (interfaceName != null && !interfaceName.isEmpty() && address != null && address.getAddress() != null) { StringBuilder sb = new StringBuilder(); sb.append("interface \"").append(interfaceName).append("\";"); String interfaceMatch = sb.toString(); sb = new StringBuilder(); sb.append("fixed-address ").append(address.getHostAddress()).append(";"); String fixedAddressMatch = sb.toString(); File globalDhClientFile = new File(formGlobalDhclientLeasesFilename()); File interfaceDhClientFile = new File(formInterfaceDhclientLeasesFilename(interfaceName)); if (interfaceDhClientFile.exists()) { servers = parseDhclientFile(interfaceDhClientFile, interfaceMatch, fixedAddressMatch); } else if (globalDhClientFile.exists()) { servers = parseDhclientFile(globalDhClientFile, interfaceMatch, fixedAddressMatch); } else { servers = new ArrayList<>(); File dhclientFile = new File(formInterfaceDhclientLeasesFilename(interfaceName)); if (!dhclientFile.exists()) { try { if (dhclientFile.createNewFile()) { logger.debug("The doesn't exist, created new empty file ...", dhclientFile.getName()); } } catch (Exception e) { throw new KuraException(KuraErrorCode.CONFIGURATION_ERROR, e); } } } } return servers; }

Target:
public List<IPAddress> getDhcpDnsServers(String interfaceName, IPAddress address) throws KuraException { if (interfaceName == null || interfaceName.isEmpty() || address == null || address.getAddress() == null) { return new ArrayList<>(); } StringBuilder sb = new StringBuilder(); sb.append("interface \"").append(interfaceName).append("\";"); String interfaceMatch = sb.toString(); sb = new StringBuilder(); sb.append("fixed-address ").append(address.getHostAddress()).append(";"); String fixedAddressMatch = sb.toString(); File globalDhClientFile = new File(formGlobalDhclientLeasesFilename()); File interfaceDhClientFile = new File(formInterfaceDhclientLeasesFilename(interfaceName)); ArrayList<IPAddress> servers; if (interfaceDhClientFile.exists()) { servers = parseDhclientFile(interfaceDhClientFile, interfaceMatch, fixedAddressMatch); } else if (globalDhClientFile.exists()) { servers = parseDhclientFile(globalDhClientFile, interfaceMatch, fixedAddressMatch); } else { servers = new ArrayList<>(); File dhclientFile = new File(formInterfaceDhclientLeasesFilename(interfaceName)); try { if (!dhclientFile.exists() && dhclientFile.createNewFile()) { logger.debug("The doesn't exist, created new empty file ...", dhclientFile.getName()); } } catch (Exception e) { throw new KuraException(KuraErrorCode.CONFIGURATION_ERROR, e); } } if (!servers.isEmpty()) { logger.debug("getDhcpDnsServers() :: DHCP DNS servers for interface {}", interfaceName, servers); } return servers; }
Source:
private List<Pair<Block, Integer>> getBlockMetaPairsFromArray(JsonArray ary) { List<Pair<Block, Integer>> blockMetaPairs = new ArrayList<>(); ary.forEach((element) -> { String str = element.getAsString(); String[] pieces = str.split(":"); String domain = "minecraft"; String path; int meta = OreDictionary.WILDCARD_VALUE; if (pieces.length == 1) { path = pieces[0]; } else if (pieces.length == 2) { domain = pieces[0]; path = pieces[1]; } else { if (pieces.length > 3) { EsteemedInnovation.logger.warn("[EI] More than 3 values separated by : in ReplaceableBlocks '%s' for Ore generation config. Expected maximum: 'domain:path:meta'. This may indicate a bug in your config!", str); } domain = pieces[0]; path = pieces[1]; meta = Integer.valueOf(pieces[2]); } blockMetaPairs.add(Pair.of(Block.REGISTRY.getObject(new ResourceLocation(domain, path)), meta)); }); return blockMetaPairs; }

Target:
private List<Pair<Block, Integer>> getBlockMetaPairsFromArray(JsonArray ary) { List<Pair<Block, Integer>> blockMetaPairs = new ArrayList<>(); ary.forEach((element) -> { String str = element.getAsString(); String[] pieces = str.split(":"); String domain = "minecraft"; String path; int meta = OreDictionary.WILDCARD_VALUE; if (pieces.length == 1) { path = pieces[0]; } else if (pieces.length == 2) { domain = pieces[0]; path = pieces[1]; } else { if (pieces.length > 3) { EsteemedInnovation.logger.warn("More than 3 values separated by : in ReplaceableBlocks '%s' for Ore generation config. Expected maximum: 'domain:path:meta'. This may indicate a bug in your config!", str); } domain = pieces[0]; path = pieces[1]; meta = Integer.valueOf(pieces[2]); } blockMetaPairs.add(Pair.of(Block.REGISTRY.getObject(new ResourceLocation(domain, path)), meta)); }); return blockMetaPairs; }
Source:
public TayamLuminousEnigma(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{B}{G}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NIGHTMARE); this.subtype.add(SubType.BEAST); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TayamLuminousEnigmaReplacementEffect())); PutTopCardOfLibraryIntoGraveControllerEffect millEffect = new PutTopCardOfLibraryIntoGraveControllerEffect(3); millEffect.concatBy("."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, millEffect, new GenericManaCost(3)); ability.addCost(new TayamLuminousEnigmaCost()); TayamLuminousEnigmaEffect effect = new TayamLuminousEnigmaEffect(); effect.setText(", then return a permanent card with converted mana cost 3 or less from your graveyard to the battlefield"); ability.addEffect(effect); this.addAbility(ability); }

Target:
public TayamLuminousEnigma(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{B}{G}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.NIGHTMARE); this.subtype.add(SubType.BEAST); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TayamLuminousEnigmaReplacementEffect())); PutTopCardOfLibraryIntoGraveControllerEffect millEffect = new PutTopCardOfLibraryIntoGraveControllerEffect(3); millEffect.concatBy("."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, millEffect, new GenericManaCost(3)); ability.addCost(new TayamLuminousEnigmaCost()); TayamLuminousEnigmaEffect effect = new TayamLuminousEnigmaEffect(); ability.addEffect(effect); this.addAbility(ability); }
Source:
public void getConditionByObsId_shouldReturnMatchingFHIRCondition() { Context.getAdministrationService().saveGlobalProperty(new GlobalProperty(FHIRConstants .CONCEPTS_CONVERTABLE_TO_CONDITIONS_STORED_AS_OBS, GLOBAL_PROPS_CONDITION_MAPPING_CONCEPT_ID_)); String openmrsAdminPersonUuid = "dagh524f-27ce-4bb2-86d6-6d1d05312bd5"; String openmrsQuestionConceptUuid = "4a5048b1-cf85-4c64-9339-7cab41e5e364"; Date openmrsDateApplies = new Date(); Person admin = Context.getPersonService().getPersonByUuid(openmrsAdminPersonUuid); Concept concept = Context.getConceptService().getConceptByUuid(openmrsQuestionConceptUuid); Obs problemAddedObs = new Obs(admin, concept, openmrsDateApplies, null); problemAddedObs.setValueNumeric(8d); problemAddedObs = Context.getObsService().saveObs(problemAddedObs, null); Condition fhirConditionForProblemAddedObs = getService().getConditionByObsId(problemAddedObs.getUuid()); assertNotNull(fhirConditionForProblemAddedObs); }

Target:
public void getConditionByObsId_shouldReturnMatchingFHIRCondition() { Context.getAdministrationService().saveGlobalProperty(new GlobalProperty(FHIRConstants .CONCEPTS_CONVERTABLE_TO_CONDITIONS_STORED_AS_OBS, GLOBAL_PROPS_CONDITION_MAPPING_CONCEPT_ID)); String patientUuid = "61b38324-e2fd-4feb-95b7-9e9a2a4400df"; String conceptUuid = "4a5048b1-cf85-4c64-9339-7cab41e5e364"; Date openmrsDateApplies = new Date(); Person patient = Context.getPersonService().getPersonByUuid(patientUuid); Concept concept = Context.getConceptService().getConceptByUuid(conceptUuid); Obs problemAddedObs = new Obs(patient, concept, openmrsDateApplies, null); problemAddedObs.setValueNumeric(8d); problemAddedObs = Context.getObsService().saveObs(problemAddedObs, null); Condition fhirConditionForProblemAddedObs = getService().getConditionByObsId(problemAddedObs.getUuid()); CodingDt fhirCoding = fhirConditionForProblemAddedObs.getCode().getCoding().get(0); assertNotNull(fhirConditionForProblemAddedObs); assertEquals(patient.getUuid(), fhirConditionForProblemAddedObs.getPatient().getReference().getIdPart()); assertEquals("Patient",fhirConditionForProblemAddedObs.getPatient().getReference().getResourceType()); assertEquals(problemAddedObs.getComment(), fhirConditionForProblemAddedObs.getNotes()); assertEquals(fhirCoding.getSystem(), FHIRConstants.OPENMRS_URI); assertEquals(fhirCoding.getCode(), problemAddedObs.getConcept().getUuid()); assertEquals(fhirCoding.getDisplay(), problemAddedObs.getConcept().getName().getName()); }
Source:
public EventReceiver(EventListener listener, ClientSessionFactory sessionFactory, ObjectMapper mapper) throws ActiveMQException { String queueName = EventSource.QUEUE_ADDRESS + "." + listener.getClass().getCanonicalName(); log.debug("registering listener for {}", queueName); session = sessionFactory.createSession(false, false, 0); try { session.createQueue(EventSource.QUEUE_ADDRESS, queueName, true); log.debug("created new event queue " + queueName); } catch (ActiveMQException e) { if (e.getType() != ActiveMQExceptionType.QUEUE_EXISTS) { throw e; } } ClientConsumer consumer = session.createConsumer(queueName); consumer.setMessageHandler(new ListenerWrapper(listener, mapper, session)); session.start(); }

Target:
public EventReceiver(EventListener listener, ClientSessionFactory sessionFactory, ObjectMapper mapper) throws ActiveMQException { String queueName = EventSource.QUEUE_ADDRESS + "." + listener.getClass().getCanonicalName(); log.debug("registering listener for {}", queueName); session = sessionFactory.createSession(false, false, 0); try { session.createQueue(EventSource.QUEUE_ADDRESS, queueName, true); log.debug("created new event queue: {}", queueName); } catch (ActiveMQException e) { if (e.getType() != ActiveMQExceptionType.QUEUE_EXISTS) { throw e; } } ClientConsumer consumer = session.createConsumer(queueName); consumer.setMessageHandler(new ListenerWrapper(listener, mapper, session)); session.start(); }
Source:
protected UUID sendRequest(@NonNull ManagementClient managementClient) throws TimeoutException { Layout layout = new Layout(runtime.getLayoutView().getLayout()); boolean bootstrapped = runtime.getManagementView().bootstrapManagementServer(nodeForWorkflow, layout); if (!bootstrapped) { log.warn("Management server is already bootstrapped."); } CreateWorkflowResponse resp = managementClient.addNodeRequest(nodeForWorkflow); log.info("sendRequest: requested to add on orchestrator {}:{}", nodeForWorkflow, managementClient.getRouter().getHost(), managementClient.getRouter().getPort()); return resp.getWorkflowId(); }

Target:
protected UUID sendRequest(@NonNull ManagementClient managementClient) throws TimeoutException { Layout layout = new Layout(runtime.getLayoutView().getLayout()); CFUtils.getUninterruptibly(runtime.getManagementView().bootstrapManagementServer(nodeForWorkflow, layout), TimeoutException.class, NetworkException.class); CreateWorkflowResponse resp = managementClient.addNodeRequest(nodeForWorkflow); log.info("sendRequest: requested to add on orchestrator {}:{}", nodeForWorkflow, managementClient.getRouter().getHost(), managementClient.getRouter().getPort()); return resp.getWorkflowId(); }
Source:
public void configure(WebSecurity web) { web.ignoring() .antMatchers( "/css report", "/perftest monitor", "/perftest graph", "/check/**", "/agent/download/**", "/monitor/download/**", "/jnlp/**", "/sign_up/**" ).and().expressionHandler(defaultWebSecurityExpressionHandler); }

Target:
public void configure(WebSecurity web) { web.ignoring() .antMatchers( "/css report", "/perftest monitor", "/perftest graph", "/check/**", "/agent/download/**", "/monitor/download/**", "/sign_up/**" ).and().expressionHandler(defaultWebSecurityExpressionHandler); }
Source:
default Block getPositions(int[] positions, int offset, int length) { checkValidPositionsArray(positions, offset, length); int[] ids = length == positions.length ? positions : Arrays.copyOfRange(positions, offset, offset + length); return new DictionaryBlock(this, ids); }

Target:
default Block getPositions(int[] positions, int offset, int length) { checkArrayRange(positions, offset, length); return new DictionaryBlock(offset, length, this, positions, false, randomDictionaryId()); }
Source:
private void addArrivedRecordsInput(PrefetchRecordsRetrieved recordsRetrieved) throws InterruptedException { wasReset = false; while (!publisherSession.prefetchRecordsQueue().offer(recordsRetrieved, idleMillisBetweenCalls, TimeUnit.MILLISECONDS)) { resetLock.readLock().unlock(); resetLock.readLock().lock(); if (wasReset) { throw new PositionResetException(); } } publisherSession.prefetchCounters().added(recordsRetrieved.processRecordsInput); }

Target:
private void addArrivedRecordsInput(PrefetchRecordsRetrieved recordsRetrieved) throws InterruptedException { wasReset = false; while (!publisherSession.offerRecords(recordsRetrieved, idleMillisBetweenCalls)) { resetLock.readLock().unlock(); resetLock.readLock().lock(); if (wasReset) { throw new PositionResetException(); } } publisherSession.prefetchCounters().added(recordsRetrieved.processRecordsInput); }
Source:
public synchronized void onHeaders(Response response) { long length = response.getHeaders().getLongField(HttpHeader.CONTENT_LENGTH.asString()); if (length > maxLength) { response.abort(new ResponseTooLargeException()); } allocateCurrentArray(); }

Target:
public synchronized void onHeaders(Response response) { long length = response.getHeaders().getLongField(HttpHeader.CONTENT_LENGTH.asString()); if (length > maxLength) { response.abort(new ResponseTooLargeException()); } }
Source:
private void removeUI() { if (replyToBox != null) { replyToBox.unregisterReplyBox(); } Side side = comment.side(); removeFromParent(); if (!getCommentInfo().has_line()) { parent.removeFileCommentBox(this, side); return; } parent.removeDraft(this, comment.side(), comment.line() - 1); getSelfWidget().clear(); PaddingManager manager = getPaddingManager(); manager.remove(this); manager.resizePaddingWidget(); cm.focus(); }

Target:
private void removeUI() { if (replyToBox != null) { replyToBox.unregisterReplyBox(); } Side side = comment.side(); removeFromParent(); if (!getCommentInfo().has_line()) { parent.removeFileCommentBox(this, side); return; } parent.removeDraft(this, side, comment.line() - 1); getSelfWidget().clear(); PaddingManager manager = getPaddingManager(); manager.remove(this); manager.resizePaddingWidget(); cm.focus(); }
Source:
private boolean lock(InvocationContext ctx, Object key, long timeoutMillis) throws InterruptedException { if (lockAndRecord(key, ctx, timeoutMillis)) { ctx.addLockedKey(key); return true; } else { Object owner = getOwner(key); if (key instanceof MarshalledValue) { key = ((MarshalledValue) key).get(); } String messagePreamble = rpcManager == null ? "Unable to acquire lock" : "Unable to acquire lock on [" + rpcManager.getAddress() + "]"; throw new TimeoutException(messagePreamble + " after [" + Util.prettyPrintTime(timeoutMillis) + "] for key [" + key + "] and requestor [" + ctx.getLockOwner() + "]! Lock is held by [" + owner + "] while lock request came from [" + ctx.getOrigin() + "]"); } }

Target:
private boolean lock(InvocationContext ctx, Object key, long timeoutMillis) throws InterruptedException { if (lockAndRecord(key, ctx, timeoutMillis)) { ctx.addLockedKey(key); return true; } else { Object owner = getOwner(key); if (key instanceof MarshalledValue) { key = ((MarshalledValue) key).get(); } throw log.unableToAcquireLock(Util.prettyPrintTime(timeoutMillis), key, ctx.getLockOwner(), owner, ctx.getOrigin()); } }
Source:
private void validateFlowTriggerBean(final FlowTriggerBean flowTriggerBean) { Preconditions.checkArgument(flowTriggerBean.getMaxWaitMins() >= 1, "max wait min must be " + "longer than 1 min"); validateSchedule(flowTriggerBean); validateTriggerDependencies(flowTriggerBean.getTriggerDependencies()); }

Target:
private void validateFlowTriggerBean(final FlowTriggerBean flowTriggerBean) { Preconditions.checkArgument(flowTriggerBean.getMaxWaitMins() >= Constants .MIN_FLOW_TRIGGER_WAIT_TIME.toMinutes(), "max wait min must be longer than " + Constants .MIN_FLOW_TRIGGER_WAIT_TIME + " min "); validateSchedule(flowTriggerBean); validateTriggerDependencies(flowTriggerBean.getTriggerDependencies()); }
Source:
public synchronized boolean add(T t) { legacyInstances.add(new ExtensionComponent<T>(t)); if(extensions!=null) { List<ExtensionComponent<T>> r = new ArrayList<ExtensionComponent<T>>(extensions); r.add(new ExtensionComponent<T>(t)); extensions = sort(r); fireOnChangeListeners(); } return true; }

Target:
public boolean add(T t) { try { return addSync(t); } finally { if(extensions!=null) { fireOnChangeListeners(); } } }
Source:
public void start() { queue.start(); if (srvInfo.getState() == ServerInformation.State.STARTUP && queue.replicateAllOnPluginStart) { ReplicationState state = new ReplicationState(ReplicationType.START_UP); pushAllFuture.set(pushAll.create(null, state).schedule(30, TimeUnit.SECONDS)); } }

Target:
public void start() { queue.start(); if (srvInfo.getState() == ServerInformation.State.STARTUP && queue.replicateAllOnPluginStart) { ReplicationState state = new ReplicationState(ReplicationType.STARTUP); pushAllFuture.set(pushAll.create(null, state).schedule(30, TimeUnit.SECONDS)); } }
Source:
public void setShouldDetectFaces(boolean shouldDetectFaces) { if (shouldDetectFaces && !mFaceDetector) { setupFaceDetector(); } this.mShouldDetectFaces = shouldDetectFaces; setScanning(mShouldDetectFaces || mShouldDetectBarcodes || mShouldScanBarCodes || mShouldRecognizeText); }

Target:
public void setShouldDetectFaces(boolean shouldDetectFaces) { if (shouldDetectFaces && mFaceDetector == null) { setupFaceDetector(); } this.mShouldDetectFaces = shouldDetectFaces; setScanning(mShouldDetectFaces || mShouldDetectBarcodes || mShouldScanBarCodes || mShouldRecognizeText); }
Source:
public RangeSet<String> getDimensionRangeSet(String dimension) { if (!Objects.equals(getDimension(), dimension) || getExtractionFn() != null || !ordering.equals(StringComparatorType.LEXICOGRAPHIC)) { return null; } RangeSet<String> retSet = TreeRangeSet.create(); Range<String> range; if (getLower() == null) { range = isUpperStrict() ? Range.lessThan(getUpper()) : Range.atMost(getUpper()); } else if (getUpper() == null) { range = isLowerStrict() ? Range.greaterThan(getLower()) : Range.atLeast(getLower()); } else { range = Range.range(getLower(), isLowerStrict() ? BoundType.OPEN : BoundType.CLOSED, getUpper(), isUpperStrict() ? BoundType.OPEN : BoundType.CLOSED); } retSet.add(range); return retSet; }

Target:
public RangeSet<String> getDimensionRangeSet(String dimension) { if (!(Objects.equals(getDimension(), dimension) && getExtractionFn() == null && ordering.equals(StringComparators.LEXICOGRAPHIC))) { return null; } RangeSet<String> retSet = TreeRangeSet.create(); Range<String> range; if (getLower() == null) { range = isUpperStrict() ? Range.lessThan(getUpper()) : Range.atMost(getUpper()); } else if (getUpper() == null) { range = isLowerStrict() ? Range.greaterThan(getLower()) : Range.atLeast(getLower()); } else { range = Range.range(getLower(), isLowerStrict() ? BoundType.OPEN : BoundType.CLOSED, getUpper(), isUpperStrict() ? BoundType.OPEN : BoundType.CLOSED); } retSet.add(range); return retSet; }
Source:
@Test public void createWithDensity() { Context context = mock(Context.class); Resources resources = mock(Resources.class); DisplayMetrics displayMetrics = new DisplayMetrics(); when(context.getResources()).thenReturn(resources); when(resources.getDisplayMetrics()).thenReturn(displayMetrics); displayMetrics.densityDpi = DisplayMetrics.DENSITY_XHIGH; int[] densities = new int[] { DisplayMetrics.DENSITY_MEDIUM, DisplayMetrics.DENSITY_HIGH, DisplayMetrics.DENSITY_XHIGH, DisplayMetrics.DENSITY_XXHIGH }; for (int density : densities) { Request data = new Request.Builder(URI_1).density(density).build(); BitmapFactory.Options options = createBitmapOptions(data, context); assertThat(options.inDensity).isEqualTo(density); assertThat(options.inTargetDensity).isEqualTo(DisplayMetrics.DENSITY_XHIGH); } }

Target:
@Test public void createWithDensity() { Context context = mock(Context.class); Resources resources = mock(Resources.class); DisplayMetrics displayMetrics = new DisplayMetrics(); when(context.getResources()).thenReturn(resources); when(resources.getDisplayMetrics()).thenReturn(displayMetrics); displayMetrics.densityDpi = DisplayMetrics.DENSITY_XHIGH; int[] densities = { DisplayMetrics.DENSITY_MEDIUM, DisplayMetrics.DENSITY_HIGH, DisplayMetrics.DENSITY_XHIGH, DisplayMetrics.DENSITY_XXHIGH }; for (int density : densities) { Request data = new Request.Builder(URI_1).originalDensity(density).build(); BitmapFactory.Options options = createBitmapOptions(data, context); assertThat(options.inDensity).isEqualTo(density); assertThat(options.inTargetDensity).isEqualTo(DisplayMetrics.DENSITY_XHIGH); } }
Source:
public CompletableFuture<AsyncConnection> createAsyncConnection() throws IOException { return ConnectionFactory.createAsyncConnection(configuration); }

Target:
public AsyncConnection createAsyncConnection() throws Exception { return ConnectionFactory.createAsyncConnection(configuration).get(); }
Source:
protected void syncSearch() { if (getEntity() == null) { return; } super.syncSearch(); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { SearchableListModel searchableListModel = (SearchableListModel) model; ArrayList<StorageDomain> domains = (ArrayList<StorageDomain>) ((VdcQueryReturnValue) ReturnValue).getReturnValue(); for (StorageDomain domain : domains) { String guid = domain.getStoragePoolId() != null ? domain.getStoragePoolId().toString() : Guid.Empty.toString(); domain.setId(domain.getStoragePoolId()); } searchableListModel.setItems(domains); setIsEmpty(((List) searchableListModel.getItems()).size() == 0); } }; IdQueryParameters tempVar = new IdQueryParameters(getEntity().getId()); tempVar.setRefresh(getIsQueryFirstTime()); Frontend.getInstance().runQuery(VdcQueryType.GetStorageDomainListById, tempVar, _asyncQuery); }

Target:
protected void syncSearch() { if (getEntity() == null) { return; } super.syncSearch(); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { SearchableListModel searchableListModel = (SearchableListModel) model; ArrayList<StorageDomain> domains = (ArrayList<StorageDomain>) ((VdcQueryReturnValue) ReturnValue).getReturnValue(); for (StorageDomain domain : domains) { domain.setId(domain.getStoragePoolId()); } searchableListModel.setItems(domains); setIsEmpty(((List) searchableListModel.getItems()).size() == 0); } }; IdQueryParameters tempVar = new IdQueryParameters(getEntity().getId()); tempVar.setRefresh(getIsQueryFirstTime()); Frontend.getInstance().runQuery(VdcQueryType.GetStorageDomainListById, tempVar, _asyncQuery); }
Source:
protected Optional<PlanNodeStatsEstimate> visitNotExpression(NotExpression node, Void context) { if (node.getValue() instanceof IsNullPredicate) { return process(new IsNotNullPredicate(((IsNullPredicate) node.getValue()).getValue())); } return process(node.getValue()).map(estimate -> differenceInStats(input, estimate)); }

Target:
protected PlanNodeStatsEstimate visitNotExpression(NotExpression node, Void context) { if (node.getValue() instanceof IsNullPredicate) { return process(new IsNotNullPredicate(((IsNullPredicate) node.getValue()).getValue())); } return differenceInStats(input, process(node.getValue())); }
Source:
public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues, UserDelegationKey userDelegationKey) { return getBlobAsyncClient().generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey); }

Target:
public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues, UserDelegationKey userDelegationKey) { return new BlobSasImplUtil(blobServiceSasSignatureValues, getContainerName(), getBlobName(), getSnapshotId()) .generateUserDelegationSas(userDelegationKey, getAccountName()); }
Source:
protected boolean checkExistingStorageDomain() { if (getParameters().getStorageDomain().getStorageDomainType() == StorageDomainType.Data && !FeatureSupported.importDataStorageDomain(getVds().getVdsGroupCompatibilityVersion())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DATA_DOMAIN_IS_NOT_SUPPORTED); } if (DbFacade.getInstance().getStorageDomainStaticDao().get(getStorageDomain().getId()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } List<Guid> storageIds = (ArrayList<Guid>) runVdsCommand(VDSCommandType.HSMGetStorageDomainsList, new HSMGetStorageDomainsListVDSCommandParameters(getVdsId(), Guid.Empty, getStorageDomain() .getStorageType(), getStorageDomain().getStorageDomainType(), "") ).getReturnValue(); if (!storageIds.contains(getStorageDomain().getId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST); } Pair<StorageDomainStatic, SANState> domainFromIrs = (Pair<StorageDomainStatic, SANState>) runVdsCommand( VDSCommandType.HSMGetStorageDomainInfo, new HSMGetStorageDomainInfoVDSCommandParameters(getVdsId(), getStorageDomain().getId()) ).getReturnValue(); if (domainFromIrs.getFirst().getStorageDomainType() != getStorageDomain().getStorageDomainType()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_CHANGE_STORAGE_DOMAIN_TYPE); } return concreteCheckExistingStorageDomain(domainFromIrs); }

Target:
protected boolean checkExistingStorageDomain() { if (DbFacade.getInstance().getStorageDomainStaticDao().get(getStorageDomain().getId()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } List<Guid> storageIds = (ArrayList<Guid>) runVdsCommand(VDSCommandType.HSMGetStorageDomainsList, new HSMGetStorageDomainsListVDSCommandParameters(getVdsId(), Guid.Empty, getStorageDomain() .getStorageType(), getStorageDomain().getStorageDomainType(), "") ).getReturnValue(); if (!storageIds.contains(getStorageDomain().getId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST); } Pair<StorageDomainStatic, Guid> domainFromIrs = (Pair<StorageDomainStatic, Guid>) runVdsCommand( VDSCommandType.HSMGetStorageDomainInfo, new HSMGetStorageDomainInfoVDSCommandParameters(getVdsId(), getStorageDomain().getId()) ).getReturnValue(); if (domainFromIrs.getFirst().getStorageDomainType() != getStorageDomain().getStorageDomainType()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_CHANGE_STORAGE_DOMAIN_TYPE); } return concreteCheckExistingStorageDomain(domainFromIrs); }
Source:
public void dispose() { repoImage.dispose(); for (Image image : images) { image.dispose(); } }

Target:
public void dispose() { repoImage.dispose(); for (Image image : images) image.dispose(); }
Source:
public Closeable addServerCache(ImmutableBytesPtr cacheId, ImmutableBytesWritable cachePtr, byte[] txState, ServerCacheFactory cacheFactory, boolean useProtoForIndexMaintainer, boolean usePersistentCache, int clientVersion) throws SQLException { getServerCaches().cleanUp(); long available = this.getMemoryManager().getAvailableMemory(); int size = cachePtr.getLength() + txState.length; if (size > available) { evictInactiveEntries(Math.max(size - available + EVICTION_MARGIN_BYTES, EVICTION_MARGIN_BYTES)); } MemoryChunk chunk = this.getMemoryManager().allocate(size); boolean success = false; try { CacheEntry entry; synchronized(this) { entry = getIfPresent(cacheId); if (entry == null) { entry = new CacheEntry( cacheId, cachePtr, cacheFactory, txState, chunk, usePersistentCache, useProtoForIndexMaintainer, clientVersion); getServerCaches().put(cacheId, entry); available = this.getMemoryManager().getAvailableMemory(); if (usePersistentCache) { getPersistentServerCaches().put(cacheId, entry); } } entry.incrementLiveQueryCount(); } success = true; return entry; } finally { if (!success) { Closeables.closeAllQuietly(Collections.singletonList(chunk)); } } }

Target:
public Closeable addServerCache(ImmutableBytesPtr cacheId, ImmutableBytesWritable cachePtr, byte[] txState, ServerCacheFactory cacheFactory, boolean useProtoForIndexMaintainer, boolean usePersistentCache, int clientVersion) throws SQLException { getServerCaches().cleanUp(); long available = this.getMemoryManager().getAvailableMemory(); int size = cachePtr.getLength() + txState.length; if (size > available) { evictInactiveEntries(size - available + EVICTION_MARGIN_BYTES); } MemoryChunk chunk = this.getMemoryManager().allocate(size); boolean success = false; try { CacheEntry entry; synchronized(this) { entry = getIfPresent(cacheId); if (entry == null) { entry = new CacheEntry( cacheId, cachePtr, cacheFactory, txState, chunk, usePersistentCache, useProtoForIndexMaintainer, clientVersion); getServerCaches().put(cacheId, entry); if (usePersistentCache) { getPersistentServerCaches().put(cacheId, entry); } } entry.incrementLiveQueryCount(); } success = true; return entry; } finally { if (!success) { Closeables.closeAllQuietly(Collections.singletonList(chunk)); } } }
Source:
public boolean onHttpRequestSend(HttpMessage msg) { try { String url = msg.getRequestHeader().getURI().toString(); String path = msg.getRequestHeader().getURI().getPath(); LOGGER.debug("Callback received for URL : " + url + " path : " + path + " from " + msg.getRequestHeader().getSenderAddress()); if (path.startsWith("/" + TEST_PREFIX)) { String str = Constant.messages.getString( "callback.test.msg", url, msg.getRequestHeader() .getSenderAddress().toString()); if (View.isInitialised()) { View.getSingleton().getOutputPanel() .appendAsync(str + "\n"); } LOGGER.info(str); callBackReceived(Constant.messages.getString("callback.handler.test.name"), msg.cloneAll()); return true; } else if (path.startsWith("/favicon.ico")) { return true; } for (Entry<String, CallbackImplementor> callback : callbacks .entrySet()) { if (path.startsWith(callback.getKey())) { HttpMessage clonedMsg = msg.cloneAll(); CallbackImplementor implementor = callback.getValue(); implementor.handleCallBack(clonedMsg); callBackReceived(implementor.getClass().getSimpleName(), clonedMsg); return true; } } callBackReceived(Constant.messages.getString("callback.handler.none.name"), msg.cloneAll()); LOGGER.error("No callback handler for URL : " + url + " from " + msg.getRequestHeader().getSenderAddress()); } catch (URIException e) { LOGGER.error(e.getMessage(), e); } return true; }

Target:
public boolean onHttpRequestSend(HttpMessage msg) { try { msg.setTimeSentMillis(new Date().getTime()); String url = msg.getRequestHeader().getURI().toString(); String path = msg.getRequestHeader().getURI().getPath(); LOGGER.debug("Callback received for URL : " + url + " path : " + path + " from " + msg.getRequestHeader().getSenderAddress()); msg.setResponseHeader(HttpHeader.HTTP11 + " " + HttpStatusCode.OK); if (path.startsWith("/" + TEST_PREFIX)) { String str = Constant.messages.getString( "callback.test.msg", url, msg.getRequestHeader() .getSenderAddress().toString()); if (View.isInitialised()) { View.getSingleton().getOutputPanel() .appendAsync(str + "\n"); } LOGGER.info(str); callbackReceived(Constant.messages.getString("callback.handler.test.name"), msg); return true; } else if (path.startsWith("/favicon.ico")) { return true; } for (Entry<String, CallbackImplementor> callback : callbacks .entrySet()) { if (path.startsWith(callback.getKey())) { CallbackImplementor implementor = callback.getValue(); implementor.handleCallBack(msg.cloneAll()); callbackReceived(implementor.getClass().getSimpleName(), msg); return true; } } callbackReceived(Constant.messages.getString("callback.handler.none.name"), msg); LOGGER.error("No callback handler for URL : " + url + " from " + msg.getRequestHeader().getSenderAddress()); } catch (URIException | HttpMalformedHeaderException e) { LOGGER.error(e.getMessage(), e); } return true; }
Source:
private boolean isCurrentUserAdmin() { String token = httpServletRequest.getHeader(AuthenticationFilter.TOKEN_REQUEST_HEADER_PARAM); if (token != null) { Account account = accountRepository.findByToken(token); return account.getMember().getROLES().contains(Role.ADMIN); } return false; }

Target:
private boolean isCurrentUserAdmin() { CurrentUser currentUser = applicationContext.getBean(CurrentUser.class); if (currentUser == null || !currentUser.getCredentials().isPresent()) { return false; } return currentUser.getCredentials().get().getMember().getROLES().contains(Role.ADMIN); }
Source:
private void handleReturnStatement(SubscriptionContext ctx, PyReturnStatementTree retStmt) { if (retStmt.expressions().size() == 1) { PyExpressionTree expr = retStmt.expressions().get(0); if ((expr.is(Tree.Kind.PARENTHESIZED) || (expr.is(Tree.Kind.TUPLE) && !((PyTupleTree) expr).elements().isEmpty())) && expr.firstToken().getLine() == expr.lastToken().getLine()) { ctx.addIssue(expr, String.format(MESSAGE, "return")); } } }

Target:
private static void handleReturnStatement(SubscriptionContext ctx, PyReturnStatementTree retStmt) { if (retStmt.expressions().size() == 1) { PyExpressionTree expr = retStmt.expressions().get(0); if ((expr.is(Tree.Kind.PARENTHESIZED) || (expr.is(Tree.Kind.TUPLE) && !((PyTupleTree) expr).elements().isEmpty())) && expr.firstToken().getLine() == expr.lastToken().getLine()) { ctx.addIssue(expr, String.format(MESSAGE, "return")); } } }
Source:
public void postCollectionAdminGroupCreateAdminGroupUnAuthorized() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); getClient().perform(post("/api/core/collections/" + collection.getID() + "/adminGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnauthorized()); }

Target:
public void postCollectionAdminGroupCreateAdminGroupUnAuthorized() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); getClient().perform(post("/api/core/collections/" + collection.getID() + "/adminGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnauthorized()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/adminGroup")) .andExpect(status().isNoContent()); }
Source:
public void readRowsAsync(Query request, StreamObserver<Result> observer) { delegate .readRowsCallable(new ResultRowAdapter()) .call(request, new StreamObserverAdapter<>(observer)); }

Target:
public void readRowsAsync(Query request, StreamObserver<Result> observer) { delegate.readRowsCallable(RESULT_ADAPTER).call(request, new StreamObserverAdapter<>(observer)); }
Source:
public ServiceTreeNode next() { currentPathSegment = pathIterator.next(); if (isID(currentPathSegment, node)) { node = node.getSubService("{id}"); } else if (node.containsSubService(currentPathSegment)) { node = node.getSubService(currentPathSegment); } else { throw new IllegalArgumentException("segment '" + currentPathSegment + "' of path does not exist"); } return node; }

Target:
public ServiceTreeNode next() { currentPathSegment = pathIterator.next(); if (isID(currentPathSegment, node)) { node = node.getSubService("{id}"); } else if (node.containsSubService(currentPathSegment)) { node = node.getSubService(currentPathSegment); } else { throw new IllegalArgumentException("Segment '" + currentPathSegment + "' of path does not exist"); } return node; }
Source:
private boolean isFunctionNameMatch(RowExpression rowExpression, String expectedName) { if (castToExpression(rowExpression) instanceof FunctionCall) { return ((FunctionCall) castToExpression(rowExpression)).getName().toString().equalsIgnoreCase(expectedName); } return false; }

Target:
private static boolean isFunctionNameMatch(RowExpression rowExpression, String expectedName) { if (castToExpression(rowExpression) instanceof FunctionCall) { return ((FunctionCall) castToExpression(rowExpression)).getName().toString().equalsIgnoreCase(expectedName); } return false; }
Source:
private static Optional<ColumnDomain<HiveColumnHandle>> getPathDomain(TupleDomain<HiveColumnHandle> effectivePredicate) { if (!effectivePredicate.getColumnDomains().isPresent()) { return Optional.empty(); } return effectivePredicate.getColumnDomains().get().stream() .filter(columnDomain -> columnDomain.getColumn().getName().equalsIgnoreCase(PATH_COLUMN_NAME)) .findFirst(); }

Target:
private static Optional<Domain> getPathDomain(TupleDomain<HiveColumnHandle> effectivePredicate) { if (!effectivePredicate.getDomains().isPresent()) { return Optional.empty(); } return effectivePredicate.getDomains().get().entrySet().stream() .filter(entry -> isPathColumnHandle(entry.getKey())) .findFirst() .map(Map.Entry::getValue); }
Source:
private BinaryContent createMetacard( InputStream stream, String contentType, String transformerParam) throws CatalogServiceException { String transformer = DEFAULT_METACARD_TRANSFORMER; if (transformerParam != null) { transformer = transformerParam; } MimeType mimeType = null; if (contentType != null) { try { mimeType = new MimeType(contentType); } catch (MimeTypeParseException e) { LOGGER.debug("Unable to create MimeType from raw data {}", contentType); } } else { LOGGER.debug("No content type specified in request"); } try { Metacard metacard = generateMetacard(mimeType, null, stream, null); String metacardId = metacard.getId(); LOGGER.debug("Metacard created", metacardId); LOGGER.debug( "Transforming metacard to to be able to return it to client", metacardId, transformer); final BinaryContent content = catalogFramework.transform(metacard, transformer, null); LOGGER.debug( "Metacard to transform complete for {}, preparing response.", transformer, metacardId); LOGGER.trace("EXITING: createMetacard"); return content; } catch (MetacardCreationException | CatalogTransformerException e) { throw new CatalogServiceException("Unable to create metacard"); } finally { try { if (stream != null) { stream.close(); } } catch (IOException e) { LOGGER.error("Unexpected error closing stream", e); } } }

Target:
private BinaryContent createMetacard( InputStream stream, String contentType, String transformerParam) throws CatalogServiceException { String transformer = DEFAULT_METACARD_TRANSFORMER; if (transformerParam != null) { transformer = transformerParam; } MimeType mimeType = null; if (contentType != null) { try { mimeType = new MimeType(contentType); } catch (MimeTypeParseException e) { LOGGER.debug("Unable to create MimeType from raw data {}", contentType); } } else { LOGGER.debug("No content type specified in request"); } try { Metacard metacard = generateMetacard(mimeType, null, stream, null); String metacardId = metacard.getId(); LOGGER.debug("Metacard created", metacardId); LOGGER.debug( "Transforming metacard to to be able to return it to client", metacardId, transformer); final BinaryContent content = catalogFramework.transform(metacard, transformer, null); LOGGER.debug( "Metacard to transform complete for {}, preparing response.", transformer, metacardId); LOGGER.trace("EXITING: createMetacard"); return content; } catch (MetacardCreationException | CatalogTransformerException e) { throw new CatalogServiceException("Unable to create metacard"); } finally { try { if (stream != null) { stream.close(); } } catch (IOException e) { LOGGER.debug("Unexpected error closing stream", e); } } }
Source:
public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException { String selectedMech = selectMechanism(mechanisms); if (selectedMech == null) { return null; } Boolean utf8 = (Boolean) props.get(AbstractMD5DigestMechanism.UTF8_PROPERTY); Charset charset = (utf8 == null || utf8.booleanValue()) ? Charsets.UTF_8 : Charsets.LATIN_1; String supprtedCipherOpts = (String) props.get(AbstractMD5DigestMechanism.SUPPORTED_CIPHERS_PROPERTY); String[] supportedCipherOpts = (supprtedCipherOpts == null ? null : supprtedCipherOpts.split(",")); final MD5DigestSaslClient client = new MD5DigestSaslClient(selectedMech, protocol, serverName, cbh, authorizationId, false, charset, supportedCipherOpts); client.init(); return client; }

Target:
public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException { String selectedMech = selectMechanism(mechanisms); if (selectedMech == null) return null; Boolean utf8 = (Boolean)props.get(AbstractMD5DigestMechanism.UTF8_PROPERTY); Charset charset = (utf8==null || utf8.booleanValue()) ? Charsets.UTF_8 : Charsets.LATIN_1; String supprtedCipherOpts = (String)props.get(AbstractMD5DigestMechanism.SUPPORTED_CIPHERS_PROPERTY); String[] supportedCipherOpts = (supprtedCipherOpts == null ? null : supprtedCipherOpts.split(",")); final MD5DigestSaslClient client = new MD5DigestSaslClient(selectedMech, protocol, serverName, cbh, authorizationId, false, charset, supportedCipherOpts); client.init(); return client; }
Source:
public String getStoreKey() { return m_storeKey; }

Target:
protected String getStoreKey() { return m_storeKey; }
Source:
public SearchRequestBuilder buildScrollSearchRequest() { String indices = index != null && !index.isEmpty() ? index : "_all"; List<String> fields = columns.stream() .map(ElasticsearchColumnHandle::getColumnName) .collect(toList()); SearchRequestBuilder searchRequestBuilder = client.prepareSearch(indices) .setTypes(type) .setSearchType(QUERY_THEN_FETCH) .setScroll(new TimeValue(scrollTimeout.toMillis())) .setFetchSource(fields.toArray(new String[0]), null) .setQuery(buildSearchQuery()) .setPreference("_shards:" + shard) .addSort("_doc", SortOrder.ASC) .setSize(scrollSize); LOG.debug("Elasticsearch Request: %s", searchRequestBuilder); return searchRequestBuilder; }

Target:
public SearchRequestBuilder buildScrollSearchRequest() { String indices = index != null && !index.isEmpty() ? index : "_all"; List<String> fields = columns.stream() .map(ElasticsearchColumnHandle::getColumnName) .collect(toList()); SearchRequestBuilder searchRequestBuilder = client.prepareSearch(indices) .setTypes(type) .setSearchType(QUERY_THEN_FETCH) .setScroll(new TimeValue(scrollTimeout.toMillis())) .setFetchSource(fields.toArray(new String[0]), null) .setQuery(buildSearchQuery()) .setPreference("_shards:" + shard) .addSort("_doc", ASC) .setSize(scrollSize); LOG.debug("Elasticsearch Request: %s", searchRequestBuilder); return searchRequestBuilder; }
Source:
WebsocketConnectionAttemptState(ModularXmppClientToServerConnectionInternal connectionInternal, XmppWebsocketTransportModule.XmppWebsocketTransport.DiscoveredWebsocketEndpoints discoveredWebsocketEndpoints, EstablishingWebsocketConnectionState establishingWebsocketConnectionState) throws IOException { this.connectionInternal = connectionInternal; this.discoveredEndpoints = discoveredWebsocketEndpoints; List<WebsocketRemoteConnectionEndpoint> endpoints = discoveredWebsocketEndpoints.result.discoveredRemoteConnectionEndpoints; connectionEndpointIterator = endpoints.iterator(); connectionEndpoint = connectionEndpointIterator.next(); connectionExceptions = new ArrayList<>(endpoints.size()); }

Target:
WebsocketConnectionAttemptState(ModularXmppClientToServerConnectionInternal connectionInternal, XmppWebsocketTransportModule.XmppWebsocketTransport.DiscoveredWebsocketEndpoints discoveredWebsocketEndpoints, EstablishingWebsocketConnectionState establishingWebsocketConnectionState) { assert discoveredWebsocketEndpoints != null; this.connectionInternal = connectionInternal; this.discoveredEndpoints = discoveredWebsocketEndpoints; }
Source:
public boolean isLocked() { return isLocked; }

Target:
public boolean isLocked() { return this.isLocked; }