Skip to content

Commit

Permalink
add @SuppressWarnings("nullness:initialization.field.uninitialized") …
Browse files Browse the repository at this point in the history
…to component fields.

RELNOTES=N/A
PiperOrigin-RevId: 693114684
  • Loading branch information
java-team-github-bot authored and Dagger Team committed Nov 4, 2024
1 parent 9a53e18 commit 1e94691
Show file tree
Hide file tree
Showing 346 changed files with 1,105 additions and 755 deletions.
3 changes: 2 additions & 1 deletion java/dagger/internal/codegen/base/SourceFileGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import static dagger.internal.codegen.javapoet.AnnotationSpecs.Suppression.KOTLIN_INTERNAL;
import static dagger.internal.codegen.javapoet.AnnotationSpecs.Suppression.RAWTYPES;
import static dagger.internal.codegen.javapoet.AnnotationSpecs.Suppression.UNCHECKED;
import static dagger.internal.codegen.javapoet.AnnotationSpecs.Suppression.UNINITIALIZED;
import static dagger.internal.codegen.xprocessing.XElements.closestEnclosingTypeElement;

import androidx.room.compiler.processing.XElement;
Expand Down Expand Up @@ -92,7 +93,7 @@ private JavaFile buildJavaFile(T input, TypeSpec.Builder typeSpecBuilder) {
AnnotationSpecs.suppressWarnings(
ImmutableSet.<Suppression>builder()
.addAll(warningSuppressions())
.add(UNCHECKED, RAWTYPES, KOTLIN_INTERNAL, CAST, DEPRECATION)
.add(UNCHECKED, RAWTYPES, KOTLIN_INTERNAL, CAST, DEPRECATION, UNINITIALIZED)
.build()));

String packageName = closestEnclosingTypeElement(originatingElement).getPackageName();
Expand Down
4 changes: 2 additions & 2 deletions java/dagger/internal/codegen/javapoet/AnnotationSpecs.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public enum Suppression {
FUTURE_RETURN_VALUE_IGNORED("FutureReturnValueIgnored"),
KOTLIN_INTERNAL("KotlinInternal", "KotlinInternalInJava"),
CAST("cast"),
DEPRECATION("deprecation")
;
DEPRECATION("deprecation"),
UNINITIALIZED("nullness:initialization.field.uninitialized");

private final ImmutableList<String> values;

Expand Down
3 changes: 2 additions & 1 deletion javatests/dagger/internal/codegen/GeneratedLines.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public final class GeneratedLines {
private static final String SUPPRESS_WARNINGS_ANNOTATION =
"@SuppressWarnings({"
+ "\"unchecked\", \"rawtypes\", \"KotlinInternal\", \"KotlinInternalInJava\", \"cast\", "
+ "\"deprecation\""
+ "\"deprecation\","
+ "\"nullness:initialization.field.uninitialized\""
+ "})";

private static final String IMPORT_DAGGER_GENERATED = "import dagger.internal.DaggerGenerated;";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ public void kotlinNullableProvides() {
" \"KotlinInternal\",",
" \"KotlinInternalInJava\",",
" \"cast\",",
" \"deprecation\"",
" \"deprecation\",",
" \"nullness:initialization.field.uninitialized\"",
"})",
"public final class TestModule_ProvideStringFactory implements"
+ " Factory<String> {",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import javax.inject.Provider;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
public final class Foo_Factory {
private final Provider<Bar> argProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import javax.inject.Provider;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
public final class Foo_Factory {
private final Provider<Bar> argProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerMyComponent {
private DaggerMyComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerMyComponent {
private DaggerMyComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerSimpleComponent {
private DaggerSimpleComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerTestComponent {
private DaggerTestComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerBComponent {
private DaggerBComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerBComponent {
private DaggerBComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import javax.annotation.processing.Generated;
"KotlinInternal",
"KotlinInternalInJava",
"cast",
"deprecation"
"deprecation",
"nullness:initialization.field.uninitialized"
})
final class DaggerBComponent {
private DaggerBComponent() {
Expand Down
Loading

0 comments on commit 1e94691

Please sign in to comment.