Skip to content

Commit ccd3b90

Browse files
author
nekocode
committed
Deal with Issue#7
1 parent a27457e commit ccd3b90

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin version="2">
22
<id>cn.nekocode.plugin.parcelablegenerator</id>
33
<name>Parcelable Code Generator(for kotlin's data class)</name>
4-
<version>0.4.5</version>
4+
<version>0.4.6</version>
55
<vendor email="[email protected]" url="https://github.com/nekocode/android-parcelable-intellij-plugin-kotlin">nekocode</vendor>
66

77
<description><![CDATA[

src/cn/nekocode/plugin/parcelablegenerator/CodeGenerator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public CodeGenerator(KtClass ktClass, List<ValueParameterDescriptor> fields) {
4040
private String generateStaticCreator(KtClass ktClass) {
4141
String className = ktClass.getName();
4242

43-
return "companion object { @JvmField final val CREATOR: Parcelable.Creator<" +
43+
return "companion object { @JvmField val CREATOR: Parcelable.Creator<" +
4444
className + "> = object : Parcelable.Creator<" + className + "> {" +
4545
"override fun createFromParcel(source: Parcel): " + className +
46-
"{return " + className + "(source)}" +
47-
"override fun newArray(size: Int): Array<" + className + "?> {" +
48-
"return arrayOfNulls(size)}" + "}}";
46+
" = " + className + "(source)" +
47+
"\noverride fun newArray(size: Int): Array<" + className + "?> =" +
48+
"arrayOfNulls(size)" + "}}";
4949
}
5050

5151
private String generateConstructor(List<TypeSerializer> typeSerializers) {
@@ -63,7 +63,7 @@ private String generateConstructor(List<TypeSerializer> typeSerializers) {
6363
}
6464

6565
private String generateDescribeContents() {
66-
return "override fun describeContents(): Int {return 0}";
66+
return "override fun describeContents() = 0";
6767
}
6868

6969
private String generateWriteToParcel(List<TypeSerializer> typeSerializers) {

0 commit comments

Comments
 (0)