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 @@ -19,8 +19,6 @@
import org.labkey.api.security.User;
import org.labkey.api.security.UserManager.UserListener;

import java.beans.PropertyChangeEvent;

/**
* User: adam
* Date: Nov 5, 2008
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.labkey.announcements;

import org.jetbrains.annotations.NotNull;
import org.labkey.announcements.model.AnnouncementManager;
import org.labkey.api.admin.AbstractFolderImportFactory;
import org.labkey.api.admin.FolderArchiveDataTypes;
Expand All @@ -26,13 +25,9 @@
import org.labkey.api.message.settings.MessageConfigService;
import org.labkey.api.notification.EmailService;
import org.labkey.api.pipeline.PipelineJob;
import org.labkey.api.pipeline.PipelineJobWarning;
import org.labkey.api.writer.VirtualFile;
import org.labkey.folder.xml.NotificationsType;

import java.util.Collection;
import java.util.Collections;

/**
* User: cnathe
* Date: 10/31/12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public ToursController()
// Anyone with read permission can attempt to view the list. ToursTable will do further permission checking.
@RequiresPermission(ReadPermission.class)
@SuppressWarnings("UnusedDeclaration")
public class BeginAction extends SimpleViewAction<QueryForm>
public static class BeginAction extends SimpleViewAction<QueryForm>
{
@Override
public ModelAndView getView(QueryForm queryForm, BindException errors)
Expand Down Expand Up @@ -86,7 +86,7 @@ public static ActionURL getEditTourURL(Container c)

@ActionNames("edit, editTour")
@RequiresPermission(ReadPermission.class) //will check below
public class EditTourAction extends SimpleViewAction<EditTourForm>
public static class EditTourAction extends SimpleViewAction<EditTourForm>
{
@Override
public ModelAndView getView(EditTourForm editTourForm, BindException errors)
Expand Down Expand Up @@ -118,7 +118,7 @@ public void addNavTrail(NavTree root)

@ActionNames("tours, saveTour")
@RequiresPermission(ReadPermission.class) //will check below
public class SaveTourAction extends MutatingApiAction<SimpleApiJsonForm>
public static class SaveTourAction extends MutatingApiAction<SimpleApiJsonForm>
{
@Override
public void validateForm(SimpleApiJsonForm form, Errors errors)
Expand Down Expand Up @@ -173,7 +173,7 @@ public Object execute(SimpleApiJsonForm form, BindException errors)
}

@RequiresPermission(ReadPermission.class)
public class GetTourAction extends MutatingApiAction<SimpleApiJsonForm>
public static class GetTourAction extends MutatingApiAction<SimpleApiJsonForm>
{

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.labkey.api.announcements.api.Announcement;
import org.labkey.api.attachments.Attachment;
import org.labkey.api.data.Container;
import org.labkey.api.security.User;
import org.labkey.api.wiki.WikiRendererType;

import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public Announcement insertAnnouncement(Container c, User u, String title, String
}
}

if (validMemberListIds.size() > 0)
if (!validMemberListIds.isEmpty())
{
// insert.setMemberListIds(validMemberListIds); // This gets set in AnnouncementManager.validateModelWithSideEffects by parsing the memberListInput
insert.setMemberListInput(StringUtils.join(validMemberListIds, "\n")); // Pretend this is coming as comma-separated input from a form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
* limitations under the License.
*/
%>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="org.labkey.api.view.HttpView" %>
<%@ page import="org.labkey.api.view.Portal" %>
<%@ page import="org.labkey.api.view.ViewContext" %>
<%@ page import="java.util.Objects" %>
<%@ taglib prefix="labkey" uri="http://www.labkey.org/taglib" %>
<%@ page extends="org.labkey.api.jsp.JspBase" %>

<%
Portal.WebPart webPart = (Portal.WebPart)HttpView.currentModel();
ViewContext context = getViewContext();
String selected = StringUtils.defaultString(webPart.getPropertyMap().get("style"), "full");
String selected = Objects.toString(webPart.getPropertyMap().get("style"), "full");
%>

