Skip to content

Commit

Permalink
Fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nekocode committed Sep 24, 2016
1 parent 1702e2f commit b50b6b3
Show file tree
Hide file tree
Showing 2 changed files with 8 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)</name>
<version>0.5.0</version>
<version>0.5.1</version>
<vendor email="[email protected]" url="https://github.com/nekocode/android-parcelable-intellij-plugin-kotlin">nekocode</vendor>

<description><![CDATA[
Expand Down
12 changes: 7 additions & 5 deletions src/cn/nekocode/plugin/parcelablegenerator/CodeGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ private String generateStaticCreator(KtClass ktClass, KtClassBody oldBodyOfCompa
String className = ktClass.getName();

StringBuilder oldBodyText = new StringBuilder();
List<KtDeclaration> declarations = oldBodyOfCompanion.getDeclarations();
for (KtDeclaration declaration : declarations) {
String declarationName = declaration.getName();
if (declarationName != null && !declarationName.equals("CREATOR")) {
oldBodyText.append(declaration.getText()).append("\n\n");
if (oldBodyOfCompanion != null) {
List<KtDeclaration> declarations = oldBodyOfCompanion.getDeclarations();
for (KtDeclaration declaration : declarations) {
String declarationName = declaration.getName();
if (declarationName != null && !declarationName.equals("CREATOR")) {
oldBodyText.append(declaration.getText()).append("\n\n");
}
}
}

Expand Down

0 comments on commit b50b6b3

Please sign in to comment.