auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetAllStoreNoMatchCacheAccessExceptionBeforeLoaderAllFailWithBulkCacheLoadingException() throws Exception { final FakeStore fakeStore = new FakeStore(getEntryMap(KEY_SET_B)); this.store = spy(fakeStore); doThrow(new CacheAccessException("")).when(this.store) .bulkComputeIfAbsent(getAnyStringSet(), getAnyIterableFunction()); final FakeCacheLoaderWriter fakeLoader = new FakeCacheLoaderWriter(TEST_ENTRIES, true); this.loaderWriter = spy(fakeLoader); final Ehcache<String, String> ehcache = this.getEhcache(this.loaderWriter); try { ehcache.getAll(KEY_SET_A); fail(); } catch (BulkCacheLoadingException e) { assertThat(e.getSuccesses().keySet(), empty()); assertThat(e.getFailures().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_A)); } final InOrder ordered = inOrder(this.loaderWriter, this.spiedResilienceStrategy); verify(this.store).bulkComputeIfAbsent(eq(KEY_SET_A), getAnyIterableFunction()); ordered.verify(this.loaderWriter, atLeast(1)).loadAll(this.loadAllCaptor.capture()); assertThat(this.getLoadAllArgs(), equalTo(KEY_SET_A)); ordered.verify(this.spiedResilienceStrategy) .getAllFailure(eq(KEY_SET_A), any(CacheAccessException.class), this.bulkExceptionCaptor.capture()); assertThat(this.bulkExceptionCaptor.getValue().getSuccesses().keySet(), empty()); assertThat(this.bulkExceptionCaptor.getValue().getFailures().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_A)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.CacheLoadingOutcome.class)); }

Target:
public void testGetAllStoreNoMatchCacheAccessExceptionBeforeLoaderAllFailWithBulkCacheLoadingException() throws Exception { final FakeStore fakeStore = new FakeStore(getEntryMap(KEY_SET_B)); this.store = spy(fakeStore); doThrow(new CacheAccessException("")).when(this.store) .bulkComputeIfAbsent(getAnyStringSet(), getAnyIterableFunction()); final FakeCacheLoaderWriter fakeLoader = new FakeCacheLoaderWriter(TEST_ENTRIES, KEY_SET_A, true); this.loaderWriter = spy(fakeLoader); final Ehcache<String, String> ehcache = this.getEhcache(this.loaderWriter); try { ehcache.getAll(KEY_SET_A); fail(); } catch (BulkCacheLoadingException e) { assertThat(e.getSuccesses().keySet(), empty()); assertThat(e.getFailures().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_A)); } final InOrder ordered = inOrder(this.loaderWriter, this.spiedResilienceStrategy); verify(this.store).bulkComputeIfAbsent(eq(KEY_SET_A), getAnyIterableFunction()); ordered.verify(this.loaderWriter, atLeast(1)).loadAll(this.loadAllCaptor.capture()); assertThat(this.getLoadAllArgs(), equalTo(KEY_SET_A)); ordered.verify(this.spiedResilienceStrategy) .getAllFailure(eq(KEY_SET_A), any(CacheAccessException.class), this.bulkExceptionCaptor.capture()); verifyBulkLoadingException(this.bulkExceptionCaptor.getValue(), Collections.<String> emptySet(), KEY_SET_A); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.CacheLoadingOutcome.class)); }
Source:
protected void label(Namespace namespace, Map<String, String> ensureLabels) throws InfrastructureException { if (ensureLabels.isEmpty()) { return; } Map<String, String> currentLabels = namespace.getMetadata().getLabels(); Map<String, String> newLabels = currentLabels != null ? new HashMap<>(currentLabels) : new HashMap<>(); if (newLabels.entrySet().containsAll(ensureLabels.entrySet())) { LOG.debug( "Nothing to do, namespace already has all required labels.", namespace.getMetadata().getName()); return; } try { cheSAClientFactory .create() .namespaces() .createOrReplace( new NamespaceBuilder(namespace) .editMetadata() .addToLabels(ensureLabels) .endMetadata() .build()); } catch (KubernetesClientException kce) { if (kce.getCode() == 403) { LOG.warn( "Can't label the namespace due to lack of permissions. Grant to `che` ServiceAccount " + "cluster-wide permissions to `get` and `update` the `namespaces` " + "(there might be `che-namespace-editor` ClusterRole prepared for this). " + "Or consider disabling the feature with setting " + "`che.infra.kubernetes.namespace.label=false`"); return; } throw new InfrastructureException(kce); } }

Target:
protected void label(Namespace namespace, Map<String, String> ensureLabels) throws InfrastructureException { if (ensureLabels.isEmpty()) { return; } Map<String, String> currentLabels = namespace.getMetadata().getLabels(); Map<String, String> newLabels = currentLabels != null ? new HashMap<>(currentLabels) : new HashMap<>(); if (newLabels.entrySet().containsAll(ensureLabels.entrySet())) { LOG.debug( "Nothing to do, namespace already has all required labels.", namespace.getMetadata().getName()); return; } try { cheSAClientFactory .create() .namespaces() .createOrReplace( new NamespaceBuilder(namespace) .editMetadata() .addToLabels(ensureLabels) .endMetadata() .build()); } catch (KubernetesClientException kce) { if (kce.getCode() == 403) { LOG.warn( "Can't label the namespace due to lack of permissions. Grant cluster-wide permissions " + "to `get` and `update` the `namespaces` to the `che` service account " + "(Che operator might have already prepared a cluster role called " + "`che-namespace-editor` for this, depending on its configuration). " + "Alternatively, consider disabling the feature by setting " + "`che.infra.kubernetes.namepsace.label` to `false`."); return; } throw new InfrastructureException(kce); } }
Source:
protected HttpResponse get(String url) { return get(url, Maps.<String,String>newHashMap()); }

Target:
protected HttpResponse get(String url) { return get(url, Collections.<String,String>emptyMap()); }
Source:
public List<ACGroup> getGroups(SessionId sessionId, ACOrgUnitId orgUnitId) throws ESException { checkForNulls(sessionId, orgUnitId); getAccessControl().getAuthorizationService().checkProjectAdminAccess( sessionId.toAPI(), null); final List<ACGroup> result = new ArrayList<ACGroup>(); final ACOrgUnit<?> orgUnit = getOrgUnit(orgUnitId); for (final ACGroup group : getGroups()) { if (group.getMembers().contains(orgUnit)) { final ACGroup copy = ModelUtil.clone(group); clearMembersFromGroup(copy); result.add(copy); } } return result; }

