Skip to content

Commit 0b99a6e

Browse files
author
Emanuel Martinez Vazquez
committed
Incorporating code change after peer review.
1 parent 59e1707 commit 0b99a6e

File tree

1 file changed

+5
-27
lines changed

1 file changed

+5
-27
lines changed

dev/com.ibm.ws.http.plugin.merge/src/com/ibm/ws/http/plugin/merge/internal/PluginMergeToolImpl.java

+5-27
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
import java.io.FileInputStream;
1717
import java.io.FileOutputStream;
1818
import java.io.IOException;
19-
import java.text.SimpleDateFormat;
19+
import java.time.ZonedDateTime;
20+
import java.time.format.DateTimeFormatter;
2021
import java.util.ArrayList;
2122
import java.util.Arrays;
2223
import java.util.Collection;
2324
import java.util.Collections;
2425
import java.util.Comparator;
25-
import java.util.Date;
2626
import java.util.Enumeration;
2727
import java.util.HashSet;
2828
import java.util.Hashtable;
@@ -191,7 +191,7 @@ private void printMergedCopy(String output) throws IOException, ParserConfigurat
191191
DocumentBuilder parser = dbf.newDocumentBuilder();
192192
Document mergeDoc = parser.newDocument();
193193
final Comment comment = mergeDoc.createComment(" This config file was generated by pluginUtility merge v1.0.75 on " +
194-
new SimpleDateFormat("yyyy.MM.dd 'at' HH:mm:ss z").format(new Date()) + " ");
194+
dateTimeFormatter.format(ZonedDateTime.now()) + " ");
195195
mergeDoc.appendChild(comment);
196196

197197
mergeDoc.appendChild(mergeDoc.importNode(mergeConfigNode, true));
@@ -255,24 +255,6 @@ private void printMergedCopy(String output) throws IOException, ParserConfigurat
255255
}
256256
}
257257

258-
259-
/* Node[] vhgs = null;
260-
itrSharedPlugins = sharedPlugins.iterator();
261-
while (itrSharedPlugins.hasNext()) {
262-
vhgs = (itrSharedPlugins.next()).getSharedVHostGrps();
263-
for (int i = 0; i < vhgs.length; i++) {
264-
mergeConfigNode.appendChild(mergeDoc.importNode(vhgs[i], true));
265-
}
266-
}
267-
268-
vhgs = null;
269-
for (int i = 0; i < plugins.length; i++) {
270-
vhgs = plugins[i].getUnsharedVHostGrp();
271-
for (int j = 0; j < vhgs.length; j++)
272-
mergeConfigNode.appendChild(mergeDoc.importNode(vhgs[j], true));
273-
} */
274-
275-
276258
mergeConfigNode.appendChild(mergeDoc.createComment(" URI Groups "));
277259

278260
Node[] uriGrps = null;
@@ -701,8 +683,7 @@ private boolean validateEach(String[] inputFiles, String mergeFileName) {
701683
break;
702684
}
703685
}
704-
if (!passFail)
705-
break;
686+
if (!passFail) break;
706687
}
707688
return passFail;
708689
}
@@ -738,14 +719,11 @@ public void merge(String argv[]) {
738719
throw new IllegalArgumentException("Please provide at least 1 plugin-cfg.xml file to merge.");
739720

740721
PluginMergeToolImpl toolInstance = new PluginMergeToolImpl();
741-
742722
sharedPlugins = new ArrayList<PluginInfo>(); // Needed in order to not add unnecessary server clusters
743723

744724
List<String> filesList = toolInstance.loadParms(argv);
745725
String mergeFileName = filesList.remove(filesList.size() - 1);
746-
String[] fileList = filesList.toArray(new String[filesList.size()]);
747-
// plugins = new PluginInfo[fileList.length];
748-
try {
726+
String[] fileList = filesList.toArray(new String[filesList.size()]); try {
749727
Tr.info(traceComponent, "Merging...");
750728
fileList = toolInstance.sortFiles(fileList, FILEINFO_SMALL_TO_LARGE_COMPARATOR);
751729
toolInstance.loadData(fileList);

0 commit comments

Comments
 (0)