auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void checkAttributeValidity(XAttributeType attribute) { String min = attribute.getMin(); int minOccurrences = 0; if (!Strings.isEmpty(min)) { minOccurrences = Integer.parseInt(min); if (minOccurrences > 0 && Strings.isEmpty(attribute.getDefaultValue())) { error("Default value cannot be empty if min greater than 0", attribute, OseeDslPackage.Literals.XATTRIBUTE_TYPE__DEFAULT_VALUE); } } if (minOccurrences < 0) { error("min cannot be less than 0", attribute, OseeDslPackage.Literals.XATTRIBUTE_TYPE__MIN); } String max = attribute.getMax(); int maxOccurrences = 0; if (!Strings.isEmpty(max)) { maxOccurrences = Integer.parseInt(max); } if (minOccurrences > maxOccurrences) { error("max must be greater than min", attribute, OseeDslPackage.Literals.XATTRIBUTE_TYPE__MAX); } }

Target:
public void checkAttributeValidity(XAttributeType attribute) { String min = attribute.getMin(); int minOccurrences = 0; if (!Strings.isEmpty(min)) { minOccurrences = Integer.parseInt(min); if (minOccurrences > 0 && Strings.isEmpty(attribute.getDefaultValue())) { error("Default value cannot be empty if min greater than 0", attribute, OseeDslPackage.Literals.XATTRIBUTE_TYPE__DEFAULT_VALUE); } } if (minOccurrences < 0) { error("min cannot be less than 0", attribute, OseeDslPackage.Literals.XATTRIBUTE_TYPE__MIN); } String max = attribute.getMax(); int maxOccurrences = 0; if (!Strings.isEmpty(max)) { maxOccurrences = Integer.parseInt(max); } if (minOccurrences > maxOccurrences) { error("min must not be greater than max", attribute, OseeDslPackage.Literals.XATTRIBUTE_TYPE__MAX); } }
Source:
private String getTablePath(String columnPath) { int columnDelim = columnPath.lastIndexOf('.'); final String tablePath; if (columnDelim == -1) { tablePath = _metadata.getDatastoreName(); } else { tablePath = columnPath.substring(0, columnDelim); } return tablePath; }

Target:
private String getTablePath(String columnPath) { final int columnDelim = columnPath.lastIndexOf('.'); final String tablePath; if (columnDelim == -1) { tablePath = _metadata.getDatastoreName(); } else { tablePath = columnPath.substring(0, columnDelim); } return tablePath; }
Source:
private boolean checkFilesFieldForNull() { boolean valid = files != null; LOGGER.assertLog(valid, LOG_FILES_IS_NULL); return valid; }

Target:
private boolean checkFilesFieldForNull() { boolean valid = (files != null); LOGGER.assertLog(valid, LOG_FILES_IS_NULL); return valid; }
Source:
private CheckAndSetResult<ValueAndBound<T>> extractRelevantValues(T targetValue, long newBound, CheckAndSetResult<SequenceAndBound> casResult) { if (casResult.successful()) { return CheckAndSetResult.of(true, ImmutableList.of(ValueAndBound.of(Optional.of(targetValue), newBound))); } return CheckAndSetResult.of( casResult.successful(), casResult.existingValues() .stream() .map(value -> ValueAndBound.of(getValue(value.sequence()), value.bound())) .collect(Collectors.toList())); }

Target:
private CheckAndSetResult<ValueAndBound<T>> extractRelevantValues(T targetValue, long newBound, CheckAndSetResult<SequenceAndBound> casResult) { if (casResult.successful()) { return CheckAndSetResult.of(true, ImmutableList.of(ValueAndBound.of(Optional.of(targetValue), newBound))); } return CheckAndSetResult.of( false, casResult.existingValues() .stream() .map(value -> ValueAndBound.of(getValue(value.sequence()), value.bound())) .collect(Collectors.toList())); }
Source:
public void open(final D diagram, final DiagramViewer.DiagramViewerCallback<D> callback) { onOpen(diagram); callback.onOpen(diagram); final String definitionSetId = diagram.getMetadata().getDefinitionSetId(); StunnerPreferences preferences = getPreferencesRegistry().get(definitionSetId); final StunnerDiagramEditorPreferences editorPreferences = preferences.getDiagramEditorPreferences(); boolean isHiDPIEnabled = false; if (editorPreferences!=null) { isHiDPIEnabled = editorPreferences.isHiDPIEnabled(); } final int[] ds = getDiagramSize(diagram); final CanvasSettings settings = new CanvasSettings(ds[0], ds[1], isHiDPIEnabled); openCanvas(getCanvas(), settings); callback.afterCanvasInitialized(); getHandler().draw(diagram, new ParameterizedCommand<CommandResult<?>>() { @Override public void execute(CommandResult<?> result) { if (!CommandUtils.isError(result)) { callback.onSuccess(); } else { callback.onError(new ClientRuntimeError("An error occurred while drawing the diagram " + "[result=" + result + "]")); } } }); }

Target:
public void open(final D diagram, final DiagramViewer.DiagramViewerCallback<D> callback) { onOpen(diagram); callback.onOpen(diagram); final String definitionSetId = diagram.getMetadata().getDefinitionSetId(); final StunnerPreferences preferences = getPreferencesRegistry().get(definitionSetId); final StunnerDiagramEditorPreferences editorPreferences = preferences.getDiagramEditorPreferences(); final boolean isHiDPIEnabled = editorPreferences != null && editorPreferences.isHiDPIEnabled(); final int[] ds = getDiagramSize(diagram); final CanvasSettings settings = new CanvasSettings(ds[0], ds[1], isHiDPIEnabled); openCanvas(getCanvas(), settings); callback.afterCanvasInitialized(); getHandler().draw(diagram, new ParameterizedCommand<CommandResult<?>>() { @Override public void execute(CommandResult<?> result) { if (!CommandUtils.isError(result)) { callback.onSuccess(); } else { callback.onError(new ClientRuntimeError("An error occurred while drawing the diagram " + "[result=" + result + "]")); } } }); }
Source:
public Project getProject() { Finder<Long, ? extends Model> finder = null; Resource resource = null; switch(resourceType) { case ISSUE_POST: resource = Issue.finder.byId(resourceId).asResource(); break; case ISSUE_ASSIGNEE: return Assignee.finder.byId(resourceId).project; case ISSUE_COMMENT: resource = IssueComment.find.byId(resourceId).asResource(); break; case NONISSUE_COMMENT: resource = PostingComment.find.byId(resourceId).asResource(); break; case LABEL: resource = Label.find.byId(resourceId).asResource(); break; case BOARD_POST: resource = Posting.finder.byId(resourceId).asResource(); break; case USER: resource = null; break; case PROJECT: resource = Project.find.byId(resourceId).asResource(); break; case ATTACHMENT: resource = Attachment.find.byId(resourceId).asResource(); break; case MILESTONE: resource = Milestone.find.byId(resourceId).asResource(); break; default: if (EnumSet.allOf(ResourceType.class).contains(resourceType)) { play.Logger.warn("Unsupported resource type " + resourceType); } else { play.Logger.warn("Unknown resource type " + resourceType); } return null; } if (resource != null) { return resource.getProject(); } else { return null; } }

