auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public OpenShiftProject create(String workspaceId) throws InfrastructureException { final String projectName; try { projectName = evalNamespaceName(workspaceId, EnvironmentContext.getCurrent().getSubject()); } catch (NotFoundException | ServerException | ConflictException | ValidationException e) { throw new InfrastructureException( format("Failed to evaluate the project name to use for workspace %s.", workspaceId), e); } OpenShiftProject osProject = doCreateProject(workspaceId, projectName); osProject.prepare(); if (isCreatingNamespace(workspaceId) && !isNullOrEmpty(getServiceAccountName())) { OpenShiftWorkspaceServiceAccount osWorkspaceServiceAccount = doCreateServiceAccount(workspaceId, projectName); osWorkspaceServiceAccount.prepare(); } return osProject; }

Target:
public OpenShiftProject create(String workspaceId) throws InfrastructureException { final String projectName; try { projectName = evalNamespaceName(workspaceId, EnvironmentContext.getCurrent().getSubject()); } catch (NotFoundException | ServerException | ConflictException | ValidationException e) { throw new InfrastructureException( format( "Failed to evaluate the project name to use for workspace %s. The error message" + " was: %s", workspaceId, e.getMessage()), e); } OpenShiftProject osProject = doCreateProject(workspaceId, projectName); osProject.prepare(); if (isCreatingNamespace(workspaceId) && !isNullOrEmpty(getServiceAccountName())) { OpenShiftWorkspaceServiceAccount osWorkspaceServiceAccount = doCreateServiceAccount(workspaceId, projectName); osWorkspaceServiceAccount.prepare(); } return osProject; }
Source:
public void testSmallTraces() { assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { Set<ITmfTrace> traces = new HashSet<>(); traces.add(trace1); traces.add(trace2); runTest(traces, "Match TCP events", 40); } }

Target:
public void testSmallTraces() { assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); try (CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace();) { Set<ITmfTrace> traces = ImmutableSet.of((ITmfTrace) trace1, trace2); runCpuTest(traces, "Match TCP events", 40); } }
Source:
private void checkScopeAnnotation(ClassTree tree) { List<AnnotationTree> annotations = tree.modifiers().annotations(); for (AnnotationTree annotationTree : annotations) { if (annotationTree.annotationType().symbolType().fullyQualifiedName().equals(SCOPE_ANNOTATION_FQN)) { context.reportIssue(this, annotationTree, "Remove this \"@Scope\" annotation."); } } }

Target:
private void checkScopeAnnotation(ClassTree tree) { tree.modifiers().annotations().stream() .filter(a -> a.annotationType().symbolType().fullyQualifiedName().equals(SCOPE_ANNOTATION_FQN)) .forEach(a -> reportIssue(a, "Remove this \"@Scope\" annotation.")); }
Source:
public boolean isExcluded(@NonNull SCMSourceRequest request, @NonNull SCMHead head) { long lastModified = 0; try { if (head instanceof BranchSCMHead && request instanceof GitHubSCMSourceRequest) { for (GHBranch b : ((GitHubSCMSourceRequest) request).getBranches()) { if (b.getName().equals(head.getName())) { lastModified = b.getOwner().getCommit(b.getSHA1()).getCommitDate().getTime(); } } } else if (head instanceof TagSCMHead && request instanceof GitHubSCMSourceRequest) { lastModified = ((TagSCMHead)head).getTimestamp(); } } catch (IOException e) { LOGGER.log(Level.WARNING, "Could not get commit date of latest commit in branch {0}", new Object[]{head.getName()} ); return false; } long daysOld = TimeUnit.MILLISECONDS.toDays(new Date().getTime() - lastModified); if (lastModified != 0 && maxDaysOld != 0 && daysOld > maxDaysOld) { return true; } return false; }

Target:
public boolean isExcluded(@NonNull SCMSourceRequest request, @NonNull SCMHead head) { long lastModified = 0; try { if (head instanceof BranchSCMHead && request instanceof GitHubSCMSourceRequest) { Iterable<GHBranch> ghBranches = null; if (this.branches == null) { ghBranches = ((GitHubSCMSourceRequest) request).getBranches(); } else { ghBranches = branches; } for (GHBranch b : ghBranches) { if (b.getName().equals(head.getName())) { lastModified = b.getOwner().getCommit(b.getSHA1()).getCommitDate().getTime(); } } } else if (head instanceof TagSCMHead && request instanceof GitHubSCMSourceRequest) { lastModified = ((TagSCMHead)head).getTimestamp(); } } catch (IOException e) { LOGGER.log(Level.WARNING, "Could not get commit date of latest commit in branch {0}", new Object[]{head.getName()} ); return false; } long daysOld = TimeUnit.MILLISECONDS.toDays(new Date().getTime() - lastModified); if (lastModified != 0 && maxDaysOld > 0 && daysOld > maxDaysOld) { return true; } return false; }
Source:
public CertificateClientBuilder credential(TokenCredential credential) { Objects.requireNonNull(credential); this.credential = credential; return this; }

Target:
public CertificateClientBuilder credential(TokenCredential credential) { Objects.requireNonNull(credential, "Token credential cannot be null"); this.credential = credential; return this; }
Source:
public static Restaurant createFakeRestaurant(ParseUser u) throws ParseException { ParseUser restUser = new ParseUser(); restUser.setUsername("testRestUser"); restUser.setPassword("12345"); restUser.setObjectId("_marksrest"); return new Restaurant(restUser); }

Target:
public static Restaurant createFakeRestaurant(ParseUser u) throws ParseException { return createFakeRestaurant(); }
Source:
private Address getHighest(){ if(this.addressTable.size() < AddressTable.DEFAULT_MAX_SIZE) return isAutoRemappingEnabled() ? this.getReferenceAddress().getComplement(): highest; else return isAutoRemappingEnabled() && !addressTable.isEmpty() ? addressTable.lastEntry().getValue() : highest; }

