Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ public void startBackgroundThreads()
}

@Override
@NotNull
public Set<Class> getIntegrationTests()
public @NotNull Set<Class<?>> getIntegrationTests()
{
return Set.of(
AnnouncementManager.TestCase.class
Expand All @@ -228,7 +227,6 @@ public Collection<String> getSummary(Container c)
return list;
}


@Override
public void enumerateDocuments(SearchService.TaskIndexingQueue queue, final Date modifiedSince)
{
Expand Down
4 changes: 2 additions & 2 deletions api/src/org/labkey/api/ApiModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public void registerServlets(ServletContext servletCtx)
}

@Override
public @NotNull Set<Class> getUnitTests()
public @NotNull Set<Class<?>> getUnitTests()
{
return Set.of(
Aggregate.TestCase.class,
Expand Down Expand Up @@ -458,7 +458,7 @@ public void registerServlets(ServletContext servletCtx)
}

@Override
public @NotNull Set<Class> getIntegrationTests()
public @NotNull Set<Class<?>> getIntegrationTests()
{
return Set.of(
AbstractAuditDomainKind.TestCase.class,
Expand Down
8 changes: 1 addition & 7 deletions api/src/org/labkey/api/audit/AbstractAuditTypeProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()));
Expand Down
5 changes: 2 additions & 3 deletions api/src/org/labkey/api/data/NameGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -1122,7 +1121,7 @@ private void initialize(@Nullable Map<String, String> 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());
Expand Down
4 changes: 2 additions & 2 deletions api/src/org/labkey/api/data/generator/DataGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public List<? extends ExpSampleType> getSampleTypes(List<String> 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)
Expand Down Expand Up @@ -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<String> dataClassParents = new ArrayList<>(config.getDataClassParents());
// Default to using all types in the container
if (dataClassParents.isEmpty())
Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/exp/api/ExperimentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ ExpRun derive(
List<ObjectReferencer> getObjectReferencers();

@NotNull
String getObjectReferenceDescription(Class referencedClass);
String getObjectReferenceDescription(Class<?> referencedClass);

@Nullable ProtocolImplementation getProtocolImplementation(String name);

Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/exp/api/ObjectReferencer.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ default Collection<Long> getItemsWithReferences(Collection<Long> referencedRowId
@NotNull Collection<Long> getItemsWithReferences(Collection<Long> referencedRowIds, @NotNull String referencedSchemaName, @Nullable String referencedQueryName);

@Nullable
String getObjectReferenceDescription(Class referencedClass);
String getObjectReferenceDescription(Class<?> referencedClass);
}
27 changes: 16 additions & 11 deletions api/src/org/labkey/api/exp/api/SampleTypeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,35 +165,40 @@ 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<? extends ExpSampleType> getSampleTypes(@NotNull Container container, @Nullable User user, boolean includeOtherContainers);
List<? extends ExpSampleType> getSampleTypes(@NotNull Container container, boolean includeOtherContainers);

@Deprecated // Temporary just to keep code compiling during migration to new method
default List<? extends ExpSampleType> getSampleTypes(@NotNull Container container, User user, boolean includeOtherContainers)
{
return getSampleTypes(container, 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.
*/
Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/exp/query/SamplesSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static private Map<String, ExpSampleType> getSampleTypeMap(Container container,
{
Map<String, ExpSampleType> 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);
}
Expand Down
6 changes: 2 additions & 4 deletions api/src/org/labkey/api/module/DefaultModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -494,15 +494,13 @@ protected void addWebPart(String name, Container c, @Nullable String location, i
}

@Override
@NotNull
public Set<Class> getIntegrationTests()
public @NotNull Set<Class<?>> getIntegrationTests()
{
return Collections.emptySet();
}

@Override
@NotNull
public Set<Class> getUnitTests()
public @NotNull Set<Class<?>> getUnitTests()
{
return Collections.emptySet();
}
Expand Down
6 changes: 2 additions & 4 deletions api/src/org/labkey/api/module/MockModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,13 @@ public TabDisplayMode getTabDisplayMode()
}

@Override
@NotNull
public Set<Class> getIntegrationTests()
public @NotNull Set<Class<?>> getIntegrationTests()
{
return Collections.emptySet();
}

@Override
@NotNull
public Set<Class> getUnitTests()
public @NotNull Set<Class<?>> getUnitTests()
{
return Collections.emptySet();
}
Expand Down
10 changes: 6 additions & 4 deletions api/src/org/labkey/api/module/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Class> getIntegrationTests();
@NotNull
Set<Class<?>> getIntegrationTests();

/**
* Modules can provide JUnit tests that must be run inside the server
Expand All @@ -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<Class> getUnitTests();
@NotNull
Set<Class<?>> getUnitTests();

/**
* Returns a set of schemas that the module wants tested. The DbSchema junit test calls this and ensures that the
Expand Down
4 changes: 2 additions & 2 deletions api/src/org/labkey/api/module/SimpleWebPartFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ 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);

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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@
*/
public abstract class SecurityEscalationAuditProvider extends AbstractAuditTypeProvider implements AuditTypeProvider
{
protected SecurityEscalationAuditProvider()
{
super();
}

protected SecurityEscalationAuditProvider(AbstractAuditDomainKind dk)
{
super(dk);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/view/DefaultWebPartFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public DefaultWebPartFactory(String name, Class<? extends WebPartView> 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"));
Expand Down
4 changes: 2 additions & 2 deletions api/src/org/labkey/api/view/SimpleWebPartFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions assay/src/org/labkey/assay/AssayModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public Set<String> getProvisionedSchemaNames()
}

@Override
public @NotNull Set<Class> getIntegrationTests()
public @NotNull Set<Class<?>> getIntegrationTests()
{
return Set.of(
ModuleAssayCache.TestCase.class,
Expand All @@ -345,7 +345,7 @@ public Set<String> getProvisionedSchemaNames()
}

@Override
public @NotNull Set<Class> getUnitTests()
public @NotNull Set<Class<?>> getUnitTests()
{
return Set.of(
TsvAssayProvider.TestCase.class,
Expand Down
8 changes: 4 additions & 4 deletions assay/src/org/labkey/assay/view/AssayBaseWebPartFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand All @@ -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();

Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions assay/src/org/labkey/assay/view/AssayListWebPartFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading