Skip to content

Commit

Permalink
Fix TIBCOSoftware#260: Commons BeanUtils2
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Jan 7, 2025
1 parent a8ec0e6 commit f4423a9
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 34 deletions.
4 changes: 2 additions & 2 deletions core/pom-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@
<optional>false</optional>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-beanutils2</artifactId>
<version>${commons-beanutils.version}</version>
<scope>compile</scope>
<optional>false</optional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.beanutils.NestedNullException;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.beanutils2.NestedNullException;
import org.apache.commons.beanutils2.PropertyUtils;

import net.sf.jasperreports.annotations.properties.Property;
import net.sf.jasperreports.annotations.properties.PropertyScope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.util.Locale;
import java.util.TimeZone;

import org.apache.commons.beanutils.locale.LocaleConvertUtilsBean;
import org.apache.commons.beanutils2.locale.LocaleConvertUtilsBean;

import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JRException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

import org.apache.commons.beanutils.locale.converters.DateLocaleConverter;
import org.apache.commons.beanutils2.locale.converters.DateLocaleConverter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand All @@ -46,7 +47,7 @@
* @author szaharia
*/

public class JRDateLocaleConverter extends DateLocaleConverter
public class JRDateLocaleConverter extends DateLocaleConverter<Date>
{

private static Log log = LogFactory.getLog(DateLocaleConverter.class);
Expand All @@ -60,18 +61,18 @@ public class JRDateLocaleConverter extends DateLocaleConverter
*/
public JRDateLocaleConverter(TimeZone timeZone)
{
super();
super(null, null, null, false, true, true);

this.timeZone = timeZone;
}

@Override
protected Object parse(Object value, String pattern) throws ParseException
protected Date parse(Object value, String pattern) throws ParseException
{
SimpleDateFormat formatter = getFormatter(pattern, locale);
if (pattern != null)
{
if (locPattern) {
if (localizedPattern) {
formatter.applyLocalizedPattern(pattern);
}
else {
Expand All @@ -87,7 +88,7 @@ protected Object parse(Object value, String pattern) throws ParseException
private SimpleDateFormat getFormatter(String pattern, Locale locale)
{
if(pattern == null) {
pattern = locPattern ?
pattern = localizedPattern ?
new SimpleDateFormat().toLocalizedPattern() : new SimpleDateFormat().toPattern();
log.warn("Null pattern was provided, defaulting to: " + pattern);
}
Expand Down
7 changes: 0 additions & 7 deletions ext/hibernate-j2ee/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
<scope>compile</scope>
<optional>false</optional>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
<scope>compile</scope>
<optional>false</optional>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-data-adapters</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.beanutils.PropertyUtils;
import org.hibernate.type.Type;

import net.sf.jasperreports.engine.JRDataSource;
Expand Down Expand Up @@ -159,7 +158,7 @@ protected FieldReader getFieldReaderSingleReturn(Map<String,Integer> aliasesMap,
else
{
@SuppressWarnings("deprecation")
int firstNestedIdx = fieldMapping.indexOf(PropertyUtils.NESTED_DELIM);
int firstNestedIdx = fieldMapping.indexOf(".");

if (firstNestedIdx >= 0 && aliasesMap.containsKey(fieldMapping.substring(0, firstNestedIdx)))
{
Expand Down Expand Up @@ -188,7 +187,7 @@ protected FieldReader getFieldReader(Type[] returnTypes, Map<String,Integer> ali
if (fieldIdx == null)
{
@SuppressWarnings("deprecation")
int firstNestedIdx = fieldMapping.indexOf(PropertyUtils.NESTED_DELIM);
int firstNestedIdx = fieldMapping.indexOf(".");

if (firstNestedIdx < 0)
{
Expand Down
7 changes: 0 additions & 7 deletions ext/hibernate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
<scope>compile</scope>
<optional>false</optional>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
<scope>compile</scope>
<optional>false</optional>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-data-adapters</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import java.util.ListIterator;
import java.util.Map;

import org.apache.commons.beanutils.PropertyUtils;

import jakarta.persistence.Tuple;
import jakarta.persistence.TupleElement;
import net.sf.jasperreports.engine.JRDataSource;
Expand Down Expand Up @@ -157,7 +155,7 @@ protected FieldReader getFieldReaderSingleReturn(Map<String,Integer> aliasesMap,
else
{
@SuppressWarnings("deprecation")
int firstNestedIdx = fieldMapping.indexOf(PropertyUtils.NESTED_DELIM);
int firstNestedIdx = fieldMapping.indexOf(".");

if (firstNestedIdx >= 0 && aliasesMap.containsKey(fieldMapping.substring(0, firstNestedIdx)))
{
Expand All @@ -179,7 +177,7 @@ protected FieldReader getFieldReader(List<TupleElement<?>> elements, Map<String,
if (fieldIdx == null)
{
@SuppressWarnings("deprecation")
int firstNestedIdx = fieldMapping.indexOf(PropertyUtils.NESTED_DELIM);
int firstNestedIdx = fieldMapping.indexOf(".");

if (firstNestedIdx < 0)
{
Expand Down
4 changes: 2 additions & 2 deletions pom-parent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@
<antlr.version>2.7.7</antlr.version>
<batik.version>1.17</batik.version>
<castor.version>1.4.1</castor.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<commons-collections4.version>4.4</commons-collections4.version>
<commons-beanutils.version>2.0.0-M1</commons-beanutils.version>
<commons-collections4.version>4.5.0-M3</commons-collections4.version>
<commons-logging.version>1.3.0</commons-logging.version>
<hsqldb.version>2.7.2</hsqldb.version>
<jackson.version>2.17.1</jackson.version>
Expand Down

0 comments on commit f4423a9

Please sign in to comment.