auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, final HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException { if (params == null) { throw new IllegalArgumentException("Parameters may not be null"); } int timeout = params.getConnectionTimeout(); if (timeout == 0) { InetAddress hostAddress = getCachedMisconfiguredHost(host, port); if (hostAddress != null) { return clientSSLSockFactory.createSocket(hostAddress, port, localAddress, localPort); } try { SSLSocket sslSocket = (SSLSocket) clientSSLSockFactory.createSocket(host, port, localAddress, localPort); try { sslSocket.startHandshake(); } catch (SSLException ex) { String errHandshakeFailHelpMsg = Constant.messages.getString("network.sslconnector.handshake.error.help", Constant.messages.getString("network.sslconnector.handshake.error.help.url")); <START> logger.warn("An exception occurred while attempting to connect to: " + sslSocket.getInetAddress()); <END> logger.warn("The exception was: " + ex.getMessage()); logger.warn(errHandshakeFailHelpMsg); if (logger.isDebugEnabled()) { logger.debug(ex, ex); } throw ex; } return sslSocket; } catch (SSLException e) { if (!e.getMessage().contains(CONTENTS_UNRECOGNIZED_NAME_EXCEPTION)) { throw e; } hostAddress = InetAddress.getByName(host); cacheMisconfiguredHost(host, port, hostAddress); return clientSSLSockFactory.createSocket(hostAddress, port, localAddress, localPort); } } Socket socket = clientSSLSockFactory.createSocket(); SocketAddress localAddr = new InetSocketAddress(localAddress, localPort); socket.bind(localAddr); SocketAddress remoteAddr = new InetSocketAddress(host, port); socket.connect(remoteAddr, timeout); return socket; }</code><technical_language>worth logging if able connect in end? (per catch logic)</technical_language>

Target:
public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, final HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException { if (params == null) { throw new IllegalArgumentException("Parameters may not be null"); } int timeout = params.getConnectionTimeout(); if (timeout == 0) { InetAddress hostAddress = getCachedMisconfiguredHost(host, port); if (hostAddress != null) { return clientSSLSockFactory.createSocket(hostAddress, port, localAddress, localPort); } try { SSLSocket sslSocket = (SSLSocket) clientSSLSockFactory.createSocket(host, port, localAddress, localPort); sslSocket.startHandshake(); return sslSocket; } catch (SSLException e) { if (!e.getMessage().contains(CONTENTS_UNRECOGNIZED_NAME_EXCEPTION)) { throw e; } hostAddress = InetAddress.getByName(host); cacheMisconfiguredHost(host, port, hostAddress); return clientSSLSockFactory.createSocket(hostAddress, port, localAddress, localPort); } } Socket socket = clientSSLSockFactory.createSocket(); SocketAddress localAddr = new InetSocketAddress(localAddress, localPort); socket.bind(localAddr); SocketAddress remoteAddr = new InetSocketAddress(host, port); socket.connect(remoteAddr, timeout); return socket; }
Source:
<code>public IncrementalIndexAdapter( Interval dataInterval, IncrementalIndex<?> index, BitmapFactory bitmapFactory ) { this.dataInterval = dataInterval; this.index = index; this.hasNullValueDimensions = Sets.newHashSet(); final List<IncrementalIndex.DimensionDesc> dimensions = index.getDimensions(); indexers = Maps.newHashMapWithExpectedSize(dimensions.size()); for (IncrementalIndex.DimensionDesc dimension : dimensions) { indexers.put(dimension.getName(), new DimensionIndexer(dimension)); } int rowNum = 0; for (IncrementalIndex.TimeAndDims timeAndDims : index.getFacts().keySet()) { final int[][] dims = timeAndDims.getDims(); for (IncrementalIndex.DimensionDesc dimension : dimensions) { final int dimIndex = dimension.getIndex(); DimensionIndexer indexer = indexers.get(dimension.getName()); <START> if (indexer == null || dims == null) { <END> log.error("bitmapIndexes and dims are null!"); continue; } if (dimIndex >= dims.length || dims[dimIndex] == null) { hasNullValueDimensions.add(dimension.getName()); continue; } final IncrementalIndex.DimDim values = dimension.getValues(); if (hasNullValue(values, dims[dimIndex])) { hasNullValueDimensions.add(dimension.getName()); } final MutableBitmap[] bitmapIndexes = indexer.invertedIndexes; for (int dimIdx : dims[dimIndex]) { if (bitmapIndexes[dimIdx] == null) { bitmapIndexes[dimIdx] = bitmapFactory.makeEmptyMutableBitmap(); } try { bitmapIndexes[dimIdx].add(rowNum); } catch (Exception e) { log.info(e.toString()); } } } ++rowNum; } }</code><technical_language>indexer null, added line 112, no</technical_language>

Target:
public IncrementalIndexAdapter( Interval dataInterval, IncrementalIndex<?> index, BitmapFactory bitmapFactory ) { this.dataInterval = dataInterval; this.index = index; this.hasNullValueDimensions = Sets.newHashSet(); final List<IncrementalIndex.DimensionDesc> dimensions = index.getDimensions(); indexers = Maps.newHashMapWithExpectedSize(dimensions.size()); for (IncrementalIndex.DimensionDesc dimension : dimensions) { indexers.put(dimension.getName(), new DimensionIndexer(dimension)); } int rowNum = 0; for (IncrementalIndex.TimeAndDims timeAndDims : index.getFacts().keySet()) { final int[][] dims = timeAndDims.getDims(); for (IncrementalIndex.DimensionDesc dimension : dimensions) { final int dimIndex = dimension.getIndex(); DimensionIndexer indexer = indexers.get(dimension.getName()); if (dimIndex >= dims.length || dims[dimIndex] == null) { hasNullValueDimensions.add(dimension.getName()); continue; } final IncrementalIndex.DimDim values = dimension.getValues(); if (hasNullValue(values, dims[dimIndex])) { hasNullValueDimensions.add(dimension.getName()); } final MutableBitmap[] bitmapIndexes = indexer.invertedIndexes; for (int dimIdx : dims[dimIndex]) { if (bitmapIndexes[dimIdx] == null) { bitmapIndexes[dimIdx] = bitmapFactory.makeEmptyMutableBitmap(); } try { bitmapIndexes[dimIdx].add(rowNum); } catch (Exception e) { log.info(e.toString()); } } } ++rowNum; } }
Source:
<code>ChangeAndCommit(@Nullable Change change, @Nullable PatchSet ps, RevCommit c) throws RepositoryNotFoundException, IOException, OrmException { if (change != null) { changeId = change.getKey().get(); _changeNumber = change.getChangeId(); _revisionNumber = ps != null ? ps.getPatchSetId() : null; PatchSet.Id curr = change.currentPatchSetId(); _currentRevisionNumber = curr != null ? curr.get() : null; } commit = new CommitInfo(); commit.commit = c.name(); commit.parents = Lists.newArrayListWithCapacity(c.getParentCount()); for (int i = 0; i < c.getParentCount(); i++) { CommitInfo p = new CommitInfo(); p.commit = c.getParent(i).name(); commit.parents.add(p); } commit.author = toGitPerson(c.getAuthorIdent()); commit.subject = c.getShortMessage(); <START> IncludedInDetail detail = new IncludedInDetail(); detail = resolveBranches(c); <END> branches = detail.getBranches().size() != 0 ? detail.getBranches() : null; }</code><technical_language>this changed to: IncludedInDetail detail = resolveBranches(c);</technical_language>

