auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void delayWindowTest2() { <END> log.info("DelayWindow Test2 : Testing window parameter definition3"); SiddhiManager siddhiManager = new SiddhiManager(); String query = "define window eventWindow(symbol string, price int, volume float) delay('abc') "; SiddhiAppRuntime siddhiAppRuntime = null; try { siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(query); } catch (SiddhiAppCreationException e) { error = false; log.info(e.getCause()); } finally { if (siddhiAppRuntime != null) { siddhiAppRuntime.shutdown(); } } AssertJUnit.assertFalse(error); }</code><technical_language>Please expectedExceptions testng parameter write validation test cases asserting error. catch assert error message too</technical_language>

Target:
public void delayWindowTest2() { log.info("DelayWindow Test2 : Testing window parameter definition3"); SiddhiManager siddhiManager = new SiddhiManager(); String query = "define window eventWindow(symbol string, price int, volume float) delay('abc') "; SiddhiAppRuntime siddhiAppRuntime = null; try { siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(query); } catch (SiddhiAppCreationException e) { error = false; AssertJUnit.assertEquals("Delay window's parameter attribute should be either int or long, " + "but found STRING", e.getCause().getMessage()); throw e; } finally { if (siddhiAppRuntime != null) { siddhiAppRuntime.shutdown(); } } }
Source:
<code><START> public void testDoHandleEvictOlderChannelData() throws Exception { <END> ReceiverReplicationChannel channel1 = handler.doHandle(connection1); channel1.hello(new ReplicationHello("remoteServer", 0)); verify(registry, never()).evictAll(any(SourceMatcher.class)); ReceiverReplicationChannel channel2 = handler.doHandle(connection2); channel2.hello(new ReplicationHello("remoteServer", 0)); verify(registry, never()).evictAll(any(SourceMatcher.class)); ArgumentCaptor<SourceMatcher> argument = ArgumentCaptor.forClass(SourceMatcher.class); channel1.close(); inputSubject2.onNext(new StreamStateUpdate(new StreamStateNotification<>(BufferStart, forFullRegistry()))); verify(registry, never()).evictAll(any(SourceMatcher.class)); inputSubject2.onNext(new StreamStateUpdate(new StreamStateNotification<>(BufferEnd, forFullRegistry()))); Thread.sleep(50); verify(registry).evictAll(argument.capture()); assertThat(argument.getValue().toString(), is(matcherFor(channel1.getSource()).toString())); }</code><technical_language>need test multiple concurrent connections established</technical_language>

Target:
public void testDoHandleEvictOlderChannelData() throws Exception { ReceiverReplicationChannel channel1 = handler.doHandle(connection1); Source remoteServer1 = new Source(Origin.REPLICATED, "remoteServer", 0); channel1.hello(new ReplicationHello(remoteServer1, 0)); verify(registry, never()).evictAll(any(SourceMatcher.class)); ReceiverReplicationChannel channel2 = handler.doHandle(connection2); Source remoteServer2 = new Source(Origin.REPLICATED, "remoteServer", 1); channel2.hello(new ReplicationHello(remoteServer2, 0)); verify(registry, never()).evictAll(any(SourceMatcher.class)); ArgumentCaptor<SourceMatcher> argument = ArgumentCaptor.forClass(SourceMatcher.class); channel1.close(); inputSubject2.onNext(new StreamStateUpdate(new StreamStateNotification<>(BufferStart, forFullRegistry()))); verify(registry, never()).evictAll(any(SourceMatcher.class)); inputSubject2.onNext(new StreamStateUpdate(new StreamStateNotification<>(BufferEnd, forFullRegistry()))); Thread.sleep(50); verify(registry).evictAll(argument.capture()); assertThat(argument.getValue().match(remoteServer1), is(true)); assertThat(argument.getValue().match(remoteServer2), is(false)); }
Source:
<code>protected void executeCommand() { VDSReturnValue returnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.AddBricksToGlusterVolume, new GlusterVolumeBricksActionVDSParameters(getUpServer().getId(), getGlusterVolumeName(), getParameters().getBricks(), getParameters().getReplicaCount(), getParameters().getStripeCount())); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { addGlusterVolumeBricksInDb(getParameters().getBricks(), getParameters().getReplicaCount(), getParameters().getStripeCount()); } <START> setSucceeded(returnValue.getSucceeded()); <END> }</code><technical_language>do again? done in line 54</technical_language>

Target:
protected void executeCommand() { VDSReturnValue returnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.AddBricksToGlusterVolume, new GlusterVolumeBricksActionVDSParameters(getUpServer().getId(), getGlusterVolumeName(), getParameters().getBricks(), getParameters().getReplicaCount(), getParameters().getStripeCount())); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { addGlusterVolumeBricksInDb(getParameters().getBricks(), getParameters().getReplicaCount(), getParameters().getStripeCount()); } }
Source:
<code>protected void migrateData( ReviewDb db, UpdateUI ui) throws OrmException { Repository git; try { git = mgr.openRepository(allProjects); } catch (IOException e) { throw new OrmException(e); } try { MetaDataUpdate md = new MetaDataUpdate(GitReferenceUpdated.DISABLED, allProjects, git); ProjectConfig config = ProjectConfig.read(md); List<AccountGroup.UUID> adminGroupUUIDs = getAdministrateServerGroups(db, config); <START> if (!adminGroupUUIDs.isEmpty()) { <END> createGroup(db, "Change Owner", adminGroupUUIDs.get(0), "The owner of a change"); } } catch (IOException e) { throw new OrmException(e); } catch (ConfigInvalidException e) { throw new OrmException(e); } finally { git.close(); } }</code><technical_language>isEmpty() checked now. line 126. rename method in findAdminGroup() return group method</technical_language>

