auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private String translateInSet(List<RexNode> disjunctions) { RexNode firstNode = disjunctions.get(0); RexCall firstCall = (RexCall) firstNode; final RexNode left = firstCall.operands.get(0); String name = getLeftNodeFieldName(left); Set<String> rightLiteralValueList = new HashSet<>(); disjunctions.forEach(node -> { RexCall call = (RexCall) node; RexLiteral rightLiteral = (RexLiteral) call.operands.get(1); rightLiteralValueList.add(quoteCharLiteral(rightLiteral)); }); final StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(name); stringBuilder.append(" IN SET("); <START> stringBuilder.append(Util.toString(rightLiteralValueList, "", ", ", "")); <END> stringBuilder.append(")"); return stringBuilder.toString(); }</code><technical_language>[String.join()](<LINK_0> sufficient here. Util class is pre java 8</technical_language>

Target:
private String translateInSet(List<RexNode> disjunctions) { RexNode firstNode = disjunctions.get(0); RexCall firstCall = (RexCall) firstNode; final RexNode left = firstCall.operands.get(0); String name = getLeftNodeFieldName(left); Set<String> rightLiteralValueList = new HashSet<>(); disjunctions.forEach(node -> { RexCall call = (RexCall) node; RexLiteral rightLiteral = (RexLiteral) call.operands.get(1); rightLiteralValueList.add(quoteCharLiteral(rightLiteral)); }); final StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(name); stringBuilder.append(" IN SET("); stringBuilder.append(String.join(", ", rightLiteralValueList)); stringBuilder.append(")"); return stringBuilder.toString(); }
Source:
<code>public static Builder builder() { <START> return new AutoValue_CreateFirewallPolicy.Builder(); <END> }</code><technical_language>I guessing builder needs isShared isAudited set default values (false) here. based this: <LINK_0> Please add docs for properties in other places applicable</technical_language>

Target:
public static Builder builder() { return new AutoValue_CreateFirewallPolicy.Builder().shared(false).audited(false); }
Source:
<code>private static void cleanShutdown() { log.info("CleanShutdown: Starting Cleanup."); shutdownServer = true; try { <START> CorfuServerNode current = activeServer; <END> if (current != null) { activeServer.close(); } } catch (Throwable th) { log.error("cleanShutdown: failed during shutdown", th); } LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); loggerContext.stop(); }</code><technical_language>do need a local variable for this</technical_language>

Target:
private static void cleanShutdown() { log.info("CleanShutdown: Starting Cleanup."); shutdownServer = true; try { CorfuServerNode current = activeServer; if (current != null) { current.close(); } } catch (Throwable th) { log.error("cleanShutdown: failed during shutdown", th); } LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); loggerContext.stop(); }
Source:
<code>public void spec104_mustSignalOnErrorWhenFails() throws Throwable { try { errorPublisherTest(new PublisherTestRun<T>() { @Override public void run(final Publisher<T> pub) throws InterruptedException { final Latch latch = new Latch(env); pub.subscribe(new TestEnvironment.TestSubscriber<T>(env) { @Override public void onError(Throwable cause) { latch.assertOpen(String.format("Error-state Publisher %s called `onError` twice on new Subscriber", pub)); latch.close(); } }); latch.expectClose(String.format("Error-state Publisher %s did not call `onError` on new Subscriber", pub)); Thread.sleep(env.defaultTimeoutMillis()); <START> env.verifyNoAsyncErrors(); <END> } }); } catch (Throwable ex) { throw new RuntimeException("Publisher threw exception ("+ex+") instead of signalling error via onError!", ex); } }</code><technical_language>I verifyNoAsyncErrors() a timeout, method decide is implemented, minimizes spread of calls Thread.sleep change implementation in a central place</technical_language>

Target:
public void spec104_mustSignalOnErrorWhenFails() throws Throwable { try { errorPublisherTest(new PublisherTestRun<T>() { @Override public void run(final Publisher<T> pub) throws InterruptedException { final Latch latch = new Latch(env); pub.subscribe(new TestEnvironment.TestSubscriber<T>(env) { @Override public void onError(Throwable cause) { latch.assertOpen(String.format("Error-state Publisher %s called `onError` twice on new Subscriber", pub)); latch.close(); } }); latch.expectClose(String.format("Error-state Publisher %s did not call `onError` on new Subscriber", pub)); env.verifyNoAsyncErrors(env.defaultTimeoutMillis()); } }); } catch (Throwable ex) { throw new RuntimeException(String.format("Publisher threw exception (%s) instead of signalling error via onError!", ex.getMessage()), ex); } }
Source:
<code><START> public final Result process(Conveyor conveyor) { <END> Map<DispatchingId, InboxMessage> seen = new HashMap<>(); for (InboxMessage message : conveyor) { InboxMessageStatus status = message.getStatus(); if (status == InboxMessageStatus.TO_DELIVER) { DispatchingId dispatchingId = new DispatchingId(message); if (seen.containsKey(dispatchingId)) { conveyor.markDuplicateAndRemove(message); } else { seen.put(dispatchingId, message); if (idempotenceWindow != null) { conveyor.keepForLonger(message, idempotenceWindow); } } } } if (!seen.isEmpty()) { Collection<InboxMessage> toDeliver = seen.values(); List<InboxMessage> toDispatch = deduplicateAndSort(toDeliver, conveyor); DeliveryErrors errors = action.executeFor(toDispatch); conveyor.markDelivered(toDispatch); Result result = new Result(toDispatch.size(), errors); return result; } else { return emptyResult(); } }</code><technical_language>Please split helper methods</technical_language>

