auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean shouldMoveTo(World world, BlockPos pos) { Block block = world.getBlockState(pos).getBlock(); if (block instanceof BlockApiculture && TileUtil.getTile(world, pos) instanceof TileBeeHouse) { TileBeeHouse beeHouse = (TileBeeHouse) TileUtil.getTile(world, pos); InventoryBeeHousing inventory = (InventoryBeeHousing) beeHouse.getBeeInventory(); if (inventory.isEmpty()) { return false; } if (!inventory.getStackInSlot(SLOT_QUEEN).isEmpty()) { EnumBeeType type = ((ItemBeeGE) inventory.getStackInSlot(SLOT_QUEEN).getItem()).getType(); if (type == EnumBeeType.QUEEN) { return false; } if (type == EnumBeeType.PRINCESS && !inventory.getStackInSlot(SLOT_DRONE).isEmpty() && !hasDrone) { return false; } } boolean foundPrincess = hasPrincess; boolean foundDrone = hasDrone; if (foundDrone && foundPrincess) { return true; } for (ItemStack stack : InventoryUtil.getStacks(inventory, SLOT_PRODUCT_1, SLOT_PRODUCT_COUNT)) { <START> if (stack != ItemStack.EMPTY && stack.getItem() instanceof ItemBeeGE) { <END> EnumBeeType type = ((ItemBeeGE) stack.getItem()).getType(); if (type == EnumBeeType.PRINCESS) { foundPrincess = true; } if (type == EnumBeeType.DRONE) { foundDrone = true; } if (foundDrone && foundPrincess) { return true; } } } return false; } return false; }</code><technical_language>!stack.isEmpty() here</technical_language>

Target:
protected boolean shouldMoveTo(World world, BlockPos pos) { pos = pos.north().up(); Block block = world.getBlockState(pos).getBlock(); if (block instanceof BlockApiculture && TileUtil.getTile(world, pos) instanceof TileBeeHouse) { TileBeeHouse beeHouse = (TileBeeHouse) TileUtil.getTile(world, pos); InventoryBeeHousing inventory = (InventoryBeeHousing) beeHouse.getBeeInventory(); if (inventory.isEmpty()) { return false; } if (!inventory.getStackInSlot(SLOT_QUEEN).isEmpty()) { EnumBeeType type = ((ItemBeeGE) inventory.getStackInSlot(SLOT_QUEEN).getItem()).getType(); if (type == EnumBeeType.QUEEN) { return false; } if (type == EnumBeeType.PRINCESS && !inventory.getStackInSlot(SLOT_DRONE).isEmpty() && !hasDrone) { return false; } } boolean foundPrincess = hasPrincess; boolean foundDrone = hasDrone; if (foundDrone && foundPrincess) { return true; } for (ItemStack stack : InventoryUtil.getStacks(inventory, SLOT_PRODUCT_1, SLOT_PRODUCT_COUNT)) { if (!stack.isEmpty() && stack.getItem() instanceof ItemBeeGE) { EnumBeeType type = ((ItemBeeGE) stack.getItem()).getType(); if (type == EnumBeeType.PRINCESS) { foundPrincess = true; } if (type == EnumBeeType.DRONE) { foundDrone = true; } if (foundDrone && foundPrincess) { return true; } } } return false; } return false; }
Source:
<code>public void getBiome(BlockPos pos, CallbackInfoReturnable<Biome> cir) { ICubicWorld cworld = (ICubicWorld) world; if(!cworld.isCubicWorld()) return; cir.cancel(); int x = (pos.getX() >> 4) - this.chunkX; <START> int z = (pos.getZ() >> 4) - this.chunkZ; <END> if (!withinBounds(x, z)) { cir.setReturnValue(Biomes.PLAINS); return; } ICube cube = ((IColumn)this.chunkArray[x][z]).getCube(Coords.blockToCube(pos.getY())); cir.setReturnValue(cube.getBiome(pos, this.world.getBiomeProvider())); }</code><technical_language>Coords</technical_language>

Target:
public void getBiome(BlockPos pos, CallbackInfoReturnable<Biome> cir) { ICubicWorld cworld = (ICubicWorld) world; if(!cworld.isCubicWorld()) return; cir.cancel(); int chunkX = Coords.blockToCube(pos.getX()) - this.chunkX; int chunkZ = Coords.blockToCube(pos.getZ()) - this.chunkZ; if (!withinBounds(chunkX, chunkZ)) { cir.setReturnValue(Biomes.PLAINS); return; } ICube cube = ((IColumn)this.chunkArray[chunkX][chunkZ]).getCube(Coords.blockToCube(pos.getY())); cir.setReturnValue(cube.getBiome(pos)); }
Source:
<code>private Optional<NodeDocument> getNodeInfo(Integer nodeId) { OnmsNode onmsNode = null; try (Timer.Context ctx = nodeLoadTimer.time()) { onmsNode = nodeDao.get(nodeId); } <START> <END> if (onmsNode != null) { final NodeDocument nodeDocument = new NodeDocument(); nodeDocument.setForeignSource(onmsNode.getForeignSource()); nodeDocument.setForeignId(onmsNode.getForeignId()); nodeDocument.setNodeId(onmsNode.getId()); nodeDocument.setCategories(onmsNode.getCategories().stream().map(OnmsCategory::getName).collect(Collectors.toList())); return Optional.of(nodeDocument); } return Optional.empty(); }</code><technical_language>need this logic. perform check interfaceToNodeCache lookup, store results in a separate cache (keyed contextKey)</technical_language>

