auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void assertBucketFilter(Plan plan, String tableName, int readBucketCount, Set<Integer> bucketsToKeep) { TableScanNode tableScan = searchFrom(plan.getRoot()) .where(node -> isTableScanNode(node, tableName)) .findOnlyElement(); assertTrue(tableScan.getTable().getLayout().isPresent()); HiveTableLayoutHandle layoutHandle = (HiveTableLayoutHandle) tableScan.getTable().getLayout().get(); assertEquals(layoutHandle.getBucketHandle().get().getReadBucketCount(), readBucketCount); assertEquals(layoutHandle.getBucketFilter().get().getBucketsToKeep(), bucketsToKeep); }

Target:
private void assertBucketFilter(Plan plan, String tableName, int readBucketCount, Set<Integer> bucketsToKeep) { TableScanNode tableScan = searchFrom(plan.getRoot()) .where(node -> isTableScanNode(node, tableName)) .findOnlyElement(); assertTrue(tableScan.getTable().getLayout().isPresent()); HiveTableLayoutHandle layoutHandle = (HiveTableLayoutHandle) tableScan.getTable().getLayout().get(); assertTrue(layoutHandle.getBucketHandle().isPresent()); assertTrue(layoutHandle.getBucketFilter().isPresent()); assertEquals(layoutHandle.getBucketHandle().get().getReadBucketCount(), readBucketCount); assertEquals(layoutHandle.getBucketFilter().get().getBucketsToKeep(), bucketsToKeep); }
Source:
protected void handleConnectionSelected() throws CoreException { final boolean enabled = fWidgetListener.isEnabled(); fWidgetListener.disable(); IRemoteConnection selectedConnection = null; if (fLocalButton != null && fLocalButton.getSelection()) { selectedConnection = fRemoteServicesManager.getLocalConnectionType().getConnections().get(0); } else { int currentSelection = fConnectionCombo.getSelectionIndex(); if (currentSelection > 0) { String connectionName = fConnectionCombo.getItem(currentSelection); selectedConnection = getSelectedConnectionType().getConnection(connectionName); } } if (selectedConnection == null || fSelectedConnection == null || !selectedConnection.getName().equals(fSelectedConnection.getName())) { fSelectedConnection = selectedConnection; Event evt = new Event(); evt.widget = this; notifyListeners(new SelectionEvent(evt)); } fWidgetListener.setEnabled(enabled); }

Target:
protected void handleConnectionSelected() { final boolean enabled = fWidgetListener.isEnabled(); fWidgetListener.disable(); IRemoteConnection selectedConnection = null; if (fLocalButton != null && fLocalButton.getSelection()) { selectedConnection = fRemoteServicesManager.getLocalConnectionType().getConnections().get(0); } else { int currentSelection = fConnectionCombo.getSelectionIndex(); if (currentSelection > 0) { String connectionName = fConnectionCombo.getItem(currentSelection); selectedConnection = getSelectedConnectionType().getConnection(connectionName); } } if (selectedConnection == null || fSelectedConnection == null || !selectedConnection.getName().equals(fSelectedConnection.getName())) { fSelectedConnection = selectedConnection; Event evt = new Event(); evt.widget = this; notifyListeners(new SelectionEvent(evt)); } fWidgetListener.setEnabled(enabled); }
Source:
public void openTsView_navigateToFlow_navigationSuccessful() { getDriver().get(getRootURL() + "/"); waitForDevServer(); waitUntil( input -> getInShadowRoot(findElement(By.tagName("about-view")), By.id("navigate-hello")).isDisplayed()); getInShadowRoot(findElement(By.tagName("about-view")), By.id("navigate-hello")).click(); Assert.assertThat(getDriver().getCurrentUrl(), CoreMatchers.endsWith("/hello")); }

Target:
public void openTsView_navigateToFlow_navigationSuccessful() { getDriver().get(getRootURL() + "/"); waitForDevServer(); waitUntil(input -> $("about-view").first().$("a").id("navigate-hello") .isDisplayed()); getInShadowRoot(findElement(By.tagName("about-view")), By.id("navigate-hello")).click(); Assert.assertThat(getDriver().getCurrentUrl(), CoreMatchers.endsWith("/hello")); Assert.assertTrue("Missing expected native button on page", $(NativeButtonElement.class).id(NAVIGATE_ABOUT).isDisplayed()); }
Source:
protected boolean inForceMode() { if (toPrompt == null) { refreshPromptObject(); } return toPrompt.isForced(); }

Target:
protected boolean inForceMode() { if (toPrompt != null) { return toPrompt.isForced(); } return false; }
Source:
public Guid getQuotaIdToConsume(Guid quotaId, storage_pool storagePool) { Guid returnedQuotaGuid = quotaId; if (storagePool == null) { log.errorFormat("Storage pool Id is null, Quota id will be set from the parameter"); } else { if (storagePool.getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED) { log.debugFormat("Storage pool quota is disabled, Quota id which will be consume from is the default DC quota"); returnedQuotaGuid = DbFacade.getInstance() .getQuotaDAO() .getDefaultQuotaByStoragePoolId(storagePool.getId()) .getId(); } } return returnedQuotaGuid; }

Target:
public Guid getQuotaIdToConsume(Guid quotaId, storage_pool storagePool) { Guid returnedQuotaGuid = quotaId; if (storagePool == null) { log.errorFormat("Storage pool is null, Quota id will be set from the parameter"); } else if (storagePool.getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED) { log.debugFormat("Storage pool quota is disabled, Quota id which will be consume from is the default DC quota"); returnedQuotaGuid = getQuotaDAO() .getDefaultQuotaByStoragePoolId(storagePool.getId()) .getId(); } return returnedQuotaGuid; }
Source:
public void deregister() { if ((getChartViewer().getControl() != null) && !getChartViewer().getControl().isDisposed()) { getChart().getPlotArea().removeMouseTrackListener(this); } }

Target:
public void deregister() { if ((getChartViewer().getControl() != null) && !getChartViewer().getControl().isDisposed()) { fToolTipHandler.deactivateHoverHelp(getChart().getPlotArea()); } }
Source:
public static void startLatency(Object messageId) { startTimestampPerId.put(messageId, System.nanoTime()); }

Target:
public void startLatency(Object messageId) { startTimestampPerId.put(messageId, System.nanoTime()); }
Source:
public Collection<MailAddress> match(Mail mail) throws MessagingException { Object exceptionValue = mail.getAttribute(Mail.MAILET_ERROR_ATTRIBUTE_NAME); if (exceptionValue != null && exceptionClass.isAssignableFrom(exceptionValue.getClass())) { return mail.getRecipients(); } else { return null; } }