Target:
ChangeAndCommit(@Nullable Change change, @Nullable PatchSet ps, RevCommit c) throws RepositoryNotFoundException, IOException, OrmException { if (change != null) { changeId = change.getKey().get(); _changeNumber = change.getChangeId(); _revisionNumber = ps != null ? ps.getPatchSetId() : null; PatchSet.Id curr = change.currentPatchSetId(); _currentRevisionNumber = curr != null ? curr.get() : null; } commit = new CommitInfo(); commit.commit = c.name(); commit.parents = Lists.newArrayListWithCapacity(c.getParentCount()); for (int i = 0; i < c.getParentCount(); i++) { CommitInfo p = new CommitInfo(); p.commit = c.getParent(i).name(); commit.parents.add(p); } commit.author = toGitPerson(c.getAuthorIdent()); commit.subject = c.getShortMessage(); IncludedInDetail detail = resolveBranches(c); branches = detail.getBranches().size() != 0 ? detail.getBranches() : null; }
Source:
<code>protected void executeCommand() { <START> SessionDataContainer.getInstance().setData( <END> getParameters().getSessionId(), SessionDataContainer.SOFT_LIMIT_INTERVAL_PARAMETER_NAME, getParameters().getSoftLimit()); setSucceeded(true); }</code><technical_language>please add setSoftLimitInterval() setter it</technical_language>

Target:
protected void executeCommand() { T params = getParameters(); String sessionId = params.getSessionId(); if (SessionDataContainer.getInstance().isSessionExists(sessionId)) { SessionDataContainer.getInstance().setSoftLimitInterval(sessionId, params.getSoftLimit()); setSucceeded(true); } else { setSucceeded(false); } }
Source:
<code>public void constructor() { String namespace = "an-namespace-test"; String entity = "an-entity-name"; String trackingId = "a-tracking-id"; Integer credits = -10; LinkErrorContext context = new LinkErrorContext(namespace, entity, trackingId, credits); Assertions.assertEquals(namespace, context.getNamespace()); Assertions.assertEquals(entity, context.getEntityPath()); Assertions.assertEquals(trackingId, context.getTrackingId()); Assertions.assertEquals(credits, context.getLinkCredit()); <START> Assertions.assertEquals(context.toString(),context.toString()); <END> }</code><technical_language>This testing anything. This removed</technical_language>

Target:
public void constructor() { String namespace = "an-namespace-test"; String entity = "an-entity-name"; String trackingId = "a-tracking-id"; Integer credits = -10; LinkErrorContext context = new LinkErrorContext(namespace, entity, trackingId, credits); Assertions.assertEquals(namespace, context.getNamespace()); Assertions.assertEquals(entity, context.getEntityPath()); Assertions.assertEquals(trackingId, context.getTrackingId()); Assertions.assertEquals(credits, context.getLinkCredit()); }
Source:
<code>public VmTemplate getVmTemplate() { if (vmTemplateFromConfiguration == null) { <START> initUnregisteredTemplate(); <END> } return vmTemplateFromConfiguration; }</code><technical_language>This is called in init method. is needed here</technical_language>

Target:
public VmTemplate getVmTemplate() { return vmTemplateFromConfiguration; }
Source:
<code>public void setUp() { <START> setInitializationStatus(false, false, false, false); <END> manager = getManagerWithCallback(true, mockCallback); }</code><technical_language>optional suggestion: extracting helper methods... "false * 4" "true * 4", consider adding e.g. whenEverythingIsInitialized whenNothingIsInitialized</technical_language>

Target:
public void setUp() { nothingInitialized(); manager = getManagerWithCallback(true, mockCallback); when(mockKvs.getClusterAvailabilityStatus()).thenReturn(ClusterAvailabilityStatus.ALL_AVAILABLE); }
Source:
<code>public int compareTo(SequencingParameters other) { <START> if (!(other instanceof SequencingParameters)) return -1; <END> if (name.startsWith("v4")) { if ("v4 2×126".equals(name)) return -1; if ("v4 2×126".equals(other.name)) return 1; if (other.name.startsWith("v4")) return other.name.compareTo(name); return -1; } else if (name.startsWith("Rapid Run")) { if (other.name.startsWith("v4")) return 1; if (other.name.startsWith("Rapid Run")) return other.name.compareTo(name); return -1; } else if (name.startsWith("10X")) { if (other.name.startsWith("v4") || other.name.startsWith("Rapid Run")) return 1; if (other.name.startsWith("10X")) return other.name.compareTo(name); return -1; } else if (name.startsWith("v3")) { if (other.name.startsWith("v4") || other.name.startsWith("Rapid Run") || other.name.startsWith("10X")) return 1; if (other.name.startsWith("v3")) return other.name.compareTo(name); return -1; } else { return other.name.compareTo(name); } }</code><technical_language>Is this meant a null check? If non-null, other instance of SequencingParameters</technical_language>

