auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getParameters().getBricks() == null || getParameters().getBricks().size() == 0) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED); return false; } <START> if (!validate(new GlusterVolumeValidator().isForceCreateVolumeAllowed(getVdsGroup().getcompatibility_version(), <END> getParameters().isForce()))) { return false; } if (getGlusterVolume().getVolumeType().isReplicatedType()) { if (getParameters().getReplicaCount() > getGlusterVolume().getReplicaCount() + 1) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT_MORE_THAN_ONE); } else if (getParameters().getReplicaCount() < getGlusterVolume().getReplicaCount()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_REPLICA_COUNT); } } if (getGlusterVolume().getVolumeType().isStripedType()) { if (getParameters().getStripeCount() > getGlusterVolume().getStripeCount() + 1) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_STRIPE_COUNT_MORE_THAN_ONE); } else if (getParameters().getStripeCount() < getGlusterVolume().getStripeCount()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_STRIPE_COUNT); } } return updateBrickServerNames(getParameters().getBricks(), true) && validateDuplicateBricks(getParameters().getBricks()); }</code><technical_language>replace "new' createVolumeValidator() Thanks</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getParameters().getBricks() == null || getParameters().getBricks().size() == 0) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED); return false; } if (!validate(createVolumeValidator().isForceCreateVolumeAllowed(getVdsGroup().getcompatibility_version(), getParameters().isForce()))) { return false; } if (getGlusterVolume().getVolumeType().isReplicatedType()) { if (getParameters().getReplicaCount() > getGlusterVolume().getReplicaCount() + 1) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT_MORE_THAN_ONE); } else if (getParameters().getReplicaCount() < getGlusterVolume().getReplicaCount()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_REPLICA_COUNT); } } if (getGlusterVolume().getVolumeType().isStripedType()) { if (getParameters().getStripeCount() > getGlusterVolume().getStripeCount() + 1) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_STRIPE_COUNT_MORE_THAN_ONE); } else if (getParameters().getStripeCount() < getGlusterVolume().getStripeCount()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_STRIPE_COUNT); } } return updateBrickServerNames(getParameters().getBricks(), true) && validateDuplicateBricks(getParameters().getBricks()); }
Source:
<code>public GraphQLFieldDefinition build() { if (dataFetcher == null) { <START> dataFetcher = new PropertyDataFetcher(name); <END> } return new GraphQLFieldDefinition(name, description, type, dataFetcher, arguments, deprecationReason); }</code><technical_language>I get this defaulted a PropertyDataFetcher. this defaulted FieldDataFetcher if defaulted</technical_language>

Target:
public GraphQLFieldDefinition build() { if (dataFetcher == null) { dataFetcher = new DefaultDataFetcher( new MapDataFetcher(name), new PropertyDataFetcher(name, type), new FieldDataFetcher(name) ); } return new GraphQLFieldDefinition(name, description, type, dataFetcher, arguments, deprecationReason); }
Source:
<code>public void jmxPortIsReportedAsTag() throws Exception { <START> InfluxDbWriter writer = getTestInfluxDbWriterWithReportJmxPortAsTag(); <END> writer.doWrite(dummyServer(), dummyQuery(), results); verify(influxDB).write(messageCaptor.capture()); BatchPoints batchPoints = messageCaptor.getValue(); assertThat(batchPoints.getDatabase()).isEqualTo(DATABASE_NAME); List<Point> points = batchPoints.getPoints(); assertThat(points).hasSize(1); Point point = points.get(0); String[] split = point.lineProtocol().split(" "); assertThat(split).hasSize(3); assertThat(split[0]).contains(JMX_PORT_KEY + "=" + DEFAULT_PORT); assertThat(split[1]).doesNotContain(JMX_PORT_KEY); }</code><technical_language>A good section of this method is duplicated pointsAreWrittenToInfluxDb(). issues here: 1) existing tests check a single thing, multiple (which means duplicating tests here, is needed). existing test shoudl refactor common behaviour is tested once, specifics tested in tests. 2) some common behaviour (setting mocks captors) identical extracted in methods</technical_language>

Target:
public void jmxPortIsReportedAsTag() throws Exception { BatchPoints batchPoints = writeToInfluxDb(getTestInfluxDbWriterWithReportJmxPortAsTag()); verifyJMXPortOnlyInToken(batchPoints.getPoints().get(0).lineProtocol(), 0 ); }
Source:
<code>public static boolean isOverlapping(Variant blockRecord, Variant variant) { <START> return (blockRecord.getStart() <= variant.getStart() && blockRecord.getEnd() >= variant <END> .getStart() + 1); }</code><technical_language>get rid of parens surrounding expression - helping readability</technical_language>

Target:
public static boolean isOverlapping(Variant blockRecord, Variant variant) { return blockRecord.getStart() <= variant.getStart() && blockRecord.getEnd() >= variant.getStart() + 1; }
Source:
<code><START> protected List<String> matchingProjects(@NonNull final Collection<AuthScope> scopes) { val result = scopes.stream().filter(s -> matches(s)) .map(s -> s.getProject()) .collect(Collectors.toList()); return result; } <END></code><technical_language>replace this java return scopes.stream() .filter(this::matches) .map(AuthScope::getProject) .collect(toUnmodifiableList());</technical_language>

Target:
protected List<String> matchingProjects(@NonNull final Collection<AuthScope> scopes) { return scopes.stream() .filter(this::matches) .map(AuthScope::getProject) .collect(toUnmodifiableList()); }
Source:
<code>public ThriftHiveMetastore(HiveCluster hiveCluster, MetastoreClientConfig config, MBeanExporter exporter, ThriftHiveMetastoreStats stats, Function<Exception, Exception> exceptionMapper) { this.isHmsImpersonationEnabled = config.isHmsImpersonationEnabled(); this.exporter = requireNonNull(exporter, "exporter is null"); this.clientProvider = requireNonNull(hiveCluster, "hiveCluster is null"); this.stats = requireNonNull(stats, "stats is null"); this.exceptionMapper = requireNonNull(exceptionMapper, "exceptionMapper is null"); this.hmsStats = new HashMap<>(); for (HostAndPort hostAndPort : hiveCluster.getAddresses()) { hmsStats.put(hostAndPort, new ThriftHiveMetastoreStats()); <START> } <END> exportHmsStats(); }</code><technical_language>ImmutableMap builder</technical_language>