Target:
public Project getProject() { switch(resourceType) { case ISSUE_ASSIGNEE: return Assignee.finder.byId(resourceId).project; default: Resource resource = getResource(); if (resource != null) { return resource.getProject(); } else { return null; } } }
Source:
public void showStatusComplete() { progressBar.getStyle().setColor( "WHITE" ); progressBar.getStyle().setBackgroundColor( "GREEN" ); progressBar.setInnerHTML( AnalysisConstants.INSTANCE.AnalysisComplete() ); }

Target:
public void showStatusComplete() { progressPanel.getStyle().setColor( "WHITE" ); progressPanel.getStyle().setBackgroundColor( "GREEN" ); progressPanel.setInnerHTML( AnalysisConstants.INSTANCE.AnalysisComplete() ); }
Source:
public MethodOutcome updateLocation(@ResourceParam Location location, @IdParam IdType theId) { MethodOutcome retVal = new MethodOutcome(); OperationOutcome outcome = new OperationOutcome(); locationResource.updateLocation(theId.getIdPart(), location); CodeableConcept concept = new CodeableConcept(); Coding coding = concept.addCoding(); coding.setDisplay("Location successfully updated"); outcome.addIssue().setDetails(concept); retVal.setOperationOutcome(outcome); return retVal; }

Target:
public MethodOutcome updateLocation(@ResourceParam Location location, @IdParam IdType theId) { MethodOutcome retVal = new MethodOutcome(); OperationOutcome outcome = new OperationOutcome(); locationResource.updateLocation(theId.getIdPart(), location); CodeableConcept concept = new CodeableConcept(); Coding coding = concept.addCoding(); coding.setDisplay("Location successfully updated" + theId.getId()); outcome.addIssue().setDetails(concept); retVal.setOperationOutcome(outcome); return retVal; }
Source:
public void hardDeleteTest() throws InterruptedException, IOException, StoreException { properties.put("store.deleted.message.retention.days", Integer.toString(1)); properties.put("store.hard.delete.bytes.per.sec", Integer.toString(Integer.MAX_VALUE / 10)); reloadIndex(false); index.hardDeleter.running.set(true); assertFalse("Hard delete did work even though no message is past retention time", index.hardDeleter.hardDelete()); advanceTime(SystemTime.getInstance().milliseconds() + 2 * Time.MsPerSec * Time.SecsPerDay); assertTrue("Hard delete did not do any work", index.hardDeleter.hardDelete()); long expectedProgress = log.getDifference(logOrder.lastKey(), new Offset(log.getFirstSegment().getName(), 0)); waitUntilExpectedProgress(expectedProgress, 1000); verifyEntriesForHardDeletes(deletedKeys, true); }

Target:
public void hardDeleteTest() throws InterruptedException, IOException, StoreException { properties.put("store.deleted.message.retention.days", Integer.toString(1)); properties.put("store.hard.delete.bytes.per.sec", Integer.toString(Integer.MAX_VALUE / 10)); reloadIndex(false); index.hardDeleter.enabled.set(true); assertFalse("Hard delete did work even though no message is past retention time", index.hardDeleter.hardDelete()); advanceTime(SystemTime.getInstance().milliseconds() + 2 * Time.MsPerSec * Time.SecsPerDay); assertTrue("Hard delete did not do any work", index.hardDeleter.hardDelete()); long expectedProgress = log.getDifference(logOrder.lastKey(), new Offset(log.getFirstSegment().getName(), 0)); assertEquals("Hard delete did not make expected progress", expectedProgress, index.hardDeleter.getProgress()); verifyEntriesForHardDeletes(deletedKeys); }
Source:
CompiledScript get() { return script.get(); }

Target:
protected CompiledScript get() { return script.get(); }
Source:
public SLDConfig(String jspPath, String units, String style, int strokeWidth, String[] attrs, float[] thresholds, String[] colors, List<Map<String,Object>> bins) { this(jspPath, units, style, strokeWidth, SLDGenerator.STROKE_OPACITY_DEFAULT, attrs, thresholds, colors, bins, SLDGenerator.DOMAIN_DEFAULT); }

Target:
public SLDConfig(String jspPath, String units, String style, int strokeWidth, String[] attrs, float[] thresholds, String[] colors, List<Map<String,Object>> bins) { this(jspPath, units, style, strokeWidth, SLDGenerator.STROKE_OPACITY_DEFAULT, attrs, thresholds, colors, bins, SLDGenerator.LEGEND_TYPE_DEFAULT); }
Source:
@Override public T convert(ResponseBody value) throws IOException { try { return MessageNano.mergeFrom(instance, value.bytes()); } catch (InvalidProtocolBufferNanoException e) { throw new RuntimeException(e); } finally { value.close(); } }

Target:
@Override public T convert(ResponseBody value) throws IOException { try { return MessageNano.mergeFrom(getNanoProtoInstance(), value.bytes()); } catch (InvalidProtocolBufferNanoException e) { throw new RuntimeException(e); } finally { value.close(); } }
Source:
public Conference(Videobridge videobridge, String id, String conferenceName, boolean enableLogging, long gid) { this.videobridge = Objects.requireNonNull(videobridge, "videobridge"); Level minLevel = enableLogging ? Level.ALL : Level.WARNING; Map<String, String> context = JMap.ofEntries( entry("confId", id) ); context.put("gid", String.valueOf(gid)); if (conferenceName != null) { context.put("conf_name", conferenceName); } logger = new LoggerImpl(Conference.class.getName(), minLevel, new LogContext(context)); this.shim = new ConferenceShim(this, logger); this.id = Objects.requireNonNull(id, "id"); this.gid = gid; this.eventAdmin = enableLogging ? videobridge.getEventAdmin() : null; this.includeInStatistics = enableLogging; this.conferenceName = conferenceName; speechActivity = new ConferenceSpeechActivity(this); audioLevelListener = (sourceSsrc, level) -> speechActivity.levelChanged(sourceSsrc, (int) level); expireableImpl = new ExpireableImpl(logger, this::expire); if (enableLogging) { eventAdmin.sendEvent(EventFactory.conferenceCreated(this)); Videobridge.Statistics videobridgeStatistics = videobridge.getStatistics(); videobridgeStatistics.totalConferencesCreated.incrementAndGet(); } }

