File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -485,9 +485,10 @@ extension JavaClassTranslator {
485485 let parametersStr = parameters. map { $0. description } . joined ( separator: " , " )
486486 let throwsStr = javaConstructor. throwsCheckedException ? " throws " : " "
487487 let accessModifier = javaConstructor. isPublic ? " public " : " "
488+ let convenienceModifier = translator. translateAsClass ? " convenience " : " "
488489 return """
489490 @JavaMethod
490- \( raw: accessModifier) init( \( raw: parametersStr) ) \( raw: throwsStr)
491+ \( raw: accessModifier) \( raw : convenienceModifier ) init( \( raw: parametersStr) ) \( raw: throwsStr)
491492 """
492493 }
493494
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ class Java2SwiftTests: XCTestCase {
280280 """ ,
281281 """
282282 @JavaMethod
283- public init(environment: JNIEnvironment? = nil)
283+ public convenience init(environment: JNIEnvironment? = nil)
284284 """ ,
285285 """
286286 @JavaMethod
@@ -310,7 +310,7 @@ class Java2SwiftTests: XCTestCase {
310310 """ ,
311311 """
312312 @JavaMethod
313- public init(environment: JNIEnvironment? = nil)
313+ public convenience init(environment: JNIEnvironment? = nil)
314314 """ ,
315315 """
316316 @JavaMethod
You can’t perform that action at this time.
0 commit comments