Target:
public final Result process(Conveyor conveyor) { FilterToDeliver filter = new FilterToDeliver(conveyor); Collection<InboxMessage> filtered = filter.messagesToDispatch(); if (filtered.isEmpty()) { return emptyResult(); } List<InboxMessage> toDispatch = deduplicateAndSort(filtered, conveyor); DeliveryErrors errors = action.executeFor(toDispatch); conveyor.markDelivered(toDispatch); Result result = new Result(toDispatch.size(), errors); return result; }
Source:
<code>public void update() { super.update(); if (Game.isClient(getWorld())) { return; } ItemStack feed = getStackInSlot(0); if (clock % (MIN_FEED_INTERVAL / 4) == 0 && (feed == null || sizeOf(feed) < feed.getMaxStackSize())) { InventoryComposite chests = InvTools.getAdjacentInventories(worldObj, getPos()); InvTools.moveOneItem(chests, feedInv, StandardStackFilters.FEED); } feed = getStackInSlot(0); feedTime--; <START> if (!powered && feed != null && sizeOf(feed) > 0 && feedTime <= 0) { <END> feedTime = MIN_FEED_INTERVAL + rand.nextInt(FEED_VARIANCE); AxisAlignedBB box = AABBFactory.start().createBoxForTileAt(getPos()).raiseFloor(-1).raiseCeiling(2).expandHorizontally(AREA).build(); List<EntityAnimal> animals = worldObj.getEntitiesWithinAABB(EntityAnimal.class, box); for (EntityAnimal target : animals) { if (target.isBreedingItem(getStackInSlot(0)) && feedAnimal(target)) { if (feedCounter <= 0) { setInventorySlotContents(0, InvTools.depleteItem(feed)); feedCounter = ANIMALS_PER_FOOD; } feedCounter--; sendFeedPacket(target); break; } } } }</code><technical_language>ItemStack null check here. This replaced !isEmpty()</technical_language>

Target:
public void update() { super.update(); if (Game.isClient(getWorld())) { return; } ItemStack feed = getStackInSlot(0); if (clock % (MIN_FEED_INTERVAL / 4) == 0 && (feed == null || sizeOf(feed) < feed.getMaxStackSize())) { InventoryComposite chests = InvTools.getAdjacentInventories(worldObj, getPos()); InvTools.moveOneItem(chests, feedInv, StandardStackFilters.FEED); } feed = getStackInSlot(0); feedTime--; if (!powered && !isEmpty(feed) && feedTime <= 0) { feedTime = MIN_FEED_INTERVAL + rand.nextInt(FEED_VARIANCE); AxisAlignedBB box = AABBFactory.start().createBoxForTileAt(getPos()).raiseFloor(-1).raiseCeiling(2).expandHorizontally(AREA).build(); List<EntityAnimal> animals = worldObj.getEntitiesWithinAABB(EntityAnimal.class, box); for (EntityAnimal target : animals) { if (target.isBreedingItem(getStackInSlot(0)) && feedAnimal(target)) { if (feedCounter <= 0) { setInventorySlotContents(0, InvTools.depleteItem(feed)); feedCounter = ANIMALS_PER_FOOD; } feedCounter--; sendFeedPacket(target); break; } } } }
Source:
<code>public void testStringWithDefaultSet() { Version v = null; String formatString = "format(sds):"; String one = "abc"; String two = "def"; for (char <START> element : <END> s_delim) { StringBuilder buf = new StringBuilder(); buf.append(formatString); buf.append(one); buf.append(element); buf.append(two); v = Version.parseVersion(buf.toString()); assertNotNull(v); assertEquals(one, v.getSegment(0)); assertEquals(two, v.getSegment(1)); } }</code><technical_language>rename delim</technical_language>

Target:
public void testStringWithDefaultSet() { Version v = null; String formatString = "format(sds):"; String one = "abc"; String two = "def"; for (char delim : s_delim) { StringBuilder buf = new StringBuilder(); buf.append(formatString); buf.append(one); buf.append(delim); buf.append(two); v = Version.parseVersion(buf.toString()); assertNotNull(v); assertEquals(one, v.getSegment(0)); assertEquals(two, v.getSegment(1)); } }
Source:
<code>public void testDeadWatcherMetrics() { MyDeadWatcherListener listener = new MyDeadWatcherListener(); WatcherCleaner cleaner = new WatcherCleaner(listener, 1, 1, 1, 1); listener.setDelayMs(20); cleaner.start(); listener.setCountDownLatch(new CountDownLatch(3)); cleaner.addDeadWatcher(1); cleaner.addDeadWatcher(2); cleaner.addDeadWatcher(3); Assert.assertTrue(listener.wait(5000)); Map<String, Object> values = ServerMetrics.getAllValues(); <START> Assert.assertTrue("Adding dead watcher should be stalled twice", (Long)values.get("add_dead_watcher_stall_time") > 0L); <END> Assert.assertEquals("Total dead watchers added to the queue should be 3", 3L, values.get("dead_watchers_queued")); Assert.assertEquals("Total dead watchers cleared should be 3", 3L, values.get("dead_watchers_cleared")); Assert.assertEquals(3L, values.get("cnt_dead_watchers_cleaner_latency")); Assert.assertEquals(20D, (Double)values.get("avg_dead_watchers_cleaner_latency"), 5); Assert.assertEquals(20D, ((Long)values.get("min_dead_watchers_cleaner_latency")).doubleValue(), 5); Assert.assertEquals(20D, ((Long)values.get("max_dead_watchers_cleaner_latency")).doubleValue(), 5); Assert.assertEquals(20D, ((Long)values.get("p50_dead_watchers_cleaner_latency")).doubleValue(), 5); Assert.assertEquals(20D, ((Long)values.get("p95_dead_watchers_cleaner_latency")).doubleValue(), 5); Assert.assertEquals(20D, ((Long)values.get("p99_dead_watchers_cleaner_latency")).doubleValue(), 5); }</code><technical_language>I greaterThan matcher here</technical_language>

