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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void process(PipelineJob job, FolderImportContext ctx, VirtualFile root)
{
if (null != job)
job.setStatus("IMPORT " + getDescription());
ctx.getLogger().info("Loading " + getDescription());
ctx.getLogger().info("Loading {}", getDescription());
NotificationsType notifications = ctx.getXml().getNotifications();
if (notifications.isSetMessagesDefault())
{
Expand All @@ -70,7 +70,7 @@ public void process(PipelineJob job, FolderImportContext ctx, VirtualFile root)
if (messagesOption != null)
AnnouncementManager.saveDefaultEmailOption(ctx.getContainer(), messagesDefault);
else
ctx.getLogger().error("Unable to find default messages email option for id " + messagesDefault);
ctx.getLogger().error("Unable to find default messages email option for id {}", messagesDefault);
}
if (notifications.isSetFilesDefault())
{
Expand All @@ -79,10 +79,10 @@ public void process(PipelineJob job, FolderImportContext ctx, VirtualFile root)
if (filesOption != null)
EmailService.get().setDefaultEmailPref(ctx.getContainer(), new FileContentDefaultEmailPref(), String.valueOf(filesDefault));
else
ctx.getLogger().error("Unable to find default files email option for id " + filesDefault);
ctx.getLogger().error("Unable to find default files email option for id {}", filesDefault);

}
ctx.getLogger().info("Done importing " + getDescription());
ctx.getLogger().info("Done importing {}", getDescription());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void aggregateFeeds(List<RSSFeed> feeds, User user, Writer writer)
}
catch (IOException e)
{
LogManager.getLogger(RSSService.class).error("Invalid RSS Feed: " + e.getMessage());
LogManager.getLogger(RSSService.class).error("Invalid RSS Feed: {}", e.getMessage());
}

