Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,8 @@ tasks.withType<Test> {
this.showStandardStreams = true
}
}

// Validate javadoc for html/syntax/reference correctness but skip "missing" (no comment) warnings
tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:all,-missing", "-quiet")
}
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ extension FFMSwift2JavaGenerator {

/**
* Assume that the passed {@code MemorySegment} represents a memory address of a {@link \(self.javaClassName(for: decl))}.
* <p/>
* <p>
* Warnings:
* <ul>
* <li>No checks are performed about the compatibility of the pointed at memory and the actual \(self.javaClassName(for: decl)) types.</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ extension JNISwift2JavaGenerator {
"""
/**
* Assume that the passed {@code long} represents a memory address of a {@link \(javaName)}.
* <p/>
* <p>
* Warnings:
* <ul>
* <li>No checks are performed about the compatibility of the pointed at memory and the actual \(javaName) types.</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

/**
* Collection of convenience functions to check argument preconditions.
* <p/>
* <p>
* Partially based on {@code com.google.common.base.Preconditions}.
*/
public final class Preconditions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@ public interface SwiftInstance {
/**
* Pointer to the {@code self} of the underlying Swift object or value.
*
* @apiNote When using this pointer one must ensure that the underlying object
* is kept alive using some means (e.g. a class remains retained), as
* this function does not ensure safety of the address in any way.
* <b>API Note:</b> When using this pointer one must ensure that the underlying object
* is kept alive using some means (e.g. a class remains retained), as
* this function does not ensure safety of the address in any way.
*/
long $memoryAddress();

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

/**
* Exposes a boolean value which can be used to indicate if the object was destroyed.
* <p/>
* <p>
* This is exposing the object, rather than performing the action because we don't want to accidentally
* form a strong reference to the {@code SwiftInstance} which could prevent the cleanup from running,
* if using an GC managed instance (e.g. using an {@code AutoSwiftMemorySession}.
*/
AtomicBoolean $statusDestroyedFlag();
/**
* Ensures that this instance has not been destroyed.
* <p/>
* <p>
* If this object has been destroyed, calling this method will cause an {@link IllegalStateException}
* to be thrown. This check should be performed before accessing {@code $memorySegment} to prevent
* use-after-free errors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class SwiftLibraries {

/**
* Allows for configuration if jextracted types should automatically attempt to load swiftCore and the library type is from.
* <p/>
* <p>
* If all libraries you need to load are available in paths passed to {@code -Djava.library.path} this should work correctly,
* however if attempting to load libraries from e.g. the jar as a resource, you may want to disable this.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

/**
* Value is of an unsigned numeric type.
* <p/>
* <p>
* This annotation is used to annotate java integer primitives when their
* corresponding Swift type was actually unsigned, e.g. an {@code @Unsigned long}
* in a method signature corresponds to a Swift {@code UInt64} type, and therefore
* negative values reported by the signed {@code long} should instead be interpreted positive values,
* larger than {@code Long.MAX_VALUE} that are just not representable using a signed {@code long}.
* <p/>
* <p>
* If this annotation is used on a method, it refers to the return type using an unsigned integer.
*/
@Documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
/**
* A Java {@link java.util.Map} backed by a Swift Dictionary living in Swift's native heap memory.
* This avoids un-necessary copying of the whole collection in case we're interested only in a few of its elements.
* <p/>
* <p>
* Methods on this type are implemented as JNI downcalls into the native Swift dictionary, unless specified otherwise.
* <p/>
* <p>
* You can use {@link #toJavaMap()} to obtain a copy of the data structure on the Java heap.
*
* @param <K> the key type, must be a value representable in Swift
Expand Down Expand Up @@ -106,7 +106,7 @@ public Set<Entry<K, V>> entrySet() {
* Make a copy of the dictionary into a Java heap {@link java.util.Map},
* which may be preferable if you are going to perform many operations on the map
* and don't expect the changes to be reflected in Swift.
* <p/>
* <p>
* This operation DOES NOT perform a deep copy. I.e. if the dictionary contained reference types,
* the new map will keep pointing at the same objects in the Swift heap.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
/**
* A Java {@link java.util.Set} backed by a Swift Set living in Swift's native heap memory.
* This avoids un-necessary copying of the whole collection in case we're interested only in a few of its elements.
* <p/>
* <p>
* Methods on this type are implemented as JNI downcalls into the native Swift set, unless specified otherwise.
* <p/>
* <p>
* You can use {@link #toJavaSet()} to obtain a copy of the data structure on the Java heap.
*
* @param <E> the element type, must be a value representable in Swift
Expand Down Expand Up @@ -108,7 +108,7 @@ public E next() {
* Make a copy of the set into a Java heap {@link java.util.Set},
* which may be preferable if you are going to perform many operations on the set
* and don't expect the changes to be reflected in Swift.
* <p/>
* <p>
* This operation DOES NOT perform a deep copy. I.e. if the set contained reference types,
* the new set will keep pointing at the same objects in the Swift heap.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/**
* Corresponds to Swift's built-in 1-element tuple type <code>(T0)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
*/
public class Tuple1<T0> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
/**
* Corresponds to Swift's built-in 10-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
*/
public class Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
/**
* Corresponds to Swift's built-in 11-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
*/
public class Tuple11<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
/**
* Corresponds to Swift's built-in 12-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
* @param <T11> the type of element 11
*/
public class Tuple12<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
/**
* Corresponds to Swift's built-in 13-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
* @param <T11> the type of element 11
* @param <T12> the type of element 12
*/
public class Tuple13<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@
/**
* Corresponds to Swift's built-in 14-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
* @param <T11> the type of element 11
* @param <T12> the type of element 12
* @param <T13> the type of element 13
*/
public class Tuple14<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
/**
* Corresponds to Swift's built-in 15-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
* @param <T11> the type of element 11
* @param <T12> the type of element 12
* @param <T13> the type of element 13
* @param <T14> the type of element 14
*/
public class Tuple15<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@
/**
* Corresponds to Swift's built-in 16-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
* @param <T11> the type of element 11
* @param <T12> the type of element 12
* @param <T13> the type of element 13
* @param <T14> the type of element 14
* @param <T15> the type of element 15
*/
public class Tuple16<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@
/**
* Corresponds to Swift's built-in 17-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
* @param <T11> the type of element 11
* @param <T12> the type of element 12
* @param <T13> the type of element 13
* @param <T14> the type of element 14
* @param <T15> the type of element 15
* @param <T16> the type of element 16
*/
public class Tuple17<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@
/**
* Corresponds to Swift's built-in 18-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
* @param <T11> the type of element 11
* @param <T12> the type of element 12
* @param <T13> the type of element 13
* @param <T14> the type of element 14
* @param <T15> the type of element 15
* @param <T16> the type of element 16
* @param <T17> the type of element 17
*/
public class Tuple18<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@
/**
* Corresponds to Swift's built-in 19-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
* @param <T11> the type of element 11
* @param <T12> the type of element 12
* @param <T13> the type of element 13
* @param <T14> the type of element 14
* @param <T15> the type of element 15
* @param <T16> the type of element 16
* @param <T17> the type of element 17
* @param <T18> the type of element 18
*/
public class Tuple19<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
/**
* Corresponds to Swift's built-in 2-element tuple type <code>(T0, T1)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
*/
public class Tuple2<T0, T1> {
public final T0 $0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@
/**
* Corresponds to Swift's built-in 20-element tuple type <code>(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)</code>.
* Elements are accessed via public final fields <code>$0</code>, <code>$1</code>, etc.
* @param <T0> the type of element 0
* @param <T1> the type of element 1
* @param <T2> the type of element 2
* @param <T3> the type of element 3
* @param <T4> the type of element 4
* @param <T5> the type of element 5
* @param <T6> the type of element 6
* @param <T7> the type of element 7
* @param <T8> the type of element 8
* @param <T9> the type of element 9
* @param <T10> the type of element 10
* @param <T11> the type of element 11
* @param <T12> the type of element 12
* @param <T13> the type of element 13
* @param <T14> the type of element 14
* @param <T15> the type of element 15
* @param <T16> the type of element 16
* @param <T17> the type of element 17
* @param <T18> the type of element 18
* @param <T19> the type of element 19
*/
public class Tuple20<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> {
public final T0 $0;
Expand Down
Loading
Loading