Target:
public int compareTo(SequencingParameters other) { Integer thisSortKey = null; for (int i = 0; i < sortOrder.size(); i++) { if (name.startsWith(sortOrder.get(i))) { thisSortKey = i; break; } } if (thisSortKey == null) thisSortKey = 100; Integer otherSortKey = null; for (int i = 0; i < sortOrder.size(); i++) { if (other.name.startsWith(sortOrder.get(i))) { otherSortKey = i; break; } } if (otherSortKey == null) otherSortKey = 100; if (thisSortKey == otherSortKey) { return name.compareTo(other.name); } else { return thisSortKey - otherSortKey; } }
Source:
<code>public void testNormalScheme() { <START> Assert.assertEquals("ftp", UriParser.extractSupportedScheme(schemes,"ftp://user:pass@host/some/path/some:file")); <END> }</code><technical_language>Hm, I if "get" a method prefix "extract". do "extract" in API names: getSupportedScheme(Set, String). written do need "Supported" in API name? pass in exact schemes for argument: getScheme(Set,String) do IMO. WDYT</technical_language>

Target:
public void testNormalScheme() { Assert.assertEquals("ftp", UriParser.extractScheme(schemes,"ftp://user:pass@host/some/path/some:file")); }
Source:
<code>public static Module getParentModule(ITestContext context) { <START> if (isStringNotEmpty(context.getSuite().getParentModule())) { <END> Class<?> parentModule = ClassHelper.forName(context.getSuite().getParentModule()); if (parentModule == null) { throw new TestNGException( "Cannot load parent Guice module class: " + context.getSuite().getParentModule()); } if (!Module.class.isAssignableFrom(parentModule)) { throw new TestNGException("Provided class is not a Guice module: " + parentModule.getName()); } try { Constructor<?> moduleConstructor = parentModule.getDeclaredConstructor(ITestContext.class); return (Module)InstanceCreator.newInstance(moduleConstructor, context); } catch (NoSuchMethodException e) { return (Module)InstanceCreator.newInstance(parentModule); } } return null; }</code><technical_language>a bit smarter: java if (!isStringNotEmpty(context.getSuite().getParentModule())) { return null; } ..</technical_language>

Target:
private static Module getParentModule(ITestContext context) { if (isStringEmpty(context.getSuite().getParentModule())) { return null; } Class<?> parentModule = ClassHelper.forName(context.getSuite().getParentModule()); if (parentModule == null) { throw new TestNGException( "Cannot load parent Guice module class: " + context.getSuite().getParentModule()); } if (!Module.class.isAssignableFrom(parentModule)) { throw new TestNGException("Provided class is not a Guice module: " + parentModule.getName()); } try { Constructor<?> moduleConstructor = parentModule.getDeclaredConstructor(ITestContext.class); return (Module)InstanceCreator.newInstance(moduleConstructor, context); } catch (NoSuchMethodException e) { return (Module)InstanceCreator.newInstance(parentModule); } }
Source:
<code>private boolean rangeHeaderExists(HttpServletRequest httpRequest) { boolean response = false; <START> if (null != httpRequest && null != httpRequest.getHeader(HEADER_RANGE)) { <END> response = true; } return response; }</code><technical_language>suggest reverse order of arguments httpRequest != null && httpRequest.getHeader(HEADER_RANGE) != null</technical_language>

Target:
private boolean rangeHeaderExists(HttpServletRequest httpRequest) { boolean response = false; if (httpRequest != null && httpRequest.getHeader(HEADER_RANGE) != null) { response = true; } return response; }
Source:
<code>private boolean parentModuleIsForcedZip(IModule[] moduleTree) { <START> ArrayList<IModule> tmp = new ArrayList<IModule>(); <END> tmp.addAll(Arrays.asList(moduleTree)); tmp.remove(tmp.size()-1); while( tmp.size() > 0 ) { IModule[] tmpArray = tmp.toArray(new IModule[tmp.size()]); if( forceZipModule(tmpArray) ) { return true; } tmp.remove(tmp.size()-1); } return false; }</code><technical_language>new ArrayList<IModule>(Arrays.asList(moduleTree)); //so proper size is set list</technical_language>

Target:
private boolean parentModuleIsForcedZip(IModule[] moduleTree) { ArrayList<IModule> tmp = new ArrayList(Arrays.asList(moduleTree)); tmp.remove(tmp.size()-1); while( tmp.size() > 0 ) { IModule[] tmpArray = tmp.toArray(new IModule[tmp.size()]); if( forceZipModule(tmpArray) ) { return true; } tmp.remove(tmp.size()-1); } return false; }
Source:
<code>public String getWorkflowDag(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "workflowId", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkOptionalAuthRead(user, workflow); WorkflowVersion workflowVersion = getWorkflowVersion(workflow, workflowVersionId); SourceFile mainDescriptor = getMainDescriptorFile(workflowVersion); if (mainDescriptor != null) { Map<String, String> secondaryDescContent = extractDescriptorAndSecondaryFiles(workflowVersion); LanguageHandlerInterface lInterface = LanguageHandlerFactory.getInterface(workflow.getFileType()); <START> return cleanDAG(lInterface.getContent(workflowVersion.getWorkflowPath(), mainDescriptor.getContent(), secondaryDescContent, <END> LanguageHandlerInterface.Type.DAG, toolDAO)); } return null; }</code><technical_language>thinking: Is situation want a dirty dag? a default method in LanguageHandlerInterface auto-cleans getContent calls getContent protected called</technical_language>

Target:
public String getWorkflowDag(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "workflowId", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkOptionalAuthRead(user, workflow); WorkflowVersion workflowVersion = getWorkflowVersion(workflow, workflowVersionId); SourceFile mainDescriptor = getMainDescriptorFile(workflowVersion); if (mainDescriptor != null) { Map<String, String> secondaryDescContent = extractDescriptorAndSecondaryFiles(workflowVersion); LanguageHandlerInterface lInterface = LanguageHandlerFactory.getInterface(workflow.getFileType()); return lInterface.getCleanDAG(workflowVersion.getWorkflowPath(), mainDescriptor.getContent(), secondaryDescContent, LanguageHandlerInterface.Type.DAG, toolDAO); } return null; }
Source:
<code>private void resetOptionSettings(IHoldsOptions holder) { IOption[] opts = holder.getOptions(); for (IOption opt : opts) { Object val = opt.getDefaultValue(); <START> if (val != null) { <END> if (val instanceof Boolean) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (Boolean)val); } else if (val instanceof String[]) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String[])val); } else { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String)val); } } } }</code><technical_language>remove check for null if other cases instanceof expression</technical_language>