Target:
public List<ACGroup> getGroups(SessionId sessionId, ACOrgUnitId orgUnitId) throws ESException { checkForNulls(sessionId, orgUnitId); getAccessControl().getAuthorizationService().checkProjectAdminAccess( sessionId.toAPI(), null); final List<ACGroup> result = new ArrayList<ACGroup>(); final ACOrgUnit<?> orgUnit = getOrgUnit(orgUnitId); for (final ACGroup group : getGroups()) { if (group.getMembers().contains(orgUnit)) { final ACGroup copy = ModelUtil.clone(group); clearMembersFromGroup(copy); result.add(copy); } } return removeInvisibleOrgUnits(result, sessionId.toAPI()); }
Source:
public PropertiesExpander(Properties properties) { if (properties == null) { throw new IllegalArgumentException("cannot pass null"); } values = new HashMap<>(properties.size()); for (Enumeration<?> e = properties.propertyNames(); e.hasMoreElements();) { final String name = (String) e.nextElement(); String val = properties.getProperty(name); val = resolveValue(properties, name, val, new HashSet<>()); values.put(name, val); } }

Target:
public PropertiesExpander(Properties properties) { if (properties == null) { throw new IllegalArgumentException("cannot pass null"); } values = new HashMap<>(properties.size()); for (Enumeration<?> e = properties.propertyNames(); e.hasMoreElements();) { final String name = (String) e.nextElement(); String value = properties.getProperty(name); value = resolveValue(properties, name, value, new HashSet<>()); values.put(name, value); } }
Source:
public void visitSwitchStatement(SwitchStatementTree tree) { Set<Tree> caseExpressions = new HashSet<>(); CaseClauseTree lastCaseClause = null; for (CaseClauseTree caseClause : Iterables.filter(tree.cases(), CaseClauseTree.class)) { addCaseExpression(caseExpressions, caseClause.expression()); lastCaseClause = caseClause; } Map<Tree, CfgBlock> caseClauseBlocksByTree = caseClauseBlocksByTree(tree); SwitchClauseTree previousClauseWithStatement = null; for (SwitchClauseTree switchClause : tree.cases()) { if (previousClauseWithStatement != null) { CfgBlock caseBlock; if (switchClause.is(Kind.CASE_CLAUSE)) { caseBlock = ControlFlowGraph.trueSuccessorFor(caseClauseBlocksByTree.get(switchClause)); } else { caseBlock = ControlFlowGraph.falseSuccessorFor(caseClauseBlocksByTree.get(lastCaseClause)); } if (canBeFallenInto(switchClause, caseBlock, caseExpressions) || hasOnlyEmptyStatements(previousClauseWithStatement)) { addIssue(previousClauseWithStatement.keyword(), MESSAGE); } } if (!switchClause.statements().isEmpty()) { previousClauseWithStatement = switchClause; } } super.visitSwitchStatement(tree); }

Target:
public void visitSwitchStatement(SwitchStatementTree tree) { Set<Tree> caseExpressions = new HashSet<>(); CaseClauseTree lastCaseClause = null; for (CaseClauseTree caseClause : Iterables.filter(tree.cases(), CaseClauseTree.class)) { addCaseExpression(caseExpressions, caseClause.expression()); lastCaseClause = caseClause; } Map<CaseClauseTree, CfgBranchingBlock> caseClauseBlocksByTree = caseClauseBlocksByTree(tree); SwitchClauseTree previousClauseWithStatement = null; for (SwitchClauseTree switchClause : tree.cases()) { if (previousClauseWithStatement != null) { CfgBlock firstBlockInClauseBody; if (switchClause.is(Kind.CASE_CLAUSE)) { firstBlockInClauseBody = caseClauseBlocksByTree.get(switchClause).trueSuccessor(); } else { firstBlockInClauseBody = caseClauseBlocksByTree.get(lastCaseClause).falseSuccessor(); } if (canBeFallenInto(switchClause, firstBlockInClauseBody, caseExpressions) || hasOnlyEmptyStatements(previousClauseWithStatement)) { addIssue(previousClauseWithStatement.keyword(), MESSAGE); } } if (!switchClause.statements().isEmpty()) { previousClauseWithStatement = switchClause; } } super.visitSwitchStatement(tree); }
Source:
public Filter getFilter() { BooleanQuery query = new BooleanQuery(); BooleanClause.Occur clause = (term.startsWith("-")) ? BooleanClause.Occur.MUST_NOT : BooleanClause.Occur.SHOULD; if (clause == BooleanClause.Occur.MUST_NOT) { query.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST); term = term.substring(1); } if (value instanceof List) { List values = (List) value; for (Object value : values) { query.add(new TermQuery(new Term(term, value.toString())), clause); } } else { query.add(new TermQuery(new Term(term, value.toString())), clause); } return new CachingWrapperFilter(new QueryWrapperFilter(query)); }

Target:
public Filter getFilter() { BooleanQuery query = new BooleanQuery(); for (Map.Entry<String, Object> entry : fieldMap.entrySet()) { String field = entry.getKey(); Object value = entry.getValue(); if (value.getClass().isArray()) { BooleanQuery arrayQuery = new BooleanQuery(); BooleanClause.Occur clause = (field.startsWith("-")) ? BooleanClause.Occur.MUST_NOT : BooleanClause.Occur.SHOULD; if (clause == BooleanClause.Occur.MUST_NOT) { arrayQuery.add(new MatchAllDocsQuery(), BooleanClause.Occur.MUST); field = field.substring(1); } Object[] values = (Object[]) value; for (Object val : values) { arrayQuery.add(new TermQuery(new Term(field, val.toString())), clause); } query.add(arrayQuery, BooleanClause.Occur.MUST); } else { query.add(new TermQuery(new Term(field, value.toString())), BooleanClause.Occur.MUST); } } return new CachingWrapperFilter(new QueryWrapperFilter(query)); }
Source:
public void visitJavadocToken(DetailNode detailNode) { final DetailNode textNode; if (detailNode.getType() == JavadocTokenTypes.JAVADOC) { textNode = JavadocUtil.getFirstChild(detailNode); } else { textNode = JavadocUtil.getNextSibling(detailNode); } if (textNode != null && textNode.getType() != JavadocTokenTypes.EOF) { checkWhitespaceAfterAsterisk(textNode); } }

