auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void searchContacts(String query, ArrayList<SearchResult> resultList) { MainApplication.Contacts contacts = MainApplication.contacts; for (String id : MainApplication.dashboard.getUserIdsICanSee()) { String email = MainApplication.dashboard.getEmailByUserId(id); Contact contact = (contacts != null)? contacts.getContactByEmail(email) : null; String name = ""; if (contact != null) { name = contact.getName(); } if (email.toLowerCase().contains(query) || name.toLowerCase().contains(query)) { if(!name.isEmpty()) resultList.add(new SearchResult(ResultType.CONTACT, name, email)); else resultList.add(new SearchResult(ResultType.CONTACT, email, email)); } } }

Target:
protected void searchContacts(String query, ArrayList<SearchResult> resultList) { MainApplication.Contacts contacts = MainApplication.contacts; for (String id : MainApplication.dashboard.getUserIdsICanSee()) { String email = MainApplication.dashboard.getEmailByUserId(id); Contact contact = (contacts != null)? contacts.getContactByEmail(email) : null; String name = ""; if (contact != null) { name = contact.getName(); } if (email.toLowerCase().contains(query.toLowerCase()) || name.toLowerCase().contains(query.toLowerCase())) { if (!name.isEmpty()) { resultList.add(new SearchResult(ResultType.CONTACT, name, email)); } else { resultList.add(new SearchResult(ResultType.CONTACT, email, email)); } } } }
Source:
public int hashCode() { int pcHashCode = 0; Collection<ProductContentDTO> productContent = this.getProductContent(); if (productContent != null) { for (ProductContentDTO dto : productContent) { pcHashCode = 31 * pcHashCode + (dto != null ? dto.hashCode() : 0); } } int ppHashCode = 0; Collection<ProductDTO> providedProducts = this.getProvidedProducts(); if (providedProducts != null) { for (ProductDTO dto : providedProducts) { ppHashCode = 31 * ppHashCode + (dto != null ? dto.hashCode() : 0); } } HashCodeBuilder builder = new HashCodeBuilder(37, 7) .append(super.hashCode()) .append(this.getUuid()) .append(this.getId()) .append(this.getName()) .append(this.getMultiplier()) .append(this.getHref()) .append(this.getAttributes()) .append(this.getDependentProductIds()) .append(this.isLocked()) .append(this.getBranding()) .append(pcHashCode) .append(ppHashCode); return builder.toHashCode(); }

Target:
public int hashCode() { int pcHashCode = 0; Collection<ProductContentDTO> productContent = this.getProductContent(); if (productContent != null) { for (ProductContentDTO dto : productContent) { pcHashCode = 31 * pcHashCode + (dto != null ? dto.hashCode() : 0); } } HashCodeBuilder builder = new HashCodeBuilder(37, 7) .append(super.hashCode()) .append(this.getUuid()) .append(this.getId()) .append(this.getName()) .append(this.getMultiplier()) .append(this.getHref()) .append(this.getAttributes()) .append(this.getDependentProductIds()) .append(this.isLocked()) .append(this.getBranding()) .append(this.getProvidedProducts()) .append(pcHashCode); return builder.toHashCode(); }
Source:
private Block sessionPropertiesToBlock(Map<String, String> properties) { BlockBuilder mapArrayBuilder = sessionPropertiesType.createBlockBuilder(null, properties.size()); BlockBuilder singleMapWriter = mapArrayBuilder.beginBlockEntry(); Type keyType = sessionPropertiesType.getTypeParameters().get(0); Type valueType = sessionPropertiesType.getTypeParameters().get(1); for (Map.Entry<String, String> entry : properties.entrySet()) { appendToBlockBuilder(keyType, entry.getKey(), singleMapWriter); appendToBlockBuilder(valueType, entry.getValue(), singleMapWriter); } mapArrayBuilder.closeEntry(); return sessionPropertiesType.getObject(mapArrayBuilder, 0); }

Target:
private Block sessionPropertiesToBlock(Map<String, String> properties) { requireNonNull(properties, "properties is null"); BlockBuilder blockBuilder = sessionPropertiesType.createBlockBuilder(null, properties.size()); BlockBuilder entryBuilder = blockBuilder.beginBlockEntry(); Type keyType = sessionPropertiesType.getTypeParameters().get(0); Type valueType = sessionPropertiesType.getTypeParameters().get(1); for (Map.Entry<String, String> entry : properties.entrySet()) { appendToBlockBuilder(keyType, entry.getKey(), entryBuilder); appendToBlockBuilder(valueType, entry.getValue(), entryBuilder); } blockBuilder.closeEntry(); return sessionPropertiesType.getObject(blockBuilder, 0); }
Source:
public static long calculateChecksum(CallMessage msg, long digestSeed) { switch (msg.getChecksumType()) { case Adler32: Adler32 adler32 = new Adler32(); adler32.update((int) digestSeed); adler32.update(msg.getPayload().nioBuffer()); return adler32.getValue(); case FarmhashFingerPrint32: case NoChecksum: case CRC32C: CRC32 crc32 = new CRC32(); crc32.update((int) digestSeed); crc32.update(msg.getPayload().nioBuffer()); return crc32.getValue(); default: return 0; } }

Target:
public static long calculateChecksum(CallMessage msg, long digestSeed) { switch (msg.getChecksumType()) { case Adler32: Adler32 adler32 = new Adler32(); adler32.update((int) digestSeed); adler32.update(msg.getPayload().nioBuffer()); return adler32.getValue(); case CRC32C: CRC32 crc32 = new CRC32(); crc32.update((int) digestSeed); crc32.update(msg.getPayload().nioBuffer()); return crc32.getValue(); case FarmhashFingerPrint32: case NoChecksum: default: return 0; } }
Source:
public Service resolveServiceFrom(final Service service) { final Optional<String> result = getEntityIdAsParameter(service); if (result.isPresent()) { final String entityId = result.get(); LOGGER.debug("Located entity id from service authentication request at [{}]", entityId, service.getId()); final RegisteredService registeredService = servicesManager.findServiceBy(entityId); if (registeredService != null && registeredService.getAccessStrategy() != null && registeredService.getAccessStrategy().isServiceAccessAllowed()) { return this.webApplicationServiceFactory.createService(entityId); } LOGGER.debug("Entity id not registered as individual service", entityId); } LOGGER.debug("Could not located entity id from service authentication request at [{}]", service.getId()); return service; }

