auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Override public boolean equals(Object o) { if (this == o) return true; <START> if (!(o instanceof MappingKey)) <END> return false; MappingKey that = (MappingKey) o; return nearEntries == that.nearEntries && nodeId.equals(that.nodeId); }</code><technical_language>I this condition readable 'NOT'. 'java.lang.String#equals'. touches 'equals' methods</technical_language>

Target:
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || MappingKey.class != o.getClass()) return false; MappingKey that = (MappingKey) o; return nearEntries == that.nearEntries && nodeId.equals(that.nodeId); }
Source:
<code>static void setCharge(ItemMeta meta, float charge, float capacity) { BigDecimal decimal = BigDecimal.valueOf(charge).setScale(2, RoundingMode.HALF_UP); float value = decimal.floatValue(); if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { <START> meta.getPersistentDataContainer().set(CHARGE_KEY, PersistentDataType.FLOAT, value); <END> } List<String> lore = meta.getLore(); for (int i = 0; i < lore.size(); i++) { String line = lore.get(i); if (line.startsWith(LORE_PREFIX)) { lore.set(i, LORE_PREFIX + value + " / " + capacity + " J"); meta.setLore(lore); return; } } }</code><technical_language>I API this smaller do this :PepeHands:</technical_language>

Target:
static void setCharge(ItemMeta meta, float charge, float capacity) { BigDecimal decimal = BigDecimal.valueOf(charge).setScale(2, RoundingMode.HALF_UP); float value = decimal.floatValue(); if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) { meta.getPersistentDataContainer().set(CHARGE_KEY, PersistentDataType.FLOAT, value); } List<String> lore = meta.hasLore() ? meta.getLore() : new ArrayList<>(); for (int i = 0; i < lore.size(); i++) { String line = lore.get(i); if (line.startsWith(LORE_PREFIX)) { lore.set(i, LORE_PREFIX + value + " / " + capacity + " J"); meta.setLore(lore); return; } } lore.add(LORE_PREFIX + value + " / " + capacity + " J"); meta.setLore(lore); }
Source:
<code>public String getOrganizationCode() { String orgCode = getString(ORGANIZATION_CODE, ""); <START> return orgCode.length() > 0 ? orgCode : null; <END> }</code><technical_language>getString(ORGANIZATION_CODE) method (without passing default parameter) get a null if field available</technical_language>

Target:
public String getOrganizationCode() { return getString(ORGANIZATION_CODE); }
Source:
<code>public static Object cleanValue(Object rawValue) { if (!(rawValue instanceof String)) { return rawValue; } String value = ((String) rawValue).trim(); String symbolToRemove = ""; FactMappingValueOperator operator = FactMappingValueOperator.findOperator(value); Optional<String> first = operator.getSymbols().stream().filter(value::startsWith).findFirst(); if (first.isPresent()) { symbolToRemove = first.get(); } int index = value.indexOf(symbolToRemove); return value.substring(index + symbolToRemove.length()).trim(); <START> } <END></code><technical_language>symbolToRemove is empty, if in cases, I implement this: java public static Object cleanValue(Object rawValue) { if (!(rawValue instanceof String)) { return rawValue; } String = ((String) rawValue).trim(); FactMappingValueOperator operator = FactMappingValueOperator.findOperator(value); Optional<String> = operator.getSymbols().stream().filter(value::startsWith).findFirst(); if (first.isPresent()) { String symbolToRemove = first.get(); int index = value.indexOf(symbolToRemove); = value.substring(index + symbolToRemove.length()); } return value.trim(); }</technical_language>

Target:
public static Object cleanValue(Object rawValue) { if (!(rawValue instanceof String)) { return rawValue; } String value = ((String) rawValue).trim(); FactMappingValueOperator operator = FactMappingValueOperator.findOperator(value); Optional<String> first = operator.getSymbols().stream().filter(value::startsWith).findFirst(); if (first.isPresent()) { String symbolToRemove = first.get(); int index = value.indexOf(symbolToRemove); value = value.substring(index + symbolToRemove.length()).trim(); } return value.trim(); }
Source:
<code><START> public static void setUpBeforeClass() throws CoreException { <END> project = TestUtils.createProject("EditorToOutlineAdapterFactoryTest" + System.currentTimeMillis()); testFile = TestUtils.createUniqueTestFile(project, "Hello World !!"); IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .findView("org.eclipse.ui.views.ContentOutline"); if (viewPart instanceof ContentOutline) { outline = (ContentOutline) viewPart; } Assert.assertNotNull(outline); }</code><technical_language>I AllCleanRule delete project test file this @BeforeClass. put this in test method</technical_language>

Target:
public static void setUpBeforeClass() throws CoreException { IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .findView("org.eclipse.ui.views.ContentOutline"); if (viewPart instanceof ContentOutline) { outline = (ContentOutline) viewPart; } Assert.assertNotNull(outline); }
Source:
<code>public void addInternalLink(String target, String text) { typeTargetAndText(target, text); <START> addLinkModal.findElement(okButtonBy).click(); <END> }</code><technical_language>log()</technical_language>

Target:
public void addInternalLink(String target, String text) { typeTargetAndText(target, text); addLinkModal.findElement(okButtonBy).click(); PageObjectLogging.log("addInternalLink", "internal link " + target + " and text " + text + " added", true); }
Source:
<code>public FbStatus(final Condition<Integer> check, final Fallback fallback) { super( new Fallback() { @Override public Opt<Response> route(final RqFallback req) throws IOException { final Opt<Response> rsp; if (check.fits(req.code())) { rsp = fallback.route(req); } else { <START> rsp = new Opt.Empty<Response>(); <END> } return rsp; } } ); }</code><technical_language>@ekondrashev move this assignment line 103 above</technical_language>

Target:
public FbStatus(final Condition<Integer> check, final Fallback fallback) { super( new Fallback() { @Override public Opt<Response> route(final RqFallback req) throws IOException { Opt<Response> rsp = new Opt.Empty<Response>(); if (check.fits(req.code())) { rsp = fallback.route(req); } return rsp; } } ); }
Source:
<code>public int[] getAcceptableTokens() { return new int[] { TokenTypes.VARIABLE_DEF, TokenTypes.PARAMETER_DEF, TokenTypes.METHOD_DEF, TokenTypes.IMPORT, TokenTypes.TYPE_ARGUMENT, <START> TokenTypes.TYPE_UPPER_BOUNDS, <END> }; }</code><technical_language>If TYPE_UPPER_BOUNDS, need TYPE_LOWER_BOUNDS too</technical_language>