Target:
public Conference(Videobridge videobridge, String id, String conferenceName, boolean enableLogging, long gid) { if (gid != GID_NOT_SET && (gid < 0 || gid > 0xffff_ffffL)) { throw new IllegalArgumentException("Invalid GID:" + gid); } this.videobridge = Objects.requireNonNull(videobridge, "videobridge"); Level minLevel = enableLogging ? Level.ALL : Level.WARNING; Map<String, String> context = JMap.ofEntries( entry("confId", id), entry("gid", String.valueOf(gid)) ); if (conferenceName != null) { context.put("conf_name", conferenceName); } logger = new LoggerImpl(Conference.class.getName(), minLevel, new LogContext(context)); this.shim = new ConferenceShim(this, logger); this.id = Objects.requireNonNull(id, "id"); this.gid = gid; this.eventAdmin = enableLogging ? videobridge.getEventAdmin() : null; this.includeInStatistics = enableLogging; this.conferenceName = conferenceName; speechActivity = new ConferenceSpeechActivity(this); audioLevelListener = (sourceSsrc, level) -> speechActivity.levelChanged(sourceSsrc, (int) level); expireableImpl = new ExpireableImpl(logger, this::expire); if (enableLogging) { eventAdmin.sendEvent(EventFactory.conferenceCreated(this)); Videobridge.Statistics videobridgeStatistics = videobridge.getStatistics(); videobridgeStatistics.totalConferencesCreated.incrementAndGet(); } }
Source:
public void testForValueUndefined() { final AdministrativeStatusType administrativeStatusType = AdministrativeStatusType.UNDEFINED; final AdministrativeStatusTypeDto administrativeStatusTypeDto = this.configurationMapper.map( administrativeStatusType, AdministrativeStatusTypeDto.class); assertNotNull(administrativeStatusType); assertNotNull(administrativeStatusTypeDto); assertEquals(administrativeStatusType.value(), administrativeStatusTypeDto.value()); }

Target:
public void testForValueUndefined() { final AdministrativeStatusType administrativeStatusType = AdministrativeStatusType.UNDEFINED; final AdministrativeStatusTypeDto administrativeStatusTypeDto = this.configurationMapper.map( administrativeStatusType, AdministrativeStatusTypeDto.class); assertNotNull(administrativeStatusTypeDto); assertEquals(administrativeStatusType.value(), administrativeStatusTypeDto.value()); }
Source:
public void working_directory() throws IOException { Path workDir = Files.createTempDirectory("workDir"); TestRule check = new TestRule() { @Override public void initialize(SubscriptionCheck.Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> assertThat(ctx.workingDirectory()).isEqualTo(workDir.toFile())); } }; File tmpFile = Files.createTempFile("foo", "py").toFile(); PythonVisitorContext context = TestPythonVisitorRunner.createContext(tmpFile, workDir.toFile()); assertThat(context.workingDirectory()).isEqualTo(workDir.toFile()); assertThat(context.pythonFile().uri()).isEqualTo(tmpFile.toURI()); check.scanFile(context); SubscriptionVisitor.analyze(Collections.singletonList(check), context); }

Target:
public void working_directory() throws IOException { Path workDir = Files.createTempDirectory("workDir"); PythonSubscriptionCheck check = new PythonSubscriptionCheck() { @Override public void initialize(SubscriptionCheck.Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> assertThat(ctx.workingDirectory()).isEqualTo(workDir.toFile())); } }; File tmpFile = Files.createTempFile("foo", "py").toFile(); PythonVisitorContext context = TestPythonVisitorRunner.createContext(tmpFile, workDir.toFile()); assertThat(context.workingDirectory()).isEqualTo(workDir.toFile()); assertThat(context.pythonFile().uri()).isEqualTo(tmpFile.toURI()); check.scanFile(context); SubscriptionVisitor.analyze(Collections.singletonList(check), context); }
Source:
private CommandCall duplicateCommandForDifferentElement(CommandCall commandCall, Element element) { String expression = commandCall.getExpression(); if (expression.equals("")) { expression = element.getText(); } return new CommandCall(null, commandCall.getCommand(), element, expression, commandCall.getResource()); }

Target:
private CommandCall duplicateCommandForDifferentElement(CommandCall commandCall, Element element) { return new CommandCall( null, commandCall.getCommand(), element, commandCall.getExpression(), commandCall.getResource()); }
Source:
private int getVisibility(int memberIndex) throws CoreException { int visibilityBitOffset = memberIndex % VISIBILITY_VALUES_PER_BYTE; long visibilityOffset = record + MEMBER_VISIBILITIES + memberIndex / VISIBILITY_VALUES_PER_BYTE; int visibility = getDB().getByte(visibilityOffset); visibility &= VISIBILITY_MASK << visibilityBitOffset * VISIBILITY_BITS; visibility >>>= visibilityBitOffset * VISIBILITY_BITS; return visibility; }

Target:
private int getVisibility(int memberIndex) throws CoreException { int visibilityBitOffset = memberIndex % VISIBILITY_VALUES_PER_BYTE; long visibilityOffset = record + MEMBER_VISIBILITIES + memberIndex / VISIBILITY_VALUES_PER_BYTE; int visibility = getDB().getByte(visibilityOffset); visibility >>>= visibilityBitOffset * VISIBILITY_BITS; visibility &= VISIBILITY_MASK; return visibility; }
Source:
private void handleRemove() { ISelection selection = filterView.getSelection(); IStructuredSelection structuredSelection = null; if (selection instanceof IStructuredSelection) { structuredSelection = ((IStructuredSelection) selection); Iterator it = structuredSelection.iterator(); while (it.hasNext()) { Object element = it.next(); if (element instanceof FilterCopy) { FilterCopy filter = (FilterCopy) element; filter.getParent().removeChild(filter); } else { int mask = element.equals(includeOnlyGroup) ? IResourceFilterDescription.INCLUDE_ONLY: IResourceFilterDescription.EXCLUDE_ALL; FilterCopy[] children = filters.getChildren(); for (FilterCopy filterCopy : children) { if ((filterCopy.getType() & mask) != 0) filters.removeChild(filterCopy); } } } filterView.refresh(); } }

