auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private static LineEdit readEdit(final InputStream in) throws IOException { <END> final int beginA = readVarInt32(in); final int endA = readVarInt32(in); final int beginB = readVarInt32(in); final int endB = readVarInt32(in); return new LineEdit(beginA, endA, beginB, endB); }</code><technical_language>BaseEdit</technical_language>

Target:
private static BaseEdit readEdit(final InputStream in) throws IOException { final int beginA = readVarInt32(in); final int endA = readVarInt32(in); final int beginB = readVarInt32(in); final int endB = readVarInt32(in); return new BaseEdit(beginA, endA, beginB, endB); }
Source:
<code>public KafkaConnector createConnector(String connectorName, Properties config) { VerifiableProperties verifiableProperties = new VerifiableProperties(config); long commitMillis = verifiableProperties.getLongInRange(KafkaConnector.CONFIG_COMMIT_INTERVAL_MILLIS, TimeUnit.SECONDS.toMillis(30), 0, TimeUnit.HOURS.toMillis(1)); String factory = verifiableProperties.getString(KafkaConnector.CONFIG_CONSUMER_FACTORY_CLASS); KafkaConsumerFactory<?, ?> kafkaConsumerFactory = ReflectionUtils.createInstance(factory); if (kafkaConsumerFactory == null) { <START> throw new DatastreamRuntimeException("Unable to instantiate factory class" + factory); <END> } return new KafkaConnector(connectorName, commitMillis, kafkaConsumerFactory); }</code><technical_language>nit: need a space "class"</technical_language>

Target:
public KafkaConnector createConnector(String connectorName, Properties config) { VerifiableProperties verifiableProperties = new VerifiableProperties(config); long commitMillis = verifiableProperties.getLongInRange(KafkaConnector.CONFIG_COMMIT_INTERVAL_MILLIS, TimeUnit.SECONDS.toMillis(30), 0, TimeUnit.HOURS.toMillis(1)); String factory = verifiableProperties.getString(KafkaConnector.CONFIG_CONSUMER_FACTORY_CLASS, KafkaConsumerFactoryImpl.class.getName()); KafkaConsumerFactory<?, ?> kafkaConsumerFactory = ReflectionUtils.createInstance(factory); if (kafkaConsumerFactory == null) { throw new DatastreamRuntimeException("Unable to instantiate factory class: " + factory); } Properties kafkaConsumerProps = verifiableProperties.getDomainProperties(DOMAIN_KAFKA_CONSUMER); return new KafkaConnector(connectorName, commitMillis, kafkaConsumerFactory, kafkaConsumerProps); }
Source:
<code>public static BlockRayBuilder from(Entity entity) { <START> final Vector3d rotation = entity.getRotation(); <END> final Vector3d direction = Quaterniond.fromAxesAnglesDeg(rotation.getY(), 360 - rotation.getX(), rotation.getZ()).getDirection(); final Location location = entity.getLocation(); final Vector3d position; final Optional<EyeLocationData> data = entity.getData(EyeLocationData.class); if (data.isPresent()) { position = data.get().getEyeLocation(); } else { position = location.getPosition(); } return from(location.getExtent(), position).direction(direction); }</code><technical_language>Missed a null check..</technical_language>

Target:
public static BlockRayBuilder from(Entity entity) { Preconditions.checkNotNull(entity, "entity"); final Vector3d rotation = entity.getRotation(); final Vector3d direction = Quaterniond.fromAxesAnglesDeg(rotation.getY(), 360 - rotation.getX(), rotation.getZ()).getDirection(); final Location location = entity.getLocation(); final Vector3d position; final Optional<EyeLocationData> data = entity.getData(EyeLocationData.class); if (data.isPresent()) { position = data.get().getEyeLocation(); } else { position = location.getPosition(); } return from(location.getExtent(), position).direction(direction); }
Source:
<code>private Database(CatalogContext context, String type, String name, UnderDatabase udb, CatalogConfiguration config) { mContext = context; mType = type; mName = name; mTables = new ConcurrentHashMap<>(); mUdb = udb; mConfig = config; mIgnoreTables = Sets.newHashSet(Splitter.on(",").trimResults().omitEmptyStrings() <START> .split(mConfig.get(CatalogProperty.DB_IGNORE_TABLES))); <END> }</code><technical_language>This implementation InstancedConfiguration, extract this a function in FormatUtils CommonUtils code in places</technical_language>

Target:
private Database(CatalogContext context, String type, String name, UnderDatabase udb, CatalogConfiguration config) { mContext = context; mType = type; mName = name; mTables = new ConcurrentHashMap<>(); mUdb = udb; mConfig = config; mIgnoreTables = Sets.newHashSet( ConfigurationUtils.parseAsList(mConfig.get(CatalogProperty.DB_IGNORE_TABLES), ",")); }
Source:
<code>public static String printLogical(List<PlanFragment> fragments, Session session) { <START> GraphvizPrinter printer = new GraphvizPrinter(session); <END> Map<PlanFragmentId, PlanFragment> fragmentsById = Maps.uniqueIndex(fragments, PlanFragment::getId); PlanNodeIdGenerator idGenerator = new PlanNodeIdGenerator(); StringBuilder output = new StringBuilder(); output.append("digraph logical_plan {\n"); for (PlanFragment fragment : fragments) { printFragmentNodes(output, fragment, idGenerator, session); } for (PlanFragment fragment : fragments) { fragment.getRoot().accept(new EdgePrinter(output, fragmentsById, idGenerator), null); } output.append("}\n"); return output.toString(); }</code><technical_language>for printer. Session a local variable. need for putting in constructor</technical_language>

Target:
public static String printLogical(List<PlanFragment> fragments, Session session) { Map<PlanFragmentId, PlanFragment> fragmentsById = Maps.uniqueIndex(fragments, PlanFragment::getId); PlanNodeIdGenerator idGenerator = new PlanNodeIdGenerator(); StringBuilder output = new StringBuilder(); output.append("digraph logical_plan {\n"); for (PlanFragment fragment : fragments) { printFragmentNodes(output, fragment, idGenerator, session); } for (PlanFragment fragment : fragments) { fragment.getRoot().accept(new EdgePrinter(output, fragmentsById, idGenerator), null); } output.append("}\n"); return output.toString(); }
Source:
<code>public boolean filter(String filter, boolean fullTrace, Locale locale) { return allocatedClassMatches(filter, locale) || getMatchingStackFrames(filter, fullTrace, <START> locale).size() > 0; <END> }</code><technical_language>!isEmpty</technical_language>