Target:
protected void migrateData( ReviewDb db, UpdateUI ui) throws OrmException { Repository git; try { git = mgr.openRepository(allProjects); } catch (IOException e) { throw new OrmException(e); } try { MetaDataUpdate md = new MetaDataUpdate(GitReferenceUpdated.DISABLED, allProjects, git); ProjectConfig config = ProjectConfig.read(md); AccountGroup.UUID adminGroupUUID = findAdminGroup(db, config); createGroup(db, "Change Owner", adminGroupUUID, "The owner of a change"); } catch (IOException e) { throw new OrmException(e); } catch (ConfigInvalidException e) { throw new OrmException(e); } finally { git.close(); } }
Source:
<code>public void handlePost(ActionParameters params) throws ActionException { params.requireLoggedInUser(); try { JSONArray paramFeatures = new JSONArray(params.getHttpParam("featureData")); JSONArray updatedFeatureIds = new JSONArray(); for (int i = 0; i < paramFeatures.length(); i++) { JSONObject featureJSON = paramFeatures.getJSONObject(i); OskariLayer layer = getLayer(featureJSON.optString("layerId")); if (!canEdit(layer, params.getUser())) { throw new ActionDeniedException("User doesn't have edit permission for layer: " + layer.getId()); } final String wfstMessage = createWFSTMessage(featureJSON); LOG.debug("Inserting feature to service at", layer.getUrl(), "with payload", wfstMessage); final String responseString = postPayload(layer, wfstMessage); updatedFeatureIds.put(parseFeatureIdFromResponse(responseString)); <START> flushLayerTilesCache(layer.getId()); <END> } ResponseHelper.writeResponse(params, JSONHelper.createJSONObject("fids", updatedFeatureIds)); } catch (JSONException e) { LOG.error(e, "JSON processing error"); throw new ActionException("JSON processing error", e); } }</code><technical_language>This improved collecting distinct layerIds updated in loop in a Set flushing layers this loops is finished. flush layer once</technical_language>

Target:
public void handlePost(ActionParameters params) throws ActionException { params.requireLoggedInUser(); try { JSONArray paramFeatures = new JSONArray(params.getHttpParam("featureData")); JSONArray updatedFeatureIds = new JSONArray(); Map<Integer, OskariLayer> layers = getLayers(paramFeatures); hasUserPermissionEditLayers(layers, params.getUser()); for (int i = 0; i < paramFeatures.length(); i++) { JSONObject featureJSON = paramFeatures.getJSONObject(i); OskariLayer layer = getLayer(featureJSON.optString("layerId")); final String wfstMessage = createWFSTMessage(featureJSON); LOG.debug("Inserting feature to service at", layer.getUrl(), "with payload", wfstMessage); final String responseString = postPayload(layer, wfstMessage); updatedFeatureIds.put(parseFeatureIdFromResponse(responseString)); } flushLayerTilesCache(layers); ResponseHelper.writeResponse(params, JSONHelper.createJSONObject("fids", updatedFeatureIds)); } catch (JSONException e) { LOG.error(e, "JSON processing error"); throw new ActionException("JSON processing error", e); } }
Source:
<code>public boolean offer(Message msg) { if (capacity == 0) { try { queue.put(msg); } catch (InterruptedException e) { return false; } return true; } <START> return queue.offer(msg); <END> }</code><technical_language>I thought changing this offer put. a big change. current change break existing behavior. good/safe me. nitpicking: a if-else more straightforward</technical_language>

Target:
public boolean offer(Message msg) { if (capacity == 0) { try { queue.put(msg); } catch (InterruptedException e) { return false; } return true; } else { return queue.offer(msg); } }
Source:
<code>private GraphHopperStorage newGHStorage(Directory dir, boolean is3D, boolean forEdgeBasedTraversal, int segmentSize) { GraphHopperStorage graph = new GraphBuilder(encodingManager) .setDir(dir).set3D(is3D).withTurnCosts(true).setSegmentSize(segmentSize).build(); for (FlagEncoder encoder : encodingManager.fetchEdgeEncoders()) { FastestWeighting weighting = new FastestWeighting(encoder, new DefaultTurnCostProvider(encoder, graph.getTurnCostStorage())); graph.addCHGraph(new CHProfile(weighting, forEdgeBasedTraversal)); <START> } <END> return graph; }</code><technical_language>working. IMO profiles identical. I I fixed this commit. problem inconsistent of weightings for CH profiles created for graphs. > Is this due compatibility layer? remove this :) ? this of compatibility layer. problem in case weighting a turn cost provider in other a default turn cost provider</technical_language>

Target:
private GraphHopperStorage newGHStorage(Directory dir, boolean is3D, boolean forEdgeBasedTraversal, int segmentSize) { GraphHopperStorage graph = new GraphBuilder(encodingManager) .setDir(dir).set3D(is3D).withTurnCosts(true).setSegmentSize(segmentSize).build(); for (FlagEncoder encoder : encodingManager.fetchEdgeEncoders()) { TurnCostProvider turnCostProvider = forEdgeBasedTraversal ? new DefaultTurnCostProvider(encoder, graph.getTurnCostStorage()) : TurnCostProvider.NO_TURN_COST_PROVIDER; FastestWeighting weighting = new FastestWeighting(encoder, turnCostProvider); graph.addCHGraph(new CHProfile(weighting, forEdgeBasedTraversal)); } return graph; }
Source:
<code>public Observation.ObservationStatus getObsStatus(Obs obs) { Observation.ObservationStatus status = Observation.ObservationStatus.FINAL; <START> return status; <END> }</code><technical_language>do in line</technical_language>

Target:
public Observation.ObservationStatus getObsStatus(Obs obs) { return Observation.ObservationStatus.FINAL; }
Source:
<code>public List<CourseComponent> getVideos(boolean downloadableOnly) { List<CourseComponent> videos = new ArrayList<>(); fetchAllLeafComponents(videos, EnumSet.of(BlockType.VIDEO)); for (Iterator<CourseComponent> videosIterator = videos.iterator(); videosIterator.hasNext(); ) { CourseComponent videoComponent = videosIterator.next(); <START> if (!(videoComponent instanceof VideoBlockModel)) { <END> videosIterator.remove(); } else if (downloadableOnly && videoComponent.getDownloadableVideosCount() == 0) { videosIterator.remove(); } } return videos; }</code><technical_language>if else if thing, combined operator</technical_language>