Target:
public ThriftHiveMetastore(HiveCluster hiveCluster, MetastoreClientConfig config, MBeanExporter exporter, ThriftHiveMetastoreStats stats, Function<Exception, Exception> exceptionMapper) { this.isHmsImpersonationEnabled = config.isMetastoreImpersonationEnabled(); this.exporter = requireNonNull(exporter, "exporter is null"); this.clientProvider = requireNonNull(hiveCluster, "hiveCluster is null"); this.stats = requireNonNull(stats, "stats is null"); this.exceptionMapper = requireNonNull(exceptionMapper, "exceptionMapper is null"); ImmutableMap.Builder<HostAndPort, ThriftHiveMetastoreStats> metastoreStatsBuilder = ImmutableMap.builder(); for (HostAndPort hostAndPort : hiveCluster.getAddresses()) { metastoreStatsBuilder.put(hostAndPort, new ThriftHiveMetastoreStats()); } this.metastoreStats = metastoreStatsBuilder.build(); exportMetastoreStatistics(); }
Source:
<code>public synchronized void initialize() { <START> try { <END> writeLock.lock(); if (!isInitialized()) { super.initialize(); setInitialized(true); this.initCalled = true; } } finally { readLock.lock(); writeLock.unlock(); readLock.unlock(); } }</code><technical_language>method implements synchronization lock API, synchronized redundant</technical_language>

Target:
public void initialize() { try { writeLock.lock(); if (!isInitialized()) { super.initialize(); setInitialized(true); this.initCalled = true; } } finally { readLock.lock(); writeLock.unlock(); readLock.unlock(); } }
Source:
<code>public void testExecutableAttributes() throws Exception { FS fs = FS.DETECTED; org.junit.Assume.assumeTrue(fs.getClass().equals(FS_POSIX_Java7.class)); File f = new File(trash, "bla"); assertTrue(f.createNewFile()); assertFalse(fs.canExecute(f)); String umask = readUmask(); if (umask == null) return; char others = umask.charAt(umask.length() - 1); boolean badUmask; if (others != '0' && others != '2' && others != '4' && others != '6') { badUmask = true; } else { badUmask = false; } Set<PosixFilePermission> permissions = readPermissions(f); assertTrue(!permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); assertTrue(!permissions.contains(PosixFilePermission.GROUP_EXECUTE)); assertTrue(!permissions.contains(PosixFilePermission.OWNER_EXECUTE)); fs.setExecute(f, true); RepositoryTestCase.fsTick(f); permissions = readPermissions(f); assertTrue("'owner' execute permission not set", permissions.contains(PosixFilePermission.OWNER_EXECUTE)); assertTrue("'group' execute permission not set", permissions.contains(PosixFilePermission.GROUP_EXECUTE)); if (badUmask) { assertFalse("'others' execute permission set", permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); <START> fail("Unexpected umask during test execution: " + umask); <END> } else { assertTrue("'others' execute permission not set", permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); } }</code><technical_language>I this is wrong, umask is 027 permissions OTHERS_EXECUTE test fails here, fail if system umask 027</technical_language>

Target:
public void testExecutableAttributes() throws Exception { FS fs = FS.DETECTED; assumeTrue(fs.getClass().equals(FS_POSIX_Java7.class)); File f = new File(trash, "bla"); assertTrue(f.createNewFile()); assertFalse(fs.canExecute(f)); String umask = readUmask(); if (umask == null) return; char others = umask.charAt(umask.length() - 1); boolean badUmask; if (others != '0' && others != '2' && others != '4' && others != '6') { badUmask = true; } else { badUmask = false; } Set<PosixFilePermission> permissions = readPermissions(f); assertTrue(!permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); assertTrue(!permissions.contains(PosixFilePermission.GROUP_EXECUTE)); assertTrue(!permissions.contains(PosixFilePermission.OWNER_EXECUTE)); fs.setExecute(f, true); RepositoryTestCase.fsTick(f); permissions = readPermissions(f); assertTrue("'owner' execute permission not set", permissions.contains(PosixFilePermission.OWNER_EXECUTE)); assertTrue("'group' execute permission not set", permissions.contains(PosixFilePermission.GROUP_EXECUTE)); if (badUmask) { assertFalse("'others' execute permission set", permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); System.err.println("WARNING: your system's umask: \"" + umask + "\" doesn't allow FSJava7Test to test if setting posix" + " permissions for \"others\" works properly"); assumeFalse(badUmask); } else { assertTrue("'others' execute permission not set", permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); } }
Source:
<code>public String toString() { return "KeySetCommand{" + <START> "set=" + cache.size() + " elements" + <END> '}'; }</code><technical_language>Again, remove number of elements</technical_language>

Target:
public String toString() { return "KeySetCommand{" + "cache=" + cache.getName() + '}'; }
Source:
<code>public GuidePostsCache(ConnectionQueryServices queryServices, Configuration config) { this.queryServices = Objects.requireNonNull(queryServices); final int statsCacheThreadPoolSize = config.getInt( QueryServices.STATS_CACHE_THREAD_POOL_SIZE, QueryServicesOptions.DEFAULT_STATS_CACHE_THREAD_POOL_SIZE); <START> executor = Executors.newFixedThreadPool(statsCacheThreadPoolSize); <END> final long statsUpdateFrequency = config.getLong( QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS); final long maxTableStatsCacheSize = config.getLong( QueryServices.STATS_MAX_CACHE_SIZE, QueryServicesOptions.DEFAULT_STATS_MAX_CACHE_SIZE); final boolean isStatsEnabled = config.getBoolean(STATS_COLLECTION_ENABLED, DEFAULT_STATS_COLLECTION_ENABLED) && config.getBoolean(STATS_ENABLED_ATTRIB, true); PhoenixStatsCacheLoader cacheLoader = new PhoenixStatsCacheLoader( isStatsEnabled ? new StatsLoaderImpl() : new EmptyStatsLoader(), executor); cache = CacheBuilder.newBuilder() .refreshAfterWrite(statsUpdateFrequency, TimeUnit.MILLISECONDS) .maximumWeight(maxTableStatsCacheSize) .weigher(new Weigher<GuidePostsKey, GuidePostsInfo>() { @Override public int weigh(GuidePostsKey key, GuidePostsInfo info) { return info.getEstimatedSize(); } }) .removalListener(new PhoenixStatsCacheRemovalListener()) .build(cacheLoader); }</code><technical_language>thread pool initialized if stats enabled</technical_language>