Target:
public boolean filter(String filter, boolean fullTrace, Locale locale) { return allocatedClassMatches(filter, locale) || !getMatchingStackFrames(filter, fullTrace, locale).isEmpty(); }
Source:
<code>public void destroyNode(final String id) { logger.debug("Destroying %s ...", id); String storageAccountName = id.replaceAll("[^A-Za-z0-9 ]", "") + "storage"; int index = id.lastIndexOf("-"); String group = id.substring(0, index); URI uri = api.getVirtualMachineApi(azureGroup).delete(id); if (uri != null){ boolean jobDone = Predicates2.retry(new Predicate<URI>() { @Override public boolean apply(URI uri) { return ParseJobStatus.JobStatus.DONE == api.getJobApi().jobStatus(uri); } }, 60 * 10 * 1000 ).apply(uri); if (jobDone) { api.getStorageAccountApi(azureGroup).delete(storageAccountName); uri = api.getNetworkInterfaceCardApi(azureGroup).delete(id + "nic"); if (uri != null){ jobDone = Predicates2.retry(new Predicate<URI>() { @Override public boolean apply(URI uri) { return ParseJobStatus.JobStatus.DONE == api.getJobApi().jobStatus(uri) || ParseJobStatus.JobStatus.NO_CONTENT == api.getJobApi().jobStatus(uri); } <START> }, 60 * 10 * 1000 ).apply(uri); <END> if (jobDone) { api.getPublicIPAddressApi(azureGroup).delete(id + "publicip"); api.getDeploymentApi(azureGroup).delete(id); api.getVirtualNetworkApi(azureGroup).delete(group + "virtualnetwork"); } } } } }</code><technical_language>here, move a reusable predicate get injected</technical_language>

Target:
public void destroyNode(final String id) { checkState(cleanupResources.apply(id), "server(%s) and its resources still there after deleting!?", id); }
Source:
<code>public static <T, R> R create(Function1<T, R> function, T source, int elementCount, Function1<R, Boolean> assertion) { <START> final Tuple2<Integer, Function1<?, ?>> key = Tuple.of(elementCount, function); <END> return (R) FUNCTION_CACHE.get(key).getOrElse(() -> { final R result = function.apply(source); assert assertion.apply(result); FUNCTION_CACHE = FUNCTION_CACHE.put(key, result); MemoryUsage.storeMemoryUsages(source, elementCount, result); return result; }); }</code><technical_language>uh, - is Function equality. A Function part of a Map key</technical_language>

Target:
public static <T, R> R create(Function1<T, R> function, T source, int elementCount, Function1<R, Boolean> assertion) { final R result = function.apply(source); assert assertion.apply(result); MemoryUsage.storeMemoryUsages(source, elementCount, result); return result; }
Source:
<code>protected void acquire(TransactionLocks locks) throws IOException { setLockMode(lockType); Set<String> hldrs = new HashSet<>(); if (leaseHolder != null) { hldrs.add(leaseHolder); <START> } else if (leaseHolder == null && LeaseHolderResolveType.ALL_PATHS == resolveType ) { <END> Collection<Lease> leases = acquireLockList(lockType, Lease.Finder.All); for(Lease lease : leases){ hldrs.add(lease.getHolder()); } } if (locks.containsLock(Type.INode)) { BaseINodeLock inodeLock = (BaseINodeLock) locks.getLock(Type.INode); for (INode f : inodeLock.getAllResolvedINodes()) { if ((f instanceof INodeFile) && f.isUnderConstruction()) { hldrs.add(((INodeFile) f).getFileUnderConstructionFeature().getClientName()); } } } List<String> holders = new ArrayList<>(hldrs); Collections.sort(holders); if (holders.isEmpty() && !locks.containsLock(Type.INode)) { Collection<Lease> allLeases = acquireLockList(lockType, Lease.Finder.All); if (leases != null) { leases.addAll(allLeases); } } for (String h : holders) { acquireLock(lockType, LeaseCreationLock.Finder.ByRowID, Math.abs(Lease.getHolderId(h)) % LEASE_CREATION_LOCK_ROWS); Lease lease = acquireLock(lockType, Lease.Finder.ByHolder, h, Lease.getHolderId(h)); if (lease != null) { leases.add(lease); } } }</code><technical_language>remove leaseHolder == null && true</technical_language>

Target:
protected void acquire(TransactionLocks locks) throws IOException { setLockMode(lockType); Set<String> hldrs = new HashSet<>(); if (leaseHolder != null) { hldrs.add(leaseHolder); } if (locks.containsLock(Type.INode)) { BaseINodeLock inodeLock = (BaseINodeLock) locks.getLock(Type.INode); for (INode f : inodeLock.getAllResolvedINodes()) { if ((f instanceof INodeFile) && f.isUnderConstruction()) { hldrs.add(((INodeFile) f).getFileUnderConstructionFeature().getClientName()); } } } if (LeaseHolderResolveType.ALL_SYSTEM_PATHS_FOR_TESTSING == resolveType ) { Collection<Lease> leases = acquireLockList(lockType, Lease.Finder.All); for(Lease lease : leases){ hldrs.add(lease.getHolder()); } } List<String> holders = new ArrayList<>(hldrs); Collections.sort(holders); if (holders.isEmpty() && !locks.containsLock(Type.INode)) { Collection<Lease> allLeases = acquireLockList(lockType, Lease.Finder.All); if (leases != null) { leases.addAll(allLeases); } } for (String h : holders) { acquireLock(lockType, LeaseCreationLock.Finder.ByRowID, Math.abs(Lease.getHolderId(h)) % LEASE_CREATION_LOCK_ROWS); Lease lease = acquireLock(lockType, Lease.Finder.ByHolder, h, Lease.getHolderId(h)); if (lease != null) { leases.add(lease); } } }
Source:
<code>public boolean hasNext() { <START> if (next == null) { <END> checkInvariants(); if (iterator.isValid()) { next = new AbstractMap.SimpleEntry( serializer.deserialize(Unpooled.wrappedBuffer(iterator.key()), corfuRuntime), serializer.deserialize(Unpooled.wrappedBuffer(iterator.value()), corfuRuntime)); iterator.next(); } else { iterator.close(); } } return next != null; }</code><technical_language>please invert if condition</technical_language>

