Remove duplicate Java wrapper classes#617
Conversation
| import SwiftJavaJNICore | ||
|
|
||
| @JavaClass("java.lang.reflect.Array") | ||
| open class Array: JavaObject { |
There was a problem hiding this comment.
I wonder if we should call it JavaArray hmmm
| import SwiftJavaJNICore | ||
|
|
||
| @JavaClass("java.lang.Class", implements: JavaReflectType.self) | ||
| @JavaClass("java.lang.Class") |
There was a problem hiding this comment.
It's not great that we lost this implements here
There was a problem hiding this comment.
GenericDeclaration wasn't originally included here, so this took the same form.
I understand this isn't ideal.
| open func getGenericSuperclass() -> JavaReflectType! | ||
|
|
||
| @JavaMethod | ||
| open func getGenericInterfaces() -> [JavaReflectType?] |
There was a problem hiding this comment.
These were manually moved to JavaClass+Reflection.swift.
| do { | ||
| swiftSuperclassName = try translator.getSwiftTypeName(javaSuperclassNonOpt, preferValueTypes: false).swiftName | ||
| if let javaGenericSuperclass = javaGenericSuperclass?.as(JavaReflectParameterizedType.self) { | ||
| if let javaGenericSuperclass = javaGenericSuperclass?.as(ParameterizedType.self) { |
There was a problem hiding this comment.
This one comes from where now?
There was a problem hiding this comment.
ParameterizedType was already present in the JavaLangReflect package.
There was a problem hiding this comment.
Gotcha thanks, the types inside SwiftJava are generally there so we could bootstrap the tool and generate the other JavaStdlib... perhaps we can get away from that actually... I'll think about it some more but PR looks ok
Motivation
I noticed that
java.lang.reflect.Typeandjava.lang.reflect.ParameterizedTypewere generated in both theSwiftJavaandJavaLangReflectpackages.To avoid confusion, I want to ensure that these are generated into a single package.
Changes
I have removed these classes from
SwiftJava.All classes under the
java.lang.reflectnamespace are moved intoJavaLangReflectpackage.