auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void createZonedDate() { String inputTimeString; TimeZone.setDefault(parameterSet.defaultTimeZone); if (parameterSet.inputTimeString == null) { <START> final Calendar calendar = Calendar.getInstance(parameterSet.inputTimeZone); <END> calendar.set(parameterSet.inputTimeMap.get("year"), parameterSet.inputTimeMap.get("month"), parameterSet.inputTimeMap.get("date"), parameterSet.inputTimeMap.get("hourOfDay"), parameterSet.inputTimeMap.get("minute"), parameterSet.inputTimeMap.get("second")); calendar.set(Calendar.MILLISECOND, parameterSet.inputTimeMap.get("milliseconds")); inputTimeString = new SimpleDateFormat(DateTimeType.DATE_PATTERN_WITH_TZ_AND_MS).format(calendar.getTime()); } else { inputTimeString = parameterSet.inputTimeString; } DateTimeType dt = new DateTimeType(inputTimeString); if (parameterSet.inputTimeZone == null) { dt = new DateTimeType(dt.getZonedDateTime().withZoneSameInstant(TimeZone.getDefault().toZoneId())); } assertEquals(parameterSet.expectedResult, dt.toString()); }</code><technical_language>Java 8 java.time.* APIs here</technical_language>

Target:
public void createZonedDate() { String inputTimeString; TimeZone.setDefault(parameterSet.defaultTimeZone); if (parameterSet.inputTimeString == null) { int durationInNano = (int) TimeUnit.NANOSECONDS.convert(parameterSet.inputTimeMap.get("milliseconds"), TimeUnit.MILLISECONDS); LocalDateTime dateTime = LocalDateTime.of(parameterSet.inputTimeMap.get("year"), parameterSet.inputTimeMap.get("month") + 1, parameterSet.inputTimeMap.get("date"), parameterSet.inputTimeMap.get("hourOfDay"), parameterSet.inputTimeMap.get("minute"), parameterSet.inputTimeMap.get("second"), durationInNano); ZonedDateTime zonedDate = ZonedDateTime.of(dateTime, parameterSet.inputTimeZone.toZoneId()).toInstant() .atZone(parameterSet.defaultTimeZone.toZoneId()); inputTimeString = zonedDate.format((DateTimeFormatter.ofPattern(DateTimeType.DATE_PATTERN_WITH_TZ_AND_MS))); } else { inputTimeString = parameterSet.inputTimeString; } DateTimeType dt = new DateTimeType(inputTimeString); if (parameterSet.inputTimeZone == null) { dt = new DateTimeType(dt.getZonedDateTime().withZoneSameInstant(TimeZone.getDefault().toZoneId())); } assertEquals(parameterSet.expectedResult, dt.toString()); }
Source:
<code>public void call(Subscriber<? super T> subscriber) { subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { that.cancel(true); } })); try { <START> if (subscriber.isUnsubscribed()) { <END> return; } T value = (unit == null) ? (T) that.get() : (T) that.get(time, unit); subscriber.onNext(value); subscriber.onCompleted(); } catch (Throwable e) { subscriber.onError(e); } }</code><technical_language>Agreed this statement. catch result in exception thrown unsubscribe happened is a race. need a check catch well</technical_language>

Target:
public void call(Subscriber<? super T> subscriber) { subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { that.cancel(true); } })); try { if (subscriber.isUnsubscribed()) { return; } T value = (unit == null) ? (T) that.get() : (T) that.get(time, unit); subscriber.onNext(value); subscriber.onCompleted(); } catch (Throwable e) { if (subscriber.isUnsubscribed()) { return; } subscriber.onError(e); } }
Source:
<code><START> public void updateAllInTransaction(Map<Guid, VmStatistics> vmStatisticsToSave) { <END> updateAllInBatch("updatevmstatistics", vmStatisticsToSave.values(), new MapSqlParameterMapper<VmStatistics>() { @Override public MapSqlParameterSource map(VmStatistics entity) { MapSqlParameterSource paramValue = new MapSqlParameterSource(); paramValue.addValue("cpu_sys", entity.getcpu_sys()); paramValue.addValue("cpu_user", entity.getcpu_user()); paramValue.addValue("elapsed_time", entity.getelapsed_time()); paramValue.addValue("usage_cpu_percent", entity.getusage_cpu_percent()); paramValue.addValue("usage_mem_percent", entity.getusage_mem_percent()); paramValue.addValue("usage_network_percent", entity.getusage_network_percent()); paramValue.addValue("disks_usage", entity.getDisksUsage()); paramValue.addValue("vm_guid", entity.getId()); return paramValue; } }); }</code><technical_language>This entire method is redundant. do is implement updarteAllInBatch(Collection<T>) in MassOperationGenericDAO in a similar fashion updateAll(Collection<T>) call there. point in this type of method in DAOs</technical_language>

Target:
public void updateAllInTransaction(Map<Guid, VmStatistics> vmStatisticsToSave) { updateAllInBatch("updatevmstatistics", vmStatisticsToSave.values(), new MapSqlParameterMapper<VmStatistics>() { @Override public MapSqlParameterSource map(VmStatistics entity) { MapSqlParameterSource paramValue = new MapSqlParameterSource() .addValue("cpu_sys", entity.getcpu_sys()) .addValue("cpu_user", entity.getcpu_user()) .addValue("elapsed_time", entity.getelapsed_time()) .addValue("usage_cpu_percent", entity.getusage_cpu_percent()) .addValue("usage_mem_percent", entity.getusage_mem_percent()) .addValue("usage_network_percent", entity.getusage_network_percent()) .addValue("disks_usage", entity.getDisksUsage()) .addValue("vm_guid", entity.getId()); return paramValue; } }); }
Source:
<code>public String getExpiresAtLabel() { <START> return "Expires at"; <END> }</code><technical_language>If time i18n is required QE</technical_language>

Target:
public String getExpiresAtLabel() { return translationService.getValue(StunnerBPMNConstants.NOTIFICATION_EXPIRESAT); }
Source:
<code>public void deactivate() { super.deactivate(); <START> logger.debug("DD-WRT binding has been started."); <END> }</code><technical_language>stopped</technical_language>

