auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String getAmaUrl() { String mcSchema = (getMcPort() == "443") ? "https" : "http"; <START> return mcSchema + "://" + getMcHost(); <END> }</code><technical_language>If port is other 80 443, included in URL</technical_language>

Target:
public String getAmaUrl() { String port = getMcPort(); String context = getMcContext(); String amaUrl = new String(); switch (port) { case "80": amaUrl = "http://" + getMcHost(); break; case "443": amaUrl = "https://" + getMcHost(); break; default: amaUrl = "http://" + getMcHost() + ":" + port; break; } if (!StringUtils.isEmpty(context)) { amaUrl += "/" + context; } return amaUrl; }
Source:
<code>public boolean equals(Object o) { <START> if(!(o instanceof Account)) { <END> return false; } return ((Account) o).getId().equals(getId()); }</code><technical_language>nit: space if (</technical_language>

Target:
public boolean equals(Object o) { return o instanceof Account && ((Account) o).getId().equals(getId()); }
Source:
<code>public static Optional<CompletableFuture<String>> upload(File file, Runnable preparedAction, Consumer<String> callback, Type fileType) { if (!Configuration.getBoolean(Configuration.Parameter.S3_UPLOAD_ENABLE)) { <START> LOGGER.debug("there is no sense to continue as saving screenshots onto S3 is disabled."); <END> return Optional.empty(); } preparedAction.run(); return Optional.ofNullable(CompletableFuture.supplyAsync(() -> { String url = null; try { int expiresIn = Configuration.getInt(Configuration.Parameter.ARTIFACTS_EXPIRATION_SECONDS); LOGGER.debug("Uploading to AWS: " + file.getName() + ". Expires in " + expiresIn + " seconds."); url = ZafiraSingleton.INSTANCE.getClient().uploadFile(file, expiresIn, String.format(fileType.getPath() + "/%s/", DATE_FORMAT.format(new Date()))); LOGGER.debug("Uploaded to AWS: " + file.getName()); callback.accept(url); LOGGER.debug("Updated AWS metadata: " + file.getName()); } catch (Exception e) { LOGGER.debug("Can't save file to Amazon S3!", e); } return url; }, executorService).exceptionally(e -> { LOGGER.debug("Can't save file to Amazon S3!", e); return null; })); }</code><technical_language>saving _artifacts_ S3</technical_language>

Target:
public static Optional<CompletableFuture<String>> upload(File file, Runnable preparedAction, Consumer<String> callback, Type fileType) { preparedAction.run(); return Optional.ofNullable(CompletableFuture.supplyAsync(() -> { String url = null; try { int expiresIn = Configuration.getInt(Configuration.Parameter.ARTIFACTS_EXPIRATION_SECONDS); LOGGER.debug("Uploading to AWS: " + file.getName() + ". Expires in " + expiresIn + " seconds."); url = ZafiraSingleton.INSTANCE.getClient().uploadFile(file, expiresIn, String.format(fileType.getPath() + "/%s/", DATE_FORMAT.format(new Date()))); LOGGER.debug("Uploaded to AWS: " + file.getName()); callback.accept(url); LOGGER.debug("Updated AWS metadata: " + file.getName()); } catch (Exception e) { LOGGER.debug("Can't save file to Amazon S3!", e); } return url; }, executorService).exceptionally(e -> { LOGGER.debug("Can't save file to Amazon S3!", e); return null; })); }
Source:
<code>public Node visitBlock(BlockContext ctx) { List<VarRefNode> arguments = new ArrayList<>(); for (DeclContext node : ctx.decl()) { <START> arguments.add((VarRefNode) visit(node)); <END> } SequenceNode sequence = (SequenceNode) visit(ctx.sequence()); return new BlockNode(sequence, arguments); }</code><technical_language>this a VarDeclNode, a VarRefNode, right</technical_language>

Target:
public Node visitBlock(BlockContext ctx) { List<VarRefNode> arguments = new ArrayList<>(); for (DeclContext node : ctx.decl()) { arguments.add((VarDeclNode) visit(node)); } SequenceNode sequence = (SequenceNode) visit(ctx.sequence()); return new BlockNode(sequence, arguments); }
Source:
<code>public Optional<Decorrelated> visitFilter(FilterNode node, PlanNode reference) { Optional<Decorrelated> result = decorrelate(node.getSource()); <START> return result.map(decorrelated -> { <END> return new Decorrelated( ImmutableList.<Expression>builder() .addAll(decorrelated.getCorrelatedPredicates()) .add(node.getPredicate()) .build(), decorrelated.getDecorrelatedNode() ); }); }</code><technical_language>need for { ... } return. a single expression</technical_language>

Target:
public Optional<Decorrelated> visitFilter(FilterNode node, PlanNode reference) { Optional<Decorrelated> result = decorrelate(node.getSource()); return result.map(decorrelated -> new Decorrelated( ImmutableList.<Expression>builder() .addAll(decorrelated.getCorrelatedPredicates()) .add(node.getPredicate()) .build(), decorrelated.getDecorrelatedNode() )); }
Source:
<code>public static AbstractTaskContextStore loadTaskContextStore() { ExtensionPointReader<AbstractTaskContextStore> reader = new ExtensionPointReader<AbstractTaskContextStore>( ITasksCoreConstants.ID_PLUGIN, "contextStore", "contextStore", AbstractTaskContextStore.class); IStatus status = reader.read(); if (!status.isOK()) { <START> StatusHandler.log(status); <END> } AbstractTaskContextStore contextStore = reader.getItem(); if (contextStore != null) { return contextStore; } return new DefaultTaskContextStore(); }</code><technical_language>This inorg.eclipse.mylyn.commons.core.ExtensionPointReader.handleResult(IStatus)</technical_language>

Target:
public static AbstractTaskContextStore loadTaskContextStore() { ExtensionPointReader<AbstractTaskContextStore> reader = new ExtensionPointReader<AbstractTaskContextStore>( ITasksCoreConstants.ID_PLUGIN, "contextStore", "contextStore", AbstractTaskContextStore.class); reader.read(); AbstractTaskContextStore contextStore = reader.getItem(); if (contextStore != null) { return contextStore; } return new DefaultTaskContextStore(); }
Source:
<code>public static void assertUsername(String strippedUsername) { profilePage.clickOnDropDownMenuForUserOnMainPage(); profilePage.clickOnProfileInDropDownMenu(); profilePage.openMainProfileTab(); info("Begin asserting the automatic stripping of the excess spaces in username"); <START> assertTrue("Excess space characters were not cut", profilePage.getUsernameTableField().getText().equals(strippedUsername)); <END> info("Excess space characters are stripped to 1 in the middle"); }</code><technical_language>simplify expression: assertEquals(profilePage.getUsername(), strippedUsername);</technical_language>

Target:
public static void assertUsername(String strippedUsername) { profilePage.clickOnDropDownMenuForUserOnMainPage(); profilePage.clickOnProfileInDropDownMenu(); profilePage.openMainProfileTab(); info("Asserting that username on profile is same as: " + strippedUsername); profilePage.assertUsernameInProfile(strippedUsername); info("Assertion passed"); }
Source:
<code>public CountingMap<String> getSegmentAvailability() { return getSegmentStats( new Function<DataSegment, Integer>() { @Override public Integer apply(DataSegment input) { <START> int available = (segmentReplicantLookup.getTotalReplicants(input.getIdentifier()) == 0) ? 0 : 1; <END> return 1 - available; } } ); }</code><technical_language>boolean logic numeric in return value? numbers booleans harder read</technical_language>

Target:
public CountingMap<String> getSegmentAvailability() { final CountingMap<String> retVal = new CountingMap<>(); if (segmentReplicantLookup == null) { return retVal; } for (DataSegment segment : getAvailableDataSegments()) { int available = (segmentReplicantLookup.getTotalReplicants(segment.getIdentifier()) == 0) ? 0 : 1; retVal.add(segment.getDataSource(), 1 - available); } return retVal; }
Source:
<code>public void start() { scheduledExecutor = Execs.scheduledSingleThreaded("coordinator_handoff_scheduled_%d"); scheduledExecutor.scheduleAtFixedRate( <START> new Runnable() <END> { @Override public void run() { Iterator<Map.Entry<SegmentDescriptor, Pair<Executor, Runnable>>> itr = handOffCallbacks.entrySet() .iterator(); while (itr.hasNext()) { Map.Entry<SegmentDescriptor, Pair<Executor, Runnable>> entry = itr.next(); SegmentDescriptor descriptor = entry.getKey(); try { List<SegmentLoadInfo> serverView = coordinatorClient.fetchServerView( dataSource, descriptor.getInterval(), true ); if (isHandOffComplete(serverView, entry.getKey())) { log.info("Segment Handoff complete for dataSource[%s] Segment[%s]", dataSource, descriptor); entry.getValue().lhs.execute(entry.getValue().rhs); itr.remove(); } else { log.info( "Segment Handoff not complete for dataSource[%s] Segment[%s]. Will try again after [%d]secs", dataSource, descriptor, pollDurationMillis ); } } catch (Exception e) { log.error( e, "Exception while checking handoff for dataSource[%s] Segment[%s], Will try again after [%d]secs", dataSource, descriptor, pollDurationMillis ); } } } }, 0L, pollDurationMillis, TimeUnit.MILLISECONDS ); }</code><technical_language>wrap entire Runnable scheduling in a try/catch if want continue running. If exception _ever_ out of Runnable, schedule halt. a try/catch some of business logic, if get NPE 80 for some reason itr.next() throws exception something</technical_language>

Target:
public void start() { scheduledExecutor = Execs.scheduledSingleThreaded("coordinator_handoff_scheduled_%d"); scheduledExecutor.scheduleAtFixedRate( new Runnable() { @Override public void run() { checkForSegmentHandoffs(); } }, 0L, pollDurationMillis, TimeUnit.MILLISECONDS ); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; <START> if (obj.getClass() != this.getClass()) { <END> return false; } EngineBackupLog other = (EngineBackupLog)obj; return (dbName.equals(other.getDbName()) && doneAt.equals(other.getDoneAt())); }</code><technical_language>Liran, Yevgeny, hibernate creates a proxy for entities, is a need enforce in equals impl of methods "is instance of" settle for getClass() comparison</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof EngineBackupLogId)) { return false; } EngineBackupLog other = (EngineBackupLog)obj; return (dbName.equals(other.getDbName()) && doneAt.equals(other.getDoneAt())); }
Source:
<code>public <T> T create0(Class<T> entityViewClass, Map<String, Object> optionalParameters) { Constructor<T> constructor = (Constructor<T>) createConstructorCache.get(entityViewClass); CREATION: try { if (constructor == null) { ManagedViewTypeImplementor<T> managedViewType = metamodel.managedView(entityViewClass); if (!managedViewType.isCreatable()) { break CREATION; } Class<? extends T> proxyClass = proxyFactory.getProxy(this, managedViewType); constructor = (Constructor<T>) proxyClass.getConstructor(proxyClass, Map.class); createConstructorCache.put(entityViewClass, constructor); } return constructor.newInstance(null, optionalParameters); } catch (Exception e) { <START> e.printStackTrace(); <END> throw new IllegalArgumentException("Couldn't instantiate entity view object for type: " + entityViewClass.getName() + "\nDid you forget to add a no-args constructor to the view? Consider adding a no-args constructor annotated with @ViewConstructor(\"create\").", e); } throw new IllegalArgumentException("Can't create instance of non-creatable view type: " + entityViewClass.getName() + "\nDid you forget to annotate it with @CreatableEntityView?"); }</code><technical_language>Remove suggestion</technical_language>

