auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateNotification() { final boolean tetheringInactive = mDownstreamTypesMask <= DOWNSTREAM_NONE; synchronized (mUpdateLock) { <START> if (mTetheringRestricted) { setupRestrictedNotification(); } else if (tetheringInactive) { <END> clearNotification(); } else { if (setupNotification()) { return; } clearNotification(); } } }</code><technical_language>Is tethering inactive tethering restricted is updated restrict? If yes, logic correct? Another question is tethering is inactive, show notification? Is wired is tethering restricted notification I do enable tethering if I understand correctly</technical_language>

Target:
private void updateNotification() { synchronized (mUpdateLock) { final boolean tetheringInactive = mDownstreamTypesMask <= DOWNSTREAM_NONE; if (tetheringInactive) { clearNotification(); } else { if (setupNotification()) { return; } clearNotification(); } } }
Source:
<code>public ApplyPmmlModelCommand(PMMLRequestData requestData, Boolean hasMining) { <START> this.requestData = requestData; <END> this.hasMining = hasMining; }</code><technical_language>This call argument constructor instead of this.requestData = requestData;. future refactorings easier</technical_language>

Target:
public ApplyPmmlModelCommand(PMMLRequestData requestData, Boolean hasMining) { initialize(requestData, hasMining); }
Source:
<code>public synchronized boolean seek(final CtfLocationInfo ctfLocationData) { boolean ret = false; <START> if (curLocation.getLocationInfo().compareTo(ctfLocationData) == 0) { <END> return super.hasMoreEvents(); } long currTimestamp = ctfLocationData.getTimestamp(); final long offsetTimestamp = this.getCtfTmfTrace().getCTFTrace().timestampNanoToCycles(currTimestamp); if (offsetTimestamp < 0) { ret = super.seek(0L); } else { ret = super.seek(offsetTimestamp); } long index = 0; final CtfTmfEvent currentEvent = this.getCurrentEvent(); if (currentEvent != null) { currTimestamp = currentEvent.getTimestamp().getValue(); for (long i = 0; i < ctfLocationData.getIndex(); i++) { if (currTimestamp == currentEvent.getTimestamp().getValue()) { index++; } else { index = 0; } this.advance(); } } else { ret = false; } if (ret) { curLocation = new CtfLocation(new CtfLocationInfo(getCurrentEvent().getTimestamp().getValue(), index)); } else { curLocation = NULL_LOCATION; } return ret; }</code><technical_language>reason .compareTo() == 0 instead of .equals()</technical_language>

Target:
public synchronized boolean seek(final CtfLocationInfo ctfLocationData) { boolean ret = false; if (curLocation.getLocationInfo().equals(ctfLocationData)) { return super.hasMoreEvents(); } long currTimestamp = ctfLocationData.getTimestamp(); final long offsetTimestamp = this.getCtfTmfTrace().getCTFTrace().timestampNanoToCycles(currTimestamp); if (offsetTimestamp < 0) { ret = super.seek(0L); } else { ret = super.seek(offsetTimestamp); } long index = 0; final CtfTmfEvent currentEvent = this.getCurrentEvent(); if (currentEvent != null) { currTimestamp = currentEvent.getTimestamp().getValue(); for (long i = 0; i < ctfLocationData.getIndex(); i++) { if (currTimestamp == currentEvent.getTimestamp().getValue()) { index++; } else { index = 0; } this.advance(); } } else { ret = false; } if (ret) { curLocation = new CtfLocation(new CtfLocationInfo(getCurrentEvent().getTimestamp().getValue(), index)); } else { curLocation = NULL_LOCATION; } return ret; }
Source:
<code>public DebuggingContext disableDebugMode(IDeploymentConfig deploymentConfig, DebuggingContext debugContext, IProgressMonitor monitor) throws CoreException { assert deploymentConfig != null; assert debugContext != null; <START> IDebugListener listener = debugContext.getDebugListener(); <END> if (listener != null) { IPod pod = getFirstPod(deploymentConfig); debugContext.setPod(pod); listener.onDebugChange(debugContext, monitor); } if (debugContext.isDebugEnabled()) { debugContext.setDebugEnabled(false); updateDebugConfig(deploymentConfig, debugContext, monitor); } return debugContext; }</code><technical_language>is some (mostely) repeated code enable disable debug mode</technical_language>

Target:
public DebuggingContext disableDebugMode(IDeploymentConfig deploymentConfig, DebuggingContext debugContext, IProgressMonitor monitor) throws CoreException { Assert.isNotNull(deploymentConfig); Assert.isNotNull(debugContext); IDebugListener listener = debugContext.getDebugListener(); if (listener != null) { IPod pod = getFirstPod(deploymentConfig); debugContext.setPod(pod); listener.onDebugChange(debugContext, monitor); } if (debugContext.isDebugEnabled()) { debugContext.setDebugEnabled(false); updateDebugConfig(deploymentConfig, debugContext, monitor); } return debugContext; }
Source:
<code>public synchronized void init() { if (!initialized) { initializeRouteMatcher(); if (!isRunningFromServlet()) { new Thread(() -> { EmbeddedServers.initialize(); if (embeddedServerIdentifier == null) { embeddedServerIdentifier = EmbeddedServers.defaultIdentifier(); } server = EmbeddedServers.create(embeddedServerIdentifier, routes, staticFilesConfiguration, hasMultipleHandlers()); server.configureWebSockets(webSocketHandlers, webSocketIdleTimeoutMillis); port = server.ignite( ipAddress, port, sslStores, maxThreads, minThreads, threadIdleTimeoutMillis); try { latch.countDown(); server.join(); } catch (InterruptedException e) { <START> LOG.error("server interrupted", e); <END> } }).start(); } initialized = true; } }</code><technical_language>interrupt flag restored here</technical_language>

