auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters()); Guid currentChildId = getCurrentChildId(getParameters()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } <START> log.info("Command: '{}' id: '{}' executing step: '{}'", getActionType(), getCommandId(), <END> getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; } persistCommandIfNeeded(); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }</code><technical_language>please move ":" id placeholder</technical_language>

Target:
public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters()); Guid currentChildId = getCurrentChildId(getParameters()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } log.info("Command '{}' id '{}' executing step '{}'", getActionType(), getCommandId(), getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; } persistCommandIfNeeded(); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sdkapp_main); <START> if (getIntent().getExtras() != null && getIntent().getExtras().containsKey("session")) <END> { SessionUtils.setsession(this, (AlfrescoSession) getIntent().getExtras().getParcelable("session")); } FragmentDisplayer.loadFragment(this, R.id.body, ListUISamplesFragments.TAG); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { ActionBar bar = getActionBar(); bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_USE_LOGO); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) { bar.setHomeButtonEnabled(true); } } }</code><technical_language>"session" a constant. noticed this is samples app though, matter in case advocate practices</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sdkapp_main); if (getIntent().getExtras() != null && getIntent().getExtras().containsKey(PARAM_SESSION)) { SessionUtils.setsession(this, (AlfrescoSession) getIntent().getExtras().getParcelable(PARAM_SESSION)); } FragmentDisplayer.loadFragment(this, R.id.body, ListUISamplesFragments.TAG); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { ActionBar bar = getActionBar(); bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_USE_LOGO); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) { bar.setHomeButtonEnabled(true); } } }
Source:
<code>protected void doGet(HttpServletRequest request, HttpServletResponse response) { HashMap<String, Object> body = new HashMap<>(); try { <START> String publishId = request.getParameter("publish_id"); <END> db.single(Publish.class).where("publish_id = ?", publishId).execute().ifPresent(publish -> { String datasource = publish.getDatasource(); body.put("datasource", datasource); String queryId = publish.getQueryId(); body.put("queryid", queryId); Query query = db.single(Query.class).where("query_id = ? AND datasource = ?", queryId, datasource).execute().get(); body.put("engine", query.getEngine()); createHistoryResult(body, config.getSelectLimit(), datasource, query, true); Optional<Comment> comment = db.single(Comment.class).where("datasource = ? AND engine = ? AND query_id = ?", datasource, query.getEngine(), queryId).execute(); body.put("comment", comment.orElse(null)); }); } catch (Throwable e) { LOGGER.error(e.getMessage(), e); body.put("error", e.getMessage()); } writeJSON(response, body); }</code><technical_language>I HttpRequestUtil(request, "publish_id") is</technical_language>

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) { HashMap<String, Object> body = new HashMap<>(); try { String publishId = getRequiredParameter(request, "publish_id"); db.single(Publish.class).where("publish_id = ?", publishId).execute().ifPresent(publish -> { String datasource = publish.getDatasource(); body.put("datasource", datasource); String queryId = publish.getQueryId(); body.put("queryid", queryId); Query query = db.single(Query.class).where("query_id = ? AND datasource = ?", queryId, datasource).execute().get(); body.put("engine", query.getEngine()); createHistoryResult(body, config.getSelectLimit(), datasource, query, true); Optional<Comment> comment = db.single(Comment.class).where("datasource = ? AND engine = ? AND query_id = ?", datasource, query.getEngine(), queryId).execute(); body.put("comment", comment.orElse(null)); }); } catch (Throwable e) { LOGGER.error(e.getMessage(), e); body.put("error", e.getMessage()); } writeJSON(response, body); }
Source:
<code>public SELF isEqualTo(ZonedDateTime expected) { Objects.instance().assertNotNull(info, actual); <START> assertDateTimeParameterIsNotNull(expected); <END> return super.isEqualTo(sameInstantInActualTimeZone(expected)); }</code><technical_language>consistent AbstractAssert.isEqualTo, this assertion pass actual expected null. a implementation sameInstantInActualTimeZone return null null</technical_language>

Target:
public SELF isEqualTo(ZonedDateTime expected) { return super.isEqualTo(sameInstantInActualTimeZone(expected)); }
Source:
<code>public boolean isNetworkError() { <START> if (getMessage().startsWith(NETWORK_ERROR_MSG) || getMessage().startsWith(CONNECTION_ISSUES_MSG)) { <END> return true; } else { return false; } }</code><technical_language>Consider explaining this change in commit message extract another patch.</technical_language>

Target:
public boolean isNetworkError() { if (getMessage().startsWith(NETWORK_ERROR_MSG)) { return true; } else { return false; } }
Source:
<code>public Distribution getDistribution() { double mean = d_quantiles.getQuantile(1); <START> double stdev = (d_quantiles.getQuantile(2) - mean) / 1.960 ; <END> if(d_coninuous) { return new Gaussian(mean, stdev); } else { return new LogGaussian(mean, stdev); } }</code><technical_language>I (d_quantiles.getQuantile(2) - d_quantiles.getQuantile(0)) / (2 \* 1.960); is more robust. another note, determine indices .5, .025, .975 quantiles instead of assuming 1, 0, 2. do this in constructor. preferably, getDistribution() called..</technical_language>

Target:
public Distribution getDistribution() { double mean = d_quantiles.getQuantile(d_quantiles.indexOf(0.5)); double stdev = (d_quantiles.getQuantile(d_quantiles.indexOf(0.975)) - d_quantiles.getQuantile(d_quantiles.indexOf(0.025))) / (2 * 1.960); if(d_isLogTransformed) { return new Gaussian(mean, stdev); } else { return new LogGaussian(mean, stdev); } }
Source:
<code>public void auditRequestMessage(T request, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, Boolean isRequesting, Properties webContextProperties, String serviceName, AuditTransforms transforms) { <START> LOG.trace("--- Before auditing of request message ---"); <END> LogEventRequestType auditLogMsg = transforms.transformRequestToAuditMsg(request, assertion, target, direction, _interface, isRequesting, webContextProperties, serviceName); auditLogMessages(auditLogMsg, assertion); LOG.trace("--- After auditing of request message ---"); }</code><technical_language>this exact log message in AuditLogger class, do need a statement places? If do, message (or in AuditLogger) more specific</technical_language>