Target:
private Address getHighest(){ if(this.addressTable.size() < (this.addressTable.getMaxSize()*.9)) return isAutoRemappingEnabled() ? this.getReferenceAddress().getComplement(): highest; else return isAutoRemappingEnabled() ? addressTable.lastEntry().getValue() : highest; }
Source:
private SQLAdmin buildSQLAdmin() { try { JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); GoogleCredential credential; if (jsonKey != null) { credential = GoogleCredential.fromStream( new ByteArrayInputStream(jsonKey.getBytes()), httpTransport, JSON_FACTORY) .createScoped(Collections.singleton(SQLAdminScopes.SQLSERVICE_ADMIN)); } else { Collection SQLSERVICE_ADMIN_SCOPES = Collections.singletonList(SQLAdminScopes.SQLSERVICE_ADMIN); credential = GoogleCredential.getApplicationDefault(httpTransport, JSON_FACTORY); credential = credential.createScoped(SQLSERVICE_ADMIN_SCOPES); } return new SQLAdmin.Builder(httpTransport, JSON_FACTORY, null) .setApplicationName(Names.buildApplicationNameVersionTag(applicationProperties)) .setHttpRequestInitializer(credential) .build(); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
private SQLAdmin buildSQLAdmin() { try { JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); GoogleCredential credential; if (jsonKey != null) { credential = GoogleCredential.fromStream( new ByteArrayInputStream(jsonKey.getBytes()), httpTransport, JSON_FACTORY) .createScoped(Collections.singleton(SQLAdminScopes.SQLSERVICE_ADMIN)); } else { Collection SQLSERVICE_ADMIN_SCOPES = Collections.singletonList(SQLAdminScopes.SQLSERVICE_ADMIN); credential = GoogleCredential.getApplicationDefault(httpTransport, JSON_FACTORY).createScoped(SQLSERVICE_ADMIN_SCOPES); } return new SQLAdmin.Builder(httpTransport, JSON_FACTORY, null) .setApplicationName(Names.buildApplicationNameVersionTag(applicationProperties)) .setHttpRequestInitializer(credential) .build(); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public String toString() { return String.valueOf(this.text); }

Target:
public String toString() { return String.format( "%s(super=%s, text=%s)", RsFlash.class.getSimpleName(), super.toString(), this.text ); }
Source:
public void split(BaseTxPartitionAndMergeTest test) { test.getLog().debug("Splitting cluster isolating a primary owner."); test.splitCluster(new int[]{2}, new int[]{0, 1, 3}); assertDegradedPartition(test, 0); TestingUtil.waitForNoRebalance(test.cache(0 ), test.cache(1), test.cache(3)); test.getLog().debug("Cluster split."); }

Target:
public void split(BaseTxPartitionAndMergeTest test) { test.getLog().debug("Splitting cluster isolating the originator."); test.splitCluster(new int[]{0}, new int[]{1, 2, 3}); assertDegradedPartition(test, 0); TestingUtil.waitForNoRebalance(test.cache(1), test.cache(2), test.cache(3)); test.getLog().debug("Cluster split."); }
Source:
public void testFilter() { ConnectorSession session = new TestingConnectorSession(ImmutableList.of()); FilterFunction filter = new FilterFunction(session, true, new IsOddPredicate()); Block numbers = makeNumbers(0, 1000); int[] allPositions = makePositions(0, 1000, 1); assertFilter(filter, numbers, allPositions, allPositions.length); Block dictionaryNumbers = new DictionaryBlock(numbers, allPositions); int[] sparsePositions = makePositions(1, 300, 3); assertFilter(filter, dictionaryNumbers, sparsePositions, sparsePositions.length); assertFilter(filter, dictionaryNumbers, allPositions, allPositions.length); DictionaryBlock otherDictionary = new DictionaryBlock(numbers, makePositions(1, 332, 3)); int[] otherDictionaryPositions = makePositions(0, 150, 2); assertFilter(filter, otherDictionary, otherDictionaryPositions, otherDictionaryPositions.length); Block numbers2 = makeNumbers(1, 1001); Block dictionary2Numbers = new DictionaryBlock(numbers2, allPositions); assertFilter(filter, dictionary2Numbers, allPositions, allPositions.length); }

Target:
public void testFilter() { ConnectorSession session = new TestingConnectorSession(ImmutableList.of()); FilterFunction filter = new FilterFunction(session, true, new IsOddPredicate()); Block numbers = makeNumbers(0, 1000); int[] allPositions = makePositions(0, 1000, 1); assertFilter(filter, numbers, allPositions, allPositions.length); Block dictionaryNumbers = new DictionaryBlock(numbers, allPositions); int[] sparsePositions = makePositions(1, 300, 3); assertFilter(filter, dictionaryNumbers, sparsePositions, sparsePositions.length); assertFilter(filter, dictionaryNumbers, allPositions, allPositions.length); DictionaryBlock otherDictionary = new DictionaryBlock(numbers, makePositions(1, 332, 3)); int[] otherDictionaryPositions = makePositions(0, 150, 2); assertFilter(filter, otherDictionary, otherDictionaryPositions, otherDictionaryPositions.length); assertFilter(filter, new DictionaryBlock(makeNumbers(1, 1001), allPositions), allPositions, allPositions.length); }
Source:
protected Runnable getSessionTask() { return new Runnable() { @Override public void run() { session.get().pulse(); } }; }

Target:
protected Runnable getSessionTask() { return sessionTask; }
Source:
public void shouldReverseANonEmptyList() { final int length = 100; final int startValue = 0; final List<Integer> reversedList = IntStream.range(startValue, length) .boxed() .collect(Collectors.toList()); Collections.reverse(reversedList); final List<Integer> list = Collections.unmodifiableList( IntStream.range(startValue, length) .boxed() .collect(Collectors.toList()) ); final List<Integer> actual = ListOps.reverse(list); final List<Integer> expected = reversedList; assertNotNull(actual); assertFalse(actual.isEmpty()); assertEquals(expected, actual); }

Target:
public void shouldReverseANonEmptyList() { final List<Integer> list = Collections.unmodifiableList( Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8) ); final List<Integer> actual = ListOps.reverse(list); final List<Integer> expected = Arrays.asList(8, 7, 6, 5, 4, 3, 2, 1, 0); assertNotNull(actual); assertFalse(actual.isEmpty()); assertEquals(expected, actual); }
Source:
public String getCode() { return this.getString(Constants.Properties.CODE); }

Target:
public String getCode() { return super.getString(Constants.Properties.CODE); }
Source:
public void handle(HttpURLConnection connection) { if(security.isAuthorized()) { long tokenLifetime = security.remainingTokenLifetime(); LOG.debug("security token will expire in " + tokenLifetime + " ms"); if (tokenLifetime < MIN_TOKEN_LIFETIME) { LOG.debug("Need to refresh security token"); try { security.refreshToken().get(); } catch (Exception e) { throw new DolphinRuntimeException("Can not refresh security token", e); } } } String accessToken = security.getAccessToken(); if(accessToken != null && !accessToken.isEmpty()) { LOG.debug("Adding security access token to request"); connection.setRequestProperty("Authorization", "Bearer " + accessToken); } }

Target:
public void handle(HttpURLConnection connection) { if(security.isAuthorized()) { long tokenLifetime = security.tokenExpiresAt() - System.currentTimeMillis(); LOG.debug("security token will expire in " + tokenLifetime + " ms"); if (tokenLifetime < MIN_TOKEN_LIFETIME) { LOG.debug("Need to refresh security token"); try { security.refreshToken().get(); } catch (Exception e) { throw new DolphinRuntimeException("Can not refresh security token", e); } } } String accessToken = security.getAccessToken(); if(accessToken != null && !accessToken.isEmpty()) { LOG.debug("Adding security access token to request"); connection.setRequestProperty("Authorization", "Bearer " + accessToken); } }
Source:
public int getWeight(EStructuralFeature feature) { if (irrelevant(feature) || toBeIgnored.contains(feature)) { return 0; } Integer found = weights.get(feature); if (found == null) { found = Integer.valueOf(SMALL); if ("name".equals(feature.getName()) || "id".equals(feature.getName())) { found = Integer.valueOf(SIGNIFICANT); } if (feature instanceof EReference && ((EReference)feature).isContainment()) { found = Integer.valueOf(NORMAL); } } if (feature instanceof EReference) { found = Integer.valueOf(referenceChangeCoef * found.intValue()); } else { found = Integer.valueOf(attributeChangeCoef * found.intValue()); } return found.intValue(); }

Target:
public int getWeight(EStructuralFeature feature) { if (irrelevant(feature)) { return 0; } Integer found = weights.get(feature); if (found == null) { found = Integer.valueOf(SMALL); if (feature == EcorePackage.Literals.ENAMED_ELEMENT__NAME) { found = Integer.valueOf(SIGNIFICANT); } if (feature instanceof EReference && ((EReference)feature).isContainment()) { found = Integer.valueOf(NORMAL); } if (feature instanceof EReference) { found = Integer.valueOf(referenceChangeCoef * found.intValue()); } else { found = Integer.valueOf(attributeChangeCoef * found.intValue()); } weights.put(feature, found); } return found.intValue(); }
Source:
private LogoutResponse logout(URL logoutUrl, String requestBody) throws Exception { Request request = new Request.Builder() .url(logoutUrl) .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .addHeader("Connection", "close") .post(RequestBody.create(JSON, requestBody)) .build(); Call call = client.newCall(request); Response response = call.execute(); return LogoutResponse.from(response); }

Target:
private LogoutResponse logout(URL logoutUrl, String requestBody) throws Exception { Request request = new Request.Builder() .url(logoutUrl) .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .post(RequestBody.create(JSON, requestBody)) .build(); Call call = client.newCall(request); Response response = call.execute(); return LogoutResponse.from(response); }
Source:
public Future<ImmutableSet<MarketplaceEntry>> loadMarketplaceEntriesFor(final IPerson user) { final List<IPortletDefinition> allPortletDefinitions = this.portletDefinitionRegistry.getAllPortletDefinitions(); final List<MarketplaceEntry> visiblePortletDefinitions = new ArrayList<>(); for (final IPortletDefinition portletDefinition : allPortletDefinitions) { if (mayBrowsePortlet(user, portletDefinition)) { final MarketplacePortletDefinition marketplacePortletDefinition = getOrCreateMarketplacePortletDefinition(portletDefinition); MarketplaceEntry entry = new MarketplaceEntry(marketplacePortletDefinition); boolean canAdd = mayAddPortlet(user, portletDefinition); entry.setCanAdd(canAdd); visiblePortletDefinitions.add(entry); } } logger.trace("These portlet definitions are browseable by {}.", visiblePortletDefinitions, user); Future<ImmutableSet<MarketplaceEntry>> result = new AsyncResult<>(ImmutableSet.copyOf(visiblePortletDefinitions)); Element cacheElement = new Element(user.getUserName(), result); marketplaceUserPortletDefinitionCache.put(cacheElement); return result; }

Target:
public Future<ImmutableSet<MarketplaceEntry>> loadMarketplaceEntriesFor(final IPerson user) { final List<IPortletDefinition> allPortletDefinitions = this.portletDefinitionRegistry.getAllPortletDefinitions(); final Set<MarketplaceEntry> visiblePortletDefinitions = new HashSet<>(); for (final IPortletDefinition portletDefinition : allPortletDefinitions) { if (mayBrowsePortlet(user, portletDefinition)) { final MarketplacePortletDefinition marketplacePortletDefinition = getOrCreateMarketplacePortletDefinition(portletDefinition); MarketplaceEntry entry = new MarketplaceEntry(marketplacePortletDefinition); boolean canAdd = mayAddPortlet(user, portletDefinition); entry.setCanAdd(canAdd); visiblePortletDefinitions.add(entry); } } logger.trace("These portlet definitions are browseable by {}.", visiblePortletDefinitions, user); Future<ImmutableSet<MarketplaceEntry>> result = new AsyncResult<>(ImmutableSet.copyOf(visiblePortletDefinitions)); Element cacheElement = new Element(user.getUserName(), result); marketplaceUserPortletDefinitionCache.put(cacheElement); return result; }
Source:
protected SortedMap<String, MavenProject> getDependencies( MavenProject project ) { return dependenciesTool.loadProjectDependencies( new LoadedProjectDependencies(project.getArtifacts(), project.getDependencyArtifacts()), this, localRepository, remoteRepositories, null ); }

Target:
protected SortedMap<String, MavenProject> getDependencies( MavenProject project ) { return dependenciesTool.loadProjectDependencies( new ResolvedProjectDependencies( project.getArtifacts(), project.getDependencyArtifacts() ), this, localRepository, remoteRepositories, null ); }
Source:
public String convertProperties(Map<String, String> properties) { StringBuilder sb = new StringBuilder(); if (properties != null && !properties.isEmpty()) { for (Map.Entry<String, String> e : properties.entrySet()) { sb.append(e.getKey()); sb.append(KEY_VALUE_DELIMETER); sb.append(Optional.ofNullable(e.getValue()).orElse("")); sb.append(PROPERTIES_DELIMETER); } sb.deleteCharAt(sb.length() - 1); } return sb.toString(); }

Target:
public String convertProperties(Map<String, String> properties) { StringBuilder sb = new StringBuilder(); if (properties != null && !properties.isEmpty()) { for (Map.Entry<String, String> e : properties.entrySet()) { sb.append(e.getKey()); sb.append(KEY_VALUE_DELIMETER); sb.append(Objects.toString(e.getValue(), "")); sb.append(PROPERTIES_DELIMETER); } sb.deleteCharAt(sb.length() - 1); } return sb.toString(); }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + getUuid().hashCode(); result = prime * result + ((hostName == null) ? 0 : hostName.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getUuid() == null) ? 0 : getUuid().hashCode()); result = prime * result + ((getHostName() == null) ? 0 : getHostName().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); return result; }
Source:
public void doIndex(StaplerRequest req, StaplerResponse rsp) throws IOException { if (!ResourceDomainConfiguration.isResourceRequest(req)) { rsp.sendError(404, "Cannot handle requests to this URL unless on Jenkins resource URL."); } else { rsp.sendError(404, "Jenkins serves only static files on this domain."); } }