Target:
public synchronized void init() { if (!initialized) { initializeRouteMatcher(); if (!isRunningFromServlet()) { new Thread(() -> { EmbeddedServers.initialize(); if (embeddedServerIdentifier == null) { embeddedServerIdentifier = EmbeddedServers.defaultIdentifier(); } server = EmbeddedServers.create(embeddedServerIdentifier, routes, staticFilesConfiguration, hasMultipleHandlers()); server.configureWebSockets(webSocketHandlers, webSocketIdleTimeoutMillis); port = server.ignite( ipAddress, port, sslStores, maxThreads, minThreads, threadIdleTimeoutMillis); try { latch.countDown(); server.join(); } catch (InterruptedException e) { LOG.error("server interrupted", e); Thread.currentThread().interrupt(); } }).start(); } initialized = true; } }
Source:
<code>public void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { if (!getLeft().getSchema().compatible(getRight().getSchema())) { throw new DbException("Incompatible input schemas"); } <START> tupleIndices = new IntObjectOpenHashMap<IntArrayList>(); <END> tuplesToRemove = new MutableTupleBuffer(getSchema()); }</code><technical_language>prefer new IntObjectOpenHashMap<>() here. javac infer correct generic type, work refactor in future. (This trick discovered late in Myria, of code.)</technical_language>

Target:
public void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { if (!getLeft().getSchema().compatible(getRight().getSchema())) { throw new DbException("Incompatible input schemas"); } tupleIndices = new IntObjectHashMap<>(); tuplesToRemove = new MutableTupleBuffer(getSchema()); }
Source:
<code><START> private void discoverHostName_SelectedItemChanged() { <END> if (Boolean.TRUE.equals(getIsDiscoveredHosts().getEntity())) { ExternalDiscoveredHost dhost = (ExternalDiscoveredHost) getExternalDiscoveredHosts().getSelectedItem(); ExternalHostGroup dhg = (ExternalHostGroup) getExternalHostGroups().getSelectedItem(); VDS vds = new VDS(); if (dhost != null && dhg != null) { vds.setVdsName(dhost.getName()); vds.setHostName(dhost.getName() + "." + (dhg.getDomainName() != null ? dhg.getDomainName() : constants.empty())); } updateModelFromVds(vds, null, false, null); } }</code><technical_language>get if in discovered hosts mode</technical_language>

Target:
private void discoverHostName_SelectedItemChanged() { if (Boolean.TRUE.equals(getIsDiscoveredHosts().getEntity())) { ExternalDiscoveredHost dhost = (ExternalDiscoveredHost) getExternalDiscoveredHosts().getSelectedItem(); ExternalHostGroup dhg = (ExternalHostGroup) getExternalHostGroups().getSelectedItem(); VDS vds = new VDS(); if (dhost != null && dhg != null) { vds.setVdsName(dhost.getName()); vds.setHostName(dhost.getName() + "." + (dhg.getDomainName() != null ? dhg.getDomainName() : "")); } updateModelFromVds(vds, null, false, null); } }
Source:
<code>private void indexFile(IndexWriter indexWriter, String inputFile) throws IOException { System.out.println("Indexing " + inputFile); int lineCount = 0; <START> for (String line : Files.readAllLines(Paths.get(inputFile))) { <END> Document doc = new Document(); doc.add(new TextField(Lucene.FIELD_NAME, line, Field.Store.YES)); doc.add(new TextField(Lucene.FIELD_NAME_LOWERCASE, line.toLowerCase(), Field.Store.YES)); indexWriter.addDocument(doc); if (++lineCount % 10_000 == 0) { System.out.println(lineCount + "..."); } } }</code><technical_language>This scanner avoid reading RAM</technical_language>

Target:
private void indexFile(IndexWriter indexWriter, String inputFile) throws IOException { System.out.println("Indexing " + inputFile); int lineCount = 0; try (BufferedReader br = Files.newBufferedReader(Paths.get(inputFile))) { String line; while ((line = br.readLine()) != null) { Document doc = new Document(); doc.add(new TextField(Lucene.FIELD_NAME, line, Field.Store.YES)); doc.add(new TextField(Lucene.FIELD_NAME_LOWERCASE, line.toLowerCase(), Field.Store.YES)); indexWriter.addDocument(doc); if (++lineCount % 10_000 == 0) { System.out.println(lineCount + "..."); } } } }
Source:
<code>public void test() throws Exception { String projectKey = TSPROJECT; SonarScanner build = SonarScanner.create() .setProjectKey(projectKey) .setSourceEncoding("UTF-8") .setSourceDirs(".") .setProjectDir(PROJECT_DIR); Tests.setProfile(projectKey, "eslint-based-rules-profile", "ts"); TestUtils.npmInstall(PROJECT_DIR); orchestrator.executeBuild(build); SearchRequest request = new SearchRequest(); <START> request <END> .setComponentKeys(Collections.singletonList(TSPROJECT)) .setRules(ImmutableList.of("typescript:S3923")); List<Issues.Issue> issuesList = newWsClient().issues().search(request).getIssuesList(); assertThat(issuesList).hasSize(1); assertThat(issuesList.get(0).getLine()).isEqualTo(2); assertThat(Tests.getMeasureAsInt(TSPROJECT, "ncloc")).isEqualTo(7); assertThat(Tests.getMeasureAsInt(TSPROJECT, "classes")).isEqualTo(0); assertThat(Tests.getMeasureAsInt(TSPROJECT, "functions")).isEqualTo(1); assertThat(Tests.getMeasureAsInt(TSPROJECT, "statements")).isEqualTo(4); assertThat(Tests.getMeasureAsInt(TSPROJECT, "comment_lines")).isEqualTo(1); assertThat(Tests.getMeasureAsDouble(TSPROJECT, "duplicated_lines")).isEqualTo(0.0); assertThat(Tests.getMeasureAsDouble(TSPROJECT, "duplicated_blocks")).isEqualTo(0.0); assertThat(Tests.getMeasureAsDouble(TSPROJECT, "duplicated_files")).isEqualTo(0.0); }</code><technical_language>test NOSONAR</technical_language>

