@Test public void testParseSpdxExpressionWithNonValidExpression() { final String license = "APACHE-2.0 PLUS BSD"; final LicenseInformation licenseInformation = LicenseSupport.parseSpdxExpression(license); assertThat(licenseInformation.getLicenses().size()) .isEqualTo(1); assertThat(licenseInformation.getLicenses().iterator().next().getId()) .isEqualTo(license); }
public static LicenseInformation parseSpdxExpression(String expression) { try { return LicenseSupport.fromSPDXExpression(expression); } catch (SpdxException e) { License unparsableExpression = new License(); unparsableExpression.setId(expression); return unparsableExpression; } }
LicenseSupport { public static LicenseInformation parseSpdxExpression(String expression) { try { return LicenseSupport.fromSPDXExpression(expression); } catch (SpdxException e) { License unparsableExpression = new License(); unparsableExpression.setId(expression); return unparsableExpression; } } }
LicenseSupport { public static LicenseInformation parseSpdxExpression(String expression) { try { return LicenseSupport.fromSPDXExpression(expression); } catch (SpdxException e) { License unparsableExpression = new License(); unparsableExpression.setId(expression); return unparsableExpression; } }  }
LicenseSupport { public static LicenseInformation parseSpdxExpression(String expression) { try { return LicenseSupport.fromSPDXExpression(expression); } catch (SpdxException e) { License unparsableExpression = new License(); unparsableExpression.setId(expression); return unparsableExpression; } }  static LicenseInformation mapLicenses(Collection<String> licenses); static LicenseInformation mapLicenses(Collection<String> licenses, LicenseOperator operator); static LicenseInformation fromSPDXExpression(String spdxExpressionString); static LicenseInformation fromSPDXExpression(SpdxExpression spdxExpression); static LicenseInformation parseSpdxExpression(String expression); static LicenseInformation fromSpdxLicenseReferenceExpression(SpdxLicenseReferenceExpression spdxLicenseReferenceExpression); static LicenseInformation fromSpdxLicenseIdExpression(SpdxLicenseIdExpression spdxLicenseIdExpression); static LicenseInformation fromSPDXCompoundExpression(SpdxCompoundExpression spdxCompoundExpression, LicenseStatement license); }
LicenseSupport { public static LicenseInformation parseSpdxExpression(String expression) { try { return LicenseSupport.fromSPDXExpression(expression); } catch (SpdxException e) { License unparsableExpression = new License(); unparsableExpression.setId(expression); return unparsableExpression; } }  static LicenseInformation mapLicenses(Collection<String> licenses); static LicenseInformation mapLicenses(Collection<String> licenses, LicenseOperator operator); static LicenseInformation fromSPDXExpression(String spdxExpressionString); static LicenseInformation fromSPDXExpression(SpdxExpression spdxExpression); static LicenseInformation parseSpdxExpression(String expression); static LicenseInformation fromSpdxLicenseReferenceExpression(SpdxLicenseReferenceExpression spdxLicenseReferenceExpression); static LicenseInformation fromSpdxLicenseIdExpression(SpdxLicenseIdExpression spdxLicenseIdExpression); static LicenseInformation fromSPDXCompoundExpression(SpdxCompoundExpression spdxCompoundExpression, LicenseStatement license);  }