Target:
public void auditRequestMessage(T request, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, Boolean isRequesting, Properties webContextProperties, String serviceName, AuditTransforms transforms) { LOG.trace("--- Before asynchronous audit call of request message ---"); LogEventRequestType auditLogMsg = transforms.transformRequestToAuditMsg(request, assertion, target, direction, _interface, isRequesting, webContextProperties, serviceName); auditLogMessages(auditLogMsg, assertion); LOG.trace("--- After asynchronous audit call of request message ---"); }
Source:
<code><START> public void onBackPressed() { <END> Log.v(TAG, "onBackPressed"); super.onBackPressed(); Log.v(TAG, "Logging out"); Intent intent = new Intent(MainActivity.this, WebViewActivity.class); intent.putExtra("url", single_logout_url); startActivityForResult(intent, WEBVIEW_ACTIVITY); }</code><technical_language>onStop() a choice</technical_language>

Target:
public void onBackPressed() { Log.v(TAG, "onBackPressed:"); super.onBackPressed(); String AIS_TARGET_URL = getResources().getString(R.string.ais_target_url); Intent intent = new Intent(MainActivity.this, WebViewActivity.class); intent.putExtra(AIS_TARGET_URL, singleLogoutUrl); startActivityForResult(intent, WEBVIEW_ACTIVITY); }
Source:
<code>public LoggerServiceImpl() { actions.put( "log-record", new Runnable() { @Override public void run() { logrecord(); } } ); <START> } <END></code><technical_language>do need default constructor now, night</technical_language>

Target:
public LoggerServiceImpl() { }
Source:
<code>public void removeKeyListener(KeyListener listener) { if (this.text != null && !this.text.isDisposed()) this.text.removeKeyListener(listener); if <START> (this.dropdownTableViewer != <END> null && !this.dropdownTable.isDisposed()) this.dropdownTable.removeKeyListener(listener); }</code><technical_language>a check for viewer here? this dropdownTable? table</technical_language>

Target:
public void removeKeyListener(KeyListener listener) { if (this.text != null && !this.text.isDisposed()) this.text.removeKeyListener(listener); if (this.dropdownTable != null && !this.dropdownTable.isDisposed()) this.dropdownTable.removeKeyListener(listener); }
Source:
<code>private IBrandingAdvice getBrandingAdvice() { for (IBrandingAdvice <START> iBrandingAdvice : <END> info.getAdvice(configSpec, true, null, null, IBrandingAdvice.class)) return iBrandingAdvice; return null; }</code><technical_language>rename advice brandingAdvice</technical_language>

Target:
private IBrandingAdvice getBrandingAdvice() { for (IBrandingAdvice advice : info.getAdvice(configSpec, true, null, null, IBrandingAdvice.class)) return advice; return null; }
Source:
<code>public synchronized void init() { try { Driver driver = DriverManager.getDriver(URL_PREFIX); LOGGER.error("LoggingDriver already installed; removing"); try { DriverManager.deregisterDriver(driver); } catch (SQLException e) { throw new IllegalStateException("Unable to de-register logging JDBC driver", e); } } catch (SQLException expected) { <START> LOGGER.error("SQLException ", expected); <END> } try { DriverManager.registerDriver(this); } catch (SQLException e) { throw new IllegalStateException("Unable to register logging JDBC driver", e); } }</code><technical_language>log @ debug for expected exception, ignore</technical_language>

Target:
public synchronized void init() { try { Driver driver = DriverManager.getDriver(URL_PREFIX); LOGGER.error("LoggingDriver already installed; removing"); try { DriverManager.deregisterDriver(driver); } catch (SQLException e) { throw new IllegalStateException("Unable to de-register logging JDBC driver", e); } } catch (SQLException expected) { LOGGER.debug(expected.getMessage(), expected); } try { DriverManager.registerDriver(this); } catch (SQLException e) { throw new IllegalStateException("Unable to register logging JDBC driver", e); } }
Source:
<code>public void simpleStringExtraInjected() { <START> ExtraInjectedActivity activity = Robolectric.buildActivity(ExtraInjectedActivity_.class, ExtraInjectedActivity_.intent(context) <END> .stringExtra("Hello!") .get()) .setup() .get(); assertThat(activity.stringExtra).isEqualTo("Hello!"); }</code><technical_language>extract intent variable code a bit readable</technical_language>

Target:
public void simpleStringExtraInjected() { Intent intent = ExtraInjectedActivity_.intent(context) .stringExtra("Hello!") .get(); ExtraInjectedActivity activity = Robolectric.buildActivity(ExtraInjectedActivity_.class, intent) .setup() .get(); assertThat(activity.stringExtra).isEqualTo("Hello!"); }
Source:
<code>public String getNameForThread() { <START> return "socket=" + String.format("%s-%s-%s", getLogType(), this.protocol, this.port); <END> }</code><technical_language>string "socket=" included format string too</technical_language>