if (null != reader)
Expand All @@ -102,7 +102,7 @@ public void aggregateFeeds(List<RSSFeed> feeds, User user, Writer writer)
}
catch (FeedException fe)
{
LogManager.getLogger(RSSService.class).error("Invalid Feed (FeedException): " + _feed.getFeedURL());
LogManager.getLogger(RSSService.class).error("Invalid Feed (FeedException): {}", _feed.getFeedURL());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.labkey.announcements;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Strings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -141,7 +140,7 @@ private Address getEmailTo(String email) throws IllegalArgumentException
// filter out disabled users or users who have never logged in : Issue #33255
if (!user.isActive() || user.isFirstLogin())
{
_log.warn("The user: " + user.getName() + " is either disabled or has never logged in and has been omitted.");
_log.warn("The user: {} is either disabled or has never logged in and has been omitted.", user.getName());
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ private static void notifyModerators(Container c, User user, AnnouncementModel a

if (toList.isEmpty())
{
LOG.warn("New " + name.toLowerCase() + " requires moderator review, but no moderators are subscribed to receive 'Individual' notifications in this folder: " + c.getPath());
LOG.warn("New {} requires moderator review, but no moderators are subscribed to receive 'Individual' notifications in this folder: {}", name.toLowerCase(), c.getPath());
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.labkey.api.security.UserManager;
import org.labkey.api.security.UserPrincipal;
import org.labkey.api.security.permissions.Permission;
import org.labkey.api.security.permissions.ReadPermission;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -92,22 +91,6 @@ public boolean hasPermission(@NotNull UserPrincipal user, @NotNull Class<? exten
return hasPermission(user, perm, getContainer());
}

@Override
public boolean hasPermission(UserPrincipal user, Class<? extends Permission> perm, Container container)
{
// Guests can't subscribe to anything, or edit anyone else's subscriptions, but they can read the table
// It'll have no rows for them
if (user.isGuest() && !ReadPermission.class.equals(perm))
{
return false;
}

// For authenticated users, if they have read access, that's enough to edit their own subscription level
// The QueryUpdateService implementation will make sure they have permission to insert/update/delete at the row
// level.
return container.hasPermission(user, ReadPermission.class);
}

@Override
public QueryUpdateService getUpdateService()
{
Expand Down
4 changes: 2 additions & 2 deletions api/src/jakarta/servlet/jsp/JspWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ protected JspWriter(int bufferSize, boolean autoFlush) {
* @throws NullPointerException If <code>s</code> is <code>null</code>
* @throws IOException If an error occurred while writing
*/
public abstract void print(char s[]) throws IOException;
public abstract void print(char[] s) throws IOException;

/**
* Print a string. If the argument is <code>null</code> then the string <code>"null"</code> is printed. Otherwise,
Expand Down Expand Up @@ -293,7 +293,7 @@ protected JspWriter(int bufferSize, boolean autoFlush) {
*
* @throws IOException If an error occurred while writing
*/
public abstract void println(char x[]) throws IOException;
public abstract void println(char[] x) throws IOException;

/**
* Print a String and then terminate the line. This method behaves as though it invokes
Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/action/ApiQueryResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ protected Map<String, Object> getMetaData()
//include an id property set to the pk column name if there is one (and only one)
List<ColumnInfo> pkCols = _tinfo.getPkColumns();
if (1 == pkCols.size())
metaData.put("id", pkCols.get(0).getName());
metaData.put("id", pkCols.getFirst().getName());

metaData.put("fields", fields);

Expand Down
4 changes: 2 additions & 2 deletions api/src/org/labkey/api/action/BaseApiAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import org.jetbrains.annotations.NotNull;
import org.labkey.api.miniprofiler.MiniProfiler;
import org.labkey.api.miniprofiler.Timing;
import org.labkey.api.query.BatchValidationException;
Expand Down Expand Up @@ -583,7 +583,7 @@ else if (value instanceof JSONObject)
}

@Override
public final void validate(Object form, Errors errors)
public final void validate(@NotNull Object form, @NotNull Errors errors)
{
try (Timing ignored = MiniProfiler.step("validate"))
{
Expand Down
22 changes: 11 additions & 11 deletions api/src/org/labkey/api/action/BaseViewAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ else if (!value.getClass().isArray())
}

@Override
public boolean supports(Class clazz)
public boolean supports(@NotNull Class clazz)
{
return getCommandClass().isAssignableFrom(clazz);
}
Expand Down Expand Up @@ -559,7 +559,7 @@ public BeanUtilsPropertyBindingResult(Object target, String objectName)
}

@Override
protected BeanWrapper createBeanWrapper()
protected @NotNull BeanWrapper createBeanWrapper()
{
return new BeanUtilsWrapperImpl((DynaBean)getTarget());
}
Expand All @@ -583,7 +583,7 @@ public BeanUtilsWrapperImpl(DynaBean target)
}

@Override
public Object getPropertyValue(String propertyName) throws BeansException
public Object getPropertyValue(@NotNull String propertyName) throws BeansException
{
try
{
Expand All @@ -596,7 +596,7 @@ public Object getPropertyValue(String propertyName) throws BeansException
}

@Override
public void setPropertyValue(String propertyName, Object value) throws BeansException
public void setPropertyValue(@NotNull String propertyName, Object value) throws BeansException
{
try
{
Expand All @@ -609,19 +609,19 @@ public void setPropertyValue(String propertyName, Object value) throws BeansExce
}

@Override
public boolean isReadableProperty(String propertyName)
public boolean isReadableProperty(@NotNull String propertyName)
{
return true;
}

@Override
public boolean isWritableProperty(String propertyName)
public boolean isWritableProperty(@NotNull String propertyName)
{
return true;
}

@Override
public TypeDescriptor getPropertyTypeDescriptor(String s) throws BeansException
public TypeDescriptor getPropertyTypeDescriptor(@NotNull String s) throws BeansException
{
return null;
}
Expand All @@ -632,25 +632,25 @@ public void setWrappedInstance(Object obj)
}

@Override
public Object getWrappedInstance()
public @NotNull Object getWrappedInstance()
{
return object;
}

@Override
public Class<?> getWrappedClass()
public @NotNull Class<?> getWrappedClass()
{
return object.getClass();
}

@Override
public PropertyDescriptor[] getPropertyDescriptors()
public PropertyDescriptor @NotNull [] getPropertyDescriptors()
{
throw new UnsupportedOperationException();
}

@Override
public PropertyDescriptor getPropertyDescriptor(String propertyName) throws BeansException
public @NotNull PropertyDescriptor getPropertyDescriptor(@NotNull String propertyName) throws BeansException
{
throw new UnsupportedOperationException();
}
Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/action/ConfirmAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public BindException bindParameters(PropertyValues m) throws Exception
public abstract boolean handlePost(FORM form, BindException errors) throws Exception;

@Override
public void validate(Object form, Errors errors)
public void validate(@NotNull Object form, @NotNull Errors errors)
{
validateCommand((FORM)form, errors);
}
Expand Down
17 changes: 9 additions & 8 deletions api/src/org/labkey/api/action/NullSafeBindException.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.jetbrains.annotations.NotNull;
import org.labkey.api.util.ExceptionUtil;
import org.springframework.validation.BindingResult;
import org.springframework.validation.Errors;
Expand Down Expand Up @@ -49,7 +50,7 @@ public NullSafeBindException(@JsonProperty("target") Object target, @JsonPropert
}

@Override
public void reject(String errorCode)
public void reject(@NotNull String errorCode)
{
if (errorCode == null)
{
Expand All @@ -60,7 +61,7 @@ public void reject(String errorCode)
}

@Override
public void reject(String errorCode, String defaultMessage)
public void reject(@NotNull String errorCode, @NotNull String defaultMessage)
{
if (errorCode == null && defaultMessage == null)
{
Expand All @@ -71,7 +72,7 @@ public void reject(String errorCode, String defaultMessage)
}

@Override
public void reject(String errorCode, Object[] errorArgs, String defaultMessage)
public void reject(@NotNull String errorCode, Object[] errorArgs, String defaultMessage)
{
if (errorCode == null && defaultMessage == null)
{
Expand All @@ -82,7 +83,7 @@ public void reject(String errorCode, Object[] errorArgs, String defaultMessage)
}

@Override
public void rejectValue(String field, String errorCode)
public void rejectValue(String field, @NotNull String errorCode)
{
if (field == null || errorCode == null)
{
Expand All @@ -93,7 +94,7 @@ public void rejectValue(String field, String errorCode)
}

@Override
public void rejectValue(String field, String errorCode, String defaultMessage)
public void rejectValue(String field, @NotNull String errorCode, @NotNull String defaultMessage)
{
if (field == null || (errorCode == null && defaultMessage == null))
{
Expand All @@ -105,7 +106,7 @@ public void rejectValue(String field, String errorCode, String defaultMessage)
}

@Override
public void rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage)
public void rejectValue(String field, @NotNull String errorCode, Object[] errorArgs, String defaultMessage)
{
if (field == null || (errorCode == null && defaultMessage == null))
{
Expand All @@ -117,14 +118,14 @@ public void rejectValue(String field, String errorCode, Object[] errorArgs, Stri
}

@Override
public void addError(ObjectError error)
public void addError(@NotNull ObjectError error)
{
checkError(error);
super.addError(error);
}

@Override
public void addAllErrors(Errors errors)
public void addAllErrors(@NotNull Errors errors)
{
checkErrors(errors);
super.addAllErrors(errors);
Expand Down
10 changes: 5 additions & 5 deletions api/src/org/labkey/api/action/PermissionCheckableAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private void _checkActionPermissions(Set<Role> contextualRoles) throws Unauthori
User user = context.getUser();
Class<? extends Controller> actionClass = getClass();
if (LOG.isDebugEnabled())
LOG.debug(actionClass.getName() + ": checking permissions for user " + (user == null ? "<null>" : user.getName() + " (impersonated=" + user.isImpersonated() + ")"));
LOG.debug("{}: checking permissions for user {}", actionClass.getName(), user == null ? "<null>" : user.getName() + " (impersonated=" + user.isImpersonated() + ")");

if (!actionClass.isAnnotationPresent(IgnoresForbiddenProjectCheck.class))
c.throwIfForbiddenProject(user);
Expand All @@ -172,14 +172,14 @@ private void _checkActionPermissions(Set<Role> contextualRoles) throws Unauthori
boolean requiresSiteAdmin = actionClass.isAnnotationPresent(RequiresSiteAdmin.class);
if (requiresSiteAdmin && !user.hasSiteAdminPermission())
{
LOG.debug(actionClass.getName() + ": action requires site admin permissions");
LOG.debug("{}: action requires site admin permissions", actionClass.getName());
throw new UnauthorizedException();
}

boolean requiresLogin = actionClass.isAnnotationPresent(RequiresLogin.class);
if (requiresLogin && user.isGuest())
{
LOG.debug(actionClass.getName() + ": action requires login (non-guest)");
LOG.debug("{}: action requires login (non-guest)", actionClass.getName());
throw new UnauthorizedException();
}

Expand Down Expand Up @@ -224,7 +224,7 @@ private void _checkActionPermissions(Set<Role> contextualRoles) throws Unauthori
if (!SecurityManager.hasAllPermissions(this.getClass().getName()+"_checkActionPermissions",
c, user, permissionsRequired, contextualRoles))
{
LOG.debug(actionClass.getName() + ": action requires all permissions: " + permissionsRequired);
LOG.debug("{}: action requires all permissions: {}", actionClass.getName(), permissionsRequired);
throw new UnauthorizedException();
}

Expand All @@ -241,7 +241,7 @@ private void _checkActionPermissions(Set<Role> contextualRoles) throws Unauthori
if (!SecurityManager.hasAnyPermissions(this.getClass().getName() + "_checkActionPermissions",
c, user, permissionsAnyOf, contextualRoles))
{
LOG.debug(actionClass.getName() + ": action requires any permissions: " + permissionsAnyOf);
LOG.debug("{}: action requires any permissions: {}", actionClass.getName(), permissionsAnyOf);
throw new UnauthorizedException();
}
}
Expand Down
Loading
Loading