Target:
public boolean hasNext() { if (next != null) { return true; } checkInvariants(); if (iterator.isValid()) { next = new AbstractMap.SimpleEntry( serializer.deserialize(Unpooled.wrappedBuffer(iterator.key()), corfuRuntime), serializer.deserialize(Unpooled.wrappedBuffer(iterator.value()), corfuRuntime)); iterator.next(); } else { iterator.close(); } return next != null; }
Source:
<code>private void assertQuery(String query, byte[] checksum) { byte[] expected = (byte[]) computeActual(query).getOnlyValue(); for (int i = 0; i < expected.length; i++) { System.err.print(expected[i] + ", "); <START> } <END> assertEquals(computeActual(query).getOnlyValue(), checksum); }</code><technical_language>Remove merging</technical_language>

Target:
private void assertQuery(String query, byte[] checksum) { assertEquals(computeActual(query).getOnlyValue(), checksum); }
Source:
<code>public static Item getRepositoryContextItemById(String contextId) { if (IContextParameter.BUILT_IN.equals(contextId)) { return null; } if (checkObject(contextId)) { return null; } IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory(); try { final IRepositoryViewObject lastVersion = factory.getLastVersion(contextId, ERepositoryObjectType.CONTEXT); <START> if (lastVersion != null) { <END> final Item item = lastVersion.getProperty().getItem(); if (item != null) { return item; } } } catch (PersistenceException e) { ExceptionHandler.process(e); } return null; }</code><technical_language>I modify code this. contextId joblet node context node</technical_language>

Target:
public static Item getRepositoryContextItemById(String contextId) { if (IContextParameter.BUILT_IN.equals(contextId)) { return null; } if (checkObject(contextId)) { return null; } List<ERepositoryObjectType> possibleTypes = new ArrayList<ERepositoryObjectType>(); possibleTypes.add(ERepositoryObjectType.CONTEXT); possibleTypes.addAll(ERepositoryObjectType.getAllTypesOfJoblet()); possibleTypes.addAll(ERepositoryObjectType.getAllTypesOfProcess()); try { IRepositoryViewObject lastVersion = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory() .getLastVersion(contextId, possibleTypes); if (lastVersion != null) { final Item item = lastVersion.getProperty().getItem(); if (item != null) { return item; } } } catch (PersistenceException e) { ExceptionHandler.process(e); } return null; }
Source:
<code>public CitationStyleToClipboardWorker(BasePanel basePanel, CitationStyleOutputFormat outputFormat, DialogService dialogService, ClipBoardManager clipBoardManager, PreviewPreferences previewPreferences) { this.basePanel = basePanel; this.selectedEntries = basePanel.getSelectedEntries(); this.style = previewPreferences.getPreviewCycle().get(previewPreferences.getPreviewCyclePosition()); this.previewStyle = previewPreferences.getPreviewStyle(); this.outputFormat = outputFormat; this.clipBoardManager = clipBoardManager; this.dialogService = dialogService; dialogService.notify(Localization.lang("Copying...")); <START> BackgroundTask.wrap(this::loadCitationStyles).onFailure(ex -> LOGGER.error("Error while copying citations to the clipboard", ex)) <END> .onSuccess(this::done); }</code><technical_language>I guess need run background task (i.e call execute()). I fact constructor side-effect of running a new thread. Thus, I propose CitationStyleToClipboardWorker inherit BackgroundTask rename loadCitationStyles call (so overrides method in background task). statement in basepanel new CitationStyleToClipboardWorker(...).executeWith(Globals.taskExecutor)</technical_language>

Target:
public CitationStyleToClipboardWorker(BasePanel basePanel, CitationStyleOutputFormat outputFormat, DialogService dialogService, ClipBoardManager clipBoardManager, PreviewPreferences previewPreferences) { this.basePanel = basePanel; this.selectedEntries = basePanel.getSelectedEntries(); this.style = previewPreferences.getPreviewCycle().get(previewPreferences.getPreviewCyclePosition()); this.previewStyle = previewPreferences.getPreviewStyle(); this.outputFormat = outputFormat; this.clipBoardManager = clipBoardManager; this.dialogService = dialogService; }
Source:
<code>public String getStorageDir(DataSegment dataSegment) { <START> <END> String seg = JOINER.join( dataSegment.getDataSource(), String.format( Locale.ENGLISH, "%s_%s", dataSegment.getInterval().getStart().toString(ISODateTimeFormat.basicDateTime()), dataSegment.getInterval().getEnd().toString(ISODateTimeFormat.basicDateTime()) ), dataSegment.getVersion(), dataSegment.getShardSpec().getPartitionNum() ); log.info("DataSegment: " + seg); return seg.replace(":", "_"); }</code><technical_language>Extra line</technical_language>

Target:
public String getStorageDir(DataSegment dataSegment) { String seg = JOINER.join( dataSegment.getDataSource(), StringUtils.format( "%s_%s", dataSegment.getInterval().getStart().toString(ISODateTimeFormat.basicDateTime()), dataSegment.getInterval().getEnd().toString(ISODateTimeFormat.basicDateTime()) ), dataSegment.getVersion().replace(":", "_"), dataSegment.getShardSpec().getPartitionNum() ); log.info("DataSegment: [%s]", seg); return seg; }
Source:
<code>private static HttpScope sessionScope(HttpServerExchange exchange, ScopeSessionListener listener) { ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); return new HttpScope() { <START> private HttpSession session = context.getOriginalRequest().getSession(); <END> @Override public String getID() { return (exists()) ? session.getId() : null; } @Override public boolean exists() { return session != null; } @Override public synchronized boolean create() { if (exists()) { return false; } session = context.getOriginalRequest().getSession(true); return session != null; } @Override public boolean supportsAttachments() { return exists(); } @Override public void setAttachment(String key, Object value) { if (exists()) { session.setAttribute(key, value); } } @Override public Object getAttachment(String key) { return (exists()) ? session.getAttribute(key) : null; } @Override public boolean supportsInvalidation() { return exists(); } @Override public boolean invalidate() { if (exists()) { try { session.invalidate(); return true; } catch (IllegalStateException cause) { UndertowLogger.ROOT_LOGGER.debugf("Failed to invalidate session", cause); } } return false; } @Override public boolean supportsNotifications() { return exists(); } @Override public void registerForNotification(Consumer<HttpScopeNotification> consumer) { if (exists()) { listener.registerListener(session.getId(), consumer); } } }; }</code><technical_language>this getSession(false) ? getSession() is getSession(true). I ask create() exists() check if false a getSession(true). exists() check return false ^^^ create a session</technical_language>

