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 f65aff8 commit 8edda32
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,21 @@ private MigrationColumn storeInfoMigrationColumn(Node nodeColumn, SchemaEvolutio
NodeList toFrom = nodeColumn.getChildNodes();
// Right now it's only for one from table and one to table
ColFrom colfrom = new ColFrom();
MigrateTo MigrateTo = new MigrateTo();
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("colfrom")) {
colfrom = storeInfoColFrom(element);
} else if (element.getNodeName().equalsIgnoreCase("MigrateTo")) {
MigrateTo = storeInfoMigrateTo(element, schemaEvolution, schema);
migrationTable.setNewTableName(MigrateTo.getNewNameTable());
migrateTo = storeInfoMigrateTo(element, schemaEvolution, schema);
migrationTable.setNewTableName(migrateTo.getNewNameTable());
}
}
}
c.setColFrom(colfrom);
c.setMigrateTo(MigrateTo);
c.setMigrateTo(migrateTo);
return c;
}

Expand All @@ -106,23 +106,23 @@ private MigrationColumn storeInfoMigrationColumn(Node nodeColumn, SchemaEvolutio
*/
private MigrateTo storeInfoMigrateTo(Element element, SchemaEvolution se, Schema sc) {
String nameMigrateTo = "";
MigrateTo MigrateTo = new MigrateTo();
MigrateTo migrateTo = new MigrateTo();
String table = element.getAttribute("DataTable");
nameMigrateTo = element.getAttribute("Data");
String key = element.getAttribute("Key");
MigrateTo.setTable(table);
MigrateTo.setData(nameMigrateTo);
MigrateTo.setDataKey(isColumnKey(table, nameMigrateTo, se, sc));
migrateTo.setTable(table);
migrateTo.setData(nameMigrateTo);
migrateTo.setDataKey(isColumnKey(table, nameMigrateTo, se, sc));
String newNameTable = element.getAttribute("NewTableName");
MigrateTo.setNewNameTable(newNameTable);
migrateTo.setNewNameTable(newNameTable);
String[] keys = key.split(",");
trimmingArray(keys);
if (keys.length == 1 && keys[0].equalsIgnoreCase("")) {
MigrateTo.setKey(new String[0]);
migrateTo.setKey(new String[0]);
} else {
MigrateTo.setKey(keys);
migrateTo.setKey(keys);
}
return MigrateTo;
return migrateTo;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
public class MigrationColumn {

private String name;
private MigrateTo MigrateTo; // Contains the required information to migrate data to a column
private MigrateTo migrateTo; // Contains the required information to migrate data to a column
private ColFrom colFrom; // 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();
migrateTo = new MigrateTo();
colFrom = new ColFrom();
}

Expand Down

0 comments on commit 8edda32

Please sign in to comment.