Skip to content

Commit

Permalink
LicenseExpressionParser: Allow "+" as part of license-refs
Browse files Browse the repository at this point in the history
license-refs as defined in Appendix IV of the SPDX 2.0 specification
should be allowed to contain "+", e.g. to write "LicenseRef-LGPL-3.0+".
Currently, LicenseExpressionParser interprets "+" in license-refs as
Operator.OR_LATER even if they are no compound-expression. Fix this by
checking the compound-expression for a license-ref and do not take "+" as
a token in that case.
  • Loading branch information
sschuberth committed Oct 28, 2015
1 parent c28bb23 commit c5f07b6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private static void processPreToken(String preToken,
} else if (preToken.endsWith(")")) {
processPreToken(preToken.substring(0, preToken.length()-1), tokenList);
tokenList.add(")");
} else if (preToken.endsWith("+")) {
} else if (preToken.endsWith("+") && !(preToken.startsWith(SpdxRdfConstants.EXTERNAL_DOC_REF_PRENUM) || preToken.startsWith(SpdxRdfConstants.NON_STD_LICENSE_ID_PRENUM))) {
processPreToken(preToken.substring(0, preToken.length()-1), tokenList);
tokenList.add("+");
} else {
Expand Down

0 comments on commit c5f07b6

Please sign in to comment.