few static fixes

This commit is contained in:
Gavriil Sitnikov 2017-02-16 17:54:33 +03:00
parent e997daa458
commit 03b8cd3dc0
5 changed files with 11 additions and 11 deletions

View File

@ -111,7 +111,7 @@ public final class CalendarUtils {
addition = 0;
} else {
count++;
addition = ((int) Math.ceil(count / 2)) * ((int) (StrictMath.pow(-1, (count - 1))));
addition = ((int) Math.ceil(count / 2)) * ((int) StrictMath.pow(-1, count - 1));
}
}
}
@ -159,7 +159,7 @@ public final class CalendarUtils {
if (firstDayInWeek != 0) {
calendarItems.add(new CalendarEmptyItem(shift + daysEnded, shift + daysEnded + (DAYS_IN_WEEK - firstDayInWeek - 1)));
shift += (DAYS_IN_WEEK - firstDayInWeek);
shift += DAYS_IN_WEEK - firstDayInWeek;
}
calendarItems.add(new CalendarHeaderItem(tempTime.getYear(), tempTime.getMonthOfYear() - 1, shift + daysEnded, shift + daysEnded));

View File

@ -43,8 +43,8 @@ public class LoganSquareJodaTimeConverter implements TypeConverter<DateTime> {
final String dateString = jsonParser.getValueAsString();
try {
return new DateTime(dateString);
} catch (RuntimeException e) {
Lc.assertion(e);
} catch (final RuntimeException exception) {
Lc.assertion(exception);
}
return null;
}

View File

@ -214,8 +214,8 @@ public abstract class HttpRequest<T> {
.<T>create(requestSubscriber -> {
try {
requestSubscriber.onNext(executeSyncInternal(requestController));
} catch (final IOException e) {
requestSubscriber.onError(e);
} catch (final IOException exception) {
requestSubscriber.onError(exception);
}
requestSubscriber.onCompleted();
})

View File

@ -9,13 +9,15 @@ import java.io.Serializable;
* Simple interface that gets one parameter with {@link TInput} type as input and returns other type {@link TReturn} as a result.
* Interface extends {@link Serializable} to survive after {@link ru.touchin.roboswag.components.navigation.AbstractState} recreation.
* Created as a replace for {@link rx.functions.Func1} because it needed to be {@link Serializable}
* @param <TInput> input type.
*
* @param <TInput> input type.
* @param <TReturn> return type.
*/
public interface ValidationFunc<TInput, TReturn> extends Serializable {
public interface ValidationFunc<TInput, TReturn> extends Serializable {
/**
* The method maps some {@link TInput} type argument into a {@link TReturn} type.
*
* @param input data;
* @return mapped data into a {@link TReturn} type.
* @throws Throwable for catching conversion errors.

View File

@ -9,8 +9,6 @@ import ru.touchin.roboswag.core.utils.pairs.HalfNullablePair;
import ru.touchin.templates.validation.ValidationState;
import rx.Observable;
import static ru.touchin.templates.validation.ValidationState.VALID;
/**
* Created by Ilia Kurtov on 24/01/2017.
* Class that simplifies work with {@link Validator}'s that have the same wrapper model and model type.
@ -40,7 +38,7 @@ public class SameTypeValidator<TModel extends Serializable> extends Validator<TM
@NonNull
@Override
public Observable<HalfNullablePair<ValidationState, TModel>> fullValidateAndGetModel(@NonNull final TModel wrapperModel) {
return Observable.just(new HalfNullablePair<>(VALID, wrapperModel));
return Observable.just(new HalfNullablePair<>(ValidationState.VALID, wrapperModel));
}
}