auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public BuildResult build() { try { checkHitPolicy(); makeRuleSet(); makeImports(); makeDeclare(); makeTable(); } catch (final UnsupportedOperationException e) { return new BuildResult(workbook, new XLSConversionResult(e.getMessage())); } catch (final Exception e) { <START> e.printStackTrace(); END> return new BuildResult(workbook, new XLSConversionResult(e.toString() + " : " + e.getMessage())); } return new BuildResult(workbook, new XLSConversionResult()); }</code><technical_language>yes, remove this, sonar happy</technical_language>

Target:
public BuildResult build() { try { checkHitPolicy(); makeRuleSet(); makeImports(); makeDeclare(); makeTable(); } catch (final UnsupportedOperationException e) { return new BuildResult(workbook, new XLSConversionResult(e.getMessage())); } catch (final Exception e) { return new BuildResult(workbook, new XLSConversionResult(e.toString() + " : " + e.getMessage())); } return new BuildResult(workbook, new XLSConversionResult()); }
Source:
<code>private static Object toThriftValue(Field field, Object value) { try { switch (field.getType()) { case TType.BOOL: return Boolean.valueOf(((Integer)value) != 0); case TType.BYTE : return ((Integer)value).byteValue(); case TType.I16 : return Short.valueOf(((Integer)value).shortValue()); case TType.STRING: return toStringType(value); case TType.STRUCT: return toThrift(field.gettStructDescriptor(), (Tuple)value); case TType.MAP: return toThriftMap(field, (Map<String, Object>)value); case TType.SET: return toThriftSet(field.getSetElemField(), (DataBag) value); <START> case TType.LIST: <END> return toThriftList(field.getListElemField(), (DataBag)value); case TType.ENUM: return toThriftEnum(field, value); default: return value; } } catch (Exception e) { ThriftToPig.LOG.warn("Exception while convering Tuple to Thrift. " + " from " + value.getClass() + " to " + field.getName() + (field.getFieldIdEnum() == null ? "" : "(field id : " + field.getFieldIdEnum().getClass() + ")"), e); } return null; }</code><technical_language>casting 'value' (String)? is consistent other fields treated here. of compatibility, I wondering if is a legitimate case expect non-existing enum name. commit this if I a case.</technical_language>

Target:
private static Object toThriftValue(Field field, Object value) { try { switch (field.getType()) { case TType.BOOL: return Boolean.valueOf(((Integer)value) != 0); case TType.BYTE : return ((Integer)value).byteValue(); case TType.I16 : return Short.valueOf(((Integer)value).shortValue()); case TType.STRING: return toStringType(value); case TType.STRUCT: return toThrift(field.gettStructDescriptor(), (Tuple)value); case TType.MAP: return toThriftMap(field, (Map<String, Object>)value); case TType.SET: return toThriftSet(field.getSetElemField(), (DataBag) value); case TType.LIST: return toThriftList(field.getListElemField(), (DataBag)value); case TType.ENUM: return toThriftEnum(field, (String) value); default: return value; } } catch (Exception e) { LOG.warn(String.format( "Failed to set field '%s' of type '%s' with value '%s' of type '%s'", field.getName(), ThriftUtils.getFieldValueType(field).getName(), value, value.getClass().getName()), e); } return null; }
Source:
<code>public void testCreateFileHeader_Modify() throws Exception { ObjectId adId = blob("a\nd\n"); ObjectId abcdId = blob("a\nb\nc\nd\n"); String diffHeader = makeDiffHeader(PATH_A, PATH_A, adId, abcdId); DiffEntry ad = DiffEntry.delete(PATH_A, adId); DiffEntry abcd = DiffEntry.add(PATH_A, abcdId); <START> DiffEntry mod = DiffEntry.pair(ChangeType.MODIFY, ad, abcd, 50); <END> FileHeader fh = df.createFileHeader(mod); assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer())); assertEquals(1, fh.getHunks().size()); HunkHeader hh = fh.getHunks().get(0); assertEquals(1, hh.toEditList().size()); EditList el = hh.toEditList(); assertEquals(1, el.size()); Edit e = el.get(0); assertEquals(1, e.getBeginA()); assertEquals(1, e.getEndA()); assertEquals(1, e.getBeginB()); assertEquals(3, e.getEndB()); assertEquals(Edit.Type.INSERT, e.getType()); }</code><technical_language>A modify a score of 0</technical_language>

Target:
public void testCreateFileHeader_Modify() throws Exception { ObjectId adId = blob("a\nd\n"); ObjectId abcdId = blob("a\nb\nc\nd\n"); String diffHeader = makeDiffHeader(PATH_A, PATH_A, adId, abcdId); DiffEntry ad = DiffEntry.delete(PATH_A, adId); DiffEntry abcd = DiffEntry.add(PATH_A, abcdId); DiffEntry mod = DiffEntry.pair(ChangeType.MODIFY, ad, abcd, 0); FileHeader fh = df.createFileHeader(mod); assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer())); assertEquals(0, fh.getStartOffset()); assertEquals(fh.getBuffer().length, fh.getEndOffset()); assertEquals(1, fh.getHunks().size()); HunkHeader hh = fh.getHunks().get(0); assertEquals(1, hh.toEditList().size()); EditList el = hh.toEditList(); assertEquals(1, el.size()); Edit e = el.get(0); assertEquals(1, e.getBeginA()); assertEquals(1, e.getEndA()); assertEquals(1, e.getBeginB()); assertEquals(3, e.getEndB()); assertEquals(Edit.Type.INSERT, e.getType()); }
Source:
<code>protected ConnectionFactory createConnectionFactory() throws URISyntaxException { ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(getBrokerURL()); <START> factory.setTrustedPackages(Arrays.asList("java.lang,javax.security,java.util,org.apache.activemq,org.fusesource.hawtbuf,com.thoughtworks.xstream.mapper".split(","))); <END> return factory; }</code><technical_language>java.lang required</technical_language>

