Skip to content

Auto-refactor assorted Java lint#7660

Merged
labkey-jeckels merged 5 commits into
developfrom
fb_lintCleanup
May 12, 2026
Merged

Auto-refactor assorted Java lint#7660
labkey-jeckels merged 5 commits into
developfrom
fb_lintCleanup

Conversation

@labkey-jeckels
Copy link
Copy Markdown
Contributor

Rationale

Warnings can cover up important code quality issues.

Changes

  • SequencedCollections: get(0) -> getFirst(), etc
  • Add missing @NotNull/@Nullable
  • Simplify test assertions
  • Map operation simplification
  • Remove redundant throws clause
  • Switch to parameterized log message
  • C-style array -> Java-style array declaration
  • Delete overridden methods identical to parent
  • Switch statement -> enhanced switch statement
  • Remove redundant imports

Tasks 📍

  • Claude Code Review
  • Manual Testing
  • Test Automation

SequencedCollections: get(0) -> getFirst(), etc
Add missing @NotNull/@nullable
Simplify test assertions
Map operation simplification
Remove redundant throws clause
Switch to parameterized log message
C-style array -> Java-style array declaration
Delete overridden methods identical to parent
Switch statement -> enhanced switch statement
Remove redundant imports

@Override
public void write(byte b[], int off, int len) throws IOException
public void write(byte @NotNull[] b, int off, int len) throws IOException
@labkey-jeckels
Copy link
Copy Markdown
Contributor Author

Tests are passing (BVT, Daily, External, EHR, Nightly, Nightly LKB, Nightly LKSM). Code scanning report is not new (though we should clear it separately).

@@ -15,6 +15,7 @@
<%@ page import="org.labkey.api.view.ViewServlet" %>
<%@ page import="org.labkey.api.util.URLHelper" %>
<%@ page import="java.net.URISyntaxException" %>
<%@ page import="org.jspecify.annotations.NonNull" %>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ununsed import?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up.

@@ -97,11 +97,11 @@ public CodeMacro() {
SourceCodeFormatter existing = formatters.get(name);
if (existing.getPriority() < formatter.getPriority()) {
formatters.put(name, formatter);
log.debug("Replacing formatter: " + formatter.getClass() + " (" + name + ")");
log.debug("Replacing formatter: {} ({})", formatter.getClass(), name);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent formatters line as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored original indentation, which is different in Radeox than our own code. Could do a full reformat of all Radeox classes in a separate commit.

}
} else {
formatters.put(name, formatter);
log.debug("Loaded formatter: " + formatter.getClass() + " (" + name +")");
log.debug("Loaded formatter: {} ({})", formatter.getClass(), name);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well

labkey-jeckels added a commit to LabKey/testAutomation that referenced this pull request May 12, 2026
#### Rationale
Warnings can cover up important code quality issues.

#### Related Pull Requests
- LabKey/platform#7660

#### Changes
- SequencedCollections: `get(0)` -> `getFirst()`, etc
- Add missing `@NotNull`/`@Nullable`
- Simplify test assertions
- Map operation simplification
- Remove redundant throws clause
- Switch to parameterized log message
- C-style array -> Java-style array declaration
- Delete overridden methods identical to parent
- Switch statement -> enhanced switch statement
- Remove redundant imports
@labkey-jeckels labkey-jeckels merged commit bbbe739 into develop May 12, 2026
12 of 13 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_lintCleanup branch May 12, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants