auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void toggleWatchingState() { WatchingService service = ServiceFactory.get(WatchingService.class, false); final String repoOwner = mRepository.owner().login(), repoName = mRepository.name(); final Single<?> responseSingle; if (mIsWatching) { responseSingle = service.deleteRepositorySubscription(repoOwner, repoName) .map(ApiHelpers::throwOnFailure); } else { SubscriptionRequest request = SubscriptionRequest.builder() .subscribed(true) .build(); responseSingle = service.setRepositorySubscription(repoOwner, repoName, request) .map(ApiHelpers::throwOnFailure); } responseSingle.compose(RxUtils::doInBackground) .subscribe(result -> { if (mIsWatching != null) { mIsWatching = !mIsWatching; mRepository = mRepository.toBuilder() .watchersCount(mRepository.watchersCount() + (mIsWatching ? 1 : -1)) .build(); updateStargazerUi(); } }, error -> { handleActionFailure("Updating repo watching state failed", error); updateStargazerUi(); }); }

Target:
private void toggleWatchingState() { WatchingService service = ServiceFactory.get(WatchingService.class, false); final String repoOwner = mRepository.owner().login(), repoName = mRepository.name(); final Single<?> responseSingle; if (mIsWatching) { responseSingle = service.deleteRepositorySubscription(repoOwner, repoName) .map(ApiHelpers::throwOnFailure); } else { SubscriptionRequest request = SubscriptionRequest.builder() .subscribed(true) .build(); responseSingle = service.setRepositorySubscription(repoOwner, repoName, request) .map(ApiHelpers::throwOnFailure); } responseSingle.compose(RxUtils::doInBackground) .subscribe(result -> { if (mIsWatching != null) { mIsWatching = !mIsWatching; mRepository = mRepository.toBuilder() .subscribersCount(mRepository.subscribersCount() + (mIsWatching ? 1 : -1)) .build(); updateWatcherUi(); } }, error -> { handleActionFailure("Updating repo watching state failed", error); updateWatcherUi(); }); }
Source:
public Map<Cell, byte[]> get(TableReference tableRef, Set<Cell> cells) { try { return get( tableRef, cells, ((tableReference, toRead) -> Futures.immediateFuture(super.get(tableReference, toRead)))).get(); } catch (InterruptedException | ExecutionException e) { throw Throwables.rewrapAndThrowUncheckedException(e.getCause()); } }

Target:
public Map<Cell, byte[]> get(TableReference tableRef, Set<Cell> cells) { try { return get( tableRef, cells, (tableReference, toRead) -> Futures.immediateFuture(super.get(tableReference, toRead))).get(); } catch (InterruptedException | ExecutionException e) { throw Throwables.rewrapAndThrowUncheckedException(e.getCause()); } }
Source:
private void sendEmail(JobExecutionContext jobContext, List<List<String>> csvRows, List<CertificationBodyDTO> acbs) throws MessagingException { LOGGER.info("Sending email to with contents and a total of pending change requests", getEmailRecipients(jobContext).get(0), getHtmlMessage(csvRows.size()), csvRows.size()); EmailBuilder emailBuilder = new EmailBuilder(env); emailBuilder.recipients(getEmailRecipients(jobContext)) .subject(getSubject(jobContext)) .htmlMessage(getHtmlMessage(csvRows.size()) + getAcbNamesAsCommaSeparatedList(jobContext)) .fileAttachments(getAttachments(csvRows, acbs)) .sendEmail(); }

Target:
private void sendEmail(JobExecutionContext jobContext, List<List<String>> csvRows, List<CertificationBodyDTO> acbs) throws MessagingException { LOGGER.info("Sending email to with contents and a total of pending change requests", getEmailRecipients(jobContext).get(0), getHtmlMessage(csvRows.size(), getAcbNamesAsCommaSeparatedList(jobContext))); EmailBuilder emailBuilder = new EmailBuilder(env); emailBuilder.recipients(getEmailRecipients(jobContext)) .subject(getSubject(jobContext)) .htmlMessage(getHtmlMessage(csvRows.size(), getAcbNamesAsCommaSeparatedList(jobContext))) .fileAttachments(getAttachments(csvRows, acbs)) .sendEmail(); }
Source:
public void handle(StateContext state, SubCollectionReadCollectionContext ctx) { String subCollection = ctx.term().getText(); EntityDictionary dictionary = state.getRequestScope().getDictionary(); try { RelationshipType type = dictionary.getRelationshipType(resource.getObject(), subCollection); if (type == RelationshipType.NONE) { throw new ForbiddenAccessException(subCollection); } String entityName = dictionary.getJsonAliasFor(dictionary.getParameterizedType(resource.getObject(), subCollection)); Class<?> entityClass = dictionary.getEntityClass(entityName); if (entityClass == null) { throw new IllegalArgumentException("Unknown type " + entityName); } final BaseState nextState; final CollectionTerminalState collectionTerminalState = new CollectionTerminalState(entityClass, Optional.of(resource), Optional.of(subCollection)); Set<PersistentResource> collection = null; if (type.isToOne()) { Optional<FilterExpression> filterExpression = state.getRequestScope().getExpressionForRelation(resource, subCollection); collection = resource.getRelationCheckedFiltered(subCollection, filterExpression, Optional.empty(), Optional.empty()); } if (collection instanceof SingleElementSet) { PersistentResource record = ((SingleElementSet<PersistentResource>) collection).getValue(); nextState = new RecordTerminalState(record, collectionTerminalState); } else { nextState = collectionTerminalState; } state.setState(nextState); } catch (InvalidAttributeException e) { throw new InvalidCollectionException(subCollection); } }