Target:
public void visitJavadocToken(DetailNode detailNode) { final DetailNode textNode; if (detailNode.getType() == JavadocTokenTypes.JAVADOC) { textNode = JavadocUtil.getFirstChild(detailNode); } else { textNode = JavadocUtil.getNextSibling(detailNode); } if (textNode != null && textNode.getType() != JavadocTokenTypes.EOF) { final String text = textNode.getText(); final int lastAsteriskPosition = getLastLeadingAsteriskPosition(text); if (!isLast(lastAsteriskPosition, text) && !Character.isWhitespace(text.charAt(lastAsteriskPosition + 1))) { log(textNode.getLineNumber(), textNode.getColumnNumber(), MSG_KEY); } } }
Source:
private void saveTag(String property, String value) { if (!Core.METACARD_TAGS.equals(property)) { LOGGER.trace("Property \"{}\" and value '{}' do not concern metacard tags", property, value); reportNonTagEncountered(); return; } if (StringUtils.isBlank(value)) { LOGGER.debug("Found blank string in query on metacard tags field \"{}\", ignoring", property); return; } Consumer<String> tagUpdateFunction = ruleDeque.isEmpty() ? tags::add : ruleDeque.peekFirst()::foundTag; tagUpdateFunction.accept(value); }

Target:
private void saveTag(String property, String value) { if (!Core.METACARD_TAGS.equals(property)) { LOGGER.trace("Property \"{}\" and value '{}' do not concern metacard tags", property, value); reportNonTagEncountered(); return; } if (StringUtils.isBlank(value)) { LOGGER.debug("Found blank string in query on metacard tags field \"{}\", ignoring", property); return; } if (rules.isEmpty()) { tags.add(value); } else { rules.peekFirst().foundTag(value); } }
Source:
public boolean subscription() throws IOException { return Boolean.parseBoolean( this.item.get(DyFriends.ATTR_SUBSCRIPTION).getS() ); }

Target:
public boolean subscription() throws IOException { boolean subs = true; if (this.item.has(DyFriends.ATTR_SUBSCRIPTION)) { subs = Boolean.parseBoolean( this.item.get(DyFriends.ATTR_SUBSCRIPTION).getS() ); } return subs; }
Source:
public Optional<ExecutionResult> compare(FileElement localFile, FileElement remoteFile, Optional<String> toolName, Optional<Boolean> prompt, boolean gui, Optional<Boolean> trustExitCode, PromptContinueHandler promptHandler, InformNoToolHandler noToolHandler) throws ToolException { String toolNameToUse; if (toolName.isPresent()) { toolNameToUse = toolName.get(); } else { toolNameToUse = getDefaultToolName(gui); } if (StringUtils.isEmptyOrNull(toolNameToUse)) { throw new ToolException( "No tool provided and no defaults configured."); } @SuppressWarnings("boxing") boolean doPrompt = prompt.orElse(isInteractive()); if (doPrompt) { if (!promptHandler.prompt(toolNameToUse)) { return Optional.empty(); } } @SuppressWarnings("boxing") boolean trust = trustExitCode.orElse(config.isTrustExitCode()); return Optional.of( compare(localFile, remoteFile, getTool(toolNameToUse), trust)); }

Target:
public Optional<ExecutionResult> compare(FileElement localFile, FileElement remoteFile, Optional<String> toolName, Optional<Boolean> prompt, boolean gui, Optional<Boolean> trustExitCode, PromptContinueHandler promptHandler, InformNoToolHandler noToolHandler) throws ToolException { String toolNameToUse; if (toolName.isPresent()) { toolNameToUse = toolName.get(); } else { toolNameToUse = getDefaultToolName(gui); } if (StringUtils.isEmptyOrNull(toolNameToUse)) { throw new ToolException(JGitText.get().diffToolNotGivenError); } @SuppressWarnings("boxing") boolean doPrompt = prompt.orElse(isInteractive()); if (doPrompt) { if (!promptHandler.prompt(toolNameToUse)) { return Optional.empty(); } } @SuppressWarnings("boxing") boolean trust = trustExitCode.orElse(config.isTrustExitCode()); return Optional.of( compare(localFile, remoteFile, getTool(toolNameToUse), trust)); }
Source:
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { final String workspaceId = identity.getWorkspaceId(); if (EphemeralWorkspaceUtility.isEphemeral(k8sEnv.getAttributes())) { ephemeralWorkspaceAdapter.provision(k8sEnv, identity); return; } log.debug("Provisioning PVC strategy for workspace '{}'", workspaceId); final Set<String> subPaths = new HashSet<>(); prefixVolumeMountsSubpaths(k8sEnv, identity.getWorkspaceId(), subPaths); String commonPVCName = getCommonPVCName(identity); final PersistentVolumeClaim commonPVC = newPVC(commonPVCName, pvcAccessMode, pvcQuantity); k8sEnv.getPersistentVolumeClaims().clear(); k8sEnv.getPersistentVolumeClaims().put(commonPVCName, commonPVC); replacePodsVolumesWithCommon(k8sEnv.getPodsData(), commonPVCName); provisionCheVolumes(k8sEnv, workspaceId, commonPVCName, subPaths); if (preCreateDirs && !subPaths.isEmpty()) { commonPVC.setAdditionalProperty( format(SUBPATHS_PROPERTY_FMT, workspaceId), subPaths.toArray(new String[subPaths.size()])); } log.debug("PVC strategy provisioning done for workspace '{}'", workspaceId); }

