auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void prepareForSending() { try { if (partitionId != null) { attemptedPartitionIds.add(partitionId); } partitionId = getPartitionForPut(attemptedPartitionIds); chunkBlobId = new BlobId(BlobId.DEFAULT_FLAG, clusterMap.getLocalDatacenterId(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), partitionId); <START> chunkBlobProperties = new BlobProperties(passedInBlobProperties.isEncrypted() ? chunkBlobSize : buf.remaining(), <END> passedInBlobProperties.getServiceId(), passedInBlobProperties.getOwnerId(), passedInBlobProperties.getContentType(), passedInBlobProperties.isPrivate(), passedInBlobProperties.getTimeToLiveInSeconds(), passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), passedInBlobProperties.isEncrypted()); operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, false, routerConfig.routerPutSuccessTarget, routerConfig.routerPutRequestParallelism); correlationIdToChunkPutRequestInfo.clear(); state = ChunkState.Ready; } catch (RouterException e) { setOperationExceptionAndComplete(e); } catch (Exception e) { setOperationExceptionAndComplete(new RouterException("Operation tracker could not be initialized", e, RouterErrorCode.UnexpectedInternalError)); } }</code><technical_language>I prefer separate variables for chunkBlobSize encryptedChunkBlobSize etc. - chunkBlobSize for buf.remaining() for other</technical_language>

Target:
private void prepareForSending() { try { if (partitionId != null) { attemptedPartitionIds.add(partitionId); } partitionId = getPartitionForPut(attemptedPartitionIds); chunkBlobId = new BlobId(routerConfig.routerBlobidCurrentVersion, BlobId.BlobIdType.NATIVE, clusterMap.getLocalDatacenterId(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), partitionId); chunkBlobProperties = new BlobProperties(chunkBlobSize, passedInBlobProperties.getServiceId(), passedInBlobProperties.getOwnerId(), passedInBlobProperties.getContentType(), passedInBlobProperties.isPrivate(), passedInBlobProperties.getTimeToLiveInSeconds(), passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getAccountId(), passedInBlobProperties.getContainerId(), passedInBlobProperties.isEncrypted()); operationTracker = new SimpleOperationTracker(routerConfig.routerDatacenterName, partitionId, false, routerConfig.routerPutSuccessTarget, routerConfig.routerPutRequestParallelism); correlationIdToChunkPutRequestInfo.clear(); state = ChunkState.Ready; } catch (RouterException e) { setOperationExceptionAndComplete(e); } catch (Exception e) { setOperationExceptionAndComplete(new RouterException("Operation tracker could not be initialized", e, RouterErrorCode.UnexpectedInternalError)); } }
Source:
<code>public String transformForInfluxSystems(ServiceMetricEvent event) { String[] parts = getValue("metric", event).split("/"); String metric = String.join( "_", Arrays.asList( Arrays.copyOfRange( parts, 1, parts.length - 1 ) ) ); String payload = "druid_" + parts[0] + ","; payload += "service=" + getValue("service", event) + ((parts.length == 2) ? "" : ",metric=druid_" + metric) + ",hostname=" + getValue("host", event).split(":")[0]; ImmutableSet<String> dimNames = ImmutableSet.copyOf(event.getUserDims().keySet()); for (String dimName : dimNames) { if (this.dimensionWhiteList.contains(dimName)) { payload += "," + dimName + "=" + sanitize(String.valueOf(event.getUserDims().get(dimName))); } } payload += " druid_" + parts[parts.length - 1] + "=" + getValue("value", event); return payload + " " + event.getCreatedTime().getMillis() * 1000000 + '\n'; <START> } <END></code><technical_language>lots of string concatenation .. format StringBuilder else that</technical_language>

Target:
public String transformForInfluxSystems(ServiceMetricEvent event) { String[] parts = getValue("metric", event).split("/"); String metric = String.join( "_", Arrays.asList( Arrays.copyOfRange( parts, 1, parts.length - 1 ) ) ); StringBuilder payload = new StringBuilder("druid_"); payload.append(parts[0]); StringBuilder tag = new StringBuilder(",service="); tag.append(getValue("service", event)); String metricTag = parts.length == 2 ? "" : ",metric=druid_" + metric; tag.append(metricTag); tag.append(StringUtils.format(",hostname=%s", getValue("host", event).split(":")[0])); ImmutableSet<String> dimNames = ImmutableSet.copyOf(event.getUserDims().keySet()); for (String dimName : dimNames) { if (this.dimensionWhiteList.contains(dimName)) { tag.append(StringUtils.format(",%1$s=%2$s", dimName, sanitize(String.valueOf(event.getUserDims().get(dimName))))); } } payload.append(tag); payload.append(StringUtils.format(" druid_%1$s=%2$s", parts[parts.length - 1], getValue("value", event))); payload.append(StringUtils.format(" %d\n", event.getCreatedTime().getMillis() * 1000000)); return payload.toString(); }
Source:
<code>private void removeAppender(Optional<Appender> appender) { removeAppender(appender.get()); <START> appender = Optional.empty(); <END> }</code><technical_language>Is this step necessary? I thought affect reference in this method's scope</technical_language>

Target:
private void removeAppender(Optional<Appender> appender) { if (appender.isPresent()) { removeAppender(appender.get()); } }
Source:
<code>protected String findError() { if( credentials.getDomain() == null || credentials.getUser() == null) { return "The Container Development Environment Server Adapter requires Red Hat Access credentials."; } if( selectedHypervisor == null ) { return "You must choose a hypervisor."; } String retString = null; if( homeDir == null || !(new File(homeDir)).exists()) { retString = "The selected file does not exist."; } else if( !(new File(homeDir).canExecute())) { retString = "The selected file is not executable."; } <START> toggleDecorator(homeText, retString); <END> if( retString != null ) return retString; if( minishiftVersionProps == null ) { return "Unknown error when checking minishift version: " + homeDir; } else if( !minishiftVersionProps.isValid()) { String err = minishiftVersionProps.getError(); if( err == null ) { err = "Unknown error while checking minishift version"; } return err; } else { String versionCompatError = isVersionCompatible(minishiftVersionProps); if( versionCompatError != null ) return versionCompatError; } return null; }</code><technical_language>wondering pass homeText in parameter this method is hard coded homeDecorator</technical_language>