Target:
public <T> T create0(Class<T> entityViewClass, Map<String, Object> optionalParameters) { Constructor<T> constructor = (Constructor<T>) createConstructorCache.get(entityViewClass); CREATION: try { if (constructor == null) { ManagedViewTypeImplementor<T> managedViewType = metamodel.managedView(entityViewClass); if (!managedViewType.isCreatable()) { break CREATION; } Class<? extends T> proxyClass = proxyFactory.getProxy(this, managedViewType); constructor = (Constructor<T>) proxyClass.getConstructor(proxyClass, Map.class); createConstructorCache.put(entityViewClass, constructor); } return constructor.newInstance(null, optionalParameters); } catch (Exception e) { throw new IllegalArgumentException("Couldn't instantiate entity view object for type: " + entityViewClass.getName() + "\nDid you forget to add a no-args constructor to the view? Consider adding a no-args constructor annotated with @ViewConstructor(\"create\").", e); } throw new IllegalArgumentException("Can't create instance of non-creatable view type: " + entityViewClass.getName() + "\nDid you forget to annotate it with @CreatableEntityView?"); }
Source:
<code>public String destroy(Request request, Response response) throws IOException { <START> final String materialName = request.params(MATERIAL_NAME); <END> SCM scm = fetchEntityFromConfig(materialName); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); pluggableScmService.deletePluggableSCM(currentUsername(), scm, result); return renderHTTPOperationResult(result, request, response); }</code><technical_language>above, is delete SCM's ConfigRepo handled</technical_language>

