auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCheckOutRegisterEvict() throws Exception { Service service = mock(Service.class); when(_factory.create(any(ServiceEndPoint.class))).thenReturn(service); MultiThreadedClientServiceCache<Service> cache = newCache(0); ServiceHandle<Service> handle = cache.checkOut(_endPoint); assertSame(handle.getService(), service); assertSame(1, cache.getNumActiveInstances(_endPoint)); assertSame(1, cache.getNumIdleInstances(_endPoint)); cache.register(_endPoint); assertSame(1, cache.getNumActiveInstances(_endPoint)); assertSame(1, cache.getNumIdleInstances(_endPoint)); cache.evict(_endPoint); verify(_factory, timeout(100).times(1)).destroy(_endPoint, handle.getService()); assertSame(0, cache.getNumActiveInstances(_endPoint)); assertSame(0, cache.getNumIdleInstances(_endPoint)); }

Target:
public void testCheckOutRegisterEvict() throws Exception { Service service = mock(Service.class); when(_factory.create(any(ServiceEndPoint.class))).thenReturn(service); MultiThreadedClientServiceCache<Service> cache = newCache(0); ServiceHandle<Service> handle = cache.checkOut(_endPoint); assertSame(service, handle.getService()); assertEquals(1, cache.getNumActiveInstances(_endPoint)); assertEquals(1, cache.getNumIdleInstances(_endPoint)); cache.register(_endPoint); assertEquals(1, cache.getNumActiveInstances(_endPoint)); assertEquals(1, cache.getNumIdleInstances(_endPoint)); cache.evict(_endPoint); verify(_factory, timeout(100).times(1)).destroy(_endPoint, handle.getService()); assertEquals(0, cache.getNumActiveInstances(_endPoint)); assertEquals(0, cache.getNumIdleInstances(_endPoint)); }
Source:
public OnDomReadyHeaderItem setNonce(String nonce) { Args.notNull(nonce, "nonce"); this.nonce = nonce; return this; }

Target:
public OnDomReadyHeaderItem setNonce(String nonce) { this.nonce = nonce; return this; }
Source:
public TimeRange deserialize( JsonElement jsonElement, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (jsonElement == null) return null; JsonObject json = jsonElement.getAsJsonObject(); if (!json.has("from") || !json.has("to")) { throw new JsonParseException("no neceessary fields."); } Date from = new Date(json.getAsJsonPrimitive("from").getAsLong()); Date to = new Date(json.getAsJsonPrimitive("to").getAsLong()); return new TimeRange(from, to); }

Target:
public TimeRange deserialize( JsonElement jsonElement, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (jsonElement == null) return null; JsonObject json = jsonElement.getAsJsonObject(); if (!json.has("from") || !json.has("to")) { throw new JsonParseException( "son doesn't contain both of 2 necessary fields: from and to."); } Date from = new Date(json.getAsJsonPrimitive("from").getAsLong()); Date to = new Date(json.getAsJsonPrimitive("to").getAsLong()); return new TimeRange(from, to); }
Source:
protected static final int getLimit(final Options expandOptions) { return expandOptions.containsKey("limit") ? expandOptions.get("limit", Integer.class) : 50; }

Target:
protected static final int getLimit(final Options expandOptions) { return expandOptions.containsKey("limit") ? expandOptions.get("limit", Integer.class) : SearchRequestBuilder.DEFAULT_LIMIT; }
Source:
public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException { Chart chart = (Chart) w; try { String itemParam = null; Item item = itemUIRegistry.getItem(chart.getItem()); if(item instanceof GroupItem) { itemParam = "groups=" + chart.getItem(); } else { itemParam = "items=" + chart.getItem(); } String url = "/chart?" + itemParam + "&period=" + chart.getPeriod() + "&random=1"; if(chart.getService() != null) url += "&service=" + chart.getService(); String snippet = getSnippet("image"); if(chart.getRefresh()>0) { snippet = StringUtils.replace(snippet, "%setrefresh%", "<script type=\"text/javascript\">imagesToRefreshOnPage=1</script>"); snippet = StringUtils.replace(snippet, "%refresh%", "id=\"%id%\" onload=\"OH.images.refresh=true;setTimeout('OH.reloadImage(\\'%url%\\', \\'%id%\\')', " + chart.getRefresh() + ")\""); } else { snippet = StringUtils.replace(snippet, "%setrefresh%", ""); snippet = StringUtils.replace(snippet, "%refresh%", ""); } snippet = StringUtils.replace(snippet, "%id%", itemUIRegistry.getWidgetId(w)); snippet = StringUtils.replace(snippet, "%url%", url); snippet = StringUtils.replace(snippet, "%refresh%", Integer.toString(chart.getRefresh())); sb.append(snippet); } catch (ItemNotFoundException e) { logger.warn("Chart cannot be rendered as item '{}' does not exist.", chart.getItem()); } return null; }

