auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private List<Class<? extends Annotation>> findGinjectorAnnotations() throws UnableToCompleteException { List<Class<? extends Annotation>> annotations = new ArrayList<Class<? extends Annotation>>(); List<String> values = findConfigurationProperty(GIN_GINJECTOR_ANNOTATION).getValues(); if (values.size() > 0) { for (String value : values) { String annotationClassName = value.trim(); if (!annotationClassName.isEmpty()) { try { annotations.add(Class.forName(annotationClassName).asSubclass(Annotation.class)); } catch (ClassNotFoundException e) { getTreeLogger().log(TreeLogger.ERROR, "Cannot find the class '" + annotationClassName + "' used in '" + GIN_GINJECTOR_ANNOTATION + "' property."); throw new UnableToCompleteException(); } catch (ClassCastException e) { getTreeLogger().log(TreeLogger.ERROR, "Class '" + annotationClassName + "' used in '" + GIN_GINJECTOR_ANNOTATION + "' property is not an Annotation."); throw new UnableToCompleteException(); } } } } return annotations; }

Target:
private List<Class<? extends Annotation>> findGinjectorAnnotations() throws UnableToCompleteException { List<Class<? extends Annotation>> annotations = new ArrayList<Class<? extends Annotation>>(); List<String> values = findConfigurationProperty(GIN_GINJECTOR_ANNOTATION).getValues(); for (String value : values) { String annotationClassName = value.trim(); if (!annotationClassName.isEmpty()) { try { annotations.add(Class.forName(annotationClassName).asSubclass(Annotation.class)); } catch (ClassNotFoundException e) { getTreeLogger().log(TreeLogger.ERROR, "Cannot find the class '" + annotationClassName + "' used in '" + GIN_GINJECTOR_ANNOTATION + "' property."); throw new UnableToCompleteException(); } catch (ClassCastException e) { getTreeLogger().log(TreeLogger.ERROR, "Class '" + annotationClassName + "' used in '" + GIN_GINJECTOR_ANNOTATION + "' property is not an Annotation."); throw new UnableToCompleteException(); } } } return annotations; }
Source:
public void createZonedDate() { String inputTimeString; TimeZone.setDefault(parameterSet.defaultTimeZone); if (parameterSet.inputTimeString == null) { final Calendar calendar = Calendar.getInstance(parameterSet.inputTimeZone); 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()); }

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:
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) { subscriber.onError(e); } }

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:
public void updateAllInTransaction(Map<Guid, VmStatistics> vmStatisticsToSave) { 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; } }); }

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:
public String getExpiresAtLabel() { return "Expires at"; }

Target:
public String getExpiresAtLabel() { return translationService.getValue(StunnerBPMNConstants.NOTIFICATION_EXPIRESAT); }
Source:
public void deactivate() { super.deactivate(); logger.debug("DD-WRT binding has been started."); }

Target:
public void deactivate() { super.deactivate(); logger.debug("DD-WRT binding has been stopped."); }
Source:
public void sleep(int retryCount) throws InterruptedException { long sleepMs = (long) (baseSleepTimeMs * Math.pow(2, retryCount)); if(sleepMs > MAX_DELAY){ sleepMs = MAX_DELAY; } TimeUnit.MILLISECONDS.sleep(sleepMs); }

Target:
public void sleep(int retryCount) throws InterruptedException { long sleepMs = (long) (baseSleepTimeMs * Math.pow(2, retryCount)); TimeUnit.MILLISECONDS.sleep(sleepMs); }
Source:
private SmooshedWriter delegateSmooshedWriter(final String name, final long size) throws IOException { final File tmpFile = new File(baseDir, name); filesInProcess.add(tmpFile); return new SmooshedWriter() { private final FileOutputStream out = new FileOutputStream(tmpFile); private final GatheringByteChannel channel = out.getChannel(); private final Closer closer = Closer.create(); ; private int currOffset = 0; { closer.register(out); closer.register(channel); } @Override public void close() throws IOException { closer.close(); completedFiles.add(tmpFile); filesInProcess.remove(tmpFile); if (!writerCurrentlyInUse) { mergeWithSmoosher(); } } public int bytesLeft() { return (int) (size - currOffset); } @Override public int write(ByteBuffer buffer) throws IOException { return addToOffset(channel.write(buffer)); } @Override public int write(InputStream in) throws IOException { return addToOffset(ByteStreams.copy(Channels.newChannel(in), channel)); } @Override public long write(ByteBuffer[] srcs, int offset, int length) throws IOException { return addToOffset(channel.write(srcs, offset, length)); } @Override public long write(ByteBuffer[] srcs) throws IOException { return addToOffset(channel.write(srcs)); } public int addToOffset(long numBytesWritten) { if (numBytesWritten > bytesLeft()) { throw new ISE("Wrote more bytes[%,d] than available[%,d]. Don't do that.", numBytesWritten, bytesLeft()); } currOffset += numBytesWritten; return Ints.checkedCast(numBytesWritten); } @Override public boolean isOpen() { return channel.isOpen(); } }; }