Target:
protected String findError() { if( credentials.getDomain() == null || credentials.getUser() == null) { return "The Container Development Environment Server Adapter requires Red Hat Access credentials."; } if( selectedHypervisor == null ) { return "You must choose a hypervisor."; } String retString = validateHomeDirectory(); if( retString != null ) return retString; return validateMinishiftVersion(); }
Source:
<code>public void cancelFutures() { IgniteCheckedException err = new IgniteCheckedException("Failed to wait for topology update, cache (or node) is stopping."); <START> if (aff != null) { <END> aff.cancelFutures(err); } }</code><technical_language>Add empty line if()</technical_language>

Target:
public void cancelFutures() { if (!starting.get()) return; IgniteCheckedException err = new IgniteCheckedException("Failed to wait for topology update, cache (or node) is stopping."); if (aff != null) aff.cancelFutures(err); }
Source:
<code>private Collection<Ref> getAllRefs() throws IOException { RefDatabase refdb = repo.getRefDatabase(); Collection<Ref> refs = refdb.getRefs(RefDatabase.ALL).values(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); for (Ref r : addl) { <START> if (r.getName().startsWith(Constants.R_REFS)) <END> all.add(r); } return all; } return refs; }</code><technical_language>missing braces</technical_language>

Target:
private Collection<Ref> getAllRefs() throws IOException { RefDatabase refdb = repo.getRefDatabase(); Collection<Ref> refs = refdb.getRefs(RefDatabase.ALL).values(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); for (Ref r : addl) { if (r.getName().startsWith(Constants.R_REFS)) { all.add(r); } } return all; } return refs; }
Source:
<code>public void validate() { takeOfflineBuilder.validate(); stateTransferBuilder.validate(); if (site == null) throw new CacheConfigurationException("The 'site' must be specified!"); if (backupFailurePolicy == BackupFailurePolicy.CUSTOM && (failurePolicyClass == null)) { throw new CacheConfigurationException("It is required to specify a 'failurePolicyClass' when using a " + "custom backup failure policy!"); } if (useTwoPhaseCommit && strategy == BackupConfiguration.BackupStrategy.ASYNC) { <START> throw new CacheConfigurationException("'two-phase-commit' can be used only with SYNC backup strategy!"); <END> } }</code><technical_language>IMO, in Log interface, other *ConfigurationBuilder is it. So, is leave (the new) is consistent</technical_language>

Target:
public void validate() { takeOfflineBuilder.validate(); stateTransferBuilder.validate(); if (site == null) throw log.backupSiteNullName(); if (backupFailurePolicy == BackupFailurePolicy.CUSTOM && (failurePolicyClass == null)) { throw log.customBackupFailurePolicyClassNotSpecified(); } if (useTwoPhaseCommit && strategy == BackupConfiguration.BackupStrategy.ASYNC) { throw log.twoPhaseCommitAsyncBackup(); } }
Source:
<code>private static Options buildOptions() { final Options options = buildOptionsExcludeHidden(); options.addOption(OPTION_CAPITAL_C_NAME, OPTION_CHECKER_THREADS_NUMBER_NAME, true, "The number of Checker threads (must be greater than zero)"); options.addOption(OPTION_CAPITAL_W_NAME, OPTION_TREE_WALKER_THREADS_NUMBER_NAME, true, "The number of TreeWalker threads (must be greater than zero)"); <START> return options; <END> }</code><technical_language>I plan code all, started ... ok . lets visible others please put in description prefix "(experimental)"</technical_language>

Target:
private static Options buildOptions() { final Options options = new Options(); options.addOption(OPTION_C_NAME, true, "Sets the check configuration file to use."); options.addOption(OPTION_O_NAME, true, "Sets the output file. Defaults to stdout"); options.addOption(OPTION_P_NAME, true, "Loads the properties file"); options.addOption(OPTION_F_NAME, true, String.format( "Sets the output format. (%s|%s). Defaults to %s", PLAIN_FORMAT_NAME, XML_FORMAT_NAME, PLAIN_FORMAT_NAME)); options.addOption(OPTION_V_NAME, false, "Print product version and exit"); options.addOption(OPTION_T_NAME, OPTION_TREE_NAME, false, "Print Abstract Syntax Tree(AST) of the file"); options.addOption(OPTION_CAPITAL_T_NAME, OPTION_TREE_COMMENT_NAME, false, "Print Abstract Syntax Tree(AST) of the file including comments"); options.addOption(OPTION_J_NAME, OPTION_JAVADOC_TREE_NAME, false, "Print Parse tree of the Javadoc comment"); options.addOption(OPTION_CAPITAL_J_NAME, OPTION_TREE_JAVADOC_NAME, false, "Print full Abstract Syntax Tree of the file"); options.addOption(OPTION_D_NAME, OPTION_DEBUG_NAME, false, "Print all debug logging of CheckStyle utility"); options.addOption(OPTION_E_NAME, OPTION_EXCLUDE_NAME, true, "Directory path to exclude from CheckStyle"); options.addOption(OPTION_X_NAME, OPTION_EXCLUDE_REGEXP_NAME, true, "Regular expression of directory to exclude from CheckStyle"); options.addOption(OPTION_EXECUTE_IGNORED_MODULES_NAME, false, "Allows ignored modules to be run."); options.addOption(OPTION_CAPITAL_C_NAME, OPTION_CHECKER_THREADS_NUMBER_NAME, true, "(experimental) The number of Checker threads (must be greater than zero)"); options.addOption(OPTION_CAPITAL_W_NAME, OPTION_TREE_WALKER_THREADS_NUMBER_NAME, true, "(experimental) The number of TreeWalker threads (must be greater than zero)"); return options; }
Source:
<code>@Override public void process(Bitmap destBitmap, Bitmap sourceBitmap) { if (listener.get() == null) { return; } if (isBitmapEligibleForImageProcessing(sourceBitmap)) { copyWithWhiteBackground(destBitmap, sourceBitmap); <START> Observable.fromCallable(() -> <END> new565ScaledBitmap(sourceBitmap)) .subscribeOn(Schedulers.io()) .subscribe(scaledBmp -> { Palette colorPalette = Palette.from(scaledBmp).generate(); PointF facePos = detectFace(scaledBmp); int defaultColor = ContextCompat.getColor(WikipediaApp.getInstance(), R.color.base30); listener.get().onImageLoaded(destBitmap.getHeight(), facePos, extractMainColor(colorPalette, defaultColor)); }, L::d); } else { listener.get().onImageFailed(); } }</code><technical_language>This function a background thread. I benefit this provides, and/or this fixes issue? do actual error issue</technical_language>