Target:
public void test() throws Exception { String projectKey = "tsproject"; SonarScanner build = SonarScanner.create() .setProjectKey(projectKey) .setSourceEncoding("UTF-8") .setSourceDirs(".") .setProjectDir(PROJECT_DIR); Tests.setProfile(projectKey, "eslint-based-rules-profile", "ts"); BuildResult result = orchestrator.executeBuild(build); List<Issues.Issue> issuesList = getIssues(projectKey + ":sample.lint.ts"); assertThat(issuesList).hasSize(1); assertThat(issuesList.get(0).getLine()).isEqualTo(2); String sampleFileKey = projectKey + ":sample.lint.ts"; assertThat(Tests.getMeasureAsInt(sampleFileKey, "ncloc")).isEqualTo(7); assertThat(Tests.getMeasureAsInt(sampleFileKey, "classes")).isEqualTo(0); assertThat(Tests.getMeasureAsInt(sampleFileKey, "functions")).isEqualTo(1); assertThat(Tests.getMeasureAsInt(sampleFileKey, "statements")).isEqualTo(4); assertThat(Tests.getMeasureAsInt(sampleFileKey, "comment_lines")).isEqualTo(1); assertThat(Tests.getMeasureAsDouble(projectKey, "duplicated_lines")).isEqualTo(111.0); assertThat(Tests.getMeasureAsDouble(projectKey, "duplicated_blocks")).isEqualTo(2.0); assertThat(Tests.getMeasureAsDouble(projectKey, "duplicated_files")).isEqualTo(1.0); issuesList = getIssues(projectKey + ":nosonar.lint.ts"); assertThat(issuesList).hasSize(1); assertThat(result.getLogsLines(log -> log.contains("Found 1 tsconfig.json file(s)"))).hasSize(1); }
Source:
<code>default ModelNode execute(Operation operation, OperationMessageHandler messageHandler) throws IOException { OperationResponse or = executeOperation(operation, messageHandler); ModelNode result = or.getResponseNode(); <START> or.close(); <END> return result; }</code><technical_language>this close happen in a finally block</technical_language>

Target:
default ModelNode execute(Operation operation, OperationMessageHandler messageHandler) throws IOException { try (OperationResponse or = executeOperation(operation, messageHandler)) { return or.getResponseNode(); } }
Source:
<code>public void afterRun() throws Exception { <START> long elapsed = Math.max(0, Timer.nanosElapsed(startTimeNanos)); <END> MultiMapService service = getService(); service.getLocalMultiMapStatsImpl(name).incrementRemoveLatencyNanos(elapsed); if (removed != null) { for (MultiMapRecord record : removed) { publishEvent(EntryEventType.REMOVED, dataKey, null, record.getObject()); } } }</code><technical_language>elapsednanos</technical_language>

Target:
public void afterRun() throws Exception { long elapsedNanos = Math.max(0, Timer.nanosElapsed(startTimeNanos)); MultiMapService service = getService(); service.getLocalMultiMapStatsImpl(name).incrementRemoveLatencyNanos(elapsedNanos); if (removed != null) { for (MultiMapRecord record : removed) { publishEvent(EntryEventType.REMOVED, dataKey, null, record.getObject()); } } }
Source:
<code>public <A> void assertIsEqualToComparingFieldByFieldRecursively(AssertionInfo info, A actual, A other) { assertNotNull(info, actual); assertHasSameClassAs(info, actual, other); if (!DeepEquals.deepEquals(actual, other)) <START> throw failures.failure(info, shouldBeEqual(actual, other, StandardRepresentation.STANDARD_REPRESENTATION)); <END> }</code><technical_language>need call ShouldBeEqualByComparingOnlyGivenFields give fields differences</technical_language>

Target:
public <A> void assertIsEqualToComparingFieldByFieldRecursively(AssertionInfo info, A actual, A other) { assertNotNull(info, actual); List<Difference> differences = DeepDifference.determineDifferences(actual, other); if (!differences.isEmpty()) { throw failures.failure(info, ShouldBeEqualByComparingFieldByFieldRecursive.shouldBeEqualComparingOnlyGivenFields(actual, other, differences)); } }
Source:
<code>private void doUpdateTimeZone(final String selectedTimeZone) { TimeZoneModel.withLoadedTimeZones(getTimeZoneType(), new Runnable() { @Override public void run() { final Iterable<TimeZoneModel> timeZones = TimeZoneModel.getTimeZones(getTimeZoneType()); getModel().getTimeZone().setItems(timeZones); getModel().getTimeZone().setSelectedItem(Linq.firstOrDefault(timeZones, new Linq.TimeZonePredicate(selectedTimeZone))); getModel().getTimeZone().setIsChangable(!getModel().getIsLinuxOS()); <START> getModel().getTimeZone().setTitle(getModel().getIsLinuxOS() ? constants.timeZoneNotChangeableForLinuxVms() : ""); <END> } }); }</code><technical_language>please consider setChangeProhibitionReason instead</technical_language>

Target:
private void doUpdateTimeZone(final String selectedTimeZone) { TimeZoneModel.withLoadedTimeZones(getTimeZoneType(), new Runnable() { @Override public void run() { final Iterable<TimeZoneModel> timeZones = TimeZoneModel.getTimeZones(getTimeZoneType()); getModel().getTimeZone().setItems(timeZones); getModel().getTimeZone().setSelectedItem(Linq.firstOrDefault(timeZones, new Linq.TimeZonePredicate(selectedTimeZone))); getModel().getTimeZone().setChangeProhibitionReason(constants.timeZoneNotChangeableForLinuxVms()); getModel().getTimeZone().setIsChangable(!getModel().getIsLinuxOS()); } }); }
Source:
<code>Classpath toClasspath(final Path f, final boolean isSourceOnly, final String encoding) throws IllegalAccessException, InvocationTargetException; } static { ClasspathAccessor accessor = (f, isSourceOnly, encoding) -> { throw new SdkException("getClasspath method on FileSystem.class could not be found"); }; try { Method getClasspath = FileSystem.class.getMethod("getClasspath", String.class, String.class, boolean.class, AccessRuleSet.class, String.class, Map.class, String.class); accessor = (f, isSourceOnly, encoding) -> (Classpath) getClasspath.invoke(null, f.toString(), encoding, isSourceOnly, null, null, null, null); } catch (NoSuchMethodException nsme) { SdkLog.debug("Fallback to legacy ECJ", nsme); try { Method getClasspath = FileSystem.class.getMethod("getClasspath", String.class, String.class, boolean.class, AccessRuleSet.class, String.class, Map.class); accessor = (f, isSourceOnly, encoding) -> (Classpath) getClasspath.invoke(null, f.toString(), encoding, isSourceOnly, null, null, null); } catch (NoSuchMethodException e) { <START> throw new SdkException(e); <END> } } CLASSPATH_ACCESSOR = accessor; }</code><technical_language>Is a good idea throw exception in a static block? This exception is thrown classloader is hard find detect lead unexpected behavior. Instead: log exception here? accessor assigned exception-implementation ok? do think</technical_language>