Target:
public Service resolveServiceFrom(final Service service) { final Optional<String> result = getEntityIdAsParameter(service); if (result.isPresent()) { final String entityId = result.get(); LOGGER.debug("Located entity id from service authentication request at [{}]", entityId, service.getId()); if (isEntityIdServiceRegistered(entityId)) { return this.webApplicationServiceFactory.createService(entityId); } LOGGER.debug("Entity id not registered as individual service", entityId); } LOGGER.debug("Could not located entity id from service authentication request at [{}]", service.getId()); return service; }
Source:
protected void onInit() { super.onInit(); if (this.evaluationContext == null && getBeanFactory() != null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } ReactiveRedisTemplate template = new ReactiveRedisTemplate<>(this.connectionFactory, this.serializationContext); this.reactiveStreamOperations = this.hashMapper == null ? template.opsForStream() : template.opsForStream(this.hashMapper); }

Target:
protected void onInit() { super.onInit(); this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); ReactiveRedisTemplate template = new ReactiveRedisTemplate<>(this.connectionFactory, this.serializationContext); this.reactiveStreamOperations = this.hashMapper == null ? template.opsForStream() : template.opsForStream(this.hashMapper); }
Source:
public List<String> upscaleCluster(HostGroup hostGroup, Collection<InstanceMetaData> instanceMetaDatas) throws CloudbreakException { LOGGER.debug("Invoking CM requests for upscale"); int hostCount = -1; Instant start = Instant.now(); ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(apiClient); try { String clusterName = stack.getName(); List<String> upscaleHostNames = getUpscaleHosts(clustersResourceApi, clusterName, instanceMetaDatas); if (!upscaleHostNames.isEmpty()) { List<ApiHost> hosts = clouderaManagerApiFactory.getHostsResourceApi(apiClient).readHosts(null, null, SUMMARY).getItems(); ApiHostRefList body = createUpscaledHostRefList(upscaleHostNames, hosts); hostCount = body.getItems().size(); clustersResourceApi.addHosts(clusterName, body); activateParcel(clustersResourceApi); applyHostGroupRolesOnUpscaledHosts(body, hostGroup.getName()); } else { redistributeParcelsForRecovery(); activateParcel(clustersResourceApi); clouderaManagerRoleRefreshService.refreshClusterRoles(apiClient, stack); } return instanceMetaDatas.stream().map(InstanceMetaData::getDiscoveryFQDN).collect(Collectors.toList()); } catch (ApiException e) { LOGGER.warn("Failed to upscale: {}", e.getResponseBody(), e); throw new CloudbreakException("Failed to upscale", e); } finally { LOGGER.debug("CM upscale request finished for hosts in ms", hostCount == -1 ? "NA" : hostCount, Duration.between(start, Instant.now()).toMillis()); } }

Target:
public List<String> upscaleCluster(HostGroup hostGroup, Collection<InstanceMetaData> instanceMetaDatas) throws CloudbreakException { LOGGER.debug("Invoking CM requests for upscale for hostGroup={}, insteanceCount={}", hostGroup.getName(), instanceMetaDatas == null ? 0 : instanceMetaDatas.size()); int hostCount = -1; Instant start = Instant.now(); ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(apiClient); try { String clusterName = stack.getName(); List<String> upscaleHostNames = getUpscaleHosts(clustersResourceApi, clusterName, instanceMetaDatas); if (!upscaleHostNames.isEmpty()) { List<ApiHost> hosts = clouderaManagerApiFactory.getHostsResourceApi(apiClient).readHosts(null, null, SUMMARY).getItems(); ApiHostRefList body = createUpscaledHostRefList(upscaleHostNames, hosts); hostCount = body.getItems().size(); clustersResourceApi.addHosts(clusterName, body); activateParcel(clustersResourceApi); applyHostGroupRolesOnUpscaledHosts(body, hostGroup.getName()); } else { redistributeParcelsForRecovery(); activateParcel(clustersResourceApi); clouderaManagerRoleRefreshService.refreshClusterRoles(apiClient, stack); } return instanceMetaDatas.stream().map(InstanceMetaData::getDiscoveryFQDN).collect(Collectors.toList()); } catch (ApiException e) { LOGGER.warn("Failed to upscale: {}", e.getResponseBody(), e); throw new CloudbreakException("Failed to upscale", e); } finally { LOGGER.debug("CM upscale request finished for hosts in ms", hostCount == -1 ? "NA" : hostCount, Duration.between(start, Instant.now()).toMillis()); } }
Source:
public String getDisplayName() { return "Use of auto refresh feature"; }

Target:
public String getDisplayName() { return Messages.AutoRefresh_DisplayName(); }
Source:
private void populateRuleStore() { this.ruleStore = new HashMap<>(); definition.getItems().stream().filter((item) -> item instanceof Module).forEach((item) -> { ((Module) item).getItems().stream().forEach((moduleItem) -> { Source src = moduleItem.getSource(); Location location = moduleItem.getLocation(); if (src != null && location != null) { ruleStore.put(new MutablePair<>(src, location), moduleItem); } }); }); }

Target:
private void populateRuleStore() { this.ruleStore = new HashMap<>(); definition.getItems().stream().filter((item) -> item instanceof Module).forEach((item) -> { ((Module) item).getItems().stream().forEach((moduleItem) -> { Source src = moduleItem.getSource(); Location location = moduleItem.getLocation(); if (src != null && location != null) { ruleStore.put(Pair.of(src, location), moduleItem); } }); }); }
Source:
private boolean validate(Patient patient) { boolean ferr=false, lerr=false, doberr=false, gerr=false, adderr=false; mRegisterPatientView.setErrorsVisibility(ferr, lerr, doberr, gerr, adderr); if(StringUtils.isBlank(patient.getPerson().getName().getGivenName())) { ferr=true; } if(StringUtils.isBlank(patient.getPerson().getName().getFamilyName())) { lerr=true; } if(!StringUtils.isBlank(patient.getPerson().getBirthdate())) { Calendar birthDateCalendar = Calendar.getInstance(); Long ageInMillis = DateUtils.convertTime(patient.getPerson().getBirthdate()); birthDateCalendar.setTimeInMillis(ageInMillis); int currentYear = Calendar.getInstance().get(Calendar.YEAR); int patientAge = currentYear - birthDateCalendar.get(Calendar.YEAR); if (patientAge > ApplicationConstants.RegisterPatientRequirements.MAX_PATIENT_AGE) { ToastUtil.error("Patient's age must be between 0 and " + ApplicationConstants.RegisterPatientRequirements.MAX_PATIENT_AGE); doberr = true; } } else { doberr = true; } if(StringUtils.isBlank(patient.getPerson().getAddress().getAddress1()) && StringUtils.isBlank(patient.getPerson().getAddress().getAddress2()) && StringUtils.isBlank(patient.getPerson().getAddress().getCityVillage()) && StringUtils.isBlank(patient.getPerson().getAddress().getStateProvince()) && StringUtils.isBlank(patient.getPerson().getAddress().getCountry()) && StringUtils.isBlank(patient.getPerson().getAddress().getPostalCode())) { adderr=true; } if (StringUtils.isBlank(patient.getPerson().getGender())) { gerr=true; } boolean result = !ferr && !lerr && !doberr && !adderr && !gerr; if (result) { mPatient = patient; return true; } else { mRegisterPatientView.setErrorsVisibility(ferr, lerr, doberr, adderr, gerr); return false; } }