Target:
private void handleRemove() { ISelection selection = filterView.getSelection(); IStructuredSelection structuredSelection = null; if (selection instanceof IStructuredSelection) { structuredSelection = ((IStructuredSelection) selection); Iterator it = structuredSelection.iterator(); while (it.hasNext()) { Object element = it.next(); if (element instanceof FilterCopy) { FilterCopy filter = (FilterCopy) element; filter.getParent().removeChild(filter); } else { int mask = element.equals(includeOnlyGroup) ? IResourceFilterDescription.INCLUDE_ONLY: IResourceFilterDescription.EXCLUDE_ALL; for (FilterCopy filterCopy : filters.getChildren()) { if ((filterCopy.getType() & mask) != 0) filters.removeChild(filterCopy); } } } filterView.refresh(); } }
Source:
public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof IJavaProject) { element = ((IJavaProject) element).getProject(); } return !Optional.ofNullable(element) .filter(IProject.class::isInstance) .map(IProject.class::cast) .filter(Objects::nonNull) .filter(p -> TemporaryProject.PROJECT_NAME.equals(p.getName())) .isPresent(); }

Target:
public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof IJavaProject) { element = ((IJavaProject) element).getProject(); } return !Optional.ofNullable(element) .filter(IProject.class::isInstance) .map(IProject.class::cast) .filter(p -> TemporaryProject.PROJECT_NAME.equals(p.getName())) .isPresent(); }
Source:
private void validateOptions(CustomJCommander jCommander) { if (configFile != null) { Set<String> filteredOptions = new HashSet<>(jCommander.getUserSpecifiedOptions()); filteredOptions.remove(addDashDash(AUTO_ACTIVATE)); filteredOptions.remove(addDashDash(REPAIR_MODE)); filteredOptions.remove("-D"); filteredOptions.remove(addDashDash(CONFIG_FILE)); filteredOptions.remove("-f"); filteredOptions.remove(addDashDash(LICENSE_FILE)); filteredOptions.remove("-l"); filteredOptions.remove(addDashDash(NODE_NAME)); filteredOptions.remove("-n"); filteredOptions.remove(addDashDash(NODE_CONFIG_DIR)); filteredOptions.remove("-r"); if (filteredOptions.size() != 0) { throw new ParameterException( String.format( "'%s' parameter can only be used with '%s', '%s' and '%s' parameters", addDashDash(CONFIG_FILE), addDashDash(REPAIR_MODE), addDashDash(NODE_NAME), addDashDash(NODE_CONFIG_DIR) ) ); } } else { if (licenseFile != null) { if (clusterName == null) { throw new ParameterException("'" + addDashDash(LICENSE_FILE) + "' parameter must be used with '" + addDashDash(CLUSTER_NAME) + "' parameter"); } if (!allowsAutoActivation) { throw new ParameterException("'" + addDashDash(LICENSE_FILE) + "' parameter must be used with '" + addDashDash(AUTO_ACTIVATE) + "' parameter"); } } } }

Target:
private void validateOptions(CustomJCommander jCommander) { if (configFile != null) { if (nodeName != null && (nodePort != null || nodeHostname != null)) { throw new ParameterException("'" + addDashDash(NODE_NAME) + "' parameter cannot be used with '" + addDashDash(NODE_HOSTNAME) + "' or '" + addDashDash(NODE_PORT) + "' parameter"); } Set<String> filteredOptions = new HashSet<>(jCommander.getUserSpecifiedOptions()); filteredOptions.remove(addDashDash(AUTO_ACTIVATE)); filteredOptions.remove(addDashDash(REPAIR_MODE)); filteredOptions.remove("-D"); filteredOptions.remove(addDashDash(CONFIG_FILE)); filteredOptions.remove("-f"); filteredOptions.remove(addDashDash(LICENSE_FILE)); filteredOptions.remove("-l"); filteredOptions.remove(addDashDash(NODE_HOSTNAME)); filteredOptions.remove("-s"); filteredOptions.remove(addDashDash(NODE_PORT)); filteredOptions.remove("-p"); filteredOptions.remove(addDashDash(NODE_NAME)); filteredOptions.remove("-n"); filteredOptions.remove(addDashDash(NODE_CONFIG_DIR)); filteredOptions.remove("-r"); if (filteredOptions.size() != 0) { throw new ParameterException( String.format( "'%s' parameter can only be used with '%s', '%s', '%s', '%s' and '%s' parameters", addDashDash(CONFIG_FILE), addDashDash(REPAIR_MODE), addDashDash(NODE_NAME), addDashDash(NODE_HOSTNAME), addDashDash(NODE_PORT), addDashDash(NODE_CONFIG_DIR) ) ); } } else { if (licenseFile != null) { if (clusterName == null) { throw new ParameterException("'" + addDashDash(LICENSE_FILE) + "' parameter must be used with '" + addDashDash(CLUSTER_NAME) + "' parameter"); } if (!allowsAutoActivation) { throw new ParameterException("'" + addDashDash(LICENSE_FILE) + "' parameter must be used with '" + addDashDash(AUTO_ACTIVATE) + "' parameter"); } } } }
Source:
<T> Mono<DigitalTwinsResponse<T>> getRelationshipWithResponse(String digitalTwinId, String relationshipId, Class<T> clazz, GetRelationshipOptions options, Context context) { return protocolLayer .getDigitalTwins() .getRelationshipByIdWithResponseAsync(digitalTwinId, relationshipId, options != null ? options.toProtocolLayerOptions() : null, context) .flatMap(response -> { T genericResponse; try { genericResponse = DeserializationHelpers.deserializeObject(mapper, response.getValue(), clazz, this.serializer); } catch (JsonProcessingException e) { logger.error("JsonProcessingException occurred while deserializing the get relationship response: ", e); return Mono.error(e); } DigitalTwinsResponseHeaders twinHeaders = mapper.convertValue(response.getDeserializedHeaders(), DigitalTwinsResponseHeaders.class); return Mono.just(new DigitalTwinsResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), genericResponse, twinHeaders)); }); }