Target:
public String destroy(Request request, Response response) throws IOException { final String materialName = request.params(MATERIAL_NAME); SCM scm = fetchEntityFromConfig(materialName); haltIfEntityIsDefinedRemotely(scm); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); pluggableScmService.deletePluggableSCM(currentUsername(), scm, result); return renderHTTPOperationResult(result, request, response); }
Source:
<code>public void testLoadingDefaultPropertiesFile() throws IOException { reader.loadDefaultPropertyFile(DEFAULT_PROPERTIES_FILE, topologyProperties); assertNotNull(topologyProperties); assertFalse(topologyProperties.isEmpty()); for (final Map.Entry<Object, Object> e : topologyProperties.entrySet()) { <START> assertNotNull(e.getKey()); <END> } }</code><technical_language>is idea checking keys in map null? This applies tests here..</technical_language>

Target:
public void testLoadingDefaultPropertiesFile() throws IOException { reader.loadDefaultPropertyFile(DEFAULT_PROPERTIES_FILE, topologyProperties); assertNotNull(topologyProperties); assertFalse(topologyProperties.isEmpty()); }
Source:
<code>public Collection<PlannedNode> provision(Label label, int excessWorkload) { List<PlannedNode> list = new ArrayList<PlannedNode>(); try { while (excessWorkload > 0) { if (onDemandRegistration) { <START> SchedularSupervisor.LOCK.lock(); <END> try { LOGGER.fine("Checking if scheduler is running?"); if (!Mesos.getInstance().isSchedulerRunning()) { LOGGER.info("Creating scheduler, as it was not running."); restartMesos(); } } finally { SchedularSupervisor.LOCK.unlock(); } } final int numExecutors = Math.min(excessWorkload, getMaxExecutors()); excessWorkload -= numExecutors; LOGGER.info("Provisioning Jenkins Slave on Mesos with " + numExecutors + " executors. Remaining excess workload: " + excessWorkload + " executors)"); list.add(new PlannedNode(this.getDisplayName(), Computer.threadPoolForRemoting .submit(new Callable<Node>() { public Node call() throws Exception { MesosSlave s = doProvision(numExecutors); return s; } }), numExecutors)); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Failed to create instances on Mesos", e); return Collections.emptyList(); } return list; }</code><technical_language>s/SchedularSupervisor/SchedulerSupervisor/</technical_language>

Target:
public Collection<PlannedNode> provision(Label label, int excessWorkload) { List<PlannedNode> list = new ArrayList<PlannedNode>(); final MesosSlaveInfo slaveInfo = getSlaveInfo(slaveInfos, label); try { while (excessWorkload > 0) { if (onDemandRegistration) { JenkinsScheduler.SUPERVISOR_LOCK.lock(); try { LOGGER.fine("Checking if scheduler is running"); if (!Mesos.getInstance().isSchedulerRunning()) { restartMesos(); } } finally { JenkinsScheduler.SUPERVISOR_LOCK.unlock(); } } final int numExecutors = Math.min(excessWorkload, slaveInfo.getMaxExecutors()); excessWorkload -= numExecutors; LOGGER.info("Provisioning Jenkins Slave on Mesos with " + numExecutors + " executors. Remaining excess workload: " + excessWorkload + " executors)"); list.add(new PlannedNode(this.getDisplayName(), Computer.threadPoolForRemoting .submit(new Callable<Node>() { public Node call() throws Exception { MesosSlave s = doProvision(numExecutors, slaveInfo); return s; } }), numExecutors)); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Failed to create instances on Mesos", e); return Collections.emptyList(); } return list; }
Source:
<code>public void applyChanges(SampleAnalyte target, SampleAnalyte source) throws IOException { target.setRegion(source.getRegion()); target.setTubeId(source.getTubeId()); target.setStrStatus(source.getStrStatus()); target.getSample().getSampleAdditionalInfo().setGroupId(source.getSample().getSampleAdditionalInfo().getGroupId()); <START> target.getSample().getSampleAdditionalInfo().setGroupDescription(source.getSample().getSampleAdditionalInfo().getGroupDescription()); <END> loadMembers(target, source); }</code><technical_language>lines removed. This in DefaultSampleAdditionalInfoService</technical_language>

Target:
public void applyChanges(SampleAnalyte target, SampleAnalyte source) throws IOException { target.setRegion(source.getRegion()); target.setTubeId(source.getTubeId()); target.setStrStatus(source.getStrStatus()); loadMembers(target, source); }
Source:
<code>public void remove(@Nonnull K key, @Nonnull V value) { assert key != null; assert value != null; int index = findIndex(key); assert index != -1; ArrayList<V> keyValues = getValues(index); assert keyValues != null; assert keyValues.size() > 0; if (keyValues.size() > 1) { getValues(index).remove(value); } else { assert value.equals(keyValues.get(0)); K[] newKeys = (K[]) new Object[keys.length - 1]; Object[] newValues = new Object[values.length - 1]; int <START> firstFree = <END> 0; for (int i = 0; i < keys.length; ++i) { if (!key.equals(keys[i])) { newKeys[firstFree] = keys[i]; newValues[firstFree] = values[i]; ++firstFree; } } keys = newKeys; values = newValues; } }</code><technical_language>I understand naming</technical_language>

Target:
public void remove(@Nonnull K key, @Nonnull V value) { assert key != null; assert value != null; int index = findIndex(key); assert index != -1; ArrayList<V> keyValues = getValues(index); assert keyValues != null; assert keyValues.size() > 0; if (keyValues.size() > 1) { getValues(index).remove(value); } else { assert value.equals(keyValues.get(0)); K[] newKeys = (K[]) new Object[keys.length - 1]; Object[] newValues = new Object[values.length - 1]; int positionToInsertNext = 0; for (int i = 0; i < keys.length; ++i) { if (!key.equals(keys[i])) { newKeys[positionToInsertNext] = keys[i]; newValues[positionToInsertNext] = values[i]; ++positionToInsertNext; } } keys = newKeys; values = newValues; } }
Source:
<code>@Test public void shouldPostBookingFormAsyncThrowError() { final InputForm inputForm = mock(InputForm.class); String responseError = "{\"error\":\"That userToken is unrecognised.\",\"errorCode\":401,\"usererror\":false}"; ResponseBody responseBody = ResponseBody.create(MediaType.parse("application/json"), responseError); final Response<BookingForm> response = Response.error(401, responseBody); when(bookingApi.postFormAsync("url", inputForm)) .thenReturn(Observable.just(response)); final TestSubscriber<BookingForm> subscriber = new TestSubscriber<>(); service.postFormAsync("url", inputForm).subscribe(subscriber); subscriber.awaitTerminalEvent(); subscriber.assertError(BookingError.class); Throwable error = subscriber.getOnErrorEvents().get(0); <START> assertThat(error instanceof BookingError).isTrue(); <END> }</code><technical_language>if test specifics of error as: assertThat(error.getError()).isEqualsTo("That userToken is unrecognised");</technical_language>

Target:
@Test public void shouldPostBookingFormAsyncThrowError() { final InputForm inputForm = mock(InputForm.class); String responseError = "{\"error\":\"That userToken is unrecognised.\",\"errorCode\":401,\"usererror\":false}"; ResponseBody responseBody = ResponseBody.create(MediaType.parse("application/json"), responseError); final Response<BookingForm> response = Response.error(401, responseBody); when(bookingApi.postFormAsync("url", inputForm)) .thenReturn(Observable.just(response)); final TestSubscriber<BookingForm> subscriber = new TestSubscriber<>(); service.postFormAsync("url", inputForm).subscribe(subscriber); subscriber.awaitTerminalEvent(); subscriber.assertError(BookingError.class); Throwable error = subscriber.getOnErrorEvents().get(0); assertThat(error.getMessage()).isEqualTo("That userToken is unrecognised."); }
Source:
<code>@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (getIntent().getBooleanExtra(DeepLink.IS_DEEP_LINK, false)) { Bundle parameters = getIntent().getExtras(); Log.d(TAG, "Deeplink params: " + parameters); String idString = parameters.getString("id"); String name = parameters.getString("name"); if(!TextUtils.isEmpty(idString)) showToast("class id== " + idString + " and name==" + name); else{ showToast("no id in the deeplink"); } <START> }else{ <END> showToast("no deep link :( "); } }</code><technical_language>formatting is a in this file. please reformat 2 spaces indentation? spaces curly braces else statement</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (getIntent().getBooleanExtra(DeepLink.IS_DEEP_LINK, false)) { Bundle parameters = getIntent().getExtras(); Log.d(TAG, "Deeplink params: " + parameters); String idString = parameters.getString("id"); String name = parameters.getString("name"); if (!TextUtils.isEmpty(idString)) { showToast("class id== " + idString + " and name==" + name); } else { showToast("no id in the deeplink"); } } else { showToast("no deep link :( "); } }
Source:
<code>public ServerWritePerfRun(int threadIndex, Throttler throttler, AtomicBoolean isShutdown, CountDownLatch latch, int minBlobSize, int maxBlobSize, FileWriter blobIdWriter, FileWriter performanceWriter, AtomicLong totalTimeTaken, AtomicLong totalWrites, long measurementIntervalNs, boolean enableVerboseLogging, ClusterMap clusterMap, ConnectionPool connectionPool) { this.threadIndex = threadIndex; this.throttler = throttler; this.isShutdown = isShutdown; this.latch = latch; this.clusterMap = clusterMap; this.minBlobSize = minBlobSize; this.maxBlobSize = maxBlobSize; this.blobIdWriter = blobIdWriter; this.performanceWriter = performanceWriter; this.totalTimeTaken = totalTimeTaken; this.totalWrites = totalWrites; this.measurementIntervalNs = measurementIntervalNs; this.enableVerboseLogging = enableVerboseLogging; this.connectionPool = connectionPool; Properties props = new Properties(); props.setProperty("router.hostname", "localhost"); props.setProperty("router.datacenter.name", "localDC"); <START> blobIdVersion = new RouterConfig(new VerifiableProperties(props)).routerBlobIdCurrentVersion; <END> }</code><technical_language>I if default stored a constant of RouterConfig, instead of construct properties objects in of places</technical_language>

Target:
public ServerWritePerfRun(int threadIndex, Throttler throttler, AtomicBoolean isShutdown, CountDownLatch latch, int minBlobSize, int maxBlobSize, FileWriter blobIdWriter, FileWriter performanceWriter, AtomicLong totalTimeTaken, AtomicLong totalWrites, long measurementIntervalNs, boolean enableVerboseLogging, ClusterMap clusterMap, ConnectionPool connectionPool) { this.threadIndex = threadIndex; this.throttler = throttler; this.isShutdown = isShutdown; this.latch = latch; this.clusterMap = clusterMap; this.minBlobSize = minBlobSize; this.maxBlobSize = maxBlobSize; this.blobIdWriter = blobIdWriter; this.performanceWriter = performanceWriter; this.totalTimeTaken = totalTimeTaken; this.totalWrites = totalWrites; this.measurementIntervalNs = measurementIntervalNs; this.enableVerboseLogging = enableVerboseLogging; this.connectionPool = connectionPool; Properties props = new Properties(); props.setProperty("router.hostname", "localhost"); props.setProperty("router.datacenter.name", "localDC"); blobIdVersion = new RouterConfig(new VerifiableProperties(props)).routerBlobidCurrentVersion; }
Source:
<code>private void traverseDownstream(CaseInsensitiveString upstreamPipelineName, Map<CaseInsensitiveString, List<PipelineConfig>> pipelineToDownstreamMap, ValueStreamMap graph, List<PipelineConfig> visitedNodes) { List<PipelineConfig> downstreamPipelines = pipelineToDownstreamMap.get(upstreamPipelineName); <START> traverseDownstream(upstreamPipelineName.toString(), downstreamPipelines, pipelineToDownstreamMap, graph, visitedNodes); <END> }</code><technical_language>upstreamPipelineName.toString() is needed <LINK_0> pipeline name is converted CaseInsensitiveString</technical_language>

Target:
private void traverseDownstream(CaseInsensitiveString upstreamPipelineName, Map<CaseInsensitiveString, List<PipelineConfig>> pipelineToDownstreamMap, ValueStreamMap graph, List<PipelineConfig> visitedNodes) { List<PipelineConfig> downstreamPipelines = pipelineToDownstreamMap.get(upstreamPipelineName); traverseDownstream(upstreamPipelineName, downstreamPipelines, pipelineToDownstreamMap, graph, visitedNodes); }
Source:
<code>public ListenableFuture<List<Availability>> tagAvailabilityData(AvailabilityMetric metric, final Map<String, String> tags, long timestamp) { ListenableFuture<ResultSet> queryFuture = dataAccess.findData(metric, timestamp); ListenableFuture<List<Availability>> dataFuture = Futures.transform(queryFuture, new AvailabilityDataMapper(true), metricsTasks); int ttl = getTTL(metric); ListenableFuture<List<Availability>> updatedDataFuture = Futures.transform(dataFuture, new ComputeTTL<>(ttl)); return Futures.transform(updatedDataFuture, new AsyncFunction<List<Availability>, List<Availability>>() { @Override public ListenableFuture<List<Availability>> apply(final List<Availability> data) throws Exception { if (data.isEmpty()) { List<Availability> results = Collections.emptyList(); return Futures.immediateFuture(results); } List<ResultSetFuture> insertFutures = new ArrayList<>(); tags.forEach((k, v) -> dataAccess.insertAvailabilityTag(k, v, data)); for (Availability a : data) { <START> insertFutures.add(dataAccess.updateDataWithTag(a, tags)); <END> } ListenableFuture<List<ResultSet>> insertsFuture = Futures.allAsList(insertFutures); return Futures.transform(insertsFuture, (List<ResultSet> resultSets) -> data); } }); }</code><technical_language>I looked details, changes in tags model? (It Map<String, Optional<String>> everywhere)</technical_language>

Target:
public ListenableFuture<List<Availability>> tagAvailabilityData(AvailabilityMetric metric, final Map<String, String> tags, long timestamp) { ListenableFuture<ResultSet> queryFuture = dataAccess.findData(metric, timestamp); ListenableFuture<List<Availability>> dataFuture = Futures.transform(queryFuture, new AvailabilityDataMapper(true), metricsTasks); int ttl = getTTL(metric); ListenableFuture<List<Availability>> updatedDataFuture = Futures.transform(dataFuture, new ComputeTTL<>(ttl)); return Futures.transform(updatedDataFuture, new AsyncFunction<List<Availability>, List<Availability>>() { @Override public ListenableFuture<List<Availability>> apply(final List<Availability> data) throws Exception { if (data.isEmpty()) { List<Availability> results = Collections.emptyList(); return Futures.immediateFuture(results); } List<ResultSetFuture> insertFutures = new ArrayList<>(); tags.forEach((k, v) -> dataAccess.insertAvailabilityTag(k, v, metric, data)); for (Availability a : data) { insertFutures.add(dataAccess.updateDataWithTag(metric, a, tags)); } ListenableFuture<List<ResultSet>> insertsFuture = Futures.allAsList(insertFutures); return Futures.transform(insertsFuture, (List<ResultSet> resultSets) -> data); } }); }
Source:
<code>public static byte[] getTenantIdBytes(RowKeySchema schema, boolean isSalted, PName tenantId) throws SQLException { int pkPos = isSalted ? 1 : 0; Field field = schema.getField(pkPos); PDataType dataType = field.getDataType(); byte[] convertedValue; try { Object value = dataType.toObject(tenantId.getString()); <START> convertedValue = dataType.toBytes(value); <END> } catch(IllegalDataException ex) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.TENANTID_IS_OF_WRONG_TYPE) .build().buildException(); } return convertedValue; }</code><technical_language>code pad convertedValue (this a noop for types padded): ImmutableBytesWritable ptr = new ImmutableBytesWritable(convertedValue); dataType.pad(ptr, field.getMaxLength(), field.getSortOrder()); convertedValue = ByteUtil.copyKeyBytesIfNecessary(ptr);</technical_language>

Target:
public static byte[] getTenantIdBytes(RowKeySchema schema, boolean isSalted, PName tenantId) throws SQLException { int pkPos = isSalted ? 1 : 0; Field field = schema.getField(pkPos); PDataType dataType = field.getDataType(); byte[] convertedValue; try { Object value = dataType.toObject(tenantId.getString()); convertedValue = dataType.toBytes(value); ImmutableBytesWritable ptr = new ImmutableBytesWritable(convertedValue); dataType.pad(ptr, field.getMaxLength(), field.getSortOrder()); convertedValue = ByteUtil.copyKeyBytesIfNecessary(ptr); } catch(IllegalDataException ex) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.TENANTID_IS_OF_WRONG_TYPE) .build().buildException(); } return convertedValue; }
Source:
<code>protected Response performRemove(String id) { <START> return performAction(VdcActionType.RemoveExternalEvent, new RemoveExternalEventParameters(Long.valueOf(id))); <END> }</code><technical_language>please implement asLong() method instead of Long.valueOf(id), asGuid(id) for details</technical_language>

