Skip to content

Conversation

@carlosroman
Copy link
Contributor

No description provided.

public Set<ObjectName> queryNames(ObjectName name) throws IOException {
String scope = (name != null) ? name.toString() : "*:*";
public Set<ObjectName> queryNames(final ObjectName name) throws IOException {
final String scope = (name != null) ? name.toString() : "*:*";

Choose a reason for hiding this comment

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

Code Quality Violation

Avoid negation in your if condition (...read more)

Using a negative comparison in if expressions with an else clause can be confusing. Consider modifying your comparison by switching your if and else` block statements.

View in Datadog  Leave us feedback  Documentation

private Socket socket = null;
private boolean shouldClose = false;

private volatile Exception exception = null;

Choose a reason for hiding this comment

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

🟠 Code Quality Violation

Suggested change
private volatile Exception exception = null;
private volatile Exception exception;
Remove initialization, this is already the default value. (...read more)

When initializing fields, prevent initializing fields to the default value. Any additional initialization means more bytecode instructions, and allocating many of these objects may impact your application performance.

If you initialize to a default value, remove the initialization.

View in Datadog  Leave us feedback  Documentation

private boolean shouldClose = false;

private volatile Exception exception = null;
private volatile Socket socket = null;

Choose a reason for hiding this comment

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

🟠 Code Quality Violation

Suggested change
private volatile Socket socket = null;
private volatile Socket socket;
Remove initialization, this is already the default value. (...read more)

When initializing fields, prevent initializing fields to the default value. Any additional initialization means more bytecode instructions, and allocating many of these objects may impact your application performance.

If you initialize to a default value, remove the initialization.

View in Datadog  Leave us feedback  Documentation


private volatile Exception exception = null;
private volatile Socket socket = null;
private volatile boolean shouldClose = false;

Choose a reason for hiding this comment

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

🟠 Code Quality Violation

Suggested change
private volatile boolean shouldClose = false;
private volatile boolean shouldClose;
Remove initialization, this is already the default value. (...read more)

When initializing fields, prevent initializing fields to the default value. Any additional initialization means more bytecode instructions, and allocating many of these objects may impact your application performance.

If you initialize to a default value, remove the initialization.

View in Datadog  Leave us feedback  Documentation

@carlosroman carlosroman force-pushed the carlosroman/AGTMETRICS-303-memory-leak branch from bd24e79 to e130317 Compare June 25, 2025 10:15
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.

2 participants