<labkey:form name="frmCustomize" method="post" action="<%=webPart.getCustomizePostURL(context)%>">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private static String loadBody()
}
catch (IOException e)
{
throw new UnexpectedException(e);
throw UnexpectedException.wrap(e);
}
}

Expand All @@ -194,20 +194,19 @@ protected void addCustomReplacements(Replacements replacements)

private void initReason()
{
StringBuilder sb = new StringBuilder();
sb.append("You have received this email because you are signed up for a daily digest of new posts to <a href=\"");
sb.append(PageFlowUtil.filter(dailyDigestBean.boardURL.getURIString()));
sb.append("\">");
sb.append(PageFlowUtil.filter(dailyDigestBean.boardPath));
sb.append("</a> at <a href=\"");
sb.append(PageFlowUtil.filter(dailyDigestBean.siteUrl));
sb.append("\">");
sb.append(PageFlowUtil.filter(dailyDigestBean.siteUrl));
sb.append("</a>. If you no longer wish to receive these notifications, please <a href=\"");
sb.append(PageFlowUtil.filter(dailyDigestBean.removeURL.getURIString()));
sb.append("\">change your email preferences</a>.");

reasonForEmail = sb.toString();
String sb = "You have received this email because you are signed up for a daily digest of new posts to <a href=\"" +
PageFlowUtil.filter(dailyDigestBean.boardURL.getURIString()) +
"\">" +
PageFlowUtil.filter(dailyDigestBean.boardPath) +
"</a> at <a href=\"" +
PageFlowUtil.filter(dailyDigestBean.siteUrl) +
"\">" +
PageFlowUtil.filter(dailyDigestBean.siteUrl) +
"</a>. If you no longer wish to receive these notifications, please <a href=\"" +
PageFlowUtil.filter(dailyDigestBean.removeURL.getURIString()) +
"\">change your email preferences</a>.";

reasonForEmail = sb;
}