Target:
private static Classpath toClasspath(final Path f, final boolean isSourceOnly, final String encoding) { if (f == null || !Files.isReadable(f)) { return null; } try { return CLASSPATH_ACCESSOR.toClasspath(f, isSourceOnly, encoding); } catch (final IllegalArgumentException | ReflectiveOperationException e) { throw new SdkException(e); } }
Source:
<code>private void setupAskHandler() { final StageActivity currentStage = this; messageHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message message) { ArrayList<Object> params = (ArrayList<Object>) message.obj; switch (message.what) { case ASK_MESSAGE: showDialog((String) params.get(1), (AskAction) params.get(0)); break; case REGISTER_INTENT: currentStage.queueIntent((IntentListener) params.get(0)); break; case PERFORM_INTENT: currentStage.startQueuedIntent((Integer) params.get(0)); break; default: <START> Log.e(TAG,"Unhandled message in messagehandler, case "+message.what); <END> } } }; }</code><technical_language>eventhough necessary, please add a break default case.. this prevents errors if case statements reordered</technical_language>

Target:
private void setupAskHandler() { final StageActivity currentStage = this; messageHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message message) { List<Object> params = (ArrayList<Object>) message.obj; switch (message.what) { case ASK_MESSAGE: showDialog((String) params.get(1), (AskAction) params.get(0)); break; case REGISTER_INTENT: currentStage.queueIntent((IntentListener) params.get(0)); break; case PERFORM_INTENT: currentStage.startQueuedIntent((Integer) params.get(0)); break; default: Log.e(TAG, "Unhandled message in messagehandler, case " + message.what); break; } } }; }
Source:
<code>public static Blob blobFromKey(String key) { try { int colon = key.indexOf(':'); if (colon < 0) { <START> throw new NuxeoException("invalid blob key format"); <END> } String providerId = key.substring(0, colon); BlobProvider blobProvider = Framework.getService(BlobManager.class).getBlobProvider(providerId); BlobInfo blobInfo = new BlobInfo(); blobInfo.key = key; if (blobProvider.performsAccessControl(blobInfo)) { return blobProvider.readBlob(blobInfo); } else { throw new NuxeoException("blob provider " + providerId + " does not perform access control"); } } catch (IOException e) { return null; } }</code><technical_language>"Invalid blob key format: " + key</technical_language>

Target:
public static Blob blobFromKey(String key) { try { int colon = key.indexOf(':'); if (colon < 0) { throw new NuxeoException("Invalid blob key format: " + key); } String providerId = key.substring(0, colon); BlobProvider blobProvider = Framework.getService(BlobManager.class).getBlobProvider(providerId); BlobInfo blobInfo = new BlobInfo(); blobInfo.key = key; if (blobProvider.performsExternalAccessControl(blobInfo)) { return blobProvider.readBlob(blobInfo); } else { throw new NuxeoException("BlobProvider " + providerId + " cannot perform access control for key: " + key); } } catch (IOException e) { throw new NuxeoException(e); } }
Source:
<code>public void testSecureGetHandshakeTimeout() throws Exception { createEndpoint(); CoapClient client = new CoapClient("coaps", InetAddress.getLoopbackAddress().getHostAddress(), TestTools.findFreePort()); CountingHandler handler = new CountingHandler(); client.get(handler); <START> handler.waitForLoadCalls(1, 1000, TimeUnit.MILLISECONDS); <END> Assert.assertEquals("An error is expected", 1, handler.errorCalls.get()); assertAllExchangesAreCompleted(coapTestEndpoint); }</code><technical_language>spend/add a waitForErrorCalls</technical_language>

Target:
public void testSecureGetHandshakeTimeout() throws Exception { try (DatagramSocket datagramSocket = new DatagramSocket(0)) { int freePort = datagramSocket.getLocalPort(); createEndpoint(); CoapClient client = new CoapClient("coaps", InetAddress.getLoopbackAddress().getHostAddress(), freePort); CountingHandler handler = new CountingHandler(); client.get(handler); handler.waitForErrorCalls(1, 1000, TimeUnit.MILLISECONDS); Assert.assertEquals("An error is expected", 1, handler.errorCalls.get()); assertAllExchangesAreCompleted(coapTestEndpoint); } }
Source:
<code>public void onStart() { monitorSessionThread = new MonitorSessionThread(this, host, port, passwd); m_last_bus_scan = new Date( (new Date()).getTime() - (1000 * m_bus_scan_interval_secs) + (1000 * m_first_scan_delay_secs)); monitorSessionThread.start(); <START> logger.info("Connected to [" + host + ":" + port + "], Rescan bus every [" + m_bus_scan_interval_secs <END> + "] seconds, first scan over [" + (((new Date()).getTime() - m_last_bus_scan.getTime()) / 1000) + "] seconds, max. heating zones: [" + m_heating_zones + "]"); start(); }</code><technical_language>parameterized logging instead of string concatenation</technical_language>

Target:
public void onStart() { monitorSessionThread = new MonitorSessionThread(this, host, port, passwd); m_last_bus_scan = new Date( (new Date()).getTime() - (1000 * m_bus_scan_interval_secs) + (1000 * m_first_scan_delay_secs)); monitorSessionThread.start(); logger.info( "Connected to [{}:{}], Rescan bus every seconds, first scan over seconds, max. heating zones: [{}], Shutter run time msecs", host, port, m_bus_scan_interval_secs, (((new Date()).getTime() - m_last_bus_scan.getTime()) / 1000), m_heating_zones, m_shutter_run_msecs); start(); }
Source:
<code>private ClockProvider createClockProvider(Configuration<?> config) { BootstrapConfiguration bootstrapConfiguration = config.getBootstrapConfiguration(); String clockProviderFqcn = bootstrapConfiguration.getClockProviderClassName(); if ( clockProviderFqcn == null ) { return config.getDefaultClockProvider(); } @SuppressWarnings("unchecked") <START> Class<ClockProvider> clockProviderClass = (Class<ClockProvider>) run( <END> LoadClass.action( clockProviderFqcn, null ) ); return createInstance( clockProviderClass ); }</code><technical_language>Technically, Class<? extends ClockProvider></technical_language>