Target:
public Collection<MailAddress> match(Mail mail) throws MessagingException { Object exceptionValue = mail.getAttribute(Mail.MAILET_ERROR_ATTRIBUTE_NAME); if (exceptionValue != null && exceptionClass.isAssignableFrom(exceptionValue.getClass())) { return mail.getRecipients(); } else { return ImmutableList.of(); } }
Source:
public void testMergeabilityOfChangesbyBranch() { try { List<Change> changes = schema.changes().byProject(destBranch.getParentKey()).toList(); for (Change change : changes) { if ((destBranch.equals(change.getDest())) && (change.getStatus() == Change.Status.NEW)) { testMergeQueue.addToQueue(change); } } testMergeQueue.consumesQueue(); } catch (OrmException e) { log.error("Test merge attempt for branch: " + destBranch.get() + " failed: Not able to query database", e); } }

Target:
public void testMergeabilityOfChangesbyBranch() { try { List<Change> changes = schema.changes().allNewNotMergeable(destBranch).toList(); for (Change change : changes) { changeTestMergeQueue.add(change); } } catch (OrmException e) { log.error("Test merge attempt for branch: " + destBranch.get() + " failed: Not able to query database", e); } }
Source:
public void deleteFromTenant(String tenant) { String hql = "DELETE FROM Policy " + "WHERE internalId.tenant = :tenant_id"; Query query = this.currentSession().createQuery(hql); query.setParameter("tenant_id", tenant); int result = query.executeUpdate(); System.out.println("The result of the delete tenant is " + result); }

Target:
public void deleteFromTenant(String tenant) { String hql = "DELETE FROM Policy " + "WHERE internalId.tenant = :tenant_id"; Query query = this.currentSession().createQuery(hql); query.setParameter("tenant_id", tenant); int result = query.executeUpdate(); }
Source:
public static <T> T run(ISafeRunnableWithResult<T> code) { Assert.isNotNull(code); try { return code.runWithResult(); } catch (Exception | LinkageError | AssertionError e) { handleException(code, e); } return null; }

Target:
public static <T> T run(ISafeRunnableWithResult<T> code) { Assert.isNotNull(code); try { return code.runWithResult(); } catch (Exception | LinkageError | AssertionError e) { handleException(code, e); return null; } }
Source:
public final <U> U to(@NonNull Function<? super ParallelFlowable<T>, U> converter) { try { return converter.apply(this); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); throw ExceptionHelper.wrapOrThrow(ex); } }

Target:
public final <U> U to(@NonNull Function<? super ParallelFlowable<T>, U> converter) { try { return ObjectHelper.requireNonNull(converter, "converter is null").apply(this); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); throw ExceptionHelper.wrapOrThrow(ex); } }
Source:
public Component getContent(Project project, ExtensionUtil util) { CssLayout layout = new CssLayout(); layout.addStyleName(STYLE_ABOUT_INFOBOX); layout.setSizeFull(); String description = "No description available"; if (StringUtils.isNotBlank(project.getDescription())) { description = project.getDescription(); if (project.getDescriptionFormat().equals("text")) { description = StringEscapeUtils.escapeHtml(description); description = StringUtils.replace(description, "\n", "<br />"); } } createLabel(layout, description, STYLE_ABOUT); InfoExtension ext = project.getExtension(InfoExtension.class); if (ext != null && StringUtils.isNotBlank(ext.getPageUrl())) { createLink(layout, "Project Homepage", ext.getPageUrl(), DEFAULT_TARGET, STYLE_HOMEPAGE); } TaggingService taggingService = Services.getService(TaggingService.class); if (taggingService != null) { TagComponent tagComponent = new TagComponent(project, taggingService, util); layout.addComponent(tagComponent); } if (!util.getProjectTemplate().isHidden(Project.class.getName(), Project.PROPERTY_PHASE, util.isUserProjectAdmin(project))) { createLabel(layout, MessageFormat.format("This project is in the <b>{0}</b> phase.", project.getPhase()), STYLE_PHASE); } layout.addComponent(new Label("<div id=" + DEBUG_ID + "></div>", Label.CONTENT_XHTML)); addLastModifiedInfo(layout,getCaption(), ext); addLastModifiedInfo(layout,"Project", project); return layout; }

Target:
public Component getContent(Project project, ExtensionUtil util) { CssLayout layout = new CssLayout(); layout.addStyleName(STYLE_ABOUT_INFOBOX); layout.setSizeFull(); String description = "No description available"; if (StringUtils.isNotBlank(project.getDescription())) { description = project.getDescription(); if (project.getDescriptionFormat().equals("text")) { description = StringEscapeUtils.escapeHtml(description); description = StringUtils.replace(description, "\n", "<br />"); } } createLabel(layout, description, STYLE_ABOUT); InfoExtension ext = project.getExtension(InfoExtension.class); if (ext != null && StringUtils.isNotBlank(ext.getPageUrl())) { createLink(layout, "Project Homepage", ext.getPageUrl(), DEFAULT_TARGET, STYLE_HOMEPAGE); } TaggingService taggingService = Services.getService(TaggingService.class); if (taggingService != null) { TagComponent tagComponent = new TagComponent(project, taggingService, util); layout.addComponent(tagComponent); } if (!util.getProjectTemplate().isHidden(Project.class.getName(), Project.PROPERTY_PHASE, util.isUserProjectAdmin(project))) { createLabel(layout, MessageFormat.format("This project is in the <b>{0}</b> phase.", project.getPhase()), STYLE_PHASE); } layout.addComponent(new Label("<div id=" + DEBUG_ID + "></div>", Label.CONTENT_XHTML)); addLastModifiedInfo(layout, project); return layout; }
Source:
public OAuth2TokenValidatorResult validate(Jwt token) { Assert.notNull(token, "token cannot be null"); T claimValue = token.getClaim(this.claim); if (test.test(claimValue)) { return OAuth2TokenValidatorResult.success(); } else { if (logger.isDebugEnabled()) { logger.debug("Failed to validate OAuth2 token claim " + claim); } return OAuth2TokenValidatorResult.failure(error); } }

