auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void deleteTenant(String tenantDomain) throws StratosException, org.wso2.carbon.user.api.UserStoreException { TenantManager tenantManager = TenantMgtServiceComponent.getTenantManager(); if (tenantManager != null) { int tenantId = tenantManager.getTenantId(tenantDomain); try { if (log.isDebugEnabled()) { log.debug(String.format("Starting tenant deletion for domain: %s and tenant id: %d from the system", tenantDomain, tenantId)); } ServerConfigurationService serverConfigurationService = TenantMgtServiceComponent.getServerConfigurationService(); if (Boolean.parseBoolean(serverConfigurationService.getFirstProperty("Tenant.TenantDelete"))) { TenantMgtUtil.deleteTenant(tenantDomain, tenantManager, tenantId, serverConfigurationService); } else { if (log.isDebugEnabled()) { log.debug("Tenant.TenantDelete flag is not set to true in carbon.xml. " + "Tenant will not be deleted."); } } } catch (Exception e) { String msg = String.format("Deleted tenant with domain: %s and tenant id: %d from the system.", tenantDomain, tenantId); log.error(msg, e); throw new StratosException(msg, e); } } }

Target:
public void deleteTenant(String tenantDomain) throws StratosException, org.wso2.carbon.user.api.UserStoreException { TenantManager tenantManager = TenantMgtServiceComponent.getTenantManager(); if (tenantManager != null) { int tenantId = tenantManager.getTenantId(tenantDomain); try { if (log.isDebugEnabled()) { log.debug(String.format("Starting tenant deletion for domain: %s and tenant id: %d from the system", tenantDomain, tenantId)); } ServerConfigurationService serverConfigurationService = TenantMgtServiceComponent.getServerConfigurationService(); if (Boolean.parseBoolean(serverConfigurationService.getFirstProperty("Tenant.TenantDelete"))) { TenantMgtUtil.deleteTenant(tenantDomain); } else { if (log.isDebugEnabled()) { log.debug("Tenant.TenantDelete flag is set to false in carbon.xml. Hence the tenant will " + "not be deleted."); } } } catch (Exception e) { String msg = String.format("Deleted tenant with domain: %s and tenant id: %d from the system.", tenantDomain, tenantId); log.error(msg, e); throw new StratosException(msg, e); } } }
Source:
public void process(final SonarLintJobManager.SonarLintJob job, final Collection<Issue> issues, Collection<ClientInputFile> failedAnalysisFiles, TriggerType trigger) { Map<VirtualFile, Collection<LocalIssuePointer>> map; long start = System.currentTimeMillis(); AccessToken token = ReadAction.start(); try { map = transformIssues(issues, job.files(), failedAnalysisFiles); Set<VirtualFile> notAnalyzed = job.files().stream().filter(store::containsFile).collect(Collectors.toSet()); store.store(map); for (VirtualFile file : job.files()) { if (shouldTrackServerIssues(file, trigger, notAnalyzed)) { serverIssueUpdater.fetchAndMatchServerIssues(file); } } getPsi(job.files()).forEach(codeAnalyzer::restart); } finally { token.finish(); } console.debug("Stored matched issues in " + (System.currentTimeMillis() - start) + " ms"); String end; if (issues.size() == 1) { end = " issue"; } else { end = " issues"; } console.info("Found " + issues.size() + end); }

Target:
public void process(final SonarLintJobManager.SonarLintJob job, final Collection<Issue> issues, Collection<ClientInputFile> failedAnalysisFiles, TriggerType trigger) { Map<VirtualFile, Collection<LocalIssuePointer>> map; long start = System.currentTimeMillis(); AccessToken token = ReadAction.start(); try { map = transformIssues(issues, job.files(), failedAnalysisFiles); Set<VirtualFile> notAnalyzed = job.files().stream().filter(store::containsFile).collect(Collectors.toSet()); store.store(map); for (VirtualFile file : job.files()) { if (shouldUpdateServerIssues(file, trigger, notAnalyzed)) { serverIssueUpdater.fetchAndMatchServerIssues(file); } } getPsi(job.files()).forEach(codeAnalyzer::restart); } finally { token.finish(); } console.debug("Stored matched issues in " + (System.currentTimeMillis() - start) + " ms"); String end; if (issues.size() == 1) { end = " issue"; } else { end = " issues"; } console.info("Found " + issues.size() + end); }
Source:
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { String code = request.getParameter(openIdAuthenticationManager.getCodeNameParameter()); if (code == null) { throw new IllegalArgumentException("authorization code cannot be null"); } String claimsUrl = openIdAuthenticationManager.buildClaimsRetrieverUrl(); Map<String, Object> claims; try { claims = retrieveClaims(claimsUrl, code); } catch (InterruptedException e) { e.printStackTrace(); throw new RuntimeException(e); } OpenIdAlfioUser alfioUser = extractUserInfoFrom(claims); if (!userManager.usernameExists(alfioUser.getEmail())) { createUser(alfioUser); } updateRoles(alfioUser.getAlfioRoles(), alfioUser.getEmail()); updateOrganizations(alfioUser, response); List<GrantedAuthority> authorities = alfioUser.getAlfioRoles().stream().map(Role::getRoleName) .map(SimpleGrantedAuthority::new).collect(Collectors.toList()); OpenIdAlfioAuthentication authentication = new OpenIdAlfioAuthentication(authorities, alfioUser.getIdToken(), alfioUser.getSubject(), alfioUser.getEmail(), openIdAuthenticationManager.buildLogoutUrl()); return getAuthenticationManager().authenticate(authentication); }

Target:
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { String code = request.getParameter(openIdAuthenticationManager.getCodeNameParameter()); if (code == null) { throw new IllegalArgumentException("authorization code cannot be null"); } String claimsUrl = openIdAuthenticationManager.buildClaimsRetrieverUrl(); Map<String, Object> claims = retrieveClaims(claimsUrl, code); OpenIdAlfioUser alfioUser = extractUserInfoFrom(claims); if (!userManager.usernameExists(alfioUser.getEmail())) { createUser(alfioUser); } updateRoles(alfioUser.getAlfioRoles(), alfioUser.getEmail()); updateOrganizations(alfioUser, response); List<GrantedAuthority> authorities = alfioUser.getAlfioRoles().stream().map(Role::getRoleName) .map(SimpleGrantedAuthority::new).collect(Collectors.toList()); OpenIdAlfioAuthentication authentication = new OpenIdAlfioAuthentication(authorities, alfioUser.getIdToken(), alfioUser.getSubject(), alfioUser.getEmail(), openIdAuthenticationManager.buildLogoutUrl()); return getAuthenticationManager().authenticate(authentication); }
Source:
public static void beforeClass() throws InterruptedException, TimeoutException, IOException { serviceAddress = client.options().isDomain ? Address.host(client.options().defaultHost) .and("core-service", "management") .and("service", "configuration-changes") : Address.coreService("management") .and("service", "configuration-changes"); changesResource = new ConfigurationChangesResource(client); }