Target:
public int[] getAcceptableTokens() { return new int[] { TokenTypes.VARIABLE_DEF, TokenTypes.PARAMETER_DEF, TokenTypes.METHOD_DEF, TokenTypes.IMPORT, }; }
Source:
<code>public AllureCommandline(final Path installationDirectory, final String version) { <START> this.installationDirectory = installationDirectory; <END> this.version = version; this.serveTimeout = SERVE_DEFAULT_TIMEOUT; }</code><technical_language>this(installationDirectory, version, SERVE_DEFAULT_TIMEOUT)</technical_language>

Target:
public AllureCommandline(final Path installationDirectory, final String version) { this(installationDirectory, version, SERVE_DEFAULT_TIMEOUT); }
Source:
<code>public static LocalDateTime parseDateTime(String s) { for (Map.Entry<String, Integer> entry : FORMAT_TO_LEN.entrySet()) { String f = entry.getKey(); <START> int len = entry.getValue(); <END> DateTimeFormatter fmt = STRING_TO_FORMATTER.get(f); try { if (s.length() < len) { continue; } String datePart = s.substring(0, len); LocalDateTime datetime = LocalDateTime.parse(datePart, fmt); return datetime; } catch (DateTimeParseException e) { continue; } } LOG.warn("Unknown date format in {}", s.length() > 50 ? s.substring(0, 50) : s); return null; }</code><technical_language>Is String.length() slow</technical_language>

Target:
public static LocalDateTime parseDateTime(String s) { for (Map.Entry<DateTimeFormatter, Integer> entry : FORMATTERS.entrySet()) { DateTimeFormatter fmt = entry.getKey(); int len = entry.getValue(); try { if (s.length() < len) { continue; } String datePart = s.substring(0, len); LocalDateTime datetime = LocalDateTime.parse(datePart, fmt); return datetime; } catch (DateTimeParseException e) { continue; } } LOG.warn("Unknown date format in {}", s.length() > 50 ? s.substring(0, 50) : s); return null; }
Source:
<code>public void load(String fileName) throws Exception { File fileStream = new File(fileName); FileOutputStream fos = new FileOutputStream(fileStream); <START> this.loadToStream = fos; <END> try { this.load(); this.loadToStream.flush(); } finally { try { this.loadToStream.close(); } catch(Exception e) { } this.loadToStream = null; } this.fileName = fileName; this.content = null; this.contentStream = null; }</code><technical_language>code I java FileOutputStream fos = new FileOutputStream(fileStream); this.loadToStream = fos; fos is assigned work? java this.loadToStream = new FileOutputStream(fileStream);</technical_language>

Target:
public void load(String fileName) throws Exception { File fileStream = new File(fileName); try { this.loadToStream = new FileOutputStream(fileStream); this.load(); this.loadToStream.flush(); } finally { try { this.loadToStream.close(); } catch(Exception e) { } this.loadToStream = null; } this.fileName = fileName; this.content = null; this.contentStream = null; }
Source:
<code>public void testDuplicatesForOneToManyAssociationWithoutOrderColumn() { Programmer participant0 = new Programmer( PARTICIPANT_0 ); Programmer participant1 = new Programmer( PARTICIPANT_1 ); Programmer participant2 = new Programmer( PARTICIPANT_2 ); Meeting meeting = new Meeting(); meeting.setName( NAME ); meeting.addParticipant( participant0 ); meeting.addParticipant( participant1 ); meeting.addParticipant( participant1 ); meeting.addParticipant( participant2 ); meeting.addParticipant( participant1 ); inTransaction( session -> { persistAll( session, meeting, participant0, participant1, participant2 ); } ); inTransaction( session -> { Meeting load = session.load( Meeting.class, NAME ); <START> assertThat( load.getParticipants() ).containsOnly( participant0, participant1, participant1, participant2, participant1 ); <END> } ); }</code><technical_language>I containsOnly hide fact duplicates preserved. Inspecting variable load.getParticipants() I get this: > 0 = {Programmer@4134} "Programmer{nick='fax4ever'}" 1 = {Programmer@4135} "Programmer{nick='phone4induction'}" 2 = {Programmer@4136} "Programmer{nick='telegraph4eternity'}" I duplicates lost in a @OneToMany. they</technical_language>

Target:
public void testDuplicatesForOneToManyAssociationWithoutOrderColumn() { Programmer participant0 = new Programmer( PARTICIPANT_0 ); Programmer participant1 = new Programmer( PARTICIPANT_1 ); Programmer participant2 = new Programmer( PARTICIPANT_2 ); Meeting meeting = new Meeting(); meeting.setName( NAME ); meeting.addParticipant( participant0 ); meeting.addParticipant( participant1 ); meeting.addParticipant( participant1 ); meeting.addParticipant( participant2 ); meeting.addParticipant( participant1 ); inTransaction( session -> { persistAll( session, meeting, participant0, participant1, participant2 ); } ); inTransaction( session -> { Meeting load = session.load( Meeting.class, NAME ); assertThat( load.getParticipants() ).hasSize( 3 ); assertThat( load.getParticipants() ) .as( "Hibernate OGM does not support duplicates for associations (issue OGM-1537)." + " If you've solved this issue, congratulations!" + " Please, update the jira and this test accordingly, and thanks a lot" ) .containsOnly( participant0, participant1, participant2 ); } ); }
Source:
<code>private HttpResponse executePut(String bucketName, String objectName, Map<String,String> headerMap, Map<String,String> queryParamMap, String region, Object data, int length) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { if (headerMap != null) { <START> headerMap = amzPrefixHeaderMap(headerMap); <END> } HttpResponse response = execute(Method.PUT, region, bucketName, objectName, headerMap, queryParamMap, data, length); return response; }</code><technical_language>This done in execute()</technical_language>

