auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void renderCommands() { commandTable.removeAllRows(); if (scheme.getItemCount() > 0) { <START> FetchInfo fetchInfo = fetch.get(scheme.getValue(scheme.getSelectedIndex())); <END> for (String commandName : Natives.keys(fetchInfo.commands())) { String command = fetchInfo.command(commandName); if (command.contains("@*:")) { command = command.replace("@*:", "@" + Window.Location.getHostName() + ":"); } CopyableLabel copyLabel = new CopyableLabel(command); copyLabel.setStyleName(Gerrit.RESOURCES.css().downloadBoxCopyLabel()); insertCommand(commandName, copyLabel); } } insertPatch(); insertCommand(null, scheme); }</code><technical_language>wrap this line</technical_language>

Target:
private void renderCommands() { commandTable.removeAllRows(); if (scheme.getItemCount() > 0) { FetchInfo fetchInfo = fetch.get(scheme.getValue(scheme.getSelectedIndex())); for (String commandName : Natives.keys(fetchInfo.commands())) { String command = fetchInfo.command(commandName); if (command.contains("@*:")) { command = command.replace("@*:", "@" + Window.Location.getHostName() + ":"); } CopyableLabel copyLabel = new CopyableLabel(command); copyLabel.setStyleName(style.clippy()); insertCommand(commandName, copyLabel); } } insertPatch(); insertCommand(null, scheme); }
Source:
<code>private Set<String> readUsernamesFromFile() { try { <START> Stream<String> lines = Files.lines(source); <END> Set<String> res = new HashSet<>(); lines.forEach(name -> res.add(name.trim())); return res; } catch (IOException e) { e.printStackTrace(); return Collections.emptySet(); } }</code><technical_language>do return Files.lines(source).map(String::trim).collect(Collectors.toSet());</technical_language>

Target:
private Set<String> readUsernamesFromFile() { try { return Files.lines(source) .map(String::trim) .collect(Collectors.toSet()); } catch (IOException e) { e.printStackTrace(); return Collections.emptySet(); } }
Source:
<code><START> public PlannerTestCase() { <END> }</code><technical_language>Minor: add super(); here</technical_language>

Target:
public PlannerTestCase() { super(); }
Source:
<code>protected Boolean checkIfMainPage() { Global.LOG_ENABLED = false; try { <START> driver.findElement(By.cssSelector("body.mainpage")); <END> } catch (NoSuchElementException e) { Global.LOG_ENABLED = true; return false; } Global.LOG_ENABLED = true; return true; }</code><technical_language>get body check if class "mainpage"</technical_language>

Target:
protected Boolean checkIfMainPage() { WebElement body = driver.findElement(By.cssSelector("body")); return (body.getAttribute("class").contains("mainpage")); }
Source:
<code>public void init() { try { eventBus.registerSubscriber(this); <START> currentStatus.compareAndSet(InstanceInfo.InstanceStatus.UNKNOWN, client.getInstanceRemoteStatus()); <END> } catch (InvalidSubscriberException e) { LOG.error("Error registring for discovery status change events.", e); } }</code><technical_language>@PostConstruct called concurrently, rite? Do need current status AtomicRef</technical_language>

Target:
public void init() { try { eventBus.registerSubscriber(this); currentStatus = client.getInstanceRemoteStatus(); } catch (InvalidSubscriberException e) { LOG.error("Error registring for discovery status change events.", e); } }
Source:
<code>private boolean isRootShardingKey(Map<String, List<String>> routingData) { if (routingData.values().size() == 1) { for (List<String> shardingKeys : routingData.values()) { return shardingKeys.size() == 1 <START> && (shardingKeys.get(0).equals(DELIMITER) || shardingKeys.get(0).equals("")); <END> } } return false; }</code><technical_language>shardingKeys.get(0).equals("") shardingKeys.get(0).isEmpty()</technical_language>

Target:
private boolean isRootShardingKey(Map<String, List<String>> routingData) { if (routingData.size() == 1) { for (List<String> shardingKeys : routingData.values()) { return shardingKeys.size() == 1 && shardingKeys.get(0).equals(DELIMITER); } } return false; }
Source:
<code>public void branchDelete(BranchDeleteRequest request) throws GitException, UnauthorizedException { String remoteName = null; String branchName = getBranchRef(request.getName()); BranchDeleteCommand branchDeleteCommand = null; if (branchName.startsWith("refs/")) { branchName = parseBranchName(branchName); <START> } else if (branchName.startsWith("refs/remotes/")) { <END> remoteName = parseRemoteName(branchName); String remoteUri; try { remoteUri = nativeGit.createRemoteListCommand() .setRemoteName(remoteName) .execute() .get(0) .getUrl(); } catch (GitException ignored) { remoteUri = remoteName; } if (Util.isSSH(remoteUri)) { branchDeleteCommand = nativeGit.createBranchDeleteCommand(keysManager.writeKeyFile(remoteUri).getAbsolutePath()); } } if (branchDeleteCommand == null) { branchDeleteCommand = nativeGit.createBranchDeleteCommand(); } if (remoteName != null) { branchDeleteCommand.setBranchName(branchName) .setRemote(remoteName) .setDeleteFullyMerged(request.isForce()); executeWithCredentials(branchDeleteCommand, remoteName); } else { branchDeleteCommand.setBranchName(branchName) .setDeleteFullyMerged(request.isForce()); branchDeleteCommand.execute(); } }</code><technical_language>if branch name called smth "refs/remotes/bla-bla" this block of code skipped</technical_language>