Target:
public String getNameForThread() { return String.format("socket=%s-%s-%s", getLogType(), this.protocol, this.port); }
Source:
<code>private void addStrategyTypeProperties(Collection<ResourceProperty> properties, IBuildStrategy buildStrategy) { if (buildStrategy == null) { <START> properties.add(new ResourceProperty("strategy", "<UNKNOWN>")); <END> return; } properties.add(new ResourceProperty("strategy", buildStrategy.getType().toString())); switch(buildStrategy.getType()) { case BuildStrategyType.SOURCE: ISourceBuildStrategy sti = (ISourceBuildStrategy) buildStrategy; properties.add(new ResourceProperty("builder image", sti.getImage().toString())); break; case BuildStrategyType.DOCKER: IDockerBuildStrategy docker = (IDockerBuildStrategy) buildStrategy; properties.add(new ResourceProperty("base image", docker.getBaseImage().toString())); break; case BuildStrategyType.CUSTOM: ICustomBuildStrategy custom = (ICustomBuildStrategy) buildStrategy; properties.add(new ResourceProperty("builder image", custom.getImage().toString())); break; default: } }</code><technical_language>I noticed in other resources "Template Details" window, if smth is defined i has: "(Not Provided)" text. a in [ResourceDetailsLabelProvider.getStyledText](<LINK_0> worth making consitent it: new ResourceProperty("strategy", "") instead of new ResourceProperty("strategy", "<UNKNOWN>"). ResourceDetailsLabelProvider "(Not Provided)"</technical_language>

Target:
private void addStrategyTypeProperties(Collection<ResourceProperty> properties, IBuildStrategy buildStrategy) { if (buildStrategy == null || buildStrategy.getType() == null) { properties.add(new UnknownResourceProperty(LABEL_STRATEGY)); return; } properties.add(new ResourceProperty(LABEL_STRATEGY, buildStrategy.getType().toString())); switch(buildStrategy.getType()) { case BuildStrategyType.SOURCE: ISourceBuildStrategy sti = (ISourceBuildStrategy) buildStrategy; properties.add(new ResourceProperty("builder image", sti.getImage().toString())); break; case BuildStrategyType.DOCKER: IDockerBuildStrategy docker = (IDockerBuildStrategy) buildStrategy; properties.add(new ResourceProperty("base image", docker.getBaseImage().toString())); break; case BuildStrategyType.CUSTOM: ICustomBuildStrategy custom = (ICustomBuildStrategy) buildStrategy; properties.add(new ResourceProperty("builder image", custom.getImage().toString())); break; default: } }
Source:
<code>public void wipe(Context context) { log.info("Removing all the data and restarting the app."); resetBlockchain(); wallet.shutdownAutosaveAndWait(); stopBlockchainService(); walletFile.delete(); cleanupFiles(); config.clear(true); PinRetryController.getInstance().clearPinFailPrefs(); File walletBackupFile = getFileStreamPath(Constants.Files.WALLET_KEY_BACKUP_PROTOBUF); if(walletBackupFile.exists()) walletBackupFile.delete(); File blockChainFile = new File(getDir("blockstore", Context.MODE_PRIVATE), Constants.Files.BLOCKCHAIN_FILENAME); if (blockChainFile.exists()) <START> blockChainFile.delete(); <END> ProcessPhoenix.triggerRebirth(context); }</code><technical_language>This unnecessary wallet file is deleted. Deleting wallet file trigger a blockchain reset</technical_language>

Target:
public void wipe(Context context) { log.info("Removing all the data and restarting the app."); resetBlockchain(); wallet.shutdownAutosaveAndWait(); stopBlockchainService(); walletFile.delete(); cleanupFiles(); config.clear(true); PinRetryController.getInstance().clearPinFailPrefs(); File walletBackupFile = getFileStreamPath(Constants.Files.WALLET_KEY_BACKUP_PROTOBUF); if(walletBackupFile.exists()) walletBackupFile.delete(); ProcessPhoenix.triggerRebirth(context); }
Source:
<code>public Action<?, ?> clusterProxyRegistrationAction() { return new AbstractChangePrimaryGatewayAction<>(StackEvent.class) { @Override protected void doExecute(ChangePrimaryGatewayContext context, StackEvent payload, Map<Object, Object> variables) { Stack stack = context.getStack(); stackUpdater.updateStackStatus(stack.getId(), DetailedStackStatus.REPAIR_IN_PROGRESS, "Changing the primary gateway cluster proxy registration"); List<String> instanceIds = getInstanceIds(variables); ClusterProxyUpdateRegistrationRequest request; <START> if (Objects.nonNull(instanceIds)) { <END> List<String> instanceIdsToRegister = stack.getNotDeletedInstanceMetaDataList().stream() .map(InstanceMetaData::getInstanceId) .filter(instanceId -> !instanceIds.contains(instanceId)) .collect(Collectors.toList()); request = new ClusterProxyUpdateRegistrationRequest(stack.getId(), instanceIdsToRegister); } else { request = new ClusterProxyUpdateRegistrationRequest(stack.getId()); } sendEvent(context, request.selector(), request); } }; }</code><technical_language>logs some nice branch is selected IDs chosen</technical_language>

Target:
public Action<?, ?> clusterProxyRegistrationAction() { return new AbstractChangePrimaryGatewayAction<>(StackEvent.class) { @Override protected void doExecute(ChangePrimaryGatewayContext context, StackEvent payload, Map<Object, Object> variables) { Stack stack = context.getStack(); stackUpdater.updateStackStatus(stack.getId(), DetailedStackStatus.REPAIR_IN_PROGRESS, "Changing the primary gateway cluster proxy registration"); List<String> repairInstanceIds = getInstanceIds(variables); ClusterProxyUpdateRegistrationRequest request; if (Objects.nonNull(repairInstanceIds)) { List<String> instanceIdsToRegister = stack.getNotDeletedInstanceMetaDataList().stream() .map(InstanceMetaData::getInstanceId) .filter(instanceId -> !repairInstanceIds.contains(instanceId)) .collect(Collectors.toList()); LOGGER.debug("When changing the primary gateway cluster proxy in stack {}, will be reregistered", stack.getId(), instanceIdsToRegister); request = new ClusterProxyUpdateRegistrationRequest(stack.getId(), instanceIdsToRegister); } else { LOGGER.debug("When changing the primary gateway cluster proxy in stack {}, the whole stack will be reregistered", stack.getId()); request = new ClusterProxyUpdateRegistrationRequest(stack.getId()); } sendEvent(context, request.selector(), request); } }; }
Source:
<code>public void testProcessQueryGraphQl() throws Exception { <START> Exception exception = assertThrows(JsonParseException.class, () -> { <END> AsyncQuery queryObj = new AsyncQuery(); ElideResponse response = new ElideResponse(200, "ResponseBody"); String query = "{\"query\":\"{ group { edges { node { name commonName description } } } }\",\"variables\":null}"; String id = "edc4a871-dff2-4054-804e-d80075cf827d"; queryObj.setId(id); queryObj.setQuery(query); queryObj.setQueryType(QueryType.GRAPHQL_V1_0); queryObj.setResultType(ResultType.EMBEDDED); when(runner.run(eq(query), eq(user), any())).thenReturn(response); AsyncQueryThread queryThread = new AsyncQueryThread(queryObj, user, elide, runner, asyncQueryDao, "v1", resultStorageEngine); queryResultObj = queryThread.processQuery(); assertEquals(queryResultObj.getResponseBody(), "ResponseBody"); assertEquals(queryResultObj.getHttpStatus(), 200); }); }</code><technical_language>dont need store results in Exception exception</technical_language>

Target:
public void testProcessQueryGraphQl() throws Exception { assertThrows(InvalidJsonException.class, () -> { AsyncQuery queryObj = new AsyncQuery(); ElideResponse response = new ElideResponse(200, "ResponseBody"); String query = "{\"query\":\"{ group { edges { node { name commonName description } } } }\",\"variables\":null}"; String id = "edc4a871-dff2-4054-804e-d80075cf827d"; queryObj.setId(id); queryObj.setQuery(query); queryObj.setQueryType(QueryType.GRAPHQL_V1_0); queryObj.setResultType(ResultType.EMBEDDED); when(runner.run(any(), eq(query), eq(user), any())).thenReturn(response); AsyncQueryThread queryThread = new AsyncQueryThread(queryObj, user, elide, runner, asyncQueryDao, "v1", resultStorageEngine, BASE_URL_ENDPOINT); queryResultObj = queryThread.processQuery(); assertEquals(queryResultObj.getResponseBody(), "ResponseBody"); assertEquals(queryResultObj.getHttpStatus(), 200); }); }
Source:
<code>private void updateVdsDynamic(V1Node node, VdsDynamic dynamic) { Map<String, String> labels = node.getMetadata().getLabels(); if ("true".equals(labels.get("kubevirt.io/schedulable"))) { dynamic.setStatus(VDSStatus.Up); } else { dynamic.setStatus(VDSStatus.NonOperational); dynamic.setNonOperationalReason(NonOperationalReason.KUBEVIRT_NOT_SCHEDULABLE); logUnmetConditions(node); } dynamic.setCpuThreads(node.getStatus() .getCapacity() .getOrDefault("cpu", new Quantity("0")) .getNumber() .intValue()); Map<String, Quantity> capacity = node.getStatus().getCapacity(); dynamic.setCpuThreads(capacity.getOrDefault("cpu", new Quantity("0")).getNumber().intValue()); Quantity <START> memoryInKiB = <END> capacity.getOrDefault("memory", new Quantity("0")); dynamic.setPhysicalMemMb(Units.parse(new QuantityFormatter().format(memoryInKiB))); V1NodeSystemInfo nodeInfo = node.getStatus().getNodeInfo(); dynamic.setKernelVersion(nodeInfo.getKernelVersion()); dynamic.setBootUuid(nodeInfo.getBootID()); dynamic.setHostOs(nodeInfo.getOperatingSystem()); dynamic.setHardwareUUID(nodeInfo.getSystemUUID()); }</code><technical_language>do changing name memory. do is in kilobytes</technical_language>

Target:
private void updateVdsDynamic(V1Node node, VdsDynamic dynamic) { Map<String, String> labels = node.getMetadata().getLabels(); if ("true".equals(labels.get("kubevirt.io/schedulable"))) { dynamic.setStatus(VDSStatus.Up); } else { dynamic.setStatus(VDSStatus.NonOperational); dynamic.setNonOperationalReason(NonOperationalReason.KUBEVIRT_NOT_SCHEDULABLE); logUnmetConditions(node); } dynamic.setCpuThreads(node.getStatus() .getCapacity() .getOrDefault("cpu", new Quantity("0")) .getNumber() .intValue()); Map<String, Quantity> capacity = node.getStatus().getCapacity(); dynamic.setCpuThreads(capacity.getOrDefault("cpu", new Quantity("0")).getNumber().intValue()); Quantity memory = capacity.getOrDefault("memory", new Quantity("0")); dynamic.setPhysicalMemMb(Units.parse(new QuantityFormatter().format(memory))); V1NodeSystemInfo nodeInfo = node.getStatus().getNodeInfo(); dynamic.setKernelVersion(nodeInfo.getKernelVersion()); dynamic.setBootUuid(nodeInfo.getBootID()); dynamic.setHostOs(nodeInfo.getOperatingSystem()); dynamic.setHardwareUUID(nodeInfo.getSystemUUID()); }
Source:
<code>public int getTimeOut(Class clazz) { try { Method method = Timeout.class.getMethod("value"); do { if (clazz.isAnnotationPresent(Timeout.class)) { return (Integer) method.invoke(clazz.getDeclaredAnnotation(Timeout.class)); } clazz = clazz.getSuperclass(); } while (clazz != Object.class && clazz != null); } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { } <START> return 1; <END> }</code><technical_language>return 5 compatibility previous implementation</technical_language>

Target:
public int getTimeOut(Class clazz) { try { Method method = Timeout.class.getMethod("value"); do { if (clazz.isAnnotationPresent(Timeout.class)) { return (Integer) method.invoke(clazz.getAnnotation(Timeout.class)); } clazz = clazz.getSuperclass(); } while (clazz != Object.class && clazz != null); } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { } return Integer.getInteger("webdriver.timeouts.implicitlywait", 5); }
Source:
<code>NotificationInformation createNotification(final T notificationPayload) { return new NotificationInformation() { @Override public int getId() { if (notificationPayload instanceof DownloadBatchStatus) { return ((DownloadBatchStatus) notificationPayload).getDownloadBatchId().hashCode(); } return notificationPayload.hashCode(); } @Override public Notification getNotification() { int newNotificationId = getId(); NotificationCustomizer.NotificationDisplayState newNotificationDisplayState = notificationDisplayState(); <START> if (builder == null || hasChanged(newNotificationId, newNotificationDisplayState)) { <END> builder = new NotificationCompat.Builder(applicationContext, notificationChannelProvider.channelId()); notificationId = newNotificationId; notificationDisplayState = newNotificationDisplayState; } return notificationCustomizer.customNotificationFrom(builder, notificationPayload); } private boolean hasChanged(int newNotificationId, NotificationCustomizer.NotificationDisplayState newNotificationDisplayState) { return notificationId != newNotificationId && !notificationDisplayState.equals(newNotificationDisplayState); } @Override public NotificationCustomizer.NotificationDisplayState notificationDisplayState() { return notificationCustomizer.notificationDisplayState(notificationPayload); } }; }</code><technical_language>well, need call notificationCustomizer in case, id displayState changed, payload could, it</technical_language>

Target:
NotificationInformation createNotification(final T notificationPayload) { return new NotificationInformation() { @Override public int getId() { if (notificationPayload instanceof DownloadBatchStatus) { return ((DownloadBatchStatus) notificationPayload).getDownloadBatchId().hashCode(); } return notificationPayload.hashCode(); } @Override public Notification getNotification() { int newNotificationId = getId(); if (builder == null || newNotificationId != notificationId) { builder = new NotificationCompat.Builder(applicationContext, notificationChannelProvider.channelId()); notificationId = newNotificationId; } return notificationCustomizer.customNotificationFrom(builder, notificationPayload); } @Override public NotificationCustomizer.NotificationDisplayState notificationDisplayState() { return notificationCustomizer.notificationDisplayState(notificationPayload); } }; }
Source:
<code><START> public Credentials(String login, String passwordHash) { <END> this.login = login; this.passwordHash = passwordHash; }</code><technical_language>package local</technical_language>

Target:
Credentials(String login, String passwordHash) { this.login = login; this.passwordHash = passwordHash; }
Source:
<code><START> public static Operation createDeploymentAddOperation(final InputStream content, final String name, final String runtimeName) { <END> Assertions.requiresNotNullParameter(content, "content"); Assertions.requiresNotNullParameter(name, "name"); final ModelNode address = createAddress(DEPLOYMENT, name); final ModelNode addOperation = createAddOperation(address); if (runtimeName != null) { addOperation.get(RUNTIME_NAME).set(runtimeName); } final CompositeOperationBuilder builder = CompositeOperationBuilder.create(true); builder.addStep(addOperation); return builder.build(); }</code><technical_language>Do need this one, createDeployOperation(final Deployment deployment)</technical_language>

Target:
public static Operation createDeploymentAddOperation(final InputStream content, final String name, final String runtimeName) { Assertions.requiresNotNullParameter(content, "content"); Assertions.requiresNotNullParameter(name, "name"); final ModelNode address = createAddress(DEPLOYMENT, name); final ModelNode addOperation = createAddOperation(address); if (runtimeName != null) { addOperation.get(RUNTIME_NAME).set(runtimeName); } final CompositeOperationBuilder builder = CompositeOperationBuilder.create(true); builder.addStep(addOperation); DeploymentContent.of(content).addContentToOperation(builder, addOperation); return builder.build(); }
Source:
<code>private Function<PollingContext<OperationResult>, Mono<OperationResult>> receiptStreamActivationOperation( Flux<ByteBuffer> data, long length, FormContentType formContentType, boolean includeTextDetails) { <START> Objects.requireNonNull(data, "'data' is required and cannot be null."); <END> return pollingContext -> { try { if (formContentType != null) { return service.analyzeReceiptAsyncWithResponseAsync( ContentType.fromString(formContentType.toString()), data, length, includeTextDetails) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation()))); } else { return detectContentType(data) .flatMap(contentType -> service.analyzeReceiptAsyncWithResponseAsync(contentType, data, length, includeTextDetails) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation())))); } } catch (RuntimeException ex) { return monoError(logger, ex); } }; }</code><technical_language>this in try caught thrown</technical_language>