Target:
public void testDeadWatcherMetrics() { MyDeadWatcherListener listener = new MyDeadWatcherListener(); WatcherCleaner cleaner = new WatcherCleaner(listener, 1, 1, 1, 1); listener.setDelayMs(20); cleaner.start(); listener.setCountDownLatch(new CountDownLatch(3)); cleaner.addDeadWatcher(1); cleaner.addDeadWatcher(2); cleaner.addDeadWatcher(3); Assert.assertTrue(listener.wait(5000)); Map<String, Object> values = ServerMetrics.getAllValues(); Assert.assertThat("Adding dead watcher should be stalled twice", (Long)values.get("add_dead_watcher_stall_time"), greaterThan(0L)); Assert.assertEquals("Total dead watchers added to the queue should be 3", 3L, values.get("dead_watchers_queued")); Assert.assertEquals("Total dead watchers cleared should be 3", 3L, values.get("dead_watchers_cleared")); Assert.assertEquals(3L, values.get("cnt_dead_watchers_cleaner_latency")); Assert.assertEquals(20D, (Double)values.get("avg_dead_watchers_cleaner_latency"), 5); Assert.assertEquals(20D, ((Long)values.get("min_dead_watchers_cleaner_latency")).doubleValue(), 5); Assert.assertEquals(20D, ((Long)values.get("max_dead_watchers_cleaner_latency")).doubleValue(), 5); Assert.assertEquals(20D, ((Long)values.get("p50_dead_watchers_cleaner_latency")).doubleValue(), 5); Assert.assertEquals(20D, ((Long)values.get("p95_dead_watchers_cleaner_latency")).doubleValue(), 5); Assert.assertEquals(20D, ((Long)values.get("p99_dead_watchers_cleaner_latency")).doubleValue(), 5); }
Source:
<code>public Collection<ResourceLocation> getTextures() { ImmutableSet.Builder<ResourceLocation> builder = ImmutableSet.builder(); try { ResourceLocation loc = interior; <START> loc = new ResourceLocation(loc.getResourceDomain(), "textures/" + loc.getResourcePath() + ".png"); <END> Minecraft.getMinecraft().getResourceManager().getAllResources(loc); loc = front; loc = new ResourceLocation(loc.getResourceDomain(), "textures/" + loc.getResourcePath() + ".png"); Minecraft.getMinecraft().getResourceManager().getAllResources(loc); builder.add(interior); builder.add(front); hasTextures = true; } catch(IOException e) { hasTextures = false; } return builder.build(); }</code><technical_language>IRetexturableModel is hardcoded locations, way, for example, this model reused for IC2 cans, similar</technical_language>

Target:
public Collection<ResourceLocation> getTextures() { ImmutableSet.Builder<ResourceLocation> builder = ImmutableSet.builder(); if(baseLocation != null) builder.add(baseLocation); if(liquidLocation != null) builder.add(liquidLocation); if(coverLocation != null) builder.add(coverLocation); return builder.build(); }
Source:
<code>public void startServer(Integer timeout) throws Exception { if (server != null) { fail("Server already started"); } server = SshServer.setUpDefaultServer(); if (timeout != null) { server.getProperties().put(FactoryManager.AUTH_TIMEOUT, timeout.toString()); } <START> server.setPort(5000); <END> server.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(new File("hostkey.ser").toPath())); server.setPasswordAuthenticator((username, password, session) -> authenticator.authenticate(username, password, session)); server.setShellFactory(new EchoShellFactory()); server.start(); }</code><technical_language>do explicit port server 1st ? if 5000 is user's machine for else</technical_language>

Target:
public void startServer(Integer timeout) throws Exception { if (server != null) { fail("Server already started"); } server = SshServer.setUpDefaultServer(); if (timeout != null) { server.getProperties().put(FactoryManager.AUTH_TIMEOUT, timeout.toString()); } server.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(new File("hostkey.ser").toPath())); server.setPasswordAuthenticator((username, password, session) -> authenticator.authenticate(username, password, session)); server.setShellFactory(new EchoShellFactory()); server.start(); port = server.getPort(); }
Source:
<code>protected void setupContent(ViewGroup rootView) { mEmailInput = (WPLoginInputRow) rootView.findViewById(R.id.login_email_row); autoFillFromBuildConfig("DEBUG_DOTCOM_LOGIN_EMAIL", mEmailInput.getEditText()); mEmailInput.addTextChangedListener(this); mEmailInput.setOnEditorCommitListener(this); LinearLayout googleLoginButton = (LinearLayout) rootView.findViewById(R.id.login_google_button); googleLoginButton.setOnClickListener(new OnClickListener() { @SuppressWarnings("PrivateMemberAccessBetweenOuterAndInnerClass") @Override public void onClick(View view) { AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_BUTTON_CLICK); <START> AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_GOOGLE_TAPPED); <END> WPActivityUtils.hideKeyboard(getActivity().getCurrentFocus()); if (NetworkUtils.checkConnection(getActivity())) { mOldSitesIDs = SiteUtils.getCurrentSiteIds(mSiteStore, false); isSocialLogin = true; addGoogleFragment(); } } }); }</code><technical_language>This another redundant stat. remove LOGIN_GOOGLE_TAPPED in favor of LOGIN_SOCIAL_BUTTON_CLICK</technical_language>

Target:
protected void setupContent(ViewGroup rootView) { mEmailInput = (WPLoginInputRow) rootView.findViewById(R.id.login_email_row); autoFillFromBuildConfig("DEBUG_DOTCOM_LOGIN_EMAIL", mEmailInput.getEditText()); mEmailInput.addTextChangedListener(this); mEmailInput.setOnEditorCommitListener(this); LinearLayout googleLoginButton = (LinearLayout) rootView.findViewById(R.id.login_google_button); googleLoginButton.setOnClickListener(new OnClickListener() { @SuppressWarnings("PrivateMemberAccessBetweenOuterAndInnerClass") @Override public void onClick(View view) { AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_BUTTON_CLICK); WPActivityUtils.hideKeyboard(getActivity().getCurrentFocus()); if (NetworkUtils.checkConnection(getActivity())) { mOldSitesIDs = SiteUtils.getCurrentSiteIds(mSiteStore, false); isSocialLogin = true; addGoogleFragment(); } } }); }
Source:
<code>public void create_two_qprofiles_in_different_organizations_with_same_name_and_language() { logInAsQProfileAdministrator(); String profileName = "Profile123"; OrganizationDto organization1 = dbTester.organizations().insert(); TestRequest request1 = wsTester.newRequest() .setMediaType(MediaTypes.PROTOBUF) .setParam("organization", organization1.getKey()) .setParam("name", profileName) .setParam("language", XOO_LANGUAGE) <START> .setParam("backup_with_messages", "<xml/>"); <END> assertThat(executeRequest(request1).getProfile().getOrganization()) .isEqualTo(organization1.getKey()); OrganizationDto organization2 = dbTester.organizations().insert(); TestRequest request2 = wsTester.newRequest() .setMediaType(MediaTypes.PROTOBUF) .setParam("organization", organization2.getKey()) .setParam("name", profileName) .setParam("language", XOO_LANGUAGE) .setParam("backup_with_messages", "<xml/>"); assertThat(executeRequest(request2).getProfile().getOrganization()) .isEqualTo(organization2.getKey()); }</code><technical_language>try drop this param</technical_language>

