Skip to content

Commit

Permalink
Revert stripe-common gradle module (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshafrir-stripe authored Jun 12, 2019
1 parent 9737878 commit e02429a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 27 deletions.
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include ':stripe-common'
include ':stripe'
include ':example'
include ':samplestore'
10 changes: 0 additions & 10 deletions stripe-common/build.gradle

This file was deleted.

2 changes: 0 additions & 2 deletions stripe/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ configurations {
}

dependencies {
implementation project(':stripe-common')

implementation "com.android.support:support-annotations:28.0.0"
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:recyclerview-v7:28.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import java.util.Calendar;
import java.util.Locale;
Expand All @@ -24,7 +24,7 @@ static boolean isWholePositiveNumber(@Nullable String value) {
/**
* Returns whether the given CharSequence contains only digits.
*/
private static boolean isDigitsOnly(@NotNull CharSequence str) {
private static boolean isDigitsOnly(@NonNull CharSequence str) {
final int len = str.length();
for (int cp, i = 0; i < len; i += Character.charCount(cp)) {
cp = Character.codePointAt(str, i);
Expand All @@ -44,7 +44,7 @@ private static boolean isDigitsOnly(@NotNull CharSequence str) {
* @return {@code true} if the input time has passed the specified current time,
* {@code false} otherwise.
*/
static boolean hasMonthPassed(int year, int month, @NotNull Calendar now) {
static boolean hasMonthPassed(int year, int month, @NonNull Calendar now) {
if (hasYearPassed(year, now)) {
return true;
}
Expand All @@ -62,12 +62,12 @@ static boolean hasMonthPassed(int year, int month, @NotNull Calendar now) {
* @return {@code true} if the input year has passed the year of the specified current time
* {@code false} otherwise.
*/
static boolean hasYearPassed(int year, @NotNull Calendar now) {
static boolean hasYearPassed(int year, @NonNull Calendar now) {
int normalized = normalizeYear(year, now);
return normalized < now.get(Calendar.YEAR);
}

static int normalizeYear(int year, @NotNull Calendar now) {
static int normalizeYear(int year, @NonNull Calendar now) {
if (year < 100 && year >= 0) {
String currentYear = String.valueOf(now.get(Calendar.YEAR));
String prefix = currentYear.substring(0, currentYear.length() - 2);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.utils;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
Expand All @@ -18,8 +18,8 @@ private ClassUtils() {}
* @return the value of the found field, if exists, on the target object, or null
*/
@Nullable
public static Object getInternalObject(@NotNull Class clazz, @NotNull Set<String> whitelist,
@NotNull Object obj) {
public static Object getInternalObject(@NonNull Class clazz, @NonNull Set<String> whitelist,
@NonNull Object obj) {
final Field field = findField(clazz, whitelist);
if (field == null) {
return null;
Expand All @@ -41,7 +41,7 @@ public static Object getInternalObject(@NotNull Class clazz, @NotNull Set<String
*/
@SuppressWarnings("WeakerAccess")
@Nullable
public static Field findField(@NotNull Class clazz, @NotNull Collection<String> whitelist) {
public static Field findField(@NonNull Class clazz, @NonNull Collection<String> whitelist) {
final Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
if (whitelist.contains(field.getName())) {
Expand All @@ -58,7 +58,7 @@ public static Field findField(@NotNull Class clazz, @NotNull Collection<String>
* @return the {@link Method} if one is found, otherwise null
*/
@Nullable
public static Method findMethod(@NotNull Class clazz, @NotNull Collection<String> whitelist) {
public static Method findMethod(@NonNull Class clazz, @NonNull Collection<String> whitelist) {
final Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods) {
if (whitelist.contains(method.getName())) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.stripe.android.utils;

import org.jetbrains.annotations.Nullable;
import android.support.annotation.Nullable;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void testfindField_withValidWhitelist_shouldReturnField() {

@Test
public void testfindField_withEmptyWhitelist_shouldReturnNull() {
final Field nameField = ClassUtils.findField(FakeClass.class, new HashSet<>());
final Field nameField = ClassUtils.findField(FakeClass.class, new HashSet<String>());
assertNull(nameField);
}

Expand Down

0 comments on commit e02429a

Please sign in to comment.