Target:
protected ConnectionFactory createConnectionFactory() throws URISyntaxException { ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(getBrokerURL()); factory.setTrustedPackages(Arrays.asList("java.lang".split(","))); return factory; }
Source:
<code>public void processEnvironmentLevelData(final AdvancingSource source, final Workbook workbook, final AdvancingNursery nurseryInfo, final Study study) { final Map<Integer, String> measurementVariablesValues = new HashMap<Integer, String>(); for (final MeasurementVariable mv : workbook.getConditions()) { if (StringUtils.isNotBlank(mv.getValue())) { if(mv.getTermId() == TermId.SEASON_VAR.getId() && StringUtils.isNumeric(mv.getValue()) && !mv.getPossibleValues().isEmpty()){ String seasonVarValue = this.getSeasonVarValue(mv.getValue(), mv.getPossibleValues()); measurementVariablesValues.put(mv.getTermId(), seasonVarValue); } else { measurementVariablesValues.put(mv.getTermId(), mv.getValue()); } <START> } <END> } source.setSeason(this.getValueOfPrioritySeasonVariable(measurementVariablesValues)); }</code><technical_language>SEASON_DRY term is checked in getValueOfPrioritySeasonVariable() method</technical_language>

Target:
public void processEnvironmentLevelData(final AdvancingSource source, final Workbook workbook, final AdvancingNursery nurseryInfo, final Study study) { final Map<Integer, String> measurementVariablesValues = new HashMap<Integer, String>(); for (final MeasurementVariable mv : workbook.getConditions()) { this.addValueToMeasurementVariablesValues(mv.getValue(), mv.getPossibleValues(), mv.getTermId(), measurementVariablesValues); } source.setSeason(this.getValueOfPrioritySeasonVariable(measurementVariablesValues)); }
Source:
<code><START> void quit() { <END> ServiceManager.getInstance().stopModelUpdate(); columns.saveSession(); DataManager.getInstance().saveLocalConfig(); DataManager.getInstance().saveSessionConfig(); browserComponent.onAppQuit(); Platform.exit(); System.exit(0); }</code><technical_language>quit public, more explicit</technical_language>

Target:
public void quit() { ServiceManager.getInstance().stopModelUpdate(); columns.saveSession(); DataManager.getInstance().saveLocalConfig(); DataManager.getInstance().saveSessionConfig(); browserComponent.onAppQuit(); Platform.exit(); System.exit(0); }
Source:
<code><START> public void generate() throws IOException { <END> CompilationUnit compilationUnit = sourceRoot.parse(pkg, visitorClassName + ".java", javaParser).get(); Optional<ClassOrInterfaceDeclaration> visitorClassOptional = compilationUnit.getClassByName(visitorClassName); if (!visitorClassOptional.isPresent()) { visitorClassOptional = compilationUnit.getInterfaceByName(visitorClassName); } ClassOrInterfaceDeclaration visitorClass = visitorClassOptional.get(); for (BaseNodeMetaModel node : javaParserMetaModel.getNodeMetaModels()) { if (!node.isAbstract()) { List<PropertyMetaModel> allPropertyMetaModels = collectAllPropertyMetaModels(node); Optional<MethodDeclaration> visitMethod = visitorClass.getMethods().stream() .filter(m -> m.getNameAsString().equals("visit")) .filter(m -> m.getParameter(0).getType().toString().equals(node.getTypeName())) .findFirst(); if (visitMethod.isPresent()) { generateVisitMethodBody(node, visitMethod.get(), allPropertyMetaModels, compilationUnit); } else if (createMissingVisitMethods) { MethodDeclaration methodDeclaration = visitorClass.addMethod("visit") .addParameter(node.getTypeNameGenericsed(), "n") .addParameter(argumentType, "arg") .setType(returnType); generateVisitMethodBody(node, methodDeclaration, allPropertyMetaModels, compilationUnit); } } } }</code><technical_language>Long method NestedBlockDepth is :)</technical_language>

Target:
public void generate() throws IOException { CompilationUnit compilationUnit = sourceRoot.parse(pkg, visitorClassName + ".java", javaParser).get(); Optional<ClassOrInterfaceDeclaration> visitorClassOptional = compilationUnit.getClassByName(visitorClassName); if (!visitorClassOptional.isPresent()) { visitorClassOptional = compilationUnit.getInterfaceByName(visitorClassName); } ClassOrInterfaceDeclaration visitorClass = visitorClassOptional.get(); javaParserMetaModel.getNodeMetaModels().stream() .filter((baseNodeMetaModel) -> !baseNodeMetaModel.isAbstract()) .forEach(node -> generateVisitMethodForNode(node, visitorClass, compilationUnit)); }
Source:
<code>private void removeDetachedServers(List<VDS> existingServers, List<GlusterServerInfo> fetchedServers) { <START> for (final VDS server : existingServers) { <END> if (isRemovableStatus(server.getStatus()) && serverDetached(server, fetchedServers)) { log.debugFormat("Server {0} has been removed directly using the gluster CLI. Removing it from engine as well.", server.getName()); logUtil.logServerMessage(server, AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI); try { removeServerFromDb(server); runVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(server.getId())); } catch (Exception e) { log.errorFormat("Error while removing server {0} from database!", server.getName(), e); } } } }</code><technical_language>change final here? of scope of patch</technical_language>

Target:
private void removeDetachedServers(List<VDS> existingServers, List<GlusterServerInfo> fetchedServers) { for (VDS server : existingServers) { if (isRemovableStatus(server.getStatus()) && serverDetached(server, fetchedServers)) { log.debugFormat("Server {0} has been removed directly using the gluster CLI. Removing it from engine as well.", server.getName()); logUtil.logServerMessage(server, AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI); try { removeServerFromDb(server); runVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(server.getId())); } catch (Exception e) { log.errorFormat("Error while removing server {0} from database!", server.getName(), e); } } } }
Source:
<code>public void verify() throws Exception { <START> if(duplicatedAttribute != null) { <END> throw new AttributeDefinitionException(this, duplicatedAttribute.getName()); } else if (attributeTypes.isEmpty()) { throw new AttributeDefinitionException(this, null); } int totalPositional = 0; for(AttributeType a : attributeTypes.values()) { if(a.isPositional()) totalPositional++; } for(int i = 0; i < totalPositional; i++) { if(!attributeTypes.containsKey(Integer.toString(i))) { throw new AttributeDefinitionException(this, i); } } }</code><technical_language>Watch out for space keywords if (. add a linter soon..</technical_language>

Target:
public void verify()
Source:
<code>public void onMapReady(@NonNull final MapboxMap mapboxMap) { mapboxMap.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { initCoordinates(); LineString lineString = LineString.fromLngLats(routeCoordinates); FeatureCollection featureCollection = FeatureCollection.fromFeature(Feature.fromGeometry(lineString)); Source geoJsonSource = new GeoJsonSource("line-source", featureCollection, new GeoJsonOptions().withLineMetrics(true)); <START> mapboxMap.getStyle().addSource(geoJsonSource); <END> LineLayer lineLayer = new LineLayer("linelayer", "line-source"); lineLayer.setProperties( lineCap(Property.LINE_CAP_ROUND), lineJoin(Property.LINE_JOIN_ROUND), lineWidth(14f), lineGradient(interpolate( linear(), lineProgress(), stop(0f, rgb(6, 1, 255)), stop(0.1f, rgb(59, 118, 227)), stop(0.3f, rgb(7, 238, 251)), stop(0.5f, rgb(0, 255, 42)), stop(0.7f, rgb(255, 252, 0)), stop(1f, rgb(255, 30, 0)) ))); mapboxMap.getStyle().addLayer(lineLayer); } }); }</code><technical_language>style callback instead</technical_language>