Target:
public void handle(StateContext state, SubCollectionReadCollectionContext ctx) { String subCollection = ctx.term().getText(); EntityDictionary dictionary = state.getRequestScope().getDictionary(); try { RelationshipType type = dictionary.getRelationshipType(resource.getObject(), subCollection); if (type == RelationshipType.NONE) { throw new ForbiddenAccessException(subCollection); } String entityName = dictionary.getJsonAliasFor(dictionary.getParameterizedType(resource.getObject(), subCollection)); Class<?> entityClass = dictionary.getEntityClass(entityName); if (entityClass == null) { throw new IllegalArgumentException("Unknown type " + entityName); } final BaseState nextState; final CollectionTerminalState collectionTerminalState = new CollectionTerminalState(entityClass, Optional.of(resource), Optional.of(subCollection)); Set<PersistentResource> collection = null; if (type.isToOne()) { Optional<FilterExpression> filterExpression = state.getRequestScope().getExpressionForRelation(resource, subCollection); collection = resource.getRelationCheckedFiltered(subCollection, filterExpression, Optional.empty(), Optional.empty()); } if (collection instanceof SingleElementSet) { PersistentResource record = ((SingleElementSet<PersistentResource>) collection).getValue(); nextState = new RecordTerminalState(record, collectionTerminalState); } else { nextState = collectionTerminalState; } state.setState(nextState); } catch (InvalidAttributeException e) { throw new ForbiddenAccessException(subCollection); } }
Source:
public void onReceivedError (WebView view, int errorCode, String description, String failingUrl) { Log_OC.e(TAG, "onReceivedError : " + failingUrl + ", code " + errorCode + ", description: " + description); if (!failingUrl.equals(mLastReloadedUrlAtError)) { view.reload(); mLastReloadedUrlAtError = failingUrl; } else { mLastReloadedUrlAtError = null; } }

Target:
public void onReceivedError (WebView view, int errorCode, String description, String failingUrl) { Log_OC.e(TAG, "onReceivedError : " + failingUrl + ", code " + errorCode + ", description: " + description); if (!failingUrl.equals(mLastReloadedUrlAtError)) { view.reload(); mLastReloadedUrlAtError = failingUrl; } else { mLastReloadedUrlAtError = null; super.onReceivedError(view, errorCode, description, failingUrl); } }
Source:
private final void configureConstructorInjection() { Constructor<?>[] constructors = msgHandler.getDeclaredConstructors(); for (Constructor<?> constructor : constructors) { if (constructor.isAnnotationPresent(Inject.class)) { this.constructor = constructor; this.constructorAnnotations = this.constructor.getParameterAnnotations(); break; } } }

Target:
private final void configureConstructorInjection() { Constructor<?>[] constructors = msgHandler.getDeclaredConstructors(); List<Constructor> injectableConstructors = Arrays.stream(constructors).filter(constructor -> constructor.isAnnotationPresent(Inject.class)).collect(Collectors.toList()); if (injectableConstructors.size() > 0) { this.constructor = injectableConstructors.get(0); this.constructorAnnotations = this.constructor.getParameterAnnotations(); if (injectableConstructors.size() > 1) { log.error("Multiple constructors annotated with Inject. Using first injectable constructor found"); } } }
Source:
private void destroyServerStore(DestroyServerStore destroyServerStore) throws ClusterException { if (!ehcacheStateService.isConfigured()) { throw new LifecycleException("Clustered Tier Manager is not configured"); } trackAndApplyMessage(destroyServerStore); String name = destroyServerStore.getName(); ServerStoreImpl store = ehcacheStateService.getStore(name); if (store != null) { TreeNode node = StatisticsManager.nodeFor(store.getPageSource()); if(node != null) { node.clean(); } } LOGGER.info("Destroying clustered tier '{}'", name); ehcacheStateService.destroyServerStore(name); }

Target:
private void destroyServerStore(DestroyServerStore destroyServerStore) throws ClusterException { if (!ehcacheStateService.isConfigured()) { throw new LifecycleException("Clustered Tier Manager is not configured"); } trackAndApplyMessage(destroyServerStore); String name = destroyServerStore.getName(); LOGGER.info("Destroying clustered tier '{}'", name); management.serverStoreDestroyed(name); ehcacheStateService.destroyServerStore(name); ehcacheStateService.removeInvalidationtracker(name); }
Source:
protected void buttonPressed(int buttonId) { switch (buttonId) { case IDialogConstants.DETAILS_ID: if (showDetails) { detailsComposite.dispose(); detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { detailsComposite = createDetailsComposite(); detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); } getContents().getShell().pack(); showDetails = !showDetails; break; case IDialogConstants.OK_ID: commit = commitCombo.getValue(); message = messageText.getText(); overwriteTag = overwriteButton.getSelection(); default: super.buttonPressed(buttonId); } }

Target:
protected void buttonPressed(int buttonId) { switch (buttonId) { case IDialogConstants.OK_ID: commit = commitCombo.getValue(); message = messageText.getText(); overwriteTag = overwriteButton.getSelection(); default: super.buttonPressed(buttonId); } }
Source:
public void testDoesItSmoke() throws Exception { WaitForAsyncUtils.asyncFx(() -> { Stopwatch stopwatch = Stopwatch.createStarted(); try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) { context.getBeanFactory().registerSingleton("hostService", mock(PlatformService.class)); context.getBeanFactory().registerSingleton("stage", new Stage()); context.getBeanFactory().registerSingleton("uidService", mock(UidService.class)); context.register(ForgedAlliancePrefs.class); context.register(FafClientApplication.class); context.refresh(); logger.debug("Loading application context took {}", stopwatch.stop()); } }); WaitForAsyncUtils.waitForFxEvents(); }

Target:
public void testDoesItSmoke() throws Exception { WaitForAsyncUtils.asyncFx(() -> { Stopwatch stopwatch = Stopwatch.createStarted(); try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext()) { context.getBeanFactory().registerSingleton("hostService", mock(PlatformService.class)); context.getBeanFactory().registerSingleton("stage", new Stage()); context.getBeanFactory().registerSingleton("uidService", mock(UidService.class)); context.register(FafClientApplication.class); context.refresh(); logger.debug("Loading application context took {}", stopwatch.stop()); } }); WaitForAsyncUtils.waitForFxEvents(); }
Source:
public void addPotentialOwners(String containerId, Number taskId, boolean removeExisting, String payload, String marshallingType) { logger.debug("About to unmarshall payload '{}' to map of task inputs", payload); if (context.getContainer(containerId) == null) throw new DeploymentNotFoundException("Could not find container with ID: " + containerId); OrganizationalEntity[] entities = convert(containerId, taskId, payload, marshallingType); userTaskAdminService.addPotentialOwners(taskId.longValue(), removeExisting, entities); logger.debug("Potential owners added to task {}", entities, taskId); }

