auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Request getRequest(final Request incomingRequest) throws TranslationException { if (incomingRequest == null) { throw new IllegalArgumentException("incomingRequest == null"); } Code code = incomingRequest.getCode(); Type type = incomingRequest.getType(); Request outgoingRequest = new Request(code); outgoingRequest.setConfirmable(type == Type.CON); byte[] payload = incomingRequest.getPayload(); outgoingRequest.setPayload(payload); URI serverUri; try { String proxyUriString = URLDecoder.decode( incomingRequest.getOptions().getProxyUri(), "UTF-8"); serverUri = new URI(proxyUriString); } catch (UnsupportedEncodingException e) { <START> LOGGER.warn("UTF-8 do not support this encoding: {}", e); <END> throw new TranslationException("UTF-8 do not support this encoding", e); } catch (URISyntaxException e) { LOGGER.warn("Cannot translate the server uri {}", e); throw new TranslationException("Cannot translate the server uri", e); } OptionSet options = new OptionSet(incomingRequest.getOptions()); options.removeProxyUri(); options.removeBlock1(); options.removeBlock2(); options.clearUriPath(); options.clearUriQuery(); outgoingRequest.setOptions(options); if (serverUri != null) { outgoingRequest.setURI(serverUri); } LOGGER.debug("Incoming request translated correctly"); return outgoingRequest; }</code><technical_language>if want include stack trace in log statement, do need a placeholder in here. placeholder syntax more sense if want include exception's *message* property: LOGGER.warn("....: {}", e.getMessage());</technical_language>

Target:
public static Request getRequest(final Request incomingRequest) throws TranslationException { if (incomingRequest == null) { throw new IllegalArgumentException("incomingRequest == null"); } Code code = incomingRequest.getCode(); Type type = incomingRequest.getType(); Request outgoingRequest = new Request(code); outgoingRequest.setConfirmable(type == Type.CON); byte[] payload = incomingRequest.getPayload(); outgoingRequest.setPayload(payload); URI serverUri; try { String proxyUriString = URLDecoder.decode( incomingRequest.getOptions().getProxyUri(), "UTF-8"); serverUri = new URI(proxyUriString); } catch (UnsupportedEncodingException e) { LOGGER.warn("UTF-8 do not support this encoding", e); throw new TranslationException("UTF-8 do not support this encoding", e); } catch (URISyntaxException e) { LOGGER.warn("Cannot translate the server uri", e); throw new TranslationException("Cannot translate the server uri", e); } OptionSet options = new OptionSet(incomingRequest.getOptions()); options.removeProxyUri(); options.removeBlock1(); options.removeBlock2(); options.clearUriPath(); options.clearUriQuery(); outgoingRequest.setOptions(options); if (serverUri != null) { outgoingRequest.setURI(serverUri); } LOGGER.debug("Incoming request translated correctly"); return outgoingRequest; }
Source:
<code>public void testMultiThreadPush() throws InterruptedException, TimeoutException, ExecutionException { final int numPushThreads = 8; final int numPushPerThread = 1000; final int pushValue = 1; final CountDownLatch countDownLatch = new CountDownLatch(numPushThreads); final Runnable[] threads = new Runnable[numPushThreads]; for (int index = 0; index < numPushThreads; ++index) { <START> final int key = index % 4; <END> threads[index] = () -> { for (int push = 0; push < numPushPerThread; ++push) { worker.push(key, pushValue); } countDownLatch.countDown(); }; } ThreadUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(10, TimeUnit.SECONDS); worker.close(CLOSE_TIMEOUT); assertTrue(MSG_THREADS_SHOULD_FINISH, allThreadsFinished); verify(mockSender, times(numPushThreads * numPushPerThread)).sendPushMsg(anyString(), anyObject(), eq(pushValue)); }</code><technical_language>is this 4? Is a numPushThreads / 2</technical_language>

Target:
public void testMultiThreadPush() throws InterruptedException, TimeoutException, ExecutionException, NetworkException { final int numPushThreads = 8; final int numKeys = 4; final int numPushPerThread = 1000; final int pushValue = 1; final CountDownLatch countDownLatch = new CountDownLatch(numPushThreads); final Runnable[] threads = new Runnable[numPushThreads]; for (int index = 0; index < numPushThreads; ++index) { final int key = index % numKeys; threads[index] = () -> { for (int push = 0; push < numPushPerThread; ++push) { worker.push(key, pushValue); } countDownLatch.countDown(); }; } ThreadUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(10, TimeUnit.SECONDS); worker.close(CLOSE_TIMEOUT); assertTrue(MSG_THREADS_SHOULD_FINISH, allThreadsFinished); verify(mockSender, times(numPushThreads * numPushPerThread)).sendPushMsg(anyString(), anyObject(), eq(pushValue)); }
Source:
<code>public void checkPreviewUpdatedAfterStopResume() { IdlingRegistry.getInstance().register(mActivityRule.getActivity().getViewIdlingResource()); <START> <END> pressHomeButton(); mActivityRule.getActivity().resetViewIdlingResource(); mIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); mActivityRule.getActivity().startActivity(mIntent); onView(withId(R.id.textureView)).check(matches(isDisplayed())); IdlingRegistry.getInstance().unregister( mActivityRule.getActivity().getViewIdlingResource()); }</code><technical_language>consider wait for preview ready press home key. verify flow Preview ready -> Preview Stop -> (Verify) preview resume successfully</technical_language>