Target:
public void onMapReady(@NonNull final MapboxMap mapboxMap) { mapboxMap.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { initCoordinates(); LineString lineString = LineString.fromLngLats(routeCoordinates); FeatureCollection featureCollection = FeatureCollection.fromFeature(Feature.fromGeometry(lineString)); style.addSource(new GeoJsonSource("line-source", featureCollection, new GeoJsonOptions().withLineMetrics(true))); style.addLayer(new LineLayer("linelayer", "line-source").withProperties( lineCap(Property.LINE_CAP_ROUND), lineJoin(Property.LINE_JOIN_ROUND), lineWidth(14f), lineGradient(interpolate( linear(), lineProgress(), stop(0f, rgb(6, 1, 255)), stop(0.1f, rgb(59, 118, 227)), stop(0.3f, rgb(7, 238, 251)), stop(0.5f, rgb(0, 255, 42)), stop(0.7f, rgb(255, 252, 0)), stop(1f, rgb(255, 30, 0)) )))); } }); }
Source:
<code>public Value loadEmbeddedService( Value request ) throws FaultException { try { Value channel = Value.create(); <START> if( request.getChildren( "filepath" ).size() > 0 ) { <END> String filePath = request.getFirstChild( "filepath" ).strValue(); String typeStr = request.getFirstChild( "type" ).strValue(); EmbeddedServiceType type = jolie.lang.Constants.stringToEmbeddedServiceType( typeStr ); EmbeddedServiceLoader.ExternalEmbeddedServiceConfiguration configuration = new EmbeddedServiceLoader.ExternalEmbeddedServiceConfiguration( type, filePath ); EmbeddedServiceLoader loader = EmbeddedServiceLoader.create( interpreter(), configuration, channel ); loader.load(); } else { String code = request.getFirstChild( "code" ).strValue(); EmbeddedServiceType type = EmbeddedServiceType.JOLIE; EmbeddedServiceLoader.ExternalEmbeddedNativeCodeConfiguration configuration = new EmbeddedServiceLoader.ExternalEmbeddedNativeCodeConfiguration( type, code ); EmbeddedServiceLoader loader = EmbeddedServiceLoader.create( interpreter(), configuration, channel ); loader.load(); } return channel; } catch( EmbeddedServiceLoaderCreationException e ) { throw new FaultException( "RuntimeException", e ); } catch( EmbeddedServiceLoadingException e ) { throw new FaultException( "RuntimeException", e ); } }</code><technical_language>request.hasChildren( "filepath" )</technical_language>

Target:
public Value loadEmbeddedService( Value request ) throws FaultException { try { Value channel = Value.create(); if( request.hasChildren( "filepath" ) ) { String filePath = request.getFirstChild( "filepath" ).strValue(); String typeStr = request.getFirstChild( "type" ).strValue(); EmbeddedServiceType type = jolie.lang.Constants.stringToEmbeddedServiceType( typeStr ); EmbeddedServiceLoader.ExternalEmbeddedServiceConfiguration configuration = new EmbeddedServiceLoader.ExternalEmbeddedServiceConfiguration( type, filePath ); EmbeddedServiceLoader loader = EmbeddedServiceLoader.create( interpreter(), configuration, channel ); loader.load(); } else { String code = request.getFirstChild( "code" ).strValue(); EmbeddedServiceType type = EmbeddedServiceType.JOLIE; EmbeddedServiceLoader.ExternalEmbeddedNativeCodeConfiguration configuration = new EmbeddedServiceLoader.ExternalEmbeddedNativeCodeConfiguration( type, code ); EmbeddedServiceLoader loader = EmbeddedServiceLoader.create( interpreter(), configuration, channel ); loader.load(); } return channel; } catch( EmbeddedServiceLoaderCreationException e ) { throw new FaultException( "RuntimeException", e ); } catch( EmbeddedServiceLoadingException e ) { throw new FaultException( "RuntimeException", e ); } }
Source:
<code>public String getClientIPFromForwardedForHeader(String forwardedForHeader){ ArrayList<String> forwardingIPs; String ip = null; Boolean containsIP = false; if (forwardedForHeader.contains(",")) { forwardingIPs = new ArrayList<String>(Arrays.asList(forwardedForHeader.replace(" ", "").split(","))); Collections.reverse(forwardingIPs); for (String forwardingIP : forwardingIPs){ for (IPRange range : trustedProxies) { if (range.contains(forwardingIP)) { containsIP = true; break; } } if (!containsIP || <START> (containsIP && forwardingIPs.get(forwardingIP.size() -1).equals(forwardingIP))) { <END> ip = forwardingIP; break; } } } else { ip = forwardedForHeader; } return ip; }</code><technical_language>this forwardingIPs.size() - 1 forwardingIP.size() -1</technical_language>

Target:
public String getClientIPFromForwardedForHeader(String forwardedForHeader){ ArrayList<String> forwardingIPs; String ip = null; Boolean containsIP = false; if (forwardedForHeader.contains(",")) { forwardingIPs = new ArrayList<String>(Arrays.asList(forwardedForHeader.replace(" ", "").split(","))); Collections.reverse(forwardingIPs); for (String forwardingIP : forwardingIPs){ for (IPRange range : trustedProxies) { if (range.contains(forwardingIP)) { containsIP = true; break; } } if (!containsIP || (containsIP && forwardingIPs.get(forwardingIPs.size() - 1).equals(forwardingIP))) { ip = forwardingIP; break; } } } else { ip = forwardedForHeader; } return ip; }
Source:
<code><START> private boolean sameCommit(RevCommit a, RevCommit b) { <END> return a == b; }</code><technical_language>this method static</technical_language>