Target:
public void branchDelete(BranchDeleteRequest request) throws GitException, UnauthorizedException { String branchName = getBranchRef(request.getName()); String remoteName = null; BranchDeleteCommand branchDeleteCommand = null; if (branchName.startsWith("refs/remotes/")) { remoteName = parseRemoteName(branchName); String remoteUri; try { remoteUri = nativeGit.createRemoteListCommand() .setRemoteName(remoteName) .execute() .get(0) .getUrl(); } catch (GitException ignored) { remoteUri = remoteName; } if (Util.isSSH(remoteUri)) { branchDeleteCommand = nativeGit.createBranchDeleteCommand(keysManager.writeKeyFile(remoteUri).getAbsolutePath()); } } branchName = parseBranchName(branchName); if (branchDeleteCommand == null) { branchDeleteCommand = nativeGit.createBranchDeleteCommand(); } branchDeleteCommand.setBranchName(branchName); branchDeleteCommand.setRemote(remoteName); branchDeleteCommand.setDeleteFullyMerged(request.isForce()); executeWithCredentials(branchDeleteCommand, remoteName); }
Source:
<code>private void glusterHostRemove(Guid sourceClusterId) { <START> boolean forceAction = false; <END> if (getClusterUtils().hasServers(sourceClusterId) && !getClusterUtils().hasVolumeOnServer(getVdsId())) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((getClusterUtils().getUpServer(sourceClusterId)).getId(), getVds().gethost_name(), forceAction)); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { getReturnValue().getFault().setError(returnValue.getVdsError().getCode()); getReturnValue().getFault().setMessage(returnValue.getVdsError().getMessage()); errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; return; } } else { setSucceeded(true); } }</code><technical_language>assume stuff wait for frontend implementation? add force option parameters it, false default, behaviour</technical_language>

Target:
private void glusterHostRemove(Guid sourceClusterId) { if (getClusterUtils().hasServers(sourceClusterId) && !getClusterUtils().hasVolumeOnServer(getVdsId())) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((getClusterUtils().getUpServer(sourceClusterId)).getId(), getVds().gethost_name(), false)); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { getReturnValue().getFault().setError(returnValue.getVdsError().getCode()); getReturnValue().getFault().setMessage(returnValue.getVdsError().getMessage()); errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; return; } } }
Source:
<code>public static <T> Map<String, T> safeGetMap(Map map, String key, Class<T> valueType) { Map<?, ?> unchecked = safeGet(map, key, Map.class); if (unchecked == null) { <START> return null; <END> } try { return unchecked .entrySet() .stream() .map(e -> new AbstractMap.SimpleEntry<>(String.class.cast(e.getKey()), e.getValue())) .map(e -> new AbstractMap.SimpleEntry<>(e.getKey(), valueType.cast(e.getValue()))) .collect( Collectors.toMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue)); } catch (ClassCastException e) { LOGGER.debug(EXCEPTION_OCCURRED_PARSING, e); LOGGER.warn( "Form configuration field was malformed, expected a querySettings Map containing type {}", key, valueType.getName()); } return null; }</code><technical_language>Return empty map instead of null (same for L59)</technical_language>

Target:
public static <T> Map<String, T> safeGetMap(Map map, String key, Class<T> valueType) { Map<?, ?> unchecked = safeGet(map, key, Map.class); if (unchecked == null) { return Collections.emptyMap(); } try { return unchecked .entrySet() .stream() .map(e -> new AbstractMap.SimpleEntry<>(String.class.cast(e.getKey()), e.getValue())) .map(e -> new AbstractMap.SimpleEntry<>(e.getKey(), valueType.cast(e.getValue()))) .collect( Collectors.toMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue)); } catch (ClassCastException e) { LOGGER.debug(EXCEPTION_OCCURRED_PARSING, e); LOGGER.warn( "Form configuration field was malformed, expected a querySettings Map containing type {}", key, valueType.getName()); } return Collections.emptyMap(); }
Source:
<code>public void testSimplePlainTextMessage() throws MessagingException { String bodyText = "K-9 Mail rocks :>"; TextBody body = new TextBody(bodyText); MimeMessage message = new MimeMessage(); MimeMessageHelper.setBody(message, body); List<Part> outputNonViewableParts = new ArrayList<Part>(); ArrayList<Viewable> outputViewableParts = new ArrayList<>(); MessageExtractor.findViewablesAndAttachments(message, outputViewableParts, outputNonViewableParts); <START> ViewableExtractedText container = extractTextFromViewables(RuntimeEnvironment.application, outputViewableParts); <END> String expectedText = bodyText; String expectedHtml = "<pre class=\"k9mail\">" + "K-9 Mail rocks :&gt;" + "</pre>"; assertEquals(expectedText, container.text); assertEquals(expectedHtml, container.html); }</code><technical_language>Please RuntimeEnvironment.application in tests. Assign a field context in setUp() reference instead</technical_language>

Target:
public void testSimplePlainTextMessage() throws MessagingException { TextBody body = new TextBody(BODY_TEXT); MimeMessage message = new MimeMessage(); MimeMessageHelper.setBody(message, body); List<Part> outputNonViewableParts = new ArrayList<Part>(); ArrayList<Viewable> outputViewableParts = new ArrayList<>(); MessageExtractor.findViewablesAndAttachments(message, outputViewableParts, outputNonViewableParts); ViewableExtractedText container = messageViewInfoExtractor.extractTextFromViewables(outputViewableParts); String expectedText = BODY_TEXT; String expectedHtml = "<pre class=\"k9mail\">" + "K-9 Mail rocks :&gt;" + "</pre>"; assertEquals(expectedText, container.text); assertEquals(expectedHtml, getHtmlBodyText(container.html)); }
Source:
<code>public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(final MethodDescriptor<ReqT, RespT> method, final CallOptions callOptions, final Channel next) { return new SimpleForwardingClientCall<ReqT, RespT>(next.newCall(method, callOptions)) { @Override public void start(Listener<RespT> responseListener, Metadata headers) { clientRequestInterceptor.handle(new GrpcClientRequestAdapter<>(method, headers)); final Span currentClientSpan = clientSpanThreadBinder.getCurrentClientSpan(); super.start(new SimpleForwardingClientCallListener<RespT>(responseListener) { @Override public void onClose(Status status, Metadata trailers) { <START> clientSpanThreadBinder.setCurrentSpan(currentClientSpan); <END> clientResponseInterceptor.handle(new GrpcClientResponseAdapter(status)); super.onClose(status, trailers); } }, headers); } }; }</code><technical_language>I move clientSpanThreadBinder, clientResponseInterceptor fields a new type ClientCallListenerFactory, ClientCallListenerFactory.create(Span currentClientSpan)</technical_language>

