You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to: JClass creatorType = jclass.owner().directClass("Creator").narrow(jclass);
would yield desired result.
Note however that since ParcelableHelper::addCreator is public such a change could cause issues in case method would be invoked without call that would generate import of android.os.Parcelable
Activity
hannesa2 commentedon Aug 12, 2020
This is the only place I found, but to be honest, I don't understand what's going on there
jsonschema2pojo/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/ParcelableHelper.java
Line 52 in 98d1e6a
unkish commentedon Nov 13, 2020
To get rid of the imports code would have to be modified.
As
android.os.Parcelable.Creatoris a nested interface defined withinandroid.os.Parcelableand latter is imported due to:jsonschema2pojo/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/ObjectRule.java
Line 157 in 98d1e6a
Changing
jsonschema2pojo/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/ParcelableHelper.java
Line 52 in 98d1e6a
to:
JClass creatorType = jclass.owner().directClass("Creator").narrow(jclass);would yield desired result.
Note however that since
ParcelableHelper::addCreatorispublicsuch a change could cause issues in case method would be invoked without call that would generate import ofandroid.os.Parcelableeirnym commentedon Mar 8, 2021
I don't see any reason against importing the
android.os.Parcelable.Creatorclass, but I see no reason to have it twice in imports.hannesa2 commentedon Mar 8, 2021
If you use
ktLint, you will run into errors with unused imports.It's simply noise
Avoid duplicate import of Creator in Parcelable types