Target:
public static void beforeClass() { serviceAddress = client.options().isDomain ? Address.host(client.options().defaultHost) .and("core-service", "management") .and("service", "configuration-changes") : Address.coreService("management") .and("service", "configuration-changes"); changesResource = new ConfigurationChangesResource(client); }
Source:
private OnmsApplication getApplicationEntity(Integer applicationId) throws NoSuchElementException { Objects.requireNonNull(applicationId); final OnmsApplication application = applicationDao.get(applicationId); if (application == null) { throw new NoSuchElementException("OnmsAppliction with id " + applicationId); } return application; }

Target:
private OnmsApplication getApplicationEntity(Integer applicationId) throws NoSuchElementException { Objects.requireNonNull(applicationId); final OnmsApplication application = applicationDao.get(applicationId); if (application == null) { throw new NoSuchElementException("OnmsApplication with id " + applicationId); } return application; }
Source:
public void testContinuousQuery() throws Exception { try(IgniteEx g1 = startGrid(1)) { IgniteCache<Integer, Integer> cache = ignite.createCache("cache-1"); try(QueryCursor qry = cache.query(new ContinuousQuery<>() .setInitialQuery(new ScanQuery<>()) .setPageSize(100) .setTimeInterval(1000) .setLocalListener(evts -> { }) .setRemoteFilterFactory(() -> evt -> true) )) { for (int i=0; i<100; i++) cache.put(i, i); List<List<?>> qrys = execute(ignite, "SELECT " + " CACHE_NAME, " + " BUFFER_SIZE, " + " INTERVAL, " + " NODE_ID, " + " LOCAL_LISTENER, " + " REMOTE_FILTER, " + " LOCAL_TRANSFORMED_LISTENER, " + " REMOTE_TRANSFORMER " + "FROM SYS.QUERY_CONTINUOUS"); assertEquals(1, qrys.size()); for (List<?> cq : qrys) checkContinuousQuery(cq, true); qrys = execute(g1, "SELECT " + " CACHE_NAME, " + " BUFFER_SIZE, " + " INTERVAL, " + " NODE_ID, " + " LOCAL_LISTENER, " + " REMOTE_FILTER, " + " LOCAL_TRANSFORMED_LISTENER, " + " REMOTE_TRANSFORMER " + "FROM SYS.QUERY_CONTINUOUS"); assertEquals(1, qrys.size()); for (List<?> cq : qrys) checkContinuousQuery(cq, false); } } }

Target:
public void testContinuousQuery() throws Exception { try(IgniteEx remoteNode = startGrid(1)) { IgniteCache<Integer, Integer> cache = ignite.createCache("cache-1"); assertTrue(execute(ignite, "SELECT * FROM SYS.QUERY_CONTINUOUS").isEmpty()); assertTrue(execute(remoteNode, "SELECT * FROM SYS.QUERY_CONTINUOUS").isEmpty()); try(QueryCursor qry = cache.query(new ContinuousQuery<>() .setInitialQuery(new ScanQuery<>()) .setPageSize(100) .setTimeInterval(1000) .setLocalListener(evts -> { }) .setRemoteFilterFactory(() -> evt -> true) )) { for (int i=0; i<100; i++) cache.put(i, i); checkContinuouQueryView(ignite, true); checkContinuouQueryView(remoteNode, false); } assertTrue(execute(ignite, "SELECT * FROM SYS.QUERY_CONTINUOUS").isEmpty()); assertTrue(execute(remoteNode, "SELECT * FROM SYS.QUERY_CONTINUOUS").isEmpty()); } }
Source:
public List<String> getDependencies() { return MoreObjects.firstNonNull(dependencies, new ArrayList<>()); }

Target:
public List<String> getDependencies() { return dependencies != null ? dependencies : new ArrayList<>(); }
Source:
boolean scheduleHeronWorkers(PackingPlan topologyPacking) { this.packing = topologyPacking; for (Entry<String, ContainerPlan> entry : topologyPacking.containers.entrySet()) { Resource reqResource = entry.getValue().resource; int mem = getMemInMBForExecutor(reqResource); int cores = getCpuForExecutor(reqResource); AllocatedEvaluator container = launchContainerForExecutor(entry.getKey(), cores, mem); if (container == null) { return false; } } return true; }

Target:
void scheduleHeronWorkers(PackingPlan topologyPacking) throws ContainerAllocationException { this.packing = topologyPacking; for (Entry<String, ContainerPlan> entry : topologyPacking.getContainers().entrySet()) { Resource reqResource = entry.getValue().getResource(); int mem = getMemInMBForExecutor(reqResource); int cores = getCpuForExecutor(reqResource); launchContainerForExecutor(entry.getKey(), cores, mem); } }
Source:
private void expandPreviousExpandedAndPaths(Object[] previous, TreeViewer viewer, Set<IPath> additionalPaths) { StagingViewContentProvider stagedContentProvider = getContentProvider( viewer); int count = stagedContentProvider.getCount(); updateAutoExpand(viewer, count); if (viewer.getAutoExpandLevel() == AbstractTreeViewer.ALL_LEVELS) { return; } if (getPresentation() == Presentation.LIST) return; Set<IPath> paths = new HashSet<>(additionalPaths); for (Object element : previous) if (element instanceof StagingFolderEntry) addPathAndParentPaths(((StagingFolderEntry) element).getPath(), paths); for (Object element : getVisibleExpandedElements(viewer)) if (element instanceof StagingFolderEntry) addPathAndParentPaths(((StagingFolderEntry) element).getPath(), paths); List<StagingFolderEntry> expand = new ArrayList<>(); calculateNodesToExpand(paths, stagedContentProvider.getElements(null), expand); viewer.setExpandedElements(expand.toArray()); }