Target:
public void checkPreviewUpdatedAfterStopResume() { IdlingRegistry.getInstance().register(mActivityRule.getActivity().getViewIdlingResource()); onView(withId(R.id.textureView)).check(matches(isDisplayed())); pressHomeButton(); mActivityRule.getActivity().resetViewIdlingResource(); mIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); mActivityRule.getActivity().startActivity(mIntent); onView(withId(R.id.textureView)).check(matches(isDisplayed())); IdlingRegistry.getInstance().unregister( mActivityRule.getActivity().getViewIdlingResource()); }
Source:
<code>public void testTmfTraceMultiTimestamps() { assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize()); assertEquals("getTraceSize", NB_EVENTS, fTrace.getNbEvents()); assertEquals("getRange-start", 1, fTrace.getTimeRange().getStartTime().getValue()); assertEquals("getRange-end", NB_EVENTS, fTrace.getTimeRange().getEndTime().getValue()); assertEquals("getStartTime", 1, fTrace.getStartTime().getValue()); assertEquals("getEndTime", NB_EVENTS, fTrace.getEndTime().getValue()); List<ITmfCheckpoint> checkpoints = fTrace.getIndexer().getCheckpoints(); assertTrue("Checkpoints exist", checkpoints != null); assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size()); TmfTimestamp seekTs = new TmfTimestamp(101, -3, 0); ITmfContext ctx = fTrace.seekEvent(seekTs); ITmfEvent event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 99); <START> assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); <END> event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 100); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 101); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); }</code><technical_language>more simple: assertEquals(seekTs, event.getTimestamp());</technical_language>

Target:
public void testTmfTraceMultiTimestamps() { assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize()); assertEquals("getTraceSize", NB_EVENTS, fTrace.getNbEvents()); assertEquals("getRange-start", 1, fTrace.getTimeRange().getStartTime().getValue()); assertEquals("getRange-end", NB_EVENTS, fTrace.getTimeRange().getEndTime().getValue()); assertEquals("getStartTime", 1, fTrace.getStartTime().getValue()); assertEquals("getEndTime", NB_EVENTS, fTrace.getEndTime().getValue()); List<ITmfCheckpoint> checkpoints = fTrace.getIndexer().getCheckpoints(); assertTrue("Checkpoints exist", checkpoints != null); assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE + 1, checkpoints.size()); TmfTimestamp seekTs = new TmfTimestamp(101, -3, 0); ITmfContext ctx = fTrace.seekEvent(seekTs); ITmfEvent event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 99); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 100); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 101); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); }
Source:
<code>public int read(byte b[], int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); } else if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } if (endOfInput && !bbuf.hasRemaining()) { return -1; } int totalRead = 0; while (len > 0 && !endOfInput) { if (bbuf.hasRemaining()) { int remaining = Math.min(len, bbuf.remaining()); bbuf.get(b, off, remaining); totalRead += remaining; off += remaining; len -= remaining; <START> if (len >= 0) { <END> return totalRead; } } advance(); } if (endOfInput && !bbuf.hasRemaining()) { return -1; } return totalRead; }</code><technical_language>This condition effectively exit loop iteration, hurt performance</technical_language>

Target:
public int read(byte b[], int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); } else if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } if (endOfInput && !bbuf.hasRemaining()) { return -1; } int totalRead = 0; while (len > 0 && !endOfInput) { if (bbuf.hasRemaining()) { int remaining = Math.min(len, bbuf.remaining()); bbuf.get(b, off, remaining); totalRead += remaining; off += remaining; len -= remaining; if (len == 0) { return totalRead; } } advance(); } if (endOfInput && !bbuf.hasRemaining() && totalRead == 0) { return -1; } return totalRead; }
Source:
<code>public void testColorReferencesCardinality() { List<EReference> referencesWithWrongCardinality = Lists.newArrayList(); Predicate<EReference> shouldBeRequired = new Predicate<EReference>() { @Override public boolean apply(EReference input) { <START> return !input.isRequired(); <END> } }; Iterables.addAll(referencesWithWrongCardinality, Iterables.filter(colorReferences, shouldBeRequired)); Assert.assertTrue(getMessage(referencesWithWrongCardinality), referencesWithWrongCardinality.isEmpty()); }</code><technical_language>check reference is a specialColorReference For exemple: return !input.isRequired() && !specialColorRefs.contains(input);</technical_language>

Target:
public void testColorReferencesCardinality() { List<EReference> referencesWithWrongCardinality = Lists.newArrayList(); Predicate<EReference> shouldBeRequired = new Predicate<EReference>() { @Override public boolean apply(EReference input) { return !input.isRequired() && !specialColorRefs.contains(input); } }; Iterables.addAll(referencesWithWrongCardinality, Iterables.filter(colorReferences, shouldBeRequired)); Assert.assertTrue(getMessage(referencesWithWrongCardinality), referencesWithWrongCardinality.isEmpty()); }
Source:
<code>public VariantToMongoDbObjectConverter variantToMongoDbObjectConverter(InputParameters inputParameters) { if (VariantSource.Aggregation.NONE.equals(inputParameters.getVcfAggregation())) { <START> return new VariantToMongoDbObjectConverter(false, false, true, includeSourceLine); <END> } else { return new VariantToMongoDbObjectConverter(true, true, false, includeSourceLine); } }</code><technical_language>2 arguments merged one, value. includeSourceLine is internally VariantToMongoDbObjectConverter dropped</technical_language>

Target:
public VariantToMongoDbObjectConverter variantToMongoDbObjectConverter(InputParameters inputParameters) { boolean includeSamples, includeStats; if (VariantSource.Aggregation.NONE.equals(inputParameters.getVcfAggregation())) { includeSamples = true; includeStats = false; } else { includeSamples = false; includeStats = true; } return new VariantToMongoDbObjectConverter(includeStats, includeSamples); }
Source:
<code>public Integer parse(CharSequence text) throws ParseException { MatchResult match = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(text.toString().trim()); if (match == null) { return 0; } String prefix = match.getGroup(1); String suffix = match.getGroup(2); Integer size = null; try { size = Integer.parseInt(prefix); } catch (NumberFormatException e) { return 0; } if (suffix.equalsIgnoreCase("TB") || suffix.equalsIgnoreCase("T")) { return size * 1024 * 1024; } else if (suffix.equalsIgnoreCase("GB") || suffix.equalsIgnoreCase("G")) { return size * 1024; } else if (suffix.equalsIgnoreCase("MB") || suffix.equalsIgnoreCase("M") || <START> suffix.equalsIgnoreCase(constant.mb())) { <END> return size; } else if (StringHelper.isNullOrEmpty(suffix)) { return size; } else { return 0; } }</code><technical_language>replace condition then? MB, "M" MiB is MiB of for GB TB</technical_language>