Target:
public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException { Chart chart = (Chart) w; try { String itemParam = null; Item item = itemUIRegistry.getItem(chart.getItem()); if(item instanceof GroupItem) { itemParam = "groups=" + chart.getItem(); } else { itemParam = "items=" + chart.getItem(); } String url = "/chart?" + itemParam + "&period=" + chart.getPeriod() + "&random=1"; if(chart.getService() != null) url += "&service=" + chart.getService(); String snippet = getSnippet("image"); if(chart.getRefresh()>0) { snippet = StringUtils.replace(snippet, "%setrefresh%", "<script type=\"text/javascript\">OH.imagesToRefreshOnPage=1</script>"); snippet = StringUtils.replace(snippet, "%refresh%", "id=\"%id%\" onload=\"setTimeout('OH.reloadImage(\\'%url%\\', \\'%id%\\')', " + chart.getRefresh() + ")\""); } else { snippet = StringUtils.replace(snippet, "%setrefresh%", ""); snippet = StringUtils.replace(snippet, "%refresh%", ""); } snippet = StringUtils.replace(snippet, "%id%", itemUIRegistry.getWidgetId(w)); snippet = StringUtils.replace(snippet, "%url%", url); snippet = StringUtils.replace(snippet, "%refresh%", Integer.toString(chart.getRefresh())); sb.append(snippet); } catch (ItemNotFoundException e) { logger.warn("Chart cannot be rendered as item '{}' does not exist.", chart.getItem()); } return null; }
Source:
public void should_fail_on_event_listener_exception_when_running_in_parallel() { CucumberFeature feature1 = TestHelper.feature("path/test.feature", "" + "Feature: feature name 1\n" + " Scenario: scenario_1 name\n" + " Given first step\n" + " Scenario: scenario_2 name\n" + " Given first step\n"); CucumberFeature feature2 = TestHelper.feature("path/test2.feature", "" + "Feature: feature name 2\n" + " Scenario: scenario_2 name\n" + " Given first step\n"); ConcurrentEventListener brokenEventListener = publisher -> publisher.registerHandlerFor(TestStepFinished.class, (EventHandler<TestStepFinished>) event -> { throw new RuntimeException("boom"); }); expectedException.expect(CompositeCucumberException.class); expectedException.expectMessage("There were 3 exceptions"); TestHelper.builder() .withFeatures(Arrays.asList(feature1, feature2)) .withFormatterUnderTest(brokenEventListener) .withTimeServiceType(TestHelper.TimeServiceType.REAL_TIME) .withRuntimeArgs("--threads", "2") .build() .run(); }

Target:
public void should_fail_on_event_listener_exception_when_running_in_parallel() { CucumberFeature feature1 = TestHelper.feature("path/test.feature", "" + "Feature: feature name 1\n" + " Scenario: scenario_1 name\n" + " Given first step\n" + " Scenario: scenario_2 name\n" + " Given first step\n"); CucumberFeature feature2 = TestHelper.feature("path/test2.feature", "" + "Feature: feature name 2\n" + " Scenario: scenario_2 name\n" + " Given first step\n"); ConcurrentEventListener brokenEventListener = publisher -> publisher.registerHandlerFor(TestStepFinished.class, (TestStepFinished event) -> { throw new RuntimeException("boom"); }); expectedException.expect(CompositeCucumberException.class); expectedException.expectMessage("There were 3 exceptions"); TestHelper.builder() .withFeatures(Arrays.asList(feature1, feature2)) .withFormatterUnderTest(brokenEventListener) .withTimeServiceType(TestHelper.TimeServiceType.REAL_TIME) .withRuntimeArgs("--threads", "2") .build() .run(); }
Source:
public void setTimezone(String timezone) { if (timezone != null) { this.timezone = TimeZone.getTimeZone(timezone).getID(); } else { this.timezone = null; } }

Target:
public void setTimezone(String timezone) { this.timezone = timezone != null ? TimeZone.getTimeZone(timezone).getID() : null; }
Source:
public void start() { String group = "carbon.connector.quartz"; JobDetail job = JobBuilder.newJob(PollingJob.class) .withIdentity("Job - " + RANDOM.nextLong(), group).build(); Trigger trigger; if (connector.cronExpression != null) { trigger = TriggerBuilder.newTrigger().withIdentity("Trigger - " + RANDOM.nextLong(), group) .withSchedule(CronScheduleBuilder.cronSchedule(connector.cronExpression)).build(); } else { trigger = TriggerBuilder.newTrigger().withIdentity("scheduledPoll", "group1").withSchedule( SimpleScheduleBuilder.simpleSchedule().withIntervalInMilliseconds(connector.interval) .repeatForever()).build(); } try { scheduler = new StdSchedulerFactory().getScheduler(); scheduler.getContext().put("connector", connector); scheduler.start(); scheduler.scheduleJob(job, trigger); } catch (SchedulerException e) { log.error("Exception occurred while scheduling job"); } }

Target:
public void start() { String group = "carbon.connector.quartz"; JobDetail job = JobBuilder.newJob(PollingJob.class) .withIdentity("Job - " + RANDOM.nextLong(), group).build(); Trigger trigger; if (connector.cronExpression != null) { trigger = TriggerBuilder.newTrigger().withIdentity("Trigger - " + RANDOM.nextLong(), group) .withSchedule(CronScheduleBuilder.cronSchedule(connector.cronExpression)).build(); } else { trigger = TriggerBuilder.newTrigger().withIdentity("scheduledPoll", "group1").withSchedule( SimpleScheduleBuilder.simpleSchedule().withIntervalInMilliseconds(connector.interval) .repeatForever()).build(); } try { scheduler = new StdSchedulerFactory().getScheduler(); scheduler.getContext().put("connector", connector); scheduler.start(); scheduler.scheduleJob(job, trigger); } catch (SchedulerException e) { log.error("Exception occurred while scheduling job", e); } }
Source:
public Iterator<LocatedRow> call(final InputStream s) throws Exception { if (operationContext.isFailed()) return Collections.<LocatedRow>emptyList().iterator(); checkPreference(); return new Iterable<LocatedRow>() { @Override public Iterator<LocatedRow> iterator() { return new Iterator<LocatedRow>() { private LocatedRow nextRow; private boolean initialized = false; private Reader reader; private SpliceCsvReader spliceCsvReader; private boolean hasNext = true; private boolean stale = false; @Override public boolean hasNext() { if (!hasNext || stale) return hasNext; try { if (!initialized) { reader = new BufferedReader(new InputStreamReader(s,charset)); spliceCsvReader = new SpliceCsvReader(reader, preference); initialized = true; } while (true) { try { if (!spliceCsvReader.hasNext()) { reader.close(); hasNext = false; return false; } nextRow = call(spliceCsvReader.next()); if (nextRow != null) { stale = true; hasNext = true; return true; } } catch (Exception e) { if (operationContext.isPermissive()) { operationContext.recordBadRecord(e.getLocalizedMessage(), e); } else throw StandardException.plainWrapException(e); } } } catch (Exception ioe) { throw new RuntimeException("Terminal, should have been caught", ioe); } } @Override public LocatedRow next() { if(!hasNext()) throw new NoSuchElementException(); stale = false; return nextRow; } @Override public void remove() { throw new RuntimeException("not supported"); } }; } }.iterator(); }

