auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void submitCallback(final int rc) { if (null != timeout) { timeout.cancel(); } if (LOG.isDebugEnabled()) { LOG.debug("Submit callback (lid:{}, eid: {}). rc:{}", new Object[] { lh.getId(), entryId, rc }); } long latencyNanos = MathUtils.elapsedNanos(requestTimeNanos); if (rc != BKException.Code.OK) { addOpLogger.registerFailedEvent(latencyNanos, TimeUnit.NANOSECONDS); LOG.error("Write of ledger entry to quorum failed: L{} E{}", lh.getId(), entryId); } else { addOpLogger.registerSuccessfulEvent(latencyNanos, TimeUnit.NANOSECONDS); } cb.addComplete(rc, lh, entryId, ctx); <START> ReferenceCountUtil.release(toSend); <END> }</code><technical_language>I this change is necessary. release trigger callback, touch anymore this point</technical_language>

Target:
void submitCallback(final int rc) { ReferenceCountUtil.release(toSend); if (null != timeout) { timeout.cancel(); } if (LOG.isDebugEnabled()) { LOG.debug("Submit callback (lid:{}, eid: {}). rc:{}", new Object[] { lh.getId(), entryId, rc }); } long latencyNanos = MathUtils.elapsedNanos(requestTimeNanos); if (rc != BKException.Code.OK) { addOpLogger.registerFailedEvent(latencyNanos, TimeUnit.NANOSECONDS); LOG.error("Write of ledger entry to quorum failed: L{} E{}", lh.getId(), entryId); } else { addOpLogger.registerSuccessfulEvent(latencyNanos, TimeUnit.NANOSECONDS); } cb.addComplete(rc, lh, entryId, ctx); cbCompleted = true; }
Source:
<code>public void testShutdownService() throws Exception { service.shutdown(); service.awaitTermination(1000, TimeUnit.MILLISECONDS); try { <START> createExecutor(DEFAULT_OPTIONS).batch(Arrays.asList(new Put(EMPTY_KEY))); <END> } catch (RetriesExhaustedWithDetailsException e) { Assert.assertEquals(1, e.getCauses().size()); Assert.assertEquals(IOException.class, e.getCause(0).getClass()); Assert.assertTrue(e.getCause(0).getMessage().toLowerCase().contains("closed")); } }</code><technical_language>new Put(EMPTY_KEY)</technical_language>

Target:
public void testShutdownService() throws Exception { service.shutdown(); service.awaitTermination(1000, TimeUnit.MILLISECONDS); try { batch(Arrays.asList(randomPut())); } catch (RetriesExhaustedWithDetailsException e) { Assert.assertEquals(1, e.getCauses().size()); Assert.assertEquals(IOException.class, e.getCause(0).getClass()); Assert.assertTrue(e.getCause(0).getMessage().toLowerCase().contains("closed")); } }
Source:
<code>ChannelStateWriteRequestDispatcherImpl(CheckpointStorageWorkerView streamFactoryResolver, ChannelStateSerializer serializer) { this.writers = new HashMap<>(); this.streamFactoryResolver = streamFactoryResolver; <START> this.serializer = serializer; <END> }</code><technical_language>nit: initialize field directly? (not default is, pointing out)</technical_language>

Target:
ChannelStateWriteRequestDispatcherImpl(CheckpointStorageWorkerView streamFactoryResolver, ChannelStateSerializer serializer) { this.writers = new HashMap<>(); this.streamFactoryResolver = checkNotNull(streamFactoryResolver); this.serializer = checkNotNull(serializer); }
Source:
<code>private void updateVertexBuffers() { <START> if(isUpdatingVertexBuffers) { <END> return; } ThreadHelper.invokeLater(()-> { isUpdatingVertexBuffers = true; if (this.isDrawable) { Color color; int vertIndex = 0; int colorIndex = 0; byte[] c = new byte[3]; for (LineSegment ls : gcodeLineList) { if (ls.isArc()) { color = arcColor; } else if (ls.isFastTraverse()) { color = rapidColor; } else if (ls.isZMovement()) { color = plungeColor; } else { color = linearColor; } if (ls.getLineNumber() < this.currentCommandNumber) { color = completedColor; } { Point3d p1 = ls.getStart(); Point3d p2 = ls.getEnd(); c[0] = (byte) color.getRed(); c[1] = (byte) color.getGreen(); c[2] = (byte) color.getBlue(); lineColorData[colorIndex++] = c[0]; lineColorData[colorIndex++] = c[1]; lineColorData[colorIndex++] = c[2]; lineColorData[colorIndex++] = c[0]; lineColorData[colorIndex++] = c[1]; lineColorData[colorIndex++] = c[2]; lineVertexData[vertIndex++] = (float) p1.x; lineVertexData[vertIndex++] = (float) p1.y; lineVertexData[vertIndex++] = (float) p1.z; lineVertexData[vertIndex++] = (float) p2.x; lineVertexData[vertIndex++] = (float) p2.y; lineVertexData[vertIndex++] = (float) p2.z; } } this.colorArrayDirty = true; this.vertexArrayDirty = true; } isUpdatingVertexBuffers = false; }); }</code><technical_language>technically a race condition here, I this function needs synchronized, set isUpdatingVertexBiffers flag invokeLater</technical_language>