Target:
private boolean validate(Patient patient) { boolean ferr=false, lerr=false, doberr=false, gerr=false, adderr=false; mRegisterPatientView.setErrorsVisibility(ferr, lerr, doberr, gerr, adderr); if(StringUtils.isBlank(patient.getPerson().getName().getGivenName())) { ferr=true; } if(StringUtils.isBlank(patient.getPerson().getName().getFamilyName())) { lerr=true; } if(StringUtils.isBlank(patient.getPerson().getBirthdate())) { doberr = true; } if(StringUtils.isBlank(patient.getPerson().getAddress().getAddress1()) && StringUtils.isBlank(patient.getPerson().getAddress().getAddress2()) && StringUtils.isBlank(patient.getPerson().getAddress().getCityVillage()) && StringUtils.isBlank(patient.getPerson().getAddress().getStateProvince()) && StringUtils.isBlank(patient.getPerson().getAddress().getCountry()) && StringUtils.isBlank(patient.getPerson().getAddress().getPostalCode())) { adderr=true; } if (StringUtils.isBlank(patient.getPerson().getGender())) { gerr=true; } boolean result = !ferr && !lerr && !doberr && !adderr && !gerr; if (result) { mPatient = patient; return true; } else { mRegisterPatientView.setErrorsVisibility(ferr, lerr, doberr, adderr, gerr); return false; } }
Source:
public void onFinish(List<Section> result) { if (!isAdded()) { Log.d("PageViewFragment", "Detached from activity, so stopping update."); return; } page = new Page(title, (ArrayList<Section>) result, pageProperties); editHandler.setPage(page); displayLeadSection(); setState(STATE_INITIAL_FETCH); new RestSectionsFetchTask().execute(); curEntry = new HistoryEntry(title, curEntry.getTimestamp(), curEntry.getSource()); new HistorySaveTask(curEntry).execute(); if (title.getThumbUrl() != null) { PageImage pi = new PageImage(title, title.getThumbUrl()); app.getPersister(PageImage.class).upsert(pi); } }

Target:
public void onFinish(List<Section> result) { if (!isAdded()) { Log.d("PageViewFragment", "Detached from activity, so stopping update."); return; } page = new Page(title, (ArrayList<Section>) result, pageProperties); editHandler.setPage(page); displayLeadSection(); setState(STATE_INITIAL_FETCH); new RestSectionsFetchTask().execute(); curEntry = new HistoryEntry(title, curEntry.getTimestamp(), curEntry.getSource()); new PersistPageItemsTask(curEntry, title).execute(); }
Source:
public CohortDefinition getPatientsWithState() { PatientStateCohortDefinition cd = new PatientStateCohortDefinition(); cd.addParameter(new Parameter("states", "reporting.parameter.states", ProgramWorkflowState.class, List.class, null)); cd.addParameter(new Parameter("startedOnOrAfter", "reporting.parameter.startDate", Date.class)); cd.addParameter(new Parameter("startedOnOrBefore", "reporting.parameter.endDate", Date.class)); cd.addParameter(new Parameter("endedOnOrAfter", "reporting.parameter.startDate", Date.class)); cd.addParameter(new Parameter("endedOnOrBefore", "reporting.parameter.endDate", Date.class)); return new MappedParametersCohortDefinition(cd, "states", "states", "startedOnOrAfter", "enrolledOnOrAfter", "startedOnOrBefore", "enrolledOnOrBefore", "endedOnOrAfter", "completedOnOrAfter", "endedOnOrBefore", "completedOnOrBefore" ); }

Target:
public CohortDefinition getPatientsWithState() { PatientStateCohortDefinition cd = new PatientStateCohortDefinition(); cd.addParameter(new Parameter("states", "reporting.parameter.states", ProgramWorkflowState.class, List.class, null)); cd.addParameter(new Parameter("startedOnOrAfter", "reporting.parameter.startedOnOrAfter", Date.class)); cd.addParameter(new Parameter("startedOnOrBefore", "reporting.parameter.startedOnOrBefore", Date.class)); cd.addParameter(new Parameter("endedOnOrAfter", "reporting.parameter.endedOnOrAfter", Date.class)); cd.addParameter(new Parameter("endedOnOrBefore", "reporting.parameter.endedOnOrBefore", Date.class)); return cd; }
Source:
private void send(String message){ ReactorClient client = JsonRpcServer.getReactorClient(); try { client.sendMessage(message.getBytes()); log.error("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Failure in sending response", e); }finally { log.debug("send events"); } }