Target:
public Iterator<LocatedRow> call(final InputStream s) throws Exception { if (operationContext.isFailed()) return Collections.<LocatedRow>emptyList().iterator(); checkPreference(); return new Iterator<LocatedRow>() { private LocatedRow nextRow; private boolean initialized = false; private Reader reader; private SpliceCsvReader spliceCsvReader; private boolean hasNext = true; private boolean stale = false; @Override public boolean hasNext() { if (!hasNext || stale) return hasNext; try { if (!initialized) { reader = new BufferedReader(new InputStreamReader(s,charset)); spliceCsvReader = new SpliceCsvReader(reader, preference); initialized = true; } while (true) { try { if (!spliceCsvReader.hasNext()) { reader.close(); hasNext = false; return false; } nextRow = call(spliceCsvReader.next()); if (nextRow != null) { stale = true; hasNext = true; return true; } } catch (Exception e) { if (operationContext.isPermissive()) { operationContext.recordBadRecord(e.getLocalizedMessage(), e); } else throw StandardException.plainWrapException(e); } } } catch (Exception ioe) { throw new RuntimeException("Terminal, should have been caught", ioe); } } @Override public LocatedRow next() { if(!hasNext()) throw new NoSuchElementException(); stale = false; return nextRow; } @Override public void remove() { throw new RuntimeException("not supported"); } }; }
Source:
static void alignRead(BitBuffer input, IDeclaration declaration){ int align = (int) declaration.getAlignment(); int pos = input.position() + ((align - (input.position() % align)) % align); input.position(pos); }

Target:
protected static void alignRead(BitBuffer input, IDeclaration declaration){ int align = (int) declaration.getAlignment(); int pos = input.position() + ((align - (input.position() % align)) % align); input.position(pos); }
Source:
public List<byte[]> getParts() throws Exception { List<byte[]> parts = new ArrayList<byte[]>(); for (MimePart part : mimeParts) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { part.writeTo(bos); parts.add(bos.toByteArray()); } finally { bos.close(); } } return parts; }

Target:
List<byte[]> getParts() throws IOException { List<byte[]> parts = new ArrayList<byte[]>(mimeParts.size()); for (MimePart part : mimeParts) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); part.writeTo(bos); parts.add(bos.toByteArray()); } return parts; }
Source:
public static Tuple<SAMFileHeader,Iterator<Interval>> toIntervals(final VCFFileReader vcf, final boolean includeFiltered) { final SAMSequenceDictionary dict = vcf.getFileHeader().getSequenceDictionary(); final SAMFileHeader samFileHeader = new SAMFileHeader(); samFileHeader.setSequenceDictionary(dict); final AtomicReference<Integer> intervals = new AtomicReference<>(1); final Iterator<Interval> iterator = vcf.iterator().stream().filter(vc -> includeFiltered || !vc.isFiltered()).map(vc -> { String name = vc.getID(); final int intervalEnd = vc.getCommonInfo().getAttributeAsInt(VCFConstants.END_KEY, vc.getEnd()); if (VCFConstants.EMPTY_ID_FIELD.equals(name) || name == null) { name = "interval-" + (intervals.getAndSet(intervals.get() + 1)); } return new Interval(vc.getContig(), vc.getStart(), intervalEnd, false, name); }).iterator(); return new Tuple<>(samFileHeader,iterator); }

Target:
public static Iterator<Interval> toIntervals(final VCFFileReader vcf, final boolean includeFiltered) { final AtomicInteger intervalCount = new AtomicInteger(0); return vcf.iterator() .stream() .filter(vc -> includeFiltered || !vc.isFiltered()) .map(vc -> { String name = vc.getID(); final int intervalEnd = vc.getCommonInfo().getAttributeAsInt(VCFConstants.END_KEY, vc.getEnd()); if (VCFConstants.EMPTY_ID_FIELD.equals(name) || name == null) { name = "interval-" + intervalCount.incrementAndGet();; } return new Interval(vc.getContig(), vc.getStart(), intervalEnd, false, name); }).iterator(); }
Source:
public boolean isValid() { return lineNumber != -1 && inLineOffset != -1; }

Target:
public boolean isValid() { return this != INVALID_TEXT_POSITION; }
Source:
public void testCreate() throws Exception { ScheduledQuery schq = createScheduledQuery(createKey("create", "c1")); ScheduledQueryMaintenanceRequest r = new ScheduledQueryMaintenanceRequest(); r.setType(ScheduledQueryMaintenanceRequestType.INSERT); r.setScheduledQuery(schq); client.scheduledQueryMaintenance(r); ScheduledQuery schq2 = client.getScheduledQuery(new ScheduledQueryKey("create", "c1")); schq.setNextExecution(schq2.getNextExecution()); assertEquals(schq2, schq); }

Target:
public void testCreate() throws Exception { ScheduledQuery schq = createScheduledQuery(createKey("create", "c1")); ScheduledQueryMaintenanceRequest r = new ScheduledQueryMaintenanceRequest(); r.setType(ScheduledQueryMaintenanceRequestType.CREATE); r.setScheduledQuery(schq); client.scheduledQueryMaintenance(r); ScheduledQuery schq2 = client.getScheduledQuery(new ScheduledQueryKey("create", "c1")); schq.setNextExecution(schq2.getNextExecution()); assertEquals(schq2, schq); }
Source:
public void testSearchByIdParam() { String id1; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); id1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless().getValue(); } String id2; { Organization patient = new Organization(); patient.addIdentifier().setSystem("urn:system").setValue("001"); id2 = myOrganizationDao.create(patient, mySrd).getId().toUnqualifiedVersionless().getValue(); } SearchParameterMap params = new SearchParameterMap(); params.setLoadSynchronous(true); assertThat(toUnqualifiedVersionlessIdValues(myPatientDao.search(params)), contains(id1)); params = new SearchParameterMap(); params.add("_id", new StringParam(id1)); myCaptureQueriesListener.clear(); assertThat(toUnqualifiedVersionlessIdValues(myPatientDao.search(params)), contains(id1)); myCaptureQueriesListener.logSelectQueriesForCurrentThread(); params = new SearchParameterMap(); params.add("_id", new StringParam("9999999999999999")); assertEquals(0, toList(myPatientDao.search(params)).size()); params = new SearchParameterMap(); params.add("_id", new StringParam(id2)); assertEquals(0, toList(myPatientDao.search(params)).size()); }