Target:
private static HttpScope sessionScope(HttpServerExchange exchange, ScopeSessionListener listener) { ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); return new HttpScope() { private HttpSession session = context.getOriginalRequest().getSession(false); @Override public String getID() { return (exists()) ? session.getId() : null; } @Override public boolean exists() { return session != null; } @Override public synchronized boolean create() { if (exists()) { return false; } session = context.getOriginalRequest().getSession(true); return session != null; } @Override public boolean supportsAttachments() { return exists(); } @Override public void setAttachment(String key, Object value) { if (exists()) { session.setAttribute(key, value); } } @Override public Object getAttachment(String key) { return (exists()) ? session.getAttribute(key) : null; } @Override public boolean supportsInvalidation() { return exists(); } @Override public boolean invalidate() { if (exists()) { try { session.invalidate(); return true; } catch (IllegalStateException cause) { UndertowLogger.ROOT_LOGGER.debugf("Failed to invalidate session", cause); } } return false; } @Override public boolean supportsNotifications() { return exists(); } @Override public void registerForNotification(Consumer<HttpScopeNotification> consumer) { if (exists()) { listener.registerListener(session.getId(), consumer); } } }; }
Source:
<code>public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (getActivity() instanceof PreLoadingListener) { preloadingListener = (PreLoadingListener) getActivity(); } else { throw new RuntimeException("Parent activity of this Fragment should implement the PreLoadingListener interface"); } swipeContainer.setEnabled(false); authWebView.initWebView(getActivity(), true, false); authWebView.getWebViewClient().setPageStatusListener(new URLInterceptorWebViewClient.IPageStatusListener() { @Override public void onPageStarted() { isPageLoading = true; } @Override public void onPageFinished() { if (authWebView.isPageLoaded()) { <START> isProblemXBlock(); <END> if (getUserVisibleHint()) { preloadingListener.setLoadingState(PreLoadingListener.State.MAIN_UNIT_LOADED); } isPageLoading = false; EventBus.getDefault().post(new UnitLoadedEvent()); } } @Override public void onPageLoadError(WebView view, int errorCode, String description, String failingUrl) { isPageLoading = false; } @Override public void onPageLoadError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse, boolean isMainRequestFailure) { isPageLoading = false; } @Override public void onPageLoadProgressChanged(WebView webView, int progress) { } }); if (getUserVisibleHint() || preloadingListener.isMainUnitLoaded()) { loadUnit(); } }</code><technical_language>rename fetchDataBannerInfo isProblemXBlock boolean return type method</technical_language>

Target:
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (getActivity() instanceof PreLoadingListener) { preloadingListener = (PreLoadingListener) getActivity(); } else { throw new RuntimeException("Parent activity of this Fragment should implement the PreLoadingListener interface"); } swipeContainer.setEnabled(false); authWebView.initWebView(getActivity(), true, false); authWebView.getWebViewClient().setPageStatusListener(new URLInterceptorWebViewClient.IPageStatusListener() { @Override public void onPageStarted() { isPageLoading = true; } @Override public void onPageFinished() { if (authWebView.isPageLoaded()) { fetchDateBannerInfo(); if (getUserVisibleHint()) { preloadingListener.setLoadingState(PreLoadingListener.State.MAIN_UNIT_LOADED); } isPageLoading = false; EventBus.getDefault().post(new UnitLoadedEvent()); } } @Override public void onPageLoadError(WebView view, int errorCode, String description, String failingUrl) { isPageLoading = false; } @Override public void onPageLoadError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse, boolean isMainRequestFailure) { isPageLoading = false; } @Override public void onPageLoadProgressChanged(WebView webView, int progress) { } }); if (getUserVisibleHint() || preloadingListener.isMainUnitLoaded()) { loadUnit(); } if (unit.getType() == BlockType.PROBLEM) { initObserver(); } }
Source:
<code><START> ExecutionPath(@Nullable ExplodedGraph.Edge edge, PSet<ExplodedGraph.Edge> visited, @Nullable Symbol trackSymbol, List<JavaFileScannerContext.Location> flow, boolean finished) { <END> this.trackSymbol = trackSymbol; this.lastEdge = edge; this.visited = visited; this.flow = flow; this.finished = finished; }</code><technical_language>I set private this class externalized point</technical_language>

Target:
private ExecutionPath(@Nullable ExplodedGraph.Edge edge, PSet<ExplodedGraph.Edge> visited, @Nullable Symbol trackSymbol, List<JavaFileScannerContext.Location> flow, boolean finished) { this.trackSymbol = trackSymbol; this.lastEdge = edge; this.visited = visited; this.flow = flow; this.finished = finished; }
Source:
<code>public ByteBuffer readMessage() throws IOException { int read; ByteBuffer lengthBuffer = ByteBuffer.allocate(4); for (int i = 0; i < 4 && lengthBuffer.hasRemaining(); i++) { read = m_socketChannel.read(lengthBuffer); if (read == -1) { throw new IOException("End of stream while reading message length"); } } lengthBuffer.flip(); int len = lengthBuffer.getInt(); if (len > VoltPort.MAX_MESSAGE_LENGTH) { throw new IOException("Packet exceeds maximum allowed size"); } ByteBuffer message = ByteBuffer.allocate(len); while (message.hasRemaining()) { read = m_socketChannel.read(message); if (read == -1) { <START> throw new IOException("End of stream while reading message"); <END> } } message.flip(); return message; }</code><technical_language>Original failed read correct</technical_language>