Target:
public GuidePostsCache(ConnectionQueryServices queryServices, Configuration config) { this.queryServices = Objects.requireNonNull(queryServices); final long statsUpdateFrequency = config.getLong( QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS); final long maxTableStatsCacheSize = config.getLong( QueryServices.STATS_MAX_CACHE_SIZE, QueryServicesOptions.DEFAULT_STATS_MAX_CACHE_SIZE); final boolean isStatsEnabled = config.getBoolean(STATS_COLLECTION_ENABLED, DEFAULT_STATS_COLLECTION_ENABLED); PhoenixStatsCacheLoader cacheLoader = new PhoenixStatsCacheLoader( isStatsEnabled ? new StatsLoaderImpl() : new EmptyStatsLoader(), config); cache = CacheBuilder.newBuilder() .refreshAfterWrite(statsUpdateFrequency, TimeUnit.MILLISECONDS) .maximumWeight(maxTableStatsCacheSize) .weigher(new Weigher<GuidePostsKey, GuidePostsInfo>() { @Override public int weigh(GuidePostsKey key, GuidePostsInfo info) { return info.getEstimatedSize(); } }) .removalListener(new PhoenixStatsCacheRemovalListener()) .build(cacheLoader); }
Source:
<code><START> public void onClose(Session session, CloseReason reason) { <END> synchronized(close) { close.notify(); } listener.onClose(); }</code><technical_language>onClose set this.session null; synchronized block notify</technical_language>

Target:
public void onClose(Session session, CloseReason reason) { synchronized(close) { this.session = null; close.notify(); } listener.onClose(); }
Source:
<code>public View onCreateView( @NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.camera_controller_view, container, false); mPreviewView = view.findViewById(R.id.preview_view); <START> mCameraController.setPreviewView(mPreviewView); <END> if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { mCameraController.bindToLifecycle(CameraControllerFragment.this); } return view; }</code><technical_language>I thinking.. PreviewView a required parameter ? if ask developer pass PreviewView CameraController constructor (or a builder for CameraController configure more options video support ImageAnalysis in future.)</technical_language>

Target:
public View onCreateView( @NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.camera_controller_view, container, false); mPreviewView = view.findViewById(R.id.preview_view); mCameraController.setPreviewView(mPreviewView); if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { mCameraController.bindToLifecycle(getContext(), CameraControllerFragment.this); } return view; }
Source:
<code>public static <T> Matcher<Async<T>> result(final Matcher<? super T> valueMatcher) { return new TypeSafeDiagnosingMatcher<Async<T>>() { @Override protected boolean matchesSafely(Async<T> item, Description mismatchDescription) { AsyncResult<T> result = getResult(item); switch (result.state) { case SUCCEEDED: if (valueMatcher.matches(result.value)) { return true; } else { mismatchDescription.appendText("result "); valueMatcher.describeMismatch(result.value, mismatchDescription); return false; } case FAILED: <START> mismatchDescription.appendText("failed with exception " + result.error); <END> return false; case UNFINISHED: mismatchDescription.appendText("isn't finished yet"); return false; } return false; } @Override public void describeTo(Description description) { description.appendText("a successful async which result ").appendDescriptionOf(valueMatcher); } }; }</code><technical_language>nice tests illustrating mismatch description messages in action</technical_language>

Target:
public static <T> Matcher<Async<T>> result(final Matcher<? super T> valueMatcher) { return new TypeSafeDiagnosingMatcher<Async<T>>() { @Override protected boolean matchesSafely(Async<T> item, Description mismatchDescription) { AsyncResult<T> result = getResult(item); switch (result.state) { case SUCCEEDED: if (valueMatcher.matches(result.value)) { return true; } else { mismatchDescription.appendText("result "); valueMatcher.describeMismatch(result.value, mismatchDescription); return false; } case FAILED: mismatchDescription.appendText("failed with exception: "); mismatchDescription.appendValue(result.error); return false; case UNFINISHED: mismatchDescription.appendText("isn't finished yet"); return false; } return false; } @Override public void describeTo(Description description) { description.appendText("a successful async which result ").appendDescriptionOf(valueMatcher); } }; }
Source:
<code><START> public MatrixTransformation(Request data) { <END> this.data = data; }</code><technical_language>public</technical_language>

Target:
MatrixTransformation(Request data) { this.data = data; }
Source:
<code>public ListenableFuture<Map<Cell, byte[]>> getAsync(TableReference tableRef, Set<Cell> cells) { if (cells.isEmpty()) { return Futures.immediateFuture(ImmutableMap.of()); } Set<Cell> toLoad = Sets.newHashSet(); ImmutableMap.Builder<Cell, byte[]> cacheHitMapBuilder = ImmutableMap.builder(); for (Cell cell : cells) { byte[] val = getCachedCellIfPresent(tableRef, cell); if (val != null) { if (val.length > 0) { cacheHitMapBuilder.put(cell, val); } } else { toLoad.add(cell); } } <START> ImmutableMap<Cell, byte[]> cacheHit = cacheHitMapBuilder.build(); <END> return Futures.transform(super.getAsync(tableRef, toLoad), loaded -> { cacheLoadedCells(tableRef, toLoad, loaded); return ImmutableMap.<Cell, byte[]>builder() .putAll(loaded.entrySet()) .putAll(cacheHit.entrySet()) .build(); }, MoreExecutors.directExecutor()); }</code><technical_language>Normal HashMap correctly publish here, need this additional copy</technical_language>

