Skip to content

Commit

Permalink
Add 'Override' annotation to methods, fixes frankiesardo#99.
Browse files Browse the repository at this point in the history
  • Loading branch information
ragunathjawahar committed Apr 13, 2017
1 parent 5f2a725 commit ca9d0ae
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions icepick-processor/src/clojure/icepick/processor.clj
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,31 @@ public class {{name}}<T extends {{target}}> extends {{parent}}<T> {
private final static Helper H = new Helper(\"{{package}}.{{name}}.\", BUNDLERS);
{{^view?}}
public void restore(T target, Bundle state) {
@Override public void restore(T target, Bundle state) {
if (state == null) return;
{{#fields}}
target.{{name}} = H.get{{method}}(state, \"{{name}}\");
{{/fields}}
super.restore(target, state);
}
public void save(T target, Bundle state) {
@Override public void save(T target, Bundle state) {
super.save(target, state);
{{#fields}}
H.put{{method}}(state, \"{{name}}\", target.{{name}});
{{/fields}}
}
{{/view?}}
{{#view?}}
public Parcelable restore(T target, Parcelable p) {
@Override public Parcelable restore(T target, Parcelable p) {
Bundle state = (Bundle) p;
{{#fields}}
target.{{name}} = H.get{{method}}(state, \"{{name}}\");
{{/fields}}
return super.restore(target, H.getParent(state));
}
public Parcelable save(T target, Parcelable p) {
@Override public Parcelable save(T target, Parcelable p) {
Bundle state = H.putParent(super.save(target, p));
{{#fields}}
H.put{{method}}(state, \"{{name}}\", target.{{name}});
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/boxed/Test$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public class Test$$Icepick<T extends Test> extends Object<T> {

private final static Helper H = new Helper("test.boxed.Test$$Icepick.", BUNDLERS);

public void restore(T target, Bundle state) {
@Override public void restore(T target, Bundle state) {
if (state == null) return;
target.f1 = H.getBoxedFloat(state, "f1");
super.restore(target, state);
}

public void save(T target, Bundle state) {
@Override public void save(T target, Bundle state) {
super.save(target, state);
H.putBoxedFloat(state, "f1", target.f1);
}
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/bundler/Test$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public class Test$$Icepick<T extends Test> extends Object<T> {

private final static Helper H = new Helper("test.bundler.Test$$Icepick.", BUNDLERS);

public void restore(T target, Bundle state) {
@Override public void restore(T target, Bundle state) {
if (state == null) return;
target.f1 = H.getWithBundler(state, "f1");
target.f2 = H.getWithBundler(state, "f2");
super.restore(target, state);
}

public void save(T target, Bundle state) {
@Override public void save(T target, Bundle state) {
super.save(target, state);
H.putWithBundler(state, "f1", target.f1);
H.putWithBundler(state, "f2", target.f2);
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/generics/Test2$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public class Test2$$Icepick<T extends Test2> extends Object<T> {

private final static Helper H = new Helper("test.generics.Test2$$Icepick.", BUNDLERS);

public void restore(T target, Bundle state) {
@Override public void restore(T target, Bundle state) {
if (state == null) return;
target.f1 = H.getParcelable(state, "f1");
super.restore(target, state);
}

public void save(T target, Bundle state) {
@Override public void save(T target, Bundle state) {
super.save(target, state);
H.putParcelable(state, "f1", target.f1);
}
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/generics/Test3$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ public class Test3$$Icepick<T extends Test3> extends Object<T> {

private final static Helper H = new Helper("test.generics.Test3$$Icepick.", BUNDLERS);

public void restore(T target, Bundle state) {
@Override public void restore(T target, Bundle state) {
if (state == null) return;
target.f1 = H.getParcelableArrayList(state, "f1");
target.f2 = H.getSparseParcelableArray(state, "f2");
super.restore(target, state);
}

public void save(T target, Bundle state) {
@Override public void save(T target, Bundle state) {
super.save(target, state);
H.putParcelableArrayList(state, "f1", target.f1);
H.putSparseParcelableArray(state, "f2", target.f2);
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/generics/Test4$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Test4$$Icepick<T extends Test4> extends Object<T> {

private final static Helper H = new Helper("test.generics.Test4$$Icepick.", BUNDLERS);

public void restore(T target, Bundle state) {
@Override public void restore(T target, Bundle state) {
if (state == null) return;
target.f1 = H.getSerializable(state, "f1");
target.f2 = H.getSerializable(state, "f2");
Expand All @@ -25,7 +25,7 @@ public void restore(T target, Bundle state) {
super.restore(target, state);
}

public void save(T target, Bundle state) {
@Override public void save(T target, Bundle state) {
super.save(target, state);
H.putSerializable(state, "f1", target.f1);
H.putSerializable(state, "f2", target.f2);
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/parent/Test$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public class Test$$Icepick<T extends Test> extends Object<T> {

private final static Helper H = new Helper("test.parent.Test$$Icepick.", BUNDLERS);

public void restore(T target, Bundle state) {
@Override public void restore(T target, Bundle state) {
if (state == null) return;
target.f1 = H.getParcelable(state, "f1");
super.restore(target, state);
}

public void save(T target, Bundle state) {
@Override public void save(T target, Bundle state) {
super.save(target, state);
H.putParcelable(state, "f1", target.f1);
}
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/parent/Test$Inner$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public class Test$Inner$$Icepick<T extends Test.Inner> extends test.parent.Test$

private final static Helper H = new Helper("test.parent.Test$Inner$$Icepick.", BUNDLERS);

public void restore(T target, Bundle state) {
@Override public void restore(T target, Bundle state) {
if (state == null) return;
target.f2 = H.getString(state, "f2");
super.restore(target, state);
}

public void save(T target, Bundle state) {
@Override public void save(T target, Bundle state) {
super.save(target, state);
H.putString(state, "f2", target.f2);
}
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/simple/Test$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public class Test$$Icepick<T extends Test> extends Object<T> {

private final static Helper H = new Helper("test.simple.Test$$Icepick.", BUNDLERS);

public void restore(T target, Bundle state) {
@Override public void restore(T target, Bundle state) {
if (state == null) return;
target.f1 = H.getInt(state, "f1");
target.f2 = H.getBoolean(state, "f2");
target.f3 = H.getCharArray(state, "f3");
super.restore(target, state);
}

public void save(T target, Bundle state) {
@Override public void save(T target, Bundle state) {
super.save(target, state);
H.putInt(state, "f1", target.f1);
H.putBoolean(state, "f2", target.f2);
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/views/Test$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public class Test$$Icepick<T extends Test> extends View<T> {

private final static Helper H = new Helper("test.views.Test$$Icepick.", BUNDLERS);

public Parcelable restore(T target, Parcelable p) {
@Override public Parcelable restore(T target, Parcelable p) {
Bundle state = (Bundle) p;
target.f1 = H.getParcelable(state, "f1");
return super.restore(target, H.getParent(state));
}

public Parcelable save(T target, Parcelable p) {
@Override public Parcelable save(T target, Parcelable p) {
Bundle state = H.putParent(super.save(target, p));
H.putParcelable(state, "f1", target.f1);
return state;
Expand Down
4 changes: 2 additions & 2 deletions icepick-processor/test/test/views/Test$Inner$$Icepick.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public class Test$Inner$$Icepick<T extends Test.Inner> extends test.views.Test$$

private final static Helper H = new Helper("test.views.Test$Inner$$Icepick.", BUNDLERS);

public Parcelable restore(T target, Parcelable p) {
@Override public Parcelable restore(T target, Parcelable p) {
Bundle state = (Bundle) p;
target.f2 = H.getString(state, "f2");
return super.restore(target, H.getParent(state));
}

public Parcelable save(T target, Parcelable p) {
@Override public Parcelable save(T target, Parcelable p) {
Bundle state = H.putParent(super.save(target, p));
H.putString(state, "f2", target.f2);
return state;
Expand Down

0 comments on commit ca9d0ae

Please sign in to comment.