Skip to content
Permalink
Browse files

Improved: Remove ‘CreateTableCallable’ private class (OFBIZ-10912)

This class was never instantiated locally.  Since this was a private
class it is better to remove it.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857090 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Apr 7, 2019
1 parent d639aba commit fef3988c4667e440f94d1fb1de835cf428dba427
Showing with 1 addition and 45 deletions.
  1. +1 −45 framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java
@@ -217,7 +217,7 @@ public void checkDb(Map<String, ModelEntity> modelEntities, List<String> colWron
Debug.logError(message, module);
return;
}
List<Future<CreateTableCallable>> tableFutures = new LinkedList<Future<CreateTableCallable>>();

for (ModelEntity entity: modelEntityList) {
curEnt++;

@@ -400,9 +400,6 @@ public void checkDb(Map<String, ModelEntity> modelEntities, List<String> colWron
}
}
}
for (CreateTableCallable tableCallable: ExecutionPool.getAllFutures(tableFutures)) {
tableCallable.updateData(messages, entitiesAdded);
}

timer.timerString("After Individual Table/Column Check");

@@ -1482,47 +1479,6 @@ public int checkPrimaryKeyInfo(ResultSet rsPks, String lookupSchemaName, boolean
return indexInfo;
}

private class CreateTableCallable implements Callable<CreateTableCallable> {
private final ModelEntity entity;
private final Map<String, ModelEntity> modelEntities;
private final String tableName;
private String message;
private boolean success;

protected CreateTableCallable(ModelEntity entity, Map<String, ModelEntity> modelEntities, String tableName) {
this.entity = entity;
this.modelEntities = modelEntities;
this.tableName = tableName;
}

public CreateTableCallable call() throws Exception {
String errMsg = createTable(entity, modelEntities, false);
if (UtilValidate.isNotEmpty(errMsg)) {
this.success = false;
this.message = "Could not create table [" + tableName + "]: " + errMsg;
Debug.logError(this.message, module);
} else {
this.success = true;
this.message = "Created table [" + tableName + "]";
Debug.logImportant(this.message, module);
}
return this;
}

protected void updateData(Collection<String> messages, List<ModelEntity> entitiesAdded) {
if (this.success) {
entitiesAdded.add(entity);
if (messages != null) {
messages.add(this.message);
}
} else {
if (messages != null) {
messages.add(this.message);
}
}
}
}

private abstract class AbstractCountingCallable implements Callable<AbstractCountingCallable> {
protected final ModelEntity entity;
protected final Map<String, ModelEntity> modelEntities;

0 comments on commit fef3988

Please sign in to comment.
You can’t perform that action at this time.