Target:
public void create_two_qprofiles_in_different_organizations_with_same_name_and_language() { logInAsQProfileAdministrator(); String profileName = "Profile123"; OrganizationDto organization1 = dbTester.organizations().insert(); TestRequest request1 = wsTester.newRequest() .setMediaType(MediaTypes.PROTOBUF) .setParam("organization", organization1.getKey()) .setParam("name", profileName) .setParam("language", XOO_LANGUAGE); assertThat(executeRequest(request1).getProfile().getOrganization()) .isEqualTo(organization1.getKey()); OrganizationDto organization2 = dbTester.organizations().insert(); TestRequest request2 = wsTester.newRequest() .setMediaType(MediaTypes.PROTOBUF) .setParam("organization", organization2.getKey()) .setParam("name", profileName) .setParam("language", XOO_LANGUAGE); assertThat(executeRequest(request2).getProfile().getOrganization()) .isEqualTo(organization2.getKey()); }
Source:
<code>private Set<LfsPointer> findObjectsToPush() throws IOException, MissingObjectException, IncorrectObjectTypeException { Set<LfsPointer> toPush = new TreeSet<>(); for (RemoteRefUpdate up : refs) { <START> try (ObjectWalk walk = new ObjectWalk(getRepository())) { <END> walk.setRewriteParents(false); excludeAllRemoteRefs(walk); walk.markStart(walk.parseCommit(up.getNewObjectId())); for (;;) { if (walk.next() == null) { break; } } findAllLfsPointers(toPush, walk); } } return toPush; }</code><technical_language>reuse ObjectWalk</technical_language>

Target:
private Set<LfsPointer> findObjectsToPush() throws IOException, MissingObjectException, IncorrectObjectTypeException { Set<LfsPointer> toPush = new TreeSet<>(); try (ObjectWalk walk = new ObjectWalk(getRepository())) { for (RemoteRefUpdate up : refs) { walk.setRewriteParents(false); excludeRemoteRefs(walk); walk.markStart(walk.parseCommit(up.getNewObjectId())); while (walk.next() != null) { } findLfsPointers(toPush, walk); } } return toPush; }
Source:
<code>int weightToWeightFlags(long edgePointer, double weight) { if (weight < 0) throw new IllegalArgumentException("weight cannot be negative but was " + weight); int weightInt; if (weight < MIN_WEIGHT) { NodeAccess nodeAccess = getNodeAccess(); int edgeId = -1; LOGGER.warn("Setting weights smaller than " + MIN_WEIGHT + " is not allowed in CHGraphImpl#setWeight. " + "You passed: " + weight + " for the edge " + edgeId + " nodeA " + nodeAccess.getLat(getNodeA(edgePointer)) + "," + nodeAccess.getLon(getNodeA(edgePointer)) + " nodeB " + nodeAccess.getLat(getNodeB(edgePointer)) + "," + nodeAccess.getLon(getNodeB(edgePointer))); weight = MIN_WEIGHT; } if (weight > MAX_WEIGHT) weightInt = MAX_WEIGHT_31; else <START> weightInt = Math.round((float) (weight * WEIGHT_FACTOR)) << 2; <END> return weightInt; }</code><technical_language>In terms of precision do (int)Math.round(x)? (If not, need do this in EncodedValue classes here) (doubles a bit faster floats some modern processors)</technical_language>

Target:
int weightToWeightFlags(long edgePointer, double weight) { if (weight < 0) throw new IllegalArgumentException("weight cannot be negative but was " + weight); int weightInt; if (weight < MIN_WEIGHT) { NodeAccess nodeAccess = getNodeAccess(); int edgeId = -1; LOGGER.warn("Setting weights smaller than " + MIN_WEIGHT + " is not allowed in CHGraphImpl#setWeight. " + "You passed: " + weight + " for the edge " + edgeId + " nodeA " + nodeAccess.getLat(getNodeA(edgePointer)) + "," + nodeAccess.getLon(getNodeA(edgePointer)) + " nodeB " + nodeAccess.getLat(getNodeB(edgePointer)) + "," + nodeAccess.getLon(getNodeB(edgePointer))); weight = MIN_WEIGHT; } if (weight > MAX_WEIGHT) weightInt = MAX_WEIGHT_31; else weightInt = ((int) Math.round(weight * WEIGHT_FACTOR)) << 2; return weightInt; }
Source:
<code>public ServiceBuilder<CacheContainer> build(ServiceTarget target) { Function<EmbeddedCacheManager, CacheContainer> mapper = manager -> new DefaultCacheContainer(this.name, manager, this.defaultCache, this.batcherFactory); Supplier<EmbeddedCacheManager> supplier = () -> { GlobalConfiguration config = this.configuration.getValue(); EmbeddedCacheManager manager = new DefaultCacheManager(config, null, false); manager.addListener(this); manager.start(); InfinispanLogger.ROOT_LOGGER.debugf("%s cache container started", this.name); return manager; }; Consumer<EmbeddedCacheManager> destroyer = manager -> { manager.stop(); manager.removeListener(this); InfinispanLogger.ROOT_LOGGER.debugf("%s cache container stopped", this.name); }; Service<CacheContainer> service = new SuppliedValueService<>(mapper, supplier, destroyer); <START> List<ServiceName> list = new ArrayList<>(); <END> for (ServiceName alias : this.aliases) { list.add(alias); } ServiceBuilder<CacheContainer> builder = target.addService(this.getServiceName(), service) .addAliases(list.toArray(new ServiceName[0])) ; return this.configuration.register(builder); }</code><technical_language>Unnecessary intermediate list</technical_language>