Target:
private void resetOptionSettings(IHoldsOptions holder) { IOption[] opts = holder.getOptions(); for (IOption opt : opts) { Object val = opt.getDefaultValue(); if (val instanceof Boolean) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (Boolean)val); } else if (val instanceof String[]) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String[])val); } else if (val instanceof String){ ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String)val); } } }
Source:
<code>int getActualDPI () { long screen = OS.gdk_screen_get_default(); <START> int monitor = OS.gdk_screen_get_primary_monitor(screen); <END> GdkRectangle dest = new GdkRectangle (); OS.gdk_screen_get_monitor_geometry(screen, monitor, dest); int widthMM = OS.gdk_screen_get_monitor_width_mm(screen, monitor); return Compatibility.round (254 * dest.width, widthMM * 10); }</code><technical_language>need test external monitor. get_active_monitor</technical_language>

Target:
int getActualDPI () { long screen = OS.gdk_screen_get_default(); Rectangle rect = getBounds(); int monitor = OS.gdk_screen_get_monitor_at_point(screen, rect.x, rect.y); GdkRectangle dest = new GdkRectangle (); OS.gdk_screen_get_monitor_geometry(screen, monitor, dest); int widthMM = OS.gdk_screen_get_monitor_width_mm(screen, monitor); return Compatibility.round (254 * dest.width, widthMM * 10); }
Source:
<code>public void visitSwitchStatement(SwitchStatementTree tree) { <START> reportIssue((tree).switchKeyword(), <END> "Refactor the code to eliminate this nested \"switch\"."); }</code><technical_language>remove useless parentheses, need for 2 lines</technical_language>

Target:
public void visitSwitchStatement(SwitchStatementTree tree) { reportIssue(tree.switchKeyword(), "Refactor the code to eliminate this nested \"switch\"."); }
Source:
<code>private void processPropertyUpdated(String instance, String property, State state) { updateIfChanged(instance, property, state); <START> if (property.startsWith("SI")) { <END> updateInputProperties(instance, property); } }</code><technical_language>please extract a constant</technical_language>

Target:
private void processPropertyUpdated(String instance, String property, State state) { updateIfChanged(instance, property, state); if (property.startsWith(SWITCH_INPUT)) { updateInputProperties(instance, property); } }
Source:
<code>protected boolean canDoAction() { DetachNetworkClusterValidator validator = new DetachNetworkClusterValidator(getParameters().getNetwork(), getParameters().getNetworkCluster()); <START> return validate(validator.notManagementNetwork()) <END> && validate(validator.clusterNetworkNotUsedByVms()) && validate(validator.clusterNetworkNotUsedByTemplates()); }</code><technical_language>This is error message. Frankly, I prefer this (NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK) more verbose</technical_language>

Target:
protected boolean canDoAction() { DetachNetworkValidator validator = new DetachNetworkValidator(getParameters().getNetwork(), getParameters().getNetworkCluster()); return validate(validator.notManagementNetwork()) && validate(validator.clusterNetworkNotUsedByVms()) && validate(validator.clusterNetworkNotUsedByTemplates()); }
Source:
<code>public void isDefaultPort_Scheme_NULL() { <START> assertTrue(HttpServletRequestUtils.isDefaultPort(null, 443)); <END> }</code><technical_language>this assert is redundant</technical_language>

Target:
public void isDefaultPort_Scheme_NULL() { HttpServletRequestUtils.isDefaultPort(null, 443); }
Source:
<code>public void deleteExchanges(String... exchanges) { ConnectionFactory connectionFactory = getConnectionFactory(); Connection connection = null; Channel channel = null; try { connection = connectionFactory.newConnection(); <START> connection.setId(generateId() + ".queueDelete"); <END> channel = connection.createChannel(); for (String exchange : exchanges) { channel.exchangeDelete(exchange); } } catch (Exception e) { logger.warn("Failed to delete queues", e); } finally { closeResources(connection, channel); } }</code><technical_language>exchangeDelete</technical_language>

Target:
public void deleteExchanges(String... exchanges) { ConnectionFactory connectionFactory = getConnectionFactory(); Connection connection = null; Channel channel = null; try { connection = connectionFactory.newConnection(); connection.setId(generateId() + ".exchangeDelete"); channel = connection.createChannel(); for (String exchange : exchanges) { channel.exchangeDelete(exchange); } } catch (Exception e) { logger.warn("Failed to delete queues", e); } finally { closeResources(connection, channel); } }
Source:
<code><START> public CriteriaSet getLastCriteriaSet() { <END> return criterias.get(criterias.size() - 1); }</code><technical_language>check for empty criterias</technical_language>

Target:
public CriteriaSet getLastCriteriaSet() { return !criterias.isEmpty() ? criterias.get(criterias.size() - 1) : null; }
Source:
<code>public void refresh() { try { if (this.producer == null) { SustainedConnectionWorker.this.totalProducerConnections.incrementAndGet(); this.producer = new KafkaProducer<>(this.props, new ByteArraySerializer(), new ByteArraySerializer()); this.partitions = this.producer.partitionsFor(this.topicName).stream() .map(partitionInfo -> new TopicPartition(partitionInfo.topic(), partitionInfo.partition())) .collect(Collectors.toList()); Collections.shuffle(this.partitions); } if (this.partitionsIterator == null || !this.partitionsIterator.hasNext()) { this.partitionsIterator = this.partitions.iterator(); } TopicPartition partition = this.partitionsIterator.next(); ProducerRecord<byte[], byte[]> record = new ProducerRecord<>( partition.topic(), partition.partition(), keys.next(), values.next()); producer.send(record).get(); } catch (Throwable e) { this.closeQuietly(); SustainedConnectionWorker.this.totalProducerConnections.decrementAndGet(); SustainedConnectionWorker.this.totalProducerFailedConnections.incrementAndGet(); <START> SustainedConnectionWorker.log.error("Error while refreshing sustained KafkaProducer connection", e.getMessage()); <END> } this.nextUpdate = System.currentTimeMillis() + this.refreshRate; this.inUse = false; }</code><technical_language>This log error. want public void error(String msg, Throwable t); overload, need change e.getMessage() -> e</technical_language>

