[java-identity-provider COMMIT] /trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/RelyingPartyUIContext.java

noreply at shibboleth.net noreply at shibboleth.net
Fri Aug 22 19:54:40 EDT 2014


Author: scantor
Date: Fri Aug 22 19:54:40 2014
New Revision: 6461

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6461&view=rev
Log:
Fix NPE in language collection.

Modified:
    trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/RelyingPartyUIContext.java

Modified: trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/RelyingPartyUIContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/RelyingPartyUIContext.java?rev=6461&r1=6460&r2=6461&view=diff
==============================================================================
--- trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/RelyingPartyUIContext.java (original)
+++ trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/RelyingPartyUIContext.java Fri Aug 22 19:54:40 2014
@@ -20,6 +20,7 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 import javax.annotation.Nonnull;
@@ -73,6 +74,11 @@
 
     /** The languages that this browser wants to know about. */
     @Nonnull @NonnullElements private List<String> browserLanguages;
+    
+    /** Constructor. */
+    public RelyingPartyUIContext() {
+        browserLanguages = Collections.emptyList();
+    }
 
     /**
      * Get the {@link EntityDescriptor}.
@@ -86,10 +92,14 @@
     /**
      * Set the {@link EntityDescriptor}.
      * 
-     * @param what what to set.
-     */
-    public void setRPEntityDescriptor(@Nonnull final EntityDescriptor what) {
+     * @param what what to set
+     * 
+     * @return this context
+     */
+    @Nonnull public RelyingPartyUIContext setRPEntityDescriptor(@Nonnull final EntityDescriptor what) {
         rpEntityDescriptor = Constraint.isNotNull(what, "Injected RP EntityDescriptor cannot be null");
+        
+        return this;
     }
 
     /**
@@ -104,10 +114,14 @@
     /**
      * Set the {@link SPSSODescriptor}.
      * 
-     * @param what what to set.
-     */
-    public void setRPSPSSODescriptor(@Nonnull final SPSSODescriptor what) {
+     * @param what what to set
+     * 
+     * @return this context
+     */
+    @Nonnull public RelyingPartyUIContext setRPSPSSODescriptor(@Nonnull final SPSSODescriptor what) {
         rpSPSSODescriptor = Constraint.isNotNull(what, "Injected RP EntityDescriptor cannot be null");
+        
+        return this;
     }
 
     /**
@@ -131,29 +145,42 @@
     /**
      * Set the RP {@link UIInfo} associated with the request.
      * 
-     * @param what the value to set.
-     */
-    public void setRPUInfo(@Nullable final UIInfo what) {
+     * @param what the value to set
+     * 
+     * @return this context
+     */
+    @Nonnull public RelyingPartyUIContext setRPUInfo(@Nullable final UIInfo what) {
         rpUIInfo = what;
+        
+        return this;
     }
 
     /**
      * Set the {@link AttributeConsumingService} for the request.
      * 
-     * @param what what to set.
-     */
-    public void setRPAttributeConsumingService(@Nonnull final AttributeConsumingService what) {
+     * @param what what to set
+     * 
+     * @return this context
+     */
+    @Nonnull public RelyingPartyUIContext setRPAttributeConsumingService(
+            @Nonnull final AttributeConsumingService what) {
         rpAttributeConsumingService =
                 Constraint.isNotNull(what, "Injected RP AttributeConsumingService cannot be null");
+        
+        return this;
     }
 
     /**
      * Set the browser languages.
      * 
-     * @param languages the languages to set.
-     */
-    public void setBrowserLanguages(@Nonnull @NonnullElements final List<String> languages) {
-        browserLanguages = Constraint.isNotNull(languages, "Language List must be non null");
+     * @param languages the languages to set
+     * 
+     * @return this context
+     */
+    @Nonnull public RelyingPartyUIContext setBrowserLanguages(@Nonnull @NonnullElements final List<String> languages) {
+        browserLanguages = Constraint.isNotNull(languages, "Language List cannot be null");
+        
+        return this;
     }
 
     /**



More information about the commits mailing list