Target:
public ByteBuffer readMessage() throws IOException { int read; ByteBuffer lengthBuffer = ByteBuffer.allocate(4); for (int i = 0; i < 4 && lengthBuffer.hasRemaining(); i++) { read = m_socketChannel.read(lengthBuffer); if (read == -1) { throw new IOException("Failed to read message length"); } } lengthBuffer.flip(); int len = lengthBuffer.getInt(); if (len <= 0) { throw new IOException("Packet size is invalid"); } if (len > VoltPort.MAX_MESSAGE_LENGTH) { throw new IOException("Packet exceeds maximum allowed size"); } ByteBuffer message = ByteBuffer.allocate(len); while (message.hasRemaining()) { read = m_socketChannel.read(message); if (read == -1) { throw new IOException("Failed to read message"); } } message.flip(); return message; }
Source:
<code>public Route(final List<Territory> territories) { <START> this.start = checkNotNull(territories.get(0)); <END> for (int i = 1; i < territories.size(); i++) { add(territories.get(i)); } }</code><technical_language>downside I is constructors differing implementations. debatable, easier reason a class is constructor logic other constructors invoke constructor. If is update for example this class is initialized, forget update constructors. Or, reading this class, constructors need account reasoning state of class. Is a avoid extra list effectively constructor</technical_language>

Target:
public Route(final List<Territory> territories) { this(territories.get(0), territories.subList(1, territories.size())); }
Source:
<code>private WorkspaceImpl doCreateWorkspace(WorkspaceConfig config, Account account, Map<String, String> attributes, boolean isTemporary) throws NotFoundException, ServerException, ConflictException { final WorkspaceImpl workspace = WorkspaceImpl.builder() .generateId() .setConfig(config) .setAccount(account) .setAttributes(attributes) .setTemporary(isTemporary) .build(); <START> SshPairImpl sshPair = this.sshManager.generatePair(EnvironmentContext.getCurrent().getSubject().getUserId(), "workspace", workspace.getId()); <END> workspace.getAttributes().put(CREATED_ATTRIBUTE_NAME, Long.toString(currentTimeMillis())); workspaceDao.create(workspace); LOG.info("Workspace '{}:{}' with id '{}' created by user '{}'", account.getName(), workspace.getConfig().getName(), workspace.getId(), sessionUserNameOr("undefined")); eventService.publish(new WorkspaceCreatedEvent(workspace)); return workspace; }</code><technical_language>elaborate this operation does, is obvious result of this operation is used</technical_language>

Target:
private WorkspaceImpl doCreateWorkspace(WorkspaceConfig config, Account account, Map<String, String> attributes, boolean isTemporary) throws NotFoundException, ServerException, ConflictException { final WorkspaceImpl workspace = WorkspaceImpl.builder() .generateId() .setConfig(config) .setAccount(account) .setAttributes(attributes) .setTemporary(isTemporary) .build(); workspace.getAttributes().put(CREATED_ATTRIBUTE_NAME, Long.toString(currentTimeMillis())); workspaceDao.create(workspace); LOG.info("Workspace '{}:{}' with id '{}' created by user '{}'", account.getName(), workspace.getConfig().getName(), workspace.getId(), sessionUserNameOr("undefined")); eventService.publish(new WorkspaceCreatedEvent(workspace)); return workspace; }
Source:
<code>protected void okPressed() { IStructuredSelection selection = (IStructuredSelection) listViewer <START> .getSelection(); <END> setResult(selection.toList()); super.okPressed(); }</code><technical_language>I feel feedback</technical_language>

Target:
protected void okPressed() { IStructuredSelection selection = listViewer.getStructuredSelection(); setResult(selection.toList()); super.okPressed(); }
Source:
<code>public static synchronized BlockCacheManager getClientInstance(AccumuloConfiguration conf) throws Exception { if (null == manager) { String impl = conf.get(Property.TSERV_CACHE_FACTORY_IMPL); Class<? extends BlockCacheManager> clazz = Class.forName(impl).asSubclass(BlockCacheManager.class); <START> manager = (BlockCacheManager) clazz.newInstance(); <END> LOG.info("Created new block cache factory of type: {}", clazz.getSimpleName()); } return manager; }</code><technical_language>This is problematic for situation. * Open RFile config for MyBlockCacheManager * Open 2nd RFile config for TinyLfuBlockCacheManager 2nd RFile MyBlockCacheManager</technical_language>

Target:
public static synchronized BlockCacheManager getClientInstance(AccumuloConfiguration conf) throws Exception { String impl = conf.get(Property.TSERV_CACHE_MANAGER_IMPL); Class<? extends BlockCacheManager> clazz = Class.forName(impl).asSubclass(BlockCacheManager.class); LOG.info("Created new block cache factory of type: {}", clazz.getSimpleName()); return (BlockCacheManager) clazz.newInstance(); }
Source:
<code>private static void writeDataToFile(String data, String filePath) throws IOException { File f = new File(filePath); if (!f.exists()) { try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } FileWriter fstream = new FileWriter(filePath); <START> try (BufferedWriter out = new BufferedWriter(fstream)) { <END> out.write(data); } }</code><technical_language>Again, insufficient. FileWriter is AutoCloseable</technical_language>

Target:
private static void writeDataToFile(String data, String filePath) throws IOException { File f = new File(filePath); if (!f.exists()) { try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } try (BufferedWriter out = new BufferedWriter(new FileWriter(filePath))) { out.write(data); } }
Source:
<code>private <T> CompletableFuture<T> executeCommandAsyncWithInjectedTx(InvocationContext ctx, VisitableCommand command) { CompletableFuture<T> cf; final Transaction implicitTransaction; try { implicitTransaction = transactionManager.suspend(); assert implicitTransaction != null; cf = doInvokeAsync(ctx, command); } catch (SystemException e) { throw new CacheException("Cannot suspend implicit transaction", e); } catch (Throwable e) { tryRollback(); throw e; } return CompletionStages.continueOnExecutor(cf.handleAsync((result, throwable) -> { if (throwable != null) { try { implicitTransaction.rollback(); } catch (SystemException e) { log.trace("Could not rollback", e); throwable.addSuppressed(e); } throw CompletableFutures.asCompletionException(throwable); } try { implicitTransaction.commit(); } catch (Exception e) { log.couldNotCompleteInjectedTransaction(e); throw CompletableFutures.asCompletionException(e); } return result; <START> }, blockingExecutor), nonBlockingExecutor, ctx).toCompletableFuture(); <END> }</code><technical_language>ctx</technical_language>