Target:
@Override public void process(Bitmap destBitmap, Bitmap sourceBitmap) { if (listener.get() == null) { return; } if (isBitmapEligibleForImageProcessing(sourceBitmap)) { copyWithWhiteBackground(destBitmap, sourceBitmap); Bitmap testBmp = new565ScaledBitmap(sourceBitmap); Palette colorPalette = Palette.from(testBmp).generate(); PointF facePos = null; try { facePos = detectFace(testBmp); } catch (OutOfMemoryError e) { L.logRemoteErrorIfProd(e); } int defaultColor = ContextCompat.getColor(WikipediaApp.getInstance(), R.color.base30); listener.get().onImageLoaded(destBitmap.getHeight(), facePos, extractMainColor(colorPalette, defaultColor)); } else { listener.get().onImageFailed(); } }
Source:
<code>@Override public boolean canHandleRequest(@NonNull Request data) { Uri uri = data.uri; <START> if (uri == null) return false; <END> return SCHEME_FILE.equals(uri.getScheme()); }</code><technical_language>Merge return</technical_language>

Target:
@Override public boolean canHandleRequest(@NonNull Request data) { Uri uri = data.uri; return uri != null && SCHEME_FILE.equals(uri.getScheme()); }
Source:
<code>public void start(Promise<Void> promise) { server = vertx.createNetServer(getServerOptions()); server.connectHandler(getServerHandler()); server.listen(s -> { <START> if (s.succeeded()) { <END> int serverPort = getClusterPublicPort(options, server.actualPort()); String serverHost = getClusterPublicHost(options); nodeInfo = new NodeInfo(serverHost, serverPort, options.getNodeMetadata()); nodeId = clusterManager.getNodeId(); Promise<Void> setPromise = Promise.promise(); setPromise.future().onComplete(ar -> { if (ar.succeeded()) { started = true; deliveryStrategy.init(vertx); promise.complete(); } else { promise.fail(ar.cause()); } }); clusterManager.setNodeInfo(nodeInfo, setPromise); } else { promise.fail(s.cause()); } }); }</code><technical_language>I benefit flatmap for readability</technical_language>

Target:
public void start(Promise<Void> promise) { server = vertx.createNetServer(getServerOptions()); server.connectHandler(getServerHandler()); server.listen().flatMap(v -> { int serverPort = getClusterPublicPort(options, server.actualPort()); String serverHost = getClusterPublicHost(options); nodeInfo = new NodeInfo(serverHost, serverPort, options.getClusterNodeMetadata()); nodeId = clusterManager.getNodeId(); Promise<Void> setPromise = Promise.promise(); clusterManager.setNodeInfo(nodeInfo, setPromise); return setPromise.future(); }).onSuccess(v -> { started = true; nodeSelector.init(vertx); }).onComplete(promise); }
Source:
<code>private List<ActivityLogEntry> searchLogsWithTimeIncrement(AdminActivityLogPageData data) { List<ActivityLogEntry> appLogs = new LinkedList<ActivityLogEntry>(); int numberOfSearchTimes = 0; totalLogsSearched = 0; while ((numberOfSearchTimes < MAX_SEARCH_TIMES) && (appLogs.size() < RELEVANT_LOGS_PER_PAGE)) { long nextTwoHour = data.getToDate() - SEARCH_TIME_INCREMENT; data.setFromDate(nextTwoHour); numberOfSearchTimes++; LogQuery query = buildQuery(data); List<ActivityLogEntry> searchResult = searchLogsByQuery(query, data); if (!searchResult.isEmpty()) { appLogs.addAll(searchResult); } <START> data.setToDate(data.getFromDate()); <END> } return appLogs; }</code><technical_language>question above: do a duplicate if a log precisely fromDate of previous query</technical_language>

Target:
private List<ActivityLogEntry> searchLogsWithTimeIncrement(AdminActivityLogPageData data) { List<ActivityLogEntry> appLogs = new LinkedList<ActivityLogEntry>(); int numberOfSearchTimes = 0; totalLogsSearched = 0; while ((numberOfSearchTimes < MAX_SEARCH_TIMES) && (appLogs.size() < RELEVANT_LOGS_PER_PAGE)) { long nextTwoHour = data.getToDate() - SEARCH_TIME_INCREMENT; data.setFromDate(nextTwoHour); numberOfSearchTimes++; LogQuery query = buildQuery(data); List<ActivityLogEntry> searchResult = searchLogsByQuery(query, data); if (!searchResult.isEmpty()) { appLogs.addAll(searchResult); } data.setToDate(data.getFromDate() + 1); } return appLogs; }
Source:
<code>private void removeFromTable(Slot e) { int tableIdx = hash(e.offset); Slot p = table[tableIdx]; if (p == e) { table[tableIdx] = e.tableNext; return; } for (; p != null; p = p.tableNext) { if (p.tableNext == e) { p.tableNext = e.tableNext; return; } <START> } <END> }</code><technical_language>Worth throwing ISE if exit this loop finding slot in table? this method is called a stale Slot, is illegal state (considering class is threadsafe)</technical_language>

Target:
private void removeFromTable(Slot e) { int tableIdx = hash(e.offset); Slot p = table[tableIdx]; if (p == e) { table[tableIdx] = e.tableNext; return; } for (; p != null; p = p.tableNext) { if (p.tableNext == e) { p.tableNext = e.tableNext; return; } } throw new IllegalStateException(String.format( "entry for %s:%d not in table", e.pack, Long.valueOf(e.offset))); }
Source:
<code>private void runOpenmrsServiceOnStartup(final OpenmrsService openmrsService, final String classString) { new Thread() { @Override public void run() { try { synchronized (refreshingContextLock) { <START> refreshingContextLock.wait(); <END> } Daemon.runStartupForService(openmrsService); } catch (InterruptedException e) { log.warn("Refresh lock was interrupted while waiting to run OpenmrsService.onStartup() for " + classString, e); } } }.start(); }</code><technical_language>in while loop. above</technical_language>