Target:
public ListenableFuture<Map<Cell, byte[]>> getAsync(TableReference tableRef, Set<Cell> cells) { return getWithLoader(tableRef, cells, super::getAsync); }
Source:
<code><START> public Configuration getEffectiveConfiguration(String[] args) throws CliArgsException { <END> final CommandLine commandLine = cli.parseCommandLineOptions(args, true); final Configuration effectiveConfiguration = new Configuration(baseConfiguration); effectiveConfiguration.addAll(cli.toConfiguration(commandLine)); effectiveConfiguration.set(DeploymentOptions.TARGET, KubernetesSessionClusterExecutor.NAME); return effectiveConfiguration; }</code><technical_language>This package private annotated @VisibleForTesting I think</technical_language>

Target:
Configuration getEffectiveConfiguration(String[] args) throws CliArgsException { final CommandLine commandLine = cli.parseCommandLineOptions(args, true); final Configuration effectiveConfiguration = new Configuration(baseConfiguration); effectiveConfiguration.addAll(cli.toConfiguration(commandLine)); effectiveConfiguration.set(DeploymentOptions.TARGET, KubernetesSessionClusterExecutor.NAME); return effectiveConfiguration; }
Source:
<code>protected void emitResults() throws Exception { while ((resultTuple = pythonFunctionRunner.pollResult()) != null) { <START> emitResult(); <END> } }</code><technical_language>**resultTuple** a local variable? e.g. emitResult(resultTuple); code more readable. do think</technical_language>

Target:
protected void emitResults() throws Exception { Tuple2<byte[], Integer> resultTuple; while ((resultTuple = pythonFunctionRunner.pollResult()) != null) { emitResult(resultTuple); } }
Source:
<code>public void insertLocator(Locator locator) throws IOException { Timer.Context timer = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { MutationBatch mutationBatch = AstyanaxIO.getKeyspace().prepareMutationBatch(); AstyanaxWriter.getInstance().insertLocator(locator, mutationBatch); mutationBatch.execute(); } catch (Exception e) { throw new IOException(e); } finally { <START> if ( timer != null ) { <END> timer.stop(); } } }</code><technical_language>do need this null check</technical_language>

Target:
public void insertLocator(Locator locator) throws IOException { Timer.Context timer = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { MutationBatch mutationBatch = AstyanaxIO.getKeyspace().prepareMutationBatch(); AstyanaxWriter.getInstance().insertLocator(locator, mutationBatch); mutationBatch.execute(); } catch (Exception e) { throw new IOException(e); } finally { timer.stop(); } }
Source:
<code><START> public List<Condition> getActiveConditions(Patient patient) { <END> if(log.isInfoEnabled()){ log.info("Getting active conditions with patient " + patient); } return conditionDAO.getActiveConditions(patient); }</code><technical_language>remove this</technical_language>

Target:
public List<Condition> getActiveConditions(Patient patient) { return conditionDAO.getActiveConditions(patient); }
Source:
<code>public void removeBrokerConnection(MqttBrokerConnection connection) { synchronized (brokerConnections) { <START> brokerConnections.remove(connection.getName(), connection); <END> for (MqttBrokersObserver o : brokersObservers) { o.brokerRemoved(connection); } } }</code><technical_language>This work for external connections if name is case. In addition check return call observers if removal succeeded</technical_language>

Target:
public void removeBrokerConnection(MqttBrokerConnection connection) { synchronized (brokerConnections) { if (brokerConnections.remove(connection.getName().toLowerCase(), connection)) { for (MqttBrokersObserver o : brokersObservers) { o.brokerRemoved(connection); } } } }
Source:
<code><START> public View getView(int position, View convertView, ViewGroup parent) { <END> View v = convertView; if (v == null) { v = View.inflate(context, R.layout.nav_drawer_item_view, null); } NavDrawerItem item = this.getItem(position); ((TextView)v.findViewById(R.id.drawer_text)).setText(item.text); ((ImageView)v.findViewById(R.id.drawer_icon)).setImageResource(item.iconResource); TextView subtext = ((TextView)v.findViewById(R.id.drawer_subtext)); if (item.subtext != null && !"".equals(item.subtext)) { subtext.setText(item.subtext); subtext.setVisibility(View.VISIBLE); } else { subtext.setVisibility(View.GONE); } return v; }</code><technical_language>nonnull annotations: public @NonNull View getView(int position, View convertView, @NonNull ViewGroup parent) {</technical_language>

Target:
public @NonNull View getView(int position, View convertView, ViewGroup parent) { View v = convertView; if (v == null) { v = View.inflate(context, R.layout.nav_drawer_item_view, null); } NavDrawerItem item = this.getItem(position); if (item != null) { ((TextView)v.findViewById(R.id.drawer_text)).setText(item.text); ((ImageView)v.findViewById(R.id.drawer_icon)).setImageResource(item.iconResource); TextView subtext = ((TextView)v.findViewById(R.id.drawer_subtext)); if (item.subtext != null && !"".equals(item.subtext)) { subtext.setText(item.subtext); subtext.setVisibility(View.VISIBLE); } else { subtext.setVisibility(View.GONE); } } return v; }
Source:
<code>protected void fireContentEditorFieldEvent(ContentEditorFieldEvent e) { EventListener[] listeners = m_listenerList.getListeners(ContentEditorFieldListener.class); <START> if (listeners != null && listeners.length > 0) { <END> for (int i = 0; i < listeners.length; i++) { ((ContentEditorFieldListener) listeners[i]).contentEditorFieldChanged(e); } } }</code><technical_language>early return (if null) a simple loop, counter variable is required here: for (EventListener l : listeners) {</technical_language>

Target:
protected void fireContentEditorFieldEvent(ContentEditorFieldEvent e) { EventListener[] listeners = m_listenerList.getListeners(ContentEditorFieldListener.class); if (listeners == null) { return; } for (EventListener listener : listeners) { ((ContentEditorFieldListener) listener).contentEditorFieldChanged(e); } }
Source:
<code>public Optional<AnnotationLayer> getLayer(Project aProject, long aLayerId) { AnnotationLayer layer = getLayer(aLayerId); <START> if (layer != null && Objects.equals(layer.getProject().getId(), aProject.getId())) { <END> return Optional.empty(); } return Optional.ofNullable(layer); }</code><technical_language>do return empty here</technical_language>

Target:
public Optional<AnnotationLayer> getLayer(Project aProject, long aLayerId) { AnnotationLayer layer = getLayer(aLayerId); if (layer != null && !Objects.equals(layer.getProject().getId(), aProject.getId())) { return Optional.empty(); } return Optional.ofNullable(layer); }
Source:
<code>public void setCookieMaxAge(int cookieMaxAge) { <START> Assert.isTrue(cookieMaxAge != 0, "cookieMaxAge is not zero"); <END> this.cookieMaxAge = cookieMaxAge; }</code><technical_language>please change this cookieMaxAge zero? is, error user if is 0 state is zero confusing. suggestion Assert.isTrue(cookieMaxAge != 0, "cookieMaxAge zero");</technical_language>

Target:
public void setCookieMaxAge(int cookieMaxAge) { Assert.isTrue(cookieMaxAge != 0, "cookieMaxAge cannot be zero"); this.cookieMaxAge = cookieMaxAge; }
Source:
<code>public PlanNode optimize(PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { if (!SystemSessionProperties.isNewOptimizerEnabled(session) && !legacyRules.isEmpty()) { for (PlanOptimizer optimizer : legacyRules) { plan = optimizer.optimize(plan, session, symbolAllocator.getTypes(), symbolAllocator, idAllocator); } return plan; } Memo memo = new Memo(idAllocator, plan); Lookup lookup = Lookup.from(memo::resolve); <START> Matcher matcher = DEFAULT_MATCHER; <END> Duration timeout = SystemSessionProperties.getOptimizerTimeout(session); Context context = new Context(memo, lookup, idAllocator, symbolAllocator, System.nanoTime(), timeout.toMillis(), session); exploreGroup(memo.getRootGroup(), context, matcher); return memo.extract(); }</code><technical_language>matcher DEFAULT_MATCHER? Also, constant for class a static instance field instead of passing around</technical_language>

Target:
public PlanNode optimize(PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { if (!SystemSessionProperties.isNewOptimizerEnabled(session) && !legacyRules.isEmpty()) { for (PlanOptimizer optimizer : legacyRules) { plan = optimizer.optimize(plan, session, symbolAllocator.getTypes(), symbolAllocator, idAllocator); } return plan; } Memo memo = new Memo(idAllocator, plan); Lookup lookup = Lookup.from(memo::resolve); Matcher matcher = new PlanNodeMatcher(lookup); Duration timeout = SystemSessionProperties.getOptimizerTimeout(session); Context context = new Context(memo, lookup, idAllocator, symbolAllocator, System.nanoTime(), timeout.toMillis(), session); exploreGroup(memo.getRootGroup(), context, matcher); return memo.extract(); }
Source:
<code>public List<SolrInputDocument> add(List<Metacard> metacards, boolean forceAutoCommit) throws IOException, SolrServerException, MetacardCreationException { <START> if (metacards == null || metacards.isEmpty()) { <END> return Collections.emptyList(); } List<SolrInputDocument> docs = new ArrayList<>(); for (Metacard metacard : metacards) { docs.add(getSolrInputDocument(metacard)); } if (!forceAutoCommit) { client.add(docs); } else { softCommit(docs); } return docs; }</code><technical_language>nit: CollectionUtils for a cleaner read. identifiers</technical_language>

Target:
public List<SolrInputDocument> add(List<Metacard> metacards, boolean forceAutoCommit) throws IOException, SolrServerException, MetacardCreationException { if (CollectionUtils.isEmpty(metacards)) { return Collections.emptyList(); } List<SolrInputDocument> docs = new ArrayList<>(); for (Metacard metacard : metacards) { docs.add(getSolrInputDocument(metacard)); } if (!forceAutoCommit) { client.add(docs); } else { softCommit(docs); } return docs; }
Source:
<code>private void dispatch(ExecutionReference reference, ExecutableFlow exflow, Executor choosenExecutor) throws ExecutorManagerException { exflow.setUpdateTime(System.currentTimeMillis()); callExecutorServer(exflow, choosenExecutor, ConnectorParams.EXECUTE_ACTION); <START> executorLoader.assignExecutor(choosenExecutor.getId(), <END> exflow.getExecutionId()); reference.setExecutor(choosenExecutor); runningFlows.put(exflow.getExecutionId(), new Pair<ExecutionReference, ExecutableFlow>(reference, exflow)); logger.info(String.format( "Successfully dispatched exec %d with error count %d", exflow.getExecutionId(), reference.getNumErrors())); }</code><technical_language>I wondering: if this sql command complete throws exception? system in inconsistent state of submitted flow, registered in DB (and in RunningFlows map, etc). handle this scenario</technical_language>

Target:
private void dispatch(ExecutionReference reference, ExecutableFlow exflow, Executor choosenExecutor) throws ExecutorManagerException { exflow.setUpdateTime(System.currentTimeMillis()); executorLoader.assignExecutor(choosenExecutor.getId(), exflow.getExecutionId()); try { callExecutorServer(exflow, choosenExecutor, ConnectorParams.EXECUTE_ACTION); } catch (ExecutorManagerException ex) { logger.error("Rolling back executor assignment for execution id:" + exflow.getExecutionId(), ex); executorLoader.unassignExecutor(exflow.getExecutionId()); throw new ExecutorManagerException(ex); } reference.setExecutor(choosenExecutor); runningFlows.put(exflow.getExecutionId(), new Pair<ExecutionReference, ExecutableFlow>(reference, exflow)); logger.info(String.format( "Successfully dispatched exec %d with error count %d", exflow.getExecutionId(), reference.getNumErrors())); }
Source:
<code><START> public void testNoSequenceAlterations() { <END> assertEquals(VariantType.NO_SEQUENCE_ALTERATION, VariantClassifier.getVariantClassification("NOVARIATION", "", 6)); assertNotEquals(VariantType.NO_SEQUENCE_ALTERATION, VariantClassifier.getVariantClassification("NOVAR", "", 6)); }</code><technical_language>Check equals reference alternate, empty non-empty</technical_language>

Target:
public void testNoSequenceAlterations() { assertEquals(VariantType.NO_SEQUENCE_ALTERATION, VariantClassifier.getVariantClassification("NOVARIATION", "", 6)); assertNotEquals(VariantType.NO_SEQUENCE_ALTERATION, VariantClassifier.getVariantClassification("NOVAR", "", 6)); assertEquals(VariantType.NO_SEQUENCE_ALTERATION, VariantClassifier.getVariantClassification("", "", 6)); assertEquals(VariantType.NO_SEQUENCE_ALTERATION, VariantClassifier.getVariantClassification("NOVARIATION", "NOVARIATION", 6)); }
Source:
<code>private void addPreferenceChangeListener() { IPreferencesService preferencesService = Platform.getPreferencesService(); <START> fileWalkerConcurrencyLevel = preferencesService.getInt(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PREF_NIO2_REFRESH_FILE_WALKER_CONCURRENCY_LEVEL, PreferenceInitializer.PREF_NIO2_REFRESH_FILE_WALKER_CONCURRENCY_LEVEL_DEFAULT, null); <END> }</code><technical_language>Please break long line</technical_language>

Target:
private void addPreferenceChangeListener() { IPreferencesService preferencesService = Platform.getPreferencesService(); IEclipsePreferences pref = (IEclipsePreferences) preferencesService.getRootNode().node(InstanceScope.SCOPE).node(ResourcesPlugin.PI_RESOURCES); if (pref != null) { pref.addPreferenceChangeListener(this); } fileWalkerConcurrencyLevel = pref.getInt(ResourcesPlugin.PREF_NIO2_REFRESH_FILE_WALKER_CONCURRENCY_LEVEL, PreferenceInitializer.PREF_NIO2_REFRESH_FILE_WALKER_CONCURRENCY_LEVEL_DEFAULT); }
Source:
<code>public void getNotModifiedBlobAndVerify(String blobId) throws Exception { JSONObject headers = new JSONObject(); SimpleDateFormat dateFormat = new SimpleDateFormat(RestUtils.HTTP_DATE_FORMAT, Locale.ENGLISH); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); Date date = new Date(System.currentTimeMillis()); String dateStr = dateFormat.format(date); headers.put(RestUtils.Headers.IF_MODIFIED_SINCE, dateStr); RestRequest restRequest = createRestRequest(RestMethod.GET, blobId, headers, null); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); doOperation(restRequest, restResponseChannel); assertEquals("Unexpected response status", ResponseStatus.NotModified, restResponseChannel.getStatus()); assertTrue("No Date header", restResponseChannel.getHeader(RestUtils.Headers.DATE) != null); assertNull("No Last-Modified header expected", restResponseChannel.getHeader("Last-Modified")); assertNull(RestUtils.Headers.BLOB_SIZE + " should have been null ", restResponseChannel.getHeader(RestUtils.Headers.BLOB_SIZE)); assertNull("Content-Type should have been null", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_TYPE)); assertEquals("No content expected as blob is not modified", 0, restResponseChannel.getResponseBody().length); <START> assertEquals("Accept-Ranges not set correctly", "bytes", <END> restResponseChannel.getHeader(RestUtils.Headers.ACCEPT_RANGES)); assertNull("Content-Range header should not be set", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_RANGE)); }</code><technical_language>a NOT_MODIFIED response a ACCEPT_RANGES header? Is is expected</technical_language>