Target:
private void send(String message){ ReactorClient client = JsonRpcServer.getReactorClient(); try { client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Failure in sending response", e); } }
Source:
default <C> TriConstraintStream<A, B, C> join(Class<C> otherClass, TriJoiner<A, B, C>... joiners) { int joinerCount = joiners.length; int indexOfFirstFilter = -1; for (int i = 0; i < joinerCount; i++) { TriJoiner<A, B, C> joiner = joiners[i]; if (indexOfFirstFilter >= 0) { if (!(joiner instanceof FilteringTriJoiner)) { throw new IllegalStateException("Indexing joiner (" + joiner + ") must not follow " + "a filtering joiner (" + joiners[indexOfFirstFilter] + ").\n" + "Maybe reorder the joiners such that filtering() joiners are later in the parameter list."); } } else { if (joiner instanceof FilteringTriJoiner) { indexOfFirstFilter = i; } } } if (indexOfFirstFilter < 0) { return join(otherClass, AbstractTriJoiner.merge(joiners)); } TriConstraintStream<A, B, C> joined = indexOfFirstFilter == 0 ? join(otherClass) : join(otherClass, Arrays.copyOf(joiners, indexOfFirstFilter)); int filterCount = joinerCount - indexOfFirstFilter; if (filterCount == 0) { return joined; } FilteringTriJoiner<A, B, C> filteringJoiner = (FilteringTriJoiner<A, B, C>) joiners[indexOfFirstFilter]; TriPredicate<A, B, C> resultingFilter = filteringJoiner.getFilter(); for (int i = indexOfFirstFilter + 1; i < joinerCount; i++) { FilteringTriJoiner<A, B, C> anoterFilteringJoiner = (FilteringTriJoiner<A, B, C>) joiners[i]; resultingFilter = resultingFilter.and(anoterFilteringJoiner.getFilter()); } return joined.filter(resultingFilter); }

Target:
default <C> TriConstraintStream<A, B, C> join(Class<C> otherClass, TriJoiner<A, B, C>... joiners) { BiConstraintStreamHelper<A, B, C> helper = new BiConstraintStreamHelper<>(this); return helper.join(otherClass, joiners); }
Source:
static void pullTimeoutAndRetry(final ParameterWorker<Integer, ?, Integer> worker, final WorkerHandler<Integer, ?, Integer> handler, final WorkerMsgSender<Integer, ?> sender) throws NetworkException, InterruptedException, TimeoutException, ExecutionException { final CountDownLatch sendLatch = new CountDownLatch(AsyncParameterWorker.MAX_PULL_RETRY_COUNT); final long gracePeriodMs = 100; final ExecutorService pool = Executors.newSingleThreadExecutor(); final int key = 0; doAnswer(invocationOnMock -> { sendLatch.countDown(); if (sendLatch.getCount() > 0) { throw new NetworkException("exception"); } final EncodedKey<Integer> encodedKey = (EncodedKey) invocationOnMock.getArguments()[1]; handler.processPullReply(encodedKey.getKey(), encodedKey.getKey()); return null; }).when(sender).sendPullMsg(anyString(), anyObject()); pool.execute(() -> worker.pull(key)); assertTrue(sendLatch.await((PULL_RETRY_TIMEOUT_MS + gracePeriodMs) * AsyncParameterWorker.MAX_PULL_RETRY_COUNT, TimeUnit.MILLISECONDS)); worker.close(CLOSE_TIMEOUT); pool.shutdown(); verify(sender, times(AsyncParameterWorker.MAX_PULL_RETRY_COUNT)).sendPullMsg(anyString(), any(EncodedKey.class)); }

Target:
static void pullTimeoutAndRetry(final ParameterWorker<Integer, ?, Integer> worker, final WorkerHandler<Integer, ?, Integer> handler, final WorkerMsgSender<Integer, ?> sender) throws NetworkException, InterruptedException, TimeoutException, ExecutionException { final CountDownLatch sendLatch = new CountDownLatch(AsyncParameterWorker.MAX_PULL_RETRY_COUNT); final long gracePeriodMs = 100; final ExecutorService pool = Executors.newSingleThreadExecutor(); final int key = 0; doAnswer(invocationOnMock -> { sendLatch.countDown(); if (sendLatch.getCount() > 0) { return null; } final EncodedKey<Integer> encodedKey = (EncodedKey) invocationOnMock.getArguments()[1]; handler.processPullReply(encodedKey.getKey(), encodedKey.getKey()); return null; }).when(sender).sendPullMsg(anyString(), anyObject()); pool.execute(() -> worker.pull(key)); assertTrue(sendLatch.await((PULL_RETRY_TIMEOUT_MS + gracePeriodMs) * AsyncParameterWorker.MAX_PULL_RETRY_COUNT, TimeUnit.MILLISECONDS)); worker.close(CLOSE_TIMEOUT); pool.shutdown(); verify(sender, times(AsyncParameterWorker.MAX_PULL_RETRY_COUNT)).sendPullMsg(anyString(), any(EncodedKey.class)); }
Source:
public String getEmail(GHMyself myself) throws IOException { for (GHEmail email: myself.getEmails2()) { if (email.isPrimary()) { return email.getEmail(); } } return null; }

Target:
private String getEmail(GHMyself myself) throws IOException { for (GHEmail email: myself.getEmails2()) { if (email.isPrimary()) { return email.getEmail(); } } return null; }
Source:
public boolean equals(Object o) { if (o instanceof BaseThrowingIntermediateEvent) { BaseThrowingIntermediateEvent other = (BaseThrowingIntermediateEvent) o; return (other.general == null ? general == null : other.general.equals(general)) && (other.dataIOSet == null ? dataIOSet == null : other.dataIOSet.equals(dataIOSet)) && (other.backgroundSet == null ? backgroundSet == null : other.backgroundSet.equals(backgroundSet)) && (other.fontSet == null ? fontSet == null : other.fontSet.equals(fontSet)) && (other.dimensionsSet == null ? dimensionsSet == null : other.dimensionsSet.equals(dimensionsSet)); } return false; }

Target:
public boolean equals(Object o) { if (o instanceof BaseThrowingIntermediateEvent) { BaseThrowingIntermediateEvent other = (BaseThrowingIntermediateEvent) o; return Objects.equals(general, other.general) && Objects.equals(dataIOSet, other.dataIOSet) && Objects.equals(backgroundSet, other.backgroundSet) && Objects.equals(fontSet, other.fontSet) && Objects.equals(dimensionsSet, other.dimensionsSet) && Objects.equals(labels, other.labels); } return false; }
Source:
final PublisherVerification<Integer> noopPublisherVerification() { return new PublisherVerification<Integer>(newTestEnvironment(), GC_TIMEOUT_MILLIS) { @Override public Publisher<Integer> createPublisher(long elements) { return new Publisher<Integer>() { @Override public void subscribe(Subscriber<? super Integer> s) { s.onSubscribe(new Subscription() { @Override public void request(long n) { } @Override public void cancel() { } }); } }; } @Override public Publisher<Integer> createErrorStatePublisher() { return SKIP; } }; }

Target:
final PublisherVerification<Integer> noopPublisherVerification() { return new PublisherVerification<Integer>(newTestEnvironment(), GC_TIMEOUT_MILLIS) { @Override public Publisher<Integer> createPublisher(long elements) { return new Publisher<Integer>() { @Override public void subscribe(Subscriber<? super Integer> s) { s.onSubscribe(new NoopSubscription()); } }; } @Override public Publisher<Integer> createErrorStatePublisher() { return SKIP; } }; }
Source:
public static ApplyAnchor fromBundleFragment(Map<String, Object> bundleFragment) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { int arity = ((Double)bundleFragment.get("arity")).intValue(); return new ApplyAnchor(arity); }

Target:
public static ApplyAnchor fromBundleFragment(Map<String, Object> bundleFragment) { int arity = ((Double)bundleFragment.get("arity")).intValue(); return new ApplyAnchor(arity); }
Source:
public void setFacing(@Nonnull EnumFacing facing) { TileSteamOven masterOven = (TileSteamOven) getMasterBlock(); if (masterOven != null) { masterOven.facing = facing; } this.facing = facing; WorldPlugin.setBlockState(worldObj, getPos(), getBlockState().withProperty(BlockMachineAlpha.FRONT, facing)); }

Target:
public void setFacing(@Nonnull EnumFacing facing) { TileSteamOven masterOven = (TileSteamOven) getMasterBlock(); if (masterOven != null) { masterOven.facing = facing; } this.facing = facing; }
Source:
public void testCreateDonorViewModelWithPermissions_shouldReturnViewModelWithCorrectDonorAndPermissions() { boolean irrelevantCanDeletePermission = true; UUID irrelevantDonorId = UUID.fromString("11e71397-0000-0000-0000-0000000AA865"); Donor donor = aDonor().withId(irrelevantDonorId).build(); DonorViewModel expectedDonorViewModel = aDonorViewModel() .withDonor(donor) .withPermission("canDelete", irrelevantCanDeletePermission) .build(); when(donorConstraintChecker.canDeleteDonor(irrelevantDonorId)).thenReturn(irrelevantCanDeletePermission); DonorViewModel returnedDonorViewModel = donorViewModelFactory.createDonorViewModelWithPermissions(donor); assertThat(returnedDonorViewModel, hasSameStateAsDonorViewModel(expectedDonorViewModel)); }

Target:
public void testCreateDonorViewModelWithPermissions_shouldReturnViewModelWithCorrectDonorAndPermissions() { boolean irrelevantCanDeletePermission = true; UUID irrelevantDonorId = UUID.randomUUID(); Donor donor = aDonor().withId(irrelevantDonorId).build(); DonorViewModel expectedDonorViewModel = aDonorViewModel() .withDonor(donor) .withPermission("canDelete", irrelevantCanDeletePermission) .build(); when(donorConstraintChecker.canDeleteDonor(irrelevantDonorId)).thenReturn(irrelevantCanDeletePermission); DonorViewModel returnedDonorViewModel = donorViewModelFactory.createDonorViewModelWithPermissions(donor); assertThat(returnedDonorViewModel, hasSameStateAsDonorViewModel(expectedDonorViewModel)); }
Source:
private static void assertResult(IgniteEx ignite, TextQuery qry, TestPair testPair) throws IgniteCheckedException { if (qry.getLimit() > 0){ assertTrue(testPair.all.size() <= QUERY_LIMIT); } else { checkForMissedKeys(ignite, testPair.expected, testPair.all); } }

Target:
private static void assertResult(IgniteEx ignite, TextQuery qry, TestPair testPair) throws IgniteCheckedException { if (qry.getLimit() > 0) assertTrue(testPair.all.size() <= QUERY_LIMIT); else checkForMissedKeys(ignite, testPair.expected, testPair.all); }
Source:
public static DBObject associationKeyToObject(AssociationKey key) { DBObject obj = new BasicDBObject(); Map<String,Object> fieldMap = new HashMap<String,Object>(); int i = 0; Object[] columnValues = key.getColumnValues(); for (String name : key.getColumnNames()) fieldMap.put(name, columnValues[i++]); obj.put(MongoDBDialect.ASSOCIATIONS_FIELDNAME, fieldMap); obj.put(MongoDBDialect.TABLE_FIELDNAME, key.getTable()); return obj; }

Target:
public static DBObject associationKeyToObject(AssociationKey key) { Object[] columnValues = key.getColumnValues(); DBObject columns = new BasicDBObject(columnValues.length); DBObject obj = new BasicDBObject(1); int i = 0; for (String name : key.getColumnNames()) columns.put(name, columnValues[i++]); obj.put(MongoDBDialect.COLUMNS_FIELDNAME, columns); return obj; }
Source:
public void shouldReportViolationWithOutDetails() throws IOException { new ConfigurationSetup().setUp(ImmutableMap.of(GeneralOption.VOLATIONS_WITH_DETAILS.getKey(), "false")); renderer.getReviewResult().getViolations().clear(); Rule rule = createRule(ruleDescription, externalInfoUrl, priority); Report report = createReportWithVolation(createRuleViolation(rule, violationDescription)); renderer.renderFileReport(report); Violation violation = renderer.getReviewResult().getViolations().get(0); assertThat(violation.getMessage()).doesNotContain(ruleDescription); assertThat(violation.getMessage()).doesNotContain(externalInfoUrl); }

Target:
public void shouldReportViolationWithOutDetails() throws IOException { new ConfigurationSetup().setUp(ImmutableMap.of(GeneralOption.VOLATIONS_WITH_DETAILS.getKey(), "false")); renderer.getReviewResult().getViolations().clear(); Rule rule = createRule(ruleDescription, externalInfoUrl, RulePriority.MEDIUM); Report report = createReportWithVolation(createRuleViolation(rule, violationDescription)); renderer.renderFileReport(report); Violation violation = renderer.getReviewResult().getViolations().get(0); assertThat(violation.getMessage()).isEqualTo(violationDescription); }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.ImageTransfer map(ImageTransfer model, org.ovirt.engine.core.common.businessentities.storage.ImageTransfer template) { org.ovirt.engine.core.common.businessentities.storage.ImageTransfer entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.storage.ImageTransfer(); if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetHost() && model.getHost().isSetId()) { entity.setVdsId(GuidUtils.asGuid(model.getHost().getId())); } if (model.isSetImage() && model.getImage().isSetId()) { entity.setDiskId(GuidUtils.asGuid(model.getImage().getId())); } if (model.isSetFormat()) { entity.setImageFormat(map(model.getFormat(), null)); } if (model.isSetBackup() && model.getImage().isSetId()) { entity.setBackupId(GuidUtils.asGuid(model.getBackup().getId())); } return entity; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.ImageTransfer map(ImageTransfer model, org.ovirt.engine.core.common.businessentities.storage.ImageTransfer template) { org.ovirt.engine.core.common.businessentities.storage.ImageTransfer entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.storage.ImageTransfer(); if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetHost() && model.getHost().isSetId()) { entity.setVdsId(GuidUtils.asGuid(model.getHost().getId())); } if (model.isSetImage() && model.getImage().isSetId()) { entity.setDiskId(GuidUtils.asGuid(model.getImage().getId())); } if (model.isSetFormat()) { entity.setImageFormat(map(model.getFormat(), null)); } if (model.isSetBackup() && model.getBackup().isSetId()) { entity.setBackupId(GuidUtils.asGuid(model.getBackup().getId())); } return entity; }
Source:
@Override public void onLocationPermissionsGranted() { googleMap.setMyLocationEnabled(true); googleMap.getUiSettings().setMyLocationButtonEnabled(true); }

Target:
@Override public void onLocationPermissionsGranted() { googleMap.setMyLocationEnabled(myLocationEnabled); }
Source:
public boolean canCreate(Repository repo, RevWalk rw, RevObject object) { if (!canWrite()) { return false; } boolean owner; switch (getCurrentUser().getAccessPath()) { case REST_API: case JSON_RPC: owner = isOwner(); break; default: owner = false; } if (object instanceof RevCommit) { return owner || (canPerform(Permission.CREATE) && canReadCommit(repo, rw, (RevCommit) object)); } else if (object instanceof RevTag) { final RevTag tag = (RevTag) object; try { rw.parseBody(tag); } catch (IOException e) { return false; } final PersonIdent tagger = tag.getTaggerIdent(); if (tagger != null) { boolean valid; if (getCurrentUser() instanceof IdentifiedUser) { final IdentifiedUser user = (IdentifiedUser) getCurrentUser(); final String addr = tagger.getEmailAddress(); valid = user.getEmailAddresses().contains(addr); } else { valid = false; } if (!valid && !owner && !canForgeCommitter()) { return false; } } if (tag.getFullMessage().contains("-----BEGIN PGP SIGNATURE-----\n")) { return owner || canPerform(Permission.PUSH_SIGNED_TAG); } else { return owner || canPerform(Permission.PUSH_TAG); } } else { return false; } }

Target:
public boolean canCreate(Repository repo, RevWalk rw, RevObject object) { if (!canWrite()) { return false; } boolean owner; switch (getCurrentUser().getAccessPath()) { case REST_API: case JSON_RPC: owner = isOwner(); break; default: owner = false; } if (object instanceof RevCommit) { return owner || (canPerform(Permission.CREATE) && projectControl.canReadCommit(rw, (RevCommit) object)); } else if (object instanceof RevTag) { final RevTag tag = (RevTag) object; try { rw.parseBody(tag); } catch (IOException e) { return false; } final PersonIdent tagger = tag.getTaggerIdent(); if (tagger != null) { boolean valid; if (getCurrentUser() instanceof IdentifiedUser) { final IdentifiedUser user = (IdentifiedUser) getCurrentUser(); final String addr = tagger.getEmailAddress(); valid = user.getEmailAddresses().contains(addr); } else { valid = false; } if (!valid && !owner && !canForgeCommitter()) { return false; } } if (tag.getFullMessage().contains("-----BEGIN PGP SIGNATURE-----\n")) { return owner || canPerform(Permission.PUSH_SIGNED_TAG); } else { return owner || canPerform(Permission.PUSH_TAG); } } else { return false; } }
Source:
public static String getSiteLoginUrl(SiteModel site) { if (site.isJetpackConnected()) { return WPCOM_LOGIN_URL; } String loginURL = site.getLoginUrl(); if (loginURL == null) { if (site.getUrl() != null) { return site.getUrl() + "/wp-login.php"; } else { return site.getXmlRpcUrl().replace("xmlrpc.php", "wp-login.php"); } } return loginURL; }

Target:
public static String getSiteLoginUrl(SiteModel site) { String loginURL = site.getLoginUrl(); if (loginURL == null) { if (site.getUrl() != null) { return site.getUrl() + "/wp-login.php"; } else { return site.getXmlRpcUrl().replace("xmlrpc.php", "wp-login.php"); } } return loginURL; }
Source:
public void testRemoteMapReduceWithStreams_DistributedMode() throws Exception { String cacheName = "testRemoteMapReduce_Streams_dist"; ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); builder.dataContainer().keyEquivalence(new AnyServerEquivalence()).valueEquivalence(new AnyServerEquivalence()) .compatibility().enable().marshaller(new GenericJBossMarshaller()); defineInAll(cacheName, builder); waitForClusterToForm(cacheName); RemoteCache<String, String> cache = clients.get(0).getCache(cacheName); RemoteCache<String, String> scriptCache = clients.get(1).getCache(SCRIPT_CACHE); loadData(cache, "/macbeth.txt"); loadScript(scriptCache, "/wordCountStream_dist.js"); ArrayList<HashMap<String, Long>> results = cache.execute("wordCountStream_dist.js", new HashMap<String, String>()); assertEquals(2, results.size()); assertEquals(3209, results.get(0).size()); assertEquals(3209, results.get(1).size()); assertTrue(results.get(0).get("macbeth").equals(Long.valueOf(287))); assertTrue(results.get(1).get("macbeth").equals(Long.valueOf(287))); }

