auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public VdcActionParametersBase() { shouldbelogged = true; transctionOption = TransactionScopeOption.Required; setTaskGroupSuccess(true); setParentCommand(VdcActionType.Unknown); executionReason = CommandExecutionReason.REGULAR_FLOW; compensationEnabled = false; parentCommand = VdcActionType.Unknown; commandType = VdcActionType.Unknown; imagesParameters = new ArrayList<VdcActionParametersBase>(); <START> lifeInMinutes = Config.<Integer>getValue(ConfigValues.CoCoCommandLifeInMinutes); <END> }</code><technical_language>while setting a default sense - applied for command, for consider (all non-coco commands). suggest leave property uninitialized if is null, set a default value. means changing type int Integer. This allow distinguish flows intended set a (by overriding null value) override for default used. logic added new code added in CommandExecutor.markExpiredCommandAsFailure(Guid) This reduce size of this patch require changes UI/Restapi code</technical_language>

Target:
public VdcActionParametersBase() { shouldbelogged = true; transctionOption = TransactionScopeOption.Required; setTaskGroupSuccess(true); setParentCommand(VdcActionType.Unknown); executionReason = CommandExecutionReason.REGULAR_FLOW; compensationEnabled = false; parentCommand = VdcActionType.Unknown; commandType = VdcActionType.Unknown; imagesParameters = new ArrayList<VdcActionParametersBase>(); }
Source:
<code>protected static String getLineDelimiterPreference(IFile file) { IScopeContext[] scopeContext; if (file != null) { ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager(); ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE); return TextUtilities.getDefaultLineDelimiter(buffer.getDocument()); } scopeContext = new IScopeContext[] { <START> InstanceScope.INSTANCE }; <END> return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext); }</code><technical_language>Please note, this ignores product default settings, is good</technical_language>

Target:
protected static String getLineDelimiterPreference(IFile file) { if (file != null) { ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager(); ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE); if (buffer != null) { return TextUtilities.getDefaultLineDelimiter(buffer.getDocument()); } } return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, null); }
Source:
<code>protected void prepareTestData() { testData = loadDataBundle("/InstructorFeedbackSessionsPageUiTest.json"); course = testData.courses.get("anotherCourse"); newSession = FeedbackSessionAttributes .builder("New Session ##", course.getId(), "teammates.test1@gmail.tmt") .withStartTime(TimeHelper.parseInstant("2035-04-01 9:59 PM +0000")) .withEndTime(TimeHelper.parseInstant("2035-04-30 8:00 PM +0000")) <START> .withCreatedTime(Const.TIME_REPRESENTS_NOW) <END> .withSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING) .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) .withGracePeriodMinutes(0) .withInstructions(new Text("Please fill in the new feedback session.")) .withSentOpenEmail(false) .withSentPublishedEmail(false) .withTimeZone(course.getTimeZone()) .withClosingEmailEnabled(true) .withPublishedEmailEnabled(true) .build(); }</code><technical_language>this needed fix test? If so, arbitrary timestamp special timestamp (I special is in real usage)</technical_language>

Target:
protected void prepareTestData() { testData = loadDataBundle("/InstructorFeedbackSessionsPageUiTest.json"); course = testData.courses.get("anotherCourse"); newSession = FeedbackSessionAttributes .builder("New Session ##", course.getId(), "teammates.test1@gmail.tmt") .withStartTime(TimeHelper.parseInstant("2035-04-01 9:59 PM +0000")) .withEndTime(TimeHelper.parseInstant("2035-04-30 8:00 PM +0000")) .withCreatedTime(Const.TIME_REPRESENTS_NEVER) .withSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING) .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) .withGracePeriodMinutes(0) .withInstructions(new Text("Please fill in the new feedback session.")) .withSentOpenEmail(false) .withSentPublishedEmail(false) .withTimeZone(course.getTimeZone()) .withClosingEmailEnabled(true) .withPublishedEmailEnabled(true) .build(); }
Source:
<code>private void onBoardNew() { logger.info("Menu: Boards > New"); if (confirmNewBoardCreation()) { panels.closeAllPanels(); onBoardSaveAs(); } else { logger.info("New board creation cancelled"); <START> } <END> }</code><technical_language>guard conditions deal hanging fruit first. reduces complexity of execution paths. java if (!confirmNewBoardCreation()) { logger.info("New board creation cancelled"); return; } panels.closeAllPanels(); onBoardSaveAs();</technical_language>

Target:
private void onBoardNew() { logger.info("Menu: Boards > New"); if (!isNewBoardCreationDialogConfirmed()) { logger.info("New board creation cancelled"); return; } panels.closeAllPanels(); onBoardSaveAs(); }
Source:
<code>public void removeTag(String tag) { <START> tags.remove(tags.stream().filter(t -> t.equalsIgnoreCase(tag)).findFirst().orElse("")); <END> }</code><technical_language>"" artibrary here. orElse(tag) choice (would result in identical call in code)</technical_language>

Target:
public void removeTag(String tag) { tags.remove(tags.stream().filter(t -> t.equalsIgnoreCase(tag)).findFirst().orElse(tag)); }
Source:
<code>protected final boolean mustCheckName(DetailAST ast) { final DetailAST modifiersAST = ast.findFirstToken(TokenTypes.MODIFIERS); <START> boolean isStatic = false; <END> if (!ScopeUtil.isInPatternDefinition(ast)) { isStatic = modifiersAST.findFirstToken(TokenTypes.LITERAL_STATIC) != null; } return modifiersAST != null && !isStatic && !ScopeUtil.isInInterfaceOrAnnotationBlock(ast) && !ScopeUtil.isLocalVariableDef(ast) && shouldCheckInScope(modifiersAST); }</code><technical_language>I simply adding a modifiersAST != null clause java boolean isStatic = modifiersAST != null && modifiersAST.findFirstToken(TokenTypes.LITERAL_STATIC) != null; leaving rest of method unchanged/not necessarily introducing Scope.isInPatternDefinition work</technical_language>