Target:
private void runOpenmrsServiceOnStartup(final OpenmrsService openmrsService, final String classString) { new Thread() { @Override public void run() { try { synchronized (contextRefreshedLock) { while (!contextRefreshedCheck) { contextRefreshedLock.wait(); } } Daemon.runStartupForService(openmrsService); } catch (InterruptedException e) { log.warn("Refresh lock was interrupted while waiting to run OpenmrsService.onStartup() for " + classString, e); } } }.start(); }
Source:
<code>public synchronized void handleCompletedBatch(ProducerBatch batch, ProduceResponse.PartitionResponse response) { <START> maybeUpdateLastAckedSequence(batch.topicPartition, batch.baseSequence() + batch.recordCount - 1); <END> log.debug("ProducerId: {}; Set last ack'd sequence number for topic-partition to {}", batch.producerId(), batch.topicPartition, lastAckedSequence(batch.topicPartition).orElse(-1)); updateLastAckedOffset(response, batch); removeInFlightBatch(batch); if (!hasProducerIdAndEpoch(batch) && !hasInflightBatches(batch.topicPartition)) { topicPartitionBookkeeper.startSequencesAtBeginning(batch.topicPartition, this.producerIdAndEpoch); } }</code><technical_language>Another place a lastSequence method useful</technical_language>

Target:
public synchronized void handleCompletedBatch(ProducerBatch batch, ProduceResponse.PartitionResponse response) { int lastAckedSequence = maybeUpdateLastAckedSequence(batch.topicPartition, batch.lastSequence()); log.debug("ProducerId: {}; Set last ack'd sequence number for topic-partition to {}", batch.producerId(), batch.topicPartition, lastAckedSequence); updateLastAckedOffset(response, batch); removeInFlightBatch(batch); if (!matchesProducerIdAndEpoch(batch) && !hasInflightBatches(batch.topicPartition)) { topicPartitionBookkeeper.startSequencesAtBeginning(batch.topicPartition, this.producerIdAndEpoch); } }
Source:
<code>public InterpreterResult interpret(String cypherQuery, InterpreterContext interpreterContext) { logger.info("Opening session"); if (StringUtils.isEmpty(cypherQuery)) { return new InterpreterResult(Code.ERROR, "Cypher query is Empty"); } try (Session session = getDriver().session()){ StatementResult result = execute(session, cypherQuery, interpreterContext); Set<String> cols = new HashSet<>(); List<List<String>> lines = new ArrayList<>(); Set<Node> nodes = new HashSet<>(); Set<Relationship> relationships = new HashSet<>(); while (result.hasNext()) { Record record = result.next(); if (cols.isEmpty()) { cols.addAll(record.keys()); } List<String> line = new ArrayList<>(); for (String col : cols) { Object value = record.get(col); setResultValue(value, nodes, relationships, line); } if (!line.isEmpty()) { lines.add(line); } } if (!nodes.isEmpty()) { return renderGraph(nodes, relationships); } else { return renderTable(cols, lines); } } catch (Exception e) { <START> return new InterpreterResult(Code.ERROR, e.getMessage()); <END> } }</code><technical_language>need logger.error("some message", e)</technical_language>

Target:
public InterpreterResult interpret(String cypherQuery, InterpreterContext interpreterContext) { logger.info("Opening session"); if (StringUtils.isEmpty(cypherQuery)) { return new InterpreterResult(Code.ERROR, "Cypher query is Empty"); } try (Session session = getDriver().session()){ StatementResult result = execute(session, cypherQuery, interpreterContext); Set<String> cols = new HashSet<>(); List<List<String>> lines = new ArrayList<>(); Set<Node> nodes = new HashSet<>(); Set<Relationship> relationships = new HashSet<>(); while (result.hasNext()) { Record record = result.next(); if (cols.isEmpty()) { cols.addAll(record.keys()); } List<String> line = new ArrayList<>(); for (String col : cols) { Object value = record.get(col); setResultValue(value, nodes, relationships, line); } if (!line.isEmpty()) { lines.add(line); } } if (!nodes.isEmpty()) { return renderGraph(nodes, relationships); } else { return renderTable(cols, lines); } } catch (Exception e) { logger.error("Exception while interpreting cypher query", e); return new InterpreterResult(Code.ERROR, e.getMessage()); } }
Source:
<code>public O compute2(final I input, final Dimensions paddedDimensions) { Dimensions paddedFFTMethodsInputDimensions = FFTMethodsUtility .getPaddedInputDimensionsRealToComplex(fast, paddedDimensions); if (obf == null) { obf = new OutOfBoundsConstantValueFactory<T, RandomAccessibleInterval<T>>( Util.getTypeFromInterval(input).createVariable()); } <START> Interval inputInterval = ops().filter().paddingIntervalCentered(input, <END> paddedFFTMethodsInputDimensions); return (O) Views.interval(Views.extend(input, obf), inputInterval); }</code><technical_language>initialize</technical_language>

Target:
public O compute2(final I input, final Dimensions paddedDimensions) { Dimensions paddedFFTMethodsInputDimensions = FFTMethodsUtility .getPaddedInputDimensionsRealToComplex(fast, paddedDimensions); if (obf == null) { obf = new OutOfBoundsConstantValueFactory<T, RandomAccessibleInterval<T>>( Util.getTypeFromInterval(input).createVariable()); } Interval inputInterval = paddingIntervalCentered.compute2(input, paddedFFTMethodsInputDimensions); return (O) Views.interval(Views.extend(input, obf), inputInterval); }
Source:
<code>private ResourceIterator<Node> nodesByLabelAndProperty( Label myLabel, String key, Value value ) { KernelTransaction transaction = statementContext.getKernelTransactionBoundToThisThread( true ); Statement statement = transaction.acquireStatement(); Read read = transaction.dataRead(); TokenRead tokenRead = transaction.tokenRead(); int propertyId = tokenRead.propertyKey( key ); int labelId = tokenRead.labelGetForName( myLabel.name() ); if ( propertyId == NO_SUCH_PROPERTY_KEY || labelId == NO_SUCH_LABEL ) { statement.close(); return emptyResourceIterator(); } CapableIndexReference index = transaction.schemaRead().index( labelId, propertyId ); if ( index != CapableIndexReference.NO_INDEX ) { try { NodeValueIndexCursor cursor = transaction.cursors().allocateNodeValueIndexCursor(); IndexQuery.ExactPredicate query = IndexQuery.exact( propertyId, value ); read.nodeIndexSeek( index, cursor, IndexOrder.NONE, query ); return new PrefetchingResourceIterator<Node>() { private boolean closed; @Override protected Node fetchNextOrNull() { if ( cursor.next() ) { return newNodeProxy( cursor.nodeReference() ); } else { close(); return null; } } @Override public void close() { if ( !closed ) { statement.close(); <START> cursor.close(); <END> closed = true; } } }; } catch ( KernelException e ) { } } return getNodesByLabelAndPropertyWithoutIndex( propertyId, value, statement, labelId ); }</code><technical_language>IOUtil.closeAll (or introduce a closeBoth if want allocate variadic array) that, ensure cursor is closed, if statement.close throws exception</technical_language>