Target:
public OAuth2TokenValidatorResult validate(Jwt token) { Assert.notNull(token, "token cannot be null"); T claimValue = token.getClaim(this.claim); if (test.test(claimValue)) { return OAuth2TokenValidatorResult.success(); } else { if (logger.isDebugEnabled()) { logger.debug(error.getDescription()); } return OAuth2TokenValidatorResult.failure(error); } }
Source:
protected SCMRevision retrieve(@NonNull SCMHead head, @NonNull TaskListener listener) throws IOException { SVNRepositoryView repository = null; try { listener.getLogger().println("Opening connection to " + remoteBase); SVNURL repoURL = SVNURL.parseURIEncoded(remoteBase); repository = openSession(repoURL); String repoPath = SubversionSCM.DescriptorImpl.getRelativePath(repoURL, repository.getRepository()); String path = SVNPathUtil.append(repoPath, head.getName()); SVNRepositoryView.NodeEntry svnEntry = repository.getNode(path, -1); return new SCMRevisionImpl(head, svnEntry.getRevision(), (additionalCredentials.size()>0)); } catch (SVNException e) { throw new IOException(e); } finally { closeSession(repository); } }

Target:
protected SCMRevision retrieve(@NonNull SCMHead head, @NonNull TaskListener listener) throws IOException { SVNRepositoryView repository = null; try { listener.getLogger().println("Opening connection to " + remoteBase); SVNURL repoURL = SVNURL.parseURIEncoded(remoteBase); repository = openSession(repoURL); String repoPath = SubversionSCM.DescriptorImpl.getRelativePath(repoURL, repository.getRepository()); String path = SVNPathUtil.append(repoPath, head.getName()); SVNRepositoryView.NodeEntry svnEntry = repository.getNode(path, -1); return new SCMRevisionImpl(head, svnEntry.getRevision()); } catch (SVNException e) { throw new IOException(e); } finally { closeSession(repository); } }
Source:
protected List<String> listResources(JarInputStream jar, String path) throws IOException { if (!path.startsWith("/")) { path = "/" + path; } if (!path.endsWith("/")) { path = path + "/"; } List<String> resources = new ArrayList<>(); for (JarEntry entry; (entry = jar.getNextJarEntry()) != null;) { if (!entry.isDirectory()) { StringBuilder name = new StringBuilder(entry.getName()); if (!name.substring(0).startsWith("/")) { name.insert(0, '/'); } if (name.substring(0).startsWith(path)) { if (log.isDebugEnabled()) { log.debug("Found resource: " + name); } resources.add(name.substring(1)); } } } return resources; }

Target:
protected List<String> listResources(JarInputStream jar, String path) throws IOException { if (!path.startsWith("/")) { path = "/" + path; } if (!path.endsWith("/")) { path = path + "/"; } List<String> resources = new ArrayList<>(); for (JarEntry entry; (entry = jar.getNextJarEntry()) != null;) { if (!entry.isDirectory()) { StringBuilder name = new StringBuilder(entry.getName()); if (name.charAt(0) != '/') { name.insert(0, '/'); } if (name.indexOf(path) == 0) { if (log.isDebugEnabled()) { log.debug("Found resource: " + name); } resources.add(name.substring(1)); } } } return resources; }
Source:
void pollQueue() { int emitted = 0; do { counter = 1; while (!scheduledUnsubscribe.isUnsubscribed()) { if (finished) { if (error != null) { child.onError(error); return; } else if (queue.isEmpty()) { child.onCompleted(); return; } } if (REQUESTED.getAndDecrement(this) != 0) { Object o = queue.poll(); if (o == null) { if (finished) { if (error != null) { child.onError(error); return; } else if (queue.isEmpty()) { child.onCompleted(); return; } } REQUESTED.incrementAndGet(this); break; } else { if (!on.accept(child, o)) { emitted++; } } } else { REQUESTED.incrementAndGet(this); break; } } } while (COUNTER_UPDATER.decrementAndGet(this) > 0); if (emitted > 0) { request(emitted); } }

Target:
void pollQueue() { int emitted = 0; do { counter = 1; long produced = 0; long r = requested; while (!child.isUnsubscribed()) { Throwable error; if (finished) { if ((error = this.error) != null) { queue.clear(); child.onError(error); return; } else if (queue.isEmpty()) { child.onCompleted(); return; } } if (r > 0) { Object o = queue.poll(); if (o != null) { child.onNext(on.getValue(o)); r--; emitted++; produced++; } else { break; } } else { break; } } if (produced > 0 && requested != Long.MAX_VALUE) { REQUESTED.addAndGet(this, -produced); } } while (COUNTER_UPDATER.decrementAndGet(this) > 0); if (emitted > 0) { request(emitted); } }
Source:
public Optional<Table> getTable(String databaseName, String tableName) { try { return retry() .stopOn(NoSuchObjectException.class, HiveViewNotSupportedException.class) .stopOnIllegalExceptions() .run("getTable", stats.getGetTable().wrap(() -> { try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) { Table table = client.getTable(databaseName, tableName); if (table.getTableType().equals(TableType.VIRTUAL_VIEW.name()) && (!"true".equals(table.getParameters().get(PRESTO_VIEW_FLAG)))) { throw new HiveViewNotSupportedException(new SchemaTableName(databaseName, tableName)); } return Optional.of(table); } })); } catch (NoSuchObjectException e) { return Optional.empty(); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public Optional<Table> getTable(String databaseName, String tableName) { try { return retry() .stopOn(NoSuchObjectException.class, HiveViewNotSupportedException.class) .stopOnIllegalExceptions() .run("getTable", stats.getGetTable().wrap(() -> { try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) { Table table = client.getTable(databaseName, tableName); if (table.getTableType().equals(TableType.VIRTUAL_VIEW.name()) && !isPrestoView(table)) { throw new HiveViewNotSupportedException(new SchemaTableName(databaseName, tableName)); } return Optional.of(table); } })); } catch (NoSuchObjectException e) { return Optional.empty(); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
private Runnable getIAMUserProfileUpdater(AuthzToken authzToken, UserProfile userProfile) throws UserProfileServiceException { IamAdminServices.Client iamAdminServicesClient = iasClientPool.getResource(); return () -> { try { iamAdminServicesClient.updateUserProfile(authzToken, userProfile); iasClientPool.returnResource(iamAdminServicesClient); } catch (TException e) { if (iamAdminServicesClient != null) { iasClientPool.returnBrokenResource(iamAdminServicesClient); } throw new RuntimeException("Failed to update user profile in IAM service", e); } }; }

Target:
private Runnable getIAMUserProfileUpdater(AuthzToken authzToken, UserProfile userProfile) throws UserProfileServiceException { IamAdminServices.Client iamAdminServicesClient = iasClientPool.getResource(); return () -> { try { iamAdminServicesClient.updateUserProfile(authzToken, userProfile); iasClientPool.returnResource(iamAdminServicesClient); } catch (TException e) { if (iamAdminServicesClient != null) { logger.error("Error while Updating user profile in IAM Service", e); iasClientPool.returnBrokenResource(iamAdminServicesClient); } throw new RuntimeException("Failed to update user profile in IAM service", e); } }; }
Source:
public static void main(String args[]) { if (args.length != 4) { System.out.println("USAGE: java [options] " + AmbryServer.class.getSimpleName() + " log4j.properties server.properties hardwarelayout partitionlayout"); System.exit(1); } try { PropertyConfigurator.configure(args[0]); Properties props = Utils.loadProps(args[1]); VerifiableProperties vprops = new VerifiableProperties(props); ClusterMap clusterMap = new ClusterMapManager(args[2], args[3], new ClusterMapConfig(vprops)); final AmbryServer server = new AmbryServer(vprops, clusterMap); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { server.shutdown(); } }); server.startup(); server.awaitShutdown(); } catch (Exception e) { System.out.println("error " + e); } System.exit(0); }

