Skip to content

Commit 9fe337a

Browse files
authored
Avoid javadoc linter warnings (#691)
1 parent c5bd059 commit 9fe337a

36 files changed

Lines changed: 326 additions & 21 deletions

BuildLogic/src/main/kotlin/build-logic.java-common-conventions.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,8 @@ tasks.withType<Test> {
101101
this.showStandardStreams = true
102102
}
103103
}
104+
105+
// Validate javadoc for html/syntax/reference correctness but skip "missing" (no comment) warnings
106+
tasks.withType<Javadoc> {
107+
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:all,-missing", "-quiet")
108+
}

Sources/JExtractSwiftLib/FFM/FFMSwift2JavaGenerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ extension FFMSwift2JavaGenerator {
299299
300300
/**
301301
* Assume that the passed {@code MemorySegment} represents a memory address of a {@link \(self.javaClassName(for: decl))}.
302-
* <p/>
302+
* <p>
303303
* Warnings:
304304
* <ul>
305305
* <li>No checks are performed about the compatibility of the pointed at memory and the actual \(self.javaClassName(for: decl)) types.</li>

Sources/JExtractSwiftLib/JNI/JNISwift2JavaGenerator+JavaBindingsPrinting.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ extension JNISwift2JavaGenerator {
262262
"""
263263
/**
264264
* Assume that the passed {@code long} represents a memory address of a {@link \(javaName)}.
265-
* <p/>
265+
* <p>
266266
* Warnings:
267267
* <ul>
268268
* <li>No checks are performed about the compatibility of the pointed at memory and the actual \(javaName) types.</li>

SwiftKitCore/src/main/java/org/swift/swiftkit/core/Preconditions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
/**
3434
* Collection of convenience functions to check argument preconditions.
35-
* <p/>
35+
* <p>
3636
* Partially based on {@code com.google.common.base.Preconditions}.
3737
*/
3838
public final class Preconditions {

SwiftKitCore/src/main/java/org/swift/swiftkit/core/SwiftInstance.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,30 @@ public interface SwiftInstance {
2020
/**
2121
* Pointer to the {@code self} of the underlying Swift object or value.
2222
*
23-
* @apiNote When using this pointer one must ensure that the underlying object
24-
* is kept alive using some means (e.g. a class remains retained), as
25-
* this function does not ensure safety of the address in any way.
23+
* <b>API Note:</b> When using this pointer one must ensure that the underlying object
24+
* is kept alive using some means (e.g. a class remains retained), as
25+
* this function does not ensure safety of the address in any way.
2626
*/
2727
long $memoryAddress();
2828

2929
/**
3030
* Called when the arena has decided the value should be destroyed.
31-
* <p/>
31+
* <p>
3232
* <b>Warning:</b> The cleanup action must not capture {@code this}.
3333
*/
3434
SwiftInstanceCleanup $createCleanup();
3535

3636
/**
3737
* Exposes a boolean value which can be used to indicate if the object was destroyed.
38-
* <p/>
38+
* <p>
3939
* This is exposing the object, rather than performing the action because we don't want to accidentally
4040
* form a strong reference to the {@code SwiftInstance} which could prevent the cleanup from running,
4141
* if using an GC managed instance (e.g. using an {@code AutoSwiftMemorySession}.
4242
*/
4343
AtomicBoolean $statusDestroyedFlag();
4444
/**
4545
* Ensures that this instance has not been destroyed.
46-
* <p/>
46+
* <p>
4747
* If this object has been destroyed, calling this method will cause an {@link IllegalStateException}
4848
* to be thrown. This check should be performed before accessing {@code $memorySegment} to prevent
4949
* use-after-free errors.

SwiftKitCore/src/main/java/org/swift/swiftkit/core/SwiftLibraries.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public final class SwiftLibraries {
3232

3333
/**
3434
* Allows for configuration if jextracted types should automatically attempt to load swiftCore and the library type is from.
35-
* <p/>
35+
* <p>
3636
* If all libraries you need to load are available in paths passed to {@code -Djava.library.path} this should work correctly,
3737
* however if attempting to load libraries from e.g. the jar as a resource, you may want to disable this.
3838
*/

SwiftKitCore/src/main/java/org/swift/swiftkit/core/annotations/Unsigned.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626

2727
/**
2828
* Value is of an unsigned numeric type.
29-
* <p/>
29+
* <p>
3030
* This annotation is used to annotate java integer primitives when their
3131
* corresponding Swift type was actually unsigned, e.g. an {@code @Unsigned long}
3232
* in a method signature corresponds to a Swift {@code UInt64} type, and therefore
3333
* negative values reported by the signed {@code long} should instead be interpreted positive values,
3434
* larger than {@code Long.MAX_VALUE} that are just not representable using a signed {@code long}.
35-
* <p/>
35+
* <p>
3636
* If this annotation is used on a method, it refers to the return type using an unsigned integer.
3737
*/
3838
@Documented

SwiftKitCore/src/main/java/org/swift/swiftkit/core/collections/SwiftDictionaryMap.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
/**
2323
* A Java {@link java.util.Map} backed by a Swift Dictionary living in Swift's native heap memory.
2424
* This avoids un-necessary copying of the whole collection in case we're interested only in a few of its elements.
25-
* <p/>
25+
* <p>
2626
* Methods on this type are implemented as JNI downcalls into the native Swift dictionary, unless specified otherwise.
27-
* <p/>
27+
* <p>
2828
* You can use {@link #toJavaMap()} to obtain a copy of the data structure on the Java heap.
2929
*
3030
* @param <K> the key type, must be a value representable in Swift
@@ -106,7 +106,7 @@ public Set<Entry<K, V>> entrySet() {
106106
* Make a copy of the dictionary into a Java heap {@link java.util.Map},
107107
* which may be preferable if you are going to perform many operations on the map
108108
* and don't expect the changes to be reflected in Swift.
109-
* <p/>
109+
* <p>
110110
* This operation DOES NOT perform a deep copy. I.e. if the dictionary contained reference types,
111111
* the new map will keep pointing at the same objects in the Swift heap.
112112
*

SwiftKitCore/src/main/java/org/swift/swiftkit/core/collections/SwiftSet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
/**
2323
* A Java {@link java.util.Set} backed by a Swift Set living in Swift's native heap memory.
2424
* This avoids un-necessary copying of the whole collection in case we're interested only in a few of its elements.
25-
* <p/>
25+
* <p>
2626
* Methods on this type are implemented as JNI downcalls into the native Swift set, unless specified otherwise.
27-
* <p/>
27+
* <p>
2828
* You can use {@link #toJavaSet()} to obtain a copy of the data structure on the Java heap.
2929
*
3030
* @param <E> the element type, must be a value representable in Swift
@@ -108,7 +108,7 @@ public E next() {
108108
* Make a copy of the set into a Java heap {@link java.util.Set},
109109
* which may be preferable if you are going to perform many operations on the set
110110
* and don't expect the changes to be reflected in Swift.
111-
* <p/>
111+
* <p>
112112
* This operation DOES NOT perform a deep copy. I.e. if the set contained reference types,
113113
* the new set will keep pointing at the same objects in the Swift heap.
114114
*

SwiftKitCore/src/main/java/org/swift/swiftkit/core/tuple/Tuple1.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
/**
1818
* Corresponds to Swift's built-in 1-element tuple type <code>(T0)</code>.
1919
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
20+
* @param <T0> the type of element 0
2021
*/
2122
public class Tuple1<T0> {
2223
public final T0 $0;

0 commit comments

Comments
 (0)