Target:
private static boolean sameCommit(RevCommit a, RevCommit b) { return a == b; }
Source:
<code><START> private static InputStream readUriResource(URI uri, ResourceSet resourceSet, Map<?, ?> response) <END> throws IOException { Map<Object, Object> options = resourceSet.getLoadOptions(); URIConverter uriConverter = getUriConverter(resourceSet); Map<Object, Object> loadMap = new HashMap<>(options); loadMap.put(URIConverter.OPTION_RESPONSE, response); InputStream inputStream = uriConverter.createInputStream(uri, loadMap); ByteArrayOutputStream out = new ByteArrayOutputStream(); try { IOUtils.copy(inputStream, out); } finally { inputStream.close(); } inputStream = new ByteArrayInputStream(out.toByteArray()); return inputStream; }</code><technical_language>rework this try-with-resources returns a byte[], evident stored in memory leftovers close</technical_language>

Target:
private static byte[] readUriResource(URI uri, ResourceSet resourceSet, Map<?, ?> response) throws IOException { Map<Object, Object> options = resourceSet.getLoadOptions(); URIConverter uriConverter = getUriConverter(resourceSet); Map<Object, Object> loadMap = new HashMap<>(options); loadMap.put(URIConverter.OPTION_RESPONSE, response); ByteArrayOutputStream out = new ByteArrayOutputStream(); try (InputStream inputStream = uriConverter.createInputStream(uri, loadMap)) { IOUtils.copy(inputStream, out); } return out.toByteArray(); }
Source:
<code>TimeDraw getTimeDraw(long timeDelta) { TimeDraw timeDraw; if (fTimeProvider != null) { TimeFormat tf = fTimeProvider.getTimeFormat(); <START> if (tf == TimeFormat.CALENDAR) { <END> if (timeDelta >= YEAR_IN_NS) { timeDraw = TIMEDRAW_ABS_YEAR; } else if (timeDelta >= MONTH_IN_NS) { timeDraw = TIMEDRAW_ABS_MONTH; } else if (timeDelta >= DAY_IN_NS) { timeDraw = TIMEDRAW_ABS_DAY; } else if (timeDelta >= HOUR_IN_NS) { timeDraw = TIMEDRAW_ABS_HRS; } else if (timeDelta >= MIN_IN_NS) { timeDraw = TIMEDRAW_ABS_MIN; } else if (timeDelta >= SEC_IN_NS) { timeDraw = TIMEDRAW_ABS_SEC; } else if (timeDelta >= MILLISEC_IN_NS) { timeDraw = TIMEDRAW_ABS_MILLISEC; } else if (timeDelta >= MICROSEC_IN_NS) { timeDraw = TIMEDRAW_ABS_MICROSEC; } else { timeDraw = TIMEDRAW_ABS_NANOSEC; } return timeDraw; } else if (tf == TimeFormat.NUMBER) { return TIMEDRAW_NUMBER; } else if (tf == TimeFormat.CYCLES) { return TIMEDRAW_CYCLES; } } if (timeDelta >= SEC_IN_NS) { timeDraw = TIMEDRAW_SEC; } else if (timeDelta >= MILLISEC_IN_NS) { timeDraw = TIMEDRAW_MILLISEC; } else if (timeDelta >= MICROSEC_IN_NS) { timeDraw = TIMEDRAW_MICROSEC; } else { timeDraw = TIMEDRAW_NANOSEC; } return timeDraw; }</code><technical_language>switch case maybe</technical_language>

Target:
TimeDraw getTimeDraw(long timeDelta) { TimeDraw timeDraw; if (fTimeProvider != null) { switch (fTimeProvider.getTimeFormat()) { case CALENDAR: if (timeDelta >= YEAR_IN_NS) { timeDraw = TIMEDRAW_ABS_YEAR; } else if (timeDelta >= MONTH_IN_NS) { timeDraw = TIMEDRAW_ABS_MONTH; } else if (timeDelta >= DAY_IN_NS) { timeDraw = TIMEDRAW_ABS_DAY; } else if (timeDelta >= HOUR_IN_NS) { timeDraw = TIMEDRAW_ABS_HRS; } else if (timeDelta >= MIN_IN_NS) { timeDraw = TIMEDRAW_ABS_MIN; } else if (timeDelta >= SEC_IN_NS) { timeDraw = TIMEDRAW_ABS_SEC; } else if (timeDelta >= MILLISEC_IN_NS) { timeDraw = TIMEDRAW_ABS_MILLISEC; } else if (timeDelta >= MICROSEC_IN_NS) { timeDraw = TIMEDRAW_ABS_MICROSEC; } else { timeDraw = TIMEDRAW_ABS_NANOSEC; } return timeDraw; case NUMBER: return TIMEDRAW_NUMBER; case CYCLES: return TIMEDRAW_CYCLES; case RELATIVE: default: } } if (timeDelta >= SEC_IN_NS) { timeDraw = TIMEDRAW_SEC; } else if (timeDelta >= MILLISEC_IN_NS) { timeDraw = TIMEDRAW_MILLISEC; } else if (timeDelta >= MICROSEC_IN_NS) { timeDraw = TIMEDRAW_MICROSEC; } else { timeDraw = TIMEDRAW_NANOSEC; } return timeDraw; }
Source:
<code><START> private boolean getAndRecordLeaderPingResult(@Nullable Future<Boolean> pingFuture) throws InterruptedException { <END> if (pingFuture == null) { eventRecorder.recordLeaderPingTimeout(); return false; } try { boolean isLeader = pingFuture.get(); if (!isLeader) { eventRecorder.recordLeaderPingReturnedFalse(); } return isLeader; } catch (ExecutionException e) { eventRecorder.recordLeaderPingFailure(e.getCause()); return false; } }</code><technical_language>Do want test this method (with a pingFuture)</technical_language>