Target:
private void expandPreviousExpandedAndPaths(Object[] previous, TreeViewer viewer, Set<IPath> additionalPaths) { StagingViewContentProvider stagedContentProvider = getContentProvider( viewer); int count = stagedContentProvider.getCount(); updateAutoExpand(viewer, count); if (viewer.getAutoExpandLevel() == AbstractTreeViewer.ALL_LEVELS) { return; } if (getPresentation() == Presentation.LIST) return; Set<IPath> paths = new HashSet<>(additionalPaths); for (Object element : previous) { if (element instanceof StagingFolderEntry) addPathAndParentPaths(((StagingFolderEntry) element).getPath(), paths); } for (Object element : getVisibleExpandedElements(viewer)) { if (element instanceof StagingFolderEntry) addPathAndParentPaths(((StagingFolderEntry) element).getPath(), paths); } List<StagingFolderEntry> expand = new ArrayList<>(); calculateNodesToExpand(paths, stagedContentProvider.getElements(null), expand); viewer.setExpandedElements(expand.toArray()); }
Source:
public final void onTimer(MessageCollector collector, TaskCoordinator coordinator) { long startNs = System.nanoTime(); Collection<RM> results = handleTimer(collector, coordinator); long endNs = System.nanoTime(); this.handleTimerTimer.update(endNs - startNs); results.forEach(rm -> this.registeredOperators.forEach(op -> op.onMessage(rm, collector, coordinator))); this.registeredOperators.forEach(op -> op.onTimer(collector, coordinator)); }

Target:
public final void onTimer(MessageCollector collector, TaskCoordinator coordinator) { long startNs = this.highResClock.nanoTime(); Collection<RM> results = handleTimer(collector, coordinator); long endNs = this.highResClock.nanoTime(); this.handleTimerNs.update(endNs - startNs); results.forEach(rm -> this.registeredOperators.forEach(op -> op.onMessage(rm, collector, coordinator))); this.registeredOperators.forEach(op -> op.onTimer(collector, coordinator)); }
Source:
public List<String> getPossibleValues(String var) { List<String> vals = new ArrayList<>(); switch (var.toLowerCase()) { case m_debugEnvVar: vals.add("true"); vals.add("false"); return vals; default: return null; } }

Target:
List<String> getPossibleValues(String var) { List<String> vals = new ArrayList<>(); switch (var.toLowerCase()) { case debugEnvVar: vals.add("true"); vals.add("false"); return vals; default: return null; } }
Source:
public boolean updateState(OutOfBandManagement.PowerState oldStatus, OutOfBandManagement.PowerState.Event event, OutOfBandManagement.PowerState newStatus, OutOfBandManagement vo, Object data) { OutOfBandManagementVO oobmHost = lockRow(vo.getId(), true); if (oobmHost == null) { if (LOG.isTraceEnabled()) { LOG.trace("Failed to lock row to update state for out-of-band management host id: " + vo.getHostId()); } return false; } Long newManagementServerId = event.getServerId(); if (oldStatus == newStatus && (oobmHost.getManagementServerId() != null && oobmHost.getManagementServerId().equals(newManagementServerId))) { return false; } if (event == OutOfBandManagement.PowerState.Event.Disabled) { newManagementServerId = null; } SearchCriteria<OutOfBandManagementVO> sc = StateUpdateSearch.create(); sc.setParameters("status", oldStatus); sc.setParameters("id", oobmHost.getId()); sc.setParameters("update", oobmHost.getUpdateCount()); oobmHost.incrUpdateCount(); UpdateBuilder ub = getUpdateBuilder(oobmHost); ub.set(oobmHost, PowerStateAttr, newStatus); ub.set(oobmHost, UpdateTimeAttr, DateUtil.currentGMTTime()); ub.set(oobmHost, MsIdAttr, newManagementServerId); int result = update(ub, sc, null); if (LOG.isDebugEnabled() && result <= 0) { LOG.debug(String.format("Failed to update out-of-band management power state from:%s to:%s due to event:%s for the host id:%d", oldStatus, newStatus, event, oobmHost.getHostId())); } return result > 0; }

Target:
public boolean updateState(OutOfBandManagement.PowerState oldStatus, OutOfBandManagement.PowerState.Event event, OutOfBandManagement.PowerState newStatus, OutOfBandManagement vo, Object data) { OutOfBandManagementVO oobmHost = (OutOfBandManagementVO) vo; if (oobmHost == null) { if (LOG.isTraceEnabled()) { LOG.trace("Invalid out-of-band management host view object provided"); } return false; } Long newManagementServerId = event.getServerId(); if (oldStatus == newStatus && (oobmHost.getManagementServerId() != null && oobmHost.getManagementServerId().equals(newManagementServerId))) { return false; } if (event == OutOfBandManagement.PowerState.Event.Disabled) { newManagementServerId = null; } SearchCriteria<OutOfBandManagementVO> sc = StateUpdateSearch.create(); sc.setParameters("status", oldStatus); sc.setParameters("id", oobmHost.getId()); sc.setParameters("update", oobmHost.getUpdateCount()); oobmHost.incrUpdateCount(); UpdateBuilder ub = getUpdateBuilder(oobmHost); ub.set(oobmHost, PowerStateAttr, newStatus); ub.set(oobmHost, UpdateTimeAttr, DateUtil.currentGMTTime()); ub.set(oobmHost, MsIdAttr, newManagementServerId); int result = update(ub, sc, null); if (LOG.isDebugEnabled() && result <= 0) { LOG.debug(String.format("Failed to update out-of-band management power state from:%s to:%s due to event:%s for the host id:%d", oldStatus, newStatus, event, oobmHost.getHostId())); } return result > 0; }
Source:
public void initializeAppResources(CommCareApp app) { int resourceState; try { currentApp = app; ExternalDataInstanceFactory.registerExternalDataInstanceBuilder(CaseInstanceTreeElement.MODEL_NAME, new CaseDataInstance()); if (currentApp.initializeApplication()) { resourceState = STATE_READY; this.sessionWrapper = new AndroidSessionWrapper(this.getCommCarePlatform()); } else { resourceState = STATE_CORRUPTED; } } catch (Exception e) { Log.i("FAILURE", "Problem with loading"); Log.i("FAILURE", "E: " + e.getMessage()); e.printStackTrace(); ExceptionReportTask ert = new ExceptionReportTask(); ert.execute(e); resourceState = STATE_CORRUPTED; } app.setAppResourceState(resourceState); }