Target:
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException { final String workspaceId = identity.getWorkspaceId(); if (EphemeralWorkspaceUtility.isEphemeral(k8sEnv.getAttributes())) { ephemeralWorkspaceAdapter.provision(k8sEnv, identity); return; } log.debug("Provisioning PVC strategy for workspace '{}'", workspaceId); prefixVolumeMountsSubpaths(k8sEnv, identity.getWorkspaceId()); PersistentVolumeClaim commonPVC = replacePVCsWithCommon(k8sEnv, identity); replacePodsVolumesWithCommon(k8sEnv.getPodsData(), commonPVC.getMetadata().getName()); provisionCheVolumes(k8sEnv, workspaceId, commonPVC.getMetadata().getName()); if (preCreateDirs) { Set<String> subPaths = combineVolumeMountsSubpaths(k8sEnv); if (!subPaths.isEmpty()) { commonPVC.setAdditionalProperty( format(SUBPATHS_PROPERTY_FMT, workspaceId), subPaths.toArray(new String[subPaths.size()])); } } log.debug("PVC strategy provisioning done for workspace '{}'", workspaceId); }
Source:
protected String runTask() throws Exception { List<String> compactionKeyspaces = new ArrayList<String>(); final Map<String, List<String>> columnFamilyFilter = updateCompactionCFList(config); if (columnFamilyFilter == null || columnFamilyFilter.isEmpty()) { logger.warn("No op on requested \"compaction\" as there are no keyspaces."); return compactionKeyspaces.toString(); } for (Map.Entry<String, List<String>> entry : columnFamilyFilter.entrySet()) { String keyspace = entry.getKey(); List<String> columnfamilies = entry.getValue(); if (!cassandraOperations.getKeyspaces().contains(keyspace)) { logger.error("Keyspace: configured for compaction does not exist!", keyspace); continue; } if (SchemaConstant.isSystemKeyspace(keyspace)) continue; try { if (columnfamilies == null || columnfamilies.isEmpty()) cassandraOperations.forceKeyspaceCompaction(keyspace, null); else for (String columnfamily : columnfamilies) { try { cassandraOperations.forceKeyspaceCompaction(keyspace, columnfamily); } catch (IOException | InterruptedException | ExecutionException e) { throw new Exception("Exception while compacting keyspace: " + keyspace + ", columnfamily: " + columnfamily, e); } } compactionKeyspaces.add(keyspace); } catch (Exception e) { throw new Exception("Exception while compacting keyspace: " + keyspace, e); } } return compactionKeyspaces.toString(); }

Target:
protected String runTask() throws Exception { final Map<String, List<String>> columnfamilies = getCompactionFilterCfs(config); if (!columnfamilies.isEmpty()) for (Map.Entry<String, List<String>> entry : columnfamilies.entrySet()) { cassandraOperations.forceKeyspaceCompaction(entry.getKey(), entry.getValue().toArray(new String[0])); } return columnfamilies.toString(); }
Source:
static void finishOperation(final long extraDataCounter) { if (!trackTime) { return; } final Queue<TimerEntry> queue = TIMER_ENTRIES.get(); final TimerEntry timerEntry = queue.remove(); TimedResult result = ACCUMULATED_RESULTS.get(timerEntry.operation); if (result == null) { ACCUMULATED_RESULTS.putIfAbsent(timerEntry.operation, new TimedResult()); result = ACCUMULATED_RESULTS.get(timerEntry.operation); } final long delta = result.accumulate(timerEntry, extraDataCounter); if (!queue.isEmpty()) { queue.peek().inNestedOperations += delta; } }

Target:
static void finishOperation(final long extraDataCounter) { if (!trackTime) { return; } final Queue<TimerEntry> queue = TIMER_ENTRIES.get(); final TimerEntry timerEntry = queue.remove(); TimedResult result = ACCUMULATED_RESULTS.get(timerEntry.operation); if (result == null) { ACCUMULATED_RESULTS.putIfAbsent(timerEntry.operation, new TimedResult()); result = ACCUMULATED_RESULTS.get(timerEntry.operation); } final long delta = result.accumulate(timerEntry, extraDataCounter); if (!queue.isEmpty()) { queue.peek().inNestedOperationsNanos += delta; } }
Source:
public GeoNearOperation(NearQuery nearQuery, String distanceField) { Assert.notNull(nearQuery); Assert.notNull(distanceField, "DistanceField must not be null."); this.nearQuery = nearQuery; this.distanceField = distanceField; }

Target:
public GeoNearOperation(NearQuery nearQuery, String distanceField) { Assert.notNull(nearQuery, "NearQuery must not be null."); Assert.hasLength(distanceField, "DistanceField must not be null or empty."); this.nearQuery = nearQuery; this.distanceField = distanceField; }
Source:
public void testBug477090() throws CorruptObjectException { checker.setSafeForMacOS(true); final byte[] bytes = { (byte) 0xE2, (byte) 0x88, (byte) 0x9E, 0x2E, 0x68, 0x74, 0x6D, 0x6C }; checker.checkPathSegment(bytes, 0, bytes.length); }

Target:
public void testBug477090() throws CorruptObjectException { checker.setSafeForMacOS(true); final byte[] bytes = { (byte) 0xe2, (byte) 0x88, (byte) 0x9e, 0x2e, 0x68, 0x74, 0x6d, 0x6c }; checker.checkPathSegment(bytes, 0, bytes.length); }
Source:
protected abstract String[] doGetExternalRoleListOfUser(String userName, String filter) throws UserStoreException; protected abstract String[] doGetSharedRoleListOfUser(String userName, String tenantDomain, String filter) throws UserStoreException; protected abstract void doAddRole(String roleName, String[] userList, boolean shared) throws UserStoreException; protected abstract void doDeleteRole(String roleName) throws UserStoreException; protected abstract void doUpdateRoleName(String roleName, String newRoleName) throws UserStoreException; protected abstract String[] doGetRoleNames(String filter, int maxItemLimit) throws UserStoreException; protected abstract String[] doListUsers(String filter, int maxItemLimit) throws UserStoreException; public abstract Long doCountClaims(String claimURI, String valueFilter) throws UserStoreException; protected abstract String[] doGetDisplayNamesForInternalRole(String[] userNames) throws UserStoreException; private boolean validateUserNameAndCredential(String userName, Object credential) throws UserStoreException { boolean isValid = true; if (userName == null || credential == null) { String message = String.format(ErrorMessages.ERROR_CODE_ERROR_WHILE_PRE_AUTHENTICATION.getMessage(), "Authentication failure. Either Username or Password is null"); handleOnAuthenticateFailure(ErrorMessages.ERROR_CODE_ERROR_WHILE_PRE_AUTHENTICATION.getCode(), message, userName, credential); log.error(message); isValid = false; } return isValid; }

Target:
protected abstract String[] doGetExternalRoleListOfUser(String userName, String filter) throws UserStoreException; protected abstract String[] doGetSharedRoleListOfUser(String userName, String tenantDomain, String filter) throws UserStoreException; protected abstract void doAddRole(String roleName, String[] userList, boolean shared) throws UserStoreException; protected abstract void doDeleteRole(String roleName) throws UserStoreException; protected abstract void doUpdateRoleName(String roleName, String newRoleName) throws UserStoreException; protected abstract String[] doGetRoleNames(String filter, int maxItemLimit) throws UserStoreException; protected abstract String[] doListUsers(String filter, int maxItemLimit) throws UserStoreException; public long doCountUsersWithClaims(String claimURI, String valueFilter) throws UserStoreException { throw new UserStoreException("Operation is not supported"); }
Source:
private void updateDisplay() { if (!isAdded() || getView() == null) { return; } boolean hasThemes = getAdapter().getUnfilteredCount() > 0; boolean hasVisibleThemes = getAdapter().getCount() > 0; boolean hasNoMatchingThemes = hasThemes && !hasVisibleThemes; mNoThemesView.setVisibility(!hasThemes ? RelativeLayout.VISIBLE : RelativeLayout.GONE); if (!hasThemes && !NetworkUtils.isNetworkAvailable(getActivity())) { mNoThemesText.setText(R.string.no_network_title); } mGridView.setVisibility(hasVisibleThemes ? RelativeLayout.VISIBLE : RelativeLayout.GONE); mNoMatchesView.setVisibility(hasNoMatchingThemes ? RelativeLayout.VISIBLE : RelativeLayout.GONE); }