Target:
private void updateVertexBuffers() { if (this.isDrawable) { Color color; int vertIndex = 0; int colorIndex = 0; byte[] c = new byte[3]; for (LineSegment ls : gcodeLineList) { if (ls.isArc()) { color = arcColor; } else if (ls.isFastTraverse()) { color = rapidColor; } else if (ls.isZMovement()) { color = plungeColor; } else { color = linearColor; } if (ls.getLineNumber() < this.currentCommandNumber) { color = completedColor; } { Point3d p1 = ls.getStart(); Point3d p2 = ls.getEnd(); c[0] = (byte) color.getRed(); c[1] = (byte) color.getGreen(); c[2] = (byte) color.getBlue(); lineColorData[colorIndex++] = c[0]; lineColorData[colorIndex++] = c[1]; lineColorData[colorIndex++] = c[2]; lineColorData[colorIndex++] = c[0]; lineColorData[colorIndex++] = c[1]; lineColorData[colorIndex++] = c[2]; lineVertexData[vertIndex++] = (float) p1.x; lineVertexData[vertIndex++] = (float) p1.y; lineVertexData[vertIndex++] = (float) p1.z; lineVertexData[vertIndex++] = (float) p2.x; lineVertexData[vertIndex++] = (float) p2.y; lineVertexData[vertIndex++] = (float) p2.z; } } this.colorArrayDirty = true; this.vertexArrayDirty = true; } }
Source:
<code>public void testAppPath() throws Exception { <START> TestGeneratorInputOperator o1 = dag.addOperator("o1", TestGeneratorInputOperator.class); <END> o1.setMaxTuples(1); File relPath = new File(dag.getAttributes().get(DAGContext.APPLICATION_PATH)); String uriPath = relPath.toURI().toString(); dag.setAttribute(DAGContext.APPLICATION_PATH, uriPath); StramLocalCluster cluster = new StramLocalCluster(dag); cluster.shutdown(); Assert.assertTrue("app path exists", relPath.exists() && relPath.isDirectory()); File checkPointDir = new File(relPath, LogicalPlan.SUBDIR_CHECKPOINTS); Assert.assertTrue("checkpoint path exists", checkPointDir.exists() && checkPointDir.isDirectory()); }</code><technical_language>o1 is used</technical_language>