Target:
private Function<PollingContext<OperationResult>, Mono<OperationResult>> receiptStreamActivationOperation( Flux<ByteBuffer> data, long length, FormContentType formContentType, boolean includeTextDetails) { return pollingContext -> { try { Objects.requireNonNull(data, "'data' is required and cannot be null."); if (formContentType != null) { return service.analyzeReceiptAsyncWithResponseAsync( ContentType.fromString(formContentType.toString()), data, length, includeTextDetails) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation()))); } else { return detectContentType(data) .flatMap(contentType -> service.analyzeReceiptAsyncWithResponseAsync(contentType, data, length, includeTextDetails) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation())))); } } catch (RuntimeException ex) { return monoError(logger, ex); } }; }
Source:
<code>private void expandToLevel(VirtualItem item, int level) { if (level == ALL_LEVELS || level > 0) { if (!item.hasItems()) { return; } item.setExpanded(true); if (item.getData() == null) { virtualLazyUpdateData(item); return; } if (level == ALL_LEVELS || level > 1) { VirtualItem[] children = item.getItems(); int newLevel = (level == ALL_LEVELS ? ALL_LEVELS : level - 1); for (VirtualItem <START> element : <END> children) { expandToLevel(element, newLevel); } } } }</code><technical_language>rename childItem</technical_language>

Target:
private void expandToLevel(VirtualItem item, int level) { if (level == ALL_LEVELS || level > 0) { if (!item.hasItems()) { return; } item.setExpanded(true); if (item.getData() == null) { virtualLazyUpdateData(item); return; } if (level == ALL_LEVELS || level > 1) { int newLevel = (level == ALL_LEVELS ? ALL_LEVELS : level - 1); for (VirtualItem element : item.getItems()) { expandToLevel(element, newLevel); } } } }
Source:
<code>public static void setUp() { POSITIONDTO_LIST_TYPE = new TypeToken<List<PositionDTO>>() {}.getType(); <START> <END> DEVELOPER_ENTITY = PositionEntity.builder().id(DEVELOPER_ID).name(DEVELOPER_NAME).build(); DEVELOPER_DTO = PositionDTO.builder().id(DEVELOPER_ID).name(DEVELOPER_NAME).build(); EXPECTED_POSITION_ENTITY_LIST = Arrays.asList( DEVELOPER_ENTITY, DEVELOPER_ENTITY, DEVELOPER_ENTITY ); EXPECTED_POSITION_DTO_LIST = Arrays.asList( DEVELOPER_DTO, DEVELOPER_DTO, DEVELOPER_DTO ); }</code><technical_language>fields in setup block uppercase, strictly constants. POSITIONDTO_LIST_TYPE remain uppercase, defined of setUp method. hard draw line uppercase, is a good quote google's recommendation: "Every constant is a static final field, static final fields constants. choosing constant case, consider field feels a constant. For example, if of instance's observable state change, is a constant. intending mutate object is generally enough."</technical_language>

Target:
public void setUp() { developerEntity = PositionEntity.builder().id(DEVELOPER_ID).name(DEVELOPER_NAME).build(); developerDto = PositionDTO.builder().id(DEVELOPER_ID).name(DEVELOPER_NAME).build(); expectedPositionEntityList = Arrays.asList(developerEntity, developerEntity, developerEntity); expectedPositionDtoList = Arrays.asList(developerDto, developerDto, developerDto); }
Source:
<code>public JudgmentType convertToType(String judgmentFormName) { if (StringUtils.isBlank(judgmentFormName)) { return JudgmentType.SENTENCE; } <START> judgmentFormName = judgmentFormName.trim().toUpperCase(); <END> for (Map.Entry<String, JudgmentType> entry : judgmentTypeMap.entrySet()) { if (judgmentFormName.contains(entry.getKey())) { return entry.getValue(); } } return JudgmentType.SENTENCE; }</code><technical_language>J) consider Locale independent version parameter Locale.ROOT</technical_language>

Target:
public JudgmentType convertToType(String judgmentFormName) { if (StringUtils.isBlank(judgmentFormName)) { return JudgmentType.SENTENCE; } judgmentFormName = judgmentFormName.trim().toUpperCase(Locale.ROOT); for (Map.Entry<String, JudgmentType> entry : judgmentTypeMap.entrySet()) { if (judgmentFormName.contains(entry.getKey())) { return entry.getValue(); } } return JudgmentType.SENTENCE; }
Source:
<code>public Properties trackScreenView(String screenName, String courseId, String action) { SegmentAnalyticsEvent aEvent = new SegmentAnalyticsEvent(); aEvent.setAppNameContext(); if (!TextUtils.isEmpty(action)) { aEvent.properties.put(Keys.ACTION, action); } tracker.screen("", screenName, aEvent.properties); addCategoryToBiEvents(aEvent.properties, Values.SCREEN, screenName); <START> aEvent.properties.put(Keys.COURSE_ID, TextUtils.isEmpty(courseId) ? "" : courseId); <END> return aEvent.properties; }</code><technical_language>forgot track properties :wink:</technical_language>

Target:
public Properties trackScreenView(String screenName, String courseId, String action) { SegmentAnalyticsEvent aEvent = new SegmentAnalyticsEvent(); aEvent.setAppNameContext(); if (!TextUtils.isEmpty(action)) { aEvent.properties.put(Keys.ACTION, action); } if (!TextUtils.isEmpty(courseId)) { aEvent.properties.put(Keys.COURSE_ID, courseId); } tracker.screen("", screenName, aEvent.properties); addCategoryToBiEvents(aEvent.properties, Values.SCREEN, screenName); tracker.track(screenName, aEvent.properties); return aEvent.properties; }
Source:
<code>private static void choosePlayerSample(GlowServer server, PaperServerListPingEvent event) { <START> ThreadLocalRandom random = ThreadLocalRandom.current(); <END> List<Player> players = Arrays.asList(server.getOnlinePlayers()); int sampleCount = server.getPlayerSampleCount(); if (players.size() <= sampleCount) { sampleCount = players.size(); } else { for (int i = 0; i < sampleCount; i++) { Collections.swap(players, i, random.nextInt(i, players.size())); } } for (int i = 0; i < sampleCount; i++) { event.getPlayerSample().add(players.get(i).getPlayerProfile()); } }</code><technical_language>Check shouldHidePlayers() first</technical_language>