Target:
public void refresh() { try { if (this.producer == null) { SustainedConnectionWorker.this.totalProducerConnections.incrementAndGet(); this.producer = new KafkaProducer<>(this.props, new ByteArraySerializer(), new ByteArraySerializer()); this.partitions = this.producer.partitionsFor(this.topicName).stream() .map(partitionInfo -> new TopicPartition(partitionInfo.topic(), partitionInfo.partition())) .collect(Collectors.toList()); Collections.shuffle(this.partitions); } if (this.partitionsIterator == null || !this.partitionsIterator.hasNext()) { this.partitionsIterator = this.partitions.iterator(); } TopicPartition partition = this.partitionsIterator.next(); ProducerRecord<byte[], byte[]> record = new ProducerRecord<>( partition.topic(), partition.partition(), keys.next(), values.next()); producer.send(record).get(); } catch (Throwable e) { this.closeQuietly(); SustainedConnectionWorker.this.totalProducerConnections.decrementAndGet(); SustainedConnectionWorker.this.totalProducerFailedConnections.incrementAndGet(); SustainedConnectionWorker.log.error("Error while refreshing sustained KafkaProducer connection", e); } this.completeRefresh(); }
Source:
<code>public boolean isClusterComplete() { <START> return (m_clusterSettings.get().hostcount() == m_messenger.getLiveHostIds().size()); <END> }</code><technical_language>I update of call getHostCount instead of implementation of getHostCount if change this implementation of getHostCount needs change</technical_language>

Target:
public boolean isClusterComplete() { return (getHostCount() == m_messenger.getLiveHostIds().size()); }
Source:
<code>public void testSubmitUsersWithNoGuarantees() { INimbus iNimbus = new INimbusTest(); Map<String, SupervisorDetails> supMap = genSupervisors(4, 4, 100, 1000); Map<String, Map<String, Number>> resourceUserPool = userResourcePool( userRes("jerry", 200, 2000)); Config config = createClusterConfig(100, 500, 500, resourceUserPool); Topologies topologies = new Topologies( genTopology("topo-1", config, 1, 0, 1, 0, currentTime - 2, 10, "jerry"), genTopology("topo-2", config, 1, 0, 1, 0, currentTime - 2, 20, "jerry"), genTopology("topo-3", config, 1, 0, 1, 0, currentTime - 2, 20, "jerry"), genTopology("topo-4", config, 1, 0, 1, 0, currentTime - 2, 10, "bobby"), genTopology("topo-5", config, 1, 0, 1, 0, currentTime - 2, 20, "bobby")); Cluster cluster = new Cluster(iNimbus, new ResourceMetrics(new StormMetricsRegistry()), supMap, new HashMap<>(), topologies, config); ResourceAwareScheduler rs = new ResourceAwareScheduler(); rs.prepare(config); rs.schedule(topologies, cluster); <START> scheduler = rs; <END> assertTopologiesFullyScheduled(cluster, "topo-1", "topo-2", "topo-3", "topo-4"); assertTopologiesNotScheduled(cluster, "topo-5"); }</code><technical_language>above. scheduler = new ResourceAwareScheduler(); directly</technical_language>

Target:
public void testSubmitUsersWithNoGuarantees() { INimbus iNimbus = new INimbusTest(); Map<String, SupervisorDetails> supMap = genSupervisors(4, 4, 100, 1000); Map<String, Map<String, Number>> resourceUserPool = userResourcePool( userRes("jerry", 200, 2000)); Config config = createClusterConfig(100, 500, 500, resourceUserPool); Topologies topologies = new Topologies( genTopology("topo-1", config, 1, 0, 1, 0, currentTime - 2, 10, "jerry"), genTopology("topo-2", config, 1, 0, 1, 0, currentTime - 2, 20, "jerry"), genTopology("topo-3", config, 1, 0, 1, 0, currentTime - 2, 20, "jerry"), genTopology("topo-4", config, 1, 0, 1, 0, currentTime - 2, 10, "bobby"), genTopology("topo-5", config, 1, 0, 1, 0, currentTime - 2, 20, "bobby")); Cluster cluster = new Cluster(iNimbus, new ResourceMetrics(new StormMetricsRegistry()), supMap, new HashMap<>(), topologies, config); scheduler = new ResourceAwareScheduler(); scheduler.prepare(config); scheduler.schedule(topologies, cluster); assertTopologiesFullyScheduled(cluster, "topo-1", "topo-2", "topo-3", "topo-4"); assertTopologiesNotScheduled(cluster, "topo-5"); }
Source:
<code>public void testGetEntryFromTupleTooSmall() { YailList tuple = createTuple(1f); Entry expected = null; Entry result = model.getEntryFromTuple(tuple); <START> assertEquals(expected, result); <END> }</code><technical_language>assertNull(...) assertEquals(null,...)</technical_language>

Target:
public void testGetEntryFromTupleTooSmall() { YailList tuple = createTuple(1f); Entry result = model.getEntryFromTuple(tuple); assertNull(result); }
Source:
<code>public void testFullTextExtractionFilterValidMimeTypeForceExistingFile() throws Exception { String derivativePath = idToPath(fileID, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); File existingFile = new File("target/" + derivativePath + "/" + fileID + ".txt"); FileUtils.writeStringToFile(existingFile, "extracted text", "utf-8"); getMockEndpoint("mock:direct:fulltext.extraction").expectedMessageCount(1); createContext(ENHANCEMENT_ROUTE); Map<String, Object> headers = createEvent(); headers.put("force", "true"); template.sendBodyAndHeaders("", headers); assertMockEndpointsSatisfied(); <START> existingFile.delete(); <END> }</code><technical_language>skip delete steps @After method recursively deletes dir. If didn't, this delete problematic if test failed delete file</technical_language>

Target:
public void testFullTextExtractionFilterValidMimeTypeForceExistingFile() throws Exception { String derivativePath = idToPath(fileID, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); File existingFile = new File("target/" + derivativePath + "/" + fileID + ".txt"); FileUtils.writeStringToFile(existingFile, "extracted text", "utf-8"); getMockEndpoint("mock:direct:fulltext.extraction").expectedMessageCount(1); createContext(ENHANCEMENT_ROUTE); Map<String, Object> headers = createEvent(); headers.put("force", "true"); template.sendBodyAndHeaders("", headers); assertMockEndpointsSatisfied(); }
Source:
<code>public Object convertFromInternal(Message<?> message, Class<?> targetClass, Object conversionHint) { <START> ByteArrayInputStream bis = new ByteArrayInputStream((byte[]) (message.getPayload())); <END> try { return new ObjectInputStream(bis).readObject(); } catch (Exception e) { this.logger.error(e.getMessage(), e); } return null; }</code><technical_language>assume payload is a byte array</technical_language>