Target:
<T> Mono<DigitalTwinsResponse<T>> getRelationshipWithResponse(String digitalTwinId, String relationshipId, Class<T> clazz, GetRelationshipOptions options, Context context) { return protocolLayer .getDigitalTwins() .getRelationshipByIdWithResponseAsync(digitalTwinId, relationshipId, OptionsConverter.toProtocolLayerOptions(options), context) .flatMap(response -> { T genericResponse; try { genericResponse = DeserializationHelpers.deserializeObject(mapper, response.getValue(), clazz, this.serializer); } catch (JsonProcessingException e) { logger.error("JsonProcessingException occurred while deserializing the get relationship response: ", e); return Mono.error(e); } DigitalTwinsResponseHeaders twinHeaders = mapper.convertValue(response.getDeserializedHeaders(), DigitalTwinsResponseHeaders.class); return Mono.just(new DigitalTwinsResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), genericResponse, twinHeaders)); }); }
Source:
public void reallocate(TaxonConcept element, Taxonomy taxonomy) { taxonomy.report(IssueType.NOTE, "taxonConcept.reallocated", element, this); taxonomy.count("count.reallocate.taxonConcept"); TaxonConceptInstance representative = this.getRepresentative(); if (representative == null || this.resolution == null) throw new IndexBuilderException("Unable to reallocate " + element + " to " + this + " without representative or resolution"); element.resolution = new TaxonResolution(); for (TaxonConceptInstance tci: element.instances) { tci.setContainer(this); this.instances.add(tci); this.resolution.addExternal(tci, representative, taxonomy); element.resolution.addExternal(tci, representative, taxonomy); } element.instances.clear(); }

Target:
public void reallocate(TaxonConcept element, Taxonomy taxonomy) { taxonomy.report(IssueType.NOTE, "taxonConcept.reallocated", element, this); taxonomy.count("count.reallocate.taxonConcept"); TaxonConceptInstance representative = this.getRepresentative(); if (representative == null || this.resolution == null) throw new IndexBuilderException("Unable to reallocate " + element + " to " + this + " without representative and resolution"); element.resolution = new TaxonResolution(); for (TaxonConceptInstance tci: element.instances) { tci.setContainer(this); this.instances.add(tci); this.resolution.addExternal(tci, representative, taxonomy); element.resolution.addExternal(tci, representative, taxonomy); } element.instances.clear(); }
Source:
public Boolean call() throws Exception { mergeabilityCheckQueue.updatingMergeabilityFlag(change, force); RequestContext context = new RequestContext() { @Override public CurrentUser getCurrentUser() { return identifiedUserFactory.create(change.getOwner()); } @Override public Provider<ReviewDb> getReviewDbProvider() { return new Provider<ReviewDb>() { @Override public ReviewDb get() { if (reviewDb == null) { try { reviewDb = schemaFactory.open(); } catch (OrmException e) { throw new ProvisionException("Cannot open ReviewDb", e); } } return reviewDb; } }; } }; RequestContext old = tl.setContext(context); ReviewDb db = context.getReviewDbProvider().get(); try { PatchSet ps = db.patchSets().get(change.currentPatchSetId()); Mergeable m = mergeable.get(); m.setForce(force); ChangeControl control = changeControlFactory.controlFor(change.getId(), context.getCurrentUser()); MergeableInfo info = m.apply( new RevisionResource(new ChangeResource(control), ps)); return Boolean.valueOf(change.isMergeable()) != info.mergeable; } catch (ResourceConflictException e) { return false; } catch (Exception e) { String msg = "Failed to update mergeability flags for project " + change.getDest().getParentKey() + " on update of " + change.getDest().get(); log.error(msg, e); throw e; } finally { tl.setContext(old); if (reviewDb != null) { reviewDb.close(); reviewDb = null; } } }

Target:
public Boolean call() throws Exception { mergeabilityCheckQueue.updatingMergeabilityFlag(change, force); RequestContext context = new RequestContext() { @Override public CurrentUser getCurrentUser() { return identifiedUserFactory.create(change.getOwner()); } @Override public Provider<ReviewDb> getReviewDbProvider() { return new Provider<ReviewDb>() { @Override public ReviewDb get() { if (reviewDb == null) { try { reviewDb = schemaFactory.open(); } catch (OrmException e) { throw new ProvisionException("Cannot open ReviewDb", e); } } return reviewDb; } }; } }; RequestContext old = tl.setContext(context); ReviewDb db = context.getReviewDbProvider().get(); try { PatchSet ps = db.patchSets().get(change.currentPatchSetId()); Mergeable m = mergeable.get(); m.setForce(force); ChangeControl control = changeControlFactory.controlFor(change.getId(), context.getCurrentUser()); MergeableInfo info = m.apply( new RevisionResource(new ChangeResource(control), ps)); return change.isMergeable() != info.mergeable; } catch (ResourceConflictException e) { return false; } catch (Exception e) { String msg = "Failed to update mergeability flags for project " + change.getDest().getParentKey() + " on update of " + change.getDest().get(); log.error(msg, e); throw e; } finally { tl.setContext(old); if (reviewDb != null) { reviewDb.close(); reviewDb = null; } } }
Source:
void deactivate() { if (nativeVideo != null) { nativeVideo.deactivate(); nativeVideo = null; } }

Target:
void deactivate() { if (nativeVideo != null) { nativeVideo.unregisterInteractionViews(); nativeVideo.deactivate(); nativeVideo = null; } }
Source:
public static VdcParameter deserialize(String key) { Map<String, String> map = new HashMap<String, String>(); for (String token : key.split(";")) { String[] keyVal = token.split("="); map.put(keyVal[0], keyVal[1]); } switch (Integer.parseInt(map.get(VERSION_KEY))) { case 0: synchronized (parametersMap) { Guid guid = new Guid(map.get(GUID_KEY)); if (!parametersMap.containsKey(guid)) { throw new InvalidParameterKeyException("VdcParameter with guid not found "+ guid.toString()); } return parametersMap.get(guid); } default: throw new InvalidParameterKeyException("Error deserializing VdcParameter from key " + key); } }

Target:
public static VdcParameter deserialize(String key) { Map<String, String> map = new HashMap<String, String>(); for (String token : key.split(";")) { String[] keyVal = token.split("="); map.put(keyVal[0], keyVal[1]); } switch (Integer.parseInt(map.get(VERSION_KEY))) { case 0: synchronized (parametersMap) { UUID uuid = UUID.fromString(map.get(UUID_KEY)); VdcParameter param = parametersMap.get(uuid); if (param == null) { throw new InvalidParameterKeyException("VdcParameter with uuid not found "+ uuid.toString()); } return param; } default: throw new InvalidParameterKeyException("Error deserializing VdcParameter from key " + key); } }
Source:
public static <T> Predicate<T> filterByTypeAndName( Function<? super T, ?> generateKey) { Map<Object, Boolean> insertedPropertiesMap = new ConcurrentHashMap<>(); return t -> insertedPropertiesMap.putIfAbsent(generateKey.apply(t), Boolean.TRUE) == null; }