Target:
public void testSearchByIdParam() { String id1; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); id1 = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless().getValue(); } String id2; { Organization patient = new Organization(); patient.addIdentifier().setSystem("urn:system").setValue("001"); id2 = myOrganizationDao.create(patient, mySrd).getId().toUnqualifiedVersionless().getValue(); } SearchParameterMap params = new SearchParameterMap(); params.setLoadSynchronous(true); assertThat(toUnqualifiedVersionlessIdValues(myPatientDao.search(params)), contains(id1)); params = new SearchParameterMap(); params.add("_id", new StringParam(id1)); assertThat(toUnqualifiedVersionlessIdValues(myPatientDao.search(params)), contains(id1)); params = new SearchParameterMap(); params.add("_id", new StringParam("9999999999999999")); assertEquals(0, toList(myPatientDao.search(params)).size()); params = new SearchParameterMap(); params.add("_id", new StringParam(id2)); assertEquals(0, toList(myPatientDao.search(params)).size()); }
Source:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); newsList = (RecyclerView) view.findViewById(R.id.news_list); LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); newsList.setLayoutManager(layoutManager); dataset = new ArrayList<>(); newsAdapter = new NewsAdapter(this, dataset); newsList.setAdapter(newsAdapter); RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST); newsList.addItemDecoration(itemDecoration); subscription = stories.subscribe(new Subscriber<List<News>>() { @Override public void onCompleted() { newsAdapter.notifyDataSetChanged(); Log.d("stories", "completed"); } @Override public void onError(Throwable e) { Log.d("stories err", e.toString()); } @Override public void onNext(List<News> items) { Log.d("stories", String.valueOf(items.size())); Log.d("stories content", items.toString()); dataset.addAll(items); } }); }

Target:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); newsList = (RecyclerView) view.findViewById(R.id.news_list); LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); newsList.setLayoutManager(layoutManager); newsAdapter = new NewsAdapter(this); newsList.setAdapter(newsAdapter); RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST); newsList.addItemDecoration(itemDecoration); subscription = stories.subscribe(new Subscriber<List<News>>() { @Override public void onCompleted() { newsAdapter.notifyDataSetChanged(); Log.d("stories", "completed"); } @Override public void onError(Throwable e) { Log.d("stories err", e.toString()); } @Override public void onNext(List<News> items) { Log.d("stories", String.valueOf(items.size())); Log.d("stories content", items.toString()); newsAdapter.addDataset(items); } }); }
Source:
public static SSLContext createDefaultSSLContext(final String pathToPKCS12File, final String keystorePassword) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, KeyManagementException, IOException { final FileInputStream keystoreInputStream = new FileInputStream(pathToPKCS12File); try { final KeyStore keyStore = KeyStore.getInstance("PKCS12"); keyStore.load(keystoreInputStream, keystorePassword != null ? keystorePassword.toCharArray() : null); return PushManagerFactory.createDefaultSSLContext(keyStore, keystorePassword.toCharArray()); } finally { try { keystoreInputStream.close(); } catch (IOException e) { LoggerFactory.getLogger(PushManagerFactory.class).error("Failed to close keystore input stream.", e); } } }

Target:
public static SSLContext createDefaultSSLContext(final String pathToPKCS12File, final String keystorePassword) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, KeyManagementException, IOException { final FileInputStream keystoreInputStream = new FileInputStream(pathToPKCS12File); try { final KeyStore keyStore = KeyStore.getInstance("PKCS12"); keyStore.load(keystoreInputStream, keystorePassword != null ? keystorePassword.toCharArray() : null); return PushManagerFactory.createDefaultSSLContext(keyStore, keystorePassword != null ? keystorePassword.toCharArray() : null); } finally { try { keystoreInputStream.close(); } catch (IOException e) { LoggerFactory.getLogger(PushManagerFactory.class).error("Failed to close keystore input stream.", e); } } }
Source:
public void processPullReply(final K key, final V value, final int requestId, final long elapsedTimeInServer) { int threadId; try { threadId = getThreadIndex(encodedKeyCache.get(key).getHash()); } catch (final ExecutionException e) { throw new RuntimeException(e); } synchronized (threads[threadId]) { final Map<K, PendingPull> pendingPulls = threads[threadId].pendingPulls; final PendingPull pendingPull = pendingPulls.get(key); if (checkPendingPull(pendingPull, requestId)) { pendingPulls.remove(key).resolvePendingOps(value, elapsedTimeInServer); if (pendingPulls.size() == MAX_PENDING_PULL_COUNT_PER_THREAD - 1) { threads[threadId].notify(); } } else { LOG.log(Level.INFO, "Could not find corresponding pendingPull for key: {0}, requestId: {1}", new Object[]{key, requestId}); } } }

Target:
public void processPullReply(final K key, final V value, final int requestId, final long elapsedTimeInServer) { final EncodedKey<K> encodedKey; try { encodedKey = encodedKeyCache.get(key); } catch (final ExecutionException e) { throw new RuntimeException("Exception while loading encoded key from cache", e); } final WorkerThread workerThread = workerThreads[getThreadIndex(encodedKey.getHash())]; synchronized (workerThread) { final Map<K, PullRequest> pendingPullRequests = workerThread.pendingPullRequests; final PullRequest pullRequest = pendingPullRequests.get(key); if (pendingPullRequestExists(pullRequest, requestId)) { pendingPullRequests.remove(key).completePendingOps(value, elapsedTimeInServer); if (pendingPullRequests.size() == maxPendingPullsPerThread - 1) { workerThread.notify(); } } else { LOG.log(Level.INFO, "Could not find corresponding pullRequest for key: {0}, requestId: {1}", new Object[]{key, requestId}); } } }
Source:
public void eventsMustBeReturnedInGuaranteedOrder() { final PartitionData pd = new PartitionData(null, 100L); for (long i = 0; i < 100; ++i) { pd.addEventFromKafka(200L - i, ("test_" + (200L - i)).getBytes()); } pd.addEventFromKafka(201L, "fake".getBytes()); for (int i = 0; i < 10; ++i) { final SortedMap<Long, byte[]> data = pd.takeEventsToStream(currentTimeMillis(), 10, 0L); assertNotNull(data); assertEquals(10, data.size()); assertEquals((i + 1) * 10, pd.getUnconfirmed()); assertEquals(0, pd.getKeepAliveInARow()); assertEquals(100L + i * 10L + 1L, data.firstKey().longValue()); assertEquals(100L + i * 10L + 10L, data.lastKey().longValue()); data.forEach((k, v) -> assertArrayEquals(("test_" + k).getBytes(), v)); } final SortedMap<Long, byte[]> data = pd.takeEventsToStream(currentTimeMillis(), 10, 0L); assertNotNull(data); assertEquals(1, data.size()); assertEquals(201L, data.firstKey().longValue()); assertArrayEquals("fake".getBytes(), data.get(data.firstKey())); assertEquals(0, pd.getKeepAliveInARow()); }