Target:
public void addPotentialOwners(String containerId, Number taskId, boolean removeExisting, String payload, String marshallingType) { logger.debug("About to unmarshall payload '{}' to map of task inputs", payload); verifyContainerId(containerId); OrganizationalEntity[] entities = convert(containerId, taskId, payload, marshallingType); userTaskAdminService.addPotentialOwners(taskId.longValue(), removeExisting, entities); logger.debug("Potential owners added to task {}", entities, taskId); }
Source:
public String getMainTypeName() { return getProject().get(MAIN_CLASS, EMBEDDED_LAUNCHER); }

Target:
public String getMainTypeName() { Instructions instructions = new Instructions(getProject().getProperty(Constants.REMOVEHEADERS)); if (!instructions.isEmpty() && instructions.matches(MAIN_CLASS)) { return EMBEDDED_LAUNCHER; } return getProject().getProperty(MAIN_CLASS, EMBEDDED_LAUNCHER); }
Source:
public static DuplicateRequestException create(String sessionId, long requestSeq) { return new DuplicateRequestException("request of session '{}' was already sent, this is duplicate or retry submission; check if some proxy or agents have retry-post enabled.", requestSeq, sessionId); }

Target:
public static DuplicateRequestException create(String sessionId, long requestSeq) { return new DuplicateRequestException("request of session '{}' was already sent, this is a duplicate or retry submission; check if some proxy or agents have retry-post enabled.", requestSeq, sessionId); }
Source:
public static void register(Optional<MeterRegistry> metricsRegistry) { if (metricsRegistry.isPresent()) { SafePointStats safePointStats = new SafePointStats(); Gauge.builder("jvm.safe_point_time", safePointStats, data -> { long current = getRuntimeMBean().getTotalSafepointTime(); long delta = current - data.safepointTime; data.safepointTime = current; return delta; }).register(metricsRegistry.get()); Gauge.builder("jvm.safe_point_count", safePointStats, data -> { long current = getRuntimeMBean().getSafepointCount(); long delta = current - data.safepointCount; data.safepointCount = current; return delta; }).register(metricsRegistry.get()); } }

Target:
public static void register(Optional<MeterRegistry> metricsRegistry) { if (metricsRegistry.isPresent()) { SafePointStats safePointStats = new SafePointStats(); Gauge.builder("jvm.safe_point_time", safePointStats, data -> { long current = getRuntimeMBean().getTotalSafepointTime(); long delta = current - data.safepointTime; data.safepointTime = current; return delta; }).strongReference(true).register(metricsRegistry.get()); Gauge.builder("jvm.safe_point_count", safePointStats, data -> { long current = getRuntimeMBean().getSafepointCount(); long delta = current - data.safepointCount; data.safepointCount = current; return delta; }).strongReference(true).register(metricsRegistry.get()); } }
Source:
public Properties getConfiguration(int tenantId) throws IdentityMgtException{ Properties properties = new Properties(); Map<String, String> configMap = null; try { configMap = identityMgtService.getConfiguration(tenantId); } catch (IdentityMgtException ex) { String msg = "Error when retrieving configurations"; log.error(msg); throw new IdentityMgtException(msg,ex); } Iterator<Map.Entry<String, String>> iterator = configMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, String> pair = iterator.next(); properties.setProperty(pair.getKey(), pair.getValue()); System.out.println(pair.getKey() + " = " + pair.getValue()); } return properties; }

Target:
public Properties getConfiguration(int tenantId) throws IdentityMgtException{ Properties properties = new Properties(); Map<String, String> configMap = null; try { configMap = identityMgtService.getConfiguration(tenantId); } catch (IdentityMgtException ex) { throw new IdentityMgtException("Error when retrieving configurations", ex); } Iterator<Map.Entry<String, String>> iterator = configMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, String> pair = iterator.next(); properties.setProperty(pair.getKey(), pair.getValue()); } return properties; }
Source:
private String makeRelative ( final File base, final File file ) { final String result = base.toURI ().relativize ( file.toURI () ).getPath (); this.log.info ( String.format ( "Make relative - base: %s, file: %s -> %s", base, file, result ) ); return result; }

Target:
private String makeRelative(final File base, final File file) throws IOException { final String result = base.getCanonicalFile().toURI().relativize(file.getCanonicalFile().toURI()).getPath(); this.log.info(String.format("Make relative - base: %s, file: %s -> %s", base, file, result)); return result; }
Source:
public static void refreshResources(IResource[] resources, IProgressMonitor monitor) throws CoreException { try { SubMonitor progress = SubMonitor.convert(monitor, CoreText.ProjectUtil_refreshing, resources.length); for (IResource resource : resources) { if (progress.isCanceled()) break; resource.refreshLocal(IResource.DEPTH_INFINITE, progress.newChild(1)); progress.worked(1); } } finally { monitor.done(); } }

Target:
public static void refreshResources(IResource[] resources, IProgressMonitor monitor) throws CoreException { try { SubMonitor progress = SubMonitor.convert(monitor, CoreText.ProjectUtil_refreshing, resources.length); for (IResource resource : resources) { if (progress.isCanceled()) break; resource.refreshLocal(IResource.DEPTH_INFINITE, progress.newChild(1)); } } finally { monitor.done(); } }
Source:
private long getCleanupTimeSeconds() { try { String cleanupTimeString = System.getProperty(RMNodeStarter.SECONDS_TASK_CLEANUP_TIMEOUT_PROP_NAME); if (cleanupTimeString != null) { return Long.parseLong(cleanupTimeString); } else { return CLEANUP_TIME_DEFAULT_SECONDS; } } catch (NumberFormatException e) { LOGGER.warn("proactive.task.cleanup.time: " + System.getProperty("proactive.task.cleanup.time") + " is not parsable to long, fallback to default value. Error : " + e.getMessage()); return CLEANUP_TIME_DEFAULT_SECONDS; } }