Target:
public List<CourseComponent> getVideos(boolean downloadableOnly) { List<CourseComponent> videos = new ArrayList<>(); fetchAllLeafComponents(videos, EnumSet.of(BlockType.VIDEO)); for (Iterator<CourseComponent> videosIterator = videos.iterator(); videosIterator.hasNext(); ) { CourseComponent videoComponent = videosIterator.next(); if (!(videoComponent instanceof VideoBlockModel) || downloadableOnly && videoComponent.getDownloadableVideosCount() == 0) { videosIterator.remove(); } } return videos; }
Source:
<code>public List<String> sendTuple(final Tuple<K, V> tuple) { <START> waitForInitializing(); <END> checkState(State.SENDING); return dataSender.sendTuple(tuple); }</code><technical_language>sendTuple blocks if comm. is initialized</technical_language>

Target:
public List<String> sendTuple(final Tuple<K, V> tuple) { waitForSenderInitialized(); stateMachine.checkState(PushShuffleSenderState.SENDING); final List<String> sentReceiverIdList = dataSender.sendTuple(tuple); messageChecker.messageSent(sentReceiverIdList.size()); return sentReceiverIdList; }
Source:
<code>public CourseInfo(InstructorAttributes currentInstructor, CourseDetailsBundle courseDetails, List<InstructorAttributes> instructors) { this.currentInstructor = currentInstructor; this.courseDetails = courseDetails; this.instructors = instructors; this.sections = new ArrayList<>(); for (SectionDetailsBundle section : courseDetails.sections) { boolean isAllowedToViewStudentInSection = currentInstructor.isAllowedForPrivilege(section.name, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS); boolean isAllowedToModifyStudent = currentInstructor.isAllowedForPrivilege(section.name, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT); for (TeamDetailsBundle teamDetails : section.teams) { sections.add(new StudentListSectionData(section.name, isAllowedToViewStudentInSection, isAllowedToModifyStudent, createStudentDataInSection(section.name, teamDetails.students))); } } if (sections.size() == 1) { StudentListSectionData section = sections.get(0); <START> this.hasSection = !"None".equals(section.sectionName); <END> } else { this.hasSection = true; } }</code><technical_language>"None" a representative in Const class. instead</technical_language>

Target:
public CourseInfo(InstructorAttributes currentInstructor, CourseDetailsBundle courseDetails, List<InstructorAttributes> instructors) { this.currentInstructor = currentInstructor; this.courseDetails = courseDetails; this.instructors = instructors; this.sections = new ArrayList<>(); for (SectionDetailsBundle section : courseDetails.sections) { boolean isAllowedToViewStudentInSection = currentInstructor.isAllowedForPrivilege(section.name, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS); boolean isAllowedToModifyStudent = currentInstructor.isAllowedForPrivilege(section.name, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT); for (TeamDetailsBundle teamDetails : section.teams) { sections.add(new StudentListSectionData(section.name, isAllowedToViewStudentInSection, isAllowedToModifyStudent, createStudentDataInSection(section.name, teamDetails.students))); } } if (sections.size() == 1) { StudentListSectionData section = sections.get(0); this.hasSection = !Const.DEFAULT_SECTION.equals(section.sectionName); } else { this.hasSection = true; } }
Source:
<code>public String toString() { <START> return "Weapon [firerate=" + firerate + ", magazineSize=" + magazineSize + ", damage=" + damage + ", shooting=" + shooting + "]"; <END> }</code><technical_language>String.format</technical_language>

Target:
public String toString() { return String.format("Weapon [firerate=%s, magazineSize=%s, gameObject=%s, damage=%s, shooting=%s, activeBullets=%s]", firerate, magazineSize, gameObject, damage, shooting, activeBullets); }
Source:
<code>public boolean isLarge() { <START> return this.encodedLength > largeSizeBytes; <END> }</code><technical_language>encodedLength zero if encoded</technical_language>

Target:
public boolean isLarge() { return this.onDiskLength() > largeSizeBytes; }
Source:
<code>private void openCropActivity(Uri sourceUri, Uri destinationUri) { UCrop.of(sourceUri, destinationUri) <START> .withAspectRatio(5f, 5f) <END> .start(getActivity(), AddEditPatientFragment.this); }</code><technical_language>@rishabh-997 place 5f in application constants name</technical_language>

Target:
private void openCropActivity(Uri sourceUri, Uri destinationUri) { UCrop.of(sourceUri, destinationUri) .withAspectRatio(ApplicationConstants.ASPECT_RATIO_FOR_CROPPING, ApplicationConstants.ASPECT_RATIO_FOR_CROPPING) .start(getActivity(), AddEditPatientFragment.this); }
Source:
<code>public void onNext(final FailedEvaluator failedEvaluator) { final String evaluatorId = failedEvaluator.getId(); if (!idMap.containsKey(evaluatorId)) { LOG.warning("Failed to find a requestor for " + evaluatorId + ". Ignore " + failedEvaluator.toString()); return; } <START> final String requestorId = idMap.get(evaluatorId); <END> if (requestorId.equals(DataLoader.class.getName())) { dataLoader.handleDataLoadingEvalFailure(failedEvaluator); } else if (requestorId.equals(ElasticMemory.class.getName())) { } else { LOG.warning("Unknown failed evaluator. Ignore " + failedEvaluator.toString()); } }</code><technical_language>This is thread-safe. check containsKey, a chance requestorId null</technical_language>

Target:
public void onNext(final FailedEvaluator failedEvaluator) { final String evaluatorId = failedEvaluator.getId(); final String requestorId = evalToRequestorMap.get(evaluatorId); if (requestorId == null) { LOG.warning("Failed to find a requestor for " + evaluatorId + ". Ignore " + failedEvaluator); return; } if (requestorId.equals(DataLoader.class.getName())) { dataLoader.handleDataLoadingEvalFailure(failedEvaluator); } else if (requestorId.equals(ElasticMemory.class.getName())) { } else { LOG.warning("Unknown failed evaluator. Ignore " + failedEvaluator); } }
Source:
<code>private static boolean useInvokeDynamic() { String property = System.getProperty(ENABLE_INVOKEDYNAMIC); if (property != null) { return Boolean.valueOf(property); } else { String javaVersion = System.getProperty("java.version"); <START> return javaVersion.compareTo(INVOKEDYNAMIC_MINIMUM_VERSION) >= 0; <END> } }</code><technical_language>is safe? If, for instance, javaVersion "1.8.0_100", this check fail. I familiar java minor versions naming, is okay</technical_language>

Target:
private static boolean useInvokeDynamic() { String property = System.getProperty(ENABLE_INVOKEDYNAMIC); if (property != null) { return Boolean.valueOf(property); } else { JavaVersion javaVersion = new JavaVersion(System.getProperty("java.version")); return javaVersion.compareTo(new JavaVersion(INVOKEDYNAMIC_MINIMUM_VERSION)) >= 0; } }
Source:
<code>public boolean accept(AuditEvent event) { boolean accepted = true; if (event.getLocalizedMessage() != null) { final FileContents currentContents = FileContentsHolder.getCurrentFileContents(); <START> if (currentContents != null) { <END> if (getFileContents() != currentContents) { setFileContents(currentContents); tagSuppressions(); } if (matchesTag(event)) { accepted = false; } } } return accepted; }</code><technical_language>I do removal of UT a test of if (currentContents != null) {</technical_language>

Target:
public boolean accept(AuditEvent event) { boolean accepted = true; if (event.getLocalizedMessage() != null) { final FileContents currentContents = FileContentsHolder.getCurrentFileContents(); if (getFileContents() != currentContents) { setFileContents(currentContents); tagSuppressions(); } if (matchesTag(event)) { accepted = false; } } return accepted; }
Source:
<code>protected <EventAtom> boolean removeRule(final RuleSpecification<EventAtom> specification, final EventFilter<? super EventAtom> filter) { Objects.requireNonNull(specification, "Cannot remove null rule specification!"); Objects.requireNonNull(filter, "Cannot remove instance for null filter"); final RuleInstance<?> instance = findInstance(specification, filter); if (instance != null) { instance.dispose(); <START> ruleInstanceTable.remove(specification, filter); <END> return true; } return false; }</code><technical_language>This correct - specification-filter pairs in ruleInstanceTable</technical_language>

Target:
protected <EventAtom> boolean removeRule(final RuleSpecification<EventAtom> specification, final EventFilter<? super EventAtom> filter) { Objects.requireNonNull(specification, "Cannot remove null rule specification!"); Objects.requireNonNull(filter, "Cannot remove instance for null filter"); final RuleInstance<?> instance = findInstance(specification, filter); if (instance != null) { instance.dispose(); ruleInstanceTable.compute(specification, (k, old) -> { old.remove(filter); return old.isEmpty() ? null: old; }); return true; } return false; }
Source:
<code>public void addUser(String user, EntitlementManager managerForThisUser) { <START> perUserManagers.put(user, managerForThisUser); <END> }</code><technical_language>Is accept nulls, put(checkNotNull(user, "user"), checkNotNull(managerForThisUser, "managerForThisUser"))</technical_language>

Target:
public void addUser(String user, EntitlementManager managerForThisUser) { perUserManagers.put(Preconditions.checkNotNull(user, "user"), Preconditions.checkNotNull(managerForThisUser, "managerForThisUser")); }
Source:
<code>public @ResponseBody JSONObj update(@PathVariable String wsName, @PathVariable Long id, @RequestBody JSONObj obj) throws Exception { Catalog catalog = geoServer.getCatalog(); WorkspaceInfo ws = findWorkspace(wsName, catalog); ImportContext imp = findImport(id); <START> System.out.println("Update import " + id + " with state " + imp.getState()); <END> if (imp.getState() == ImportContext.State.PENDING) { ImportFilter f = filter(obj); return continueImport(imp, ws, f); } Integer t = obj.integer("task"); if (t == null) { throw new BadRequestException("Request must contain task identifier"); } final ImportTask task = imp.task(t); if (task == null) { throw new NotFoundException("No such task: " + t + " for import: " + id); } ResourceInfo resource = task.getLayer().getResource(); if (task.getState() == ImportTask.State.NO_CRS) { JSONObj proj = obj.object("proj"); if (proj == null) { throw new BadRequestException("Request must contain a 'proj' property"); } try { resource.setSRS(IO.srs(proj)); resource.setNativeCRS(IO.crs(proj)); importer.changed(task); } catch(Exception e) { throw new BadRequestException("Unable to parse proj: " + proj.toString()); } } importer.run(imp, new ImportFilter() { @Override public boolean include(ImportTask t) { return task.getId() == t.getId(); } }); if (task.getState() == ImportTask.State.COMPLETE) { return complete(task); } else { switch(task.getState()) { case NO_CRS: case NO_BOUNDS: return pending(task); case ERROR: return failed(task); default: return ignored(task); } } }</code><technical_language>system out, do need a logger</technical_language>

Target:
public @ResponseBody JSONObj update(@PathVariable String wsName, @PathVariable Long id, @RequestBody JSONObj obj) throws Exception { Catalog catalog = geoServer.getCatalog(); WorkspaceInfo ws = findWorkspace(wsName, catalog); ImportContext imp = findImport(id); if (imp.getState() == ImportContext.State.PENDING) { ImportFilter f = filter(obj); return continueImport(imp, ws, f); } Integer t = obj.integer("task"); if (t == null) { throw new BadRequestException("Request must contain task identifier"); } final ImportTask task = imp.task(t); if (task == null) { throw new NotFoundException("No such task: " + t + " for import: " + id); } ResourceInfo resource = task.getLayer().getResource(); if (task.getState() == ImportTask.State.NO_CRS) { JSONObj proj = obj.object("proj"); if (proj == null) { throw new BadRequestException("Request must contain a 'proj' property"); } try { resource.setSRS(IO.srs(proj)); resource.setNativeCRS(IO.crs(proj)); importer.changed(task); } catch(Exception e) { throw new BadRequestException("Unable to parse proj: " + proj.toString()); } } importer.run(imp, new ImportFilter() { @Override public boolean include(ImportTask t) { return task.getId() == t.getId(); } }); if (task.getState() == ImportTask.State.COMPLETE) { return complete(task); } else { switch(task.getState()) { case NO_CRS: case NO_BOUNDS: return pending(task); case ERROR: return failed(task); default: return ignored(task); } } }
Source:
<code>public void loadProjectClassloaderFromStringTest() throws Exception { CompilationResponse res = compileProjectInRepo(MavenCLIArgs.CLEAN, MavenCLIArgs.COMPILE, MavenCLIArgs.INSTALL); if (!res.isSuccessful()) { TestUtil.writeMavenOutputIntoTargetFolder(tmp, res.getMavenOutput(), "ClassLoaderProviderTest.loadProjectClassloaderFromStringTest"); } assertThat(res.isSuccessful()).isTrue(); Optional<ClassLoader> clazzLoader = CompilerClassloaderUtils.loadDependenciesClassloaderFromProject(uberfireTmp.toAbsolutePath().toString(), mavenRepo.toAbsolutePath().toString()); assertThat(clazzLoader).isNotNull(); <START> assertThat(clazzLoader.isPresent()).isTrue(); <END> LoadProjectDependencyUtil.loadLoggerFactory(clazzLoader.get()); if (tmpRoot != null) { TestUtil.rm(tmpRoot.toFile()); } }</code><technical_language>Replace assertThat(clazzLoader).isPresent() is shorter error message. remove assertThat(clazzLoader).isNotNull(); non-nullness is checked in assertJ methods require non-null values default. 25x in this PR (Ctrl + f "isPresent()).isTrue();")</technical_language>

Target:
public void loadProjectClassloaderFromStringTest() throws Exception { CompilationResponse res = compileProjectInRepo(MavenCLIArgs.CLEAN, MavenCLIArgs.COMPILE, MavenCLIArgs.INSTALL); TestUtil.saveMavenLogIfCompilationResponseNotSuccessfull(tmp, res, this.getClass(), testName); assertThat(res.isSuccessful()).isTrue(); Optional<ClassLoader> clazzLoader = CompilerClassloaderUtils.loadDependenciesClassloaderFromProject(uberfireTmp.toAbsolutePath().toString(), mavenRepo.toAbsolutePath().toString()); assertThat(clazzLoader).isPresent(); LoadProjectDependencyUtil.loadLoggerFactory(clazzLoader.get()); }
Source:
<code>private Optional<String> createTextQueryPlan(QueryInfo queryInfo) { try { if (queryInfo.getOutputStage().isPresent()) { return Optional.of(textDistributedPlan( queryInfo.getOutputStage().get(), functionRegistry, queryInfo.getSession().toSession(sessionPropertyManager), false)); } } catch (Exception e) { <START> log.warn(e, "Error creating explain plan"); <END> } return Optional.empty(); }</code><technical_language>Unrelated, add query ID do this</technical_language>

Target:
private Optional<String> createTextQueryPlan(QueryInfo queryInfo) { try { if (queryInfo.getOutputStage().isPresent()) { return Optional.of(textDistributedPlan( queryInfo.getOutputStage().get(), functionRegistry, queryInfo.getSession().toSession(sessionPropertyManager), false)); } } catch (Exception e) { log.warn(e, "Error creating explain plan for query %s", queryInfo.getQueryId()); } return Optional.empty(); }
Source:
<code>private RelationshipMetadataValue getRelationMetadataFromOtherItem(Context context, Item otherItem, String relationName, Integer relationshipId) { RelationshipMetadataValue metadataValue = constructMetadataValue(context, MetadataSchemaEnum.RELATION .getName() + "." + relationName); <START> metadataValue.setAuthority(Constants.VIRTUAL_AUTHORITY_PREFIX + relationshipId); <END> metadataValue.setValue(otherItem.getID().toString()); return metadataValue; }</code><technical_language>Please consider metadataValue null constructMetadataValue return null</technical_language>

Target:
private RelationshipMetadataValue getRelationMetadataFromOtherItem(Context context, Item otherItem, String relationName, Integer relationshipId) { RelationshipMetadataValue metadataValue = constructMetadataValue(context, MetadataSchemaEnum.RELATION .getName() + "." + relationName); if (metadataValue != null) { metadataValue.setAuthority(Constants.VIRTUAL_AUTHORITY_PREFIX + relationshipId); metadataValue.setValue(otherItem.getID().toString()); return metadataValue; } return null; }
Source:
<code><START> private Set<Location> getAllChildAndGrandLocations(Set<Location> visitLocations){ <END> Set<Location>allchildAndGrandVisitLocations=new HashSet<Location>(); for(Location visitLocation:visitLocations) { allchildAndGrandVisitLocations.addAll(visitLocation.getChildLocations()); if(visitLocation.getChildLocations() !=null) { getAllChildAndGrandLocations(allchildAndGrandVisitLocations); } else { break; } } return allchildAndGrandVisitLocations; }</code><technical_language>write a quick test this worked properly? I wrong, accumulation of results work correctly</technical_language>

Target:
public static Set<Location> getAllChildAndGrandLocations(Set<Location> visitLocations) { Set<Location> allchildAndGrandVisitLocations = new HashSet<Location>(); for (Location visitLocation : visitLocations) { if (visitLocation.getChildLocations() != null) { allchildAndGrandVisitLocations.addAll(visitLocation.getChildLocations()); getAllChildAndGrandLocations(allchildAndGrandVisitLocations); } else { break; } } return allchildAndGrandVisitLocations; }
Source:
<code>private boolean checkPermissions(Attribute attr, Subject subject, String action) { Map<String, Set<String>> map = null; KeyValueCollectionPermission securityPermission; if (attr != null) { map = (Map<String, Set<String>>) attr.getValue(); } if (MapUtils.isNotEmpty(map)) { securityPermission = new KeyValueCollectionPermission(action, map); } else { <START> securityPermission = new KeyValueCollectionPermission(action); <END> } return subject.isPermitted(securityPermission); }</code><technical_language>replace this if calling KeyValueCollectionPermission(action, map) function empty map? attempt addAll empty map do anything. java Map<String, Set<String>> map = Collections.emptyMap(); KeyValueCollectionPermission securityPermission; if (attr != null) { map = (Map<String, Set<String>>) attr.getValue(); } securityPermission = new KeyValueCollectionPermission(action, map);</technical_language>

Target:
private boolean checkPermissions(Attribute attr, Subject subject, String action) { Map<String, Set<String>> map = null; KeyValueCollectionPermission securityPermission; if (attr != null) { map = (Map<String, Set<String>>) attr.getValue(); } if (MapUtils.isNotEmpty(map)) { securityPermission = new KeyValueCollectionPermission(action, map); } else { return false; } return subject.isPermitted(securityPermission); }
Source:
<code>public void setReadOnly(boolean readOnly) throws SQLException { checkClosed(); if (queryExecutor.getTransactionState() != TransactionState.IDLE) { throw new PSQLException( GT.tr("Cannot change transaction read-only property in the middle of a transaction."), PSQLState.ACTIVE_SQL_TRANSACTION); } if (readOnly != this.readOnly) { if (autoCommit) { <START> execSQLUpdate(readOnly ? setSessionReadOnly : setSessionNotReadOnly); <END> } } this.readOnly = readOnly; LOGGER.log(Level.FINE, " setReadOnly = {0}", readOnly); }</code><technical_language>This hidden a default=true connection property. is default pgjdbc issue SET SESSION CHARACTERISTICS TRANSACTION READ all</technical_language>

Target:
public void setReadOnly(boolean readOnly) throws SQLException { checkClosed(); if (queryExecutor.getTransactionState() != TransactionState.IDLE) { throw new PSQLException( GT.tr("Cannot change transaction read-only property in the middle of a transaction."), PSQLState.ACTIVE_SQL_TRANSACTION); } if (readOnly != this.readOnly && autoCommit && this.readOnlyBehavior == ReadOnlyBehavior.always) { execSQLUpdate(readOnly ? setSessionReadOnly : setSessionNotReadOnly); } this.readOnly = readOnly; LOGGER.log(Level.FINE, " setReadOnly = {0}", readOnly); }
Source:
<code>public void addMetric(IMetric metric) { MetricInfo info = metrics.get(metric.getName()); if (info == null) { metrics.put(metric.getName(), new MetricInfo(metric)); } <START> else <END> { info.metric = metric; } }</code><technical_language>metric == null</technical_language>

Target:
public void addMetric(IMetric metric) { if (metric == null) { throw new RuntimeException("BenchmarkResult: Error: A null IMetric was provided to addMetric."); } MetricInfo info = metrics.get(metric.getName()); if (info == null) { metrics.put(metric.getName(), new MetricInfo(metric)); } else { info.metric = metric; } }
Source:
<code>public static AtomicLoadKeyStore newInstance(final String type, final Provider provider) { AtomicLoadKeyStoreSpi keyStoreSpi = new AtomicLoadKeyStoreSpi(() -> KeyStore.getInstance(type, provider)); if (ElytronMessages.tls.isTraceEnabled()) { <START> ElytronMessages.tls.trace("AtomicLoadKeyStore creating:" + <END> "\n type = " + type + "\n provider = " + provider + "\n"); } return new AtomicLoadKeyStore(keyStoreSpi, provider, type); }</code><technical_language>tracef for this instead of .isTraceEnabled(). %n instead of \n</technical_language>

Target:
public static AtomicLoadKeyStore newInstance(final String type, final Provider provider) { AtomicLoadKeyStoreSpi keyStoreSpi = new AtomicLoadKeyStoreSpi(() -> KeyStore.getInstance(type, provider)); ElytronMessages.tls.tracef("AtomicLoadKeyStore creating: type = %s, provider = %s", type, provider); return new AtomicLoadKeyStore(keyStoreSpi, provider, type); }
Source:
<code>private TableViewer createTableViewerSection(Composite aParent) { GridLayout layout = new GridLayout(2, false); aParent.setLayout(layout); Label labelHeader = new Label(aParent, SWT.NONE); labelHeader.setText(Messages.BranchSelectionTableModel_question); labelHeader.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1)); fViewer = new TableViewer(aParent, TABLE_STYLE); buildAndLayoutTable(); ReviewTableSorter.bind(fViewer); fViewer.setComparator(new ReviewTableSorter(1)); <START> fViewer.setContentProvider(new BranchListContentProvider()); <END> fViewer.setLabelProvider(new BranchListLabelProvider()); fViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof StructuredSelection) { Entry entry = (Entry) ((StructuredSelection) selection).getFirstElement(); selectedBranch = (String) entry.getKey(); } } }); fViewer.setInput(potentialBranches); int foundMatchAt = findPerfectMatch(); if (foundMatchAt >= 0) { selectPerfectBranch(foundMatchAt); } return fViewer; }</code><technical_language>I able replace this ArrayContentProvider somethign existing in jface, of adapt input match</technical_language>