Target:
public void getNotModifiedBlobAndVerify(String blobId) throws Exception { JSONObject headers = new JSONObject(); SimpleDateFormat dateFormat = new SimpleDateFormat(RestUtils.HTTP_DATE_FORMAT, Locale.ENGLISH); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); Date date = new Date(System.currentTimeMillis()); String dateStr = dateFormat.format(date); headers.put(RestUtils.Headers.IF_MODIFIED_SINCE, dateStr); RestRequest restRequest = createRestRequest(RestMethod.GET, blobId, headers, null); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); doOperation(restRequest, restResponseChannel); assertEquals("Unexpected response status", ResponseStatus.NotModified, restResponseChannel.getStatus()); assertTrue("No Date header", restResponseChannel.getHeader(RestUtils.Headers.DATE) != null); assertNull("No Last-Modified header expected", restResponseChannel.getHeader("Last-Modified")); assertNull(RestUtils.Headers.BLOB_SIZE + " should have been null ", restResponseChannel.getHeader(RestUtils.Headers.BLOB_SIZE)); assertNull("Content-Type should have been null", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_TYPE)); assertEquals("No content expected as blob is not modified", 0, restResponseChannel.getResponseBody().length); assertNull("Accept-Ranges should not be set", restResponseChannel.getHeader(RestUtils.Headers.ACCEPT_RANGES)); assertNull("Content-Range header should not be set", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_RANGE)); }
Source:
<code>public ParametersBuilder addPersistedWithoutHibernate(int yearWhenPersistedWithoutHibernate, int monthWhenPersistedWithoutHibernate, int dayWhenPersistedWithoutHibernate, int hour, int minute, int second, int nanosecond, String offset, ZoneId defaultTimeZone) { if ( isNanosecondPrecisionSupported() ) { <START> nanosecond = 0; <END> } return add( defaultTimeZone, hour, minute, second, nanosecond, offset, yearWhenPersistedWithoutHibernate, monthWhenPersistedWithoutHibernate, dayWhenPersistedWithoutHibernate ); }</code><technical_language>if condition be: if ( !isNanosecondPrecisionSupported() )</technical_language>