Target:
private ClockProvider createClockProvider(Configuration<?> config) { BootstrapConfiguration bootstrapConfiguration = config.getBootstrapConfiguration(); String clockProviderFqcn = bootstrapConfiguration.getClockProviderClassName(); if ( clockProviderFqcn == null ) { return config.getDefaultClockProvider(); } @SuppressWarnings("unchecked") Class<? extends ClockProvider> clockProviderClass = (Class<? extends ClockProvider>) run( LoadClass.action( clockProviderFqcn, null ) ); return createInstance( clockProviderClass ); }
Source:
<code>public String getUnifiedDiff() { StringBuilder detail = new StringBuilder(); if (patchSet != null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); DiffFormatter df = new DiffFormatter(out); db = openRepository(); <START> reader = db.newObjectReader(); <END> PatchList patchList = getPatchList(); for (PatchListEntry p : patchList.getPatches()) { if (Patch.COMMIT_MSG.equals(p.getNewName())) { continue; } detail.append("\n"); List<String> headers = p.getHeaderLines(); for (String hdr : headers) { detail.append(hdr); } try { String filename = p.getNewName(); RawText aText = resolve(patchList.getOldId(), filename); RawText bText = resolve(patchList.getNewId(), filename); df.format(toEditList(p.getEdits()), aText, bText); detail.append(out.toString()); } catch (IOException err) { } } detail.append("\n"); } return detail.toString(); }</code><technical_language>This NPEs openRepository fails gracefully repository is suddenly torn out Gerrit (this happens!). I prefer return "" in this case</technical_language>

Target:
public String getUnifiedDiff() { ByteArrayOutputStream out = new ByteArrayOutputStream(); Repository repo = openRepository(); if (repo != null) { DiffFormatter df = new DiffFormatter(out); df.setRepository(repo); df.setDetectRenames(true); try { PatchList patchList = getPatchList(); df.format(patchList.getOldId(), patchList.getNewId()); } catch (IOException e) { log.error("Cannot format patch", e); } finally { df.release(); } } return RawParseUtils.decode(out.toByteArray()); }
Source:
<code>private static JsonParserIterator<TaskStatusPlus> getTasks( DruidLeaderClient indexingServiceClient, ObjectMapper jsonMapper, BytesAccumulatingResponseHandler responseHandler ) { Request request; try { request = indexingServiceClient.makeRequest( HttpMethod.GET, StringUtils.format("/druid/indexer/v1/tasks") ); } catch (IOException e) { throw new RuntimeException(e); } ListenableFuture<InputStream> future = indexingServiceClient.goStream( request, responseHandler ); try { future.get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } if (responseHandler.getStatus() != HttpServletResponse.SC_OK) { throw new ISE( "Error while fetching tasks status[%s] description[%s]", responseHandler.status, responseHandler.description ); } final JavaType typeRef = jsonMapper.getTypeFactory().constructType(new TypeReference<TaskStatusPlus>() { }); <START> JsonParserIterator<TaskStatusPlus> iterator = new JsonParserIterator<>( <END> typeRef, future, request.getUrl().toString(), null, request.getUrl().getHost(), jsonMapper ); return iterator; }</code><technical_language>return directly</technical_language>

Target:
private static JsonParserIterator<TaskStatusPlus> getTasks( DruidLeaderClient indexingServiceClient, ObjectMapper jsonMapper, BytesAccumulatingResponseHandler responseHandler ) { Request request; try { request = indexingServiceClient.makeRequest( HttpMethod.GET, StringUtils.format("/druid/indexer/v1/tasks") ); } catch (IOException e) { throw new RuntimeException(e); } ListenableFuture<InputStream> future = indexingServiceClient.goAsync( request, responseHandler ); final JavaType typeRef = jsonMapper.getTypeFactory().constructType(new TypeReference<TaskStatusPlus>() { }); return new JsonParserIterator<>( typeRef, future, request.getUrl().toString(), null, request.getUrl().getHost(), jsonMapper ); }
Source:
<code>public void testDisposeCallsUnregisterForIccRefresh() { <START> verify(mMockCI).registerForIccRefresh(any(IccRecords.class), <END> eq(IccRecords.EVENT_REFRESH), isNull()); mIccRecords.dispose(); verify(mMockCI).unregisterForIccRefresh(any(IccRecords.class)); }</code><technical_language>any? mIccRecords</technical_language>

