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
6 changes: 3 additions & 3 deletions api/src/org/labkey/api/data/SqlExecutingSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public abstract class SqlExecutingSelector<FACTORY extends SqlFactory, SELECTOR

// At most one warning per day per call site (not per query or row count), so a legitimately large but expected load doesn't flood the log; see getStackKey()
private static final Throttle<LargeResultWarning> LARGE_RESULT_WARNING_THROTTLE = new Throttle<>("SqlSelector large result warnings", 1000, CacheManager.DAY,
w -> LOGGER.warn("{} {} rows loaded into a collection via {}. Consider switching to streaming variants to reduce memory usage. SQL: {}",
w.rowCount, w.elementClass, w.selectorClass, w.sql, w.stackTrace));
w -> LOGGER.warn("{} {} rows loaded into a collection via {}. Consider switching to streaming variants to reduce memory usage. SQL: {}",
String.format("%,d", w.rowCount), w.elementClass, w.selectorClass, w.sql, w.stackTrace));

int _maxRows = Table.ALL_ROWS;
protected long _offset = Table.NO_OFFSET;
Expand Down Expand Up @@ -191,7 +191,7 @@ public SELECTOR setJdbcCaching(boolean cache)
// Log the parameterized SQL only so bound parameter values stay out of the log
SQLFragment sql = getSqlFactory(false).getSql();
LARGE_RESULT_WARNING_THROTTLE.execute(new LargeResultWarning(getStackKey(stackTrace), result.size(),
clazz.getSimpleName(), getClass().getSimpleName(), sql == null ? null : sql.getSQL(), stackTrace));
clazz.getSimpleName(), getClass().getSimpleName(), sql == null ? null : sql.getSQL(), stackTrace));
}

return result;
Expand Down
4 changes: 2 additions & 2 deletions api/src/org/labkey/api/reader/ExcelLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -1321,9 +1321,9 @@ else if (isDateFormat)
}
else
{
// Excel auto-converts lots of things that are not numbers, such particpantids and sometimes dates
// Excel auto-converts lots of things that are not numbers, such participant ids and sometimes dates
// If the value is not explicitly formatted as a number then use Excel's stored string representation and let DataLoader sort it out
// NOTE: if we it is formatted as a number we generate our own string representation,
// NOTE: if it is formatted as a number, we generate our own string representation
// This helps when targeting a string column
// a) to avoid Excel's trailing 0000001 and 9999999 format
// b) avoid scientific notation if possible
Expand Down
14 changes: 1 addition & 13 deletions api/src/org/labkey/api/security/SecurityManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -3035,15 +3035,9 @@ public static Stream<Class<? extends Permission>> getPermissions(SecurableResour
return getPermissionsWithoutCheckingForbiddenProjects(resource, principal, contextualRoles);
}

@Deprecated // Left behind temporarily so we don't immediately break existing ehrModules FBs. TODO: Remove
public static Set<Class<? extends Permission>> streamPermissions(SecurableResource resource, UserPrincipal principal, Set<Role> contextualRoles)
{
return getPermissions(resource, principal, contextualRoles).collect(Collectors.toSet());
}

/**
* This method exists to allow isForbiddenProject() to check permissions on the project without reentrancy loops.
* Do not call this method unless you're isForbiddenProject().
* isForbiddenProject() and getPermissions() are the only methods that should be calling this.
*/
public static Stream<Class<? extends Permission>> getPermissionsWithoutCheckingForbiddenProjects(@NotNull SecurableResource resource, @NotNull UserPrincipal principal, @NotNull Set<Role> contextualRoles)
{
Expand All @@ -3061,12 +3055,6 @@ public static Stream<Class<? extends Permission>> getPermissionsWithoutCheckingF
return permissions;
}

@Deprecated // Left behind temporarily so we don't immediately break existing premiumModules FBs. TODO: Remove
public static Stream<Class<? extends Permission>> streamPermissionsWithoutCheckingForbiddenProjects(@NotNull SecurableResource resource, @NotNull UserPrincipal principal, Set<Role> contextualRoles)
{
return getPermissionsWithoutCheckingForbiddenProjects(resource, principal, contextualRoles);
}

@NotNull
public static Set<String> getPermissionNames(SecurableResource resource, @NotNull UserPrincipal principal)
{
Expand Down
28 changes: 5 additions & 23 deletions api/src/org/labkey/api/services/ServiceRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,10 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/*
* User: Dave
* Date: Nov 19, 2008
* Time: 10:50:17 AM
*/

/**
* Provides a central registry for service interface implementations.
* Modules that supply cross-module services should register their service
* instances at startup by calling {@link #registerService}.
* Other modules can then request that service at
* runtime by calling {@link #getService(Class)}, specifying the
* class of the service interface.
* Provides a central registry for service interface implementations. Modules that supply cross-module services should
* register their service instances at startup by calling {@link #registerService}. Other modules can then request that
* service at runtime by calling {@link #getService(Class)}, specifying the class of the service interface.
*/
public class ServiceRegistry
{
Expand All @@ -63,12 +54,12 @@ else if (name.endsWith("$I"))
}
final String shortName;
final String longName;
final Class cls;
final Class<?> cls;
final Object instance;
}

private static final ServiceRegistry _instance = new ServiceRegistry();
private final ConcurrentMap<Class, _ServiceDef> _servicesByClass = new ConcurrentHashMap<>();
private final ConcurrentMap<Class<?>, _ServiceDef> _servicesByClass = new ConcurrentHashMap<>();

static {ServiceRegistry._instance.registerService(ServiceRegistry.class, _instance);}

Expand Down Expand Up @@ -104,15 +95,6 @@ public <T> boolean hasService(Class<T> type)
return getService(type) != null;
}