Target:
public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(final MethodDescriptor<ReqT, RespT> method, final CallOptions callOptions, final Channel next) { return new SimpleForwardingClientCall<ReqT, RespT>(next.newCall(method, callOptions)) { @Override public void start(Listener<RespT> responseListener, Metadata headers) { clientRequestInterceptor.handle(new HttpClientRequestAdapter( new GrpcHttpClientRequest<>(method, headers), new StringServiceNameProvider(clientService), new MethodSpanNameProvider<>(method))); final Span currentClientSpan = clientSpanThreadBinder.getCurrentClientSpan(); super.start(new SimpleForwardingClientCallListener<RespT>(responseListener) { @Override public void onClose(Status status, Metadata trailers) { try { clientSpanThreadBinder.setCurrentSpan(currentClientSpan); clientResponseInterceptor.handle(new HttpClientResponseAdapter(new GrpcHttpResponse(status))); super.onClose(status, trailers); } finally { clientSpanThreadBinder.setCurrentSpan(null); } } }, headers); } }; }
Source:
<code>public static void setValidWriteIdList(Configuration conf, TableScanDesc tsDesc) { String dbName = tsDesc.getDatabaseName(); String tableName = tsDesc.getTableName(); if ((dbName != null) && (tableName != null)) { ValidWriteIdList validWriteIdList = getTableValidWriteIdList(conf, AcidUtils.getFullTableName(dbName, tableName)); if (validWriteIdList != null) { setValidWriteIdList(conf, validWriteIdList); } else if (HiveConf.getBoolVar(conf, ConfVars.HIVE_TRANSACTIONAL_TABLE_SCAN, false)) { <START> LOG.error("setValidWriteIdList on table: " + AcidUtils.getFullTableName(dbName, tableName) <END> + " isAcidTable: " + HiveConf.getBoolVar(conf, ConfVars.HIVE_TRANSACTIONAL_TABLE_SCAN, false) + " acidProperty: " + getAcidOperationalProperties(conf) + " couldn't find the ValidWriteId list from ValidTxnWriteIdList: " + conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY)); } } }</code><technical_language>this throw? a serious error if is info for table processing compound issues</technical_language>

Target:
public static void setValidWriteIdList(Configuration conf, TableScanDesc tsDesc) { if (tsDesc.isTranscationalTable()) { String dbName = tsDesc.getDatabaseName(); String tableName = tsDesc.getTableName(); ValidWriteIdList validWriteIdList = getTableValidWriteIdList(conf, AcidUtils.getFullTableName(dbName, tableName)); if (validWriteIdList != null) { setValidWriteIdList(conf, validWriteIdList); } else { LOG.error("setValidWriteIdList on table: " + AcidUtils.getFullTableName(dbName, tableName) + " isAcidTable: " + true + " acidProperty: " + getAcidOperationalProperties(conf) + " couldn't find the ValidWriteId list from ValidTxnWriteIdList: " + conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY)); throw new IllegalStateException("ACID table: " + AcidUtils.getFullTableName(dbName, tableName) + " is missing from the ValidWriteIdList config: " + conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY)); } } }
Source:
<code>public void testNoValues() { Stats s = new Stats(); assertTrue(Double.isNaN(s.var())); assertTrue(Double.isNaN(s.stddev())); s.add(42.3); assertTrue(Double.isNaN(s.var())); <START> assertTrue(Double.isNaN(s.stddev())); <END> }</code><technical_language>add more check non-NaNs 2</technical_language>

Target:
public void testNoValues() { Stats s = new Stats(); assertTrue(Double.isNaN(s.var())); assertTrue(Double.isNaN(s.stddev())); assertTrue(Double.isNaN(s.avg())); assertTrue(Double.isNaN(s.min())); assertTrue(Double.isNaN(s.max())); s.add(42.3); assertTrue(Double.isNaN(s.var())); assertTrue(Double.isNaN(s.stddev())); assertEquals(42.3, s.avg(), 1E-6); assertEquals(42.3, s.max(), 1E-6); assertEquals(42.3, s.min(), 1E-6); s.add(42.3); assertEquals(0, s.var(), 1E-6); assertEquals(0, s.stddev(), 1E-6); }
Source:
<code>private static void setStatus(ITmfStateSystemBuilder ss, long status, int curThreadNode, @Nullable Long cpu, long timestamp, long type) { ITmfStateValue value; <START> if (ss.queryOngoingState(curThreadNode).isNull()) { <END> value = ProcessStatus.getStatusFromStatedump(status).getStateValue(); ss.modifyAttribute(timestamp, value.unboxValue(), curThreadNode); if (status == LinuxValues.STATEDUMP_PROCESS_STATUS_WAIT_CPU) { setRunQueue(ss, curThreadNode, cpu, timestamp); } if (type != 0) { int sysallQuark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.SYSTEM_CALL); ss.modifyAttribute(timestamp, "", sysallQuark); } } }</code><technical_language>sets kernel mode thread status is null, run before. If ran, thought in user mode realize kernel, update syscall "" anyway, no? kernel threads run system calls well</technical_language>

Target:
private static void setStatus(ITmfStateSystemBuilder ss, long status, int curThreadNode, @Nullable Long cpu, long timestamp, long type) { ITmfStateValue value; if (ss.queryOngoingState(curThreadNode).isNull()) { value = ProcessStatus.getStatusFromStatedump(status).getStateValue(); ss.modifyAttribute(timestamp, value.unboxValue(), curThreadNode); if (status == LinuxValues.STATEDUMP_PROCESS_STATUS_WAIT_CPU) { setRunQueue(ss, curThreadNode, cpu, timestamp); } } if (type != 0) { int sysallQuark = ss.getQuarkRelativeAndAdd(curThreadNode, Attributes.SYSTEM_CALL); ss.modifyAttribute(timestamp, "", sysallQuark); } }
Source:
<code>private EntryLogAndLockTuple(long ledgerId) { <START> int lockIndex = Math.abs(Long.hashCode(ledgerId) % lockArrayPool.length()); <END> if (lockArrayPool.get(lockIndex) == null) { lockArrayPool.compareAndSet(lockIndex, null, new ReentrantLock()); } ledgerLock = lockArrayPool.get(lockIndex); }</code><technical_language>If hashCode() returns a negative, modulo operation fail anyway. I MathUtils.signSafeMod() here</technical_language>