Target:
private TableViewer createTableViewerSection(Composite aParent) { GridLayout layout = new GridLayout(2, false); aParent.setLayout(layout); Label labelHeader = new Label(aParent, SWT.NONE); labelHeader.setText(NLS.bind(Messages.BranchSelectionTableModel_question, reviewName, selectedPatchSet)); labelHeader.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1)); fViewer = new TableViewer(aParent, TABLE_STYLE); buildAndLayoutTable(); ReviewTableSorter.bind(fViewer); fViewer.setComparator(new ReviewTableSorter(1)); fViewer.setContentProvider(new BranchListContentProvider()); fViewer.setLabelProvider(new BranchListLabelProvider()); fViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof StructuredSelection) { Entry entry = (Entry) ((StructuredSelection) selection).getFirstElement(); selectedBranch = (String) entry.getKey(); } } }); fViewer.setInput(potentialBranches); int foundMatchAt = findPerfectMatch(); if (foundMatchAt >= 0) { selectPerfectBranch(foundMatchAt); } return fViewer; }
Source:
<code>public FormValidation doCheckRawBuildsDir(@QueryParameter String value) { String replacedValue = Util.replaceMacro(value, ImmutableMap.of( <START> "JENKINS_HOME", Jenkins.getInstance().getRootDir().getPath(), <END> "ITEM_ROOTDIR", Jenkins.getInstance().getRootDir().getPath() + "/jobs/doCheckRawBuildsDir-Marker$foo", "ITEM_FULLNAME", "doCheckRawBuildsDir-Marker:foo", "ITEM_FULL_NAME", "doCheckRawBuildsDir-Marker$foo")); File replacedFile = new File(replacedValue); if (!replacedFile.isAbsolute()) { return FormValidation.error(value + " does not resolve to an absolute path"); } if (!replacedValue.contains("doCheckRawBuildsDir-Marker")) { return FormValidation.error(value + " does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR}, cannot distinguish between projects"); } if (replacedValue.contains("doCheckRawBuildsDir-Marker:foo")) { try { File tmp = File.createTempFile("Jenkins-doCheckRawBuildsDir", "foo:bar"); tmp.delete(); } catch (IOException e) { return FormValidation.error(value + " contains ${ITEM_FULLNAME} but your system does not support it (JENKINS-12251). Use ${ITEM_FULL_NAME} instead"); } } File d = new File(replacedValue); if (!d.isDirectory()) { d = d.getParentFile(); while (!d.exists()) { d = d.getParentFile(); } if (!d.canWrite()) { return FormValidation.error(value + " does not exist and probably cannot be created"); } } return FormValidation.ok(); }</code><technical_language>a code duplication</technical_language>