/** Returns a service implementation for a given service interface. */
@Deprecated // Use ServiceRegistry.get().getService() instead
public static <T> T get(Class<T> type)
{
return get().getService(type);
}


/**
* Registers a service implementation. Modules that expose services should call this method
* at load time, passing the service interface class and the implementation instance.
Expand Down
6 changes: 0 additions & 6 deletions api/src/org/labkey/api/view/ViewContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,6 @@ public Object get(String key)
return _map.get(key);
}

@Deprecated // Left behind so not every module needs to be recompiled immediately. TODO: Remove
public Object get(Object key)
{
return _map.get(key);
}

/*
* Safer and more convenient than using get() with a String cast. Returns _map.get(key) if it's null or a String.
* Otherwise, throws BadRequestException. See GH Issue 1631.
Expand Down
2 changes: 1 addition & 1 deletion core/src/org/labkey/core/admin/AdminController.java
Original file line number Diff line number Diff line change
Expand Up @@ -12376,7 +12376,7 @@ public class ViewUsageStatisticsAction extends SimpleViewAction<Object>
@Override
public ModelAndView getView(Object o, BindException errors)
{
return ModuleHtmlView.get(ModuleLoader.getInstance().getModule("core"), ModuleHtmlView.getGeneratedViewPath("ViewUsageStatistics"));
return ModuleHtmlView.get(ModuleLoader.getInstance().getCoreModule(), ModuleHtmlView.getGeneratedViewPath("ViewUsageStatistics"));
}

@Override
Expand Down
11 changes: 5 additions & 6 deletions study/src/org/labkey/study/controllers/StudyController.java
Original file line number Diff line number Diff line change
Expand Up @@ -1096,19 +1096,18 @@ public void addNavTrail(NavTree root)
}
}


Participant findParticipant(Study study, String particpantId) throws StudyManager.ParticipantNotUniqueException
Participant findParticipant(Study study, String participantId) throws StudyManager.ParticipantNotUniqueException
{
Participant participant = StudyManager.getInstance().getParticipant(study, particpantId);
Participant participant = StudyManager.getInstance().getParticipant(study, participantId);
if (participant == null)
{
if (study.isDataspaceStudy())
{
Container c = StudyManager.getInstance().findParticipant(study, particpantId);
Container c = StudyManager.getInstance().findParticipant(study, participantId);
Study s = null == c ? null : StudyManager.getInstance().getStudy(c);
if (null != s && c.hasPermission(getUser(), ReadPermission.class))
{
participant = StudyManager.getInstance().getParticipant(s, particpantId);
participant = StudyManager.getInstance().getParticipant(s, participantId);
}
}
}
Expand Down Expand Up @@ -1217,7 +1216,7 @@ public class Participant2Action extends SimpleViewAction<ParticipantForm>
// TODO participant list support? cohortfilter support?
// TODO define participant context
// {
// particpantId:"",
// participantId:"",
// participantGroup:""
// demoMode:false
// }
Expand Down
Loading