Target:
private ResourceIterator<Node> nodesByLabelAndProperty( Label myLabel, String key, Value value ) { KernelTransaction transaction = statementContext.getKernelTransactionBoundToThisThread( true ); Statement statement = transaction.acquireStatement(); Read read = transaction.dataRead(); TokenRead tokenRead = transaction.tokenRead(); int propertyId = tokenRead.propertyKey( key ); int labelId = tokenRead.nodeLabel( myLabel.name() ); if ( propertyId == NO_SUCH_PROPERTY_KEY || labelId == NO_SUCH_LABEL ) { statement.close(); return emptyResourceIterator(); } CapableIndexReference index = transaction.schemaRead().index( labelId, propertyId ); if ( index != CapableIndexReference.NO_INDEX ) { try { NodeValueIndexCursor cursor = transaction.cursors().allocateNodeValueIndexCursor(); IndexQuery.ExactPredicate query = IndexQuery.exact( propertyId, value ); read.nodeIndexSeek( index, cursor, IndexOrder.NONE, query ); return new NodeCursorResourceIterator<>( cursor, statement ); } catch ( KernelException e ) { } } return getNodesByLabelAndPropertyWithoutIndex( propertyId, value, statement, labelId ); }
Source:
<code>private static Type getInt32Type(RichColumnDescriptor descriptor) { OriginalType originalType = descriptor.getPrimitiveType().getOriginalType(); if (originalType == null) { return IntegerType.INTEGER; } switch (originalType) { case DECIMAL: return createDecimalType(descriptor.getPrimitiveType().getDecimalMetadata()); case DATE: return DateType.DATE; default: <START> return IntegerType.INTEGER; <END> } }</code><technical_language>static import INTEGER</technical_language>

Target:
private static Type getInt32Type(RichColumnDescriptor descriptor) { OriginalType originalType = descriptor.getPrimitiveType().getOriginalType(); if (originalType == null) { return INTEGER; } switch (originalType) { case DECIMAL: return createDecimalType(descriptor.getPrimitiveType().getDecimalMetadata()); case DATE: return DateType.DATE; default: return INTEGER; } }
Source:
<code>public synchronized void correlate(final Event e) { if (m_kieSession == null) { <START> LOG.info("No valid session"); <END> return; } LOG.debug("Begin correlation for Event uei: {}", e.getDbid(), e.getUei()); m_kieSession.insert(e); try { if (!m_isStreaming) m_kieSession.fireAllRules(); } catch (Exception e1) { LOG.error("Exception while firing rules ", e1); } m_eventsMeter.mark(); LOG.debug("End correlation for Event uei: {}", e.getDbid(), e.getUei()); }</code><technical_language>suggestion LOG.info("No valid session exists. Event id: UEI: added a fact.", e.getDbid(), e.getUei());</technical_language>

Target:
public synchronized void correlate(final Event e) { if (m_kieSession == null) { LOG.info("No valid session, Event with id: and UEI: will not be added as a fact.", e.getDbid(), e.getUei()); return; } LOG.debug("Begin correlation for Event uei: {}", e.getDbid(), e.getUei()); m_kieSession.insert(e); try { if (!m_isStreaming) m_kieSession.fireAllRules(); } catch (Exception e1) { LOG.error("Exception while firing rules ", e1); } m_eventsMeter.mark(); LOG.debug("End correlation for Event uei: {}", e.getDbid(), e.getUei()); }
Source:
<code>public static Constraint getViewConstraint(Element view) { if (view != null) { Collection<Constraint> constraints = view.get_constraintOfConstrainedElement(); for (Constraint constraint : constraints) { <START> if (constraint != null && Converters.getElementToIdConverter().apply(constraint).endsWith(("_vc"))) { <END> return constraint; } } } return null; }</code><technical_language>Abstract MDKConstants.VIEW_CONSTRAINT_SYSML_ID_SUFFIX</technical_language>

Target:
public static Constraint getViewConstraint(Element view) { if (view != null) { Collection<Constraint> constraints = view.get_constraintOfConstrainedElement(); for (Constraint constraint : constraints) { if (constraint != null && Converters.getElementToIdConverter().apply(constraint).endsWith((MDKConstants.VIEW_CONSTRAINT_SYSML_ID_SUFFIX))) { return constraint; } } } return null; }
Source:
<code>public CheckpointMetrics build() { checkState(alignmentDurationNanos.isDone()); return new CheckpointMetrics( <START> FutureUtils.getWithoutException(alignmentDurationNanos), <END> syncDurationMillis, asyncDurationMillis, checkpointStartDelayNanos); }</code><technical_language>potentially swallowing exceptions again</technical_language>

Target:
public CheckpointMetrics build() { return new CheckpointMetrics( checkStateAndGet(bytesProcessedDuringAlignment), bytesPersistedDuringAlignment, checkStateAndGet(alignmentDurationNanos), syncDurationMillis, asyncDurationMillis, checkpointStartDelayNanos); }
Source:
<code>public String postStep(HTTPRequest request) { double GBPerMonth; long bytesPerMonth; String capTo = request.getPartAsStringFailsafe("capTo", 4096); StringBuilder target = new StringBuilder(FirstTimeWizardToadlet.WIZARD_STEP.BANDWIDTH_MONTHLY.name()).append("&parseTarget="); try { GBPerMonth = Double.valueOf(capTo); bytesPerMonth = Math.round(GBPerMonth * GB); } catch (NumberFormatException e) { target.append(URLEncoder.encode(capTo, true)); target.append("&parseError=true"); return target.toString(); } double bytesPerSecond = bytesPerMonth/secondsPerMonth; double minBytesPerSecond = Node.getMinimumBandwidth(); double bwinc = bytesPerSecond - 2*minBytesPerSecond; double dllimit = minBytesPerSecond + (bwinc * ((4./5.))); <START> double ullimit = minBytesPerSecond + (bwinc / 5.); <END> String downloadLimit = String.valueOf(Math.ceil(dllimit)); String uploadLimit = String.valueOf(Math.ceil(ullimit)); try { setBandwidthLimit(downloadLimit, false); setBandwidthLimit(uploadLimit, true); } catch (InvalidConfigValueException e) { target.append(URLEncoder.encode(String.valueOf(GBPerMonth), true)); target.append("&tooLow=true"); return target.toString(); } setWizardComplete(); return FirstTimeWizardToadlet.WIZARD_STEP.COMPLETE.name(); }</code><technical_language>bwinc * asymptoticFraction bwinc * (1 - asymptoticFraction)? avoids dependent constants</technical_language>