Target:
public FormValidation doCheckRawBuildsDir(@QueryParameter String value) { String replacedValue = expandVariablesForDirectory(value, "doCheckRawBuildsDir-Marker:foo", Jenkins.getInstance().getRootDir().getPath() + "/jobs/doCheckRawBuildsDir-Marker$foo"); File replacedFile = new File(replacedValue); if (!replacedFile.isAbsolute()) { return FormValidation.error(value + " does not resolve to an absolute path"); } if (!replacedValue.contains("doCheckRawBuildsDir-Marker")) { return FormValidation.error(value + " does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR}, cannot distinguish between projects"); } if (replacedValue.contains("doCheckRawBuildsDir-Marker:foo")) { try { File tmp = File.createTempFile("Jenkins-doCheckRawBuildsDir", "foo:bar"); tmp.delete(); } catch (IOException e) { return FormValidation.error(value + " contains ${ITEM_FULLNAME} but your system does not support it (JENKINS-12251). Use ${ITEM_FULL_NAME} instead"); } } File d = new File(replacedValue); if (!d.isDirectory()) { d = d.getParentFile(); while (!d.exists()) { d = d.getParentFile(); } if (!d.canWrite()) { return FormValidation.error(value + " does not exist and probably cannot be created"); } } return FormValidation.ok(); }
Source:
<code>private void <START> lsRefsV2() <END> throws IOException { PacketLineOutRefAdvertiser adv = new PacketLineOutRefAdvertiser(pckOut); Map<String, Ref> refs = getAdvertisedOrDefaultRefs(); String line; adv.setUseProtocolV2(true); while ((line = pckIn.readString()) != PacketLineIn.END) { if (line.equals("peel")) { adv.setDerefTags(true); } else if (line.equals("symrefs")) { findSymrefs(adv, refs); } } adv.send(refs); adv.end(); }</code><technical_language>Move a separate file? UploadPack.java is pretty big..</technical_language>