Target:
private Optional<NodeDocument> getNodeInfo(Integer nodeId) { OnmsNode onmsNode = null; try (Timer.Context ctx = nodeLoadTimer.time()) { onmsNode = nodeDao.get(nodeId); } return mapOnmsNodeToNodeDocument(onmsNode); }
Source:
<code>protected void configureSystemProperties( String solutionRootPath, String root ) { fillMissedSystemProperty( "karaf.home", root ); fillMissedSystemProperty( "karaf.base", root ); fillMissedSystemProperty( "karaf.history", root + "/data/history.txt" ); fillMissedSystemProperty( "karaf.instances", root + "/instances" ); fillMissedSystemProperty( "karaf.startLocalConsole", "false" ); fillMissedSystemProperty( "karaf.startRemoteShell", "true" ); fillMissedSystemProperty( "karaf.lock", "false" ); fillMissedSystemProperty( "karaf.etc", root + "/etc" ); <START> final String karafLogsPath = getCustomPropertyValue( root, PENTAHO_KARAF_LOGS, solutionRootPath + "/logs" ); <END> fillMissedSystemProperty( PENTAHO_KARAF_LOGS, karafLogsPath ); KettleClientEnvironment.ClientType clientType = getClientType(); String extraKettleEtc = translateToExtraKettleEtc( clientType ); if ( extraKettleEtc != null && new File( root + extraKettleEtc ).exists() ) { System.setProperty( "felix.fileinstall.dir", root + "/etc" + "," + root + extraKettleEtc ); } else { System.setProperty( "felix.fileinstall.dir", root + "/etc" ); } System.setProperty( "embedded.karaf.mode", "true" ); File file = new File( solutionRootPath + "/system/osgi/log4j.xml" ); if ( file.exists() ) { System.setProperty( "log4j.configuration", file.toURI().toString() ); } else { logger.warn( file.toURI().toString() + " file not exist" ); } }</code><technical_language>Extra space + "/logs"</technical_language>

Target:
protected void configureSystemProperties( String solutionRootPath, String root ) { fillMissedSystemProperty( "karaf.home", root ); fillMissedSystemProperty( "karaf.base", root ); fillMissedSystemProperty( "karaf.history", root + "/data/history.txt" ); fillMissedSystemProperty( "karaf.instances", root + "/instances" ); fillMissedSystemProperty( "karaf.startLocalConsole", "false" ); fillMissedSystemProperty( "karaf.startRemoteShell", "true" ); fillMissedSystemProperty( "karaf.lock", "false" ); fillMissedSystemProperty( "karaf.etc", root + "/etc" ); final String karafLogsPath = this.karafCustomProperties.getProperty( KARAF_LOGS_PATH, solutionRootPath + "/logs" ); fillMissedSystemProperty( KARAF_LOGS_PATH, karafLogsPath ); KettleClientEnvironment.ClientType clientType = getClientType(); String extraKettleEtc = translateToExtraKettleEtc( clientType ); if ( extraKettleEtc != null && new File( root + extraKettleEtc ).exists() ) { System.setProperty( "felix.fileinstall.dir", root + "/etc" + "," + root + extraKettleEtc ); } else { System.setProperty( "felix.fileinstall.dir", root + "/etc" ); } System.setProperty( "embedded.karaf.mode", "true" ); File file = new File( solutionRootPath + "/system/osgi/log4j.xml" ); if ( file.exists() ) { System.setProperty( "log4j.configuration", file.toURI().toString() ); } else { logger.warn( file.toURI().toString() + " file not exist" ); } }
Source:
<code><START> private boolean spongeImpl$throwEventForChangingBlockDuringUpdate(final net.minecraft.world.World world, final BlockPos pos, final BlockState blockState) { <END> return this.spongeImpl$strikeBlockAndAddSnapshot(world, pos, blockState); }</code><technical_language>Fix prefix impl</technical_language>

Target:
private boolean impl$throwEventForChangingBlockDuringUpdate(final net.minecraft.world.World world, final BlockPos pos, final BlockState blockState) { return this.impl$strikeBlockAndAddSnapshot(world, pos, blockState); }
Source:
<code>private TableDescriptor cleanupTempTableOnCommitOrRollback(TableDescriptor td, boolean dropAndRedeclare) throws StandardException{ getDataDictionary().startWriting(this); TransactionController tc=getTransactionExecute(); long conglomId= tc.createConglomerate(td.getTableType() == TableDescriptor.EXTERNAL_TYPE, "heap", td.getEmptyExecRow().getRowArray(), null, td.getColumnCollationIds(), null, (TransactionController.IS_TEMPORARY| <START> TransactionController.IS_KEPT), 0); <END> long cid=td.getHeapConglomerateId(); ConglomerateDescriptor cgd=td.getConglomerateDescriptor(cid); td.getConglomerateDescriptorList().dropConglomerateDescriptorByUUID( cgd.getUUID()); cgd=getDataDictionary().getDataDescriptorGenerator().newConglomerateDescriptor(conglomId,null,false,null,false,null,td.getUUID(), td.getSchemaDescriptor().getUUID()); ConglomerateDescriptorList conglomList= td.getConglomerateDescriptorList(); conglomList.add(cgd); td.resetHeapConglomNumber(); if(dropAndRedeclare){ tc.dropConglomerate(cid); replaceDeclaredGlobalTempTable(td.getName(),td); } return (td); }</code><technical_language>a constant</technical_language>

Target:
private TableDescriptor cleanupTempTableOnCommitOrRollback(TableDescriptor td, boolean dropAndRedeclare) throws StandardException{ getDataDictionary().startWriting(this); TransactionController tc=getTransactionExecute(); long conglomId= tc.createConglomerate(td.getTableType() == TableDescriptor.EXTERNAL_TYPE, "heap", td.getEmptyExecRow().getRowArray(), null, td.getColumnCollationIds(), null, (TransactionController.IS_TEMPORARY| TransactionController.IS_KEPT), Conglomerate.Priority.NORMAL); long cid=td.getHeapConglomerateId(); ConglomerateDescriptor cgd=td.getConglomerateDescriptor(cid); td.getConglomerateDescriptorList().dropConglomerateDescriptorByUUID( cgd.getUUID()); cgd=getDataDictionary().getDataDescriptorGenerator().newConglomerateDescriptor(conglomId,null,false,null,false,null,td.getUUID(), td.getSchemaDescriptor().getUUID()); ConglomerateDescriptorList conglomList= td.getConglomerateDescriptorList(); conglomList.add(cgd); td.resetHeapConglomNumber(); if(dropAndRedeclare){ tc.dropConglomerate(cid); replaceDeclaredGlobalTempTable(td.getName(),td); } return (td); }
Source:
<code>public void releaseProducer(final Producer<String, String> producer) { final int newUseCount = useCount.get(producer).decrementAndGet(); <START> assert newUseCount >= 0; <END> if (newUseCount == 0) { final boolean deleteProducer; rwLock.readLock().lock(); try { deleteProducer = producer != activeProducer; } finally { rwLock.readLock().unlock(); } if (deleteProducer) { useCount.remove(producer); producer.close(); } } }</code><technical_language>Usually, assertions development. add explanation string assertion</technical_language>