Target:
public static <T> Predicate<T> filterByTypeAndName( Function<? super T, ?> generateKey) { Map<Object, Boolean> insertedPropertiesMap = new HashMap<>(); return t -> insertedPropertiesMap.putIfAbsent(generateKey.apply(t), Boolean.TRUE) == null; }
Source:
public void visitNewClass(NewClassTree tree) { if (tree.is(Tree.Kind.NEW_CLASS)) { checkMethodInvocationArgument(tree.arguments(), tree.constructorSymbol()); } super.visitNewClass(tree); }

Target:
public void visitNewClass(NewClassTree tree) { checkMethodInvocationArgument(tree.arguments(), tree.constructorSymbol()); super.visitNewClass(tree); }
Source:
public CompletableFuture<Versioned<BookieServiceInfo>> getBookieServiceInfo(String bookieId) { String pathAsWritable = bookieRegistrationPath + "/" + bookieId; String pathAsReadonly = bookieReadonlyRegistrationPath + "/" + bookieId; CompletableFuture<Versioned<BookieServiceInfo>> promise = new CompletableFuture<>(); zk.getData(pathAsWritable, false, (int rc, String path, Object o, byte[] bytes, Stat stat) -> { if (KeeperException.Code.OK.intValue() == rc) { try { BookieServiceInfo bookieServiceInfo = deserializeBookieService(bookieId, bytes); promise.complete(new Versioned<>(bookieServiceInfo, new LongVersion(stat.getCversion()))); } catch (IOException ex) { promise.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc), path)); return; } } else if (KeeperException.Code.NONODE.intValue() == rc) { zk.getData(pathAsReadonly, false, (int rc2, String path2, Object o2, byte[] bytes2, Stat stat2) -> { if (KeeperException.Code.OK.intValue() == rc2) { try { BookieServiceInfo bookieServiceInfo = deserializeBookieService(bookieId, bytes2); promise.complete(new Versioned<>(bookieServiceInfo, new LongVersion(stat2.getCversion()))); } catch (IOException ex) { promise.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc2), path2)); return; } } else { promise.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc2), path2)); } }, null); } else { promise.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc), path)); } }, null); return promise; }

Target:
public CompletableFuture<Versioned<BookieServiceInfo>> getBookieServiceInfo(String bookieId) { String pathAsWritable = bookieRegistrationPath + "/" + bookieId; String pathAsReadonly = bookieReadonlyRegistrationPath + "/" + bookieId; CompletableFuture<Versioned<BookieServiceInfo>> promise = new CompletableFuture<>(); zk.getData(pathAsWritable, false, (int rc, String path, Object o, byte[] bytes, Stat stat) -> { if (KeeperException.Code.OK.intValue() == rc) { try { BookieServiceInfo bookieServiceInfo = deserializeBookieServiceInfo(bookieId, bytes); promise.complete(new Versioned<>(bookieServiceInfo, new LongVersion(stat.getCversion()))); } catch (IOException ex) { promise.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc), path)); return; } } else if (KeeperException.Code.NONODE.intValue() == rc) { zk.getData(pathAsReadonly, false, (int rc2, String path2, Object o2, byte[] bytes2, Stat stat2) -> { if (KeeperException.Code.OK.intValue() == rc2) { try { BookieServiceInfo bookieServiceInfo = deserializeBookieServiceInfo(bookieId, bytes2); promise.complete(new Versioned<>(bookieServiceInfo, new LongVersion(stat2.getCversion()))); } catch (IOException ex) { promise.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc2), path2)); return; } } else { promise.completeExceptionally(BKException.create(BKException.Code.NoBookieAvailableException)); } }, null); } else { promise.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc), path)); } }, null); return promise; }
Source:
private void checkMigrationEffect(DAnalysis analysis) { UnmodifiableIterator<EObject> noteAttachmentWithoutSourceOrTarget = null; for (DView dView : analysis.getOwnedViews()) { for (DDiagram dDiagram : Iterables.filter(dView.getOwnedRepresentations(), DDiagram.class)) { DiagramCreationUtil diagramCreationUtil = new DiagramCreationUtil(dDiagram); if (diagramCreationUtil.findAssociatedGMFDiagram()) { Diagram gmfDiagram = diagramCreationUtil.getAssociatedGMFDiagram(); noteAttachmentWithoutSourceOrTarget = Iterators.filter(gmfDiagram.eAllContents(), Predicates.and(Predicates.instanceOf(Connector.class), new Predicate<EObject>() { @Override public boolean apply(EObject input) { Connector connector = (Connector) input; if (ViewType.NOTEATTACHMENT.equals(connector.getType())) { return connector.getSource() == null || connector.getTarget() == null; } return false; } })); } } } assertTrue("It should not have NoteAttachment without source or target in this representations file.", noteAttachmentWithoutSourceOrTarget == null || !noteAttachmentWithoutSourceOrTarget.hasNext()); }

Target:
private void checkMigrationEffect(DAnalysis analysis) { Iterator<EObject> noteAttachmentWithoutSourceOrTarget = null; for (DView dView : analysis.getOwnedViews()) { for (DDiagram dDiagram : Iterables.filter(dView.getOwnedRepresentations(), DDiagram.class)) { DiagramCreationUtil diagramCreationUtil = new DiagramCreationUtil(dDiagram); if (diagramCreationUtil.findAssociatedGMFDiagram()) { Diagram gmfDiagram = diagramCreationUtil.getAssociatedGMFDiagram(); noteAttachmentWithoutSourceOrTarget = Iterators.filter(gmfDiagram.eAllContents(), Predicates.and(Predicates.instanceOf(Connector.class), new Predicate<EObject>() { @Override public boolean apply(EObject input) { Connector connector = (Connector) input; if (ViewType.NOTEATTACHMENT.equals(connector.getType())) { return connector.getSource() == null || connector.getTarget() == null; } return false; } })); } } } assertTrue("It should not have NoteAttachment without source or target in this representations file.", noteAttachmentWithoutSourceOrTarget == null || !noteAttachmentWithoutSourceOrTarget.hasNext()); }
Source:
public void setTitle(final String title) { mToolbarTitle = (title.equals("")) ? "WordPress" : title; if (mToolbar != null) { mToolbar.setTitle(title); } }