Target:
private EntryLogAndLockTuple(long ledgerId) { int lockIndex = MathUtils.signSafeMod(Long.hashCode(ledgerId), lockArrayPool.length()); if (lockArrayPool.get(lockIndex) == null) { lockArrayPool.compareAndSet(lockIndex, null, new ReentrantLock()); } ledgerLock = lockArrayPool.get(lockIndex); }
Source:
<code>public static <K, V> TypeToken<CorfuTable<K, V>> getMapType() { return new TypeToken<CorfuTable<K, V>>() { }; <END> <START> }</code><technical_language>please revert this file. bunch of conflicts changes</technical_language>

Target:
getMapType() { return new TypeToken<CorfuTable<K, V>>() {}; }
Source:
<code>public static NicType fromValue(String value) { Optional<NicType> nicType = Enums.getIfPresent(NicType.class, value.toUpperCase()); <START> checkArgument(nicType.isPresent(), "Expected one of %s but was %s", Joiner.on(',').join(Policy.values()), value); <END> return nicType.get(); }</code><technical_language>NicType.values()</technical_language>

Target:
public static NicType fromValue(String value) { Optional<NicType> nicType = Enums.getIfPresent(NicType.class, value.toUpperCase()); checkArgument(nicType.isPresent(), "Expected one of %s but was %s", Joiner.on(',').join(NicType.values()), value); return nicType.get(); }
Source:
<code>public void run() { <START> UserFilter userFilter = new UserFilter("", true); <END> UserAccount localUserAccount = userAccountRepository.getUser(userFilter, NetworkStrategy.LocalFirst); userFilter = new UserFilter(localUserAccount.getUserUid(), false); UserAccount updatedUserAccount = userAccountRepository.getUser(userFilter, NetworkStrategy.NetworkFirst); if(updatedUserAccount==null){ notifyError(localUserAccount); return; } if(localUserAccount.getAnnouncement()!=null && !localUserAccount.getAnnouncement().isEmpty() && !localUserAccount.getAnnouncement().equals(updatedUserAccount.getAnnouncement())){ PreferencesState.getInstance().setUserAccept(false); } notifyOnComplete(updatedUserAccount); }</code><technical_language>In this case some improvements realize: - UseCase invoke PreferencesState.getInstance().setUserAccept - UserAccept is a concept of user in UserAccount in database - logic set UserAccept false UserAccount entity is a Bussiness Rule logic values decide UserAccount create a unit test validate logic - UseCase execute repository LocalFirst NetworkFirst - UserFilter passed UseCase</technical_language>

Target:
public void run() { UserAccount updatedUserAccount = null; try { updatedUserAccount = userAccountRepository.getUser(networkStrategy); } catch (Exception e){ notifyError(); } notifyOnComplete(updatedUserAccount); }
Source:
<code>public Monitor(Map conf, final String boltService) { startTimestampPerId = CacheBuilder.newBuilder() <START> .maximumSize(1000) <END> .expireAfterWrite(60, TimeUnit.MINUTES) .concurrencyLevel(2) .removalListener(new RemovalListener<Object, Long>() { @Override public void onRemoval(RemovalNotification<Object, Long> notification) { if (notification.getCause() != RemovalCause.EXPLICIT) { ExceptionEvent event = new ExceptionEvent("Latency object unexpectedly removed"); event.attribute("removalCause", notification.getCause().name()); event.service(boltService); send(event); } } }) .build(); if (RiemannDiscovery.getInstance().isAWS()) { eventSender = RiemannEventSender.getInstance(); } else { eventSender = new LoggerEventSender(); } customAttributes = extractCustomEventAttributes(conf); }</code><technical_language>this conf.... validateConfiguration(conf) { Preconditions.checkNotNull(maximumSize) etc... }</technical_language>

Target:
public Monitor(Map conf, final String boltService) { startTimestampPerId = createCache(conf, boltService); if (RiemannDiscovery.getInstance().isAWS()) { eventSender = RiemannEventSender.getInstance(); } else { eventSender = new LoggerEventSender(); } customAttributes = extractCustomEventAttributes(conf); }
Source:
<code>public static StandardVariable createStandardVariable() { final StandardVariable stdVariable = new StandardVariable(); stdVariable.setName("variable name " + new Random().nextInt(10000)); stdVariable.setDescription("variable description"); stdVariable.setProperty(new Term(2002, "User", "Database user")); stdVariable.setMethod(new Term(4030, "Assigned", "Term, name or id assigned")); stdVariable.setScale(new Term(61220, "DBCV", "Controlled vocabulary from a database")); stdVariable.setDataType(new Term(1120, "Character variable", "variable with char values")); stdVariable.setIsA(new Term(1050, "Study condition", "Study condition class")); stdVariable.setEnumerations(new ArrayList<Enumeration>()); <START> stdVariable.getEnumerations().add(new Enumeration(10001, "HB", "Hybridization nursery", 2)); <END> stdVariable.getEnumerations().add(new Enumeration(10002, "PN", "Pedigree nursery", 3)); stdVariable.setConstraints(new VariableConstraints(100.0, 999.0)); stdVariable.setCropOntologyId("CROP-TEST"); return stdVariable; }</code><technical_language>@vmaletta, please remove types of Nursery</technical_language>