Target:
public static void main(String args[]) { if (args.length != 3) { System.out.println("USAGE: java [options] " + AmbryMain.class.getCanonicalName() + " server.properties hardwarelayout partitionlayout"); System.exit(1); } try { Properties props = Utils.loadProps(args[0]); VerifiableProperties vprops = new VerifiableProperties(props); ClusterMap clusterMap = new ClusterMapManager(args[1], args[2], new ClusterMapConfig(vprops)); final AmbryServer server = new AmbryServer(vprops, clusterMap); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { server.shutdown(); } }); server.startup(); server.awaitShutdown(); } catch (Exception e) { System.out.println("error " + e); } System.exit(0); }
Source:
protected LockAndUnlockContendedBenchmark(TimelockService timelock, int numClients, int numRequestsPerClient, int numDistinctLocks) { super(numClients, numRequestsPerClient); this.timelock = timelock; List<LockDescriptor> descriptors = Lists.newArrayList(); for (int i = 0; i < numDistinctLocks; i++) { descriptors.add(StringLockDescriptor.of(UUID.randomUUID().toString())); } lockDescriptors = ImmutableList.copyOf(descriptors); }

Target:
protected LockAndUnlockContendedBenchmark(TimelockService timelock, int numClients, int numRequestsPerClient, int numDistinctLocks) { super(numClients, numRequestsPerClient); this.timelock = timelock; List<LockDescriptor> descriptors = Lists.newArrayListWithExpectedSize(numDistinctLocks); for (int i = 0; i < numDistinctLocks; i++) { descriptors.add(StringLockDescriptor.of(UUID.randomUUID().toString())); } lockDescriptors = ImmutableList.copyOf(descriptors); }
Source:
static ReadCountCollection removeTargetsWithTooManyZeros(final ReadCountCollection readCounts, final int maximumTargetZeros, final Logger logger) { final Set<Target> targetsToKeep = new HashSet<>(readCounts.targets().size()); final RealMatrix counts = readCounts.counts(); for (int i = 0; i < counts.getRowDimension(); i++) { final double[] rowCounts = counts.getRow(i); int zeroCounts = 0; for (final double rowCount : rowCounts) { if (rowCount == 0.0) { zeroCounts++; } } if (zeroCounts <= maximumTargetZeros) { targetsToKeep.add(readCounts.targets().get(i)); } } final int targetsToDropCount = readCounts.targets().size() - targetsToKeep.size(); if (targetsToDropCount == 0) { logger.info( String.format("No target drop due to too many zero counts; there is no target with a large number of columns with zero counts (<= %d of %d) ", maximumTargetZeros, readCounts.targets().size())); return readCounts; } else if (targetsToDropCount == readCounts.targets().size()) { throw new UserException.BadInput("the number of zeros per target in the input is too large resulting in all targets being dropped"); } else { logger.info( String.format("Some targets dropped, %d of %d, as they have too many zeros (> %d of %d)." , targetsToDropCount, readCounts.columnNames().size(), maximumTargetZeros, readCounts.targets().size())); return readCounts.subsetTargets(targetsToKeep); } }

Target:
static ReadCountCollection removeTargetsWithTooManyZeros(final ReadCountCollection readCounts, final int maximumTargetZeros, final Logger logger) { final RealMatrix counts = readCounts.counts(); final Set<Target> targetsToKeep = IntStream.range(0, counts.getRowDimension()).boxed() .filter(i -> countZeroes(counts.getRow(i)) <= maximumTargetZeros) .map(i -> readCounts.targets().get(i)).collect(Collectors.toSet()); final int targetsToDropCount = readCounts.targets().size() - targetsToKeep.size(); if (targetsToDropCount == 0) { logger.info( String.format("No target drop due to too many zero counts; there is no target with a large number of columns with zero counts (<= %d of %d) ", maximumTargetZeros, readCounts.targets().size())); return readCounts; } else if (targetsToDropCount == readCounts.targets().size()) { throw new UserException.BadInput("the number of zeros per target in the input is too large resulting in all targets being dropped"); } else { logger.info( String.format("Some targets dropped, %d of %d, as they have too many zeros (> %d of %d)." , targetsToDropCount, readCounts.columnNames().size(), maximumTargetZeros, readCounts.targets().size())); return readCounts.subsetTargets(targetsToKeep); } }
Source:
private void retryWork(int maxRetries) { for (int attempt = 0; attempt < maxRetries; attempt++) { if (attempt > 0 && log.isDebugEnabled()) log.debugf("Retrying due to previous failure. %s attempts left.", maxRetries - attempt); try { if (!failSilently) { availabilityLock.lock(); try { if (!delegateAvailable) { if (stopped) { log.debugf("Failed to write async modifications to %s as the store is unavailable and stop() was called", actual); return; } availability.await(); } } catch (InterruptedException e) { log.debugf("%s interrupted: %s", this, e); Thread.currentThread().interrupt(); break; } finally { availabilityLock.unlock(); } } AsyncCacheWriter.this.applyModificationsSync(modifications); return; } catch (Exception e) { if (log.isDebugEnabled()) log.debug("Failed to process async modifications", e); if (!failSilently) { try { Thread.sleep(configuration.availabilityInterval()); } catch (InterruptedException ie) { break; } } } } log.unableToProcessAsyncModifications(maxRetries); }

