auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testDeleteNonEmptyNonRecursiveNonUniqueStoreOnWorkspace() throws Exception { <START> removeStore("sf", "newDataStore"); END> String store1 = "aa_sf"; String store2 = "zz_sf"; createDataStore("sf", store1); createDataStore("sf", store2); List<DataStoreInfo> dataStoresByWorkspace = catalog.getDataStoresByWorkspace("sf"); assertEquals(3, dataStoresByWorkspace.size()); assertEquals( 200, deleteAsServletResponse(ROOT_PATH + "/workspaces/sf/datastores/" + store1) .getStatus()); assertEquals( 200, deleteAsServletResponse(ROOT_PATH + "/workspaces/sf/datastores/" + store2) .getStatus()); assertNull(catalog.getDataStoreByName("sf", store1)); assertNull(catalog.getDataStoreByName("sf", store2)); }</code><technical_language>Sounds this in a @Before method then</technical_language>

Target:
public void testDeleteNonEmptyNonRecursiveNonUniqueStoreOnWorkspace() throws Exception { String store1 = "aa_sf"; String store2 = "zz_sf"; createDataStore("sf", store1); createDataStore("sf", store2); try { List<DataStoreInfo> dataStoresByWorkspace = catalog.getDataStoresByWorkspace("sf"); assertEquals(3, dataStoresByWorkspace.size()); assertEquals( 200, deleteAsServletResponse(ROOT_PATH + "/workspaces/sf/datastores/" + store1) .getStatus()); assertEquals( 200, deleteAsServletResponse(ROOT_PATH + "/workspaces/sf/datastores/" + store2) .getStatus()); assertNull(catalog.getDataStoreByName("sf", store1)); assertNull(catalog.getDataStoreByName("sf", store2)); } finally { removeStore("sf", store1); removeStore("sf", store2); } }
Source:
<code>protected void addMemberCheckNull(Object member, boolean addSeparator) { ConditionalExpression cExpression= fAst.newConditionalExpression(); InfixExpression infExpression= fAst.newInfixExpression(); infExpression.setLeftOperand(createMemberAccessExpression(member, true, true)); infExpression.setRightOperand(fAst.newNullLiteral()); infExpression.setOperator(Operator.NOT_EQUALS); cExpression.setExpression(infExpression); SumExpressionBuilder builder= new SumExpressionBuilder(null); <START> for (String a : getContext().getTemplateParser().getBody()) { <END> addElement(processElement(a, member), builder); } if (addSeparator) addElement(getContext().getTemplateParser().getSeparator(), builder); cExpression.setThenExpression(builder.getExpression()); StringLiteral literal= fAst.newStringLiteral(); literal.setLiteralValue(getContext().isSkipNulls() ? "" : "null"); cExpression.setElseExpression(literal); ParenthesizedExpression pExpression= fAst.newParenthesizedExpression(); pExpression.setExpression(cExpression); toStringExpressionBuilder.addExpression(pExpression); }</code><technical_language>change s</technical_language>

Target:
protected void addMemberCheckNull(Object member, boolean addSeparator) { ConditionalExpression cExpression= fAst.newConditionalExpression(); InfixExpression infExpression= fAst.newInfixExpression(); infExpression.setLeftOperand(createMemberAccessExpression(member, true, true)); infExpression.setRightOperand(fAst.newNullLiteral()); infExpression.setOperator(Operator.NOT_EQUALS); cExpression.setExpression(infExpression); SumExpressionBuilder builder= new SumExpressionBuilder(null); for (String s : getContext().getTemplateParser().getBody()) { addElement(processElement(s, member), builder); } if (addSeparator) addElement(getContext().getTemplateParser().getSeparator(), builder); cExpression.setThenExpression(builder.getExpression()); StringLiteral literal= fAst.newStringLiteral(); literal.setLiteralValue(getContext().isSkipNulls() ? "" : "null"); cExpression.setElseExpression(literal); ParenthesizedExpression pExpression= fAst.newParenthesizedExpression(); pExpression.setExpression(cExpression); toStringExpressionBuilder.addExpression(pExpression); }
Source:
<code>protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { DiagramElementsSelectionDialog dlg = new <START> DiagramElementsSelectionDialog(Messages.SelectPinnedElementsAction_label, Messages.PinnedElementsSelectionCommand_messageTitle); <END> dlg.setSelectionPredicate(isPinned); dlg.setSelectedAction(pinElement); dlg.setDeselectedAction(unpinElement); dlg.setGrayedPredicate(getNonSelectablePredicate()); boolean executed = dlg.open(getShell(), diagram, false); if (executed) { return CommandResult.newOKCommandResult(); } else { return CommandResult.newCancelledCommandResult(); } }</code><technical_language>this constant previously in 2 methods</technical_language>

Target:
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { DiagramElementsSelectionDialog dlg = new DiagramElementsSelectionDialog(Messages.SelectPinnedElementsAction_label, Messages.PinnedElementsSelectionCommand_dialogMessage); dlg.setSelectionPredicate(isPinned); dlg.setSelectedAction(pinElement); dlg.setDeselectedAction(unpinElement); dlg.setGrayedPredicate(getNonSelectablePredicate()); boolean executed = dlg.open(getShell(), diagram, false); if (executed) { return CommandResult.newOKCommandResult(); } else { return CommandResult.newCancelledCommandResult(); } }
Source:
<code>public String convertToNormalizedHTML(String inputHTML) throws SAXException, IOException, TransformerException { DOMParser parser = new DOMParser(); Document doc = null; <START> String resultString = ""; <END> InputSource source = new InputSource(new StringReader(inputHTML)); parser.setProperty(HTMLConfig.getNamesElementFeature(), "lower"); parser.setProperty(HTMLConfig.getNamesAttrFeatures(), "lower"); parser.parse(source); doc = parser.getDocument(); doc.normalizeDocument(); Element elem = doc.getDocumentElement(); Node node = elem.getFirstChild(); while (node != null) { node = processNodeWithChildren(node, doc); node = node.getNextSibling(); } TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource DOMsource = new DOMSource(doc); ByteArrayOutputStream output = new ByteArrayOutputStream(); StreamResult result = new StreamResult(output); transformer.transform(DOMsource, result); resultString = output.toString("UTF-8"); return resultString; }</code><technical_language>This is end, right return. I eliminate this variable return output.toString("UTF-8")</technical_language>