Target:
public ServiceBuilder<CacheContainer> build(ServiceTarget target) { Function<EmbeddedCacheManager, CacheContainer> mapper = manager -> new DefaultCacheContainer(this.name, manager, this.defaultCache, this.batcherFactory); Supplier<EmbeddedCacheManager> supplier = () -> { GlobalConfiguration config = this.configuration.getValue(); EmbeddedCacheManager manager = new DefaultCacheManager(config, null, false); manager.addListener(this); manager.start(); InfinispanLogger.ROOT_LOGGER.debugf("%s cache container started", this.name); return manager; }; Consumer<EmbeddedCacheManager> destroyer = manager -> { manager.stop(); manager.removeListener(this); InfinispanLogger.ROOT_LOGGER.debugf("%s cache container stopped", this.name); }; Service<CacheContainer> service = new SuppliedValueService<>(mapper, supplier, destroyer); ServiceBuilder<CacheContainer> builder = target.addService(this.getServiceName(), service) .addAliases(aliases.toArray(NO_SERVICE_NAMES)); return this.configuration.register(builder); }
Source:
<code>public boolean keyPressed(KeyEvent event) { switch (event.keyCode) { case SWT.ARROW_DOWN: getViewer().scrollByOffset(0, <START> 400); <END> return true; case SWT.ARROW_UP: getViewer().scrollByOffset(0, -400); return true; case SWT.ARROW_RIGHT: getViewer().scrollByOffset(400, 0); return true; case SWT.ARROW_LEFT: getViewer().scrollByOffset(-400, 0); return true; case SWT.PAGE_DOWN: if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { getViewer().scrollByOffset(0, getViewer().getFigureCanvasSize().y); } else { getViewer().scrollByOffset(getViewer().getFigureCanvasSize().x, 0); } return true; case SWT.PAGE_UP: if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { getViewer().scrollByOffset(0, -getViewer().getFigureCanvasSize().y); } else { getViewer().scrollByOffset(-getViewer().getFigureCanvasSize().x, 0); } return true; default: return super.keyPressed(event); } }</code><technical_language>this a constant? resolution depended a percentage of canvas size</technical_language>

Target:
public boolean keyPressed(KeyEvent event) { switch (event.keyCode) { case SWT.ARROW_DOWN: getViewer().scrollByOffset(0, SCROLL_SPEED); return true; case SWT.ARROW_UP: getViewer().scrollByOffset(0, -SCROLL_SPEED); return true; case SWT.ARROW_RIGHT: getViewer().scrollByOffset(SCROLL_SPEED, 0); return true; case SWT.ARROW_LEFT: getViewer().scrollByOffset(-SCROLL_SPEED, 0); return true; case SWT.PAGE_DOWN: if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { getViewer().scrollByOffset(0, getViewer().getFigureCanvasSize().y); } else { getViewer().scrollByOffset(getViewer().getFigureCanvasSize().x, 0); } return true; case SWT.PAGE_UP: if ((event.stateMask & SWT.MODIFIER_MASK) == 0) { getViewer().scrollByOffset(0, -getViewer().getFigureCanvasSize().y); } else { getViewer().scrollByOffset(-getViewer().getFigureCanvasSize().x, 0); } return true; default: return super.keyPressed(event); } }
Source:
<code>public List<CommentOutputView> getCommentsCreatedOn(LocalDate fromDate, LocalDate toDate) { return hibernateTemplate.execute(session -> { Query query = session.createQuery("FROM Comment " + "WHERE created >= :fromDate AND created <= :toDate "); query.setParameter("fromDate", java.sql.Date.valueOf(fromDate)); query.setParameter("toDate", java.sql.Date.valueOf(toDate)); List<Comment> comments = query.list(); <START> CommentOutputView.Factory viewFactory = new CommentOutputView.Factory(runtimeConfiguration); <END> return comments.stream().map(viewFactory::buildView).collect(Collectors.toList()); }); }</code><technical_language>This new factory class a global bean other view factories, constructed here</technical_language>

Target:
public List<CommentNodeView> getCommentsCreatedOn(LocalDate fromDate, LocalDate toDate) { return hibernateTemplate.execute(session -> { Query query = session.createQuery("FROM Comment " + "WHERE created >= :fromDate AND created <= :toDate "); query.setParameter("fromDate", java.sql.Date.valueOf(fromDate)); query.setParameter("toDate", java.sql.Date.valueOf(toDate)); List<Comment> comments = query.list(); return comments.stream().map(commentNodeViewFactory::create).collect(Collectors.toList()); }); }
Source:
<code>public void getFailedLRAs(Map<URI, Transaction> lras) { InputObjectState aa_uids = new InputObjectState(); try { if (getUids(aa_uids)) { boolean moreUids = true; while (moreUids) { try { Uid uid = UidHelper.unpackFrom(aa_uids); if (uid.equals(Uid.nullUid())) { moreUids = false; } else { Transaction lra = new Transaction(lraService, new Uid(uid)); lra.activate(); lras.put(lra.getId(), lra); } } catch (Exception ex) { <START> moreUids = false; <END> } } } } catch (ObjectStoreException e) { if (LRALogger.logger.isInfoEnabled()) { LRALogger.logger.infof("LRARecoverModule: Object store exception: %s", e.getMessage()); } } }</code><technical_language>log exception reason stacktrace TRACE log level, please</technical_language>

Target:
public void getFailedLRAs(Map<URI, Transaction> lras) { InputObjectState aa_uids = new InputObjectState(); Consumer<Uid> failedLRACreator = uid -> { Transaction lra = new Transaction(lraService, new Uid(uid)); lra.activate(); lras.put(lra.getId(), lra); }; if (getUids(aa_uids)) { forEach(aa_uids, failedLRACreator); } }
Source:
<code>private CompletionStage<Collection<ClusterListenerReplicateCallable<Object, Object>>> getClusterListeners( int topologyId, List<Address> sources) { if (sources.isEmpty()) { if (trace) log.trace("Unable to acquire cluster listeners from other members, assuming none are present"); return CompletableFuture.completedFuture(Collections.emptySet()); } Address source = sources.get(0); if (sources.get(0).equals(rpcManager.getAddress())) { return getClusterListeners(topologyId, sources.subList(1, sources.size())); } if (trace) log.tracef("Requesting cluster listeners of cache %s from node %s", cacheName, sources); <START> TopologyAffectedCommand cmd = commandsFactory.buildStateTransferGetListenersCommand(topologyId); <END> CompletionStage<ValidResponse> remoteStage = rpcManager.invokeCommand(source, cmd, SingleResponseCollector.validOnly(), rpcOptions); return handleAndCompose(remoteStage, (response, throwable) -> { if (throwable != null) { log.exceptionDuringClusterListenerRetrieval(source, throwable); } if (response instanceof SuccessfulResponse) { return CompletableFuture.completedFuture( (Collection<ClusterListenerReplicateCallable<Object, Object>>) response.getResponseValue()); } else { log.unsuccessfulResponseForClusterListeners(source, response); return getClusterListeners(topologyId, sources.subList(1, sources.size())); } }); }</code><technical_language>TopologyAffectedCommand? CacheRpcCommand</technical_language>

