[java-support] branch master updated: JSPT-90 Review comments.

Rod Widdowson rdw at steadingsoftware.com
Mon Jun 17 06:45:37 EDT 2019


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository java-support.

View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=402ac0d03f454ca51ab12b4e742c48c811de2930

The following commit(s) were added to refs/heads/master by this push:
       new  402ac0d   JSPT-90 Review comments.
402ac0d is described below

commit 402ac0d03f454ca51ab12b4e742c48c811de2930
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Jun 17 11:44:05 2019 +0100

    JSPT-90 Review comments.
    
    https://issues.shibboleth.net/jira/browse/JSPT-90
    
    Fix typo in field.  Clarify (in javadoc) the use of nulls in the
    queryParams field.
---
 .../utilities/java/support/net/URLBuilder.java        | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/main/java/net/shibboleth/utilities/java/support/net/URLBuilder.java b/src/main/java/net/shibboleth/utilities/java/support/net/URLBuilder.java
index 06173cc..125472f 100644
--- a/src/main/java/net/shibboleth/utilities/java/support/net/URLBuilder.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/net/URLBuilder.java
@@ -61,7 +61,7 @@ public class URLBuilder {
     @Nonnull private List<Pair<String, String>> queryParams;
 
     /** URL fragment. */
-    private String fragement;
+    private String fragment;
 
     /**
      * Constructor.
@@ -132,7 +132,7 @@ public class URLBuilder {
      * @return URL fragment in its decoded form
      */
     @Nullable public String getFragment() {
-        return fragement;
+        return fragment;
     }
 
     /**
@@ -141,7 +141,7 @@ public class URLBuilder {
      * @param newFragment URL fragment in its decoded form
      */
     public void setFragment(@Nullable final String newFragment) {
-        fragement = StringSupport.trimOrNull(newFragment);
+        fragment = StringSupport.trimOrNull(newFragment);
     }
 
     /**
@@ -217,7 +217,14 @@ public class URLBuilder {
     }
 
     /**
-     * Gets the query string parameters for the URL. Params may be added and removed through the map interface.
+     * Gets the query string parameters for the URL. Params may be added and removed through the {@link List} interface.
+     * <br/>
+     * A note on the use of nulls in the {@link Pair}.
+     * <ul><li>A null {@link Pair#getFirst()} is generated from a URL segment such as {@code ?=foo}.
+     * Such pairs are ignored by {@link #buildURL()}.</li>
+     * <li> A null {@link Pair#getSecond()} is generated from a URL segment such as {@code ?foo=&bar=fred} and
+     * will be rendered as {@code foo&bar=fred} by {@link #buildURL()}.</li>
+     * </ul>
      * 
      * @return query string parameters for the URL
      */
@@ -308,9 +315,9 @@ public class URLBuilder {
             builder.append(queryString);
         }
 
-        if (!Strings.isNullOrEmpty(fragement)) {
+        if (!Strings.isNullOrEmpty(fragment)) {
             builder.append("#");
-            builder.append(fragement);
+            builder.append(fragment);
         }
 
         return builder.toString();

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list