Target:
public Integer parse(CharSequence text) throws ParseException { MatchResult match = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(text.toString().trim()); if (match == null) { return 0; } String prefix = match.getGroup(1); String suffix = match.getGroup(2); Integer size = null; try { size = Integer.parseInt(prefix); } catch (NumberFormatException e) { return 0; } if (suffix.equalsIgnoreCase(constant.tb()) || suffix.equalsIgnoreCase(constant.t()) || suffix.equalsIgnoreCase(constant.tib())) { return size * 1024 * 1024; } else if (suffix.equalsIgnoreCase(constant.gb()) || suffix.equalsIgnoreCase(constant.g()) || suffix.equalsIgnoreCase(constant.gib())) { return size * 1024; } else if (suffix.equalsIgnoreCase(constant.mb()) || suffix.equalsIgnoreCase(constant.m()) || suffix.equalsIgnoreCase(constant.mib())) { return size; } else if (StringHelper.isNullOrEmpty(suffix)) { return size; } else { return 0; } }
Source:
<code>public <T extends ModuleType> Collection<T> getModuleTypes(Locale locale) { Collection<ModuleType> values = providedObjectsHolder.values(); if (values.isEmpty()) { return Collections.<T>emptyList(); } <START> Collection<ModuleType> toReturn = new LinkedList<ModuleType>(); <END> toReturn.addAll(values); return (Collection<T>) toReturn; }</code><technical_language>do Collection<ModuleType> toReturn = new LinkedList<ModuleType>(values);</technical_language>

Target:
public <T extends ModuleType> Collection<T> getModuleTypes(Locale locale) { Collection<ModuleType> values = providedObjectsHolder.values(); if (values.isEmpty()) { return Collections.<T>emptyList(); } return (Collection<T>) new LinkedList<ModuleType>(values); }
Source:
<code>private static List<IProject> collectSelectedProjects(ExecutionEvent event) { ISelection currentSelection = HandlerUtil.getCurrentSelection(event); if (currentSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) currentSelection; @SuppressWarnings("unchecked") ImmutableList<IProject> selectedProjects = FluentIterable.from(selection.toList()) .transform(new AdapterFunction<IProject>(IProject.class, Platform.getAdapterManager())) .filter(Predicates.hasGradleNature()).toList(); return selectedProjects; } <START> return ImmutableList.of(); <END> }</code><technical_language>put this else statement</technical_language>

Target:
private static List<IProject> collectSelectedProjects(ExecutionEvent event) { ISelection currentSelection = HandlerUtil.getCurrentSelection(event); if (currentSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) currentSelection; @SuppressWarnings("unchecked") ImmutableList<IProject> selectedProjects = FluentIterable.from(selection.toList()) .transform(new AdapterFunction<IProject>(IProject.class, Platform.getAdapterManager())) .filter(Predicates.hasGradleNature()).toList(); return selectedProjects; } else { return ImmutableList.of(); } }
Source:
<code><START> public Stream<Allele> filterAllelesForFinalSet() { <END> return newAlleles.stream().filter(a -> !a.equals(GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE)) .filter(a -> !a.isReference()) .filter(a -> !(a.isSymbolic() && vc.isSymbolic())) .filter(Allele::isCalled) ; }</code><technical_language>weird change this public method return a Stream a more conventional List -- if this streaming expressions infinitesimally more elegant I disapprove :) this method public in place</technical_language>

