Skip to content

Commit

Permalink
Deal with Issue#7
Browse files Browse the repository at this point in the history
  • Loading branch information
nekocode committed Jul 10, 2016
1 parent a27457e commit ccd3b90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin version="2">
<id>cn.nekocode.plugin.parcelablegenerator</id>
<name>Parcelable Code Generator(for kotlin's data class)</name>
<version>0.4.5</version>
<version>0.4.6</version>
<vendor email="[email protected]" url="https://github.com/nekocode/android-parcelable-intellij-plugin-kotlin">nekocode</vendor>

<description><![CDATA[
Expand Down
10 changes: 5 additions & 5 deletions src/cn/nekocode/plugin/parcelablegenerator/CodeGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public CodeGenerator(KtClass ktClass, List<ValueParameterDescriptor> fields) {
private String generateStaticCreator(KtClass ktClass) {
String className = ktClass.getName();

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

private String generateConstructor(List<TypeSerializer> typeSerializers) {
Expand All @@ -63,7 +63,7 @@ private String generateConstructor(List<TypeSerializer> typeSerializers) {
}

private String generateDescribeContents() {
return "override fun describeContents(): Int {return 0}";
return "override fun describeContents() = 0";
}

private String generateWriteToParcel(List<TypeSerializer> typeSerializers) {
Expand Down

0 comments on commit ccd3b90

Please sign in to comment.