Target:
protected final boolean mustCheckName(DetailAST ast) { final DetailAST modifiersAST = ast.findFirstToken(TokenTypes.MODIFIERS); final boolean isStatic = modifiersAST != null && modifiersAST.findFirstToken(TokenTypes.LITERAL_STATIC) != null; return modifiersAST != null && !isStatic && !ScopeUtil.isInInterfaceOrAnnotationBlock(ast) && !ScopeUtil.isLocalVariableDef(ast) && shouldCheckInScope(modifiersAST); }
Source:
<code>private void updateCommentList(CommentAttributes comment, boolean isCurrentInstructorGiver, List<CommentAttributes> commentList) { if (isViewingDraft || isCurrentInstructorGiver) { commentList.add(comment); <START> } else { <END> if (isInstructorAllowedForPrivilegeOnComment(comment, instructor, courseId, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS)) { commentList.add(comment); } } }</code><technical_language>combine this else if statement</technical_language>

Target:
private void updateCommentList(CommentAttributes comment, boolean isCurrentInstructorGiver, List<CommentAttributes> commentList) { if (isViewingDraft || isCurrentInstructorGiver) { commentList.add(comment); } else if (isInstructorAllowedForPrivilegeOnComment(comment, instructor, courseId, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS)) { commentList.add(comment); } }
Source:
<code>private void notifyErrorContext(Connection connection, ErrorCondition condition) { if (connection == null || connection.getRemoteState() == EndpointState.CLOSED) { return; } if (condition == null) { throw logger.logExceptionAsError(new IllegalStateException(String.format( <START> "connectionId[%s] notifyErrorContext does not have an ErrorCondition.", getConnectionId()))); <END> } final Throwable exception = ExceptionUtil.toException(condition.getCondition().toString(), condition.getDescription(), getErrorContext()); onNext(exception); }</code><technical_language>suggestion "connectionId[%s]: notifyErrorContext ErrorCondition.", getConnectionId())));</technical_language>

Target:
private void notifyErrorContext(Connection connection, ErrorCondition condition) { if (connection == null || connection.getRemoteState() == EndpointState.CLOSED) { return; } if (condition == null) { throw logger.logExceptionAsError(new IllegalStateException(String.format( "connectionId[%s]: notifyErrorContext does not have an ErrorCondition.", getConnectionId()))); } final Throwable exception = ExceptionUtil.toException(condition.getCondition().toString(), condition.getDescription(), getErrorContext()); onNext(exception); }
Source:
<code>void record(int statusCode, long micros) { switch (statusCode / 100) { case 1: informational.update(micros, MICROS); break; case 2: successful.update(micros, MICROS); break; case 3: redirection.update(micros, MICROS); break; case 4: clientError.update(micros, MICROS); break; case 5: serverError.update(micros, MICROS); break; default: other.update(micros, MICROS); break; } <START> lastUpdate = Instant.now(clock); <END> }</code><technical_language>nit: assuming updating this more frequently querying it, remember epoch millis create Instant in lastUpdate()</technical_language>

Target:
void record(int statusCode, long micros) { switch (statusCode / 100) { case 1: informational.update(micros, MICROS); break; case 2: successful.update(micros, MICROS); break; case 3: redirection.update(micros, MICROS); break; case 4: clientError.update(micros, MICROS); break; case 5: serverError.update(micros, MICROS); break; default: other.update(micros, MICROS); break; } lastUpdateEpochMillis = clock.millis(); }
Source:
<code>public static void load(File file) { try { <START> LineIterator it = IOUtils.lineIterator(new FileInputStream(file), "UTF-8"); <END> while (it.hasNext()) { String line = it.next(); if (!line.startsWith("#") && !line.trim().isEmpty()) { add(line); } } } catch (Exception e) { throw new WindupException("Failed loading archive ignore patterns from [" + file.toString() + "]", e); } }</code><technical_language>this is leaked</technical_language>

Target:
public static void load(File file) { try(FileInputStream inputStream = new FileInputStream(file)) { LineIterator it = IOUtils.lineIterator(inputStream, "UTF-8"); while (it.hasNext()) { String line = it.next(); if (!line.startsWith("#") && !line.trim().isEmpty()) { add(line); } } } catch (Exception e) { throw new WindupException("Failed loading archive ignore patterns from [" + file.toString() + "]", e); } }
Source:
<code>protected void executeQueryCommand() { GlusterGeoRepDao geoRepDao = getGeoRepDao(); List<GlusterGeoRepSession> geoRepSessions = geoRepDao.getGeoRepSessions(getParameters().getId()); if (geoRepSessions != null) { for (GlusterGeoRepSession currentSession : geoRepSessions) { ArrayList<GlusterGeoRepSessionDetails> currentSessionDetails = (ArrayList<GlusterGeoRepSessionDetails>) geoRepDao.getGeoRepSessionDetails(currentSession.getId()); <START> currentSession.setSessionDetails(currentSessionDetails); <END> if (currentSession.getSessionDetails() != null) { for (GlusterGeoRepSessionDetails currentDetail : currentSession.getSessionDetails()) { GlusterBrickEntity currentBrick = getGlusterBrickDao().getById(currentDetail.getMasterBrickId()); if (currentBrick != null) { currentDetail.setMasterBrickNode(currentBrick.getServerName()); } } } } } getQueryReturnValue().setReturnValue(geoRepSessions); }</code><technical_language>Set this if session details null?</technical_language>

Target:
protected void executeQueryCommand() { GlusterGeoRepDao geoRepDao = getGeoRepDao(); List<GlusterGeoRepSession> geoRepSessions = geoRepDao.getGeoRepSessions(getParameters().getId()); if (geoRepSessions != null) { for (GlusterGeoRepSession currentSession : geoRepSessions) { List<GlusterGeoRepSessionDetails> geoRepSessionDetails = geoRepDao.getGeoRepSessionDetails(currentSession.getId()); if(geoRepSessionDetails == null) { continue; } ArrayList<GlusterGeoRepSessionDetails> currentSessionDetails = (ArrayList<GlusterGeoRepSessionDetails>) geoRepSessionDetails; currentSession.setSessionDetails(currentSessionDetails); if (currentSession.getSessionDetails() != null) { for (GlusterGeoRepSessionDetails currentDetail : currentSession.getSessionDetails()) { GlusterBrickEntity currentBrick = getGlusterBrickDao().getById(currentDetail.getMasterBrickId()); if (currentBrick != null) { currentDetail.setMasterBrickNode(currentBrick.getServerName()); } } } } } getQueryReturnValue().setReturnValue(geoRepSessions); }
Source:
<code>public boolean visitMethod(UMethod node) { super.visitMethod(node); <START> return !"onResume".equalsIgnoreCase(node.getName()); <END> }</code><technical_language>isOverride checks existence of annotation? convenient then.</technical_language>