Target:
private CompletionStage<Collection<ClusterListenerReplicateCallable<Object, Object>>> getClusterListeners( int topologyId, List<Address> sources) { if (sources.isEmpty()) { if (trace) log.trace("Unable to acquire cluster listeners from other members, assuming none are present"); return CompletableFuture.completedFuture(Collections.emptySet()); } Address source = sources.get(0); if (sources.get(0).equals(rpcManager.getAddress())) { return getClusterListeners(topologyId, sources.subList(1, sources.size())); } if (trace) log.tracef("Requesting cluster listeners of cache %s from node %s", cacheName, sources); CacheRpcCommand cmd = commandsFactory.buildStateTransferGetListenersCommand(topologyId); CompletionStage<ValidResponse> remoteStage = rpcManager.invokeCommand(source, cmd, SingleResponseCollector.validOnly(), rpcOptions); return handleAndCompose(remoteStage, (response, throwable) -> { if (throwable != null) { log.exceptionDuringClusterListenerRetrieval(source, throwable); } if (response instanceof SuccessfulResponse) { return CompletableFuture.completedFuture( (Collection<ClusterListenerReplicateCallable<Object, Object>>) response.getResponseValue()); } else { log.unsuccessfulResponseForClusterListeners(source, response); return getClusterListeners(topologyId, sources.subList(1, sources.size())); } }); }
Source:
<code>private String genUnique() { long timePart = (System.currentTimeMillis() << 5) | (msCounter++ & 31); long ipPart = 0; try { byte[] address = InetAddress.getLocalHost().getAddress(); for (byte <START> addres : <END> address) ipPart = ((ipPart << 8) | (addres & 0xff)); } catch (UnknownHostException e) { } int port = 0; try { socket = new ServerSocket(0, 1, InetAddress.getByName("127.0.0.1")); port = socket.getLocalPort(); } catch (IOException e) { try { if (socket != null) socket.close(); } catch (IOException e1) { } port = new Random().nextInt() & 0xffff; } long aPart = (ipPart << 16) | (port & 0xffff); return Long.toHexString(timePart) + "_" + Long.toHexString(aPart); }</code><technical_language>rename addr</technical_language>

Target:
private String genUnique() { long timePart = (System.currentTimeMillis() << 5) | (msCounter++ & 31); long ipPart = 0; try { for (byte addr : InetAddress.getLocalHost().getAddress()) ipPart = ((ipPart << 8) | (addr & 0xff)); } catch (UnknownHostException e) { } int port = 0; try { socket = new ServerSocket(0, 1, InetAddress.getByName("127.0.0.1")); port = socket.getLocalPort(); } catch (IOException e) { try { if (socket != null) socket.close(); } catch (IOException e1) { } port = new Random().nextInt() & 0xffff; } long aPart = (ipPart << 16) | (port & 0xffff); return Long.toHexString(timePart) + "_" + Long.toHexString(aPart); }
Source:
<code>private List<Content> getContentForExplicitEquivFromRequest(HttpServletRequest req) throws InvalidApiKeyException { Application application = getAndValidateApplication(req); List<String> uris = parseList(req.getParameter(URIS)); List<String> ids = parseList(req.getParameter(IDS)); if (uris.size() + ids.size() != 2) { <START> throw new IllegalArgumentException("Must specify exactly two " + URIS + " or " + IDS); <END> } List<Content> contents = resolveContent(uris, ids); if (contents.size() != 2 || contents.get(0).equals(contents.get(1))) { throw new IllegalArgumentException("Must specify exactly two distinct pieces of content"); } for (Content content : contents) { validateApplicationForExplicitEquiv(content.getPublisher(), application); } return contents; }</code><technical_language>clearer sum two, this reads 2 uris 2 IDs</technical_language>

Target:
private List<Content> getContentForExplicitEquivFromRequest(HttpServletRequest req) throws InvalidApiKeyException { Application application = getAndValidateApplication(req); List<String> uris = parseList(req.getParameter(URIS)); List<String> ids = parseList(req.getParameter(IDS)); if (uris.size() + ids.size() != 2) { throw new IllegalArgumentException("Must specify exactly a distinct sum of two of " + URIS + " or " + IDS); } List<Content> contents = resolveContent(uris, ids); if (contents.size() != 2 || contents.get(0).equals(contents.get(1))) { throw new IllegalArgumentException("Must specify exactly a distinct sum of two of " + URIS + " or " + IDS); } for (Content content : contents) { validateApplicationForExplicitEquiv(content.getPublisher(), application); } return contents; }
Source:
<code>private void buildComputeEngineObject() throws IOException, GeneralSecurityException { try { if (log.isDebugEnabled()) { log.debug("Authorizing and building the compute engine object"); } HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); GoogleCredential credential = new GoogleCredential.Builder().setTransport(httpTransport) .setJsonFactory(jsonFactory) .setServiceAccountId(ACCOUNT_ID) .setServiceAccountScopes(Collections.singleton(ComputeScopes.COMPUTE)) .setServiceAccountPrivateKeyFromP12File(new File(KEY_FILE_PATH)) .build(); compute = new Compute.Builder( httpTransport, jsonFactory, null).setApplicationName(PROJECT_NAME) .setHttpRequestInitializer(credential).build(); if (log.isDebugEnabled()) { log.debug("Successfully built the compute engine object"); } } catch (GeneralSecurityException e) { log.error("Could not authenticate and build compute object"); throw new GeneralSecurityException(e); } catch (IOException e) { <START> log.error("Could not authenticate and build compute object"); <END> throw new IOException(e); } }</code><technical_language>Please log.error(message,e) log exception messages</technical_language>