Target:
private HttpResponse executePut(String bucketName, String objectName, Map<String,String> headerMap, Map<String,String> queryParamMap, String region, Object data, int length) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { HttpResponse response = execute(Method.PUT, region, bucketName, objectName, headerMap, queryParamMap, data, length); return response; }
Source:
<code>private List<Artifact> getNewDependencies(List<Dependency> dependencies, List<Dependency> existingDependencies) { List<Artifact> updatedArtifacts = new ArrayList<Artifact>(); for (Dependency dep : dependencies) { boolean newDependency = true; for (Dependency existingDep : existingDependencies) { if (dep.getArtifactId().equals(existingDep.getArtifactId()) && dep.getGroupId().equals(existingDep.getGroupId())) { if ((dep.getVersion() != null && dep.getVersion().equals(existingDep.getVersion())) <START> || (dep.getVersion() == null)) { <END> if ((dep.getType() != null && dep.getType().equals(existingDep.getType()) || (dep.getType() == null && existingDep.getType() == null))) { if ((dep.getScope() != null && dep.getScope().equals(existingDep.getScope()) || (dep.getScope() == null && (existingDep.getScope() == null || existingDep.getScope().equals("compile"))))) { newDependency = false; break; } } } } } if (newDependency) { log.debug("New dependency found: " + dep.getArtifactId()); try { Artifact artifact = getArtifact(dep.getGroupId(), dep.getArtifactId(), dep.getType(), dep.getVersion()); updatedArtifacts.add(artifact); } catch (MojoExecutionException | IllegalArgumentException e) { log.warn(e.getMessage()); } } } return updatedArtifacts; }</code><technical_language>this check if existingDep.getVersion() == null</technical_language>

Target:
private List<Artifact> getNewDependencies(List<Dependency> dependencies, List<Dependency> existingDependencies) { List<Artifact> updatedArtifacts = new ArrayList<Artifact>(); for (Dependency dep : dependencies) { boolean newDependency = true; try { Artifact artifact = getArtifact(dep.getGroupId(), dep.getArtifactId(), dep.getType(), dep.getVersion()); for (Dependency existingDep : existingDependencies) { if (Objects.equals(artifact.getArtifactId(), existingDep.getArtifactId()) && Objects.equals(artifact.getGroupId(), existingDep.getGroupId()) && Objects.equals(artifact.getVersion(), existingDep.getVersion()) && Objects.equals(artifact.getType(), existingDep.getType())) { newDependency = false; break; } } if (newDependency) { log.debug("New dependency found: " + artifact.toString()); updatedArtifacts.add(artifact); } } catch (MojoExecutionException e) { log.warn(e.getMessage()); } catch (IllegalArgumentException e) { log.warn(dep.toString() + " is not valid: " + e.getMessage()); } } return updatedArtifacts; }
Source:
<code>public void onTestFailure(ITestResult tr) { <START> System.out.println(tr.getName() + "--Test method failed"); <END> }</code><technical_language>a logger instead of System out println</technical_language>

Target:
public void onTestFailure(ITestResult tr) { LOG.info ("[%s] -- Test method failed", tr.getName()); }
Source:
<code><START> public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException <END> { if("tag".equals(qName)) { String tagName = attributes.getValue("name"); Tag tag = tagService.getOrCreateTag(tagName); if ("true".equals(attributes.getValue("root"))) tag.setIsRoot(true); if ("true".equals(attributes.getValue("pseudo"))) tag.setPseudo(true); final String color = attributes.getValue("color"); if (color != null) { if (color.matches("#\\p{XDigit}{6}")) tag.setColor(color); else log.fine("Invalid color, not matching #\\p{XDigit}{6}: " + color); } if(!stack.empty()) stack.peek().addContainedTag(tag); stack.push(tag); String[] containedBy = StringUtils.split( StringUtils.defaultString(attributes.getValue("parents")), " ,"); for (String containingTagName : containedBy) { Tag containingTag = tagService.getOrCreateTag(containingTagName); tag.addContainingTag(containingTag); } } }</code><technical_language>if follow parse xml files in JavaHandler, XmlFileHandler etc</technical_language>

Target:
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if("tag".equals(qName)) { String tagName = attributes.getValue("name"); Tag tag = tagService.getOrCreateTag(tagName); if ("true".equals(attributes.getValue("root"))) tag.setIsRoot(true); if ("true".equals(attributes.getValue("pseudo"))) tag.setPseudo(true); tag.setTitle(attributes.getValue("title")); final String color = attributes.getValue("color"); if (color != null) { if (color.matches("#\\p{XDigit}{6}")) tag.setColor(color); else log.fine("Invalid color, not matching #\\p{XDigit}{6}: " + color); } if(!stack.empty()) stack.peek().addContainedTag(tag); stack.push(tag); String[] containedBy = StringUtils.split( StringUtils.defaultString(attributes.getValue("parents")), " ,"); for (String containingTagName : containedBy) { Tag containingTag = tagService.getOrCreateTag(containingTagName); tag.addContainingTag(containingTag); } } }
Source:
<code>public ChannelFuture dispose() { if (preparedFuture == null) { disposedFuture.setSuccess(); } else if (!disposedFuture.isDone()) { ChannelFuture future = abort(); future.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { serverChannels.close().addListener(new ChannelGroupFutureListener() { @Override public void operationComplete(ChannelGroupFuture future) throws Exception { clientChannels.close(); try { bootstrapFactory.shutdown(); bootstrapFactory.releaseExternalResources(); } catch (Exception e) { if (LOGGER.isDebugEnabled()) { LOGGER.error("Caught exception releasing resources", e); <START> } <END> } finally { disposedFuture.setSuccess(); } } }); } }); } return disposedFuture; }</code><technical_language>Do disposedFuture fail here? imply for caller</technical_language>

