auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public long getLong(int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getLong columnIndex: {0}", columnIndex); checkResultSet(columnIndex); if (wasNullFlag) { return 0; } if (isBinary(columnIndex)) { int col = columnIndex - 1; int oid = fields[col].getOID(); return readLongValue(this_row[col], oid, Long.MIN_VALUE, Long.MAX_VALUE, "long"); } Encoding encoding = connection.getEncoding(); if (encoding.hasAsciiNumbers()) { try { return getFastLong(columnIndex); } catch (NumberFormatException ex) { } } return toLong(getFixedString(columnIndex)); }

Target:
public long getLong(int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getLong columnIndex: {0}", columnIndex); checkResultSet(columnIndex); if (wasNullFlag) { return 0; } if (isBinary(columnIndex)) { int col = columnIndex - 1; int oid = fields[col].getOID(); if (oid == Oid.INT8) { return ByteConverter.int8(this_row[col], 0); } return readLongValue(this_row[col], oid, Long.MIN_VALUE, Long.MAX_VALUE, "long"); } Encoding encoding = connection.getEncoding(); if (encoding.hasAsciiNumbers()) { try { return getFastLong(columnIndex); } catch (NumberFormatException ex) { } } return toLong(getFixedString(columnIndex)); }
Source:
public void testV2FetchMixedWantRef() throws Exception { RevCommit one = remote.commit().message("1").create(); RevCommit two = remote.commit().message("2").create(); RevCommit three = remote.commit().message("3").create(); remote.update("one", one); remote.update("two", two); remote.update("three", three); server.getConfig().setBoolean("uploadpack", null, "allowrefinwant", true); ByteArrayInputStream recvStream = uploadPackV2( "command=fetch\n", PacketLineIn.DELIM, "want-ref refs/heads/one\n", "want " + two.toObjectId().getName(), "done\n", PacketLineIn.END); PacketLineIn pckIn = new PacketLineIn(recvStream); assertThat(pckIn.readString(), is("wanted-refs")); assertThat( pckIn.readString(), is(one.toObjectId().getName() + " refs/heads/one")); assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM)); assertThat(pckIn.readString(), is("packfile")); parsePack(recvStream); assertTrue(client.hasObject(one.toObjectId())); assertTrue(client.hasObject(two.toObjectId())); assertFalse(client.hasObject(three.toObjectId())); }

Target:
public void testV2FetchMixedWantRef() throws Exception { RevCommit one = remote.commit().message("1").create(); RevCommit two = remote.commit().message("2").create(); RevCommit three = remote.commit().message("3").create(); remote.update("one", one); remote.update("two", two); remote.update("three", three); server.getConfig().setBoolean("uploadpack", null, "allowrefinwant", true); ByteArrayInputStream recvStream = uploadPackV2( "command=fetch\n", PacketLineIn.DELIM, "want-ref refs/heads/one\n", "want " + two.toObjectId().getName() + "\n", "done\n", PacketLineIn.END); PacketLineIn pckIn = new PacketLineIn(recvStream); assertThat(pckIn.readString(), is("wanted-refs")); assertThat( pckIn.readString(), is(one.toObjectId().getName() + " refs/heads/one")); assertThat(pckIn.readString(), theInstance(PacketLineIn.DELIM)); assertThat(pckIn.readString(), is("packfile")); parsePack(recvStream); assertTrue(client.hasObject(one.toObjectId())); assertTrue(client.hasObject(two.toObjectId())); assertFalse(client.hasObject(three.toObjectId())); }
Source:
public boolean equals(final Object other) { if(other instanceof EntityQueryNode) { return hashCode() == other.hashCode(); } return false; }

Target:
public boolean equals(final Object other) { if(other instanceof EntityQueryNode) { final EntityQueryNode otherNode = (EntityQueryNode)other; final boolean samePatterns = getPatterns().size() == otherNode.getPatterns().size(); boolean match = true; if(samePatterns) { for(final StatementPattern sp : getPatterns()) { if(!otherNode.getPatterns().contains(sp)) { match = false; break; } } } return Objects.equals(subjectIsConstant, otherNode.subjectIsConstant) && Objects.equals(subjectVar, otherNode.subjectVar) && Objects.equals(type, otherNode.type) && Objects.equals(subjectConstant, otherNode.subjectConstant) && samePatterns && match; } return false; }
Source:
protected Object doInBackground() { hashDb.setIndexing(true); progress = ProgressHandle.createHandle( NbBundle.getMessage(this.getClass(), "HashDbManager.progress.indexingHashSet", hashDb.getHashSetName())); progress.start(); progress.switchToIndeterminate(); try { SleuthkitJNI.createLookupIndexForHashDatabase(hashDb.getHandle()); } catch (TskCoreException ex) { Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error indexing hash database", ex); JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "HashDbManager.dlgMsg.errorIndexingHashSet", hashDb.getHashSetName()), NbBundle.getMessage(this.getClass(), "HashDbManager.hashDbIndexingErr"), JOptionPane.ERROR_MESSAGE); } return null; }

Target:
protected Object doInBackground() { hashDb.setIndexing(true); progress = ProgressHandle.createHandle( NbBundle.getMessage(this.getClass(), "HashDbManager.progress.indexingHashSet", hashDb.getHashSetName())); progress.start(); progress.switchToIndeterminate(); try { SleuthkitJNI.createLookupIndexForHashDatabase(hashDb.getHandle()); } catch (TskCoreException ex) { Logger.getLogger(HashDbIndexer.class.getName()).log(Level.SEVERE, "Error indexing hash set " + hashDb.getHashSetName(), ex); JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "HashDbManager.dlgMsg.errorIndexingHashSet", hashDb.getHashSetName()), NbBundle.getMessage(this.getClass(), "HashDbManager.hashDbIndexingErr"), JOptionPane.ERROR_MESSAGE); } return null; }
Source:
public void requiredHeadersInSeparateConnectionHeaders() { setUpServerChannel(); String upgradeString = "GET / HTTP/1.1\r\n" + "Host: example.com\r\n" + "Connection: keep-alive\r\n" + "Connection: HTTP2-Settings\r\n" + "Connection: Upgrade\r\n" + "Upgrade: h2c\r\n" + "HTTP2-Settings: AAMAAABkAAQAAP__\r\n\r\n"; validateClearTextUpgrade(upgradeString); }