Target:
public void releaseProducer(final Producer<String, String> producer) { useCountMetric.dec(); final AtomicInteger counter = useCount.get(producer); if (counter != null && 0 == counter.decrementAndGet()) { final boolean deleteProducer; rwLock.readLock().lock(); try { deleteProducer = producer != activeProducer; } finally { rwLock.readLock().unlock(); } if (deleteProducer) { rwLock.writeLock().lock(); try { if (counter.get() == 0 && null != useCount.remove(producer)) { LOG.info("Stopping producer instance - It was reported that instance should be refreshed " + "and it is not used anymore: " + producer); producer.close(); } } finally { rwLock.writeLock().unlock(); } } } }
Source:
<code><START> public static <T> Set<T> makeSet(int initialCapacity) { <END> return new MiniSet<T>(); }</code><technical_language>if caller initial capacity a Mini variant if capacity put Mini variant</technical_language>

Target:
public static <T> Set<T> makeSet(int initialCapacity) { if (initialCapacity > MiniSet.MAX_OPTIMIZED_CAPACITY) { return new HashSet<>(); } else { return new MiniSet<T>(); } }
Source:
<code><START> private Collection<ColumnId> asColumns(Collection<String> names) { <END> Collection<ColumnId> ids = new ArrayList<>(); for (String name : names) { ids.add(new ColumnId( tableId, name )); } return ids; }</code><technical_language>Java 8-ify this method replace body a streams/map/collect one-liner: return names.stream().map(name -> new ColumnId(tableId, name)).collect(Collectors.toList());</technical_language>

Target:
private Collection<ColumnId> asColumns(Collection<String> names) { return names.stream() .map(name -> new ColumnId(tableId, name)) .collect(Collectors.toList()); }
Source:
<code>protected void performAction() { Context ctx = extension.getView().getSiteTreePanel().getSelectedContext(); if (ctx == null) { View.getSingleton() .showWarningDialog( Constant.messages.getString("exportUrls.popup.context.error")); if (LOG.isDebugEnabled()) { LOG.debug("No context selected, when trying to export URLs for a context."); } return; } File file = super.getOutputFile(); if (file == null) { return; } List<Context> contexts = extension.getView().getSiteTreePanel().getSelectedContexts(); SortedSet<String> allUrls = new TreeSet<String>(); for (Context c : contexts) { <START> allUrls.addAll(this.getOutputSet(c)); <END> } super.writeURLs(file, allUrls); }</code><technical_language>pass allUrls getOutputSet collection</technical_language>

Target:
protected void performAction() { Context ctx = extension.getView().getSiteTreePanel().getSelectedContext(); if (ctx == null) { View.getSingleton() .showWarningDialog( Constant.messages.getString("exportUrls.popup.context.error")); if (LOG.isDebugEnabled()) { LOG.debug("No context selected, when trying to export URLs for a context."); } return; } File file = super.getOutputFile(); if (file == null) { return; } List<Context> contexts = extension.getView().getSiteTreePanel().getSelectedContexts(); SortedSet<String> allUrls = new TreeSet<String>(); for (Context c : contexts) { this.getOutputSet(c, allUrls); } super.writeURLs(file, allUrls); }
Source:
<code>public CompletableFuture<Void> modifyTable(TableDescriptor newDescriptor) { return getDescriptor(newDescriptor.getTableName()).thenApply(descriptor -> tableModificationAdapter .buildModifications(new HTableDescriptor(newDescriptor), new HTableDescriptor(descriptor))) .thenApply(modifications -> { <START> modifyColumns(newDescriptor.getTableName(), modifications); <END> return null; }); }</code><technical_language>modifyColumns returns a CompletableFuture, means do a join() get(), ensure top CompletableFuture returns modification is complete</technical_language>

Target:
public CompletableFuture<Void> modifyTable(TableDescriptor newDescriptor) { return getDescriptor(newDescriptor.getTableName()).thenApply(descriptor -> tableModificationAdapter .buildModifications(new HTableDescriptor(newDescriptor), new HTableDescriptor(descriptor))) .thenApply(modifications -> { try { modifyColumns(newDescriptor.getTableName(), modifications).get(); } catch (InterruptedException | ExecutionException e) { throw new CompletionException(e); } return null; }); }
Source:
<code>public void testPermissionsForAddingTemplateDedicatedHostChanged(){ setupDedicatedHostForVm(false); PermissionSubject editDefaultHostPermission = new PermissionSubject(spId, VdcObjectType.StoragePool, ActionGroup.EDIT_ADMIN_TEMPLATE_PROPERTIES); List<PermissionSubject> permissionCheckSubjects = cmd.getPermissionCheckSubjects(); <START> permissionCheckSubjects.stream().filter(permissionSubject -> <END> ActionGroup.EDIT_ADMIN_TEMPLATE_PROPERTIES.equals(permissionSubject.getActionGroup())). forEach(permissionSubject -> {verifyPermissions(editDefaultHostPermission, permissionSubject);}); }</code><technical_language>break .filter new line == instead of equals enums check possible. for toString of enum btw</technical_language>

Target:
public void testPermissionsForAddingTemplateDedicatedHostChanged(){ setupDedicatedHostForVmAndTemplate(false); PermissionSubject editDefaultHostPermission = new PermissionSubject(spId, VdcObjectType.StoragePool, ActionGroup.EDIT_ADMIN_TEMPLATE_PROPERTIES); List<PermissionSubject> permissionCheckSubjects = cmd.getPermissionCheckSubjects(); permissionCheckSubjects.stream() .filter(permissionSubject -> ActionGroup.EDIT_ADMIN_TEMPLATE_PROPERTIES == permissionSubject.getActionGroup()) .forEach(permissionSubject -> {verifyPermissions(editDefaultHostPermission, permissionSubject);}); }
Source:
<code><START> @Override public boolean filter(Object context, Descriptor descriptor) { <END> if (context instanceof MultiBranchProject && descriptor instanceof BranchPropertyDescriptor) { return ((BranchPropertyDescriptor) descriptor).isApplicable((MultiBranchProject) context); } else { return true; } }</code><technical_language>code style</technical_language>

