FINERACT-846: Migrating to Java 11, upgrading dependencies, fixing compiler warnings
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
7ace5d47b2
commit
0e4aeef1af
+29
-28
@@ -27,16 +27,18 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformService
|
||||
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
|
||||
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
|
||||
import org.apache.fineract.infrastructure.core.exception.UnsupportedParameterException;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.hssf.util.CellReference;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.CellType;
|
||||
import org.apache.poi.ss.usermodel.CellValue;
|
||||
import org.apache.poi.ss.usermodel.FillPatternType;
|
||||
import org.apache.poi.ss.usermodel.FormulaEvaluator;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.SheetVisibility;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.util.CellReference;
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
public class ImportHandlerUtils {
|
||||
@@ -62,10 +64,10 @@ public class ImportHandlerUtils {
|
||||
|
||||
public static Long readAsLong(int colIndex, Row row) {
|
||||
Cell c = row.getCell(colIndex);
|
||||
if (c == null || c.getCellType() == Cell.CELL_TYPE_BLANK)
|
||||
if (c == null || c.getCellType() == CellType.BLANK)
|
||||
return null;
|
||||
FormulaEvaluator eval = row.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator();
|
||||
if(c.getCellType() == Cell.CELL_TYPE_FORMULA) {
|
||||
if(c.getCellType() == CellType.FORMULA) {
|
||||
if(eval!=null) {
|
||||
CellValue val = null;
|
||||
try {
|
||||
@@ -76,7 +78,7 @@ public class ImportHandlerUtils {
|
||||
return ((Double)val.getNumberValue()).longValue();
|
||||
}
|
||||
}
|
||||
else if (c.getCellType()==Cell.CELL_TYPE_NUMERIC){
|
||||
else if (c.getCellType()==CellType.NUMERIC){
|
||||
return ((Double) c.getNumericCellValue()).longValue();
|
||||
}
|
||||
else {
|
||||
@@ -89,10 +91,10 @@ public class ImportHandlerUtils {
|
||||
public static String readAsString(int colIndex, Row row) {
|
||||
|
||||
Cell c = row.getCell(colIndex);
|
||||
if (c == null || c.getCellType() == Cell.CELL_TYPE_BLANK)
|
||||
if (c == null || c.getCellType() == CellType.BLANK)
|
||||
return null;
|
||||
FormulaEvaluator eval = row.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator();
|
||||
if(c.getCellType() == Cell.CELL_TYPE_FORMULA) {
|
||||
if(c.getCellType() == CellType.FORMULA) {
|
||||
if (eval!=null) {
|
||||
CellValue val = null;
|
||||
try {
|
||||
@@ -114,13 +116,13 @@ public class ImportHandlerUtils {
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}else if(c.getCellType()==Cell.CELL_TYPE_STRING) {
|
||||
}else if(c.getCellType()==CellType.STRING) {
|
||||
String res = trimEmptyDecimalPortion(c.getStringCellValue().trim());
|
||||
return res.trim();
|
||||
|
||||
}else if(c.getCellType()==Cell.CELL_TYPE_NUMERIC) {
|
||||
}else if(c.getCellType()==CellType.NUMERIC) {
|
||||
return ((Double) row.getCell(colIndex).getNumericCellValue()).intValue() + "";
|
||||
}else if (c.getCellType()==Cell.CELL_TYPE_BOOLEAN){
|
||||
}else if (c.getCellType()==CellType.BOOLEAN){
|
||||
return c.getBooleanCellValue()+"";
|
||||
}else {
|
||||
return null;
|
||||
@@ -137,7 +139,7 @@ public class ImportHandlerUtils {
|
||||
|
||||
public static LocalDate readAsDate(int colIndex, Row row) {
|
||||
Cell c = row.getCell(colIndex);
|
||||
if(c == null || c.getCellType() == Cell.CELL_TYPE_BLANK)
|
||||
if(c == null || c.getCellType() == CellType.BLANK)
|
||||
return null;
|
||||
|
||||
LocalDate localDate=new LocalDate(c.getDateCellValue());
|
||||
@@ -146,10 +148,10 @@ public class ImportHandlerUtils {
|
||||
|
||||
public static Boolean readAsBoolean(int colIndex, Row row) {
|
||||
Cell c = row.getCell(colIndex);
|
||||
if(c == null || c.getCellType() == Cell.CELL_TYPE_BLANK)
|
||||
if(c == null || c.getCellType() == CellType.BLANK)
|
||||
return false;
|
||||
FormulaEvaluator eval = row.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator();
|
||||
if(c.getCellType() == Cell.CELL_TYPE_FORMULA) {
|
||||
if(c.getCellType() == CellType.FORMULA) {
|
||||
if(eval!=null) {
|
||||
CellValue val = null;
|
||||
try {
|
||||
@@ -160,7 +162,7 @@ public class ImportHandlerUtils {
|
||||
return val.getBooleanValue();
|
||||
}
|
||||
return false;
|
||||
}else if(c.getCellType()==Cell.CELL_TYPE_BOOLEAN)
|
||||
}else if(c.getCellType()==CellType.BOOLEAN)
|
||||
return c.getBooleanCellValue();
|
||||
else {
|
||||
String booleanString = row.getCell(colIndex).getStringCellValue().trim();
|
||||
@@ -173,10 +175,10 @@ public class ImportHandlerUtils {
|
||||
|
||||
public static Integer readAsInt(int colIndex, Row row) {
|
||||
Cell c = row.getCell(colIndex);
|
||||
if (c == null || c.getCellType() == Cell.CELL_TYPE_BLANK)
|
||||
if (c == null || c.getCellType() == CellType.BLANK)
|
||||
return null;
|
||||
FormulaEvaluator eval = row.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator();
|
||||
if(c.getCellType() == Cell.CELL_TYPE_FORMULA) {
|
||||
if(c.getCellType() == CellType.FORMULA) {
|
||||
if(eval!=null) {
|
||||
CellValue val = null;
|
||||
try {
|
||||
@@ -187,7 +189,7 @@ public class ImportHandlerUtils {
|
||||
return ((Double)val.getNumberValue()).intValue();
|
||||
}
|
||||
return null;
|
||||
}else if (c.getCellType()==Cell.CELL_TYPE_NUMERIC) {
|
||||
}else if (c.getCellType()==CellType.NUMERIC) {
|
||||
return ((Double) c.getNumericCellValue()).intValue();
|
||||
}else {
|
||||
return Integer.parseInt(row.getCell(colIndex).getStringCellValue());
|
||||
@@ -196,10 +198,10 @@ public class ImportHandlerUtils {
|
||||
|
||||
public static Double readAsDouble(int colIndex, Row row) {
|
||||
Cell c = row.getCell(colIndex);
|
||||
if (c == null || c.getCellType() == Cell.CELL_TYPE_BLANK)
|
||||
if (c == null || c.getCellType() == CellType.BLANK)
|
||||
return 0.0;
|
||||
FormulaEvaluator eval = row.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator();
|
||||
if(c.getCellType() == Cell.CELL_TYPE_FORMULA) {
|
||||
if(c.getCellType() == CellType.FORMULA) {
|
||||
if (eval!=null) {
|
||||
CellValue val = null;
|
||||
try {
|
||||
@@ -211,7 +213,7 @@ public class ImportHandlerUtils {
|
||||
}else {
|
||||
return 0.0;
|
||||
}
|
||||
} else if (c.getCellType()==Cell.CELL_TYPE_NUMERIC) {
|
||||
} else if (c.getCellType()==CellType.NUMERIC) {
|
||||
return row.getCell(colIndex).getNumericCellValue();
|
||||
}else {
|
||||
return Double.parseDouble(row.getCell(colIndex).getStringCellValue());
|
||||
@@ -234,16 +236,15 @@ public class ImportHandlerUtils {
|
||||
}
|
||||
CellStyle style = workbook.createCellStyle();
|
||||
style.setFillForegroundColor(color.getIndex());
|
||||
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
|
||||
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
|
||||
Sheet cache = workbook.createSheet(color.toString());
|
||||
workbook.setSheetHidden(workbook.getSheetIndex(cache), HSSFWorkbook.SHEET_STATE_VERY_HIDDEN);
|
||||
workbook.setSheetVisibility(workbook.getSheetIndex(cache), SheetVisibility.VERY_HIDDEN);
|
||||
Row row = cache.createRow(cellReference.getRow());
|
||||
Cell cell = row.createCell(cellReference.getCol());
|
||||
cell.setCellStyle(style);
|
||||
|
||||
return style;
|
||||
|
||||
}
|
||||
|
||||
public static String getDefaultUserMessages(List<ApiParameterError> ApiParameterErrorList){
|
||||
@@ -301,20 +302,20 @@ public class ImportHandlerUtils {
|
||||
for (Row row : sheet) {
|
||||
for (Cell cell : row) {
|
||||
if(name!=null) {
|
||||
if (cell.getCellType() == Cell.CELL_TYPE_STRING && cell.getRichStringCellValue().getString().trim().equals(name)) {
|
||||
if (cell.getCellType() == CellType.STRING && cell.getRichStringCellValue().getString().trim().equals(name)) {
|
||||
if (sheetName.equals(TemplatePopulateImportConstants.OFFICE_SHEET_NAME) ||
|
||||
sheetName.equals(TemplatePopulateImportConstants.GL_ACCOUNTS_SHEET_NAME) ||
|
||||
sheetName.equals(TemplatePopulateImportConstants.EXTRAS_SHEET_NAME) ||
|
||||
sheetName.equals(TemplatePopulateImportConstants.SHARED_PRODUCTS_SHEET_NAME)||
|
||||
sheetName.equals(TemplatePopulateImportConstants.ROLES_SHEET_NAME)) {
|
||||
if (row.getCell(cell.getColumnIndex() - 1).getCellType() == Cell.CELL_TYPE_NUMERIC)
|
||||
if (row.getCell(cell.getColumnIndex() - 1).getCellType() == CellType.NUMERIC)
|
||||
return ((Double) row.getCell(cell.getColumnIndex() - 1).getNumericCellValue()).longValue();
|
||||
return 0L;
|
||||
} else if (sheetName.equals(TemplatePopulateImportConstants.CLIENT_SHEET_NAME) ||
|
||||
sheetName.equals(TemplatePopulateImportConstants.CENTER_SHEET_NAME) ||
|
||||
sheetName.equals(TemplatePopulateImportConstants.GROUP_SHEET_NAME) ||
|
||||
sheetName.equals(TemplatePopulateImportConstants.STAFF_SHEET_NAME))
|
||||
if (row.getCell(cell.getColumnIndex() + 1).getCellType() == Cell.CELL_TYPE_NUMERIC)
|
||||
if (row.getCell(cell.getColumnIndex() + 1).getCellType() == CellType.NUMERIC)
|
||||
return ((Double) row.getCell(cell.getColumnIndex() + 1).getNumericCellValue()).longValue();
|
||||
return 0L;
|
||||
}
|
||||
@@ -328,7 +329,7 @@ public class ImportHandlerUtils {
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if (name != null) {
|
||||
Cell cell = row.getCell(i);
|
||||
if (cell.getCellType() == Cell.CELL_TYPE_STRING && cell.getRichStringCellValue().getString().trim().equals(name)) {
|
||||
if (cell.getCellType() == CellType.STRING && cell.getRichStringCellValue().getString().trim().equals(name)) {
|
||||
return ((Double) row.getCell(cell.getColumnIndex() - 1).getNumericCellValue()).longValue();
|
||||
}
|
||||
}else {
|
||||
@@ -346,7 +347,7 @@ public class ImportHandlerUtils {
|
||||
for (Row row : sheet) {
|
||||
for (Cell cell : row) {
|
||||
if (name!=null) {
|
||||
if (cell.getCellType() == Cell.CELL_TYPE_STRING
|
||||
if (cell.getCellType() == CellType.STRING
|
||||
&& cell.getRichStringCellValue().getString().trim()
|
||||
.equals(name)) {
|
||||
return row.getCell(cell.getColumnIndex() - 1)
|
||||
|
||||
+1
-3
@@ -27,7 +27,6 @@ import java.util.List;
|
||||
import org.apache.fineract.organisation.office.data.OfficeData;
|
||||
import org.apache.fineract.portfolio.client.data.ClientData;
|
||||
import org.apache.fineract.portfolio.group.data.GroupGeneralData;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
@@ -55,7 +54,6 @@ public abstract class AbstractWorkbookPopulator implements WorkbookPopulator {
|
||||
}
|
||||
|
||||
protected void writeFormula(int colIndex, Row row, String formula) {
|
||||
row.createCell(colIndex).setCellType(Cell.CELL_TYPE_FORMULA);
|
||||
row.createCell(colIndex).setCellFormula(formula);
|
||||
}
|
||||
|
||||
@@ -160,4 +158,4 @@ public abstract class AbstractWorkbookPopulator implements WorkbookPopulator {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -32,6 +32,7 @@ import org.apache.fineract.portfolio.loanproduct.data.LoanProductData;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDataValidationHelper;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.ss.SpreadsheetVersion;
|
||||
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.DataValidation;
|
||||
@@ -378,9 +379,9 @@ public class LoanWorkbookPopulator extends AbstractWorkbookPopulator {
|
||||
|
||||
CellStyle borderStyle = worksheet.getWorkbook().createCellStyle();
|
||||
CellStyle doubleBorderStyle = worksheet.getWorkbook().createCellStyle();
|
||||
borderStyle.setBorderBottom(CellStyle.BORDER_THIN);
|
||||
doubleBorderStyle.setBorderBottom(CellStyle.BORDER_THIN);
|
||||
doubleBorderStyle.setBorderRight(CellStyle.BORDER_THICK);
|
||||
borderStyle.setBorderBottom(BorderStyle.THIN);
|
||||
doubleBorderStyle.setBorderBottom(BorderStyle.THIN);
|
||||
doubleBorderStyle.setBorderRight(BorderStyle.THICK);
|
||||
for (int colNo = 0; colNo < 35; colNo++) {
|
||||
Cell cell = rowHeader.getCell(colNo);
|
||||
if (cell == null)
|
||||
|
||||
+3
-3
@@ -297,14 +297,14 @@ public class BulkImportWorkbookPopulatorServiceImpl implements BulkImportWorkboo
|
||||
private List<CodeValueData> fetchCodeValuesByCodeName(String codeName){
|
||||
List<CodeValueData> codeValues=null;
|
||||
if (codeName!=null){
|
||||
codeValues=(List)codeValueReadPlatformService.retrieveCodeValuesByCode(codeName);
|
||||
codeValues=(List<CodeValueData>)codeValueReadPlatformService.retrieveCodeValuesByCode(codeName);
|
||||
}else {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
return codeValues;
|
||||
}
|
||||
private List<SavingsProductData>fetchSavingsProducts(){
|
||||
List<SavingsProductData> savingsProducts=(List)savingsProductReadPlatformService.retrieveAll();
|
||||
List<SavingsProductData> savingsProducts=(List<SavingsProductData>)savingsProductReadPlatformService.retrieveAll();
|
||||
return savingsProducts;
|
||||
}
|
||||
|
||||
@@ -686,4 +686,4 @@ private WorkbookPopulator populateCenterWorkbook(Long officeId,Long staffId){
|
||||
new ExtrasSheetPopulator(funds, paymentTypes, currencies),savingsAccounts);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -21,11 +21,11 @@ package org.apache.fineract.infrastructure.core.boot;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@EnableWebMvc
|
||||
@Configuration
|
||||
public class WebFrontEndConfiguration extends WebMvcConfigurerAdapter {
|
||||
public class WebFrontEndConfiguration implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class WebTwoFactorXmlConfiguration {
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean twoFactorFilterBean(TwoFactorAuthenticationFilter filter) {
|
||||
FilterRegistrationBean registrationBean = new FilterRegistrationBean(filter);
|
||||
FilterRegistrationBean<TwoFactorAuthenticationFilter> registrationBean = new FilterRegistrationBean<TwoFactorAuthenticationFilter>(filter);
|
||||
registrationBean.setEnabled(false);
|
||||
return registrationBean;
|
||||
}
|
||||
|
||||
+3
-5
@@ -19,7 +19,6 @@
|
||||
package org.apache.fineract.infrastructure.core.boot;
|
||||
|
||||
import com.sun.jersey.spi.spring.container.servlet.SpringServlet;
|
||||
import javax.servlet.Servlet;
|
||||
import org.apache.fineract.infrastructure.core.filters.ResponseCorsFilter;
|
||||
import org.apache.fineract.infrastructure.security.filter.TenantAwareBasicAuthenticationFilter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -44,9 +43,8 @@ public class WebXmlConfiguration {
|
||||
|
||||
@Bean
|
||||
public ServletRegistrationBean jersey() {
|
||||
Servlet jerseyServlet = new SpringServlet();
|
||||
ServletRegistrationBean jerseyServletRegistration = new ServletRegistrationBean();
|
||||
jerseyServletRegistration.setServlet(jerseyServlet);
|
||||
ServletRegistrationBean<SpringServlet> jerseyServletRegistration = new ServletRegistrationBean<SpringServlet>();
|
||||
jerseyServletRegistration.setServlet(new SpringServlet());
|
||||
jerseyServletRegistration.addUrlMappings("/api/v1/*");
|
||||
jerseyServletRegistration.setName("jersey-servlet");
|
||||
jerseyServletRegistration.setLoadOnStartup(1);
|
||||
@@ -62,7 +60,7 @@ public class WebXmlConfiguration {
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean filterRegistrationBean() {
|
||||
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
|
||||
FilterRegistrationBean<TenantAwareBasicAuthenticationFilter> filterRegistrationBean = new FilterRegistrationBean<TenantAwareBasicAuthenticationFilter>();
|
||||
filterRegistrationBean.setFilter(basicAuthenticationProcessingFilter);
|
||||
filterRegistrationBean.setEnabled(false);
|
||||
return filterRegistrationBean;
|
||||
|
||||
+3
-5
@@ -19,7 +19,6 @@
|
||||
package org.apache.fineract.infrastructure.core.boot;
|
||||
|
||||
import com.sun.jersey.spi.spring.container.servlet.SpringServlet;
|
||||
import javax.servlet.Servlet;
|
||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -38,9 +37,8 @@ public class WebXmlOauthConfiguration {
|
||||
|
||||
@Bean
|
||||
public ServletRegistrationBean jersey() {
|
||||
Servlet jerseyServlet = new SpringServlet();
|
||||
ServletRegistrationBean jerseyServletRegistration = new ServletRegistrationBean();
|
||||
jerseyServletRegistration.setServlet(jerseyServlet);
|
||||
ServletRegistrationBean<SpringServlet> jerseyServletRegistration = new ServletRegistrationBean<SpringServlet>();
|
||||
jerseyServletRegistration.setServlet(new SpringServlet());
|
||||
jerseyServletRegistration.addUrlMappings("/api/v1/*");
|
||||
jerseyServletRegistration.setName("jersey-servlet");
|
||||
jerseyServletRegistration.setLoadOnStartup(1);
|
||||
@@ -56,7 +54,7 @@ public class WebXmlOauthConfiguration {
|
||||
|
||||
@Bean
|
||||
public ServletRegistrationBean dispatcherRegistration(DispatcherServlet dispatcherServlet) {
|
||||
ServletRegistrationBean registrationBean = new ServletRegistrationBean(dispatcherServlet);
|
||||
ServletRegistrationBean<DispatcherServlet> registrationBean = new ServletRegistrationBean<DispatcherServlet>(dispatcherServlet);
|
||||
registrationBean.addUrlMappings("/api/oauth/token");
|
||||
return registrationBean;
|
||||
}
|
||||
|
||||
+1
@@ -23,6 +23,7 @@ import java.sql.SQLException;
|
||||
import org.apache.openjpa.jdbc.sql.BooleanRepresentationFactory;
|
||||
import org.apache.openjpa.jdbc.sql.MySQLDictionary;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class MySQLDictionaryCustom extends MySQLDictionary {
|
||||
|
||||
public MySQLDictionaryCustom(){
|
||||
|
||||
+2
-4
@@ -49,12 +49,10 @@ public class FromJsonHelper {
|
||||
|
||||
private final Gson gsonConverter;
|
||||
private final JsonParserHelper helperDelegator;
|
||||
private final JsonParser parser;
|
||||
|
||||
public FromJsonHelper() {
|
||||
this.gsonConverter = new Gson();
|
||||
this.helperDelegator = new JsonParserHelper();
|
||||
this.parser = new JsonParser();
|
||||
}
|
||||
|
||||
public Map<String, Boolean> extractMap(final Type typeOfMap, final String json) {
|
||||
@@ -140,7 +138,7 @@ public class FromJsonHelper {
|
||||
|
||||
JsonElement parsedElement = null;
|
||||
if (StringUtils.isNotBlank(json)) {
|
||||
parsedElement = this.parser.parse(json);
|
||||
parsedElement = JsonParser.parseString(json);
|
||||
}
|
||||
return parsedElement;
|
||||
}
|
||||
@@ -286,4 +284,4 @@ public class FromJsonHelper {
|
||||
return this.gsonConverter;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,11 +18,11 @@
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.core.service;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.googlecode.flyway.core.Flyway;
|
||||
import com.googlecode.flyway.core.api.FlywayException;
|
||||
import com.googlecode.flyway.core.util.jdbc.DriverDataSource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.sql.DataSource;
|
||||
import org.apache.fineract.infrastructure.core.boot.JDBCDriverConfig;
|
||||
@@ -94,7 +94,7 @@ public class TenantDatabaseUpgradeService {
|
||||
flyway.setDataSource(tenantDataSource);
|
||||
flyway.setLocations("sql/migrations/list_db");
|
||||
flyway.setOutOfOrder(true);
|
||||
flyway.setPlaceholders(ImmutableMap.of( // FINERACT-773
|
||||
flyway.setPlaceholders(Map.of( // FINERACT-773
|
||||
"fineract_default_tenantdb_hostname", dbHostname,
|
||||
"fineract_default_tenantdb_port", dbPort,
|
||||
"fineract_default_tenantdb_uid", dbUid,
|
||||
|
||||
+2
-2
@@ -475,13 +475,13 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
// PERMITTED datatables
|
||||
final String sql = "select if((exists (select 1 from x_registered_table where registered_table_name = ?)) = 1, 'true', 'false')";
|
||||
final String isRegisteredDataTable = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { name });
|
||||
return new Boolean(isRegisteredDataTable);
|
||||
return Boolean.valueOf(isRegisteredDataTable);
|
||||
}
|
||||
|
||||
private void assertDataTableExists(final String datatableName) {
|
||||
final String sql = "select if((exists (select 1 from information_schema.tables where table_schema = schema() and table_name = ?)) = 1, 'true', 'false')";
|
||||
final String dataTableExistsString = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { datatableName });
|
||||
final boolean dataTableExists = new Boolean(dataTableExistsString);
|
||||
final boolean dataTableExists = Boolean.valueOf(dataTableExistsString);
|
||||
if (!dataTableExists) { throw new PlatformDataIntegrityException("error.msg.invalid.datatable",
|
||||
"Invalid Data Table: " + datatableName, "name", datatableName); }
|
||||
}
|
||||
|
||||
-3
@@ -20,7 +20,6 @@ package org.apache.fineract.infrastructure.documentmanagement.contentrepository;
|
||||
|
||||
import com.amazonaws.AmazonClientException;
|
||||
import com.amazonaws.AmazonServiceException;
|
||||
import com.amazonaws.SDKGlobalConfiguration;
|
||||
import com.amazonaws.auth.BasicAWSCredentials;
|
||||
import com.amazonaws.services.s3.AmazonS3;
|
||||
import com.amazonaws.services.s3.AmazonS3Client;
|
||||
@@ -54,8 +53,6 @@ public class S3ContentRepository implements ContentRepository {
|
||||
|
||||
public S3ContentRepository(final String bucketName, final String secretKey, final String accessKey) {
|
||||
this.s3BucketName = bucketName;
|
||||
//On some AWS regions by default V4 signature is enabled. Setting this property.
|
||||
System.setProperty(SDKGlobalConfiguration.ENABLE_S3_SIGV4_SYSTEM_PROPERTY, "true");
|
||||
this.s3Client = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey));
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -228,10 +228,9 @@ public class Sender {
|
||||
if (responseBody == null) {
|
||||
return null;
|
||||
}
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
JsonObject jsonResponse;
|
||||
try {
|
||||
jsonResponse = (JsonObject) jsonParser.parse(responseBody);
|
||||
jsonResponse = JsonParser.parseString(responseBody).getAsJsonObject();
|
||||
Result.Builder resultBuilder = new Result.Builder();
|
||||
if (jsonResponse.has("results")) {
|
||||
// Handle response from message sent to specific device.
|
||||
@@ -480,10 +479,9 @@ public class Sender {
|
||||
return null;
|
||||
}
|
||||
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject jsonResponse;
|
||||
try {
|
||||
jsonResponse = (JsonObject) parser.parse(responseBody);
|
||||
jsonResponse = JsonParser.parseString(responseBody).getAsJsonObject();
|
||||
int success = getNumber(responseMap, JSON_SUCCESS).intValue();
|
||||
int failure = getNumber(responseMap, JSON_FAILURE).intValue();
|
||||
int canonicalIds = getNumber(responseMap, JSON_CANONICAL_IDS)
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ public class TwilioHookProcessor implements HookProcessor {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
json = new JsonParser().parse(payload).getAsJsonObject();
|
||||
json = JsonParser.parseString(payload).getAsJsonObject();
|
||||
}
|
||||
service.sendSmsBridgeRequest(entityName, actionName,
|
||||
tenantIdentifier, apiKey, json, callback);
|
||||
@@ -136,7 +136,7 @@ public class TwilioHookProcessor implements HookProcessor {
|
||||
jsonMap.put("mobileNo", mobileNo);
|
||||
jsonMap.put("message", compiledMessage);
|
||||
final String jsonString = new Gson().toJson(jsonMap);
|
||||
json = new JsonParser().parse(jsonString).getAsJsonObject();
|
||||
json = JsonParser.parseString(jsonString).getAsJsonObject();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class WebHookProcessor implements HookProcessor {
|
||||
|
||||
if (contentType.equalsIgnoreCase("json")
|
||||
|| contentType.contains("json")) {
|
||||
final JsonObject json = new JsonParser().parse(payload)
|
||||
final JsonObject json = JsonParser.parseString(payload)
|
||||
.getAsJsonObject();
|
||||
service.sendJsonRequest(entityName, actionName, tenantIdentifier,
|
||||
fineractEndpointUrl, json, callback);
|
||||
|
||||
+3
-3
@@ -33,14 +33,14 @@ public class OTPRequestRepository {
|
||||
|
||||
|
||||
public OTPRequest getOTPRequestForUser(AppUser user) {
|
||||
Assert.notNull(user);
|
||||
Assert.notNull(user, "User must not be null");
|
||||
|
||||
return this.OTPrequests.get(user.getId());
|
||||
}
|
||||
|
||||
public void addOTPRequest(AppUser user, OTPRequest request) {
|
||||
Assert.notNull(user);
|
||||
Assert.notNull(request);
|
||||
Assert.notNull(user, "User must not be null");
|
||||
Assert.notNull(request, "Request must not be null");
|
||||
this.OTPrequests.put(user.getId(), request);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ public class ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl implement
|
||||
private boolean isAnyLoanProductsAssociateWithThisProvisioningCategory(final Long categoryID) {
|
||||
final String sql = "select if((exists (select 1 from m_loanproduct_provisioning_details lpd where lpd.category_id = ?)) = 1, 'true', 'false')";
|
||||
final String isLoansUsingCharge = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { categoryID });
|
||||
return new Boolean(isLoansUsingCharge);
|
||||
return Boolean.valueOf(isLoansUsingCharge);
|
||||
}
|
||||
/*
|
||||
* Guaranteed to throw an exception no matter what the data integrity issue
|
||||
|
||||
+4
-4
@@ -242,27 +242,27 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
||||
|
||||
final String sql = "select if((exists (select 1 from m_loan_charge lc where lc.charge_id = ? and lc.is_active = 1)) = 1, 'true', 'false')";
|
||||
final String isLoansUsingCharge = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { chargeId });
|
||||
return new Boolean(isLoansUsingCharge);
|
||||
return Boolean.valueOf(isLoansUsingCharge);
|
||||
}
|
||||
|
||||
private boolean isAnySavingsAssociateWithThisCharge(final Long chargeId) {
|
||||
|
||||
final String sql = "select if((exists (select 1 from m_savings_account_charge sc where sc.charge_id = ? and sc.is_active = 1)) = 1, 'true', 'false')";
|
||||
final String isSavingsUsingCharge = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { chargeId });
|
||||
return new Boolean(isSavingsUsingCharge);
|
||||
return Boolean.valueOf(isSavingsUsingCharge);
|
||||
}
|
||||
|
||||
private boolean isAnyLoanProductsAssociateWithThisCharge(final Long chargeId) {
|
||||
|
||||
final String sql = "select if((exists (select 1 from m_product_loan_charge lc where lc.charge_id = ?)) = 1, 'true', 'false')";
|
||||
final String isLoansUsingCharge = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { chargeId });
|
||||
return new Boolean(isLoansUsingCharge);
|
||||
return Boolean.valueOf(isLoansUsingCharge);
|
||||
}
|
||||
|
||||
private boolean isAnySavingsProductsAssociateWithThisCharge(final Long chargeId) {
|
||||
|
||||
final String sql = "select if((exists (select 1 from m_savings_product_charge sc where sc.charge_id = ?)) = 1, 'true', 'false')";
|
||||
final String isSavingsUsingCharge = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { chargeId });
|
||||
return new Boolean(isSavingsUsingCharge);
|
||||
return Boolean.valueOf(isSavingsUsingCharge);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -536,11 +536,11 @@ public class GroupsApiResource {
|
||||
List<GLIMContainer> glimContainer = Collections.emptyList();
|
||||
if(parentLoanAccountNo==null)
|
||||
{
|
||||
glimContainer=(List)glimAccountInfoReadPlatformService.findGlimAccount(groupId);
|
||||
glimContainer=(List<GLIMContainer>)glimAccountInfoReadPlatformService.findGlimAccount(groupId);
|
||||
}
|
||||
else
|
||||
{
|
||||
glimContainer=(List)glimAccountInfoReadPlatformService.findGlimAccountbyGroupAndAccount(groupId,parentLoanAccountNo);
|
||||
glimContainer=(List<GLIMContainer>)glimAccountInfoReadPlatformService.findGlimAccountbyGroupAndAccount(groupId,parentLoanAccountNo);
|
||||
}
|
||||
|
||||
|
||||
@@ -568,11 +568,11 @@ public class GroupsApiResource {
|
||||
}
|
||||
else if(parentGSIMAccountNo !=null && parentGSIMId==null )
|
||||
{
|
||||
gsimContainer= (List)this.gsimReadPlatformService.findGsimAccountContainerbyGsimAccountNumber(parentGSIMAccountNo);
|
||||
gsimContainer= (List<GSIMContainer>)this.gsimReadPlatformService.findGsimAccountContainerbyGsimAccountNumber(parentGSIMAccountNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
gsimContainer= (List)this.gsimReadPlatformService.findGSIMAccountContainerByGroupId(groupId);
|
||||
gsimContainer= (List<GSIMContainer>)this.gsimReadPlatformService.findGSIMAccountContainerByGroupId(groupId);
|
||||
|
||||
}
|
||||
|
||||
@@ -585,4 +585,4 @@ public class GroupsApiResource {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-3
@@ -174,10 +174,8 @@ public class SelfSavingsApiResource {
|
||||
|
||||
@GET
|
||||
@Path("template")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
public String template(@QueryParam("clientId") final Long clientId, @QueryParam("productId") final Long productId,
|
||||
final String apiRequestBodyAsJson, @Context final UriInfo uriInfo) {
|
||||
public String template(@QueryParam("clientId") final Long clientId, @QueryParam("productId") final Long productId, @Context final UriInfo uriInfo) {
|
||||
|
||||
validateAppuserClientsMapping(clientId);
|
||||
Long groupId = null;
|
||||
|
||||
Reference in New Issue
Block a user