Target:
private void buildComputeEngineObject() throws IOException, GeneralSecurityException { try { if (log.isDebugEnabled()) { log.debug("Authorizing and building the compute engine object"); } HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); GoogleCredential credential = new GoogleCredential.Builder().setTransport(httpTransport) .setJsonFactory(jsonFactory) .setServiceAccountId(ACCOUNT_ID) .setServiceAccountScopes(Collections.singleton(ComputeScopes.COMPUTE)) .setServiceAccountPrivateKeyFromP12File(new File(KEY_FILE_PATH)) .build(); compute = new Compute.Builder( httpTransport, jsonFactory, null).setApplicationName(PROJECT_NAME) .setHttpRequestInitializer(credential).build(); if (log.isDebugEnabled()) { log.debug("Successfully built the compute engine object"); } } catch (GeneralSecurityException e) { log.error("Could not authenticate and build compute object", e); throw new GeneralSecurityException(e); } catch (IOException e) { log.error("Could not authenticate and build compute object", e); throw new IOException(e); } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_traffic_plugin); mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(MapboxMap mapboxMap) { <START> TrafficPluginActivity.this.map = mapboxMap; <END> TrafficPluginActivity.this.trafficPlugin = new TrafficPlugin(mapView, mapboxMap); TrafficPluginActivity.this.trafficPlugin.toggle(); } }); FloatingActionButton trafficToggleButton = (FloatingActionButton) findViewById(R.id.traffic_toggle_fab); trafficToggleButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (map != null) { trafficPlugin.toggle(); } } }); }</code><technical_language>need clarify variable location a name local mapboxMap, TrafficPluginActivity.this.map map = mapboxMap;</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_traffic_plugin); mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(MapboxMap mapboxMap) { map = mapboxMap; trafficPlugin = new TrafficPlugin(mapView, mapboxMap); TrafficPluginActivity.this.trafficPlugin.toggle(); } }); findViewById(R.id.traffic_toggle_fab).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (map != null) { trafficPlugin.toggle(); } } }); }
Source:
<code>public void validateWhatsNewItems(List<WhatsNewItemModel> whatsNewItems) { for (WhatsNewItemModel item : whatsNewItems) { <START> assertThat(item).isNotNull(); <END> assertThat(item.getTitle()).isNotEmpty(); assertThat(item.getMessage()).isNotEmpty(); assertThat(item.getImage()).isNotEmpty(); if (item.isAndroidMessage()) { assertThat(item.getImage().matches(IMAGE_NAME_REGEX)).isTrue(); @DrawableRes final int imageRes = UiUtil.getDrawable(RuntimeEnvironment.application, item.getImage()); assertThat(imageRes).isNotEqualTo(0); } final List<String> platforms = item.getPlatforms(); assertThat(platforms).isNotEmpty(); for (String platform : platforms) { assertThat(platform.toLowerCase()).isIn(WhatsNewItemModel.PLATFORM_ANDROID, WhatsNewItemModel.PLATFORM_IOS); } } }</code><technical_language>a good idea WhatsNewItemModel check validity? A valid WhatsNewItemModel item returned if provided data is valid</technical_language>

Target:
public void validateWhatsNewItems(List<WhatsNewItemModel> whatsNewItems) { for (WhatsNewItemModel item : whatsNewItems) { assertThat(item).isNotNull(); assertThat(item.getTitle()).isNotEmpty(); assertThat(item.getMessage()).isNotEmpty(); assertThat(item.getImage()).isNotEmpty(); if (item.isAndroidMessage()) { assertThat(item.getImage().matches(IMAGE_NAME_REGEX)).isTrue(); } final List<String> platforms = item.getPlatforms(); assertThat(platforms).isNotEmpty(); for (String platform : platforms) { assertThat(WhatsNewItemModel.Platform.isSupportedPlatform(platform)).isTrue(); } } }
Source:
<code>public void onRemoved(Iterable<CacheEntryEvent<? extends K, ? extends V>> events) throws CacheEntryListenerException { <START> for (Object event1 : events) { <END> CacheEntryEvent event = (CacheEntryEvent) event1; Assert.assertEquals(EventType.REMOVED, event.getEventType()); this.removed.incrementAndGet(); event.getKey(); if (event.isOldValueAvailable()) { event.getOldValue(); } } }</code><technical_language>cast</technical_language>

Target:
public void onRemoved(Iterable<CacheEntryEvent<? extends K, ? extends V>> events) throws CacheEntryListenerException { for (CacheEntryEvent<? extends K, ? extends V> event : events) { Assert.assertEquals(EventType.REMOVED, event.getEventType()); this.removed.incrementAndGet(); if (event.isOldValueAvailable()) { event.getOldValue(); } } }
Source:
<code>protected void handleSpecificCommandActions() { <START> return; <END> }</code><technical_language>needed, please leave method empty</technical_language>

Target:
protected void handleSpecificCommandActions() { }
Source:
<code>private Actuate(String name) { <START> this.name = name; <END> }</code><technical_language>Modifier 'private' is redundant for Enum constructor - needs removed</technical_language>

Target:
Actuate(String name) { this.name = name; }
Source:
<code>private void reportEndHostLog(ILogSaver saver) { LogRegistry registry = (LogRegistry) LogRegistry.getLogRegistry(); try (InputStreamSource source = registry.getLogger().getLog(); InputStream stream = source.createInputStream()) { saver.saveLogData(TestInvocation.TRADEFED_END_HOST_LOG, LogDataType.TEXT, stream); if (SystemUtil.isRemoteEnvironment()) { System.out.println("===== Result Reporters ====="); <START> System.out.println(StreamUtil.getStringFromStream(stream)); <END> } } catch (IOException e) { CLog.e(e); } }</code><technical_language>System.out.println("===== Result Reporters Start ====="); ... System.out.println("===== Result Reporters End ====="); Do want block output avoid mixing of local remote messages</technical_language>