Target:
private static void choosePlayerSample(GlowServer server, PaperServerListPingEvent event) { ThreadLocalRandom random = ThreadLocalRandom.current(); List<Player> players = new ArrayList<>(server.getOnlinePlayers()); int sampleCount = server.getPlayerSampleCount(); if (players.size() <= sampleCount) { sampleCount = players.size(); } else { for (int i = 0; i < sampleCount; i++) { Collections.swap(players, i, random.nextInt(i, players.size())); } } for (int i = 0; i < sampleCount; i++) { event.getPlayerSample().add(players.get(i).getPlayerProfile()); } }
Source:
<code>private void ensureStorageFormatInitialized() { StorageDomain sd = getStorageDomain(); if (sd.getStorageFormat() == null) { if (sd.getStorageDomainType().isDataDomain()) { StoragePool sp = getTargetStoragePool(); if (sp != null) { sd.setStorageFormat(VersionStorageFormatUtil.getPreferredForVersion( sp.getcompatibility_version(), sd.getStorageType()) ); } else { <START> sd.setStorageFormat(StorageFormatType.V3); <END> } } else { sd.setStorageFormat(StorageFormatType.V1); } } }</code><technical_language>if host support v3 format (old vdsm version), fail add domain. i if pool, add domain v1 (it's rare enough anyway)..in worst case, upgraded</technical_language>

Target:
private void ensureStorageFormatInitialized() { StorageDomain sd = getStorageDomain(); if (sd.getStorageFormat() == null) { if (sd.getStorageDomainType().isDataDomain()) { StoragePool sp = getTargetStoragePool(); if (sp != null) { sd.setStorageFormat(VersionStorageFormatUtil.getPreferredForVersion( sp.getcompatibility_version(), sd.getStorageType()) ); } else { if (sd.getStorageType().isBlockDomain()) { sd.setStorageFormat(StorageFormatType.V2); } else { sd.setStorageFormat(StorageFormatType.V1); } } } else { sd.setStorageFormat(StorageFormatType.V1); } } }
Source:
<code>Page<Book> getDefaultPageable(Pageable pageable) { if (pageable != null) { <START> return new PageImpl<>(Collections.singletonList(new Book()), pageable, 1); <END> } return new PageImpl<>(Collections.emptyList(), pageable, 0); }</code><technical_language>I (should) stay Java 6 syntax here</technical_language>

Target:
Page<Book> getDefaultPageable(Pageable pageable) { if (pageable != null) { return new PageImpl<Book>(Collections.singletonList(new Book()), pageable, 1); } return new PageImpl<Book>(Collections.emptyList(), pageable, 0); }
Source:
<code>public void visitNode(Tree tree) { if (!hasSemantic()) { return; } ReturnThis returnThis = new ReturnThis(); ClassTree classTree = (ClassTree) tree; Type classType = classTree.symbol().type(); if(!(classType.isSubtypeOf("java.util.Iterator") && classType.isSubtypeOf("java.lang.Iterable"))) { return; } <START> classTree.members().stream().filter(m -> m.is(Tree.Kind.METHOD)).forEach(t -> t.accept(returnThis)); <END> if (!returnThis.issueLocations.isEmpty()) { reportIssue(returnThis.issueLocations.get(0), "", returnThis.issueLocations.stream().skip(1) .map(t -> new JavaFileScannerContext.Location("", t)).collect(Collectors.toList()), null); } }</code><technical_language>if I mistaken, check for iterator() method, methods. RSPEC is worded</technical_language>

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } ReturnThis returnThis = new ReturnThis(); ClassTree classTree = (ClassTree) tree; Type classType = classTree.symbol().type(); if(!(classType.isSubtypeOf("java.util.Iterator") && classType.isSubtypeOf("java.lang.Iterable"))) { return; } classTree.members().stream() .filter(m -> m.is(Tree.Kind.METHOD)) .filter(m -> ITERATOR.matches(((MethodTree) m))) .forEach(t -> t.accept(returnThis)); if (!returnThis.issueLocations.isEmpty()) { reportIssue(returnThis.issueLocations.get(0), "Refactor this code so that the Iterator supports multiple traversal", returnThis.issueLocations.stream().skip(1) .map(t -> new JavaFileScannerContext.Location("", t)).collect(Collectors.toList()), null); } }
Source:
<code>public PackBitmapIndexBuilder(List<ObjectToPack> objects) { super(new ObjectIdOwnerMap<StoredBitmap>()); byOffset = new BlockList<>(objects.size()); <START> sortByOffset(objects); <END> int sizeInWords = Math.max(4, byOffset.size() / 64 / 3); commits = new EWAHCompressedBitmap(sizeInWords); trees = new EWAHCompressedBitmap(sizeInWords); blobs = new EWAHCompressedBitmap(sizeInWords); tags = new EWAHCompressedBitmap(sizeInWords); for (int i = 0; i < objects.size(); i++) { int type = objects.get(i).getType(); switch (type) { case Constants.OBJ_COMMIT: commits.set(i); break; case Constants.OBJ_TREE: trees.set(i); break; case Constants.OBJ_BLOB: blobs.set(i); break; case Constants.OBJ_TAG: tags.set(i); break; default: throw new IllegalArgumentException(MessageFormat.format( JGitText.get().badObjectType, String.valueOf(type))); } } commits.trim(); trees.trim(); blobs.trim(); tags.trim(); }</code><technical_language>Stylistically, passing byOffset sortByOffset() function sortByOffset() allocate return a indication effect of calling sortByOffset is change byOffset list</technical_language>

Target:
public PackBitmapIndexBuilder(List<ObjectToPack> objects) { super(new ObjectIdOwnerMap<StoredBitmap>()); byOffset = new BlockList<>(objects.size()); sortByOffsetAndIndex(byOffset, positionEntries, objects); int sizeInWords = Math.max(4, byOffset.size() / 64 / 3); commits = new EWAHCompressedBitmap(sizeInWords); trees = new EWAHCompressedBitmap(sizeInWords); blobs = new EWAHCompressedBitmap(sizeInWords); tags = new EWAHCompressedBitmap(sizeInWords); for (int i = 0; i < objects.size(); i++) { int type = objects.get(i).getType(); switch (type) { case Constants.OBJ_COMMIT: commits.set(i); break; case Constants.OBJ_TREE: trees.set(i); break; case Constants.OBJ_BLOB: blobs.set(i); break; case Constants.OBJ_TAG: tags.set(i); break; default: throw new IllegalArgumentException(MessageFormat.format( JGitText.get().badObjectType, String.valueOf(type))); } } commits.trim(); trees.trim(); blobs.trim(); tags.trim(); }
Source:
<code>public void clickTemplateQuestionModalCheckBox(int questionNum) { WebElement questionCheckBox = browser.driver.findElement(By.id("addTemplateQuestionModalForm")) <START> .findElement(By.id("addTemplateQuestion-" + questionNum)) <END> .findElement(By.cssSelector("input")); click(questionCheckBox); }</code><technical_language>ID is a unique element in a page need a chain</technical_language>

Target:
public void clickTemplateQuestionModalCheckBox(int questionNum) { WebElement questionCheckBox = browser.driver.findElement(By.id("addTemplateQuestion-" + questionNum)) .findElement(By.cssSelector("input")); click(questionCheckBox); }
Source:
<code>public ReplicaMetadataRequestInfo(PartitionId partitionId, FindToken token, String hostName, String replicaPath) { if (partitionId == null || token == null || hostName == null || replicaPath == null) { logger.error( <START> "A parameter in replica metadata request is null: " + "[Partition: " + partitionId + ", token: " + token <END> + ", hostName: " + hostName + ", replicaPath: " + replicaPath); throw new IllegalArgumentException("no parameters of replica metadata request info can be null"); } this.partitionId = partitionId; this.token = token; this.hostName = hostName; this.replicaPath = replicaPath; }</code><technical_language>This get logged pollutes log. add this info Exception get logged</technical_language>