Target:
public void testAppPath() throws Exception { TestGeneratorInputOperator o1 = dag.addOperator("o1", TestGeneratorInputOperator.class); o1.setMaxTuples(1); File relPath = new File(dag.getAttributes().get(DAGContext.APPLICATION_PATH)); String uriPath = relPath.toURI().toString(); dag.setAttribute(DAGContext.APPLICATION_PATH, uriPath); StramLocalCluster cluster = new StramLocalCluster(dag); Assert.assertFalse(cluster.isFinished()); Assert.assertTrue("app path exists", relPath.exists() && relPath.isDirectory()); File checkPointDir = new File(relPath, LogicalPlan.SUBDIR_CHECKPOINTS); Assert.assertTrue("checkpoint path exists", checkPointDir.exists() && checkPointDir.isDirectory()); }
Source:
<code>private VdsNetworkInterface findNicToSetupManagementNetwork() { VdsNetworkInterface nic = Entities.entitiesByName(host.getInterfaces()).get(host.getActiveNic()); if (nic == null) { log.warn("Failed to find a valid interface for the management network." + " If the interface is a bridge, it should be torn-down manually.", host.getActiveNic(), host.getName()); throw new NetworkConfiguratorException( <START> String.format("Invalid interface for management network")); <END> } Network managementNetwork = getDbFacade().getNetworkDao() .getByNameAndDataCenter(NetworkUtils.getEngineNetwork(), host.getStoragePoolId()); if (managementNetwork.getName().equals(nic.getNetworkName())) { return null; } if (!nicHasValidVlanId(managementNetwork, nic)) { final AuditLogableBase event = createEvent(); event.addCustomValue("VlanId", resolveVlanId(nic.getVlanId())); event.addCustomValue("MgmtVlanId", resolveVlanId(managementNetwork.getVlanId())); event.addCustomValue("InterfaceName", nic.getName()); AuditLogDirector.log(event, AuditLogType.VLAN_ID_MISMATCH_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } return nic; }</code><technical_language>I activeNic part of exception message - in debugging. Note null... a bridge, OVS etc..</technical_language>

Target:
private VdsNetworkInterface findNicToSetupManagementNetwork() { VdsNetworkInterface nic = Entities.entitiesByName(host.getInterfaces()).get(host.getActiveNic()); if (nic == null) { log.warn("Failed to find a valid interface for the management network of host {}." + " If the interface is a bridge, it should be torn-down manually.", host.getName(), host.getActiveNic()); throw new NetworkConfiguratorException( String.format("Interface %s is invalid for management network", host.getActiveNic())); } final Network managementNetwork = getManagementNetworkUtil().getManagementNetwork(host.getVdsGroupId()); if (managementNetwork.getName().equals(nic.getNetworkName())) { return null; } if (!nicHasValidVlanId(managementNetwork, nic)) { final AuditLogableBase event = createEvent(); event.addCustomValue("VlanId", resolveVlanId(nic.getVlanId())); event.addCustomValue("MgmtVlanId", resolveVlanId(managementNetwork.getVlanId())); event.addCustomValue("InterfaceName", nic.getName()); auditLogDirector.log(event, AuditLogType.VLAN_ID_MISMATCH_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } return nic; }
Source:
<code>static InetSocketAddress getResolvedHttpProxyAddress(String host, int port) throws IOException { InetSocketAddress targetAddress = null; Iterator<Proxy> proxies = ProxySelector.getDefault().select(URI.create(String.format("http://%s:%d", host, port))).iterator(); while (targetAddress == null && proxies.hasNext()) { Proxy proxy = proxies.next(); if (proxy.type() == Proxy.Type.HTTP) { if (!(proxy.address() instanceof InetSocketAddress)) <START> throw new IOException("Unsupported proxy address type " + proxy.address().getClass()); <END> InetSocketAddress proxyAddress = (InetSocketAddress) proxy.address(); if(proxyAddress.isUnresolved()) proxyAddress = new InetSocketAddress(proxyAddress.getHostName(), proxyAddress.getPort()); targetAddress = proxyAddress; } } if (targetAddress == null) { String httpProxy = System.getenv("http_proxy"); if (httpProxy != null) { try { URL url = new URL(httpProxy); targetAddress = new InetSocketAddress(url.getHost(), url.getPort()); } catch (MalformedURLException e) { LOGGER.log(Level.WARNING, INVALID_HTTP_PROXY_MSG + " HTTP Proxy: " + httpProxy); } } } return targetAddress; }</code><technical_language><code>proxy.address</code> return null if is a direct connection. In case NPE in routine. If I understand code correctly, <code> getResolvedHttpProxyAddress</code> return null in case invoke no-proxy logic in calling method</technical_language>

Target:
static InetSocketAddress getResolvedHttpProxyAddress(String host, int port) throws IOException { InetSocketAddress targetAddress = null; Iterator<Proxy> proxies = ProxySelector.getDefault().select(URI.create(String.format("http://%s:%d", host, port))).iterator(); while (targetAddress == null && proxies.hasNext()) { Proxy proxy = proxies.next(); if (proxy.type() == Proxy.Type.HTTP) { if (!(proxy.address() instanceof InetSocketAddress)) { throw new IOException("Unsupported proxy address type " + proxy.address().getClass()); } InetSocketAddress proxyAddress = (InetSocketAddress) proxy.address(); if (proxyAddress == null) { targetAddress = null; } else if (proxyAddress.isUnresolved()) { proxyAddress = new InetSocketAddress(proxyAddress.getHostName(), proxyAddress.getPort()); } targetAddress = proxyAddress; } } if (targetAddress == null) { String httpProxy = System.getenv("http_proxy"); if (httpProxy != null) { try { URL url = new URL(httpProxy); targetAddress = new InetSocketAddress(url.getHost(), url.getPort()); } catch (MalformedURLException e) { LOGGER.log(Level.WARNING, INVALID_HTTP_PROXY_MSG + " HTTP Proxy: " + httpProxy); } } } return targetAddress; }
Source:
<code>public void shouldReturnEmptyResultWhenFileNotFound() { <START> Review review = new Review(ImmutableList.of(new ReviewFile("test"))); <END> ReviewResult reviewResult = fixture.process(review); assertThat(reviewResult).isNotNull(); assert reviewResult != null; assertThat(reviewResult.getViolations()).isEmpty(); }</code><technical_language>this test passes change remove this line</technical_language>

Target:
public void shouldReturnEmptyResultWhenFileNotFound() { Review review = new Review(ImmutableList.of(new ReviewFile("test"))); ReviewResult reviewResult = fixture.process(mock(Review.class)); assertThat(reviewResult).isNotNull(); assert reviewResult != null; assertThat(reviewResult.getViolations()).isEmpty(); }
Source:
<code><START> public void push(T value) { <END> Element<T> newElement = new Element<>(value); this.size++; if (Objects.isNull(head)) { head = newElement; } else { newElement.next = head; head = newElement; } }</code><technical_language>This allows null values, fine</technical_language>

Target:
public final void push(T value) { Element<T> newElement = new Element<>(value); this.size++; if (Objects.isNull(head)) { head = newElement; } else { newElement.next = head; head = newElement; } }
Source:
<code>public Iterable<Component> getStatusMessages() { <START> return Lists.newArrayList(TranslatableComponent.of("worldedit.operation.deform.expression", <END> TextComponent.of(expression).color(TextColor.LIGHT_PURPLE))); }</code><technical_language>prefer ImmutableList.of here, in other getStatusMessages well</technical_language>

Target:
public Iterable<Component> getStatusMessages() { return ImmutableList.of(TranslatableComponent.of("worldedit.operation.deform.expression", TextComponent.of(expression).color(TextColor.LIGHT_PURPLE))); }
Source:
<code>private void onTrendsTabSelected() { mainTabPanel.forceLayout(); controlTree.onSummaryTrendsTab(); if (!chosenMetrics.isEmpty() && hasChanged) { for(Map.Entry<MetricNode, SummaryIntegratedDto> entry : chosenMetrics.entrySet()) { String plotId = entry.getKey().getId(); if (plotTrendsPanel.containsElementWithId(plotId)) { continue; } <START> SummaryIntegratedDto cur = entry.getValue(); <END> renderPlots( plotTrendsPanel, entry.getKey(), cur.getPlotIntegratedDto(), plotId, true ); plotTrendsPanel.scrollToBottom(); } hasChanged = false; } }</code><technical_language>cur is redundant</technical_language>

Target:
private void onTrendsTabSelected() { mainTabPanel.forceLayout(); controlTree.onSummaryTrendsTab(); if (!chosenMetrics.isEmpty() && hasChanged) { for(Map.Entry<MetricNode, SummaryIntegratedDto> entry : chosenMetrics.entrySet()) { String plotId = entry.getKey().getId(); if (plotTrendsPanel.containsElementWithId(plotId)) { continue; } renderPlots( plotTrendsPanel, entry.getKey(), entry.getValue().getPlotIntegratedDto(), plotId, true ); plotTrendsPanel.scrollToBottom(); } hasChanged = false; } }
Source:
<code><START> public void restart(){ <END> }</code><technical_language>throw UnsupportedException here</technical_language>

Target:
public void restart(){ throw new UnsupportedOperationException("Restart container is not supported with Docker Compose"); }
Source:
<code>private void loadPlugins(String[] pluginsUrls) { for (final String url : pluginsUrls) { ScriptInjector.fromUrl(url) .setWindow(ScriptInjector.TOP_WINDOW) .setCallback(new Callback<Void, Exception>() { @Override public void onSuccess(Void result) { } @Override public void onFailure(Exception reason) { <START> new ErrorDialog("Failed load pluing: " + url).show(); <END> } }).inject(); } }</code><technical_language>"Failed load pluing" -> "Failed load plugin"</technical_language>

Target:
private void loadPlugins(String[] pluginsUrls) { for (final String url : pluginsUrls) { ScriptInjector.fromUrl(url) .setWindow(ScriptInjector.TOP_WINDOW) .setCallback(new Callback<Void, Exception>() { @Override public void onSuccess(Void result) { } @Override public void onFailure(Exception reason) { new ErrorDialog("Failed to load plugin: " + url).show(); } }).inject(); } }
Source:
<code>public List<Object> getScatterPlotPointsOfLatestVersion(long datasetId, ScatterPlotPoints scatterPlotPoints) throws MLDataProcessingException { try { List<MLDatasetVersion> versions = databaseService.getAllVersionsetsOfDataset( scatterPlotPoints.getTenantId(), scatterPlotPoints.getUser(), datasetId); <START> if (versions.size() < 1) { <END> throw new MLDataProcessingException(String.format("%s is not a valid dataset Id", datasetId)); } long versionsetId = versions.get(versions.size() - 1).getId(); scatterPlotPoints.setVersionsetId(versionsetId); return databaseService.getScatterPlotPoints(scatterPlotPoints); } catch (DatabaseHandlerException e) { throw new MLDataProcessingException(e.getMessage(), e); } }</code><technical_language>equate 0</technical_language>

Target:
public List<Object> getScatterPlotPointsOfLatestVersion(long datasetId, ScatterPlotPoints scatterPlotPoints) throws MLDataProcessingException { try { List<MLDatasetVersion> versions = databaseService.getAllVersionsetsOfDataset( scatterPlotPoints.getTenantId(), scatterPlotPoints.getUser(), datasetId); if (versions.size() == 0) { throw new MLDataProcessingException(String.format("%s is not a valid dataset Id", datasetId)); } long versionsetId = versions.get(versions.size() - 1).getId(); scatterPlotPoints.setVersionsetId(versionsetId); return databaseService.getScatterPlotPoints(scatterPlotPoints); } catch (DatabaseHandlerException e) { throw new MLDataProcessingException(e.getMessage(), e); } }
Source:
<code>public void testValidateCodeFoundByCodingUrlNotMatch() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-5").setSystem("http://url2"))); try { <START> myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); <END> } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: Coding.system 'http://url2' does not equal with CodeSystem.url '<LINK_0>'. Unable to validate.",e.getMessage()); } }</code><technical_language>Suggestion: again, include a JUnit fail() statement this statement, in case exception is thrown expected</technical_language>

Target:
public void testValidateCodeFoundByCodingUrlNotMatch() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-5").setSystem("http://url2"))); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); fail(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: Coding.system 'http://url2' does not equal with CodeSystem.url '<LINK_0>'. Unable to validate.",e.getMessage()); } }
Source:
<code>public NodeSelector createNodeSelector(ConnectorId connectorId, int maxTasksPerStage) { Supplier<NodeMap> nodeMap = Suppliers.memoizeWithExpiration(() -> { ImmutableMap.Builder<String, InternalNode> byNodeId = ImmutableMap.builder(); ImmutableSetMultimap.Builder<HostAddress, InternalNode> byHostAndPort = ImmutableSetMultimap.builder(); ImmutableSetMultimap.Builder<InetAddress, InternalNode> byHost = ImmutableSetMultimap.builder(); ImmutableSetMultimap.Builder<NetworkLocation, InternalNode> workersByNetworkPath = ImmutableSetMultimap.builder(); Set<InternalNode> nodes; if (connectorId != null) { nodes = nodeManager.getActiveConnectorNodes(connectorId); } else { nodes = nodeManager.getNodes(ACTIVE); } Set<String> coordinatorNodeIds = nodeManager.getCoordinators().stream() .map(InternalNode::getNodeIdentifier) .collect(toImmutableSet()); for (InternalNode node : nodes) { byNodeId.put(node.getNodeIdentifier(), node); if (useNetworkTopology && (includeCoordinator || !coordinatorNodeIds.contains(node.getNodeIdentifier()))) { NetworkLocation location = networkLocationCache.get(node.getHostAndPort()); for (int i = 0; i <= location.getSegments().size(); i++) { workersByNetworkPath.put(location.subLocation(0, i), node); } } try { byHostAndPort.put(node.getHostAndPort(), node); InetAddress host = InetAddress.getByName(node.getInternalUri().getHost()); byHost.put(host, node); } catch (UnknownHostException e) { } } return new NodeMap(byNodeId.build(), byHostAndPort.build(), byHost.build(), workersByNetworkPath.build(), coordinatorNodeIds); <START> }, nodeMapRefreshInNanos, TimeUnit.NANOSECONDS); <END> if (useNetworkTopology) { return new TopologyAwareNodeSelector( nodeManager, nodeTaskMap, includeCoordinator, nodeMap, minCandidates, maxSplitsPerNode, maxPendingSplitsPerTask, topologicalSplitCounters, networkLocationSegmentNames, networkLocationCache); } else { return new SimpleNodeSelector(nodeManager, nodeTaskMap, includeCoordinator, nodeMap, minCandidates, maxSplitsPerNode, maxPendingSplitsPerTask, maxTasksPerStage); } }</code><technical_language>memoizeWithExpiration supplier allow 0 =\ I recommend a condition here. If duration is 0, create a regular supplier. memoizeWithExpiration one</technical_language>

Target:
public NodeSelector createNodeSelector(ConnectorId connectorId, int maxTasksPerStage) { Supplier<NodeMap> nodeMap = nodeMapRefreshInterval.toMillis() > 0 ? memoizeWithExpiration(createNodeMapSupplier(connectorId), nodeMapRefreshInterval.toMillis(), MILLISECONDS) : createNodeMapSupplier(connectorId); if (useNetworkTopology) { return new TopologyAwareNodeSelector( nodeManager, nodeTaskMap, includeCoordinator, nodeMap, minCandidates, maxSplitsPerNode, maxPendingSplitsPerTask, topologicalSplitCounters, networkLocationSegmentNames, networkLocationCache); } else { return new SimpleNodeSelector(nodeManager, nodeTaskMap, includeCoordinator, nodeMap, minCandidates, maxSplitsPerNode, maxPendingSplitsPerTask, maxTasksPerStage); } }
Source:
<code>private void deleteFromMessageMonitoringDB(final MonitoredMessage trackMessage) { try { MessageMonitoringDAOImpl.getInstance().deleteCompletedMessages(trackMessage); } catch (final MessageMonitoringDAOException ex) { LOG.debug("Error While deleting Message from MessageMonitoring Table: {}", ex); <START> return; <END> } LOG.debug("Completed message deleted."); }</code><technical_language>remove return</technical_language>

Target:
private void deleteFromMessageMonitoringDB(final MonitoredMessage trackMessage) { try { MessageMonitoringDAOImpl.getInstance().deleteCompletedMessages(trackMessage); } catch (final MessageMonitoringDAOException ex) { LOG.debug("Error While deleting Message from MessageMonitoring Table: {}", ex); } LOG.debug("Completed message deleted."); }
Source:
<code>private TypedValue createTypedValue(CursorQuad cursorQuad, DataSet dataSet) { <START> String type = cursorQuad.getValuetype().isPresent() ? cursorQuad.getValuetype().get() : RdfConstants.STRING; <END> return TypedValue.create(cursorQuad.getObject(), type, dataSet); }</code><technical_language><LINK_0></technical_language>

Target:
private TypedValue createTypedValue(CursorQuad cursorQuad, DataSet dataSet) { String type = cursorQuad.getValuetype().isPresent() ? cursorQuad.getValuetype().get() : RdfConstants.URI; return TypedValue.create(cursorQuad.getObject(), type, dataSet); }
Source:
<code>boolean isEitherPasswordOrPrivateKeyAndPassPhrase() { if (!StringUtils.hasText(password)) { return StringUtils.hasText(privateKey) && StringUtils.hasText(passPhrase); } else { <START> return !StringUtils.hasText(privateKey) && !StringUtils.hasText(passPhrase); <END> } }</code><technical_language>need else here. bad java XOR :)</technical_language>

Target:
boolean isEitherPasswordOrPrivateKeyAndPassPhrase() { if (!StringUtils.hasText(password)) { return StringUtils.hasText(privateKey) && StringUtils.hasText(passPhrase); } return !StringUtils.hasText(privateKey) && !StringUtils.hasText(passPhrase); }
Source:
<code>public Option[] config() { return new Option[]{ karafDistributionConfiguration().frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").versionAsInProject().type("tar.gz")) .karafVersion(MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf")).name("Apache Karaf").unpackDirectory(new File("target/exam")), keepRuntimeFolder(), logLevel(LogLevelOption.LogLevel.INFO), replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", getConfigFile("/etc/org.ops4j.pax.logging.cfg")), editConfigurationFilePut("etc/system.properties", "hibernate3.version", System.getProperty("hibernate3.version")), editConfigurationFilePut("etc/system.properties", "hibernate42.version", System.getProperty("hibernate42.version")), editConfigurationFilePut("etc/system.properties", "hibernate43.version", System.getProperty("hibernate43.version")), editConfigurationFilePut("etc/system.properties", "spring31.version", System.getProperty("spring31.version")), editConfigurationFilePut("etc/system.properties", "spring32.version", System.getProperty("spring32.version")), editConfigurationFilePut("etc/system.properties", "spring40.version", System.getProperty("spring40.version")), <START> editConfigurationFilePut("etc/system.properties", "spring41.version", System.getProperty("spring41.version")) <END> }; }</code><technical_language>a spring 4.2 version</technical_language>

Target:
public Option[] config() { return new Option[]{ karafDistributionConfiguration() .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").versionAsInProject().type("tar.gz")) .karafVersion(MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf")) .name("Apache Karaf") .unpackDirectory(new File("target/karaf")), keepRuntimeFolder(), configureConsole().ignoreRemoteShell(), logLevel(LogLevelOption.LogLevel.WARN), replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", getConfigFile("/etc/org.ops4j.pax.logging.cfg")), editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", Integer.toString(AvailablePortFinder.getNextAvailable())), editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", Integer.toString(AvailablePortFinder.getNextAvailable())), editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", Integer.toString(AvailablePortFinder.getNextAvailable())), junitBundles(), KarafDistributionOption.features(getCamelKarafFeatureUrl(), "camel", "camel-test"), mavenBundle().groupId("org.apache.camel").artifactId("camel-test-karaf").versionAsInProject() }; }
Source:
<code>protected List<String> getCommandLineArgs(RuntimeIdentity runtimeId) { return new ArrayList<String>( Arrays.asList( <START> "-push-endpoint", cheWebsocketEndpoint, "-runtime-id", String.format( "%s:%s:%s", runtimeId.getWorkspaceId(), MoreObjects.firstNonNull(runtimeId.getEnvName(), ""), runtimeId.getOwnerId()), "-cacert", certProvisioner.isConfigured() ? certProvisioner.getCertPath() : "", "--registry-address", Strings.nullToEmpty(pluginRegistryUrl))); <END> }</code><technical_language>This is unrelated current PR, -argument strange a UNIX perspective, dashes for long args for short version (e.g. -v, --version). change this suggestion "--push-endpoint", cheWebsocketEndpoint, "--runtime-id", String.format( "%s:%s:%s", runtimeId.getWorkspaceId(), MoreObjects.firstNonNull(runtimeId.getEnvName(), ""), runtimeId.getOwnerId()), "--cacert", certProvisioner.isConfigured() ? certProvisioner.getCertPath() : "", "--registry-address", Strings.nullToEmpty(pluginRegistryUrl)));</technical_language>