Target:
public static StandardVariable createStandardVariable() { final StandardVariable stdVariable = new StandardVariable(); stdVariable.setName("variable name " + new Random().nextInt(10000)); stdVariable.setDescription("variable description"); stdVariable.setProperty(new Term(2002, "User", "Database user")); stdVariable.setMethod(new Term(4030, "Assigned", "Term, name or id assigned")); stdVariable.setScale(new Term(61220, "DBCV", "Controlled vocabulary from a database")); stdVariable.setDataType(new Term(1120, "Character variable", "variable with char values")); stdVariable.setIsA(new Term(1050, "Study condition", "Study condition class")); stdVariable.setEnumerations(new ArrayList<Enumeration>()); stdVariable.getEnumerations().add(new Enumeration(StudyType.N.getId(), StudyType.N.getName(), StudyType.N.getLabel(), 1)); stdVariable.getEnumerations().add(new Enumeration(StudyType.HB.getId(), StudyType.HB.getName(), StudyType.HB.getLabel(), 2)); stdVariable.getEnumerations().add(new Enumeration(StudyType.PN.getId(), StudyType.PN.getName(), StudyType.PN.getLabel(), 3)); stdVariable.setConstraints(new VariableConstraints(100.0, 999.0)); stdVariable.setCropOntologyId("CROP-TEST"); return stdVariable; }
Source:
<code>public String getLongestIndex() { Map<Integer, Integer> lengths = pooledElementViews.stream() .flatMap(element -> element.getIndices().stream()) .collect(Collectors.toMap(Index::getPosition, index -> index.getSequence().length(), Integer::max)); if (lengths.isEmpty()) { return "0"; } return lengths.entrySet().stream() .sorted((a, b) -> { return a.getKey().compareTo(b.getKey()); <START> }) <END> .map(Entry<Integer, Integer>::getValue) .map(length -> length.toString()) .collect(Collectors.joining(",")); }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') Replace this lambda a method reference. [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
public String getLongestIndex() { Map<Integer, Integer> lengths = pooledElementViews.stream() .flatMap(element -> element.getIndices().stream()) .collect(Collectors.toMap(Index::getPosition, index -> index.getSequence().length(), Integer::max)); if (lengths.isEmpty()) { return "0"; } return lengths.entrySet().stream() .sorted((a, b) -> a.getKey().compareTo(b.getKey())) .map(Entry<Integer, Integer>::getValue) .map(length -> length.toString()) .collect(Collectors.joining(",")); }
Source:
<code>private static String getDescriptionForFBFile(IFile fbtFile) { FBType type = null; if (TypeLibraryTags.FB_TYPE_FILE_ENDING.equalsIgnoreCase(fbtFile.getFileExtension())) { type = getFBTypeFromFile(fbtFile); } else if (TypeLibraryTags.ADAPTER_TYPE_FILE_ENDING.equalsIgnoreCase(fbtFile.getFileExtension())) { type = getAdapterTypeForFile(fbtFile); } if (null != type) { <START> return type.getName() + ": " + ((null == type.getComment()) ? "" : type.getComment()); END> } return null; }</code><technical_language>if put a helper method, code clearer. I read times is returned</technical_language>

Target:
private static String getDescriptionForFBFile(IFile fbtFile) { FBType type = null; if (TypeLibraryTags.FB_TYPE_FILE_ENDING.equalsIgnoreCase(fbtFile.getFileExtension())) { type = getFBTypeFromFile(fbtFile); } else if (TypeLibraryTags.ADAPTER_TYPE_FILE_ENDING.equalsIgnoreCase(fbtFile.getFileExtension())) { type = getAdapterTypeForFile(fbtFile); } if (null != type) { return generateTypeDescriptionString(type); } return null; }
Source:
<code>public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestInfos) throws IOException { if (closed) { throw new IllegalStateException("The NetworkClient is closed."); } List<ResponseInfo> responseInfoList = new ArrayList<ResponseInfo>(); <START> numPendingConnections.set(pendingRequests.size()); <END> for (RequestInfo requestInfo : requestInfos) { ClientNetworkRequestMetrics clientNetworkRequestMetrics = new ClientNetworkRequestMetrics(networkMetrics.requestQueueTime, networkMetrics.requestSendTime, networkMetrics.requestSendTotalTime, 0); pendingRequests.add(new RequestMetadata(time.milliseconds(), requestInfo, clientNetworkRequestMetrics)); numPendingConnections.set(pendingRequests.size()); } List<NetworkSend> sends = prepareSends(responseInfoList); selector.poll(POLL_TIMEOUT_MS, sends); handleSelectorEvents(responseInfoList); return responseInfoList; }</code><technical_language>set this times this method? set for loop</technical_language>

Target:
public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestInfos) throws IOException { long startTime = time.milliseconds(); try { if (closed) { throw new IllegalStateException("The NetworkClient is closed."); } List<ResponseInfo> responseInfoList = new ArrayList<ResponseInfo>(); for (RequestInfo requestInfo : requestInfos) { ClientNetworkRequestMetrics clientNetworkRequestMetrics = new ClientNetworkRequestMetrics(networkMetrics.requestQueueTime, networkMetrics.requestSendTime, networkMetrics.requestSendTotalTime, 0); pendingRequests.add(new RequestMetadata(time.milliseconds(), requestInfo, clientNetworkRequestMetrics)); } List<NetworkSend> sends = prepareSends(responseInfoList); selector.poll(POLL_TIMEOUT_MS, sends); handleSelectorEvents(responseInfoList); return responseInfoList; } finally { numPendingRequests.set(pendingRequests.size()); networkMetrics.networkClientSendAndPollTime.update(time.milliseconds() - startTime); } }
Source:
<code>public CommandCallback getCallback() { if (getVm().getVmPoolId() != null || <START> getParameters() instanceof CloneVmParameters) { <END> return callbackProvider.get(); } return null; }</code><technical_language>Please, do do this way. First, if this is UpdateVmCommand, receive CloneVmParameters. Second, if need change a behaviour of a command, pass additional parameter. is visible predictable</technical_language>

Target:
public CommandCallback getCallback() { if (getVm().getVmPoolId() != null) { return callbackProvider.get(); } return getParameters().isUseCinderCommandCallback() ? callbackProvider.get() : null; }
Source:
<code>public boolean acceptMarker(ProblemMarkerInfo markerInfo) { IProject project = markerInfo.file.getProject(); <START> if (project == null) <END> return true; List<ProblemMarkerFilterDesc> enabledFilters = findEnabledFilters(project); for (ProblemMarkerFilterDesc filterDesc: enabledFilters) { if ( ! filterDesc.getFilter().acceptMarker(markerInfo) ) { return false; } } return true; }</code><technical_language>This project is open: if (project == null || !project.isOpen()) However, I get a marker a project open, I respin patch for this change</technical_language>

Target:
public boolean acceptMarker(ProblemMarkerInfo markerInfo) { IProject project = markerInfo.file.getProject(); if (project == null || !project.isOpen()) return true; List<ProblemMarkerFilterDesc> enabledFilters = findEnabledFilters(project); for (ProblemMarkerFilterDesc filterDesc: enabledFilters) { if ( ! filterDesc.getFilter().acceptMarker(markerInfo) ) { return false; } } return true; }
Source:
<code>public void addFileHandler(String name) { clickButton("Add"); getWindowFragment().getEditor().text("name", name); <START> getWindowFragment().clickButton("Save"); <END> getWindowFragment().getEditor().text("path", "/logs/"); getWindowFragment().getEditor().clickButton("Finish"); }</code><technical_language>This button label changed "Save". BTW Wizard done job better</technical_language>

Target:
public void addFileHandler(String name) { clickButton("Add"); getWindowFragment().getEditor().text("name", name); getWindowFragment().clickButton("Next"); getWindowFragment().getEditor().text("path", "/logs/"); getWindowFragment().getEditor().clickButton("Finish"); }
Source:
<code>private String compressToThumbnail( String base64content, String extension ) { <START> byte[] imageBytes = javax.xml.bind.DatatypeConverter.parseBase64Binary(base64content); <END> double scaleFactor = 0.02; String base64thumb = ""; try { BufferedImage before = ImageIO.read( new ByteArrayInputStream( imageBytes ) ); int width = (int) Math.round( before.getWidth() * scaleFactor ); int height = (int) Math.round( before.getHeight() * scaleFactor ); BufferedImage after = new BufferedImage( width, height, BufferedImage.TYPE_INT_ARGB ); AffineTransform at = new AffineTransform( ); at.scale( scaleFactor, scaleFactor ); AffineTransformOp scaleOp = new AffineTransformOp( at, AffineTransformOp.TYPE_BILINEAR ); after = scaleOp.filter( before, after ); base64thumb = bufferedImageToBase64( after, extension ); } catch( IOException e ) { log.error( "Error while decoding the attachment to BufferedImage ", e); } return base64thumb; }</code><technical_language>I extract a method takes a BufferedImage produces do Base64 conversion of that</technical_language>

Target:
private byte[] compressToThumbnail( String base64content, String extension ) { byte[] imageBytes = javax.xml.bind.DatatypeConverter.parseBase64Binary( base64content ); double scaleFactor = 0.02; byte[] base64thumb = {}; try { BufferedImage before = ImageIO.read( new ByteArrayInputStream( imageBytes ) ); BufferedImage after = scaleBy( scaleFactor, before ); base64thumb = bufferedImageToBase64( after, extension ); } catch( IOException e ) { log.error( "Error while decoding the attachment to BufferedImage ", e ); } return base64thumb; }
Source:
<code>public Property[] removeRandomPasswords(Property[] properties, boolean withCacheClear) { if (ArrayUtils.isEmpty(properties)) { return new Property[0]; } String uuid = IdentityApplicationManagementUtil.getPropertyValue(properties, IdentityApplicationConstants.UNIQUE_ID_CONSTANT); properties = (Property[]) removeUniqueIdProperty(properties); if (StringUtils.isBlank(uuid)) { if (log.isDebugEnabled()) { log.debug("Cache Key not found for Random Password Container"); <START> } <END> } else { RandomPassword[] randomPasswords = getAndRemoveRandomPasswordContainerFromCache(uuid, withCacheClear); if (!ArrayUtils.isEmpty(randomPasswords)) { replaceRandomPasswordsWithOriginalPasswords(properties, randomPasswords); } } return properties; }</code><technical_language>need cast Property[] above? java properties = (Property[]) removeUniqueIdProperty(properties); move else block below, remove uuid if exists</technical_language>

Target:
public Property[] removeRandomPasswords(Property[] properties, boolean withCacheClear) { if (ArrayUtils.isEmpty(properties)) { return new Property[0]; } String uuid = IdentityApplicationManagementUtil.getPropertyValue(properties, IdentityApplicationConstants.UNIQUE_ID_CONSTANT); if (StringUtils.isBlank(uuid)) { if (log.isDebugEnabled()) { log.debug("Cache Key not found for Random Password Container"); } } else { properties = removeUniqueIdProperty(properties); RandomPassword[] randomPasswords = getRandomPasswordContainerFromCache(uuid, withCacheClear); if (!ArrayUtils.isEmpty(randomPasswords)) { replaceRandomPasswordsWithOriginalPasswords(properties, randomPasswords); } } return properties; }
Source:
<code>public void shouldReturnRandomEmailAddress() { final Set<String> randomEmailAddresses = new HashSet<>(); for (int n = 0; n < SAMPLE_SIZE; n++) { final String randomEmailAddress = Randoms.randomEmailAddress(); assertNotNull(randomEmailAddress); try { Check.isValidEmail("email", randomEmailAddress); } catch (final ValidationException e) { <START> fail("Invalid random email addredd generated: " + randomEmailAddress); <END> } randomEmailAddresses.add(randomEmailAddress); } assertEquals("Random sample e-mail addresses should be unique", SAMPLE_SIZE, randomEmailAddresses.size()); }</code><technical_language>Typo, address</technical_language>

Target:
public void shouldReturnRandomEmailAddress() { final Set<String> randomEmailAddresses = new HashSet<>(); for (int n = 0; n < SAMPLE_SIZE; n++) { final String randomEmailAddress = Randoms.randomEmailAddress(); assertNotNull(randomEmailAddress); try { Check.isValidEmail("email", randomEmailAddress); } catch (final ValidationException e) { fail("Invalid random email address generated: " + randomEmailAddress); } randomEmailAddresses.add(randomEmailAddress); } assertEquals("Random sample e-mail addresses should be unique", SAMPLE_SIZE, randomEmailAddresses.size()); }
Source:
<code>public void testOrphanedAllocationIsCanceledIfNotRemapped() throws Exception { final List<AllocationID> allocationIds = new ArrayList<>(); resourceManagerGateway.setRequestSlotConsumer( slotRequest -> allocationIds.add(slotRequest.getAllocationId())); final List<AllocationID> canceledAllocations = new ArrayList<>(); resourceManagerGateway.setCancelSlotConsumer(canceledAllocations::add); try (SlotPoolImpl slotPool = createAndSetUpSlotPool(resourceManagerGateway)) { <START> slotPool.registerTaskManager(taskManagerLocation.getResourceID()); <END> final SlotRequestId slotRequestId1 = new SlotRequestId(); final SlotRequestId slotRequestId2 = new SlotRequestId(); requestNewAllocatedSlots(slotPool, slotRequestId1, slotRequestId2); final AllocationID allocationId1 = allocationIds.get(0); final AllocationID allocationId2 = allocationIds.get(1); AllocationID randomAllocationId; do { randomAllocationId = new AllocationID(); } while (randomAllocationId.equals(allocationId1) || randomAllocationId.equals(allocationId2)); registerAndOfferSlot(taskManagerLocation, slotPool, randomAllocationId); assertThat(slotPool.getPendingRequests().values(), hasSize(1)); assertThat(canceledAllocations, contains(allocationId1)); } }</code><technical_language>registerTaskManager is need registerAndOfferSlot do it</technical_language>