Target:
private void lsRefsV2() throws IOException { PacketLineOutRefAdvertiser adv = new PacketLineOutRefAdvertiser(pckOut); Map<String, Ref> refs = getAdvertisedOrDefaultRefs(); String line; adv.setUseProtocolV2(true); line = pckIn.readString(); END if not. if (line == PacketLineIn.DELIM) { while ((line = pckIn.readString()) != PacketLineIn.END) { if (line.equals("peel")) { adv.setDerefTags(true); } else if (line.equals("symrefs")) { findSymrefs(adv, refs); } else { throw new PackProtocolException("unexpected " + line); } } } else if (line != PacketLineIn.END) { throw new PackProtocolException("unexpected " + line); } adv.send(refs); adv.end(); }
Source:
<code>public void sendRegisMsg(final String dataClassName, final long unitStartId, final long unitEndId, final TraceInfo parentTraceInfo) { final TraceScope sendRegisMsgScope = Trace.startSpan(SEND_REGIS_MSG, parentTraceInfo); try { LOG.entering(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "sendRegisMsg", new Object[]{dataClassName, unitStartId, unitEndId}); final RegisMsg regisMsg = RegisMsg.newBuilder() .setDataClassName(dataClassName) .setIdRange(AvroLongRange.newBuilder() .setMin(unitStartId) .setMax(unitEndId) .build()) .build(); send(driverId, AvroElasticMemoryMessage.newBuilder() .setType(Type.RegisMsg) .setSrcId(networkService.getMyId().toString()) .setDestId(driverId) .setRegisMsg(regisMsg) .build()); <START> LOG.entering(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "sendRegisMsg", <END> new Object[]{dataClassName, unitStartId, unitEndId}); } finally { sendRegisMsgScope.close(); } }</code><technical_language>LOG.exiting</technical_language>

Target:
public void sendRegisMsg(final String dataClassName, final long unitStartId, final long unitEndId, final TraceInfo parentTraceInfo) { final TraceScope sendRegisMsgScope = Trace.startSpan(SEND_REGIS_MSG, parentTraceInfo); try { LOG.entering(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "sendRegisMsg", new Object[]{dataClassName, unitStartId, unitEndId}); final RegisMsg regisMsg = RegisMsg.newBuilder() .setDataClassName(dataClassName) .setIdRange(AvroLongRange.newBuilder() .setMin(unitStartId) .setMax(unitEndId) .build()) .build(); send(driverId, AvroElasticMemoryMessage.newBuilder() .setType(Type.RegisMsg) .setSrcId(networkService.getMyId().toString()) .setDestId(driverId) .setRegisMsg(regisMsg) .build()); LOG.exiting(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "sendRegisMsg", new Object[]{dataClassName, unitStartId, unitEndId}); } finally { sendRegisMsgScope.close(); } }
Source:
<code>protected void ExecuteVdsBrokerCommand() { <START> status = getBroker().desktopLogoff(mVmId.toString(), (Boolean.valueOf(mForce)).toString()); <END> ProceedProxyReturnValue(); }</code><technical_language>Instead of Boolean.valueOf(boolean).toString(), String.valueOf(boolean)</technical_language>