Target:
public boolean filter(Object context, Descriptor descriptor) { if (context instanceof MultiBranchProject && descriptor instanceof BranchPropertyDescriptor) { return ((BranchPropertyDescriptor) descriptor).isApplicable((MultiBranchProject) context); } else { return true; } }
Source:
<code>private void saveDigest(PipelineTemplate pipelineTemplate) { <START> String digestId = String.format("%s@SHA256%s", pipelineTemplate.getId(), computeSHA256Digest(pipelineTemplate)); <END> try { checkForDuplicatePipelineTemplate(digestId); } catch (DuplicateEntityException dee) { log.debug("Duplicate pipeline digest calculated, not updating key {}", digestId); return; } getPipelineTemplateDAO().create(digestId, pipelineTemplate); }</code><technical_language>format this a : actual digest value, delineate hash type & value</technical_language>

Target:
private void saveDigest(PipelineTemplate pipelineTemplate) { String digestId = String.format("%s@sha256:%s", pipelineTemplate.getId(), computeSHA256Digest(pipelineTemplate)); try { checkForDuplicatePipelineTemplate(digestId); } catch (DuplicateEntityException dee) { log.debug("Duplicate pipeline digest calculated, not updating key {}", digestId); return; } getPipelineTemplateDAO().create(digestId, pipelineTemplate); }
Source:
<code>public void decrementConsumers() { <START> if (numberOfConsumers > 0) { <END> numberOfConsumers--; } else { ActiveMQServerLogger.LOGGER.consumerCountError("Tried to decrement consumer count below 0: " + this); } }</code><technical_language>This isnt atomically updated decrements time number negative incorrectly. avoid this ideally syncronize update field changes field atomic updater , im more pro atomic updater</technical_language>

Target:
public void decrementConsumers() { numberOfConsumers.getAndUpdate(value -> { if (value > 0) { return value--; } else { ActiveMQServerLogger.LOGGER.consumerCountError("Tried to decrement consumer count below 0: " + this); return value; } }); }
Source:
<code>public void initChannel(SocketChannel socket) throws IOException, NoSuchAlgorithmException, CertificateException { ChannelPipeline pipeline = socket.pipeline(); <START> pipeline.addLast(LOGGER_HANDLER, loggingHandler); <END> if(server.isSslEnable()) { SslHandler sslHandler = sslBuilder.build(socket.alloc()); pipeline.addLast(SSL_HANDLER, sslHandler); } pipeline.addLast(idleExecutorGroup, KEEP_ALIVE_HANDLER, new IdleStateHandler(60*15, 5, 0)); pipeline.addLast(BEATS_PARSER, new BeatsParser()); pipeline.addLast(BEATS_HANDLER, beatsHandler); }</code><technical_language>do add logging handler a child handler? that</technical_language>

