Skip to content

Commit 391316f

Browse files
Merge pull request #986 from ashitsalesforce/master
Fix for W-14887469 and W-14893310
2 parents 8a632e0 + ed7bda0 commit 391316f

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.force</groupId>
55
<artifactId>dataloader</artifactId>
66
<packaging>jar</packaging>
7-
<version>60.0.0</version>
7+
<version>60.0.1</version>
88
<name>Salesforce Data Loader</name>
99
<url>https://github.com/forcedotcom/dataloader</url>
1010
<organization>

src/main/java/com/salesforce/dataloader/action/visitor/BulkLoadVisitor.java

+1-10
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
import com.salesforce.dataloader.exception.DataAccessObjectInitializationException;
6565
import com.salesforce.dataloader.exception.LoadException;
6666
import com.salesforce.dataloader.exception.OperationException;
67-
import com.salesforce.dataloader.exception.ParameterLoadException;
6867
import com.salesforce.dataloader.model.NACalendarValue;
6968
import com.salesforce.dataloader.model.NADateOnlyCalendarValue;
7069
import com.salesforce.dataloader.model.NATextValue;
@@ -542,17 +541,9 @@ private void processBatchResults(final BatchInfo batch, final String errorMessag
542541
final int idIdx = hdrIndices.get(ID_RESULT_COL);
543542
final int errIdx = hdrIndices.get(ERROR_RESULT_COL);
544543
hdrIndices = null;
545-
int dataReaderRowCount = 0;
546-
int skippedRowsCount = 0;
547-
try {
548-
skippedRowsCount = controller.getConfig().getInt(Config.LOAD_ROW_TO_START_AT);
549-
} catch (ParameterLoadException e) {
550-
// @ignored
551-
}
552544

553545
for (final Row row : rows) {
554-
boolean conversionSuccessOfRow = isRowConversionSuccessful(skippedRowsCount
555-
+ this.firstDAORowForCurrentBatch + dataReaderRowCount++);
546+
boolean conversionSuccessOfRow = isRowConversionSuccessful();
556547
if (!conversionSuccessOfRow) {
557548
continue; // this DAO row failed to convert and was not part of the batch sent to the server. Go to the next one
558549
}

src/main/java/com/salesforce/dataloader/action/visitor/DAOLoadVisitor.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,20 @@ public void setRowConversionStatus(int dataSourceRow, boolean conversionSuccess)
110110
}
111111
}
112112

113-
protected boolean isRowConversionSuccessful(int dataSourceRow) {
114-
Boolean conversionFailure = this.rowConversionFailureMap.get(dataSourceRow);
113+
private int rowConversionCheckCounter = 0;
114+
private boolean gotSkippedRowsCount = false;
115+
private int skippedRowsCount = 0;
116+
protected boolean isRowConversionSuccessful() {
117+
if (!gotSkippedRowsCount) {
118+
try {
119+
skippedRowsCount = controller.getConfig().getInt(Config.LOAD_ROW_TO_START_AT);
120+
gotSkippedRowsCount = true;
121+
} catch (ParameterLoadException e) {
122+
// @ignored
123+
}
124+
}
125+
int rowToCheck = skippedRowsCount + rowConversionCheckCounter++;
126+
Boolean conversionFailure = this.rowConversionFailureMap.get(rowToCheck);
115127
if (conversionFailure != null && conversionFailure.booleanValue()) {
116128
return false;
117129
}

src/main/java/com/salesforce/dataloader/action/visitor/PartnerLoadVisitor.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,9 @@ private void writeOutputToWriter(Object[] results)
130130
// have to do this because although saveResult and deleteResult
131131
// are a) not the same class yet b) not subclassed
132132
int batchRowCounter = 0;
133-
int startAtDAORow = 0;
134-
try {
135-
startAtDAORow = controller.getConfig().getInt(Config.LOAD_ROW_TO_START_AT);
136-
} catch (ParameterLoadException e) {
137-
// @ignored
138-
}
139133
for (int i = 0; i < this.daoRowList.size(); i++) {
140134
Row daoRow = this.daoRowList.get(i);
141-
if (!isRowConversionSuccessful(startAtDAORow + i)) {
135+
if (!isRowConversionSuccessful()) {
142136
continue;
143137
}
144138
String statusMsg = null;

0 commit comments

Comments
 (0)