File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/main/java/org/cyclonedx/maven Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ private MavenProject getEffectiveMavenProject(final Artifact artifact) throws Pr
272
272
}
273
273
274
274
private void addExternalReference (final ExternalReference .Type referenceType , final String url , final Component component ) {
275
- if (isURLBlank (url ) || doesComponentHaveExternalReference (component , referenceType )) {
275
+ if (isBlank (url ) || doesComponentHaveExternalReference (component , referenceType )) {
276
276
return ;
277
277
}
278
278
try {
@@ -422,12 +422,11 @@ private Component.Type resolveProjectType(String projectType) {
422
422
return Component .Type .LIBRARY ;
423
423
}
424
424
425
- private static boolean isURLBlank (String url ) {
426
- return url == null || url .isEmpty () || url .trim ().length () == 0 ;
425
+ private static boolean isBlank (String s ) {
426
+ return s == null || s .isEmpty () || s .trim ().isEmpty () ;
427
427
}
428
428
429
429
private static boolean isLicenseBlank (org .apache .maven .model .License license ) {
430
- return (license .getName () == null || license .getName ().isEmpty () || license .getName ().trim ().length () == 0 )
431
- && (license .getUrl () == null || license .getUrl ().isEmpty () || license .getUrl ().trim ().length () == 0 );
430
+ return isBlank (license .getName ()) && isBlank (license .getUrl ());
432
431
}
433
432
}
You can’t perform that action at this time.
0 commit comments