Target:
public void eventsMustBeReturnedInGuaranteedOrder() { final PartitionData pd = new PartitionData(null, 100L); for (long i = 0; i < 100; ++i) { pd.addEventFromKafka(200L - i, ("test_" + (200L - i)).getBytes(UTF_8)); } pd.addEventFromKafka(201L, "fake".getBytes(UTF_8)); for (int i = 0; i < 10; ++i) { final SortedMap<Long, byte[]> data = pd.takeEventsToStream(currentTimeMillis(), 10, 0L); assertNotNull(data); assertEquals(10, data.size()); assertEquals((i + 1) * 10, pd.getUnconfirmed()); assertEquals(0, pd.getKeepAliveInARow()); assertEquals(100L + i * 10L + 1L, data.firstKey().longValue()); assertEquals(100L + i * 10L + 10L, data.lastKey().longValue()); data.forEach((k, v) -> assertArrayEquals(("test_" + k).getBytes(UTF_8), v)); } final SortedMap<Long, byte[]> data = pd.takeEventsToStream(currentTimeMillis(), 10, 0L); assertNotNull(data); assertEquals(1, data.size()); assertEquals(201L, data.firstKey().longValue()); assertArrayEquals("fake".getBytes(UTF_8), data.get(data.firstKey())); assertEquals(0, pd.getKeepAliveInARow()); }
Source:
public void post_product() throws IOException { SendProduct product = new SendProduct(); product.setBarcode("978020137962"); product.setName("coca3"); product.setBrands("auchan"); product.setWeight("300"); product.setWeight_unit("g"); product.setLang("fr"); Map<String, String> productDetails = new HashMap<String, String>() {{ put("lang", product.getLang()); put("product_name", product.getName()); put("brands", product.getBrands()); put("quantity", product.getQuantity()); }}; State body = serviceWrite .saveProductSingle(product.getBarcode(), productDetails, PRODUCT_API_COMMENT) .blockingGet(); assertEquals(body.getStatus(), 1); assertEquals(body.getStatusVerbose(), "fields saved"); String fields = "product_name,brands,brands_tags,quantity"; Response<State> response = serviceWrite.getProductByBarcode(product.getBarcode(), fields, Utils.getUserAgent(Utils.HEADER_USER_AGENT_SEARCH)).execute(); Product savedProduct = response.body().getProduct(); assertEquals(product.getName(), savedProduct.getProductName()); assertEquals(product.getBrands(), savedProduct.getBrands()); assertTrue(savedProduct.getBrandsTags().contains(product.getBrands())); assertEquals(product.getWeight() + " " + product.getWeight_unit(), savedProduct.getQuantity()); }

Target:
public void post_product() throws IOException { SendProduct product = new SendProduct(); product.setBarcode("1234567890"); product.setName("ProductName"); product.setBrands("productbrand"); product.setWeight("123"); product.setWeight_unit("g"); product.setLang("en"); Map<String, String> productDetails = new HashMap<String, String>() {{ put("lang", product.getLang()); put("product_name", product.getName()); put("brands", product.getBrands()); put("quantity", product.getQuantity()); }}; State body = serviceWrite .saveProductSingle(product.getBarcode(), productDetails, PRODUCT_API_COMMENT) .blockingGet(); assertEquals(body.getStatus(), 1); assertEquals(body.getStatusVerbose(), "fields saved"); String fields = "product_name,brands,brands_tags,quantity"; Response<State> response = serviceWrite.getProductByBarcode(product.getBarcode(), fields, Utils.getUserAgent(Utils.HEADER_USER_AGENT_SEARCH)).execute(); Product savedProduct = response.body().getProduct(); assertEquals(product.getName(), savedProduct.getProductName()); assertEquals(product.getBrands(), savedProduct.getBrands()); assertTrue(savedProduct.getBrandsTags().contains(product.getBrands())); assertEquals(product.getWeight() + " " + product.getWeight_unit(), savedProduct.getQuantity()); }
Source:
protected void findTop() throws IOException { SortedKeyValueIterator<Key,Value> src = getSource(); if (src.hasTop() && advance != null) { advanceSource(src, advance); } advance = null; while (src.hasTop() && !advancedPastSeek) { if (src.getTopKey().isDeleted()) { advance = AdvanceResult.NEXT; return; } FilterResult f = filter(src.getTopKey(), src.getTopValue()); if (log.isTraceEnabled()) { log.trace("Filtered: " + src.getTopKey() + " result == " + f + " hint == " + getNextKeyHint(src.getTopKey(), src.getTopValue())); } if (f.accept != negate) { advance = f.advance; break; } else { advanceSource(src, f.advance); } } }