Target:
public void initializeAppResources(CommCareApp app) { int resourceState; try { currentApp = app; if (currentApp.initializeApplication()) { resourceState = STATE_READY; this.sessionWrapper = new AndroidSessionWrapper(this.getCommCarePlatform()); } else { resourceState = STATE_CORRUPTED; } } catch (Exception e) { Log.i("FAILURE", "Problem with loading"); Log.i("FAILURE", "E: " + e.getMessage()); e.printStackTrace(); ExceptionReportTask ert = new ExceptionReportTask(); ert.execute(e); resourceState = STATE_CORRUPTED; } app.setAppResourceState(resourceState); }
Source:
public void migrationConstructorUpdatesSignedOnValue() throws Exception { String json = "{\"name\":\"test name\",\"birthdate\":\"1970-01-01\"}"; ConsentSignature sig = BridgeObjectMapper.get().readValue(json, ConsentSignature.class); ConsentSignature updated = new ConsentSignature.Builder().withConsentSignature(sig) .withSignedOn(SIGNED_ON_TIMESTAMP.getMillis()).build(); assertEquals("test name", updated.getName()); assertEquals("1970-01-01", updated.getBirthdate()); assertEquals(SIGNED_ON_TIMESTAMP.getMillis(), updated.getSignedOn()); String timestamp = new DateTime(SIGNED_ON_TIMESTAMP, DateTimeZone.UTC).toString(); json = "{\"name\":\"test name\",\"birthdate\":\"1970-01-01\",\"signedOn\":\""+timestamp+"\"}"; sig = BridgeObjectMapper.get().readValue(json, ConsentSignature.class); assertEquals(SIGNED_ON_TIMESTAMP.getMillis(), sig.getSignedOn()); }

Target:
public void migrationConstructorUpdatesSignedOnValue() throws Exception { String json = "{\"name\":\"test name\",\"birthdate\":\"1970-01-01\"}"; ConsentSignature sig = BridgeObjectMapper.get().readValue(json, ConsentSignature.class); ConsentSignature updated = new ConsentSignature.Builder().withConsentSignature(sig) .withSignedOn(SIGNED_ON_TIMESTAMP.getMillis()).build(); assertEquals("test name", updated.getName()); assertEquals("1970-01-01", updated.getBirthdate()); assertEquals(SIGNED_ON_TIMESTAMP.getMillis(), updated.getSignedOn()); json = "{\"name\":\"test name\",\"birthdate\":\"1970-01-01\",\"signedOn\":\"" + SIGNED_ON_TIMESTAMP.toString() + "\"}"; sig = BridgeObjectMapper.get().readValue(json, ConsentSignature.class); assertEquals(SIGNED_ON_TIMESTAMP.getMillis(), sig.getSignedOn()); }
Source:
public DateTime extractDateTime(AbstractInstance instance) { Attributes attributes = instance.getAttributes(); try { Date currentTimeMillis = dateFormat.parse((String) attributes.get("created_at")); return new DateTime(currentTimeMillis); } catch (ParseException e) { logger.error("Error parsing date", e); } return new DateTime(); }

Target:
public DateTime extractDateTime(AbstractInstance instance) { Attributes attributes = instance.getAttributes(); try { Date currentTimeMillis = dateFormat.parse((String) attributes.get(dateAttribute)); return new DateTime(currentTimeMillis, DateTimeZone.UTC); } catch (ParseException e) { logger.error("Error parsing date", e); } return new DateTime(); }
Source:
public static String lpad(String base, Integer len, String pad) { if (len < 0) { return null; } else if (len == 0) { return ""; } char[] data = new char[len]; char[] baseChars = base.toCharArray(); char[] padChars = pad.toCharArray(); int pos = Math.max(len - base.length(), 0); int i = 0; while (i < pos) { int j = 0; while (j < pad.length() && j < pos - i) { data[i + j] = padChars[j]; j += 1; } i += pad.length(); } i = 0; while (pos + i < len && i < base.length()) { data[pos + i] = baseChars[i]; i += 1; } return new String(data); }

Target:
public static String lpad(String base, Integer len, String pad) { if (len < 0) { return null; } else if (len == 0) { return ""; } char[] data = new char[len]; int pos = Math.max(len - base.length(), 0); for (int i = 0; i < pos; i += pad.length()) { for (int j = 0; j < pad.length() && j < pos - i; j++) { data[i + j] = pad.charAt(j); } } for (int i = 0; pos + i < len && i < base.length(); i++) { data[pos + i] = base.charAt(i); } return new String(data); }
Source:
private Snapshot.LocationType getLocationType() { if (Snapshot.LocationType.values() == null || Snapshot.LocationType.values().length == 0) { return null; } Snapshot.LocationType locationTypeToReturn = Snapshot.LocationType.values()[0]; if (locationType != null && locationType >= 1 && locationType <= Snapshot.LocationType.values().length) { locationTypeToReturn = Snapshot.LocationType.values()[locationType-1]; } return locationTypeToReturn; }

Target:
private Snapshot.LocationType getLocationType() { if (Snapshot.LocationType.values() == null || Snapshot.LocationType.values().length == 0 || locationType == null) { return null; } try { String lType = locationType.trim().toUpperCase(); return Snapshot.LocationType.valueOf(lType); } catch (IllegalArgumentException e) { String errMesg = "Invalid locationType " + locationType + "Specified for volume " + getVolumeId() + " Valid values are: primary,secondary "; s_logger.warn(errMesg); throw new CloudRuntimeException(errMesg); } }
Source:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == MENU_REMEMBER_PW_AND_LOGOUT) { launchRememberPasswordConfirmDialog(); } return true; }

Target:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == MENU_REMEMBER_PW_AND_LOGOUT) { launchRememberPasswordConfirmDialog(); } return super.onOptionsItemSelected(item); }
Source:
public Response removeCartridge( @PathParam("cartridgeType") String cartridgeType) throws RestAPIException { try { StratosApiV41Utils.removeCartridge(cartridgeType); return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS, String.format("Cartridge deleted successfully: [cartridge-type] %s", cartridgeType))).build(); } catch (RemoteException e) { return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean( ResponseMessageBean.ERROR, e.getMessage())).build(); } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) { return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean( ResponseMessageBean.ERROR, e.getFaultMessage().getInvalidCartridgeTypeException().getMessage())) .build(); } catch (CloudControllerServiceCartridgeNotFoundExceptionException e) { return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean( ResponseMessageBean.ERROR, e.getFaultMessage().getCartridgeNotFoundException().getMessage())).build(); } }