Target:
boolean getAndRecordLeaderPingResult(@Nullable Future<Boolean> pingFuture) throws InterruptedException { if (pingFuture == null) { eventRecorder.recordLeaderPingTimeout(); return false; } try { boolean isLeader = pingFuture.get(); if (!isLeader) { eventRecorder.recordLeaderPingReturnedFalse(); } return isLeader; } catch (ExecutionException e) { eventRecorder.recordLeaderPingFailure(e.getCause()); return false; } }
Source:
<code>public void testStepDefaultTools() throws Exception { <START> String name = ToolInstallations.configureDefaultGradle(new TemporaryFolder()).getName(); <END> WorkflowJob p1 = j.jenkins.createProject(WorkflowJob.class, "FakeProject"); p1.setDefinition(new CpsFlowDefinition("node {\n" + build_gradle + "withGradle(gradle:" + name + "){\n" + "sh 'gradle'\n" + "}\n" + "}", false)); WorkflowRun r = p1.scheduleBuild2(0).get(); j.assertBuildStatusSuccess(r); }</code><technical_language>talked docker-fixtures for tests in this PR, is more work set up</technical_language>

Target:
public void testStepDefaultTools() throws Exception { String name = ToolInstallations.configureDefaultGradle(folder).getName(); WorkflowJob p1 = j.jenkins.createProject(WorkflowJob.class, "FakeProject"); p1.setDefinition(new CpsFlowDefinition("node {\n" + build_gradle + "withGradle(gradleName:'" + name + "'){\n" + "sh 'gradle'\n" + "}\n" + "}", false)); WorkflowRun r = p1.scheduleBuild2(0).get(); j.assertBuildStatusSuccess(r); }
Source:
<code>private void createAndStartBlobStoreIfAbsent(PartitionId partitionId) { partitionToStore.computeIfAbsent(partitionId, value -> { CloudBlobStore store = null; try { store = new CloudBlobStore(properties, partitionId, cloudDestination, clusterMap, vcrMetrics); <START> store.start(); <END> } catch (StoreException ex) { logger.error("Can't start CloudStore for partition {}" + partitionId, ex); } return store; }); }</code><technical_language>avoid side effects starting a store a computeIfAbsent lambda</technical_language>

Target:
private CloudBlobStore createAndStartBlobStoreIfAbsent(PartitionId partitionId) { try { lock.writeLock().lock(); if (partitionToStore.containsKey(partitionId)) { return partitionToStore.get(partitionId); } CloudBlobStore store = new CloudBlobStore(properties, partitionId, cloudDestination, clusterMap, vcrMetrics); partitionToStore.put(partitionId, store); store.start(); logger.info("Cloudblobstore started for partition {}", partitionId); return store; } finally { lock.writeLock().unlock(); } }
Source:
<code>public synchronized boolean next(LongWritable key, Text value) throws IOException { while (true) { int bytes = readLine(value); if (bytes <= 0) { if (!selectClient.isRequestComplete()) { throw new RuntimeException("S3 Select request was incomplete as End Event was not received."); } return false; } <START> if (++recordsFromS3 > processedRecords) { <END> position += bytes; processedRecords++; key.set(processedRecords); return true; } } }</code><technical_language>code style is ++ -- a statements, expressions, this a separate statement</technical_language>

Target:
public synchronized boolean next(LongWritable key, Text value) throws IOException { while (true) { int bytes = readLine(value); if (bytes <= 0) { if (!selectClient.isRequestComplete()) { throw new IOException("S3 Select request was incomplete as End Event was not received"); } return false; } recordsFromS3++; if (recordsFromS3 > processedRecords) { position += bytes; processedRecords++; key.set(processedRecords); return true; } } }
Source:
<code><START> public int getSleepTimer(IPlayer player) { <END> return getInternal(player).getSleepTimer(); }</code><technical_language>Forgot</technical_language>

Target:
public static int getSleepTimer(IPlayer player) { return getInternal(player).getSleepTimer(); }
Source:
<code>public void filter(Filter filter) throws NoTestsRemainException { synchronized (childrenLock) { <START> List<T> filteredChildren = new ArrayList<T>(getFilteredChildren()); <END> for (Iterator<T> iter = filteredChildren.iterator(); iter.hasNext(); ) { T each = iter.next(); if (shouldRun(filter, each)) { try { filter.apply(each); } catch (NoTestsRemainException e) { iter.remove(); } } else { iter.remove(); } } this.filteredChildren = Collections.unmodifiableCollection(filteredChildren); if (this.filteredChildren.isEmpty()) { throw new NoTestsRemainException(); } } }</code><technical_language>please rename this variable children. current name is unexact in this context accidently mistaken for this.filteredChildern</technical_language>

Target:
public void filter(Filter filter) throws NoTestsRemainException { synchronized (childrenLock) { List<T> children = new ArrayList<T>(getFilteredChildren()); for (Iterator<T> iter = children.iterator(); iter.hasNext(); ) { T each = iter.next(); if (shouldRun(filter, each)) { try { filter.apply(each); } catch (NoTestsRemainException e) { iter.remove(); } } else { iter.remove(); } } filteredChildren = Collections.unmodifiableCollection(children); if (filteredChildren.isEmpty()) { throw new NoTestsRemainException(); } } }
Source:
<code>default List<MCTag<T>> getAllTags() { return getTagCollection().getIDTagMap() .keySet() .stream() <START> .map(itemITag -> new MCTag<>(itemITag, this)) <END> .collect(Collectors.toList()); }</code><technical_language>this variable more sense itag for items</technical_language>

Target:
default List<MCTag<T>> getAllTags() { return getTagCollection().getIDTagMap() .keySet() .stream() .map(tagLocation -> new MCTag<>(tagLocation, this)) .collect(Collectors.toList()); }
Source:
<code>public static final void setDarkThemePreferred(boolean preferred){ if (!GTK3) return; gdk_flush(); <START> g_object_set(OS.gtk_settings_get_default(), <END> gtk_application_prefer_dark_theme, preferred, 0); g_object_notify(OS.gtk_settings_get_default(), gtk_application_prefer_dark_theme); }</code><technical_language>This invoked well</technical_language>