Target:
private void reportEndHostLog(ILogSaver saver) { LogRegistry registry = (LogRegistry) LogRegistry.getLogRegistry(); try (InputStreamSource source = registry.getLogger().getLog()) { if (source == null) { CLog.e("%s stream was null, skip saving it.", TestInvocation.TRADEFED_END_HOST_LOG); return; } try (InputStream stream = source.createInputStream()) { saver.saveLogData(TestInvocation.TRADEFED_END_HOST_LOG, LogDataType.TEXT, stream); if (SystemUtil.isRemoteEnvironment()) { System.out.println( String.format( "===== Result Reporters =====\n%s", StreamUtil.getStringFromStream(stream))); } } } catch (IOException e) { CLog.e(e); } }
Source:
<code><START> public String toString() { <END> return "PvaluefromZscorePostAggregator{" + "name'" + name + '\'' + ", field=" + field + "}"; }</code><technical_language>Consider overriding equals hashCode well</technical_language>

Target:
public String toString() { return "PvaluefromZscorePostAggregator{" + "name='" + name + '\'' + ", zScore=" + zScore + '}'; }
Source:
<code>public Object[] getElements(Object inputElement) { <START> ArrayList<IConnectionProvider> providers = new ArrayList<IConnectionProvider>(); <END> HashMap<String, ConnectionProviderUI> map = UIExtensionManager.getConnectionUIElements(); Set<String> keys = map.keySet(); Iterator<String> i = keys.iterator(); while (i.hasNext()) { String id = i.next(); if (ExtensionManager.getProvider(id) != null && ExtensionManager.getProvider(id).canCreate()) providers.add(ExtensionManager.getProvider(id)); } return providers.toArray(new IConnectionProvider[providers.size()]); }</code><technical_language>Optional: written in more compact List<IConnectionProvider> providers = new ArrayList<>();</technical_language>

Target:
public Object[] getElements(Object inputElement) { List<IConnectionProvider> providers = new ArrayList<>(); Map<String, ConnectionProviderUI> map = UIExtensionManager.getConnectionUIElements(); Set<String> keys = map.keySet(); Iterator<String> i = keys.iterator(); while (i.hasNext()) { String id = i.next(); if (ExtensionManager.getProvider(id) != null && ExtensionManager.getProvider(id).canCreate()) providers.add(ExtensionManager.getProvider(id)); } return providers.toArray(new IConnectionProvider[providers.size()]); }
Source:
<code>public List<MLModelField> getModelOutputFields(MLModelInfo modelInfo) throws IOException, SAXException, JAXBException { <START> final List<MLModelField> fieldNames = doGetOutputFieldsForPMMLStream(modelInfo.getPmml()); <END> return fieldNames; }</code><technical_language>inline this: return doGetInputFieldsForPMMLStream(modelInfo.getPmml());</technical_language>

Target:
public List<MLModelField> getModelOutputFields(MLModelInfo modelInfo) throws IOException, SAXException, JAXBException { return doGetOutputFieldsForPMMLStream(modelInfo.getPmml()); }
Source:
<code>static boolean isColumnDelete(Cell cell) { return cell.getTypeByte() == KeyValue.Type.DeleteColumn.getCode() <START> || cell.getTypeByte() == KeyValue.Type.Delete.getCode(); <END> }</code><technical_language>Delete implies a single version deleted DeleteColumn implies versions (less a timestamp) deleted. changing meaning in adapter</technical_language>

Target:
static boolean isColumnDelete(Cell cell) { return cell.getTypeByte() == KeyValue.Type.DeleteColumn.getCode(); }
Source:
<code>private String decodeAlarm(int value) { switch (value) { case 1: return Position.ALARM_SOS; case 2: <START> return null; <END> case 3: return Position.ALARM_GEOFENCE; case 4: return Position.ALARM_POWER_CUT; case 5: return null; case 6: return null; default: return null; } }</code><technical_language>Remove "null" cases. is a default case for that</technical_language>

Target:
private String decodeAlarm(int value) { switch (value) { case 1: return Position.ALARM_SOS; case 3: return Position.ALARM_GEOFENCE; case 4: return Position.ALARM_POWER_CUT; default: return null; } }
Source:
<code>private void refineType(AbstractTypedTree expression, JavaType expressionType, JavaType capturedReturnType, JavaType refinedReturnType) { <START> if (refinedReturnType != capturedReturnType && expressionType.isParameterized()) { <END> TypeSubstitution typeSubstitution = ((ParametrizedTypeJavaType) expressionType).typeSubstitution; for (Map.Entry<TypeVariableJavaType, JavaType> entry : typeSubstitution.substitutionEntries()) { if (entry.getValue() == capturedReturnType) { TypeSubstitution refinedSubstitution = new TypeSubstitution(typeSubstitution).add(entry.getKey(), refinedReturnType); JavaType refinedType = parametrizedTypeCache.getParametrizedTypeType(expressionType.symbol, refinedSubstitution); expression.setType(refinedType); break; } } } }</code><technical_language>Statement nesting avoided inverting this if returning early method</technical_language>

Target:
private void refineType(AbstractTypedTree expression, JavaType expressionType, JavaType capturedReturnType, JavaType refinedReturnType) { if (refinedReturnType != capturedReturnType && expressionType.isParameterized()) { TypeSubstitution typeSubstitution = ((ParametrizedTypeJavaType) expressionType).typeSubstitution; typeSubstitution.substitutionEntries().stream() .filter(e -> e.getValue() == capturedReturnType) .findFirst() .ifPresent(e -> { TypeSubstitution refinedSubstitution = new TypeSubstitution(typeSubstitution).add(e.getKey(), refinedReturnType); JavaType refinedType = parametrizedTypeCache.getParametrizedTypeType(expressionType.symbol, refinedSubstitution); expression.setType(refinedType); }); } }
Source:
<code>public HTNode getNodeAt(int pos) { List<HTNode> latest = getLatestBranch(); if (pos >= latest.size()) { <START> throw new IndexOutOfBoundsException(); <END> } return NonNullUtils.checkNotNull(latest.get(pos)); }</code><technical_language>get() throw exception, happen naturally ;)</technical_language>

Target:
public HTNode getNodeAt(int pos) { List<HTNode> latest = getLatestBranch(); return NonNullUtils.checkNotNull(latest.get(pos)); }