Target:
public Response removeCartridge( @PathParam("cartridgeType") String cartridgeType) throws RestAPIException { try { StratosApiV41Utils.removeCartridge(cartridgeType); return Response.ok().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS, String.format("Cartridge deleted successfully: [cartridge-type] %s", cartridgeType))).build(); } catch (RemoteException e) { throw new RestAPIException(e.getMessage()); } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) { return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean( ResponseMessageBean.ERROR, e.getFaultMessage().getInvalidCartridgeTypeException().getMessage())) .build(); } catch (CloudControllerServiceCartridgeNotFoundExceptionException e) { return Response.status(Response.Status.BAD_REQUEST).entity(new ResponseMessageBean( ResponseMessageBean.ERROR, e.getFaultMessage().getCartridgeNotFoundException().getMessage())).build(); } }
Source:
public boolean addDependency(Taint<T> other) { if(other == null) { return false; } else if(BIT_SET_CAPACITY > 0) { BitSet prev = this.labelBitSet; this.labelBitSet = BitSet.union(this.labelBitSet, other.labelBitSet); return (prev == null && this.labelBitSet != null) || (prev != null && !prev.equals(this.labelBitSet)); } else { PowerSetTree.SetNode union = this.labelSet.union(other.labelSet); boolean changed = (this.labelSet != union); this.labelSet = union; return changed; } }

Target:
public boolean addDependency(Taint<T> other) { if(other == null) { return false; } else if(BIT_SET_CAPACITY > 0) { if(this.labelBitSet == null && other.labelBitSet != null) { this.labelBitSet = other.labelBitSet.copy(); return true; } else if(this.labelBitSet != null && !this.labelBitSet.isSuperset(other.labelBitSet)) { this.labelBitSet.union(other.labelBitSet); return true; } else { return false; } } else { PowerSetTree.SetNode union = this.labelSet.union(other.labelSet); boolean changed = (this.labelSet != union); this.labelSet = union; return changed; } }
Source:
public void transientFilesWorkAreCleaned() throws Exception { LogFactory.getLog(WorkManagerTest.class).fatal("\"default\" is processing=" + service.isProcessingEnabled("default")); final File file = feature.resolveAndCreate(new File("pfouh")); service.schedule(new CreateFile(file)); service.awaitCompletion(5, TimeUnit.SECONDS); }

Target:
public void transientFilesWorkAreCleaned() throws Exception { final File file = feature.resolveAndCreate(new File("pfouh")); service.schedule(new CreateFile(file)); service.awaitCompletion(5, TimeUnit.SECONDS); }
Source:
public void start() { Profiler profiler = Profiler.create(LOG).startInfo("Register rules"); try (DbSession session = dbClient.openSession(false)) { Map<RuleKey, RuleDefinitionDto> allRules = loadRules(session); List<RuleKey> keysToIndex = new ArrayList<>(); RulesDefinition.Context context = defLoader.load(); for (RulesDefinition.ExtendedRepository repoDef : getRepositories(context)) { if (languages.get(repoDef.language()) != null) { for (RulesDefinition.Rule ruleDef : repoDef.rules()) { boolean relevantForIndex = registerRule(ruleDef, allRules, session); if (relevantForIndex) { keysToIndex.add(RuleKey.of(ruleDef.repository().key(), ruleDef.key())); } } session.commit(); } } List<RuleDefinitionDto> removedRules = processRemainingDbRules(allRules.values(), session); List<ActiveRuleChange> changes = removeActiveRulesOnStillExistingRepositories(session, removedRules, context); session.commit(); persistRepositories(session, context.repositories()); ruleIndexer.delete(removedRules.stream().map(r -> r.getKey()).collect(java.util.stream.Collectors.toList())); ruleIndexer.index(getDefaultOrganization(), keysToIndex); activeRuleIndexer.index(changes); profiler.stopDebug(); } }

Target:
public void start() { Profiler profiler = Profiler.create(LOG).startInfo("Register rules"); try (DbSession session = dbClient.openSession(false)) { Map<RuleKey, RuleDefinitionDto> allRules = loadRules(session); List<RuleKey> keysToIndex = new ArrayList<>(); RulesDefinition.Context context = defLoader.load(); for (RulesDefinition.ExtendedRepository repoDef : getRepositories(context)) { if (languages.get(repoDef.language()) != null) { for (RulesDefinition.Rule ruleDef : repoDef.rules()) { boolean relevantForIndex = registerRule(ruleDef, allRules, session); if (relevantForIndex) { keysToIndex.add(RuleKey.of(ruleDef.repository().key(), ruleDef.key())); } } session.commit(); } } List<RuleDefinitionDto> removedRules = processRemainingDbRules(allRules.values(), session); List<ActiveRuleChange> changes = removeActiveRulesOnStillExistingRepositories(session, removedRules, context); session.commit(); persistRepositories(session, context.repositories()); ruleIndexer.delete(removedRules.stream().map(RuleDefinitionDto::getKey).collect(Collectors.toList(removedRules.size()))); ruleIndexer.index(getDefaultOrganization(), keysToIndex); activeRuleIndexer.index(changes); profiler.stopDebug(); } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Analysis)) { return false; } Analysis analysis = (Analysis) o; return Objects.equal(projectUuid, analysis.projectUuid) && Objects.equal(ceTaskUuid, analysis.ceTaskUuid) && Objects.equal(analysisUuid, analysis.analysisUuid); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Analysis analysis = (Analysis) o; return Objects.equals(projectUuid, analysis.projectUuid) && Objects.equals(ceTaskUuid, analysis.ceTaskUuid) && Objects.equals(analysisUuid, analysis.analysisUuid); }
Source:
public void run(String... args) throws Exception { List<ModuleLaunchRequest> modulesToRun = toModuleLaunchRequests(moduleLauncherProperties); if (log.isInfoEnabled()) { StringBuilder sb = new StringBuilder("Launching\n"); for (ModuleLaunchRequest moduleLaunchRequest : modulesToRun) { sb.append('\t').append(moduleLaunchRequest).append('\n'); } log.info(sb.toString()); } this.moduleLauncher.launch(modulesToRun); }

