diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 1dfcfd377..13d3ab3bf 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -338,7 +338,6 @@ tasks.withType(JavaCompile) { "SameNameButDifferent", "StringSplitter", "ImmutableEnumChecker", - "BadImport", "UnusedMethod", "ModifiedButNotUsed", "TypeParameterUnusedInFormals", @@ -379,6 +378,7 @@ tasks.withType(JavaCompile) { "MixedArrayDimensions", "PackageLocation", "UseBinds", + "BadImport", "IntLongMath", "FloatCast", "ReachabilityFenceUsage", @@ -397,6 +397,7 @@ tasks.withType(JavaCompile) { "PrivateConstructorForNoninstantiableModule", "ClassCanBeStatic", "ClassNewInstance", + "UnnecessaryStaticImport", "UnsafeFinalization", "JodaPlusMinusLong", "MutableMethodReturnType", @@ -419,7 +420,6 @@ tasks.withType(JavaCompile) { // "MethodCanBeStatic", // "Var", // "ConstantField", -// "UnnecessaryStaticImport", // "ConstructorInvokesOverridable", // "InjectOnConstructorOfAbstractClass", // "StringSplitter", diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java index 5d7e83246..c64b4bdb3 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java @@ -18,10 +18,10 @@ */ package org.apache.fineract.integrationtests.common; -import static io.restassured.path.json.JsonPath.from; import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.gson.Gson; +import io.restassured.path.json.JsonPath; import io.restassured.specification.RequestSpecification; import io.restassured.specification.ResponseSpecification; import java.util.HashMap; @@ -87,7 +87,7 @@ public class CalendarHelper { final String CLIENT_URL = "/fineract-provider/api/v1/groups/" + generatedGroupId + "?associations=all&" + Utils.TENANT_IDENTIFIER; final String responseCalendarDetailsinJSON = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL, "collectionMeetingCalendar"); - final Integer responseCalendarId = from(responseCalendarDetailsinJSON).get("id"); + final Integer responseCalendarId = JsonPath.from(responseCalendarDetailsinJSON).get("id"); assertEquals(generatedCalendarId, responseCalendarId, "ERROR IN CREATING THE CALENDAR"); } diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java index d20ba5eea..88eaee6f0 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java @@ -19,7 +19,6 @@ package org.apache.fineract.integrationtests.common; import static io.restassured.RestAssured.given; -import static io.restassured.path.json.JsonPath.from; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.fail; @@ -138,7 +137,7 @@ public class Utils { if (jsonAttributeToGetBack == null) { return (T) json; } - return (T) from(json).get(jsonAttributeToGetBack); + return (T) JsonPath.from(json).get(jsonAttributeToGetBack); } public static String performGetTextResponse(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, @@ -158,28 +157,28 @@ public class Utils { if (jsonAttributeToGetBack == null) { return (T) json; } - return (T) from(json).get(jsonAttributeToGetBack); + return (T) JsonPath.from(json).get(jsonAttributeToGetBack); } public static T performServerPut(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String putURL, final String jsonBodyToSend, final String jsonAttributeToGetBack) { final String json = given().spec(requestSpec).body(jsonBodyToSend).expect().spec(responseSpec).log().ifError().when().put(putURL) .andReturn().asString(); - return (T) from(json).get(jsonAttributeToGetBack); + return (T) JsonPath.from(json).get(jsonAttributeToGetBack); } public static T performServerDelete(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String deleteURL, final String jsonAttributeToGetBack) { final String json = given().spec(requestSpec).expect().spec(responseSpec).log().ifError().when().delete(deleteURL).andReturn() .asString(); - return (T) from(json).get(jsonAttributeToGetBack); + return (T) JsonPath.from(json).get(jsonAttributeToGetBack); } public static T performServerDelete(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String deleteURL, final String jsonBodyToSend, final String jsonAttributeToGetBack) { final String json = given().spec(requestSpec).body(jsonBodyToSend).expect().spec(responseSpec).log().ifError().when() .delete(deleteURL).andReturn().asString(); - return (T) (jsonAttributeToGetBack == null ? json : from(json).get(jsonAttributeToGetBack)); + return (T) (jsonAttributeToGetBack == null ? json : JsonPath.from(json).get(jsonAttributeToGetBack)); } public static String convertDateToURLFormat(final String dateToBeConvert) throws ParseException { diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java index 31ab42bf4..3bb669d17 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java @@ -19,11 +19,11 @@ package org.apache.fineract.integrationtests.common.organisation; import static io.restassured.RestAssured.given; -import static io.restassured.path.json.JsonPath.from; import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; +import io.restassured.path.json.JsonPath; import io.restassured.specification.RequestSpecification; import io.restassured.specification.ResponseSpecification; import java.lang.reflect.Type; @@ -178,7 +178,7 @@ public class CampaignsHelper { .asString(); Assert.notNull(json, "json"); ArrayList reportsList = new ArrayList<>(); - String reportsString = new Gson().toJson(from(json).get(jsonAttributeToGetBack)); + String reportsString = new Gson().toJson(JsonPath.from(json).get(jsonAttributeToGetBack)); Assert.notNull(reportsString, "reportsString"); final Gson gson = new Gson(); final Type typeOfHashMap = new TypeToken>() {}.getType(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/NotificationSenderService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/NotificationSenderService.java index cf8f2bbb1..8a40cac38 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/NotificationSenderService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/NotificationSenderService.java @@ -30,7 +30,6 @@ import org.apache.fineract.infrastructure.gcm.GcmConstants; import org.apache.fineract.infrastructure.gcm.domain.DeviceRegistration; import org.apache.fineract.infrastructure.gcm.domain.DeviceRegistrationRepositoryWrapper; import org.apache.fineract.infrastructure.gcm.domain.Message; -import org.apache.fineract.infrastructure.gcm.domain.Message.Builder; import org.apache.fineract.infrastructure.gcm.domain.Message.Priority; import org.apache.fineract.infrastructure.gcm.domain.Notification; import org.apache.fineract.infrastructure.gcm.domain.NotificationConfigurationData; @@ -94,7 +93,7 @@ public class NotificationSenderService { try { Notification notification = new Notification.Builder(GcmConstants.defaultIcon).title(GcmConstants.title) .body(smsMessage.getMessage()).build(); - Builder b = new Builder(); + Message.Builder b = new Message.Builder(); b.notification(notification); b.dryRun(false); b.contentAvailable(true); diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java index 92d15e828..84a520723 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java +++ b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java @@ -19,7 +19,6 @@ package org.apache.fineract.common; import static io.restassured.RestAssured.given; -import static io.restassured.path.json.JsonPath.from; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.fail; @@ -75,7 +74,7 @@ public class Utils { public static T performServerGet(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String getURL, final String jsonAttributeToGetBack) { final String json = given().spec(requestSpec).expect().spec(responseSpec).log().ifError().when().get(getURL).andReturn().asString(); - return (T) from(json).get(jsonAttributeToGetBack); + return (T) JsonPath.from(json).get(jsonAttributeToGetBack); } }