Target:
public void deactivate() { super.deactivate(); logger.debug("DD-WRT binding has been stopped."); }
Source:
<code>public void sleep(int retryCount) throws InterruptedException { long sleepMs = (long) (baseSleepTimeMs * Math.pow(2, retryCount)); <START> if(sleepMs > MAX_DELAY){ <END> sleepMs = MAX_DELAY; } TimeUnit.MILLISECONDS.sleep(sleepMs); }</code><technical_language>Please follow existing code style spaces</technical_language>

Target:
public void sleep(int retryCount) throws InterruptedException { long sleepMs = (long) (baseSleepTimeMs * Math.pow(2, retryCount)); TimeUnit.MILLISECONDS.sleep(sleepMs); }
Source:
<code>public VoiceCallLeg viewCallLegByCallIdAndLegId(final String callId, String legId) throws UnsupportedEncodingException, NotFoundException, GeneralException, UnauthorizedException { <START> String url = VOICE_CALLS_BASE_URL + <END> VOICECALLSPATH + "/" + urlEncode(callId) + VOICELEGS_SUFFIX_PATH; VoiceCallLegResponse response = messageBirdService.requestByID(url, legId, VoiceCallLegResponse.class); if (response.getData().size() == 1) { return response.getData().get(0); } else { throw new NotFoundException("No such leg", new LinkedList<ErrorReport>()); } }</code><technical_language>I feel a String.format in situations this</technical_language>