Target:
public void run(String... args) throws Exception { List<ModuleLaunchRequest> launchRequests = toModuleLaunchRequests(moduleLauncherProperties); if (log.isInfoEnabled()) { StringBuilder sb = new StringBuilder("Launching\n"); for (ModuleLaunchRequest moduleLaunchRequest : launchRequests) { sb.append('\t').append(moduleLaunchRequest).append('\n'); } log.info(sb.toString()); } this.moduleLauncher.launch(launchRequests); }
Source:
public Account removeGroup(Group group) { GroupMembership groupMembership = null; for (GroupMembership aGroupMembership : getGroupMemberships()) { if (aGroupMembership.getGroup().getHref().equalsIgnoreCase(group.getHref())) { groupMembership = aGroupMembership; break; } } if (groupMembership != null){ groupMembership.delete(); } return this; }

Target:
public Account removeGroup(Group group) { Assert.notNull(group, "group cannot be null"); GroupMembership groupMembership = null; for (GroupMembership aGroupMembership : getGroupMemberships()) { if (aGroupMembership.getGroup().getHref().equals(group.getHref())) { groupMembership = aGroupMembership; break; } } if (groupMembership != null){ groupMembership.delete(); } else { throw new IllegalStateException("This account does not belong to the specified group."); } return this; }
Source:
public AutoGenerationOption save(AutoGenerationOption autoGenerationOption) { return Context.getService(IdentifierSourceService.class).saveAutoGenerationOption(autoGenerationOption); }

Target:
public AutoGenerationOption save(AutoGenerationOption autoGenerationOption) { return identifierSourceService.saveAutoGenerationOption(autoGenerationOption); }
Source:
private JoinEnumerationResult setJoinNodeProperties(JoinNode joinNode) { List<JoinEnumerationResult> possibleJoinNodes = new ArrayList<>(); FeaturesConfig.JoinDistributionType joinDistributionType = getJoinDistributionType(session); if (isAtMostScalar(joinNode.getRight(), lookup)) { JoinNode node = joinNode.withDistributionType(REPLICATED); return new JoinEnumerationResult(costProvider.getCumulativeCost(node), Optional.of(node)); } if (isAtMostScalar(joinNode.getLeft(), lookup)) { JoinNode node = joinNode.flipChildren().withDistributionType(REPLICATED); return new JoinEnumerationResult(costProvider.getCumulativeCost(node), Optional.of(node)); } if (joinDistributionType.canRepartition() && !joinNode.isCrossJoin()) { JoinNode node = joinNode.withDistributionType(PARTITIONED); possibleJoinNodes.add(new JoinEnumerationResult(costProvider.getCumulativeCost(node), Optional.of(node))); node = node.flipChildren(); possibleJoinNodes.add(new JoinEnumerationResult(costProvider.getCumulativeCost(node), Optional.of(node))); } if (joinDistributionType.canReplicate()) { JoinNode node = joinNode.withDistributionType(REPLICATED); possibleJoinNodes.add(new JoinEnumerationResult(costProvider.getCumulativeCost(node), Optional.of(node))); node = node.flipChildren(); possibleJoinNodes.add(new JoinEnumerationResult(costProvider.getCumulativeCost(node), Optional.of(node))); } if (possibleJoinNodes.stream().anyMatch(result -> result.cost.hasUnknownComponents())) { return UNKNOWN_COST_RESULT; } return resultComparator.min(possibleJoinNodes); }

Target:
private JoinEnumerationResult setJoinNodeProperties(JoinNode joinNode) { if (isAtMostScalar(joinNode.getRight(), lookup)) { JoinNode node = joinNode.withDistributionType(REPLICATED); return createJoinEnumerationResult(Optional.of(node), costProvider.getCumulativeCost(node)); } if (isAtMostScalar(joinNode.getLeft(), lookup)) { JoinNode node = joinNode.flipChildren().withDistributionType(REPLICATED); return createJoinEnumerationResult(Optional.of(node), costProvider.getCumulativeCost(node)); } List<JoinEnumerationResult> possibleJoinNodes = new ArrayList<>(); FeaturesConfig.JoinDistributionType joinDistributionType = getJoinDistributionType(session); if (joinDistributionType.canRepartition() && !joinNode.isCrossJoin()) { JoinNode node = joinNode.withDistributionType(PARTITIONED); possibleJoinNodes.add(createJoinEnumerationResult(Optional.of(node), costProvider.getCumulativeCost(node))); node = node.flipChildren(); possibleJoinNodes.add(createJoinEnumerationResult(Optional.of(node), costProvider.getCumulativeCost(node))); } if (joinDistributionType.canReplicate()) { JoinNode node = joinNode.withDistributionType(REPLICATED); possibleJoinNodes.add(createJoinEnumerationResult(Optional.of(node), costProvider.getCumulativeCost(node))); node = node.flipChildren(); possibleJoinNodes.add(createJoinEnumerationResult(Optional.of(node), costProvider.getCumulativeCost(node))); } if (possibleJoinNodes.stream().anyMatch(result -> result.equals(UNKNOWN_COST_RESULT))) { return UNKNOWN_COST_RESULT; } return resultComparator.min(possibleJoinNodes); }
Source:
private Optional<LockWatchVersion> extractVersionFromUpdate(LockWatchStateUpdate update) { return update.accept(new LockWatchStateUpdate.Visitor<Optional<LockWatchVersion>>() { @Override public Optional<LockWatchVersion> visit(Success success) { return currentVersion .filter(current -> current.id().equals(success.logId())) .map(_unused -> LockWatchVersion.of(success.logId(), success.lastKnownVersion())); } @Override public Optional<LockWatchVersion> visit(Snapshot snapshot) { return Optional.of(LockWatchVersion.of(snapshot.logId(), snapshot.lastKnownVersion())); } }); }