Target:
protected Response performRemove(String id) { return performAction(VdcActionType.RemoveExternalEvent, new RemoveExternalEventParameters(asLong(id))); }
Source:
<code>public static boolean isEditAllowed(@NonNull PageTitle title) { return <START> Arrays.asList(ENABLED_LANGUAGES).contains(title.getWikiSite().languageCode()); <END> }</code><technical_language>minor: cleaner initialized ENABLED_LANGUAGES Arrays.asList</technical_language>

Target:
public static boolean isEditAllowed(@NonNull PageTitle title) { return ENABLED_LANGUAGES.contains(title.getWikiSite().languageCode()); }
Source:
<code>public void testRegister() throws Exception { Cluster cluster = getTestCluster(1L); ZookeeperServiceRegistrar registrar = initializeServiceRegistrar(); Config config = new Config(); config.put(ZookeeperServiceRegistrar.PARAM_ZOOKEEPER_SERVER_HOSTNAMES, Lists.newArrayList("zookeeper-1", "zookeeper-2")); config.put(ZookeeperServiceRegistrar.PARAM_ZOOKEEPER_PORT, (Object) 2181); registrar.register(cluster, config, Collections.emptyList()); Service zkService = environmentService.getServiceByName(cluster.getId(), Constants.Zookeeper.SERVICE_NAME); assertNotNull(zkService); Component zkServer = environmentService.getComponentByName(zkService.getId(), ComponentPropertyPattern.ZOOKEEPER_SERVER.name()); <START> assertNotNull(zkServer); <END> Collection<ComponentProcess> zkServerProcesses = environmentService.listComponentProcessesInComponent(zkServer.getId()); assertEquals(Sets.newHashSet("zookeeper-1", "zookeeper-2"), zkServerProcesses.stream().map(ComponentProcess::getHost).collect(Collectors.toSet())); assertEquals(Sets.newHashSet(2181, 2181), zkServerProcesses.stream().map(ComponentProcess::getPort).collect(Collectors.toSet())); ServiceConfiguration zooConf = environmentService.getServiceConfigurationByName(zkService.getId(), CONFIGURATION_NAME_ZOO_CFG); assertNotNull(zooConf); }</code><technical_language>Is this true, depend order of sets? If sporadic test failures</technical_language>