Target:
protected void findTop() throws IOException { SortedKeyValueIterator<Key,Value> src = getSource(); advance = null; while (src.hasTop() && !advancedPastSeek) { if (src.getTopKey().isDeleted()) { advance = AdvanceResult.NEXT; return; } FilterResult f = filter(src.getTopKey(), src.getTopValue()); if (log.isTraceEnabled()) { log.trace("Filtered: result == hint == {}", src.getTopKey(), f, f.advance == AdvanceResult.USE_HINT ? getNextKeyHint(src.getTopKey(), src.getTopValue()) : " (none)"); } if (f.accept != negate) { advance = f.advance; break; } else { advanceSource(src, f.advance); } } }
Source:
private ThreadPoolExecutor createAddConnectionExecutor(ThreadFactory threadFactory, LinkedBlockingQueue<Runnable> addQueue) { int poosSize = 1; if (Boolean.getBoolean("com.zaxxer.hikari.blockUntilFilled") && config.getInitializationFailTimeout() > 1) { poosSize = config.getMinimumIdle(); } return createThreadPoolExecutorWithFixedSize(addQueue, poolName + " connection adder", threadFactory, new ThreadPoolExecutor.DiscardPolicy(), poosSize); }

Target:
private ThreadPoolExecutor createAddConnectionExecutor(ThreadFactory threadFactory, LinkedBlockingQueue<Runnable> addQueue) { final int maxPoolSize; if (isBlockedInitialization(config)) { maxPoolSize = config.getMinimumIdle(); } else { maxPoolSize = 1; } return createThreadPoolExecutorWithFlexibleSize(addQueue, poolName + " connection adder", threadFactory, new ThreadPoolExecutor.DiscardPolicy(), maxPoolSize); }
Source:
public MetricResource(String urlTemplate) { super(urlTemplate); metricPublisher = new MetricPublisher(); isPrometheusPublishingEnabled = Boolean.parseBoolean(System.getProperty("enablePrometheusBE")); }

Target:
public MetricResource(String urlTemplate) { super(urlTemplate); metricPublisher = new MetricPublisher(); }
Source:
public Field copy() { return new Builder() .setName(this.name) .setValue(this.value) .setLabel(this.label) .setPlaceholder(this.placeholder) .setRequired(this.required) .setType(this.type) .setVisible(this.visible) .setEnable(this.enable) .build(); }

Target:
public Field copy() { return builder() .setName(this.name) .setValue(this.value) .setLabel(this.label) .setPlaceholder(this.placeholder) .setRequired(this.required) .setType(this.type) .setVisible(this.visible) .setEnabled(this.enabled) .build(); }
Source:
public FunctionListModel() { readSQLFunctions(); Services.getService(DataManager.class).getDataSourceFactory().getFunctionManager().addFunctionManagerListener(functionListener); }

Target:
public FunctionListModel() { FunctionManager functionManager = Services.getService(DataManager.class).getDataSourceFactory().getFunctionManager(); readSQLFunctions(functionManager); functionManager.addFunctionManagerListener(functionListener); }
Source:
public ActionResult execute() throws EntityDoesNotExistException { new GateKeeper().verifyLoggedInUserPrivileges(); data = new StudentHomePageData(account); String recentlyJoinedCourseId = getRequestParamValue(Const.ParamsNames.CHECK_PERSISTENCE_COURSE); try { Map<String, StudentAttributes> courseToAttributesMap = new HashMap<String, StudentAttributes>(); data.courses = logic.getCourseDetailsListForStudent(account.googleId, courseToAttributesMap); data.sessionSubmissionStatusMap = generateFeedbackSessionSubmissionStatusMap(data.courses, account.googleId, courseToAttributesMap); CourseDetailsBundle.sortDetailedCourses(data.courses); statusToAdmin = "studentHome Page Load<br>" + "Total courses: " + data.courses.size(); boolean isDataConsistent = checkEventualConsistency(recentlyJoinedCourseId); if (!isDataConsistent) { addPlaceholderCourse(recentlyJoinedCourseId, account.googleId); data.setEventualConsistencyCourse(recentlyJoinedCourseId); } for(CourseDetailsBundle course: data.courses) { FeedbackSessionDetailsBundle.sortFeedbackSessionsByCreationTime(course.feedbackSessions); } } catch (EntityDoesNotExistException e) { if (recentlyJoinedCourseId != null) { addPlaceholderCourse(recentlyJoinedCourseId, account.googleId); } else { statusToUser.add(Const.StatusMessages.STUDENT_FIRST_TIME); statusToAdmin = Const.ACTION_RESULT_FAILURE + " :" + e.getMessage(); } } ShowPageResult response = createShowPageResult(Const.ViewURIs.STUDENT_HOME, data); return response; }

Target:
public ActionResult execute() throws EntityDoesNotExistException { new GateKeeper().verifyLoggedInUserPrivileges(); data = new StudentHomePageData(account); String recentlyJoinedCourseId = getRequestParamValue(Const.ParamsNames.CHECK_PERSISTENCE_COURSE); try { data.courses = logic.getCourseDetailsListForStudent(account.googleId); data.sessionSubmissionStatusMap = generateFeedbackSessionSubmissionStatusMap(data.courses, account.googleId); CourseDetailsBundle.sortDetailedCourses(data.courses); statusToAdmin = "studentHome Page Load<br>" + "Total courses: " + data.courses.size(); boolean isDataConsistent = checkEventualConsistency(recentlyJoinedCourseId); if (!isDataConsistent) { addPlaceholderCourse(recentlyJoinedCourseId, account.googleId); data.setEventualConsistencyCourse(recentlyJoinedCourseId); } for(CourseDetailsBundle course: data.courses) { FeedbackSessionDetailsBundle.sortFeedbackSessionsByCreationTime(course.feedbackSessions); } } catch (EntityDoesNotExistException e) { if (recentlyJoinedCourseId != null) { addPlaceholderCourse(recentlyJoinedCourseId, account.googleId); } else { statusToUser.add(Const.StatusMessages.STUDENT_FIRST_TIME); statusToAdmin = Const.ACTION_RESULT_FAILURE + " :" + e.getMessage(); } } ShowPageResult response = createShowPageResult(Const.ViewURIs.STUDENT_HOME, data); return response; }
Source:
public void isCompleted_shouldReturnFalseIfPerformedStatusIsNotCompleted() throws Exception { RadiologyStudy radiologystudy = new RadiologyStudy(); radiologystudy.setPerformedStatus(PerformedProcedureStepStatus.IN_PROGRESS); assertFalse(radiologystudy.isCompleted()); }