Target:
public void doIndex(StaplerRequest req, StaplerResponse rsp) throws IOException { if (ResourceDomainConfiguration.isResourceRequest(req)) { rsp.sendError(404, ResourceDomainFilter.ERROR_RESPONSE); } else { rsp.sendError(404, "Cannot handle requests to this URL unless on Jenkins resource URL."); } }
Source:
public static <T extends TimeValue> T positive(final T timeValue, final String name) { positive(timeValue.toMilliseconds(), name); return timeValue; }

Target:
public static <T extends TimeValue> T positive(final T timeValue, final String name) { positive(timeValue.getDuration(), name); return timeValue; }
Source:
public void run() { if (!this.getBuilder().getJob().isBuildable()) { logger.info(format("Build Skip (%s).", getBuilder().getJob().getName())); } else if(checkAlreadyQueued.compareAndSet(false, true)) { logger.info(format("Build started (%s).", getBuilder().getJob().getName())); descriptor.getExecutorService().execute(new Runnable() { @Override public void run() { try { stashPullRequestsBuilder.run(); } finally { checkAlreadyQueued.set(false); } } }); } else { logger.info(format("Build check already queued - skipping (%s).", getBuilder().getJob().getName())); } this.getDescriptor().save(); }

Target:
public void run() { if (!this.getBuilder().getJob().isBuildable()) { logger.info(format("Build Skip (%s).", getBuilder().getJob().getName())); } else if(checkAlreadyQueued.compareAndSet(false, true)) { logger.info(format("Build started (%s).", getBuilder().getJob().getName())); descriptor.getExecutorService().execute(new Runnable() { @Override public void run() { try { stashPullRequestsBuilder.run(); } catch (Exception e) { logger.log(Level.WARNING, "Stash Pull Request Builder failed when checking for changes", e); } finally { checkAlreadyQueued.set(false); } } }); } else { logger.info(format("Build check already queued - skipping (%s).", getBuilder().getJob().getName())); } this.getDescriptor().save(); }
Source:
private void checkTableNotExists(SchemaTableName tableName) { if (tables.values().stream() .map(MemoryTableHandle::toSchemaTableName) .anyMatch(tableName::equals)) { throw new PrestoException(ALREADY_EXISTS, format("Table [%s] already exists", tableName.toString())); } if (views.keySet().stream() .anyMatch(tableName::equals)) { throw new PrestoException(ALREADY_EXISTS, format("View [%s] already exists", tableName.toString())); } }