Target:
private void retryWork(int maxRetries) { for (int attempt = 0; attempt < maxRetries; attempt++) { if (attempt > 0 && log.isDebugEnabled()) log.debugf("Retrying due to previous failure. %s attempts left.", maxRetries - attempt); try { if (!failSilently) { availabilityLock.lock(); try { if (!delegateAvailable) { if (stopped) { log.debugf("Failed to write async modifications to %s as the store is unavailable and stop() was called", actual); return; } availability.await(); } } catch (InterruptedException e) { log.debugf("%s interrupted: %s", this, e); Thread.currentThread().interrupt(); break; } finally { availabilityLock.unlock(); } } AsyncCacheWriter.this.applyModificationsSync(modifications); return; } catch (Exception e) { if (log.isDebugEnabled()) log.debug("Failed to process async modifications", e); if (!failSilently) { try { Thread.sleep(configuration.availabilityInterval()); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); break; } } } } log.unableToProcessAsyncModifications(maxRetries); }
Source:
public BibEntry createNewEntry(JSONObject jsonObject) { BibEntry newEntry = new BibEntry(); newEntry.setField(StandardField.TITLE, jsonObject.getString("title")); newEntry.setField(StandardField.AUTHOR, jsonObject.getString("author")); newEntry.setField(StandardField.YEAR, jsonObject.getString("year")); newEntry.setField(StandardField.PAGES, jsonObject.getString("page")); newEntry.setField(StandardField.VOLUME, jsonObject.getString("volume")); newEntry.setField(StandardField.ISSUE, jsonObject.getString("issue")); newEntry.setField(StandardField.DOI, jsonObject.getString("doi")); return newEntry; }

Target:
private BibEntry createNewEntry(JSONObject jsonObject) { LOGGER.debug("Paper found: {}", jsonObject.getString("doi")); return new BibEntry() .withField(StandardField.TITLE, jsonObject.getString("title")) .withField(StandardField.AUTHOR, jsonObject.getString("author")) .withField(StandardField.YEAR, jsonObject.getString("year")) .withField(StandardField.PAGES, jsonObject.getString("page")) .withField(StandardField.VOLUME, jsonObject.getString("volume")) .withField(StandardField.ISSUE, jsonObject.getString("issue")) .withField(StandardField.DOI, jsonObject.getString("doi")); }
Source:
public Collection<IDataProviderDescriptor> getDescriptors(@NonNull ITmfTrace trace) { return Collections.singletonList(DESCRIPTOR); }

Target:
public Collection<IDataProviderDescriptor> getDescriptors(@NonNull ITmfTrace trace) { return Collections.singleton(DESCRIPTOR); }
Source:
public void selectionChanged(IStructuredSelection sel) { if( sel.size() == 0 || sel.size() > 1 ) { setEnabled(false); return; } setEnabled(true); synchronized(this) { switchListener(previousSelection, sel); previousSelection = sel; } super.selectionChanged(sel); }

Target:
public void selectionChanged(IStructuredSelection sel) { if( sel.size() != 1 ) { setEnabled(false); return; } setEnabled(true); synchronized(this) { switchListener(previousSelection, sel); previousSelection = sel; } super.selectionChanged(sel); }
Source:
public CompletableFuture<TransferBatchResponse> tryTransferForRandomNodes( RandomNodeIterator nodeIterator) { return CompletableFuture.supplyAsync(() -> { while (nodeIterator.hasNext()) { TransferBatchRequestForNode transferBatchRequestForNode = nodeIterator.next(); List<Long> addresses = transferBatchRequestForNode.getAddresses(); String destinationNode = transferBatchRequestForNode.getDestinationNode(); LogUnitClient logUnitClientToTargetNode = runtimeLayout.getLogUnitClient(destinationNode); LogUnitClient logUnitClientToCurrentNode = runtimeLayout.getLogUnitClient(currentNode); try { ReadBatch readBatch = readRecords(addresses, Optional.of(destinationNode), logUnitClientToTargetNode); return writeRecords(readBatch, logUnitClientToCurrentNode, maxWriteRetries, writeSleepDuration); } catch (ReadBatchException re) { log.warn("Read exception for node occurred. " + "Retry transfer for the next available node.", destinationNode, re); } catch (Exception e) { log.error("Exception during batch transfer occurred. Failing the transfer.", e); throw e; } } throw new IllegalStateException("No target nodes left to select from"); }); }

Target:
private CompletableFuture<TransferBatchResponse> tryTransferForRandomNodes( RandomNodeIterator nodeIterator) { return CompletableFuture.supplyAsync(() -> { while (nodeIterator.hasNext()) { TransferBatchRequestForNode transferBatchRequestForNode = nodeIterator.next(); List<Long> addresses = transferBatchRequestForNode.getAddresses(); String destinationNode = transferBatchRequestForNode.getDestinationNode(); LogUnitClient logUnitClientToTargetNode = runtimeLayout.getLogUnitClient(destinationNode); LogUnitClient logUnitClientToCurrentNode = runtimeLayout.getLogUnitClient(currentNode); try { ReadBatch readBatch = readRecords(addresses, Optional.of(destinationNode), logUnitClientToTargetNode); return writeRecords(readBatch, logUnitClientToCurrentNode, maxWriteRetries, writeSleepDuration); } catch (ReadBatchException re) { log.warn("Read exception for node occurred. " + "Retry transfer for the next available node.", destinationNode, re); } catch (Exception e) { log.error("Exception during batch transfer occurred. Failing the transfer.", e); throw e; } } throw new ReadBatchException("No target nodes left to select from"); }); }
Source:
private void restoreTable(Connection connection, Database d, String name, int id, String charset, String pks) throws SQLException { Statement s = connection.createStatement(); Table t = d.buildTable(name, charset); ResultSet cRS = s.executeQuery("SELECT * from `columns` where table_id = " + id + " ORDER by id"); int i = 0; while (cRS.next()) { String[] enumValues = null; if ( cRS.getString("enum_values") != null ) enumValues = StringUtils.splitByWholeSeparatorPreserveAllTokens(cRS.getString("enum_values"), ","); ColumnDef c = ColumnDef.build( cRS.getString("name"), cRS.getString("charset"), cRS.getString("coltype"), i++, cRS.getInt("is_signed") == 1, enumValues, Long.valueOf(cRS.getInt("column_length"))); t.addColumn(c); } if ( pks != null ) { List<String> pkList = Arrays.asList(StringUtils.split(pks, ',')); t.setPKList(pkList); } }