Target:
public ParametersBuilder addPersistedWithoutHibernate(int yearWhenPersistedWithoutHibernate, int monthWhenPersistedWithoutHibernate, int dayWhenPersistedWithoutHibernate, int hour, int minute, int second, int nanosecond, String offset, ZoneId defaultTimeZone) { if ( !isNanosecondPrecisionSupported() ) { nanosecond = 0; } return add( defaultTimeZone, hour, minute, second, nanosecond, offset, yearWhenPersistedWithoutHibernate, monthWhenPersistedWithoutHibernate, dayWhenPersistedWithoutHibernate ); }
Source:
<code>public IFilterHolder getFilterHolder(MessageContext ctx, int filterId, int param1) { if (ctx.side == Side.SERVER) { <START> if (ctx.getServerHandler().player.openContainer instanceof ContainerFilter) { <END> final TileEntity tileEntity = ((ContainerFilter) ctx.getServerHandler().player.openContainer).getTileEntity(); if (tileEntity == null || !tileEntity.getPos().equals(getPos())) { Log.warn("Player " + ctx.getServerHandler().player.getName() + " tried to manipulate a filter while another gui was open!"); return null; } } } World world = getWorld(ctx); TileEntity tileEntity = getTileEntity(world); if (tileEntity instanceof IFilterHolder) { return (IFilterHolder) tileEntity; } return null; }</code><technical_language>fall-through in 'else' case leads unsafe code. Missing return</technical_language>

Target:
public IFilterHolder getFilterHolder(MessageContext ctx, int filterId, int param1) { if (ctx.side == Side.SERVER) { if (ctx.getServerHandler().player.openContainer instanceof ContainerFilter) { final TileEntity tileEntity = ((ContainerFilter) ctx.getServerHandler().player.openContainer).getTileEntity(); if (tileEntity == null || !tileEntity.getPos().equals(getPos())) { Log.warn("Player " + ctx.getServerHandler().player.getName() + " tried to manipulate a filter while another gui was open!"); return null; } else { if (tileEntity instanceof IFilterHolder) { return (IFilterHolder) tileEntity; } } } } return null; }
Source:
<code>public TextDocumentInput(String id, String text) { this.id = id; this.text = text; <START> this.language = "en"; <END> }</code><technical_language>is language set english? matter pass in for language, language is english</technical_language>

Target:
public TextDocumentInput(String id, String text) { this.id = id; this.text = text; }
Source:
<code>private void processUpdateMessages(List<EventsBranch> updateEvents) { for (EventsBranch event : updateEvents) { UpdateMessageWrapper updateEvent = (UpdateMessageWrapper) event; Message message = updateEvent.getMessage(); if (message != null) { message.setFormattedContent(updateEvent.getFormattedContent()); Dao<Message, Integer> messageDao = app.getDao(Message.class); try { messageDao.update(message); } catch (SQLException e) { ZLog.logException(e); } } } mActivity.runOnUiThread(new Runnable() { @Override public void run() { <START> mActivity.getCurrentMessageList().getAdapter().notifyDataSetChanged(); <END> } }); }</code><technical_language>This notifyDataSetChanged() changed message ID find index of message in list notifyItemChanged(int);</technical_language>

Target:
private void processUpdateMessages(List<EventsBranch> updateEvents) { final List<Integer> messageIds = new ArrayList<>(); for (EventsBranch event : updateEvents) { UpdateMessageWrapper updateEvent = (UpdateMessageWrapper) event; Message message = updateEvent.getMessage(); if (message != null) { message.setFormattedContent(updateEvent.getFormattedContent()); message.setHasBeenEdited(true); Dao<Message, Integer> messageDao = app.getDao(Message.class); try { messageDao.update(message); messageIds.add(message.getId()); } catch (SQLException e) { ZLog.logException(e); } } } mActivity.runOnUiThread(new Runnable() { @Override public void run() { RecyclerMessageAdapter adapter = mActivity.getCurrentMessageList().getAdapter(); for (int id : messageIds) { adapter.notifyItemChanged(adapter.getItemIndex(id)); } } }); }
Source:
<code>private static ModuleDescription getResourceForModule(String moduleName, String categoryPath) { String pathToModule = String.join("/", moduleName.split("\\.")); String fullPathToModule = categoryPath + pathToModule + ".pyi"; InputStream resource = TypeShed.class.getResourceAsStream(fullPathToModule); if (resource == null) { fullPathToModule = categoryPath + moduleName + "/__init__.pyi"; resource = TypeShed.class.getResourceAsStream(fullPathToModule); if (resource == null) { return null; } } String fileName = Paths.get(fullPathToModule).getFileName().toString(); <START> fileName = fileName.substring(0, fileName.length() - 4); <END> return new ModuleDescription(resource, fileName, moduleName); }</code><technical_language>4</technical_language>

Target:
private static ModuleDescription getResourceForModule(String moduleName, String categoryPath) { String[] moduleNameHierarchy = moduleName.split("\\."); String pathToModule = String.join("/", moduleNameHierarchy); String moduleFileName = moduleNameHierarchy[moduleNameHierarchy.length - 1]; String packageName = String.join(".", Arrays.copyOfRange(moduleNameHierarchy, 0, moduleNameHierarchy.length - 1)); InputStream resource = TypeShed.class.getResourceAsStream(categoryPath + pathToModule + ".pyi"); if (resource == null) { resource = TypeShed.class.getResourceAsStream(categoryPath + moduleName + "/__init__.pyi"); if (resource == null) { return null; } moduleFileName = "__init__"; packageName = moduleName; } return new ModuleDescription(resource, moduleFileName, packageName); }
Source:
<code><START> public CloseableIterator<SAMRecord> queryAlignmentStart(String sequence, int start) { throw new RuntimeException("queryAlignmentStart is not implemented."); } <END></code><technical_language>UnsupportedOperationException (here below)</technical_language>

Target:
public CloseableIterator<SAMRecord> queryAlignmentStart(String sequence, int start) { int sequenceIndex = virtualHeader.getSequenceIndex(sequence); if (sequenceIndex == -1) { throw new IllegalArgumentException("Unknown sequence '" + sequence + "' was passed to SRAFileReader"); } return getIterator(getSpanContained(sequenceIndex, start, -1)); }
Source:
<code>protected TupleBatch fetchNextReady() throws Exception { TupleBatch nexttb = ans.popAnyUsingTimeout(); if (nexttb != null) { return nexttb; } if (!loadInitially()) { return null; } while (nexttb == null && !deferredEOS) { final int compared = leftBatches.getLast().tupleCompare(leftCompareIndx, leftRowIndex, rightBatches.getLast(), rightCompareIndx, rightRowIndex, ascending); if (compared == 0) { leftAndRightEqual(); } else if (compared > 0) { rightIsLess(); } else { leftIsLess(); } nexttb = ans.popFilled(); if (nexttb != null) { return nexttb; <START> } <END> } if (deferredEOS) { nexttb = ans.popAny(); if (nexttb == null) { setEOS(); } else { return nexttb; } } return nexttb; }</code><technical_language>This while loop jumped out if 1. If is newly generated tuples in ans 2. If deferredEOS happen if in this of merge join, is result tuple generated deferredEOS reached</technical_language>