Target:
private void updateDisplay() { if (!isAdded() || getView() == null) { return; } boolean hasThemes = getAdapter().getUnfilteredCount() > 0; boolean hasVisibleThemes = getAdapter().getCount() > 0; boolean hasNoMatchingThemes = hasThemes && !hasVisibleThemes; mEmptyView.setVisibility(!hasThemes ? View.VISIBLE : View.GONE); if (!hasThemes && !NetworkUtils.isNetworkAvailable(getActivity())) { mEmptyTextView.setText(R.string.no_network_title); } mGridView.setVisibility(hasVisibleThemes ? View.VISIBLE : View.GONE); mActionableEmptyView.setVisibility(hasNoMatchingThemes ? View.VISIBLE : View.GONE); }
Source:
public <T> T getAdapter(Class<T> key) { if (key.equals(IContentOutlinePage.class)) { Object object= getCompareConfiguration().getProperty(CompareConfiguration.USE_OUTLINE_VIEW); if (object instanceof Boolean && ((Boolean)object).booleanValue()) { if (fOutlinePage != null) { if (fOutlinePage.getControl() != null && fOutlinePage.getControl().isDisposed()) { fOutlinePage = null; } else { return (T) fOutlinePage; } } fOutlinePage= new CompareOutlinePage(this); return (T) fOutlinePage; } } if (key == IShowInSource.class || key == OutlineViewerCreator.class || key == IFindReplaceTarget.class) { Object input = getEditorInput(); if (input != null) { return Adapters.adapt(input, key); } } if (key == IEditorInput.class) { return (T) getEditorInput().getAdapter(IEditorInput.class); } if (key == ITextEditorExtension3.class) { return (T) getEditorInput().getAdapter(ITextEditorExtension3.class); } return super.getAdapter(key); }

Target:
public <T> T getAdapter(Class<T> key) { if (key.equals(IContentOutlinePage.class)) { Object object= getCompareConfiguration().getProperty(CompareConfiguration.USE_OUTLINE_VIEW); if (object instanceof Boolean && ((Boolean)object).booleanValue()) { if (fOutlinePage != null) { if (fOutlinePage.getControl() != null && fOutlinePage.getControl().isDisposed()) { fOutlinePage = null; } else { return (T) fOutlinePage; } } fOutlinePage= new CompareOutlinePage(this); return (T) fOutlinePage; } } if (key == IShowInSource.class || key == OutlineViewerCreator.class || key == IFindReplaceTarget.class) { Object input = getEditorInput(); if (input != null) { return Adapters.adapt(input, key); } } if (key == IEditorInput.class) { return (T) Adapters.adapt(getEditorInput(), IEditorInput.class); } if (key == ITextEditorExtension3.class) { return (T) Adapters.adapt(getEditorInput(), ITextEditorExtension3.class); } return super.getAdapter(key); }
Source:
private void initializeHandler(Thing thing) { if (isInitializable(thing)) { ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.INITIALIZING, ThingStatusDetail.NONE); setThingStatus(thing, statusInfo); initializeHandler(thing, thing.getHandler()); } else { logger.debug("Thing '{}' not initializeable, check required configuration parameters.", thing.getUID()); ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.UNINITIALIZED, ThingStatusDetail.HANDLER_CONFIGURATION_PENDING); setThingStatus(thing, statusInfo); } }

Target:
private void initializeHandler(Thing thing) { if (isInitializable(thing)) { ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.INITIALIZING, ThingStatusDetail.NONE); setThingStatus(thing, statusInfo); initializeHandler(thing, thing.getHandler()); } else { logger.debug("Thing '{}' not initializable, check required configuration parameters.", thing.getUID()); ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.UNINITIALIZED, ThingStatusDetail.HANDLER_CONFIGURATION_PENDING); setThingStatus(thing, statusInfo); } }
Source:
protected String[] addUserIdToParams(String userId, String[] params) { List<String> list = new ArrayList<String>(); list.add(Const.ParamsNames.USER_ID); list.add(userId); for (String s : params) { list.add(s); } return list.toArray(new String[list.size()]); }

Target:
protected String[] addUserIdToParams(String userId, String[] params) { List<String> list = new ArrayList<>(); list.add(Const.ParamsNames.USER_ID); list.add(userId); for (String s : params) { list.add(s); } return list.toArray(new String[list.size()]); }
Source:
public String getDisplayName() { String s = ""; if(getMetadataBlock() == null){ s = title; } else { s = BundleUtil.getStringFromPropertyFile( "datasetfieldtype."+getName()+".title" , getMetadataBlock().getName() ); } if (isHasParent() && !parentDatasetFieldType.getTitle().equals(s)) { return parentDatasetFieldType.getTitle() + " " + s; } else { return s; } }

Target:
public String getDisplayName() { String _title = ""; if(getMetadataBlock() == null){ _title = title; } else { _title = BundleUtil.getStringFromPropertyFile( "datasetfieldtype."+getName()+".title" , getMetadataBlock().getName() ); } if (isHasParent() && !parentDatasetFieldType.getTitle().equals(_title)) { return parentDatasetFieldType.getTitle() + " " + _title; } else { return _title; } }
Source:
public void arrayType() { Type type = parseType("int[]"); assertTrue(type.isArrayType()); ArrayType arrayType = type.asArrayType(); final ArrayType[] s = new ArrayType[1]; type.ifArrayType(t -> s[0] = (ArrayType)t); assertNotNull(s[0]); }