Target:
private long getCleanupTimeSeconds() { try { String cleanupTimeString = System.getProperty(RMNodeStarter.SECONDS_TASK_CLEANUP_TIMEOUT_PROP_NAME); if (cleanupTimeString != null) { return Long.parseLong(cleanupTimeString); } else { return CLEANUP_TIME_DEFAULT_SECONDS; } } catch (NumberFormatException e) { LOGGER.warn("proactive.task.cleanup.time: " + System.getProperty(RMNodeStarter.SECONDS_TASK_CLEANUP_TIMEOUT_PROP_NAME) + " is not parsable to long, fallback to default value. Error : " + e.getMessage()); return CLEANUP_TIME_DEFAULT_SECONDS; } }
Source:
public void updateExternalExecutionId(long taskExecutionId, String externalExecutionId) { if (jdbcTemplate.queryForObject(getQuery(CHECK_TASK_EXECUTION_EXISTS), Integer.class, taskExecutionId) != 1) { throw new IllegalStateException("Invalid TaskExecution, ID " + taskExecutionId + " not found."); } Object[] parameters = new Object[]{ externalExecutionId, taskExecutionId}; jdbcTemplate.update( getQuery(UPDATE_TASK_EXECUTION_EXTERNAL_EXECUTION_ID), parameters, new int[]{ Types.VARCHAR, Types.BIGINT}); }

Target:
public void updateExternalExecutionId(long taskExecutionId, String externalExecutionId) { Object[] parameters = new Object[]{externalExecutionId, taskExecutionId}; if (jdbcTemplate.update( getQuery(UPDATE_TASK_EXECUTION_EXTERNAL_EXECUTION_ID), parameters, new int[]{Types.VARCHAR, Types.BIGINT}) != 1) { throw new IllegalStateException("Invalid TaskExecution, ID " + taskExecutionId + " not found."); } }
Source:
public void map(GenericData.Record record, AvroCollector<Pair<ByteBuffer, ByteBuffer>> collector, Reporter reporter) throws IOException { byte[] keyBytes = null, valBytes = null; Object keyRecord = null, valRecord = null; try { keyRecord = record.get(keyField); valRecord = record.get(valField); keyBytes = keySerializer.toBytes(keyRecord); valBytes = valueSerializer.toBytes(valRecord); this.collectorWrapper.setCollector(collector); this.mapper.map(keyBytes, valBytes, this.collectorWrapper); recordCounter++; } catch (OutOfMemoryError oom) { logger.error(oomErrorMessage(reporter)); if (keyBytes == null) { logger.error("keyRecord caused OOM!"); } else { logger.error("keyRecord: " + keyRecord); logger.error("valRecord: " + (valBytes == null ? "caused OOM" : valRecord)); } throw new VoldemortException(oomErrorMessage(reporter), oom); } }

Target:
public void map(GenericData.Record record, AvroCollector<Pair<ByteBuffer, ByteBuffer>> collector, Reporter reporter) throws IOException { byte[] keyBytes = null; byte[] valBytes = null; Object keyRecord = null; Object valRecord = null; try { keyRecord = record.get(keyField); valRecord = record.get(valField); keyBytes = keySerializer.toBytes(keyRecord); valBytes = valueSerializer.toBytes(valRecord); this.collectorWrapper.setCollector(collector); this.mapper.map(keyBytes, valBytes, this.collectorWrapper); recordCounter++; } catch (OutOfMemoryError oom) { logger.error(oomErrorMessage(reporter)); if (keyBytes == null) { logger.error("keyRecord caused OOM!"); } else { logger.error("keyRecord: " + keyRecord); logger.error("valRecord: " + (valBytes == null ? "caused OOM" : valRecord)); } throw new VoldemortException(oomErrorMessage(reporter), oom); } }
Source:
protected void initialize() { super.initialize(); getWindowPanel().add(getFooterStatusBar(), BorderLayout.SOUTH); getFooterStatusBar().add(getLabelTimeLapse()); getFooterStatusBar().addSeparator(); getFooterStatusBar().add(getLabelContentLength()); getFooterStatusBar().addSeparator(); getFooterStatusBar().add(getLabelTotalLength()); getWindowPanel() .addComponentListener( new ComponentAdapter() { @Override public void componentShown(ComponentEvent ce) { sender.updateOptions(); } }); }

Target:
protected void initialize() { super.initialize(); getWindowPanel().add(getFooterStatusBar(), BorderLayout.SOUTH); getFooterStatusBar().add(getLabelTimeLapse()); getFooterStatusBar().addSeparator(); getFooterStatusBar().add(getLabelContentLength()); getFooterStatusBar().addSeparator(); getFooterStatusBar().add(getLabelTotalLength()); }
Source:
public void onDataSetChanged() { if(null!=adapter) { adapter.notifyDataSetChanged(); } }

Target:
public void onDataSetChanged() { if (null != adapter) { adapter.notifyDataSetChanged(); if (null != lastVisibleItemID) { int itemPositionWithId = callback.findItemPositionWithId(lastVisibleItemID); rvContributionsList.scrollToPosition(itemPositionWithId); lastVisibleItemID = null; } } }
Source:
public ImmutableValue<Vector3i> exitPortal() { return new ImmutableSpongeValue<>(Keys.EXIT_PORTAL, Vector3i.ONE, this.exitPortal); }

Target:
public ImmutableValue<Vector3i> exitPortal() { return this.exitPortalValue; }
Source:
public void remove() { throw new UnsupportedOperationException("Not supported yet."); }

Target:
public void remove() { throw new UnsupportedOperationException("It won't be supported because it's not mandatory."); }
Source:
@Override public synchronized Boolean isLeader(String workerId) { if (executeConditionCheckWithReadLock(() -> CollectionUtils.isNullOrEmpty(leaders))) { electLeaders(); leaderElectionThreadPool.scheduleWithFixedDelay(this::electLeaders, ELECTION_INITIAL_DELAY_MILLIS, ELECTION_SCHEDULING_INTERVAL_MILLIS, TimeUnit.MILLISECONDS); } return executeConditionCheckWithReadLock(() -> isWorkerLeaderForShardSync(workerId)); }

