Skip to content

Commit bd6f80b

Browse files
committed
Remove the use of javax.annotation.Nullable.
It's only used for AutoValue, which is perfectly happy with a locally-defined @nullable annotation. Without this change, a clean Maven build fails, because we were previously getting javax.annotation.Nullable through an indirect dependency which was removed. PiperOrigin-RevId: 293256408
1 parent a21369a commit bd6f80b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

invoker/core/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@
5252
<artifactId>cloudevents-api</artifactId>
5353
<version>1.2.0</version>
5454
</dependency>
55-
<dependency>
56-
<groupId>javax.annotation</groupId>
57-
<artifactId>javax.annotation-api</artifactId>
58-
<version>1.3.2</version>
59-
</dependency>
6055
<dependency>
6156
<groupId>com.google.code.gson</groupId>
6257
<artifactId>gson</artifactId>

invoker/core/src/main/java/com/google/cloud/functions/invoker/CloudFunctionsContext.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
import com.google.cloud.functions.Context;
55
import com.google.gson.Gson;
66
import com.google.gson.TypeAdapter;
7-
import javax.annotation.Nullable;
7+
import java.lang.annotation.Retention;
8+
import java.lang.annotation.RetentionPolicy;
89

910
/** Event context (metadata) for events handled by Cloud Functions. */
1011
@AutoValue
1112
abstract class CloudFunctionsContext implements Context {
13+
// AutoValue recognizes any annotation called @Nullable, so no need to import this from anywhere.
14+
@Retention(RetentionPolicy.SOURCE)
15+
@interface Nullable {}
16+
1217
@Nullable
1318
public abstract String eventId();
1419

0 commit comments

Comments
 (0)