Target:
public void initChannel(SocketChannel socket) throws IOException, NoSuchAlgorithmException, CertificateException { ChannelPipeline pipeline = socket.pipeline(); pipeline.addLast(LOGGER_HANDLER, loggingHandler); if(enableSSL) { SslHandler sslHandler = sslBuilder.build(socket.alloc()); pipeline.addLast(SSL_HANDLER, sslHandler); } pipeline.addLast(idleExecutorGroup, KEEP_ALIVE_HANDLER, new IdleStateHandler(IDLESTATE_READER_IDLE_TIME_SECONDS, IDLESTATE_WRITER_IDLE_TIME_SECONDS , IDLESTATE_ALL_IDLE_TIME_SECONDS)); pipeline.addLast(BEATS_PARSER, new BeatsParser()); pipeline.addLast("acker", new AckEncoder()); pipeline.addLast(BEATS_HANDLER, beatsHandler); }
Source:
<code>public void onEntityDestroyed(EntityRef entity) { <START> if (!entity.isPersistent()) { <END> return; } entityDeltas.remove(entity.getId()); destroyedEntities.add(entity.getId()); }</code><technical_language>issue, rewritten java if (entity.isPersistent()) { // do stuff } avoid multiple points of return method (and save a line of code)</technical_language>

Target:
public void onEntityDestroyed(EntityRef entity) { if (entity.isPersistent()) { entityDeltas.remove(entity.getId()); destroyedEntities.add(entity.getId()); } }
Source:
<code>public CompletableSource apply(Completable upstream) { <START> return Completable.amb( <END> Arrays.asList( upstream, takeUntilEvent(lifecycle, event) .flatMap(Functions.CANCEL_COMPLETABLE) .ignoreElements() ) ); }</code><technical_language>consider Completable.ambArray</technical_language>

Target:
public CompletableSource apply(Completable upstream) { return Completable.ambArray( upstream, takeUntilEvent(lifecycle, event) .flatMap(Functions.CANCEL_COMPLETABLE) .ignoreElements() ); }
Source:
<code>public void process(Region region, EntityBuffer buffer) { <START> if (region.getRegion().encompasses(0, 64, 276)) { <END> Prefab chooseFactionNpc = Assets.getPrefab("LightAndShadow:MagicFool").get(); EntityStore entity = new EntityStore(chooseFactionNpc); entity.addComponent(new LocationComponent(new Vector3f(0, 61, 276))); buffer.enqueue(entity); Prefab beaconMark = Assets.getPrefab("BeaconMark").get(); EntityStore entityStore = new EntityStore(beaconMark); entityStore.addComponent(new LocationComponent(new Vector3f(0, 63, 276))); buffer.enqueue(entityStore); } }</code><technical_language>magic numbers</technical_language>

Target:
public void process(Region region, EntityBuffer buffer) { if (region.getRegion().encompasses( 0, LASUtils.FLOATING_PLATFORM_HEIGHT_LEVEL + 4, LASUtils.FLOATING_PLATFORM_POSITION.z + LASUtils.NPC_OFFSET)) { Prefab chooseFactionNpc = Assets.getPrefab("LightAndShadow:MagicFool").get(); EntityStore entity = new EntityStore(chooseFactionNpc); entity.addComponent(new LocationComponent(new Vector3f( 0, LASUtils.FLOATING_PLATFORM_HEIGHT_LEVEL + 1, LASUtils.FLOATING_PLATFORM_POSITION.z + LASUtils.NPC_OFFSET))); buffer.enqueue(entity); Prefab beaconMark = Assets.getPrefab("BeaconMark").get(); EntityStore entityStore = new EntityStore(beaconMark); entityStore.addComponent(new LocationComponent(new Vector3f( 0, LASUtils.FLOATING_PLATFORM_HEIGHT_LEVEL + 3, LASUtils.FLOATING_PLATFORM_POSITION.z + LASUtils.NPC_OFFSET))); buffer.enqueue(entityStore); } }
Source:
<code>private void printRestrictions() { try { TBoxReasonerModule reasoner = ApplicationUtils.instance().getTBoxReasonerModule(); for (Restriction rest : reasoner.listRestrictions() ) { if (rest.isAllValuesFromRestriction()) { log.trace("All values from: "); AllValuesFromRestriction avfr = rest.asAllValuesFromRestriction(); Resource res = avfr.getAllValuesFrom(); if (res.canAs(OntClass.class)) { OntClass resClass = res.as(OntClass.class); for (Resource inst : resClass.listInstances().toList() ) { log.trace(" -"+inst.getURI()); } } } else if (rest.isSomeValuesFromRestriction()) { log.trace("Some values from: "); } else if (rest.isHasValueRestriction()) { log.trace("Has value: "); } log.trace("On property "+rest.getOnProperty().getURI()); for (Resource inst : rest.listInstances().toList() ) { log.trace(" "+inst.getURI()); } } } catch (IllegalStateException e) { <START> log.debug("Status of reasoner could not be determined. It is likely disabled", e); <END> } }</code><technical_language>Suggest changing logging level warn</technical_language>

Target:
private void printRestrictions() { try { TBoxReasonerModule reasoner = ApplicationUtils.instance().getTBoxReasonerModule(); for (Restriction rest : reasoner.listRestrictions() ) { if (rest.isAllValuesFromRestriction()) { log.trace("All values from: "); AllValuesFromRestriction avfr = rest.asAllValuesFromRestriction(); Resource res = avfr.getAllValuesFrom(); if (res.canAs(OntClass.class)) { OntClass resClass = res.as(OntClass.class); for (Resource inst : resClass.listInstances().toList() ) { log.trace(" -"+inst.getURI()); } } } else if (rest.isSomeValuesFromRestriction()) { log.trace("Some values from: "); } else if (rest.isHasValueRestriction()) { log.trace("Has value: "); } log.trace("On property "+rest.getOnProperty().getURI()); for (Resource inst : rest.listInstances().toList() ) { log.trace(" "+inst.getURI()); } } } catch (IllegalStateException e) { log.warn("Status of reasoner could not be determined. It is likely disabled", e); } }
Source:
<code>public void writeObject(ObjectOutput output, Map<Object, Object> map) throws IOException { Optional<Map.Entry<Object, Object>> found = Optional.empty(); <START> for (Map.Entry<Object, Object> objectObjectEntry : map.entrySet()) { <END> found = Optional.of(objectObjectEntry); break; } Map.Entry<Object, Object> entry = found.get(); output.writeObject(entry.getKey()); output.writeObject(entry.getValue()); }</code><technical_language>Rename "entry"</technical_language>

Target:
public void writeObject(ObjectOutput output, Map<Object, Object> map) throws IOException { final Map.Entry<Object, Object> entry = map.entrySet().iterator().next(); output.writeObject(entry.getKey()); output.writeObject(entry.getValue()); }
Source:
<code>private void performInternalCompactionIfNecessary(TableReference tableRef, SweepResults results) { if (results.getStaleValuesDeleted() > 0) { Stopwatch watch = Stopwatch.createStarted(); kvs.compactInternally(tableRef); long elapsedMillis = watch.elapsed(TimeUnit.MILLISECONDS); <START> log.info("Finished performing compactInternally on in ms.", <END> UnsafeArg.of("table name", tableRef), SafeArg.of("", elapsedMillis)); sweepPerfLogger.logInternalCompaction( SweepCompactionPerformanceResults.builder() .tableName(tableRef.getQualifiedName()) .cellsDeleted(results.getStaleValuesDeleted()) .cellsExamined(results.getCellTsPairsExamined()) .elapsedMillis(elapsedMillis) .build()); } }</code><technical_language>Leave debug, compaction is work, useful info here.. @ashrayjain for SA</technical_language>

Target:
private void performInternalCompactionIfNecessary(TableReference tableRef, SweepResults results) { if (results.getStaleValuesDeleted() > 0) { Stopwatch watch = Stopwatch.createStarted(); kvs.compactInternally(tableRef); long elapsedMillis = watch.elapsed(TimeUnit.MILLISECONDS); log.debug("Finished performing compactInternally on in ms.", UnsafeArg.of("table name", tableRef), SafeArg.of("elapsedMillis", elapsedMillis)); sweepPerfLogger.logInternalCompaction( SweepCompactionPerformanceResults.builder() .tableName(tableRef.getQualifiedName()) .cellsDeleted(results.getStaleValuesDeleted()) .cellsExamined(results.getCellTsPairsExamined()) .elapsedMillis(elapsedMillis) .build()); } }
Source:
<code>GC100IRConnection(InetAddress ipAddress, String ipAddressString, int port, int module, int connector, <START> String deviceType, Socket socket) throws IOException { <END> this.inetAddress = ipAddress; this.ipAddressString = ipAddressString; this.port = port; this.module = module; this.connector = connector; this.deviceType = deviceType; this.socket = socket; this.isConnected = true; }</code><technical_language>constructor throw IOException</technical_language>

Target:
GC100IRConnection(InetAddress ipAddress, String ipAddressString, int port, int module, int connector, String deviceType, Socket socket) { this.inetAddress = ipAddress; this.ipAddressString = ipAddressString; this.port = port; this.module = module; this.connector = connector; this.deviceType = deviceType; this.socket = socket; this.isConnected = true; }
Source:
<code>public void setClientCapabilites(List<String> clientCapabilites){ <START> this.mClientCapabilites = clientCapabilites; <END> }</code><technical_language>this. is required</technical_language>

Target:
public void setClientCapabilites(List<String> clientCapabilites){ mClientCapabilites = clientCapabilites; }
Source:
<code>public SynchronizeTimeResponse getSynchronizeTimeResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final SynchronizeTimeAsyncRequest request) throws OsgpException { final MeterResponseData meterResponseData = this.adhocService.dequeueSynchronizeTimeResponse(request <START> .getCorrelationUid()); <END> final SynchronizeTimeResponse response = new SynchronizeTimeResponse(); if (meterResponseData != null) { response.setResult(OsgpResultType.fromValue(meterResponseData.getResultType().getValue())); if (meterResponseData.getMessageData() instanceof String) { response.setDescription((String) meterResponseData.getMessageData()); } } else { response.setResult(OsgpResultType.NOT_FOUND); } return response; }</code><technical_language>In SmartMeteringMonitoringEndpoint I response data retrieved a call meterResponseDataService. Calling adhocService obtain response data inconsistent sight. If is reason for this difference, I cleaner if obtaining actual response is treated alike in endpoints</technical_language>

Target:
public SynchronizeTimeResponse getSynchronizeTimeResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final SynchronizeTimeAsyncRequest request) { final SynchronizeTimeResponse response = new SynchronizeTimeResponse(); try { final MeterResponseData meterResponseData = this.adhocService.dequeueSynchronizeTimeResponse(request .getCorrelationUid()); response.setResult(OsgpResultType.fromValue(meterResponseData.getResultType().getValue())); if (meterResponseData.getMessageData() instanceof String) { response.setDescription((String) meterResponseData.getMessageData()); } } catch (final FunctionalException e) { if (e.getExceptionType() == FunctionalExceptionType.UNKNOWN_CORRELATION_UID) { response.setResult(OsgpResultType.NOT_FOUND); } else { response.setResult(OsgpResultType.NOT_OK); } } return response; }
Source:
<code>public void handlesSocket() throws IOException { <START> final Socket socket = createMockSocket( <END> Joiner.on(BkBasicTest.CRLF).join( "GET /1 HTTP/1.1", "Host: localhost", "Content-Length: 1", "", "hi1" ) ); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); Mockito.when(socket.getOutputStream()).thenReturn(baos); new BkBasic(new TkText("Hello world!")).accept(socket); MatcherAssert.assertThat( baos.toString(), Matchers.containsString("Hello world") ); }</code><technical_language>@exper0 I get is point of moving this code createMockSocket() method? Do understand issue solve</technical_language>

Target:
public void handlesSocket() throws IOException { final Socket socket = new Socket.FakeSocket( Joiner.on(BkBasicTest.CRLF).join( "GET /1 HTTP/1.1", "Host: localhost", "Content-Length: 1", "", "hi1" ) ); new BkBasic(new TkText("Hello world!")).accept(socket); MatcherAssert.assertThat( socket.output().toString(), Matchers.containsString("Hello world") ); }
Source:
<code>public void testConnectionSuspendedHandlingDuringInitialization() throws Exception { QueueLeaderElectionListener queueLeaderElectionListener = new QueueLeaderElectionListener(1, Duration.ofMillis(50)); LeaderRetrievalDriver leaderRetrievalDriver = null; try { leaderRetrievalDriver = ZooKeeperUtils .createLeaderRetrievalDriverFactory(zooKeeperClient, config) .createLeaderRetrievalDriver(queueLeaderElectionListener, fatalErrorHandler); CompletableFuture<String> firstAddress = queueLeaderElectionListener.next(); assertThat("No results are expected, yet, since no leader was elected.", firstAddress, is(nullValue())); closeTestServer(); <START> final CompletableFuture<String> secondAddress = queueLeaderElectionListener.next(Duration.ofSeconds(3)); <END> assertThat("The next result must not be missing.", secondAddress, is(notNullValue())); assertThat("The next result is expected to be null.", secondAddress.get(), is(nullValue())); } finally { if (leaderRetrievalDriver != null) { leaderRetrievalDriver.close(); } } }</code><technical_language>If expecting empty leader information, a timeout is required here</technical_language>

Target:
public void testConnectionSuspendedHandlingDuringInitialization() throws Exception { final QueueLeaderElectionListener queueLeaderElectionListener = new QueueLeaderElectionListener(1); LeaderRetrievalDriver leaderRetrievalDriver = null; try { leaderRetrievalDriver = ZooKeeperUtils .createLeaderRetrievalDriverFactory(zooKeeperClient, config) .createLeaderRetrievalDriver(queueLeaderElectionListener, fatalErrorHandler); final CompletableFuture<String> firstAddress = queueLeaderElectionListener.next(Duration.ofMillis(50)); assertThat("No results are expected, yet, since no leader was elected.", firstAddress, is(nullValue())); closeTestServer(); final CompletableFuture<String> secondAddress = queueLeaderElectionListener.next(); assertThat("The next result must not be missing.", secondAddress, is(notNullValue())); assertThat("The next result is expected to be null.", secondAddress.get(), is(nullValue())); } finally { if (leaderRetrievalDriver != null) { leaderRetrievalDriver.close(); } } }
Source:
<code>public <E extends Enum<E>> E readEnumValue(Class<E> enumClass) { E[] enums = enumClass.getEnumConstants(); if (enums.length == 0) { throw new IllegalArgumentException(); } int index; if (enums.length > 1) { int length = MathHelper.log2DeBruijn(enums.length); index = readFixedBits(length); } else { index = 0; <START> } <END> return enums[index]; }</code><technical_language>need change read+write methods</technical_language>

Target:
public <E extends Enum<E>> E readEnumValue(Class<E> enumClass) { E[] enums = enumClass.getEnumConstants(); if (enums == null) throw new IllegalArgumentException("Not an enum " + enumClass); if (enums.length == 0) throw new IllegalArgumentException("Tried to read an enum value without any values! How did you do this?"); if (enums.length == 1) return enums[0]; int length = MathHelper.log2DeBruijn(enums.length); int index = readFixedBits(length); return enums[index]; }
Source:
<code>public static void getPresignedObjectUrl_test2() throws Exception { String methodName = "getPresignedObjectUrl(GetPresignedObjectUrlArgs args)"; if (!mintEnv) { <START> System.out.println("Test: presigned get object with expiry: " + methodName); <END> } long startTime = System.currentTimeMillis(); try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * KB)) { client.putObject(bucketName, objectName, is, new PutObjectOptions(1 * KB, -1)); } byte[] inBytes; try (final InputStream is = new ContentInputStream(1 * KB)) { inBytes = readAllBytes(is); } String urlString = client.getPresignedObjectUrl( GetPresignedObjectUrlArgs.builder() .method(Method.GET) .bucket(bucketName) .object(objectName) .expires(3600) .build()); byte[] outBytes = readObject(urlString); if (!Arrays.equals(inBytes, outBytes)) { throw new Exception("object content differs"); } client.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(objectName).build()); mintSuccessLog(methodName, "presigned get object expiry :3600 sec ", startTime); } catch (Exception e) { handleException(methodName, "presigned get object expiry :3600 sec ", startTime, e); } }</code><technical_language>suggestion System.out.println("Test: " + methodName + " " + args);</technical_language>