Target:
public Object convertFromInternal(Message<?> message, Class<?> targetClass, Object conversionHint) { if (!(message.getPayload() instanceof byte[])) { return null; } try { ByteArrayInputStream bis = new ByteArrayInputStream((byte[]) (message.getPayload())); return new ObjectInputStream(bis).readObject(); } catch (Exception e) { this.logger.error(e.getMessage(), e); } return null; }
Source:
<code>public String getAlgorithm() { <START> return "SK-ED25519"; <END> }</code><technical_language>Please this a public literal constant of this class</technical_language>

Target:
public String getAlgorithm() { return ALGORITHM; }
Source:
<code>public synchronized <T extends TopLevelItem> T copy(T src, String name) throws IOException { acl.checkPermission(Item.CREATE); src.checkPermission(Item.EXTENDED_READ); XmlFile srcConfigFile = Items.getConfigFile(src); if (!src.hasPermission(Item.CONFIGURE)) { Matcher matcher = AbstractItem.SECRET_PATTERN.matcher(srcConfigFile.asString()); while (matcher.find()) { if (Secret.decrypt(matcher.group(1)) != null) { throw new AccessDeniedException(Messages.ItemGroupMixIn_may_not_copy_as_it_contains_secrets_and_(src.getFullName(), Jenkins.getAuthentication().getName(), Item.PERMISSIONS.title, Item.EXTENDED_READ.name, Item.CONFIGURE.name)); } } } src.getDescriptor().checkApplicableIn(parent); acl.getACL().checkCreatePermission(parent, src.getDescriptor()); ItemListener.checkBeforeCopy(src, parent); T result = (T)createProject(src.getDescriptor(),name,false); <START> Files.copy(srcConfigFile.getFile().toPath(), Items.getConfigFile(result).getFile().toPath(), <END> StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING); final File rootDir = result.getRootDir(); result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<T,IOException>() { @Override public T call() throws IOException { return (T) Items.load(parent, rootDir); } }); result.onCopiedFrom(src); add(result); ItemListener.fireOnCopied(src,result); Jenkins.getInstance().rebuildDependencyGraphAsync(); return result; }</code><technical_language>want Util#fileToPath well</technical_language>

Target:
public synchronized <T extends TopLevelItem> T copy(T src, String name) throws IOException { acl.checkPermission(Item.CREATE); src.checkPermission(Item.EXTENDED_READ); XmlFile srcConfigFile = Items.getConfigFile(src); if (!src.hasPermission(Item.CONFIGURE)) { Matcher matcher = AbstractItem.SECRET_PATTERN.matcher(srcConfigFile.asString()); while (matcher.find()) { if (Secret.decrypt(matcher.group(1)) != null) { throw new AccessDeniedException(Messages.ItemGroupMixIn_may_not_copy_as_it_contains_secrets_and_(src.getFullName(), Jenkins.getAuthentication().getName(), Item.PERMISSIONS.title, Item.EXTENDED_READ.name, Item.CONFIGURE.name)); } } } src.getDescriptor().checkApplicableIn(parent); acl.getACL().checkCreatePermission(parent, src.getDescriptor()); ItemListener.checkBeforeCopy(src, parent); T result = (T)createProject(src.getDescriptor(),name,false); Files.copy(Util.fileToPath(srcConfigFile.getFile()), Util.fileToPath(Items.getConfigFile(result).getFile()), StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING); final File rootDir = result.getRootDir(); result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<T,IOException>() { @Override public T call() throws IOException { return (T) Items.load(parent, rootDir); } }); result.onCopiedFrom(src); add(result); ItemListener.fireOnCopied(src,result); Jenkins.getInstance().rebuildDependencyGraphAsync(); return result; }
Source:
<code>private HttpMessage makeHttpMessage() throws HttpMalformedHeaderException { HttpMessage httpMessage = new HttpMessage(); SiteNode siteNode = Mockito.mock(SiteNode.class); given(siteNode.getPastHistoryReference()).willReturn(new Vector<>()); HistoryReference ref = Mockito.mock(HistoryReference.class); given(ref.getSiteNode()).willReturn(siteNode); httpMessage.setHistoryRef(ref); httpMessage.setRequestHeader("GET <LINK_0> HTTP/1.1"); httpMessage.setResponseHeader("HTTP/1.1 200 OK"); <START> httpMessage.getResponseHeader().addHeader(HttpResponseHeader.CONTENT_TYPE, "text/html"); <END> return httpMessage; }</code><technical_language>setHeader, result is clearer</technical_language>

Target:
private HttpMessage makeHttpMessage() throws HttpMalformedHeaderException { HttpMessage httpMessage = new HttpMessage(); SiteNode siteNode = Mockito.mock(SiteNode.class); given(siteNode.getPastHistoryReference()).willReturn(new Vector<>()); HistoryReference ref = Mockito.mock(HistoryReference.class); given(ref.getSiteNode()).willReturn(siteNode); httpMessage.setHistoryRef(ref); httpMessage.setRequestHeader("GET <LINK_0> HTTP/1.1"); httpMessage.setResponseHeader("HTTP/1.1 200 OK"); httpMessage.getResponseHeader().setHeader(HttpResponseHeader.CONTENT_TYPE, "text/html"); return httpMessage; }
Source:
<code>public void bufferInput(RowData input) throws Exception { BinaryRowData currentKey = groupKeyProjection.apply(input).copy(); <START> currentKey.setRowKind(input.getRowKind()); <END> if (lastGroupKey == null) { lastGroupKey = currentKey; lastGroupSet = groupSetProjection.apply(input).copy(); } else if (isNewKey(currentKey)) { invokeCurrentBatch(); lastGroupKey = currentKey; lastGroupSet = groupSetProjection.apply(input).copy(); } }</code><technical_language>refactor code a bit avoid duplication</technical_language>