Target:
public void testRemoteMapReduceWithStreams_DistributedMode() throws Exception { String cacheName = "testRemoteMapReduce_Streams_dist"; ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); builder.dataContainer().keyEquivalence(new AnyServerEquivalence()).valueEquivalence(new AnyServerEquivalence()) .compatibility().enable().marshaller(new GenericJBossMarshaller()); defineInAll(cacheName, builder); waitForClusterToForm(cacheName); RemoteCache<String, String> cache = clients.get(0).getCache(cacheName); RemoteCache<String, String> scriptCache = clients.get(1).getCache(SCRIPT_CACHE); loadData(cache, "/macbeth.txt"); loadScript(scriptCache, "/wordCountStream_dist.js"); ArrayList<Map<String, Long>> results = cache.execute("wordCountStream_dist.js", new HashMap<String, String>()); assertEquals(2, results.size()); assertEquals(3209, results.get(0).size()); assertEquals(3209, results.get(1).size()); assertTrue(results.get(0).get("macbeth").equals(Long.valueOf(287))); assertTrue(results.get(1).get("macbeth").equals(Long.valueOf(287))); }
Source:
private void testBinaryStatsWithTruncation(int truncateLen, int minLen, int maxLen) { BinaryStatistics stats = new BinaryStatistics(); byte[] min = generateRandomString("a", minLen).getBytes(); byte[] max = generateRandomString("b", maxLen).getBytes(); stats.updateStats(Binary.fromConstantByteArray(min)); stats.updateStats(Binary.fromConstantByteArray(max)); ParquetMetadataConverter metadataConverter = new ParquetMetadataConverter(truncateLen); org.apache.parquet.format.Statistics formatStats = metadataConverter.toParquetStatistics(stats); if (minLen >= ParquetMetadataConverter.MAX_STATS_SIZE || maxLen >= ParquetMetadataConverter.MAX_STATS_SIZE) { assertNull(formatStats.getMin_value()); assertNull(formatStats.getMax_value()); } else { String minString = new String(min, Charset.forName("UTF-8")); String minStatString = new String(formatStats.getMin_value(), Charset.forName("UTF-8")); assertTrue(minStatString.compareTo(minString) <= 0); String maxString = new String(max, Charset.forName("UTF-8")); String maxStatString = new String(formatStats.getMax_value(), Charset.forName("UTF-8")); assertTrue(maxStatString.compareTo(maxString) >= 0); } }