Target:
public static void getPresignedObjectUrl_test2() throws Exception { String methodName = "getPresignedObjectUrl(GetPresignedObjectUrlArgs args)"; if (!mintEnv) { System.out.println("Test: " + methodName + " presigned get with expiry"); } long startTime = System.currentTimeMillis(); String mintArgs = "expiry: 3600 sec"; try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * KB)) { client.putObject(bucketName, objectName, is, new PutObjectOptions(1 * KB, -1)); } byte[] inBytes; try (final InputStream is = new ContentInputStream(1 * KB)) { inBytes = readAllBytes(is); } String urlString = client.getPresignedObjectUrl( GetPresignedObjectUrlArgs.builder() .method(Method.GET) .bucket(bucketName) .object(objectName) .expiry(3600) .build()); byte[] outBytes = readObject(urlString); if (!Arrays.equals(inBytes, outBytes)) { throw new Exception("object content differs"); } client.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(objectName).build()); mintSuccessLog(methodName, mintArgs, startTime); } catch (Exception e) { handleException(methodName, mintArgs, startTime, e); } }
Source:
<code>public void logIn(final String message, @Nullable final IGoogleLoginCompletedCallback callback) { final GoogleLoginState state = createGoogleLoginState(); new Task.Modal(null, "Please Log in...", true) { private boolean loggedIn = false; @Override public void run(@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); <START> if (!(indicator instanceof ProgressIndicatorEx)) return; <END> ((ProgressIndicatorEx)indicator).addStateDelegate(new ProgressIndicatorBase() { @Override public void cancel() { assert uiFacade != null; uiFacade.stop(); super.cancel(); } }); loggedIn = state.logInWithLocalServer(message); } @Override public void onCancel() { notifyOnComplete(); } @Override public void onSuccess() { notifyOnComplete(); } private void notifyOnComplete() { if(loggedIn) { IGoogleLoginCompletedCallback localCallback = new IGoogleLoginCompletedCallback() { @Override public void onLoginCompleted() { uiFacade.notifyStatusIndicator(); if(callback != null) { callback.onLoginCompleted(); } } }; users.addUser(new CredentialedUser(state, localCallback)); } else if (callback != null) { callback.onLoginCompleted(); } } }.queue(); }</code><technical_language>Standard braces: <LINK_0></technical_language>

Target:
public void logIn(final String message, @Nullable final IGoogleLoginCompletedCallback callback) { final GoogleLoginState state = createGoogleLoginState(); new Task.Modal(null, "Please Log in...", true) { private boolean loggedIn = false; @Override public void run(@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); if (!(indicator instanceof ProgressIndicatorEx)) { return; } ((ProgressIndicatorEx)indicator).addStateDelegate(new ProgressIndicatorBase() { @Override public void cancel() { assert uiFacade != null; uiFacade.stop(); super.cancel(); } }); loggedIn = state.logInWithLocalServer(message); } @Override public void onCancel() { notifyOnComplete(); } @Override public void onSuccess() { notifyOnComplete(); } private void notifyOnComplete() { if(loggedIn) { IGoogleLoginCompletedCallback localCallback = new IGoogleLoginCompletedCallback() { @Override public void onLoginCompleted() { uiFacade.notifyStatusIndicator(); if(callback != null) { callback.onLoginCompleted(); } } }; users.addUser(new CredentialedUser(state, localCallback)); } else if (callback != null) { callback.onLoginCompleted(); } } }.queue(); }
Source:
<code>public void testCmdRegistration() throws Exception { CommandLineExecutorService cles = Framework.getLocalService(CommandLineExecutorService.class); assertNotNull(cles); <START> <END> deployContrib("org.nuxeo.ecm.platform.commandline.executor", "OSGI-INF/commandline-aspell-test-contribs.xml"); applyInlineDeployments(); List<String> cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(1, cmds.size()); assertTrue(cmds.contains("aspell")); deployContrib("org.nuxeo.ecm.platform.commandline.executor", "OSGI-INF/commandline-imagemagic-test-contrib.xml"); applyInlineDeployments(); cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(2, cmds.size()); assertTrue(cmds.contains("identify")); deployContrib("org.nuxeo.ecm.platform.commandline.executor", "OSGI-INF/commandline-imagemagic-test-contrib2.xml"); applyInlineDeployments(); cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(1, cmds.size()); assertFalse(cmds.contains("identify")); }</code><technical_language>pushInlineDeployments</technical_language>

Target:
public void testCmdRegistration() throws Exception { CommandLineExecutorService cles = Framework.getLocalService(CommandLineExecutorService.class); assertNotNull(cles); pushInlineDeployments( "org.nuxeo.ecm.platform.commandline.executor:OSGI-INF/commandline-aspell-test-contribs.xml"); List<String> cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(1, cmds.size()); assertTrue(cmds.contains("aspell")); pushInlineDeployments( "org.nuxeo.ecm.platform.commandline.executor:OSGI-INF/commandline-imagemagic-test-contrib.xml"); cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(2, cmds.size()); assertTrue(cmds.contains("identify")); pushInlineDeployments( "org.nuxeo.ecm.platform.commandline.executor:OSGI-INF/commandline-imagemagic-test-contrib2.xml"); cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(1, cmds.size()); assertFalse(cmds.contains("identify")); }
Source:
<code>public static ArrayList<Geometry> findBorders(Pixmap pm, double threshold, double distanceTolerance) { final int w = pm.getWidth(); final int h = pm.getHeight(); double[][] area = new double[w + 4][h + 4]; for (int x = 0; x < w; x++) { double[] column = area[x + 2]; for (int y = 0; y < h; y++) { int p = pm.getPixel(x, h - y - 1); column[y + 2] = (p & 0xff) * 1.0 / 256; } } <START> ArrayList<ArrayList<Point2D>> contours = new ArrayList<ArrayList<Point2D>>(); <END> MarchingSquares.calculateContour(contours, area, 1, threshold); ArrayList<Geometry> geo = new ArrayList<Geometry>(); for (ArrayList<Point2D> contour : contours) { float[] vs = new float[contour.size() * 2]; int i = 0; for (Point2D p : contour) { vs[i++] = (float) p.getX() - 1; vs[i++] = (float) p.getY() - 1; } geo.add(gdxToJts(new Polygon(vs))); } simplify(geo, distanceTolerance); return geo; }</code><technical_language>I catch this in previous PR, @RotaruDan said, Point2D is android incompatible</technical_language>