Target:
private void restoreTable(Connection connection, Database d, String name, int id, String charset, String pks) throws SQLException { Statement s = connection.createStatement(); Table t = d.buildTable(name, charset); ResultSet cRS = s.executeQuery("SELECT * from `columns` where table_id = " + id + " ORDER by id"); int i = 0; while (cRS.next()) { Long columnLength; int columnLengthInt = cRS.getInt("column_length"); if ( cRS.wasNull() ) columnLength = null; else columnLength = Long.valueOf(columnLengthInt); String[] enumValues = null; if ( cRS.getString("enum_values") != null ) enumValues = StringUtils.splitByWholeSeparatorPreserveAllTokens(cRS.getString("enum_values"), ","); ColumnDef c = ColumnDef.build( cRS.getString("name"), cRS.getString("charset"), cRS.getString("coltype"), i++, cRS.getInt("is_signed") == 1, enumValues, columnLength); t.addColumn(c); } if ( pks != null ) { List<String> pkList = Arrays.asList(StringUtils.split(pks, ',')); t.setPKList(pkList); } }
Source:
private static void move(State state, ObjectInstance containerInstance, ObjectInstance spaceInstance) { String oldSpace = ContainerFactory.getSpaceName(containerInstance); ObjectInstance oldSpaceObject = state.getObject(oldSpace); ContainerFactory.changeContainerSpace(containerInstance, spaceInstance.getName()); SpaceFactory.addContainer(spaceInstance, containerInstance); SpaceFactory.removeContainer(oldSpaceObject, containerInstance); if (SpaceFactory.getOnOff(spaceInstance) && !ContainerFactory.isEmptyContainer(containerInstance)) { if (SpaceFactory.isHeating(spaceInstance) && ContainerFactory.isHeatingContainer(containerInstance)) { for (String name : ContainerFactory.getContentNames(containerInstance)) { ObjectInstance ing = state.getObject(name); if (!IngredientFactory.isMeltedAtRoomTemperature(ing)) { IngredientFactory.meltIngredient(ing); } } } else if (SpaceFactory.isBaking(spaceInstance) && ContainerFactory.isBakingContainer(containerInstance)) { for (String name : ContainerFactory.getContentNames(containerInstance)) { ObjectInstance ing = state.getObject(name); IngredientFactory.bakeIngredient(ing); } } } }

Target:
private static void move(State state, ObjectInstance containerInstance, ObjectInstance spaceInstance) { String oldSpace = ContainerFactory.getSpaceName(containerInstance); ObjectInstance oldSpaceObject = state.getObject(oldSpace); ContainerFactory.changeContainerSpace(containerInstance, spaceInstance.getName()); SpaceFactory.addContainer(spaceInstance, containerInstance); SpaceFactory.removeContainer(oldSpaceObject, containerInstance); if (SpaceFactory.getOnOff(spaceInstance)) { if (SpaceFactory.isBaking(spaceInstance)) { MoveAction.movingToBakingSpace(state, spaceInstance, containerInstance); } if (SpaceFactory.isHeating(spaceInstance)) { MoveAction.movingToHeatingSpace(state, spaceInstance, containerInstance); } } }
Source:
public int getMaxIntermediateSize() { return Doubles.BYTES; }

Target:
public int getMaxIntermediateSize() { return Double.BYTES; }
Source:
void notifiedWithCorrectNamesWhenClassExecutionSkipped() throws Exception { ArgumentCaptor<ReportEntry> entryCaptor = ArgumentCaptor.forClass(ReportEntry.class); TestPlan testPlan = TestPlan.from(Collections.singletonList(new EngineDescriptor(newId(), "Luke's Plan"))); adapter.testPlanExecutionStarted(testPlan); TestIdentifier classIdentifier = newClassIdentifierOnTestPlan(testPlan); adapter.executionSkipped(classIdentifier, "test"); verify(listener).testSkipped(entryCaptor.capture()); ReportEntry entry = entryCaptor.getValue(); assertTrue(MyTestClass.class.getTypeName().contains(entry.getName())); assertEquals("<unrooted>", entry.getSourceName()); }

Target:
void notifiedWithCorrectNamesWhenClassExecutionSkipped() throws Exception { ArgumentCaptor<ReportEntry> entryCaptor = ArgumentCaptor.forClass(ReportEntry.class); TestPlan testPlan = TestPlan.from(Collections.singletonList(new EngineDescriptor(newId(), "Luke's Plan"))); adapter.testPlanExecutionStarted(testPlan); TestIdentifier classIdentifier = identifiersAsParentOnTestPlan(testPlan, newEngineDescriptor(), newClassDescriptor()); adapter.executionSkipped(classIdentifier, "test"); verify(listener).testSkipped(entryCaptor.capture()); ReportEntry entry = entryCaptor.getValue(); assertTrue(MyTestClass.class.getTypeName().contains(entry.getName())); assertEquals("engine", entry.getSourceName()); }
Source:
findBindingsForOneIndexedExpression(ExpressionOrColumn nextStatementEOC, ExpressionOrColumn indexEntry) { assert(nextStatementEOC.m_expr != null); AbstractExpression nextStatementExpr = nextStatementEOC.m_expr; if (indexEntry.m_colRef != null) { ColumnRef indexColRef = indexEntry.m_colRef; if (matchExpressionAndColumnRef(nextStatementExpr, indexColRef, indexEntry.m_tableScan)) { return m_emptyBindings; } return null; } List<AbstractExpression> moreBindings = nextStatementEOC.m_expr.bindingToIndexedExpression(indexEntry.m_expr); if (moreBindings != null) { return moreBindings; } return null; }

Target:
findBindingsForOneIndexedExpression(ExpressionOrColumn nextStatementEOC, ExpressionOrColumn indexEntry) { assert(nextStatementEOC.m_expr != null); AbstractExpression nextStatementExpr = nextStatementEOC.m_expr; if (indexEntry.m_colRef != null) { ColumnRef indexColRef = indexEntry.m_colRef; if (matchExpressionAndColumnRef(nextStatementExpr, indexColRef, indexEntry.m_tableScan)) { return s_reusableImmutableEmptyBinding; } return null; } List<AbstractExpression> moreBindings = nextStatementEOC.m_expr.bindingToIndexedExpression(indexEntry.m_expr); if (moreBindings != null) { return moreBindings; } return null; }
Source:
public List<String> findDistinctChromosomes() { return (List<String>) mongoTemplate.getCollection(mongoTemplate.getCollectionName(VariantEntity.class)) .distinct("chr", new Query().getQueryObject()); }