Target:
public void isCompleted_shouldReturnFalseIfPerformedStatusIsNotCompleted() throws Exception { RadiologyStudy radiologyStudy = new RadiologyStudy(); radiologyStudy.setPerformedStatus(PerformedProcedureStepStatus.IN_PROGRESS); assertFalse(radiologyStudy.isCompleted()); }
Source:
public void testDoesNotFire() { tester().assertThat(new RemoveEmptyDelete()) .on(p -> p.tableDelete( new SchemaTableName("sch", "tab"), p.tableScan( new TableHandle( CONNECTOR_ID, new TpchTableHandle("nation", 1.0), TestingTransactionHandle.create(), Optional.empty()), ImmutableList.of(), ImmutableMap.of(), false, TupleDomain.all(), TupleDomain.all()), p.variable("a", BIGINT))) .doesNotFire(); }

Target:
public void testDoesNotFire() { tester().assertThat(new RemoveEmptyDelete()) .on(p -> p.tableDelete( new SchemaTableName("sch", "tab"), p.tableScan( new TableHandle( CONNECTOR_ID, new TpchTableHandle("nation", 1.0), TestingTransactionHandle.create(), Optional.empty()), ImmutableList.of(), ImmutableMap.of()), p.variable("a", BIGINT))) .doesNotFire(); }
Source:
public int compareOrder(NodeInfo nodeInfo) { int cmp = getLineNumber() - nodeInfo.getLineNumber(); if (cmp == 0) { cmp = getColumnNumber() - nodeInfo.getColumnNumber(); if (cmp == 0) { cmp = getLocalPart().compareTo(nodeInfo.getLocalPart()); } } return cmp; }

Target:
public int compareOrder(NodeInfo nodeInfo) { int result = getLineNumber() - nodeInfo.getLineNumber(); if (result == 0) { result = getColumnNumber() - nodeInfo.getColumnNumber(); if (result == 0) { result = getLocalPart().compareTo(nodeInfo.getLocalPart()); } } return result; }
Source:
private void parseModel() { System.out.println("parse..."); try { model = Model.parseYaml(schema, get()); } catch (Exception e) { model = null; } }

Target:
private void parseModel() { try { model = Model.parseYaml(schema, get()); } catch (Exception e) { model = null; } }
Source:
protected boolean compareIndexTypeTo(String indexType, String indexSettings) { if (!this.indexType.equalsIgnoreCase(indexType)) { return false; } if (this.indexSettings == null && indexSettings == null) { return true; } else if (this.indexSettings == null || indexSettings == null) { return false; } String settingsAsAString; try { settingsAsAString = new ObjectMapper().writeValueAsString(this.indexSettings); } catch (JsonProcessingException e) { String msg = String.format("Error processing index settings %s", this.indexSettings.toString()); logger.log(Level.SEVERE, msg, e); return false; } return settingsAsAString.equalsIgnoreCase(indexSettings); }

Target:
protected boolean compareIndexTypeTo(String indexType, String indexSettings) { if (!this.indexType.equalsIgnoreCase(indexType)) { return false; } if (this.indexSettings == null && indexSettings == null) { return true; } else if (this.indexSettings == null || indexSettings == null) { return false; } Map<String, Object> settings; try { settings = getObjectMapper().readValue(indexSettings, new TypeReference<Map<String, Object>>() { }); } catch (IOException e) { String msg = String.format("Error processing index settings %s", this.indexSettings.toString()); logger.log(Level.SEVERE, msg, e); return false; } return this.indexSettings.equals(settings); }
Source:
public void testPathThrough() { ApplicationContext context = new SpringApplicationBuilder( TestChannelBinderConfiguration.getCompleteConfiguration(FunctionsConfiguration.class)).web( WebApplicationType.NONE).run("--spring.jmx.enabled=false"); InputDestination source = context.getBean(InputDestination.class); OutputDestination target = context.getBean(OutputDestination.class); source.send(new GenericMessage<byte[]>("hello".getBytes(StandardCharsets.UTF_8))); assertThat(target.receive(1000).getPayload()).isEqualTo("hello".getBytes(StandardCharsets.UTF_8)); }

Target:
public void testPathThrough() { context = new SpringApplicationBuilder( TestChannelBinderConfiguration.getCompleteConfiguration(FunctionsConfiguration.class)).web( WebApplicationType.NONE).run("--spring.jmx.enabled=false"); InputDestination source = context.getBean(InputDestination.class); OutputDestination target = context.getBean(OutputDestination.class); source.send(new GenericMessage<byte[]>("hello".getBytes(StandardCharsets.UTF_8))); assertThat(target.receive(1000).getPayload()).isEqualTo("hello".getBytes(StandardCharsets.UTF_8)); }
Source:
public ListViewInitializer<T> withEmptyListView(View emptyView, ViewRenderer<View, D> emptyViewRenderer, D data) { listView.setEmptyView(emptyView); emptyViewRenderer.render(emptyView, data); return this; }

Target:
public <D> ListViewInitializer<T> withEmptyListView(View emptyView, ViewRenderer<View, D> emptyViewRenderer, D data) { emptyViewRenderer.render(emptyView, data); return this; }
Source:
public void onContextEstablished(EndpointContext context) { exchange.setSendTimestamp(ClockUtil.nanoRealtime()); exchange.setEndpointContext(context); }

Target:
public void onContextEstablished(EndpointContext context) { exchange.setEndpointContext(context); }
Source:
private void setConfirmResultConverter() { setResultConverter((dialogButton) -> { List<PickerMilestone> finalList = state.getCurrentMilestonesList(); Optional<PickerMilestone> selectedMilestone = PickerMilestone.getSelectedMilestone(finalList); if (selectedMilestone.isPresent()) { return new MilestonePickerDialogResponse(dialogButton, Optional.of(selectedMilestone.get().getId())); } return new MilestonePickerDialogResponse(dialogButton, Optional.empty()); }); }

