Skip to content

Upgrade to Spring Batch 5.1 #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions spring-batch-excel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<java.version>1.8</java.version>
<java.version>17</java.version>

<spring.batch.version>4.3.9</spring.batch.version>
<poi.version>4.1.2</poi.version>
<spring.batch.version>5.1.2</spring.batch.version>
<poi.version>5.3.0</poi.version>

<!-- Test Dependencies -->
<assertj.version>3.18.1</assertj.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<assertj.version>3.26.3</assertj.version>
<junit.jupiter.version>5.10.2</junit.jupiter.version>
<slf4j.version>1.7.36</slf4j.version>
<mockito.version>3.12.4</mockito.version>
<mockito.version>5.12.0</mockito.version>
</properties>

<developers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected T doRead() {
*/
@Override
protected void jumpToItem(final int itemIndex) {
RowMapper<T> current = this.rowMapper;
var current = this.rowMapper;
this.rowMapper = (rs) -> null;
try {
for (int i = 0; i < itemIndex; i++) {
Expand All @@ -145,8 +145,8 @@ protected void jumpToItem(final int itemIndex) {
}

private boolean isInvalidValidRow(RowSet rs) {
for (String str : rs.getCurrentRow()) {
if (str.length() > 0) {
for (var str : rs.getCurrentRow()) {
if (!str.isEmpty()) {
return false;
}
}
Expand Down Expand Up @@ -220,7 +220,7 @@ public void setResource(final Resource resource) {
this.resource = resource;
}

public void afterPropertiesSet() throws Exception {
public void afterPropertiesSet() {
Assert.notNull(this.rowMapper, "RowMapper must be set");
if (this.datesAsIso) {
this.dataFormatter = (this.userLocale != null) ? new IsoFormattingDateDataFormatter(this.userLocale) : new IsoFormattingDateDataFormatter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,10 @@ public void setTargetType(Class<? extends T> type) {

/**
* Check that precisely one of type or prototype bean name is specified.
* @throws IllegalStateException if neither is set or both properties are set.
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
@Override
public void afterPropertiesSet() throws Exception {
public void afterPropertiesSet() {
Assert.state(this.name != null || this.type != null, "Either name or type must be provided.");
Assert.state(this.name == null || this.type == null, "Both name and type cannot be specified together.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class PassThroughRowMapper implements RowMapper<String[]> {

@Override
public String[] mapRow(final RowSet rs) throws Exception {
public String[] mapRow(final RowSet rs) {
return rs.getCurrentRow();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ private String[] calculateMatches(PropertyDescriptor[] propertyDescriptors, int
* @return the distance value
*/
private int calculateStringDistance(String s1, String s2) {
if (s1.length() == 0) {
if (s1.isEmpty()) {
return s2.length();
}
if (s2.length() == 0) {
if (s2.isEmpty()) {
return s1.length();
}
int[][] d = new int[s1.length() + 1][s2.length() + 1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ protected int getNumberOfSheets() {
}

@Override
protected void openExcelFile(Resource resource, String password) throws Exception {
protected void openExcelFile(Resource resource, String password) {

}

@Override
protected void doClose() throws Exception {
protected void doClose() {
this.sheets.clear();
}

Expand Down
Loading