Target:
public String convertToNormalizedHTML(String inputHTML) throws SAXException, IOException, TransformerException { DOMParser parser = new DOMParser(); InputSource source = new InputSource(new StringReader(inputHTML)); parser.setProperty(HTMLConfig.getNamesElementFeature(), "lower"); parser.setProperty(HTMLConfig.getNamesAttrFeature(), "lower"); parser.parse(source); Document doc = parser.getDocument(); doc.normalizeDocument(); Element elem = doc.getDocumentElement(); Node node = elem.getFirstChild(); while (node != null) { node = processNodeWithChildren(node, doc); node = node.getNextSibling(); } TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource DOMsource = new DOMSource(doc); ByteArrayOutputStream output = new ByteArrayOutputStream(); StreamResult result = new StreamResult(output); transformer.transform(DOMsource, result); return output.toString("UTF-8"); }
Source:
<code>public List<String> listCatalogs(String sessionid) throws SqlExecutionException { <START> return null; <END> }</code><technical_language>Collections.emptyList() UnsupportedOperationException</technical_language>

Target:
public List<String> listCatalogs(String sessionid) throws SqlExecutionException { throw new UnsupportedOperationException("Not implemented."); }
Source:
<code>public DataSharingSettings load() { <START> if (cachedSettings == null) { <END> cachedSettings = transactionTemplate.execute(status -> (DataSharingSettings) sessionFactory.getCurrentSession().getNamedQuery("load.datasharing.settings").uniqueResult()); } return cachedSettings; }</code><technical_language>need synchronize cachedSettings while setting invalidating cache, add double checking too</technical_language>

Target:
public DataSharingSettings load() { String cacheKey = cacheKeyForDataSharingSettings(); DataSharingSettings settings = (DataSharingSettings) goCache.get(cacheKey); if (settings == null) { synchronized (cacheKey) { if (settings == null) { settings = transactionTemplate.execute(status -> (DataSharingSettings) sessionFactory.getCurrentSession().getNamedQuery("load.datasharing.settings").uniqueResult()); goCache.put(cacheKey, settings); } } } return settings; }
Source:
<code>public Repository lookupRepository(final File gitDir) throws IOException { File normalizedGitDir = new Path(gitDir.getAbsolutePath()).toFile(); synchronized (repositoryCache) { Reference<Repository> r = repositoryCache.get(normalizedGitDir); Repository result = r != null ? r.get() : null; if (result == null <START> || !result.getDirectory().exists()) { result = FileRepositoryBuilder.create(normalizedGitDir); <END> repositoryCache.put(normalizedGitDir, new WeakReference<>(result)); } return result; } }</code><technical_language>if result != null, !directory.exists(), is repository instance in cache, get's overwritten. in contrast implementation is longer removed indexdiffcache. remove it, assigning new instance result, right</technical_language>

Target:
public Repository lookupRepository(final File gitDir) throws IOException { File normalizedGitDir = new Path(gitDir.getAbsolutePath()).toFile(); synchronized (repositoryCache) { Reference<Repository> r = repositoryCache.get(normalizedGitDir); if (r == null) { Repository result = FileRepositoryBuilder .create(normalizedGitDir); repositoryCache.put(normalizedGitDir, new WeakReference<>(result)); return result; } else { Repository result = r.get(); if (result != null && result.getDirectory().exists()) { return result; } else { repositoryCache.remove(normalizedGitDir); } } } IndexDiffCache cache = Activator.getDefault().getIndexDiffCache(); if (cache != null) { cache.remove(normalizedGitDir); } return lookupRepository(gitDir); }
Source:
<code>public boolean isKeyRequired() { <START> return keyParts.stream().noneMatch(k -> k.isRequired() || k.getDefaultValue() != null); <END> }</code><technical_language>if keyParts is empty? this key is required</technical_language>

Target:
public boolean isKeyRequired() { return keyParts.stream().anyMatch(ParameterModel::isRequired); }
Source:
<code>ClientMetadata(final String endPoint) { <START> hostInfo = endPoint != null ? HostInfo.buildFromEndpoint(endPoint) : null; <END> consumers = new HashSet<>(); state = new ClientState(); }</code><technical_language>nit: I feel internalize hostInfo creation, including null check: hostInfo = HostInfo.buildFromEndpoint(endPoint);</technical_language>

Target:
ClientMetadata(final String endPoint) { hostInfo = HostInfo.buildFromEndpoint(endPoint); consumers = new HashSet<>(); state = new ClientState(); }
Source:
<code>public void run() { Set<SubscriptionInfo> subscriptions = new HashSet<>(); for (Product product : products) { Collection<? extends SubscriptionInfo> subs = subAdapter .getSubscriptionsByProductId(product.getId()); log.debug("Will refresh subscriptions in all orgs using product: ", subs.size(), product.getId()); if (log.isDebugEnabled()) { for (SubscriptionInfo s : subs) { OwnerInfo so = s.getOwner(); if (so == null || so.getKey() == null) { log.debug(" Received a subscription without a well-defined owner: {}", s.getId()); continue; } if (!this.owners.containsKey(so.getKey())) { log.debug(" {}", s); } } } subscriptions.addAll(subs); } for (SubscriptionInfo subscription : subscriptions) { OwnerInfo so = subscription.getOwner(); if (so == null || so.getKey() == null) { log.error("Received a subscription without a well-defined owner: {}", subscription.getId()); continue; } if (this.owners.containsKey(so.getKey())) { log.debug("Skipping subscription \"{}\" for owner: {}", subscription.getId(), so); continue; } Pool masterPool = poolManager.convertToMasterPool(subscription); <START> masterPool.setLocked(true); <END> poolManager.refreshPoolsForMasterPool(masterPool, true, lazy, Collections.<String, Product>emptyMap()); } for (Owner owner : this.owners.values()) { poolManager.refreshPoolsWithRegeneration(this.subAdapter, owner, this.lazy); poolManager.recalculatePoolQuantitiesForOwner(owner); ownerManager.refreshContentAccessMode(this.ownerAdapter, owner); ownerManager.updateRefreshDate(owner); } }</code><technical_language>CPM handle this; places this is done explicitly, better</technical_language>

Target:
public void run() { Set<SubscriptionInfo> subscriptions = new HashSet<>(); for (Product product : products) { Collection<? extends SubscriptionInfo> subs = subAdapter .getSubscriptionsByProductId(product.getId()); log.debug("Will refresh subscriptions in all orgs using product: ", subs.size(), product.getId()); if (log.isDebugEnabled()) { for (SubscriptionInfo s : subs) { OwnerInfo so = s.getOwner(); if (so == null || so.getKey() == null) { log.debug(" Received a subscription without a well-defined owner: {}", s.getId()); continue; } if (!this.owners.containsKey(so.getKey())) { log.debug(" {}", s); } } } subscriptions.addAll(subs); } for (SubscriptionInfo subscription : subscriptions) { OwnerInfo so = subscription.getOwner(); if (so == null || so.getKey() == null) { log.error("Received a subscription without a well-defined owner: {}", subscription.getId()); continue; } if (this.owners.containsKey(so.getKey())) { log.debug("Skipping subscription \"{}\" for owner: {}", subscription.getId(), so); continue; } Pool masterPool = poolManager.convertToMasterPool(subscription); poolManager.refreshPoolsForMasterPool(masterPool, true, lazy, Collections.<String, Product>emptyMap()); } for (Owner owner : this.owners.values()) { poolManager.refreshPoolsWithRegeneration(this.subAdapter, owner, this.lazy); poolManager.recalculatePoolQuantitiesForOwner(owner); ownerManager.refreshContentAccessMode(this.ownerAdapter, owner); ownerManager.updateRefreshDate(owner); } }
Source:
<code>public IStatus validate(final IProject project, final String path) { IStatus validTrace = Status.OK_STATUS; try { final CTFTrace temp = new CTFTrace(path); if (!temp.majortIsSet()) { validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_MajorNotSet); } else { CTFTraceReader ctfTraceReader = new CTFTraceReader(temp); if (!ctfTraceReader.hasMoreEvents()) { validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_NoEvent); } ctfTraceReader.dispose(); } temp.dispose(); } catch (final CTFReaderException e) { validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_ReadingError +": " + e.toString()); } catch (final BufferOverflowException e){ <START> validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_ReadingError +": " + Messages.CtfTmfTrace_bufferOverflowErrorMessage ); END> } return validTrace; }</code><technical_language>remove space closing bracket</technical_language>

Target:
public IStatus validate(final IProject project, final String path) { IStatus validTrace = Status.OK_STATUS; try { final CTFTrace temp = new CTFTrace(path); if (!temp.majortIsSet()) { validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_MajorNotSet); } else { CTFTraceReader ctfTraceReader = new CTFTraceReader(temp); if (!ctfTraceReader.hasMoreEvents()) { validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_NoEvent); } ctfTraceReader.dispose(); } temp.dispose(); } catch (final CTFReaderException e) { validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_ReadingError +": " + e.toString()); } catch (final BufferOverflowException e){ validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_ReadingError +": " + Messages.CtfTmfTrace_BufferOverflowErrorMessage); } return validTrace; }
Source:
<code>public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.PRE_DELETE && <START> event.getResource().getType() <END> == IResource.PROJECT) { IProject aboutToBeDeleted = (IProject) event.getResource(); IContainer parent = getParent(aboutToBeDeleted); if (parent != null) { parentsToRefresh.add(parent); } } else if (event.getType() == IResourceChangeEvent.POST_CHANGE) { if (event.getDelta().getKind() == IResourceDelta.CHANGED && event.getDelta().getResource().getType() == IResource.ROOT) { for (IResourceDelta delta : event.getDelta().getAffectedChildren()) { if (delta.getResource().getType() == IResource.PROJECT && delta.getKind() == IResourceDelta.ADDED) { IProject newProject = (IProject) delta.getResource(); IContainer parent = getParent(newProject); if (parent != null) { parentsToRefresh.add(parent); } } } } if (!parentsToRefresh.isEmpty()) { this.viewer.getTree().getDisplay().asyncExec(new Runnable() { @Override public void run() { for (IContainer parent : parentsToRefresh) { NestedProjectsContentProvider.this.viewer.refresh(parent); } parentsToRefresh.clear(); } }); } } }</code><technical_language>nan</technical_language>

Target:
public void resourceChanged(IResourceChangeEvent event) { IResource resource = event.getResource(); if (event.getType() == IResourceChangeEvent.PRE_DELETE && resource != null && resource.getType() == IResource.PROJECT) { IProject aboutToBeDeleted = (IProject) resource; IContainer parent = getParent(aboutToBeDeleted); if (parent != null) { parentsToRefresh.add(parent); } } else if (event.getType() == IResourceChangeEvent.POST_CHANGE) { IResourceDelta delta = event.getDelta(); if (delta != null) { resource = delta.getResource(); if (delta.getKind() == IResourceDelta.CHANGED && resource != null && resource.getType() == IResource.ROOT) { for (IResourceDelta childDelta : event.getDelta().getAffectedChildren()) { IResource childResource = childDelta.getResource(); if (childResource != null && childResource.getType() == IResource.PROJECT && childDelta.getKind() == IResourceDelta.ADDED) { IProject newProject = (IProject) childResource; IContainer parent = getParent(newProject); if (parent != null) { parentsToRefresh.add(parent); } } } } } if (!parentsToRefresh.isEmpty()) { this.viewer.getTree().getDisplay().asyncExec(new Runnable() { @Override public void run() { for (IContainer parent : parentsToRefresh) { NestedProjectsContentProvider.this.viewer.refresh(parent); } parentsToRefresh.clear(); } }); } } }
Source:
<code>public boolean isFinished() { if (finished) { return true; } <START> boolean finished = finishing && probe == null && pageBuilder.isEmpty() && outputPage == null; <END> if (finished) { close(); } return finished; }</code><technical_language>check if spilled spiller.isPresent (however, now, this is true, be). that, ok</technical_language>

Target:
public boolean isFinished() { boolean finished = this.finished && probe == null && pageBuilder.isEmpty() && outputPage == null; if (finished) { close(); } return finished; }
Source:
<code>protected URI[] getSelectedLocations(Object[] selectionArray) { List<URI> urls = new ArrayList<>(); for (Object element : selectionArray) { <START> if (element instanceof MetadataRepositoryElement) urls.add(((MetadataRepositoryElement) element).getLocation()); <END> } return urls.toArray(new URI[urls.size()]); }</code><technical_language>it: add braces</technical_language>

