Merge pull request #710 from mar-v-in/patch-1

Fix OperationResultParcel
This commit is contained in:
Vincent 2014-07-09 11:26:59 +02:00
commit 9fcc0a8816

View File

@ -305,20 +305,20 @@ public class OperationResultParcel implements Parcelable {
public static class OperationLog implements Iterable<LogEntryParcel> { public static class OperationLog implements Iterable<LogEntryParcel> {
private final List<LogEntryParcel> parcels = new ArrayList<LogEntryParcel>(); private final List<LogEntryParcel> mParcels = new ArrayList<LogEntryParcel>();
/// Simple convenience method /// Simple convenience method
public void add(LogLevel level, LogType type, int indent, Object... parameters) { public void add(LogLevel level, LogType type, int indent, Object... parameters) {
Log.d(Constants.TAG, type.toString()); Log.d(Constants.TAG, type.toString());
parcels.add(new OperationResultParcel.LogEntryParcel(level, type, indent, parameters)); mParcels.add(new OperationResultParcel.LogEntryParcel(level, type, indent, parameters));
} }
public void add(LogLevel level, LogType type, int indent) { public void add(LogLevel level, LogType type, int indent) {
parcels.add(new OperationResultParcel.LogEntryParcel(level, type, indent, (Object[]) null)); mParcels.add(new OperationResultParcel.LogEntryParcel(level, type, indent, (Object[]) null));
} }
public boolean containsWarnings() { public boolean containsWarnings() {
for(LogEntryParcel entry : new IterableIterator<LogEntryParcel>(parcels.iterator())) { for(LogEntryParcel entry : new IterableIterator<LogEntryParcel>(mParcels.iterator())) {
if (entry.mLevel == LogLevel.WARN || entry.mLevel == LogLevel.ERROR) { if (entry.mLevel == LogLevel.WARN || entry.mLevel == LogLevel.ERROR) {
return true; return true;
} }
@ -327,20 +327,20 @@ public class OperationResultParcel implements Parcelable {
} }
public void addAll(List<LogEntryParcel> parcels) { public void addAll(List<LogEntryParcel> parcels) {
parcels.addAll(parcels); mParcels.addAll(parcels);
} }
public List<LogEntryParcel> toList() { public List<LogEntryParcel> toList() {
return parcels; return mParcels;
} }
public boolean isEmpty() { public boolean isEmpty() {
return parcels.isEmpty(); return mParcels.isEmpty();
} }
@Override @Override
public Iterator<LogEntryParcel> iterator() { public Iterator<LogEntryParcel> iterator() {
return parcels.iterator(); return mParcels.iterator();
} }
} }