Target:
public void arrayType() { Type type = parseType("int[]"); assertTrue(type.isArrayType()); ArrayType arrayType = type.asArrayType(); final ArrayType[] s = new ArrayType[1]; type.ifArrayType(t -> s[0] = t); assertNotNull(s[0]); }
Source:
protected CertificateAndPrivateKey createCertificateAndPrivateKey() { final CertificateAndKeyPair certificateAndKeyPair = X509CertificateFactory.get(agentProxy, identity, getUser()); try { Files.createDirectories(HELIOS_HOME); final String certData = X509CertificateFactory.CERT_ENCODING .encode(certificateAndKeyPair.getCertificate().getEncoded()); final String certPem = String.format("%1$s\n%2$s\n%3$s", "-----BEGIN CERTIFICATE-----", certData, "-----END CERTIFICATE-----"); final String keyData = X509CertificateFactory.CERT_ENCODING .encode(certificateAndKeyPair.getKeyPair().getPrivate().getEncoded()); final String keyPem = String.format("%1$s\n%2$s\n%3$s", "-----BEGIN PRIVATE KEY-----", keyData, "-----END PRIVATE KEY-----"); final Set<StandardOpenOption> options = ImmutableSet.of(CREATE, WRITE); final Set<PosixFilePermission> perms = ImmutableSet.of(PosixFilePermission.OWNER_READ, PosixFilePermission.OWNER_WRITE); final FileAttribute<Set<PosixFilePermission>> attrs = PosixFilePermissions.asFileAttribute(perms); try (final SeekableByteChannel sbc = Files.newByteChannel(cacheCertrificatePath, options, attrs)) { sbc.write(ByteBuffer.wrap(certPem.getBytes())); } try (final SeekableByteChannel sbc = Files.newByteChannel(cacheKeyPath, options, attrs)) { sbc.write(ByteBuffer.wrap(keyPem.getBytes())); } log.debug("cached generated certificate to {}", cacheCertrificatePath); } catch (IOException | CertificateEncodingException e) { log.warn("error caching generated certificate - {}", e); } return CertificateAndPrivateKey.from(certificateAndKeyPair); }

Target:
protected CertificateAndPrivateKey createCertificateAndPrivateKey() { return x509CertificateFactory.get(agentProxy, identity, getUser()); }
Source:
public void goToNewsDetail(final News news) { final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getActivity()); Intent intent; boolean shouldOpenLink = pref.getBoolean(Constants.CONFIG_SHOW_LINK, true); if (pref.getBoolean(Constants.CONFIG_EXTERNAL_BROWSER, false)) { intent = new Intent(getActivity(), NewsCommentsActivity.class); boolean isURLValid = news.getUrl() != null && !news.getUrl().isEmpty(); if (shouldOpenLink && isURLValid) { new Handler().postDelayed(new Runnable() { @Override public void run() { ActionUtil.open(getActivity(), news); } }, 300); } else if (!shouldOpenLink) { intent = new Intent(getActivity(), NewsCommentsActivity.class); } } else { intent = new Intent(getActivity(), NewsDetailActivity.class); } openedNews = news; intent.putExtra(Constants.NEWS, Parcels.wrap(news)); startActivity(intent); }

Target:
public void goToNewsDetail(final News news) { final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getActivity()); Intent intent; boolean shouldOpenLink = pref.getBoolean(Constants.CONFIG_SHOW_LINK, true); if (pref.getBoolean(Constants.CONFIG_EXTERNAL_BROWSER, false)) { intent = new Intent(getActivity(), NewsCommentsActivity.class); boolean isURLValid = news.getUrl() != null && !news.getUrl().isEmpty(); if (shouldOpenLink && isURLValid) { new Handler().postDelayed(new Runnable() { @Override public void run() { ActionUtil.open(getActivity(), news); } }, 300); } } else { intent = new Intent(getActivity(), NewsDetailActivity.class); } openedNews = news; intent.putExtra(Constants.NEWS, Parcels.wrap(news)); startActivity(intent); }
Source:
public PlaintextAuthenticateRequest(final String username, final String password) { super(KEY); this.username = username; this.password = password; }

Target:
public PlaintextAuthenticateRequest(final String username, final String password) { super(KEY); this.username = checkNotNull(username); this.password = checkNotNull(password); }
Source:
public Image getSizedWebImage(URI sourceUri, int width) throws IOException { if (!new File(sourceUri).exists()) { throw new FileNotFoundException("sourceUri must exist: " + sourceUri.getRawPath()); } if (width <= 0) { throw new IllegalArgumentException("width must be > 0, but was " + Integer.toString(width)); } File tempFile = File.createTempFile("sizedWebImage-", WEB_IMAGE_FORMAT, TMPDIR); try { tempFile.deleteOnExit(); URI webImageUri = tempFile.toURI(); ImageConverter imageConverter = new ImageConverter(sourceUri); imageConverter.addResult(webImageUri).resizeToWidth(width); logger.info("Generating sized web image from as {}, width px", sourceUri, tempFile, width); imageConverter.run(); logger.trace("Loading {}", tempFile); Image buffer = ImageIO.read(tempFile); logger.trace("{} successfully loaded", tempFile); return buffer; } finally { logger.debug("Deleting {}", tempFile); tempFile.delete(); logger.trace("Successfully deleted {}", tempFile); } }

Target:
public Image getSizedWebImage(URI sourceUri, int width) throws IOException { if (!new File(sourceUri).exists()) { throw new FileNotFoundException("sourceUri must exist: " + sourceUri.getRawPath()); } if (width <= 0) { throw new IllegalArgumentException("width must be > 0, but was " + Integer.toString(width)); } return summarize("sizedWebImage-", WEB_IMAGE_FORMAT, sourceUri, λ -> λ.resizeToWidth(width), "Generating sized web image from as {}, width px", width); }
Source:
private static void checkPrintfStyle(SubscriptionContext ctx) { BinaryExpression expression = (BinaryExpression) ctx.syntaxNode(); StringLiteral formatString = extractStringLiteral(expression.leftOperand()); if (formatString == null) { return; } Optional<StringFormat> formatOptional = StringFormat.createFromPrintfStyle(ctx, expression.leftOperand(), formatString); if (!formatOptional.isPresent()) { return; } StringFormat format = formatOptional.get(); Expression rhs = expression.rightOperand(); if (format.numExpectedArguments() == 0 && (isMapping(rhs) || rhs.type().canOnlyBe("list"))) { return; } if (format.hasNamedFields()) { checkNamed(ctx, format, rhs); } else { checkPositional(ctx, format, rhs); } }

