Skip to content

Commit

Permalink
Polish documentation
Browse files Browse the repository at this point in the history
- fix small typos in comment, javadoc, error messages,
- improve formatting

Signed-off-by: Marc Wrobel <[email protected]>
  • Loading branch information
marcwrobel committed Nov 3, 2022
1 parent 4c94a30 commit dcb381e
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In the build plugins section add the plugin with a goal of createSPDX:
<plugin>
<groupId>org.spdx</groupId>
<artifactId>spdx-maven-plugin</artifactId>
<!-- please check for updates on https://search.maven.org/search?q=a:spdx-maven-plugin-->
<!-- please check for updates on https://search.maven.org/search?q=a:spdx-maven-plugin -->
<version>0.5.4</version>
<executions>
<execution>
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/spdx/maven/CreateSpdxMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
* <p>
* 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.
*/
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spdx/maven/ExternalReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/org/spdx/maven/LicenseManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> urlStringToSpdxLicenseId = new HashMap<>();

Expand All @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spdx/maven/MavenToSpdxLicenseMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/spdx/maven/NonStandardLicense.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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 )
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/spdx/maven/SpdxDependencyInformation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Relationship> toRelationships = new ArrayList<>();

Expand Down Expand Up @@ -690,7 +690,7 @@ private AnyLicenseInfo mavenLicensesToSpdxLicense( List<License> 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
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/spdx/maven/SpdxDocumentBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 )
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/spdx/maven/SpdxFileCollector.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spdx/maven/SpdxProjectInformation.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spdx/maven/SpdxSourceFileParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/spdx/maven/TestLicenseManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/org/spdx/maven/TestSpdxMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/spdx/maven/TestSpdxSourceFileParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down

0 comments on commit dcb381e

Please sign in to comment.