@@ -44,7 +44,7 @@ public class HSLColorImpl implements Serializable {
4444 */
4545 public HSLColorImpl (final String function , final LexicalUnit lu ) throws DOMException {
4646 if (function == null ) {
47- throw new DOMException (DOMException .SYNTAX_ERR , "Color space hsl or hsla is required." );
47+ throw new DOMException (DOMException .SYNTAX_ERR , "Color space ' hsl' or ' hsla' is required." );
4848 }
4949 final String functionLC = function .toLowerCase (Locale .ROOT );
5050 if (!"hsl" .equals (functionLC ) && !"hsla" .equals (functionLC )) {
@@ -54,30 +54,30 @@ public HSLColorImpl(final String function, final LexicalUnit lu) throws DOMExcep
5454
5555 LexicalUnit next = lu ;
5656 if (next == null ) {
57- throw new DOMException (DOMException .SYNTAX_ERR , function_ + " requires at least three values." );
57+ throw new DOMException (DOMException .SYNTAX_ERR , "'" + function_ + "' requires at least three values." );
5858 }
5959 hue_ = getHuePart (next );
6060
6161 next = next .getNextLexicalUnit ();
6262 if (next == null ) {
63- throw new DOMException (DOMException .SYNTAX_ERR , function_ + " requires at least three values." );
63+ throw new DOMException (DOMException .SYNTAX_ERR , "'" + function_ + "' requires at least three values." );
6464 }
6565
6666 commaSeparated_ = LexicalUnitType .OPERATOR_COMMA == next .getLexicalUnitType ();
6767 if (commaSeparated_ ) {
6868 if (hue_ .getLexicalUnitType () == LexicalUnitType .NONE ) {
6969 throw new DOMException (DOMException .SYNTAX_ERR ,
70- function_ + " has to use blank as separator if none is used." );
70+ "'" + function_ + "' has to use blank as separator if none is used." );
7171 }
7272
7373 next = next .getNextLexicalUnit ();
7474 if (next == null ) {
75- throw new DOMException (DOMException .SYNTAX_ERR , function_ + " requires at least three values." );
75+ throw new DOMException (DOMException .SYNTAX_ERR , "'" + function_ + "' requires at least three values." );
7676 }
7777
7878 if (LexicalUnitType .NONE == next .getLexicalUnitType ()) {
7979 throw new DOMException (DOMException .SYNTAX_ERR ,
80- function_ + " has to use blank as separator if none is used." );
80+ "'" + function_ + "' has to use blank as separator if none is used." );
8181 }
8282 if (LexicalUnitType .PERCENTAGE != next .getLexicalUnitType ()) {
8383 throw new DOMException (DOMException .SYNTAX_ERR , "Saturation part has to be percentage." );
@@ -86,21 +86,22 @@ public HSLColorImpl(final String function, final LexicalUnit lu) throws DOMExcep
8686
8787 next = next .getNextLexicalUnit ();
8888 if (next == null ) {
89- throw new DOMException (DOMException .SYNTAX_ERR , function_ + " requires at least three values." );
89+ throw new DOMException (DOMException .SYNTAX_ERR , "'" + function_ + "' requires at least three values." );
9090 }
9191
9292 if (LexicalUnitType .OPERATOR_COMMA != next .getLexicalUnitType ()) {
93- throw new DOMException (DOMException .SYNTAX_ERR , function_ + " parameters must be separated by ','." );
93+ throw new DOMException (DOMException .SYNTAX_ERR ,
94+ "'" + function_ + "' parameters must be separated by ','." );
9495 }
9596
9697 next = next .getNextLexicalUnit ();
9798 if (next == null ) {
98- throw new DOMException (DOMException .SYNTAX_ERR , function_ + " requires at least three values." );
99+ throw new DOMException (DOMException .SYNTAX_ERR , "'" + function_ + "' requires at least three values." );
99100 }
100101
101102 if (LexicalUnitType .NONE == next .getLexicalUnitType ()) {
102103 throw new DOMException (DOMException .SYNTAX_ERR ,
103- function_ + " has to use blank as separator if none is used." );
104+ "'" + function_ + "' has to use blank as separator if none is used." );
104105 }
105106 if (LexicalUnitType .PERCENTAGE != next .getLexicalUnitType ()) {
106107 throw new DOMException (DOMException .SYNTAX_ERR , "Lightness part has to be percentage." );
@@ -113,7 +114,8 @@ public HSLColorImpl(final String function, final LexicalUnit lu) throws DOMExcep
113114 }
114115
115116 if (LexicalUnitType .OPERATOR_COMMA != next .getLexicalUnitType ()) {
116- throw new DOMException (DOMException .SYNTAX_ERR , function_ + " parameters must be separated by ','." );
117+ throw new DOMException (DOMException .SYNTAX_ERR ,
118+ "'" + function_ + "' parameters must be separated by ','." );
117119 }
118120
119121 next = next .getNextLexicalUnit ();
@@ -123,12 +125,13 @@ public HSLColorImpl(final String function, final LexicalUnit lu) throws DOMExcep
123125
124126 if (LexicalUnitType .NONE == next .getLexicalUnitType ()) {
125127 throw new DOMException (DOMException .SYNTAX_ERR ,
126- function_ + " has to use blank as separator if none is used." );
128+ "'" + function_ + "' has to use blank as separator if none is used." );
127129 }
128130 alpha_ = getAlphaPart (next );
129131 next = next .getNextLexicalUnit ();
130132 if (next != null ) {
131- throw new DOMException (DOMException .SYNTAX_ERR , "Too many parameters for " + function_ + " function." );
133+ throw new DOMException (DOMException .SYNTAX_ERR ,
134+ "Too many parameters for '" + function_ + "' function." );
132135 }
133136 return ;
134137 }
@@ -141,11 +144,11 @@ public HSLColorImpl(final String function, final LexicalUnit lu) throws DOMExcep
141144
142145 next = next .getNextLexicalUnit ();
143146 if (next == null ) {
144- throw new DOMException (DOMException .SYNTAX_ERR , function_ + " requires at least three values." );
147+ throw new DOMException (DOMException .SYNTAX_ERR , "'" + function_ + "' requires at least three values." );
145148 }
146149 if (next .getLexicalUnitType () == LexicalUnitType .OPERATOR_COMMA ) {
147150 throw new DOMException (DOMException .SYNTAX_ERR ,
148- function_ + " requires consitent separators (blank or comma)." );
151+ "'" + function_ + "' requires consitent separators (blank or comma)." );
149152 }
150153
151154 if (LexicalUnitType .NONE != next .getLexicalUnitType ()
@@ -159,7 +162,8 @@ public HSLColorImpl(final String function, final LexicalUnit lu) throws DOMExcep
159162 }
160163
161164 if (next .getLexicalUnitType () != LexicalUnitType .OPERATOR_SLASH ) {
162- throw new DOMException (DOMException .SYNTAX_ERR , function_ + " alpha value must be separated by '/'." );
165+ throw new DOMException (DOMException .SYNTAX_ERR ,
166+ "'" + function_ + "' alpha value must be separated by '/'." );
163167 }
164168 next = next .getNextLexicalUnit ();
165169 if (next == null ) {
@@ -170,7 +174,7 @@ public HSLColorImpl(final String function, final LexicalUnit lu) throws DOMExcep
170174
171175 next = next .getNextLexicalUnit ();
172176 if (next != null ) {
173- throw new DOMException (DOMException .SYNTAX_ERR , "Too many parameters for " + function_ + " function." );
177+ throw new DOMException (DOMException .SYNTAX_ERR , "Too many parameters for ' " + function_ + "' function." );
174178 }
175179 }
176180
0 commit comments