Target:
private void checkTableNotExists(SchemaTableName tableName) { if (tables.values().stream() .map(MemoryTableHandle::toSchemaTableName) .anyMatch(tableName::equals)) { throw new PrestoException(ALREADY_EXISTS, format("Table [%s] already exists", tableName.toString())); } if (views.keySet().contains(tableName)) { throw new PrestoException(ALREADY_EXISTS, format("View [%s] already exists", tableName.toString())); } }
Source:
public void testRequireNull() { RequiredModel model = new RequiredModel(); model.field = null; RequiredModel result = unmarshal(RequiredModel.class, marshal(model)); assertThat(result, nullValue()); }

Target:
public void testRequireNull() { RequiredModel model = new RequiredModel(); RequiredModel result = unmarshal(gson, RequiredModel.class, marshal(gson, model)); assertThat(result, nullValue()); }
Source:
public List<Action> getActions() { List<Action> actions = new ArrayList<>(); final Collection<? extends AbstractContent> selectedContents = Utilities.actionsGlobalContext().lookupAll(AbstractContent.class); if (!selectedContents.isEmpty() && selectedContents.size() == 1) { AbstractContent content = selectedContents.toArray(new AbstractContent[selectedContents.size()])[0]; try { if (content instanceof AbstractFile && content.getArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED).size() > 0 && DOCUMENT_EXTENSIONS.contains("." + ((AbstractFile) content).getNameExtension().toLowerCase())) { actions.add(new ExtractDocumentWithPasswordAction(((AbstractFile) content))); } } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.WARNING, "Unable to add unzip with password action to context menus", ex); } } return actions; }

