From b0c382841d7501a52bb577b33354dbdbab197bf2 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 2 Oct 2025 13:51:08 -0700 Subject: [PATCH 1/3] Return Set> from Module "get test" methods --- .../announcements/AnnouncementModule.java | 4 +-- api/src/org/labkey/api/ApiModule.java | 4 +-- .../api/audit/AbstractAuditTypeProvider.java | 8 +----- .../org/labkey/api/data/NameGenerator.java | 5 ++-- .../api/data/generator/DataGenerator.java | 4 +-- .../labkey/api/exp/api/ExperimentService.java | 2 +- .../labkey/api/exp/api/ObjectReferencer.java | 2 +- .../labkey/api/exp/api/SampleTypeService.java | 21 ++++++++-------- .../labkey/api/exp/query/SamplesSchema.java | 2 +- .../org/labkey/api/module/DefaultModule.java | 6 ++--- api/src/org/labkey/api/module/MockModule.java | 6 ++--- api/src/org/labkey/api/module/Module.java | 10 +++++--- .../api/module/SimpleWebPartFactory.java | 4 +-- .../SecurityEscalationAuditProvider.java | 5 ---- .../StudySecurityEscalationAuditProvider.java | 10 ++++---- .../api/view/DefaultWebPartFactory.java | 2 +- .../labkey/api/view/SimpleWebPartFactory.java | 4 +-- assay/src/org/labkey/assay/AssayModule.java | 4 +-- .../assay/view/AssayBaseWebPartFactory.java | 8 +++--- .../assay/view/AssayListWebPartFactory.java | 4 +-- core/src/org/labkey/core/CoreModule.java | 8 +++--- .../labkey/experiment/ExperimentModule.java | 10 +++----- .../ExperimentRunWebPartFactory.java | 4 +-- .../experiment/api/ExperimentServiceImpl.java | 10 ++++---- .../experiment/api/SampleTypeServiceImpl.java | 5 ++-- .../labkey/filecontent/FileContentModule.java | 3 +-- issues/src/org/labkey/issue/IssuesModule.java | 3 +-- list/src/org/labkey/list/ListModule.java | 3 +-- .../list/view/SingleListWebPartFactory.java | 4 +-- .../labkey/mothership/MothershipModule.java | 3 +-- .../org/labkey/pipeline/PipelineModule.java | 6 ++--- .../labkey/query/DataViewsWebPartFactory.java | 3 +-- .../query/QueryBrowserWebPartFactory.java | 4 +-- query/src/org/labkey/query/QueryModule.java | 6 ++--- .../query/reports/ReportsWebPartFactory.java | 4 +-- .../query/view/QueryWebPartFactory.java | 4 +-- .../src/org/labkey/search/SearchModule.java | 3 +-- .../search/view/SearchWebPartFactory.java | 4 +-- .../org/labkey/specimen/SpecimenModule.java | 5 ++-- .../view/SpecimenReportWebPartFactory.java | 2 +- .../view/SpecimenSearchWebPartFactory.java | 2 +- .../specimen/view/SpecimenWebPartFactory.java | 2 +- .../api/study/view/ToolsWebPartFactory.java | 2 +- .../labkey/study/StudyContainerListener.java | 2 +- study/src/org/labkey/study/StudyModule.java | 25 +++++++++---------- .../controllers/SharedStudyController.java | 2 +- .../study/view/StudyListWebPartFactory.java | 6 ++--- .../view/StudySummaryWebPartFactory.java | 4 +-- .../view/SubjectDetailsWebPartFactory.java | 2 +- .../labkey/studydesign/StudyDesignModule.java | 13 +++++----- .../view/AssayScheduleWebpartFactory.java | 2 +- .../ImmunizationScheduleWebpartFactory.java | 2 +- .../view/VaccineDesignWebpartFactory.java | 2 +- .../src/org/labkey/survey/SurveyModule.java | 7 +++--- .../visualization/VisualizationModule.java | 9 +++---- .../labkey/wiki/MenuWikiWebPartFactory.java | 2 +- wiki/src/org/labkey/wiki/WikiModule.java | 7 +----- wiki/src/org/labkey/wiki/WikiTOCFactory.java | 6 ++--- .../org/labkey/wiki/WikiWebPartFactory.java | 4 +-- 59 files changed, 133 insertions(+), 177 deletions(-) diff --git a/announcements/src/org/labkey/announcements/AnnouncementModule.java b/announcements/src/org/labkey/announcements/AnnouncementModule.java index cba6cd56997..2be171e4985 100644 --- a/announcements/src/org/labkey/announcements/AnnouncementModule.java +++ b/announcements/src/org/labkey/announcements/AnnouncementModule.java @@ -200,8 +200,7 @@ public void startBackgroundThreads() } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( AnnouncementManager.TestCase.class @@ -228,7 +227,6 @@ public Collection getSummary(Container c) return list; } - @Override public void enumerateDocuments(SearchService.TaskIndexingQueue queue, final Date modifiedSince) { diff --git a/api/src/org/labkey/api/ApiModule.java b/api/src/org/labkey/api/ApiModule.java index cfd324365d7..b28cf36e71d 100644 --- a/api/src/org/labkey/api/ApiModule.java +++ b/api/src/org/labkey/api/ApiModule.java @@ -361,7 +361,7 @@ public void registerServlets(ServletContext servletCtx) } @Override - public @NotNull Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( Aggregate.TestCase.class, @@ -458,7 +458,7 @@ public void registerServlets(ServletContext servletCtx) } @Override - public @NotNull Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( AbstractAuditDomainKind.TestCase.class, diff --git a/api/src/org/labkey/api/audit/AbstractAuditTypeProvider.java b/api/src/org/labkey/api/audit/AbstractAuditTypeProvider.java index c9a804f1c33..ff5fdfdc722 100644 --- a/api/src/org/labkey/api/audit/AbstractAuditTypeProvider.java +++ b/api/src/org/labkey/api/audit/AbstractAuditTypeProvider.java @@ -85,12 +85,6 @@ public abstract class AbstractAuditTypeProvider implements AuditTypeProvider private final AbstractAuditDomainKind _domainKind; - @Deprecated // Call the other constructor and stop overriding getDomainKind() - public AbstractAuditTypeProvider() - { - this(null); - } - public AbstractAuditTypeProvider(@NotNull AbstractAuditDomainKind domainKind) { // TODO: consolidate domain kind initialization to this constructor and stop overriding getDomainKind() @@ -99,7 +93,7 @@ public AbstractAuditTypeProvider(@NotNull AbstractAuditDomainKind domainKind) PropertyService.get().registerDomainKind(getDomainKind()); } - protected AbstractAuditDomainKind getDomainKind() + protected final AbstractAuditDomainKind getDomainKind() { if (_domainKind == null) throw new IllegalStateException(String.format("The audit type : \"%s\" has a null domain kind", getLabel())); diff --git a/api/src/org/labkey/api/data/NameGenerator.java b/api/src/org/labkey/api/data/NameGenerator.java index c26de6cf404..3d76477eeed 100644 --- a/api/src/org/labkey/api/data/NameGenerator.java +++ b/api/src/org/labkey/api/data/NameGenerator.java @@ -43,7 +43,6 @@ import org.labkey.api.query.QueryService; import org.labkey.api.query.UserSchema; import org.labkey.api.query.ValidationException; -import org.labkey.api.reader.TabLoader; import org.labkey.api.security.User; import org.labkey.api.util.GUID; import org.labkey.api.util.JunitUtil; @@ -919,7 +918,7 @@ else if (ancestorPaths != null && !ancestorPaths.isEmpty()) dataTypes.add(sampleType); } else - dataTypes.addAll(SampleTypeService.get().getSampleTypes(_container, user, true)); + dataTypes.addAll(SampleTypeService.get().getSampleTypes(_container, true)); } if (isData) { @@ -1122,7 +1121,7 @@ private void initialize(@Nullable Map importAliasesMap) } - for (ExpSampleType sampleType : SampleTypeService.get().getSampleTypes(_container, user, true)) + for (ExpSampleType sampleType : SampleTypeService.get().getSampleTypes(_container, true)) { sampleTypeLSIDs.put(sampleType.getName(), sampleType.getLSID()); sampleTypeNames.put(sampleType.getLSID(), sampleType.getName()); diff --git a/api/src/org/labkey/api/data/generator/DataGenerator.java b/api/src/org/labkey/api/data/generator/DataGenerator.java index edfd0055ec0..4e02ba7b802 100644 --- a/api/src/org/labkey/api/data/generator/DataGenerator.java +++ b/api/src/org/labkey/api/data/generator/DataGenerator.java @@ -217,7 +217,7 @@ public List getSampleTypes(List sampleTypeNames { SampleTypeService service = SampleTypeService.get(); if (sampleTypeNames.isEmpty()) - _sampleTypes.addAll(service.getSampleTypes(getContainer(), getUser(), false)); + _sampleTypes.addAll(service.getSampleTypes(getContainer(), false)); else { for (String typeName : sampleTypeNames) @@ -345,7 +345,7 @@ public void generateSamplesForAllTypes() throws SQLException, BatchValidationExc boolean hasParentTypes = !parentTypes.isEmpty(); // Default to using all types in the container if (!hasParentTypes) - parentTypes.addAll(SampleTypeService.get().getSampleTypes(getContainer(), getUser(), false).stream().map(ExpSampleType::getName).toList()); + parentTypes.addAll(SampleTypeService.get().getSampleTypes(getContainer(), false).stream().map(ExpSampleType::getName).toList()); List dataClassParents = new ArrayList<>(config.getDataClassParents()); // Default to using all types in the container if (dataClassParents.isEmpty()) diff --git a/api/src/org/labkey/api/exp/api/ExperimentService.java b/api/src/org/labkey/api/exp/api/ExperimentService.java index 5c6a0141513..40d9651fd26 100644 --- a/api/src/org/labkey/api/exp/api/ExperimentService.java +++ b/api/src/org/labkey/api/exp/api/ExperimentService.java @@ -939,7 +939,7 @@ ExpRun derive( List getObjectReferencers(); @NotNull - String getObjectReferenceDescription(Class referencedClass); + String getObjectReferenceDescription(Class referencedClass); @Nullable ProtocolImplementation getProtocolImplementation(String name); diff --git a/api/src/org/labkey/api/exp/api/ObjectReferencer.java b/api/src/org/labkey/api/exp/api/ObjectReferencer.java index 09e48972145..56ab66d0479 100644 --- a/api/src/org/labkey/api/exp/api/ObjectReferencer.java +++ b/api/src/org/labkey/api/exp/api/ObjectReferencer.java @@ -15,5 +15,5 @@ default Collection getItemsWithReferences(Collection referencedRowId @NotNull Collection getItemsWithReferences(Collection referencedRowIds, @NotNull String referencedSchemaName, @Nullable String referencedQueryName); @Nullable - String getObjectReferenceDescription(Class referencedClass); + String getObjectReferenceDescription(Class referencedClass); } diff --git a/api/src/org/labkey/api/exp/api/SampleTypeService.java b/api/src/org/labkey/api/exp/api/SampleTypeService.java index bcfbb85c86c..b8835321c30 100644 --- a/api/src/org/labkey/api/exp/api/SampleTypeService.java +++ b/api/src/org/labkey/api/exp/api/SampleTypeService.java @@ -165,35 +165,34 @@ ExpSampleType createSampleType(Container c, User u, String name, String descript @Nullable DataState getSampleState(Container container, Long stateRowId); - void removeAutoLinkedStudy(@NotNull Container studyContainer, @Nullable User user); + void removeAutoLinkedStudy(@NotNull Container studyContainer); /** * @param includeOtherContainers whether sample types from the shared container or the container's project should be included */ - // TODO: Remove user parameter (not used) - List getSampleTypes(@NotNull Container container, @Nullable User user, boolean includeOtherContainers); + List getSampleTypes(@NotNull Container container, boolean includeOtherContainers); /** * Get a SampleType by name within the definition container. */ ExpSampleType getSampleType(@NotNull Container definitionContainer, @NotNull String sampleTypeName); + /** + * Get a SampleType by name within scope -- current, project, and shared. + * Requires a user to check for container read permission. + */ + // TODO: Remove user parameter (not used) + ExpSampleType getSampleType(@NotNull Container scope, @NotNull User user, @NotNull String sampleTypeName); + /** Get the sample type with name at a specific time */ @Nullable - // TODO: Remove user parameter (not used) - ExpSampleType getEffectiveSampleType(@NotNull Container definitionContainer, @NotNull User user, @NotNull String sampleTypeName, @NotNull Date effectDate, @Nullable ContainerFilter cf); + ExpSampleType getEffectiveSampleType(@NotNull Container definitionContainer, @NotNull String sampleTypeName, @NotNull Date effectDate, @Nullable ContainerFilter cf); /** * Return the sample type for this LSID, optionally pass Container hint for performance */ ExpSampleType getSampleTypeByType(@NotNull String lsid, Container hint); - /** - * Get a SampleType by name within scope -- current, project, and shared. - * Requires a user to check for container read permission. - */ - ExpSampleType getSampleType(@NotNull Container scope, @NotNull User user, @NotNull String sampleTypeName); - /** * Get a SampleType by rowId within the definition container. */ diff --git a/api/src/org/labkey/api/exp/query/SamplesSchema.java b/api/src/org/labkey/api/exp/query/SamplesSchema.java index 7a09eade671..c1e7412b208 100644 --- a/api/src/org/labkey/api/exp/query/SamplesSchema.java +++ b/api/src/org/labkey/api/exp/query/SamplesSchema.java @@ -77,7 +77,7 @@ static private Map getSampleTypeMap(Container container, { Map map = new CaseInsensitiveTreeMap<>(); // User can be null if we're running in a background thread, such as doing a study export - for (ExpSampleType st : SampleTypeService.get().getSampleTypes(container, user, user != null)) + for (ExpSampleType st : SampleTypeService.get().getSampleTypes(container, user != null)) { map.put(st.getName(), st); } diff --git a/api/src/org/labkey/api/module/DefaultModule.java b/api/src/org/labkey/api/module/DefaultModule.java index f370c77b9ad..8935a9d88df 100644 --- a/api/src/org/labkey/api/module/DefaultModule.java +++ b/api/src/org/labkey/api/module/DefaultModule.java @@ -494,15 +494,13 @@ protected void addWebPart(String name, Container c, @Nullable String location, i } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Collections.emptySet(); } @Override - @NotNull - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Collections.emptySet(); } diff --git a/api/src/org/labkey/api/module/MockModule.java b/api/src/org/labkey/api/module/MockModule.java index 3852d1060dc..84e7b1215d4 100644 --- a/api/src/org/labkey/api/module/MockModule.java +++ b/api/src/org/labkey/api/module/MockModule.java @@ -232,15 +232,13 @@ public TabDisplayMode getTabDisplayMode() } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Collections.emptySet(); } @Override - @NotNull - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Collections.emptySet(); } diff --git a/api/src/org/labkey/api/module/Module.java b/api/src/org/labkey/api/module/Module.java index b732fa4f7de..cf938f6e959 100644 --- a/api/src/org/labkey/api/module/Module.java +++ b/api/src/org/labkey/api/module/Module.java @@ -236,11 +236,12 @@ default void startBackgroundThreads() * Modules can provide JUnit tests that must be run inside the server * VM. These tests will be executed as part of the DRT. These are not true unit tests, and may rely on external * resources such as a database connection or services provided by other modules. + * * @return the integration tests that this module provides */ - @NotNull @JsonIgnore - Set getIntegrationTests(); + @NotNull + Set> getIntegrationTests(); /** * Modules can provide JUnit tests that must be run inside the server @@ -258,11 +259,12 @@ default void startBackgroundThreads() /** * Modules can provide JUnit tests that can be run independent of the server VM. Satisfies the requirements for a * traditional unit test. + * * @return the unit tests that this module provides */ - @NotNull @JsonIgnore - Set getUnitTests(); + @NotNull + Set> getUnitTests(); /** * Returns a set of schemas that the module wants tested. The DbSchema junit test calls this and ensures that the diff --git a/api/src/org/labkey/api/module/SimpleWebPartFactory.java b/api/src/org/labkey/api/module/SimpleWebPartFactory.java index 102c1038672..0aa077c6e1d 100644 --- a/api/src/org/labkey/api/module/SimpleWebPartFactory.java +++ b/api/src/org/labkey/api/module/SimpleWebPartFactory.java @@ -183,7 +183,7 @@ public String getViewName() @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) throws WebPartConfigurationException + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) throws WebPartConfigurationException { if (null != _loadException) throw new WebPartConfigurationException(this, "Error thrown during load", _loadException); @@ -191,7 +191,7 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta if (null == getViewName()) throw new WebPartConfigurationException(this, "No view name specified for the module web part defined in " + _resourceName); - WebPartView ret = ModuleHtmlView.get(getModule(), ModuleHtmlView.getStandardPath(getViewName()), webPart); + WebPartView ret = ModuleHtmlView.get(getModule(), ModuleHtmlView.getStandardPath(getViewName()), webPart); if (null != _webPartDef && null != _webPartDef.getView()) { if (null != _webPartDef.getView().getFrame()) diff --git a/api/src/org/labkey/api/study/security/SecurityEscalationAuditProvider.java b/api/src/org/labkey/api/study/security/SecurityEscalationAuditProvider.java index f15b48b5ad4..0e0256e87e3 100644 --- a/api/src/org/labkey/api/study/security/SecurityEscalationAuditProvider.java +++ b/api/src/org/labkey/api/study/security/SecurityEscalationAuditProvider.java @@ -50,11 +50,6 @@ */ public abstract class SecurityEscalationAuditProvider extends AbstractAuditTypeProvider implements AuditTypeProvider { - protected SecurityEscalationAuditProvider() - { - super(); - } - protected SecurityEscalationAuditProvider(AbstractAuditDomainKind dk) { super(dk); diff --git a/api/src/org/labkey/api/study/security/StudySecurityEscalationAuditProvider.java b/api/src/org/labkey/api/study/security/StudySecurityEscalationAuditProvider.java index d3393974337..62d6d7721be 100644 --- a/api/src/org/labkey/api/study/security/StudySecurityEscalationAuditProvider.java +++ b/api/src/org/labkey/api/study/security/StudySecurityEscalationAuditProvider.java @@ -25,6 +25,11 @@ public class StudySecurityEscalationAuditProvider extends SecurityEscalationAudi public static String EVENT_TYPE = StudySecurityEscalationEvent.class.getSimpleName(); public static String AUDIT_LOG_TITLE = "Study Security Escalations"; + public StudySecurityEscalationAuditProvider() + { + super(new StudySecurityEscalationDomainKind()); + } + @Override public String getDescription() { return "This audits all uses of the Study Security Escalation"; @@ -45,11 +50,6 @@ public String getAuditLogTitle() { return AUDIT_LOG_TITLE; } - public StudySecurityEscalationAuditProvider() - { - super(new StudySecurityEscalationDomainKind()); - } - public static class StudySecurityEscalationEvent extends SecurityEscalationEvent { /** Important for reflection-based instantiation */ diff --git a/api/src/org/labkey/api/view/DefaultWebPartFactory.java b/api/src/org/labkey/api/view/DefaultWebPartFactory.java index c4dd9de1369..0ddb79ecf81 100644 --- a/api/src/org/labkey/api/view/DefaultWebPartFactory.java +++ b/api/src/org/labkey/api/view/DefaultWebPartFactory.java @@ -43,7 +43,7 @@ public DefaultWebPartFactory(String name, Class cls, @Not } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { if (!portalCtx.hasPermission(ReadPermission.class)) return new HtmlView("Not Authorized", HtmlString.of(portalCtx.getUser().isGuest() ? "Please log in to see this data." : "You do not have permission to see this data")); diff --git a/api/src/org/labkey/api/view/SimpleWebPartFactory.java b/api/src/org/labkey/api/view/SimpleWebPartFactory.java index b1dd9724b24..dcd599af9b4 100644 --- a/api/src/org/labkey/api/view/SimpleWebPartFactory.java +++ b/api/src/org/labkey/api/view/SimpleWebPartFactory.java @@ -131,7 +131,7 @@ ModelAndView newInstance(ViewContext portalCtx, Portal.WebPart wp, Object form, @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { Object form = null; BindException errors = null; @@ -154,7 +154,7 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta if (view instanceof HttpView && _formClass != null) ((HttpView)view).setModelBean(form); if (view instanceof WebPartView) - return (WebPartView)view; + return (WebPartView)view; VBox v = new VBox(view); v.setTitle(getName()); return v; diff --git a/assay/src/org/labkey/assay/AssayModule.java b/assay/src/org/labkey/assay/AssayModule.java index df2a12ed944..8f71db6fc29 100644 --- a/assay/src/org/labkey/assay/AssayModule.java +++ b/assay/src/org/labkey/assay/AssayModule.java @@ -327,7 +327,7 @@ public Set getProvisionedSchemaNames() } @Override - public @NotNull Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( ModuleAssayCache.TestCase.class, @@ -345,7 +345,7 @@ public Set getProvisionedSchemaNames() } @Override - public @NotNull Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( TsvAssayProvider.TestCase.class, diff --git a/assay/src/org/labkey/assay/view/AssayBaseWebPartFactory.java b/assay/src/org/labkey/assay/view/AssayBaseWebPartFactory.java index 248bc596480..fbce012276a 100644 --- a/assay/src/org/labkey/assay/view/AssayBaseWebPartFactory.java +++ b/assay/src/org/labkey/assay/view/AssayBaseWebPartFactory.java @@ -87,7 +87,7 @@ public static Long getProtocolId(Portal.WebPart webPart) // } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { Long protocolId = getProtocolId(webPart); ProtocolIdForm protocolIdForm = new ProtocolIdForm(); @@ -97,7 +97,7 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta boolean showButtons = Boolean.parseBoolean(webPart.getPropertyMap().get(SHOW_BUTTONS_KEY)); ExpProtocol protocol; - WebPartView view; + WebPartView view; try { protocol = protocolIdForm.getProtocol(true); @@ -113,7 +113,7 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta return view; } - public abstract WebPartView getWebPartView(ViewContext portalCtx, Portal.WebPart webPart, ExpProtocol protocol, boolean showButtons); + public abstract WebPartView getWebPartView(ViewContext portalCtx, Portal.WebPart webPart, ExpProtocol protocol, boolean showButtons); public abstract String getDescription(); @@ -124,7 +124,7 @@ public static class EditViewBean } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { EditViewBean bean = new EditViewBean(); bean.description = getDescription(); diff --git a/assay/src/org/labkey/assay/view/AssayListWebPartFactory.java b/assay/src/org/labkey/assay/view/AssayListWebPartFactory.java index 29a8b53a5cc..96e8f11a932 100644 --- a/assay/src/org/labkey/assay/view/AssayListWebPartFactory.java +++ b/assay/src/org/labkey/assay/view/AssayListWebPartFactory.java @@ -37,9 +37,9 @@ public AssayListWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { - WebPartView listView = AssayService.get().createAssayListView(portalCtx, true, null); + WebPartView listView = AssayService.get().createAssayListView(portalCtx, true, null); ActionURL url = PageFlowUtil.urlProvider(AssayUrls.class).getBeginURL(portalCtx.getContainer()); listView.setTitle("Assay List"); listView.setTitleHref(url); diff --git a/core/src/org/labkey/core/CoreModule.java b/core/src/org/labkey/core/CoreModule.java index 6412aaa88a0..6414f3b94f4 100644 --- a/core/src/org/labkey/core/CoreModule.java +++ b/core/src/org/labkey/core/CoreModule.java @@ -1516,11 +1516,10 @@ public TabDisplayMode getTabDisplayMode() } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { // Must be mutable since we add the dialect tests below - Set testClasses = Sets.newHashSet + Set> testClasses = Sets.newHashSet ( AdminController.SchemaVersionTestCase.class, AdminController.SerializationTest.class, @@ -1561,9 +1560,8 @@ public Set getIntegrationTests() return testClasses; } - @NotNull @Override - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( ApiJsonWriter.TestCase.class, diff --git a/experiment/src/org/labkey/experiment/ExperimentModule.java b/experiment/src/org/labkey/experiment/ExperimentModule.java index 33f47d8c275..61e7105210d 100644 --- a/experiment/src/org/labkey/experiment/ExperimentModule.java +++ b/experiment/src/org/labkey/experiment/ExperimentModule.java @@ -932,7 +932,7 @@ public Collection getSummary(Container c) if (dataClassCount > 0) list.add(dataClassCount + " Data Class" + (dataClassCount > 1 ? "es" : "")); - int sampleTypeCount = SampleTypeService.get().getSampleTypes(c, null, false).size(); + int sampleTypeCount = SampleTypeService.get().getSampleTypes(c, false).size(); if (sampleTypeCount > 0) list.add(sampleTypeCount + " Sample Type" + (sampleTypeCount > 1 ? "s" : "")); @@ -986,7 +986,7 @@ public Collection getSummary(Container c) } // Sample Types - int sampleTypeCount = SampleTypeService.get().getSampleTypes(c, null, false).size(); + int sampleTypeCount = SampleTypeService.get().getSampleTypes(c, false).size(); if (sampleTypeCount > 0) summaries.add(new Summary(sampleTypeCount, "Sample Type")); @@ -1023,8 +1023,7 @@ public Collection getSummary(Container c) } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( DomainImpl.TestCase.class, @@ -1055,9 +1054,8 @@ public Set getIntegrationTests() return list; } - @NotNull @Override - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( GraphAlgorithms.TestCase.class, diff --git a/experiment/src/org/labkey/experiment/ExperimentRunWebPartFactory.java b/experiment/src/org/labkey/experiment/ExperimentRunWebPartFactory.java index 30bbaba87de..04c55c62469 100644 --- a/experiment/src/org/labkey/experiment/ExperimentRunWebPartFactory.java +++ b/experiment/src/org/labkey/experiment/ExperimentRunWebPartFactory.java @@ -76,14 +76,14 @@ public Set getTypes() } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { Set types = ExperimentService.get().getExperimentRunTypes(context.getContainer()); return new JspView<>("/org/labkey/experiment/customizeRunWebPart.jsp", new Bean(types, getConfiguredRunFilterName(webPart))); } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { String selectedTypeName = getConfiguredRunFilterName(webPart); Set types = ExperimentService.get().getExperimentRunTypes(portalCtx.getContainer()); diff --git a/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java b/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java index d1441d648b5..cb67b95ded2 100644 --- a/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java @@ -1670,7 +1670,7 @@ public String generateGuidLSID(Container container, DataType type) } @Override - public Pair generateLSIDWithDBSeq(@NotNull Container container, DataType type) + public Pair generateLSIDWithDBSeq(@NotNull Container container, @NotNull DataType type) { return generateLSIDWithDBSeq(container, type.getNamespacePrefix()); } @@ -3200,7 +3200,7 @@ else if ("samples".equalsIgnoreCase(referencedSchemaName)) } @Override - public @NotNull String getObjectReferenceDescription(Class referencedClass) + public @NotNull String getObjectReferenceDescription(Class referencedClass) { if (referencedClass != ExpRun.class) return "derived data or sample dependencies"; @@ -5519,7 +5519,7 @@ public void deleteAllExpObjInContainer(Container c, User user) throws Experiment int[] runIds = ArrayUtils.toPrimitive(new SqlSelector(getExpSchema(), sql, c).getArray(Integer.class)); List exps = getExperiments(c, false, true, true); - List sampleTypes = ((SampleTypeServiceImpl) SampleTypeService.get()).getSampleTypes(c, user, false); + List sampleTypes = ((SampleTypeServiceImpl) SampleTypeService.get()).getSampleTypes(c, false); List dataClasses = getDataClasses(c, user, false); sql = "SELECT RowId FROM " + getTinfoProtocol() + " WHERE Container = ?"; @@ -9393,7 +9393,7 @@ private Map getNameExpressionMetrics() return new Pair<>(sampleTypes, dataClasses); String targetInputType = (isSampleParent ? MATERIAL_INPUTS_ALIAS_PREFIX : DATA_INPUTS_ALIAS_PREFIX) + parentDataTypeName; - for (ExpSampleType sampleType : SampleTypeService.get().getSampleTypes(container, user, true)) + for (ExpSampleType sampleType : SampleTypeService.get().getSampleTypes(container, true)) { try { @@ -9941,7 +9941,7 @@ public int moveAuditEvents(Container targetContainer, List runLsids) DbSchema dbSchema = ExperimentService.get().getSchema(); SqlDialect dialect = dbSchema.getSqlDialect(); UserSchema samplesUserSchema = QueryService.get().getUserSchema(user, container, SamplesSchema.SCHEMA_NAME); - List sampleTypes = SampleTypeServiceImpl.get().getSampleTypes(container, user, true); + List sampleTypes = SampleTypeServiceImpl.get().getSampleTypes(container, true); String unionAll = ""; SQLFragment query = new SQLFragment(); diff --git a/experiment/src/org/labkey/experiment/api/SampleTypeServiceImpl.java b/experiment/src/org/labkey/experiment/api/SampleTypeServiceImpl.java index f435673dcbc..097331515b0 100644 --- a/experiment/src/org/labkey/experiment/api/SampleTypeServiceImpl.java +++ b/experiment/src/org/labkey/experiment/api/SampleTypeServiceImpl.java @@ -420,7 +420,7 @@ public Map getSampleTypesForRoles(Container container, Co } @Override - public void removeAutoLinkedStudy(@NotNull Container studyContainer, @Nullable User user) + public void removeAutoLinkedStudy(@NotNull Container studyContainer) { SQLFragment sql = new SQLFragment("UPDATE ").append(getTinfoMaterialSource()) .append(" SET autolinkTargetContainer = NULL WHERE autolinkTargetContainer = ?") @@ -440,7 +440,6 @@ public ExpSampleTypeImpl getSampleTypeByObjectId(Long objectId) @Override public @Nullable ExpSampleType getEffectiveSampleType( @NotNull Container definitionContainer, - @NotNull User user, @NotNull String sampleTypeName, @NotNull Date effectiveDate, @Nullable ContainerFilter cf @@ -459,7 +458,7 @@ public ExpSampleTypeImpl getSampleTypeByObjectId(Long objectId) } @Override - public List getSampleTypes(@NotNull Container container, @Nullable User user, boolean includeOtherContainers) + public List getSampleTypes(@NotNull Container container, boolean includeOtherContainers) { List containerIds = ExperimentServiceImpl.get().createContainerList(container, includeOtherContainers); diff --git a/filecontent/src/org/labkey/filecontent/FileContentModule.java b/filecontent/src/org/labkey/filecontent/FileContentModule.java index 4efff13cafa..5b79bcfdd03 100644 --- a/filecontent/src/org/labkey/filecontent/FileContentModule.java +++ b/filecontent/src/org/labkey/filecontent/FileContentModule.java @@ -211,8 +211,7 @@ public Set getSchemaNames() } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( FileContentController.TestCase.class, diff --git a/issues/src/org/labkey/issue/IssuesModule.java b/issues/src/org/labkey/issue/IssuesModule.java index b6566050313..2962f2bb49e 100644 --- a/issues/src/org/labkey/issue/IssuesModule.java +++ b/issues/src/org/labkey/issue/IssuesModule.java @@ -187,8 +187,7 @@ public ActionURL getTabURL(Container c, User user) } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Collections.singleton(org.labkey.issue.model.IssueManager.TestCase.class); } diff --git a/list/src/org/labkey/list/ListModule.java b/list/src/org/labkey/list/ListModule.java index dfdf613d4c1..c98987eafd6 100644 --- a/list/src/org/labkey/list/ListModule.java +++ b/list/src/org/labkey/list/ListModule.java @@ -212,9 +212,8 @@ public Collection getProvisionedSchemaNames() return PageFlowUtil.set(ListSchema.getInstance().getSchemaName()); } - @NotNull @Override - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( ListManager.TestCase.class, diff --git a/list/src/org/labkey/list/view/SingleListWebPartFactory.java b/list/src/org/labkey/list/view/SingleListWebPartFactory.java index 1a89b5fa3e1..cbd512ee216 100644 --- a/list/src/org/labkey/list/view/SingleListWebPartFactory.java +++ b/list/src/org/labkey/list/view/SingleListWebPartFactory.java @@ -48,7 +48,7 @@ public SingleListWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { Map props = webPart.getPropertyMap(); @@ -89,7 +89,7 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { return new JspView<>("/org/labkey/list/view/customizeSingleListWebPart.jsp", webPart); } diff --git a/mothership/src/org/labkey/mothership/MothershipModule.java b/mothership/src/org/labkey/mothership/MothershipModule.java index 6c46f27395c..7fa597ab097 100644 --- a/mothership/src/org/labkey/mothership/MothershipModule.java +++ b/mothership/src/org/labkey/mothership/MothershipModule.java @@ -111,8 +111,7 @@ public Set getSchemaNames() } @Override - @NotNull - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return PageFlowUtil.set(ExceptionStackTrace.TestCase.class); } diff --git a/pipeline/src/org/labkey/pipeline/PipelineModule.java b/pipeline/src/org/labkey/pipeline/PipelineModule.java index d96856a7918..6482353c6b2 100644 --- a/pipeline/src/org/labkey/pipeline/PipelineModule.java +++ b/pipeline/src/org/labkey/pipeline/PipelineModule.java @@ -333,8 +333,7 @@ public void propertyChange(PropertyChangeEvent evt) @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( PipelineController.TestCase.class, @@ -347,8 +346,7 @@ public Set getIntegrationTests() } @Override - @NotNull - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( CommandLineTokenizer.TestCase.class, diff --git a/query/src/org/labkey/query/DataViewsWebPartFactory.java b/query/src/org/labkey/query/DataViewsWebPartFactory.java index 7227e5a2ea7..c7a45611626 100644 --- a/query/src/org/labkey/query/DataViewsWebPartFactory.java +++ b/query/src/org/labkey/query/DataViewsWebPartFactory.java @@ -56,7 +56,7 @@ public DataViewsWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { JspView view = new JspView<>("/org/labkey/query/reports/view/dataViews.jsp", webPart); view.setTitle("Data Views"); @@ -100,7 +100,6 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta menu.addChild(getItem(info, "Add ")); } - // We display the edit button for everyone with insert (Author, Editor, Admin). Other components are admin-only. if (portalCtx.hasPermission(InsertPermission.class)) { diff --git a/query/src/org/labkey/query/QueryBrowserWebPartFactory.java b/query/src/org/labkey/query/QueryBrowserWebPartFactory.java index 042485094db..101315fefa5 100644 --- a/query/src/org/labkey/query/QueryBrowserWebPartFactory.java +++ b/query/src/org/labkey/query/QueryBrowserWebPartFactory.java @@ -32,9 +32,9 @@ public QueryBrowserWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { - JspView view = new JspView<>("/org/labkey/query/view/browse.jsp"); + JspView view = new JspView<>("/org/labkey/query/view/browse.jsp"); view.setTitle(NAME); view.setFrame(WebPartView.FrameType.PORTAL); return view; diff --git a/query/src/org/labkey/query/QueryModule.java b/query/src/org/labkey/query/QueryModule.java index da8464e0b83..16f6c82957c 100644 --- a/query/src/org/labkey/query/QueryModule.java +++ b/query/src/org/labkey/query/QueryModule.java @@ -344,8 +344,7 @@ public Set getSchemaNames() } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( ModuleReportCache.TestCase.class, @@ -375,8 +374,7 @@ public Set getIntegrationTests() @Override - @NotNull - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( AggregateQueryDataTransform.TestCase.class, diff --git a/query/src/org/labkey/query/reports/ReportsWebPartFactory.java b/query/src/org/labkey/query/reports/ReportsWebPartFactory.java index 3a0b3597082..ccf0873ef13 100644 --- a/query/src/org/labkey/query/reports/ReportsWebPartFactory.java +++ b/query/src/org/labkey/query/reports/ReportsWebPartFactory.java @@ -45,7 +45,7 @@ public ReportsWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { ReportsWebPart wp = new ReportsWebPart(portalCtx, webPart); populateProperties(wp, webPart.getPropertyMap()); @@ -54,7 +54,7 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { return new ReportsWebPartConfig(webPart); } diff --git a/query/src/org/labkey/query/view/QueryWebPartFactory.java b/query/src/org/labkey/query/view/QueryWebPartFactory.java index 16eb7d1a41c..ebd56bafdaa 100644 --- a/query/src/org/labkey/query/view/QueryWebPartFactory.java +++ b/query/src/org/labkey/query/view/QueryWebPartFactory.java @@ -33,7 +33,7 @@ public QueryWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { QueryWebPart ret = new QueryWebPart(portalCtx, webPart); populateProperties(ret, webPart.getPropertyMap()); @@ -41,7 +41,7 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { return new JspView<>("/org/labkey/query/view/editQueryWebPart.jsp", webPart); } diff --git a/search/src/org/labkey/search/SearchModule.java b/search/src/org/labkey/search/SearchModule.java index 5812959640c..871c5991a21 100644 --- a/search/src/org/labkey/search/SearchModule.java +++ b/search/src/org/labkey/search/SearchModule.java @@ -246,9 +246,8 @@ private void reindexIfNeeded(@NotNull SearchService ss) } } - @NotNull @Override - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of ( diff --git a/search/src/org/labkey/search/view/SearchWebPartFactory.java b/search/src/org/labkey/search/view/SearchWebPartFactory.java index b8c3e5cf05b..dbb2572df00 100644 --- a/search/src/org/labkey/search/view/SearchWebPartFactory.java +++ b/search/src/org/labkey/search/view/SearchWebPartFactory.java @@ -41,7 +41,7 @@ public SearchWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { boolean includeSubfolders = includeSubfolders(webPart); @@ -57,7 +57,7 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { return new JspView<>("/org/labkey/search/view/customizeSearchWebPart.jsp", webPart); } diff --git a/specimen/src/org/labkey/specimen/SpecimenModule.java b/specimen/src/org/labkey/specimen/SpecimenModule.java index afdde6c73e6..02ad4f3b1b0 100644 --- a/specimen/src/org/labkey/specimen/SpecimenModule.java +++ b/specimen/src/org/labkey/specimen/SpecimenModule.java @@ -315,8 +315,7 @@ protected void startupAfterSpringConfig(ModuleContext moduleContext) } @Override - @NotNull - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( SpecimenWriter.TestCase.class @@ -330,7 +329,7 @@ public Set getUnitTests() } @Override - public @NotNull Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( SpecimenImporter.TestCase.class diff --git a/specimen/src/org/labkey/specimen/view/SpecimenReportWebPartFactory.java b/specimen/src/org/labkey/specimen/view/SpecimenReportWebPartFactory.java index 6eea9fc4c22..8c1ae4c6e48 100644 --- a/specimen/src/org/labkey/specimen/view/SpecimenReportWebPartFactory.java +++ b/specimen/src/org/labkey/specimen/view/SpecimenReportWebPartFactory.java @@ -67,7 +67,7 @@ private SpecimenVisitReportParameters getFactory(ViewContext context, Portal.Web } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { return new JspView<>("/org/labkey/specimen/view/customizeSpecimenReportWebPart.jsp", webPart); } diff --git a/specimen/src/org/labkey/specimen/view/SpecimenSearchWebPartFactory.java b/specimen/src/org/labkey/specimen/view/SpecimenSearchWebPartFactory.java index b820d41156d..977a814d182 100644 --- a/specimen/src/org/labkey/specimen/view/SpecimenSearchWebPartFactory.java +++ b/specimen/src/org/labkey/specimen/view/SpecimenSearchWebPartFactory.java @@ -19,7 +19,7 @@ public SpecimenSearchWebPartFactory(String position) } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { if (!portalCtx.hasPermission(ReadPermission.class)) return new HtmlView("Specimens", HtmlString.of(portalCtx.getUser().isGuest() ? "Please log in to see this data." : "You do not have permission to see this data")); diff --git a/specimen/src/org/labkey/specimen/view/SpecimenWebPartFactory.java b/specimen/src/org/labkey/specimen/view/SpecimenWebPartFactory.java index e9c2dcfc8cb..14b02ded6dd 100644 --- a/specimen/src/org/labkey/specimen/view/SpecimenWebPartFactory.java +++ b/specimen/src/org/labkey/specimen/view/SpecimenWebPartFactory.java @@ -22,7 +22,7 @@ public SpecimenWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { if (!portalCtx.hasPermission(ReadPermission.class)) return new HtmlView("Specimens", HtmlString.of(portalCtx.getUser().isGuest() ? "Please log in to see this data." : "You do not have permission to see this data")); diff --git a/study/api-src/org/labkey/api/study/view/ToolsWebPartFactory.java b/study/api-src/org/labkey/api/study/view/ToolsWebPartFactory.java index 96305fe3221..37d975c5cfc 100644 --- a/study/api-src/org/labkey/api/study/view/ToolsWebPartFactory.java +++ b/study/api-src/org/labkey/api/study/view/ToolsWebPartFactory.java @@ -41,7 +41,7 @@ protected ToolsWebPartFactory(String name, @NotNull String defaultLocation, Stri protected abstract String getTitle(); @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { return new StudyToolsWebPart(getTitle(), webPart.getLocation().equals(HttpView.BODY), getItems(portalCtx)); } diff --git a/study/src/org/labkey/study/StudyContainerListener.java b/study/src/org/labkey/study/StudyContainerListener.java index 6ac40fab96f..d3e4ccace37 100644 --- a/study/src/org/labkey/study/StudyContainerListener.java +++ b/study/src/org/labkey/study/StudyContainerListener.java @@ -36,7 +36,7 @@ public void containerDeleted(Container c, User user) publishedStudy.setSourceStudyContainerId(null); StudyManager.getInstance().updateStudy(user, publishedStudy); } - SampleTypeService.get().removeAutoLinkedStudy(c, user); + SampleTypeService.get().removeAutoLinkedStudy(c); } @Override diff --git a/study/src/org/labkey/study/StudyModule.java b/study/src/org/labkey/study/StudyModule.java index 68fcf780527..290664c008d 100644 --- a/study/src/org/labkey/study/StudyModule.java +++ b/study/src/org/labkey/study/StudyModule.java @@ -731,19 +731,19 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Po } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( - DatasetDefinition.TestCleanupOrphanedDatasetDomains.class, - ParticipantGroupManager.ParticipantGroupTestCase.class, - StudyImpl.ProtocolDocumentTestCase.class, - StudyManager.StudySnapshotTestCase.class, - StudyManager.VisitCreationTestCase.class, - StudyModule.TestCase.class, - VisitImpl.TestCase.class, - DatasetUpdateService.TestCase.class, - DatasetLsidImportHelper.TestCase.class); + DatasetDefinition.TestCleanupOrphanedDatasetDomains.class, + ParticipantGroupManager.ParticipantGroupTestCase.class, + StudyImpl.ProtocolDocumentTestCase.class, + StudyManager.StudySnapshotTestCase.class, + StudyManager.VisitCreationTestCase.class, + StudyModule.TestCase.class, + VisitImpl.TestCase.class, + DatasetUpdateService.TestCase.class, + DatasetLsidImportHelper.TestCase.class + ); } @Override @@ -755,8 +755,7 @@ public Set getIntegrationTests() } @Override - @NotNull - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( DatasetDataWriter.TestCase.class, diff --git a/study/src/org/labkey/study/controllers/SharedStudyController.java b/study/src/org/labkey/study/controllers/SharedStudyController.java index 37db0837b32..a8828f1f7eb 100644 --- a/study/src/org/labkey/study/controllers/SharedStudyController.java +++ b/study/src/org/labkey/study/controllers/SharedStudyController.java @@ -107,7 +107,7 @@ public boolean isAvailable(Container c, String scope, String location) } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { JspView view = new StudyFilterWebPart(); view.setTitle(getName()); diff --git a/study/src/org/labkey/study/view/StudyListWebPartFactory.java b/study/src/org/labkey/study/view/StudyListWebPartFactory.java index 52c49fcb762..7d40b9c6225 100644 --- a/study/src/org/labkey/study/view/StudyListWebPartFactory.java +++ b/study/src/org/labkey/study/view/StudyListWebPartFactory.java @@ -39,9 +39,9 @@ public StudyListWebPartFactory() @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { - WebPartView view; + WebPartView view; if (webPart.getLocation().equals(HttpView.BODY)) { @@ -57,7 +57,7 @@ public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Porta } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { return new JspView<>("/org/labkey/study/view/customizeStudyList.jsp", webPart); } diff --git a/study/src/org/labkey/study/view/StudySummaryWebPartFactory.java b/study/src/org/labkey/study/view/StudySummaryWebPartFactory.java index 4611f5c2ee8..09e4a78a356 100644 --- a/study/src/org/labkey/study/view/StudySummaryWebPartFactory.java +++ b/study/src/org/labkey/study/view/StudySummaryWebPartFactory.java @@ -135,13 +135,13 @@ public String getGrant(){ } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { if (!portalCtx.hasPermission(ReadPermission.class)) return new HtmlView(NAME, HtmlString.of(portalCtx.getUser().isGuest() ? "Please log in to see this data" : "You do not have permission to see this data")); BindException errors = (BindException) portalCtx.getRequest().getAttribute("errors"); - WebPartView v = new JspView<>("/org/labkey/study/view/studySummary.jsp", new StudySummaryBean(portalCtx), errors); + WebPartView v = new JspView<>("/org/labkey/study/view/studySummary.jsp", new StudySummaryBean(portalCtx), errors); v.setTitle(NAME); if(portalCtx.getContainer().hasPermission(portalCtx.getUser(), AdminPermission.class)) diff --git a/study/src/org/labkey/study/view/SubjectDetailsWebPartFactory.java b/study/src/org/labkey/study/view/SubjectDetailsWebPartFactory.java index ede737025a2..49b5f2fc4d7 100644 --- a/study/src/org/labkey/study/view/SubjectDetailsWebPartFactory.java +++ b/study/src/org/labkey/study/view/SubjectDetailsWebPartFactory.java @@ -110,7 +110,7 @@ public String getDisplayName(Container container, String location) } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { String participantId = webPart.getPropertyMap().get(PARTICIPANT_ID_KEY); String currentUrl = webPart.getPropertyMap().get(CURRENT_URL_KEY); diff --git a/studydesign/src/org/labkey/studydesign/StudyDesignModule.java b/studydesign/src/org/labkey/studydesign/StudyDesignModule.java index eff8232833b..44aa8c8ba76 100644 --- a/studydesign/src/org/labkey/studydesign/StudyDesignModule.java +++ b/studydesign/src/org/labkey/studydesign/StudyDesignModule.java @@ -34,9 +34,9 @@ public String getName() protected Collection createWebPartFactories() { return List.of( - new AssayScheduleWebpartFactory(), - new ImmunizationScheduleWebpartFactory(), - new VaccineDesignWebpartFactory() + new AssayScheduleWebpartFactory(), + new ImmunizationScheduleWebpartFactory(), + new VaccineDesignWebpartFactory() ); } @@ -72,12 +72,11 @@ protected void startupAfterSpringConfig(ModuleContext moduleContext) } @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( - TreatmentManager.TreatmentDataTestCase.class, - TreatmentManager.AssayScheduleTestCase.class + TreatmentManager.TreatmentDataTestCase.class, + TreatmentManager.AssayScheduleTestCase.class ); } } \ No newline at end of file diff --git a/studydesign/src/org/labkey/studydesign/view/AssayScheduleWebpartFactory.java b/studydesign/src/org/labkey/studydesign/view/AssayScheduleWebpartFactory.java index 7295b36bb67..60dfbfe746a 100644 --- a/studydesign/src/org/labkey/studydesign/view/AssayScheduleWebpartFactory.java +++ b/studydesign/src/org/labkey/studydesign/view/AssayScheduleWebpartFactory.java @@ -43,7 +43,7 @@ public AssayScheduleWebpartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { if (!canShow(portalCtx.getContainer())) return null; diff --git a/studydesign/src/org/labkey/studydesign/view/ImmunizationScheduleWebpartFactory.java b/studydesign/src/org/labkey/studydesign/view/ImmunizationScheduleWebpartFactory.java index abfe3e25a3e..946a00eefda 100644 --- a/studydesign/src/org/labkey/studydesign/view/ImmunizationScheduleWebpartFactory.java +++ b/studydesign/src/org/labkey/studydesign/view/ImmunizationScheduleWebpartFactory.java @@ -43,7 +43,7 @@ public ImmunizationScheduleWebpartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { if (!canShow(portalCtx.getContainer())) return null; diff --git a/studydesign/src/org/labkey/studydesign/view/VaccineDesignWebpartFactory.java b/studydesign/src/org/labkey/studydesign/view/VaccineDesignWebpartFactory.java index 0522c2eedea..22588e2e316 100644 --- a/studydesign/src/org/labkey/studydesign/view/VaccineDesignWebpartFactory.java +++ b/studydesign/src/org/labkey/studydesign/view/VaccineDesignWebpartFactory.java @@ -35,7 +35,7 @@ public VaccineDesignWebpartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { if (!canShow(portalCtx.getContainer())) return null; diff --git a/survey/src/org/labkey/survey/SurveyModule.java b/survey/src/org/labkey/survey/SurveyModule.java index a55dd4d8cf9..f30de7ddf14 100644 --- a/survey/src/org/labkey/survey/SurveyModule.java +++ b/survey/src/org/labkey/survey/SurveyModule.java @@ -208,13 +208,13 @@ public SurveysWebPartFactory() } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { return new JspView<>("/org/labkey/survey/view/customizeSurveysWebPart.jsp", webPart); } @Override - public WebPartView getWebPartView(@NotNull ViewContext context, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext context, @NotNull Portal.WebPart webPart) { if (!context.hasPermission(ReadPermission.class) || context.getUser().isGuest()) return new HtmlView("Surveys", HtmlString.of("You do not have permission to see this data")); @@ -262,9 +262,8 @@ public WebPartView getWebPartView(@NotNull ViewContext context, @NotNull Portal. } } - @NotNull @Override - public Set getUnitTests() + public @NotNull Set> getUnitTests() { return Set.of( SurveyManager.TestCase.class diff --git a/visualization/src/org/labkey/visualization/VisualizationModule.java b/visualization/src/org/labkey/visualization/VisualizationModule.java index 8b248b0e0c7..ae269464ca0 100644 --- a/visualization/src/org/labkey/visualization/VisualizationModule.java +++ b/visualization/src/org/labkey/visualization/VisualizationModule.java @@ -63,15 +63,14 @@ protected Collection createWebPartFactories() return Collections.emptyList(); } - - @NotNull @Override - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { - Set set = new LinkedHashSet<>(); + Set> set = new LinkedHashSet<>(); set.add(VisualizationController.TestCase.class); set.add(VisualizationSQLGenerator.GetDataTestCase.class); set.add(VisualizationCDSGenerator.TestCase.class); + return set; } @@ -93,7 +92,6 @@ public QuerySchema createSchema(DefaultSchema schema, Module module) } }); - addController(VisualizationController.NAME, VisualizationController.class); ReportService.get().registerDescriptor(new TimeChartReportDescriptor()); ReportService.get().registerDescriptor(new GenericChartReportDescriptor()); @@ -107,7 +105,6 @@ public QuerySchema createSchema(DefaultSchema schema, Module module) VisualizationService.setInstance(new VisualizationServiceImpl()); } - @Override public void doStartup(ModuleContext moduleContext) { diff --git a/wiki/src/org/labkey/wiki/MenuWikiWebPartFactory.java b/wiki/src/org/labkey/wiki/MenuWikiWebPartFactory.java index c0ce7598662..970eacae0f9 100644 --- a/wiki/src/org/labkey/wiki/MenuWikiWebPartFactory.java +++ b/wiki/src/org/labkey/wiki/MenuWikiWebPartFactory.java @@ -36,7 +36,7 @@ public MenuWikiWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { Map props = new HashMap<>(webPart.getPropertyMap()); if (null == props.get("webPartContainer")) diff --git a/wiki/src/org/labkey/wiki/WikiModule.java b/wiki/src/org/labkey/wiki/WikiModule.java index 824d2f742bd..b570c9dbd30 100644 --- a/wiki/src/org/labkey/wiki/WikiModule.java +++ b/wiki/src/org/labkey/wiki/WikiModule.java @@ -223,17 +223,14 @@ private void loadWikiContent(@Nullable Container c, User user, String name, Stri } } - @Override - @NotNull - public Set getIntegrationTests() + public @NotNull Set> getIntegrationTests() { return Set.of( WikiManager.TestCase.class ); } - @Override public void enumerateDocuments(SearchService.TaskIndexingQueue queue, @Nullable Date modifiedSince) { @@ -241,14 +238,12 @@ public void enumerateDocuments(SearchService.TaskIndexingQueue queue, @Nullable getWikiManager().indexWikis(q, modifiedSince, null)); } - @Override public void indexDeleted() { new SqlExecutor(CommSchema.getInstance().getSchema()).execute("UPDATE comm.pages SET lastIndexed=NULL"); } - private WikiManager getWikiManager() { return WikiManager.get(); diff --git a/wiki/src/org/labkey/wiki/WikiTOCFactory.java b/wiki/src/org/labkey/wiki/WikiTOCFactory.java index a2ff3542570..c9cbbe5276a 100644 --- a/wiki/src/org/labkey/wiki/WikiTOCFactory.java +++ b/wiki/src/org/labkey/wiki/WikiTOCFactory.java @@ -45,16 +45,16 @@ public WikiTOCFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { - WebPartView v = new WikiTOC(portalCtx, webPart); + WebPartView v = new WikiTOC(portalCtx, webPart); //TODO: Should just use setters populateProperties(v, webPart.getPropertyMap()); return v; } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { return new JspView<>("/org/labkey/wiki/view/customizeWikiToc.jsp", webPart); } diff --git a/wiki/src/org/labkey/wiki/WikiWebPartFactory.java b/wiki/src/org/labkey/wiki/WikiWebPartFactory.java index 1340f969e45..d141b325564 100644 --- a/wiki/src/org/labkey/wiki/WikiWebPartFactory.java +++ b/wiki/src/org/labkey/wiki/WikiWebPartFactory.java @@ -50,14 +50,14 @@ public WikiWebPartFactory() } @Override - public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) + public WebPartView getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart) { Map props = webPart.getPropertyMap(); return new WikiWebPart(webPart.getRowId(), props); } @Override - public HttpView getEditView(Portal.WebPart webPart, ViewContext context) + public HttpView getEditView(Portal.WebPart webPart, ViewContext context) { return new WikiController.CustomizeWikiPartView(webPart); } From 1d0697dfbce2b929322b035bdfcdb7b8fe832dda Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 2 Oct 2025 14:15:01 -0700 Subject: [PATCH 2/3] Temporarily restore old method --- api/src/org/labkey/api/exp/api/SampleTypeService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/org/labkey/api/exp/api/SampleTypeService.java b/api/src/org/labkey/api/exp/api/SampleTypeService.java index b8835321c30..3be72f4fd6a 100644 --- a/api/src/org/labkey/api/exp/api/SampleTypeService.java +++ b/api/src/org/labkey/api/exp/api/SampleTypeService.java @@ -172,6 +172,12 @@ ExpSampleType createSampleType(Container c, User u, String name, String descript */ List getSampleTypes(@NotNull Container container, boolean includeOtherContainers); + @Deprecated // Temporary just to keep code compiling during migration to new method + default List getSampleTypes(@NotNull Container container, User user, boolean includeOtherContainers) + { + return getSampleTypes(container, includeOtherContainers); + } + /** * Get a SampleType by name within the definition container. */ From 83e9589c262ecd85914002101be9e1a032799faf Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Fri, 3 Oct 2025 09:37:42 -0700 Subject: [PATCH 3/3] Fix build breaks --- .../labkey/experiment/controllers/exp/ExperimentController.java | 2 +- experiment/src/org/labkey/experiment/samplesAndAnalytes.jsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java index 657d28931d0..49d87a94d84 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java +++ b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java @@ -4429,7 +4429,7 @@ protected Map getRenamedColumns() // file is loaded. if (crossTypeImport) { - List sampleTypes = SampleTypeServiceImpl.get().getSampleTypes(getContainer(), getUser(), true); + List sampleTypes = SampleTypeServiceImpl.get().getSampleTypes(getContainer(), true); for (ExpSampleTypeImpl sampleType : sampleTypes) aliases.addAll(sampleType.getImportAliases().keySet()); } diff --git a/experiment/src/org/labkey/experiment/samplesAndAnalytes.jsp b/experiment/src/org/labkey/experiment/samplesAndAnalytes.jsp index 65b3ba2e040..a2c8a6c2b49 100644 --- a/experiment/src/org/labkey/experiment/samplesAndAnalytes.jsp +++ b/experiment/src/org/labkey/experiment/samplesAndAnalytes.jsp @@ -33,7 +33,7 @@ } else { - List sampleTypes = SampleTypeServiceImpl.get().getSampleTypes(getContainer(), getUser(), true); + List sampleTypes = SampleTypeServiceImpl.get().getSampleTypes(getContainer(), true); int i = 0; %>
<%