Actually check branding token syntax. NbFeature1135_root issue_57166_fixed palette_client_support
authorjglick@netbeans.org
Fri, 22 Jul 2005 19:24:19 +0000
changeset 507a74b3c8477e
parent 49 ed504fad51bf
child 51 6848ca729a9e
Actually check branding token syntax.
openide.util/src/org/openide/util/NbBundle.java
     1.1 --- a/openide.util/src/org/openide/util/NbBundle.java	Fri Jul 22 09:42:22 2005 +0000
     1.2 +++ b/openide.util/src/org/openide/util/NbBundle.java	Fri Jul 22 19:24:19 2005 +0000
     1.3 @@ -86,7 +86,7 @@
     1.4  
     1.5      /** Set the current branding token.
     1.6       * The permitted format, as a regular expression:
     1.7 -     * <pre>/^[a-z][a-z0-9]*(_[a-z][a-z0-9]*)*$/</pre>
     1.8 +     * <pre>[a-z][a-z0-9]*(_[a-z][a-z0-9]*)*</pre>
     1.9       * <p class="nonnormative">
    1.10       * This is normally only called by NetBeans startup code and unit tests.
    1.11       * Currently the branding may be specified by passing the <code>--branding</code>
    1.12 @@ -96,7 +96,9 @@
    1.13       * @throws IllegalArgumentException if in an incorrect format
    1.14       */
    1.15      public static void setBranding(String bt) throws IllegalArgumentException {
    1.16 -        // [PENDING] check its format here acc. to above regex
    1.17 +        if (bt != null && !bt.matches("[a-z][a-z0-9]*(_[a-z][a-z0-9]*)*")) { // NOI18N
    1.18 +            throw new IllegalArgumentException("Malformed branding token: " + bt); // NOI18N
    1.19 +        }
    1.20          brandingToken = bt;
    1.21      }
    1.22