Target:
public synchronized Boolean isLeader(String workerId) { if (executeConditionCheckWithReadLock(() -> CollectionUtils.isNullOrEmpty(leaders))) { electLeaders(); leaderElectionThreadPool.scheduleWithFixedDelay(this::electLeaders, ELECTION_INITIAL_DELAY_MILLIS, ELECTION_SCHEDULING_INTERVAL_MILLIS, TimeUnit.MILLISECONDS); } return executeConditionCheckWithReadLock(() -> isWorkerLeaderForShardSync(workerId)); }
Source:
public ClusterComposition lookupRoutingTable( ConnectionPool connections, RoutingTable routingTable ) throws InterruptedException, ServiceUnavailableException, ProtocolException { assertRouterIsNotEmpty( routingTable.routerSize() ); int failures = 0; for ( long start = clock.millis(), delay = 0; ; delay = Math.max( settings.retryTimeoutDelay, delay * 2 ) ) { long waitTime = start + delay - clock.millis(); if ( waitTime > 0 ) { clock.sleep( waitTime ); } start = clock.millis(); for ( int i = 0, size = routingTable.routerSize(); i < size; i++ ) { BoltServerAddress address = routingTable.nextRouter(); if ( address == null ) { throw new ServiceUnavailableException( NO_ROUTERS_AVAILABLE ); } GetClusterCompositionResponse response = null; try ( Connection connection = connections.acquire( address ) ) { response = provider.getClusterComposition( connection ); } catch ( Throwable e ) { logger.error( format( "Failed to connect to routing server '%s'.", address ), e ); routingTable.removeRouter( address ); assertRouterIsNotEmpty( routingTable.routerSize() ); continue; } ClusterComposition cluster = response.clusterComposition(); logger.info( "Got cluster composition %s", cluster ); if ( cluster.isValid() ) { return cluster; } } if ( ++failures >= settings.maxRoutingFailures ) { throw new ServiceUnavailableException( NO_ROUTERS_AVAILABLE ); } } }

Target:
public ClusterComposition lookupRoutingTable( ConnectionPool connections, RoutingTable routingTable ) throws InterruptedException { assertHasRouters( routingTable ); int failures = 0; for ( long start = clock.millis(), delay = 0; ; delay = Math.max( settings.retryTimeoutDelay, delay * 2 ) ) { long waitTime = start + delay - clock.millis(); if ( waitTime > 0 ) { clock.sleep( waitTime ); } start = clock.millis(); int size = routingTable.routerSize(); for ( int i = 0; i < size; i++ ) { BoltServerAddress address = routingTable.nextRouter(); if ( address == null ) { throw new ServiceUnavailableException( NO_ROUTERS_AVAILABLE ); } ClusterCompositionResponse response = null; try ( Connection connection = connections.acquire( address ) ) { response = provider.getClusterComposition( connection ); } catch ( Throwable e ) { logger.error( format( "Failed to connect to routing server '%s'.", address ), e ); routingTable.removeRouter( address ); assertHasRouters( routingTable ); continue; } ClusterComposition cluster = response.clusterComposition(); logger.info( "Got cluster composition %s", cluster ); if ( cluster.hasWriters() ) { return cluster; } } if ( ++failures >= settings.maxRoutingFailures ) { throw new ServiceUnavailableException( NO_ROUTERS_AVAILABLE ); } } }
Source:
private void onRemove() { cancel(); AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ArrayList<StoragePool> pools = (ArrayList<StoragePool>) returnValue; if (pools != null && pools.size() > 0) { pool = pools.get(0); getVmsFromExportDomain(pool.getId(), getEntity().getId()); } } }), getEntity().getId()); }

Target:
private void onRemove() { cancel(); AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ArrayList<StoragePool> pools = (ArrayList<StoragePool>) returnValue; if (pools != null && !pools.isEmpty()) { pool = pools.get(0); checkVmsDependentOnTemplate(pool.getId(), getEntity().getId()); } } }), getEntity().getId()); }
Source:
public V putIfAbsent(final K key, final V value) { V old = null; final Function<K, V> mappingFunction = memoize( new Function<K, V>() { @Override public V apply(final K k) { V loaded = null; try { if (cacheLoader != null) { loaded = cacheLoader.load(k); } } catch (RuntimeException e) { throw new CacheLoaderException(e); } if(loaded != null) { return loaded; } try { if (cacheWriter != null) { cacheWriter.write(k, value); } } catch (RuntimeException e) { throw new CacheWriterException(e); } return value; } }); try { final Store.ValueHolder<V> holder = store.computeIfAbsent(key, mappingFunction); if(holder != null) { old = holder.value(); } } catch (CacheAccessException e) { try { old = mappingFunction.apply(key); if(cacheLoader != null && cacheWriter != null) { store.remove(key); } else { final Store.ValueHolder<V> holder = store.get(key); if(holder == null) { resilienceStrategy.possiblyInconsistent(key, e); } else { return holder.value(); } } } catch (CacheAccessException e1) { resilienceStrategy.possiblyInconsistent(key, e, e1); } } return old; }

Target:
public V putIfAbsent(final K key, final V value) { checkNonNull(key, value); V old = null; final Function<K, V> mappingFunction = memoize( new Function<K, V>() { @Override public V apply(final K k) { V loaded = null; try { if (cacheLoader != null) { loaded = cacheLoader.load(k); } } catch (RuntimeException e) { throw new CacheLoaderException(e); } if(loaded != null) { return loaded; } try { if (cacheWriter != null) { cacheWriter.write(k, value); } } catch (RuntimeException e) { throw new CacheWriterException(e); } return value; } }); try { final Store.ValueHolder<V> holder = store.computeIfAbsent(key, mappingFunction); if(holder != null) { old = holder.value(); } } catch (CacheAccessException e) { try { old = mappingFunction.apply(key); if(cacheLoader != null && cacheWriter != null) { store.remove(key); } else { final Store.ValueHolder<V> holder = store.get(key); if(holder == null) { resilienceStrategy.possiblyInconsistent(key, e); } else { return holder.value(); } } } catch (CacheAccessException e1) { resilienceStrategy.possiblyInconsistent(key, e, e1); } } return old; }
Source:
public int hashCode() { int hash = 7; hash = 43 * hash + Objects.hashCode(this.id); return hash; }

