File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -523,7 +523,8 @@ extension JavaClassTranslator {
523
523
? " "
524
524
: javaMethod. isStatic ? " @JavaStaticMethod \n " : " @JavaMethod \n " ;
525
525
let accessModifier = implementedInSwift ? " "
526
- : " \( translator. defaultAccessSpecifier) "
526
+ : ( javaMethod. isStatic || !translator. translateAsClass) ? " public "
527
+ : " open "
527
528
let overrideOpt = ( translator. translateAsClass &&
528
529
!javaMethod. isStatic && isOverride ( javaMethod) )
529
530
? " override "
Original file line number Diff line number Diff line change @@ -250,11 +250,6 @@ extension JavaTranslator {
250
250
251
251
throw TranslationError . untranslatedJavaClass ( name)
252
252
}
253
-
254
- /// The default Swift access specifier for a Java method.
255
- var defaultAccessSpecifier : String {
256
- translateAsClass ? " open " : " public "
257
- }
258
253
}
259
254
260
255
// MARK: Class translation
Original file line number Diff line number Diff line change @@ -323,7 +323,11 @@ class Java2SwiftTests: XCTestCase {
323
323
"""
324
324
@JavaMethod
325
325
open func intern() -> String
326
+ """ ,
326
327
"""
328
+ @JavaStaticMethod
329
+ public func valueOf(_ arg0: Int64) -> String
330
+ """ ,
327
331
]
328
332
)
329
333
}
You can’t perform that action at this time.
0 commit comments