Target:
private <T> CompletableFuture<T> executeCommandAsyncWithInjectedTx(InvocationContext ctx, VisitableCommand command) { CompletableFuture<T> cf; final Transaction implicitTransaction; try { implicitTransaction = transactionManager.suspend(); assert implicitTransaction != null; cf = doInvokeAsync(ctx, command); } catch (SystemException e) { throw new CacheException("Cannot suspend implicit transaction", e); } catch (Throwable e) { tryRollback(); throw e; } return CompletionStages.continueOnExecutor(cf.handleAsync((result, throwable) -> { if (throwable != null) { try { implicitTransaction.rollback(); } catch (SystemException e) { log.trace("Could not rollback", e); throwable.addSuppressed(e); } throw CompletableFutures.asCompletionException(throwable); } try { implicitTransaction.commit(); } catch (Exception e) { log.couldNotCompleteInjectedTransaction(e); throw CompletableFutures.asCompletionException(e); } return result; }, blockingExecutor), nonBlockingExecutor, ctx.getLockOwner()).toCompletableFuture(); }
Source:
<code>private boolean isSelfSigned(X509Certificate[] chain) { <START> if(chain[0].getIssuerX500Principal().getName().equals(chain[0].getSubjectX500Principal().getName())){ <END> return true; } else { return false; } }</code><technical_language>replace by: return chain[0].getIssuerX500Principal().getName().equals(chain[0].getSubjectX500Principal().getName()) (there's need for if/else)</technical_language>

Target:
private boolean isSelfSigned(X509Certificate[] chain) { return chain[0].getIssuerX500Principal().getName().equals(chain[0].getSubjectX500Principal().getName()) && chain.length == 1; }
Source:
<code>private void updateModifiedInterfaces() { List<VdsNetworkInterface> nicsForUpdate = prepareNicsForUpdate(); <START> List<Guid> updateNicsIds = Entities.getIds(nicsForUpdate); <END> if (!nicsForUpdate.isEmpty()) { interfaceDao.massClearNetworkFromNics(updateNicsIds); interfaceDao.massUpdateInterfacesForVds(getNicsForUpdate()); } }</code><technical_language>albeit related this patch - called explicitly, getter</technical_language>

Target:
private void updateModifiedInterfaces() { List<VdsNetworkInterface> nicsForUpdate = getNicsForUpdate(); List<Guid> updateNicsIds = Entities.getIds(nicsForUpdate); if (!nicsForUpdate.isEmpty()) { interfaceDao.massClearNetworkFromNics(updateNicsIds); interfaceDao.massUpdateInterfacesForVds(nicsForUpdate); } }
Source:
<code>public String getName() { <START> return name; <END> }</code><technical_language>return "kudu"</technical_language>

Target:
public String getName() { return "kudu"; }
Source:
<code>public List<? extends Module> getJacksonModules() { <START> return Arrays.<Module> asList( <END> new SimpleModule("ArrayOfDoublesSketchModule").registerSubtypes( new NamedType(ArrayOfDoublesSketchAggregatorFactory.class, ARRAY_OF_DOUBLES_SKETCH), new NamedType(ArrayOfDoublesSketchToEstimatePostAggregator.class, ARRAY_OF_DOUBLES_SKETCH_TO_ESTIMATE_POST_AGG), new NamedType(ArrayOfDoublesSketchToEstimateAndBoundsPostAggregator.class, ARRAY_OF_DOUBLES_SKETCH_TO_ESTIMATE_AND_BOUNDS_POST_AGG), new NamedType(ArrayOfDoublesSketchToNumEntriesPostAggregator.class, ARRAY_OF_DOUBLES_SKETCH_TO_NUM_ENTRIES_POST_AGG), new NamedType(ArrayOfDoublesSketchToMeansPostAggregator.class, ARRAY_OF_DOUBLES_SKETCH_TO_MEANS_POST_AGG), new NamedType(ArrayOfDoublesSketchToVariancesPostAggregator.class, ARRAY_OF_DOUBLES_SKETCH_TO_VARIANCES_POST_AGG), new NamedType(ArrayOfDoublesSketchToQuantilesSketchPostAggregator.class, ARRAY_OF_DOUBLES_SKETCH_TO_QUANTILES_SKETCH_POST_AGG), new NamedType(ArrayOfDoublesSketchSetOpPostAggregator.class, ARRAY_OF_DOUBLES_SKETCH_SET_OP_POST_AGG), new NamedType(ArrayOfDoublesSketchTTestPostAggregator.class, ARRAY_OF_DOUBLES_SKETCH_T_TEST_POST_AGG), new NamedType(ArrayOfDoublesSketchToStringPostAggregator.class, ARRAY_OF_DOUBLES_SKETCH_TO_STRING_POST_AGG)) .addSerializer(ArrayOfDoublesSketch.class, new ArrayOfDoublesSketchJsonSerializer())); }</code><technical_language>Extra space</technical_language>

Target:
public List<? extends Module> getJacksonModules() { return Arrays.<Module>asList( new SimpleModule("ArrayOfDoublesSketchModule").registerSubtypes( new NamedType( ArrayOfDoublesSketchAggregatorFactory.class, ARRAY_OF_DOUBLES_SKETCH ), new NamedType( ArrayOfDoublesSketchToEstimatePostAggregator.class, "arrayOfDoublesSketchToEstimate" ), new NamedType( ArrayOfDoublesSketchToEstimateAndBoundsPostAggregator.class, "arrayOfDoublesSketchToEstimateAndBounds" ), new NamedType( ArrayOfDoublesSketchToNumEntriesPostAggregator.class, "arrayOfDoublesSketchToNumEntries" ), new NamedType( ArrayOfDoublesSketchToMeansPostAggregator.class, "arrayOfDoublesSketchToMeans" ), new NamedType( ArrayOfDoublesSketchToVariancesPostAggregator.class, "arrayOfDoublesSketchToVariances" ), new NamedType( ArrayOfDoublesSketchToQuantilesSketchPostAggregator.class, "arrayOfDoublesSketchToQuantilesSketch" ), new NamedType( ArrayOfDoublesSketchSetOpPostAggregator.class, "arrayOfDoublesSketchSetOp" ), new NamedType( ArrayOfDoublesSketchTTestPostAggregator.class, "arrayOfDoublesSketchTTest" ), new NamedType( ArrayOfDoublesSketchToStringPostAggregator.class, "arrayOfDoublesSketchToString" ) ).addSerializer(ArrayOfDoublesSketch.class, new ArrayOfDoublesSketchJsonSerializer()) ); }
Source:
<code>public void shouldMarkPatientDeadSuccessfully() { MarkPatientDeadPageController markPatientDeadPageController = new MarkPatientDeadPageController(); <START> markPatientDeadPageController.post(concept.getUuid(), true, date, patient.getUuid().toString()); <END> Assert.assertEquals(patient.getDead(), true); Assert.assertEquals(patient.getCauseOfDeath(), concept); }</code><technical_language>@slubwama patient.getUuid().toString() uuid is a string</technical_language>

Target:
public void shouldMarkPatientDeadSuccessfully() { MarkPatientDeadPageController markPatientDeadPageController = new MarkPatientDeadPageController(); markPatientDeadPageController.post(concept.getUuid(), true, dateOfDeath, patient.getUuid()); Assert.assertEquals(patient.getDead(), true); Assert.assertEquals(patient.getCauseOfDeath(), concept); }
Source:
<code>public void getDefaultCredentials_envServiceAccount_providesToken() throws IOException { MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); transportFactory.transport.addServiceAccount(SA_CLIENT_EMAIL, ACCESS_TOKEN); InputStream serviceAccountStream = ServiceAccountCredentialsTest .writeServiceAccountStream( SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID); TestDefaultCredentialsProvider testProvider = new TestDefaultCredentialsProvider(); File serviceAccountFile = File.createTempFile("service_account", ".json"); <START> serviceAccountFile.deleteOnExit(); <END> String serviceAccountPath = serviceAccountFile.getPath(); testProvider.addFile(serviceAccountPath, serviceAccountStream); testProvider.setEnv( DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, serviceAccountPath); GoogleCredentials defaultCredentials = testProvider.getDefaultCredentials(transportFactory); assertNotNull(defaultCredentials); defaultCredentials = defaultCredentials.createScoped(SCOPES); Map<String, List<String>> metadata = defaultCredentials.getRequestMetadata(CALL_URI); TestUtils.assertContainsBearerToken(metadata, ACCESS_TOKEN); }</code><technical_language>Is a reason clean this in a finally block sooner</technical_language>