Target:
public void testDisposeCallsUnregisterForIccRefresh() { verify(mSimulatedCommandsVerifier).registerForIccRefresh(eq(mIccRecords), eq(IccRecords.EVENT_REFRESH), isNull()); mIccRecords.dispose(); verify(mSimulatedCommandsVerifier).unregisterForIccRefresh(eq(mIccRecords)); }
Source:
<code>public synchronized String createNonce(Repository repo, long timestamp) throws IllegalStateException { String path; if (repo instanceof DfsRepository) path = ((DfsRepository) repo).getDescription().getRepositoryName(); else if (repo.getDirectory() != null) path = repo.getDirectory().getPath(); else throw new IllegalStateException(); String input = path + ":" + String.valueOf(timestamp); byte[] rawHmac; try { rawHmac = mac.doFinal(input.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } StringBuilder sentNonceBuilder = new StringBuilder(); sentNonceBuilder.append(String.format("%d-", new Long(timestamp))); <START> for (byte b : rawHmac) { <END> sentNonceBuilder.append(String.format("%02x", Byte.valueOf(b))); } return sentNonceBuilder.toString(); }</code><technical_language>braces</technical_language>

Target:
public synchronized String createNonce(Repository repo, long timestamp) throws IllegalStateException { String path; if (repo instanceof DfsRepository) path = ((DfsRepository) repo).getDescription().getRepositoryName(); else if (repo.getDirectory() != null) path = repo.getDirectory().getPath(); else throw new IllegalStateException(); String input = path + ":" + String.valueOf(timestamp); byte[] rawHmac; try { rawHmac = mac.doFinal(input.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } return String.format("%d-%s", Long.valueOf(timestamp), toHex(rawHmac)); }
Source:
<code>public void start() throws Throwable { CleanupJob job; while ( (job = jobs.poll()) != null ) { <START> jobScheduler.schedule( recoveryCleanup, job ); <END> } }</code><technical_language>I wrong, scheduling cleanup jobs individually. This means cleanup jobs potentially run in parallel. if multiple cleanup jobs, processors? lots lots of context switching in vain, there</technical_language>

Target:
public void start() throws Throwable { jobScheduler.schedule( recoveryCleanup, allJobs() ); }
Source:
<code>public final void registerEvents() { UI.events.registerEvent((ModelUpdatedEventHandler) this::modelUpdated); <START> UI.events.registerEvent((UpdateRateLimitsEventHandler) this::updateSyncRefreshRate); <END> UI.events.registerEvent((UpdateRateLimitsEventHandler) this::updateAPIBox); UI.events.registerEvent((ShowErrorDialogEventHandler) this::showErrorDialog); UI.events.registerEvent((PrimaryRepoChangedEventHandler) this::setDefaultRepo); }</code><technical_language>Feels neater a single event handler for this dispatches methods</technical_language>

Target:
public final void registerEvents() { UI.events.registerEvent((ModelUpdatedEventHandler) this::modelUpdated); UI.events.registerEvent((NewApiQuotaInfoAvailableEventHandler) this::updateApiQuotaInfo); UI.events.registerEvent((ShowErrorDialogEventHandler) this::showErrorDialog); UI.events.registerEvent((PrimaryRepoChangedEventHandler) this::setDefaultRepo); }
Source:
<code>public synchronized Set<String> getProxyUsers() { if (PROXY_USERS == null) { PROXY_USERS = new HashSet<>(); for (Map.Entry<String, String> entry : this) { String propName = entry.getKey(); if (propName.startsWith(ProxyUsers.CONF_HADOOP_PROXYUSER)) { String[] tokens = propName.split("\\."); <START> PROXY_USERS.add(tokens[2]); <END> } } } return PROXY_USERS; }</code><technical_language>refactoring it, a bit more defensive. check property name a regex extract group interested check if tokens array 2+ elements</technical_language>

Target:
public Set<String> getProxyUsers() { if (PROXY_USERS == null) { synchronized (this) { if (PROXY_USERS == null) { PROXY_USERS = new HashSet<>(); String regex = ProxyUsers.CONF_HADOOP_PROXYUSER + "." + "([a-zA-Z0-9_\\-]+).(users|groups|hosts)"; regex = regex.replace(".", "\\."); Pattern pattern = Pattern.compile(regex); for (Object item : getProps().keySet()){ Matcher m = pattern.matcher((String)item); if (m.matches()) { PROXY_USERS.add(m.group(1)); } } } } } return PROXY_USERS; }
Source:
<code>private void performWorkload(BaseSubscriber<Object> documentSubscriber, OperationType type, long i) throws Exception { Flux<? extends Object> obs; CosmosAsyncContainer container = containers.get((int) i % containers.size()); if (type.equals(OperationType.Create)) { PojoizedJson data = BenchmarkHelper.generateDocument(prefixUuidForCreate + i, dataFieldValue, partitionKey, configuration.getDocumentDataFieldCount()); obs = container.createItem(data).flux(); } else if (type.equals(OperationType.Query)) { CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); String sqlQuery = "Select top 100 * from c order by c._ts"; obs = container.queryItems(sqlQuery, options, PojoizedJson.class).byPage(10); } else { int index = random.nextInt(docsToRead.get(container.getId()).size()); RequestOptions options = new RequestOptions(); String partitionKeyValue = docsToRead.get(container.getId()).get(index).getId(); options.setPartitionKey(new PartitionKey(partitionKeyValue)); Mono sparsitySleepMono = sparsityMono(); <START> obs = sparsitySleepMono.flux().doOnComplete( <END> () -> container.readItem( docsToRead.get(container.getId()).get(index).getId(), new PartitionKey(partitionKeyValue), PojoizedJson.class) ); } concurrencyControlSemaphore.acquire(); obs.subscribeOn(Schedulers.parallel()).subscribe(documentSubscriber); }</code><technical_language>reason flatmap similar original AsyncReadBenchmark? <LINK_0></technical_language>

Target:
private void performWorkload(BaseSubscriber<Object> documentSubscriber, OperationType type, long i) throws Exception { Flux<? extends Object> obs; Mono sparsitySleepMono = sparsityMono(i); CosmosAsyncContainer container = containers.get((int) i % containers.size()); if (type.equals(OperationType.Create)) { PojoizedJson data = BenchmarkHelper.generateDocument(prefixUuidForCreate + i, dataFieldValue, partitionKey, configuration.getDocumentDataFieldCount()); obs = sparsitySleepMono.flux().flatMap( null, null, () -> container.createItem(data)); } else if (type.equals(OperationType.Query)) { CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); String sqlQuery = "Select top 100 * from c order by c._ts"; obs = sparsitySleepMono.flux().flatMap( null, null, () -> container.queryItems(sqlQuery, options, PojoizedJson.class).byPage(10)); } else { int index = random.nextInt(docsToRead.get(container.getId()).size()); RequestOptions options = new RequestOptions(); String partitionKeyValue = docsToRead.get(container.getId()).get(index).getId(); options.setPartitionKey(new PartitionKey(partitionKeyValue)); obs = sparsitySleepMono.flux().flatMap( null, null, () -> container.readItem(docsToRead.get(container.getId()).get(index).getId(), new PartitionKey(partitionKeyValue), PojoizedJson.class)); } concurrencyControlSemaphore.acquire(); obs.subscribeOn(Schedulers.parallel()).subscribe(documentSubscriber); }
Source:
<code>private void launchStockMediaPicker() { if (mSite != null) { ActivityLauncher.showStockMediaPickerForResult(this, mSite, RequestCodes.STOCK_MEDIA_PICKER_SINGLE_SELECT); <START> } <END> }</code><technical_language>add a Toast if mSite is null? I a situation is happen, in event action is performed user is informed. fail in onCreate method in Activity itself. a direct part of this PR checks mSite null benefit this check right start</technical_language>

