assertion*

This commit is contained in:
Gavriil Sitnikov 2015-12-14 23:41:56 +03:00
parent a2ac2d03ba
commit 34d57a1990
7 changed files with 12 additions and 12 deletions

View File

@ -92,7 +92,7 @@ public final class VolumeController {
public void setVolume(final int value) {
if (value < 0 || value > maxVolume) {
Lc.asserted(new ShouldNotHappenException("Volume: " + value + " out of bounds [0," + maxVolume + "]"));
Lc.assertion(new ShouldNotHappenException("Volume: " + value + " out of bounds [0," + maxVolume + "]"));
return;
}
if (getVolume() != value) {
@ -112,7 +112,7 @@ public final class VolumeController {
public void attachSeekBar(@NonNull final SeekBar seekBar) {
if (seekBars.containsKey(seekBar)) {
Lc.asserted(new ShouldNotHappenException("SeekBar already attached"));
Lc.assertion(new ShouldNotHappenException("SeekBar already attached"));
return;
}
seekBar.setMax(maxVolume);
@ -144,7 +144,7 @@ public final class VolumeController {
public void detachSeekBar(@NonNull final SeekBar seekBar) {
final Subscription subscription = seekBars.get(seekBar);
if (subscription == null) {
Lc.asserted(new ShouldNotHappenException("SeekBar not attached yet"));
Lc.assertion(new ShouldNotHappenException("SeekBar not attached yet"));
return;
}
seekBar.setOnSeekBarChangeListener(null);
@ -156,7 +156,7 @@ public final class VolumeController {
public void attachVolumeButtons(@NonNull final View volumeUpButton, @NonNull final View volumeDownButton) {
final VolumeButtons volumeButtons = new VolumeButtons(volumeUpButton, volumeDownButton);
if (volumeButtonsSet.contains(volumeButtons)) {
Lc.asserted(new ShouldNotHappenException("VolumeButtons already attached"));
Lc.assertion(new ShouldNotHappenException("VolumeButtons already attached"));
return;
}
@ -178,7 +178,7 @@ public final class VolumeController {
public void detachVolumeButtons(@NonNull final View volumeUpButton, @NonNull final View volumeDownButton) {
final VolumeButtons volumeButtons = new VolumeButtons(volumeUpButton, volumeDownButton);
if (!volumeButtonsSet.contains(volumeButtons)) {
Lc.asserted(new ShouldNotHappenException("VolumeButtons not attached yet"));
Lc.assertion(new ShouldNotHappenException("VolumeButtons not attached yet"));
return;
}

View File

@ -51,7 +51,7 @@ public class ListProvider<T> implements ItemsProvider<T> {
@Override
public Observable loadItem(final int position) {
Lc.asserted(new ShouldNotHappenException("ListProvider doesn't support loading"));
Lc.assertion(new ShouldNotHappenException("ListProvider doesn't support loading"));
return Observable.just(items.get(position));
}

View File

@ -130,7 +130,7 @@ public class PagingListProvider<T> implements ItemsProvider<T> {
@Override
public Observable loadItem(final int position) {
if (!isInitialized) {
Lc.asserted(new ShouldNotHappenException("Provider should be initialized first"));
Lc.assertion(new ShouldNotHappenException("Provider should be initialized first"));
return Observable.empty();
}
return loadPage(position / PAGE_SIZE);

View File

@ -87,13 +87,13 @@ public abstract class AbstractItemsAdapter<TItem, TViewHolder extends RecyclerVi
final TItem item = getItem(position);
if (holder instanceof NotLoadedItemViewHolder) {
if (itemsProvider == null) {
Lc.asserted(new ShouldNotHappenException("This adapter shouldn't work without provider"));
Lc.assertion(new ShouldNotHappenException("This adapter shouldn't work without provider"));
return;
}
((NotLoadedItemViewHolder) holder).bindItem(position, itemsProvider);
} else {
if (item == null) {
Lc.asserted(new ShouldNotHappenException("Item at" + position + " should not be null"));
Lc.assertion(new ShouldNotHappenException("Item at" + position + " should not be null"));
return;
}
onBindItemToViewHolder((TViewHolder) holder, position, item);

View File

@ -16,7 +16,7 @@ public abstract class AbstractSavedStateController {
protected AbstractSavedStateController(final int itemId) {
if (itemId == 0) {
Lc.asserted(new ShouldNotHappenException("ItemId = 0 deprecated"));
Lc.assertion(new ShouldNotHappenException("ItemId = 0 deprecated"));
}
this.itemId = itemId;
}

View File

@ -29,7 +29,7 @@ public class PhoneSpan extends URLSpan {
widget.getContext().startActivity(intent);
// it should catch throwable to not crash in production if there are problems with startActivity()
} catch (Throwable throwable) {
Lc.asserted(throwable);
Lc.assertion(throwable);
}
}

View File

@ -94,7 +94,7 @@ public final class Typefaces {
typefacedText.setTypeface(customTypeface, typeface == null ? Typeface.NORMAL : typeface.getStyle());
}
} else if (!allowEmptyCustomTypeface) {
Lc.asserted(new ShouldNotHappenException("TypefacedText has no customTypeface attribute: " + typefacedText));
Lc.assertion(new ShouldNotHappenException("TypefacedText has no customTypeface attribute: " + typefacedText));
}
}