Target:
protected List<String> getCommandLineArgs(RuntimeIdentity runtimeId) { return new ArrayList<String>( Arrays.asList( "--push-endpoint", cheWebsocketEndpoint, "--runtime-id", String.format( "%s:%s:%s", runtimeId.getWorkspaceId(), MoreObjects.firstNonNull(runtimeId.getEnvName(), ""), runtimeId.getOwnerId()), "--cacert", certProvisioner.isConfigured() ? certProvisioner.getCertPath() : "", "--registry-address", Strings.nullToEmpty(pluginRegistryUrl))); }
Source:
<code>private PdpFeedFileBaseEntry buildPdpFeedFileBaseEntry(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) { KualiDecimal pdpTotal = KualiDecimal.ZERO; PdpFeedFileBaseEntry pdpFeedFileBaseEntry = new PdpFeedFileBaseEntry(); pdpFeedFileBaseEntry.setVersion(ConcurConstants.StandardAccountingExtractPdpConstants.FEED_FILE_ENTRY_HEADER_VERSION); pdpFeedFileBaseEntry.setHeader( getConcurStandardAccountExtractPdpEntryService().buildPdpFeedHeaderEntry(concurStandardAccountingExtractFile.getBatchDate())); for (ConcurStandardAccountingExtractDetailLine line : concurStandardAccountingExtractFile.getConcurStandardAccountingExtractDetailLines()) { if (StringUtils.equalsIgnoreCase(line.getPaymentCode(), ConcurConstants.StandardAccountingExtractPdpConstants.PAYMENT_CODE_CASH)) { if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountingExtractDetailLine(line)) { PdpFeedGroupEntry currentGroup = getGroupEntryForLine(pdpFeedFileBaseEntry, line); PdpFeedDetailEntry currentDetail = getDetailEntryForLine(currentGroup, line); PdpFeedAccountingEntry currentAccounting = getAccountingEntryForLine(currentDetail, line); pdpTotal = pdpTotal.add(line.getJournalAmount()); <START> String newAmount = addAmounts(currentAccounting.getAmount(), line.getJournalAmount()); <END> currentAccounting.setAmount(newAmount); } } } pdpFeedFileBaseEntry.setTrailer(buildPdpFeedTrailerEntry(pdpFeedFileBaseEntry, pdpTotal)); return pdpFeedFileBaseEntry; }</code><technical_language>dealing debits credits for amounts need consolidating, potential deal both? Also, for credits, verify values need positive negative</technical_language>