Target:
public void bufferInput(RowData input) throws Exception { BinaryRowData currentKey = groupKeyProjection.apply(input).copy(); if (isNewKey(currentKey)) { if (lastGroupKey != null) { invokeCurrentBatch(); } lastGroupKey = currentKey; lastGroupSet = groupSetProjection.apply(input).copy(); } }
Source:
<code>public void testDataSourceNative() { System.loadLibrary("ctsmediav2codec_jni"); <START> boolean isOk = true; if (!nativeTestDataSource(mInpPrefix + mInpMedia, mInpMediaUrl)) { isOk = false; } <END> assertTrue(testName.getMethodName() + " failed ", isOk); }</code><technical_language>boolean isOK = nativeTestDataSource(mInpPrefix + mInpMedia, mInpMediaUrl); simpler</technical_language>

Target:
public void testDataSourceNative() { System.loadLibrary("ctsmediav2codec_jni"); boolean isOk = nativeTestDataSource(mInpPrefix + mInpMedia, mInpMediaUrl); assertTrue(testName.getMethodName() + " failed ", isOk); }
Source:
<code><START> @Provides @Singleton static TelephonyManager provideTelephonyManager(Context context) { <END> return (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); }</code><technical_language>static if needed</technical_language>

Target:
@Provides @Singleton TelephonyManager provideTelephonyManager(Context context) { return (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); }
Source:
<code>private void maybeAddPlaceholderBoltAggStats(TopologyPageInfo topoPageInfo, StormTopology topology, boolean includeSys) { if (topoPageInfo.get_id_to_bolt_agg_stats().isEmpty()) { Map<String, Bolt> bolts = topology.get_bolts(); for (String boltName : bolts.keySet()) { <START> if (!includeSys && Utils.isSystemId(boltName) || boltName.equals("__system")) { <END> continue; } ComponentAggregateStats placeholderComponentStats = new ComponentAggregateStats(); placeholderComponentStats.set_type(ComponentType.BOLT); CommonAggregateStats commonStats = new CommonAggregateStats(); commonStats.set_num_executors(0); commonStats.set_num_tasks(0); commonStats.set_emitted(0); commonStats.set_transferred(0); commonStats.set_acked(0); placeholderComponentStats.set_common_stats(commonStats); BoltAggregateStats boltAggStats = new BoltAggregateStats(); boltAggStats.set_execute_latency_ms(0); boltAggStats.set_process_latency_ms(0); boltAggStats.set_executed(0); boltAggStats.set_capacity(0); SpecificAggregateStats specificStats = new SpecificAggregateStats(); specificStats.set_bolt(boltAggStats); placeholderComponentStats.set_specific_stats(specificStats); topoPageInfo.get_id_to_bolt_agg_stats().put(boltName, placeholderComponentStats); } } }</code><technical_language>Utils.isSystemId covers boltName.equals("__system"), need call Utils.isSystemId</technical_language>

Target:
private void maybeAddPlaceholderBoltAggStats(TopologyPageInfo topoPageInfo, StormTopology topology, boolean includeSys) { if (topoPageInfo.get_id_to_bolt_agg_stats().isEmpty()) { Map<String, Bolt> bolts = topology.get_bolts(); for (String boltName : bolts.keySet()) { if ((!includeSys && Utils.isSystemId(boltName)) || boltName.equals(Constants.SYSTEM_COMPONENT_ID)) { continue; } ComponentAggregateStats placeholderComponentStats = new ComponentAggregateStats(); placeholderComponentStats.set_type(ComponentType.BOLT); CommonAggregateStats commonStats = new CommonAggregateStats(); commonStats.set_num_executors(0); commonStats.set_num_tasks(0); commonStats.set_emitted(0); commonStats.set_transferred(0); commonStats.set_acked(0); placeholderComponentStats.set_common_stats(commonStats); BoltAggregateStats boltAggStats = new BoltAggregateStats(); boltAggStats.set_execute_latency_ms(0); boltAggStats.set_process_latency_ms(0); boltAggStats.set_executed(0); boltAggStats.set_capacity(0); SpecificAggregateStats specificStats = new SpecificAggregateStats(); specificStats.set_bolt(boltAggStats); placeholderComponentStats.set_specific_stats(specificStats); topoPageInfo.get_id_to_bolt_agg_stats().put(boltName, placeholderComponentStats); } } }
Source:
<code>public void schedule(Job job, Calendar eventAt) { monitor.lock(); try { <START> long sleepTime = eventAt.getTimeInMillis() - new Date().getTime(); <END> ScheduledFuture<?> future = scheduler.schedule(job, sleepTime, TimeUnit.MILLISECONDS); scheduledFutures.add(future); if (logger.isDebugEnabled()) { String formattedDate = DateFormatUtils.ISO_DATETIME_FORMAT.format(eventAt); logger.debug("Scheduled in {}ms (at {})", job, sleepTime, formattedDate); } } finally { monitor.unlock(); } }</code><technical_language>ESH scheduler esp. for Cron Expressions handle time changes? If I change system time, delta needs recalculated, too. Is this out of scope here</technical_language>

Target:
public void schedule(Job job, Calendar eventAt) { long sleepTime; monitor.lock(); try { sleepTime = eventAt.getTimeInMillis() - new Date().getTime(); ScheduledFuture<?> future = scheduler.schedule(job, sleepTime, TimeUnit.MILLISECONDS); scheduledFutures.add(future); } finally { monitor.unlock(); } if (logger.isDebugEnabled()) { String formattedDate = DateFormatUtils.ISO_DATETIME_FORMAT.format(eventAt); logger.debug("Scheduled in {}ms (at {})", job, sleepTime, formattedDate); } }
Source:
<code>public ConsistentHash getReadConsistentHash() { switch (phase) { case STABLE: assert pendingCH == null; assert unionCH == null; return currentCH; case READ_OLD_WRITE_ALL: assert pendingCH != null; assert unionCH != null; return currentCH; case READ_ALL_WRITE_ALL: assert pendingCH != null; return unionCH; case READ_NEW_WRITE_ALL: assert unionCH != null; <START> return pendingCH; <END> } return currentCH; }</code><technical_language>I this a good time rename currentCH oldCH pendingCH newCH. in a separate PR :)</technical_language>