Target:
public void getDefaultCredentials_envServiceAccount_providesToken() throws IOException { MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); transportFactory.transport.addServiceAccount(SA_CLIENT_EMAIL, ACCESS_TOKEN); InputStream serviceAccountStream = ServiceAccountCredentialsTest .writeServiceAccountStream( SA_CLIENT_ID, SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID); TestDefaultCredentialsProvider testProvider = new TestDefaultCredentialsProvider(); String serviceAccountPath = tempFilePath("service_account.json"); testProvider.addFile(serviceAccountPath, serviceAccountStream); testProvider.setEnv( DefaultCredentialsProvider.CREDENTIAL_ENV_VAR, serviceAccountPath); GoogleCredentials defaultCredentials = testProvider.getDefaultCredentials(transportFactory); assertNotNull(defaultCredentials); defaultCredentials = defaultCredentials.createScoped(SCOPES); Map<String, List<String>> metadata = defaultCredentials.getRequestMetadata(CALL_URI); TestUtils.assertContainsBearerToken(metadata, ACCESS_TOKEN); }
Source:
<code>default Tuple2<Seq<K>, Seq<V>> unzip() { <START> return this.unzip(Function.identity()); <END> }</code><technical_language>remove this</technical_language>

Target:
default Tuple2<Seq<K>, Seq<V>> unzip() { return unzip(Function.identity()); }
Source:
<code>public FormValidation doCheckTargetLogIntakeURL(@QueryParameter("targetLogIntakeURL") final String targetLogIntakeURL) { <START> if (StringUtils.isNotBlank(targetApiURL) && !DatadogHttpClient.validateTargetURL(targetLogIntakeURL) && collectBuildLogs) { <END> return FormValidation.error("The field must be configured in the form <http|https>://<url>/"); } return FormValidation.ok("Valid URL"); }</code><technical_language>Ditto here, need move validation DatadogHttpClient</technical_language>

Target:
public FormValidation doCheckTargetLogIntakeURL(@QueryParameter("targetLogIntakeURL") final String targetLogIntakeURL) { if (!validateURL(targetLogIntakeURL) && collectBuildLogs) { return FormValidation.error("The field must be configured in the form <http|https>://<url>/"); } return FormValidation.ok("Valid URL"); }
Source:
<code>protected SChannelOutput(final SynchronousQueue<Object> cell, final SChannel channel) { this.cell = cell; this.channel = channel; <START> if (VmSettings.ACTOR_TRACING | VmSettings.REPLAY) { <END> numWrites = new AtomicInteger(0); } else { numWrites = null; } }</code><technical_language>Double ||</technical_language>