Target:
public List<Action> getActions() { List<Action> actions = new ArrayList<>(); final Collection<? extends AbstractFile> selectedContents = Utilities.actionsGlobalContext().lookupAll(AbstractFile.class); if (selectedContents.size() == 1) { AbstractFile content = selectedContents.toArray(new AbstractFile[selectedContents.size()])[0]; try { if (content.getArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED).size() > 0 && DOCUMENT_EXTENSIONS.contains(content.getNameExtension().toLowerCase())) { actions.add(new ExtractDocumentWithPasswordAction(content)); } } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.WARNING, "Unable to to add Extract Content with Password action to context menus", ex); } } return actions; }
Source:
protected HttpClient getHttpClient(Integer readTimeout, Integer connectTimeout) { if (getDoCacheClient() && HTTP_CLIENT_API_43) { if (cachedClient == null) { cachedClient = getNewPooledHttpClient(readTimeout, connectTimeout); } return cachedClient; } if (HTTP_CLIENT_API_43) { RequestConfig config = RequestConfig.custom() .setSocketTimeout(readTimeout) .setConnectTimeout(connectTimeout) .setConnectionRequestTimeout(connectTimeout) .build(); HttpClientBuilder clientBuilder = HttpClientBuilder.create() .setDefaultRequestConfig(config); if (Boolean.getBoolean(USE_SYSTEM_PROPERTIES)) { String proxyHost = System.getProperty("http.proxyHost"); Integer proxyPort = Integer.getInteger("http.proxyPort"); if (proxyHost != null && proxyPort != null) { clientBuilder.setRoutePlanner(new DefaultProxyRoutePlanner(new HttpHost(proxyHost, proxyPort))); } clientBuilder.useSystemProperties(); } return clientBuilder.build(); } else { DefaultHttpClient httpClient = new DefaultHttpClient(); httpClient.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, readTimeout); httpClient.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectTimeout); return httpClient; } }

Target:
protected HttpClient getHttpClient(Integer readTimeout, Integer connectTimeout) { if (getDoCacheClient() && HTTP_CLIENT_API_43) { if (cachedClient == null) { cachedClient = getNewPooledHttpClient(readTimeout, connectTimeout); } return cachedClient; } if (HTTP_CLIENT_API_43) { RequestConfig config = RequestConfig.custom() .setSocketTimeout(readTimeout) .setConnectTimeout(connectTimeout) .setConnectionRequestTimeout(connectTimeout) .build(); HttpClientBuilder clientBuilder = HttpClientBuilder.create() .setDefaultRequestConfig(config); if (Boolean.getBoolean(USE_SYSTEM_PROPERTIES)) { HttpRoutePlanner routePlanner = getRoutePlanner(); if (routePlanner != null) { clientBuilder.setRoutePlanner(routePlanner); } clientBuilder.useSystemProperties(); } return clientBuilder.build(); } else { DefaultHttpClient httpClient = new DefaultHttpClient(); httpClient.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, readTimeout); httpClient.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectTimeout); if (Boolean.getBoolean(USE_SYSTEM_PROPERTIES)) { HttpRoutePlanner routePlanner = getRoutePlanner(); if (routePlanner != null) { httpClient.setRoutePlanner(routePlanner); } } return httpClient; } }
Source:
private Filter buildAttributeFilter( String attributeName, Collection<String> attributeValues, boolean isExactMatch) { if (CollectionUtils.isEmpty(attributeValues)) { return null; } List<Filter> filters = new ArrayList<>(); for (String value : attributeValues) { if (isExactMatch) { filters.add(filterBuilder.attribute(attributeName).is().equalTo().text(value)); } else { Filter f = filterBuilder.attribute(attributeName).is().like().text(value); filters.add(f); } } if (filters.size() == 1) { return filters.get(0); } else { return filterBuilder.anyOf(filters); } }

Target:
private Filter buildAttributeFilter( String attributeName, Collection<String> attributeValues, boolean isExactMatch) { if (CollectionUtils.isEmpty(attributeValues)) { return null; } List<Filter> filters = new ArrayList<>(); for (String value : attributeValues) { if (isExactMatch) { filters.add(filterBuilder.attribute(attributeName).is().equalTo().text(value)); } else { filters.add(filterBuilder.attribute(attributeName).is().like().text(value)); } } if (filters.size() == 1) { return filters.get(0); } else { return filterBuilder.anyOf(filters); } }
Source:
public GatewayErrorException(String message) { super(message); this.responseFromGateway = "null"; this.status = 0; }

Target:
public GatewayErrorException(String message) { super(message); this.responseFromGateway = "null"; this.status = null; }
Source:
void ensure_spies_are_created_for_nested_tests() { MockUtil.getMockSettings(nestedSpy); }

Target:
void ensure_spies_are_created_for_nested_tests() { assertThat(MockUtil.isSpy(nestedSpy)).isTrue(); }
Source:
public void addContentToIndex(final Contentlet content, final boolean includeDependencies, final boolean indexBeforeCommit, final boolean reindexOnly, final BulkRequestBuilder bulk) throws DotHibernateException { if (null == content || !UtilMethods.isSet(content.getIdentifier())) { return; } List<Contentlet> contentDependencies = null; final boolean indexNow = !content.isDefaultContentRefresh(); final List<Contentlet> contentToIndex = new ArrayList<>(); contentToIndex.add(content); try { if(includeDependencies){ if (indexNow) { contentDependencies = new ArrayList<>(loadDeps(content)); } else { contentToIndex.addAll(loadDeps(content)); } } if(bulk!=null || indexBeforeCommit) { if (indexNow) { this.handleIndexNow(content, reindexOnly, bulk, contentDependencies, contentToIndex, false); } else { this.indexContentList(contentToIndex, bulk, reindexOnly); } } else { if (indexNow) { this.handleIndexNow(content, reindexOnly, bulk, contentDependencies, contentToIndex, true); } else { HibernateUtil.addCommitListener(content.getInode() + ReindexRunnable.Action.ADDING, new AddReindexRunnable(contentToIndex, ReindexRunnable.Action.ADDING, bulk, reindexOnly)); } } } catch (DotDataException | DotSecurityException e1) { throw new DotHibernateException(e1.getMessage(), e1); } }