Target:
public String postStep(HTTPRequest request) { double GBPerMonth; long bytesPerMonth; String capTo = request.getPartAsStringFailsafe("capTo", 4096); StringBuilder target = new StringBuilder(FirstTimeWizardToadlet.WIZARD_STEP.BANDWIDTH_MONTHLY.name()).append("&parseTarget="); try { GBPerMonth = Double.valueOf(capTo); bytesPerMonth = Math.round(GBPerMonth * GB); } catch (NumberFormatException e) { target.append(URLEncoder.encode(capTo, true)); target.append("&parseError=true"); return target.toString(); } double bytesPerSecond = bytesPerMonth/secondsPerMonth; double minBytesPerSecond = Node.getMinimumBandwidth(); double bwinc = bytesPerSecond - 2*minBytesPerSecond; double asymptoticDlFraction = 4. / 5.; double dllimit = minBytesPerSecond + (bwinc * asymptoticDlFraction); double ullimit = minBytesPerSecond + (bwinc * (1 - asymptoticDlFraction)); String downloadLimit = String.valueOf(Math.ceil(dllimit)); String uploadLimit = String.valueOf(Math.ceil(ullimit)); try { setBandwidthLimit(downloadLimit, false); setBandwidthLimit(uploadLimit, true); } catch (InvalidConfigValueException e) { target.append(URLEncoder.encode(String.valueOf(GBPerMonth), true)); target.append("&tooLow=true"); return target.toString(); } setWizardComplete(); return FirstTimeWizardToadlet.WIZARD_STEP.COMPLETE.name(); }
Source:
<code>public String getDetailedPeerState() { return getPeerState().toString().toLowerCase() <START> + ((getZabState() != ZabState.ELECTION) ? <END> " - " + getZabState().toString().toLowerCase() : "") + ((getSyncMode() != SyncMode.NONE) ? " - " + getSyncMode().toString().toLowerCase() : ""); }</code><technical_language>Nit: call getZabState getSyncMode</technical_language>

Target:
public String getDetailedPeerState() { final StringBuilder sb = new StringBuilder(getPeerState().toString().toLowerCase()); final ZabState zabState = getZabState(); if (!ZabState.ELECTION.equals(zabState)) { sb.append(" - ").append(zabState.toString().toLowerCase()); } final SyncMode syncMode = getSyncMode(); if (!SyncMode.NONE.equals(syncMode)) { sb.append(" - ").append(syncMode.toString().toLowerCase()); } return sb.toString(); }
Source:
<code><START> private void guaranteeSameVPC(TargetGroup targetGroup, <END> Collection<BaragonAgentMetadata> agents, Collection<LoadBalancer> loadBalancers) { String vpcId = targetGroup.getVpcId(); for (BaragonAgentMetadata agent : agents) { if (agent.getEc2().getVpcId().isPresent()) { if (! agent.getEc2().getVpcId().get().equals(vpcId)) { LOG.warn("Agent not on same VPC as its target group {}", agent, targetGroup); } } else { LOG.warn("Agent not assigned to a VPC", agent); } } for (LoadBalancer loadBalancer : loadBalancers) { if (!vpcId.equals(loadBalancer.getVpcId())) { LOG.warn("Load balancer on different VPC from target group {}", loadBalancer, targetGroup); } } }</code><technical_language>return/raise this method if find a mismatch in vpc. If vpc match of time register reuqests fail</technical_language>

Target:
private void guaranteeSameVPC(TargetGroup targetGroup, Collection<BaragonAgentMetadata> agents, Collection<LoadBalancer> loadBalancers) { String vpcId = targetGroup.getVpcId(); for (BaragonAgentMetadata agent : agents) { if (agent.getEc2().getVpcId().isPresent()) { if (! agent.getEc2().getVpcId().get().equals(vpcId)) { LOG.error("Agent not on same VPC as its target group {}", agent, targetGroup); throw new IllegalStateException(String.format("Agent %s not on same VPC as its target group %s", agent, targetGroup)); } } else { LOG.error("Agent not assigned to a VPC", agent); throw new IllegalStateException(String.format("Agent %s not assigned to a VPC", agent)); } } for (LoadBalancer loadBalancer : loadBalancers) { if (!vpcId.equals(loadBalancer.getVpcId())) { LOG.error("Load balancer on different VPC from target group {}", loadBalancer, targetGroup); throw new IllegalStateException(String.format("Load balancer %s on different VPC from target group %s", loadBalancer, targetGroup)); } } }
Source:
<code>MessageActionDto handleAction_Process(UserDto actingUser, BuddyConnectResponseMessage connectResponseMessageEntity, MessageActionDto payload) { if (connectResponseMessageEntity.getStatus() == Status.REJECTED) { buddyService.removeBuddyAfterConnectRejection(actingUser.getId(), connectResponseMessageEntity.getBuddyId()); } else { buddyService.setBuddyAcceptedWithSecretUserInfo(connectResponseMessageEntity.getBuddyId(), connectResponseMessageEntity.getRelatedUserAnonymizedId().get(), connectResponseMessageEntity.getSenderNickname()); } <START> UserDto actingUserAfterUpdate = userService.getPrivateUser(actingUser.getId()); <END> connectResponseMessageEntity = updateMessageStatusAsProcessed(connectResponseMessageEntity); Optional<User> senderUser = connectResponseMessageEntity.getSenderUser(); String mobileNumber = senderUser.map(User::getMobileNumber).orElse("already deleted"); String id = senderUser.map(u -> u.getId().toString()).orElse("already deleted"); logger.info( "User with mobile number '{}' and ID '{}' processed buddy connect response from user with mobile number '{}' and ID '{}'", actingUser.getMobileNumber(), actingUser.getId(), mobileNumber, id); return MessageActionDto .createInstanceActionDone(theDtoFactory.createInstance(actingUserAfterUpdate, connectResponseMessageEntity)); }</code><technical_language>fine if inline userService.getPrivateUser(actingUser.getId()) in place actingUserAfterUpdate is line 155 below</technical_language>