Target:
public ChannelFuture dispose() { if (preparedFuture == null) { disposedFuture.setSuccess(); } else if (!disposedFuture.isDone()) { ChannelFuture future = abort(); future.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { for (AutoCloseable resource : configuration.getResources()) { try { resource.close(); } catch (Exception e) { } } serverChannels.close().addListener(new ChannelGroupFutureListener() { @Override public void operationComplete(ChannelGroupFuture future) throws Exception { clientChannels.close(); try { bootstrapFactory.shutdown(); bootstrapFactory.releaseExternalResources(); } catch (Exception e) { if (LOGGER.isDebugEnabled()) { LOGGER.error("Caught exception releasing resources", e); } } finally { disposedFuture .setFailure(new Throwable("Disposed due to shutdown of channel, not due to command")); } } }); } }); } return disposedFuture; }
Source:
<code>public void onNewJobModelAvailable(final String version) { debounceTimer.scheduleAfterDebounceTime(ScheduleAfterDebounceTime.JOB_MODEL_VERSION_CHANGE, 0, () -> { LOGGER.info("pid=" + processorId + "new JobModel available"); if (coordinatorListener != null) { coordinatorListener.onJobModelExpired(); } LOGGER.info("pid=" + processorId + "new JobModel available.Container stopped."); newJobModel = zkUtils.getJobModel(version); LOGGER.info("pid=" + processorId + ": new JobModel available. ver=" + version + "; jm = " + newJobModel); <START> ZkBarrierForVersionUpgrade barrier = <END> (ZkBarrierForVersionUpgrade) coordinationUtils.getBarrier(JOB_MODEL_UPGRADE_BARRIER); barrier.waitForBarrier(version, processorId, () -> onNewJobModelConfirmed(version)); }); }</code><technical_language>wondering, if this is auto-format change is formatting preferences</technical_language>

Target:
public void onNewJobModelAvailable(final String version) { debounceTimer.scheduleAfterDebounceTime(ScheduleAfterDebounceTime.JOB_MODEL_VERSION_CHANGE, 0, () -> { LOG.info("pid=" + processorId + "new JobModel available"); if (coordinatorListener != null) { coordinatorListener.onJobModelExpired(); } LOG.info("pid=" + processorId + "new JobModel available.Container stopped."); newJobModel = zkUtils.getJobModel(version); LOG.info("pid=" + processorId + ": new JobModel available. ver=" + version + "; jm = " + newJobModel); ZkBarrierForVersionUpgrade barrier = (ZkBarrierForVersionUpgrade) coordinationUtils.getBarrier(JOB_MODEL_UPGRADE_BARRIER); barrier.waitForBarrier(version, processorId, () -> onNewJobModelConfirmed(version)); }); }
Source:
<code>public ObjectStream<LemmaSample> create(String[] args) { Parameters params = ArgumentParser.parse(args, Parameters.class); ConlluTagset tagset; if ("u".equals(params.getTagset())) { tagset = ConlluTagset.U; } else if ("x".equals(params.getTagset())) { tagset = ConlluTagset.X; } else { throw new TerminateToolException(-1, "Unkown tagset parameter: " + params.getTagset()); } InputStreamFactory inFactory = CmdLineUtil.createInputStreamFactory(params.getData()); try { return new ConlluLemmaSampleStream(new ConlluStream(inFactory), tagset); } <START> catch (IOException e) { <END> CmdLineUtil.handleCreateObjectStreamError(e); return null; } }</code><technical_language>cosmetic: move catch line prevous line }</technical_language>

Target:
public ObjectStream<LemmaSample> create(String[] args) { Parameters params = ArgumentParser.parse(args, Parameters.class); ConlluTagset tagset; switch (params.getTagset()) { case "u": tagset = ConlluTagset.U; break; case "x": tagset = ConlluTagset.X; break; default: throw new TerminateToolException(-1, "Unkown tagset parameter: " + params.getTagset()); } InputStreamFactory inFactory = CmdLineUtil.createInputStreamFactory(params.getData()); try { return new ConlluLemmaSampleStream(new ConlluStream(inFactory), tagset); } catch (IOException e) { CmdLineUtil.handleCreateObjectStreamError(e); } return null; }
Source:
<code>public URI getSkillifierUrl(String addition) { if (!addition.isEmpty()) { return URI.create("<LINK_0>" + addition); } <START> return URI.create("<LINK_0>"); <END> }</code><technical_language>branches guaranteed produce result</technical_language>

Target:
public URI getSkillifierUrl(String addition) { return URI.create("<LINK_0>" + addition); }
Source:
<code>private void initWebViewListeners() { webView.addOnUpOrCancelMotionEventListener(() -> { app.getSessionFunnel().touchSession(); }); webView.addOnScrollChangeListener((int oldScrollY, int scrollY, boolean isHumanScroll) -> { if (pageScrollFunnel != null) { pageScrollFunnel.onPageScrolled(oldScrollY, scrollY, isHumanScroll); } }); webView.addOnContentHeightChangedListener(scrollTriggerListener); webView.setWebViewClient(new OkHttpWebViewClient() { @NonNull @Override public PageViewModel getModel() { return model; } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); if (!isAdded()) { return; } pageFragmentLoadState.onPageFinished(); updateProgressBar(false, true, 0); webView.setVisibility(View.VISIBLE); <START> bridge.execute(JavaScriptActionHandler.setTopMargin(leadImagesHandler.getPaddingTop())); <END> onPageLoadComplete(); } @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { onPageLoadError(new Throwable()); } }); }</code><technical_language>need issue another call setTopMargin here. instead setting correctly in initial setup call</technical_language>