Target:
public void testOrphanedAllocationIsCanceledIfNotRemapped() throws Exception { final List<AllocationID> allocationIds = new ArrayList<>(); resourceManagerGateway.setRequestSlotConsumer( slotRequest -> allocationIds.add(slotRequest.getAllocationId())); final List<AllocationID> canceledAllocations = new ArrayList<>(); resourceManagerGateway.setCancelSlotConsumer(canceledAllocations::add); try (SlotPoolImpl slotPool = SlotPoolUtils.createAndSetUpSlotPool(resourceManagerGateway)) { final SlotRequestId slotRequestId1 = new SlotRequestId(); final SlotRequestId slotRequestId2 = new SlotRequestId(); requestNewAllocatedSlots(slotPool, slotRequestId1, slotRequestId2); final AllocationID allocationId1 = allocationIds.get(0); final AllocationID allocationId2 = allocationIds.get(1); AllocationID randomAllocationId; do { randomAllocationId = new AllocationID(); } while (randomAllocationId.equals(allocationId1) || randomAllocationId.equals(allocationId2)); registerAndOfferSlot(taskManagerLocation, slotPool, randomAllocationId); assertThat(slotPool.getPendingRequests().values(), hasSize(1)); assertThat(canceledAllocations, contains(allocationId1)); } }
Source:
<code>void acquireToken(final IWindowComponent activity, final boolean useDialog, final AuthenticationRequest authRequest, final AuthenticationCallback<AuthenticationResult> authenticationCallback) { final CallbackHandler callbackHandle = new CallbackHandler(getHandler(), authenticationCallback); Logger.setCorrelationId(authRequest.getCorrelationId()); Logger.v(TAG, "Sending async task from thread:" + android.os.Process.myTid()); THREAD_EXECUTOR.execute(new Runnable() { @Override public void run() { Logger.v(TAG, "Running task in thread:" + android.os.Process.myTid()); try { validateAcquireTokenRequest(authRequest); performAcquireTokenRequest(callbackHandle, activity, useDialog, authRequest); } catch (final AuthenticationException authenticationException) { <START> mAPIEvent.setSuccessStatus(false); <END> Telemetry.getInstance().stopEvent(authRequest.getTelemetryRequestId(), mAPIEvent, mAPIEvent.getEventName()); callbackHandle.onError(authenticationException); } } }); }</code><technical_language>setSuccessStatus [](start = 30, length = 16) this renamed? setSuccessStatus sounds setting success case status. #Closed</technical_language>

Target:
void acquireToken(final IWindowComponent activity, final boolean useDialog, final AuthenticationRequest authRequest, final AuthenticationCallback<AuthenticationResult> authenticationCallback) { final CallbackHandler callbackHandle = new CallbackHandler(getHandler(), authenticationCallback); Logger.setCorrelationId(authRequest.getCorrelationId()); Logger.v(TAG, "Sending async task from thread:" + android.os.Process.myTid()); THREAD_EXECUTOR.execute(new Runnable() { @Override public void run() { Logger.v(TAG, "Running task in thread:" + android.os.Process.myTid()); try { validateAcquireTokenRequest(authRequest); performAcquireTokenRequest(callbackHandle, activity, useDialog, authRequest); } catch (final AuthenticationException authenticationException) { mAPIEvent.setWasApiCallSuccessful(false, authenticationException); mAPIEvent.setCorrelationId(authRequest.getCorrelationId().toString()); mAPIEvent.stopTelemetryAndFlush(); callbackHandle.onError(authenticationException); } } }); }
Source:
<code>private GroupReference getOrCreateGroupForIndividuals(ReviewDb db, ProjectConfig config, List<AccountGroup.Id> adminGroupIds, ContributorAgreement agreement) throws OrmException { if (!agreement.getAccepted().isEmpty()) { return agreement.getAccepted().get(0).getGroup(); } String name = "CLA Accepted - " + agreement.getName(); AccountGroupName agn = db.accountGroupNames().get(new AccountGroup.NameKey(name)); AccountGroup ag; if (agn != null) { ag = db.accountGroups().get(agn.getId()); if (ag == null) { throw new IllegalStateException( "account group name exists but account group does not: " + name); } if (!adminGroupIds.contains(ag.getOwnerGroupId())) { throw new IllegalStateException( "individual group exists with non admin owner group: " + name); } } else { ag = createGroup(db, name, adminGroupIds.get(0), String.format("Users who have accepted the %s CLA", agreement.getName())); } GroupReference group = config.resolve(ag); agreement.setAccepted(Lists.newArrayList(new PermissionRule(group))); if (agreement.getAutoVerify() != null) { <START> agreement.setAutoVerify(group); <END> } return group; }</code><technical_language>autoverify groups need accounts.sameGroupVisiblity = deny set for</technical_language>