Target:
protected TupleBatch fetchNextReady() throws Exception { TupleBatch nexttb = ans.popAnyUsingTimeout(); if (nexttb != null) { return nexttb; } loadInitially(); if (leftBatches.size() == 0 || rightBatches.size() == 0) { return null; } needData = false; while (nexttb == null && !deferredEOS && !needData) { final int compared = leftBatches.getLast().tupleCompare(leftCompareIndx, leftRowIndex, rightBatches.getLast(), rightCompareIndx, rightRowIndex, ascending); if (compared == 0) { Preconditions.checkState(leftBatches.getLast().tupleCompare(leftCompareIndx, leftRowIndex, rightBatches.getLast(), rightCompareIndx, rightRowIndex, ascending) == 0); Preconditions.checkState(leftBatches.getFirst().tupleCompare(leftCompareIndx, leftBeginIndex, rightBatches.getFirst(), rightCompareIndx, rightBeginIndex, ascending) == 0); leftAndRightEqual(); } else if (compared > 0) { rightIsLess(); } else { leftIsLess(); } nexttb = ans.popFilled(); if (nexttb != null) { return nexttb; } } if (deferredEOS) { nexttb = ans.popAny(); if (nexttb == null) { setEOS(); } } return nexttb; }
Source:
<code>public static void main(String[] args) { OAuthService service = new ServiceBuilder() .provider(LinkedInApi.class) <START> .apiKey("mkz553lz3k26") <END> .apiSecret("BtL5Oz3S6Tpn0as8") .build(); Scanner in = new Scanner(System.in); System.out.println("=== LinkedIn's OAuth Workflow ==="); System.out.println(); System.out.println("Fetching the Request Token..."); Token requestToken = service.getRequestToken(); System.out.println("Got the Request Token!"); System.out.println(); System.out.println("Now go and authorize Scribe here:"); System.out.println(service.getAuthorizationUrl(requestToken)); System.out.println("And paste the verifier here"); System.out.print(">>"); Verifier verifier = new Verifier(in.nextLine()); System.out.println(); System.out.println("Trading the Request Token for an Access Token..."); Token accessToken = service.getAccessToken(requestToken, verifier); System.out.println("Got the Access Token!"); System.out.println("(if your curious it looks like this: " + accessToken + " )"); System.out.println(); System.out.println("Now we're going to access a protected resource..."); OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL); service.signRequest(accessToken, request); Response response = request.send(); System.out.println("Got it! Lets see what we found..."); System.out.println(); System.out.println(response.getBody()); System.out.println(); System.out.println("Thats it man! Go and build something awesome with Scribe! :)"); }</code><technical_language>change please</technical_language>

Target:
public static void main(String[] args) { OAuthService service = new ServiceBuilder() .provider(LinkedInApi.class) .apiKey("CiEgwWDkA5BFpNrc0RfGyVuSlOh4tig5kOTZ9q97qcXNrFl7zqk-Ts7DqRGaKDCV") .apiSecret("dhho4dfoCmiQXrkw4yslork5XWLFnPSuMR-8gscPVjY4jqFFHPYWJKgpFl4uLTM6") .build(); Scanner in = new Scanner(System.in); System.out.println("=== LinkedIn's OAuth Workflow ==="); System.out.println(); System.out.println("Fetching the Request Token..."); Token requestToken = service.getRequestToken(); System.out.println("Got the Request Token!"); System.out.println(); System.out.println("Now go and authorize Scribe here:"); System.out.println(service.getAuthorizationUrl(requestToken)); System.out.println("And paste the verifier here"); System.out.print(">>"); Verifier verifier = new Verifier(in.nextLine()); System.out.println(); System.out.println("Trading the Request Token for an Access Token..."); Token accessToken = service.getAccessToken(requestToken, verifier); System.out.println("Got the Access Token!"); System.out.println("(if your curious it looks like this: " + accessToken + " )"); System.out.println(); System.out.println("Now we're going to access a protected resource..."); OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL); service.signRequest(accessToken, request); Response response = request.send(); System.out.println("Got it! Lets see what we found..."); System.out.println(); System.out.println(response.getBody()); System.out.println(); System.out.println("Thats it man! Go and build something awesome with Scribe! :)"); }
Source:
<code>private Runnable getNodesHouseKeepingHandler() { return () -> { List<String> unavailableNodesUrls = this.rmCoreStub.getToBeRemovedUnavailableNodesUrls(); if (!unavailableNodesUrls.isEmpty()) { logger.info("Remove " + unavailableNodesUrls.size() + " unavailable nodes"); <START> if (logger.isDebugEnabled() && unavailableNodesUrls.size() < 100) { <END> logger.debug("Nodes URL: " + Arrays.toString(unavailableNodesUrls.toArray())); } unavailableNodesUrls.forEach(nodeUrl -> this.rmCoreStub.removeNode(nodeUrl, true)); } }; }</code><technical_language>I this information belongs info level. is done often, is done, nodes removed</technical_language>

Target:
private Runnable getNodesHouseKeepingHandler() { return () -> { List<String> unavailableNodesUrls = this.rmCoreStub.getToBeRemovedUnavailableNodesUrls(); if (!unavailableNodesUrls.isEmpty()) { logger.info("Remove " + unavailableNodesUrls.size() + " unavailable nodes: " + Arrays.toString(unavailableNodesUrls.toArray())); unavailableNodesUrls.forEach(nodeUrl -> this.rmCoreStub.removeNode(nodeUrl, true)); } }; }