Target:
private static void checkPrintfStyle(SubscriptionContext ctx) { BinaryExpression expression = (BinaryExpression) ctx.syntaxNode(); StringLiteral formatString = extractStringLiteral(expression.leftOperand()); if (formatString == null) { return; } Optional<StringFormat> formatOptional = StringFormat.createFromPrintfStyle(ctx, expression.leftOperand(), formatString); if (!formatOptional.isPresent()) { return; } StringFormat format = formatOptional.get(); Expression rhs = expression.rightOperand(); if (format.numExpectedArguments() == 0 && (isMapping(rhs) || rhs.type().canOnlyBe(BuiltinTypes.LIST))) { return; } if (format.hasNamedFields()) { checkNamed(ctx, format, rhs); } else { checkPositional(ctx, format, rhs); } }
Source:
public ClusteringServiceConfiguration(URI clusterUri, boolean autoCreate, ServerSideConfiguration serverConfig) { this(clusterUri, DEFAULT_OPERATION_TIMEOUT, autoCreate, serverConfig); }

Target:
public ClusteringServiceConfiguration(URI clusterUri, boolean autoCreate, ServerSideConfiguration serverConfig) { this(clusterUri, Timeouts.DEFAULT, autoCreate, serverConfig); }
Source:
protected void connectAllHostsToStorage(List<String> connectionIds) { List<StorageServerConnections> connections = getDbFacade().getStorageServerConnectionDao().getByIds(connectionIds); List<VDS> hosts = getVdsDAO().getAllForStoragePool(getIscsiBond().getStoragePoolId()); for (VDS host : hosts) { if (host.getStatus() == VDSStatus.Up) { List<StorageServerConnections> conns = ISCSIStorageHelper.updateIfaces(connections, host.getId()); runVdsCommand(VDSCommandType.ConnectStorageServer, new StorageServerConnectionManagementVDSParameters(host.getId(), Guid.Empty, StorageType.ISCSI, conns) ); } } }

Target:
protected void connectAllHostsToStorage(List<String> connectionIds) { List<Callable<Void>> tasks = new ArrayList<>(); List<StorageServerConnections> connections = getDbFacade().getStorageServerConnectionDao().getByIds(connectionIds); List<VDS> hosts = getVdsDAO().getAllForStoragePoolAndStatus(getIscsiBond().getStoragePoolId(), VDSStatus.Up); for (final VDS host : hosts) { final List<StorageServerConnections> conns = ISCSIStorageHelper.updateIfaces(connections, host.getId()); tasks.add(new Callable<Void>() { @Override public Void call() throws Exception { runVdsCommand(VDSCommandType.ConnectStorageServer, new StorageServerConnectionManagementVDSParameters(host.getId(), Guid.Empty, StorageType.ISCSI, conns) ); return null; } }); } ThreadPoolUtil.invokeAll(tasks); }
Source:
public void evictExpiredEntries(int expirationPercentage) { long now = Clock.currentTimeMillis(); int maxIterationCount = getMaxIterationCount(size(), expirationPercentage); int evictedCount = 0; int maxRetry = 3; int loop = 0; while (true) { evictedCount += evictExpiredInternal(maxIterationCount, now); if (evictedCount >= maxIterationCount) { break; } loop++; if (loop > maxRetry) { break; } } }

Target:
public void evictExpiredEntries(int expirationPercentage) { long now = Clock.currentTimeMillis(); int maxIterationCount = getMaxIterationCount(size(), expirationPercentage); int evictedCount = 0; int maxRetry = 3; int loop = 0; while (loop < maxRetry) { evictedCount += evictExpiredInternal(maxIterationCount, now); if (evictedCount >= maxIterationCount) { break; } loop++; } }
Source:
public ReadLine(final String line, final String... lineTokens) { this.line = line; String[] tokens = lineTokens; if (!tokens[0].isEmpty() && tokens[0].charAt(0) == '@') { final int tsEnd = tokens[0].indexOf('@', 1); if (tsEnd > -1) { try { final long ts = Long.parseLong(tokens[0].substring(1, tsEnd)); tags.put("tsirc date", tokens[0].substring(1, tsEnd)); tokens[0] = tokens[0].substring(tsEnd + 1); } catch (final NumberFormatException nfe) { } } } if (!tokens[0].isEmpty() && tokens[0].charAt(0) == '@') { final String[] lineTags = tokens[0].substring(1).split(";"); for (final String keyVal : lineTags) { if (!keyVal.isEmpty()) { final String[] keyValue = keyVal.split("=", 2); tags.put(keyValue[0], keyValue.length > 1 ? keyValue[1] : ""); } } tokens = new String[lineTokens.length - 1]; System.arraycopy(lineTokens, 1, tokens, 0, lineTokens.length - 1); } if (!tokens[0].isEmpty() && tokens[0].charAt(0) == '@') { final int tsEnd = tokens[0].indexOf('@', 1); if (tsEnd > -1) { try { final long ts = Long.parseLong(tokens[0].substring(1, tsEnd)); tags.put("tsirc date", tokens[0].substring(1, tsEnd)); tokens[0] = tokens[0].substring(tsEnd + 1); } catch (final NumberFormatException nfe) { } } } this.tokens = tokens; }

Target:
public ReadLine(final String line, final String... lineTokens) { this.line = line; this.tokens = checkTSIRC(checkMessageTags(checkTSIRC(lineTokens))); }
Source:
public static void main(String[] args) throws IOException, EmbeddingLDAPException { ApacheDirectoryServerActivator apacheDS = new ApacheDirectoryServerActivator(); apacheDS.start(); HTTPMonitoringInterceptor httpMonitoringInterceptor = new HTTPMonitoringInterceptor(); MetricsInterceptor MetricsInterceptor = new MetricsInterceptor(); new MicroservicesRunner() .addGlobalRequestInterceptor(httpMonitoringInterceptor, MetricsInterceptor) .addGlobalResponseInterceptor(httpMonitoringInterceptor, MetricsInterceptor) .deploy(new UserAuthenticationService()) .start(); }

Target:
public static void main(String[] args) throws IOException, EmbeddingLDAPException { ApacheDirectoryServerActivator apacheDS = new ApacheDirectoryServerActivator(); apacheDS.start(); HTTPMonitoringInterceptor httpMonitoringInterceptor = new HTTPMonitoringInterceptor(); MetricsInterceptor metricsInterceptor = new MetricsInterceptor(); new MicroservicesRunner() .addGlobalRequestInterceptor(httpMonitoringInterceptor, metricsInterceptor) .addGlobalResponseInterceptor(httpMonitoringInterceptor, metricsInterceptor) .deploy(new UserAuthenticationService()) .start(); }
Source:
public static void cancelHadoopTokens(HadoopSecurityManager hadoopSecurityManager, String userToProxy, File tokenFile, Logger log) { try { hadoopSecurityManager.cancelTokens(tokenFile, userToProxy, log); } catch (HadoopSecurityManagerException e) { e.printStackTrace(); log.error(e.getCause() + e.getMessage()); } catch (Exception e) { e.printStackTrace(); log.error(e.getCause() + e.getMessage()); } }