Target:
public static Array<Geometry> findBorders(Pixmap pm, double threshold, double distanceTolerance) { final int w = pm.getWidth(); final int h = pm.getHeight(); double[][] area = new double[w + 4][h + 4]; for (int x = 0; x < w; x++) { double[] column = area[x + 2]; for (int y = 0; y < h; y++) { int p = pm.getPixel(x, h - y - 1); column[y + 2] = (p & 0xff) * 1.0 / 256; } } Array<Array<Vector2>> contours = new Array<Array<Vector2>>(); MarchingSquares.calculateContour(contours, area, 1, threshold); Array<Geometry> geo = new Array<Geometry>(); for (Array<Vector2> contour : contours) { float[] vs = new float[contour.size * 2]; int i = 0; for (Vector2 p : contour) { vs[i++] = (float) p.x - 1; vs[i++] = (float) p.y - 1; } geo.add(gdxToJts(new Polygon(vs))); } simplify(geo, distanceTolerance); return geo; }
Source:
<code>public void setup() { conf = new ClientConfiguration(); client = new MockUrlHttpClient(conf); <START> server = DefaultHttpProxyServer.bootstrap() <END> .withPort(8080) .start(); }</code><technical_language>Is this server other tests? If not, initialized test it</technical_language>

Target:
public void setup() { conf = new ClientConfiguration(); client = new MockUrlHttpClient(conf); }
Source:
<code>private TaxonConceptInstance getResolvedAccepted(TaxonConceptInstance original, int steps, @Nullable List<TaxonomicElement> trace, boolean exception) { if (steps <= 0) { if (exception) throw new ResolutionException("Detected possible loop resolving accepted " + original, trace); return original; } <START> TaxonConceptInstance resolved = this.getResolved(original, steps - 1); <END> TaxonomicElement ae = resolved.getAccepted(); if (ae == null || ae == resolved) return resolved; if (trace != null && trace.contains(ae)) { trace.add(ae); if (exception) throw new ResolutionException("Detected possible loop resolving accepted " + original, trace); return original; } if (trace != null) trace.add(ae); TaxonConceptInstance accepted = ae.getRepresentative(); accepted = accepted.getResolvedAccepted(original, steps - 1, trace, exception); if (!accepted.isForbidden()) return accepted; return accepted.getResolvedParent(original, steps - 1, trace, exception); }</code><technical_language>getResolved theoretically return null, is immediately a null check</technical_language>

Target:
private TaxonConceptInstance getResolvedAccepted(TaxonConceptInstance original, int steps, @Nullable List<TaxonomicElement> trace, boolean exception) { if (steps <= 0) { if (exception) throw new ResolutionException("Detected possible loop resolving accepted " + original, trace); return original; } TaxonConceptInstance resolved = this.getResolved(original, steps - 1); if (resolved == null) { if (exception) throw new ResolutionException("Detected dangling resolution resolving accepted " + original, trace); return original; } TaxonomicElement ae = resolved.getAccepted(); if (ae == null || ae == resolved) return resolved; if (trace != null && trace.contains(ae)) { trace.add(ae); if (exception) throw new ResolutionException("Detected possible loop resolving accepted " + original, trace); return original; } if (trace != null) trace.add(ae); TaxonConceptInstance accepted = ae.getRepresentative(); accepted = accepted.getResolvedAccepted(original, steps - 1, trace, exception); if (!accepted.isForbidden()) return accepted; return accepted.getResolvedParent(original, steps - 1, trace, exception); }
Source:
<code>public GetMastersResponse getMasters(RpcController rpcController, GetMastersRequest request) throws ServiceException { GetMastersResponse.Builder resp = GetMastersResponse.newBuilder(); Optional<ServerName> serverName = master.getActiveMaster(); serverName.ifPresent(name -> resp.addMasterServers(GetMastersResponseEntry.newBuilder() .setServerName(ProtobufUtil.toServerName(name)).setIsActive(true).build())); try { for (ServerName backupMaster: master.getBackupMasters()) { resp.addMasterServers(GetMastersResponseEntry.newBuilder().setServerName( ProtobufUtil.toServerName(backupMaster)).setIsActive(false).build()); } } catch (InterruptedIOException e) { LOG.error("Interrupted during getMasters() RPC.", e); <START> } <END> return resp.build(); }</code><technical_language>I this done in this patch, this method replace getActiveMaster method, in internal refresh end users, users ability harmmer zookeeper..</technical_language>

Target:
public GetMastersResponse getMasters(RpcController rpcController, GetMastersRequest request) throws ServiceException { GetMastersResponse.Builder resp = GetMastersResponse.newBuilder(); Optional<ServerName> serverName = master.getActiveMaster(); serverName.ifPresent(name -> resp.addMasterServers(GetMastersResponseEntry.newBuilder() .setServerName(ProtobufUtil.toServerName(name)).setIsActive(true).build())); for (ServerName backupMaster: master.getBackupMasters()) { resp.addMasterServers(GetMastersResponseEntry.newBuilder().setServerName( ProtobufUtil.toServerName(backupMaster)).setIsActive(false).build()); } return resp.build(); }
Source:
<code>public PlanNodeCostEstimate visitAggregation(AggregationNode node, Void context) { PlanNodeStatsEstimate aggregationStats = getStats(node); PlanNodeStatsEstimate sourceStats = getStats(node.getSource()); double cpuCost = sourceStats.getOutputSizeInBytes(node.getSource().getOutputSymbols(), types); double memoryCost = aggregationStats.getOutputSizeInBytes(node.getOutputSymbols(), types); <START> return new PlanNodeCostEstimate(cpuCost, memoryCost, memoryCost, 0); <END> }</code><technical_language>Squash it, for reason</technical_language>

Target:
public PlanNodeCostEstimate visitAggregation(AggregationNode node, Void context) { if (node.getStep() != FINAL && node.getStep() != SINGLE) { return PlanNodeCostEstimate.unknown(); } PlanNodeStatsEstimate aggregationStats = getStats(node); PlanNodeStatsEstimate sourceStats = getStats(node.getSource()); double cpuCost = sourceStats.getOutputSizeInBytes(node.getSource().getOutputSymbols(), types); double memoryCost = aggregationStats.getOutputSizeInBytes(node.getOutputSymbols(), types); return new PlanNodeCostEstimate(cpuCost, memoryCost, 0); }