@@ -76,7 +76,7 @@ enum Operator {
7676 static AnyLicenseInfo parseLicenseExpression (String expression , IModelStore store ,
7777 String documentUri , ModelCopyManager copyManager ) throws InvalidSPDXAnalysisException {
7878 if (expression == null || expression .trim ().isEmpty ()) {
79- throw ( new LicenseParserException ("Empty license expression" ) );
79+ throw new LicenseParserException ("Empty license expression" );
8080 }
8181 Objects .requireNonNull (store , "Model store can not be null" );
8282 Objects .requireNonNull (documentUri , "Document URI can not be null" );
@@ -90,9 +90,9 @@ static AnyLicenseInfo parseLicenseExpression(String expression, IModelStore stor
9090 return parseLicenseExpression (tokens , store , documentUri , copyManager );
9191 } catch (LicenseParserException ex ) {
9292 // Add the expression to the error message to provide additional information to the user
93- throw ( new LicenseParserException (ex .getMessage ()+" License expression: '" +expression +"'" , ex ) );
93+ throw new LicenseParserException (ex .getMessage ()+" License expression: '" +expression +"'" , ex );
9494 } catch (EmptyStackException ex ) {
95- throw ( new LicenseParserException ("Invalid license expression: '" +expression +"' - check that every operator (e.g. AND and OR) has operators and that parenthesis are matched" ) );
95+ throw new LicenseParserException ("Invalid license expression: '" +expression +"' - check that every operator (e.g. AND and OR) has operators and that parenthesis are matched" );
9696 }
9797 }
9898 }
@@ -145,7 +145,7 @@ private static void processPreToken(String preToken,
145145 private static AnyLicenseInfo parseLicenseExpression (String [] tokens , IModelStore store ,
146146 String documentUri , ModelCopyManager copyManager ) throws InvalidSPDXAnalysisException {
147147 if (tokens == null || tokens .length == 0 ) {
148- throw ( new LicenseParserException ("Expected license expression" ) );
148+ throw new LicenseParserException ("Expected license expression" );
149149 }
150150 Stack <AnyLicenseInfo > operandStack = new Stack <AnyLicenseInfo >();
151151 Stack <Operator > operatorStack = new Stack <Operator >();
@@ -157,7 +157,7 @@ private static AnyLicenseInfo parseLicenseExpression(String[] tokens, IModelStor
157157 if (LEFT_PAREN .equals (token )) {
158158 int rightParenIndex = findMatchingParen (tokens , tokenIndex );
159159 if (rightParenIndex < 0 ) {
160- throw ( new LicenseParserException ("Missing right parenthesis" ) );
160+ throw new LicenseParserException ("Missing right parenthesis" );
161161 }
162162 String [] nestedTokens = Arrays .copyOfRange (tokens , tokenIndex , rightParenIndex );
163163 operandStack .push (parseLicenseExpression (nestedTokens , store , documentUri , copyManager ));
@@ -173,7 +173,7 @@ private static AnyLicenseInfo parseLicenseExpression(String[] tokens, IModelStor
173173 evaluateExpression (tosOperator , operandStack , store , documentUri , copyManager );
174174 }
175175 if (tokenIndex >= tokens .length ) {
176- throw ( new LicenseParserException ("Missing exception clause" ) );
176+ throw new LicenseParserException ("Missing exception clause" );
177177 }
178178 token = tokens [tokenIndex ++];
179179 LicenseException licenseException = null ;
@@ -189,10 +189,10 @@ private static AnyLicenseInfo parseLicenseExpression(String[] tokens, IModelStor
189189 }
190190 AnyLicenseInfo operand = operandStack .pop ();
191191 if (operand == null ) {
192- throw ( new LicenseParserException ("Missing license for with clause" ) );
192+ throw new LicenseParserException ("Missing license for with clause" );
193193 }
194194 if (!((operand instanceof SimpleLicensingInfo ) || (operand instanceof OrLaterOperator ))) {
195- throw ( new LicenseParserException ("License with exception is not of type SimpleLicensingInfo or OrLaterOperator" ) );
195+ throw new LicenseParserException ("License with exception is not of type SimpleLicensingInfo or OrLaterOperator" );
196196 }
197197 WithExceptionOperator weo = new WithExceptionOperator (store , documentUri , store .getNextId (IdType .Anonymous , documentUri ), copyManager , true );
198198 weo .setLicense (operand );
@@ -216,7 +216,7 @@ private static AnyLicenseInfo parseLicenseExpression(String[] tokens, IModelStor
216216 }
217217 AnyLicenseInfo retval = operandStack .pop ();
218218 if (!operandStack .isEmpty ()) {
219- throw ( new LicenseParserException ("Invalid license expression. Expecting more operands." ) );
219+ throw new LicenseParserException ("Invalid license expression. Expecting more operands." );
220220 }
221221 return retval ;
222222 }
@@ -311,7 +311,7 @@ private static void evaluateExpression(Operator operator,
311311 // unary operator
312312 AnyLicenseInfo license = operandStack .pop ();
313313 if (!(license instanceof SimpleLicensingInfo )) {
314- throw ( new LicenseParserException ("Missing license for the '+' or later operator" ) );
314+ throw new LicenseParserException ("Missing license for the '+' or later operator" );
315315 }
316316 OrLaterOperator olo = new OrLaterOperator (store , documentUri , store .getNextId (IdType .Anonymous , documentUri ), copyManager , true );
317317 olo .setLicense ((SimpleLicensingInfo )license );
@@ -321,7 +321,7 @@ private static void evaluateExpression(Operator operator,
321321 AnyLicenseInfo operand2 = operandStack .pop ();
322322 AnyLicenseInfo operand1 = operandStack .pop ();
323323 if (operand1 == null || operand2 == null ) {
324- throw ( new LicenseParserException ("Missing operands for the " +operator .toString ()+" operator" ) );
324+ throw new LicenseParserException ("Missing operands for the " +operator .toString ()+" operator" );
325325 }
326326 operandStack .push (evaluateBinary (operator , operand1 , operand2 , store , documentUri , copyManager ));
327327 }
@@ -364,7 +364,7 @@ private static AnyLicenseInfo evaluateBinary(Operator tosOperator,
364364 return retval ;
365365 }
366366 } else {
367- throw ( new LicenseParserException ("Unknown operator " +tosOperator .toString () ));
367+ throw new LicenseParserException ("Unknown operator " +tosOperator .toString ());
368368 }
369369 }
370370}
0 commit comments