Target:
private void initWebViewListeners() { webView.addOnUpOrCancelMotionEventListener(() -> { app.getSessionFunnel().touchSession(); }); webView.addOnScrollChangeListener((int oldScrollY, int scrollY, boolean isHumanScroll) -> { if (pageScrollFunnel != null) { pageScrollFunnel.onPageScrolled(oldScrollY, scrollY, isHumanScroll); } }); webView.addOnContentHeightChangedListener(scrollTriggerListener); webView.setWebViewClient(new OkHttpWebViewClient() { @NonNull @Override public PageViewModel getModel() { return model; } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); if (!isAdded()) { return; } pageFragmentLoadState.onPageFinished(); updateProgressBar(false, true, 0); webView.setVisibility(View.VISIBLE); onPageLoadComplete(); } @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { onPageLoadError(new Throwable()); } }); }
Source:
<code>public void onMessageReceived(RemoteMessage message){ Log.d(LOG_TAG, "onMessage - from: " + message.getFrom()); Bundle extras = new Bundle(); if (message.getNotification()!=null) { extras.putString(TITLE,message.getNotification().getTitle()); extras.putString(MESSAGE,message.getNotification().getBody()); } for (Map.Entry<String, String> entry : message.getData().entrySet()) { extras.putString(entry.getKey(), entry.getValue()); <START> } <END> if (extras != null) { SharedPreferences prefs = getApplicationContext().getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); boolean forceShow = prefs.getBoolean(FORCE_SHOW, false); extras = normalizeExtras(extras); if (!forceShow && PushPlugin.isInForeground()) { Log.d(LOG_TAG, "foreground"); extras.putBoolean(FOREGROUND, true); PushPlugin.sendExtras(extras); } else if (forceShow && PushPlugin.isInForeground()) { Log.d(LOG_TAG, "foreground force"); extras.putBoolean(FOREGROUND, true); showNotificationIfPossible(getApplicationContext(), extras); } else { Log.d(LOG_TAG, "background"); extras.putBoolean(FOREGROUND, false); showNotificationIfPossible(getApplicationContext(), extras); } } }</code><technical_language>Hmmm....need RemoteMessage some more a good idea minimize changes for now</technical_language>

Target:
public void onMessageReceived(RemoteMessage message){ Log.d(LOG_TAG, "onMessage - from: " + message.getFrom()); Bundle extras = new Bundle(); if (message.getNotification()!=null) { extras.putString(TITLE,message.getNotification().getTitle()); extras.putString(MESSAGE,message.getNotification().getBody()); } for (Map.Entry<String, String> entry : message.getData().entrySet()) { extras.putString(entry.getKey(), entry.getValue()); } if (extras != null) { SharedPreferences prefs = getApplicationContext().getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); boolean forceShow = prefs.getBoolean(FORCE_SHOW, false); extras = normalizeExtras(extras); if (!forceShow && PushPlugin.isInForeground()) { Log.d(LOG_TAG, "foreground"); extras.putBoolean(FOREGROUND, true); extras.putBoolean(COLDSTART, false); PushPlugin.sendExtras(extras); } else if (forceShow && PushPlugin.isInForeground()) { Log.d(LOG_TAG, "foreground force"); extras.putBoolean(FOREGROUND, true); extras.putBoolean(COLDSTART, false); showNotificationIfPossible(getApplicationContext(), extras); } else { Log.d(LOG_TAG, "background"); extras.putBoolean(FOREGROUND, false); extras.putBoolean(COLDSTART, PushPlugin.isActive()); showNotificationIfPossible(getApplicationContext(), extras); } } }
Source:
<code>public void enableWikiaTracker() { <START> appendToUrl("&log_level=info"); <END> }</code><technical_language>is is running tests query string? "?log_level=info"</technical_language>

Target:
public void enableWikiaTracker() { if (driver.getCurrentUrl().contains("?")) { appendToUrl("&log_level=info"); } else { appendToUrl("?log_level=info"); } }
Source:
<code>public void afterDelivery() throws ApplicationServerInternalException, UnavailableException { switch (state) { case RELEASED: throw new IllegalStateException("Message endpoint factory has been released"); case NONE: throw new IllegalStateException("afterDelivery may only be called if message delivery began with a beforeDelivery call"); } boolean exceptionThrown = false; try { container.afterDelivery(instance); } catch (final SystemException se) { exceptionThrown = true; final Throwable throwable = se.getRootCause() != null ? se.getRootCause() : se; <START> throwable.printStackTrace(); <END> throw new ApplicationServerInternalException(throwable); } finally { if (state == State.SYSTEM_EXCEPTION) { } state = State.NONE; } }</code><technical_language>logging instead</technical_language>

Target:
public void afterDelivery() throws ApplicationServerInternalException, UnavailableException { switch (state) { case RELEASED: throw new IllegalStateException("Message endpoint factory has been released"); case NONE: throw new IllegalStateException("afterDelivery may only be called if message delivery began with a beforeDelivery call"); } try { container.afterDelivery(instance); } catch (final SystemException se) { final Throwable throwable = se.getRootCause() != null ? se.getRootCause() : se; throw new ApplicationServerInternalException(throwable); } finally { state = State.NONE; this.instance = null; } }
Source:
<code>public RuleAutomatonDisjunction(List<Pair<Term, BitSet>> children, TermContext context) { super(Kind.KITEM); this.kItemDisjunctionsArray = new Pair[KLabelConstant.cacheSize()]; children.stream() .filter(p -> p.getLeft() instanceof KItem) .forEach(p -> { this.kItemDisjunctionsArray[((KLabelConstant) ((KItem) p.getLeft()).kLabel()).ordinal()] = (Pair<KItem, BitSet>) (Object) p; }); <START> synchronized (Sort.cache) { <END> this.variableDisjunctionsArray = new List[Sort.cache.size()]; } context.definition().allSorts().forEach(s -> { this.variableDisjunctionsArray[s.ordinal()] = new ArrayList<>((Set<Pair<Variable, BitSet>>) (Object) children.stream() .filter(p -> p.getLeft() instanceof Variable && context.definition().subsorts().isSubsortedEq(p.getLeft().sort(), s)) .collect(Collectors.toSet())); }); this.tokenDisjunctions = children.stream() .filter(p -> p.getLeft() instanceof Token) .collect(Collectors.toMap(p -> (Token) p.getLeft(), p -> (Pair<Token, BitSet>) (Object) p)); }</code><technical_language>this poor encapsulation..</technical_language>