Target:
protected SChannelOutput(final SynchronousQueue<Object> cell, final SChannel channel) { this.cell = cell; this.channel = channel; }
Source:
<code>Evaluator( final ObjectMapper mapper, final AsyncTaskExecutor asyncTaskExecutor, <START> final long timeoutLength) { <END> this.mapper = mapper; this.asyncTaskExecutor = asyncTaskExecutor; this.timeoutLength = timeoutLength; }</code><technical_language>this ) { is next line</technical_language>

Target:
protected Evaluator( final ObjectMapper mapper, final AsyncTaskExecutor asyncTaskExecutor, final long timeoutLength ) { this.mapper = mapper; this.asyncTaskExecutor = asyncTaskExecutor; this.timeoutLength = timeoutLength; }
Source:
<code>public Set<java.util.Map.Entry<String, Object>> entrySet() { <START> return new AbstractSet<Map.Entry<String,Object>>() { <END> @Override public Iterator<Entry<String, Object>> iterator() { Iterator<Entry<String,Object>> iterator = vars.entrySet().iterator(); return new Iterator<Entry<String,Object>>() { @Override public boolean hasNext() { return iterator.hasNext(); } @Override public Entry<String, Object> next() { Entry<String,Object> entry = iterator.next(); return new Entry<String,Object>() { @Override public String getKey() { return entry.getKey(); } @Override public Object getValue() { return resolve(entry.getValue()); } @Override public Object setValue(Object value) { Object previous = entry.setValue(value); return resolve(previous); } }; } }; } @Override public int size() { return vars.size(); } }; }</code><technical_language>java.util.Map.Entry -> Map.Entry -> Entry is enough (already in other places)</technical_language>

Target:
public Set<Map.Entry<String, Object>> entrySet() { return new AbstractSet<Map.Entry<String,Object>>() { @Override public Iterator<Entry<String, Object>> iterator() { Iterator<Entry<String,Object>> iterator = vars.entrySet().iterator(); return new Iterator<Entry<String,Object>>() { @Override public boolean hasNext() { return iterator.hasNext(); } @Override public Entry<String, Object> next() { Entry<String,Object> entry = iterator.next(); return new Entry<String,Object>() { @Override public String getKey() { return entry.getKey(); } @Override public Object getValue() { return resolve(entry.getValue()); } @Override public Object setValue(Object value) { Object previous = entry.setValue(value); return resolve(previous); } }; } }; } @Override public int size() { return vars.size(); } }; }
Source:
<code>public static boolean writeRecoveryJob(final RecoveryJob job) { try { final File file; if(job.getJobType() == BulkJobType.GET_BULK) { file = createGetFile(job.getId().toString()); } else { file = createPutFile(job.getId().toString()); } <START> try (BufferedWriter writer = com.google.common.io.Files.newWriter(file, Charset.forName("utf-8"))) { <END> writer.write(JsonMapper.toJson(job)); } catch (final Exception inner) { throw inner; } return true; } catch (final IOException e) { LOG.error("Could not create recovery file", e); return false; } }</code><technical_language>final</technical_language>

Target:
public static boolean writeRecoveryJob(final RecoveryJob job) { try { final File file; if(job.getJobType() == BulkJobType.GET_BULK) { file = createGetFile(job.getId().toString()); } else { file = createPutFile(job.getId().toString()); } try (final BufferedWriter writer = com.google.common.io.Files.newWriter(file, Charset.forName("utf-8"))) { writer.write(JsonMapper.toJson(job)); } catch (final Exception inner) { throw inner; } return true; } catch (final IOException e) { LOG.error("Could not create recovery file", e); return false; } }
Source:
<code>public int compare(Team team1, Team team2) { <START> if(team1==null || team2 == null) { <END> return -1; } int skillCompare = compare(team1.getTeamSkillLevel(), team2.getTeamSkillLevel()); return skillCompare !=0 ? skillCompare : 0; }</code><technical_language>Do this sort team1 team2 if of null? sort null first</technical_language>

Target:
public int compare(Team team1, Team team2) { if(team1 == null && team2==null) { return 0; } if(team1==null) { return -1; } if(team2==null) { return 1; } int skillCompare = compare(team1.getTeamSkillLevel(), team2.getTeamSkillLevel()); return skillCompare; }
Source:
<code>public CompletableFuture<Boolean> thenMutate(RowMutations mutation) { preCheck(); return RawAsyncTableImpl.this.<Boolean> newCaller(row, mutation.getMaxPriority(), rpcTimeoutNs) .action((controller, loc, stub) -> RawAsyncTableImpl.this.mutateRow(controller, loc, stub, mutation, (rn, rm) -> RequestConverter.buildMutateRequest(rn, row, family, qualifier, op, value, null, timeRange, rm), <START> resp -> ((CheckAndMutateResult) resp).isSuccess())) <END> .call(); }</code><technical_language>of generic type need cast</technical_language>

Target:
public CompletableFuture<Boolean> thenMutate(RowMutations mutation) { preCheck(); return RawAsyncTableImpl.this.<Boolean> newCaller(row, mutation.getMaxPriority(), rpcTimeoutNs) .action((controller, loc, stub) -> RawAsyncTableImpl.this.mutateRow(controller, loc, stub, mutation, (rn, rm) -> RequestConverter.buildMutateRequest(rn, row, family, qualifier, op, value, null, timeRange, rm), CheckAndMutateResult::isSuccess)) .call(); }
Source:
<code>public int hashCode() { if (value.hasArray()) { return Binary.hashCode(value.array(), value.arrayOffset() + offset, length); } <START> byte[] bytes = getBytes(); <END> return Binary.hashCode(bytes, 0, bytes.length); }</code><technical_language>a bytebuffer based impl</technical_language>

Target:
public int hashCode() { if (value.hasArray()) { return Binary.hashCode(value.array(), value.arrayOffset() + offset, length); } else { return Binary.hashCode(value, offset, length); } }
Source:
<code>public List<RichMember> getSponsoredMembers(PerunSession sess, Vo vo) throws InternalErrorException, PrivilegeException { Utils.checkPerunSession(sess); Utils.notNull(vo, "vo"); if(!(AuthzResolver.isAuthorized(sess, Role.REGISTRAR)||AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo))) { <START> throw new PrivilegeException(sess, "getSponsoredMembers must be called by REGISTRAR or VOADMIN"); <END> } return membersManagerBl.convertMembersToRichMembers(sess, membersManagerBl.getSponsoredMembers(sess, vo)); }</code><technical_language>Please shorten exception message method name: getSponsoredMembers, this text is wrapped in sentence exception constructor passing sentence result in nonsense text. Thank you</technical_language>

Target:
public List<RichMember> getSponsoredMembers(PerunSession sess, Vo vo) throws InternalErrorException, PrivilegeException { Utils.checkPerunSession(sess); Utils.notNull(vo, "vo"); if(!(AuthzResolver.isAuthorized(sess, Role.REGISTRAR)||AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo))) { throw new PrivilegeException(sess, "getSponsoredMembers"); } return membersManagerBl.convertMembersToRichMembers(sess, membersManagerBl.getSponsoredMembers(sess, vo)); }
Source:
<code>public QueryResult convert(final ResponseBody value) throws IOException { try (InputStream is = value.byteStream()) { MessagePackTraverser traverser = new MessagePackTraverser(); <START> for (QueryResult queryResult : traverser.traverse(is)) { <END> return queryResult; } return null; } }</code><technical_language>I understand traversing InputStream returning element is retrieved</technical_language>

Target:
public QueryResult convert(final ResponseBody value) throws IOException { try (InputStream is = value.byteStream()) { MessagePackTraverser traverser = new MessagePackTraverser(); return traverser.parse(is); } }