Skip to content

Commit bdfb7d1

Browse files
committed
Address some miscellaneous warnings
1 parent bd4eee1 commit bdfb7d1

8 files changed

Lines changed: 24 additions & 37 deletions

File tree

api/src/org/labkey/api/admin/AdminBean.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ public static class RecentUser
8080
public static final String servletContainer = ModuleLoader.getServletContext().getServerInfo();
8181
public static final String servletConfiguration = "Embedded";
8282
public static final String sessionTimeout = Formats.commaf0.format(ModuleLoader.getServletContext().getSessionTimeout());
83-
@SuppressWarnings("unused") // Available substitution property, not used directly in code
8483
public static final String buildTime = ModuleLoader.getInstance().getCoreModule().getBuildTime();
85-
@SuppressWarnings("unused") // Available substitution property, not used directly in code
8684
public static final String serverStartupTime = DateUtil.formatDateTime(ContainerManager.getRoot());
8785
public static final List<Module> modules;
8886

api/src/org/labkey/api/exp/api/ExperimentService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,10 +1297,13 @@ public XarImportOptions setStrictValidateExistingSampleType(boolean strictValida
12971297
}
12981298
}
12991299

1300+
@Deprecated // Use IntegerUtils.asLong() instead
13001301
static Long asLong(Object o)
13011302
{
13021303
return null==o ? null : o.getClass() == Long.class ? (Long)o : ((Number)o).longValue();
13031304
}
1305+
1306+
@Deprecated // Use IntegerUtils.asLong() instead
13041307
static Integer asInteger(Object o)
13051308
{
13061309
if (null == o)

api/src/org/labkey/api/util/IntegerUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
/**
77
* This Class to help with dealing with Object that may represent an integer number (char,short,int,long). It
8-
* is meant to fill in the small gap between Java (e.g casts and instanceof) and ConvertUtils. Hopefully, this
8+
* is meant to fill in the small gap between Java (e.g. casts and instanceof) and ConvertUtils. Hopefully, this
99
* class makes it just a little easier to deal with Integer valued Numbers.
1010
* <br>
11-
* Unfortunately, Number does not help with detecting integer/non-integer types, so this class only handles Object
12-
* instances that have corresponding to the primitive types. {@code boolean}, {@code byte}, {@code char},
11+
* Unfortunately, Number does not help with detecting integer/noninteger types, so this class only handles Object
12+
* instances that have corresponding to the primitive types. {@code boolean}, {@code byte}, {@code char},
1313
* {@code short}, {@code int}, {@code long}, {@code float}, and {@code double})
1414
* <br>
1515
* Because "Integer" is kind of ambiguous, I will use "Integral" to mean any integer type. For now, I am not including

api/src/org/labkey/api/view/DataViewSnapshotSelectionForm.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.labkey.api.collections.LongHashSet;
44
import org.labkey.api.data.DataRegionSelection;
55

6-
import java.util.HashSet;
76
import java.util.Set;
87

98
public class DataViewSnapshotSelectionForm extends DataViewSelectionForm

query/src/org/labkey/query/QueryServiceImpl.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -385,18 +385,16 @@ private static SQLFragment getColumnInSql(@NotNull FieldKey fieldKey, Object val
385385

386386
SQLFragment fromSql = t.getFromSQL("_");
387387

388-
SQLFragment sqlFragment = new SQLFragment()
389-
.append("(").appendIdentifier(col.getAlias())
390-
.append(")")
391-
.append(negate ? " NOT" : "")
392-
.append(" IN (")
393-
.append(" SELECT ")
394-
.append(t.getColumns().get(0).getValueSql("_"))
395-
.append(" FROM ")
396-
.append(fromSql)
397-
.append(")");
398-
399-
return sqlFragment;
388+
return new SQLFragment()
389+
.append("(").appendIdentifier(col.getAlias())
390+
.append(")")
391+
.append(negate ? " NOT" : "")
392+
.append(" IN (")
393+
.append(" SELECT ")
394+
.append(t.getColumns().get(0).getValueSql("_"))
395+
.append(" FROM ")
396+
.append(fromSql)
397+
.append(")");
400398
}
401399

402400
/**

query/src/org/labkey/query/reports/AttachmentReport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public String getType()
8080
@Override
8181
public boolean canEdit(User user, Container container, List<ValidationError> errors)
8282
{
83-
// disallow a non site admin user from editing a server AttachmentReport
83+
// disallow a non-site-admin user from editing a server AttachmentReport
8484
if (StringUtils.isNotEmpty(getFilePath()) && !container.hasPermission(user, AdminOperationsPermission.class))
8585
{
8686
errors.add(new SimpleValidationError("You must be an administrator in order to edit this report."));

search/src/org/labkey/search/view/SearchWebPartFactory.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,13 @@
1818
import org.jetbrains.annotations.NotNull;
1919
import org.labkey.api.data.BooleanFormat;
2020
import org.labkey.api.view.AlwaysAvailableWebPartFactory;
21-
import org.labkey.api.view.HttpView;
2221
import org.labkey.api.view.JspView;
23-
import org.labkey.api.view.Portal;
22+
import org.labkey.api.view.Portal.WebPart;
2423
import org.labkey.api.view.ViewContext;
2524
import org.labkey.api.view.WebPartFactory;
26-
import org.labkey.api.view.WebPartView;
2725

2826
import java.text.ParseException;
2927

30-
/**
31-
* User: adam
32-
* Date: Jan 19, 2010
33-
* Time: 2:03:13 PM
34-
*/
3528
public class SearchWebPartFactory extends AlwaysAvailableWebPartFactory
3629
{
3730
public SearchWebPartFactory()
@@ -41,7 +34,7 @@ public SearchWebPartFactory()
4134
}
4235

4336
@Override
44-
public WebPartView<?> getWebPartView(@NotNull ViewContext portalCtx, @NotNull Portal.WebPart webPart)
37+
public SearchWebPart getWebPartView(@NotNull ViewContext portalCtx, @NotNull WebPart webPart)
4538
{
4639
boolean includeSubfolders = includeSubfolders(webPart);
4740

@@ -57,13 +50,13 @@ public WebPartView<?> getWebPartView(@NotNull ViewContext portalCtx, @NotNull Po
5750

5851

5952
@Override
60-
public HttpView<?> getEditView(Portal.WebPart webPart, ViewContext context)
53+
public JspView<WebPart> getEditView(WebPart webPart, ViewContext context)
6154
{
6255
return new JspView<>("/org/labkey/search/view/customizeSearchWebPart.jsp", webPart);
6356
}
6457

6558

66-
public static boolean includeSubfolders(Portal.WebPart part)
59+
public static boolean includeSubfolders(WebPart part)
6760
{
6861
String value = part.getPropertyMap().get("includeSubfolders");
6962

@@ -77,5 +70,3 @@ public static boolean includeSubfolders(Portal.WebPart part)
7770
}
7871
}
7972
}
80-
81-

study/src/org/labkey/study/query/DatasetQueryView.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,13 +594,11 @@ private MenuButton createQCStateButton()
594594
}
595595

596596
boolean addSeparator = false;
597+
597598
if (getContainer().hasPermission(getUser(), QCAnalystPermission.class))
598599
{
599-
if (!addSeparator)
600-
{
601-
addSeparator = true;
602-
button.addSeparator();
603-
}
600+
addSeparator = true;
601+
button.addSeparator();
604602
ActionURL updateAction = new ActionURL(StudyController.UpdateQCStateAction.class, getContainer());
605603
updateAction.addReturnUrl(getViewContext().getActionURL());
606604
button.addMenuItem("Update state of selected rows", "if (verifySelected(" + DataRegion.getJavaScriptObjectReference(getDataRegionName()) + ".form, \"" +

0 commit comments

Comments
 (0)