auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public @Nullable Set<HttpCookie> getCookies(boolean refresh) { if (cookies == null || (refresh && snapshot.isModified(file.toFile()))) { try { for (int retryCount = 0; retryCount < MAX_STALE_FILEHANDLE_RETRIES; retryCount++) { try { snapshot = FileSnapshot.save(file.toFile()); Set<HttpCookie> newCookies = read(file, creationDate); if (cookies != null) { cookies = mergeCookies(newCookies, cookies); } else { cookies = newCookies; } return cookies; } catch (IOException e) { if (FileUtils.isStaleFileHandle(e)) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( JGitText.get().configHandleIsStale, Integer.valueOf(retryCount)), e); } continue; } else { throw e; } } } } catch (IOException | IllegalArgumentException e) { LOG.warn( MessageFormat.format( JGitText.get().couldNotReadCookieFile, file), e); } } return cookies; }

Target:
public Set<HttpCookie> getCookies(boolean refresh) { if (cookies == null || (refresh && snapshot.isModified(file.toFile()))) { try { for (int retryCount = 0; retryCount < MAX_STALE_FILEHANDLE_RETRIES; retryCount++) { try { snapshot = FileSnapshot.save(file.toFile()); Set<HttpCookie> newCookies = read(file, creationDate); if (cookies != null) { cookies = mergeCookies(newCookies, cookies); } else { cookies = newCookies; } return cookies; } catch (IOException e) { if (FileUtils.isStaleFileHandle(e)) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( JGitText.get().configHandleIsStale, Integer.valueOf(retryCount)), e); } continue; } else { throw e; } } } } catch (IOException | IllegalArgumentException e) { LOG.warn( MessageFormat.format( JGitText.get().couldNotReadCookieFile, file), e); if (cookies == null) { cookies = new LinkedHashSet<>(); } } } return cookies; }
Source:
private Server setUpServer() { Server server = new Server(0); ResourceHandler handler = new ResourceHandler(); handler.setDirectoriesListed(true); handler.setWelcomeFiles(new String[]{"index.html"}); handler.setResourceBase(getReportDirectoryPath().toAbsolutePath().toString()); HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[]{handler, new DefaultHandler()}); server.setHandler(handlers); return server; }

Target:
private Server setUpServer() { Server server = new Server(0); ResourceHandler handler = new ResourceHandler(); handler.setDirectoriesListed(true); handler.setWelcomeFiles(new String[]{"index.html"}); handler.setResourceBase(getReportDirectoryPath().toAbsolutePath().toString()); HandlerList handlers = new HandlerList(); handlers.setHandlers(new Handler[]{handler, new DefaultHandler()}); server.setStopAtShutdown(true); server.setHandler(handlers); return server; }
Source:
public void testFail() throws Exception { Connector c = getConnector(); String tableName = getUniqueNames(1)[0]; NewTableConfiguration ntc = new NewTableConfiguration(); ntc.setProperties( Collections.singletonMap(Property.TABLE_DELETE_BEHAVIOR.getKey(), Behavior.FAIL.name())); c.tableOperations().create(tableName, ntc); try (BatchWriter writer = c.createBatchWriter(tableName)) { Mutation m = new Mutation("1234"); m.putDelete("f1", "q1", 2L); writer.addMutation(m); } Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY); try { scanner.forEach(e -> {}); Assert.fail(); } catch (RuntimeException e) }

Target:
public void testFail() throws Exception { Connector c = getConnector(); String tableName = getUniqueNames(1)[0]; NewTableConfiguration ntc = new NewTableConfiguration(); ntc.setProperties( Collections.singletonMap(Property.TABLE_DELETE_BEHAVIOR.getKey(), Behavior.FAIL.name())); c.tableOperations().create(tableName, ntc); try (BatchWriter writer = c.createBatchWriter(tableName)) { Mutation m = new Mutation("1234"); m.putDelete("f1", "q1", 2L); writer.addMutation(m); } Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY); try { scanner.forEach(e -> {}); Assert.fail("Expected scan to fail because deletes are present."); } catch (RuntimeException e) }
Source:
public void testMiddleOfByteArrayConversion() { ByteBuffer bytes = ByteBuffer.wrap(new byte[]{'a', 'b', 'c', 'd'}); bytes.position(1).mark().limit(3); Assert.assertEquals("bc", StringUtils.fromUtf8(bytes, 2)); bytes.reset(); Assert.assertEquals("bc", StringUtils.fromUtf8(bytes)); }

Target:
public void testMiddleOfByteArrayConversion() { ByteBuffer bytes = ByteBuffer.wrap(new byte[]{'a', 'b', 'c', 'd'}); bytes.position(1).limit(3); Assert.assertEquals("bc", StringUtils.fromUtf8(bytes, 2)); bytes.position(1); Assert.assertEquals("bc", StringUtils.fromUtf8(bytes)); }
Source:
private int multiSync(String entityId, Collection<org.openrdf.model.Statement> statements, Collection<String> valueList) { Change change = new Change(entityId, -1, Instant.now(), -1); change.setStatements(statements); change.setValueCleanupList(valueList != null ? valueList : Collections.emptyList()); change.setRefCleanupList(valueList != null ? valueList : Collections.emptyList()); int res = syncFromChanges(Collections.singleton(change), false); int ts = rdfClient.update("DELETE { ?x wikibase:timestamp ?y } WHERE { ?x wikibase:timestamp ?y }").intValue(); return res - ts; }

Target:
private int multiSync(String entityId, Collection<org.openrdf.model.Statement> statements, Collection<String> valueList) { Change change = new Change(entityId, -1, Instant.now(), -1); change.setStatements(statements); change.setValueCleanupList(valueList); change.setRefCleanupList(valueList); int res = syncFromChanges(Collections.singleton(change), false); int ts = rdfClient.update("DELETE { ?x wikibase:timestamp ?y } WHERE { ?x wikibase:timestamp ?y }").intValue(); return res - ts; }
Source:
public String getString(final ByteBuffer byteBuffer) { if (byteBuffer == null) return null; return AsciiType.instance.getString(byteBuffer); }

Target:
public String getString(final ByteBuffer byteBuffer) { if (byteBuffer == null) return null; return AsciiType.instance.getString(byteBuffer.duplicate()); }
Source:
public ItemSetView getView(ArticleIngestion ingestion) { Collection<ArticleFile> files = (List<ArticleFile>) hibernateTemplate.find("SELECT file FROM ArticleFile file LEFT JOIN FETCH file.item WHERE file.ingestion = ?", ingestion); return new ItemSetView(ingestion, files); }