Target:
public void addContentToIndex(final Contentlet content, final boolean includeDependencies, final boolean indexBeforeCommit, final boolean reindexOnly, final BulkRequestBuilder bulk) throws DotHibernateException { if (null == content || !UtilMethods.isSet(content.getIdentifier())) { return; } List<Contentlet> contentDependencies = null; final boolean indexIsNotDefer = IndexPolicy.DEFER != content.getIndexPolicy(); final List<Contentlet> contentToIndex = new ArrayList<>(); contentToIndex.add(content); try { if(includeDependencies){ if (indexIsNotDefer) { contentDependencies = new ArrayList<>(loadDeps(content)); } else { contentToIndex.addAll(loadDeps(content)); } } if(bulk!=null || indexBeforeCommit) { if (indexIsNotDefer) { this.handleIndexNotDefer(content, reindexOnly, bulk, contentDependencies, contentToIndex, false); } else { this.indexContentList(contentToIndex, bulk, reindexOnly); } } else { if (indexIsNotDefer) { this.handleIndexNotDefer(content, reindexOnly, bulk, contentDependencies, contentToIndex, true); } else { HibernateUtil.addCommitListener(content.getInode() + ReindexRunnable.Action.ADDING, new AddReindexRunnable(contentToIndex, ReindexRunnable.Action.ADDING, bulk, reindexOnly)); } } } catch (DotDataException | DotSecurityException e1) { throw new DotHibernateException(e1.getMessage(), e1); } }
Source:
public boolean equals(Object other) { if (other == null) { return false; } if (!(other instanceof JcrResourceAdapter)) { return false; } return other == this; }

Target:
public boolean equals(Object other) { if (other == this) { return true; } if (other instanceof JcrManagedConnectionFactory) { return this == other; } return false; }
Source:
Index apply(InputStream t) throws IOException; } IndexType(final int magicNumber, final Integer tribbleIndexType, boolean canCreate, IndexFromStreamFunction createFromInputStream, final int defaultBinSize) { this.magicNumber = magicNumber; this.tribbleIndexType = tribbleIndexType; this.canCreate = canCreate; this.createFromInputStream = createFromInputStream; this.defaultBinSize = defaultBinSize; }