Target:
public void requiredHeadersInSeparateConnectionHeaders() { String upgradeString = "GET / HTTP/1.1\r\n" + "Host: example.com\r\n" + "Connection: keep-alive\r\n" + "Connection: HTTP2-Settings\r\n" + "Connection: Upgrade\r\n" + "Upgrade: h2c\r\n" + "HTTP2-Settings: AAMAAABkAAQAAP__\r\n\r\n"; validateClearTextUpgrade(upgradeString); }
Source:
public VersionHolder createElement(StudyIdentifier studyId, AppConfigElement element) { checkNotNull(studyId); checkNotNull(element); if (element.getRevision() == null) { element.setRevision(1L); } Validate.entityThrowingException(AppConfigElementValidator.INSTANCE, element); element.setKey(studyId.getIdentifier() + ":" + element.getId()); element.setStudyId(studyId.getIdentifier()); element.setVersion(null); element.setDeleted(false); element.setCreatedOn(getDateTime().getMillis()); element.setModifiedOn(element.getCreatedOn()); AppConfigElement existing = appConfigElementDao.getElementRevision(studyId, element.getId(), element.getRevision()); if (existing != null) { throw new EntityAlreadyExistsException(AppConfigElement.class, ImmutableMap.of("id", existing.getId(), "revision", existing.getRevision())); } return appConfigElementDao.saveElementRevision(element); }

Target:
public VersionHolder createElement(StudyIdentifier studyId, AppConfigElement element) { checkNotNull(studyId); checkNotNull(element); if (element.getRevision() == null) { element.setRevision(1L); } Validate.entityThrowingException(AppConfigElementValidator.INSTANCE, element); element.setStudyId(studyId.getIdentifier()); element.setId(element.getId()); element.setVersion(null); element.setDeleted(false); element.setCreatedOn(DateTime.now().getMillis()); element.setModifiedOn(element.getCreatedOn()); AppConfigElement existing = appConfigElementDao.getElementRevision(studyId, element.getId(), element.getRevision()); if (existing != null) { throw new EntityAlreadyExistsException(AppConfigElement.class, ImmutableMap.of("id", existing.getId(), "revision", existing.getRevision())); } return appConfigElementDao.saveElementRevision(element); }
Source:
private boolean performLiveSnapshot(final Snapshot snapshot) { if(getVm().getClusterCompatibilityVersion().less(new Version("4.4"))) { return performLiveSnapshotDeprecated(snapshot); } else { ActionReturnValue actionReturnValue = runInternalAction(ActionType.CreateLiveSnapshotForVm, createLiveSnapshotParameters(snapshot), getContext()); if (actionReturnValue.getSucceeded()) { setSucceeded(true); return true; } else { log.error("Failed to start live snapshot on VDS"); setSucceeded(false); return false; } } }

Target:
private boolean performLiveSnapshot(final Snapshot snapshot) { if(FeatureSupported.isAsyncLiveSnapshotSupported(getVm().getClusterCompatibilityVersion())) { ActionReturnValue actionReturnValue = runInternalAction(ActionType.CreateLiveSnapshotForVm, createLiveSnapshotParameters(snapshot), getContext()); if (actionReturnValue.getSucceeded()) { setSucceeded(true); return true; } else { log.error("Failed to start live snapshot on VDS"); setSucceeded(false); return false; } } else { return performLiveSnapshotDeprecated(snapshot); } }
Source:
public void setValue(String text) { if (isMultiSelect) { String[] valueArr = text.split(VALUE_SEPARATOR); getAttributeMapper().setValues(getTaskAttribute(), FluentIterable.from(Arrays.asList(valueArr)).transform(new Function<String, String>() { @Override public String apply(String input) { return StringUtils.stripToNull(input); } }).filter(Predicates.notNull()).toList()); } else { getAttributeMapper().setValue(getTaskAttribute(), text); } attributeChanged(); }

Target:
public void setValue(String text) { if (isMultiSelect) { String[] valueArr = text.split(VALUE_SEPARATOR); getAttributeMapper().setValues(getTaskAttribute(), FluentIterable.from(Arrays.asList(valueArr)).transform(new Function<String, String>() { @Override public String apply(String input) { return input == null ? "" : input.trim(); } }).filter(new Predicate<String>() { @Override public boolean apply(String input) { return !Strings.isNullOrEmpty(input); } }).toList()); } else { getAttributeMapper().setValue(getTaskAttribute(), text); } attributeChanged(); }
Source:
private List<RemoteTask> scheduleTasks(int count) { if (count == 0) { return ImmutableList.of(); } List<Node> nodes = nodeSelector.selectRandomNodes(count, scheduledNodes); checkCondition(!scheduledNodes.isEmpty() || !nodes.isEmpty(), NO_NODES_AVAILABLE, "No nodes available to run query"); ImmutableList.Builder<RemoteTask> tasks = ImmutableList.builder(); for (Node node : nodes) { tasks.add(taskScheduler.scheduleTask(node, scheduledNodes.size(), OptionalInt.of(nodes.size()))); scheduledNodes.add(node); } return tasks.build(); }

Target:
private List<RemoteTask> scheduleTasks(int count) { if (count == 0) { return ImmutableList.of(); } List<Node> nodes = nodeSelector.selectRandomNodes(count, scheduledNodes); checkCondition(!scheduledNodes.isEmpty() || !nodes.isEmpty(), NO_NODES_AVAILABLE, "No nodes available to run query"); ImmutableList.Builder<RemoteTask> tasks = ImmutableList.builder(); for (Node node : nodes) { tasks.add(taskScheduler.scheduleTask(node, scheduledNodes.size(), OptionalInt.empty())); scheduledNodes.add(node); } return tasks.build(); }
Source:
public Iterator<Tree> childrenIterator() { if (parameters != null) { return Iterators.concat(Iterators.singletonIterator(lParenthesis), parameters.elementsAndSeparators(Functions.identity()), Iterators.forArray(restParameter, comma, rParenthesis)); } else { return Iterators.forArray(lParenthesis, restParameter, comma, rParenthesis); } }