Target:
MessageActionDto handleAction_Process(UserDto actingUser, BuddyConnectResponseMessage connectResponseMessageEntity, MessageActionDto payload) { if (connectResponseMessageEntity.getStatus() == Status.REJECTED) { buddyService.removeBuddyAfterConnectRejection(actingUser.getId(), connectResponseMessageEntity.getBuddyId()); } else { buddyService.setBuddyAcceptedWithSecretUserInfo(connectResponseMessageEntity.getBuddyId(), connectResponseMessageEntity.getRelatedUserAnonymizedId().get(), connectResponseMessageEntity.getSenderNickname()); } actingUser = userService.getPrivateUser(actingUser.getId()); connectResponseMessageEntity = updateMessageStatusAsProcessed(connectResponseMessageEntity); logHandledAction_Process(actingUser, connectResponseMessageEntity); return MessageActionDto .createInstanceActionDone(theDtoFactory.createInstance(actingUser, connectResponseMessageEntity)); }
Source:
<code><START> public BinaryRelation binaryRelation() { <END> switch (kind) { case EQUAL: return new EqualRelation(leftOp, rightOp); case NOT_EQUAL: return new NotEqualRelation(leftOp, rightOp); case LESS_THAN: return new LessThanRelation(leftOp, rightOp); case LESS_THAN_OR_EQUAL: return new LessThanOrEqualRelation(leftOp, rightOp); case GREATER_THAN: return new GreaterThanRelation(leftOp, rightOp); case GREATER_THAN_OR_EQUAL: return new GreaterThanOrEqualRelation(leftOp, rightOp); case METHOD_EQUALS: return new MethodEqualsRelation(leftOp, rightOp); case NOT_METHOD_EQUALS: return new NotMethodEqualsRelation(leftOp, rightOp); default: throw new IllegalStateException("In case someone adds an element to the enum...!"); } }</code><technical_language>![MAJOR](<LINK_1> Reduce number of returns of this method 8, maximum allowed 5. [![rule](<LINK_2>](<LINK_3> ![MAJOR](<LINK_1> Cyclomatic Complexity of this method "binaryRelation" is 18 is greater 10 authorized. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public BinaryRelation binaryRelation() { BinaryRelation relation; switch (kind) { case EQUAL: relation = new EqualRelation(leftOp, rightOp); break; case NOT_EQUAL: relation = new NotEqualRelation(leftOp, rightOp); break; case LESS_THAN: relation = new LessThanRelation(leftOp, rightOp); break; case LESS_THAN_OR_EQUAL: relation = new LessThanOrEqualRelation(leftOp, rightOp); break; case GREATER_THAN: relation = new GreaterThanRelation(leftOp, rightOp); break; case GREATER_THAN_OR_EQUAL: relation = new GreaterThanOrEqualRelation(leftOp, rightOp); break; case METHOD_EQUALS: relation = new MethodEqualsRelation(leftOp, rightOp); break; case NOT_METHOD_EQUALS: relation = new NotMethodEqualsRelation(leftOp, rightOp); break; default: throw new IllegalStateException("Creation of relation of kind " + kind + " is missing!"); } return relation; }
Source:
<code>public void removeSegment(String segmentName) { super.removeSegment(segmentName); try { loadLookupTable(); <START> _logger.info("Successfully removed segment and reloaded lookup table for {}", getTableName()); <END> } catch (Exception e) { _logger.error("Error reloading lookup table after segment remove for table {}", getTableName()); } }</code><technical_language>(nit) suggestion _logger.info("Successfully removed segment reloaded lookup table: {}", getTableName());</technical_language>

Target:
public void removeSegment(String segmentName) { super.removeSegment(segmentName); try { loadLookupTable(); _logger.info("Successfully removed segment and reloaded lookup table: {}", segmentName, getTableName()); } catch (Exception e) { throw new RuntimeException(String .format("Error reloading lookup table after segment remove ({}) for table: {}", segmentName, getTableName()), e); } }
Source:
<code>public List<PlotPoint> loadSeries(FilePath workspaceRootDir, int buildNumber, PrintStream logger) { List<PlotPoint> ret = null; FilePath[] seriesFiles; try { seriesFiles = workspaceRootDir.list(getFile()); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception trying to retrieve series files", e); return null; } if (ArrayUtils.isEmpty(seriesFiles)) { LOGGER.info("No plot data file found: " + workspaceRootDir.getName() + " " + getFile()); return null; } <START> for (int index = 0; index < seriesFiles.length; index++) { <END> List<PlotPoint> seriesList = loadSeriesFile(seriesFiles[index], buildNumber, logger); if (seriesList != null) { if (ret != null) { ret.addAll(seriesList); } else { ret = seriesList; } } } return ret; }</code><technical_language>foreach syntax instead? suggestion for (FilePath seriesFile : seriesFiles) { List<PlotPoint> seriesList = loadSeriesFile(seriesFile, buildNumber, logger);</technical_language>

Target:
public List<PlotPoint> loadSeries(FilePath workspaceRootDir, int buildNumber, PrintStream logger) { List<PlotPoint> ret = null; FilePath[] seriesFiles; try { seriesFiles = workspaceRootDir.list(getFile()); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Exception trying to retrieve series files", e); return null; } if (ArrayUtils.isEmpty(seriesFiles)) { LOGGER.info("No plot data file found: " + workspaceRootDir.getName() + " " + getFile()); return null; } for (FilePath seriesFile : seriesFiles) { List<PlotPoint> seriesList = loadSeriesFile(seriesFile, buildNumber); if (seriesList != null) { if (ret != null) { ret.addAll(seriesList); } else { ret = seriesList; } } } return ret; }
Source:
<code>private static List<DimensionSpec> makeFieldsFromFieldNames(List<String> fieldNames) { <START> return Lists.transform( <END> fieldNames, new Function<String, DimensionSpec>() { @Override public DimensionSpec apply(String input) { return new DefaultDimensionSpec(input, input); } } ); }</code><technical_language>Lists.transform is lazy; this is a member field, copy wrapping this ImmutableList.copyOf(...)</technical_language>

Target:
private static List<DimensionSpec> makeFieldsFromFieldNames(List<String> fieldNames) { return ImmutableList.copyOf( Lists.transform( fieldNames, new Function<String, DimensionSpec>() { @Override public DimensionSpec apply(String input) { return new DefaultDimensionSpec(input, input); } } ) ); }
Source:
<code>public SWTBotTreeItem collapse() { waitForEnabled(); if (!isExpanded()) { log.warn(MessageFormat.format("Tree item {0} is already collapsed. Won''t collapse it again.", this)); return this; } <START> asyncExec(new VoidResult() { <END> @Override public void run() { widget.setExpanded(false); } }); postCollapseNotify(); return this; }</code><technical_language>syncExec</technical_language>

Target:
public SWTBotTreeItem collapse() { waitForEnabled(); if (!isExpanded()) { log.warn(MessageFormat.format("Tree item {0} is already collapsed. Won''t collapse it again.", this)); return this; } preCollapseNotify(); syncExec(new VoidResult() { @Override public void run() { widget.setExpanded(false); } }); postCollapseNotify(); return this; }
Source:
<code><START> public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) { <END> JsonObject msg = new JsonObject(); msg.put("consumerTag", consumerTag); populate(msg, envelope); if (includeProperties) { put("properties", toJson(properties), msg); } try { msg.put("body", parse(properties, body)); msg.put("deliveryTag", envelope.getDeliveryTag()); this.handlerContext.runOnContext(v -> handler.handle(Future.succeededFuture(msg))); } catch (Exception e) { this.handlerContext.runOnContext(v -> handler.handle(Future.failedFuture(e))); } }</code><technical_language>is related this PR</technical_language>

Target:
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { JsonObject msg = new JsonObject(); msg.put("consumerTag", consumerTag); populate(msg, envelope); if (includeProperties) { put("properties", toJson(properties), msg); } try { msg.put("body", parse(properties, body)); msg.put("deliveryTag", envelope.getDeliveryTag()); this.handlerContext.runOnContext(v -> handler.handle(Future.succeededFuture(msg))); } catch (Exception e) { this.handlerContext.runOnContext(v -> handler.handle(Future.failedFuture(e))); } }
Source:
<code>public void write(Batch batch) throws StageException { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); DataGenerator gen = null; <START> try { <END> gen = gcsTargetConfig.dataGeneratorFormatConfig.getDataGeneratorFactory().getGenerator(bOut); } catch (IOException e) { throw new StageException(Errors.GENERIC, e); } Iterator<Record> batchIterator = batch.getRecords(); while (batchIterator.hasNext()) { Record record = batchIterator.next(); try { gen.write(record); } catch (IOException e) { throw new StageException(Errors.GENERIC, e); } } try { gen.close(); } catch (IOException e) { throw new StageException(Errors.GENERIC, e); } if (bOut.size() > 0) { TimeEL.setCalendarInContext(elVars, calendar); TimeNowEL.setTimeNowInContext(elVars, new Date()); String partition = partitionEval.eval(elVars, gcsTargetConfig.partitionTemplate, String.class); String path = gcsTargetConfig.commonPrefix + partition + "/" + gcsTargetConfig.fileNamePrefix + UUID.randomUUID(); BlobId blobId = BlobId.of(gcsTargetConfig.bucketTemplate, path); BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType(getContentType()).build(); Blob blob = storage.create(blobInfo, bOut.toByteArray()); } }</code><technical_language>i suggest try resources in instead of explicit open close data generator</technical_language>

Target:
public void write(Batch batch) throws StageException { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); Iterator<Record> batchIterator = batch.getRecords(); while (batchIterator.hasNext()) { Record record = batchIterator.next(); DataGeneratorFactory generatorFactory = gcsTargetConfig.dataGeneratorFormatConfig.getDataGeneratorFactory(); try (DataGenerator gen = generatorFactory.getGenerator(bOut)) { gen.write(record); } catch (IOException e) { getContext().toError(record, Errors.GCS_00, e); } } if (bOut.size() > 0) { TimeEL.setCalendarInContext(elVars, calendar); TimeNowEL.setTimeNowInContext(elVars, calendar.getTime()); String partition = partitionEval.eval(elVars, gcsTargetConfig.partitionTemplate, String.class); String path = gcsTargetConfig.commonPrefix + partition + gcsTargetConfig.fileNamePrefix + UUID.randomUUID(); BlobId blobId = BlobId.of(gcsTargetConfig.bucketTemplate, path); BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType(getContentType()).build(); try { Blob blob = storage.create(blobInfo, bOut.toByteArray()); } catch(StorageException e) { batchIterator = batch.getRecords(); while (batchIterator.hasNext()) { getContext().toError(batchIterator.next(), e); } } } }
Source:
<code>public void partialLoadingConceptApi() throws Exception { PageableCollectionResource<String[]> hits = new CodeSystemResourceRequest<>(CodeSystemURI.head(SnomedApiTestConstants.INT_CODESYSTEM), new RevisionIndexReadRequest<>( context -> { return SnomedRequests.prepareSearchConcept() .all() .setFields(SnomedRf2Headers.FIELD_ID, SnomedRf2Headers.FIELD_EFFECTIVE_TIME) .toRawSearch(String[].class) .build() .execute(context); } )).execute(ApplicationContext.getServiceForClass(Environment.class)); <START> System.err.println(hits); <END> hits.forEach(hit -> { assertNotNull(SnomedIdentifiers.create(hit[0])); assertNotNull(EffectiveTimes.parse(hit[1], DateFormats.SHORT)); }); }</code><technical_language>Accidentally committed syserr</technical_language>

Target:
public void partialLoadingConceptApi() throws Exception { PageableCollectionResource<String[]> hits = new CodeSystemResourceRequest<>(CodeSystemURI.head(SnomedApiTestConstants.INT_CODESYSTEM), new RevisionIndexReadRequest<>( context -> { return SnomedRequests.prepareSearchConcept() .all() .setFields(SnomedRf2Headers.FIELD_ID, SnomedRf2Headers.FIELD_EFFECTIVE_TIME) .toRawSearch(String[].class) .build() .execute(context); } )).execute(ApplicationContext.getServiceForClass(Environment.class)); hits.forEach(hit -> { assertNotNull(SnomedIdentifiers.create(hit[0])); assertNotNull(EffectiveTimes.parse(hit[1], DateFormats.SHORT)); }); }