Target:
private void testBinaryStatsWithTruncation(int truncateLen, int minLen, int maxLen) { BinaryStatistics stats = new BinaryStatistics(); byte[] min = generateRandomString("a", minLen).getBytes(); byte[] max = generateRandomString("b", maxLen).getBytes(); stats.updateStats(Binary.fromConstantByteArray(min)); stats.updateStats(Binary.fromConstantByteArray(max)); ParquetMetadataConverter metadataConverter = new ParquetMetadataConverter(truncateLen); org.apache.parquet.format.Statistics formatStats = metadataConverter.toParquetStatistics(stats); if (minLen + maxLen >= ParquetMetadataConverter.MAX_STATS_SIZE) { assertNull(formatStats.getMin_value()); assertNull(formatStats.getMax_value()); } else { String minString = new String(min, Charset.forName("UTF-8")); String minStatString = new String(formatStats.getMin_value(), Charset.forName("UTF-8")); assertTrue(minStatString.compareTo(minString) <= 0); String maxString = new String(max, Charset.forName("UTF-8")); String maxStatString = new String(formatStats.getMax_value(), Charset.forName("UTF-8")); assertTrue(maxStatString.compareTo(maxString) >= 0); } }
Source:
public static String getFQNForFile(VirtualFile file) { String packageName = ""; if (file instanceof JavaFileNode) { if (((JavaFileNode)file).getParent() instanceof PackageNode) { packageName = ((PackageNode)((JavaFileNode)file).getParent()).getPackage(); } if (!packageName.isEmpty()) { packageName = packageName + "."; } return packageName + file.getName().substring(0, file.getName().lastIndexOf('.')); } else if (file instanceof ContentNode || file instanceof JarFileNode) { return file.getPath(); } return file.getName().substring(0, file.getName().lastIndexOf('.')); }