Target:
public Iterator<Tree> childrenIterator() { return Iterators.concat(Iterators.singletonIterator(lParenthesis), parameters.elementsAndSeparators(Functions.identity()), Iterators.singletonIterator(rParenthesis)); }
Source:
public InstanceKey saveToSnapshot(String owner) throws MachineException { try { final String repository = generateRepository(); final String tag = "latest"; if (locallySnapshot) { return new DockerInstanceKey(repository, tag, createImage(owner, repository, tag)); } else { return new DockerInstanceKey(repository, tag, registry, saveInRegistry(owner, repository, tag)); } } catch (IOException ioEx) { throw new MachineException(ioEx); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new MachineException(ex.getLocalizedMessage(), ex); } }

Target:
public InstanceKey saveToSnapshot(String owner) throws MachineException { try { final String repository = generateRepository(); final String tag = "latest"; if(!snapshotUseRegistry) { commitContainer(owner, repository, tag); return new DockerInstanceKey(repository, tag); } final String repositoryName = registry + '/' + repository; commitContainer(owner, repositoryName, tag); Thread.sleep(2000); final ProgressLineFormatterImpl lineFormatter = new ProgressLineFormatterImpl(); final String digest = docker.push(PushParams.create(repository) .withTag(tag) .withRegistry(registry), progressMonitor -> { try { outputConsumer.writeLine(lineFormatter.format(progressMonitor)); } catch (IOException ignored) { } }); docker.removeImage(RemoveImageParams.create(repositoryName).withForce(false)); return new DockerInstanceKey(repository, tag, registry, digest); } catch (IOException ioEx) { throw new MachineException(ioEx); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new MachineException(e.getLocalizedMessage(), e); } }
Source:
public void andThenCompletableCompleteError() { Completable.complete() .andThen(Completable.error(new RuntimeException("test"))) .test() .assertNotComplete() .assertNoValues() .assertError(RuntimeException.class) .assertErrorMessage("test"); }

Target:
public void andThenCompletableCompleteError() { Completable.complete() .andThen(Completable.error(new TestException("test"))) .test() .assertNotComplete() .assertNoValues() .assertError(TestException.class) .assertErrorMessage("test"); }
Source:
public HttpResponse doCompleteInstall() throws IOException, ServletException { jenkins.setInstallState(InstallState.INITIAL_SETUP_COMPLETED); InstallUtil.saveLastExecVersion(); PluginServletFilter.removeFilter(FORCE_SETUP_WIZARD_FILTER); <<<<<<< HEAD j.setSetupWizard(null); UpgradeWizard uw = j.getInjector().getInstance(UpgradeWizard.class); if (uw!=null) uw.setCurrentLevel(new VersionNumber("2.0")); ======= jenkins.setSetupWizard(null); >>>>>>> origin/2.0 return HttpResponses.okJSON(); }

Target:
public HttpResponse doCompleteInstall() throws IOException, ServletException { jenkins.setInstallState(InstallState.INITIAL_SETUP_COMPLETED); InstallUtil.saveLastExecVersion(); PluginServletFilter.removeFilter(FORCE_SETUP_WIZARD_FILTER); jenkins.setSetupWizard(null); UpgradeWizard uw = jenkins.getInjector().getInstance(UpgradeWizard.class); if (uw!=null) uw.setCurrentLevel(new VersionNumber("2.0")); return HttpResponses.okJSON(); }
Source:
public boolean acceptsValue( Value value ) { if ( value == null ) { return false; } if ( value instanceof PointValue ) { PointValue point = (PointValue) value; if ( point.getCRS() == crs ) { return point.withinRange( from, fromInclusive, to, toInclusive ); } } return false; }

Target:
public boolean acceptsValue( Value value ) { if ( value == null ) { return false; } if ( value instanceof PointValue ) { PointValue point = (PointValue) value; if ( point.getCRS().equals( crs ) ) { return point.withinRange( from, fromInclusive, to, toInclusive ); } } return false; }
Source:
public Object[] factory() { List testsToRun = new ArrayList<>(); testsToRun.add(new DistributedMultimapCacheTest().fromOwner(false).cacheMode(CacheMode.DIST_SYNC).transactional(false)); testsToRun.add(new DistributedMultimapCacheTest().fromOwner(true).cacheMode(CacheMode.DIST_SYNC).transactional(false)); return testsToRun.toArray(); }

Target:
public Object[] factory() { return new Object[]{ new DistributedMultimapCacheTest().fromOwner(false).cacheMode(CacheMode.DIST_SYNC).transactional(false), new DistributedMultimapCacheTest().fromOwner(true).cacheMode(CacheMode.DIST_SYNC).transactional(false), }; }
Source:
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); menu.findItem(R.id.menu_edit).setVisible(false); menu.findItem(R.id.menu_preview).setVisible(true); if (TextUtils.isEmpty(searchQuery)) { searchMenuItem.collapseActionView(); } }

Target:
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); menu.findItem(R.id.menu_edit).setVisible(false); menu.findItem(R.id.menu_preview).setVisible(true); }
Source:
public void teardown() throws Exception { if (ddbms != null) { S3GuardTableAccess tableAccess = new S3GuardTableAccess(ddbms); ExpressionSpecBuilder builder = new ExpressionSpecBuilder(); builder.withKeyCondition( ExpressionSpecBuilder.S(PARENT).beginsWith("/test/")); Iterable<DDBPathMetadata> entries = tableAccess.scanMetadata(builder); List<Path> list = new ArrayList<>(); entries.iterator().forEachRemaining(e -> { if (!(e instanceof S3GuardTableAccess.VersionMarker)) { Path p = e.getFileStatus().getPath(); LOG.info("Deleting {}", p); list.add(p); } }); tableAccess.delete(list); } IOUtils.cleanupWithLogger(LOG, ddbms); super.teardown(); }

Target:
public void teardown() throws Exception { if (ddbms != null) { S3GuardTableAccess tableAccess = new S3GuardTableAccess(ddbms); ExpressionSpecBuilder builder = new ExpressionSpecBuilder(); builder.withCondition( ExpressionSpecBuilder.S(PARENT).beginsWith("/test/")); Iterable<DDBPathMetadata> entries = tableAccess.scanMetadata(builder); List<Path> list = new ArrayList<>(); entries.iterator().forEachRemaining(e -> { Path p = e.getFileStatus().getPath(); LOG.info("Deleting {}", p); list.add(p); }); tableAccess.delete(list); } IOUtils.cleanupWithLogger(LOG, ddbms); super.teardown(); }
Source:
protected OptionStatus getConcreteEnumCustom(MCOptionStatus abstracted) { if(Static.getServer().getMinecraftVersion().lt(MCVersion.MC1_9_4)) { return null; } return super.getConcreteEnumCustom(abstracted); }