Target:
public RuleAutomatonDisjunction(List<Pair<Term, BitSet>> children, TermContext context) { super(Kind.KITEM); disjunctions = Collections.unmodifiableList(children); this.kItemDisjunctionsArray = new Pair[KLabelConstant.maxOrdinal.get()]; children.stream() .filter(p -> p.getLeft() instanceof KItem) .forEach(p -> { this.kItemDisjunctionsArray[((KLabelConstant) ((KItem) p.getLeft()).kLabel()).ordinal()] = (Pair<KItem, BitSet>) (Object) p; }); this.variableDisjunctionsArray = new List[Sort.maxOrdinal.get()]; context.definition().allSorts().forEach(s -> { this.variableDisjunctionsArray[s.ordinal()] = new ArrayList<>((Set<Pair<Variable, BitSet>>) (Object) children.stream() .filter(p -> p.getLeft() instanceof Variable && context.definition().subsorts().isSubsortedEq(p.getLeft().sort(), s)) .collect(Collectors.toSet())); }); this.tokenDisjunctions = children.stream() .filter(p -> p.getLeft() instanceof Token) .collect(Collectors.toMap(p -> (Token) p.getLeft(), p -> p.getRight())); }
Source:
<code>private void handleUsernameAvailabilityEvent(OnAvailabilityChecked event) { endProgress(); if (event.type != IsAvailable.USERNAME ) { return; } if (!event.isAvailable) { <START> mUsername = isAvailableUsername; <END> mUsernameEditText.setText(isAvailableUsername); showPasswordFieldAndFocus(); } else { showUsernameError(R.string.username_invalid); } isAvailableUsername = ""; }</code><technical_language>rely event.value give user name, isAvailableUsername necessary</technical_language>

Target:
private void handleUsernameAvailabilityEvent(OnAvailabilityChecked event) { endProgress(); if (event.type != IsAvailable.USERNAME ) { return; } if (event.isAvailable) { showUsernameError(R.string.username_invalid); return; } mUsername = event.value; mUsernameEditText.setText(event.value); showPasswordFieldAndFocus(); }
Source:
<code>private void checkCapacityAndUpdateWriteStatusDelegate(long totalCapacity, long usedCapacity) { if (writeStatusDelegate != null) { logger.debug( "Checking current used capacity: Bytes of store with High threshold: Bytes and Low threshold: Bytes", index.getLogUsedCapacity(), replicaId.getPartitionId(), thresholdBytesHigh, thresholdBytesLow); if (index.getLogUsedCapacity() > thresholdBytesHigh && !replicaId.isSealed()) { if (!writeStatusDelegate.seal(replicaId)) { metrics.sealSetError.inc(); <START> logger.error("Could not set the partition as read-only status on {}", replicaId); <END> } else { logger.debug("Store is successfully sealed for partition : {}", replicaId.getPartitionId()); } } else if (index.getLogUsedCapacity() <= thresholdBytesLow && replicaId.isSealed()) { if (!writeStatusDelegate.unseal(replicaId)) { metrics.unsealSetError.inc(); logger.error("Could not set the partition as read-write status on {}", replicaId); } else { logger.debug("Store is successfully unsealed for partition : {}", replicaId.getPartitionId()); } } } else { logger.debug("The WriteStatusDelegate is not instantiated"); } }</code><technical_language>log this debug</technical_language>

Target:
private void checkCapacityAndUpdateWriteStatusDelegate(long totalCapacity, long usedCapacity) { if (writeStatusDelegate != null) { logger.debug("The current used capacity is bytes on store {}", index.getLogUsedCapacity(), replicaId.getPartitionId()); if (index.getLogUsedCapacity() > thresholdBytesHigh && !replicaId.isSealed()) { if (!writeStatusDelegate.seal(replicaId)) { metrics.sealSetError.inc(); logger.warn("Could not set the partition as read-only status on {}", replicaId); } else { metrics.sealDoneCount.inc(); logger.info( "Store is successfully sealed for partition : because current used capacity : bytes exceeds ReadOnly threshold : bytes", replicaId.getPartitionId(), index.getLogUsedCapacity(), thresholdBytesHigh); } } else if (index.getLogUsedCapacity() <= thresholdBytesLow && replicaId.isSealed()) { if (!writeStatusDelegate.unseal(replicaId)) { metrics.unsealSetError.inc(); logger.warn("Could not set the partition as read-write status on {}", replicaId); } else { metrics.unsealDoneCount.inc(); logger.info( "Store is successfully unsealed for partition : because current used capacity : bytes is below ReadWrite threshold : bytes", replicaId.getPartitionId(), index.getLogUsedCapacity(), thresholdBytesLow); } } } else { logger.debug("The WriteStatusDelegate is not instantiated"); } }
Source:
<code>@Override public Request transformRequest(Request request) { if (request.resourceId != 0) { return request; } Uri uri = request.uri; String scheme = uri.getScheme(); if (!"https".equals(scheme) && !"http".equals(scheme)) { return request; } if (!request.hasSize()) { return request; } if (request.centerCrop) { return request; } Request.Builder newRequest = request.buildUpon(); Thumbor thumbor; if (key != null) { <START> thumbor = Thumbor.create(host, key); <END> } else { thumbor = Thumbor.create(host); } ThumborUrlBuilder urlBuilder = thumbor.buildImage(uri.toString()); urlBuilder.resize(request.targetWidth, request.targetHeight); newRequest.clearResize(); if (request.centerInside) { urlBuilder.fitIn(); newRequest.clearCenterInside(); } newRequest.setUri(Uri.parse(urlBuilder.toUrl())); return newRequest.build(); }</code><technical_language>This a constructor arg</technical_language>

Target:
@Override public Request transformRequest(Request request) { if (request.resourceId != 0) { return request; } Uri uri = request.uri; String scheme = uri.getScheme(); if (!"https".equals(scheme) && !"http".equals(scheme)) { return request; } if (!request.hasSize()) { return request; } if (request.centerCrop) { return request; } Request.Builder newRequest = request.buildUpon(); ThumborUrlBuilder urlBuilder = thumbor.buildImage(uri.toString()); urlBuilder.resize(request.targetWidth, request.targetHeight); newRequest.clearResize(); if (request.centerInside) { urlBuilder.fitIn(); newRequest.clearCenterInside(); } newRequest.setUri(Uri.parse(urlBuilder.toUrl())); return newRequest.build(); }
Source:
<code>public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); String fcrepoUri = (String) in.getHeader(FCREPO_URI); String editThumbnail = (String) in.getHeader(CdrEditThumbnail); List<PID> targetPids = new ArrayList<>(); PID targetPid = PIDs.get(fcrepoUri); String resourceTypes = (String) in.getHeader(FCREPO_RESOURCE_TYPE); <START> if (!Boolean.parseBoolean(editThumbnail) && resourceTypes != null && <END> resourceTypes.contains(Fcrepo4Repository.Binary.getURI())) { targetPid = PIDs.get(targetPid.getId()); FileObject parentFile = repoObjLoader.getFileObject(targetPid); RepositoryObject grandParent = parentFile.getParent(); if (grandParent instanceof WorkObject) { targetPids.add(grandParent.getPid()); } } targetPids.add(targetPid); log.debug("Indexing objects {}", targetPids); for (PID pid: targetPids) { SolrUpdateRequest updateRequest = new SolrUpdateRequest( pid.getRepositoryPath(), IndexingActionType.ADD); DocumentIndexingPackage dip = factory.createDip(pid); updateRequest.setDocumentIndexingPackage(dip); pipeline.process(dip); solrUpdateDriver.addDocument(dip.getDocument()); } }</code><technical_language>need check CdrEditThumbnail header, resource type restriction enough prevent bad indexing</technical_language>