Target:
public void setTitle(final String title) { mToolbarTitle = title.isEmpty() ? getString(R.string.wordpress_as_site_title) : title; if (mToolbar != null) { mToolbar.setTitle(mToolbarTitle); } }
Source:
private List<IndexName> getIndexNameObjectList(Set<String> versionedIndexPaths) { Set<String> allIndexNameVersions = getIndexVersionNames(versionedIndexPaths); List<IndexName> indexNameObjectList = getVersionedIndexNameObjects(allIndexNameVersions); return indexNameObjectList; }

Target:
private List<IndexName> getIndexNameObjectList(Set<String> versionedIndexPaths) { List<IndexName> indexNameObjectList = new ArrayList<>(); for (String indexNameString : versionedIndexPaths) { indexNameObjectList.add(IndexName.parse(indexNameString)); } return indexNameObjectList; }
Source:
public boolean isEnabled() { if (config == null) { return true; } Boolean enabled = (Boolean) config.get("enabled"); return enabled == null || enabled.booleanValue(); }

Target:
public boolean isEnabled() { if (config == null) { return false; } Boolean enabled = (Boolean) config.get("enabled"); return enabled == null || enabled.booleanValue(); }
Source:
public void testConcurrentPubSub() throws Exception { Jedis subscriber1 = new Jedis("localhost", ports[0]); Jedis subscriber2 = new Jedis("localhost", ports[1]); CountDownLatch latch = new CountDownLatch(2); MockSubscriber mockSubscriber1 = new MockSubscriber(latch); MockSubscriber mockSubscriber2 = new MockSubscriber(latch); Runnable runnable1 = () -> subscriber1.subscribe(mockSubscriber1, CHANNEL_NAME); Thread subscriberThread1 = new Thread(runnable1); subscriberThread1.start(); Runnable runnable2 = () -> subscriber2.subscribe(mockSubscriber2, CHANNEL_NAME); Thread subscriberThread2 = new Thread(runnable2); subscriberThread2.start(); assertThat(latch.await(2, TimeUnit.SECONDS)) .as("channel subscription was not received") .isTrue(); int CLIENT_COUNT = 10; int ITERATIONS = 1000; List<Jedis> clients = new ArrayList<>(); List<Thread> threads = new ArrayList<>(); for (int i = 0; i < CLIENT_COUNT; i++) { Jedis client = new Jedis("localhost", ports[i % 2]); clients.add(client); Runnable runnable = () -> { for (int j = 0; j < ITERATIONS; j++) { client.publish(CHANNEL_NAME, "hello"); } }; threads.add(new Thread(runnable)); } threads.forEach(Thread::start); for (Thread thread : threads) { thread.join(); } mockSubscriber1.unsubscribe(CHANNEL_NAME); mockSubscriber2.unsubscribe(CHANNEL_NAME); GeodeAwaitility.await().untilAsserted(subscriberThread1::join); GeodeAwaitility.await().untilAsserted(subscriberThread2::join); assertThat(mockSubscriber1.getReceivedMessages().size()).isEqualTo(CLIENT_COUNT * ITERATIONS); assertThat(mockSubscriber2.getReceivedMessages().size()).isEqualTo(CLIENT_COUNT * ITERATIONS); }

Target:
public void testConcurrentPubSub() throws Exception { int CLIENT_COUNT = 10; int ITERATIONS = 1000; Jedis subscriber1 = new Jedis("localhost", ports[0]); Jedis subscriber2 = new Jedis("localhost", ports[1]); CountDownLatch latch = new CountDownLatch(2); MockSubscriber mockSubscriber1 = new MockSubscriber(latch); MockSubscriber mockSubscriber2 = new MockSubscriber(latch); Future<Void> subscriber1Future = executor.submit( () -> subscriber1.subscribe(mockSubscriber1, CHANNEL_NAME)); Future<Void> subscriber2Future = executor.submit( () -> subscriber2.subscribe(mockSubscriber2, CHANNEL_NAME)); assertThat(latch.await(30, TimeUnit.SECONDS)) .as("channel subscription was not received") .isTrue(); List<Future<Void>> futures = new LinkedList<>(); for (int i = 0; i < CLIENT_COUNT; i++) { Jedis client = new Jedis("localhost", ports[i % 2]); Callable<Void> callable = () -> { for (int j = 0; j < ITERATIONS; j++) { client.publish(CHANNEL_NAME, "hello"); } return null; }; futures.add(executor.submit(callable)); } for (Future<Void> future : futures) { GeodeAwaitility.await().untilAsserted(future::get); } mockSubscriber1.unsubscribe(CHANNEL_NAME); mockSubscriber2.unsubscribe(CHANNEL_NAME); GeodeAwaitility.await().untilAsserted(subscriber1Future::get); GeodeAwaitility.await().untilAsserted(subscriber2Future::get); assertThat(mockSubscriber1.getReceivedMessages().size()).isEqualTo(CLIENT_COUNT * ITERATIONS); assertThat(mockSubscriber2.getReceivedMessages().size()).isEqualTo(CLIENT_COUNT * ITERATIONS); }
Source:
public void testIsAttached() { UI ui = new UI(); Assert.assertTrue(ui.isAttached()); TestComponentContainer parent = new TestComponentContainer(); TestComponentContainer child = new TestComponentContainer(); TestComponent grandChild = new TestComponent(); child.track(); grandChild.addAttachListener( event -> Assert.assertTrue(grandChild.isAttached())); grandChild.addDetachListener( event -> grandChild.getDetachEvents().incrementAndGet()); parent.add(child); child.add(grandChild); Assert.assertFalse(parent.isAttached()); Assert.assertFalse(child.isAttached()); Assert.assertFalse(grandChild.isAttached()); ui.add(parent); Assert.assertTrue(parent.isAttached()); Assert.assertTrue(child.isAttached()); Assert.assertTrue(grandChild.isAttached()); ui.remove(parent); Assert.assertFalse(parent.isAttached()); Assert.assertFalse(child.isAttached()); Assert.assertFalse(grandChild.isAttached()); ui.add(parent); Assert.assertTrue(parent.isAttached()); Assert.assertTrue(child.isAttached()); Assert.assertTrue(grandChild.isAttached()); ui.close(); Assert.assertTrue(parent.isAttached()); Assert.assertTrue(child.isAttached()); Assert.assertTrue(grandChild.isAttached()); }