Target:
public ItemSetView getView(ArticleIngestion ingestion) { return new ItemSetView(ingestion, ingestion.getFiles()); }
Source:
public Control createControl(IUiContext context, Composite parent, FormToolkit toolkit) { ImageHyperlink removeLink = toolkit.createImageHyperlink(parent, SWT.TOP); removeLink.setImage(CommonImages.getImage(CommonImages.REMOVE)); removeLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { new RemoveReviewerDialog(getShell(), getTask(), getModelObject()).open(getEditor()); } }); removeLink.setEnabled(!isExecutableStateKnown() || isExecutable()); return removeLink; }

Target:
public Control createControl(IUiContext context, Composite parent, FormToolkit toolkit) { ImageHyperlink removeLink = toolkit.createImageHyperlink(parent, SWT.TOP); removeLink.setToolTipText( NLS.bind(Messages.RemoveReviewerUiFactory_Remove_Reviewer_Name, getModelObject().getDisplayName())); removeLink.setImage(CommonImages.getImage(CommonImages.REMOVE)); removeLink.addHyperlinkListener(new ObjectHyperlinkAdapter(this) { @Override public void linkActivated(HyperlinkEvent e) { RemoveReviewerUiFactory factory = (RemoveReviewerUiFactory) this.getObject(); factory.execute(); } }); removeLink.setEnabled(!isExecutableStateKnown() || isExecutable()); return removeLink; }
Source:
private boolean mediaBelongsToAPost(MediaModel media) { PostModel postToCancel = mPostStore.getPostByLocalPostId(media.getLocalPostId()); if (postToCancel == null) return false; if (!mUploadStore.isRegisteredPostModel(postToCancel)) { return false; } return true; }

Target:
private boolean mediaBelongsToAPost(MediaModel media) { PostModel postToCancel = mPostStore.getPostByLocalPostId(media.getLocalPostId()); return (postToCancel != null && mUploadStore.isRegisteredPostModel(postToCancel)); }
Source:
public boolean isStructureChanged(VDomainModelReference reference, EObject domainRootObject, ModelChangeNotification notification) { Assert.create(reference).notNull(); Assert.create(notification).notNull(); Assert.create(reference).ofClass(VFeaturePathDomainModelReference.class); if (notification.getRawNotification().isTouch()) { return false; } if (EAttribute.class.isInstance(notification.getStructuralFeature())) { return false; } final VIndexDomainModelReference indexDMR = VIndexDomainModelReference.class.cast(reference); boolean relevantChange = false; EObject lastResolvedEObject = domainRootObject; if (indexDMR.getPrefixDMR() == null) { for (final EReference eReference : indexDMR.getDomainModelEReferencePath()) { relevantChange |= eReference.equals(notification.getStructuralFeature()) && lastResolvedEObject == notification.getNotifier(); if (relevantChange) { return true; } lastResolvedEObject = (EObject) lastResolvedEObject.eGet(eReference); } } else { relevantChange = emfFormsStructuralChangeTester.isStructureChanged(indexDMR.getPrefixDMR(), domainRootObject, notification); } if (relevantChange) { return true; } try { lastResolvedEObject = ((EList<EObject>) emfFormsDatabinding .getSetting(indexDMR.getPrefixDMR(), domainRootObject).get(true)).get(indexDMR.getIndex()); } catch (final DatabindingFailedException ex) { throw new IllegalStateException(ex); } relevantChange = emfFormsStructuralChangeTester.isStructureChanged(indexDMR.getTargetDMR(), lastResolvedEObject, notification); return relevantChange; }

Target:
public boolean isStructureChanged(VDomainModelReference reference, EObject domainRootObject, ModelChangeNotification notification) { Assert.create(reference).notNull(); Assert.create(notification).notNull(); Assert.create(reference).ofClass(VFeaturePathDomainModelReference.class); if (notification.getRawNotification().isTouch()) { return false; } if (EAttribute.class.isInstance(notification.getStructuralFeature())) { return false; } final VIndexDomainModelReference indexDMR = VIndexDomainModelReference.class.cast(reference); boolean relevantChange = false; EObject lastResolvedEObject = domainRootObject; if (indexDMR.getPrefixDMR() == null) { for (final EReference eReference : indexDMR.getDomainModelEReferencePath()) { if (lastResolvedEObject == null) { return false; } relevantChange |= eReference.equals(notification.getStructuralFeature()) && lastResolvedEObject == notification.getNotifier(); if (relevantChange) { return true; } lastResolvedEObject = (EObject) lastResolvedEObject.eGet(eReference); } } else { relevantChange = emfFormsStructuralChangeTester.isStructureChanged(indexDMR.getPrefixDMR(), domainRootObject, notification); } if (relevantChange) { return true; } try { lastResolvedEObject = ((EList<EObject>) emfFormsDatabinding .getSetting(indexDMR.getPrefixDMR(), domainRootObject).get(true)).get(indexDMR.getIndex()); } catch (final DatabindingFailedException ex) { throw new IllegalStateException(ex); } relevantChange = emfFormsStructuralChangeTester.isStructureChanged(indexDMR.getTargetDMR(), lastResolvedEObject, notification); return relevantChange; }
Source:
public Job getJob(int row, int column) throws NoSuchElementException, MalformedURLException { getPage().open(); WebElement tableElement = getTable().findElement(By.xpath(" try { WebElement link = getTable().findElement(By.xpath(" String name = link.getText(); URL url = new URL(link.getAttribute("href")); return new Job(injector, url, name); } catch (NoSuchElementException e) { return null; } }

Target:
public Job getJob(int row, int column) throws NoSuchElementException { getPage().open(); getTable().findElement(By.xpath(" try { WebElement link = getTable().findElement(By.xpath(" String name = link.getText(); URL url = new URL(link.getAttribute("href")); return new Job(injector, url, name); } catch (NoSuchElementException e) { return null; } catch (MalformedURLException e) { throw new RuntimeException(e); } }
Source:
public void testConstructor(){ Integer expectParallelism = 100; Boolean expectIsParallel = true; StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); MockSource mockSource = new MockSource(Boundedness.BOUNDED, 10); DataStreamSource<Integer> stream = new DataStreamSource<Integer>( env, mockSource, WatermarkStrategy.noWatermarks() , null, "TestingSource"); stream.setParallelism(100); assertEquals(expectIsParallel, stream.isParallel); Integer actual = Integer.valueOf(stream.getParallelism()); assertEquals(expectParallelism, actual); }

Target:
public void testConstructor() { int expectParallelism = 100; boolean expectIsParallel = true; StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); MockSource mockSource = new MockSource(Boundedness.BOUNDED, 10); DataStreamSource<Integer> stream = env.fromSource( mockSource, WatermarkStrategy.noWatermarks(), "TestingSource"); stream.setParallelism(expectParallelism); assertEquals(expectIsParallel, stream.isParallel); assertEquals(expectParallelism, stream.getParallelism()); }
Source:
public void should_be_able_to_new_access_token_after_expiry_on_silent() { givenThat(james).wasAbleTo( acquireToken, clickDone, readCache); then(james).should(seeThat(TokenCacheItemCount.displayed(), is(6))); String accessToken1 = james.asksFor(AccessToken.displayed()); james.attemptsTo(clickDone, expireAccessToken, clickDone); when(james).attemptsTo( acquireToken .tokenExists(true) .withUserIdentifier(james.getCacheResult().displayableId), clickDone, readCache); then(james).should(seeThat(AccessToken.displayed(), not(accessToken1))); }