Target:
private SmooshedWriter delegateSmooshedWriter(final String name, final long size) throws IOException { final File tmpFile = new File(baseDir, name); filesInProcess.add(tmpFile); return new SmooshedWriter() { private final FileOutputStream out = new FileOutputStream(tmpFile); private final GatheringByteChannel channel = out.getChannel(); private final Closer closer = Closer.create(); private int currOffset = 0; { closer.register(out); closer.register(channel); } @Override public void close() throws IOException { closer.close(); completedFiles.add(tmpFile); filesInProcess.remove(tmpFile); if (!writerCurrentlyInUse) { mergeWithSmoosher(); } } public int bytesLeft() { return (int) (size - currOffset); } @Override public int write(ByteBuffer buffer) throws IOException { return addToOffset(channel.write(buffer)); } @Override public int write(InputStream in) throws IOException { return addToOffset(ByteStreams.copy(Channels.newChannel(in), channel)); } @Override public long write(ByteBuffer[] srcs, int offset, int length) throws IOException { return addToOffset(channel.write(srcs, offset, length)); } @Override public long write(ByteBuffer[] srcs) throws IOException { return addToOffset(channel.write(srcs)); } public int addToOffset(long numBytesWritten) { if (numBytesWritten > bytesLeft()) { throw new ISE("Wrote more bytes[%,d] than available[%,d]. Don't do that.", numBytesWritten, bytesLeft()); } currOffset += numBytesWritten; return Ints.checkedCast(numBytesWritten); } @Override public boolean isOpen() { return channel.isOpen(); } }; }
Source:
public VoiceCallLeg viewCallLegByCallIdAndLegId(final String callId, String legId) throws UnsupportedEncodingException, NotFoundException, GeneralException, UnauthorizedException { String url = 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>()); } }

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:
public void testTimeLine() { String lines = "pulse"; resetTimeRange(); 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); }

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:
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()); } }

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:
public ByteChannel wrapChannel(SocketChannel channel, SelectionKey key) throws IOException { SSLEngine e = sslcontext.createSSLEngine(); e.setUseClientMode(false); if (sslParameters != null) { e.setSSLParameters(sslParameters); } return new SSLSocketChannel2(channel, e, exec, key); }

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:
public void doImport(VM vm) { if (!Config.<Boolean>getValue( ConfigValues.AutoImportHostedEngine, vdsGroupDAO.get(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); } } }

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:
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, 1); 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!"); } }

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:
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); monitorLocks(); lock.input(LockEvent.LEASE_REVOKED); }

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:
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 { LOG.warn("Job lost a resource but no such resource was tracked.", jobId, resourceProfile); } }

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:
public String getName() { return "StrategyResolve"; }

Target:
public String getName() { return "resolve"; }
Source:
public ThreadPoolTaskScheduler threadPoolTaskScheduler() { ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler(); threadPoolTaskScheduler.setPoolSize(1); threadPoolTaskScheduler.setThreadNamePrefix("ThreadPoolTaskScheduler"); return threadPoolTaskScheduler; }

Target:
public ThreadPoolTaskScheduler threadPoolTaskScheduler() { ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler(); threadPoolTaskScheduler.setPoolSize(1); threadPoolTaskScheduler.setThreadNamePrefix("ExchangeThreadPoolTaskScheduler"); return threadPoolTaskScheduler; }
Source:
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 (segments.size() < 4 || !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); }

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:
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); when(clientSupplier.get()).thenThrow(new IllegalStateException("bad")); 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); }

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:
public int generateDataAccessor(final long classid, final String classname, final int probecount, final MethodVisitor mv) { mv.visitFieldInsn(Opcodes.GETSTATIC, className, FIELD_NAME, FIELD_TYPE); RuntimeData.generateAccessCall(classid, classname, probecount, mv); return 6; }

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:
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(objectProperty.getAnnotation("javax.annotation.Generated") == null); 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); }

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:
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"); press(KeyCode.ESCAPE); assertEquals(0, panelControl.getNumberOfSavedBoards()); assertEquals(1, panelControl.getPanelCount()); }

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:
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); } }

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:
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", "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")); }

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:
public String toString() { return "KinesisSupervisorSpec{" + "dataSchema=" + getDataSchema() + ", tuningConfig=" + getTuningConfig() + ", ioConfig=" + getIoConfig() + ", suspended=" + isSuspended() + '}'; }