Target:
public ReplicaMetadataRequestInfo(PartitionId partitionId, FindToken token, String hostName, String replicaPath) { if (partitionId == null || token == null || hostName == null || replicaPath == null) { throw new IllegalArgumentException( "A parameter in the replica metadata request is null: " + "[Partition: " + partitionId + ", token: " + token + ", hostName: " + hostName + ", replicaPath: " + replicaPath); } this.partitionId = partitionId; this.token = token; this.hostName = hostName; this.replicaPath = replicaPath; }
Source:
<code>public void testRecursiveImportsMetadata() { try { WDLHandler.checkForRecursiveLocalImports(getSourceFile1().getContent(), getSourceFiles(), new HashSet<>(), "/"); Assert.fail("Should have detected recursive local import"); } catch (Exception e) { Assert.assertEquals("Recursive local import detected: /first-import.wdl", e.getMessage()); <START> } <END> }</code><technical_language>Adjust test custom exception</technical_language>

Target:
public void testRecursiveImportsMetadata() { try { WDLHandler.checkForRecursiveLocalImports(getSourceFile1().getContent(), getSourceFiles(), new HashSet<>(), "/"); Assert.fail("Should have detected recursive local import"); } catch (ParseException e) { Assert.assertEquals("Recursive local import detected: /first-import.wdl", e.getMessage()); } }
Source:
<code>private String getFilterCommandDefinition(String filterDriverName, String filterCommandType) { String key = filterDriverName + "." + filterCommandType; String filterCommand = filterCommandsByNameDotType.get(key); if (filterCommand != null) return filterCommand; filterCommand = config.getString(Constants.ATTR_FILTER, filterDriverName, filterCommandType); <START> boolean useBuiltin = config.getBoolean(Constants.ATTR_FILTER, <END> filterDriverName, Constants.ATTR_FILTER_USE_BUILTIN, false); if (useBuiltin) { String builtinFilterCommand = Constants.BUILTIN_FILTER_PREFIX + filterDriverName + "/" + filterCommandType; if (registeredCommands != null && registeredCommands.contains(builtinFilterCommand)) { filterCommand = builtinFilterCommand; } } if (filterCommand != null) { filterCommandsByNameDotType.put(key, filterCommand); } return filterCommand; }</code><technical_language>inline introduce a FilterConfig class encapsulating handling of filter related config options</technical_language>

Target:
private String getFilterCommandDefinition(String filterDriverName, String filterCommandType) { String key = filterDriverName + "." + filterCommandType; String filterCommand = filterCommandsByNameDotType.get(key); if (filterCommand != null) return filterCommand; filterCommand = config.getString(Constants.ATTR_FILTER, filterDriverName, filterCommandType); boolean useBuiltin = config.getBoolean(Constants.ATTR_FILTER, filterDriverName, Constants.ATTR_FILTER_USE_BUILTIN, false); if (useBuiltin) { String builtinFilterCommand = Constants.BUILTIN_FILTER_PREFIX + filterDriverName + "/" + filterCommandType; if (filterCommands != null && filterCommands.contains(builtinFilterCommand)) { filterCommand = builtinFilterCommand; } } if (filterCommand != null) { filterCommandsByNameDotType.put(key, filterCommand); } return filterCommand; }
Source:
<code>public void sendSuccessfullyUpdatedAccountsNotification(List<Account> updatedAccounts) { Map<String, Object> model = new HashMap<>(); model.put("accounts", updatedAccounts); <START> model.put("today", ZonedDateTime.now(UTC).toLocalDate()); <END> String text = mailBuilder.buildMailBody("updated_accounts", model, LOCALE); mailSender.sendEmail(getMailSettings(), RecipientUtil.getMailAddresses( recipientService.getRecipientsWithNotificationType(MailNotification.NOTIFICATION_OFFICE)), getTranslation("subject.account.updatedRemainingDays"), text); sendTechnicalNotification(getTranslation("subject.account.updatedRemainingDays"), text); }</code><technical_language>LocalDate.now(UTC);</technical_language>

Target:
public void sendSuccessfullyUpdatedAccountsNotification(List<Account> updatedAccounts) { Map<String, Object> model = new HashMap<>(); model.put("accounts", updatedAccounts); model.put("today", LocalDate.now(UTC)); String text = mailBuilder.buildMailBody("updated_accounts", model, LOCALE); mailSender.sendEmail(getMailSettings(), RecipientUtil.getMailAddresses( recipientService.getRecipientsWithNotificationType(MailNotification.NOTIFICATION_OFFICE)), getTranslation("subject.account.updatedRemainingDays"), text); sendTechnicalNotification(getTranslation("subject.account.updatedRemainingDays"), text); }
Source:
<code>public String[] getIdpInitSLOReturnToURLs() { <START> return idpInitSLOReturnToURLs; <END> }</code><technical_language>return a clone</technical_language>

Target:
public String[] getIdpInitSLOReturnToURLs() { if (idpInitSLOReturnToURLs == null) { return ArrayUtils.EMPTY_STRING_ARRAY; } return idpInitSLOReturnToURLs.clone(); }
Source:
<code>public void removeAllExpiredBans() { if(perunBl.isPerunReadOnly()) { <START> log.debug("This instance is just read only so skip removing expired bans."); <END> return; } try { getPerun().getResourcesManagerBl().removeAllExpiredBansOnResources(sess); getPerun().getFacilitiesManagerBl().removeAllExpiredBansOnFacilities(sess); } catch (InternalErrorException ex) { log.error("Synchronizer: removeAllExpiredBans, exception {}", ex); } }</code><technical_language>warning</technical_language>

Target:
public void removeAllExpiredBans() { if(perunBl.isPerunReadOnly()) { log.warn("This instance is just read only so skip removing expired bans."); return; } try { getPerun().getResourcesManagerBl().removeAllExpiredBansOnResources(sess); getPerun().getFacilitiesManagerBl().removeAllExpiredBansOnFacilities(sess); } catch (InternalErrorException ex) { log.error("Synchronizer: removeAllExpiredBans, exception {}", ex); } }