Target:
private PdpFeedFileBaseEntry buildPdpFeedFileBaseEntry(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile) { KualiDecimal pdpTotal = KualiDecimal.ZERO; PdpFeedFileBaseEntry pdpFeedFileBaseEntry = new PdpFeedFileBaseEntry(); pdpFeedFileBaseEntry.setVersion(ConcurConstants.StandardAccountingExtractPdpConstants.FEED_FILE_ENTRY_HEADER_VERSION); pdpFeedFileBaseEntry.setHeader( getConcurStandardAccountExtractPdpEntryService().buildPdpFeedHeaderEntry(concurStandardAccountingExtractFile.getBatchDate())); for (ConcurStandardAccountingExtractDetailLine line : concurStandardAccountingExtractFile.getConcurStandardAccountingExtractDetailLines()) { replacePendingClientWithOverride(line); if (StringUtils.equalsIgnoreCase(line.getPaymentCode(), ConcurConstants.PAYMENT_CODE_CASH)) { if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountingExtractDetailLine(line)) { buildAndUpdateAccountingEntryFromLine(pdpFeedFileBaseEntry, line); pdpTotal = pdpTotal.add(line.getJournalAmount()); } } } pdpFeedFileBaseEntry.setTrailer(getConcurStandardAccountExtractPdpEntryService().buildPdpFeedTrailerEntry(pdpFeedFileBaseEntry, pdpTotal)); return pdpFeedFileBaseEntry; }
Source:
<code>private void runJob(long transactionId, OptionalInt bucketNumber, long tableId, Set<UUID> shardUuids) throws IOException { TableMetadata metadata = getTableMetadata(tableId); List<ShardInfo> newShards = performCompaction(transactionId, bucketNumber, shardUuids, metadata); log.info("Compacted shards %s into %s", shardUuids, newShards.stream().map(ShardInfo::getShardUuid).collect(toList())); <START> shardManager.replaceShardUuids(transactionId, tableId, metadata.getColumns(), null, newShards, OptionalLong.empty(), false); <END> }</code><technical_language>do pass in null</technical_language>