Target:
public static String getFQNForFile(VirtualFile file) { String packageName = ""; if (file instanceof JavaFileNode) { if (((JavaFileNode)file).getParent() instanceof PackageNode) { packageName = ((PackageNode)((JavaFileNode)file).getParent()).getPackage(); } if (!packageName.isEmpty()) { packageName = packageName + "."; } return packageName + file.getName().substring(0, file.getName().lastIndexOf('.')); } else if (file instanceof JarFileNode) { return file.getPath(); } return file.getName().substring(0, file.getName().lastIndexOf('.')); }
Source:
protected ConsumerRecords<?, ?> pollRecords(long pollInterval) throws Exception { ConsumerRecords<?, ?> records; try { long curPollTime = System.currentTimeMillis(); _lastPolledTimeMillis = curPollTime; records = consumerPoll(pollInterval); long pollDurationMillis = System.currentTimeMillis() - curPollTime; if (pollDurationMillis > pollInterval + POLL_BUFFER_TIME_MILLIS) { _logger.warn("ConsumerId: {}, Kafka client poll took ms (> poll timeout + buffer time ms)", _taskName, pollDurationMillis, pollInterval, POLL_BUFFER_TIME_MILLIS); _consumerMetrics.updateClientPollOverTimeout(1); } _consumerMetrics.updateNumPolls(1); _consumerMetrics.updateEventCountsPerPoll(records.count()); if (_enablePollDurationMsMetric) { _dynamicMetricsManager.createOrUpdateHistogram(_metricsPrefix, _datastreamName, POLL_DURATION_MS, pollDurationMillis); } if (!records.isEmpty()) { _consumerMetrics.updateEventsProcessedRate(records.count()); _consumerMetrics.updateLastEventReceivedTime(Instant.now()); } _pollAttempts.set(0); return records; } catch (NoOffsetForPartitionException e) { handleNoOffsetForPartitionException(e); return ConsumerRecords.EMPTY; } catch (WakeupException e) { _logger.warn("Got a WakeupException, shutdown in progress.", e); return ConsumerRecords.EMPTY; } catch (Exception e) { handlePollRecordsException(e); return ConsumerRecords.EMPTY; } }