Target:
VoiceCallLeg viewCallLegByCallIdAndLegId(final String callId, String legId) throws UnsupportedEncodingException, NotFoundException, GeneralException, UnauthorizedException { if (callId == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (legId == null) { throw new IllegalArgumentException("Leg ID must be specified."); } String url = String.format( "%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, urlEncode(callId), VOICELEGS_SUFFIX_PATH); VoiceCallLegResponse response = messageBirdService.requestByID(url, legId, VoiceCallLegResponse.class); if (response.getData().size() == 1) { return response.getData().get(0); } else { throw new NotFoundException("No such leg", new LinkedList<ErrorReport>()); } }
Source:
<code>public void testTimeLine() { String lines = "pulse"; <START> resetTimeRange(); <END> SWTBotTimeGraph timegraph = fTimeGraph; assertEquals(0, timegraph.selection().columnCount()); ImageHelper currentImage = ImageHelper.grabImage(fBounds); SWTBotTimeGraphEntry entry = timegraph.getEntry(lines); entry = timegraph.getEntry(lines).select(); ImageHelper.waitForNewImage(fBounds, currentImage); Rectangle rect = entry.absoluteLocation(); ImageHelper image = ImageHelper.grabImage(rect); ImmutableMultiset<RGB> ms = Multisets.copyHighestCountFirst(image.getHistogram()); int black = ms.count(new RGB(0, 0, 0)); RGB bgColor = ms.elementSet().iterator().next(); int bgCount = ms.count(bgColor); float actual = ((float) black) / (bgCount); System.out.println(Integer.toString(black) + " " + bgCount + " " + actual * 100); assertEquals(0.113f, actual, 0.05f); }</code><technical_language>curious, this method change initial range full range</technical_language>

Target:
public void testTimeLine() { String lines = "pulse"; resetTimeRange(); SWTBotTimeGraph timegraph = fTimeGraph; assertEquals(0, timegraph.selection().columnCount()); ImageHelper currentImage = ImageHelper.waitForNewImage(fBounds, null); SWTBotTimeGraphEntry entry = timegraph.getEntry(lines); entry = timegraph.getEntry(lines).select(); ImageHelper.waitForNewImage(fBounds, currentImage); Rectangle rect = entry.absoluteLocation(); ImageHelper image = ImageHelper.grabImage(rect); ImmutableMultiset<RGB> ms = Multisets.copyHighestCountFirst(image.getHistogram()); int black = ms.count(new RGB(0, 0, 0)); RGB bgColor = ms.elementSet().iterator().next(); int bgCount = ms.count(bgColor); float actual = ((float) black) / (bgCount); assertEquals(0.113f, actual, 0.05f); }
Source:
<code>public void init() { if (managementRegistry != null) { LOGGER.trace("init({})", storeIdentifier); ServerSideServerStore serverStore = ehcacheStateService.getStore(storeIdentifier); ServerStoreBinding serverStoreBinding = new ServerStoreBinding(storeIdentifier, serverStore); managementRegistry.register(serverStoreBinding); ServerSideConfiguration.Pool pool = ehcacheStateService.getDedicatedResourcePool(storeIdentifier); if (pool != null) { managementRegistry.register(new PoolBinding(storeIdentifier, pool, PoolBinding.AllocationType.DEDICATED)); } managementRegistry.refresh(); managementRegistry.pushServerEntityNotification(serverStoreBinding, EHCACHE_SERVER_STORE_CREATED.name()); <START> } <END> }</code><technical_language>@ljacomet : I forgot update this part in previous PR. Now, calls register() delayed need completable futures delegate refreshing push of notification, in case platform send entity creation event fast. Is change this: if (managementRegistry != null) { LOGGER.trace("init({})", storeIdentifier); ServerSideServerStore serverStore = ehcacheStateService.getStore(storeIdentifier); ServerStoreBinding serverStoreBinding = new ServerStoreBinding(storeIdentifier, serverStore); CompletableFuture<?> r1 = managementRegistry.register(serverStoreBinding); ServerSideConfiguration.Pool pool = ehcacheStateService.getDedicatedResourcePool(storeIdentifier); CompletableFuture<?> r2; if (pool != null) { r2 = managementRegistry.register(new PoolBinding(storeIdentifier, pool, PoolBinding.AllocationType.DEDICATED)); } else { r2 = CompletableFuture.completedFuture(null); } CompletableFuture.allOf(r1, r2) .thenRun(() -> managementRegistry.refresh() .thenRun(() -> managementRegistry.pushServerEntityNotification(serverStoreBinding, EHCACHE_SERVER_STORE_CREATED.name()))); }</technical_language>

Target:
public void init() { if (managementRegistry != null) { LOGGER.trace("init({})", storeIdentifier); ServerSideServerStore serverStore = ehcacheStateService.getStore(storeIdentifier); ServerStoreBinding serverStoreBinding = new ServerStoreBinding(storeIdentifier, serverStore); CompletableFuture<Void> r1 = managementRegistry.register(serverStoreBinding); ServerSideConfiguration.Pool pool = ehcacheStateService.getDedicatedResourcePool(storeIdentifier); CompletableFuture<Void> allOf; if (pool != null) { allOf = CompletableFuture.allOf(r1, managementRegistry.register(new PoolBinding(storeIdentifier, pool, PoolBinding.AllocationType.DEDICATED))); } else { allOf = r1; } allOf.thenRun(() -> { managementRegistry.refresh(); managementRegistry.pushServerEntityNotification(serverStoreBinding, EHCACHE_SERVER_STORE_CREATED.name()); }); } }
Source:
<code>public ByteChannel wrapChannel(SocketChannel channel, SelectionKey key) throws IOException { SSLEngine e = sslcontext.createSSLEngine(); e.setUseClientMode(false); <START> if (sslParameters != null) { <END> e.setSSLParameters(sslParameters); } return new SSLSocketChannel2(channel, e, exec, key); }</code><technical_language>check needed throw IllegalArgumentException()</technical_language>

Target:
public ByteChannel wrapChannel(SocketChannel channel, SelectionKey key) throws IOException { SSLEngine e = sslcontext.createSSLEngine(); e.setUseClientMode(false); e.setSSLParameters(sslParameters); return new SSLSocketChannel2(channel, e, exec, key); }
Source:
<code>public void doImport(VM vm) { if (!Config.<Boolean>getValue( ConfigValues.AutoImportHostedEngine, vdsGroupDAO.get(vm.getVdsGroupId()).getCompatibilityVersion().getValue())) { return; <START> } <END> VdcReturnValueBase heVmImported; StorageDomain sd = getHEStorageDomain(vm); if (sd != null && (sd.getStatus() == StorageDomainStatus.Active)) { log.info("Try to import the Hosted Engine VM '{}'", vm); if (vmStaticDAO.get(vm.getId()) == null || removedHEVM(vm)) { heVmImported = importHEVM(vm, sd); if (heVmImported.getSucceeded()) { log.info("Successfully imported the Hosted Engine VM"); auditLogDirector.log(new AuditLogableBase(), AuditLogType.HOSTED_ENGINE_VM_IMPORT_SUCCEEDED); } else { log.error("Failed importing the Hosted Engine VM"); auditLogDirector.log(new AuditLogableBase(), AuditLogType.HOSTED_ENGINE_VM_IMPORT_FAILED); } } } else { if (sd == null) { log.debug("Skip trying to import the Hosted Engine VM. Storage Domain '{}' doesn't exist", Config.<String>getValue(ConfigValues.HostedEngineStorageDomainName)); auditLogDirector.log(new AuditLogableBase(), AuditLogType.HOSTED_ENGINE_SD_NOT_EXIT); } else { log.debug("Skip trying to import the Hosted Engine VM. Storage Domain '{}' isn't ACTIVE", sd); auditLogDirector.log(new AuditLogableBase(), AuditLogType.HOSTED_ENGINE_SD_NOT_ACTIVE); } } }</code><technical_language>data Center level, do for ImportStorageDomain</technical_language>

Target:
public void doImport(VM vm) { if (!Config.<Boolean>getValue( ConfigValues.AutoImportHostedEngine, storagePoolDao.getForVdsGroup(vm.getVdsGroupId()).getCompatibilityVersion().getValue())) { return; } VdcReturnValueBase heVmImported; StorageDomain sd = getHEStorageDomain(vm); if (sd != null && (sd.getStatus() == StorageDomainStatus.Active)) { log.info("Try to import the Hosted Engine VM '{}'", vm); if (vmStaticDAO.get(vm.getId()) == null || removedHEVM(vm)) { heVmImported = importHEVM(vm, sd); if (heVmImported.getSucceeded()) { log.info("Successfully imported the Hosted Engine VM"); auditLogDirector.log(new AuditLogableBase(), AuditLogType.HOSTED_ENGINE_VM_IMPORT_SUCCEEDED); } else { log.error("Failed importing the Hosted Engine VM"); auditLogDirector.log(new AuditLogableBase(), AuditLogType.HOSTED_ENGINE_VM_IMPORT_FAILED); } } } else { if (sd == null) { log.debug("Skip trying to import the Hosted Engine VM. Storage Domain '{}' doesn't exist", Config.<String>getValue(ConfigValues.HostedEngineStorageDomainName)); auditLogDirector.log(new AuditLogableBase(), AuditLogType.HOSTED_ENGINE_SD_NOT_EXIT); } else { log.debug("Skip trying to import the Hosted Engine VM. Storage Domain '{}' isn't ACTIVE", sd); auditLogDirector.log(new AuditLogableBase(), AuditLogType.HOSTED_ENGINE_SD_NOT_ACTIVE); } } }
Source:
<code>public void onClick(View view) { Intent intent = new Intent(); switch (view.getId()) { case R.id.nav_item_history: intent.setClass(this.getActivity(), HistoryActivity.class); getActivity().startActivity(intent); break; case R.id.nav_item_saved_pages: intent.setClass(this.getActivity(), BookmarksActivity.class); startActivity(intent); break; case R.id.nav_item_settings: intent.setClass(this.getActivity(), SettingsActivity.class); <START> startActivityForResult(intent, 1); <END> break; case R.id.nav_item_login: intent.setClass(this.getActivity(), LoginActivity.class); intent.putExtra(LoginActivity.LOGIN_REQUEST_SOURCE, LoginFunnel.SOURCE_NAV); startActivity(intent); break; case R.id.nav_item_random: randomHandler.doVistRandomArticle(); break; case R.id.nav_item_send_feedback: intent.setAction(Intent.ACTION_SENDTO); intent.setData(Uri.parse("mailto:mobile-android-wikipedia@wikimedia.org?subject=Android App " + WikipediaApp.APP_VERSION_STRING + " Feedback")); startActivity(intent); break; case R.id.nav_item_logout: doLogout(); break; default: throw new RuntimeException("Unknown ID clicked!"); } }</code><technical_language>want define a constant for this? ^</technical_language>

Target:
public void onClick(View view) { Intent intent = new Intent(); switch (view.getId()) { case R.id.nav_item_history: intent.setClass(this.getActivity(), HistoryActivity.class); getActivity().startActivity(intent); break; case R.id.nav_item_saved_pages: intent.setClass(this.getActivity(), BookmarksActivity.class); startActivity(intent); break; case R.id.nav_item_settings: intent.setClass(this.getActivity(), SettingsActivity.class); startActivityForResult(intent, SettingsActivity.ACTIVITY_REQUEST_SHOW_SETTINGS); break; case R.id.nav_item_login: intent.setClass(this.getActivity(), LoginActivity.class); intent.putExtra(LoginActivity.LOGIN_REQUEST_SOURCE, LoginFunnel.SOURCE_NAV); startActivity(intent); break; case R.id.nav_item_random: randomHandler.doVistRandomArticle(); break; case R.id.nav_item_send_feedback: intent.setAction(Intent.ACTION_SENDTO); intent.setData(Uri.parse("mailto:mobile-android-wikipedia@wikimedia.org?subject=Android App " + WikipediaApp.APP_VERSION_STRING + " Feedback")); startActivity(intent); break; case R.id.nav_item_logout: doLogout(); break; default: throw new RuntimeException("Unknown ID clicked!"); } }
Source:
<code>public void resumeInterest() { LockId lockId = LockDataTypes.LockId.newBuilder() .setLockGroup(lockConfig.getLockGroup()) .setLockName(lockConfig.getLockName()) .build(); if (!locks.containsKey(lockId)){ throw new IllegalStateException("Can only resume interest if the known " + "lock is present in the map."); } Lock lock = locks.get(lockId); <START> <END> monitorLocks(); lock.input(LockEvent.LEASE_REVOKED); }</code><technical_language>LockClient in state calling deregisterInterest() LEASE_EXPIRED event received in HAS_LEASE state. I set state correctly in discoveryService I validation</technical_language>

Target:
public void resumeInterest() { LockId lockId = LockDataTypes.LockId.newBuilder() .setLockGroup(lockConfig.getLockGroup()) .setLockName(lockConfig.getLockName()) .build(); if (!locks.containsKey(lockId)){ throw new IllegalStateException("Can only resume interest if the known " + "lock is present in the map."); } Lock lock = locks.get(lockId); if (lock.getState().getType() != LockStateType.NO_LEASE) { throw new IllegalStateException("Can only resume interest if the lock " + "is in NO_LEASE state."); } monitorLocks(); lock.input(LockEvent.LEASE_REVOKED); }
Source:
<code>public void notifyLostResource(ResourceProfile resourceProfile) { Preconditions.checkNotNull(resourceProfile); if (excessResources.getResourceCount(resourceProfile) > 0) { LOG.trace("Job lost excess resource {}.", jobId, resourceProfile); excessResources.decrementCount(resourceProfile, 1); return; } Set<ResourceProfile> fulfilledRequirements = resourceToRequirementMapping.getRequirementsFulfilledBy(resourceProfile).keySet(); if (!fulfilledRequirements.isEmpty()) { ResourceProfile assignedRequirement = null; for (ResourceProfile requirementProfile : fulfilledRequirements) { assignedRequirement = requirementProfile; if (resourceRequirements.getResourceCount(requirementProfile) < resourceToRequirementMapping.getNumFulfillingResources(requirementProfile)) { break; } } if (assignedRequirement == null) { throw new IllegalStateException(String.format("Job %s lost a (non-excess) resource %s but no requirement was assigned to it.", jobId, resourceProfile)); } resourceToRequirementMapping.decrementCount(assignedRequirement, resourceProfile, 1); tryAssigningExcessSlots(); } else { <START> LOG.warn("Job lost a resource but no such resource was tracked.", jobId, resourceProfile); <END> } }</code><technical_language>this happen is this invalid state</technical_language>

Target:
public void notifyLostResource(ResourceProfile resourceProfile) { Preconditions.checkNotNull(resourceProfile); if (excessResources.getResourceCount(resourceProfile) > 0) { LOG.trace("Job lost excess resource {}.", jobId, resourceProfile); excessResources.decrementCount(resourceProfile, 1); return; } Set<ResourceProfile> fulfilledRequirements = resourceToRequirementMapping.getRequirementsFulfilledBy(resourceProfile).keySet(); if (!fulfilledRequirements.isEmpty()) { ResourceProfile assignedRequirement = fulfilledRequirements.iterator().next(); resourceToRequirementMapping.decrementCount(assignedRequirement, resourceProfile, 1); tryAssigningExcessSlots(); } else { throw new IllegalStateException(String.format("Job %s lost a resource %s but no such resource was tracked.", jobId, resourceProfile)); } }
Source:
<code>public String getName() { <START> return "StrategyResolve"; <END> }</code><technical_language>I "resolve" fits other strategy names have</technical_language>

Target:
public String getName() { return "resolve"; }
Source:
<code>public ThreadPoolTaskScheduler threadPoolTaskScheduler() { ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler(); threadPoolTaskScheduler.setPoolSize(1); <START> threadPoolTaskScheduler.setThreadNamePrefix("ThreadPoolTaskScheduler"); <END> return threadPoolTaskScheduler; }</code><technical_language>threadName for config classes, consider change this name ExchangeThreadPoolTaskScheduler debug in server log if needed</technical_language>

Target:
public ThreadPoolTaskScheduler threadPoolTaskScheduler() { ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler(); threadPoolTaskScheduler.setPoolSize(1); threadPoolTaskScheduler.setThreadNamePrefix("ExchangeThreadPoolTaskScheduler"); return threadPoolTaskScheduler; }
Source:
<code>public void put(HttpServletRequest request, HttpServletResponse response) throws ZebedeeException, IOException { Session session = zebedeeCmsService.getSession(request); if (!zebedeeCmsService.getPermissions().canEdit(session)) { logInfo("Forbidden request made to the collection endpoint").log(); response.setStatus(HttpStatus.SC_FORBIDDEN); return; } Path path = Path.newInstance(request); List<String> segments = path.segments(); <START> if (segments.size() < 4 || <END> !segments.get(2).equalsIgnoreCase("instances")) { logInfo("Endpoint for colletions not found").addParameter("path", path).log(); response.setStatus(HttpStatus.SC_NOT_FOUND); return; } String collectionID = segments.get(1); String instanceID = segments.get(3); logInfo("PUT called on /collections/{collection_id}/instances/{instance_id} endpoint") .addParameter("collectionID", collectionID) .addParameter("instanceID", instanceID) .log(); datasetService.addInstanceToCollection(collectionID, instanceID); }</code><technical_language>pull this out common method</technical_language>

Target:
public void put(HttpServletRequest request, HttpServletResponse response) throws ZebedeeException, IOException { Session session = zebedeeCmsService.getSession(request); if (!zebedeeCmsService.getPermissions().canEdit(session)) { logInfo("Forbidden request made to the collection endpoint").log(); response.setStatus(HttpStatus.SC_FORBIDDEN); return; } Path path = Path.newInstance(request); List<String> segments = path.segments(); if (!isValidPath(response, path, segments)) return; String collectionID = segments.get(1); String instanceID = segments.get(3); logInfo("PUT called on /collections/{collection_id}/instances/{instance_id} endpoint") .addParameter("collectionID", collectionID) .addParameter("instanceID", instanceID) .log(); try { datasetService.addInstanceToCollection(collectionID, instanceID); } catch (UnexpectedResponseException e) { throw new UnexpectedErrorException(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } catch (InstanceNotFoundException | DatasetNotFoundException e) { throw new NotFoundException(e.getMessage()); } catch (com.github.onsdigital.zebedee.dataset.api.exception.BadRequestException e) { throw new BadRequestException(e.getMessage()); } }
Source:
<code>public void requestsContinueWithOldClientIfDelegateSupplierThrows() throws IOException { when(clientSupplier.get()).thenReturn(client); when(client.execute(request, options)).thenThrow(CLIENT_EXCEPTION); Client refreshingClient = new ExceptionCountingRefreshingClient(clientSupplier, EXCEPTION_COUNT_BEFORE_REFRESH); callExecute(refreshingClient,1); <START> when(clientSupplier.get()).thenThrow(new IllegalStateException("bad")); <END> int numberOfExecutions = EXCEPTION_COUNT_BEFORE_REFRESH + 1; callExecute(refreshingClient, numberOfExecutions - 1); verify(clientSupplier, times((numberOfExecutions / EXCEPTION_COUNT_BEFORE_REFRESH + 1))).get(); verify(client, times(numberOfExecutions)).execute(request, options); verifyNoMoreInteractions(clientSupplier, client); }</code><technical_language>I _think_ this is equivalent writing line beginning when(clientSupplier.get()).thenReturn(client).thenThrow(new ISE("bad"));. This avoid do numberOfExecutions - 1 calls in line 98, requires figure out a - 1 there</technical_language>

Target:
public void requestsContinueWithOldClientIfDelegateSupplierThrows() throws IOException { when(clientSupplier.get()).thenReturn(client).thenThrow(new IllegalStateException("bad")); when(client.execute(request, options)).thenThrow(CLIENT_EXCEPTION); Client refreshingClient = new ExceptionCountingRefreshingClient(clientSupplier, EXCEPTION_COUNT_BEFORE_REFRESH); int numberOfExecutions = EXCEPTION_COUNT_BEFORE_REFRESH + 1; callExecute(refreshingClient, numberOfExecutions); verify(clientSupplier, times((numberOfExecutions / EXCEPTION_COUNT_BEFORE_REFRESH + 1))).get(); verify(client, times(numberOfExecutions)).execute(request, options); verifyNoMoreInteractions(clientSupplier, client); }
Source:
<code>public int generateDataAccessor(final long classid, final String classname, final int probecount, final MethodVisitor mv) { <START> mv.visitFieldInsn(Opcodes.GETSTATIC, className, FIELD_NAME, FIELD_TYPE); <END> RuntimeData.generateAccessCall(classid, classname, probecount, mv); return 6; }</code><technical_language>classname vs. className is tricky. I prefer a more distinct naming, e.g. rename member className injectedClassName</technical_language>

Target:
public int generateDataAccessor(final long classid, final String classname, final int probecount, final MethodVisitor mv) { mv.visitFieldInsn(Opcodes.GETSTATIC, injectedClassName, FIELD_NAME, FIELD_TYPE); RuntimeData.generateAccessCall(classid, classname, probecount, mv); return 6; }
Source:
<code>private void addRemoveRowColumn() { ButtonCell buttonCell = new ButtonCell(IconType.TRASH, ButtonType.DANGER, ButtonSize.SMALL); Column<ObjectProperty, String> column = new Column<ObjectProperty, String>(buttonCell) { @Override public String getValue(ObjectProperty objectProperty) { <START> buttonCell.setEnabled(objectProperty.getAnnotation("javax.annotation.Generated") == null); <END> return Constants.INSTANCE.objectBrowser_action_delete(); } }; column.setFieldUpdater(new FieldUpdater<ObjectProperty, String>() { @Override public void update(int index, ObjectProperty objectProperty, String value) { if (!readonly) { presenter.onDeleteProperty(objectProperty, index); } } }); propertiesTable.addColumn(column, ""); propertiesTable.setColumnWidth(column, calculateButtonSize(Constants.INSTANCE.objectBrowser_action_delete()), Style.Unit.PX); }</code><technical_language>@mcimbora , if this code is "limit" "delete field operation" fields generated data modeler? this is do, data modeller eventually edit manage dataobjects eventually generated external tools</technical_language>

Target:
private void addRemoveRowColumn() { ButtonCell buttonCell = new ButtonCell(IconType.TRASH, ButtonType.DANGER, ButtonSize.SMALL); Column<ObjectProperty, String> column = new Column<ObjectProperty, String>(buttonCell) { @Override public String getValue(ObjectProperty objectProperty) { buttonCell.setEnabled(isRemoveButtonEnabled(objectProperty)); return Constants.INSTANCE.objectBrowser_action_delete(); } }; column.setFieldUpdater(new FieldUpdater<ObjectProperty, String>() { @Override public void update(int index, ObjectProperty objectProperty, String value) { if (!readonly) { presenter.onDeleteProperty(objectProperty, index); } } }); propertiesTable.addColumn(column, ""); propertiesTable.setColumnWidth(column, calculateButtonSize(Constants.INSTANCE.objectBrowser_action_delete()), Style.Unit.PX); }
Source:
<code>public void boards_panelCount_nothingHappensWhenNewBoardIsCancelled() { UI ui = TestController.getUI(); PanelControl panelControl = ui.getPanelControl(); assertEquals(0, panelControl.getNumberOfSavedBoards()); assertEquals(1, panelControl.getPanelCount()); traverseMenu("Boards", "New"); waitUntilNodeAppears("No"); clickOn("No"); <START> press(KeyCode.ESCAPE); <END> assertEquals(0, panelControl.getNumberOfSavedBoards()); assertEquals(1, panelControl.getPanelCount()); }</code><technical_language>Is escape needed here</technical_language>

Target:
public void boards_panelCount_nothingHappensWhenNewBoardIsCancelled() { UI ui = TestController.getUI(); PanelControl panelControl = ui.getPanelControl(); assertEquals(0, panelControl.getNumberOfSavedBoards()); assertEquals(1, panelControl.getPanelCount()); traverseMenu("Boards", "New"); waitUntilNodeAppears("No"); clickOn("No"); waitUntilNodeAppears("Cancel"); clickOn("Cancel"); assertEquals(0, panelControl.getNumberOfSavedBoards()); assertEquals(1, panelControl.getPanelCount()); }
Source:
<code>private boolean release0(int decrement) { int rawCnt = nonVolatileRawCnt(); for (boolean firstTry = true;; firstTry = false) { if ((rawCnt & 1) != 0) { throw new IllegalReferenceCountException(0, -decrement); } int realCnt = rawCnt >>> 1; if (decrement == realCnt) { if (refCntUpdater.compareAndSet(this, rawCnt, 1)) { deallocate(); return true; } if (!firstTry) { Thread.yield(); } } else if (decrement < realCnt) { if (refCntUpdater.compareAndSet(this, rawCnt, rawCnt - (decrement << 1))) { return false; } if (!firstTry) { Thread.yield(); } } else if (!firstTry) { throw new IllegalReferenceCountException(realCnt, -decrement); } rawCnt = refCntUpdater.get(this); <START> } <END> }</code><technical_language>nit: consider simplify this: java for (boolean firstTry = true, int rawCnt = nonVolatileRawCnt();; firstTry = false, rawCnt = refCntUpdater.get(this)) { if ((rawCnt & 1) != 0) { throw new IllegalReferenceCountException(0, -decrement); } int realCnt = rawCnt >>> 1; if (decrement == realCnt) { // case if (refCntUpdater.compareAndSet(this, rawCnt, 1)) { // odd number deallocate(); return true; } } else if (decrement < realCnt) { // changes raw count 2x "real" change if (refCntUpdater.compareAndSet(this, rawCnt, rawCnt - (decrement << 1))) { return false; } } else if (!firstTry) { throw new IllegalReferenceCountException(realCnt, -decrement); } if (!firstTry) { // this benefits throughput high contention Thread.yield(); } rawCnt = refCntUpdater.get(this); }</technical_language>

Target:
private boolean release0(int decrement) { int rawCnt = nonVolatileRawCnt(), realCnt = toLiveRealCnt(rawCnt, decrement); if (decrement == realCnt) { if (refCntUpdater.compareAndSet(this, rawCnt, 1)) { deallocate(); return true; } return retryRelease0(decrement); } return releaseNonFinal0(decrement, rawCnt, realCnt); }
Source:
<code>public void shouldFilterTransactionsByCardHolderName() { String cardHolderName = "Mr. PayMcPayment"; <START> addChargeAndCardDetails(nextLong(), CREATED, ServicePaymentReference.of("ref-1"), "ref", now(), "", "<LINK_0>", "aaa@bbb.test", cardHolderName, "1234", "CREDIT"); <END> addChargeAndCardDetails(nextLong(), AUTHORISATION_SUCCESS, ServicePaymentReference.of("ref-1"), "ref", now(), "", "<LINK_0>", "aaa@bbb.test", cardHolderName, "1234", "CREDIT"); connectorRestApiClient .withAccountId(accountId) .withQueryParam("cardholder_name", "PayMc") .withHeader(HttpHeaders.ACCEPT, APPLICATION_JSON) .getChargesV2() .statusCode(OK.getStatusCode()) .contentType(JSON) .body("results.size()", is(2)) .body("results[0].card_details.cardholder_name", is(cardHolderName)) .body("results[0].card_details.last_digits_card_number", is("1234")); }</code><technical_language>CREDIT, a mix of values for a greater coverage</technical_language>

Target:
public void shouldFilterTransactionsByCardHolderName() { String cardHolderName = "Mr. PayMcPayment"; addChargeAndCardDetails(nextLong(), CREATED, ServicePaymentReference.of("ref-1"), "ref", now(), "", "<LINK_0>", "aaa@bbb.test", cardHolderName, "1234", "CREDIT"); addChargeAndCardDetails(nextLong(), AUTHORISATION_SUCCESS, ServicePaymentReference.of("ref-1"), "ref", now(), "", "<LINK_0>", "aaa@bbb.test", cardHolderName, "1234", "DEBIT"); connectorRestApiClient .withAccountId(accountId) .withQueryParam("cardholder_name", "PayMc") .withHeader(HttpHeaders.ACCEPT, APPLICATION_JSON) .getChargesV2() .statusCode(OK.getStatusCode()) .contentType(JSON) .body("results.size()", is(2)) .body("results[0].card_details.cardholder_name", is(cardHolderName)) .body("results[0].card_details.card_type", is("debit")) .body("results[0].card_details.last_digits_card_number", is("1234")) .body("results[1].card_details.cardholder_name", is(cardHolderName)) .body("results[1].card_details.card_type", is("credit")) .body("results[1].card_details.last_digits_card_number", is("1234")); }
Source:
<code>public String toString() { <START> return "KinesisSupervisorSpec{" + <END> "dataSchema=" + getDataSchema() + ", tuningConfig=" + getTuningConfig() + ", ioConfig=" + getIoConfig() + ", suspended=" + isSuspended() + '}'; }</code><technical_language>add context here</technical_language>

Target:
public String toString() { return "KinesisSupervisorSpec{" + "dataSchema=" + getDataSchema() + ", tuningConfig=" + getTuningConfig() + ", ioConfig=" + getIoConfig() + ", suspended=" + isSuspended() + ", context=" + getContext() + '}'; }
Source:
<code>public DecimalSubtractExpression(List<Expression> children) { super(children); <START> maxLengths = new Integer[children.size()]; <END> scales = new Integer[children.size()]; for (int i=0; i<children.size(); i++) { Expression childExpr = children.get(i); if (i == 0) { maxLengths[i] = childExpr.getMaxLength(); scales[i] = childExpr.getScale(); } else if (maxLengths[i-1] != null && scales[i-1] != null && childExpr.getMaxLength() != null && childExpr.getScale() != null) { maxLengths[i] = NumberUtil.getDecimalPrecision(NumericOperators.MINUS, maxLengths[i-1], childExpr.getMaxLength(), scales[i-1], childExpr.getScale()); scales[i] = NumberUtil.getDecimalScale(NumericOperators.MINUS, maxLengths[i-1], childExpr.getMaxLength(), scales[i-1], childExpr.getScale()); } } }</code><technical_language>I precision/scale, calculated logic written, a loop instead of lhs rhs. in case mentioned if col1 + col2 + col3 fail if result fits precision. driving a spec ok. alternative create arithmetic expressions 2 children, instead of n. I advantage failing expression evaluation in case mention. Oracle fail it? If Oracle Postgres Derby fail in this case, move 2 children expressions. Otherwise, do above</technical_language>

Target:
public DecimalSubtractExpression(List<Expression> children) { super(children); for (int i=0; i<children.size(); i++) { Expression childExpr = children.get(i); if (i == 0) { maxLength = childExpr.getMaxLength(); scale = childExpr.getScale(); } else if (maxLength != null && scale != null && childExpr.getMaxLength() != null && childExpr.getScale() != null) { maxLength = getPrecision(maxLength, childExpr.getMaxLength(), scale, childExpr.getScale()); scale = getScale(maxLength, childExpr.getMaxLength(), scale, childExpr.getScale()); } } }
Source:
<code>public static synchronized void install() { <START> new Exception("Http2Agent.install() no longer does anything, please remove all invocations from your codebase") <END> .printStackTrace(); }</code><technical_language>This throw</technical_language>

Target:
public static void install() { }
Source:
<code><START> public List<String> getKeys(GetUserKeysCmd cmd){ <END> final long userId = cmd.getID(); User user = getActiveUser(userId); if(user==null){ throw new InvalidParameterValueException("Unable to find user by id"); } final ControlledEntity account = getAccount(getUserAccountById(userId).getAccountId()); checkAccess(CallContext.current().getCallingUser(), account); List<String> keys = new ArrayList<String>(); keys.add(user.getApiKey()); keys.add(user.getSecretKey()); return keys; }</code><technical_language>Instead of a list this a Pair (keypair) of string, rename method getUserKeyPair()</technical_language>

Target:
public Map<String, String> getKeys(GetUserKeysCmd cmd){ final long userId = cmd.getID(); User user = getActiveUser(userId); if(user==null){ throw new InvalidParameterValueException("Unable to find user by id"); } final ControlledEntity account = getAccount(getUserAccountById(userId).getAccountId()); checkAccess(CallContext.current().getCallingUser(), account); Map <String, String> keys = new HashMap<String, String>(); keys.put("apikey", user.getApiKey()); keys.put("secretkey", user.getSecretKey()); return keys; }
Source:
<code>public void updateRole(@NonNull final String id, final JSONObject content, final KuzzleOptions options, final KuzzleResponseListener<KuzzleRole> listener) throws JSONException { if (id == null) { throw new IllegalArgumentException("KuzzleSecurity.updateRole: cannot update role without an ID"); } JSONObject data = new JSONObject().put("_id", id); data.put("body", content); if (listener != null) { this.kuzzle.query(buildQueryArgs("updateRole"), data, options, new OnQueryDoneListener() { @Override public void onSuccess(JSONObject response) { try { <START> listener.onSuccess(new KuzzleRole(KuzzleSecurity.this.kuzzle, response.getJSONObject("result").getString("_id"), response.getJSONObject("result"))); <END> } catch(JSONException e) { throw new RuntimeException(e); } } @Override public void onError(JSONObject error) { listener.onError(error); } }); } else { this.kuzzle.query(buildQueryArgs("updateRole"), data, options); } }</code><technical_language>I pass result._source new role content. yet, content argument of this method, updateRole performs a replace</technical_language>

Target:
public void updateRole(@NonNull final String id, final JSONObject content, final KuzzleOptions options, final KuzzleResponseListener<KuzzleRole> listener) throws JSONException { if (id == null) { throw new IllegalArgumentException("KuzzleSecurity.updateRole: cannot update role without an ID"); } JSONObject data = new JSONObject().put("_id", id); data.put("body", content); if (listener != null) { this.kuzzle.query(buildQueryArgs("updateRole"), data, options, new OnQueryDoneListener() { @Override public void onSuccess(JSONObject response) { try { listener.onSuccess(new KuzzleRole(KuzzleSecurity.this.kuzzle, response.getJSONObject("result").getString("_id"), response.getJSONObject("result").getJSONObject("_source"))); } catch(JSONException e) { throw new RuntimeException(e); } } @Override public void onError(JSONObject error) { listener.onError(error); } }); } else { this.kuzzle.query(buildQueryArgs("updateRole"), data, options); } }
Source:
<code>public synchronized void deleteRepository( String id ) throws NoSuchRepositoryException, IOException, ConfigurationException { Repository repository = repositoryRegistry.getRepository( id ); repository.setLocalStatus( LocalStatus.OUT_OF_SERVICE ); repository.setIndexable( false ); repository.setSearchable( false ); List<ShadowRepository> shadows = repositoryRegistry.getRepositoriesWithFacet( ShadowRepository.class ); for ( Iterator<ShadowRepository> i = shadows.iterator(); i.hasNext(); ) { ShadowRepository shadow = i.next(); if ( repository.getId().equals( shadow.getMasterRepository().getId() ) ) { throw new ConfigurationException( "The repository with ID " + id + " is not deletable, it has dependant repositories!" ); } } List<CPathMappingItem> pathMappings = getConfigurationModel().getRepositoryGrouping().getPathMappings(); for ( Iterator<CPathMappingItem> i = pathMappings.iterator(); i.hasNext(); ) { CPathMappingItem item = i.next(); item.removeRepository( id ); } repositoryRegistry.removeRepository( id ); List<CRepository> reposes = getConfigurationModel().getRepositories(); for ( Iterator<CRepository> i = reposes.iterator(); i.hasNext(); ) { CRepository repo = i.next(); if ( repo.getId().equals( id ) ) { i.remove(); releaseRepository( repository, getConfigurationModel(), repo ); saveConfiguration(); <START> <END> return; } } throw new NoSuchRepositoryException( id ); }</code><technical_language>save configuration repository disposing of repository</technical_language>

Target:
public synchronized void deleteRepository( String id ) throws NoSuchRepositoryException, IOException, ConfigurationException { Repository repository = repositoryRegistry.getRepository( id ); repository.setLocalStatus( LocalStatus.OUT_OF_SERVICE ); repository.setIndexable( false ); repository.setSearchable( false ); List<ShadowRepository> shadows = repositoryRegistry.getRepositoriesWithFacet( ShadowRepository.class ); for ( Iterator<ShadowRepository> i = shadows.iterator(); i.hasNext(); ) { ShadowRepository shadow = i.next(); if ( repository.getId().equals( shadow.getMasterRepository().getId() ) ) { throw new ConfigurationException( "The repository with ID " + id + " is not deletable, it has dependant repositories!" ); } } List<CPathMappingItem> pathMappings = getConfigurationModel().getRepositoryGrouping().getPathMappings(); for ( Iterator<CPathMappingItem> i = pathMappings.iterator(); i.hasNext(); ) { CPathMappingItem item = i.next(); item.removeRepository( id ); } repositoryRegistry.removeRepository( id ); List<CRepository> reposes = getConfigurationModel().getRepositories(); for ( Iterator<CRepository> i = reposes.iterator(); i.hasNext(); ) { CRepository repo = i.next(); if ( repo.getId().equals( id ) ) { i.remove(); saveConfiguration(); releaseRepository( repository, getConfigurationModel(), repo ); return; } } throw new NoSuchRepositoryException( id ); }
Source:
<code>public List<Integer> process(String expression) throws FilterExpressionException { if (expression.isEmpty()) { throw new FilterExpressionException(FilterExpressionException.EMPTY_EXPRESSION_MSG); } if (!expression.contains("$")) { throw new FilterExpressionException(FilterExpressionException.DEFAULT_MSG); } <START> List<String> colSpecifiers = findColumnSpecifiers(expression); <END> StaticVariableSet<Double> variables = new StaticVariableSet<>(); List<Double> evaluatedExpression = new ArrayList<>(); for (int i=0; i<this.starJTable.getStarTable().getRowCount(); i++) { int colNumber; for (String colName : colSpecifiers) { try { colNumber = Integer.parseInt(colName); } catch (NumberFormatException ex) { throw new FilterExpressionException(FilterExpressionException.NON_NUMERIC_COLUMN_NAME_MSG); } try { if (!this.starJTable.getStarTable().getColumnInfo(colNumber).getContentClass().isAssignableFrom(String.class)) { variables.set("$"+String.valueOf(colNumber), (Double) this.starJTable.getStarTable().getCell(i, colNumber)); } else { throw new FilterExpressionException("Only numeric columns may be filtered at this time."); } } catch (NoSuchElementException ex) { throw new FilterExpressionException("Bad expression: " + "Specified column $"+colNumber+" does not exist."); } catch (IOException ex) { Logger.getLogger(FilterDoubleExpressionValidator.class.getName()). log(Level.SEVERE, null, ex); } } try { evaluatedExpression.add(doubleEvaluator.evaluate(expression, variables)); } catch (IllegalArgumentException ex) { throw new FilterExpressionException(FilterExpressionException.BAD_PARENTHESES_MSG); } } return getFilteredIndices(evaluatedExpression); }</code><technical_language>I this function return array of column indexes - specifiers. add more support do there, line 86/ another for loop</technical_language>

Target:
public List<Integer> process(String expression) throws IllegalArgumentException { if (expression.isEmpty()) { throw new IllegalArgumentException(FilterExpressionException.EMPTY_EXPRESSION_MSG); } if (!expression.contains("$")) { throw new IllegalArgumentException(FilterExpressionException.DEFAULT_MSG); } ColumnMapper mapper = new ColumnMapper(starTable, expression); List<Double> evaluatedExpression = new ArrayList<>(); for (int i=0; i<this.starTable.getRowCount(); i++) { try { evaluatedExpression.add(mapper.evaluateRow(starTable.getRow(i))); } catch (IOException ex) { Logger.getLogger(FilterDoubleExpressionValidator.class.getName()).log(Level.SEVERE, null, ex); } } return getFilteredIndices(evaluatedExpression); }
Source:
<code>protected void executeCommand() { VDSReturnValue vdsReturnaValue = runVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); if (!vdsReturnaValue.getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError() .getMessage()); setSucceeded(false); return; } GlusterVolumeTaskStatusEntity rebalanceStatusEntity = (GlusterVolumeTaskStatusEntity) vdsReturnaValue.getReturnValue(); JobExecutionStatus stepStatus = rebalanceStatusEntity.getStatusSummary().getStatus(); if (stepStatus != null) { endStepJob(stepStatus, getStepMessageMap(stepStatus, GlusterTaskUtils.getInstance().getSummaryMessage(rebalanceStatusEntity.getStatusSummary())), GlusterTaskUtils.getInstance().isTaskSuccess(stepStatus)); } else { <START> endStepJob(JobExecutionStatus.ABORTED, getStepMessageMap(JobExecutionStatus.ABORTED, " "), false); <END> } releaseVolumeLock(); setSucceeded(vdsReturnaValue.getSucceeded()); getReturnValue().setActionReturnValue(rebalanceStatusEntity); }</code><technical_language>change this null well</technical_language>

Target:
protected void executeCommand() { VDSReturnValue vdsReturnaValue = runVdsCommand(VDSCommandType.StopRebalanceGlusterVolume, new GlusterVolumeVDSParameters(upServer.getId(), getGlusterVolumeName())); if (!vdsReturnaValue.getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED, vdsReturnaValue.getVdsError() .getMessage()); setSucceeded(false); return; } GlusterVolumeTaskStatusEntity rebalanceStatusEntity = (GlusterVolumeTaskStatusEntity) vdsReturnaValue.getReturnValue(); JobExecutionStatus stepStatus = rebalanceStatusEntity.getStatusSummary().getStatus(); if (stepStatus != null) { endStepJob(stepStatus, getStepMessageMap(stepStatus, GlusterTaskUtils.getInstance().getSummaryMessage(rebalanceStatusEntity.getStatusSummary())), GlusterTaskUtils.getInstance().isTaskSuccess(stepStatus)); } else { endStepJob(JobExecutionStatus.ABORTED, getStepMessageMap(JobExecutionStatus.ABORTED, null), false); } releaseVolumeLock(); setSucceeded(vdsReturnaValue.getSucceeded()); getReturnValue().setActionReturnValue(rebalanceStatusEntity); }
Source:
<code>public Text getQuestionDescription() { return questionDescription == null ? null <START> : new Text(Sanitizer.sanitizeForRichText(questionDescription.getValue())); <END> }</code><technical_language>If description is sanitized constructor, I this is needed anymore. a simple return questionDescription do</technical_language>

Target:
public Text getQuestionDescription() { return questionDescription; }