Target:
private void runJob(long transactionId, OptionalInt bucketNumber, long tableId, Set<UUID> shardUuids) throws IOException { TableMetadata metadata = getTableMetadata(tableId); List<ShardInfo> newShards = performCompaction(transactionId, bucketNumber, shardUuids, metadata); log.info("Compacted shards %s into %s", shardUuids, newShards.stream().map(ShardInfo::getShardUuid).collect(toList())); }
Source:
<code>public Context getContext() { if (sdkName == null) { sdkName = this.getClass().getPackage().getName(); } return new Context("Sdk-Name", sdkName) <START> .addData("Sdk-Version", SDK_VERSION); <END> }</code><technical_language>sdk version hardcoded</technical_language>

Target:
public Context getContext() { return new Context("Sdk-Name", sdkName) .addData("Sdk-Version", SDK_VERSION); }
Source:
<code>public void testShallowCommitParse() throws Exception { RevCommit a = commit(); RevCommit b = commit(a); createShallowFile(b); <START> rw = createRevWalk(); <END> b = rw.parseCommit(b); markStart(b); assertCommit(b, rw.next()); assertNull(rw.next()); }</code><technical_language>Leaks ObjectReader</technical_language>

Target:
public void testShallowCommitParse() throws Exception { RevCommit a = commit(); RevCommit b = commit(a); createShallowFile(b); rw.close(); rw = createRevWalk(); b = rw.parseCommit(b); markStart(b); assertCommit(b, rw.next()); assertNull(rw.next()); }
Source:
<code>public void testBackgroundUpdater() throws InterruptedException, SQLException, IOException { mySqlConfigProps.setProperty(UPDATER_POLLING_INTERVAL_SECONDS, "1"); Account testAccount = new AccountBuilder((short) 1, "testAccount1", Account.AccountStatus.ACTIVE).build(); when(mockMySqlAccountStore.getNewAccounts(anyLong())).thenReturn(new ArrayList<>()) .thenReturn(new ArrayList<>(Collections.singletonList(testAccount))); mySqlAccountService = getAccountService(); assertEquals("Background account updater thread should have been started", 1, numThreadsByThisName(MySqlAccountService.MYSQL_ACCOUNT_UPDATER_PREFIX)); assertNull("Cache should be empty", mySqlAccountService.getAccountById(testAccount.getId())); Thread.sleep(Long.parseLong(mySqlConfigProps.getProperty(UPDATER_POLLING_INTERVAL_SECONDS)) * 1000 + 100); assertEquals("Mismatch in account retrieved by ID", testAccount, mySqlAccountService.getAccountById(testAccount.getId())); mySqlAccountService.close(); mySqlAccountService.getScheduler().shutdownNow(); <START> Thread.sleep(100); <END> assertEquals("Background account updater thread should be stopped", 0, numThreadsByThisName(MySqlAccountService.MYSQL_ACCOUNT_UPDATER_PREFIX)); }</code><technical_language>For cases a poll timeout is needed, a test utility used: TestUtils.checkAndSleep(0, () -> numThreadsByThisName(MySqlAccountService.MYSQL_ACCOUNT_UPDATER_PREFIX), 200);</technical_language>

Target:
public void testBackgroundUpdater() throws InterruptedException, SQLException, IOException { mySqlConfigProps.setProperty(UPDATER_POLLING_INTERVAL_SECONDS, "1"); Account testAccount = new AccountBuilder((short) 1, "testAccount1", Account.AccountStatus.ACTIVE).build(); when(mockMySqlAccountStore.getNewAccounts(anyLong())).thenReturn(new ArrayList<>()) .thenReturn(new ArrayList<>(Collections.singletonList(testAccount))); mySqlAccountService = getAccountService(); assertEquals("Background account updater thread should have been started", 1, numThreadsByThisName(MySqlAccountService.MYSQL_ACCOUNT_UPDATER_PREFIX)); assertNull("Cache should be empty", mySqlAccountService.getAccountById(testAccount.getId())); Thread.sleep(Long.parseLong(mySqlConfigProps.getProperty(UPDATER_POLLING_INTERVAL_SECONDS)) * 1000 + 100); assertEquals("Mismatch in account retrieved by ID", testAccount, mySqlAccountService.getAccountById(testAccount.getId())); mySqlAccountService.close(); mySqlAccountService.getScheduler().shutdownNow(); assertTrue("Background account updater thread should be stopped", TestUtils.checkAndSleep(0, () -> numThreadsByThisName(MySqlAccountService.MYSQL_ACCOUNT_UPDATER_PREFIX), 1000)); }
Source:
<code>default int compareTo(@Nullable ISegment arg0) { if (arg0 == null) { throw new IllegalArgumentException("Cannot compared to null"); } <START> return DEFAULT_COMPARATOR.compare(this, arg0); <END> }</code><technical_language>Ordering provide nice abstraction, ComparisonChain for a similar effect. Or, Java 8 a thenComparing() method, do: return SegmentComparators.INTERVAL_START_COMPARATOR .thenComparing(SegmentComparators.INTERVAL_END_COMPARATOR) .compare(this, arg0);</technical_language>

