Skip to content

Commit

Permalink
#21060 Fixing Sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nollymar committed Jan 22, 2024
1 parent 7bdfc44 commit 2e26221
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3226,7 +3226,7 @@ public void deleteAllVersionsandBackup(List<Contentlet> contentlets, User user,
}

if (contentlets.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -3252,7 +3252,7 @@ public void deleteAllVersionsandBackup(List<Contentlet> contentlets, User user,
Logger.error(this, e.getMessage());
}
}
_xstream.toXML(contentlets, _bout);
xStreamInstance.toXML(contentlets, _bout);
}
deleteBinaryFiles(contentletsVersion, null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public List <Map <String,Object>> executeFix() throws DotDataException, DotRunti
public List <Map<String, String>> getModifiedData() {

if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -201,7 +201,7 @@ public List <Map<String, String>> getModifiedData() {
+ "FixTask00001CheckAssetsMissingIdentifiers" + ".xml");

try (BufferedOutputStream _bout = new BufferedOutputStream(Files.newOutputStream(_writing.toPath()))){
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} catch (IOException e) {
Logger.error(this, "Error trying to get modified data from XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public List <Map <String,Object>> executeFix() throws DotDataException, DotRunti
public List <Map<String, String>> getModifiedData() {

if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -201,7 +201,7 @@ public List <Map<String, String>> getModifiedData() {
+ "FixTask00001CheckAssetsMissingIdentifiers" + ".xml");

try (BufferedOutputStream _bout = new BufferedOutputStream(Files.newOutputStream(_writing.toPath()))){
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} catch (IOException e) {
Logger.error(this, "Error trying to get modified data from XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public List <Map <String,Object>> executeFix() throws DotDataException, DotRunt
public List <Map<String, String>> getModifiedData() {

if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -165,7 +165,7 @@ public List <Map<String, String>> getModifiedData() {
+ "FixTask00003CheckContainersInconsistencies" + ".xml");

try (BufferedOutputStream _bout = new BufferedOutputStream(Files.newOutputStream(_writing.toPath()))){
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} catch (IOException e) {
Logger.error(this, "Error trying to get modified data from XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public List <Map <String,Object>> executeFix() throws DotDataException, DotRunti
public List <Map<String, String>> getModifiedData() {

if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -168,7 +168,7 @@ public List <Map<String, String>> getModifiedData() {
+ "FixTask00006CheckLinksInconsistencies" + ".xml");

try (BufferedOutputStream _bout = new BufferedOutputStream(Files.newOutputStream(_writing.toPath()))){
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} catch (IOException e) {
Logger.error(this, "Error trying to get modified data from XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public List <Map <String,Object>> executeFix() throws DotDataException, DotRunti
public List <Map<String, String>> getModifiedData() {

if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -168,7 +168,7 @@ public List <Map<String, String>> getModifiedData() {
+ "FixTask00007CheckTemplatesInconsistencies" + ".xml");

try (BufferedOutputStream _bout = new BufferedOutputStream(Files.newOutputStream(_writing.toPath()))){
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} catch (IOException e) {
Logger.error(this, "Error trying to get modified data from XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public List <Map <String,Object>> executeFix() throws DotDataException,
public List <Map<String, String>> getModifiedData() {

if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -157,7 +157,7 @@ public List <Map<String, String>> getModifiedData() {
+ "FixTask00008CheckTreeInconsistencies" + ".xml");

try (BufferedOutputStream _bout = new BufferedOutputStream(Files.newOutputStream(_writing.toPath()))){
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} catch (IOException e) {
Logger.error(this, "Error trying to get modified data from XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public class FixTask00009CheckContentletsInexistentInodes implements FixTask {
public List <Map<String, String>> getModifiedData() {

if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -134,7 +134,7 @@ public List <Map<String, String>> getModifiedData() {
+ "FixTask00009CheckContentletsInconsistencies" + ".xml");

try (BufferedOutputStream _bout = new BufferedOutputStream(Files.newOutputStream(_writing.toPath()))){
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} catch (IOException e) {
Logger.error(this, "Error trying to get modified data from XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public List<Map<String, Object>> executeFix() throws DotDataException, DotRuntim

public List <Map<String, String>> getModifiedData() {
if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -106,7 +106,7 @@ public List <Map<String, String>> getModifiedData() {
+ "FixTask00011RenameHostInFieldVariableName" + ".xml");

try (BufferedOutputStream _bout = new BufferedOutputStream(Files.newOutputStream(_writing.toPath()))){
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} catch (IOException e) {
Logger.error(this, "Error trying to get modified data from XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public List<Map<String, Object>> executeFix() throws DotDataException, DotRuntim

public List<Map<String, String>> getModifiedData() {
if (0 < modifiedData.size()) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -214,7 +214,7 @@ public List<Map<String, String>> getModifiedData() {
_writing = new java.io.File(ConfigUtils.getBackupPath()+File.separator+"fixes" + java.io.File.separator + lastmoddate + "_" + "FixTask00012UpdateAssetsHosts" + ".xml");

try (BufferedOutputStream _bout = new BufferedOutputStream(Files.newOutputStream(_writing.toPath()))){
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} catch (IOException e) {
Logger.error(this, "Error trying to get modified data from XML.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public List<Map<String, Object>> executeFix() throws DotDataException,

public List<Map<String, String>> getModifiedData() {
if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -159,7 +159,7 @@ public List<Map<String, String>> getModifiedData() {

}
try {
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} finally {
CloseUtils.closeQuietly(_bout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public List<Map<String, Object>> executeFix() throws DotDataException, DotRuntim

public List<Map<String, String>> getModifiedData() {
if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -184,7 +184,7 @@ public List<Map<String, String>> getModifiedData() {

}
try {
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} finally {
CloseUtils.closeQuietly(_bout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public List<Map<String, Object>> executeFix() throws DotDataException,

public List<Map<String, String>> getModifiedData() {
if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -160,7 +160,7 @@ public List<Map<String, String>> getModifiedData() {

}
try {
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} finally {
CloseUtils.closeQuietly(_bout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public List<Map<String, Object>> executeFix() throws DotDataException, DotRuntim
@Override
public List<Map<String, String>> getModifiedData() {
if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -161,7 +161,7 @@ public List<Map<String, String>> getModifiedData() {

}
try {
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} finally {
CloseUtils.closeQuietly(_bout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public List<Map<String, Object>> executeFix() throws DotDataException,
@Override
public List<Map<String, String>> getModifiedData() {
if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -139,7 +139,7 @@ public List<Map<String, String>> getModifiedData() {
Logger.error(this, "Could not write to Fix Task status file.");
}
try {
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} finally {
CloseUtils.closeQuietly(_bout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private void createFixAudit(List<Map<String, Object>> returnValue, int total) th
@Override
public List<Map<String, String>> getModifiedData() {
if (modifiedData.size() > 0) {
XStream _xstream = XStreamHandler.newXStreamInstance();
XStream xStreamInstance = XStreamHandler.newXStreamInstance();
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy_HH-mm-ss");
String lastmoddate = sdf.format(date);
Expand All @@ -230,7 +230,7 @@ public List<Map<String, String>> getModifiedData() {
Logger.error(this, "Could not write to Fix Task status file.");
}
try {
_xstream.toXML(modifiedData, _bout);
xStreamInstance.toXML(modifiedData, _bout);
} finally {
CloseUtils.closeQuietly(_bout);
}
Expand Down

0 comments on commit 2e26221

Please sign in to comment.