Target:
private Optional<LockWatchVersion> extractVersionFromUpdate(LockWatchStateUpdate update) { return update.accept(new LockWatchStateUpdate.Visitor<Optional<LockWatchVersion>>() { @Override public Optional<LockWatchVersion> visit(LockWatchStateUpdate.Success success) { return currentVersion .filter(current -> current.id().equals(success.logId())) .map(_unused -> LockWatchVersion.of(success.logId(), success.lastKnownVersion())); } @Override public Optional<LockWatchVersion> visit(LockWatchStateUpdate.Snapshot snapshot) { return Optional.of(LockWatchVersion.of(snapshot.logId(), snapshot.lastKnownVersion())); } }); }
Source:
public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) { match: { if (!OR_ELSE_GET_METHOD.matches(tree, state)) { break match; } ExpressionTree orElseGetArg = tree.getArguments().get(0); if (orElseGetArg.getKind() != Tree.Kind.LAMBDA_EXPRESSION) { break match; } LambdaExpressionTree lambdaExpressionTree = (LambdaExpressionTree) orElseGetArg; LambdaExpressionTree.BodyKind bodyKind = lambdaExpressionTree.getBodyKind(); if (bodyKind != LambdaExpressionTree.BodyKind.EXPRESSION) { break match; } ExpressionTree expressionBody = (ExpressionTree) lambdaExpressionTree.getBody(); if (COMPILE_TIME_CONSTANT.matches(expressionBody, state) || isTrivialExpression(expressionBody) || isTrivialSelect(expressionBody)) { return buildDescription(tree) .setMessage("Prefer Optional#orElse instead of Optional#orElseGet for compile time constants") .addFix(SuggestedFix.builder() .merge(SuggestedFixes.renameMethodInvocation(tree, "orElse", state)) .replace(orElseGetArg, state.getSourceForNode(expressionBody)) .build()) .build(); } } return Description.NO_MATCH; }

Target:
public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) { if (!OR_ELSE_GET_METHOD.matches(tree, state)) { return Description.NO_MATCH; } ExpressionTree orElseGetArg = tree.getArguments().get(0); if (orElseGetArg.getKind() != Tree.Kind.LAMBDA_EXPRESSION) { return Description.NO_MATCH; } LambdaExpressionTree lambdaExpressionTree = (LambdaExpressionTree) orElseGetArg; LambdaExpressionTree.BodyKind bodyKind = lambdaExpressionTree.getBodyKind(); if (bodyKind != LambdaExpressionTree.BodyKind.EXPRESSION) { return Description.NO_MATCH; } ExpressionTree expressionBody = (ExpressionTree) lambdaExpressionTree.getBody(); if (!COMPILE_TIME_CONSTANT.matches(expressionBody, state) && !isTrivialExpression(expressionBody) && !isTrivialSelect(expressionBody)) { return Description.NO_MATCH; } return buildDescription(tree) .setMessage("Prefer Optional#orElse instead of Optional#orElseGet for compile time constants") .addFix(SuggestedFix.builder() .merge(SuggestedFixes.renameMethodInvocation(tree, "orElse", state)) .replace(orElseGetArg, state.getSourceForNode(expressionBody)) .build()) .build(); }
Source:
static void createAndPopulateTable(Connection connection, RowShapeParams rowShapeParams) throws IOException { try (Admin admin = connection.getAdmin()) { if (admin.tableExists(rowShapeParams.tableName)) { LOG.info("Using existing table"); return; } LOG.info("Did not found the the table with tableName as: " + rowShapeParams.tableName); admin.createTable( new HTableDescriptor(rowShapeParams.tableName) .addFamily(new HColumnDescriptor(COL_FAMILY).setMaxVersions(1))); } try (BufferedMutator bufferedMutator = connection.getBufferedMutator(rowShapeParams.tableName)) { long timestamp = getTimeInMicroSecond(); byte[] cellValue = getRandomBytes(rowShapeParams.cellSize); for (int rowInd = 0; rowInd < rowShapeParams.totalRows; rowInd++) { Put put = new Put(Bytes.toBytes(ROW_PREFIX + String.format("%010d", rowInd))); for (int cellInd = 0; cellInd < rowShapeParams.cellsPerRow; cellInd++) { put.addColumn( COL_FAMILY, Bytes.toBytes("qualifier-" + String.format("%06d", cellInd)), timestamp, cellValue); } bufferedMutator.mutate(put); if (rowInd % 1000 == 0) { bufferedMutator.flush(); } } } LOG.info(String.format("Mutate table with %d rows", rowShapeParams.totalRows)); }

Target:
static void createAndPopulateTable(Connection connection, RowShapeParams rowShapeParams) throws IOException { try (Admin admin = connection.getAdmin()) { if (admin.tableExists(rowShapeParams.tableName)) { LOG.info("Using existing table"); return; } LOG.info("Did not found the the table with tableName as: " + rowShapeParams.tableName); admin.createTable( new HTableDescriptor(rowShapeParams.tableName) .addFamily(new HColumnDescriptor(COL_FAMILY).setMaxVersions(1))); } try (BufferedMutator bufferedMutator = connection.getBufferedMutator(rowShapeParams.tableName)) { for (int rowInd = 0; rowInd < rowShapeParams.totalRows; rowInd++) { Put put = new Put(Bytes.toBytes(READ_ROW_PREFIX + String.format("%010d", rowInd))); for (int cellInd = 0; cellInd < rowShapeParams.cellsPerRow; cellInd++) { put.addColumn( COL_FAMILY, Bytes.toBytes("qualifier-" + String.format("%06d", cellInd)), SAMPLE_TIMESTAMP, getRandomBytes(rowShapeParams.cellSize)); } bufferedMutator.mutate(put); } } LOG.info(String.format("Mutate table with %d rows", rowShapeParams.totalRows)); }
Source:
public HttpResponse doNotifyCommit(@QueryParameter(required=true) String url) throws ServletException, IOException { final List<AbstractProject<?,?>> projects = Lists.newArrayList(); boolean scmFound = false, triggerFound = false, urlFound = false; Authentication old = SecurityContextHolder.getContext().getAuthentication(); SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM); try { for (AbstractProject<?,?> project : Hudson.getInstance().getAllItems(AbstractProject.class)) { SCM scm = project.getScm(); if (scm instanceof MercurialSCM) scmFound = true; else continue; MercurialSCM hg = (MercurialSCM) scm; String repository = hg.getSource(); if (url.equals(repository)) urlFound = true; else continue; SCMTrigger trigger = project.getTrigger(SCMTrigger.class); if (trigger!=null) triggerFound = true; else continue; LOGGER.info("Triggering the polling of "+project.getFullDisplayName()); trigger.run(); projects.add(project); } } finally { SecurityContextHolder.getContext().setAuthentication(old); } final String msg; if (!scmFound) msg = "No mercurial jobs found"; else if (!urlFound) msg = "No mercurial jobs using repository: " + url; else if (!triggerFound) msg = "Jobs found but they aren't configured for polling"; else msg = null; return new HttpResponse() { public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { rsp.setStatus(SC_OK); rsp.setContentType("text/plain"); for (AbstractProject<?, ?> p : projects) { rsp.addHeader("Triggered", p.getAbsoluteUrl()); } PrintWriter w = rsp.getWriter(); for (AbstractProject<?, ?> p : projects) { w.println("Scheduled polling of "+p.getFullDisplayName()); } if (msg!=null) w.println(msg); } }; }