Target:
protected OptionStatus getConcreteEnumCustom(MCOptionStatus abstracted) { if(Static.getServer().getMinecraftVersion().lt(MCVersion.MC1_9)) { return null; } return super.getConcreteEnumCustom(abstracted); }
Source:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRestoreSnapshotCommand())) { restoreSnapshot(); } else if (command.getName().equals("onRestoreSnapshot")) { onRestoreSnapshot(); } else if (command.equals(getDeleteSnapshotCommand())) { deleteSnapshot(); } else if (command.getName().equals("onDeleteSnapshot")) { onDeleteSnapshot(); } else if (command.equals(getDeleteAllSnapshotsCommand())) { deleteAllSnapshots(); } else if (command.getName().equals("onDeleteAllSnapshots")) { onDeleteAllSnapshots(); } else if (command.equals(getActivateSnapshotCommand())) { activateSnapshot(); } else if (command.getName().equals("onActivateSnapshot")) { onActivateSnapshot(); } else if (command.equals(getDeactivateSnapshotCommand())) { deactivateSnapshot(); } else if (command.getName().equals("onDeactivateSnapshot")) { onDeactivateSnapshot(); } else if (command.getName().equals("CancelConfirmation")) { setConfirmWindow(null); } }

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRestoreSnapshotCommand())) { restoreSnapshot(); } else if (command.equals(getDeleteSnapshotCommand())) { deleteSnapshot(); } else if (command.equals(getDeleteAllSnapshotsCommand())) { deleteAllSnapshots(); } else if (command.equals(getActivateSnapshotCommand())) { activateSnapshot(); } else if (command.equals(getDeactivateSnapshotCommand())) { deactivateSnapshot(); } else if (command.getName().equals("onRestoreSnapshot")) { onRestoreSnapshot(); } else if (command.getName().equals("onDeleteSnapshot")) { onDeleteSnapshot(); } else if (command.getName().equals("onDeleteAllSnapshots")) { onDeleteAllSnapshots(); } else if (command.getName().equals("onActivateSnapshot")) { onActivateSnapshot(); } else if (command.getName().equals("onDeactivateSnapshot")) { onDeactivateSnapshot(); } else if (command.getName().equals("cancelConfirmation")) { setConfirmWindow(null); } }
Source:
public void process(Exchange exchange) throws CatalogTransformerException, MimeTypeParseException, IOException { LOGGER.debug("ENTERING: process"); LOGGER.debug("exchange pattern = {}", exchange.getPattern()); Message in = exchange.getIn(); Object metacard = null; String transformerId = in.getHeader(CatalogComponent.ID_PARAMETER, String.class); String mimeType = in.getHeader(CatalogComponent.MIME_TYPE_PARAMETER, String.class); if (transformerId != null) { LOGGER.debug("transformerId retrieved from message header"); in.removeHeader(CatalogComponent.ID_PARAMETER); } else { LOGGER.debug("transformerId retrieved from CamelCatalogEndpoint"); transformerId = endpoint.getTransformerId(); } LOGGER.debug("transformerId = {}", transformerId); if (mimeType != null) { in.removeHeader(CatalogComponent.MIME_TYPE_PARAMETER); } else { LOGGER.debug("MIME Type retrieved from CamelCatalogEndpoint"); mimeType = endpoint.getMimeType(); } LOGGER.debug("MIME Type = {}", mimeType); Transform transform = endpoint.getComponent().getTransform(); if (transform != null) { LOGGER.debug("Got a Transform service"); metacard = transform(in, metacard, mimeType, transformerId); } else { LOGGER.debug("Did not find a Transform service"); throw new CatalogTransformerException("Did not find a Transform service"); } exchange.getOut().setBody(metacard); LOGGER.debug("EXITING: process"); }

Target:
public void process(Exchange exchange) throws CatalogTransformerException, MimeTypeParseException, IOException { LOGGER.debug("ENTERING: process"); LOGGER.debug("exchange pattern = {}", exchange.getPattern()); Message in = exchange.getIn(); Object metacard = null; String transformerId = in.getHeader(CatalogComponent.ID_PARAMETER, String.class); String mimeType = in.getHeader(CatalogComponent.MIME_TYPE_PARAMETER, String.class); if (transformerId != null) { LOGGER.debug("transformerId retrieved from message header"); in.removeHeader(CatalogComponent.ID_PARAMETER); } else { LOGGER.debug("transformerId retrieved from CamelCatalogEndpoint"); transformerId = endpoint.getTransformerId(); } LOGGER.debug("transformerId = {}", transformerId); if (mimeType != null) { in.removeHeader(CatalogComponent.MIME_TYPE_PARAMETER); } else { LOGGER.debug("MIME Type retrieved from CamelCatalogEndpoint"); mimeType = endpoint.getMimeType(); } LOGGER.debug("MIME Type = {}", mimeType); Transform transform = endpoint.getComponent().getTransform(); if (transform != null) { LOGGER.trace("Got a Transform service"); metacard = transform(in, metacard, mimeType, transformerId); } else { throw new CatalogTransformerException("Did not find a Transform service"); } exchange.getOut().setBody(metacard); LOGGER.debug("EXITING: process"); }
Source:
public void delete(Long id) { Page page = pageRepository.findById(id).orElseThrow(() -> new RestException("Not found", 404)); Long publicationId = page.getPublication().getId(); List<PageId> order = pageRepository.getPageOrderByPublicationId(publicationId); order.remove(new PageId(id)); setPageOrder(order, publicationId); messagingService.broadcastEntityAction(page, Action.DELETE); pageRepository.deleteById(id); }