Target:
protected URI[] getSelectedLocations(Object[] selectionArray) { List<URI> urls = new ArrayList<>(); for (Object element : selectionArray) { if (element instanceof MetadataRepositoryElement) { urls.add(((MetadataRepositoryElement) element).getLocation()); } } return urls.toArray(new URI[urls.size()]); }
Source:
<code>private void persistEngineSession(String sessionId) { SessionInfo sessionInfo = getSessionInfo(sessionId); if (sessionInfo != null) { EngineSession engineSession = new EngineSession(); engineSession.setEngineSessionId(sessionId); DbUser user = getUser(sessionId, false); engineSession.setUserId(user.getId()); engineSession.setUserName(user.getLoginName()); <START> engineSession.setGroupIds(user.getGroupIds()); <END> sessionToIdMap.put(sessionId, getDbFacade().getEngineSessionDao().save(engineSession)); } }</code><technical_language>I do conventions of dao, a method accept DbUser</technical_language>

Target:
private void persistEngineSession(String sessionId) { SessionInfo sessionInfo = getSessionInfo(sessionId); if (sessionInfo != null) { EngineSession engineSession = new EngineSession(); engineSession.setEngineSessionId(sessionId); DbUser user = getUser(sessionId, false); engineSession.setUserId(user.getId()); engineSession.setUserName(user.getLoginName()); engineSession.setGroupIds(user.getGroupIds()); sessionInfo.contentOfSession.put(ENGINE_SESSION_SEQ_ID, getDbFacade().getEngineSessionDao().save(engineSession)); } }
Source:
<code>private static boolean validSortLimit(Sort sort, DruidQuery query) { if (sort.offset != null && RexLiteral.intValue(sort.offset) != 0) { return false; } if (query.getTopNode() instanceof Aggregate) { final Aggregate topAgg = (Aggregate) query.getTopNode(); final ImmutableBitSet.Builder positionsReferenced = ImmutableBitSet.builder(); int metricsRefs = 0; for (RelFieldCollation col : sort.collation.getFieldCollations()) { int idx = col.getFieldIndex(); if (idx >= topAgg.getGroupCount()) { <START> metricsRefs++; <END> continue; } positionsReferenced.set(topAgg.getGroupSet().nth(idx)); } if (checkIsFlooringTimestampRefOnQuery(topAgg.getGroupSet(), topAgg.getInput(), query) && topAgg.getGroupCount() == 1) { return !RelOptUtil.isLimit(sort) && sort.collation.getFieldCollations().size() == 1 && checkTimestampRefOnQuery(positionsReferenced.build(), topAgg.getInput(), query); } return true; } return RelOptUtil.isPureLimit(sort); }</code><technical_language>_metricsRefs_ is anymore (and is needed). If useless, get rid of it</technical_language>

Target:
private static boolean validSortLimit(Sort sort, DruidQuery query) { if (sort.offset != null && RexLiteral.intValue(sort.offset) != 0) { return false; } if (query.getTopNode() instanceof Aggregate) { final Aggregate topAgg = (Aggregate) query.getTopNode(); final ImmutableBitSet.Builder positionsReferenced = ImmutableBitSet.builder(); for (RelFieldCollation col : sort.collation.getFieldCollations()) { int idx = col.getFieldIndex(); if (idx >= topAgg.getGroupCount()) { continue; } positionsReferenced.set(topAgg.getGroupSet().nth(idx)); } if (checkIsFlooringTimestampRefOnQuery(topAgg.getGroupSet(), topAgg.getInput(), query) && topAgg.getGroupCount() == 1) { return !RelOptUtil.isLimit(sort) && sort.collation.getFieldCollations().size() == 1 && checkTimestampRefOnQuery(positionsReferenced.build(), topAgg.getInput(), query); } return true; } return RelOptUtil.isPureLimit(sort); }
Source:
<code><START> private void sendErrorFrame(String message, String description, ChannelHandlerContext ctx) { <END> StompFrame errorFrame = new DefaultStompFrame(StompCommand.ERROR); errorFrame.headers().set(MESSAGE, message); if (description != null) { ByteBuf content = encodeString(ctx.alloc(), CharBuffer.wrap(description), UTF_8); errorFrame.content().writeBytes(content); } ctx.writeAndFlush(errorFrame).addListener(ChannelFutureListener.CLOSE); }</code><technical_language>static</technical_language>

Target:
private static void sendErrorFrame(String message, String description, ChannelHandlerContext ctx) { StompFrame errorFrame = new DefaultStompFrame(StompCommand.ERROR); errorFrame.headers().set(MESSAGE, message); if (description != null) { errorFrame.content().writeCharSequence(description, CharsetUtil.UTF_8); } ctx.writeAndFlush(errorFrame).addListener(ChannelFutureListener.CLOSE); }
Source:
<code>static private String anchorFromVc(final VariantContext vc) { final Genotype genotype = vc.getGenotype(0); if (genotype == null || !genotype.hasExtendedAttribute(VCFConstants.PHASE_SET_KEY) ) { <START> return "Synthetic_"+vc.getContig()+"_"+vc.getStart(); <END> } else { return "PhaseSet_"+vc.getContig()+"_"+genotype.getExtendedAttribute(VCFConstants.PHASE_SET_KEY); } }</code><technical_language>spaces + magic string constants "Synthetic" "PhaseSet"</technical_language>

Target:
static private String anchorFromVc(final VariantContext vc) { final Genotype genotype = vc.getGenotype(0); if (genotype == null || !genotype.hasExtendedAttribute(VCFConstants.PHASE_SET_KEY)) { return SYNTHETIC_PHASESET_PREFIX + "_" + vc.getContig() + "_" + vc.getStart(); } else { return PHASESET_PREFIX + "_" + vc.getContig() + "_" + genotype.getExtendedAttribute(VCFConstants.PHASE_SET_KEY); } }
Source:
<code><START> public void dispose() { <END> server.getSecurityRegistry().remove(getCurrentEndpoint()); server.getSecurityRegistry().remove(BAD_ENDPOINT); }</code><technical_language>super.dispose() clear endpoint identifier</technical_language>