Target:
public void testRegister() throws Exception { Cluster cluster = getTestCluster(1L); ZookeeperServiceRegistrar registrar = initializeServiceRegistrar(); Config config = new Config(); config.put(ZookeeperServiceRegistrar.PARAM_ZOOKEEPER_SERVER_HOSTNAMES, Lists.newArrayList("zookeeper-1", "zookeeper-2")); config.put(ZookeeperServiceRegistrar.PARAM_ZOOKEEPER_PORT, (Object) 2181); registrar.register(cluster, config, Collections.emptyList()); Service zkService = environmentService.getServiceByName(cluster.getId(), Constants.Zookeeper.SERVICE_NAME); assertNotNull(zkService); Component zkServer = environmentService.getComponentByName(zkService.getId(), ComponentPropertyPattern.ZOOKEEPER_SERVER.name()); assertNotNull(zkServer); Collection<ComponentProcess> zkServerProcesses = environmentService.listComponentProcesses(zkServer.getId()); assertEquals(Sets.newHashSet("zookeeper-1", "zookeeper-2"), zkServerProcesses.stream().map(ComponentProcess::getHost).collect(Collectors.toSet())); assertEquals(Sets.newHashSet(2181, 2181), zkServerProcesses.stream().map(ComponentProcess::getPort).collect(Collectors.toSet())); ServiceConfiguration zooConf = environmentService.getServiceConfigurationByName(zkService.getId(), CONFIGURATION_NAME_ZOO_CFG); assertNotNull(zooConf); }
Source:
<code>public static <T, R> IgniteFunction<T, R> constant(R r) { return new IgniteFunction<T, R>() { @Override public String toString() { <START> return "Constant function [c=" + r + "]"; <END> } @Override public R apply(T t) { return r; } }; }</code><technical_language>good toString for functions)</technical_language>

