Skip to content

Commit 8ec51c4

Browse files
authored
Updates from code inspection (#209)
1 parent 98ca4fd commit 8ec51c4

File tree

316 files changed

+1309
-1021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+1309
-1021
lines changed

OpenLdapSync/src/org/labkey/openldapsync/OpenLdapSyncController.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class OpenLdapSyncController extends SpringActionController
4949
private static final DefaultActionResolver _actionResolver = new DefaultActionResolver(OpenLdapSyncController.class);
5050
public static final String NAME = "openldapsync";
5151

52-
private static Logger _log = LogManager.getLogger(OpenLdapSyncController.class);
52+
private static final Logger _log = LogManager.getLogger(OpenLdapSyncController.class);
5353

5454
public OpenLdapSyncController()
5555
{
@@ -59,6 +59,7 @@ public OpenLdapSyncController()
5959
@RequiresPermission(AdminOperationsPermission.class)
6060
public class InitiateLdapSyncAction extends MutatingApiAction<InitiateLdapSyncForm>
6161
{
62+
@Override
6263
public ApiResponse execute(InitiateLdapSyncForm form, BindException errors) throws Exception
6364
{
6465
try
@@ -101,6 +102,7 @@ public void setForPreview(boolean forPreview)
101102
@RequiresPermission(AdminPermission.class)
102103
public class ListLdapGroupsAction extends ReadOnlyApiAction<LdapForm>
103104
{
105+
@Override
104106
public ApiResponse execute(LdapForm form, BindException errors) throws Exception
105107
{
106108
ApiSimpleResponse resp = new ApiSimpleResponse();
@@ -495,6 +497,7 @@ public void setMemberSyncMode(String memberSyncMode)
495497
@RequiresPermission(AdminOperationsPermission.class)
496498
public class TestLdapConnectionAction extends MutatingApiAction<Object>
497499
{
500+
@Override
498501
public ApiResponse execute(Object form, BindException errors) throws Exception
499502
{
500503
ApiSimpleResponse resp = new ApiSimpleResponse();
@@ -544,6 +547,7 @@ public ApiResponse execute(Object form, BindException errors) throws Exception
544547
@RequiresPermission(AdminOperationsPermission.class)
545548
public class GetLdapSettingsAction extends ReadOnlyApiAction<Object>
546549
{
550+
@Override
547551
public ApiResponse execute(Object form, BindException errors)
548552
{
549553
Map<String, Object> result = new HashMap<>();
@@ -567,6 +571,7 @@ public ApiResponse execute(Object form, BindException errors)
567571
@RequiresPermission(AdminOperationsPermission.class)
568572
public class SetLdapSettingsAction extends MutatingApiAction<LdapForm>
569573
{
574+
@Override
570575
public ApiResponse execute(LdapForm form, BindException errors)
571576
{
572577
Map<String, String> props = new HashMap<>();

OpenLdapSync/src/org/labkey/openldapsync/OpenLdapSyncModule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ protected void startupAfterSpringConfig(ModuleContext moduleContext)
7474
{
7575
DefaultSchema.registerProvider(OpenLdapSyncSchema.getInstance().getSchema().getQuerySchemaName(), new DefaultSchema.SchemaProvider(this)
7676
{
77+
@Override
7778
public QuerySchema createSchema(final DefaultSchema schema, Module module)
7879
{
7980
DbSchema dbSchema = DbSchema.get(OpenLdapSyncSchema.NAME, DbSchemaType.Module);

OpenLdapSync/src/org/labkey/openldapsync/ldap/LdapScheduler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ public synchronized void schedule()
7373
catch (LdapException e)
7474
{
7575
_log.error("LDAP sync is enabled, but the saved setting are invalid. Sync will not start.", e);
76-
return;
7776
}
7877
catch (Exception e)
7978
{

OpenLdapSync/src/org/labkey/openldapsync/ldap/LdapSettings.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class LdapSettings
7979

8080
public static final String DELIM = "<>";
8181

82-
private Map<String, Object> _settings;
82+
private final Map<String, Object> _settings;
8383

8484
public LdapSettings()
8585
{
@@ -448,10 +448,6 @@ public User getLabKeyAdminUser()
448448
{
449449
ValidEmail e = new ValidEmail(email);
450450
User u = UserManager.getUser(e);
451-
if (u == null)
452-
{
453-
return null;
454-
}
455451

456452
return u;
457453
}

OpenLdapSync/src/org/labkey/openldapsync/ldap/LdapSyncRunner.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ public class LdapSyncRunner implements Job
7272
private static final Logger _log = LogManager.getLogger(LdapSyncRunner.class);
7373
private LdapSettings _settings;
7474
private LdapConnectionWrapper _wrapper;
75-
private Map<String, LdapSyncModel> _syncedRecordMap = new HashMap<>();
75+
private final Map<String, LdapSyncModel> _syncedRecordMap = new HashMap<>();
7676
private boolean _previewOnly = false;
77-
private List<String> _messages = new ArrayList<>();
77+
private final List<String> _messages = new ArrayList<>();
7878
private boolean _doDetailedLogging = true;
7979

80-
private Map<String, Integer> _usersSynced = new HashMap<>();
81-
private Map<String, Integer> _groupsSynced = new HashMap<>();
80+
private final Map<String, Integer> _usersSynced = new HashMap<>();
81+
private final Map<String, Integer> _groupsSynced = new HashMap<>();
8282

8383
public static final String AUDIT_EVENT_TYPE = "LdapAuditEvent";
8484

@@ -98,6 +98,7 @@ public LdapSyncRunner()
9898

9999
}
100100

101+
@Override
101102
public void execute(JobExecutionContext context) throws JobExecutionException
102103
{
103104
try
@@ -437,7 +438,7 @@ else if (_settings.getMemberSyncMode().equals(LdapSettings.MemberSyncMode.remove
437438
if (u.getPrincipalType().equals(PrincipalType.GROUP))
438439
continue;
439440

440-
if (_usersSynced.values().contains(u.getUserId()))
441+
if (_usersSynced.containsValue(u.getUserId()))
441442
{
442443
deleteMember(existingGroup, u);
443444
}
@@ -1068,9 +1069,9 @@ public void testIndividualOperations() throws Exception
10681069
// This can be used to return LdapEntry objects to support some degree of automated testing without needing a functional LDAP Server
10691070
public class DummyConnectionWrapper extends LdapConnectionWrapper
10701071
{
1071-
private List<LdapEntry> _users = new ArrayList<>();
1072-
private Map<String, MockLdapEntry> _groupMap = new HashMap<>();
1073-
private Map<MockLdapEntry, List<LdapEntry>> _groupMemberMap = new HashMap<>();
1072+
private final List<LdapEntry> _users = new ArrayList<>();
1073+
private final Map<String, MockLdapEntry> _groupMap = new HashMap<>();
1074+
private final Map<MockLdapEntry, List<LdapEntry>> _groupMemberMap = new HashMap<>();
10741075

10751076
public DummyConnectionWrapper() throws LdapException
10761077
{
@@ -1125,9 +1126,9 @@ public List<LdapEntry> listAllUsers()
11251126

11261127
private static class MockLdapEntry extends LdapEntry
11271128
{
1128-
private Dn _dn;
1129+
private final Dn _dn;
11291130

1130-
private Map<String, String> _otherProps = new HashMap<>();
1131+
private final Map<String, String> _otherProps = new HashMap<>();
11311132

11321133
//represents an LDAP user entry
11331134
public MockLdapEntry(String dn, Map<String, String> otherProps, LdapSettings settings) throws LdapInvalidDnException

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/GenomeTrigger.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
*/
2626
public interface GenomeTrigger
2727
{
28-
public String getName();
28+
String getName();
2929

30-
public void onCreate(Container c, User u, Logger log, int genomeId);
30+
void onCreate(Container c, User u, Logger log, int genomeId);
3131

32-
public void onRecreate(Container c, User u, Logger log, int genomeId);
32+
void onRecreate(Container c, User u, Logger log, int genomeId);
3333

34-
public void onDelete(Container c, User u, Logger log, int genomeId);
34+
void onDelete(Container c, User u, Logger log, int genomeId);
3535

3636
default void onTrackAdd(Container c, User u, Logger log, int genomeId, int trackId)
3737
{
3838

3939
}
4040

41-
public boolean isAvailable(Container c);
41+
boolean isAvailable(Container c);
4242
}

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/PedigreeRecord.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ public boolean isChildOf(PedigreeRecord potentialParent)
5151
{
5252
return true;
5353
}
54-
else if (mother != null && mother.equals(potentialParent.subjectName))
55-
{
56-
return true;
57-
}
58-
59-
return false;
54+
else return mother != null && mother.equals(potentialParent.subjectName);
6055
}
6156

6257
public String getSubjectName()

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/ReferenceLibraryHelper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
*/
2323
public interface ReferenceLibraryHelper
2424
{
25-
public File getReferenceFasta();
25+
File getReferenceFasta();
2626

27-
public File getIdKeyFile();
27+
File getIdKeyFile();
2828

29-
public File getFastaIndexFile(boolean createIfDoesntExist);
29+
File getFastaIndexFile(boolean createIfDoesntExist);
3030

31-
public File getSequenceDictionaryFile(boolean createIfDoesntExist);
31+
File getSequenceDictionaryFile(boolean createIfDoesntExist);
3232

33-
public Integer resolveSequenceId(String refName);
33+
Integer resolveSequenceId(String refName);
3434

35-
public String resolveAccession(String refName);
35+
String resolveAccession(String refName);
3636
}

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/SequenceDataProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
*/
2828
public interface SequenceDataProvider extends DataProvider
2929
{
30-
public List<NavItem> getSequenceNavItems(Container c, User u, SequenceNavItemCategory category);
30+
List<NavItem> getSequenceNavItems(Container c, User u, SequenceNavItemCategory category);
3131

32-
public enum SequenceNavItemCategory
32+
enum SequenceNavItemCategory
3333
{
3434
data(),
3535
references(),

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/model/AnalysisModel.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,50 +31,50 @@
3131
*/
3232
public interface AnalysisModel extends Serializable
3333
{
34-
public Integer getAnalysisId();
34+
Integer getAnalysisId();
3535

36-
public Integer getRunId();
36+
Integer getRunId();
3737

38-
public String getContainer();
38+
String getContainer();
3939

40-
public Integer getReadset();
40+
Integer getReadset();
4141

42-
public Integer getAlignmentFile();
42+
Integer getAlignmentFile();
4343

44-
public File getAlignmentFileObject();
44+
File getAlignmentFileObject();
4545

46-
public ExpData getAlignmentData();
46+
ExpData getAlignmentData();
4747

4848
@Deprecated
49-
public Integer getReferenceLibrary();
49+
Integer getReferenceLibrary();
5050

51-
public void setReferenceLibrary(Integer libraryId);
51+
void setReferenceLibrary(Integer libraryId);
5252

53-
public ExpData getReferenceLibraryData(User u) throws PipelineJobException;
53+
ExpData getReferenceLibraryData(User u) throws PipelineJobException;
5454

55-
public File getReferenceLibraryFile(User u) throws PipelineJobException;
55+
File getReferenceLibraryFile(User u) throws PipelineJobException;
5656

57-
public String getType();
57+
String getType();
5858

59-
public Date getModified();
59+
Date getModified();
6060

61-
public Integer getModifiedby();
61+
Integer getModifiedby();
6262

63-
public Date getCreated();
63+
Date getCreated();
6464

65-
public Integer getCreatedby();
65+
Integer getCreatedby();
6666

67-
public Integer getRowId();
67+
Integer getRowId();
6868

69-
public String getDescription();
69+
String getDescription();
7070

71-
public String getSynopsis();
71+
String getSynopsis();
7272

73-
public void setSynopsis(String synopsis);
73+
void setSynopsis(String synopsis);
7474

75-
public Integer getLibraryId();
75+
Integer getLibraryId();
7676

77-
public void setLibraryId(Integer libraryId);
77+
void setLibraryId(Integer libraryId);
7878

79-
public JSONObject toJSON();
79+
JSONObject toJSON();
8080
}

0 commit comments

Comments
 (0)