Target:
public void should_be_able_to_new_access_token_after_expiry_on_silent() { givenThat(james).wasAbleTo( acquireToken, clickDone, readCache); int expectedCacheCount = james.asksFor(ExpectedCacheItemCount.displayed()); then(james).should(seeThat(TokenCacheItemCount.displayed(), is(expectedCacheCount))); String accessToken1 = james.asksFor(AccessToken.displayed()); james.attemptsTo(clickDone, expireAccessToken, clickDone); when(james).attemptsTo( acquireToken .tokenExists(true) .withUserIdentifier(james.getCacheResult().displayableId), clickDone, readCache); then(james).should(seeThat(AccessToken.displayed(), not(accessToken1))); }
Source:
public void validateFreeSpace() { List<LUNs> allLuns = blockStorageDomainHelper.getVgLUNsInfo(getStorageDomain().getStorageStaticData(), getVdsId()); if (allLuns == null) { getAuditLogDirector().log(this, AuditLogType.USER_REDUCE_DOMAIN_DEVICES_FAILED_TO_GET_DOMAIN_INFO); throw new EngineException(EngineError.GeneralException, "Failed to get the vg info"); } Long freeExtants = allLuns.stream() .filter(l -> getParameters().getDstDevices().contains(l.getLUNId())) .mapToLong(l -> l.getPeCount() - l.getPeAllocatedCount()) .sum(); Long neededExtants = allLuns.stream() .filter(l -> getParameters().getDevicesToReduce().contains(l.getLUNId())) .mapToLong(LUNs::getPeAllocatedCount) .sum(); if (neededExtants > freeExtants) { getAuditLogDirector().log(this, AuditLogType.USER_REDUCE_DOMAIN_DEVICES_FAILED_NO_FREE_SPACE); throw new EngineException(EngineError.GeneralException, "Not enough free space on the destination devices"); } }