Target:
public void dispose() { super.dispose(); server.getSecurityRegistry().remove(getCurrentEndpoint()); server.getSecurityRegistry().remove(BAD_ENDPOINT); }
Source:
<code>public SyndFeedInfo remove(URL feedUrl) { try { String url = urlToString(feedUrl); FeedRecord record = feedRecordDataService.findByURL(url); if (record == null) { LOGGER.error("Trying to remove feedRecord for inexistent URL {}", feedUrl); return null; } LOGGER.debug("*** removing from cache *** {}", url); byte[] bytes = (byte[]) feedRecordDataService.getDetachedField(record, FEED_DATA); feedRecordDataService.delete(record); return feedRecordToFeedInfo(record); } catch (IOException | ClassNotFoundException | FeedException ex) { <START> LOGGER.error(ex.getMessage(), ex); <END> return null; } }</code><technical_language>additionally add message, signal problem occured</technical_language>

Target:
public SyndFeedInfo remove(URL feedUrl) { try { String url = FeedCacheUtils.urlToString(feedUrl); FeedRecord record = feedRecordDataService.findByURL(url); if (record == null) { LOGGER.error("Trying to remove feedRecord for inexistent URL {}", feedUrl); return null; } LOGGER.debug("*** removing from cache *** {}", url); feedRecordDataService.delete(record); return FeedCacheUtils.feedRecordToFeedInfo(record); } catch (IOException | ClassNotFoundException | FeedException ex) { LOGGER.error("Error removing FeedRecord from the databaase {}", ex.getMessage()); return null; } }
Source:
<code>public void update_author_and_assignee_when_scm_is_activated() { createUser("user1", "User 1", "user1@email.com"); projectAnalysis.withProperties("sonar.scm.disabled", "true").run(); List<Issue> issues = searchIssues(); assertThat(issues).isNotEmpty(); for (Issue issue : issues) { assertThat(issue.author()).isEmpty(); } assertThat(search(IssueQuery.create().assigned(true)).list()).isEmpty(); projectAnalysis.run(); issues = searchIssues(); assertThat(issues).isNotEmpty(); for (Issue issue : issues) { if (issue.line() == 10) { assertThat(issue.author()).isEmpty(); } else { assertThat(issue.author()).isNotEmpty(); <START> } <END> } assertThat(search(IssueQuery.create().assignees("user1")).list()).hasSize(1); }</code><technical_language>I prefer test more explicit, using: assertThat(issues) .extracting(Issue::line, Issue::author) .containsExactlyInAnyOrder( tuple(1, "user1"), tuple(2, "user2"), tuple(3, "user3name"), tuple(4, "user4name"), tuple(5, "user5@email.com"), tuple(6, "user6@email.com"), tuple(7, "user7scmaccount"), tuple(8, "user8scmaccount"), tuple(9, "user8scmaccount"), tuple(10, "") ); (and line 142: assertThat(issues) .extracting(Issue::line, Issue::author) .containsExactlyInAnyOrder( tuple(1, ""), tuple(2, ""), tuple(3, ""), tuple(4, ""), tuple(5, ""), tuple(6, ""), tuple(7, ""), tuple(8, ""), tuple(9, ""), tuple(10, "") ); )</technical_language>

Target:
public void update_author_and_assignee_when_scm_is_activated() { createUser("user1", "User 1", "user1@email.com"); projectAnalysis.withProperties("sonar.scm.disabled", "true").run(); List<Issue> issues = searchIssues(); assertThat(issues).isNotEmpty(); assertThat(issues) .extracting(Issue::line, Issue::author) .containsExactlyInAnyOrder( tuple(1, ""), tuple(2, ""), tuple(3, ""), tuple(4, ""), tuple(5, ""), tuple(6, ""), tuple(7, ""), tuple(8, ""), tuple(9, ""), tuple(10, "")); assertThat(search(IssueQuery.create().assigned(true)).list()).isEmpty(); projectAnalysis.run(); issues = searchIssues(); assertThat(issues).isNotEmpty(); assertThat(issues) .extracting(Issue::line, Issue::author) .containsExactlyInAnyOrder( tuple(1, "user1"), tuple(2, "user2"), tuple(3, "user3name"), tuple(4, "user4name"), tuple(5, "user5@email.com"), tuple(6, "user6@email.com"), tuple(7, "user7scmaccount"), tuple(8, "user8scmaccount"), tuple(9, "user8scmaccount"), tuple(10, "")); assertThat(search(IssueQuery.create().assignees("user1")).list()).hasSize(1); }
Source:
<code>public E remove(int index) { throw new UnsupportedOperationException("No <START> delete in <END> " + this.getClass().getName()); }</code><technical_language>remove(int)</technical_language>

Target:
public E remove(int index) { throw new UnsupportedOperationException("No delete(int) in " + this.getClass().getName()); }
Source:
<code>private BundleDescription[] mergeBundles(BundleDescription[] reResolve, BundleDescription[] removed) { if (reResolve == null) return removed; if (reResolve.length == 0) return reResolve; List<BundleDescription> result = new ArrayList<>(reResolve.length + removed.length); for (BundleDescription <START> reResolve1 : <END> reResolve) { result.add(reResolve1); } for (BundleDescription removed1 : removed) { boolean found = false; for (BundleDescription reResolve1 : reResolve) { if (removed1 == reResolve1) { found = true; break; } } if (!found) { result.add(removed1); } } return result.toArray(new BundleDescription[result.size()]); }</code><technical_language>rename toRefresh</technical_language>