Target:
private void launchStockMediaPicker() { if (mSite != null) { ActivityLauncher.showStockMediaPickerForResult(this, mSite, RequestCodes.STOCK_MEDIA_PICKER_SINGLE_SELECT); } else { ToastUtils.showToast(this, R.string.blog_not_found); } }
Source:
<code>public void checkReference(boolean partial, boolean legacy) { checkCommon("Bundle org.nuxeo.apidoc.core", "Bundle org.nuxeo.apidoc.core", "In bundle group org.nuxeo.ecm.platform", "Documentation\n" + "Deployment Order\n" + "Components\n" + "Maven Artifact\n" + "Manifest"); try { String readme = AbstractExplorerTest.getReferenceContent("data/core_readme.txt"); String parentReadme = AbstractExplorerTest.getReferenceContent("data/apidoc_readme.txt"); checkDocumentationText("ReadMe.md\n" + readme + "\nParent Documentation: ReadMe.md\n" + parentReadme); } catch (IOException e) { throw new RuntimeException(e); } checkGroupId("org.nuxeo.ecm.platform"); checkArtifactId("nuxeo-apidoc-core"); checkRequirements(null); <START> checkDeploymentOrder(legacy ? false : true); <END> }</code><technical_language>suggestion checkDeploymentOrder(!legacy); (same elsewhere)</technical_language>

Target:
public void checkReference(boolean partial, boolean legacy) { checkCommon("Bundle org.nuxeo.apidoc.core", "Bundle org.nuxeo.apidoc.core", "In bundle group org.nuxeo.ecm.platform", "Documentation\n" + "Deployment Order\n" + "Components\n" + "Maven Artifact\n" + "Manifest"); try { String readme = AbstractExplorerTest.getReferenceContent("data/core_readme.txt"); String parentReadme = AbstractExplorerTest.getReferenceContent("data/apidoc_readme.txt"); checkDocumentationText("ReadMe.md\n" + readme + "\nParent Documentation: ReadMe.md\n" + parentReadme); } catch (IOException e) { throw new RuntimeException(e); } checkGroupId("org.nuxeo.ecm.platform"); checkArtifactId("nuxeo-apidoc-core"); checkRequirements(null); checkDeploymentOrder(!legacy); }
Source:
<code>private void runLocked(final Runnable action) { try { Exception releaseException = null; final InterProcessLock lock = new InterProcessSemaphoreMutex(zooKeeperHolder.get(), ROOT_PATH + "/lock"); lock.acquire(); try { action.run(); } finally { try { lock.release(); } catch (final Exception ex) { <START> LOG.warn("Failed to release lock", ex); <END> releaseException = ex; } } if (null != releaseException) { throw releaseException; } } catch (final RuntimeException ex) { throw ex; } catch (final Exception ex) { throw new RuntimeException(ex); } }</code><technical_language>this give a higher severity? Presumably, if release lock, there, processes waiting for stuck</technical_language>

Target:
private void runLocked(final Runnable action) { try { Exception releaseException = null; final InterProcessLock lock = new InterProcessSemaphoreMutex(zooKeeperHolder.get(), ROOT_PATH + "/lock"); lock.acquire(); try { action.run(); } finally { try { lock.release(); } catch (final Exception ex) { LOG.error("Failed to release lock", ex); releaseException = ex; } } if (null != releaseException) { throw releaseException; } } catch (final RuntimeException ex) { throw ex; } catch (final Exception ex) { throw new RuntimeException(ex); } }
Source:
<code>public String listConnectionsAsJSON() throws Exception { checkStarted(); clearIO(); try { JsonArrayBuilder array = JsonLoader.createArrayBuilder(); Set<RemotingConnection> connections = server.getRemotingService().getConnections(); for (RemotingConnection connection : connections) { JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("connectionID", connection.getID().toString()) .add("clientAddress", connection.getRemoteAddress()) .add("creationTime", connection.getCreationTime()) <START> .add("implementation", connection.getClass().getSimpleName()) <END> .add("sessionCount", server.getSessions(connection.getID().toString()).size()); if (connection.getClientID() != null) { obj.add("clientID", connection.getClientID()); } else { obj.add("clientID", ""); } array.add(obj); } return array.build().toString(); } finally { blockOnIO(); } }</code><technical_language>Please avoid reformatting this, code change</technical_language>

Target:
public String listConnectionsAsJSON() throws Exception { checkStarted(); clearIO(); try { JsonArrayBuilder array = JsonLoader.createArrayBuilder(); Set<RemotingConnection> connections = server.getRemotingService().getConnections(); for (RemotingConnection connection : connections) { JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("connectionID", connection.getID().toString()).add("clientAddress", connection.getRemoteAddress()).add("creationTime", connection.getCreationTime()).add("implementation", connection.getClass().getSimpleName()).add("sessionCount", server.getSessions(connection.getID().toString()).size()); List<ServerSession> sessions = server.getSessions(connection.getID().toString()); if (sessions.size() > 0) { if (sessions.get(0).getMetaData(ClientSession.JMS_SESSION_CLIENT_ID_PROPERTY) != null) { obj.add("clientID", sessions.get(0).getMetaData(ClientSession.JMS_SESSION_CLIENT_ID_PROPERTY)); } else { obj.add("clientID", ""); } } else { obj.add("clientID", ""); } array.add(obj); } return array.build().toString(); } finally { blockOnIO(); } }
Source:
<code>public void commitOutput() throws IOException { <START> try (OutputStream os = response.getOutputStream()) { <END> try (InputStream is = getInputStream()) { if (is != null) { Utils.transferContent(is, os); } os.flush(); } } }</code><technical_language>In original version, "in" "out" closed end. do close now</technical_language>

Target:
public void commitOutput() throws IOException { OutputStream os = response.getOutputStream(); InputStream is = getInputStream(); if (is != null) { Utils.transferContent(is, os); } os.flush(); }
Source:
<code><START> public static void delete(Path path) throws IOException { <END> if ( path == null ) { throw new IllegalArgumentException(); } if ( Files.notExists( path ) ) { return; } Files.walkFileTree( path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { safeDelete( file ); return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) { safeDelete( dir ); return FileVisitResult.CONTINUE; } } ); }</code><technical_language>new behavior, renaming this "tryDelete" sense</technical_language>