Target:
default int compareTo(@Nullable ISegment arg0) { if (arg0 == null) { throw new IllegalArgumentException("Cannot compared to null"); } return SegmentComparators.INTERVAL_START_COMPARATOR. thenComparing(SegmentComparators.INTERVAL_END_COMPARATOR). compare(this, arg0); }
Source:
<code><START> public AlterConsumerGroupOffsetsResult(KafkaFuture<Map<TopicPartition, Errors>> future) { <END> this.future = future; }</code><technical_language>default access constructors for Result types. Similarly for ListOffsetsResult</technical_language>

Target:
AlterConsumerGroupOffsetsResult(KafkaFuture<Map<TopicPartition, Errors>> future) { this.future = future; }
Source:
<code>public NIC update(NIC device) { if (device.isSetPortMirroring() && device.getPortMirroring().isSetNetworks() && device.getPortMirroring().getNetworks().getNetworks().size() == 1 && device.getPortMirroring().getNetworks().getNetworks().get(0).isSetId() && device.isSetNetwork() && device.getNetwork().isSetId() && !device.getNetwork() .getId() .equals(device.getPortMirroring().getNetworks().getNetworks().get(0).getId())) { Fault fault = new Fault(); <START> fault.setReason("port mirrorings network must match to Nics network"); <END> Response response = Response.status(Response.Status.BAD_REQUEST).entity(fault).build(); throw new WebApplicationException(response); } else if (device.isSetPortMirroring() && device.getPortMirroring().isSetNetworks() && device.getPortMirroring().getNetworks().getNetworks().size() > 1) { Fault fault = new Fault(); fault.setReason("cannot set more then one network to port mirroring"); Response response = Response.status(Response.Status.BAD_REQUEST).entity(fault).build(); throw new WebApplicationException(response); } return super.update(device); }</code><technical_language>message be: "The port mirroring network match Network set NIC"</technical_language>

Target:
public NIC update(NIC device) { if (device.isSetPortMirroring() && device.getPortMirroring().isSetNetworks() && device.getPortMirroring().getNetworks().getNetworks().size() == 1 && device.getPortMirroring().getNetworks().getNetworks().get(0).isSetId() && device.isSetNetwork() && device.getNetwork().isSetId() && !device.getNetwork() .getId() .equals(device.getPortMirroring().getNetworks().getNetworks().get(0).getId())) { Fault fault = new Fault(); fault.setReason("The port mirroring network must match the Network set on the NIC"); Response response = Response.status(Response.Status.BAD_REQUEST).entity(fault).build(); throw new WebApplicationException(response); } else if (device.isSetPortMirroring() && device.getPortMirroring().isSetNetworks() && device.getPortMirroring().getNetworks().getNetworks().size() > 1) { Fault fault = new Fault(); fault.setReason("cannot set more than one network in port mirroring mode"); Response response = Response.status(Response.Status.BAD_REQUEST).entity(fault).build(); throw new WebApplicationException(response); } return super.update(device); }
Source:
<code>private boolean isInliningCandidate(Expression expression, ProjectNode node) { <START> Set<Symbol> childOutputSet = ImmutableSet.copyOf(node.getOutputSymbols()); <END> Map<Symbol, Long> dependencies = SymbolsExtractor.extractAll(expression).stream() .filter(childOutputSet::contains) .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); Set<Symbol> tryArguments = extractTryArguments(expression); return dependencies.entrySet().stream() .allMatch(entry -> (entry.getValue() == 1 || node.getAssignments().get(entry.getKey()) instanceof Literal) && !tryArguments.contains(entry.getKey())); }</code><technical_language>s/childOutputSet/input</technical_language>

Target:
private boolean isInliningCandidate(Expression expression, ProjectNode node) { Verify.verify(AstUtils.preOrder(expression).noneMatch(TryExpression.class::isInstance)); Set<Symbol> childOutputSet = ImmutableSet.copyOf(node.getOutputSymbols()); Map<Symbol, Long> dependencies = SymbolsExtractor.extractAll(expression).stream() .filter(childOutputSet::contains) .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); return dependencies.entrySet().stream() .allMatch(entry -> entry.getValue() == 1 || node.getAssignments().get(entry.getKey()) instanceof Literal); }
Source:
<code>private void createRunConfigsTasks(@Nonnull Project project, ExtractNatives extractNatives, DownloadAssets downloadAssets, Map<String, RunConfig> runs) { project.getTasks().withType(GenerateEclipseClasspath.class, t -> { t.dependsOn(extractNatives, downloadAssets); }); TaskProvider<Task> prepareRun = project.getTasks().register("prepareRun", Task.class); prepareRun.configure(task -> { task.dependsOn(project.getTasks().getByName("classes"), extractNatives, downloadAssets); }); VersionJson json = null; try { json = Utils.loadJson(extractNatives.getMeta(), VersionJson.class); } catch (IOException e) <START> List<String> additionalClientArgs = json != null ? json.getPlatformJvmArgs() : Collections.EMPTY_LIST; <END> runs.values().forEach(runConfig -> { if (runConfig.isClient()) { runConfig.setJvmArgs(additionalClientArgs); } }); EclipseHacks.doEclipseFixes(project, extractNatives, downloadAssets, runs); IntellijUtils.createIntellijRunsTask(project, extractNatives, downloadAssets, prepareRun.get(), runs); }</code><technical_language>Collection.emptyList() instead (raw types)</technical_language>