Target:
private BundleDescription[] mergeBundles(BundleDescription[] reResolve, BundleDescription[] removed) { if (reResolve == null) return removed; if (reResolve.length == 0) return reResolve; List<BundleDescription> result = new ArrayList<>(reResolve.length + removed.length); for (BundleDescription toRefresh : reResolve) { result.add(toRefresh); } for (BundleDescription removedDescription : removed) { boolean found = false; for (BundleDescription toRefresh : reResolve) { if (removedDescription == toRefresh) { found = true; break; } } if (!found) { result.add(removedDescription); } } return result.toArray(new BundleDescription[result.size()]); }
Source:
<code>public void onInitializationComplete() { GlStateManager.disableTexture2D(); GlStateManager.enableTexture2D(); if (errorToDisplay != null) { GuiScreen errorScreen = errorToDisplay.createGui(); showGuiScreen(errorScreen); } else { logMissingTextureErrors(); if (!badTextureDomains.isEmpty() || !badResources.isEmpty()) { if ((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) { if (badTextureDomains.size() != 0) badResources.put("textures", badTextureDomains); showGuiScreen(new GuiResourceError(badResources)); } else <START> FMLLog.log.warn("Skipped ResourceErrorScreen due to deobfusated Environement"); <END> } } }</code><technical_language>This log removed, informative</technical_language>

Target:
public void onInitializationComplete() { GlStateManager.disableTexture2D(); GlStateManager.enableTexture2D(); if (errorToDisplay != null) { GuiScreen errorScreen = errorToDisplay.createGui(); showGuiScreen(errorScreen); } else { logMissingTextureErrors(); if (FMLLaunchHandler.isDeobfuscatedEnvironment()) { badTextureDomains.forEach(domain -> trackBadResource("textures", domain)); if (showResourceErrorScreen) { showGuiScreen(new GuiResourceError(badResources)); } } } }
Source:
<code>private GitModelObject[] getChildrenImpl() { List<GitModelObject> restult = new ArrayList<GitModelObject>(); try { if (gsds.size() == 1) { GitSynchronizeData gsd = gsds.iterator().next(); GitModelRepository repoModel = new GitModelRepository(gsd); return repoModel.getChildren(); } else for (GitSynchronizeData data : gsds) { GitModelRepository repoModel = new GitModelRepository(data); if (repoModel.getChildren().length > 0) restult.add(repoModel); } } catch (IOException e) { Activator.logError(e.getMessage(), e); } disposeOldChildren(); <START> children = restult.toArray(new GitModelObject[restult.size()]); <END> return children; }</code><technical_language>typo in local variable name s/restult/result/</technical_language>

Target:
private GitModelObject[] getChildrenImpl() { List<GitModelObject> result = new ArrayList<GitModelObject>(); try { if (gsds.size() == 1) { GitSynchronizeData gsd = gsds.iterator().next(); GitModelRepository repoModel = new GitModelRepository(gsd); return repoModel.getChildren(); } else for (GitSynchronizeData data : gsds) { GitModelRepository repoModel = new GitModelRepository(data); if (repoModel.getChildren().length > 0) result.add(repoModel); } } catch (IOException e) { Activator.logError(e.getMessage(), e); } disposeOldChildren(); children = result.toArray(new GitModelObject[result.size()]); return children; }
Source:
<code>public ZkKeyBuilder(String pathPrefix) { <START> if (Strings.isNullOrEmpty(pathPrefix)) { <END> throw new SamzaException("Zk PathPrefix cannot be null or empty!"); } this.pathPrefix = pathPrefix.trim(); }</code><technical_language>is related change, i noticed trim pathPrefix assignment. Ideally trim check " " considered a valid prefix</technical_language>

Target:
public ZkKeyBuilder(String pathPrefix) { if (pathPrefix != null && !pathPrefix.trim().isEmpty()) { this.pathPrefix = pathPrefix.trim(); } else { throw new IllegalArgumentException("Zk PathPrefix cannot be null or empty!"); } }
Source:
<code>public MethodHandle find() { try { return resolve().asType(type); } catch (NoSuchMethodException | IllegalAccessException e) { <START> throw new Error(e); <END> } }</code><technical_language>Is Error right exception type? /cc @yloiseau</technical_language>

Target:
public MethodHandle find() { try { return resolve().asType(type); } catch (NoSuchMethodException | IllegalAccessException e) { throw new RuntimeException(e); } }
Source:
<code>public static boolean acceptableAlleleBases(final byte[] bases, final boolean isReferenceAllele) { if ( wouldBeNullAllele(bases) ) return false; if ( wouldBeNoCallAllele(bases) || wouldBeSymbolicAllele(bases) ) return true; for (byte base : bases ) { switch (base) { case 'A': case 'C': case 'G': case 'T': case 'a': case 'c': case 'g': case 't': break; case 'N' : case 'n' : case '*': if (isReferenceAllele) <START> break; <END> else return false; default: return false; } } return true; }</code><technical_language>This needs changed. 1) turns out spec changed 'N's allowed in REF ALT fields, treated other bases above. 2) '_'s acceptable in ALT field (so if isReferenceAllele is true). allowed character (so this check needs occur of for loop). E.g. if ( wouldBeStarAllele(bases) ) return true; wouldBeStarAllele() check a single base == '_'</technical_language>

Target:
public static boolean acceptableAlleleBases(final byte[] bases, final boolean isReferenceAllele) { if ( wouldBeNullAllele(bases) ) return false; if ( wouldBeNoCallAllele(bases) || wouldBeSymbolicAllele(bases) ) return true; if ( wouldBeStarAllele(bases) ) { if ( isReferenceAllele ) return false; else return true; } for (byte base : bases ) { switch (base) { case 'A': case 'C': case 'G': case 'T': case 'a': case 'c': case 'g': case 't': case 'N' : case 'n' : break; default: return false; } } return true; }
Source:
<code>private void enableRTPExtension(byte extensionID, RTPExtension rtpExtension) { boolean active = !MediaDirection.INACTIVE.equals(rtpExtension.getDirection()); byte effectiveId = active ? extensionID : -1; String uri = rtpExtension.getURI().toString(); if (RTPExtension.ABS_SEND_TIME_URN.equals(uri)) { if (absSendTimeEngine != null) { absSendTimeEngine.setExtensionID(effectiveId); } RemoteBitrateEstimatorWrapper remoteBitrateEstimatorWrapper = getRemoteBitrateEstimator(); if (remoteBitrateEstimatorWrapper != null) { remoteBitrateEstimatorWrapper <START> .setExtensionID(effectiveId & 0xFFFF); <END> } } else if (RTPExtension.FRAME_MARKING_URN.equals(uri)) { frameMarkingsExtensionId = effectiveId; } else if (RTPExtension.ORIGINAL_HEADER_BLOCK_URN.equals(uri)) { ohbEngine.setExtensionID(effectiveId); } else if (RTPExtension.TRANSPORT_CC_URN.equals(uri)) { transportCCEngine.setExtensionID(effectiveId); } }</code><technical_language>this RTPUtils.as16Bits()</technical_language>