Target:
public void delete(Long id) { Page page = pageRepository.findById(id).orElseThrow(() -> new RestException("Not found", HttpServletResponse.SC_NOT_FOUND)); Long publicationId = page.getPublication().getId(); List<PageId> order = pageRepository.getPageOrderByPublicationId(publicationId); order.remove(new PageId(id)); setPageOrder(order, publicationId); messagingService.broadcastEntityAction(page, Action.DELETE); pageRepository.deleteById(id); }
Source:
public void testBorrow() throws Exception { AsyncQueue<Integer> queue = new AsyncQueue<>(4, executor); queue.offer(1); queue.offer(2); queue.offer(3); queue.offer(4); queue.offer(5); Runnable runnable = () -> { for (int i = 0; i < 700; i++) { getFutureValue(queue.borrowBatchAsync(3, elements -> new BorrowResult<>(elements, null))); } }; Future<?> future1 = executor.submit(runnable); Future<?> future2 = executor.submit(runnable); Future<?> future3 = executor.submit(runnable); future1.get(); future2.get(); future3.get(); queue.finish(); assertFalse(queue.isFinished()); AtomicBoolean done = new AtomicBoolean(); executor.submit(() -> { if (!done.get()) { assertFalse(queue.isFinished()); } }); future1 = executor.submit(runnable); future2 = executor.submit(runnable); future3 = executor.submit(runnable); future1.get(); future2.get(); future3.get(); done.set(true); assertFalse(queue.isFinished()); ArrayList<Integer> list = new ArrayList<>(queue.getBatchAsync(100).get()); list.sort(Integer::compare); assertEquals(list, ImmutableList.of(1, 2, 3, 4, 5)); assertTrue(queue.isFinished()); }

Target:
public void testBorrow() throws Exception { AsyncQueue<Integer> queue = new AsyncQueue<>(4, executor); queue.offer(1); queue.offer(2); queue.offer(3); queue.offer(4); queue.offer(5); Runnable runnable = () -> { for (int i = 0; i < 700; i++) { getFutureValue(queue.borrowBatchAsync(3, elements -> new BorrowResult<>(elements, null))); } }; Future<?> future1 = executor.submit(runnable); Future<?> future2 = executor.submit(runnable); Future<?> future3 = executor.submit(runnable); future1.get(); future2.get(); future3.get(); queue.finish(); assertFalse(queue.isFinished()); AtomicBoolean done = new AtomicBoolean(); executor.submit(() -> { while (!done.get()) { assertFalse(queue.isFinished() || done.get()); } }); future1 = executor.submit(runnable); future2 = executor.submit(runnable); future3 = executor.submit(runnable); future1.get(); future2.get(); future3.get(); done.set(true); assertFalse(queue.isFinished()); ArrayList<Integer> list = new ArrayList<>(queue.getBatchAsync(100).get()); list.sort(Integer::compare); assertEquals(list, ImmutableList.of(1, 2, 3, 4, 5)); assertTrue(queue.isFinished()); }
Source:
public CrewMember translateLegacyCrewMember(org.atlasapi.media.entity.CrewMember legacy) { if(! legacy.getClass().getName().equals("org.atlasapi.media.entity.CrewMember")) { log.warn("Generic legacy CrewMember type: class={} id={} name='{}' role='{}', best effort migration", Objects.toString(legacy.getClass().getName(), "unidentifed"), Objects.toString(legacy.getId(), "?"), Objects.toString(legacy.name(), "?"), Objects.toString(legacy.role(), "?") ); } CrewMember translated = new CrewMember(legacy.getCanonicalUri(), legacy.getCurie(), legacy.publisher()); addIdentified(legacy, translated); addCrewMember(legacy, translated); return translated; }

Target:
public CrewMember translateLegacyCrewMember(org.atlasapi.media.entity.CrewMember legacy) { if (legacy.getClass() != org.atlasapi.media.entity.CrewMember.class) { log.warn("Generic legacy CrewMember type: class={} id={} name='{}' role='{}', best effort migration", Objects.toString(legacy.getClass().getName(), "unidentifed"), Objects.toString(legacy.getId(), "?"), Objects.toString(legacy.name(), "?"), Objects.toString(legacy.role(), "?") ); } CrewMember translated = new CrewMember(legacy.getCanonicalUri(), legacy.getCurie(), legacy.publisher()); addIdentified(legacy, translated); addCrewMember(legacy, translated); return translated; }
Source:
public void createsRedirectResponseWithURL() throws IOException { final String url = "/about"; MatcherAssert.assertThat( new RsPrint( new TkRedirect(url).act() ).print(), Matchers.equalTo( Joiner.on(NEWLINE).join( "HTTP/1.1 303 See Other", LOCATION + url, "", "" ) ) ); }

Target:
public void createsRedirectResponseWithURL() throws IOException { final String url = "/about"; MatcherAssert.assertThat( new RsPrint( new TkRedirect(url).act() ).print(), Matchers.equalTo( Joiner.on(TkRedirectTest.NEWLINE).join( "HTTP/1.1 303 See Other", String.format(TkRedirectTest.LOCATION, url), "", "" ) ) ); }
Source:
public ListBranchesResult call() throws NoSuchProjectException, IOException { ProjectControl pctl = projectControlFactory.validateFor(projectName, ProjectControl.OWNER | ProjectControl.VISIBLE); try { List<Branch> branches = Lists.newArrayList(); List<BranchInfo> branchInfos = listBranchesProvider.get().apply(new ProjectResource(pctl)); for (BranchInfo info : branchInfos) { Branch b = new Branch(new Branch.NameKey(projectName, info.ref)); b.setRevision(new RevId(info.revision)); b.setCanDelete(info.canDelete != null ? true : false); branches.add(b); } return new ListBranchesResult(branches, pctl.canAddRefs(), false); } catch (ResourceNotFoundException e) { throw new NoSuchProjectException(projectName); } }

Target:
public ListBranchesResult call() throws NoSuchProjectException, IOException { ProjectControl pctl = projectControlFactory.validateFor(projectName, ProjectControl.OWNER | ProjectControl.VISIBLE); try { List<Branch> branches = Lists.newArrayList(); List<BranchInfo> branchInfos = listBranchesProvider.get().apply(new ProjectResource(pctl)); for (BranchInfo info : branchInfos) { Branch b = new Branch(new Branch.NameKey(projectName, info.ref)); b.setRevision(new RevId(info.revision)); b.setCanDelete(Objects.firstNonNull(info.canDelete, false)); branches.add(b); } return new ListBranchesResult(branches, pctl.canAddRefs(), false); } catch (ResourceNotFoundException e) { throw new NoSuchProjectException(projectName); } }
Source:
private static ExpressionTree getActualArgument(MethodInvocationTree mit) { int arity = mit.arguments().size(); ExpressionTree arg = mit.arguments().get(arity - 1); if (arity > 2 && (arity == 4 || mit.arguments().stream().allMatch(AssertionArgumentOrderCheck::isDouble))) { arg = mit.arguments().get(arity - 2); } return arg; }