Target:
public int hashCode() { return Objects.hash(id, foo, bar); }
Source:
void reportInternalBugsnagError(@NonNull Event event) { Map<String, Object> app = appData.getAppDataSummary(); app.put("duration", AppData.getDurationMs()); app.put("durationInForeground", appData.calculateDurationInForeground()); app.put("inForeground", sessionTracker.isInForeground()); event.setApp(app); Map<String, Object> device = deviceData.getDeviceDataSummary(); device.put("freeDisk", deviceData.calculateFreeDisk()); event.setDevice(device); Notifier notifier = Notifier.INSTANCE; event.addMetadata(INTERNAL_DIAGNOSTICS_TAB, "notifierName", notifier.getName()); event.addMetadata(INTERNAL_DIAGNOSTICS_TAB, "notifierVersion", notifier.getVersion()); event.addMetadata(INTERNAL_DIAGNOSTICS_TAB, "apiKey", immutableConfig.getApiKey()); Object packageName = appData.getAppData().get("packageName"); event.addMetadata(INTERNAL_DIAGNOSTICS_TAB, "packageName", packageName); final Report report = new Report(null, event); try { Async.run(new Runnable() { @Override public void run() { try { Delivery delivery = immutableConfig.getDelivery(); DeliveryParams params = immutableConfig.errorApiDeliveryParams(); if (delivery instanceof DefaultDelivery) { Map<String, String> headers = params.getHeaders(); headers.put("Bugsnag-Internal-Error", "true"); headers.remove(HEADER_API_KEY); DefaultDelivery defaultDelivery = (DefaultDelivery) delivery; defaultDelivery.deliver(params.getEndpoint(), report, headers); } } catch (Exception exception) { logger.w("Failed to report internal event to Bugsnag", exception); } } }); } catch (RejectedExecutionException ignored) { } }

Target:
void reportInternalBugsnagError(@NonNull Event event) { Map<String, Object> app = appData.getAppDataSummary(); app.put("duration", AppData.getDurationMs()); app.put("durationInForeground", appData.calculateDurationInForeground()); app.put("inForeground", sessionTracker.isInForeground()); event.setApp(app); Map<String, Object> device = deviceData.getDeviceDataSummary(); device.put("freeDisk", deviceData.calculateFreeDisk()); event.setDevice(device); Notifier notifier = Notifier.INSTANCE; event.addMetadata(INTERNAL_DIAGNOSTICS_TAB, "notifierName", notifier.getName()); event.addMetadata(INTERNAL_DIAGNOSTICS_TAB, "notifierVersion", notifier.getVersion()); event.addMetadata(INTERNAL_DIAGNOSTICS_TAB, "apiKey", immutableConfig.getApiKey()); Object packageName = appData.getAppData().get("packageName"); event.addMetadata(INTERNAL_DIAGNOSTICS_TAB, "packageName", packageName); final Report report = new Report(null, event); try { Async.run(new Runnable() { @Override public void run() { try { Delivery delivery = immutableConfig.getDelivery(); DeliveryParams params = immutableConfig.errorApiDeliveryParams(); if (delivery instanceof DefaultDelivery) { Map<String, String> headers = params.getHeaders(); headers.put(HEADER_INTERNAL_ERROR, "true"); headers.remove(HEADER_API_KEY); DefaultDelivery defaultDelivery = (DefaultDelivery) delivery; defaultDelivery.deliver(params.getEndpoint(), report, headers); } } catch (Exception exception) { logger.w("Failed to report internal event to Bugsnag", exception); } } }); } catch (RejectedExecutionException ignored) { } }
Source:
public void shouldRunEnterprise() { try ( Neo4jContainer neo4jContainer = new Neo4jContainer() .withEnterpriseEdition() .acceptLicense() .withAdminPassword("Picard123") ) { neo4jContainer.start(); try ( Driver driver = getDriver(neo4jContainer); Session session = driver.session() ) { String edition = session .run("CALL dbms.components() YIELD edition RETURN edition", Collections.emptyMap()) .next().get(0).asString(); assertThat(edition, is("enterprise")); } } }

Target:
public void shouldRunEnterprise() { assumeThat(Neo4jContainerTest.class.getResource(ACCEPTANCE_FILE_LOCATION)).isNotNull(); try ( Neo4jContainer neo4jContainer = new Neo4jContainer() .withEnterpriseEdition() .withAdminPassword("Picard123") ) { neo4jContainer.start(); try ( Driver driver = getDriver(neo4jContainer); Session session = driver.session() ) { String edition = session .run("CALL dbms.components() YIELD edition RETURN edition", Collections.emptyMap()) .next().get(0).asString(); assertThat(edition).isEqualTo("enterprise"); } } }
Source:
protected HttpRequest getBlobWithTime() { return HttpRequest.builder().method("GET") .endpoint("<LINK_0>" + "?Signature=Y4Ac4sZfBemGZmgfG78F7IX%20IFg%3D&Expires=1212683902&AWSAccessKeyId=identity") .addHeader("Host", "container.s3.amazonaws.com") .addHeader("Date", DATE).build(); }

Target:
protected HttpRequest getBlobWithTime() { return HttpRequest.builder().method("GET") .endpoint("<LINK_0>" + "?Expires=1212683902&AWSAccessKeyId=identity&Signature=Y4Ac4sZfBemGZmgfG78F7IX%2BIFg%3D") .addHeader("Host", "container.s3.amazonaws.com") .addHeader("Date", DATE).build(); }
Source:
public ElytronIntegrationChecker(Builder builder) { this.client = builder.client; this.operations = new Operations(client); this.address = builder.address; this.configFragment = builder.configFragment; if (builder.credentialReferenceAttributeName == null) { this.credentialReferenceAttributeName = CREDENTIAL_REFERENCE; } else { this.credentialReferenceAttributeName = builder.credentialReferenceAttributeName; } }

Target:
public ElytronIntegrationChecker(Builder builder) { this.client = builder.client; this.operations = new Operations(client); this.address = builder.address; this.configFragment = builder.configFragment; this.credentialReferenceAttributeName = builder.credentialReferenceAttributeName; }
Source:
public void testUpload() throws Exception { put("/rest/resource/mydir/mynewres", "This is my new test."); Resource newRes = getDataDirectory().get("/mydir/mynewres"); try (InputStream is = newRes.in()) { Assert.assertEquals("This is my new test.", IOUtils.toString(is)); } newRes.delete(); }

Target:
public void testUpload() throws Exception { put("/rest/resource/mydir/mynewres", STR_MY_NEW_TEST); Resource newRes = getDataDirectory().get("/mydir/mynewres"); try (InputStream is = newRes.in()) { Assert.assertEquals(STR_MY_NEW_TEST, IOUtils.toString(is)); } newRes.delete(); }
Source:
public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction(SEARCH_ACTION) .setDescription("Search for webhooks associated to an organization or a project.<br/>") .setSince("7.1") .setResponseExample(Resources.getResource(this.getClass(), "example-webhooks-search.json")) .setHandler(this); action.createParam(ORGANIZATION_KEY_PARAM) .setDescription("Organization key. If no organization is provided, the default organization is used.") .setInternal(true) .setRequired(false) .setExampleValue(KEY_ORG_EXAMPLE_001); action.createParam(PROJECT_KEY_PARAM) .setDescription("Project key") .setRequired(false) .setExampleValue(KEY_PROJECT_EXAMPLE_001); }