Target:
private void enableRTPExtension(byte extensionID, RTPExtension rtpExtension) { boolean active = !MediaDirection.INACTIVE.equals(rtpExtension.getDirection()); int effectiveId = active ? RTPUtils.as16Bits(extensionID) : -1; String uri = rtpExtension.getURI().toString(); if (RTPExtension.ABS_SEND_TIME_URN.equals(uri)) { if (absSendTimeEngine != null) { absSendTimeEngine.setExtensionID(effectiveId); } RemoteBitrateEstimatorWrapper remoteBitrateEstimatorWrapper = getRemoteBitrateEstimator(); if (remoteBitrateEstimatorWrapper != null) { remoteBitrateEstimatorWrapper .setAstExtensionID(effectiveId); } } else if (RTPExtension.FRAME_MARKING_URN.equals(uri)) { frameMarkingsExtensionId = effectiveId; } else if (RTPExtension.ORIGINAL_HEADER_BLOCK_URN.equals(uri)) { ohbEngine.setExtensionID(effectiveId); } else if (RTPExtension.TRANSPORT_CC_URN.equals(uri)) { transportCCEngine.setExtensionID(effectiveId); RemoteBitrateEstimatorWrapper remoteBitrateEstimatorWrapper = getRemoteBitrateEstimator(); if (remoteBitrateEstimatorWrapper != null) { remoteBitrateEstimatorWrapper.setTccExtensionID(effectiveId); } } }
Source:
<code>private ArrayList<Location> getLocationsFromFile(String name) throws Exception { String fileName = getProperty("user.dir"); File file = new File(fileName + "/src/test/fixtures/" + name + ".txt"); String content = FileUtils.readFileToString(file, "UTF-8"); ArrayList<Location> allLocations = new ArrayList<Location>(); <START> for(String locations: content.split("\n")) { <END> String[] latLng = locations.split(","); Location location = new Location("test"); location.setLatitude(Double.valueOf(latLng[0])); location.setLongitude(Double.valueOf(latLng[1])); allLocations.add(location); } return allLocations; }</code><technical_language>is a new utility in Java 7 this a verbose. <LINK_0>,%20java.nio.charset.Charset)</technical_language>

Target:
private ArrayList<Location> getLocationsFromFile(String name) throws Exception { String fileName = getProperty("user.dir"); File file = new File(fileName + "/src/test/fixtures/" + name + ".txt"); ArrayList<Location> allLocations = new ArrayList<Location>(); for(String locations: Files.readAllLines(file.toPath(), defaultCharset())) { String[] latLng = locations.split(","); Location location = new Location("test"); location.setLatitude(Double.valueOf(latLng[0])); location.setLongitude(Double.valueOf(latLng[1])); allLocations.add(location); } return allLocations; }
Source:
<code>public void testPutInstantAsObject() { Object instant = Instant.now(); JsonObject jsonObject = new JsonObject(); <START> jsonObject.put("instant", instant); <END> }</code><technical_language>need test retrieve "instant" type / expected</technical_language>

Target:
public void testPutInstantAsObject() { Object instant = Instant.now(); JsonObject jsonObject = new JsonObject(); jsonObject.put("instant", instant); assertTrue(jsonObject.getValue("instant") instanceof String); }
Source:
<code>public JCAOrderedLastSynchronizationList(Transaction tx, Map<Transaction, JCAOrderedLastSynchronizationList> jcaOrderedLastSynchronizations) { this.tx = tx; this.jcaOrderedLastSynchronizations = jcaOrderedLastSynchronizations; <START> this.jcaOrderedLastSynchronizations.put(tx, this); <END> }</code><technical_language>Remove this</technical_language>

Target:
public JCAOrderedLastSynchronizationList(Transaction tx, Map<Transaction, JCAOrderedLastSynchronizationList> jcaOrderedLastSynchronizations) { this.tx = tx; this.jcaOrderedLastSynchronizations = jcaOrderedLastSynchronizations; }
Source:
<code>public SpongeLoreData(List<Text> lore) { super(LoreData.class); <START> this.lore = lore; <END> registerGettersAndSetters(); }</code><technical_language>a defensive copy of lore list otherwise, I pass ImmutableList break manipulator</technical_language>

Target:
public SpongeLoreData(List<Text> lore) { super(LoreData.class); this.lore = Lists.newArrayList(lore); registerGettersAndSetters(); }
Source:
<code>public boolean valid(IConfigurationElement element, IPreferenceNode node) { <START> return PluginChecker.isTIS(); <END> }</code><technical_language>I need PluginChecker.isTIS() || hadoopUiService != null , page show in tos-bd</technical_language>

Target:
public boolean valid(IConfigurationElement element, IPreferenceNode node) { GlobalServiceRegister serviceRegister = GlobalServiceRegister.getDefault(); return PluginChecker.isTIS() || serviceRegister.isServiceRegistered(IHadoopUiService.class); }
Source:
<code>protected void updateOperatorPlmn() { String imsi = getIMSI(); if (imsi != null) { if (((mMncLength == UNKNOWN) || (mMncLength == 2)) && imsi.length() >= 6) { String mccmncCode = imsi.substring(0, 6); for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { if (mccmnc.equals(mccmncCode)) { mMncLength = 3; log("IMSI: setting1 mMncLength=" + mMncLength); <START> break; <END> } } } if (mMncLength == UNKNOWN) { try { int mcc = Integer.parseInt(imsi.substring(0, 3)); mMncLength = MccTable.smallestDigitsMccForMnc(mcc); log("setting2 mMncLength=" + mMncLength); } catch (NumberFormatException e) { mMncLength = UNKNOWN; loge("Corrupt IMSI! setting3 mMncLength=" + mMncLength); } } if (mMncLength != UNKNOWN && mMncLength != UNINITIALIZED && imsi.length() >= 3 + mMncLength) { log("update mccmnc=" + imsi.substring(0, 3 + mMncLength)); MccTable.updateMccMncConfiguration(mContext, imsi.substring(0, 3 + mMncLength)); } } }</code><technical_language>Remove</technical_language>