Target:
Index apply(InputStream t) throws IOException; } IndexType(final int magicNumber, final Integer tribbleIndexType, final boolean canCreate, final IndexFromStreamFunction createFromInputStream, final int defaultBinSize) { this.magicNumber = magicNumber; this.tribbleIndexType = tribbleIndexType; this.canCreate = canCreate; this.createFromInputStream = createFromInputStream; this.defaultBinSize = defaultBinSize; }
Source:
private Function<PollingContext<OperationResult>, Mono<OperationResult>> receiptAnalyzeActivationOperation( String sourceUrl, boolean includeTextDetails) { return (pollingContext) -> { try { return service.analyzeReceiptAsyncWithResponseAsync(includeTextDetails, new SourcePath().setSource(sourceUrl)) .map(response -> { final AnalyzeReceiptAsyncHeaders headers = response.getDeserializedHeaders(); return new OperationResult(parseModelId(headers.getOperationLocation())); }); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }

Target:
private Function<PollingContext<OperationResult>, Mono<OperationResult>> receiptAnalyzeActivationOperation( String sourceUrl, boolean includeTextDetails) { return (pollingContext) -> { try { return service.analyzeReceiptAsyncWithResponseAsync(includeTextDetails, new SourcePath().setSource(sourceUrl)) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation()))); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }
Source:
public Map<String, String> getUAMap(String uaString) { result.clear(); UserAgent browser = null; Device device = null; OS os = null; if (uaString == null) uaString = ""; try { Client c = cachingParser.parse(uaString); if (c != null) { browser = c.userAgent; device = c.device; os = c.os; } } catch (Exception e) { LOG.error(e.getMessage(), e); } if (browser != null) { result.put("browser_family", replaceNA(browser.family)); result.put("browser_major", replaceNA(browser.major)); } else { result.put("browser_family", NA); result.put("browser_major", NA); } if (device != null) { result.put("device_family", replaceNA(device.family)); } else { result.put("device_family", NA); } if (os != null) { result.put("os_family", replaceNA(os.family)); result.put("os_major", replaceNA(os.major)); result.put("os_minor", replaceNA(os.minor)); } else { result.put("os_family", NA); result.put("os_major", NA); result.put("os_minor", NA); } result.put("wmf_app_version", NA); String wmfAppStart = "WikipediaApp/"; if (uaString.startsWith(wmfAppStart)) { int from = wmfAppStart.length(); int to = uaString.indexOf(' ', from); if (to > from) result.put("wmf_app_version", uaString.substring(from, to)); else result.put("wmf_app_version", uaString.substring(from, uaString.length())); } return result; }

Target:
public Map<String, String> getUAMap(String uaString) { result.clear(); UserAgent browser = null; Device device = null; OS os = null; if (uaString == null) uaString = ""; try { Client c = cachingParser.parse(uaString); if (c != null) { browser = c.userAgent; device = c.device; os = c.os; } } catch (Exception e) { LOG.error(e.getMessage(), e); } if (browser != null) { result.put("browser_family", replaceNA(browser.family)); result.put("browser_major", replaceNA(browser.major)); } else { result.put("browser_family", NA); result.put("browser_major", NA); } if (device != null) { result.put("device_family", replaceNA(device.family)); } else { result.put("device_family", NA); } if (os != null) { result.put("os_family", replaceNA(os.family)); result.put("os_major", replaceNA(os.major)); result.put("os_minor", replaceNA(os.minor)); } else { result.put("os_family", NA); result.put("os_major", NA); result.put("os_minor", NA); } String wmfAppVersion = NA; String wmfAppStart = "WikipediaApp/"; if (uaString.startsWith(wmfAppStart)) { int from = wmfAppStart.length(); int to = uaString.indexOf(' ', from); to = (to == -1) ? uaString.length() : to; wmfAppVersion = uaString.substring(from, to); } result.put("wmf_app_version", wmfAppVersion); return result; }
Source:
public static <N, V extends Number> ValueGraph<N, V> extractFrom(ValueGraph<N, V> graph) { Set<N> remainingNodes = new HashSet<>(graph.nodes()); Map<N, NodeData<N>> nodeData = new HashMap<>(); for (N node : remainingNodes) { nodeData.put(node, new NodeData<>()); } MapBinaryHeap<N> heap = new MapBinaryHeap<>((a, b) -> Double.compare(nodeData.get(a).cost, nodeData.get(b).cost)); heap.addAll(remainingNodes); MutableValueGraph<N, V> tree = ValueGraphBuilder.directed().build(); while (!remainingNodes.isEmpty()) { N node = heap.peek(); remainingNodes.remove(node); N connectedNode = nodeData.get(node).connection; if (connectedNode == null) { tree.addNode(node); } else { tree.putEdgeValue( node, connectedNode, graph.edgeValue(node, connectedNode).orElseThrow(IllegalStateException::new)); } for (N adjacentNode : graph.adjacentNodes(node)) { if (!remainingNodes.contains(adjacentNode)) { continue; } NodeData<N> adjacentNodeData = nodeData.get(adjacentNode); double connectingEdgeWeight = graph .edgeValue(node, adjacentNode) .orElseThrow(IllegalStateException::new) .doubleValue(); if (connectingEdgeWeight < adjacentNodeData.cost) { adjacentNodeData.update(connectingEdgeWeight, node); heap.update(adjacentNode); } } } return tree; }

Target:
public static <N, V extends Number> ValueGraph<N, V> extractFrom(ValueGraph<N, V> graph) { Set<N> remainingNodes = new HashSet<>(graph.nodes()); Map<N, NodeData<N>> nodeData = new HashMap<>(); for (N node : remainingNodes) { nodeData.put(node, new NodeData<>()); } MapBinaryHeap<N> heap = new MapBinaryHeap<>((a, b) -> Double.compare(nodeData.get(a).cost, nodeData.get(b).cost)); heap.addAll(remainingNodes); MutableValueGraph<N, V> tree = ValueGraphBuilder.directed().build(); while (!remainingNodes.isEmpty()) { N node = heap.peek(); remainingNodes.remove(node); N connectedNode = nodeData.get(node).connection; if (connectedNode == null) { tree.addNode(node); } else { tree.putEdgeValue( node, connectedNode, graph .edgeValue(node, connectedNode) .orElseThrow( () -> new IllegalStateException( "unexpected exception caused by bug in graph data structures"))); } for (N adjacentNode : graph.adjacentNodes(node)) { if (!remainingNodes.contains(adjacentNode)) { continue; } NodeData<N> adjacentNodeData = nodeData.get(adjacentNode); double connectingEdgeWeight = graph .edgeValue(node, adjacentNode) .orElseThrow( () -> new IllegalStateException( "unexpected exception caused by bug in graph data structures")) .doubleValue(); if (connectingEdgeWeight < adjacentNodeData.cost) { adjacentNodeData.update(connectingEdgeWeight, node); heap.update(adjacentNode); } } } return tree; }
Source:
public void restrictedLoginDialogLinkTest() { String link = Locale.getDefault().getLanguage().equals(Locale.GERMAN.getLanguage()) ? Constants.RESTRICTED_LOGIN_LINK_GERMAN : baseActivityTestRule.getActivity().getString(R.string.schoolreg_link); Intents.init(); Matcher<Intent> expectedIntent = allOf(hasAction(Intent.ACTION_VIEW), hasData(link)); intending(expectedIntent).respondWith(new Instrumentation.ActivityResult(0, null)); Espresso.onView(ViewMatchers.withId(R.id.dialog_restricted_login_text)) .perform(ViewActions.openLinkWithText(link)); intended(expectedIntent); Intents.release(); }

Target:
public void restrictedLoginDialogLinkTest() { String link = Locale.getDefault().getLanguage().equals(Locale.GERMAN.getLanguage()) ? UiTestUtils.getResourcesString(R.string.schoolreg_link_german) : UiTestUtils.getResourcesString(R.string.schoolreg_link); Intents.init(); Matcher<Intent> expectedIntent = allOf(hasAction(Intent.ACTION_VIEW), hasData(link)); intending(expectedIntent).respondWith(new Instrumentation.ActivityResult(0, null)); Espresso.onView(ViewMatchers.withId(R.id.dialog_restricted_login_text)) .perform(ViewActions.openLinkWithText(link)); intended(expectedIntent); Intents.release(); }
Source:
public Iterable<Edge> getEdges(final Vertex otherVertex, Direction direction, String label, FetchHints fetchHints, Authorizations authorizations) { getFetchHints().validateHasEdgeFetchHints(direction); return getGraph().getEdges(getEdgeIdsWithOtherVertexId(otherVertex.getId(), direction, labelToArrayOrNull(label), authorizations), fetchHints, authorizations); }

Target:
public Iterable<Edge> getEdges(final Vertex otherVertex, Direction direction, String label, FetchHints fetchHints, Authorizations authorizations) { getFetchHints().validateHasEdgeFetchHints(direction, label); return getGraph().getEdges(getEdgeIdsWithOtherVertexId(otherVertex.getId(), direction, labelToArrayOrNull(label), authorizations), fetchHints, authorizations); }
Source:
public static void registerPermission(final String permissionNode, final int opLevel) { if (!REGISTERED_PERMISSIONS.contains(permissionNode)) { SpongeCommon.getLogger().info("Registering permission with op level {}.", permissionNode, opLevel); REGISTERED_PERMISSIONS.add(permissionNode); final PermissionService service = SpongeCommon.getGame().getServiceProvider().permissionService(); if (opLevel == 0) { service.getDefaults() .getTransientSubjectData() .setPermission(SubjectData.GLOBAL_CONTEXT, permissionNode, Tristate.TRUE); } if (service instanceof SpongePermissionService) { ((SpongePermissionService) service).getGroupForOpLevel(opLevel).getTransientSubjectData() .setPermission(SubjectData.GLOBAL_CONTEXT, permissionNode, Tristate.TRUE); } } }

Target:
public static void registerPermission(final String permissionNode, final int opLevel) { if (REGISTERED_PERMISSIONS.add(permissionNode)) { final PermissionService service = SpongeCommon.getGame().getServiceProvider().permissionService(); if (opLevel == 0) { service.getDefaults() .getTransientSubjectData() .setPermission(SubjectData.GLOBAL_CONTEXT, permissionNode, Tristate.TRUE); } if (service instanceof SpongePermissionService) { ((SpongePermissionService) service).getGroupForOpLevel(opLevel).getTransientSubjectData() .setPermission(SubjectData.GLOBAL_CONTEXT, permissionNode, Tristate.TRUE); } } }
Source:
public String getRelativePath() { String path = getPath(); if (path.startsWith("/")) { path = path.substring(1); } return path; }

Target:
public String getRelativePath() { String path = getPath(); return path.startsWith("/") ? path.substring(1) : path; }
Source:
OffPeakHoursImpl(int startHour, int endHour) { this.startHour = startHour; this.endHour = endHour; LOG.info(this.toString()); }

Target:
OffPeakHoursImpl(int startHour, int endHour) { this.startHour = startHour; this.endHour = endHour; }
Source:
protected Session getSession() { SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); return sessionFactory.openSession(); }