Target:
public void testIsAttached() { UI ui = new UI(); Assert.assertTrue(ui.isAttached()); TestComponentContainer parent = new TestComponentContainer(); TestComponentContainer child = new TestComponentContainer(); TestComponent grandChild = new TestComponent(); child.track(); grandChild.addAttachListener( event -> Assert.assertTrue(grandChild.isAttached())); grandChild.addDetachListener( event -> grandChild.getDetachEvents().incrementAndGet()); parent.add(child); child.add(grandChild); Assert.assertFalse(parent.isAttached()); Assert.assertFalse(child.isAttached()); Assert.assertFalse(grandChild.isAttached()); ui.add(parent); Assert.assertTrue(parent.isAttached()); Assert.assertTrue(child.isAttached()); Assert.assertTrue(grandChild.isAttached()); ui.remove(parent); Assert.assertFalse(parent.isAttached()); Assert.assertFalse(child.isAttached()); Assert.assertFalse(grandChild.isAttached()); ui.add(parent); Assert.assertTrue(parent.isAttached()); Assert.assertTrue(child.isAttached()); Assert.assertTrue(grandChild.isAttached()); ui.getInternals().setSession(Mockito.mock(VaadinSession.class)); ui.close(); ui.getInternals().setSession(null); Assert.assertFalse(parent.isAttached()); Assert.assertFalse(child.isAttached()); Assert.assertFalse(grandChild.isAttached()); Assert.assertFalse(ui.isAttached()); }
Source:
public static void initialize(final Initializer initializer) { ActivityTracker.get().beginTrackingIfPossible( (Application)initializer.mContext.getApplicationContext()); Thread listener = new Thread(LISTENER_THREAD_NAME) { @Override public void run() { LocalSocketHttpServer server = new LocalSocketHttpServer(initializer); try { server.run(); } catch (IOException e) { LogUtil.e(e, "Could not start Stetho"); } } }; listener.start(); }

Target:
public static void initialize(final Initializer initializer) { boolean isTrackingActivities = ActivityTracker.get().beginTrackingIfPossible( (Application)initializer.mContext.getApplicationContext()); if (!isTrackingActivities) { LogUtil.w("Automatic activity tracking not available on this API level, caller must invoke " + "ActivityTracker methods manually!"); } Thread listener = new Thread(LISTENER_THREAD_NAME) { @Override public void run() { LocalSocketHttpServer server = new LocalSocketHttpServer(initializer); try { server.run(); } catch (IOException e) { LogUtil.e(e, "Could not start Stetho"); } } }; listener.start(); }
Source:
public String[] getCompletion(String wordPart) { if (wordPart == null || wordPart.isEmpty()) { return EMPTY_COMPLETION_LIST; } List<String> list = new ArrayList<String>(); for (String osName : OsRepositoryImpl.INSTANCE.getOsNames().values()) { if (osName.startsWith(wordPart)) { list.add(osName); } } return list.toArray(new String[]{}); }

Target:
public String[] getCompletion(String wordPart) { if (wordPart == null || wordPart.isEmpty()) { return EMPTY_COMPLETION_LIST; } List<String> list = new ArrayList<String>(); for (String osName : map.values()) { if (osName.startsWith(wordPart)) { list.add(osName); } } return list.toArray(new String[]{}); }
Source:
public AtsDsl getContents(String uri, String xTextData) throws Exception { AtsDslStandaloneSetup setup = new AtsDslStandaloneSetup(); Injector injector = setup.createInjectorAndDoEMFRegistration(); XtextResourceSet set = injector.getInstance(XtextResourceSet.class); set.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE); resource = set.createResource(URI.createURI(uri)); resource.load(new ByteArrayInputStream(xTextData.getBytes("UTF-8")), set.getLoadOptions()); EList<EObject> contents = resource.getContents(); if (contents.size() == 1) { return (AtsDsl) contents.get(0); } else { return AtsDslFactoryImpl.init().createAtsDsl(); } }

Target:
public AtsDsl getContents(String uri, String xTextData) throws Exception { AtsDslStandaloneSetup setup = new AtsDslStandaloneSetup(); Injector injector = setup.createInjectorAndDoEMFRegistration(); XtextResourceSet set = injector.getInstance(XtextResourceSet.class); set.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE); resource = set.createResource(URI.createURI(uri)); resource.load(new ByteArrayInputStream(xTextData.getBytes("UTF-8")), set.getLoadOptions()); EList<EObject> contents = resource.getContents(); if (contents.size() == 1) { return (AtsDsl) contents.get(0); } else if (contents.isEmpty()) { return AtsDslFactoryImpl.init().createAtsDsl(); } else { throw new OseeArgumentException("Unexpected contents size > 1 in AtsDslResourceProvicer", contents.toString()); } }
Source:
public ReactorSession(Session session, SessionHandler sessionHandler, String sessionName, ReactorProvider provider, ReactorHandlerProvider handlerProvider, Mono<ClaimsBasedSecurityNode> cbsNodeSupplier, TokenManagerProvider tokenManagerProvider, MessageSerializer messageSerializer, Duration openTimeout, AmqpRetryPolicy retryPolicy) { this(session, sessionHandler, sessionName, provider, handlerProvider, cbsNodeSupplier, tokenManagerProvider, messageSerializer, openTimeout); this.retryPolicy = retryPolicy; }

Target:
public ReactorSession(Session session, SessionHandler sessionHandler, String sessionName, ReactorProvider provider, ReactorHandlerProvider handlerProvider, Mono<ClaimsBasedSecurityNode> cbsNodeSupplier, TokenManagerProvider tokenManagerProvider, MessageSerializer messageSerializer, Duration openTimeout, AmqpRetryPolicy retryPolicy) { this.session = session; this.sessionHandler = sessionHandler; this.handlerProvider = handlerProvider; this.sessionName = sessionName; this.provider = provider; this.cbsNodeSupplier = cbsNodeSupplier; this.tokenManagerProvider = tokenManagerProvider; this.messageSerializer = messageSerializer; this.openTimeout = openTimeout; this.retryPolicy = retryPolicy; this.subscriptions = Disposables.composite( this.sessionHandler.getEndpointStates().subscribe( state -> { logger.verbose("Connection state: {}", state); endpointStateSink.next(AmqpEndpointStateUtil.getConnectionState(state)); }, error -> { logger.error("[{}] Error occurred in session endpoint handler.", sessionName, error); endpointStateSink.error(error); dispose(); }, () -> { endpointStateSink.next(AmqpEndpointState.CLOSED); endpointStateSink.complete(); dispose(); }), this.sessionHandler.getErrors().subscribe(error -> { logger.error("[{}] Error occurred in session error handler.", sessionName, error); endpointStateSink.error(error); dispose(); })); session.open(); }