Target:
public void process(Exchange exchange) throws Exception { final Message in = exchange.getIn(); String fcrepoUri = (String) in.getHeader(FCREPO_URI); List<PID> targetPids = new ArrayList<>(); PID targetPid = PIDs.get(fcrepoUri); String resourceTypes = (String) in.getHeader(FCREPO_RESOURCE_TYPE); if (resourceTypes != null && resourceTypes.contains(Fcrepo4Repository.Binary.getURI())) { targetPid = PIDs.get(targetPid.getId()); FileObject parentFile = repoObjLoader.getFileObject(targetPid); RepositoryObject grandParent = parentFile.getParent(); if (grandParent instanceof WorkObject) { targetPids.add(grandParent.getPid()); } } targetPids.add(targetPid); log.debug("Indexing objects {}", targetPids); for (PID pid: targetPids) { SolrUpdateRequest updateRequest = new SolrUpdateRequest( pid.getRepositoryPath(), IndexingActionType.ADD); DocumentIndexingPackage dip = factory.createDip(pid); updateRequest.setDocumentIndexingPackage(dip); pipeline.process(dip); solrUpdateDriver.addDocument(dip.getDocument()); } }
Source:
<code>public void testChunkStore() throws Exception { File file1 = new File(temporary, "file1"); <START> Files.write("hello world", file1, UTF_8); <END> long id1 = nextChunkId.getAndIncrement(); assertFalse(store.chunkExists(id1)); store.putChunk(id1, file1); assertTrue(store.chunkExists(id1)); File file2 = new File(temporary, "file2"); Files.write("bye bye", file2, UTF_8); long id2 = nextChunkId.getAndIncrement(); assertFalse(store.chunkExists(id2)); store.putChunk(id2, file2); assertTrue(store.chunkExists(id2)); File restore1 = new File(temporary, "restore1"); store.getChunk(id1, restore1); assertEquals(readAllBytes(file1.toPath()), readAllBytes(restore1.toPath())); File restore2 = new File(temporary, "restore2"); store.getChunk(id2, restore2); assertEquals(readAllBytes(file2.toPath()), readAllBytes(restore2.toPath())); assertFalse(store.chunkExists(nextChunkId.getAndIncrement())); assertTrue(store.chunkExists(id1)); assertTrue(store.chunkExists(id2)); assertTrue(store.deleteChunk(id1)); assertFalse(store.deleteChunk(id1)); assertFalse(store.chunkExists(id1)); assertTrue(store.chunkExists(id2)); assertFalse(store.deleteChunk(nextChunkId.getAndIncrement())); }</code><technical_language>This is deprecated scheduled removed</technical_language>