Target:
public static <T, R> IgniteFunction<T, R> constant(R r) { return (IgniteFunction<T, R>)t -> r; }
Source:
<code>protected static String getHttpStatusCode(final ImmutableList<Ds3ResponseCode> responseCodes) { if (isEmpty(responseCodes)) { LOG.error("There are no response codes"); return ""; } final ImmutableList.Builder<Integer> builder = ImmutableList.builder(); responseCodes.stream() .filter(responseCode -> ResponsePayloadUtil.isNonErrorCode(responseCode.getCode())) <START> .forEach(responseCode -> builder.add(responseCode.getCode())); <END> final ImmutableList<Integer> codes = builder.build(); if (isEmpty(codes)) { LOG.error("There are no non-error response codes within the list: " + codes.toString()); return ""; } if (codes.contains(204)) { return "NoContent"; } return "OK"; }</code><technical_language>This a collector instead create list</technical_language>

Target:
protected static String getHttpStatusCode(final ImmutableList<Ds3ResponseCode> responseCodes) { if (isEmpty(responseCodes)) { LOG.error("There are no response codes"); return ""; } final ImmutableList<Integer> codes = responseCodes.stream() .filter(responseCode -> ResponsePayloadUtil.isNonErrorCode(responseCode.getCode())) .map(Ds3ResponseCode::getCode) .collect(GuavaCollectors.immutableList()); if (isEmpty(codes)) { LOG.error("There are no non-error response codes within the list: " + codes.toString()); return ""; } if (codes.contains(204)) { return "NoContent"; } return "OK"; }
Source:
<code>protected Header[] mergeHeaders(final HttpCacheEntry entry, final HttpResponse response) { <START> response.removeHeaders(HTTP.CONTENT_ENCODING); <END> if (entryAndResponseHaveDateHeader(entry, response) && entryDateHeaderNewerThenResponse(entry, response)) { return entry.getAllHeaders(); } final List<Header> cacheEntryHeaderList = new ArrayList<Header>(Arrays.asList(entry .getAllHeaders())); removeCacheHeadersThatMatchResponse(cacheEntryHeaderList, response); removeCacheEntry1xxWarnings(cacheEntryHeaderList, entry); cacheEntryHeaderList.addAll(Arrays.asList(response.getAllHeaders())); return cacheEntryHeaderList.toArray(new Header[cacheEntryHeaderList.size()]); }</code><technical_language>@catchsudheera Sudheera, avoid mutation of original response message? cleaner ignore this header copying updated headers response message instead of deleting original message itself. easier want port mergeHeaders method master <LINK_0></technical_language>

