Skip to content
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class BeginAction extends SimpleViewAction
{
public ModelAndView getView(Object o, BindException errors)
{
return new JspView("/org/labkey/communityartifacts/view/hello.jsp");
return new JspView<>("/org/labkey/communityartifacts/view/hello.jsp");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class BeginAction extends SimpleViewAction
{
public ModelAndView getView(Object o, BindException errors)
{
return new JspView("/org/labkey/starterartifacts/view/hello.jsp");
return new JspView<>("/org/labkey/starterartifacts/view/hello.jsp");
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions data/qc/src/org/labkey/AbstractAssayValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public abstract class AbstractAssayValidator
private String _email;
private String _password;
private File _errorFile;
private Map<String, String> _runProperties = new HashMap<>();
private Map<String, String> _transformFile = new HashMap<>();
private List<String> _errors = new ArrayList<>();
private final Map<String, String> _runProperties = new HashMap<>();
private final Map<String, String> _transformFile = new HashMap<>();
private final List<String> _errors = new ArrayList<>();
private String _host;

public enum Props {
Expand Down
9 changes: 0 additions & 9 deletions data/qc/src/org/labkey/AssayTransformNoOp.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@
*/
package org.labkey;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class AssayTransformNoOp extends AbstractAssayValidator
{
Expand Down
4 changes: 2 additions & 2 deletions data/qc/src/org/labkey/AssayValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public void runQC(File inputFile, String username, String password, String host)
if (getRunProperties().containsKey(Props.runDataFile.name()))
{
List<Map<String, String>> dataMap = parseRunData(new File(getRunProperties().get(Props.runDataFile.name())));
Map<String, String> ptidMap = new HashMap<String, String>();
Map<String, String> animalMap = new HashMap<String, String>();
Map<String, String> ptidMap = new HashMap<>();
Map<String, String> animalMap = new HashMap<>();

for (Map<String, String> row : dataMap)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public CrawlerTestController()
}

@RequiresPermission(ReadPermission.class)
public class InjectJspAction extends SimpleViewAction<InjectForm>
public static class InjectJspAction extends SimpleViewAction<InjectForm>
{
@Override
public void validate(InjectForm form, BindException errors)
Expand Down
3 changes: 1 addition & 2 deletions modules/dumbster/src/com/dumbster/smtp/SimpleSmtpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class SimpleSmtpServer implements Runnable {
/**
* Port the server listens on - set to the default SMTP port initially.
*/
private int port = DEFAULT_SMTP_PORT;
private final int port;

/**
* Timeout listening on server socket.
Expand Down Expand Up @@ -166,7 +166,6 @@ public synchronized void stop() {
* @param out output stream
* @param input input stream
* @return List of SmtpMessage
* @throws IOException
*/
private List<SmtpMessage> handleTransaction(PrintWriter out, BufferedReader input) throws IOException {
// Initialize the state machine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ public EditableModuleController()
}

@RequiresPermission(ReadPermission.class)
public class HelloAction extends SimpleViewAction
public static class HelloAction extends SimpleViewAction<Object>
{
@Override
public ModelAndView getView(Object o, BindException errors)
{
return new JspView("/org/labkey/editablemodule/view/hello.jsp");
return new JspView<>("/org/labkey/editablemodule/view/hello.jsp");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*/
public class TestLinkedSchemaCustomizer implements LinkedSchemaCustomizer
{
private static Logger LOG = LogManager.getLogger(TestLinkedSchemaCustomizer.class);
private static final Logger LOG = LogManager.getLogger(TestLinkedSchemaCustomizer.class);

// Name of the parameter declaration
private static final String PARAM_FAMILY = "PARAM_FAMILY";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.labkey.api.data.TableInfo;

import java.util.Collection;
import java.util.List;

public class TestTableCustomizer implements TableCustomizer
{
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/junit/rules/TestWatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public Statement apply(final Statement base, final Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
List<Throwable> errors = new ArrayList<Throwable>();
List<Throwable> errors = new ArrayList<>();

try {
starting(description);
Expand Down
4 changes: 2 additions & 2 deletions src/org/labkey/junit/runner/WebTestProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

public abstract class WebTestProperties
{
private static TestMap associatedTests = new TestMap(); // Stores Tests, keyed by associated module.
private static ModuleMap associatedModules = new ModuleMap();
private static final TestMap associatedTests = new TestMap(); // Stores Tests, keyed by associated module.
private static final ModuleMap associatedModules = new ModuleMap();
private static final List<String> installedModules = getInstalledModules();

private static void loadTestProperties(Class<?> testClass)
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/remoteapi/admin/GetModulesResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Set<Module> getModules()
return _modules;
}

public class Module extends ResponseObject implements Comparable<Module>
public static class Module extends ResponseObject implements Comparable<Module>
{
String _tabName;
String _name;
Expand Down
2 changes: 0 additions & 2 deletions src/org/labkey/remoteapi/issues/IssueModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ public String getNotify()

/**
* when notify is just 1 user, you can provide their email
* @param notify
* @return
*/
public IssueModel setNotify(String notify)
{
Expand Down
1 change: 0 additions & 1 deletion src/org/labkey/remoteapi/issues/IssueResponseModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public List<IssueComment> getComments()

/**
* for ad-hoc querying of _serverProps
* @param key
* @return the object at that key
*/
public Object getProperties(String key)
Expand Down
6 changes: 2 additions & 4 deletions src/org/labkey/remoteapi/plate/CreatePlateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class CreatePlateParams
private String _assayType; // blank or Standard
private List<Map<String, Object>> _data = new ArrayList<>();
private String _description;
private String _name;
private Integer _plateSetId;
private final String _name;
private final Integer _plateSetId;
private Integer _plateType; // 1- 3x4(12), 2- 4x6(24), 3-6x8(48), 4-8x12(96), 5-16x24(384)
private boolean _template;

Expand Down Expand Up @@ -55,8 +55,6 @@ public String getName()
/**
* Sets the plate type for plate creation
* // 1- 3x4(12), 2- 4x6(24), 3-6x8(48), 4-8x12(96), 5-16x24(384)
* @param plateType
* @return
*/
public CreatePlateParams setPlateType(PlateTypes plateType)
{
Expand Down
4 changes: 2 additions & 2 deletions src/org/labkey/remoteapi/plate/CreatePlateSetParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CreatePlateSetParams
// This will match PlateController.CreatePlateSetForm
private String _name;
private String _description;
private List<CreatePlateSetPlate> _plates = new ArrayList<CreatePlateSetPlate>();
private List<CreatePlateSetPlate> _plates = new ArrayList<>();
private PlateSetType _type;
private String _plateSetId; // optional
private Integer _rowId;
Expand All @@ -33,7 +33,7 @@ public JSONObject toJSON()
json.put("parentPlateSetId", _parentPlateSetId);
if (_plateSetId != null)
json.put("plateSetId", _plateSetId);
if (_plates.size() > 0)
if (!_plates.isEmpty())
{
JSONArray plates = new JSONArray();
for (CreatePlateSetPlate plate : _plates)
Expand Down
1 change: 0 additions & 1 deletion src/org/labkey/remoteapi/puppeteer/PuppeteerSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import org.json.JSONObject;
import org.labkey.remoteapi.CommandResponse;
import org.labkey.test.util.TestLogger;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public static class Params
private List<String> tables = new ArrayList<>();
private String dataSource = "labkeyDataSource";
private boolean includeSystem = true;
private boolean editable = false;
private final boolean editable = false;
private boolean indexable = true;
private boolean fastCacheRefresh = true; // Enable fast refresh by default for tests
private final boolean fastCacheRefresh = true; // Enable fast refresh by default for tests
private String metaData = "";

public Params(String userSchemaName, String sourceSchemaName)
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/remoteapi/security/GetRolesResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public List<Role> getRoles()
return _roles;
}

public class Role extends ResponseObject
public static class Role extends ResponseObject
{
String _uniqueName;
String _name;
Expand Down
12 changes: 6 additions & 6 deletions src/org/labkey/serverapi/collections/ArrayListMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ public Set<Entry<K, Integer>> entrySet()

public ArrayListMap()
{
this(new FindMap<>(new HashMap<K, Integer>()), new ArrayList<V>());
this(new FindMap<>(new HashMap<>()), new ArrayList<>());
}


public ArrayListMap(int columnCount)
{
this(new FindMap<>(new HashMap<K, Integer>(columnCount * 2)), new ArrayList<V>(columnCount));
this(new FindMap<>(new HashMap<>(columnCount * 2)), new ArrayList<>(columnCount));
}


Expand All @@ -161,7 +161,7 @@ public ArrayListMap(ArrayListMap<K, V> m, List<V> row)

public ArrayListMap(FindMap<K> findMap)
{
this(findMap, new ArrayList<V>(findMap.size()));
this(findMap, new ArrayList<>(findMap.size()));
}


Expand Down Expand Up @@ -378,14 +378,14 @@ public void test()
a.put("C", "three");
a.put("D", "four");

ArrayListMap<String,String> b = new ArrayListMap<>(a, new ArrayList<String>());
ArrayListMap<String,String> b = new ArrayListMap<>(a, new ArrayList<>());
b.put("A", "ONE");
b.put("E", "FIVE");
a.put("F", "six");
b.put("G", "SEVEN");

assertEquals(a.get("A"), "one");
assertEquals(b.get("A"), "ONE");
assertEquals("one", a.get("A"));
assertEquals("ONE", b.get("A"));

assertTrue(a.containsKey("E"));
assertNull(a.get("E"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ public void parseContent(InputStream stream, ContentHandler h) throws IOExceptio
Object value = row.get(cd.name);
if (value != null)
{
if (value instanceof String)
if (value instanceof String str)
{
String str = (String)value;
write(h, str);
}
else
Expand Down
5 changes: 2 additions & 3 deletions src/org/labkey/serverapi/reader/DataLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ public void setPreserveEmptyString(boolean preserveEmptyString)
* Most useful if maps are being returned, otherwise use inferColumnInfo(reader, clazz) to
* use properties of a bean instead.
*
* @throws java.io.IOException
*/
@SuppressWarnings({"ConstantConditions"})
private void inferColumnInfo() throws IOException
Expand Down Expand Up @@ -321,7 +320,7 @@ protected abstract class DataLoaderIterator implements CloseableIterator<Map<Str

private Object[] _fields = null;
private Map<String, Object> _values = null;
private int _lineNum = 0;
private int _lineNum;
private boolean _closed = false;


Expand All @@ -337,7 +336,7 @@ protected DataLoaderIterator(int lineNum) throws IOException
if (column.load)
active.add(column);

_activeColumns = active.toArray(new ColumnDescriptor[active.size()]);
_activeColumns = active.toArray(new ColumnDescriptor[0]);
ArrayListMap.FindMap<String> colMap = new ArrayListMap.FindMap<>(new CaseInsensitiveHashMap<>());

for (int i = 0; i < _activeColumns.length; i++)
Expand Down
12 changes: 6 additions & 6 deletions src/org/labkey/serverapi/reader/FileType.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ public enum gzSupportLevel
/**
* A list of possible suffixes in priority order. Later suffixes may also match earlier suffixes
*/
private List<String> _suffixes;
private final List<String> _suffixes;
/**
* a list of filetypes to reject - handles the scenario where old pepxml files are "foo.xml" and
* we have to avoid grabbing "foo.pep-prot.xml"
*/
private List<FileType> _antiTypes;
private final List<FileType> _antiTypes;
/**
* The canonical suffix, will be used when creating new files from scratch
*/
private String _defaultSuffix;
private final String _defaultSuffix;

/**
* Mime content type.
*/
private List<String> _contentTypes;
private final List<String> _contentTypes;

private Boolean _dir;
private final Boolean _dir;
/**
* If _preferGZ is true, assume suffix.gz for new files to support TPP's transparent .xml.gz useage.
* When dealing with existing files, non-gz version is still assumed to be the target if found
Expand All @@ -75,7 +75,7 @@ public enum gzSupportLevel
* If _supportGZ is true, accept .suffix.gz as the equivalent of .suffix
**/
private Boolean _supportGZ;
private boolean _caseSensitiveOnCaseSensitiveFileSystems = false;
private final boolean _caseSensitiveOnCaseSensitiveFileSystems = false;

/**
* @param suffixes list of what are usually the file extensions (but may be some other suffix to
Expand Down
4 changes: 2 additions & 2 deletions src/org/labkey/serverapi/reader/TabFileType.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public boolean isHeaderMatch(@NotNull byte[] header)
int fieldLen = -1;
for (String line : lines)
{
if (line.length() == 0 || line.charAt(0) == TabLoader.COMMENT_CHAR)
if (line.isEmpty() || line.charAt(0) == TabLoader.COMMENT_CHAR)
continue;

String[] fields = line.split(delim, -1);
Expand Down Expand Up @@ -96,7 +96,7 @@ else if (fields.length > fieldLen)

/*package*/ boolean isHeader(@NotNull String cs)
{
if (cs.length() == 0)
if (cs.isEmpty())
return false;

return HEADER.matcher(cs).matches();
Expand Down
Loading
Loading