Target:
public List<String> findDistinctChromosomes() { return (List<String>) mongoTemplate.getCollection(mongoTemplate.getCollectionName(VariantEntity.class)) .distinct("chr"); }
Source:
public int getMax() { if (isCake()) { return getCake().getMaximumBites(); } if (isSnow()) { return getSnow().getMaximumLayers(); } else if (isHive()) { return getMaxHoneyLevel(); } return getLevelled().getMaximumLevel(); }

Target:
public int getMax() { if (isCake()) { return getCake().getMaximumBites(); } else if (isSnow()) { return getSnow().getMaximumLayers(); } else if (isHive()) { return getMaxHoneyLevel(); } return getLevelled().getMaximumLevel(); }
Source:
private void addNewColumToSystables(TransactionController tc) throws StandardException { SchemaDescriptor sd = getSystemSchemaDescriptor(); TableDescriptor td = getTableDescriptor(SYSTABLEPERMSRowFactory.TABLENAME_STRING, sd, tc); ColumnDescriptor cd = td.getColumnDescriptor(SYSTABLESRowFactory.PURGE_DELETED_ROWS); if (cd == null) { tc.elevate("dictionary"); dropTableDescriptor(td, sd, tc); td.setColumnSequence(td.getColumnSequence() + 1); addDescriptor(td, sd, DataDictionary.SYSTABLES_CATALOG_NUM, false, tc); DataValueDescriptor storableDV = getDataValueFactory().getNullBoolean(null); int colNumber = td.getNumberOfColumns() + 1; DataTypeDescriptor dtd = DataTypeDescriptor.getBuiltInDataTypeDescriptor((Types.BOOLEAN)); tc.addColumnToConglomerate(td.getHeapConglomerateId(), colNumber, storableDV, dtd.getCollationType()); UUID uuid = getUUIDFactory().createUUID(); ColumnDescriptor columnDescriptor = new ColumnDescriptor( SYSTABLESRowFactory.PURGE_DELETED_ROWS, colNumber, colNumber, dtd, new SQLBoolean(false), null, td, uuid, 0, 0, td.getColumnSequence()); addDescriptor(columnDescriptor, td, DataDictionary.SYSCOLUMNS_CATALOG_NUM, false, tc); td.getColumnDescriptorList().add(columnDescriptor); updateSYSCOLPERMSforAddColumnToUserTable(td.getUUID(), tc); SpliceLogUtils.info(LOG, "SYS.SYSTABLES upgraded: added a new column %s.", SYSTABLESRowFactory.PURGE_DELETED_ROWS); } }

Target:
private void addNewColumToSystables(TransactionController tc) throws StandardException { SchemaDescriptor sd = getSystemSchemaDescriptor(); TableDescriptor td = getTableDescriptor(SYSTABLESRowFactory.TABLENAME_STRING, sd, tc); ColumnDescriptor cd = td.getColumnDescriptor(SYSTABLESRowFactory.PURGE_DELETED_ROWS); if (cd == null) { tc.elevate("dictionary"); dropTableDescriptor(td, sd, tc); td.setColumnSequence(td.getColumnSequence() + 1); addDescriptor(td, sd, DataDictionary.SYSTABLES_CATALOG_NUM, false, tc); DataValueDescriptor storableDV = getDataValueFactory().getNullBoolean(null); int colNumber = td.getNumberOfColumns() + 1; DataTypeDescriptor dtd = DataTypeDescriptor.getBuiltInDataTypeDescriptor((Types.BOOLEAN)); tc.addColumnToConglomerate(td.getHeapConglomerateId(), colNumber, storableDV, dtd.getCollationType()); UUID uuid = getUUIDFactory().createUUID(); ColumnDescriptor columnDescriptor = new ColumnDescriptor( SYSTABLESRowFactory.PURGE_DELETED_ROWS, colNumber, colNumber, dtd, new SQLBoolean(false), null, td, uuid, 0, 0, td.getColumnSequence()); addDescriptor(columnDescriptor, td, DataDictionary.SYSCOLUMNS_CATALOG_NUM, false, tc); td.getColumnDescriptorList().add(columnDescriptor); updateSYSCOLPERMSforAddColumnToUserTable(td.getUUID(), tc); SpliceLogUtils.info(LOG, "SYS.SYSTABLES upgraded: added a new column %s.", SYSTABLESRowFactory.PURGE_DELETED_ROWS); } }
Source:
public CenterStage(final AssetManager assets, final float width, final float height) { this.setBounds(0, 0, width, height); this.TOTALHEIGHT = height; this.TOTALWIDTH = width; RiverBanksActor background = new RiverBanksActor(assets, 0, 0, width, height); this.addActor(background); WoodenBackground floor = new WoodenBackground(assets, 100, 50, width -200, height -100); DividingLine line = new DividingLine(assets,300,30,width/2,height); leftBoat = new LittleBoat(assets,TOTALWIDTH / 5 ,30,TOTALHEIGHT - 80 - TOTALWIDTH / 10, TOTALHEIGHT / 4, TOTALWIDTH / 10); rightBoat = new LittleBoat(assets,TOTALWIDTH / 5 * 3,30,TOTALHEIGHT - 80 - TOTALWIDTH / 10, TOTALHEIGHT / 4, TOTALWIDTH / 10); this.addActor(floor); this.addActor(line); this.addActor(leftBoat); this.addActor(rightBoat); }