Target:
public static void cancelHadoopTokens(HadoopSecurityManager hadoopSecurityManager, String userToProxy, File tokenFile, Logger log) { try { hadoopSecurityManager.cancelTokens(tokenFile, userToProxy, log); } catch (HadoopSecurityManagerException e) { log.error(e.getCause() + e.getMessage()); } catch (Exception e) { log.error(e.getCause() + e.getMessage()); } }
Source:
boolean isGlusterSupportEnabled() { return getVdsGroup().supportsGlusterService() && getParameters().isGlusterPeerProbeNeeded(); }

Target:
protected boolean isGlusterSupportEnabled() { return getVdsGroup().supportsGlusterService() && getParameters().isGlusterPeerProbeNeeded(); }
Source:
public void testGetRangeOfTimestampsThrowsOnError() { try { assertFalse("getRangeOfTimestamps must throw on failure", keyValueService.getRangeOfTimestamps(TEST_NONEXISTING_TABLE, RangeRequest.all(), AtlasDbConstants.MAX_TS).hasNext()); } catch (RuntimeException e) { } }

Target:
public void testGetRangeOfTimestampsThrowsOnError() { keyValueService.getRangeOfTimestamps(TEST_NONEXISTING_TABLE, RangeRequest.all(), AtlasDbConstants.MAX_TS) .hasNext(); }
Source:
private T doPut(T row, boolean needOld) throws IgniteCheckedException { checkDestroyed(); Put p = new Put(row, needOld); try { for (;;) { p.init(); Result res = putDown(p, p.rootId, 0L, p.rootLvl); switch (res) { case RETRY: case RETRY_ROOT: checkInterrupted(); continue; case FOUND: if (!p.isFinished()) { assert p.btmLvl <= getRootLevel(); checkInterrupted(); continue; } return p.oldRow; default: throw new IllegalStateException("Result: " + res); } } } catch (IgniteCheckedException | IgniteSQLException e) { throw new IgniteCheckedException("Runtime failure on row: " + row, e); } catch (RuntimeException | AssertionError e) { throw corruptedTreeException("Runtime failure on row: " + row, e, grpId, p.pageId); } finally { checkDestroyed(); } }

Target:
private T doPut(T row, boolean needOld) throws IgniteCheckedException { checkDestroyed(); Put p = new Put(row, needOld); try { for (;;) { p.init(); Result res = putDown(p, p.rootId, 0L, p.rootLvl); switch (res) { case RETRY: case RETRY_ROOT: checkInterrupted(); continue; case FOUND: if (!p.isFinished()) { assert p.btmLvl <= getRootLevel(); checkInterrupted(); continue; } return p.oldRow; default: throw new IllegalStateException("Result: " + res); } } } catch (IgniteCheckedException e) { throw new IgniteCheckedException("Runtime failure on row: " + row, e); } catch (RuntimeException | AssertionError e) { throw corruptedTreeException("Runtime failure on row: " + row, e, grpId, p.pageId); } finally { checkDestroyed(); } }
Source:
public void andThenSingleSubscribeOn() { TestSubscriber<String> ts = new TestSubscriber<String>(0); TestScheduler scheduler = new TestScheduler(); Completable.complete().andThen(Single.just("foo").delay(1, TimeUnit.SECONDS, scheduler)).subscribe(ts); ts.requestMore(1); ts.assertNoValues(); ts.assertNoTerminalEvent(); scheduler.advanceTimeBy(1, TimeUnit.SECONDS); ts.assertValue("foo"); ts.assertCompleted(); ts.assertNoErrors(); }

Target:
public void andThenSingleSubscribeOn() { TestSubscriber<String> ts = new TestSubscriber<String>(0); TestScheduler scheduler = new TestScheduler(); Completable.complete().andThen(Single.just("foo").delay(1, TimeUnit.SECONDS, scheduler)).subscribe(ts); ts.requestMore(1); ts.assertNoValues(); ts.assertNoTerminalEvent(); scheduler.advanceTimeBy(1, TimeUnit.SECONDS); ts.assertValue("foo"); ts.assertCompleted(); ts.assertNoErrors(); ts.assertUnsubscribed(); }
Source:
private void loadPaths(DeploymentType deployment) throws IOException { String voltdbRoot = (new VoltFile(deployment.getPaths().getVoltdbroot().getPath())).getCanonicalPath(); m_pathList.put(deployment.getPaths().getVoltdbroot().getKey(), voltdbRoot); File path = new VoltFile(deployment.getPaths().getCommandlog().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getCommandlog().getKey(), path.getCanonicalPath()); path = new VoltFile(deployment.getPaths().getCommandlogsnapshot().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getCommandlogsnapshot().getKey(), path.getCanonicalPath()); path = new VoltFile(deployment.getPaths().getSnapshots().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getSnapshots().getKey(), path.getCanonicalPath()); path = new VoltFile(deployment.getPaths().getExportoverflow().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getExportoverflow().getKey(), path.getCanonicalPath()); path = new VoltFile(deployment.getPaths().getDroverflow().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(deployment.getPaths().getDroverflow().getKey(), path.getCanonicalPath()); }

Target:
private void loadPaths(DeploymentType deployment) throws IOException { String voltdbRoot = (new VoltFile(deployment.getPaths().getVoltdbroot().getPath())).getCanonicalPath(); m_pathList.put(VoltDB.VOLTDBROOT_PATH_KEY, voltdbRoot); File path = new File(deployment.getPaths().getCommandlog().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.CL_PATH_KEY, path.getCanonicalPath()); path = new File(deployment.getPaths().getCommandlogsnapshot().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.CL_SNAPSHOT_PATH_KEY, path.getCanonicalPath()); path = new File(deployment.getPaths().getSnapshots().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.SNAPTHOT_PATH_KEY, path.getCanonicalPath()); path = new File(deployment.getPaths().getExportoverflow().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.EXPORT_OVERFLOW_PATH_KEY, path.getCanonicalPath()); path = new File(deployment.getPaths().getDroverflow().getPath()); if (!path.isAbsolute()) { path = new VoltFile(voltdbRoot, path.getPath()); } m_pathList.put(VoltDB.DR_OVERFLOW_PATH_KEY, path.getCanonicalPath()); }