Target:
public HttpResponse doNotifyCommit(@QueryParameter(required=true) String url) throws ServletException, IOException { SecurityContext securityContext = ACL.impersonate(ACL.SYSTEM); try { return handleNotifyCommit(url); } finally { SecurityContextHolder.setContext(securityContext); } }
Source:
public String localize(final String errorMsg, final Locale requestLocale) { String localizedErrorMsg = ""; ResourceBundle resourceBundle = getResourceBundle(requestLocale == null ? Locale.getDefault() : requestLocale); if (resourceBundle != null && resourceBundle.containsKey(errorMsg)) { localizedErrorMsg = resourceBundle.getString(errorMsg); } else if (!StringUtils.isEmpty(errorMsg)) { localizedErrorMsg = StringUtils.join(errorMsg.toLowerCase().split("[_]", -1), " "); } return localizedErrorMsg; }

Target:
public String localize(final String errorMsg, final Locale requestLocale) { String localizedErrorMsg = errorMsg; ResourceBundle resourceBundle = getResourceBundle(requestLocale == null ? Locale.getDefault() : requestLocale); if (resourceBundle != null && resourceBundle.containsKey(errorMsg)) { localizedErrorMsg = resourceBundle.getString(errorMsg); } return localizedErrorMsg; }
Source:
public ClientCompactQueryTuningConfig( @JsonProperty("maxRowsPerSegment") @Nullable Integer maxRowsPerSegment, @JsonProperty("maxRowsInMemory") @Nullable Integer maxRowsInMemory, @JsonProperty("maxTotalRows") @Nullable Integer maxTotalRows, @JsonProperty("indexSpec") @Nullable IndexSpec indexSpec, @JsonProperty("maxPendingPersists") @Nullable Integer maxPendingPersists, @JsonProperty("pushTimeout") @Nullable Long pushTimeout ) { this.maxRowsPerSegment = maxRowsPerSegment; this.maxRowsInMemory = maxRowsInMemory == null ? DEFAULT_MAX_ROWS_IN_MEMORY : maxRowsInMemory; this.maxTotalRows = maxTotalRows == null ? DEFAULT_MAX_TOTAL_ROWS : maxTotalRows; this.indexSpec = indexSpec == null ? DEFAULT_INDEX_SPEC : indexSpec; this.maxPendingPersists = maxPendingPersists == null ? DEFAULT_MAX_PENDING_PERSISTS : maxPendingPersists; this.pushTimeout = pushTimeout == null ? DEFAULT_PUBLISH_TIMEOUT : pushTimeout; }

Target:
public ClientCompactQueryTuningConfig( @JsonProperty("maxRowsPerSegment") @Nullable Integer maxRowsPerSegment, @JsonProperty("maxRowsInMemory") @Nullable Integer maxRowsInMemory, @JsonProperty("maxTotalRows") @Nullable Integer maxTotalRows, @JsonProperty("indexSpec") @Nullable IndexSpec indexSpec, @JsonProperty("maxPendingPersists") @Nullable Integer maxPendingPersists, @JsonProperty("pushTimeout") @Nullable Long pushTimeout ) { this.maxRowsPerSegment = maxRowsPerSegment; this.maxRowsInMemory = maxRowsInMemory == null ? DEFAULT_MAX_ROWS_IN_MEMORY : maxRowsInMemory; this.maxTotalRows = maxTotalRows == null ? DEFAULT_MAX_TOTAL_ROWS : maxTotalRows; this.indexSpec = indexSpec == null ? DEFAULT_INDEX_SPEC : indexSpec; this.maxPendingPersists = maxPendingPersists == null ? DEFAULT_MAX_PENDING_PERSISTS : maxPendingPersists; this.pushTimeout = pushTimeout == null ? DEFAULT_PUSH_TIMEOUT : pushTimeout; }
Source:
public void start() { if (!running) { synchronized (lifecycleMonitor) { if (!running) { BindingUtils.bindAll(this.applicationContext); this.running = true; } } } }

Target:
public void start() { if (!running) { synchronized (lifecycleMonitor) { if (!running) { try { ChannelBindingService channelBindingService = this.applicationContext.getBean(ChannelBindingService.class); Map<String, Bindable> bindables = this.applicationContext.getBeansOfType(Bindable.class); for (Bindable bindable : bindables.values()) { bindable.bindOutputs(channelBindingService); } for (Bindable bindable : bindables.values()) { bindable.bindInputs(channelBindingService); } } catch (BeansException e) { throw new IllegalStateException("Cannot perform binding, no proper implementation found",e); } this.running = true; } } } }
Source:
public Response update(final ClientRepresentation rep) { auth.requireManage(); try { RepresentationToModel.updateClient(rep, client); adminEvent.realm(realm).operation(OperationType.UPDATE).resourcePath(client).representation(rep).success(); return Response.noContent().build(); } catch (ModelDuplicateException e) { return ErrorResponse.exists("Client " + rep.getClientId() + " already exists"); } }

Target:
public Response update(final ClientRepresentation rep) { auth.requireManage(); try { RepresentationToModel.updateClient(rep, client); adminEvent.operation(OperationType.UPDATE).resourcePath(client).representation(rep).success(); return Response.noContent().build(); } catch (ModelDuplicateException e) { return ErrorResponse.exists("Client " + rep.getClientId() + " already exists"); } }
Source:
public void setSearchFactory(ExtendedSearchIntegrator boundSearchIntegrator) { this.searchIntegrator = boundSearchIntegrator; this.clientReference = searchIntegrator.getServiceManager().requestReference( JestClient.class ); if ( postInitialize != null ) { try { postInitialize.call(); } catch (Exception e) { throw new SearchException( "Index manager initialization failed", e ); } } }

Target:
public void setSearchFactory(ExtendedSearchIntegrator boundSearchIntegrator) { this.searchIntegrator = boundSearchIntegrator; this.clientReference = searchIntegrator.getServiceManager().requestReference( JestClient.class ); initializeIndex(); }