Skip to content

Commit

Permalink
fix sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
suarezgpablo committed Nov 22, 2024
1 parent 42582ec commit 015f78f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ private MigrationColumn storeInfoMigrationColumn(Node nodeColumn, SchemaEvolutio
}
NodeList toFrom = nodeColumn.getChildNodes();
// Right now it's only for one from table and one to table
MigrateFrom MigrateFrom = new MigrateFrom();
MigrateFrom migrateFrom = new MigrateFrom();
MigrateTo migrateTo = new MigrateTo();
for (int j = 0; j < toFrom.getLength(); j++) {
Node nodeToFrom = toFrom.item(j);
if (nodeToFrom.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) nodeToFrom;
if (element.getNodeName().equalsIgnoreCase("MigrateFrom")) {
MigrateFrom = storeInfoMigrateFrom(element);
migrateFrom = storeInfoMigrateFrom(element);
} else if (element.getNodeName().equalsIgnoreCase("MigrateTo")) {
migrateTo = storeInfoMigrateTo(element, schemaEvolution, schema);
migrationTable.setNewTableName(migrateTo.getNewNameTable());
}
}
}
c.setMigrateFrom(MigrateFrom);
c.setMigrateFrom(migrateFrom);
c.setMigrateTo(migrateTo);
return c;
}
Expand Down Expand Up @@ -132,17 +132,17 @@ private MigrateFrom storeInfoMigrateFrom(Element element) {
String table = element.getAttribute("DataTable");
String column = element.getAttribute("Data");
String key = element.getAttribute("Key");
MigrateFrom MigrateFrom = new MigrateFrom();
MigrateFrom.setTable(table);
MigrateFrom.setData(column);
MigrateFrom migrateFrom = new MigrateFrom();
migrateFrom.setTable(table);
migrateFrom.setData(column);
String[] keys = key.split(",");
trimmingArray(keys);
if (keys.length == 1 && keys[0].equalsIgnoreCase("")) {
MigrateFrom.setKey(new String[0]);
migrateFrom.setKey(new String[0]);
} else {
MigrateFrom.setKey(keys);
migrateFrom.setKey(keys);
}
return MigrateFrom;
return migrateFrom;
}

private boolean isColumnKey(String nameTable, String nameCol, SchemaEvolution se, Schema sc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public class MigrationColumn {

private String name;
private MigrateTo migrateTo; // Contains the required information to migrate data to a column
private MigrateFrom MigrateFrom; // Contains the required information to migrate data from a column
private MigrateFrom migrateFrom; // Contains the required information to migrate data from a column
private String description; //when it is not possible to proceed with the migration

public MigrationColumn() {
super();
migrateTo = new MigrateTo();
MigrateFrom = new MigrateFrom();
migrateFrom = new MigrateFrom();
}

public MigrationColumn(String name) {
Expand Down

0 comments on commit 015f78f

Please sign in to comment.