Target:
public void define(WebService.NewController controller) { WebService.NewAction action = controller.createAction(SEARCH_ACTION) .setDescription("Search for global or project webhooks") .setSince("7.1") .setResponseExample(Resources.getResource(this.getClass(), "example-webhooks-search.json")) .setHandler(this); action.createParam(ORGANIZATION_KEY_PARAM) .setDescription("Organization key. If no organization is provided, the default organization is used.") .setInternal(true) .setRequired(false) .setExampleValue(KEY_ORG_EXAMPLE_001); action.createParam(PROJECT_KEY_PARAM) .setDescription("Project key") .setRequired(false) .setExampleValue(KEY_PROJECT_EXAMPLE_001); }
Source:
public LockToken createNewFileAtomic(File file) throws IOException { boolean created = false; try { Files.createFile(file.toPath()); created = true; } catch (FileAlreadyExistsException e) { } if (!created) { return token(false, null); } if (supportsAtomicCreateNewFile() || !supportsUnixNLink) { return token(true, null); } Path link = null; Path path = file.toPath(); try { link = Files.createLink(Paths.get(uniqueLinkPath(file)), path); Integer nlink = (Integer) (Files.getAttribute(path, "unix:nlink")); if (nlink.intValue() > 2) { LOG.warn(MessageFormat.format( JGitText.get().failedAtomicFileCreation, path, nlink)); return token(false, link); } else if (nlink.intValue() < 2) { supportsUnixNLink = false; } return token(true, link); } catch (UnsupportedOperationException | IllegalArgumentException e) { supportsUnixNLink = false; return token(true, link); } }

Target:
public LockToken createNewFileAtomic(File file) throws IOException { Path path; try { path = file.toPath(); Files.createFile(path); } catch (FileAlreadyExistsException e) { return token(false, null); } if (supportsAtomicCreateNewFile() || !supportsUnixNLink) { return token(true, null); } Path link = null; try { link = Files.createLink(Paths.get(uniqueLinkPath(file)), path); Integer nlink = (Integer) (Files.getAttribute(path, "unix:nlink")); if (nlink.intValue() > 2) { LOG.warn(MessageFormat.format( JGitText.get().failedAtomicFileCreation, path, nlink)); return token(false, link); } else if (nlink.intValue() < 2) { supportsUnixNLink = false; } return token(true, link); } catch (UnsupportedOperationException | IllegalArgumentException e) { supportsUnixNLink = false; return token(true, link); } }
Source:
public OverPeriodMeasureDefinition( @JsonProperty("measureIdentifier") final String measureIdentifier, @JsonProperty("dateAttributes") final List<OverPeriodDateAttribute> dateAttributes) { this.measureIdentifier = notNull(measureIdentifier, "'measureIdentifier' must not be null!"); this.dateAttributes = notEmpty(dateAttributes, "'dateAttributes' list must not be empty!"); }

Target:
public OverPeriodMeasureDefinition( @JsonProperty("measureIdentifier") final String measureIdentifier, @JsonProperty("dateAttributes") final List<OverPeriodDateAttribute> dateAttributes) { this.measureIdentifier = notNull(measureIdentifier, "measureIdentifier"); this.dateAttributes = notEmpty(dateAttributes, "dateAttributes"); }
Source:
protected Long nullUnsafeScalar(YearMonth value) { return value.atDay( 1 ).atStartOfDay().atZone( ZoneOffset.UTC ).toInstant().toEpochMilli(); }

Target:
protected Long nullUnsafeScalar(YearMonth value) { return value.atDay( 1 ).atStartOfDay().toInstant( ZoneOffset.UTC ).toEpochMilli(); }
Source:
private CtfIterator replaceRandomElement(final CtfTmfContext context) { fAccessLock.lock(); try { final int size = fRandomAccess.size(); final int pos = fRnd.nextInt(size); final CtfTmfContext victim = fRandomAccess.get(pos); fRandomAccess.set(pos, context); CtfIterator elem = fMap.remove(victim); if (elem.isClosed()) { Activator.getDefault().logError("Found closed iterator in iterator manager."); elem.dispose(); elem = (CtfIterator) fTrace.createIterator(); } fMap.put(context, elem); victim.dispose(); return elem; } finally { fAccessLock.unlock(); } }

Target:
private CtfIterator replaceRandomElement(final CtfTmfContext context) { fAccessLock.lock(); try { final int size = fRandomAccess.size(); final int pos = fRnd.nextInt(size); final CtfTmfContext victim = fRandomAccess.get(pos); fRandomAccess.set(pos, context); CtfIterator elem = fMap.remove(victim); if (elem.isClosed()) { String traceLog = victim.getTrace() != null ? victim.getTrace().toString() : ""; Activator.getDefault().logError("Found closed iterator in iterator manager. " + traceLog); elem.dispose(); elem = (CtfIterator) fTrace.createIterator(); } fMap.put(context, elem); victim.dispose(); return elem; } finally { fAccessLock.unlock(); } }
Source:
public static String complement(String sequence, boolean RNA) { String result = ""; for (int i = sequence.length() - 1; i >= 0; i--) { result += complementBase(sequence.charAt(i), RNA); } return result; }

Target:
private static String complement(String sequence, boolean RNA) { String result = ""; for (int i = sequence.length() - 1; i >= 0; i--) { result += complementBase(sequence.charAt(i), RNA); } return result; }
Source:
String getClasspathForTemplate(String template) { String classPath = configurationGenerator.getUserConfig().getProperty(template + ".check.classpath"); final TextTemplate templateParser = new TextTemplate(configurationGenerator.getUserConfig()); classPath = templateParser.processText(classPath); return classPath; }