Target:
protected void ExecuteVdsBrokerCommand() { status = getBroker().desktopLogoff(mVmId.toString(), String.valueOf(mForce)); ProceedProxyReturnValue(); }
Source:
<code>private String getResource(String resourceName) throws ServerException { try { <START> InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(resourceName); <END> return IOUtils.toString(resourceAsStream); } catch (Exception e) { throw new ServerException(e.getMessage()); } }</code><technical_language>I meant try (InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(resourceName)) {</technical_language>

Target:
private String getResource(String resourceName) throws ServerException { try (InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(resourceName)) { return IOUtils.toString(resourceAsStream); } catch (Exception e) { throw new ServerException(e.getMessage()); } }
Source:
<code>private void mpathwaysCall(HttpServletRequest request, HttpServletResponse response, PrintWriter out){ WAPIResultWrapper wrappedResult = null; String mpathwaysInstructor = request.getParameter(PARAMETER_INSTRUCTOR); String mpathwaysTermId = request.getParameter(PARAMETER_TERMID); if(mpathwaysInstructor == null || mpathwaysTermId == null){ response.setStatus(400); wrappedResult = new WAPIResultWrapper(400, "Parameter missing in Instructors request", new JSONObject()); } else{ if(appExtSecurePropertiesFile!=null) { <START> HashMap<String, String> value = new HashMap<String, String>(); <END> value.put("tokenServer", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_TOKEN_SERVER)); value.put("apiPrefix", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_PREFIX)); value.put("key", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_KEY)); value.put("secret", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_SECRET)); WAPI wapi = new WAPI(value); try { wrappedResult = wapi.getRequest(wapi.getApiPrefix() + mpathwaysInstructor + "/Terms/" + mpathwaysTermId + "/Classes"); } catch (UnirestException e) { e.printStackTrace(); } } } out.print(wrappedResult.toJson()); out.flush(); }</code><technical_language>A name more specific 'value' nice</technical_language>

Target:
private void mpathwaysCall(HttpServletRequest request, HttpServletResponse response, PrintWriter out){ WAPIResultWrapper wrappedResult = null; String mpathwaysInstructor = request.getParameter(PARAMETER_INSTRUCTOR); String mpathwaysTermId = request.getParameter(PARAMETER_TERMID); if(mpathwaysInstructor == null || mpathwaysTermId == null){ response.setStatus(400); wrappedResult = new WAPIResultWrapper(400, "Parameter missing in Instructors request", new JSONObject()); M_log.error("Error in mpathwaysCall(), missing parameter in Instuctors request"); } else{ if(appExtSecurePropertiesFile!=null) { HashMap<String, String> wapiValuesMap = new HashMap<String, String>(); wapiValuesMap.put("tokenServer", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_TOKEN_SERVER)); wapiValuesMap.put("apiPrefix", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_PREFIX)); wapiValuesMap.put("key", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_KEY)); wapiValuesMap.put("secret", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_SECRET)); WAPI wapi = new WAPI(wapiValuesMap); try { wrappedResult = wapi.getRequest(wapi.getApiPrefix() + mpathwaysInstructor + "/Terms/" + mpathwaysTermId + "/Classes"); } catch (UnirestException e) { M_log.error("MPathways API call did not complete successfully", e); } } } out.print(wrappedResult.toJson()); out.flush(); }
Source:
<code>public static Slice crc32(@SqlType(StandardTypes.VARBINARY) Slice slice) { Slice hash = Slices.allocate(Long.BYTES); CRC32 crc32 = new CRC32(); crc32.update(slice.toByteBuffer()); long crc32Value = crc32.getValue(); hash.setLong(0, Long.reverseBytes(crc32Value)); <START> return hash; <END> }</code><technical_language>I a bunch of investigation a discussion @martint. decide crc32 return a number (instead of binary). for change. Please change accordingly. I looked PHP, java (java.util.zip), Java (Guava), C++ Boost, Python (binascii), Ruby (zlib). turns out is general consensus byte order for representation of result</technical_language>

Target:
public static long crc32(@SqlType(StandardTypes.VARBINARY) Slice slice) { CRC32 crc32 = new CRC32(); crc32.update(slice.toByteBuffer()); return crc32.getValue(); }
Source:
<code>public void clearOldHistory(String machineId) { List<SingularityMachineStateHistoryUpdate> histories = getHistory(machineId); <START> histories.sort(Comparator.comparingLong(SingularityMachineStateHistoryUpdate::getTimestamp)); <END> histories.stream() .skip(maxHistoryEntries) .forEach((history) -> { delete(getHistoryUpdatePath(history)); }); }</code><technical_language>I want reverse this sort, skip() oldest n entries instead of newest</technical_language>

Target:
public void clearOldHistory(String machineId) { List<SingularityMachineStateHistoryUpdate> histories = getHistory(machineId); histories.sort(Comparator.comparingLong(SingularityMachineStateHistoryUpdate::getTimestamp).reversed()); histories.stream() .skip(maxHistoryEntries) .forEach((history) -> { delete(getHistoryUpdatePath(history)); }); }
Source:
<code>private void scheduleRelogin(Throwable error) { assert eventLoop.inEventLoop(); if (error instanceof FallbackDisallowedException) { return; } LOG.trace("Try scheduleRelogin."); if (!provider.canRetry()) { LOG.trace("SASL Provider does not support retries"); return; } if (reloginInProgress) { return; } reloginInProgress = true; RELOGIN_EXECUTOR.schedule(() -> { try { provider.relogin(); <START> } catch (Throwable e) { <END> LOG.warn("Relogin failed", e); } eventLoop.execute(() -> { reloginInProgress = false; }); }, ThreadLocalRandom.current().nextInt(reloginMaxBackoff), TimeUnit.MILLISECONDS); }</code><technical_language>Yeah, I sense. IIRC, netty swallows throwable silently, difficult figure out wrong</technical_language>

Target:
private void scheduleRelogin(Throwable error) { assert eventLoop.inEventLoop(); if (error instanceof FallbackDisallowedException) { return; } LOG.trace("Try scheduleRelogin."); if (!provider.canRetry()) { LOG.trace("SASL Provider does not support retries"); return; } if (reloginInProgress) { return; } reloginInProgress = true; RELOGIN_EXECUTOR.schedule(() -> { try { provider.relogin(); } catch (IOException e) { LOG.warn("Relogin failed", e); } eventLoop.execute(() -> { reloginInProgress = false; }); }, ThreadLocalRandom.current().nextInt(reloginMaxBackoff), TimeUnit.MILLISECONDS); }