Target:
protected void updateOperatorPlmn() { String imsi = getIMSI(); if (imsi != null) { if (((mMncLength == UNKNOWN) || (mMncLength == 2)) && imsi.length() >= 6) { String mccmncCode = imsi.substring(0, 6); for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { if (mccmnc.equals(mccmncCode)) { mMncLength = 3; log("IMSI: setting1 mMncLength=" + mMncLength); break; } } } if (mMncLength == UNKNOWN) { try { int mcc = Integer.parseInt(imsi.substring(0, 3)); mMncLength = MccTable.smallestDigitsMccForMnc(mcc); log("setting2 mMncLength=" + mMncLength); } catch (NumberFormatException e) { loge("Corrupt IMSI! setting3 mMncLength=" + mMncLength); } } if (mMncLength != UNKNOWN && mMncLength != UNINITIALIZED && imsi.length() >= 3 + mMncLength) { log("update mccmnc=" + imsi.substring(0, 3 + mMncLength)); MccTable.updateMccMncConfiguration(mContext, imsi.substring(0, 3 + mMncLength)); } } }
Source:
<code>protected void fetch(ResultSet from, int fromIndex) throws SQLException { java.sql.Timestamp timestamp = from.getTimestamp(fromIndex); if (timestamp != null) { <START> value = Instant.ofEpochSecond(timestamp.getTime() / 1000, timestamp.getNanos()); <END> } }</code><technical_language>= timestamp.toInstant()</technical_language>

Target:
protected void fetch(ResultSet from, int fromIndex) throws SQLException { java.sql.Timestamp timestamp = from.getTimestamp(fromIndex); if (timestamp != null) { value = timestamp.toInstant(); } }
Source:
<code>public ThriftContext(String namespace, List<String> includes, List<ThriftType> thriftTypes, List<ThriftServiceMetadata> thriftServices, Map<String, String> namespaceMap) { this.namespace = namespace; this.includes = includes; for (ThriftType t: thriftTypes) { switch (t.getProtocolType()) { case STRUCT: this.thriftStructs.add(t.getStructMetadata()); break; case ENUM: this.thriftEnums.add(t.getEnumMetadata()); break; default: throw new IllegalStateException("Unknown protocol type: " + t.getProtocolType()); } } this.thriftServices = thriftServices; <START> for (Map.Entry<String, String> entry : namespaceMap.entrySet()) { <END> customNamespaces.add(String.format("namespace %s %s", entry.getKey(), entry.getValue())); } }</code><technical_language>need convert map a list, template handle maps</technical_language>

Target:
public ThriftContext(String namespace, List<String> includes, List<ThriftType> thriftTypes, List<ThriftServiceMetadata> thriftServices, Map<String, String> namespaceMap) { this.namespace = namespace; this.includes = includes; for (ThriftType t: thriftTypes) { switch (t.getProtocolType()) { case STRUCT: this.thriftStructs.add(t.getStructMetadata()); break; case ENUM: this.thriftEnums.add(t.getEnumMetadata()); break; default: throw new IllegalStateException("Unknown protocol type: " + t.getProtocolType()); } } this.thriftServices = thriftServices; customNamespaces = namespaceMap; }
Source:
<code>public User cacheExternalUserDetails(String sourceId, UserDetails springUser) { User user = springUser instanceof StrongboxUserDetails ? ((StrongboxUserDetails) springUser).getUser() : new UserData(springUser); String username = user.getUsername(); Optional<UserEntity> optionalUser = Optional.ofNullable(findByUsername(user.getUsername())); try { if (optionalUser.map(User::getSourceId).map(sourceId::equals).filter(Boolean.FALSE::equals).isPresent()) { deleteByUsername(optionalUser.map(u -> user.getUuid()).get()); optionalUser = Optional.empty(); } UserEntity userEntry = optionalUser.orElseGet(() -> new UserEntity(username)); if (!StringUtils.isBlank(user.getPassword())) { userEntry.setPassword(user.getPassword()); } userEntry.setEnabled(user.isEnabled()); userEntry.setRoles(user.getRoles()); userEntry.setSecurityTokenKey(user.getSecurityTokenKey()); userEntry.setLastUpdated(LocalDateTime.now()); userEntry.setSourceId(sourceId); <START> return save(userEntry); <END> } catch (SchemaViolationException e) { throw new UserAlreadyExistsException(String.format("Failed to cache external user from [%s], duplicate [%s] already exists.", sourceId, user.getUsername()), e); } }</code><technical_language>So, Janusgraph+Cassandra, OrientDB, supports LocalDateTime? Cool! :)</technical_language>

Target:
public User cacheExternalUserDetails(String sourceId, UserDetails springUser) { User user = springUser instanceof StrongboxUserDetails ? ((StrongboxUserDetails) springUser).getUser() : new UserData(springUser); String username = user.getUsername(); Optional<UserEntity> optionalUser = Optional.ofNullable(findByUsername(user.getUsername())); try { if (optionalUser.map(User::getSourceId).map(sourceId::equals).filter(Boolean.FALSE::equals).isPresent()) { deleteByUsername(optionalUser.map(u -> user.getUuid()).get()); optionalUser = Optional.empty(); } UserEntity userEntry = optionalUser.orElseGet(() -> new UserEntity(username)); if (!StringUtils.isBlank(user.getPassword())) { userEntry.setPassword(user.getPassword()); } userEntry.setEnabled(user.isEnabled()); userEntry.setRoles(user.getRoles()); userEntry.setSecurityTokenKey(user.getSecurityTokenKey()); userEntry.setLastUpdated(LocalDateTimeInstance.now()); userEntry.setSourceId(sourceId); return userRepository.save(userEntry); } catch (SchemaViolationException e) { throw new UserAlreadyExistsException(String.format("Failed to cache external user from [%s], duplicate [%s] already exists.", sourceId, user.getUsername()), e); } }
Source:
<code>public void testWithGroupDirectFilter() throws Exception { JsonObject params = buildParameterObject("direct", "users"); Map<String, Object> parameters = new HashMap<>(); parameters.put("params", params); <START> LOG.info("params = {}",params.toString()); <END> context.request().setParameterMap(parameters); servlet.doGet(context.request(), context.response()); assertEquals(context.response().getStatus(), 200); String output = context.response().getOutputAsString(); LOG.info(output); CSVParser parser = CSVParser.parse(output, CSVFormat.DEFAULT.withHeader()); assertAllUsersPresent(parser.getRecords(), "alice","bob"); }</code><technical_language>LOG</technical_language>

Target:
public void testWithGroupDirectFilter() throws Exception { JsonObject params = buildParameterObject("direct", "users"); Map<String, Object> parameters = new HashMap<>(); parameters.put("params", params); context.request().setParameterMap(parameters); servlet.doGet(context.request(), context.response()); assertEquals(context.response().getStatus(), 200); String output = context.response().getOutputAsString(); CSVParser parser = CSVParser.parse(output, CSVFormat.DEFAULT.withHeader()); assertAllUsersPresent(parser.getRecords(), "alice","bob"); }