From dcb381e17d1ed2baaca5115ce43b0480189fc7e5 Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Thu, 3 Nov 2022 10:18:06 +0100 Subject: [PATCH] Polish documentation - fix small typos in comment, javadoc, error messages, - improve formatting Signed-off-by: Marc Wrobel --- CONTRIBUTING.md | 4 ++-- README.md | 2 +- .../java/org/spdx/maven/CreateSpdxMojo.java | 22 +++++++++---------- .../org/spdx/maven/ExternalReference.java | 2 +- .../java/org/spdx/maven/LicenseManager.java | 4 ++-- .../spdx/maven/MavenToSpdxLicenseMapper.java | 2 +- .../org/spdx/maven/NonStandardLicense.java | 6 ++--- .../spdx/maven/SpdxDependencyInformation.java | 4 ++-- .../org/spdx/maven/SpdxDocumentBuilder.java | 6 ++--- .../org/spdx/maven/SpdxFileCollector.java | 8 +++---- .../spdx/maven/SpdxProjectInformation.java | 2 +- .../org/spdx/maven/SpdxSourceFileParser.java | 2 +- .../org/spdx/maven/TestLicenseManager.java | 2 +- .../java/org/spdx/maven/TestSpdxMojo.java | 8 +++---- .../spdx/maven/TestSpdxSourceFileParser.java | 4 ++-- 15 files changed, 39 insertions(+), 39 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dce46d3..7566bad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,9 +12,9 @@ Pull Requests ------- The source code for `spdx-maven-plugin` is hosted on [github.com/spdx/spdx-maven-plugin](https://github.com/spdx/spdx-maven-plugin). Please review [open pull requests](https://github.com/spdx/spdx-maven-plugin/pulls) and [active branches](https://github.com/spdx/spdx-maven-plugin/branches) before committing time to a substantial revision. Work along similar lines may already be in progress. -To submit a pull request via GitHub, fork the repository, create a topic branch from `master` for your work, and send a pull request when ready. If you would prefer to send a patch or grant access to pull from your own Git repository, please contact the project's contributors by e-mail. +To submit a pull request via GitHub, fork the repository, create a topic branch from `master` for your work, and send a pull request when ready. If you prefer to send a patch or grant access to pull from your own Git repository, please contact the project's contributors by e-mail. -To contribute an implementation of a feature defined by a version of the SPDX specification later than the one supported by the current SPDX Tools release, clone the branch `spec/X.X`, where X.X is the major.minor version of the targeted specification (e.g. "3.0"). +To contribute an implementation of a feature defined by a version of the SPDX specification later than the one supported by the current SPDX Tools release, clone the branch `spec/X.X`, where `X.X` is the major.minor version of the targeted specification (e.g. `3.0`). Once implemented, submit a pull request with `spec/X.X` branch as the parent branch. diff --git a/README.md b/README.md index cd10353..7e14b2f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ In the build plugins section add the plugin with a goal of createSPDX: org.spdx spdx-maven-plugin - + 0.5.4 diff --git a/src/main/java/org/spdx/maven/CreateSpdxMojo.java b/src/main/java/org/spdx/maven/CreateSpdxMojo.java index 50c7520..c3c1ea0 100644 --- a/src/main/java/org/spdx/maven/CreateSpdxMojo.java +++ b/src/main/java/org/spdx/maven/CreateSpdxMojo.java @@ -146,8 +146,8 @@ public class CreateSpdxMojo extends AbstractMojo private String componentName; /** - * Licenses which are not SPDX listed licenses referenced within the Maven SPDX plugin configuration. All non - * standard licenses must be configured containing the required license ID and license text. + * Licenses which are not SPDX listed licenses referenced within the Maven SPDX plugin configuration. All + * non-standard licenses must be configured containing the required license ID and license text. */ @Parameter private NonStandardLicense[] nonStandardLicenses; @@ -341,7 +341,7 @@ public class CreateSpdxMojo extends AbstractMojo * SPDX data specified in the PathSpecificSpdxInfo parameters. All of the SPDX data parameters are optional. If * any SPDX field is not specified, the project level default data will be used. *

- * If a file or directory is nested within another pathsWithSpcificSpdxInfo, the lowest level values will be used. + * If a file or directory is nested within another pathsWithSpecificSpdxInfo, the lowest level values will be used. * Note: in this case the non-specified SPDX fields for the lowest level PathSpecificSpdxInfo will use the default * project level fields NOT the higher level PathSpecificSpdxInfo. */ @@ -393,7 +393,7 @@ public void execute() throws MojoExecutionException if ( this.spdxFile == null ) { throw ( new MojoExecutionException( - "No SPDX file referenced. " + "Specify a configuration paramaeter spdxFile to resolve." ) ); + "No SPDX file referenced. " + "Specify a configuration parameter spdxFile to resolve." ) ); } File outputDir = this.spdxFile.getParentFile(); if ( outputDir == null ) @@ -684,13 +684,13 @@ private void logNonStandardLicenses( NonStandardLicense[] nonStandardLicenses ) { return; } - for ( NonStandardLicense nonStandardLicens : nonStandardLicenses ) + for ( NonStandardLicense nonStandardLicense : nonStandardLicenses ) { - this.getLog().debug( "Non standard license ID: " + nonStandardLicens.getLicenseId() ); - this.getLog().debug( "Non standard license Text: " + nonStandardLicens.getExtractedText() ); - this.getLog().debug( "Non standard license Comment: " + nonStandardLicens.getComment() ); - this.getLog().debug( "Non standard license Name: " + nonStandardLicens.getName() ); - String[] crossReferences = nonStandardLicens.getCrossReference(); + this.getLog().debug( "Non standard license ID: " + nonStandardLicense.getLicenseId() ); + this.getLog().debug( "Non standard license Text: " + nonStandardLicense.getExtractedText() ); + this.getLog().debug( "Non standard license Comment: " + nonStandardLicense.getComment() ); + this.getLog().debug( "Non standard license Name: " + nonStandardLicense.getName() ); + String[] crossReferences = nonStandardLicense.getCrossReference(); if ( crossReferences != null ) { for ( String crossReference : crossReferences ) @@ -793,7 +793,7 @@ private SpdxDefaultFileInformation getDefaultFileInfoFromParameters( SpdxDocumen /** * Get the SPDX project level information from the parameters The following project level information is taken from - * the POM project description: declaredLicense - mapped by the license parameter in the project. Can be overriden + * the POM project description: declaredLicense - mapped by the license parameter in the project. Can be overridden * by specifying a plugin configuration declaredLicense string concludedLicense - same as the declared license * unless overridden by the plugin configuration parameter concludedLicense name - name of the project. If not * provided, the artifactId is used downloadUrl - distributionManagement().downloadUrl - If not provided, a default diff --git a/src/main/java/org/spdx/maven/ExternalReference.java b/src/main/java/org/spdx/maven/ExternalReference.java index 387fecc..642ac34 100644 --- a/src/main/java/org/spdx/maven/ExternalReference.java +++ b/src/main/java/org/spdx/maven/ExternalReference.java @@ -74,7 +74,7 @@ public ExternalRef getExternalRef( SpdxDocument spdxDoc ) throws MojoExecutionEx } catch ( InvalidSPDXAnalysisException e ) { - throw ( new MojoExecutionException( "Error createing External Reference: "+e.getMessage())); + throw ( new MojoExecutionException( "Error creating External Reference: "+e.getMessage())); } } } diff --git a/src/main/java/org/spdx/maven/LicenseManager.java b/src/main/java/org/spdx/maven/LicenseManager.java index 5be930c..b750f6d 100644 --- a/src/main/java/org/spdx/maven/LicenseManager.java +++ b/src/main/java/org/spdx/maven/LicenseManager.java @@ -47,7 +47,7 @@ public class LicenseManager SpdxDocument spdxDoc = null; /** - * Maps URLs to SPDX license ID's. The SPDX licenses could be an SPDX listed license or a extracted license. + * Maps URLs to SPDX license ID's. The SPDX licenses could be an SPDX listed license or an extracted license. */ Map urlStringToSpdxLicenseId = new HashMap<>(); @@ -64,7 +64,7 @@ public class LicenseManager * * @param spdxDoc SPDX document to add any extracted licenses * @param useStdLicenseSourceUrls if true, map any SPDX listed license source URL to license ID. Note: significant - * performance degredation + * performance degradation * @param Log plugin logger * @throws LicenseMapperException */ diff --git a/src/main/java/org/spdx/maven/MavenToSpdxLicenseMapper.java b/src/main/java/org/spdx/maven/MavenToSpdxLicenseMapper.java index 157ce39..7de7d47 100644 --- a/src/main/java/org/spdx/maven/MavenToSpdxLicenseMapper.java +++ b/src/main/java/org/spdx/maven/MavenToSpdxLicenseMapper.java @@ -130,7 +130,7 @@ public String urlToSpdxId( String url ) } /** - * Initialize the urlSTringToSpdxLicense map with the SPDX listed licenses + * Initialize the urlStringToSpdxLicense map with the SPDX listed licenses * * @param jsonReader Reader for the JSON input file containing the listed licenses * @param log Optional logger diff --git a/src/main/java/org/spdx/maven/NonStandardLicense.java b/src/main/java/org/spdx/maven/NonStandardLicense.java index 8057b9a..d774a65 100644 --- a/src/main/java/org/spdx/maven/NonStandardLicense.java +++ b/src/main/java/org/spdx/maven/NonStandardLicense.java @@ -20,7 +20,7 @@ import org.apache.maven.plugins.annotations.Parameter; /** - * Non standard license (e.g. license which is not in the SPDX standard license list http://spdx.org/licenses) + * Non-standard license (e.g. license which is not in the SPDX standard license list http://spdx.org/licenses) * * @author Gary O'Neall */ @@ -29,7 +29,7 @@ public class NonStandardLicense /** * Required license ID. Must be of the form "LicenseRef-"[idString] where [idString] is a unique string containing - * letters, numbers, “.”, “-” or “+”. Note that this is required for the Maven use of non standard licenses. The + * letters, numbers, “.”, “-” or “+”. Note that this is required for the Maven use of non-standard licenses. The * SPDX standard does not generally require this parameter. */ @Parameter( required = true ) @@ -42,7 +42,7 @@ public class NonStandardLicense private String extractedText; /** - * Optional: Common name of the license not on the SPDX list. If there is no common name or it is not known, please + * Optional: Common name of the license not on the SPDX list. If there is no common name, or it is not known, please * use NOASSERTION. */ @Parameter diff --git a/src/main/java/org/spdx/maven/SpdxDependencyInformation.java b/src/main/java/org/spdx/maven/SpdxDependencyInformation.java index da5ab0a..04e3906 100644 --- a/src/main/java/org/spdx/maven/SpdxDependencyInformation.java +++ b/src/main/java/org/spdx/maven/SpdxDependencyInformation.java @@ -124,7 +124,7 @@ public RelationshipType getRelationshipType() private Log log; /** - * List of all Relationships added for for dependances To a related element + * List of all Relationships added for dependances To a related element */ private List toRelationships = new ArrayList<>(); @@ -690,7 +690,7 @@ private AnyLicenseInfo mavenLicensesToSpdxLicense( List mavenLicenses ) { try { - // The call below will map non standard licenses as well as standard licenses + // The call below will map non-standard licenses as well as standard licenses // but will throw an exception if no mapping is found - we'll try this first // and if there is an error, try just the standard license mapper which will // return an UNSPECIFIED license type if there is no mapping diff --git a/src/main/java/org/spdx/maven/SpdxDocumentBuilder.java b/src/main/java/org/spdx/maven/SpdxDocumentBuilder.java index 696105f..f614e1f 100644 --- a/src/main/java/org/spdx/maven/SpdxDocumentBuilder.java +++ b/src/main/java/org/spdx/maven/SpdxDocumentBuilder.java @@ -88,7 +88,7 @@ public class SpdxDocumentBuilder * @param spdxFile File to store the SPDX document results * @param spdxDocumentNamespace URI for SPDX document - must be unique * @param useStdLicenseSourceUrls if true, map any SPDX standard license source URL to license ID. Note: - * significant performance degredation + * significant performance degradation * @param outputFormat File format for the SPDX file * @throws SpdxBuilderException * @throws LicenseMapperException @@ -167,7 +167,7 @@ public SpdxDocumentBuilder( Log log, File spdxFile, URL spdxDocumentNamespace, } /** - * add non standard licenses to the SPDX document + * Add non-standard licenses to the SPDX document. * * @param spdxDoc * @throws SpdxBuilderException @@ -180,7 +180,7 @@ public void addNonStandardLicenses( NonStandardLicense[] nonStandardLicenses ) t { try { - // the following will add the non standard license to the document container + // the following will add the non-standard license to the document container licenseManager.addExtractedLicense( nonStandardLicense ); } catch ( LicenseManagerException e ) diff --git a/src/main/java/org/spdx/maven/SpdxFileCollector.java b/src/main/java/org/spdx/maven/SpdxFileCollector.java index 6c98f0c..06a8788 100644 --- a/src/main/java/org/spdx/maven/SpdxFileCollector.java +++ b/src/main/java/org/spdx/maven/SpdxFileCollector.java @@ -128,7 +128,7 @@ private static void loadFileExtensionConstants() String trimmedExtension = extension.toUpperCase().trim(); if ( EXT_TO_FILE_TYPE.containsKey( trimmedExtension ) ) { - logger.warn( "Dulicate file extension: "+trimmedExtension ); + logger.warn( "Duplicate file extension: "+trimmedExtension ); } EXT_TO_FILE_TYPE.put( trimmedExtension, fileType ); } @@ -195,7 +195,7 @@ public void collectFiles( FileSet[] fileSets, String baseDir, } /** - * Find the most appropriate file information based on the lowset level match (closedt to file) + * Find the most appropriate file information based on the lowest level match (closed to file) * * @param filePath * @param pathSpecificInformation @@ -324,7 +324,7 @@ private void collectFile( File file, String outputFileName, SpdxDefaultFileInfor } /** - * Create an SpdxSnippt from the snippet information provided + * Create an SpdxSnippet from the snippet information provided * @param snippet * @param spdxFile * @param spdxDoc @@ -685,7 +685,7 @@ public static String generateSha1( File file, SpdxDocument spdxDoc ) throws Spdx * @param file file whose checksum is to be generated * @param algorithms algorithms to generate the checksums * @param spdxDoc SPDX document which will contain the checksum - * @return {@code Set} of checksums for file using each algortihm specified + * @return {@code Set} of checksums for file using each algorithm specified * @throws SpdxCollectionException if the input algorithm is invalid or unavailable or if the file cannot be read * @throws InvalidSPDXAnalysisException */ diff --git a/src/main/java/org/spdx/maven/SpdxProjectInformation.java b/src/main/java/org/spdx/maven/SpdxProjectInformation.java index 3cbf6c8..7b06dd9 100644 --- a/src/main/java/org/spdx/maven/SpdxProjectInformation.java +++ b/src/main/java/org/spdx/maven/SpdxProjectInformation.java @@ -412,7 +412,7 @@ public void logInfo( Log log, SpdxDocument spdxDoc ) } catch ( InvalidSPDXAnalysisException e ) { - externalRefString.append( "Invalid Reference Locatoer" ); + externalRefString.append( "Invalid Reference Locator" ); } log.debug( "External Ref: " + externalRefString.toString() ); } diff --git a/src/main/java/org/spdx/maven/SpdxSourceFileParser.java b/src/main/java/org/spdx/maven/SpdxSourceFileParser.java index ad83804..3d8737c 100644 --- a/src/main/java/org/spdx/maven/SpdxSourceFileParser.java +++ b/src/main/java/org/spdx/maven/SpdxSourceFileParser.java @@ -28,7 +28,7 @@ import org.spdx.library.model.license.LicenseInfoFactory; /** - * Helper class with static methods to parse SDPX source files + * Helper class with static methods to parse SPDX source files * * @author Gary O'Neall */ diff --git a/src/test/java/org/spdx/maven/TestLicenseManager.java b/src/test/java/org/spdx/maven/TestLicenseManager.java index 4803c6c..cc22400 100644 --- a/src/test/java/org/spdx/maven/TestLicenseManager.java +++ b/src/test/java/org/spdx/maven/TestLicenseManager.java @@ -328,7 +328,7 @@ public void testSpdxLicenseToMavenLicense() throws LicenseManagerException, Lice assertEquals( LICENSE_NAME, result.getName() ); assertEquals( CROSS_REF_URLS.get( 0 ), result.getUrl() ); - // non standard without name + // non-standard without name final String LICENSE_ID2 = "LicenseRef-second"; final String LICENSE_TEXT2 = "second text"; AnyLicenseInfo noName = new ExtractedLicenseInfo( LICENSE_ID2, LICENSE_TEXT2 ); diff --git a/src/test/java/org/spdx/maven/TestSpdxMojo.java b/src/test/java/org/spdx/maven/TestSpdxMojo.java index d521401..95c66dd 100644 --- a/src/test/java/org/spdx/maven/TestSpdxMojo.java +++ b/src/test/java/org/spdx/maven/TestSpdxMojo.java @@ -94,7 +94,7 @@ public void testExecute() throws Exception // Test configuration parameters found in the test resources pom.xml file // Document namespace assertEquals( "http://spdx.org/documents/spdx%20toolsv2.0%20rc1", result.getDocumentUri() ); - // Non standard licenses + // Non-standard licenses ExtractedLicenseInfo[] licenseInfos = result.getExtractedLicenseInfos().toArray( new ExtractedLicenseInfo[result.getExtractedLicenseInfos().size()] ); assertEquals( 2, licenseInfos.length ); ExtractedLicenseInfo testLicense1 = null; @@ -361,7 +361,7 @@ public void testExecuteJson() throws Exception // Test configuration parameters found in the test resources pom.xml file // Document namespace assertEquals( "http://spdx.org/documents/spdx%20toolsv2.0%20rc1", result.getDocumentUri() ); - // Non standard licenses + // Non-standard licenses ExtractedLicenseInfo[] licenseInfos = result.getExtractedLicenseInfos().toArray( new ExtractedLicenseInfo[result.getExtractedLicenseInfos().size()] ); assertEquals( 2, licenseInfos.length ); ExtractedLicenseInfo testLicense1 = null; @@ -599,7 +599,7 @@ else if ( externalRefs[0].getReferenceCategory().equals( /** * Add relative file paths to the filePaths list * - * @param prefix Absolute path of the directory to which the filpaths are relative + * @param prefix Absolute path of the directory to which the filepaths are relative * @param dir Directory of files to add * @param filePaths return list of file paths to which paths are added */ @@ -667,7 +667,7 @@ public void testExecuteNoContributors() throws Exception // Test configuration parameters found in the test resources pom.xml file // Document namespace assertEquals( "http://spdx.org/documents/spdx%20toolsv2.0%20rc1", result.getDocumentUri() ); - // Non standard licenses + // Non-standard licenses ExtractedLicenseInfo[] licenseInfos = result.getExtractedLicenseInfos().toArray( new ExtractedLicenseInfo[result.getExtractedLicenseInfos().size()] ); assertEquals( 2, licenseInfos.length ); ExtractedLicenseInfo testLicense1 = null; diff --git a/src/test/java/org/spdx/maven/TestSpdxSourceFileParser.java b/src/test/java/org/spdx/maven/TestSpdxSourceFileParser.java index c0b52db..2739b86 100644 --- a/src/test/java/org/spdx/maven/TestSpdxSourceFileParser.java +++ b/src/test/java/org/spdx/maven/TestSpdxSourceFileParser.java @@ -94,7 +94,7 @@ public void testParseTextForSpdxLicenses() throws SpdxSourceParserException, Inv assertEquals( 2, result.size() ); assertEquals( APACHE_LICENSE_ID, ( (SpdxListedLicense) result.get( 0 ) ).getLicenseId() ); assertEquals( MIT_LICENSE_ID, ( (SpdxListedLicense) result.get( 1 ) ).getLicenseId() ); - // Multpile SPDX ID's complex + // Multiple SPDX ID's complex result = SpdxSourceFileParser.parseTextForSpdxLicenses( MULTIPLE_COMPLEX_IDS ); assertEquals( 6, result.size() ); assertTrue( result.get( 0 ) instanceof DisjunctiveLicenseSet ); @@ -117,7 +117,7 @@ public void testParseTextForSpdxLicenses() throws SpdxSourceParserException, Inv { //IGNORE - this is success } - // Invalid expression (shoud error) + // Invalid expression (should error) try { result = SpdxSourceFileParser.parseTextForSpdxLicenses( INVALID_EXPRESSION );