Target:
protected Session getSession() { return HibernateUtil.getSessionFactory().openSession(); }
Source:
public List<Consumer> getHypervisorsBulk(Collection<String> hypervisorIds, String ownerKey) { if (hypervisorIds == null || hypervisorIds.isEmpty()) { return new LinkedList<Consumer>(); } LinkedList<String> hypervisorIdsUpper = new LinkedList<String>(); for (String hypervisorId : hypervisorIds) { hypervisorIdsUpper.add(hypervisorId.toUpperCase()); } String query = "SELECT c FROM Consumer c WHERE" + "(c.owner.key = :ownerKey AND UPPER(c.hypervisorId.hypervisorId) IN (:hypervisorIds))" + "ORDER BY c.hypervisorId.hypervisorId ASC"; List<Consumer> consumers = getEntityManager().createQuery(query) .setLockMode(LockModeType.PESSIMISTIC_WRITE) .setParameter("ownerKey", ownerKey) .setParameter("hypervisorIds", hypervisorIdsUpper) .getResultList(); return consumers; }

Target:
public List<Consumer> getHypervisorsBulk(Collection<String> hypervisorIds, String ownerKey) { if (hypervisorIds == null || hypervisorIds.isEmpty()) { return new LinkedList<Consumer>(); } LinkedList<String> hypervisorIdsUpper = new LinkedList<String>(); for (String hypervisorId : hypervisorIds) { hypervisorIdsUpper.add(hypervisorId.toUpperCase()); } List<Consumer> consumers = new LinkedList<Consumer>(); String query = "SELECT c FROM Consumer c WHERE " + "(c.owner.key = :ownerKey AND UPPER(c.hypervisorId.hypervisorId) IN (:hypervisorIds)) " + "ORDER BY c.hypervisorId.hypervisorId ASC"; javax.persistence.Query q = getEntityManager().createQuery(query); java.util.Collections.sort(hypervisorIdsUpper); int fromIndex = 0; int toIndex = fromIndex + MAX_IN_QUERY_LENGTH; while (fromIndex < hypervisorIdsUpper.size()) { if (toIndex > hypervisorIdsUpper.size()) { toIndex = hypervisorIdsUpper.size(); } List<String> subList = hypervisorIdsUpper.subList(fromIndex, toIndex); q.setLockMode(LockModeType.PESSIMISTIC_WRITE); q.setParameter("ownerKey", ownerKey); q.setParameter("hypervisorIds", subList); consumers.addAll(q.getResultList()); fromIndex = toIndex; toIndex += MAX_IN_QUERY_LENGTH; } return consumers; }
Source:
protected SelectionAdapter createMandatoryAttributesSelectionListener(final IObservableSet checkedElements) { return new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { checkMandatoryAttributes(checkedElements, mappings); } protected void checkMandatoryAttributes(final IObservableSet checkedElements, final List<FieldToContractInputMapping> mappings) { for (final FieldToContractInputMapping mapping : mappings) { if (!mapping.getField().isNullable() && !mapping.isGenerated()) { checkedElements.add(mapping); checkAllMappings(checkedElements, mapping.getChildren()); generateAllMappings(mapping.getChildren(), true); if (mapping.getParent() != null && !checkedElements.contains(mapping.getParent())) { checkedElements.add(mapping.getParent()); } } checkMandatoryAttributes(checkedElements, mapping.getChildren()); } } }; }

Target:
protected SelectionAdapter createMandatoryAttributesSelectionListener(final IObservableSet checkedElements) { return new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { checkMandatoryAttributes(checkedElements, mappings); } protected void checkMandatoryAttributes(final IObservableSet checkedElements, final List<FieldToContractInputMapping> mappings) { for (final FieldToContractInputMapping mapping : mappings) { final List<FieldToContractInputMapping> mappingChildren = mapping.getChildren(); if (!mapping.getField().isNullable() && !mapping.isGenerated()) { checkedElements.add(mapping); mapping.setGenerated(true); checkAllMappings(checkedElements, mappingChildren); generateAllMappings(mappingChildren, true); } if (mapping.isGenerated()) { checkMandatoryAttributes(checkedElements, mappingChildren); checkMandatoryAttributes(checkedElements, mappingChildren); } } } }; }
Source:
public void updatePermissionWithExclusiveConsumer(String queueName, QueueRolePermission[] queueRolePermissionsDTO, boolean exclusiveConsumerUpdate) throws BrokerManagerAdminException{ QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance() .getQueueManagerService(); try { queueManagerService.updateExclusiveConsumerValue(queueName, exclusiveConsumerUpdate); } catch (QueueManagerException e) { e.printStackTrace(); } updatePermission(queueName, queueRolePermissionsDTO); }

Target:
public void updatePermissionWithExclusiveConsumer(String queueName, QueueRolePermission[] queueRolePermissionsDTO, boolean exclusiveConsumerUpdate) throws BrokerManagerAdminException, QueueManagerException { QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance() .getQueueManagerService(); try { queueManagerService.updateExclusiveConsumerValue(queueName, exclusiveConsumerUpdate); updatePermission(queueName, queueRolePermissionsDTO); } catch (QueueManagerException e) { log.error("Error in updating exclusive consumer value", e); throw new BrokerManagerAdminException("Error in updating exclusive consumer value.", e); } }
Source:
public XformParser getParser(ConfigurationType type) { switch (type) { case ONA: return new XformParserODK(); case ODK: return new XformParserODK(); case KOBO: return new XformParserKobo(); default: return null; } }

Target:
public XformParser getParser(ConfigurationType type) throws ConfigurationTypeException { switch (type) { case ONA: return new XformParserODK(); case ODK: return new XformParserODK(); case KOBO: return new XformParserKobo(); default: throw new ConfigurationTypeException("No parser for configuration type: " + type); } }