Target:
private void setConfirmResultConverter() { setResultConverter((dialogButton) -> { List<PickerMilestone> finalList = state.getCurrentMilestonesList(); Optional<PickerMilestone> selectedMilestone = PickerMilestone.getSelectedMilestone(finalList); return new MilestonePickerDialogResponse(dialogButton, selectedMilestone.map(PickerMilestone::getId)); }); }
Source:
public String solveProblemForSingle() { try { serviceManager.getWorkflowService().setSolution(getSolution()); try { setCurrentStep(serviceManager.getWorkflowService().solveProblem(this.currentStep, this.solutionTask)); } catch (DataException e) { logger.error("Problem couldn't be solved: " + e); } saveStep(); this.solution.setMessage(""); this.solutionTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); } catch (AuthenticationException e) { Helper.setFehlerMeldung(e.getMessage()); return ""; } }

Target:
public String solveProblemForSingle() { try { serviceManager.getWorkflowService().setSolution(getSolution()); try { setCurrentStep(serviceManager.getWorkflowService().solveProblem(this.currentStep, this.solutionTask)); saveStep(); } catch (DataException e) { logger.error("Problem couldn't be solved: " + e); } this.solution.setMessage(""); this.solutionTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); } catch (AuthenticationException e) { Helper.setFehlerMeldung(e.getMessage()); return ""; } }
Source:
public int hashCode() { final int prime = 31; int result = 1; IOseeBranch thisbranch = this.getBranch(); result = prime * result + ((thisbranch == null) ? 0 : thisbranch.hashCode()); result = prime * result + this.getTransaction(); return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; IOseeBranch branch = getBranch(); result = prime * result + ((branch == null) ? 0 : branch.hashCode()); result = prime * result + getTransaction(); return result; }
Source:
private LimitQueryDeterminismAnalysis analyzeLimitNoOrderBy(Query newLimitQuery, long limit) { Query rowCountQuery = simpleQuery( new Select(false, ImmutableList.of(new SingleColumn(new FunctionCall(QualifiedName.of("count"), ImmutableList.of(new LongLiteral("1")))))), new TableSubquery(newLimitQuery)); QueryResult<Long> result = callWithQueryStatsConsumer( () -> prestoAction.execute(rowCountQuery, DETERMINISM_ANALYSIS, resultSet -> resultSet.getLong(1)), stats -> verificationContext.setLimitQueryAnalysisQueryId(stats.getQueryId())); long rowCountNoLimit = getOnlyElement(result.getResults()); if (rowCountNoLimit == rowCount) { return DETERMINISTIC; } if (rowCount >= limit && rowCountNoLimit > rowCount) { return NON_DETERMINISTIC; } return FAILED_DATA_CHANGED; }

Target:
private LimitQueryDeterminismAnalysis analyzeLimitNoOrderBy(Query newLimitQuery, long limit) { Query rowCountQuery = simpleQuery( new Select(false, ImmutableList.of(new SingleColumn(new FunctionCall(QualifiedName.of("count"), ImmutableList.of(new LongLiteral("1")))))), new TableSubquery(newLimitQuery)); QueryResult<Long> result = callWithQueryStatsConsumer( () -> prestoAction.execute(rowCountQuery, DETERMINISM_ANALYSIS, resultSet -> resultSet.getLong(1)), stats -> verificationContext.setLimitQueryAnalysisQueryId(stats.getQueryId())); long rowCountHigherLimit = getOnlyElement(result.getResults()); if (rowCountHigherLimit == rowCount) { return DETERMINISTIC; } if (rowCount >= limit && rowCountHigherLimit > rowCount) { return NON_DETERMINISTIC; } return FAILED_DATA_CHANGED; }
Source:
protected String readCronTabFile(InputStream cronInputStream) throws IOException { final StringBuilder cronFileBasicInfo = new StringBuilder("#!/bin/bash") .append(NEW_LINE) .append("SHELL=/bin/sh") .append(NEW_LINE) .append("PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin") .append(NEW_LINE).append("# m h dom mon dow user command") .append(NEW_LINE); if (cronInputStream != null) { try { InputStreamReader isReader = new InputStreamReader( cronInputStream); BufferedReader br = new BufferedReader(isReader); StringBuilder cronBuilder = new StringBuilder(); String textinLine; while (true) { textinLine = br.readLine(); if (textinLine == null) { break; } cronBuilder.append(textinLine); cronBuilder.append(NEW_LINE); } return cronBuilder.toString(); } finally { cronInputStream.close(); } } return cronFileBasicInfo.toString(); }

Target:
protected String readCronTabFile(InputStream cronInputStream) throws IOException { final StringBuilder cronFileBasicInfo = new StringBuilder("#!/bin/bash") .append(NEW_LINE) .append("SHELL=/bin/sh") .append(NEW_LINE) .append("PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin") .append(NEW_LINE).append("# m h dom mon dow user command") .append(NEW_LINE); if (cronInputStream != null) { InputStreamReader isReader = new InputStreamReader( cronInputStream); BufferedReader br = new BufferedReader(isReader); StringBuilder cronBuilder = new StringBuilder(); String textinLine; while (true) { textinLine = br.readLine(); if (textinLine == null) { break; } cronBuilder.append(textinLine); cronBuilder.append(NEW_LINE); } return cronBuilder.toString(); } return cronFileBasicInfo.toString(); }
Source:
public void test_update_with_no_page_nor_url() throws Exception { SFormMapping formMapping = createFormMapping(ID); formMappingService.update(formMapping, null, null); verify(recorder).recordUpdate(updateRecordCaptor.capture(), updateEventCaptor.capture()); assertThat(updateRecordCaptor.getValue().getFields()).contains(entry("pageMapping.url", null), entry("pageMapping.pageId", null), entry("pageMapping.urlAdapter", null)); }

Target:
public void test_update_with_no_page_nor_url() throws Exception { SFormMapping formMapping = createFormMapping(ID); formMappingService.update(formMapping, null, null); verify(recorder).recordUpdate(updateRecordCaptor.capture(), updateEventCaptor.capture()); assertThat(updateRecordCaptor.getValue().getFields()).contains(entry("target", SFormMapping.TARGET_NONE),entry("pageMapping.url", null), entry("pageMapping.pageId", null), entry("pageMapping.urlAdapter", null)); }