Target:
public boolean visitMethod(UMethod node) { super.visitMethod(node); return !"onResume".equalsIgnoreCase(node.getName()) || node.getReturnType() != PsiType.VOID || node.getUastParameters().size() != 0 || !isPublicOrProtected(node); }
Source:
<code>public EDBObject getObject() { Map<String, Object> data = new HashMap<String, Object>(); for (KeyValuePair kvp : values) { data.put(kvp.getKey(), kvp.getValue()); } <START> String s = (String) data.get("@isDeleted"); <END> if (s != null) { data.put("@isDeleted", s.equals("true")); } return new EDBObject(uid, timestamp, data); }</code><technical_language>@isDeleted is a "strange" constant; please constants in constant file</technical_language>

Target:
public EDBObject getObject() { Map<String, Object> data = new HashMap<String, Object>(); for (JPAEntry kvp : entries) { data.put(kvp.getKey(), kvp.getValue()); } String s = (String) data.get("isDeleted"); if (s != null) { data.put("isDeleted", s.equals("true")); } EDBObject object = new EDBObject(oid, data); object.updateTimestamp(timestamp); return object; }
Source:
<code>private DolphinContext createContext() { try{ return new DolphinContext(new DolphinPlatformConfiguration(), new DolphinSessionProvider() { @Override public DolphinSession getCurrentDolphinSession() { return null; } }, new ContainerManagerMock(), new ControllerRepository(classpathScanner), new DefaultOpenDolphinFactory(), new DestroyCallbackMock(), new DestroyCallbackMock()); }catch(ControllerValidationException cve){ <START> return null; <END> } }</code><technical_language>throw exception instead of returning null</technical_language>

Target:
private DolphinContext createContext() throws ControllerValidationException { return new DolphinContext(new DolphinPlatformConfiguration(), new DolphinSessionProvider() { @Override public DolphinSession getCurrentDolphinSession() { return null; } }, new ContainerManagerMock(), new ControllerRepository(classpathScanner), new DefaultOpenDolphinFactory(), new DestroyCallbackMock(), new DestroyCallbackMock()); }
Source:
<code>private void deleteEnumerationLiteralClassifierChanges(ReferenceChange referenceChange) { if (isEnumerationLiteralClassifierChange(referenceChange)) { <START> EcoreUtil.delete(referenceChange); <END> } }</code><technical_language>I deleting diff find implies/impledBy, requires/requiredBy, ... elements referred in EReferences properly referenced in diff represents change. Also, if part of equivalence (is possible?) equivalence diff this is removed, remove equivalence if case. I this logic of deleting a Diff moved a utility method capture this responsibility</technical_language>

Target:
private void deleteEnumerationLiteralClassifierChanges(ReferenceChange referenceChange) { if (isEnumerationLiteralClassifierChange(referenceChange)) { delete(referenceChange); } }
Source:
<code><START> public static Trace createTrace(Optional<Boolean> isObservable, String traceId) { <END> validateId(traceId, "traceId must be non-empty: %s"); boolean observable = isObservable.orElse(sampler.sample()); return new Trace(observable, traceId); }</code><technical_language>I need this need exposed public anymore</technical_language>

Target:
private static Trace createTrace(Optional<Boolean> isObservable, String traceId) { validateId(traceId, "traceId must be non-empty: %s"); boolean observable = isObservable.orElse(sampler.sample()); return new Trace(observable, traceId); }
Source:
<code>private boolean matchesSavedRequest(HttpServletRequest request, SavedRequest savedRequest) { if (savedRequest == null) { return false; <START> } else if (savedRequest instanceof DefaultSavedRequest) { <END> DefaultSavedRequest defaultSavedRequest = (DefaultSavedRequest) savedRequest; return defaultSavedRequest.doesRequestMatch(request, this.portResolver); } else { String currentUrl = UrlUtils.buildFullRequestUrl(request); return savedRequest.getRedirectUrl().equals(currentUrl); } }</code><technical_language>This else if block removed. information saved request URL, is compare</technical_language>

Target:
private boolean matchesSavedRequest(HttpServletRequest request, SavedRequest savedRequest) { if (savedRequest == null) { return false; } else { String currentUrl = UrlUtils.buildFullRequestUrl(request); return savedRequest.getRedirectUrl().equals(currentUrl); } }
Source:
<code>public NetworkQoSCommandBase(NetworkQoSParametersBase parameters) { super(parameters); <START> setStoragePoolId(parameters.getNetworkQoS().getStoragePoolId()); <END> addCustomValue("NetworkQoSName", parameters.getNetworkQoS().getName()); getParameters().setShouldBeLogged(true); }</code><technical_language>please note c'tor is invoked prior other method, including candoaction validations, is a chance a client send incorrect values, e.g providing NetworkQoS entity, NPE safe here</technical_language>

Target:
public NetworkQoSCommandBase(NetworkQoSParametersBase parameters) { super(parameters); if (getNetworkQoS() != null) { setStoragePoolId(getNetworkQoS().getStoragePoolId()); addCustomValue("NetworkQoSName", getNetworkQoS().getName()); } getParameters().setShouldBeLogged(true); addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ADD); }
Source:
<code>public ResultValidator<T> expectEvents(EventMessage... expectedEvents) { <START> this.expectEvents((Object[]) (Stream.of(expectedEvents).map(Message::getPayload).toArray())); <END> Iterator<EventMessage<?>> iterator = publishedEvents.iterator(); for (EventMessage expectedEvent : expectedEvents) { EventMessage actualEvent = iterator.next(); if (!verifyMetaDataEquality(expectedEvent.getPayloadType(), expectedEvent.getMetaData(), actualEvent.getMetaData())) { reporter.reportWrongEvent(publishedEvents, Arrays.asList(expectedEvents), actualException); } } return this; }</code><technical_language>do another map call in between, casts payload object? So, this: this.expectEvents(Stream.of(expectedEvents).map(Message::getPayload).map(payload -> (Object) payload).toArray());</technical_language>