Target:
public ConsistentHash getReadConsistentHash() { switch (phase) { case NO_REBALANCE: assert pendingCH == null; assert unionCH == null; return currentCH; case READ_OLD_WRITE_ALL: assert pendingCH != null; assert unionCH != null; return currentCH; case READ_ALL_WRITE_ALL: assert pendingCH != null; return unionCH; case READ_NEW_WRITE_ALL: assert unionCH != null; return pendingCH; } return currentCH; }
Source:
<code><START> public com.google.common.base.Optional<InterpreterSetting> getDefaultInterpreterSetting(String noteId) { <END> return getDefaultInterpreterSetting(getInterpreterSettings(noteId)); }</code><technical_language>import com.google.common.base.Optional; instead</technical_language>

Target:
public InterpreterSetting getDefaultInterpreterSetting(String noteId) { return getDefaultInterpreterSetting(getInterpreterSettings(noteId)); }
Source:
<code>public void checkoutToRemoteBranch() throws Exception { String pathJavaFile = "src/main/java/che/eclipse/sample/Aclass.java"; String pathJspFile = "src/main/webapp/index.jsp"; String changeContent = String.format(" projectExplorer.waitProjectExplorer(); git.importJavaApp(testRepo.getHtmlUrl(), PROJECT_NAME, MAVEN); projectExplorer.waitAndSelectItem(PROJECT_NAME); checkoutToSecondRemoteBranch(); menu.runCommand(GIT, STATUS); git.waitGitStatusBarWithMess(GIT_STATUS_MESS); performGitPull(); <START> changeContentOnGithubSide(pathJavaFile, changeContent, SECOND_BRANCH); <END> changeContentOnGithubSide(pathJspFile, changeContent, SECOND_BRANCH); git.importJavaApp(testRepo.getHtmlUrl(), PROJECT_NAME2, MAVEN); projectExplorer.waitAndSelectItem(PROJECT_NAME2); checkoutToSecondRemoteBranch(); projectExplorer.quickExpandWithJavaScript(); projectExplorer.openItemByPath(PROJECT_NAME2 + "/src/main/java/che/eclipse/sample/Aclass.java"); editor.waitTextIntoEditor(changeContent); projectExplorer.openItemByPath(PROJECT_NAME2 + "/src/main/webapp/index.jsp"); editor.waitTextIntoEditor(changeContent); }</code><technical_language>replace manual modification of files changing TestGitHubRepository</technical_language>

Target:
public void checkoutToRemoteBranch() throws Exception { String pathJavaFile = "/src/main/java/che/eclipse/sample/Aclass.java"; String pathJspFile = "/src/main/webapp/index.jsp"; String changeContent = String.format(" projectExplorer.waitProjectExplorer(); git.importJavaApp(testRepo.getSshUrl(), PROJECT_NAME, MAVEN); projectExplorer.waitAndSelectItem(PROJECT_NAME); checkoutToSecondRemoteBranch(); menu.runCommand(GIT, STATUS); git.waitGitStatusBarWithMess(GIT_STATUS_MESS); performGitPull(); testProjectServiceClient.updateFile(ws.getId(), PROJECT_NAME + pathJavaFile, changeContent); testProjectServiceClient.updateFile(ws.getId(), PROJECT_NAME + pathJspFile, changeContent); commitFiles(); performGitPush(); git.importJavaApp(testRepo.getHtmlUrl(), PROJECT_NAME2, MAVEN); projectExplorer.waitAndSelectItem(PROJECT_NAME2); checkoutToSecondRemoteBranch(); projectExplorer.quickExpandWithJavaScript(); projectExplorer.openItemByPath(PROJECT_NAME2 + "/src/main/java/che/eclipse/sample/Aclass.java"); editor.waitTextIntoEditor(changeContent); projectExplorer.openItemByPath(PROJECT_NAME2 + "/src/main/webapp/index.jsp"); editor.waitTextIntoEditor(changeContent); projectExplorer.waitAndSelectItem(PROJECT_NAME2 + "/src"); menu.runCommand(GIT, SHOW_HISTORY); git.waitHistoryFormToOpen(); git.waitCommitInHistoryForm(COMMIT_MESS); }
Source:
<code>public void whenPOSTValidEventTypeThenOk() { Map body = buildEventTypeBody("event-name"); final Response response = given().body(body).post("http://localhost:8080/event_types"); response.then().body(equalTo("")); <START> response.then().statusCode(HttpStatus.SC_CREATED); <END> }</code><technical_language>Yes, I agree. change in API</technical_language>

Target:
public void whenPOSTValidEventTypeThenOk() throws JsonProcessingException { EventType eventType = buildEventTypeBody(); String body = mapper.writer().writeValueAsString(eventType); given(). body(body). header("accept", "application/json"). contentType(JSON). when(). post(ENDPOINT). then(). body(equalTo("")). statusCode(HttpStatus.SC_CREATED); }
Source:
<code>public DomainTranslator.ColumnExtractor<Subfield> toColumnExtractor() { return (expression, domain) -> { Type type = expression.getType(); if (isComplexType(type) && !(domain.isOnlyNull() || (domain.getValues().isAll() && !domain.isNullAllowed()))) { return Optional.empty(); } Optional<Subfield> subfield = extract(expression); if (hasSubscripts(subfield)) { <START> if (HiveSessionProperties.isNestedColumnsFilterEnabled(connectorSession)) { <END> return subfield; } return Optional.empty(); } return subfield; }; }</code><technical_language>static import isNestedColumnsFilterEnabled</technical_language>

Target:
public DomainTranslator.ColumnExtractor<Subfield> toColumnExtractor() { return (expression, domain) -> { Type type = expression.getType(); if (isComplexType(type) && !(domain.isOnlyNull() || (domain.getValues().isAll() && !domain.isNullAllowed()))) { return Optional.empty(); } Optional<Subfield> subfield = extract(expression); if (hasSubscripts(subfield)) { if (isNestedColumnsFilterEnabled(connectorSession)) { return subfield; } return Optional.empty(); } return subfield; }; }
Source:
<code>public void close() { log.debug("Closing record collector"); if (eosEnabled) { streamsProducer.abortTransaction(); } <START> streamsProducer.flush(); <END> checkForException(); }</code><technical_language>wondering if introducing a latency regression EOS here: in code closing EOS do nothing, block flushing. other hand, flushing needed close a task tasks' records acked already. If task is in RUNNING shutting down, commit closing, flush is called; if task is in RESTORING / SUSPENDED written this task, a flush is needed. I is safe call flush all</technical_language>

Target:
public void close() { log.debug("Closing record collector"); if (eosEnabled) { streamsProducer.abortTransaction(); } checkForException(); }