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 {
523523 ? " "
524524 : javaMethod. isStatic ? " @JavaStaticMethod \n " : " @JavaMethod \n " ;
525525 let accessModifier = implementedInSwift ? " "
526- : " \( translator. defaultAccessSpecifier) "
526+ : ( javaMethod. isStatic || !translator. translateAsClass) ? " public "
527+ : " open "
527528 let overrideOpt = ( translator. translateAsClass &&
528529 !javaMethod. isStatic && isOverride ( javaMethod) )
529530 ? " override "
Original file line number Diff line number Diff line change @@ -250,11 +250,6 @@ extension JavaTranslator {
250250
251251 throw TranslationError . untranslatedJavaClass ( name)
252252 }
253-
254- /// The default Swift access specifier for a Java method.
255- var defaultAccessSpecifier : String {
256- translateAsClass ? " open " : " public "
257- }
258253}
259254
260255// MARK: Class translation
Original file line number Diff line number Diff line change @@ -323,7 +323,11 @@ class Java2SwiftTests: XCTestCase {
323323 """
324324 @JavaMethod
325325 open func intern() -> String
326+ """ ,
326327 """
328+ @JavaStaticMethod
329+ public func valueOf(_ arg0: Int64) -> String
330+ """ ,
327331 ]
328332 )
329333 }
You can’t perform that action at this time.
0 commit comments