Target:
public static final void setDarkThemePreferred(boolean preferred){ if (!GTK3) return; gdk_flush(); g_object_set(gtk_settings_get_default(), gtk_application_prefer_dark_theme, preferred, 0); g_object_notify(gtk_settings_get_default(), gtk_application_prefer_dark_theme); }
Source:
<code>public void canFetchCommentsCount() throws Exception { final Pull pull = Mockito.mock(Pull.class); Mockito.doReturn( Json.createObjectBuilder() <START> .add("comments", 5) <END> .build() ).when(pull).json(); MatcherAssert.assertThat( new Pull.Smart(pull).comments(), Matchers.notNullValue() ); }</code><technical_language>point of giving 5 if comparing later</technical_language>

Target:
public void canFetchCommentsCount() throws Exception { final int number = 1; final Pull pull = Mockito.mock(Pull.class); Mockito.doReturn( Json.createObjectBuilder() .add("comments", number) .build() ).when(pull).json(); MatcherAssert.assertThat( new Pull.Smart(pull).comments(), Matchers.is(number) ); }
Source:
<code>public void hash_value_null() { <START> assertEquals("", hasher.hash(" ")); <END> }</code><technical_language>this test is identical hash_value_blank()</technical_language>

Target:
public void hash_value_null() { assertEquals("", hasher.hash(null)); }
Source:
<code>public static boolean isOfType(int type, int... types) { boolean result = false; <START> for (int t : types) { <END> if (type == t) { result = true; break; } } return result; }</code><technical_language><LINK_0> I a declarative programming approach streams is a more elegant implementation this</technical_language>

Target:
public static boolean isOfType(int type, int... types) { return Arrays.stream(types).anyMatch(tokenType -> tokenType == type); }
Source:
<code>@Override public void active(boolean active) { guard(); try { <START> ctx.state().changeGlobalState(active ? ACTIVE : INACTIVE, true, serverNodes(), false, false).get(); <END> } catch (IgniteCheckedException e) { throw U.convertException(e); } finally { unguard(); } }</code><technical_language>forceDeactivation true for cluster activate</technical_language>

Target:
@Override public void active(boolean active) { guard(); try { ctx.state().changeGlobalState(active ? ACTIVE : INACTIVE, true, serverNodes(), false).get(); } catch (IgniteCheckedException e) { throw U.convertException(e); } finally { unguard(); } }
Source:
<code>private static HttpPipeline createPipeline(String host, String expectedUrl) { return HttpPipeline.builder() .httpClient(new MockHttpClient() { @Override public Mono<HttpResponse> send(HttpRequest request) { return Mono.empty(); } <START> }) <END> .addPolicy(new HostPolicy(host)) .addPolicy((context, next) -> { assertEquals(expectedUrl, context.httpRequest().url().toString()); return next.process(); }) .build(); }</code><technical_language>nice work this code replace anonymous classes lambdas</technical_language>

Target:
private static HttpPipeline createPipeline(String host, String expectedUrl) { return HttpPipeline.builder() .httpClient(new MockHttpClient()) .policies(new HostPolicy(host), (context, next) -> { assertEquals(expectedUrl, context.httpRequest().url().toString()); return next.process(); }) .build(); }
Source:
<code>protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_landing); <START> View migrationView = findViewById(R.id.migration); <END> View downloadsView = findViewById(R.id.downloads); migrationView.setOnClickListener(view -> { Intent intent = new Intent(getApplicationContext(), MigrationActivity.class); startActivity(intent); }); downloadsView.setOnClickListener(view -> { Intent intent = new Intent(getApplicationContext(), MainActivity.class); startActivity(intent); }); }</code><technical_language>same, inline extract a common method Activity class want start, lines of code</technical_language>

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_landing); findViewById(R.id.migration).setOnClickListener(view -> navigateTo(MigrationActivity.class)); findViewById(R.id.downloads).setOnClickListener(view -> navigateTo(MainActivity.class)); }
Source:
<code>public SWTBotRootMenu <START> contextMenu(final <END> Control control) throws WidgetNotFoundException { ContextMenuHelper.notifyMenuDetect(control, widget); WaitForObjectCondition<Menu> waitForMenu = Conditions.waitForPopupMenu(control); new SWTBot().waitUntil(waitForMenu); return new SWTBotRootMenu(waitForMenu.get(0)); }</code><technical_language>SWTBot APIs generally wrapping SWT controls exposing in signatures, this method a private a protected API</technical_language>

Target:
protected SWTBotRootMenu contextMenu(final Control control) throws WidgetNotFoundException { ContextMenuHelper.notifyMenuDetect(control, widget); WaitForObjectCondition<Menu> waitForMenu = Conditions.waitForPopupMenu(control); new SWTBot().waitUntil(waitForMenu); return new SWTBotRootMenu(waitForMenu.get(0)); }
Source:
<code>public void storeKeyStore() throws IOException{ assertActivatedKeyStore(); <START> OutputStream fos = getResource().out(); <END> char[] passwd = securityManager.getMasterPassword(); try { ks.store(fos, passwd); } catch (Exception e) { throw new IOException(e); } finally { securityManager.disposePassword(passwd); } fos.close(); }</code><technical_language>try-with-resources? Needs care disposePassword</technical_language>

Target:
public void storeKeyStore() throws IOException{ assertActivatedKeyStore(); try (OutputStream fos = getResource().out()) { char[] passwd = securityManager.getMasterPassword(); try { ks.store(fos, passwd); } catch (Exception e) { throw new IOException(e); } finally { securityManager.disposePassword(passwd); } } }
Source:
<code>public void close() throws Exception { try { int i = 0; while (i < CHECK_TIMEOUT / CHECK_INTERVAL) { try { i++; FileUtils.deleteDirectory(new File(baseDirectory)); } catch (Throwable t) { if (i == CHECK_TIMEOUT / CHECK_INTERVAL) { LOG.error("Clean the temporary directory of Python UDF worker failed.", t); break; } } Thread.sleep(CHECK_INTERVAL); } } finally { if (shutdownHook != null) { ShutdownHookUtil.removeShutdownHook( shutdownHook, ProcessPythonEnvironmentManager.class.getSimpleName(), LOG); shutdownHook = null; } <START> LOG.info("Python environment manager is closing. Now print the content of boot log:\n" + getBootLog()); <END> } }</code><technical_language>need print log boot log</technical_language>