Target:
protected ConsumerRecords<?, ?> pollRecords(long pollInterval) throws Exception { ConsumerRecords<?, ?> records; try { long curPollTime = System.currentTimeMillis(); _lastPolledTimeMillis = curPollTime; records = consumerPoll(pollInterval); long pollDurationMillis = System.currentTimeMillis() - curPollTime; if (pollDurationMillis > pollInterval + POLL_BUFFER_TIME_MILLIS) { _logger.warn("ConsumerId: {}, Kafka client poll took ms (> poll timeout + buffer time ms)", _taskName, pollDurationMillis, pollInterval, POLL_BUFFER_TIME_MILLIS); _consumerMetrics.updateClientPollOverTimeout(1); } _consumerMetrics.updateNumPolls(1); _consumerMetrics.updateEventCountsPerPoll(records.count()); if (_enablePollDurationMillisMetric) { _consumerMetrics.updatePollDurationMs(pollDurationMillis); } if (!records.isEmpty()) { _consumerMetrics.updateEventsProcessedRate(records.count()); _consumerMetrics.updateLastEventReceivedTime(Instant.now()); } _pollAttempts.set(0); return records; } catch (NoOffsetForPartitionException e) { handleNoOffsetForPartitionException(e); return ConsumerRecords.EMPTY; } catch (WakeupException e) { _logger.warn("Got a WakeupException, shutdown in progress.", e); return ConsumerRecords.EMPTY; } catch (Exception e) { handlePollRecordsException(e); return ConsumerRecords.EMPTY; } }
Source:
private void doubleBufferPaint(GC dest) { if (fCanvas.isVisible()) { return; } Point size= fCanvas.getSize(); if (size.x <= 0 || size.y <= 0) return; if (fBuffer != null) { Rectangle r= fBuffer.getBounds(); if (r.width != size.x || r.height != size.y) { fBuffer.dispose(); fBuffer= null; } } if (fBuffer == null) fBuffer= new Image(fCanvas.getDisplay(), size.x, size.y); GC gc= new GC(fBuffer); gc.setFont(fCanvas.getFont()); try { gc.setBackground(getBackground()); gc.fillRectangle(0, 0, size.x, size.y); doPaint(gc); } finally { gc.dispose(); } dest.drawImage(fBuffer, 0, 0); }

Target:
private void doubleBufferPaint(GC dest) { if (!fCanvas.isVisible()) { return; } Point size= fCanvas.getSize(); if (size.x <= 0 || size.y <= 0) return; if (fBuffer != null) { Rectangle r= fBuffer.getBounds(); if (r.width != size.x || r.height != size.y) { fBuffer.dispose(); fBuffer= null; } } if (fBuffer == null) fBuffer= new Image(fCanvas.getDisplay(), size.x, size.y); GC gc= new GC(fBuffer); gc.setFont(fCanvas.getFont()); try { gc.setBackground(getBackground()); gc.fillRectangle(0, 0, size.x, size.y); doPaint(gc); } finally { gc.dispose(); } dest.drawImage(fBuffer, 0, 0); }
Source:
public String showExperimentPage(Model model, @PathVariable String experimentAccession, @RequestParam(defaultValue = "") String accessKey) { Experiment<?> experiment = experimentTrader.getExperiment(experimentAccession, accessKey); model.addAllAttributes(experiment.getAttributes()); if (!experiment.getDois().isEmpty()) { model.addAttribute("publications", experimentPageContentService.getPublications(experiment.getDois())); } else if (!experiment.getPubMedIds().isEmpty()) { model.addAttribute("publications", experimentPageContentService.getPublications(experiment.getPubMedIds())); } model.addAttribute("content", GSON.toJson(experimentPageContentForExperiment(experiment, accessKey))); return "experiment-page"; }

Target:
public String showExperimentPage(Model model, @PathVariable String experimentAccession, @RequestParam(defaultValue = "") String accessKey) { Experiment<Cell> experiment = experimentTrader.getExperiment(experimentAccession, accessKey); model.addAllAttributes(experimentAttributesService.getAttributes(experiment)); model.addAttribute("content", GSON.toJson(experimentPageContentForExperiment(experiment, accessKey))); return "experiment-page"; }
Source:
public void testDbBenchmarkSuiteSupplier() throws Exception { Bootstrap app = new Bootstrap( ImmutableList.<Module>builder() .add(new BenchmarkSuiteModule(ImmutableSet.of())) .build()); Injector injector = app.strictConfig() .setRequiredConfigurationProperties(ImmutableMap.<String, String>builder() .putAll(DEFAULT_CONFIGURATION_PROPERTIES) .put("database", "jdbc://localhost:1080") .put("suite-name", "test") .build()) .initialize(); assertTrue(injector.getInstance(BenchmarkSuiteSupplier.class) instanceof DbBenchmarkSuiteSupplier); }

Target:
public void testDbBenchmarkSuiteSupplier() { Bootstrap app = new Bootstrap(ImmutableList.<Module>builder() .add(new BenchmarkSuiteModule(ImmutableSet.of())) .build()); Injector injector = null; try { injector = app.strictConfig() .setRequiredConfigurationProperties(ImmutableMap.<String, String>builder() .putAll(DEFAULT_CONFIGURATION_PROPERTIES) .put("database-url", "jdbc://localhost:1080") .put("suite", "test") .build()) .initialize(); assertTrue(injector.getInstance(BenchmarkSuiteSupplier.class) instanceof DbBenchmarkSuiteSupplier); } finally { if (injector != null) { injector.getInstance(LifeCycleManager.class).stop(); } } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BoundDimFilter that = (BoundDimFilter) o; if (lowerStrict != that.lowerStrict) { return false; } if (upperStrict != that.upperStrict) { return false; } if (alphaNumeric != that.alphaNumeric) { return false; } if (!dimension.equals(that.dimension)) { return false; } if (!upper.equals(that.upper)) { return false; } if (!lower.equals(that.lower)) { return false; } return extractionFn != null ? extractionFn.equals(that.extractionFn) : that.extractionFn == null; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BoundDimFilter that = (BoundDimFilter) o; if (isLowerStrict() != that.isLowerStrict()) { return false; } if (isUpperStrict() != that.isUpperStrict()) { return false; } if (isAlphaNumeric() != that.isAlphaNumeric()) { return false; } if (!getDimension().equals(that.getDimension())) { return false; } if (getUpper() != null ? !getUpper().equals(that.getUpper()) : that.getUpper() != null) { return false; } if (getLower() != null ? !getLower().equals(that.getLower()) : that.getLower() != null) { return false; } return getExtractionFn() != null ? getExtractionFn().equals(that.getExtractionFn()) : that.getExtractionFn() == null; }
Source:
public Map<String, ServerSideConfiguration.Pool> getSharedResourcePools() { Map<String, ServerSideConfiguration.Pool> sharedPools = new HashMap<String, ServerSideConfiguration.Pool>(); for (Map.Entry<String, ResourcePageSource> entry : sharedResourcePools.entrySet()) { sharedPools.put(entry.getKey(), entry.getValue().getPool()); } return sharedPools; }

Target:
public Map<String, ServerSideConfiguration.Pool> getSharedResourcePools() { return sharedResourcePools.entrySet().stream().collect(toMap(Map.Entry::getKey, e -> e.getValue().getPool())); }