Target:
protected Header[] mergeHeaders(final HttpCacheEntry entry, final HttpResponse response) { if (entryAndResponseHaveDateHeader(entry, response) && entryDateHeaderNewerThenResponse(entry, response)) { return entry.getAllHeaders(); } final HeaderGroup headerGroup = new HeaderGroup(); headerGroup.setHeaders(entry.getAllHeaders()); for (final HeaderIterator it = response.headerIterator(); it.hasNext(); ) { final Header responseHeader = it.nextHeader(); if (HTTP.CONTENT_ENCODING.equals(responseHeader.getName())) { continue; } final Header[] matchingHeaders = headerGroup.getHeaders(responseHeader.getName()); for (final Header matchingHeader : matchingHeaders) { headerGroup.removeHeader(matchingHeader); } } for (final HeaderIterator it = headerGroup.iterator(); it.hasNext(); ) { final Header cacheHeader = it.nextHeader(); if (HeaderConstants.WARNING.equalsIgnoreCase(cacheHeader.getName())) { final String warningValue = cacheHeader.getValue(); if (warningValue != null && warningValue.startsWith("1")) { it.remove(); } } } for (final HeaderIterator it = response.headerIterator(); it.hasNext(); ) { final Header responseHeader = it.nextHeader(); if (HTTP.CONTENT_ENCODING.equals(responseHeader.getName())) { continue; } headerGroup.addHeader(responseHeader); } return headerGroup.getAllHeaders(); }
Source:
<code>public BookKeeper build() throws IOException, InterruptedException, KeeperException { Preconditions.checkNotNull(statsLogger, "No stats logger provided"); if (eventLoopGroup == null) { <START> eventLoopGroup = getDefaultEventLoopGroup(); <END> } return new BookKeeper(conf, zk, eventLoopGroup, statsLogger, dnsResolver, requestTimer, featureProvider); }</code><technical_language>This eventLoopGroup leak. need ownChanelFactory (or ownEventLoopGroup) is set true create eventLoopGroup</technical_language>

Target:
public BookKeeper build() throws IOException, InterruptedException, KeeperException { Preconditions.checkNotNull(statsLogger, "No stats logger provided"); return new BookKeeper(conf, zk, eventLoopGroup, statsLogger, dnsResolver, requestTimer, featureProvider); }
Source:
<code>public static String toTimePrecision(final TimeUnit t) { switch (t) { case HOURS: return "h"; case MINUTES: return "m"; case SECONDS: return "s"; case MILLISECONDS: return "ms"; case MICROSECONDS: return "u"; case NANOSECONDS: <START> return "ns"; <END> default: throw new IllegalArgumentException("time precision must be one of:" + ALLOWED_TIMEUNITS); } }</code><technical_language>unrelated change, if this is a problem, please raise another Issue/PR</technical_language>

Target:
public static String toTimePrecision(final TimeUnit t) { switch (t) { case HOURS: return "h"; case MINUTES: return "m"; case SECONDS: return "s"; case MILLISECONDS: return "ms"; case MICROSECONDS: return "u"; case NANOSECONDS: return "n"; default: throw new IllegalArgumentException("time precision must be one of:" + ALLOWED_TIMEUNITS); } }
Source:
<code>private Map<Guid, Map<Integer, NumaNodeMemoryConsumption>> vmNumaRequirements(List<VM> vmGroup, VDS host) { List<VM> filteredVms = vmGroup.stream() .filter(vm -> vm.getNumaTuneMode() != NumaTuneMode.PREFERRED) .filter(vm -> !host.getId().equals(vm.getRunOnVds())) .collect(Collectors.toList()); boolean considerCpuPinning = filteredVms.stream() .anyMatch(vm -> !StringUtils.isEmpty(vm.getCpuPinning())); Optional<Map<Guid, Integer>> nodeAssignment = Optional.empty(); if (considerCpuPinning) { nodeAssignment = NumaPinningHelper.findAssignment(filteredVms, host.getNumaNodeList(), true); } if (!nodeAssignment.isPresent()) { nodeAssignment = NumaPinningHelper.findAssignment(filteredVms, host.getNumaNodeList(), false); } if (!nodeAssignment.isPresent()) { return Collections.emptyMap(); } Map<Guid, Map<Integer, NumaNodeMemoryConsumption>> result = new HashMap<>(); for (VM vm : filteredVms) { if (vm.getvNumaNodeList().isEmpty()) { continue; } Map<Integer, NumaNodeMemoryConsumption> hostNumaMemRequirements = new HashMap<>(); for (VmNumaNode vmNode : vm.getvNumaNodeList()) { Integer hostNodeIndex = nodeAssignment.get().get(vmNode.getId()); if (hostNodeIndex == null) { continue; } <START> Optional<Integer> hugePageSize = HugePageUtils.getHugePageSize(vm.getStaticData()); <END> hostNumaMemRequirements.merge( hostNodeIndex, new NumaNodeMemoryConsumption(vmNode.getMemTotal(), hugePageSize), NumaNodeMemoryConsumption::merge); } result.put(vm.getId(), hostNumaMemRequirements); } return result; }</code><technical_language>This line moved out of loop improve performance</technical_language>