Target:
String getClasspathForTemplate(String template) { String classPath = configurationGenerator.getUserConfig().getProperty(template + PARAM_CHECK_CLASSPATH_SUFFIX); TextTemplate templateParser = new TextTemplate(configurationGenerator.getUserConfig()); return templateParser.processText(classPath); }
Source:
public TransactionConfiguration get() { TransactionConfigurationBuilder builder = new ConfigurationBuilder().transaction() .lockingMode(this.locking) .cacheStopTimeout(this.timeout) .transactionMode((this.mode == TransactionMode.NONE) ? org.infinispan.transaction.TransactionMode.NON_TRANSACTIONAL : org.infinispan.transaction.TransactionMode.TRANSACTIONAL) .useSynchronization(EnumSet.of(TransactionMode.BATCH, TransactionMode.NON_XA).contains(this.mode)) .recovery().enabled(this.mode == TransactionMode.FULL_XA).transaction() ; switch (this.mode) { case NONE: { break; } case BATCH: { builder.transactionManagerLookup(new TransactionManagerProvider(EmbeddedTransactionManager.getInstance())); break; } case NON_XA: { builder.transactionSynchronizationRegistryLookup(new TransactionSynchronizationRegistryProvider(this.tsrSupplier.get())); } default: { builder.transactionManagerLookup(new TransactionManagerProvider(ContextTransactionManager.getInstance())); } } return builder.create(); }

Target:
public TransactionConfiguration get() { TransactionConfigurationBuilder builder = new ConfigurationBuilder().transaction() .lockingMode(this.locking) .cacheStopTimeout(this.timeout) .transactionMode((this.mode == TransactionMode.NONE) ? org.infinispan.transaction.TransactionMode.NON_TRANSACTIONAL : org.infinispan.transaction.TransactionMode.TRANSACTIONAL) .useSynchronization(EnumSet.of(TransactionMode.BATCH, TransactionMode.NON_XA).contains(this.mode)) .recovery().enabled(this.mode == TransactionMode.FULL_XA).transaction() ; switch (this.mode) { case NONE: { break; } case BATCH: { builder.transactionManagerLookup(new TransactionManagerProvider(EmbeddedTransactionManager.getInstance())); break; } case NON_XA: { builder.transactionSynchronizationRegistryLookup(new TransactionSynchronizationRegistryProvider(this.tsrDependency.get())); } default: { builder.transactionManagerLookup(new TransactionManagerProvider(ContextTransactionManager.getInstance())); } } return builder.create(); }
Source:
public void writeLine(String line) throws IOException { if (!isClosed) { for (LineConsumer lineConsumer : lineConsumers) { try { lineConsumer.writeLine(line); } catch (ConsumerAlreadyClosedException | ClosedByInterruptException e) { lineConsumers.remove(lineConsumer); if (lineConsumers.size() == 0) { isClosed = true; } } catch (IOException e) { LOG.error(String.format("An error occurred while writing line to the line consumer %s", lineConsumer), e); } } } }

Target:
public void writeLine(String line) { if (isOpen) { for (LineConsumer lineConsumer : lineConsumers) { try { lineConsumer.writeLine(line); } catch (ConsumerAlreadyClosedException | ClosedByInterruptException e) { lineConsumers.remove(lineConsumer); if (lineConsumers.size() == 0) { isOpen = false; } } catch (IOException e) { LOG.error(String.format("An error occurred while writing line to the line consumer %s", lineConsumer), e); } } } }
Source:
public FunctionParseNode functionDistinct(String name, List<ParseNode> args) { if ("COUNT".equals(SchemaUtil.normalizeIdentifier(name))) { BuiltInFunctionInfo info = getInfo( SchemaUtil.normalizeIdentifier(DistinctCountAggregateFunction.NAME), args); return new AggregateFunctionParseNode(name, args, info); } else { throw new UnsupportedOperationException("DISTINCT not supported with " + name); } }

Target:
public FunctionParseNode functionDistinct(String name, List<ParseNode> args) { if (CountAggregateFunction.NAME.equals(SchemaUtil.normalizeIdentifier(name))) { BuiltInFunctionInfo info = getInfo( SchemaUtil.normalizeIdentifier(DistinctCountAggregateFunction.NAME), args); return new DistinctCountParseNode(name, args, info); } else { throw new UnsupportedOperationException("DISTINCT not supported with " + name); } }
Source:
public void onEntityExplode(EntityExplodeEvent event) { if (!ConfigEntry.ALLOW_EXPLOSIONS.getBoolean()) { event.setCancelled(true); return; } event.blockList().clear(); }

Target:
public void onEntityExplode(EntityExplodeEvent event) { if (!ConfigEntry.ALLOW_EXPLOSIONS.getBoolean()) { event.blockList().clear(); return; } event.setYield(0.0F); }
Source:
public ReferenceCountingResourceHolder<T> take(final long timeout) throws InterruptedException { checkInitialized(); final T theObject = timeout >= 0 ? objects.poll(timeout, TimeUnit.MILLISECONDS) : objects.take(); return theObject == null ? null : new ReferenceCountingResourceHolder<>( theObject, new Closeable() { @Override public void close() throws IOException { offer(theObject); } } ); }

Target:
public ReferenceCountingResourceHolder<T> take(final long timeout) { checkInitialized(); final T theObject; try { if (timeout > -1) { theObject = timeout > 0 ? poll(timeout) : poll(); } else { theObject = take(); } return theObject == null ? null : new ReferenceCountingResourceHolder<>( theObject, new Closeable() { @Override public void close() throws IOException { offer(theObject); } } ); } catch (InterruptedException e) { throw Throwables.propagate(e); } }
Source:
public static Stream<Library> searchChildrenLibraries(DetailedSample model, LibraryService libraryService) { try { return Stream.concat(libraryService.listBySampleId(model.getId()).stream(), model.getChildren().stream().flatMap(child -> searchChildrenLibraries(child, libraryService))); } catch (IOException e) { log.error("Failed to get child libraries.", e); return Stream.empty(); } }

Target:
public static Stream<Library> searchChildrenLibraries(DetailedSample model, LibraryService libraryService) { try { return Stream.concat(libraryService.listBySampleId(model.getId()).stream(), model.getChildren().stream().flatMap(child -> searchChildrenLibraries(child, libraryService))); } catch (IOException e) { log.error("Failed to get child libraries.", e); throw new RestException("Error fetching library information", Status.INTERNAL_SERVER_ERROR); } }