Skip to content

Commit 45205e1

Browse files
authored
feature: Code enhancement (#267)
1 parent 6e53b3b commit 45205e1

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

Samples/SwiftKitSampleApp/src/test/java/org/swift/swiftkit/SwiftArenaTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void arena_markAsDestroyed_preventUseAfterFree_class() {
6363

6464
try {
6565
unsafelyEscapedOutsideArenaScope.echoIntMethod(1);
66-
fail("Expected exception to be thrown! Object was suposed to be dead.");
66+
fail("Expected exception to be thrown! Object was supposed to be dead.");
6767
} catch (IllegalStateException ex) {
6868
return;
6969
}
@@ -82,7 +82,7 @@ public void arena_markAsDestroyed_preventUseAfterFree_struct() {
8282

8383
try {
8484
unsafelyEscapedOutsideArenaScope.echoIntMethod(1);
85-
fail("Expected exception to be thrown! Object was suposed to be dead.");
85+
fail("Expected exception to be thrown! Object was supposed to be dead.");
8686
} catch (IllegalStateException ex) {
8787
return;
8888
}

Sources/JExtractSwiftLib/CodePrinter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ public struct CodePrinter {
5353
self.mode = mode
5454
}
5555

56-
internal mutating func append(_ text: String) {
56+
mutating func append(_ text: String) {
5757
contents.append(text)
5858
if self.verbose {
5959
Swift.print(text, terminator: "")
6060
}
6161
}
6262

63-
internal mutating func append<S>(contentsOf text: S)
63+
mutating func append<S>(contentsOf text: S)
6464
where S: Sequence, S.Element == Character {
6565
contents.append(contentsOf: text)
6666
if self.verbose {

Sources/JExtractSwiftLib/Convenience/SwiftSyntax+Extensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ import SwiftDiagnostics
1616
import SwiftSyntax
1717

1818
extension WithModifiersSyntax {
19-
internal var accessControlModifiers: DeclModifierListSyntax {
19+
var accessControlModifiers: DeclModifierListSyntax {
2020
modifiers.filter { modifier in
2121
modifier.isAccessControl
2222
}
2323
}
2424
}
2525

2626
extension ImplicitlyUnwrappedOptionalTypeSyntax {
27-
internal var asOptionalTypeSyntax: any TypeSyntaxProtocol {
27+
var asOptionalTypeSyntax: any TypeSyntaxProtocol {
2828
OptionalTypeSyntax(
2929
leadingTrivia: leadingTrivia,
3030
unexpectedBeforeWrappedType,

Sources/JExtractSwiftLib/Logger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ extension Logger.Level: ExpressibleByArgument {
111111
}
112112

113113
extension Logger.Level {
114-
internal var naturalIntegralValue: Int {
114+
var naturalIntegralValue: Int {
115115
switch self {
116116
case .trace:
117117
return 0

Sources/JavaKit/JavaKitVM/LockedState.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
#if canImport(os)
16-
internal import os
16+
import os
1717
#if FOUNDATION_FRAMEWORK && canImport(C.os.lock)
18-
internal import C.os.lock
18+
import C.os.lock
1919
#endif
2020
#elseif canImport(Bionic)
2121
import Bionic

Sources/JavaKit/JavaValue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import JavaTypes
3434
/// The protocol provides operations to bridge values in both directions:
3535
/// - `getJNIValue(in:)`: produces the JNI value (of type `JNIType`) for the
3636
/// `self` Swift value in the given JNI environment.
37-
/// - `init(fromJNI:in:)`: intializes a Swift value from the JNI value (of
37+
/// - `init(fromJNI:in:)`: initializes a Swift value from the JNI value (of
3838
/// type `JNIType`) in the given JNI environment.
3939
///
4040
/// The protocol also provides hooks to tie into JNI, including operations to

Sources/SwiftKitSwift/SwiftKit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public func _swiftjava_swift_isUniquelyReferenced(object: UnsafeMutableRawPointe
3434

3535

3636
@_alwaysEmitIntoClient @_transparent
37-
internal func _swiftjava_withHeapObject<R>(
37+
func _swiftjava_withHeapObject<R>(
3838
of object: AnyObject,
3939
_ body: (UnsafeMutableRawPointer) -> R
4040
) -> R {

SwiftKit/src/main/java/org/swift/swiftkit/SwiftValueWitnessTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public abstract class SwiftValueWitnessTable {
5656
MemoryLayout.PathElement.groupElement("vwt"));
5757

5858
/**
59-
* Given the address of Swift type metadata for a type, return the addres
59+
* Given the address of Swift type metadata for a type, return the address
6060
* of the "full" type metadata that can be accessed via fullTypeMetadataLayout.
6161
*/
6262
public static MemorySegment fullTypeMetadata(MemorySegment typeMetadata) {

USER_GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Note that we are passing the Jar file in the `classpath` argument when initializ
221221

222222
### Downcasting
223223

224-
All Java classes available in Swift provide `is` and `as` methods to check whether an object dynamically matches another type. The `is` operation is the equivalent of Java's `instanceof` and Swift's `is` operator, and will checkin whether a given object is of the specified type, e.g.,
224+
All Java classes available in Swift provide `is` and `as` methods to check whether an object dynamically matches another type. The `is` operation is the equivalent of Java's `instanceof` and Swift's `is` operator, and will checking whether a given object is of the specified type, e.g.,
225225

226226
```swift
227227
if myObject.is(URL.self) {
@@ -626,7 +626,7 @@ The project is still very early days, however the general outline of using this
626626
- These `.swiftinterface` files are imported by jextract-swift which generates `*.java` files
627627
- The generated Java files contain generated code for efficient native invocations.
628628

629-
You can then use Swift libraries in Java just by calling the apropriate methods and initializers.
629+
You can then use Swift libraries in Java just by calling the appropriate methods and initializers.
630630

631631
## `jextract-swift`: Generating Java bridging files
632632

0 commit comments

Comments
 (0)