Target:
public void testChunkStore() throws Exception { File file1 = new File(temporary, "file1"); byte[] data1 = "hello world".getBytes(UTF_8); write(file1.toPath(), data1); long id1 = nextChunkId.getAndIncrement(); assertFalse(store.chunkExists(id1)); store.putChunk(id1, file1); assertTrue(store.chunkExists(id1)); File file2 = new File(temporary, "file2"); byte[] data2 = "bye bye".getBytes(UTF_8); write(file2.toPath(), data2); long id2 = nextChunkId.getAndIncrement(); assertFalse(store.chunkExists(id2)); store.putChunk(id2, file2); assertTrue(store.chunkExists(id2)); File restore1 = new File(temporary, "restore1"); store.getChunk(id1, restore1); assertEquals(readAllBytes(restore1.toPath()), data1); File restore2 = new File(temporary, "restore2"); store.getChunk(id2, restore2); assertEquals(readAllBytes(restore2.toPath()), data2); assertFalse(store.chunkExists(nextChunkId.getAndIncrement())); assertTrue(store.chunkExists(id1)); assertTrue(store.chunkExists(id2)); assertTrue(store.deleteChunk(id1)); assertFalse(store.deleteChunk(id1)); assertFalse(store.chunkExists(id1)); assertTrue(store.chunkExists(id2)); assertFalse(store.deleteChunk(nextChunkId.getAndIncrement())); }
Source:
<code>private void addNotifications(boolean archived) { Timber.d("Add notifications"); if (mNotificationWorkerFragment == null) { Observable.fromCallable(() -> { progressBar.setVisibility(View.VISIBLE); return controller.getNotifications(archived); }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(notificationList -> { Collections.reverse(notificationList); Timber.d("Number of notifications is %d", notificationList.size()); this.notificationList = notificationList; if (notificationList.size()==0){ if (archived) { nonotificationtext.setText(R.string.no_archived_notification); isarchivedvisible = true; }else { nonotificationtext.setText(R.string.no_notification); isarchivedvisible = false; } relativeLayout.setVisibility(View.GONE); no_notification.setVisibility(View.VISIBLE); } else { setAdapter(notificationList); } if (notificationmenuitem != null) { <START> if (archived) { <END> notificationmenuitem.setTitle(R.string.menu_option_unread); }else { notificationmenuitem.setTitle(R.string.menu_option_archived); } } progressBar.setVisibility(View.GONE); }, throwable -> { Timber.e(throwable, "Error occurred while loading notifications"); ViewUtil.showShortSnackbar(relativeLayout, R.string.error_notifications); progressBar.setVisibility(View.GONE); }); } else { notificationList = mNotificationWorkerFragment.getNotificationList(); setAdapter(notificationList); } }</code><technical_language>extract setMenuItemTitle</technical_language>

Target:
private void addNotifications(boolean archived) { Timber.d("Add notifications"); if (mNotificationWorkerFragment == null) { Observable.fromCallable(() -> { progressBar.setVisibility(View.VISIBLE); return controller.getNotifications(archived); }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(notificationList -> { Collections.reverse(notificationList); Timber.d("Number of notifications is %d", notificationList.size()); this.notificationList = notificationList; if (notificationList.size()==0){ setEmptyView(); relativeLayout.setVisibility(View.GONE); no_notification.setVisibility(View.VISIBLE); } else { setAdapter(notificationList); } if (notificationmenuitem != null) { } progressBar.setVisibility(View.GONE); }, throwable -> { Timber.e(throwable, "Error occurred while loading notifications"); ViewUtil.showShortSnackbar(relativeLayout, R.string.error_notifications); progressBar.setVisibility(View.GONE); }); } else { notificationList = mNotificationWorkerFragment.getNotificationList(); setAdapter(notificationList); } }
Source:
<code>public void setCreatedAt(Date newDate) { this.createdAt = newDate; <START> this.updatedAt = newDate; <END> }</code><technical_language>this affected keepUpdateTimestamp</technical_language>

Target:
public void setCreatedAt(Date newDate) { this.createdAt = newDate; setLastUpdate(newDate); }
Source:
<code>H2Sql() throws IOException { final File tmp = File.createTempFile("netbout-", ".h2"); tmp.deleteOnExit(); this.file = tmp.getAbsolutePath(); final String[] stmts = { "CREATE TABLE alias (name VARCHAR, urn VARCHAR, photo VARCHAR, locale VARCHAR, email VARCHAR)", <START> "CREATE TABLE bout (number BIGINT AUTO_INCREMENT, title VARCHAR, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, subscription INTEGER)", <END> "CREATE TABLE message (number BIGINT AUTO_INCREMENT, bout BIGINT, text VARCHAR, author VARCHAR, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)", "CREATE TABLE attachment (name VARCHAR, bout BIGINT, data VARCHAR, author VARCHAR, ctype VARCHAR, etag VARCHAR)", "CREATE TABLE friend (alias VARCHAR, bout BIGINT)", }; final JdbcSession session = new JdbcSession(this.source()); for (final String stmt : stmts) { try { session.sql(stmt).execute(); } catch (final SQLException ex) { throw new IOException(ex); } } }</code><technical_language>@erimerturk this new subscription flag - is related a specific user</technical_language>

Target:
H2Sql() throws IOException { final File tmp = File.createTempFile("netbout-", ".h2"); tmp.deleteOnExit(); this.file = tmp.getAbsolutePath(); final String[] stmts = { "CREATE TABLE alias (name VARCHAR, urn VARCHAR, photo VARCHAR, locale VARCHAR, email VARCHAR)", "CREATE TABLE bout (number BIGINT AUTO_INCREMENT, title VARCHAR, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)", "CREATE TABLE message (number BIGINT AUTO_INCREMENT, bout BIGINT, text VARCHAR, author VARCHAR, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)", "CREATE TABLE attachment (name VARCHAR, bout BIGINT, data VARCHAR, author VARCHAR, ctype VARCHAR, etag VARCHAR)", "CREATE TABLE friend (alias VARCHAR, bout BIGINT, subscription INTEGER )", }; final JdbcSession session = new JdbcSession(this.source()); for (final String stmt : stmts) { try { session.sql(stmt).execute(); } catch (final SQLException ex) { throw new IOException(ex); } } }
Source:
<code>private static byte[] base64Decode(String base64) { <START> return Base64.getMimeDecoder().decode(base64.getBytes(US_ASCII)); <END> }</code><technical_language>static import getMimeDecoder match other file</technical_language>

Target:
private static byte[] base64Decode(String base64) { return getMimeDecoder().decode(base64.getBytes(US_ASCII)); }
Source:
<code>private boolean addVUSMutation(Alteration alteration){ <START> if (AlterationUtils.getVUS(alteration).contains(alteration)) return true; return false; <END> }</code><technical_language>suggestion AlterationUtils.getVUS(alteration).contains(alteration);</technical_language>

Target:
private boolean addVUSMutation(Alteration alteration){ return AlterationUtils.getVUS(alteration).contains(alteration); }
Source:
<code>public void open(ExecutionContext executionContext) throws ItemStreamException { checkResourceIsProvided(); String resourcePath = getResourcePath(); pedigreeReader = new PedigreePedReader(resourcePath); <START> doOpen(resourcePath); <END> }</code><technical_language>If reader is reused, open called this reader read reset "read finished". I this applies other reader</technical_language>

Target:
public void open(ExecutionContext executionContext) throws ItemStreamException { readAlreadyDone = false; checkResourceIsProvided(); String resourcePath = getResourcePath(); pedigreeReader = new PedigreePedReader(resourcePath); doOpen(resourcePath); }
Source:
<code>public void close() { currentByte = 0; currentBytePosition = 0; finished = false; try { baos.close(); } catch (IOException e) { <START> throw new ParquetRuntimeException("Error closing output stream.", e){}; <END> } }</code><technical_language>please create a more specific exception. create a method dealing this. void close(Closable c) { try { c.close() } catch (IOException e) { throw ... } }</technical_language>

Target:
public void close() { currentByte = 0; currentBytePosition = 0; finished = false; baos.close(); }
Source:
<code>protected List<CassandraRawCellValue> computeNext() { <START> while (true) { <END> if (queuedTasks.isEmpty()) { if (nextRow == null) { return endOfData(); } else { fetchNextRange(); } } else if (queuedTasks.peek().hasNext()) { return queuedTasks.peek().next(); } else { queuedTasks.poll(); } } }</code><technical_language>options in this loop a bit of explanation, especially referring steps - e.g. fetchNextRange means start of step 8 above</technical_language>

Target:
protected List<CassandraRawCellValue> computeNext() { while (true) { if (cellsToReturn.isEmpty()) { if (nextRow == null) { return endOfData(); } else { fetchNextRange(); } } else if (cellsToReturn.peek().hasNext()) { return cellsToReturn.peek().next(); } else { cellsToReturn.poll(); } } }