Target:
public ResultValidator<T> expectEvents(EventMessage... expectedEvents) { this.expectEvents(Stream.of(expectedEvents).map(Message::getPayload).toArray()); Iterator<EventMessage<?>> iterator = publishedEvents.iterator(); for (EventMessage expectedEvent : expectedEvents) { EventMessage actualEvent = iterator.next(); if (!verifyMetaDataEquality(expectedEvent.getPayloadType(), expectedEvent.getMetaData(), actualEvent.getMetaData())) { reporter.reportWrongEvent(publishedEvents, Arrays.asList(expectedEvents), actualException); } } return this; }
Source:
<code>protected void parseTickerFromJsonObject(int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { <START> ticker.bid = parsePrice(jsonObject.getJSONObject("message").getDouble("bid")); <END> ticker.ask = parsePrice(jsonObject.getJSONObject("message").getDouble("ask")); ticker.vol = jsonObject.getJSONObject("message").getDouble("coinvolume") / 100000000; ticker.high = parsePrice(jsonObject.getJSONObject("message").getDouble("high")); ticker.low = parsePrice(jsonObject.getJSONObject("message").getDouble("low")); ticker.last = parsePrice(jsonObject.getJSONObject("message").getDouble("lastPrice")); }</code><technical_language>create final JSONObject messageJsonObject = jsonObject.getJSONObject("message"); later</technical_language>

Target:
protected void parseTickerFromJsonObject(int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { final JSONObject messageJsonObject = jsonObject.getJSONObject("message"); ticker.bid = parsePrice(messageJsonObject.getDouble("bid")); ticker.ask = parsePrice(messageJsonObject.getDouble("ask")); ticker.vol = messageJsonObject.getDouble("coinvolume") / 100000000; ticker.high = parsePrice(messageJsonObject.getDouble("high")); ticker.low = parsePrice(messageJsonObject.getDouble("low")); ticker.last = parsePrice(messageJsonObject.getDouble("lastPrice")); }
Source:
<code>public Day deserialize(Object val) { Day date = null; try { if (val instanceof String) { try { date = new Day(new Timestamp(FORMATTER.parse((String) val).getTime())); } catch (ParseException pe) { date = new Day(new Timestamp(ISO_FORMATTER.parse((String) val).getTime())); } } <START> date = new Day(FORMATTER.parse(FORMATTER.format(val))); <END> } catch (ParseException e) { throw new IllegalArgumentException("String must be formatted as " + FORMAT); } return date; }</code><technical_language>This else block get executed val is instanceof string</technical_language>

Target:
public Day deserialize(Object val) { Day date = null; try { if (val instanceof String) { date = new Day(FORMATTER.parse(FORMATTER.format(TimeGrainFormatter.formatDateString(FORMATTER, (String) val)))); } else { date = new Day(FORMATTER.parse(FORMATTER.format(val))); } } catch (ParseException e) { throw new IllegalArgumentException("String must be formatted as " + FORMAT + " or " + TimeGrainFormatter.ISO_FORMAT); } return date; }
Source:
<code>public static IdeDto asDto(Ide ide) { <START> IdeDto ideDto = newDto(IdeDto.class); <END> final OnAppClosed onAppClosed = ide.getOnAppClosed(); final OnAppLoaded onAppLoaded = ide.getOnAppLoaded(); final OnProjectsLoaded onProjectsLoaded = ide.getOnProjectsLoaded(); if (onAppClosed != null) { ideDto.withOnAppClosed(newDto(OnAppClosedDto.class).withActions(asDto(onAppClosed.getActions()))); } if (onAppLoaded != null) { ideDto.withOnAppLoaded(newDto(OnAppLoadedDto.class).withActions(asDto(onAppLoaded.getActions()))); } if (onProjectsLoaded != null) { ideDto.withOnProjectsLoaded(newDto(OnProjectsLoadedDto.class).withActions(asDto(onProjectsLoaded.getActions()))); } return ideDto; }</code><technical_language>variables definition context ideDto modified</technical_language>

Target:
public static IdeDto asDto(Ide ide) { final IdeDto ideDto = newDto(IdeDto.class); final OnAppClosed onAppClosed = ide.getOnAppClosed(); final OnAppLoaded onAppLoaded = ide.getOnAppLoaded(); final OnProjectsLoaded onProjectsLoaded = ide.getOnProjectsLoaded(); if (onAppClosed != null) { ideDto.withOnAppClosed(newDto(OnAppClosedDto.class).withActions(asDto(onAppClosed.getActions()))); } if (onAppLoaded != null) { ideDto.withOnAppLoaded(newDto(OnAppLoadedDto.class).withActions(asDto(onAppLoaded.getActions()))); } if (onProjectsLoaded != null) { ideDto.withOnProjectsLoaded(newDto(OnProjectsLoadedDto.class).withActions(asDto(onProjectsLoaded.getActions()))); } return ideDto; }
Source:
<code>public Mono<? extends AsyncKeyEncryptionKey> buildAsyncKeyEncryptionKey(KeyVaultKey key) { builder.key(key); <START> if (key == null) { throw logger.logExceptionAsError(new IllegalStateException( "Key is required to create key encryption key async client")); } if (key.getKey() == null) { throw logger.logExceptionAsError(new IllegalStateException( "Json Web key is required to create key encryption key async client")); <END> } CryptographyServiceVersion serviceVersion = builder.getServiceVersion() != null ? builder.getServiceVersion() : CryptographyServiceVersion.getLatest(); if (builder.getPipeline() != null) { return Mono.defer(() -> Mono.just(new KeyEncryptionKeyAsyncClient(key, builder.getPipeline(), serviceVersion))); } if (builder.getCredential() == null) { throw logger.logExceptionAsError(new IllegalStateException( "Key Vault credentials are required to build the key encryption key async client")); } HttpPipeline pipeline = builder.setupPipeline(); return Mono.defer(() -> Mono.just(new KeyEncryptionKeyAsyncClient(key, pipeline, serviceVersion))); }</code><technical_language>exceptions do state user do resolve issue. More specificity means confusion for end users</technical_language>

Target:
public Mono<? extends AsyncKeyEncryptionKey> buildAsyncKeyEncryptionKey(KeyVaultKey key) { builder.key(key); if (key == null) { throw logger.logExceptionAsError(new IllegalStateException( "Key Vault Key parameter cannot be null and is required to create key encryption key async client.")); } if (key.getKey() == null) { throw logger.logExceptionAsError(new IllegalStateException( "Json Web key value on the Key Vault Key object cannot be null and is required to create key encryption key async client.")); } CryptographyServiceVersion serviceVersion = builder.getServiceVersion() != null ? builder.getServiceVersion() : CryptographyServiceVersion.getLatest(); if (builder.getPipeline() != null) { return Mono.defer(() -> Mono.just(new KeyEncryptionKeyAsyncClient(key, builder.getPipeline(), serviceVersion))); } if (builder.getCredential() == null) { throw logger.logExceptionAsError(new IllegalStateException( "Key Vault credentials cannot be null and are required to build the key encryption key async client")); } HttpPipeline pipeline = builder.setupPipeline(); return Mono.defer(() -> Mono.just(new KeyEncryptionKeyAsyncClient(key, pipeline, serviceVersion))); }
Source:
<code>public void updateChart(@NonNull Set<@NonNull Integer> quarks) { cancelUpdate(); resetData(); <START> fQuarks.addAll(quarks); <END> updateContent(); }</code><technical_language>fQuarks = quarks</technical_language>

Target:
public void updateChart(@NonNull Set<@NonNull Integer> quarks) { cancelUpdate(); resetData(); fQuarks = quarks; updateContent(); }
Source:
<code>private String getMigrationNetworkIp() { if (!FeatureSupported.migrationNetwork(getVm().getVdsGroupCompatibilityVersion())) { return null; } Network migrationNetwork = null; List<Network> allNetworksInCluster = DbFacade.getInstance().getNetworkDao().getAllForCluster(getVm().getVdsGroupId()); for (Network tempNetwork : allNetworksInCluster) { if (tempNetwork.getCluster().isMigration()) { migrationNetwork = tempNetwork; break; } } if (migrationNetwork != null) { if (getMigrationNetworkAddress(getVds().getId(), migrationNetwork.getName()) == null) { return null; } String dstMigrationIp = getMigrationNetworkAddress(getDestinationVds().getId(), migrationNetwork.getName()); <START> if (dstMigrationIp != null) { <END> return dstMigrationIp; } } return null; }</code><technical_language>check simply return value</technical_language>

Target:
private String getMigrationNetworkIp() { if (!FeatureSupported.migrationNetwork(getVm().getVdsGroupCompatibilityVersion())) { return null; } Network migrationNetwork = null; List<Network> allNetworksInCluster = DbFacade.getInstance().getNetworkDao().getAllForCluster(getVm().getVdsGroupId()); for (Network tempNetwork : allNetworksInCluster) { if (tempNetwork.getCluster().isMigration()) { migrationNetwork = tempNetwork; break; } } if (migrationNetwork != null) { if (getMigrationNetworkAddress(getVds().getId(), migrationNetwork.getName()) == null) { return null; } return getMigrationNetworkAddress(getDestinationVds().getId(), migrationNetwork.getName()); } return null; }
Source:
<code>public void onCascadeEvent(BeforeWorkspaceRemovedEvent event) throws Exception { Optional<KubernetesRuntimeState> k8sRuntimeStateOpt = k8sRuntimes.find(event.getWorkspace().getId()); if (k8sRuntimeStateOpt.isPresent()) { <START> LOG.error("Workspace is removed but Kubernetes runtime state exists"); <END> KubernetesRuntimeState existingK8sRuntimeState = k8sRuntimeStateOpt.get(); k8sRuntimes.remove(existingK8sRuntimeState.getRuntimeId()); } }</code><technical_language>Please add more details this event. WS_ID, user ID, etc. figure out this happens</technical_language>

Target:
public void onCascadeEvent(BeforeWorkspaceRemovedEvent event) throws Exception { Optional<KubernetesRuntimeState> k8sRuntimeStateOpt = k8sRuntimes.find(event.getWorkspace().getId()); if (k8sRuntimeStateOpt.isPresent()) { KubernetesRuntimeState existingK8sRuntimeState = k8sRuntimeStateOpt.get(); RuntimeId runtimeId = existingK8sRuntimeState.getRuntimeId(); LOG.error( format( "Workspace is being removed while Kubernetes runtime state '%s:%s:%s' exists. " + "This situation indicates a bug that needs to be reported. Runtime state " + "will be removed from DB, but Kubernetes resources (pods, pvcs, etc.) " + "won't be cleaned up.", runtimeId.getWorkspaceId(), runtimeId.getEnvName(), runtimeId.getOwnerId())); k8sRuntimes.remove(runtimeId); } }
Source:
<code>public static RyaStatement read(Input input){ String subject = input.readString(); String predicate = input.readString(); String objectType = input.readString(); String objectValue = input.readString(); RyaType value; <START> if (objectType.equals("<LINK_0>")){ <END> value = new RyaURI(objectValue); } else { value = new RyaType(new URIImpl(objectType), objectValue); } RyaStatement statement = new RyaStatement(new RyaURI(subject), new RyaURI(predicate), value); int length = 0; boolean hasNextValue = input.readBoolean(); if (hasNextValue){ statement.setContext(new RyaURI(input.readString())); } hasNextValue = input.readBoolean(); if (hasNextValue){ length = input.readInt(); statement.setColumnVisibility(input.readBytes(length)); } hasNextValue = input.readBoolean(); if (hasNextValue){ statement.setQualifer(input.readString()); } hasNextValue = input.readBoolean(); if (hasNextValue){ statement.setTimestamp(input.readLong()); } hasNextValue = input.readBoolean(); if (hasNextValue){ length = input.readInt(); statement.setValue(input.readBytes(length)); } return statement; }</code><technical_language>Is a constant for this URI somewhere</technical_language>

Target:
public static RyaStatement read(Input input){ Preconditions.checkNotNull(input); String subject = input.readString(); String predicate = input.readString(); String objectType = input.readString(); String objectValue = input.readString(); RyaType value; if (objectType.equals(XMLSchema.ANYURI.toString())){ value = new RyaURI(objectValue); } else { value = new RyaType(new URIImpl(objectType), objectValue); } RyaStatement statement = new RyaStatement(new RyaURI(subject), new RyaURI(predicate), value); int length = 0; boolean hasNextValue = input.readBoolean(); if (hasNextValue){ statement.setContext(new RyaURI(input.readString())); } hasNextValue = input.readBoolean(); if (hasNextValue){ length = input.readInt(); statement.setColumnVisibility(input.readBytes(length)); } hasNextValue = input.readBoolean(); if (hasNextValue){ statement.setQualifer(input.readString()); } hasNextValue = input.readBoolean(); if (hasNextValue){ statement.setTimestamp(input.readLong()); } hasNextValue = input.readBoolean(); if (hasNextValue){ length = input.readInt(); statement.setValue(input.readBytes(length)); } return statement; }
Source:
<code>public void shouldSetMonochromeOnPlugin() { RuntimeOptions runtimeOptions = new RuntimeOptions("--monochrome"); Plugins plugins = new Plugins(getSystemClassLoader(), pluginFactory, runtimeOptions); ColorAware plugin = Mockito.mock(ColorAware.class); plugins.addPlugin(plugin); <START> plugins.setSerialEventBusOnEventListenerPlugins(rootEventPublisher); <END> verify(plugin).setMonochrome(true); }</code><technical_language>suggestion</technical_language>

Target:
public void shouldSetMonochromeOnPlugin() { RuntimeOptions runtimeOptions = new RuntimeOptions("--monochrome"); Plugins plugins = new Plugins(getSystemClassLoader(), pluginFactory, runtimeOptions); ColorAware plugin = Mockito.mock(ColorAware.class); plugins.addPlugin(plugin); verify(plugin).setMonochrome(true); }
Source:
<code>private void validate() { int nParams = nodes.size(); for (int i = 0; i < nParams; ++i) { <START> ArgChecker.isTrue(nodes.get(i).getCurrencyPair().equals(currencyPair), "currency pair must be the same"); <END> ArgChecker.isTrue(nodes.get(i).getStrike() instanceof SimpleStrike, "Strike must be SimpleStrike"); ArgChecker.isTrue(nodes.get(i).getQuoteValueType().equals(ValueType.BLACK_VOLATILITY), "quote value type must be BLACK_VOLATILITY"); } }</code><technical_language>letter of error message upper case. lines down</technical_language>

Target:
private void validate() { int nParams = nodes.size(); for (int i = 0; i < nParams; ++i) { ArgChecker.isTrue(nodes.get(i).getCurrencyPair().equals(currencyPair), "Currency pair must be the same"); ArgChecker.isTrue(nodes.get(i).getStrike() instanceof SimpleStrike, "Strike must be SimpleStrike"); ArgChecker.isTrue(nodes.get(i).getQuoteValueType().equals(ValueType.BLACK_VOLATILITY), "Quote value type must be BLACK_VOLATILITY"); } }
Source:
<code>public static void writeStyle(final InputStream in, final Resource styleFile) throws IOException { BufferedOutputStream out = null; try { out = new BufferedOutputStream(styleFile.out()); IOUtils.copy(in, out); out.flush(); } finally { <START> out.close(); <END> } }</code><technical_language>try-with-resources? tabs fixed</technical_language>

Target:
public static void writeStyle(final InputStream in, final Resource styleFile) throws IOException { try (BufferedOutputStream out = new BufferedOutputStream(styleFile.out())) { IOUtils.copy(in, out); out.flush(); } }
Source:
<code>private void handleNotification(final Observation observation, final LwM2mNode value) { excutorService.submit(new Runnable() { @Override public void run() { String ticket = observatioIdToTicket.get(new KeyId(observation.getId())); try { sendNotification(ticket, value); <START> } catch (Throwable t) { <END> LOG.error("Unable to send Notification.", t); sendError(ticket, String.format("Expected error while sending LWM2M Notification.(%s)", t.getMessage())); } } }); }</code><technical_language>catch RuntimeException</technical_language>

Target:
private void handleNotification(final Observation observation, final LwM2mNode value) { executorService.submit(new Runnable() { @Override public void run() { String ticket = observatioIdToTicket.get(new KeyId(observation.getId())); try { sendNotification(ticket, value); } catch (RuntimeException t) { LOG.error("Unable to send Notification.", t); sendError(ticket, String.format("Expected error while sending LWM2M Notification.(%s)", t.getMessage())); } } }); }
Source:
<code>public boolean checkout() throws IOException { toBeDeleted.clear(); if (headCommitTree != null) preScanTwoTrees(); else prescanOneTree(); if (!conflicts.isEmpty()) { if (failOnConflict) { dc.unlock(); throw new CheckoutConflictException(conflicts.toArray(new String[conflicts.size()])); } else cleanUpConflicts(); } builder.finish(); File file=null; String last = ""; for (int i = removed.size() - 1; i >= 0; i--) { String r = removed.get(i); file = new File(repo.getWorkTree(), r); if (!file.delete() && file.exists()) toBeDeleted.add(r); else { if (!isSamePrefix(r, last)) <START> removeEmptyParents(new File(repo.getWorkTree(), last)); <END> last = r; } } if (file != null) removeEmptyParents(file); for (String path : updated.keySet()) { file = new File(repo.getWorkTree(), path); if (!file.getParentFile().mkdirs()) { } DirCacheEntry entry = dc.getEntry(path); if (FileMode.GITLINK.equals(entry.getRawMode())) continue; checkoutEntry(repo, file, entry); } if (!builder.commit()) { dc.unlock(); throw new IndexWriteException(); } return toBeDeleted.size() == 0; }</code><technical_language>Thanks Thomasz. a amazing bug: - unit tests covered line - succesfull unit tests covered functionality of deleting empty dir's (they worked of removedEmptyParents() call loop) - code multiple reviews ... this bug managed undetected. Good job</technical_language>

Target:
public boolean checkout() throws IOException { try { return doCheckout(); } finally { dc.unlock(); } }
Source:
<code>public void updateByXml(Source source) throws IOException { checkPermission(CONFIGURE); StringWriter out = new StringWriter(); try { XMLUtils.safeTransform(source, new StreamResult(out)); out.close(); } catch (TransformerException|SAXException e) { throw new IOException("Failed to persist configuration.xml", e); } try (InputStream in = new BufferedInputStream(new ByteArrayInputStream(out.toString().getBytes("UTF-8")))){ String oldname = name; Object o = Jenkins.XSTREAM.unmarshal(new Xpp3Driver().createReader(in), this); <START> if (o!=this) { <END> throw new IOException("Expecting "+this.getClass()+" but got "+o.getClass()+" instead"); } name = oldname; } catch (StreamException | ConversionException | Error e) { throw new IOException("Unable to read",e); } save(); }</code><technical_language>!o.getClass().equals(getClass())</technical_language>

Target:
public void updateByXml(Source source) throws IOException { checkPermission(CONFIGURE); StringWriter out = new StringWriter(); try { XMLUtils.safeTransform(source, new StreamResult(out)); out.close(); } catch (TransformerException|SAXException e) { throw new IOException("Failed to persist configuration.xml", e); } try (InputStream in = new BufferedInputStream(new ByteArrayInputStream(out.toString().getBytes("UTF-8")))){ String oldname = name; Object o = Jenkins.XSTREAM.unmarshal(new Xpp3Driver().createReader(in), this); if (!o.getClass().equals(getClass())) { throw new IOException("Expecting view type: "+this.getClass()+" but got: "+o.getClass()+" instead." + "\nShould you needed to change to a new view type, you must first delete and then re-create " + "the view with the new view type."); } name = oldname; } catch (StreamException | ConversionException | Error e) { throw new IOException("Unable to read",e); } save(); }
Source:
<code>public void visitNode(Tree tree) { <START> UnaryExpressionTree temp = (UnaryExpressionTree) tree; <END> if (usedForDoublePrefix(temp)) { return; } ExpressionTree expr = ExpressionUtils.skipParentheses(temp.expression()); if (temp.is(expr.kind())) { prefixSet.add(expr); reportIssue(temp.operatorToken(), ((UnaryExpressionTree) expr).operatorToken(), "Remove multiple operator prefixes."); } }</code><technical_language>Rename temp a meaningful name</technical_language>

Target:
public void visitNode(Tree tree) { UnaryExpressionTree exprTree = (UnaryExpressionTree) tree; if (alreadyReported(exprTree)) { return; } ExpressionTree expr = ExpressionUtils.skipParentheses(exprTree.expression()); if (exprTree.is(expr.kind())) { UnaryExpressionTree child = (UnaryExpressionTree) expr; if (child.is(Tree.Kind.BITWISE_COMPLEMENT) && !ExpressionUtils.skipParentheses(child.expression()).is(Tree.Kind.BITWISE_COMPLEMENT)) { return; } prefixSet.add(child); reportIssue(exprTree.operatorToken(), child.operatorToken(), "Remove multiple operator prefixes."); } }
Source:
<code>private VirtualMachineScaleSet CreateOrUpdateVMSS(VirtualMachineScaleSetApi vmssAPI) { return vmssAPI.createOrUpdate( vmssname, "eastus", VirtualMachineScaleSetSKU.create( "Standard_A1", "Standard", 10), null, VirtualMachineScaleSetProperties.create( true, true, VirtualMachineScaleSetUpgradePolicy.create("Manual"), VirtualMachineScaleSetVirtualMachineProfile.create( StorageProfile.create( ImageReference.create( null, "Canonical", "UbuntuServer", "16.04-LTS", "latest"), OSDisk.create( "Windows", null, <START> null, <END> null, "FromImage", null, ManagedDiskParameters.create( null, "Standard_LRS"), null), Arrays.asList(DataDisk.create( null, "10", 1, null, null, "FromImage", "None", ManagedDiskParameters.create( null, "Standard_LRS"), null))), VirtualMachineScaleSetOSProfile.create( "jclouds-vmssname", "jclouds", "jClouds1!", VirtualMachineScaleSetOSProfile.LinuxConfiguration.create( "False", null), null, new ArrayList<Secrets>()), getNetworkProfile(), getExtensionProfile() ) )); }</code><technical_language>here. "testCreate" complete enough validate properties want validate remove redundant ones</technical_language>

Target:
private VirtualMachineScaleSet CreateOrUpdateVMSS(VirtualMachineScaleSetApi vmssAPI) { return vmssAPI.createOrUpdate( vmssname, "eastus", VirtualMachineScaleSetSKU.create( "Standard_A1", "Standard", 10), null, VirtualMachineScaleSetProperties.create( true, true, VirtualMachineScaleSetUpgradePolicy.create("Manual"), null, VirtualMachineScaleSetVirtualMachineProfile.create( StorageProfile.create( ImageReference.create( null, "Canonical", "UbuntuServer", "16.04-LTS", "latest"), OSDisk.create( "Windows", null, null, null, "FromImage", null, ManagedDiskParameters.create( null, "Standard_LRS"), null), Arrays.asList(DataDisk.create( null, "10", 1, null, null, "FromImage", "None", ManagedDiskParameters.create( null, "Standard_LRS"), null))), VirtualMachineScaleSetOSProfile.create( "jclouds-vmssname", "admin", "password", VirtualMachineScaleSetOSProfile.LinuxConfiguration.create( false, null), null, new ArrayList<Secrets>()), getNetworkProfile(), getExtensionProfile() ) )); }
Source:
<code>public void accumulate(final VariantContext vc) { progress.record(vc.getContig(), vc.getStart()); if (!isVariantExcluded(vc)) { final String singletonSample = getSingletonSample(vc); updateSummaryMetric(summaryMetric, null, vc, singletonSample != null); vc.getSampleNames().stream() <START> .filter(sampleName -> vc.getGenotype(sampleName).isHomRef()) <END> .forEach(sampleName -> sampleMetricsMap.get(sampleName)); vc.getSampleNames().stream() .filter(sampleName -> !vc.getGenotype(sampleName).isHomRef()) .forEach(sampleName -> updateDetailMetric(sampleMetricsMap.get(sampleName), vc.getGenotype(sampleName), vc, sampleName.equals(singletonSample))); } }</code><technical_language>This add a lot of compute in large call-sets vast majority of genotypes HomRef. change setup function be: java public void setup(final VCFHeader vcfHeader) { vcfHeader.getGenotypeSamples().stream().forEach(sampleName -> sampleMetricsMap.get(sampleName)); } avoid calling get a lot more times intended</technical_language>

Target:
public void accumulate(final VariantContext vc) { progress.record(vc.getContig(), vc.getStart()); if (!isVariantExcluded(vc)) { final String singletonSample = getSingletonSample(vc); updateSummaryMetric(summaryMetric, null, vc, singletonSample != null); vc.getSampleNames().stream() .filter(sampleName -> !vc.getGenotype(sampleName).isHomRef()) .forEach(sampleName -> updateDetailMetric(sampleMetricsMap.get(sampleName), vc.getGenotype(sampleName), vc, sampleName.equals(singletonSample))); } }
Source:
<code>public void process(Class<?> context, Object testInstance) { Field[] fields = context.getDeclaredFields(); for (Field field : fields) { if (field.isAnnotationPresent(Spy.class) && !field.isAnnotationPresent(InjectMocks.class)) { assertNoIncompatibleAnnotations(Spy.class, field, Mock.class, Captor.class); field.setAccessible(true); Object instance; try { instance = field.get(testInstance); assertNotInterface(instance, field.getType()); if (MockUtil.isMock(instance)) { Mockito.reset(instance); } else if (instance != null) { field.set(testInstance, Mockito.mock(instance.getClass(), withSettings().spiedInstance(instance) .defaultAnswer(CALLS_REAL_METHODS) .name(field.getName()))); } else { field.set(testInstance, newSpyInstance(testInstance, field)); } } catch (Exception e) { <START> e.printStackTrace(); <END> throw new MockitoException("Unable to initialize @Spy annotated field '" + field.getName() + "'.\n" + e.getMessage(), e); } } } }</code><technical_language>I assume want get rid of this line</technical_language>

Target:
public void process(Class<?> context, Object testInstance) { Field[] fields = context.getDeclaredFields(); for (Field field : fields) { if (field.isAnnotationPresent(Spy.class) && !field.isAnnotationPresent(InjectMocks.class)) { assertNoIncompatibleAnnotations(Spy.class, field, Mock.class, Captor.class); field.setAccessible(true); Object instance; try { instance = field.get(testInstance); assertNotInterface(instance, field.getType()); if (MockUtil.isMock(instance)) { Mockito.reset(instance); } else if (instance != null) { field.set(testInstance, spyInstance(field, instance)); } else { field.set(testInstance, spyNewInstance(testInstance, field)); } } catch (Exception e) { throw new MockitoException("Unable to initialize @Spy annotated field '" + field.getName() + "'.\n" + e.getMessage(), e); } } } }
Source:
<code>public static double[] noDuplicates(double[] argument, String name) { notNull(argument, name); <START> if (argument.length > 0 && DoubleStream.of(argument).distinct().count() != argument.length) { <END> throw new IllegalArgumentException(noDuplicatesArrayMsg(name)); } return argument; }</code><technical_language>I thought DoubleStream.of(argument).distinct().count() fast</technical_language>

Target:
public static double[] noDuplicates(double[] argument, String name) { notNull(argument, name); if (argument.length > 1) { Set<Double> seen = new LinkedHashSet<>(); for (double v : argument) { if (!seen.add(v)) { throw new IllegalArgumentException(noDuplicatesArrayMsg(name)); } } } return argument; }
Source:
<code>public Builder setRecordCount(@DnsSection int sec, int count) { <START> if (count < 0) throw new IllegalArgumentException("Bad record count: " + count); <END> mRecordCount[sec] = count; return this; }</code><technical_language>want validate |sec|. @SystemApi matter though</technical_language>

Target:
public Builder setRecordCount(@DnsSection int sec, int count) { if (sec > DnsPacket.ARSECTION || sec < DnsPacket.QDSECTION) { throw new IllegalArgumentException("Bad sec: " + sec); } if (count < 0) throw new IllegalArgumentException("Bad record count: " + count); mRecordCount[sec] = count; return this; }
Source:
<code>public IStatus unloadAtResourceSetDispose(Resource resource, IProgressMonitor monitor) { try { if (!isFromPackageRegistry(resource)) { resource.unload(); } } catch (final IllegalStateException e) { return new Status(IStatus.WARNING, SiriusPlugin.ID, MessageFormat.format(Messages.DAnalysisSessionImpl_unloadingErrorMsg, e.getMessage()), e); } return new <START> Status(IStatus.INFO, SiriusPlugin.ID, <END> ""); }</code><technical_language>IStatus.OK? ("this status represents nominal case")</technical_language>

Target:
public IStatus unloadAtResourceSetDispose(Resource resource, IProgressMonitor monitor) { try { if (!isFromPackageRegistry(resource)) { resource.unload(); } } catch (final IllegalStateException e) { return new Status(IStatus.WARNING, SiriusPlugin.ID, MessageFormat.format(Messages.DAnalysisSessionImpl_unloadingErrorMsg, e.getMessage()), e); } return new Status(IStatus.OK, SiriusPlugin.ID, ""); }
Source:
<code>public void teardown() throws Exception { dbHelper.onTearDown(); configHelper.onTearDown(); <START> notifier.enableUpdates(); <END> }</code><technical_language>Usually, is done end of setUp is reverted beginning of teardown. Convention, though. super important</technical_language>

Target:
public void teardown() throws Exception { notifier.enableUpdates(); dbHelper.onTearDown(); configHelper.onTearDown(); }
Source:
<code>public void testIndexSeekAndScan() throws Exception { updateAndCommit( asList( IndexEntryUpdate.add( 1L, descriptor, "a", "a" ), IndexEntryUpdate.add( 2L, descriptor, "a", "a" ), IndexEntryUpdate.add( 3L, descriptor, "b", "b" ) ) ); assertThat( getAllNodesWithProperties( "a", "a" ), equalTo( asList( 1L, 2L ) ) ); <START> assertThat( getAllNodes(), equalTo( asList( 1L, 2L, 3L ) ) ); <END> }</code><technical_language>clear implementation considers properties, I add IndexEntryUpdate.add( 1L, descriptor, "a", "b" )</technical_language>

Target:
public void testIndexSeekAndScan() throws Exception { updateAndCommit( asList( IndexEntryUpdate.add( 1L, descriptor, "a", "a" ), IndexEntryUpdate.add( 2L, descriptor, "a", "a" ), IndexEntryUpdate.add( 3L, descriptor, "b", "b" ), IndexEntryUpdate.add( 4L, descriptor, "a", "b" ) ) ); assertThat( query( exact( 0, "a" ), exact( 1, "a" ) ), equalTo( asList( 1L, 2L ) ) ); assertThat( query( exact( 0, "b" ), exact( 1, "b" ) ), equalTo( asList( 3L ) ) ); assertThat( query( exact( 0, "a" ), exact( 1, "b" ) ), equalTo( asList( 4L ) ) ); assertThat( query( exists( 1 ) ), equalTo( asList( 1L, 2L, 3L, 4L ) ) ); }