Target:
private Stream<Allele> filterAllelesForFinalSet() { return newAlleles.stream().filter(a -> !a.equals(GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE)) .filter(a -> !a.isReference()) .filter(a -> !(a.isSymbolic() && vc.isSymbolic())) .filter(Allele::isCalled) ; }
Source:
<code>public void testClientCertificatePem() throws Exception { <START> HttpServlet servlet = new HttpServlet() <END> { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate"); if ((certs == null) || (certs.length == 0)) { throw new RuntimeException("No client certificate"); } if (certs.length > 1) { throw new RuntimeException("Received multiple client certificates"); } X509Certificate cert = certs[0]; response.getWriter().write(cert.getSubjectX500Principal().getName()); response.setStatus(HttpServletResponse.SC_OK); } }; config.setHttpEnabled(false) .setAdminEnabled(false) .setHttpsEnabled(true) .setHttpsPort(0) .setKeystorePath(getResource("clientcert-pem/server.pem").getPath()) .setKeystorePassword("airlift") .setTrustStorePath(getResource("clientcert-pem/ca.crt").getPath()); createAndStartServer(servlet); HttpClientConfig clientConfig = new HttpClientConfig() .setKeyStorePath(getResource("clientcert-pem/client.pem").getPath()) .setKeyStorePassword("airlift") .setTrustStorePath(getResource("clientcert-pem/ca.crt").getPath()); System.out.println(httpServerInfo.getHttpsUri()); try (JettyHttpClient httpClient = new JettyHttpClient(clientConfig)) { StringResponse response = httpClient.execute( prepareGet().setUri(httpServerInfo.getHttpsUri()).build(), createStringResponseHandler()); assertEquals(response.getStatusCode(), HttpServletResponse.SC_OK); assertEquals(response.getBody(), "CN=testing,OU=Client,O=Airlift,L=Palo Alto,ST=CA,C=US"); } }</code><technical_language>Add a method for this need duplicate</technical_language>

Target:
public void testClientCertificatePem() throws Exception { config.setHttpEnabled(false) .setAdminEnabled(false) .setHttpsEnabled(true) .setHttpsPort(0) .setKeystorePath(getResource("clientcert-pem/server.pem").getPath()) .setKeystorePassword("airlift") .setTrustStorePath(getResource("clientcert-pem/ca.crt").getPath()); createAndStartServer(createCertTestServlet()); HttpClientConfig clientConfig = new HttpClientConfig() .setKeyStorePath(getResource("clientcert-pem/client.pem").getPath()) .setKeyStorePassword("airlift") .setTrustStorePath(getResource("clientcert-pem/ca.crt").getPath()); assertClientCertificateRequest(clientConfig); }
Source:
<code>public String getHostnameForHostID(int hostId) { if (hostId == m_localHostId) { return CoreUtils.getHostnameOrAddress(); } Iterator<ForeignHost> it = m_foreignHosts.get(hostId).iterator(); if (it.hasNext()) { ForeignHost fh = it.next(); return fh.hostname(); <START> } else { <END> return "UNKNOWN"; } }</code><technical_language>@luyangco remove ELSE return "UNKNOWN"</technical_language>

Target:
public String getHostnameForHostID(int hostId) { if (hostId == m_localHostId) { return CoreUtils.getHostnameOrAddress(); } Iterator<ForeignHost> it = m_foreignHosts.get(hostId).iterator(); if (it.hasNext()) { ForeignHost fh = it.next(); return fh.hostname(); } return "UNKNOWN"; }
Source:
<code>public void commitTransaction() { nativeCommitTransaction(nativePtr); <START> invokeListenerIfSchemaChanged(); <END> }</code><technical_language>related dynamic APIs refresh schema cache well</technical_language>

Target:
public void commitTransaction() { nativeCommitTransaction(nativePtr); }
Source:
<code><START> public static Extension create(Builder builder) { <END> return new HeadingAnchorExtension(builder.defaultId, builder.idPrefix, builder.idSuffix); }</code><technical_language>This need public. Instead, pass builder private constructor. do in HtmlRenderer</technical_language>

Target:
private static Extension create(Builder builder) { return new HeadingAnchorExtension(builder.defaultId, builder.idPrefix, builder.idSuffix); }
Source:
<code>private void removeExistContainer(String containerName) { try { docker.killContainer(containerName); } catch (DockerException | InterruptedException e) { <START> LOGGER.error(e.getMessage(), e); <END> } finally { try { docker.removeContainer(containerName); } catch (DockerException | InterruptedException e) { LOGGER.error(e.getMessage(), e); } } }</code><technical_language>error if docker exist</technical_language>

Target:
private void removeExistContainer(String containerName) { boolean isExist = false; try { final List<Container> containers = docker.listContainers(DockerClient.ListContainersParam.allContainers()); for (Container container : containers) { for (String name : container.names()) { if (StringUtils.equals(name, "/" + containerName)) { isExist = true; break; } } } if (isExist == true) { LOGGER.info("kill exist container {}", containerName); docker.killContainer(containerName); } } catch (DockerException | InterruptedException e) { LOGGER.error(e.getMessage(), e); } finally { try { if (isExist == true) { docker.removeContainer(containerName); } } catch (DockerException | InterruptedException e) { LOGGER.error(e.getMessage(), e); } } }
Source:
<code>public Collection<UstDebugInfoBinaryFile> getAllBinaries() { waitForCompletion(); ITmfStateSystem ss = checkNotNull(getStateSystem()); Set<UstDebugInfoBinaryFile> files = new TreeSet<>(); ImmutableList.Builder<Integer> builder = ImmutableList.builder(); List<Integer> vpidQuarks = ss.getSubAttributes(-1, false); for (Integer vpidQuark : vpidQuarks) { builder.addAll(ss.getSubAttributes(vpidQuark, false)); } List<Integer> baddrQuarks = builder.build(); for (Integer baddrQuark : baddrQuarks) { List<Integer> buildIdQuarks = ss.getSubAttributes(baddrQuark, false); for (Integer buildIdQuark : buildIdQuarks) { String buildId = ss.getAttributeName(buildIdQuark); ITmfStateInterval interval = StateSystemUtils.queryUntilNonNullValue(ss, buildIdQuark, ss.getStartTime(), Long.MAX_VALUE); if (interval == null) { throw new IllegalStateException(); } String filePath = interval.getStateValue().unboxStr(); try { int isPicQuark = ss.getQuarkRelative(buildIdQuark, UstDebugInfoStateProvider.IS_PIC_ATTRIB); int isPicVal = ss.querySingleState(interval.getStartTime(), isPicQuark).getStateValue().unboxInt(); <START> boolean isPic = (isPicVal == 0 ? false : true); <END> files.add(new UstDebugInfoBinaryFile(filePath, buildId, isPic)); } catch (AttributeNotFoundException e) { throw new IllegalStateException("Missing expected \"isPic\" attribute"); } catch (StateSystemDisposedException e) { } } } return files; }</code><technical_language>boolean isPic = isPicVal != 0;</technical_language>

Target:
public Collection<UstDebugInfoBinaryFile> getAllBinaries() { waitForCompletion(); ITmfStateSystem ss = checkNotNull(getStateSystem()); Set<UstDebugInfoBinaryFile> files = new TreeSet<>(); ImmutableList.Builder<Integer> builder = ImmutableList.builder(); List<Integer> vpidQuarks = ss.getSubAttributes(-1, false); for (Integer vpidQuark : vpidQuarks) { builder.addAll(ss.getSubAttributes(vpidQuark, false)); } List<Integer> baddrQuarks = builder.build(); for (Integer baddrQuark : baddrQuarks) { List<Integer> buildIdQuarks = ss.getSubAttributes(baddrQuark, false); for (Integer buildIdQuark : buildIdQuarks) { String buildId = ss.getAttributeName(buildIdQuark); ITmfStateInterval interval = StateSystemUtils.queryUntilNonNullValue(ss, buildIdQuark, ss.getStartTime(), Long.MAX_VALUE); if (interval == null) { throw new IllegalStateException(); } String filePath = interval.getStateValue().unboxStr(); try { int isPicQuark = ss.getQuarkRelative(buildIdQuark, UstDebugInfoStateProvider.IS_PIC_ATTRIB); int isPicVal = ss.querySingleState(interval.getStartTime(), isPicQuark).getStateValue().unboxInt(); boolean isPic = (isPicVal != 0); files.add(new UstDebugInfoBinaryFile(filePath, buildId, isPic)); } catch (AttributeNotFoundException e) { throw new IllegalStateException("Missing expected \"is_pic\" attribute"); } catch (StateSystemDisposedException e) { } } } return files; }
Source:
<code>protected synchronized CDOLockState[] getLockStates(Collection<CDOID> ids, boolean loadOnDemand) { List<CDOID> missing = new LinkedList<CDOID>(); List<CDOLockState> lockStates = new LinkedList<CDOLockState>(); for (CDOID id : ids) { CDOLockState lockState = null; InternalCDOObject obj = getObject(id, false); if (obj != null) { lockState = this.lockStates.get(obj); } if (lockState != null) { lockStates.add(lockState); } else { missing.add(id); } } if (loadOnDemand && (missing.size() > 0 || ids.isEmpty())) { CDOSessionProtocol sessionProtocol = session.getSessionProtocol(); CDOLockState[] loadedLockStates = sessionProtocol.getLockStates(viewID, missing); List<CDOLockState> newLockStateForCache = new ArrayList<CDOLockState>(loadedLockStates.length + missing.size()); for (CDOLockState loadedLockState : loadedLockStates) { lockStates.add(loadedLockState); newLockStateForCache.add(loadedLockState); CDOID cdoID = CDOIDUtil.getCDOID(loadedLockState.getLockedObject()); if (cdoID != null) { missing.remove(cdoID); } } for (CDOID missingLockStateForCDOID : missing) { CDOLockState defaultLockState = CDOLockUtil.createLockState(missingLockStateForCDOID); lockStates.add(defaultLockState); <START> newLockStateForCache.add(defaultLockState); <END> } if (options().isLockNotificationEnabled()) { updateLockStates(newLockStateForCache.toArray(new CDOLockState[loadedLockStates.length + missing.size()])); } } return lockStates.toArray(new CDOLockState[lockStates.size()]); }</code><technical_language>lockStates instead of a new list</technical_language>

Target:
protected synchronized CDOLockState[] getLockStates(Collection<CDOID> ids, boolean loadOnDemand) { List<CDOID> missing = new LinkedList<CDOID>(); List<CDOLockState> lockStates = new LinkedList<CDOLockState>(); for (CDOID id : ids) { CDOLockState lockState = null; InternalCDOObject obj = getObject(id, false); if (obj != null) { lockState = this.lockStates.get(obj); } if (lockState != null) { lockStates.add(lockState); } else { missing.add(id); } } if (loadOnDemand && (missing.size() > 0 || ids.isEmpty())) { CDOSessionProtocol sessionProtocol = session.getSessionProtocol(); CDOLockState[] loadedLockStates = sessionProtocol.getLockStates(viewID, missing); List<CDOLockState> newLockStateForCache = new ArrayList<CDOLockState>(loadedLockStates.length + missing.size()); for (CDOLockState loadedLockState : loadedLockStates) { lockStates.add(loadedLockState); newLockStateForCache.add(loadedLockState); CDOID cdoID = CDOIDUtil.getCDOID(loadedLockState.getLockedObject()); if (cdoID != null) { missing.remove(cdoID); } } for (CDOID missingLockStateForCDOID : missing) { CDOLockState defaultLockState = CDOLockUtil.createLockState(missingLockStateForCDOID); lockStates.add(defaultLockState); newLockStateForCache.add(defaultLockState); } if (options().isLockNotificationEnabled()) { updateLockStates(newLockStateForCache.toArray(new CDOLockState[newLockStateForCache.size()])); } } return lockStates.toArray(new CDOLockState[lockStates.size()]); }
Source:
<code>public void registerDefaults() { <START> Comparator<ItemStack> TYPE = Comparator.comparing(i -> i.getType().getId()); <END> this.comparators.put("TYPE", TYPE); Comparator<ItemStack> SIZE = Comparator.comparing(ItemStack::getQuantity); this.comparators.put("SIZE", SIZE); Comparator<ItemStack> TYPE_SIZE = TYPE.thenComparing(SIZE); this.comparators.put("TYPE_SIZE", TYPE_SIZE); this.comparators.put("DEFAULT", TYPE_SIZE); Properties PROPERTIES = new Properties(); this.comparators.put("PROPERTIES", PROPERTIES); ItemDataComparator ITEM_DATA = new ItemDataComparator(); this.comparators.put("ITEM_DATA", ITEM_DATA); this.comparators.put("ITEM_DATA_IGNORE_DAMAGE", new ItemDataComparator(DamageableData.class)); this.comparators.put("IGNORE_SIZE", TYPE.thenComparing(PROPERTIES).thenComparing(ITEM_DATA)); this.comparators.put("ALL", TYPE.thenComparing(SIZE).thenComparing(PROPERTIES).thenComparing(ITEM_DATA)); }</code><technical_language>capitals</technical_language>

Target:
public void registerDefaults() { Comparator<ItemStack> type = Comparator.comparing(i -> i.getType().getId()); this.comparators.put("TYPE", type); Comparator<ItemStack> size = Comparator.comparing(ItemStack::getQuantity); this.comparators.put("SIZE", size); Comparator<ItemStack> typeSize = type.thenComparing(size); this.comparators.put("TYPE_SIZE", typeSize); this.comparators.put("DEFAULT", typeSize); Properties properties = new Properties(); this.comparators.put("PROPERTIES", properties); ItemDataComparator itemData = new ItemDataComparator(); this.comparators.put("ITEM_DATA", itemData); this.comparators.put("ITEM_DATA_IGNORE_DAMAGE", new ItemDataComparator(DamageableData.class)); this.comparators.put("IGNORE_SIZE", type.thenComparing(properties).thenComparing(itemData)); this.comparators.put("ALL", type.thenComparing(size).thenComparing(properties).thenComparing(itemData)); }
Source:
<code>public void initialize() { logger.info("Initializing ..."); peerEurekaNodes.start(); try { registry.init(peerEurekaNodes); } catch (Exception e) { <START> logger.error("Error occurred while initializing registry", e); <END> } logger.info("Initialized"); }</code><technical_language>wrap throw a RuntimeException instead of suppressing a log message</technical_language>

Target:
public void initialize() { logger.info("Initializing ..."); peerEurekaNodes.start(); try { registry.init(peerEurekaNodes); } catch (Exception e) { throw new RuntimeException(e); } logger.info("Initialized"); }
Source:
<code>public Analysis analyze(Statement statement, boolean isDescribe) { Statement rewrittenStatement = StatementRewrite.rewrite(session, metadata, sqlParser, queryExplainer, statement, parameters, accessControl); Analysis analysis = new Analysis(rewrittenStatement, parameters, isDescribe); StatementAnalyzer analyzer = new StatementAnalyzer(analysis, metadata, sqlParser, accessControl, session); analyzer.analyze(rewrittenStatement, Optional.empty()); analysis.getTableColumnReferences().forEach((identity, tableColumnReferences) -> { AccessControl identityAccessControl = identity.equals(session.getIdentity()) ? accessControl : new ViewAccessControl(accessControl); tableColumnReferences.forEach((tableName, columns) -> <START> identityAccessControl.checkCanSelectFromColumns(session.getRequiredTransactionId(), <END> identity, tableName, ImmutableSet.copyOf(columns))); }); return analysis; }</code><technical_language>Nit: wrap argument</technical_language>

Target:
public Analysis analyze(Statement statement, boolean isDescribe) { Statement rewrittenStatement = StatementRewrite.rewrite(session, metadata, sqlParser, queryExplainer, statement, parameters, accessControl); Analysis analysis = new Analysis(rewrittenStatement, parameters, isDescribe); StatementAnalyzer analyzer = new StatementAnalyzer(analysis, metadata, sqlParser, accessControl, session); analyzer.analyze(rewrittenStatement, Optional.empty()); analysis.getTableColumnReferences().forEach((accessControlInfo, tableColumnReferences) -> tableColumnReferences.forEach((tableName, columns) -> accessControlInfo.getAccessControl().checkCanSelectFromColumns( session.getRequiredTransactionId(), accessControlInfo.getIdentity(), tableName, columns))); return analysis; }
Source:
<code>public SlotCollection getSlots() { <START> return slots; <END> }</code><technical_language>this</technical_language>

Target:
public SlotCollection getSlots() { return this.slots; }
Source:
<code>public FilterSupportStatus isFilterSupported(FilterAdapterContext context, org.apache.hadoop.hbase.filter.RowFilter filter) { ByteArrayComparable comparator = filter.getComparator(); if (!(comparator instanceof RegexStringComparator) && !(comparator instanceof BinaryComparator)) { return FilterSupportStatus.newNotSupported(comparator.getClass().getName() <START> + " comparators are not supported"); <END> } CompareOp operator = filter.getOperator(); if (operator != CompareFilter.CompareOp.EQUAL && operator != CompareFilter.CompareOp.NO_OP) { return FilterSupportStatus.newNotSupported(operator + " operators are not supported"); } return FilterSupportStatus.SUPPORTED; }</code><technical_language>ABC comparator is supported</technical_language>

Target:
public FilterSupportStatus isFilterSupported( FilterAdapterContext context, org.apache.hadoop.hbase.filter.RowFilter filter) { ByteArrayComparable comparator = filter.getComparator(); if (!(comparator instanceof RegexStringComparator) && !(comparator instanceof BinaryComparator)) { return FilterSupportStatus.newNotSupported(comparator.getClass().getName() + " comparator is not supported"); } if (filter.getOperator() != CompareFilter.CompareOp.EQUAL) { return FilterSupportStatus.newNotSupported(filter.getOperator() + " operator is not supported"); } return FilterSupportStatus.SUPPORTED; }
Source:
<code>public void ensureInputVisible() { scrollIntoViewPending_ = true; <START> Scheduler.get().scheduleDeferred(() -> checkForPendingScroll()); <END> }</code><technical_language>skip this if scrollIntoViewPending_ is true for requests stack up</technical_language>

Target:
public void ensureInputVisible() { if (!scrollIntoViewPending_) { scrollIntoViewPending_ = true; Scheduler.get().scheduleDeferred(() -> checkForPendingScroll()); } }
Source:
<code>private List<Map<String, Object>> convertJSONObjectToSiteList(JSONObject jsonObject, boolean keepJetpackSites) { List<Map<String, Object>> sites = new ArrayList<Map<String, Object>>(); JSONArray jsonSites = jsonObject.optJSONArray("sites"); if (jsonSites != null) { for (int i = 0; i < jsonSites.length(); i++) { JSONObject jsonSite = jsonSites.optJSONObject(i); Map<String, Object> site = new HashMap<String, Object>(); try { if (jsonSite.getBoolean("jetpack") && !keepJetpackSites) { continue; } site.put("blogName", jsonSite.get("name")); site.put("url", jsonSite.get("URL")); site.put("blogid", jsonSite.get("ID")); site.put("isAdmin", jsonSite.get("user_can_manage")); site.put("isVisible", jsonSite.get("visible")); <START> site.put("capabilities", jsonSite.get("capabilities").toString()); <END> JSONObject plan = jsonSite.getJSONObject("plan"); site.put("planID", plan.get("product_id")); site.put("plan_product_name_short", plan.get("product_name_short")); JSONObject jsonLinks = JSONUtils.getJSONChild(jsonSite, "meta/links"); if (jsonLinks != null) { site.put("xmlrpc", jsonLinks.getString("xmlrpc")); sites.add(site); } else { AppLog.e(T.NUX, "xmlrpc links missing from the me/sites REST response"); } } catch (JSONException e) { AppLog.e(T.NUX, e); } } } return sites; }</code><technical_language>jsonSite.get() return null guard this line. Cheers</technical_language>

Target:
private List<Map<String, Object>> convertJSONObjectToSiteList(JSONObject jsonObject, boolean keepJetpackSites) { List<Map<String, Object>> sites = new ArrayList<Map<String, Object>>(); JSONArray jsonSites = jsonObject.optJSONArray("sites"); if (jsonSites != null) { for (int i = 0; i < jsonSites.length(); i++) { JSONObject jsonSite = jsonSites.optJSONObject(i); Map<String, Object> site = new HashMap<String, Object>(); try { if (jsonSite.getBoolean("jetpack") && !keepJetpackSites) { continue; } site.put("blogName", jsonSite.get("name")); site.put("url", jsonSite.get("URL")); site.put("blogid", jsonSite.get("ID")); site.put("isAdmin", jsonSite.get("user_can_manage")); site.put("isVisible", jsonSite.get("visible")); site.put("capabilities", jsonSite.getString("capabilities")); JSONObject plan = jsonSite.getJSONObject("plan"); site.put("planID", plan.get("product_id")); site.put("plan_product_name_short", plan.get("product_name_short")); JSONObject jsonLinks = JSONUtils.getJSONChild(jsonSite, "meta/links"); if (jsonLinks != null) { site.put("xmlrpc", jsonLinks.getString("xmlrpc")); sites.add(site); } else { AppLog.e(T.NUX, "xmlrpc links missing from the me/sites REST response"); } } catch (JSONException e) { AppLog.e(T.NUX, e); } } } return sites; }
Source:
<code>public static RevCommit getCommonAncestor(Repository repo, AnyObjectId commit1, AnyObjectId commit2) throws IOException { RevWalk rw = new RevWalk(repo); rw.setRevFilter(RevFilter.MERGE_BASE); RevCommit srcRev = lookupCommit(rw, commit1); RevCommit dstRev = lookupCommit(rw, commit2); if (dstRev != null) rw.markStart(dstRev); if (srcRev != null) <START> rw.markStart(srcRev); <END> RevCommit result; result = rw.next(); return result != null ? result : null; }</code><technical_language>I merge base start point (or start point) sense. is result of that? generally, caller check arguments</technical_language>

Target:
public static RevCommit getCommonAncestor(Repository repo, AnyObjectId commit1, AnyObjectId commit2) throws IOException { Assert.isNotNull(repo); Assert.isNotNull(commit1); Assert.isNotNull(commit2); RevWalk rw = new RevWalk(repo); rw.setRevFilter(RevFilter.MERGE_BASE); RevCommit srcRev = rw.lookupCommit(commit1); RevCommit dstRev = rw.lookupCommit(commit2); rw.markStart(dstRev); rw.markStart(srcRev); RevCommit result; result = rw.next(); return result != null ? result : null; }
Source:
<code>public void setDefaultInterface() { Guid vmId = getVmId(); if <START> (!Guid.isNullOrEmpty(vmId)) <END> { getDiskInterface().setSelectedItem(getDisk().getDiskVmElementForVm(vmId).getDiskInterface()); } else { getDiskInterface().setSelectedItem(DiskInterface.VirtIO); } }</code><technical_language>if in positive branch</technical_language>

Target:
public void setDefaultInterface() { Guid vmId = getVmId(); if (Guid.isNullOrEmpty(vmId)) { getDiskInterface().setSelectedItem(DiskInterface.VirtIO); } else { getDiskInterface().setSelectedItem(getDisk().getDiskVmElementForVm(vmId).getDiskInterface()); } }
Source:
<code>public static Config loadConfig( String cluster, String role, String environ, String topologyBinaryFile, String topologyDefnFile, Boolean verbose, TopologyAPI.Topology topology) { <START> return Config.toRemoteMode( <END> Config.newBuilder() .putAll(ClusterConfig.loadSandboxConfig()) .putAll(commandLineConfigs(cluster, role, environ, verbose)) .putAll(topologyConfigs(topologyBinaryFile, topologyDefnFile, topology)) .build()); }</code><technical_language>is a name 'remote' - 'toSandboxMode' 'toContainerMode' - lines</technical_language>

Target:
public static Config loadConfig( String cluster, String role, String environ, String topologyBinaryFile, String topologyDefnFile, Boolean verbose, TopologyAPI.Topology topology) { return Config.toClusterMode( Config.newBuilder() .putAll(ConfigLoader.loadClusterConfig()) .putAll(commandLineConfigs(cluster, role, environ, verbose)) .putAll(topologyConfigs(topologyBinaryFile, topologyDefnFile, topology)) .build()); }
Source:
<code>public boolean test( Object value ) { <START> assert false : "StringRangePredicate.test() has not been tested yet... Add tests and remove assert"; <END> if ( value == null ) { return false; } if ( !(value instanceof String) ) { return false; } String str = (String) value; if ( from != null ) { int compare = PropertyValueComparison.COMPARE_STRINGS.compare( str, from ); if ( compare < 0 || !fromInclusive && compare == 0 ) { return false; } } if ( to != null ) { int compare = PropertyValueComparison.COMPARE_STRINGS.compare( str, to ); if ( compare > 0 || !toInclusive && compare == 0 ) { return false; } } return true; }</code><technical_language>This</technical_language>

Target:
public boolean test( Object value ) { if ( value == null ) { return false; } if ( !(value instanceof String) ) { return false; } String str = (String) value; if ( from != null ) { int compare = PropertyValueComparison.COMPARE_STRINGS.compare( str, from ); if ( compare < 0 || !fromInclusive && compare == 0 ) { return false; } } if ( to != null ) { int compare = PropertyValueComparison.COMPARE_STRINGS.compare( str, to ); if ( compare > 0 || !toInclusive && compare == 0 ) { return false; } } return true; }
Source:
<code>private static boolean argsMatch(AbstractExpression e1, AbstractExpression e2) { final List<AbstractExpression> args1 = e1.getArgs(), args2 = e2.getArgs(); return args1 == null || args2 == null ? args1 == args2 : args1.size() == args2.size() && IntStream.range(0, args1.size()) <START> .mapToObj(index -> (new FilterMatcher(args1.get(index), args2.get(index))).match()) <END> .reduce(Boolean::logicalAnd).get(); }</code><technical_language>Add a space if</technical_language>

Target:
private static boolean argsMatch(AbstractExpression e1, AbstractExpression e2) { final List<AbstractExpression> args1 = e1.getArgs(), args2 = e2.getArgs(); if (args1 == null || args2 == null) { return args1 == args2; } else { return args1.size() == args2.size() && IntStream.range(0, args1.size()) .mapToObj(index -> (new FilterMatcher(args1.get(index), args2.get(index))).match()) .reduce(Boolean::logicalAnd).get(); } }
Source:
<code>public List<ChangeItem> call() throws Exception { List<ChangeItem> changeData = new LinkedList<>(); Conditions.checkExpressionFailOnTrue(!txDelta.areOnTheSameBranch(), "Unable to compute deltas between transactions on different branches [%s]", txDelta); TransactionJoinQuery txJoin = joinFactory.createTransactionJoinQuery(); boolean isArchived = false; JdbcStatement chStmt = getJdbcClient().getStatement(); try { chStmt.runPreparedQuery(1, SELECT_IS_BRANCH_ARCHIVED, getBranchId()); while (chStmt.next()) { checkForCancelled(); if (chStmt.getInt("archived") == <START> 1) { <END> isArchived = true; } } } finally { chStmt.close(); } loadChangesAtEndTx(txJoin, isArchived); int txJoinId = txJoin.getQueryId(); try { loadByItemId(changeData, txJoinId, changeItemLoader.createArtifactChangeItemFactory(), isArchived); loadByItemId(changeData, txJoinId, changeItemLoader.createAttributeChangeItemFactory(), isArchived); loadByItemId(changeData, txJoinId, changeItemLoader.createRelationChangeItemFactory(), isArchived); } finally { try { txJoin.delete(); } finally { changeByGammaId.clear(); } } return changeData; }</code><technical_language>change BranchArchivedState.ARCHIVED</technical_language>

Target:
public List<ChangeItem> call() throws Exception { List<ChangeItem> changeData = new LinkedList<>(); Conditions.checkExpressionFailOnTrue(!txDelta.areOnTheSameBranch(), "Unable to compute deltas between transactions on different branches [%s]", txDelta); TransactionJoinQuery txJoin = joinFactory.createTransactionJoinQuery(); boolean isArchived = false; JdbcStatement chStmt = getJdbcClient().getStatement(); try { chStmt.runPreparedQuery(1, SELECT_IS_BRANCH_ARCHIVED, getBranchId()); while (chStmt.next()) { checkForCancelled(); if (chStmt.getInt("archived") == BranchArchivedState.ARCHIVED.getValue()) { isArchived = true; } } } finally { chStmt.close(); } loadChangesAtEndTx(txJoin, isArchived); int txJoinId = txJoin.getQueryId(); try { loadByItemId(changeData, txJoinId, changeItemLoader.createArtifactChangeItemFactory(), isArchived); loadByItemId(changeData, txJoinId, changeItemLoader.createAttributeChangeItemFactory(), isArchived); loadByItemId(changeData, txJoinId, changeItemLoader.createRelationChangeItemFactory(), isArchived); } finally { try { txJoin.delete(); } finally { changeByGammaId.clear(); } } return changeData; }
Source:
<code>public void traceClosed(@Nullable TmfTraceClosedSignal signal) { if (signal == null || signal.getTrace() != fTrace) { return; } fTrace = null; <START> Runnable r = this::reset; <END> if (Display.getCurrent() == null) { Display d = Display.getDefault(); if (!d.isDisposed()) { d.asyncExec(r); } } else { r.run(); } }</code><technical_language>necessary, signal UI thread</technical_language>

Target:
public void traceClosed(@Nullable TmfTraceClosedSignal signal) { if (signal == null || signal.getTrace() != fTrace) { return; } fTrace = null; reset(); }
Source:
<code>public void setup() throws Exception { trustStoreFile = File.createTempFile("truststore", ".jks"); SSLConfig sslConfig = TestSSLUtils.createSSLConfig("DC1,DC2,DC3", SSLFactory.Mode.SERVER, trustStoreFile, "server"); SSLConfig clientSSLConfig = TestSSLUtils.createSSLConfig("DC1,DC2,DC3", SSLFactory.Mode.CLIENT, trustStoreFile, "client"); SSLFactory serverSSLFactory = new SSLFactory(sslConfig); SSLFactory clientSSLFactory = new SSLFactory(clientSSLConfig); this.server = new EchoServer(serverSSLFactory, 18383); this.server.start(); <START> this.selector = new Selector(new NetworkMetrics(new MetricRegistry()), SystemTime.getInstance(), clientSSLFactory); <END> }</code><technical_language>again, this prefix in this method</technical_language>

Target:
public void setup() throws Exception { trustStoreFile = File.createTempFile("truststore", ".jks"); SSLConfig sslConfig = TestSSLUtils.createSSLConfig("DC1,DC2,DC3", SSLFactory.Mode.SERVER, trustStoreFile, "server"); SSLConfig clientSSLConfig = TestSSLUtils.createSSLConfig("DC1,DC2,DC3", SSLFactory.Mode.CLIENT, trustStoreFile, "client"); SSLFactory serverSSLFactory = new SSLFactory(sslConfig); SSLFactory clientSSLFactory = new SSLFactory(clientSSLConfig); server = new EchoServer(serverSSLFactory, 18383); server.start(); selector = new Selector(new NetworkMetrics(new MetricRegistry()), SystemTime.getInstance(), clientSSLFactory); }
Source:
<code>public DefaultTraversalMetrics(final long totalStepDurationNs, final List<MutableMetrics> orderedMetrics) { totalStepDuration = totalStepDurationNs; <START> for (int ix = 0; ix < orderedMetrics.size(); ix++) { <END> stepIndexedMetrics.put(orderedMetrics.get(ix).getId(), orderedMetrics.get(ix).getImmutableClone()); positionIndexedMetrics.put(ix, orderedMetrics.get(ix).getImmutableClone()); } }</code><technical_language>Good orderedMetrics.forEach() replaced a simple for loop, if calling get(ix) 3 times more efficient. Maybe: int ix = 0; for (final MutableMetrics metric : orderedMetrics) { stepIndexedMetrics.put(metric.getId(), metric.getImmutableClone()); positionIndexedMetrics.put(ix++, metric.getImmutableClone()); }</technical_language>

Target:
public DefaultTraversalMetrics(final long totalStepDurationNs, final List<MutableMetrics> orderedMetrics) { totalStepDuration = totalStepDurationNs; int ix = 0; for (final MutableMetrics metric : orderedMetrics) { stepIndexedMetrics.put(metric.getId(), metric.getImmutableClone()); positionIndexedMetrics.put(ix++, metric.getImmutableClone()); } }
Source:
<code>int modelToView(int childIndex) { if (filteredIndexes == null) { return childIndex; } int offset = 0; for (int <START> filteredIndexe : <END> filteredIndexes) { if (childIndex == filteredIndexe ) { return -1; } else if (childIndex > filteredIndexe) { offset++; } else { break; } } return childIndex - offset; }</code><technical_language>rename filteredIndex index</technical_language>

Target:
int modelToView(int childIndex) { if (filteredIndexes == null) { return childIndex; } int offset = 0; for (int filteredIndex : filteredIndexes) { if (childIndex == filteredIndex ) { return -1; } else if (childIndex > filteredIndex) { offset++; } else { break; } } return childIndex - offset; }