Target:
public static void delete(Path path) throws IOException { deleteRecursive( path, false ); }
Source:
<code>private boolean doValidation(ValidationHandler handler, String elementType, String elementName, String permissionType, List<FieldMetadata> roles) { boolean valid = true; for (FieldMetadata roleMetadata : roles) { String lowerCaseRoleName = roleMetadata.getName().toLowerCase(); if (lowerCaseRoleName.startsWith("system_") || lowerCaseRoleName.equals("administration") || lowerCaseRoleName.equals("super_admin")) { String message = "System role \"" + roleMetadata.getName() + "\" shouldn't be used to set \"" + permissionType <START> + "\" permission on "+elementType+" \"" + elementName + "\" ."; END> Element data = roleMetadata.<Element> getData(MetadataRepository.XSD_DOM_ELEMENT); Integer lineNum = roleMetadata.<Integer> getData(MetadataRepository.XSD_LINE_NUMBER); Integer colNum = roleMetadata.<Integer> getData(MetadataRepository.XSD_COLUMN_NUMBER); if(complexTypeMetadata != null) { handler.error(complexTypeMetadata, message, data,lineNum, colNum, ValidationError.PERMISSION_SYSTEM_ROLE_NOT_SETTABLE); } else { handler.error(field, message, data,lineNum, colNum, ValidationError.PERMISSION_SYSTEM_ROLE_NOT_SETTABLE); } valid &= false; } } return valid; }</code><technical_language>Need format code, space right, see: +elementType+</technical_language>

Target:
private boolean doValidation(ValidationHandler handler, String elementType, String elementName, String permissionType, List<FieldMetadata> roles) { boolean valid = true; for (FieldMetadata roleMetadata : roles) { String lowerCaseRoleName = roleMetadata.getName().toLowerCase(); if (lowerCaseRoleName.startsWith(PermissionConstants.PERMISSION_ROLE_SYSTEM_PREFIX) || lowerCaseRoleName.equals(PermissionConstants.PERMISSION_ROLE_ADMINISTRATION)) { String message = "System role \"" + roleMetadata.getName() + "\" shouldn't be used to set \"" + permissionType + "\" permission on " + elementType + " \"" + elementName + "\" ."; Element data = roleMetadata.<Element> getData(MetadataRepository.XSD_DOM_ELEMENT); Integer lineNum = roleMetadata.<Integer> getData(MetadataRepository.XSD_LINE_NUMBER); Integer colNum = roleMetadata.<Integer> getData(MetadataRepository.XSD_COLUMN_NUMBER); if(complexTypeMetadata != null) { handler.error(complexTypeMetadata, message, data,lineNum, colNum, ValidationError.PERMISSION_SYSTEM_ROLE_NOT_SETTABLE); } else { handler.error(field, message, data,lineNum, colNum, ValidationError.PERMISSION_SYSTEM_ROLE_NOT_SETTABLE); } valid &= false; } } return valid; }
Source:
<code>public SortedComponentGroupedEvents(ComponentGroupedEvents groupedEvents, String selectedEventId) { this.componentName = groupedEvents.getComponentName(); this.inputEventIds = new ArrayList<>(groupedEvents.getInputEventIds()); this.outputEventIds = new ArrayList<>(groupedEvents.getOutputEventIds()); if (this.outputEventIds.contains(selectedEventId)) { this.containingSelectedEvent = true; <START> this.outputEventIds.remove(selectedEventId); <END> this.outputEventIds.add(0, selectedEventId); } else { this.containingSelectedEvent = false; } }</code><technical_language>nit: LinkedList adding removing entries</technical_language>

Target:
public SortedComponentGroupedEvents(ComponentGroupedEvents groupedEvents, String selectedEventId) { this.componentName = groupedEvents.getComponentName(); this.inputEventIds = new LinkedList<>(groupedEvents.getInputEventIds()); this.outputEventIds = new LinkedList<>(groupedEvents.getOutputEventIds()); if (this.outputEventIds.contains(selectedEventId)) { this.containingSelectedEvent = true; this.outputEventIds.remove(selectedEventId); this.outputEventIds.add(0, selectedEventId); } else { this.containingSelectedEvent = false; } }
Source:
<code>private boolean handleFailure(PollReport pollReport) { log.trace("Handle failures for the report: {}", pollReport); Layout layout = serverContext.copyManagementLayout(); try { ClusterState clusterState = pollReport.getClusterState(); <START> if (clusterState.size() != layout.getAllServers().size()) { <END> log.error("Cluster representation is different than layout. Cluster: {}, layout: {}", clusterState, layout); return false; } Optional<NodeRank> maybeFailedNode = recommendationEngine.failedServer( clusterState, layout.getUnresponsiveServers(), serverContext.getLocalEndpoint() ); if (maybeFailedNode.isPresent()) { NodeRank failedNode = maybeFailedNode.get(); Set<String> failedNodes = new HashSet<>(); failedNodes.add(failedNode.getEndpoint()); handleFailure(failedNodes, pollReport); return true; } } catch (Exception e) { log.error("Exception invoking failure handler : {}", e); } return false; }</code><technical_language>this happen ? I check want this happen ? is intention this happen</technical_language>

Target:
private boolean handleFailure(PollReport pollReport) { log.trace("Handle failures for the report: {}", pollReport); Layout layout = serverContext.copyManagementLayout(); try { ClusterState clusterState = pollReport.getClusterState(); if (clusterState.size() != layout.getAllServers().size()) { log.error("Cluster representation is different than layout. Cluster: {}, layout: {}", clusterState, layout); return false; } Optional<NodeRank> maybeFailedNode = advisor.failedServer( clusterState, layout.getUnresponsiveServers(), serverContext.getLocalEndpoint() ); if (maybeFailedNode.isPresent()) { NodeRank failedNode = maybeFailedNode.get(); FailureDetectorMetrics history = FailureDetectorMetrics.builder() .localNode(serverContext.getLocalEndpoint()) .graph(ClusterGraph.transform(pollReport.getClusterState()).toSymmetric().connectivityGraph()) .healed(failedNode) .action(FailureDetectorAction.FAIL) .unresponsiveNodes(layout.getUnresponsiveServers()) .layout(layout.getLayoutServers()) .epoch(layout.getEpoch()) .build(); serverContext.saveFailureDetectorMetrics(history); Set<String> failedNodes = new HashSet<>(); failedNodes.add(failedNode.getEndpoint()); handleFailure(failedNodes, pollReport); return true; } } catch (Exception e) { log.error("Exception invoking failure handler : {}", e); } return false; }