Target:
private GroupReference getOrCreateGroupForIndividuals(ReviewDb db, ProjectConfig config, List<AccountGroup.Id> adminGroupIds, ContributorAgreement agreement) throws OrmException { if (!agreement.getAccepted().isEmpty()) { return agreement.getAccepted().get(0).getGroup(); } String name = "CLA Accepted - " + agreement.getName(); AccountGroupName agn = db.accountGroupNames().get(new AccountGroup.NameKey(name)); AccountGroup ag; if (agn != null) { ag = db.accountGroups().get(agn.getId()); if (ag == null) { throw new IllegalStateException( "account group name exists but account group does not: " + name); } if (!adminGroupIds.contains(ag.getOwnerGroupId())) { throw new IllegalStateException( "individual group exists with non admin owner group: " + name); } } else { ag = createGroup(db, name, adminGroupIds.get(0), String.format("Users who have accepted the %s CLA", agreement.getName())); } GroupReference group = config.resolve(ag); agreement.setAccepted(Lists.newArrayList(new PermissionRule(group))); if (agreement.getAutoVerify() != null) { agreement.setAutoVerify(group); } List<PermissionRule> sameGroupVisibility = config.getAccountsSection().getSameGroupVisibility(); PermissionRule rule = new PermissionRule(group); rule.setDeny(); if (!sameGroupVisibility.contains(rule)) { sameGroupVisibility.add(rule); } return group; }
Source:
<code>public static Bond map(HostNIC model, Bond template) { Bond entity = template == null ? new Bond() : template; if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetBonding()) { entity.setBonded(true); if (model.getBonding().isSetSlaves()) { <START> Set<String> slaveNamesInConfig = new HashSet<String>(); <END> for (HostNIC slave : model.getBonding().getSlaves().getSlaves()) { if (!entity.getSlaves().contains(slave.getName())) { entity.getSlaves().add(slave.getName()); } slaveNamesInConfig.add(slave.getName()); } for (int i = entity.getSlaves().size()-1; i>=0; i--){ if (!slaveNamesInConfig.contains(entity.getSlaves().get(i))){ entity.getSlaves().remove(i); } } } if (model.getBonding().isSetOptions()) { entity.setBondOptions(calculateBondingOptionsString(model)); } } if (model.isSetQos()) { entity.setQos((HostNetworkQos) QosMapper.map(model.getQos(), null)); } return entity; }</code><technical_language>1. correct (and pardon) if wrong. add items, passed client entity.getSlaves() collection. Then, remove item this collection, pass client. feels, end exact collection is client. if true, simply assign this collection, since, strings, state collections in JPA. I missing something? 2. 'for loop' work generate ConcurateModificationException. However, more customary in java iterator remove method do this operation. Ie. iterator loop (in order) call iterator.remove instance obtained iterator.next removed</technical_language>

Target:
public static Bond map(HostNIC model, Bond template) { Bond entity = template == null ? new Bond() : template; if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetBonding()) { entity.setBonded(true); if (model.getBonding().isSetSlaves()) { entity.getSlaves().clear(); for (HostNIC slave : model.getBonding().getSlaves().getSlaves()) { entity.getSlaves().add(slave.getName()); } } if (model.getBonding().isSetOptions()) { entity.setBondOptions(calculateBondingOptionsString(model)); } } if (model.isSetQos()) { entity.setQos((HostNetworkQos) QosMapper.map(model.getQos(), null)); } return entity; }
Source:
<code><START> public Account(short id, String name, AccountStatus status, Collection<Container> containers) { <END> this.id = id; this.name = name; this.status = status; checkRequiredFieldsForBuild(); if (containers != null) { for (Container container : containers) { checkParentAccountIdInContainers(container); checkDuplicateContainerNameOrId(container); updateContainerMap(container); } } }</code><technical_language>is this public now</technical_language>

Target:
Account(short id, String name, AccountStatus status, Collection<Container> containers) { this.id = id; this.name = name; this.status = status; checkRequiredFieldsForBuild(); if (containers != null) { for (Container container : containers) { checkParentAccountIdInContainers(container); checkDuplicateContainerNameOrId(container); updateContainerMap(container); } } }
Source:
<code>public Set<String> dispatch(RejectionEnvelope envelope) { final Rejection rejection = envelope.getOuterObject(); final ExternalMessage message = ExternalMessages.of(rejection, boundedContextName); <START> final Iterable<Publisher> channels = router.route(message); <END> final ImmutableSet<String> result = from(channels) .transform(new Function<Publisher, String>() { @Override public String apply(Publisher input) { return input.toString(); } }) .toSet(); return result; }</code><technical_language>This portion of code a copy-paste changeset DomesticEventPublisher</technical_language>

Target:
public Set<String> dispatch(RejectionEnvelope envelope) { final Rejection rejection = envelope.getOuterObject(); final ExternalMessage message = ExternalMessages.of(rejection, boundedContextName); final Iterable<Publisher> channels = router.route(message); final Set<String> result = ImmutableSet.copyOf(Channels.toString(channels)); return result; }
Source:
<code>public boolean validate(IOperationMonitor monitor) throws BugzillaRestException { try { ErrorResponse validateResponse = new BugzillaRestValidateRequest(client).run(monitor); return validateResponse.isError() && validateResponse.getCode() == 32614; } catch (BugzillaRestException e) { <START> if (e instanceof BugzillaRestResourceNotFoundException <END> && e.getMessage().equals("Error 32614: A REST API resource was not found for 'GET '.")) { return true; } else { throw e; } } }</code><technical_language>explain this me? is clear this means, this fragile</technical_language>

Target:
public boolean validate(IOperationMonitor monitor) throws BugzillaRestException { RepositoryLocation location = getClient().getLocation(); if (Boolean.parseBoolean(location.getProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY))) { UserCredentials credentials = location.getCredentials(AuthenticationType.REPOSITORY); if (credentials == null) { throw new IllegalStateException("Authentication requested without valid credentials"); } String url = MessageFormat.format("/valid_login?login={0}&api_key={1}", new Object[] { credentials.getUserName(), location.getProperty(IBugzillaRestConstants.REPOSITORY_API_KEY) }); BooleanResult response = new BugzillaRestUnauthenticatedGetRequest<BooleanResult>(client, url, new TypeToken<BooleanResult>() { }).run(monitor); return response.getResult(); } else { LoginToken validateResponse = new BugzillaRestLoginRequest(client).run(monitor); if (validateResponse != null && !Strings.isNullOrEmpty(validateResponse.getId())) { String url = MessageFormat.format("/logout?token={0}", new Object[] { validateResponse.getToken() }); new BugzillaRestUnauthenticatedGetRequest<BooleanResult>(client, url, new TypeToken<BooleanResult>() { }).run(monitor); return true; } } return false; }
Source:
<code>public Register.DoubleLongRegister indexSample( IndexReference index, Register.DoubleLongRegister target ) throws IndexNotFoundKernelException { ktx.assertOpen(); <START> ktx.assertOpen(); <END> return storeReadLayer.indexUpdatesAndSize( SchemaDescriptorFactory.forLabel( index.label(), index.properties() ), target ); }</code><technical_language>open now</technical_language>

Target:
public Register.DoubleLongRegister indexSample( IndexReference index, Register.DoubleLongRegister target ) throws IndexNotFoundKernelException { ktx.assertOpen(); return storeReadLayer.indexSample( SchemaDescriptorFactory.forLabel( index.label(), index.properties() ), target ); }