This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ant-antlibs-cyclonedx.git
The following commit(s) were added to refs/heads/main by this push:
new 4ad120a fix some javascript warnings
4ad120a is described below
commit 4ad120a6571c1a87d63c490324c2906d62d9b022
Author: Stefan Bodewig <[email protected]>
AuthorDate: Mon Aug 17 18:33:38 2026 +0200
fix some javascript warnings
---
src/main/org/apache/ant/cyclonedx/Component.java | 22 ++++++++++++++++++++++
src/main/org/apache/ant/cyclonedx/EnumUtils.java | 19 +++++++++++++++++++
.../FilesystemOnlyMappedResourceCollection.java | 6 ++++++
.../ant/cyclonedx/IvyModuleComponentResolver.java | 2 ++
src/main/org/apache/ant/cyclonedx/License.java | 5 +++++
5 files changed, 54 insertions(+)
diff --git a/src/main/org/apache/ant/cyclonedx/Component.java
b/src/main/org/apache/ant/cyclonedx/Component.java
index f757189..cd7a6c7 100644
--- a/src/main/org/apache/ant/cyclonedx/Component.java
+++ b/src/main/org/apache/ant/cyclonedx/Component.java
@@ -1014,6 +1014,13 @@ public class Component extends DataType {
return component;
}
+ /**
+ * Maps from a CycloneDX Component to an incstance of this type.
+ *
+ * @param real the CycloneDX component
+ * @param dependencies list of dependencies of "real"
+ * @return a {@link Component} matching real and dependencies
+ */
protected static Component from(
org.cyclonedx.model.Component real,
List<org.cyclonedx.model.Dependency> dependencies) {
@@ -1022,6 +1029,14 @@ public class Component extends DataType {
return c;
}
+ /**
+ * Enriches this instance with data read from a CycloneDX component and
its dependencies.
+ *
+ * <p>Any values already set on this component will not be overwritten by
"real"'s values.</p>
+ +
+ * @param real the CycloneDX component
+ * @param allDependencies list of dependencies of "real"
+ */
protected void fillFrom(org.cyclonedx.model.Component real,
List<org.cyclonedx.model.Dependency>
allDependencies) {
if (type == null) {
@@ -1238,10 +1253,17 @@ public class Component extends DataType {
public static class Tag {
private String tag;
+ /**
+ * Creates an empty instance.
+ */
public Tag() {
}
/**
+ * Creates a new instance.
+ *
+ * @param tag the tag
+ *
* @since CycloneDX Antlib 0.2
*/
public Tag(String tag) {
diff --git a/src/main/org/apache/ant/cyclonedx/EnumUtils.java
b/src/main/org/apache/ant/cyclonedx/EnumUtils.java
index b85c910..3c558b9 100644
--- a/src/main/org/apache/ant/cyclonedx/EnumUtils.java
+++ b/src/main/org/apache/ant/cyclonedx/EnumUtils.java
@@ -28,6 +28,14 @@ import org.apache.tools.ant.BuildException;
*/
public class EnumUtils {
+ /**
+ * Provides strings that can be mapped to enum values unambiguously.
+ *
+ * @param clazz the enum type
+ * @param alternativeProvider a function generating alternative names for
the enum constant
+ * @param <E> the enum type
+ * @return array of enum constants and alternative names for each constant.
+ */
public static <E extends Enum<E>> String[] valuesPlus(
Class<E> clazz,
Function<E, String> alternativeProvider) {
@@ -36,6 +44,17 @@ public class EnumUtils {
.toArray(String[]::new);
}
+ /**
+ * Maps a string to an enum value.
+ *
+ * @param clazz the enum type
+ * @param value the string to translate
+ * @param alternativeProvider a function generating alternative names for
the enum constant
+ * @param <E> the enum type
+ * @return the enum constant the string could be mapped to
+ * @throws NullPointerException if value is null
+ * @throws BuildException if value can not be translated
+ */
public static <E extends Enum<E>> E valueOf(
Class<E> clazz,
String value,
diff --git
a/src/main/org/apache/ant/cyclonedx/FilesystemOnlyMappedResourceCollection.java
b/src/main/org/apache/ant/cyclonedx/FilesystemOnlyMappedResourceCollection.java
index 9d84ca4..f77cc10 100644
---
a/src/main/org/apache/ant/cyclonedx/FilesystemOnlyMappedResourceCollection.java
+++
b/src/main/org/apache/ant/cyclonedx/FilesystemOnlyMappedResourceCollection.java
@@ -58,6 +58,8 @@ public final class FilesystemOnlyMappedResourceCollection
/**
* Adds the resources to map.
+ *
+ * @param c the resources
*/
public void add(ResourceCollection c) throws BuildException {
checkChildrenAllowed();
@@ -73,6 +75,8 @@ public final class FilesystemOnlyMappedResourceCollection
/**
* Creates a nested mapper.
+ *
+ * @return a mapper instance that can be used to configure filename mapping
*/
public Mapper createMapper() throws BuildException {
checkChildrenAllowed();
@@ -86,6 +90,8 @@ public final class FilesystemOnlyMappedResourceCollection
/**
* Creates a nested mapper by directly providing the implementation.
+ *
+ * @param fileNameMapper the mapper to use
*/
public void add(FileNameMapper fileNameMapper) {
createMapper().add(fileNameMapper);
diff --git a/src/main/org/apache/ant/cyclonedx/IvyModuleComponentResolver.java
b/src/main/org/apache/ant/cyclonedx/IvyModuleComponentResolver.java
index c2f7c3a..bb5d6ca 100644
--- a/src/main/org/apache/ant/cyclonedx/IvyModuleComponentResolver.java
+++ b/src/main/org/apache/ant/cyclonedx/IvyModuleComponentResolver.java
@@ -147,6 +147,8 @@ public class IvyModuleComponentResolver extends
ProjectComponent implements Comp
* The retrieve pattern used for retrieving the dependency artifacts.
*
* <p>Defaults to {@code ${ivy.retrieve.pattern}}.</p>
+ *
+ * @param pattern retrieve pattern used
*/
public void setPattern(String pattern) {
this.pattern = pattern;
diff --git a/src/main/org/apache/ant/cyclonedx/License.java
b/src/main/org/apache/ant/cyclonedx/License.java
index a0adb47..ab9c945 100644
--- a/src/main/org/apache/ant/cyclonedx/License.java
+++ b/src/main/org/apache/ant/cyclonedx/License.java
@@ -179,6 +179,11 @@ public class License extends DataType {
}
/**
+ * Creates an instance of the License class based on a CylconeDX
LicenseItem.
+ *
+ * @param licenseItem CycloneDX LicenseItem to tranlate
+ * @return mapped License instance
+ *
* @since CycloneDX Antlib 0.2
*/
public static License from(LicenseItem licenseItem) {