Target:
public void close() throws Exception { try { int retries = 0; while (true) { try { FileUtils.deleteDirectory(new File(baseDirectory)); break; } catch (Throwable t) { retries++; if (retries <= CHECK_TIMEOUT / CHECK_INTERVAL) { LOG.warn( String.format( "Failed to delete the working directory %s of the Python UDF worker. Retrying...", baseDirectory), t); } else { LOG.warn( String.format( "Failed to delete the working directory %s of the Python UDF worker.", baseDirectory), t); break; } } } } finally { if (shutdownHook != null) { ShutdownHookUtil.removeShutdownHook( shutdownHook, ProcessPythonEnvironmentManager.class.getSimpleName(), LOG); shutdownHook = null; } } }
Source:
<code>public boolean performFinish() { if (!vElement.isPresent()) { return performFinishNewPage(); } final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); activePage.addPartListener(new AddToTemplatePartListener(activePage)); if (choosePage.get().createNewTemplate()) { if (!performFinishNewPage()) { return false; } } else { final IFile resource = (IFile) ResourcesPlugin.getWorkspace().getRoot() .findMember(selectPage.get().getTemplateName()); getShell().getDisplay().asyncExec(new Runnable() { @Override public void run() { final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); try { IDE.openEditor(page, resource, true); } catch (final PartInitException e) { <START> } <END> } }); } return true; }</code><technical_language>show a dialog a message in case editor opened</technical_language>

Target:
public boolean performFinish() { if (!vElement.isPresent()) { return performFinishNewPage(); } final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); activePage.addPartListener(new AddToTemplatePartListener(activePage)); if (choosePage.get().createNewTemplate()) { if (!performFinishNewPage()) { return false; } } else { final IFile resource = (IFile) ResourcesPlugin.getWorkspace().getRoot() .findMember(selectPage.get().getTemplateName()); getShell().getDisplay().asyncExec(new Runnable() { @Override public void run() { final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); try { IDE.openEditor(page, resource, true); } catch (final PartInitException e) { ErrorDialog.openError( getShell(), Messages.EMFFormsTemplateWizard_OpenEditorFailTitle, Messages.EMFFormsTemplateWizard_OpenEditorFailMessage, new Status( IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e)); } } }); } return true; }
Source:
<code>public void doPatchProcessing(Context context, Request currentRequest, InProgressSubmission source, Operation op, SubmissionStepConfig stepConf) throws Exception { PatchOperation<MetadataValueRest> patchOperation = new PatchOperationFactory() .instanceOf(DESCRIBE_STEP_METADATA_OPERATION_ENTRY, op.getOp()); DCInputSet inputConfig = inputReader.getInputsByFormName(stepConf.getId()); String[] split = patchOperation.getAbsolutePath(op.getPath()).split("/"); if (inputConfig.isFieldPresent(split[0])) { patchOperation.perform(context, currentRequest, source, op); } else { <START> throw new UnprocessableEntityException("The attribute " + split[0] + " does not present in section " <END> + inputConfig.getFormName()); } }</code><technical_language>I this error say: "The field " + split[0] + " is present in section "</technical_language>

Target:
public void doPatchProcessing(Context context, Request currentRequest, InProgressSubmission source, Operation op, SubmissionStepConfig stepConf) throws Exception { String[] pathParts = op.getPath().substring(1).split("/"); DCInputSet inputConfig = inputReader.getInputsByFormName(stepConf.getId()); if ("remove".equals(op.getOp()) && pathParts.length < 3) { String[] path = op.getPath().substring(1).split("/", 3); String configId = path[1]; List<String> fieldsName = getInputFieldsName(inputConfig, configId); for (String fieldName : fieldsName) { String fieldPath = op.getPath() + "/" + fieldName; Operation fieldRemoveOp = new RemoveOperation(fieldPath); PatchOperation<MetadataValueRest> patchOperation = new PatchOperationFactory() .instanceOf(DESCRIBE_STEP_METADATA_OPERATION_ENTRY, fieldRemoveOp.getOp()); patchOperation.perform(context, currentRequest, source, fieldRemoveOp); } } else { PatchOperation<MetadataValueRest> patchOperation = new PatchOperationFactory() .instanceOf(DESCRIBE_STEP_METADATA_OPERATION_ENTRY, op.getOp()); String[] split = patchOperation.getAbsolutePath(op.getPath()).split("/"); if (inputConfig.isFieldPresent(split[0])) { patchOperation.perform(context, currentRequest, source, op); } else { throw new UnprocessableEntityException("The field " + split[0] + " is not present in section " + inputConfig.getFormName()); } } }
Source:
<code>public RestletProducer(RestletEndpoint endpoint) throws Exception { super(endpoint); this.throwException = endpoint.isThrowExceptionOnFailure(); client = new Client(endpoint.getProtocol()); client.setContext(new Context()); client.getContext().getParameters().add("socketTimeout", String.valueOf(endpoint.getSocketTimeout())); client.getContext().getParameters().add("socketConnectTimeoutMs", String.valueOf(endpoint.getSocketTimeout())); <START> RestletComponent component = (RestletComponent)endpoint.getComponent(); <END> client.getContext().getParameters().add("maxConnectionsPerHost", String.valueOf(component.getMaxConnectionsPerHost())); client.getContext().getParameters().add("maxTotalConnections", String.valueOf(component.getMaxTotalConnections())); }</code><technical_language>need check if values null Integer types</technical_language>

Target:
public RestletProducer(RestletEndpoint endpoint) throws Exception { super(endpoint); this.throwException = endpoint.isThrowExceptionOnFailure(); client = new Client(endpoint.getProtocol()); client.setContext(new Context()); client.getContext().getParameters().add("socketTimeout", String.valueOf(endpoint.getSocketTimeout())); client.getContext().getParameters().add("socketConnectTimeoutMs", String.valueOf(endpoint.getSocketTimeout())); RestletComponent component = (RestletComponent)endpoint.getComponent(); if(component.getMaxConnectionsPerHost() != null && component.getMaxConnectionsPerHost() > 0) { client.getContext().getParameters().add("maxConnectionsPerHost", String.valueOf(component.getMaxConnectionsPerHost())); } if(component.getMaxTotalConnections() != null && component.getMaxTotalConnections() > 0) { client.getContext().getParameters().add("maxTotalConnections", String.valueOf(component.getMaxTotalConnections())); } }
Source:
<code>TopoSortGenerator(Generator s) throws MissingObjectException, IncorrectObjectTypeException, IOException { FIFORevQueue tempQueue = new FIFORevQueue(); outputType = s.outputType() | SORT_TOPO; s.shareFreeList(tempQueue); for (;;) { final RevCommit c = s.next(); <START> if (c == null) <END> break; if ((c.flags & RevWalk.TEMP_MARK) != 0) { continue; } for (RevCommit p : c.parents) { p.inDegree++; } c.flags |= RevWalk.TEMP_MARK; tempQueue.add(c); } pending = new FIFORevQueue(); tempQueue.shareFreeList(pending); for (;;) { RevCommit c = tempQueue.next(); if (c == null) { break; } c.flags &= ~RevWalk.TEMP_MARK; pending.add(c); } }</code><technical_language>add missing braces</technical_language>