Target:
public void validateFreeSpace() { List<LUNs> allLuns = blockStorageDomainHelper.getVgLUNsInfo(getStorageDomain().getStorageStaticData(), getVdsId()); if (allLuns == null) { getAuditLogDirector().log(this, AuditLogType.USER_REDUCE_DOMAIN_DEVICES_FAILED_TO_GET_DOMAIN_INFO); throw new EngineException(EngineError.GeneralException, "Failed to get the vg info"); } Long freeExtents = allLuns.stream() .filter(l -> getParameters().getDstDevices().contains(l.getLUNId())) .mapToLong(l -> l.getPeCount() - l.getPeAllocatedCount()) .sum(); Long neededExtents = allLuns.stream() .filter(l -> getParameters().getDevicesToReduce().contains(l.getLUNId())) .mapToLong(LUNs::getPeAllocatedCount) .sum(); if (neededExtents > freeExtents) { getAuditLogDirector().log(this, AuditLogType.USER_REDUCE_DOMAIN_DEVICES_FAILED_NO_FREE_SPACE); throw new EngineException(EngineError.GeneralException, "Not enough free space on the destination devices"); } }
Source:
public static long fromUnixTime(@SqlType(StandardTypes.DOUBLE) double unixTime, @SqlType(StandardTypes.BIGINT) long hoursOffset, @SqlType(StandardTypes.BIGINT) long minutesOffset) { int offset = toIntExact(hoursOffset * 60 + minutesOffset); TimeZoneKey timeZoneKey; try { timeZoneKey = getTimeZoneKeyForOffset(offset); } catch (IllegalArgumentException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Invalid offset: %d", offset), e); } return packDateTimeWithZone(Math.round(unixTime * 1000), timeZoneKey); }

Target:
public static long fromUnixTime(@SqlType(StandardTypes.DOUBLE) double unixTime, @SqlType(StandardTypes.BIGINT) long hoursOffset, @SqlType(StandardTypes.BIGINT) long minutesOffset) { TimeZoneKey timeZoneKey; try { timeZoneKey = getTimeZoneKeyForOffset((int) (hoursOffset * 60 + minutesOffset)); } catch (IllegalArgumentException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, e); } return packDateTimeWithZone(Math.round(unixTime * 1000), timeZoneKey); }
Source:
public void evalBatch( final List<TupleBatch> ltb, final AppendableTable result, final ReadableTable state) throws DbException, IOException { if (pyWorker == null) { pyWorker = new PythonWorker(); initEvaluator(); } int resultcol = -1; for (int i = 0; i < tupleSize; i++) { if (isStateColumn[i]) { resultcol = columnIdxs[i]; } break; } try { DataOutputStream dOut = pyWorker.getDataOutputStream(); int numTuples = 0; for (int j = 0; j < ltb.size(); j++) { numTuples += ltb.get(j).numTuples(); } pyWorker.sendNumTuples(numTuples); for (int tbIdx = 0; tbIdx < ltb.size(); tbIdx++) { TupleBatch tb = ltb.get(tbIdx); for (int tup = 0; tup < tb.numTuples(); tup++) { for (int col = 0; col < tupleSize; col++) { writeToStream(tb, tup, columnIdxs[col], dOut); } } } Object obj = readFromStream(null); switch (outputType) { case DOUBLE_TYPE: result.putDouble(resultcol, (Double) obj); break; case BLOB_TYPE: result.putBlob(resultcol, (ByteBuffer.wrap((byte[]) obj))); break; case FLOAT_TYPE: result.putFloat(resultcol, (float) obj); break; case INT_TYPE: result.putInt(resultcol, (int) obj); break; case LONG_TYPE: result.putLong(resultcol, (long) obj); break; default: LOGGER.info("type not supported as Python Output"); break; } } catch (Exception e) { throw new DbException(e); } }

Target:
public void evalBatch( final List<TupleBatch> ltb, final AppendableTable result, final ReadableTable state) throws DbException, IOException { if (pyWorker == null) { pyWorker = new PythonWorker(); initEvaluator(); } int resultcol = -1; for (int i = 0; i < numColumns; i++) { if (isStateColumn[i]) { resultcol = columnIdxs[i]; } break; } try { DataOutputStream dOut = pyWorker.getDataOutputStream(); int numTuples = 0; for (int j = 0; j < ltb.size(); j++) { numTuples += ltb.get(j).numTuples(); } pyWorker.sendNumTuples(numTuples); for (int tbIdx = 0; tbIdx < ltb.size(); tbIdx++) { TupleBatch tb = ltb.get(tbIdx); for (int tup = 0; tup < tb.numTuples(); tup++) { for (int col = 0; col < numColumns; col++) { writeToStream(tb, tup, columnIdxs[col], dOut); } } } readFromStream(null, null, result, resultcol); } catch (Exception e) { throw new DbException(e); } }
Source:
public void handleError(CommandEnvelope envelope, RuntimeException exception) { checkNotNull(envelope); checkNotNull(exception); if (causedByRejection(exception)) { final Rejection rejection = rejectWithCause(envelope.getCommand(), exception); rejectionBus.post(rejection); } else { log().error(format("Error dispatching command (class: %s id: %s).", envelope.getMessage().getClass(), envelope.getId().getUuid()), exception); throw exception; } }

Target:
public void handleError(CommandEnvelope envelope, RuntimeException exception) { checkNotNull(envelope); checkNotNull(exception); if (causedByRejection(exception)) { final Rejection rejection = rejectWithCause(envelope.getCommand(), exception); rejectionBus.post(rejection); } else { log().error(format("Error dispatching command (class: %s id: %s).", envelope.getMessage().getClass(), Stringifiers.toString(envelope.getId())), exception); throw exception; } }
Source:
public ValiantRescuer(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[] {CardType.CREATURE}, "{1}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.power = new MageInt(3); this.toughness = new MageInt(1); this.addAbility(new CycleControllerTriggeredAbility( new CreateTokenEffect(new HumanSoldierToken()))); this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); }

Target:
public ValiantRescuer(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[] {CardType.CREATURE}, "{1}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.power = new MageInt(3); this.toughness = new MageInt(1); this.addAbility(new ValiantRescuerTriggeredAbility()); this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); }
Source:
private void initComponents(SquareConfig squareConfig) { mTeamInfos.forEach(teamInfo -> { createTeamPanel(squareConfig, teamInfo); }); JButton addTeam = new JButton(Messages.getString("TeamCreationPanel.addTeam")); addTeam.addActionListener(event -> { TeamInfo newTeam = new TeamInfo(); newTeam.teamId = mTeamIDCounter; newTeam.color = Color.gray; newTeam.teamName = Messages.getString("TeamCreationPanel.team", mTeamIDCounter++); mTeamInfos.add(newTeam); createTeamPanel(squareConfig, newTeam); remove(addTeam); if (mTeamIDCounter <= 4) add(addTeam); validate(); repaint(); }); add(addTeam); }

Target:
private void initComponents(SquareConfig squareConfig) { mTeamInfos.forEach(teamInfo -> { createTeamPanel(squareConfig, teamInfo); }); JButton addTeam = new JButton(Messages.getString("TeamCreationPanel.addTeam")); addTeam.addActionListener(event -> { TeamInfo newTeam = new TeamInfo(); newTeam.teamId = mTeamIDCounter; newTeam.color = Color.gray; newTeam.teamName = Messages.getString("TeamCreationPanel.team", mTeamIDCounter++); mTeamInfos.add(newTeam); createTeamPanel(squareConfig, newTeam); remove(addTeam); if (mTeamIDCounter <= 4) { add(addTeam); } validate(); repaint(); }); add(addTeam); }
Source:
public void executeThroughCli_reload() throws IOException { Assume.assumeTrue(client.version().greaterThanOrEqualTo(ServerVersion.VERSION_4_1_0) || client.version().lessThan(ServerVersion.VERSION_2_0_0)); super.executeThroughCli_reload(); }

Target:
public void executeThroughCli_reload() throws IOException { Assume.assumeTrue(client.version() != ServerVersion.VERSION_4_0_0); super.executeThroughCli_reload(); }
Source:
public void addView(TextAnnotation textAnnotation) throws AnnotatorException { String[] tokens = textAnnotation.getTokens(); String[] tags = {"DT","NN","IN","DT","NN","VBD","IN","NN","."}; View posView = new View(ViewNames.POS,"POS-annotator",textAnnotation,1.0); textAnnotation.addView(ViewNames.POS,posView); for(int i=0;i<tokens.length;i++){ posView.addConstituent(new Constituent(tags[i],ViewNames.POS,textAnnotation,i,i+1)); } }

Target:
public void addView(TextAnnotation textAnnotation) throws AnnotatorException { String[] tokens = textAnnotation.getTokens(); String[] tags = {"DT","NN","IN","DT","NN","VBD","IN","NN","."}; View posView = new View(ViewNames.POS,"POS-annotator",textAnnotation,1.0); textAnnotation.addView(ViewNames.POS,posView); for(int i=0;i<tags.length;i++){ posView.addConstituent(new Constituent(tags[i],ViewNames.POS,textAnnotation,i,i+1)); } }
Source:
private void copyHdfsToTd() { _logger.info("Executing " + HdfsToTeradataJobRunnerMain.class.getSimpleName() + " with params: "+ _params); TeradataExportTool.main(_params.toTdchParams()); }

Target:
private void copyHdfsToTd() { _logger.info(String.format("Executing %s with params: %s", HdfsToTeradataJobRunnerMain.class.getSimpleName(), _params)); TeradataExportTool.main(_params.toTdchParams()); }
Source:
public static void bind(ServiceBinder binder) { binder.bind(NashornReactRenderEngine.class, NashornReactRenderEngineImplementation.class); }

Target:
public static void bind(ServiceBinder binder) { binder.bind(ReactRenderEngine.class, NashornReactRenderEngineImplementation.class); binder.bind(ModuleLoaderFactory.class, ModuleLoaderFactoryImplementation.class); }
Source:
public static CharSequence generateMarkdown(Context c, String message){ Bypass bypass = new Bypass(c); CharSequence mSequence = bypass.markdownToSpannable(convertCharacterEncodings(message)); System.out.println("2915 msequence: " + mSequence); System.out.print("2915 msequence: " + mSequence); return MarkupUtil.trimTrailingWhitespace(mSequence); }

Target:
public static CharSequence generateMarkdown(Context c, String message){ Bypass bypass = new Bypass(c); CharSequence mSequence = bypass.markdownToSpannable(convertCharacterEncodings(message)); return MarkupUtil.trimTrailingWhitespace(mSequence); }
Source:
public NetworkFilterParameterEditor() { initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); ViewIdHandler.idHandler.generateAndSetIds(this); driver.initialize(this); ((Element) nameEditor.getElement().getChild(0)).addClassName(style.elementStyle()); ((Element) nameEditor.getElement().getChild(1)).addClassName(style.elementStyle()); ((Element) valueEditor.getElement().getChild(0)).addClassName(style.elementStyle()); ((Element) valueEditor.getElement().getChild(1)).addClassName(style.elementStyle()); }

Target:
public NetworkFilterParameterEditor() { initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); ViewIdHandler.idHandler.generateAndSetIds(this); driver.initialize(this); nameEditor.addLabelStyleName(style.elementStyle()); nameEditor.getContentWidgetContainer().getParent().addStyleName(style.elementStyle()); valueEditor.addLabelStyleName(style.elementStyle()); valueEditor.getContentWidgetContainer().getParent().addStyleName(style.elementStyle()); }
Source:
public void testSinglePlanSingleContext() { final List<String> plan = Lists.newArrayList(CONTEXT_A_ID); final int evalNum = 3; final List<EventHandler<ActiveContext>> activeContextHandlerList = new ArrayList<>(); for (int i = 1; i < plan.size(); i++) { activeContextHandlerList.add(new SubmitContextToACHandler(plan.get(i))); } activeContextHandlerList.add(new LastACHandler()); finishedCounter = new CountDownLatch(evalNum); evaluatorManager.allocateEvaluators(evalNum, new SubmitContextToAEHandler(plan.get(0), plan), activeContextHandlerList); try { finishedCounter.await(); } catch (final InterruptedException e) { throw new RuntimeException(e); } for (final String evalId : evalIdToActualContextIdStack.keySet()) { final List<String> expectedContextIdStack = evalIdToExpectedContextIdStack.get(evalId); final List<String> actualContextIdStack = evalIdToActualContextIdStack.get(evalId); assertEquals(expectedContextIdStack, actualContextIdStack); } }

Target:
public void testSinglePlanSingleContext() { final List<String> plan = Lists.newArrayList(CONTEXT_A_ID); final int evalNum = 3; final Tuple2<EventHandler<AllocatedEvaluator>, List<EventHandler<ActiveContext>>> handlers = getHandlersFromPlan(plan); finishedCounter = new CountDownLatch(evalNum); evaluatorManager.allocateEvaluators(evalNum, handlers.getT1(), handlers.getT2()); try { finishedCounter.await(TEST_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); } catch (final InterruptedException e) { throw new RuntimeException(e); } for (final String evalId : evalIdToActualContextIdStack.keySet()) { final List<String> expectedContextIdStack = evalIdToExpectedContextIdStack.get(evalId); final List<String> actualContextIdStack = evalIdToActualContextIdStack.get(evalId); assertEquals(expectedContextIdStack, actualContextIdStack); } }
Source:
public void hideAll() { Collection<Phantom> phantoms = fPhantomRegistry.values(); Iterable<Phantom> visiblePhantoms = Iterables.filter(phantoms, new Predicate<Phantom>() { public boolean apply(Phantom phantom) { return phantom.getFigure().getParent() != null; } }); for (Phantom phantom : visiblePhantoms) { handleDecorator(phantom, false, true); } }

Target:
public void hideAll() { for (Phantom phantom : fPhantomRegistry.values()) { if (phantom.getFigure().getParent() != null) { handleDecorator(phantom, false, true); } } }
Source:
private void setWhereClause(ParseQuery query) { if (city != null && !city.equalsIgnoreCase("Any") && !city.equalsIgnoreCase("")) query.whereMatches("cityName", city, "i"); if (group != null && !group.equalsIgnoreCase("Any") && !group.equalsIgnoreCase("")) query.whereMatches("groupType", group, "i"); if (season != null && !season.equalsIgnoreCase("Any") && !season.equalsIgnoreCase("")) query.whereMatches("travelSeason", season, "i"); }

Target:
private void setWhereClause(ParseQuery query) { if (!TextUtils.isEmpty(city) && !city.equalsIgnoreCase("Any")) query.whereMatches("cityName", city, "i"); if (!TextUtils.isEmpty(group) && !group.equalsIgnoreCase("Any")) query.whereMatches("groupType", group, "i"); if (!TextUtils.isEmpty(season) && !season.equalsIgnoreCase("Any")) query.whereMatches("travelSeason", season, "i"); }
Source:
public Map<Long, V> getAll() { rwLock.readLock().lock(); try { return (Map<Long, V>) ((TreeMap) subDataMap).clone(); } finally { rwLock.readLock().unlock(); } }

Target:
public Map<Long, V> getAll() { rwLock.readLock().lock(); try { return (Map<Long, V>) ((TreeMap<Long, V>) subDataMap).clone(); } finally { rwLock.readLock().unlock(); } }
Source:
protected static void assertSqlSimpleData(Ignite node, String sql, int expSize) { try { SqlQuery qry = new SqlQuery(typeName(ValueClass.class), sql).setArgs(SQL_ARG_1); List<Cache.Entry<BinaryObject, BinaryObject>> res = node.cache(CACHE_NAME).withKeepBinary().query(qry).getAll(); Set<Long> ids = new HashSet<>(); for (Cache.Entry<BinaryObject, BinaryObject> entry : res) { long id = entry.getKey().field(FIELD_KEY); long field1 = entry.getValue().field(FIELD_NAME_1_ESCAPED); long field2 = entry.getValue().field(FIELD_NAME_2_ESCAPED); assertTrue(field1 >= SQL_ARG_1); assertEquals(id, field1); assertEquals(id, field2); assertTrue(ids.add(id)); } assertEquals("Size mismatch [node=" + node.name() + ", exp=" + expSize + ", actual=" + res.size() + ", ids=" + ids + ']', expSize, res.size()); } catch (Exception e) { for (Throwable th = e; th != null; th = th.getCause()) { if (th.getMessage().contains(CONC_DESTROY_MSG)) return; } if (X.cause(e, QueryRetryException.class) == null) throw e; } }

Target:
protected static void assertSqlSimpleData(Ignite node, String sql, int expSize) { try { SqlQuery qry = new SqlQuery(typeName(ValueClass.class), sql).setArgs(SQL_ARG_1); List<Cache.Entry<BinaryObject, BinaryObject>> res = node.cache(CACHE_NAME).withKeepBinary().query(qry).getAll(); Set<Long> ids = new HashSet<>(); for (Cache.Entry<BinaryObject, BinaryObject> entry : res) { long id = entry.getKey().field(FIELD_KEY); long field1 = entry.getValue().field(FIELD_NAME_1_ESCAPED); long field2 = entry.getValue().field(FIELD_NAME_2_ESCAPED); assertTrue(field1 >= SQL_ARG_1); assertEquals(id, field1); assertEquals(id, field2); assertTrue(ids.add(id)); } assertEquals("Size mismatch [node=" + node.name() + ", exp=" + expSize + ", actual=" + res.size() + ", ids=" + ids + ']', expSize, res.size()); } catch (Exception e) { if (X.cause(e, QueryRetryException.class) == null) throw e; } }
Source:
public void testDisputeList() throws StripeException, InterruptedException { createDisputedCharge(100).getDispute(); createDisputedCharge(150).getDispute(); createDisputedCharge(300).getDispute(); Map<String, Object> listParams = new HashMap<String, Object>(); listParams.put("count", 3); List<Dispute> disputes = Dispute.all(listParams).getData(); assertEquals(3, disputes.size()); }

Target:
public void testDisputeList() throws StripeException, InterruptedException { Map<String, Object> listParams = new HashMap<String, Object>(); listParams.put("count", 3); List<Dispute> disputes = Dispute.all(listParams).getData(); assertEquals(3, disputes.size()); }
Source:
public String getUrl() { return url; }

Target:
public String getUrl() { return getURL(); }
Source:
public String add(Network network) { if (isReadOnly()){ throw new EngineException(EngineError.NO_IMPLEMENTATION); } return super.add(network); }

Target:
public String add(Network network) { testProviderIsNotReadOnly(); return super.add(network); }
Source:
public boolean execute() { for (int i = 0; i < maxAttempts; i++) { final Boolean result = taskRunner.get(); if (result != null && result) { return true; } final boolean wasLastAttempt = i + 1 == maxAttempts; if (!wasLastAttempt) { threadSleeper.accept(fixedBackOff); } } return false; }

Target:
public boolean execute() { for (int i = 1; i < maxAttempts; i++) { if (taskRunner.getAsBoolean()) { return true; } threadSleeper.accept(fixedBackOff); } return taskRunner.getAsBoolean(); }
Source:
public Map<String, String> convertProperties(String properties) { Map<String, String> map = new LinkedHashMap<String, String>(); if (StringUtils.isNotEmpty(properties)) { String keyValuePairs[] = SEMICOLON_PATTERN.split(properties); for (String keyValuePairStr : keyValuePairs) { String[] pairParts = keyValuePairStr.split(KEY_VALUE_DELIMETER, 2); String key = pairParts[0]; String value = pairParts[1]; map.put(key, value); } } return map; }

Target:
public Map<String, String> convertProperties(String properties) { if (syntaxErrorInProperties(properties)) { throw new IllegalArgumentException("Invalid properties syntax!"); } Map<String, String> map = new LinkedHashMap<String, String>(); if (StringUtils.isNotEmpty(properties)) { String keyValuePairs[] = SEMICOLON_PATTERN.split(properties); for (String keyValuePairStr : keyValuePairs) { String[] pairParts = keyValuePairStr.split(KEY_VALUE_DELIMETER, 2); String key = pairParts[0]; String value = pairParts[1]; map.put(key, value); } } return map; }
Source:
public boolean processOwnsAnchorXML(Process process) throws IOException { URI yearFile = FileService.this.createAnchorFile(FileService.this.getMetadataFilePath(process, false, false)); return FileService.this.fileExist(yearFile); }

Target:
public boolean processOwnsAnchorXML(Process process) throws IOException { URI yearFile = createAnchorFile(getMetadataFilePath(process, false, false)); return fileExist(yearFile); }
Source:
protected void executeVmCommand() { lockImageInDb(); List<UpdateVmDiskParameters.Phase> phaseList = new ArrayList<>(); ImagesHandler.setDiskAlias(getParameters().getDiskInfo(), getVm()); if (resizeDiskImageRequested()) { phaseList.add(UpdateVmDiskParameters.Phase.EXTEND_DISK); } if (Objects.equals(getOldDisk().getDiskStorageType(), DiskStorageType.IMAGE) && amendDiskRequested()) { phaseList.add(UpdateVmDiskParameters.Phase.AMEND_DISK); } phaseList.add(UpdateVmDiskParameters.Phase.UPDATE_DISK); getParameters().setDiskUpdatePhases(phaseList); setSucceeded(true); }

Target:
protected void executeVmCommand() { lockImageInDb(); List<UpdateVmDiskParameters.Phase> phaseList = new ArrayList<>(); ImagesHandler.setDiskAlias(getParameters().getDiskInfo(), getVm()); if (resizeDiskImageRequested()) { phaseList.add(UpdateVmDiskParameters.Phase.EXTEND_DISK); } if (getOldDisk().getDiskStorageType() == DiskStorageType.IMAGE && amendDiskRequested()) { phaseList.add(UpdateVmDiskParameters.Phase.AMEND_DISK); } phaseList.add(UpdateVmDiskParameters.Phase.UPDATE_DISK); getParameters().setDiskUpdatePhases(phaseList); setSucceeded(true); }
Source:
public String getDescription() { return de.danoeh.antennapod.core.util.TextUtils.getNormalizedText(description); }

Target:
public String getDescription() { return description; }
Source:
public Set<String> getSegmentVersions(final String dataSource) { ArrayList<DataSegment> segments; try { StatusResponseHolder response = makeRequest(HttpMethod.GET, getFullSegmentsURL(dataSource)); segments = jsonMapper.readValue( response.getContent(), new TypeReference<List<DataSegment>>() { } ); } catch (Exception e) { throw Throwables.propagate(e); } return segments.stream().map(s -> s.getVersion()).collect(Collectors.toSet()); }

Target:
public Set<String> getSegmentVersions(final String dataSource) { ArrayList<DataSegment> segments; try { StatusResponseHolder response = makeRequest(HttpMethod.GET, getFullSegmentsURL(dataSource)); segments = jsonMapper.readValue( response.getContent(), new TypeReference<List<DataSegment>>() { } ); } catch (Exception e) { throw new RuntimeException(e); } return segments.stream().map(s -> s.getVersion()).collect(Collectors.toSet()); }
Source:
private void setupSpecificMessageHandlers() { bridge.addListener("onBeginNewPage", new SynchronousBridgeListener() { @Override public void onMessage(JSONObject payload) { try { stagedScrollY = payload.getInt("stagedScrollY"); loadPageOnWebViewReady(Cache.valueOf(payload.getString("cachePreference"))); } catch (JSONException e) { L.logRemoteErrorIfProd(e); } } }); bridge.addListener("requestSection", new SynchronousBridgeListener() { @Override public void onMessage(JSONObject payload) { try { displayNonLeadSection(payload.getInt("index"), payload.optBoolean(BRIDGE_PAYLOAD_SAVED_PAGE, false)); } catch (JSONException e) { L.logRemoteErrorIfProd(e); } } }); bridge.addListener("pageLoadComplete", new SynchronousBridgeListener() { @Override public void onMessage(JSONObject payload) { activity.updateProgressBar(false, true, 0); bottomContentHandler.setTitle(model.getTitle()); bottomContentHandler.beginLayout(); if (model.getPage() != null) { leadImagesHandler.updateNavigate(model.getPage().getPageProperties().getGeo()); } } }); bridge.addListener("pageInfo", new CommunicationBridge.JSEventListener() { @Override public void onMessage(String message, JSONObject payload) { if (fragment.isAdded()) { PageInfo pageInfo = PageInfoUnmarshaller.unmarshal(model.getTitle(), model.getTitle().getSite(), payload); fragment.updatePageInfo(pageInfo); } } }); bottomContentHandler = new BottomContentHandler(fragment, bridge, webView, fragment.getLinkHandler(), (ViewGroup) fragment.getView().findViewById(R.id.bottom_content_container)); }

Target:
private void setupSpecificMessageHandlers() { bridge.addListener("onBeginNewPage", new SynchronousBridgeListener() { @Override public void onMessage(JSONObject payload) { try { stagedScrollY = payload.getInt("stagedScrollY"); loadPageOnWebViewReady(Cache.valueOf(payload.getString("cachePreference"))); } catch (JSONException e) { L.logRemoteErrorIfProd(e); } } }); bridge.addListener("requestSection", new SynchronousBridgeListener() { @Override public void onMessage(JSONObject payload) { try { displayNonLeadSection(payload.getInt("index"), payload.optBoolean(BRIDGE_PAYLOAD_SAVED_PAGE, false)); } catch (JSONException e) { L.logRemoteErrorIfProd(e); } } }); bridge.addListener("pageLoadComplete", new SynchronousBridgeListener() { @Override public void onMessage(JSONObject payload) { activity.updateProgressBar(false, true, 0); bottomContentHandler.setTitle(model.getTitle()); bottomContentHandler.beginLayout(); } }); bridge.addListener("pageInfo", new CommunicationBridge.JSEventListener() { @Override public void onMessage(String message, JSONObject payload) { if (fragment.isAdded()) { PageInfo pageInfo = PageInfoUnmarshaller.unmarshal(model.getTitle(), model.getTitle().getSite(), payload); fragment.updatePageInfo(pageInfo); } } }); bottomContentHandler = new BottomContentHandler(fragment, bridge, webView, fragment.getLinkHandler(), (ViewGroup) fragment.getView().findViewById(R.id.bottom_content_container)); }
Source:
public ExistsPredicateBuilder<LuceneSearchPredicateBuilder> exists(String absoluteFieldPath) { LuceneScopedIndexObjectComponent<LuceneFieldPredicateBuilderFactory> schemaObjectNodeComponent = scopeModel.getSchemaObjectNodeComponent( absoluteFieldPath, PREDICATE_BUILDER_FACTORY_RETRIEVAL_STRATEGY ); if ( schemaObjectNodeComponent != null ) { LuceneExistsCompositePredicateBuilder objectPredicateBuilder = new LuceneExistsCompositePredicateBuilder(); for ( Map.Entry<String, LuceneFieldPredicateBuilderFactory> fieldComponentEntry : schemaObjectNodeComponent.getFieldComponents().entrySet() ) { ExistsPredicateBuilder<LuceneSearchPredicateBuilder> existsPredicateBuilder = fieldComponentEntry.getValue().createExistsPredicateBuilder( fieldComponentEntry.getKey() ); objectPredicateBuilder.addChild( existsPredicateBuilder ); } return objectPredicateBuilder; } return scopeModel .getSchemaNodeComponent( absoluteFieldPath, PREDICATE_BUILDER_FACTORY_RETRIEVAL_STRATEGY ) .getComponent().createExistsPredicateBuilder( absoluteFieldPath ); }

Target:
public ExistsPredicateBuilder<LuceneSearchPredicateBuilder> exists(String absoluteFieldPath) { LuceneObjectPredicateBuilderFactory objectPredicateBuilderFactory = scopeModel.getObjectPredicateBuilderFactory( absoluteFieldPath ); if ( objectPredicateBuilderFactory != null ) { return objectPredicateBuilderFactory.createExistsPredicateBuilder(); } return scopeModel .getSchemaNodeComponent( absoluteFieldPath, PREDICATE_BUILDER_FACTORY_RETRIEVAL_STRATEGY ) .getComponent().createExistsPredicateBuilder( absoluteFieldPath ); }
Source:
public String getCertificate (final KeyStore keyStore, final String alias, final boolean canAttachSelfSign) throws ScriptSignatureException { if (keyStore!=null && alias!=null) { try { if (!keyStore.containsAlias(alias)) throw new ScriptSignatureException("Alias can't be found", null); if (!keyStore.isCertificateEntry(alias) && !canAttachSelfSign) throw new ScriptSignatureException("This certificate is self-signed certificate. Chose another trusted certificate.", null); Certificate certificate = keyStore.getCertificate(alias); byte[] certByte = certificate.getEncoded(); if (certByte == null) throw new ScriptSignatureException("Certificate not retrieved. Try again.", null); return fHelper.convertBytesToBase64(certByte); } catch (KeyStoreException e) { throw new ScriptSignatureException("Keystore not initialized properly. Try again.", e); } catch (CertificateEncodingException e) { throw new ScriptSignatureException("Encoding of certificate is improper. Please try again or chose another alias.", e); } } throw new ScriptSignatureException("Either keystore is not initialized properly or alias is not provided. Try again.", null); }

Target:
public String getCertificate(final KeyStore keyStore, final String alias, final boolean canAttachSelfSign) throws ScriptSignatureException { if (keyStore != null && alias != null) try { if (!keyStore.containsAlias(alias)) throw new ScriptSignatureException("Alias can't be found"); if (!keyStore.isCertificateEntry(alias) && !canAttachSelfSign) throw new ScriptSignatureException("This certificate is self-signed certificate. Chose another trusted certificate."); Certificate certificate = keyStore.getCertificate(alias); byte[] certByte = certificate.getEncoded(); if (certByte == null) throw new ScriptSignatureException("Certificate not retrieved. Try again."); return fHelper.convertBytesToBase64(certByte); } catch (KeyStoreException e) { throw new ScriptSignatureException("Keystore not initialized properly. Try again.", e); } catch (CertificateEncodingException e) { throw new ScriptSignatureException("Encoding of certificate is improper. Please try again or chose another alias.", e); } throw new ScriptSignatureException("Either keystore is not initialized properly or alias is not provided. Try again."); }
Source:
private List<Allele> buildNewAllelesFromZCall(final String zCallPedFileAlleles, final Map<String, Object> newAttributes) { final char allele1 = zCallPedFileAlleles.charAt(0); final char allele2 = zCallPedFileAlleles.charAt(1); final List<Allele> newAlleles = new ArrayList<>(); final String alleleA = String.valueOf(newAttributes.get("ALLELE_A")); final String alleleB = String.valueOf(newAttributes.get("ALLELE_B")); newAlleles.add(translateAllele(alleleA, alleleB, allele1)); newAlleles.add(translateAllele(alleleA, alleleB, allele2)); return newAlleles; }

Target:
private List<Allele> buildNewAllelesFromZCall(final String zCallPedFileAlleles, final Map<String, Object> newAttributes) { final char allele1 = zCallPedFileAlleles.charAt(0); final char allele2 = zCallPedFileAlleles.charAt(1); final List<Allele> newAlleles = new ArrayList<>(); final String alleleA = String.valueOf(newAttributes.get(ALLELE_A)); final String alleleB = String.valueOf(newAttributes.get(ALLELE_B)); newAlleles.add(translateAllele(alleleA, alleleB, allele1)); newAlleles.add(translateAllele(alleleA, alleleB, allele2)); return newAlleles; }
Source:
public static void flatGroups(ExtMap principal) { HashMap<String, ExtMap> accumulator = new HashMap<>(); flatGroups(principal, PrincipalRecord.GROUPS, accumulator); principal.put(PrincipalRecord.GROUPS, new ArrayList<>(accumulator.values())); }

Target:
public static void flatGroups(ExtMap principal) { Map<String, ExtMap> accumulator = new HashMap<>(); flatGroups(principal, PrincipalRecord.GROUPS, accumulator); principal.put(PrincipalRecord.GROUPS, new ArrayList<>(accumulator.values())); }
Source:
private void testBloomFilterForPrimitives(long seed) { final int numValues = 1024 * 1024; final int numBytes = BlockSplitBloomFilter.optimalNumOfBits(numValues , 0.01) / 8; BloomFilter bloomFilter = new BlockSplitBloomFilter(numBytes); Random random = new Random(seed); Set<Object> values = new HashSet<>(); for (int i = 0; i < numValues; i++) { int type = random.nextInt(4); Object v; switch (type) { case 0: { v = random.nextInt(); break; } case 1: { v = random.nextLong(); break; } case 2: { v = random.nextFloat(); break; } default: { v = random.nextDouble(); } } values.add(v); bloomFilter.insertHash(bloomFilter.hash(v)); } for (Object v : values) { assertTrue(String.format("the value %s should not be filtered, seed = %d", v, seed), bloomFilter.findHash(bloomFilter.hash(v))); } }

Target:
private void testBloomFilterForPrimitives(long seed) { Random random = new Random(seed); final int numValues = 1024 * 1024; final int numBytes = BlockSplitBloomFilter.optimalNumOfBits(numValues, random.nextDouble() / 10) / 8; BloomFilter bloomFilter = new BlockSplitBloomFilter(numBytes); Set<Object> values = new HashSet<>(); for (int i = 0; i < numValues; i++) { int type = random.nextInt(4); Object v; switch (type) { case 0: { v = random.nextInt(); break; } case 1: { v = random.nextLong(); break; } case 2: { v = random.nextFloat(); break; } default: { v = random.nextDouble(); } } values.add(v); bloomFilter.insertHash(bloomFilter.hash(v)); } for (Object v : values) { assertTrue(String.format("the value %s should not be filtered, seed = %d", v, seed), bloomFilter.findHash(bloomFilter.hash(v))); } }
Source:
public void publishEvent(Object event) { publishEvent(new PayloadApplicationEvent<Object>(null, event)); }

Target:
public void publishEvent(Object event) { publishEvent(new PayloadApplicationEvent<>(this, event)); }