private void initPosts()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,12 @@ private static void notifyModerators(Container c, User user, AnnouncementModel a
msg.setFrom(LookAndFeelProperties.getInstance(c).getSystemEmailAddress());
msg.setSubject("New " + name.toLowerCase() + " in " + c.getPath() + " (" + c.getTitle() + ") requires moderator review");

StringBuilder content = new StringBuilder();
content.append("Please visit the Moderator Review page at ").append(new ActionURL(ModeratorReviewAction.class, c).getURIString());
content.append("\n\nSubject: ").append(ann.getTitle());
content.append("\nUser: ").append(user.getDisplayName(user)).append(" (").append(user.getEmail()).append(")");
content.append("\n").append(name).append(": ").append(AnnouncementsController.getThreadURL(c, ann.getEntityId(), ann.getRowId()).getURIString());
String content = "Please visit the Moderator Review page at " + new ActionURL(ModeratorReviewAction.class, c).getURIString() +
"\n\nSubject: " + ann.getTitle() +
"\nUser: " + user.getDisplayName(user) + " (" + user.getEmail() + ")" +
"\n" + name + ": " + AnnouncementsController.getThreadURL(c, ann.getEntityId(), ann.getRowId()).getURIString();

msg.setTextContent(content.toString());
msg.setTextContent(content);
emailer.addMessage(toList, msg);
emailer.start();
}
Expand Down Expand Up @@ -1248,7 +1247,7 @@ private static String loadBody()
}
catch (IOException e)
{
throw new UnexpectedException(e);
throw UnexpectedException.wrap(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
public class DiscussionServiceImpl implements DiscussionService
{
@Override
public WebPartView startDiscussion(Container c, User user, String identifier, ActionURL pageURL, URLHelper cancelURL, String title, String summary, boolean allowMultipleDiscussions)
public WebPartView<?> startDiscussion(Container c, User user, String identifier, ActionURL pageURL, URLHelper cancelURL, String title, String summary, boolean allowMultipleDiscussions)
{
if (!allowMultipleDiscussions)
{
Expand Down Expand Up @@ -110,7 +110,7 @@ public static ActionURL fromSaved(String saved)
}


public WebPartView getDiscussion(Container c, URLHelper currentURL, AnnouncementModel ann, User user)
public WebPartView<?> getDiscussion(Container c, URLHelper currentURL, AnnouncementModel ann, User user)
{
// NOTE: don't pass in AnnouncementModel, it came from getBareAnnouncements()
return new AnnouncementsController.ThreadView(c, currentURL, user, null, ann.getEntityId());
Expand Down Expand Up @@ -147,7 +147,7 @@ public DiscussionService.DiscussionView getDiscussionArea(Container c, User user
{
discussionId = Integer.parseInt(id);
}
else if (displayFirstDiscussionByDefault && params.isEmpty() && discussions.size() > 0)
else if (displayFirstDiscussionByDefault && params.isEmpty() && !discussions.isEmpty())
{
discussionId = discussions.get(0).getRowId();
}
Expand All @@ -168,7 +168,7 @@ else if (displayFirstDiscussionByDefault && params.isEmpty() && discussions.size
// clean up discussion parameters (in case caller didn't)
pageURL.deleteScopeParameters("discussion");

WebPartView start = startDiscussion(c, user, objectId, pageURL, adjustedCurrentURL, newDiscussionTitle, "", allowMultipleDiscussions);
WebPartView<?> start = startDiscussion(c, user, objectId, pageURL, adjustedCurrentURL, newDiscussionTitle, "", allowMultipleDiscussions);
String title;

if (start instanceof AnnouncementsController.ThreadView)
Expand All @@ -188,8 +188,8 @@ else if (displayFirstDiscussionByDefault && params.isEmpty() && discussions.size
{
AnnouncementModel selected = null;

WebPartView discussionView = null;
HttpView respondView = null;
WebPartView<?> discussionView = null;
HttpView<?> respondView = null;

if (discussionId != 0)
{
Expand Down Expand Up @@ -246,7 +246,7 @@ public void deleteDiscussions(Container c, User user, String... identifiers)
@Override
public void deleteDiscussions(Container container, User user, Collection<String> identifiers)
{
Collection<AnnouncementModel> discussions = AnnouncementManager.getDiscussions(container, identifiers.toArray(new String[identifiers.size()]));
Collection<AnnouncementModel> discussions = AnnouncementManager.getDiscussions(container, identifiers.toArray(new String[0]));
for (AnnouncementModel ann : discussions)
{
AnnouncementManager.deleteAnnouncement(container, ann.getRowId());
Expand Down Expand Up @@ -328,17 +328,17 @@ public static class AnchorView extends HtmlView
}


public static class ThreadWrapper extends WebPartView
public static class ThreadWrapper extends WebPartView<Object>
{
String _id;
String _class = "labkey-hidden";
VBox _vbox;

ThreadWrapper(URLHelper currentURL, String caption, HttpView... views)
ThreadWrapper(URLHelper currentURL, String caption, HttpView<?>... views)
{
super(FrameType.NONE);
_vbox = new VBox();
for (HttpView v : views)
for (HttpView<?> v : views)
{
if (v != null)
{
Expand All @@ -354,7 +354,7 @@ public static class ThreadWrapper extends WebPartView

_id = "discussionBox" + UniqueID.getRequestScopedUID(HttpView.currentRequest());

for (HttpView view : views)
for (HttpView<?> view : views)
{
if (view != null)
addClientDependencies(view.getClientDependencies());
Expand Down Expand Up @@ -399,7 +399,7 @@ public void doEndTag(PrintWriter out)
}


public static class PickerView extends JspView
public static class PickerView extends JspView<Object>
{
final public String discussionAreaId;
final public URLHelper pageURL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public boolean shouldSend(@Nullable AnnouncementModel ann, User user)
// log information to mothership (to help track this down) and return false (to avoid subsequent NPE).
if (null == up)
{
ExceptionUtil.logExceptionToMothership(HttpView.currentRequest(), new IllegalStateException("UserPreference is null for user: " + user.getEmail() + ", ann: " + (null != ann ? ann.getRowId() : null) + ", c: " + _c.toString() + "\n" + pp.toString()));
ExceptionUtil.logExceptionToMothership(HttpView.currentRequest(), new IllegalStateException("UserPreference is null for user: " + user.getEmail() + ", ann: " + (null != ann ? ann.getRowId() : null) + ", c: " + _c.toString() + "\n" + pp));
return false;
}

Expand Down Expand Up @@ -213,7 +213,7 @@ UserPreference getApplicablePreference(@Nullable AnnouncementModel ann)
@Override
public String toString()
{
return "PreferencePicker: " + _c.getId() + " " + _preferenceMap.toString();
return "PreferencePicker: " + _c.getId() + " " + _preferenceMap;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public JSONObject abbrevDef()
public JSONObject toJSON()
{
JSONObject out = new JSONObject();
if (!getJson().equals(""))
if (!getJson().isEmpty())
{
out = new JSONObject(getJson());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ public QueryUpdateService getUpdateService()

private static class SubscriptionTarget
{
@NotNull private User _user;
@NotNull private Container _container;
@NotNull private String _srcIdentifier;
@NotNull private final User _user;
@NotNull private final Container _container;
@NotNull private final String _srcIdentifier;

private SubscriptionTarget(@NotNull User user, @NotNull Container container, @NotNull String srcIdentifier)
{
Expand Down Expand Up @@ -203,7 +203,7 @@ private SubscriptionTarget getTargets(Map<String, Object> row, User user, Contai
targetContainer = ContainerManager.getForId(folderId.toString());
if (targetContainer == null)
{
throw new InvalidKeyException("No such Folder: " + folderId.toString());
throw new InvalidKeyException("No such Folder: " + folderId);
}
}

Expand Down
4 changes: 2 additions & 2 deletions announcements/src/org/labkey/announcements/update.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ if (settings.hasExpires())
for (Attachment att : ann.getAttachments())
{
x++;
id = makeId("remove_");
%><tr id="attach-<%=x%>">
makeId("remove_");
%><tr id="attach-<%=x%>">
<td><img src="<%=getWebappURL(att.getFileIcon())%>" alt="logo"/>&nbsp;<%= h(att.getName()) %></td>
<td><%= link("remove").onClick("LABKEY.discuss.removeAttachment(" + q(ann.getEntityId()) + "," + q(att.getName()) + "," + q("attach-"+x) + ");") %></td>
</tr><%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public enum AuditBehaviorType
DETAILED("Detailed"),
SUMMARY("Summary");

private String _label;
private final String _label;

AuditBehaviorType(String label)
{
Expand Down
2 changes: 1 addition & 1 deletion api/gwtsrc/org/labkey/api/gwt/client/DefaultScaleType.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum DefaultScaleType
LINEAR("Linear"),
LOG("Log");

private String _label;
private final String _label;

DefaultScaleType(String label)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ public class GWTProtocol implements IsSerializable
private List<GWTDomain<GWTPropertyDescriptor>> _domains;

private List<String> _availablePlateTemplates;
private Map<String, String> _availableMetadataInputFormats = new HashMap<String, String>();
private Map<String, String> _availableMetadataInputFormats = new HashMap<>();
private String _metadataInputFormatHelp;

private String _selectedPlateTemplate;
private String _selectedMetadataInputFormat;

/** Scripts defined in the module itself, associated with the assay provider */
private List<String> _moduleTransformScripts = new ArrayList<String>();
private List<String> _moduleTransformScripts = new ArrayList<>();
/** Scripts defined in the assay definition */
private List<Map<String, Object>> _protocolTransformScripts = new ArrayList<>();
private final List<Map<String, Object>> _protocolTransformScripts = new ArrayList<>();

private List<String> _availableDetectionMethods;
private String _selectedDetectionMethod;
Expand Down
Loading
Loading