Target:
public String toString() { return "KinesisSupervisorSpec{" + "dataSchema=" + getDataSchema() + ", tuningConfig=" + getTuningConfig() + ", ioConfig=" + getIoConfig() + ", suspended=" + isSuspended() + ", context=" + getContext() + '}'; }
Source:
public DecimalSubtractExpression(List<Expression> children) { super(children); maxLengths = new Integer[children.size()]; 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()); } } }

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:
public static synchronized void install() { new Exception("Http2Agent.install() no longer does anything, please remove all invocations from your codebase") .printStackTrace(); }

Target:
public static void install() { }
Source:
public List<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); List<String> keys = new ArrayList<String>(); keys.add(user.getApiKey()); keys.add(user.getSecretKey()); return keys; }

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:
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"))); } catch(JSONException e) { throw new RuntimeException(e); } } @Override public void onError(JSONObject error) { listener.onError(error); } }); } else { this.kuzzle.query(buildQueryArgs("updateRole"), data, options); } }

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:
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(); return; } } throw new NoSuchRepositoryException( id ); }

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:
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); } List<String> colSpecifiers = findColumnSpecifiers(expression); 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); }

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:
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, " "), false); } releaseVolumeLock(); setSucceeded(vdsReturnaValue.getSucceeded()); getReturnValue().setActionReturnValue(rebalanceStatusEntity); }

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:
public Text getQuestionDescription() { return questionDescription == null ? null : new Text(Sanitizer.sanitizeForRichText(questionDescription.getValue())); }

Target:
public Text getQuestionDescription() { return questionDescription; }
Source:
private void buildTopicTree(TopicNode topicNode, String[] paths) throws EventBrokerException { String[] children = paths; if (children != null) { List<TopicNode> nodes = new ArrayList<TopicNode>(); for (String childTopic : children) { if (childTopic.endsWith("/")) { childTopic = childTopic.substring(0, childTopic.length() - 2); } String nodeName = childTopic.substring(childTopic.lastIndexOf("/") + 1); if (!nodeName.equals(EventBrokerConstants.EB_CONF_WS_SUBSCRIPTION_COLLECTION_NAME) && !nodeName.equals(EventBrokerConstants.EB_CONF_JMS_SUBSCRIPTION_COLLECTION_NAME)) { childTopic = childTopic.substring(childTopic.indexOf(this.topicStoragePath) + this.topicStoragePath.length() + 1); TopicNode childNode = new TopicNode(nodeName, childTopic); childNode.setLeafNode(false); nodes.add(childNode); } } topicNode.setChildren(nodes.toArray(new TopicNode[nodes.size()])); } }

Target:
private void buildTopicTree(TopicNode topicNode, String[] paths) throws EventBrokerException { String[] children = paths; if (children != null) { List<TopicNode> nodes = new ArrayList<TopicNode>(); for (String childTopic : children) { if (childTopic.endsWith(RegistryConstants.ROOT_PATH)) { childTopic = childTopic.substring(0, childTopic.length() - 2); } String nodeName = childTopic.substring(childTopic.lastIndexOf(RegistryConstants.ROOT_PATH) + 1); if (!nodeName.equals(EventBrokerConstants.EB_CONF_WS_SUBSCRIPTION_COLLECTION_NAME) && !nodeName.equals(EventBrokerConstants.EB_CONF_JMS_SUBSCRIPTION_COLLECTION_NAME)) { childTopic = childTopic.substring(childTopic.indexOf(this.topicStoragePath) + this.topicStoragePath.length() + 1); TopicNode childNode = new TopicNode(nodeName, childTopic); childNode.setLeafNode(false); nodes.add(childNode); } } topicNode.setChildren(nodes.toArray(new TopicNode[nodes.size()])); } }
Source:
public void create() throws IOException { assert indexMap.isEmpty(); }

Target:
public void create() throws IOException { if ( !indexMap.isEmpty() ) { throw new IOException( "Trying to create a new spatial populator when the index had already been created." ); } }