Target:
private Map<Guid, Map<Integer, NumaNodeMemoryConsumption>> vmNumaRequirements(List<VM> vmGroup, VDS host) { List<VM> filteredVms = vmGroup.stream() .filter(vm -> vm.getNumaTuneMode() != NumaTuneMode.PREFERRED) .filter(vm -> !host.getId().equals(vm.getRunOnVds())) .collect(Collectors.toList()); boolean considerCpuPinning = filteredVms.stream() .anyMatch(vm -> !StringUtils.isEmpty(vm.getCpuPinning())); Optional<Map<Guid, Integer>> nodeAssignment = Optional.empty(); if (considerCpuPinning) { nodeAssignment = NumaPinningHelper.findAssignment(filteredVms, host.getNumaNodeList(), true); } if (!nodeAssignment.isPresent()) { nodeAssignment = NumaPinningHelper.findAssignment(filteredVms, host.getNumaNodeList(), false); } if (!nodeAssignment.isPresent()) { return Collections.emptyMap(); } Map<Guid, Map<Integer, NumaNodeMemoryConsumption>> result = new HashMap<>(); for (VM vm : filteredVms) { if (vm.getvNumaNodeList().isEmpty()) { continue; } Map<Integer, NumaNodeMemoryConsumption> hostNumaMemRequirements = new HashMap<>(); Optional<Integer> hugePageSize = HugePageUtils.getHugePageSize(vm.getStaticData()); for (VmNumaNode vmNode : vm.getvNumaNodeList()) { Integer hostNodeIndex = nodeAssignment.get().get(vmNode.getId()); if (hostNodeIndex == null) { continue; } hostNumaMemRequirements.merge( hostNodeIndex, new NumaNodeMemoryConsumption(vmNode.getMemTotal(), hugePageSize), NumaNodeMemoryConsumption::merge); } result.put(vm.getId(), hostNumaMemRequirements); } return result; }
Source:
<code>public Patient savePatient(Patient patient) { LOG.info("save-patient"); if (CollectionUtils.isNotEmpty(patient.getPersonnames())) { LOG.debug("Personname-set-patient"); Personname personnameRecord = patient.getPersonnames().get(0); personnameRecord.setPatient(patient); if (HelperUtil.isId(patient.getPatientId())) { LOG.debug("update-patient-byID"); patientDAO.update(patient); } else { LOG.debug("create-patient-new-record"); patientDAO.create(patient); } <START> LOG.debug("Personname-Patient-patientId: " + personnameRecord.getPatient().getPatientId()); <END> if (HelperUtil.isId(personnameRecord.getPersonnameId())) { LOG.debug("update-personname-byID"); personnameDAO.update(personnameRecord); } else { LOG.debug("create-personname-new-record"); personnameDAO.create(personnameRecord); } } else { LOG.info("save-patient: fail personname does not exist"); } return patient; }</code><technical_language>Update Log statements parameterized logging</technical_language>

Target:
public boolean savePatient(Patient patient) throws LoadTestDataException { boolean actionResult; LOG.info("Service-save-patient"); if (CollectionUtils.isNotEmpty(patient.getPersonnames())) { if (HelperUtil.isId(patient.getPatientId())) { LOG.debug("update-patient-byID"); actionResult = patientDAO.update(patient); } else { LOG.debug("create-patient-new-record"); actionResult = patientDAO.create(patient); } for (Personname personnameRecord : patient.getPersonnames()) { LOG.debug("Personname-Patient-patientId: ", personnameRecord.getPatient().getPatientId()); personnameRecord.setPatient(patient); if (HelperUtil.isId(personnameRecord.getPersonnameId())) { LOG.debug("update-personname-byID"); actionResult = personnameDAO.update(personnameRecord); } else { LOG.debug("create-personname-new-record"); actionResult = personnameDAO.create(personnameRecord); } } } else { throw new LoadTestDataException("Patient-Personname is required when trying to save-patient"); } LOG.info("save-patient: Action-result: ", actionResult); return actionResult; }
Source:
<code>public Builder append(String key, String value) { if (isValid(key) && isValid(value)) { if (sb.length() > 0) { sb.append(separator); } <START> sb.append(key + ":" + value); <END> } return this; }</code><technical_language>colon a constant configurable</technical_language>

Target:
public Builder append(String key, String value) { if (isValid(key) && isValid(value)) { if (sb.length() > 0) { sb.append(fieldSeparator); } sb.append(key).append(KEY_VALUE_SEPARATOR).append(value); } return this; }
Source:
<code>public static Text getSleepAlarmMessage(final String wakeTime, final int sleepDurationMinutes, final String preSleepTime, final String sleepTime) { final float sleepDurationHr = (float) sleepDurationMinutes/60; final String messageBody; <START> if (sleepDurationHr % 1 == 0) { <END> messageBody = String.format("You typically wake up at around %s. If you want to get %.0f hours of sleep, you should start preparing for bed at %s, and plan to sleep by %s.", wakeTime, sleepDurationHr, preSleepTime, sleepTime); } else { messageBody = String.format("You typically wake up at around %s. If you want to get %.1f hours of sleep, you should start preparing for bed at %s, and plan to sleep by %s.", wakeTime, sleepDurationHr, preSleepTime, sleepTime); } return new Text("Bed Time", messageBody); }</code><technical_language>String[] mySplit = String.format("%.1f").split("\\."); if (mysplit.len > 1 && mysplit[1].equals("0")) { }</technical_language>

Target:
public static Text getSleepAlarmMessage(final String wakeTime, final int sleepDurationMinutes, final String preSleepTime, final String sleepTime) { final float sleepDurationHr = (float) sleepDurationMinutes/60; final String sleepDurationHrString; final String[] mySplit = String.format("%.1f", sleepDurationHr).split("\\."); if (mySplit.length > 1 && mySplit[1].equals("0")) { sleepDurationHrString = mySplit[0]; } else { sleepDurationHrString = String.format("%.1f", sleepDurationHr); } final String messageBody = String.format("You typically wake up at around %s. If you want to get %s hours of sleep, you should start preparing for bed at %s, and plan to sleep by %s.", wakeTime, sleepDurationHrString, preSleepTime, sleepTime); return new Text("Bed Time", messageBody); }
Source:
<code>public void deleteGroupForbiddenTest() throws Exception { GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); Group parentGroup = null; try { context.turnOffAuthorisationSystem(); parentGroup = groupService.create(context); context.commit(); <START> parentGroup = context.reloadEntity(parentGroup); <END> String adminToken = getAuthToken(admin.getEmail(), password); String authToken = getAuthToken(eperson.getEmail(), password); getClient(adminToken).perform( get("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isOk()); getClient(authToken).perform( delete("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isForbidden()); getClient(adminToken).perform( get("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isOk()); } finally { if (parentGroup != null) { GroupBuilder.deleteGroup(parentGroup.getID()); } } }</code><technical_language>above. GroupBuilder, missing a context.restoreAuthSystemState(); question commit() reloadEntity() above</technical_language>

Target:
public void deleteGroupForbiddenTest() throws Exception { context.turnOffAuthorisationSystem(); Group parentGroup = GroupBuilder.createGroup(context) .withName("test group") .build(); context.restoreAuthSystemState(); String adminToken = getAuthToken(admin.getEmail(), password); String authToken = getAuthToken(eperson.getEmail(), password); getClient(adminToken).perform( get("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isOk()); getClient(authToken).perform( delete("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isForbidden()); getClient(adminToken).perform( get("/api/eperson/groups/" + parentGroup.getID()) ).andExpect(status().isOk()); }