Target:
private void createRunConfigsTasks(@Nonnull Project project, ExtractNatives extractNatives, DownloadAssets downloadAssets, Map<String, RunConfig> runs) { project.getTasks().withType(GenerateEclipseClasspath.class, t -> { t.dependsOn(extractNatives, downloadAssets); }); TaskProvider<Task> prepareRun = project.getTasks().register("prepareRun", Task.class); prepareRun.configure(task -> { task.dependsOn(project.getTasks().getByName("classes"), extractNatives, downloadAssets); }); VersionJson json = null; try { json = Utils.loadJson(extractNatives.getMeta(), VersionJson.class); } catch (IOException e) List<String> additionalClientArgs = json != null ? json.getPlatformJvmArgs() : Collections.emptyList(); runs.values().forEach(runConfig -> { if (runConfig.isClient()) { runConfig.jvmArgs(additionalClientArgs); } }); EclipseHacks.doEclipseFixes(project, extractNatives, downloadAssets, runs); IntellijUtils.createIntellijRunsTask(project, extractNatives, downloadAssets, prepareRun.get(), runs); }
Source:
<code>private static File getFile(String path, HttpServletResponse response) throws IOException { if (path == null) { if (response != null) { <START> response.sendError(HttpServletResponse.SC_NOT_ACCEPTABLE, "Missing path parameter"); <END> } return null; } File file = new File(env.getSourceRootFile(), path); if (!file.isFile()) { if (response != null) { response.sendError(HttpServletResponse.SC_NOT_FOUND, "File not found"); } return null; } return file; }</code><technical_language>acceptable is related content negotiation headers, this is more a bad request</technical_language>

Target:
private static File getFile(String path, HttpServletResponse response) throws IOException { if (path == null) { if (response != null) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Missing path parameter"); } return null; } File file = new File(env.getSourceRootFile(), path); if (!file.isFile()) { if (response != null) { response.sendError(HttpServletResponse.SC_NOT_FOUND, "File not found"); } return null; } return file; }
Source:
<code>public Map<String, Person> getCurrentProgramMembers() { String cropname = this.contextUtil.getProjectInContext().getCropType().getCropName(); <START> final Map<String, Person> currentProgramMembers = new HashMap<>(); <END> final Long projectId = this.workbenchDataManager.getProjectByUuidAndCrop(this.getCurrentProgramID(), cropname).getProjectId(); final Map<Integer, Person> programMembers = new HashMap<>(); for (final Map.Entry<Integer, Person> member : programMembers.entrySet()) { currentProgramMembers.put(String.valueOf(member.getKey()), member.getValue()); } return currentProgramMembers; }</code><technical_language>This change related bug addressed</technical_language>

Target:
public Map<String, Person> getCurrentProgramMembers() { String cropname = this.contextUtil.getProjectInContext().getCropType().getCropName(); final Map<String, Person> currentProgramMembers = new HashMap<>(); final Long projectId = this.workbenchDataManager.getProjectByUuidAndCrop(this.getCurrentProgramID(), cropname).getProjectId(); final Map<Integer, Person> programMembers = this.workbenchDataManager.getPersonsByProjectId(projectId); for (final Map.Entry<Integer, Person> member : programMembers.entrySet()) { currentProgramMembers.put(String.valueOf(member.getKey()), member.getValue()); } return currentProgramMembers; }
Source:
<code>public double calculateNonRefGenotypeConcordance(final GenotypeConcordanceScheme scheme, final boolean missingSitesFlag) { double numerator = 0.0; double denominator = 0.0; scheme.validateScheme(); final TruthState[] allTruthStates = TruthState.values(); final CallState[] allCallStates = CallState.values(); for (final TruthState truthState : allTruthStates) { for (final CallState callState : allCallStates) { if(!missingSitesFlag && isMissing(truthState, callState)) { continue; } <START> else if (isVar(truthState, callState)) { <END> final TruthAndCallStates truthAndCallStates = new TruthAndCallStates(truthState, callState); final int count = getCount(truthAndCallStates); if (truthState.getCode()==callState.getCode()) { numerator += count; denominator += count; } else { denominator += count; } } } } return (numerator / denominator); }</code><technical_language>This entire method is identical calculateGenotypeConcordance() for this line. break out a utility method 2 public methods call into</technical_language>

Target:
public double calculateNonRefGenotypeConcordance(final GenotypeConcordanceScheme scheme, final boolean missingSitesFlag) { return calculateGenotypeConcordanceUtil(scheme, missingSitesFlag, false); }
Source:
<code>ZkJobCoordinator(Config config, MetricsRegistry metricsRegistry, ZkUtils zkUtils) { this.config = config; this.metrics = new ZkJobCoordinatorMetrics(metricsRegistry); this.processorId = createProcessorId(config); this.zkUtils = zkUtils; LeaderElector leaderElector = new ZkLeaderElector(processorId, zkUtils); leaderElector.setLeaderElectorListener(new LeaderElectorListenerImpl()); this.zkController = new ZkControllerImpl(processorId, zkUtils, this, leaderElector); this.barrier = new ZkBarrierForVersionUpgrade( <START> zkUtils.getKeyBuilder().getJobModelVersionBarrierPrefix(), <END> zkUtils, new ZkBarrierListenerImpl()); this.debounceTimeMs = new JobConfig(config).getDebounceTimeMs(); this.reporters = MetricsReporterLoader.getMetricsReporters(new MetricsConfig(config), processorId); debounceTimer = new ScheduleAfterDebounceTime(throwable -> { LOG.error("Received exception from in JobCoordinator Processing!", throwable); stop(); }); }</code><technical_language>session state change listener is longer created in this patch. this accidentally removed</technical_language>

Target:
ZkJobCoordinator(Config config, MetricsRegistry metricsRegistry, ZkUtils zkUtils) { this.config = config; this.metrics = new ZkJobCoordinatorMetrics(metricsRegistry); this.processorId = createProcessorId(config); this.zkUtils = zkUtils; zkUtils.getZkClient().subscribeStateChanges(new ZkSessionStateChangedListener()); LeaderElector leaderElector = new ZkLeaderElector(processorId, zkUtils); leaderElector.setLeaderElectorListener(new LeaderElectorListenerImpl()); this.zkController = new ZkControllerImpl(processorId, zkUtils, this, leaderElector); this.barrier = new ZkBarrierForVersionUpgrade( zkUtils.getKeyBuilder().getJobModelVersionBarrierPrefix(), zkUtils, new ZkBarrierListenerImpl()); this.debounceTimeMs = new JobConfig(config).getDebounceTimeMs(); this.reporters = MetricsReporterLoader.getMetricsReporters(new MetricsConfig(config), processorId); debounceTimer = new ScheduleAfterDebounceTime(throwable -> { LOG.error("Received exception from in JobCoordinator Processing!", throwable); stop(); }); }