Target:
private static ExpressionTree getActualArgument(MethodInvocationTree mit) { int arity = mit.arguments().size(); ExpressionTree arg = mit.arguments().get(arity - 1); if (arity > 2 && (arity == 4 || mit.arguments().stream().allMatch(AssertionArgumentOrderCheck::isDoubleOrFloat))) { arg = mit.arguments().get(arity - 2); } return arg; }
Source:
protected int getNextVersionNumer(Context c, VersionHistory vh) throws SQLException { TableRow row = DatabaseManager.querySingle(c, "SELECT (COALESCE(MAX(" + VersionDAO.VERSION_NUMBER + "), 0) + 1)" + " AS nextversionnumber FROM " + VersionDAO.TABLE_NAME + " WHERE " + VersionDAO.HISTORY_ID +" = ?", vh.getVersionHistoryId()); int next = row.getIntColumn("nextversionnumber"); if (vh.getLatestVersion() != null && vh.getLatestVersion().getVersionNumber() >= next) { log.debug("New version number: vh.getLatest....getVersionNumber... = " + Integer.toString(vh.getLatestVersion().getVersionNumber() + 1)); return vh.getLatestVersion().getVersionNumber() + 1; } log.debug("New version number: " + Integer.toString(next)); return next; }

Target:
protected int getNextVersionNumer(Context c, VersionHistory vh) throws SQLException{ int next = versionDAO.getNextVersionNumber(c, vh); if (versionHistoryService.getLatestVersion(c, vh) != null && versionHistoryService.getLatestVersion(c, vh).getVersionNumber() >= next) { next = versionHistoryService.getLatestVersion(c, vh).getVersionNumber() + 1; } return next; }
Source:
public String getAddonText() { return addonText; }

Target:
public String getAddonText() { return NLS.smartGet(addonText); }
Source:
public void onClick(View v) { if (listItemClickListener != null) { int position = getAdapterPosition(); if (position != RecyclerView.NO_POSITION) { listItemClickListener.onItemClick(position); } } }

Target:
public void onClick(View v) { listItemClickListener.onItemClick(position); }
Source:
String getDownloadAnalyticsEvent(int downloadedFormCount) { return downloadedFormCount == 0 ? FIRST_FORM_DOWNLOAD : SUBSEQUENT_FORM_DOWNLOAD; }

Target:
private String getDownloadAnalyticsEvent(int downloadedFormCount) { return downloadedFormCount == 0 ? FIRST_FORM_DOWNLOAD : SUBSEQUENT_FORM_DOWNLOAD; }
Source:
public void setUp() throws Exception { testContext = getInstrumentation().getContext(); }

Target:
public void setUp() throws Exception { super.setUp(); testContext = getInstrumentation().getContext(); }
Source:
public UnusedPrivateFieldRule() throws ClassNotFoundException { NEGLECT_ANNOTATIONS_TYPE.add(Class.forName("javafx.fxml.FXML")); }

Target:
public UnusedPrivateFieldRule() { definePropertyDescriptor(IGNORED_ANNOTATIONS_DESCRIPTOR); }
Source:
public TableBuilderComponentObject clickAddTableButton(){ waitForElementClickableByElement(addTableButton); addTableButton.click(); PageObjectLogging.log("addTable", "add table button clicked", true); return new TableBuilderComponentObject(driver); }

Target:
public TableBuilderComponentObject clickAddTableButton(){ addTableButton.click(); PageObjectLogging.log("addTable", "add table button clicked", true); return new TableBuilderComponentObject(driver); }
Source:
public void handlePushNotificationAlarm(final DeviceMessageMetadata deviceMessageMetadata, final PushNotificationAlarmDto pushNotificationAlarm) { LOGGER.info("handlePushNotificationAlarm for MessageType: {}", deviceMessageMetadata.getMessageType()); final PushNotificationAlarm pushNotificationAlarmDomain = this.mapperFactory.getMapperFacade() .map(pushNotificationAlarm, PushNotificationAlarm.class); this.webServiceResponseMessageSender.send( ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()) .withResult(ResponseMessageResultType.OK).withDataObject(pushNotificationAlarmDomain) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handlePushNotificationAlarm(final DeviceMessageMetadata deviceMessageMetadata, final PushNotificationAlarmDto pushNotificationAlarm) { LOGGER.info("handlePushNotificationAlarm for MessageType: {}", deviceMessageMetadata.getMessageType()); final PushNotificationAlarm pushNotificationAlarmDomain = this.mapperFactory.getMapperFacade() .map(pushNotificationAlarm, PushNotificationAlarm.class); final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()) .withResult(ResponseMessageResultType.OK).withDataObject(pushNotificationAlarmDomain) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
public QuotaDAO getQuotaDAO() { return DbFacade.getInstance() .getQuotaDao(); }

Target:
protected QuotaDAO getQuotaDAO() { return DbFacade.getInstance().getQuotaDao(); }
Source:
public Builder addOptions(String... keyValuePairs) { Preconditions.checkArgument(keyValuePairs.length % 2 == 0, "Require an even number of arguments, got %s", keyValuePairs.length); for (int i = 0; i < keyValuePairs.length; i += 2) { addOption(keyValuePairs[i], keyValuePairs[i + 1]); } return this; }

Target:
public Builder addOptions(String... keyValuePairs) { Preconditions.checkArgument(keyValuePairs.length % 2 == 0 && keyValuePairs.length > 0, "Require an even, positive number of arguments, got %s", keyValuePairs.length); for (int i = 0; i < keyValuePairs.length; i += 2) { addOption(keyValuePairs[i], keyValuePairs[i + 1]); } return this; }
Source:
public void checkForMultipleRecordsPerformsCorrectly() throws QueryException, XWikiRestException { Query q = mock(DefaultQuery.class); doReturn(q).when(this.qm) .createQuery("where doc.object(PhenoTips.PatientClass).external_id = :eid", Query.XWQL); List<String> results = new ArrayList<>(); results.add(this.eid); results.add(this.eid); doReturn(results).when(q).execute(); when(this.repository.getPatientByExternalId(this.eid)).thenReturn(null); Response response = this.component.getPatient(this.eid); verify(this.logger).debug("Retrieving patient record with external ID via REST", this.eid); verify(this.logger).debug("Multiple patient records ({}) with external ID [{}]: {}", 2, this.eid, results); assertEquals(300, response.getStatus()); }

Target:
public void checkForMultipleRecordsPerformsCorrectly() throws QueryException { Query q = mock(DefaultQuery.class); doReturn(q).when(this.qm) .createQuery("where doc.object(PhenoTips.PatientClass).external_id = :eid", Query.XWQL); List<String> results = new ArrayList<>(); results.add(this.eid); results.add(this.eid); doReturn(results).when(q).execute(); when(this.repository.getPatientByExternalId(this.eid)).thenReturn(null); Response responseGet = this.component.getPatient(this.eid); Response responseUpdate = this.component.updatePatient(this.eid, this.eid); Response responseDelete = this.component.deletePatient(this.eid); verify(this.logger, times(3)).debug("Multiple patient records ({}) with external ID [{}]: {}", 2, this.eid, results); verify(this.factory, times(3)).createAlternatives(anyListOf(String.class), eq(this.uriInfo)); assertEquals(300, responseGet.getStatus()); assertEquals(300, responseUpdate.getStatus()); assertEquals(300, responseDelete.getStatus()); }
Source:
private static void checkMethods(FunctionDef suspiciousMethod, List<FunctionDef> methods, int index, SubscriptionContext ctx) { StatementList suspiciousBody = suspiciousMethod.body(); if (isException(suspiciousMethod)) { return; } for (int j = 0; j < index; j++) { FunctionDef originalMethod = methods.get(j); Tree originalBody = originalMethod.body(); if (CheckUtils.areEquivalent(originalBody, suspiciousBody)) { int line = originalMethod.name().firstToken().line(); String message = String.format(MESSAGE, originalMethod.name().name(), line); ctx.addIssue(suspiciousMethod.name(), message).secondary(IssueLocation.preciseLocation(originalMethod.name(), "Original")); break; } } }

Target:
private static void checkMethods(FunctionDef suspiciousMethod, List<FunctionDef> methods, int index, SubscriptionContext ctx) { StatementList suspiciousBody = suspiciousMethod.body(); if (isException(suspiciousMethod)) { return; } for (int j = 0; j < index; j++) { FunctionDef originalMethod = methods.get(j); Tree originalBody = originalMethod.body(); if (CheckUtils.areEquivalent(originalBody, suspiciousBody)) { int line = originalMethod.name().firstToken().line(); String message = String.format(MESSAGE, originalMethod.name().name(), line); ctx.addIssue(suspiciousMethod.name(), message).secondary(originalMethod.name(), "Original"); break; } } }
Source:
public <T> void put(String family, String qualifier, long timestamp, T value) throws IOException { final KijiColumnName kijiColumnName = new KijiColumnName(family, qualifier); final HBaseColumnName columnName = mTranslator.toHBaseColumnName(kijiColumnName); final CellSpec cellSpec = mTable.getLayout().getCellSpec(kijiColumnName) .setSchemaTable(mTable.getKiji().getSchemaTable()); final KijiCellEncoder cellEncoder = DefaultKijiCellEncoderFactory.get().create(cellSpec); final byte[] encoded = cellEncoder.encode(value); mLGNames.add(mTable.getLayout().getFamilyMap().get(family).getLocalityGroup().getName()); mHopper.add(new KeyValue( mId, columnName.getFamily(), columnName.getQualifier(), timestamp, encoded)); }

Target:
public <T> void put(String family, String qualifier, long timestamp, T value) throws IOException { Preconditions.checkState(mPut != null, "calls to put() must be between calls to begin() and " + "commit(), checkAndCommit(), or rollback()"); final KijiColumnName kijiColumnName = new KijiColumnName(family, qualifier); final HBaseColumnName columnName = mTranslator.toHBaseColumnName(kijiColumnName); final CellSpec cellSpec = mTable.getLayout().getCellSpec(kijiColumnName) .setSchemaTable(mTable.getKiji().getSchemaTable()); final KijiCellEncoder cellEncoder = DefaultKijiCellEncoderFactory.get().create(cellSpec); final byte[] encoded = cellEncoder.encode(value); mLGNames.add(mTable.getLayout().getFamilyMap().get(family).getLocalityGroup().getName()); mHopper.add(new KeyValue( mId, columnName.getFamily(), columnName.getQualifier(), timestamp, encoded)); }
Source:
public void addRow(List<CellData> cells, boolean isHeader) { if (batchRequest == null) { batchRequest = new Request(); rows = new ArrayList<RowData>(BATCH_SIZE); } List<com.google.api.services.sheets.v4.model.CellData> cellDatas = new ArrayList<com.google.api.services.sheets.v4.model.CellData>(); RowData rowData = new RowData(); for (int c = 0; c < cells.size(); c++) { CellData cellData = cells.get(c); if (cellData != null && cellData.text != null) { cellDatas.add(cellData2sheetCellData(cellData)); } } rowData.setValues(cellDatas); rows.add(rowData); row++; if (row % BATCH_SIZE == 0) { sendBatch(rows); } }

Target:
public void addRow(List<CellData> cells, boolean isHeader) { if (batchRequest == null) { batchRequest = new Request(); rows = new ArrayList<RowData>(BATCH_SIZE); } List<com.google.api.services.sheets.v4.model.CellData> cellDatas = new ArrayList<>(); RowData rowData = new RowData(); for (int c = 0; c < cells.size(); c++) { CellData cellData = cells.get(c); if (cellData != null && cellData.text != null) { cellDatas.add(cellData2sheetCellData(cellData)); } } rowData.setValues(cellDatas); rows.add(rowData); row++; if (row % BATCH_SIZE == 0) { sendBatch(rows); } }
Source:
public synchronized <S> S getBusinessObject(Class<S> businessInterfaceType) { if (isRemoved()) { throw new NoSuchEJBException("EJB has been removed"); } final String businessInterfaceName = businessInterfaceType.getName(); ManagedReference managedReference = null; if (businessInterfaceToReference == null) { businessInterfaceToReference = new HashMap<String, ManagedReference>(); } else { managedReference = businessInterfaceToReference.get(businessInterfaceName); } if (managedReference == null) { if (viewServices.containsKey(businessInterfaceType)) { final ServiceController<?> serviceController = currentServiceContainer().getRequiredService( viewServices.get(businessInterfaceType)); final ComponentView view = (ComponentView) serviceController.getValue(); try { managedReference = view.createInstance(Collections.<Object, Object> singletonMap(SessionID.class, id)); businessInterfaceToReference.put(businessInterfaceName, managedReference); } catch (Exception e) { throw new RuntimeException(e); } } else { throw WeldLogger.ROOT_LOGGER .viewNotFoundOnEJB(businessInterfaceType.getName(), ejbComponent.getComponentName()); } } return (S) managedReference.getInstance(); }

Target:
public synchronized <S> S getBusinessObject(Class<S> businessInterfaceType) { if (isRemoved()) { WeldEjbLogger.ROOT_LOGGER.ejbHashBeenRemoved(ejbComponent); } final String businessInterfaceName = businessInterfaceType.getName(); ManagedReference managedReference = null; if (businessInterfaceToReference == null) { businessInterfaceToReference = new HashMap<String, ManagedReference>(); } else { managedReference = businessInterfaceToReference.get(businessInterfaceName); } if (managedReference == null) { if (viewServices.containsKey(businessInterfaceType)) { final ServiceController<?> serviceController = currentServiceContainer().getRequiredService( viewServices.get(businessInterfaceType)); final ComponentView view = (ComponentView) serviceController.getValue(); try { managedReference = view.createInstance(Collections.<Object, Object> singletonMap(SessionID.class, id)); businessInterfaceToReference.put(businessInterfaceName, managedReference); } catch (Exception e) { throw new RuntimeException(e); } } else { throw WeldLogger.ROOT_LOGGER .viewNotFoundOnEJB(businessInterfaceType.getName(), ejbComponent.getComponentName()); } } return (S) managedReference.getInstance(); }
Source:
public void run() { while (!stop) { CastChannel.CastMessage message = null; try { message = read(); if (message.getPayloadType() == CastChannel.CastMessage.PayloadType.STRING) { final String jsonMSG = message.getPayloadUtf8().replaceFirst("\"type\"", "\"responseType\""); if (!jsonMSG.contains("responseType")) { LOG.warn(" <-- {Skipping}", jsonMSG); continue; } Response parsed = jsonMapper.readValue(jsonMSG, Response.class); if (parsed.requestId != null) { ResultProcessor rp = requests.remove(parsed.requestId); if (rp != null) { rp.put(parsed); } else { if (parsed.requestId != 0) { LOG.warn("Unable to process request ID = {}, data: {}", parsed.requestId, jsonMSG); } } } else if (parsed instanceof Response.Ping) { write("urn:x-cast:com.google.cast.tp.heartbeat", Message.pong(), DEFAULT_RECEIVER_ID); } } else { LOG.warn("Received unexpected message", message.getPayloadType()); } } catch (InvalidProtocolBufferException ipbe) { LOG.debug("Error while processing protobuf: {}", ipbe.getLocalizedMessage()); } catch (IOException ioex) { LOG.warn("Error while reading: {}", ioex.getLocalizedMessage()); LOG.warn(" <-- {}", message.getPayloadUtf8()); } } }

Target:
public void run() { while (!stop) { CastChannel.CastMessage message = null; try { message = read(); if (message.getPayloadType() == CastChannel.CastMessage.PayloadType.STRING) { LOG.debug(" <-- {}", message.getPayloadUtf8()); final String jsonMSG = message.getPayloadUtf8().replaceFirst("\"type\"", "\"responseType\""); if (!jsonMSG.contains("responseType")) { LOG.warn(" <-- {Skipping}", jsonMSG); continue; } Response parsed = jsonMapper.readValue(jsonMSG, Response.class); if (parsed.requestId != null) { ResultProcessor rp = requests.remove(parsed.requestId); if (rp != null) { rp.put(parsed); } else { if (parsed.requestId != 0) { LOG.warn("Unable to process request ID = {}, data: {}", parsed.requestId, jsonMSG); } } } else if (parsed instanceof Response.Ping) { write("urn:x-cast:com.google.cast.tp.heartbeat", Message.pong(), DEFAULT_RECEIVER_ID); } } else { LOG.warn("Received unexpected message", message.getPayloadType()); } } catch (InvalidProtocolBufferException ipbe) { LOG.debug("Error while processing protobuf: {}", ipbe.getLocalizedMessage()); } catch (IOException ioex) { LOG.warn("Error while reading: {}", ioex.getLocalizedMessage()); String temp; if (message != null && message.getPayloadUtf8() != null) { temp = message.getPayloadUtf8(); } else { temp = " null payload in message ";} LOG.warn(" <-- {}", temp); } } }
Source:
public void testAssignSplitsFromCoordinatorExecutor() throws ExecutionException, InterruptedException, IOException { testAssignSplits(true); }

Target:
public void testAssignSplitsFromCoordinatorExecutor() throws Exception { testAssignSplits(true); }
Source:
public void parentTheme_isApplied() { open(); checkLogsForErrors(); Assert.assertEquals( "Color from parent theme should be applied.", "rgba(0, 255, 255, 1)", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("color")); Assert.assertEquals( "Color from parent theme should be applied.", "5px", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("margin")); }

Target:
public void parentTheme_isApplied() { open(); checkLogsForErrors(); Assert.assertEquals( "Color from parent theme should be applied.", "rgba(0, 255, 255, 1)", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("color")); Assert.assertEquals( "Child theme should override parent theme values", "5px", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("margin")); Assert.assertEquals( "Child theme values should be applied", "5px", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("padding")); TestBenchElement myField = $(TestBenchElement.class).id(MY_POLYMER_ID); TestBenchElement input = myField.$(TestBenchElement.class) .id("vaadin-text-field-input-0"); Assert.assertEquals("Polymer text field should get parent border radius", "0px", input.getCssValue("border-radius")); Assert.assertEquals("Polymer text field should use green as color", "rgba(0, 128, 0, 1)", input.getCssValue("color")); }