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 @@ -87,7 +87,7 @@ public Rating[] getRatingsByToolAllVersions(String toolLsid)
for (SkylineTool tool : tools)
ratings.addAll(Arrays.asList(getRatingsByToolId(tool.getRowId())));
}
return ratings.toArray(new Rating[ratings.size()]);
return ratings.toArray(new Rating[0]);
}

public boolean userLeftRating(String toolLsid, User user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public SkylineToolsStoreController()
}

@RequiresPermission(ReadPermission.class)
public class BeginAction extends SimpleViewAction
public static class BeginAction extends SimpleViewAction<Object>
{
@Override
public ModelAndView getView(Object o, BindException errors) throws Exception
Expand Down Expand Up @@ -460,7 +460,7 @@ public ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest,
ArrayList<User> toolOwnersUsers = parsedOwners.first;
ArrayList<String> toolOwnersInvalid = parsedOwners.second;

if (toolOwnersInvalid.size() > 0)
if (!toolOwnersInvalid.isEmpty())
{
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "form",
UNKNOWN_USERS + StringUtils.join(toolOwnersInvalid, ", "));
Expand Down Expand Up @@ -607,7 +607,7 @@ else if (!getContainer().hasPermission(getUser(), InsertPermission.class))
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "sender", sender);
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "updatetarget", updateTargetString);
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "toolowners", toolOwners);
return new JspView("/org/labkey/skylinetoolsstore/view/SkylineToolsStoreUpload.jsp", null);
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineToolsStoreUpload.jsp", null);
}

@Override
Expand Down Expand Up @@ -667,9 +667,9 @@ protected ModelAndView handleRequestInternal(HttpServletRequest httpServletReque
final String ratingIdString = httpServletRequest.getParameter("ratingId");
int ratingId;
try {
ratingId = (ratingIdString != null && !ratingIdString.isEmpty()) ? Integer.parseInt(ratingIdString) : -1;;
ratingId = (ratingIdString != null && !ratingIdString.isEmpty()) ? Integer.parseInt(ratingIdString) : -1;
} catch(Exception e) {
return new JspView("/org/labkey/skylinetoolsstore/view/SkylineRating.jsp", null);
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineRating.jsp", null);
}
Rating rating = (ratingId < 0) ? null : RatingManager.get().getRatingById(ratingId);
final SkylineTool tool = SkylineToolsStoreManager.get().getTool((toolId >= 0) ? toolId : rating.getToolId());
Expand All @@ -679,7 +679,7 @@ protected ModelAndView handleRequestInternal(HttpServletRequest httpServletReque
try {
ratingValue = Integer.parseInt(ratingValueString);
} catch(Exception e) {
return new JspView("/org/labkey/skylinetoolsstore/view/SkylineRating.jsp", null);
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineRating.jsp", null);
}
final String ratingTitle = httpServletRequest.getParameter("title");
final String review = httpServletRequest.getParameter("review");
Expand All @@ -701,7 +701,7 @@ else if (ratingValue < 1 || ratingValue > 5)
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "form",
NO_RATING);
}
else if (review == null || review.length() == 0)
else if (review == null || review.isEmpty())
{
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "form",
NO_REVIEW);
Expand Down Expand Up @@ -748,7 +748,7 @@ else if (tool == null || (ratingId >= 0 && rating == null))
if (review != null)
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "formReview", review);

return new JspView("/org/labkey/skylinetoolsstore/view/SkylineRating.jsp", null);
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineRating.jsp", null);
}

@Override
Expand Down Expand Up @@ -813,7 +813,7 @@ public ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest,
{
httpServletRequest.setAttribute(BindingResult.MODEL_KEY_PREFIX + "form", INVALID_TOOL_ID + " " + suppTargetString);
httpServletRequest.setAttribute(BindingResult.MODEL_KEY_PREFIX + "supptarget", suppTargetString);
return new JspView("/org/labkey/skylinetoolsstore/view/SkylineToolSupplementUpload.jsp", null);
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineToolSupplementUpload.jsp", null);
}

SkylineTool tool = SkylineToolsStoreManager.get().getTool(suppTarget);
Expand Down Expand Up @@ -846,7 +846,7 @@ public ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest,
}

getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "supptarget", suppTargetString);
return new JspView("/org/labkey/skylinetoolsstore/view/SkylineToolSupplementUpload.jsp", null);
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineToolSupplementUpload.jsp", null);
}

@Override
Expand Down Expand Up @@ -902,7 +902,7 @@ public void checkPermissions() throws UnauthorizedException
}

@RequiresLogin
public class DeleteAction extends FormHandlerAction<IdForm>
public static class DeleteAction extends FormHandlerAction<IdForm>
{
@Override
public URLHelper getSuccessURL(IdForm idForm)
Expand Down Expand Up @@ -1002,7 +1002,7 @@ public class DeleteLatestAction extends AbstractController implements Permission
@Override
public ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception
{
Integer id;
int id;
try {
id = Integer.parseInt(httpServletRequest.getParameter("id"));
}
Expand Down Expand Up @@ -1156,7 +1156,7 @@ public void checkPermissions() throws UnauthorizedException

@RequiresNoPermission
@ActionNames("downloadFile")
public class DownloadToolFileAction extends SimpleViewAction<DownloadFileForm> implements PermissionCheckable
public static class DownloadToolFileAction extends SimpleViewAction<DownloadFileForm> implements PermissionCheckable
{
@Override
public ModelAndView getView(DownloadFileForm form, BindException errors) throws Exception
Expand Down Expand Up @@ -1243,8 +1243,7 @@ public ModelAndView getView(ViewToolDetailsForm form, BindException errors) thro
_tool = SkylineToolsStoreManager.get().getTool(toolId);
if (_tool == null)
{
StringBuilder msg = new StringBuilder("Could not find tool ").append(" by Id ").append(toolId);
errors.reject(SpringActionController.ERROR_MSG, msg.toString());
errors.reject(SpringActionController.ERROR_MSG, "Could not find tool " + " by Id " + toolId);
return new SimpleErrorView(errors);
}
}
Expand Down Expand Up @@ -1396,7 +1395,7 @@ public ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest,
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "toolowners", toolOwners);
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "sender", sender);
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "updatetarget", updateTargetString);
return new JspView("/org/labkey/skylinetoolsstore/view/SkylineToolManageOwners.jsp", null);
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineToolManageOwners.jsp", null);
}

@Override
Expand All @@ -1414,7 +1413,7 @@ public class UpdatePropertyAction extends AbstractController implements Permissi
@Override
public ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception
{
final Integer id = Integer.parseInt(httpServletRequest.getParameter("id"));
final int id = Integer.parseInt(httpServletRequest.getParameter("id"));

final SkylineTool tool = SkylineToolsStoreManager.get().getTool(id);
if(tool == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.labkey.skylinetoolsstore.model.SkylineTool;
import org.labkey.skylinetoolsstore.view.SkylineToolsStoreWebPart;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -66,19 +65,21 @@ public boolean hasScripts()
@NotNull
protected Collection<WebPartFactory> createWebPartFactories()
{
return new ArrayList<WebPartFactory>(
Arrays.asList(
new BaseWebPartFactory("Skyline Tool Store") {
return new ArrayList<>(
Arrays.asList(
new BaseWebPartFactory("Skyline Tool Store")
{
addLegacyNames("Skyline Tools Store");
}
@Override
public WebPartView getWebPartView(@NotNull ViewContext portalCtx, Portal.@NotNull WebPart webPart) throws WebPartConfigurationException
{
return new SkylineToolsStoreWebPart();
{
addLegacyNames("Skyline Tools Store");
}

@Override
public WebPartView getWebPartView(@NotNull ViewContext portalCtx, Portal.@NotNull WebPart webPart) throws WebPartConfigurationException
{
return new SkylineToolsStoreWebPart();
}
}
}
));
));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import org.labkey.api.data.dialect.SqlDialect;
import org.labkey.api.data.TableInfo;

import java.lang.String;

public class SkylineToolsStoreSchema
{
private static final SkylineToolsStoreSchema _instance = new SkylineToolsStoreSchema();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ public void setRowId(Integer rowId)

public boolean equals(Object obj)
{
if (!(obj instanceof Rating))
if (!(obj instanceof Rating p))
return false;
Rating p = (Rating)obj;

return Objects.equals(_rating, p.getRating()) &&
Objects.equals(_toolId, p.getToolId()) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ public void setRowId(Integer rowId)

public boolean equals(Object obj)
{
if (!(obj instanceof SkylineTool))
if (!(obj instanceof SkylineTool p))
return false;
SkylineTool p = (SkylineTool)obj;

return Objects.equals(_name, p.getName()) &&
Objects.equals(_authors, p.getAuthors()) &&
Expand Down
2 changes: 1 addition & 1 deletion lincs/src/org/labkey/lincs/DocImportListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

public class DocImportListener implements ExperimentListener, SkylineDocumentImportListener
{
private static Logger _log = LogManager.getLogger(DocImportListener.class);
private static final Logger _log = LogManager.getLogger(DocImportListener.class);

@Override
public void beforeRunDelete(ExpProtocol protocol, ExpRun run, User user)
Expand Down
18 changes: 9 additions & 9 deletions lincs/src/org/labkey/lincs/Gct.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
*/
public class Gct
{
private List<GctEntity> _probes;
private Map<String, Integer> _probeIndexMap;
private List<GctEntity> _replicates;
private Map<String, Integer> _replicateIndexMap;
private GctTable<ProbeReplicate> _areaRatios;
private final List<GctEntity> _probes;
private final Map<String, Integer> _probeIndexMap;
private final List<GctEntity> _replicates;
private final Map<String, Integer> _replicateIndexMap;
private final GctTable<ProbeReplicate> _areaRatios;

private List<String> _probeAnnotationNames;
private List<String> _replicateAnnotationNames;
Expand Down Expand Up @@ -164,7 +164,7 @@ public List<GctEntity> getSortedReplicates()
// Sort replicates by the value of the det_plate annotation, and then
// by replicate name. For custom GCT, the replicate name is:
// <exp_type>_<plate_number>_<original_replicate_name>
List<GctEntity> sortedReplicates = new ArrayList<GctEntity>(_replicates.size());
List<GctEntity> sortedReplicates = new ArrayList<>(_replicates.size());
sortedReplicates.addAll(_replicates);
sortedReplicates.sort((rep1, rep2) ->
{
Expand Down Expand Up @@ -262,7 +262,7 @@ public void setIgnoredProbeAnnotations(Set<String> ignored)
public static class GctEntity
{
private final String _name;
private Map<String, String> _annotations;
private final Map<String, String> _annotations;

public GctEntity(String name)
{
Expand Down Expand Up @@ -418,7 +418,7 @@ public String toString()

public interface GctKeyBuilder <T extends GctKey>
{
public T build(String key1, String key2);
T build(String key1, String key2);
}

public static class ProbePlateKeyBuilder implements GctKeyBuilder<ProbeExpTypePlate>
Expand Down Expand Up @@ -446,7 +446,7 @@ public GctFileException(String message, Throwable cause)

public static class GctTable <T extends GctKey>
{
private Map<T, String> _map;
private final Map<T, String> _map;
private List<String> _sortedKey2;

public GctTable()
Expand Down
Loading