Target:
TopoSortGenerator(Generator s) throws MissingObjectException, IncorrectObjectTypeException, IOException { FIFORevQueue tempQueue = new FIFORevQueue(); outputType = s.outputType() | SORT_TOPO; s.shareFreeList(tempQueue); for (;;) { RevCommit c = s.next(); if (c == null) { break; } if ((c.flags & RevWalk.TEMP_MARK) != 0) { continue; } for (RevCommit p : c.parents) { p.inDegree++; } c.flags |= RevWalk.TEMP_MARK; tempQueue.add(c); } pending = new FIFORevQueue(); tempQueue.shareFreeList(pending); for (;;) { RevCommit c = tempQueue.next(); if (c == null) { break; } c.flags &= ~RevWalk.TEMP_MARK; pending.add(c); } }
Source:
<code>public Result getElementRevision(String id, String revisionString) { UserSession session = getAuthenticatedSession(DEVELOPER); <START> Long revision = BridgeUtils.getLongOrDefault(revisionString, 0L); <END> AppConfigElement element = service.getElementRevision(session.getStudyIdentifier(), id, revision); return okResult(element); }</code><technical_language>converting this a default? Revision 0 is a valid revision. throw in this case? pass service service validate? Do need a test case for unspecified revision? Similarly in updateElementRevision(), publishElementRevision(), deleteElementRevision()</technical_language>

Target:
public Result getElementRevision(String id, String revisionString) { UserSession session = getAuthenticatedSession(DEVELOPER); Long revision = BridgeUtils.getLongOrDefault(revisionString, null); if (revision == null) { throw new BadRequestException("Revision is not a valid revision number"); } AppConfigElement element = service.getElementRevision(session.getStudyIdentifier(), id, revision); return okResult(element); }
Source:
<code>private void RemoveVdsFromCollection() { VDSReturnValue returnValue = Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(getVdsId())); if (!returnValue.getSucceeded()) { <START> errorType = AuditLogType.USER_FAILED_REMOVE_VDS; <END> } }</code><technical_language>this is good enough, if for some reason execution fail this method is called, fail of this run, error for audit log failure</technical_language>

Target:
private void RemoveVdsFromCollection() { VDSReturnValue returnValue = Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(getVdsId())); }
Source:
<code><START> public String getStoragePoolId() { <END> return storagePoolId; }</code><technical_language>mark this @Nullable please</technical_language>

Target:
public @Nullable String getStoragePoolId() { return storagePoolId; }
Source:
<code>private static PartitionReceiver createOffsetReceiver(EventHubClient ehClient, OffsetFilter filter, EventHubConfig eventHubConfig, String partitionId) throws EventHubException { return ehClient.createEpochReceiverSync( eventHubConfig.getConsumerGroupName(), partitionId, <START> EventPosition.fromOffset(filter.getOffset(), false), <END> 1); }</code><technical_language>I putting this line in OffsetFilter implementation, similar for TimestampFilter. IEventFilter declare a getOffset() method instead of do instanceof check in createReceiver</technical_language>

Target:
private static PartitionReceiver createOffsetReceiver(EventHubClient ehClient, OffsetFilter filter, EventHubConfig eventHubConfig, String partitionId) throws EventHubException { final ReceiverOptions options = new ReceiverOptions(); options.setReceiverRuntimeMetricEnabled(true); return ehClient.createEpochReceiverSync( eventHubConfig.getConsumerGroupName(), partitionId, EventPosition.fromOffset(filter.getOffset(), false), 1, options); }
Source:
<code>private boolean isSequenceElementChange(Notification notification) { <START> boolean isSequenceElement = isSequenceElement(notification.getNotifier()); <END> Object value = getValue(notification); if (value != null) { boolean valueIsSequenceElt = false; if (value instanceof EObject) { valueIsSequenceElt = isSequenceElement(value); } else if (value instanceof Collection<?>) { Collection<?> values = (Collection<?>) value; for (Object val : values) { if (isSequenceElement(val)) { valueIsSequenceElt = true; break; } } } isSequenceElement = isSequenceElement && valueIsSequenceElt; } return isSequenceElement; }</code><technical_language>in previous review: Add a condition isSequenceElement, code is unnecessary if isSequenceElement == false</technical_language>

Target:
private boolean isSequenceElementChange(Notification notification) { boolean isSequenceElement = isSequenceElement(notification.getNotifier()); if (isSequenceElement) { Object value = getValue(notification); if (value != null) { boolean valueIsSequenceElt = false; if (value instanceof EObject) { valueIsSequenceElt = isSequenceElement(value); } else if (value instanceof Collection<?>) { Collection<?> values = (Collection<?>) value; for (Object val : values) { if (isSequenceElement(val)) { valueIsSequenceElt = true; break; } } } isSequenceElement = isSequenceElement && valueIsSequenceElt; } } return isSequenceElement; }
Source:
<code>void notifyError(Throwable error) { Objects.requireNonNull(error); <START> final String stackTrace = Stream.of(error.getStackTrace()).map(StackTraceElement::toString) <END> .collect(Collectors.joining("\n")); logger.error("Error occurred. '{}'\nStacktrace: {}", error.toString(), stackTrace); errorContextProcessor.onNext(error); }</code><technical_language>I consider updating ClientLogger provide information exception (including stacktrace) possible. For some reason, ClientLogger filters out exceptions sending slf4j logger. If do that, slf4j log entire stacktrace</technical_language>

Target:
void notifyError(Throwable error) { Objects.requireNonNull(error); logger.error("Error occurred. {}", error.toString()); errorContextProcessor.onNext(error); }