gnodet commented on code in PR #23021:
URL: https://github.com/apache/camel/pull/23021#discussion_r3202822460


##########
core/camel-api/src/main/java/org/apache/camel/spi/OAuthClientConfig.java:
##########
@@ -24,46 +28,46 @@
  */
 public class OAuthClientConfig {
 
-    private String clientId;
-    private String clientSecret;
-    private String tokenEndpoint;
-    private String scope;
+    private @Nullable String clientId;
+    private @Nullable String clientSecret;
+    private @Nullable String tokenEndpoint;
+    private @Nullable String scope;
     private boolean cacheTokens = true;
     private long cachedTokensDefaultExpirySeconds = 3600;
     private long cachedTokensExpirationMarginSeconds = 5;
 
-    public String getClientId() {
+    public @Nullable String getClientId() {
         return clientId;
     }
 
     public OAuthClientConfig setClientId(String clientId) {
-        this.clientId = clientId;
+        this.clientId = Objects.requireNonNull(clientId, "clientId");
         return this;
     }
 
-    public String getClientSecret() {
+    public @Nullable String getClientSecret() {
         return clientSecret;
     }
 
     public OAuthClientConfig setClientSecret(String clientSecret) {
-        this.clientSecret = clientSecret;
+        this.clientSecret = Objects.requireNonNull(clientSecret, 
"clientSecret");
         return this;

Review Comment:
   For this constructor, yes. But the no-arg constructor does not set the 
`clientSecret` field, which ends up being `null`, hence the @Nullable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to