Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
package com.google.errorprone.bugpatterns.checkreturnvalue;

import com.google.errorprone.ErrorProneFlags;
import com.google.errorprone.bugpatterns.WellKnownKeep;

public final class CanIgnoreReturnValueSuggesterFactory {

// calls package private constructor of CanIgnoreReturnValueSuggester
public static CanIgnoreReturnValueSuggester createCanIgnoreReturnValueSuggester(
ErrorProneFlags errorProneFlags) {
return new CanIgnoreReturnValueSuggester(errorProneFlags);
ErrorProneFlags errorProneFlags, WellKnownKeep wellKnownKeep) {
return new CanIgnoreReturnValueSuggester(errorProneFlags, wellKnownKeep);
}

private CanIgnoreReturnValueSuggesterFactory() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.google.errorprone.ErrorProneFlags;
import com.google.errorprone.VisitorState;
import com.google.errorprone.bugpatterns.BugChecker;
import com.google.errorprone.bugpatterns.WellKnownKeep;
import com.google.errorprone.bugpatterns.checkreturnvalue.CanIgnoreReturnValueSuggester;
import com.google.errorprone.bugpatterns.checkreturnvalue.CanIgnoreReturnValueSuggesterFactory;
import com.google.errorprone.matchers.Description;
Expand All @@ -33,9 +34,10 @@ public class OtelCanIgnoreReturnValueSuggester extends BugChecker
private final CanIgnoreReturnValueSuggester delegate;

@Inject
OtelCanIgnoreReturnValueSuggester(ErrorProneFlags errorProneFlags) {
OtelCanIgnoreReturnValueSuggester(ErrorProneFlags errorProneFlags, WellKnownKeep wellKnownKeep) {
delegate =
CanIgnoreReturnValueSuggesterFactory.createCanIgnoreReturnValueSuggester(errorProneFlags);
CanIgnoreReturnValueSuggesterFactory.createCanIgnoreReturnValueSuggester(
errorProneFlags, wellKnownKeep);
}

public OtelCanIgnoreReturnValueSuggester() {
Expand Down
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ val DEPENDENCY_BOMS = listOf(

val autoServiceVersion = "1.1.1"
val autoValueVersion = "1.11.0"
val errorProneVersion = "2.40.0"
val errorProneVersion = "2.41.0"
val byteBuddyVersion = "1.17.6"
val asmVersion = "9.8"
val jmhVersion = "1.37"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ private static void debugContextPropagation(Context context) {
}

private static class Propagation {
public final String carrierClassName;
public final StackTraceElement[] location;
final String carrierClassName;
final StackTraceElement[] location;

public Propagation(String carrierClassName, StackTraceElement[] location) {
Propagation(String carrierClassName, StackTraceElement[] location) {
this.carrierClassName = carrierClassName;
this.location = location;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public GraphStageLogic createLogic(Attributes attributes) {
private class TracingLogic extends GraphStageLogic {
private final Deque<TracingRequest> requests = new ArrayDeque<>();

public TracingLogic() {
TracingLogic() {
super(shape);

// server pulls response, pass response from user code to server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected void configure(HttpClientTestOptions.Builder optionsBuilder) {
private static class HttpResponseHandler implements ResponseHandler<Void> {
private final HttpClientResult requestResult;

public HttpResponseHandler(HttpClientResult requestResult) {
HttpResponseHandler(HttpClientResult requestResult) {
this.requestResult = requestResult;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void executeRequestWithCallback(SimpleHttpRequest request, URI uri, HttpClientRe
private static class ResponseCallback implements FutureCallback<SimpleHttpResponse> {
private final HttpClientResult httpClientResult;

public ResponseCallback(HttpClientResult httpClientResult) {
ResponseCallback(HttpClientResult httpClientResult) {
this.httpClientResult = httpClientResult;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ protected void configure(HttpClientTestOptions.Builder optionsBuilder) {
private static class ResponseHandler implements HttpClientResponseHandler<Void> {
private final HttpClientResult httpClientResult;

public ResponseHandler(HttpClientResult httpClientResult) {
ResponseHandler(HttpClientResult httpClientResult) {
this.httpClientResult = httpClientResult;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ public String handleRequest(Integer input, Context context) {
}
}

@SuppressWarnings("UnusedMethod")
private static class CustomType {
static class CustomType {
String key;
String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private Object writeReplace() {
}

private static class CallerClass extends SecurityManager {
public static final CallerClass INSTANCE = new CallerClass();
static final CallerClass INSTANCE = new CallerClass();

@Override
public Class<?>[] getClassContext() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,24 @@ private static class ContextWithScope {
private final CamelRequest request;
@Nullable private final Scope scope;

public ContextWithScope(
ContextWithScope parent, Context context, CamelRequest request, Scope scope) {
ContextWithScope(ContextWithScope parent, Context context, CamelRequest request, Scope scope) {
this.parent = parent;
this.context = context;
this.request = request;
this.scope = scope;
}

public static ContextWithScope activate(
static ContextWithScope activate(
ContextWithScope parent, Context context, CamelRequest request) {
Scope scope = context != null ? context.makeCurrent() : null;
return new ContextWithScope(parent, context, request, scope);
}

public ContextWithScope getParent() {
ContextWithScope getParent() {
return parent;
}

public void deactivate(Exception exception) {
void deactivate(Exception exception) {
if (scope == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private static final class SnsMetadata {
private final String queueUrl;
private final String topicArn;

public SnsMetadata(String queueUrl, String topicArn) {
SnsMetadata(String queueUrl, String topicArn) {
this.queueUrl = queueUrl;
this.topicArn = topicArn;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,14 @@ private static Stream<Arguments> provideAsyncParameters() {
}

private static class Parameter {
public final String keyspace;
public final String statement;
public final String expectedStatement;
public final String spanName;
public final String operation;
public final String table;
final String keyspace;
final String statement;
final String expectedStatement;
final String spanName;
final String operation;
final String table;

public Parameter(
Parameter(
String keyspace,
String statement,
String expectedStatement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ private static Stream<Arguments> providesArguments() {
}

private static class Parameter {
public final Object query;
public final String expected;
final Object query;
final String expected;

public Parameter(Object query, String expected) {
Parameter(Object query, String expected) {
this.query = query;
this.expected = expected;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,19 @@ void elasticsearchStatusAsync() throws Exception {
}

private static class AsyncRequest {
volatile InfoResponse response = null;
private volatile InfoResponse response = null;

public InfoResponse getResponse() {
InfoResponse getResponse() {
return response;
}

public void setResponse(InfoResponse response) {
void setResponse(InfoResponse response) {
this.response = response;
}
}

private static class Person {
public final String name;
static class Person {
private final String name;

Person(String name) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,22 @@ public void onFailure(Exception e) {
}

private static class AsyncRequest {
volatile Response requestResponse = null;
volatile Exception exception = null;
private volatile Response requestResponse = null;
private volatile Exception exception = null;

public Response getRequestResponse() {
Response getRequestResponse() {
return requestResponse;
}

public void setRequestResponse(Response requestResponse) {
void setRequestResponse(Response requestResponse) {
this.requestResponse = requestResponse;
}

public Exception getException() {
Exception getException() {
return exception;
}

public void setException(Exception exception) {
void setException(Exception exception) {
this.exception = exception;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,22 @@ public void onFailure(Exception e) {
}

private static class AsyncRequest {
volatile Response requestResponse = null;
volatile Exception exception = null;
private volatile Response requestResponse = null;
private volatile Exception exception = null;

public Response getRequestResponse() {
Response getRequestResponse() {
return requestResponse;
}

public void setRequestResponse(Response requestResponse) {
void setRequestResponse(Response requestResponse) {
this.requestResponse = requestResponse;
}

public Exception getException() {
Exception getException() {
return exception;
}

public void setException(Exception exception) {
void setException(Exception exception) {
this.exception = exception;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public Node newNode(Settings settings) {
InternalSettingsPreparer.prepareEnvironment(settings, null),
Collections.singleton(Netty4Plugin.class)) {

@SuppressWarnings({"UnusedMethod", "UnusedVariable"})
@SuppressWarnings({"UnusedMethod", "UnusedVariable", "EffectivelyPrivate"})
protected void registerDerivedNodeNameWithLogger(String s) {}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private static class CustomAttributesExtractorV2

private final String valueOfKey2;

public CustomAttributesExtractorV2(String valueOfKey2) {
CustomAttributesExtractorV2(String valueOfKey2) {
this.valueOfKey2 = valueOfKey2;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ private static Stream<Arguments> provideArguments() {
}

private static class Parameter {
public final String expectedSpanName;
public final boolean requiresTransaction;
public final Consumer<Session> queryInteraction;
final String expectedSpanName;
final boolean requiresTransaction;
final Consumer<Session> queryInteraction;

public Parameter(
Parameter(
String expectedSpanName, boolean requiresTransaction, Consumer<Session> queryInteraction) {
this.expectedSpanName = expectedSpanName;
this.requiresTransaction = requiresTransaction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,13 @@ private static Stream<Arguments> provideArgumentsForQueryMethods() {
}

private static class Parameter {
public final String methodName;
public final String resource;
public final BiConsumer<Session, Value> sessionMethodTest;
public final BiConsumer<StatelessSession, Value> statelessSessionMethodTest;
public final Function<Session, Query> queryBuildMethod;
final String methodName;
final String resource;
final BiConsumer<Session, Value> sessionMethodTest;
final BiConsumer<StatelessSession, Value> statelessSessionMethodTest;
final Function<Session, Query> queryBuildMethod;

public Parameter(
Parameter(
String methodName,
String resource,
BiConsumer<Session, Value> sessionMethodTest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,12 @@ private static Stream<Arguments> provideArgumentsAttachesState() {
}

private static class Parameter {
public final String methodName;
public final boolean attach;
public final boolean flushOnCommit;
public final BiConsumer<EntityManager, Value> sessionMethodTest;
final String methodName;
final boolean attach;
final boolean flushOnCommit;
final BiConsumer<EntityManager, Value> sessionMethodTest;

public Parameter(
Parameter(
String methodName,
boolean attach,
boolean flushOnCommit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ void testHibernateQueryIterate() {
}

private static class Parameter {
public final String expectedSpanName;
public final Consumer<Session> queryInteraction;
final String expectedSpanName;
final Consumer<Session> queryInteraction;

public Parameter(String expectedSpanName, Consumer<Session> queryInteraction) {
Parameter(String expectedSpanName, Consumer<Session> queryInteraction) {
this.expectedSpanName = expectedSpanName;
this.queryInteraction = queryInteraction;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -851,11 +851,11 @@ void testHibernateOverlappingSessions() {
}

private static class Parameter {
public final String methodName;
public final BiConsumer<Session, Value> sessionMethodTest;
public final BiConsumer<StatelessSession, Value> statelessSessionMethodTest;
final String methodName;
final BiConsumer<Session, Value> sessionMethodTest;
final BiConsumer<StatelessSession, Value> statelessSessionMethodTest;

public Parameter(
Parameter(
String methodName,
BiConsumer<Session, Value> sessionMethodTest,
BiConsumer<StatelessSession, Value> statelessSessionMethodTest) {
Expand Down
Loading
Loading