Target:
public CenterStage(final AssetManager assets, final float width, final float height) { this.setBounds(0, 0, width, height); this.TOTALHEIGHT = height; this.TOTALWIDTH = width; RiverBanksActor background = new RiverBanksActor(assets, 0, 0, width, height); this.addActor(background); WoodenBackground floor = new WoodenBackground(assets, 100, 50, width - 200, height - 100); DividingLine line = new DividingLine(assets, 300, 30, width / 2, height); float top_y = TOTALHEIGHT - 2 * BOAT_HEIGHT - 30; leftBoat = new LittleBoat(assets, TOTALWIDTH / 5, BOAT_HEIGHT, top_y, TOTALHEIGHT / 4, TOTALWIDTH / 10); rightBoat = new LittleBoat(assets, TOTALWIDTH / 5 * 3, BOAT_HEIGHT, top_y, TOTALHEIGHT / 4, TOTALWIDTH / 10); this.addActor(floor); this.addActor(line); this.addActor(leftBoat); this.addActor(rightBoat); }
Source:
static String format(ValueData val) throws UnsupportedEncodingException, RegistryParseException { StringBuilder sb = new StringBuilder(); switch (val.getValueType()) { case REG_SZ: case REG_EXPAND_SZ: { String valString = val.getAsString(); if (valString.length() == 0) { sb.append(Bundle.RegeditExeValueFormatter_valueNotSet_text()); } else { sb.append(valString); } if (sb.length() > 48) { sb.setLength(45); sb.append("..."); } break; } case REG_MULTI_SZ: { Iterator<String> it = val.getAsStringList().iterator(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) { sb.append(", "); } } if (sb.length() > 48) { sb.setLength(45); sb.append("..."); } break; } case REG_DWORD: case REG_BIG_ENDIAN: { sb.append(String.format("0x%08x (%d)", val.getAsNumber(), val.getAsNumber())); break; } case REG_QWORD: { sb.append(String.format("0x%016x (%d)", val.getAsNumber(), val.getAsNumber())); break; } default: { ByteBuffer valData = val.getAsRawData(); valData.position(0x0); for (int i = 0; i < Math.min(16, valData.limit()); i++) { byte b = valData.get(); sb.append(HexDump.toHexString(b)); if (i != 15) { sb.append(' '); } } if (valData.limit() > 16) { sb.append("..."); } break; } } return sb.toString(); }

Target:
static String format(ValueData val) throws UnsupportedEncodingException, RegistryParseException { StringBuilder sb = new StringBuilder(); switch (val.getValueType()) { case REG_SZ: case REG_EXPAND_SZ: { String valString = val.getAsString(); if (valString.length() == 0) { sb.append(Bundle.RegeditExeValueFormatter_valueNotSet_text()); } else { sb.append(valString); } if (sb.length() > MAX_STRING_LENGTH) { sb.setLength(MAX_STRING_LENGTH - OVER_MAX_LENGTH_ENDING.length()); sb.append(OVER_MAX_LENGTH_ENDING); } break; } case REG_MULTI_SZ: { Iterator<String> it = val.getAsStringList().iterator(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) { sb.append(", "); } } if (sb.length() > MAX_STRING_LENGTH) { sb.setLength(MAX_STRING_LENGTH - OVER_MAX_LENGTH_ENDING.length()); sb.append(OVER_MAX_LENGTH_ENDING); } break; } case REG_DWORD: case REG_BIG_ENDIAN: { sb.append(String.format("0x%08x (%d)", val.getAsNumber(), val.getAsNumber())); break; } case REG_QWORD: { sb.append(String.format("0x%016x (%d)", val.getAsNumber(), val.getAsNumber())); break; } default: { ByteBuffer valData = val.getAsRawData(); valData.position(0x0); for (int i = 0; i < Math.min(MAX_BUFFER_SIZE, valData.limit()); i++) { byte b = valData.get(); sb.append(HexDump.toHexString(b)); if (i != MAX_BUFFER_SIZE - 1) { sb.append(' '); } } if (valData.limit() > MAX_BUFFER_SIZE) { sb.append(OVER_MAX_LENGTH_ENDING); } break; } } return sb.toString(); }
Source:
public Image getImage(Object element) { RepositoryTreeNode node = (RepositoryTreeNode) element; RepositoryTreeNodeType type = node.getType(); if (type == RepositoryTreeNodeType.TAG) { RevObject any; RevWalk walk = new RevWalk(node.getRepository()); try { ObjectId id = node.getRepository().resolve( ((Ref) node.getObject()).getName()); if (id == null) return null; any = walk.parseAny(id); } catch (MissingObjectException e) { Activator.logError(e.getMessage(), e); return null; } catch (IOException e) { Activator.logError(e.getMessage(), e); return null; } finally { walk.release(); } if (any instanceof RevTag) return decorateImage(annotatedTagImage, element); } else if (type == RepositoryTreeNodeType.FILE) { Object object = node.getObject(); if (object instanceof File) { ImageDescriptor descriptor = PlatformUI.getWorkbench() .getEditorRegistry() .getImageDescriptor(((File) object).getName()); return decorateImage((Image) resourceManager.get(descriptor), element); } } else if (type == RepositoryTreeNodeType.REPO) { Object object = node.getObject(); if (object instanceof Repository) { Repository r = (Repository) object; if (ResourcePropertyTester.testRepositoryState(r, "hasGerritConfiguration")) return gerritRepoImage; } } return decorateImage(node.getType().getIcon(), element); }

Target:
public Image getImage(Object element) { RepositoryTreeNode node = (RepositoryTreeNode) element; RepositoryTreeNodeType type = node.getType(); if (type == RepositoryTreeNodeType.TAG) { RevObject any; RevWalk walk = new RevWalk(node.getRepository()); try { ObjectId id = node.getRepository().resolve( ((Ref) node.getObject()).getName()); if (id == null) return null; any = walk.parseAny(id); } catch (MissingObjectException e) { Activator.logError(e.getMessage(), e); return null; } catch (IOException e) { Activator.logError(e.getMessage(), e); return null; } finally { walk.release(); } if (any instanceof RevTag) return decorateImage(annotatedTagImage, element); } else if (type == RepositoryTreeNodeType.FILE) { Object object = node.getObject(); if (object instanceof File) { ImageDescriptor descriptor = PlatformUI.getWorkbench() .getEditorRegistry() .getImageDescriptor(((File) object).getName()); return decorateImage((Image) resourceManager.get(descriptor), element); } } else if (type == RepositoryTreeNodeType.REPO) { Object object = node.getObject(); if (object instanceof Repository) { Repository r = (Repository) object; if (ResourcePropertyTester.hasGerritConfiguration(r)) return gerritRepoImage; } } return decorateImage(node.getType().getIcon(), element); }
Source:
private void updatePlaybackSpeedPreference() { ListPreference feedPlaybackSpeedPreference = (ListPreference) findPreference(PREF_FEED_PLAYBACK_SPEED); String speedValue = feedPreferences.getFeedPlaybackSpeed(); feedPlaybackSpeedPreference.setValue(speedValue); }

Target:
private void updatePlaybackSpeedPreference() { ListPreference feedPlaybackSpeedPreference = findPreference(PREF_FEED_PLAYBACK_SPEED); float speedValue = feedPreferences.getFeedPlaybackSpeed(); feedPlaybackSpeedPreference.setValue(decimalFormat.format(speedValue)); }