|
16 | 16 | import java.io.FileInputStream;
|
17 | 17 | import java.io.FileOutputStream;
|
18 | 18 | import java.io.IOException;
|
19 |
| -import java.text.SimpleDateFormat; |
| 19 | +import java.time.ZonedDateTime; |
| 20 | +import java.time.format.DateTimeFormatter; |
20 | 21 | import java.util.ArrayList;
|
21 | 22 | import java.util.Arrays;
|
22 | 23 | import java.util.Collection;
|
23 | 24 | import java.util.Collections;
|
24 | 25 | import java.util.Comparator;
|
25 |
| -import java.util.Date; |
26 | 26 | import java.util.Enumeration;
|
27 | 27 | import java.util.HashSet;
|
28 | 28 | import java.util.Hashtable;
|
|
80 | 80 | public class PluginMergeToolImpl implements PluginMergeTool {
|
81 | 81 | private static final TraceComponent traceComponent = Tr.register(PluginMergeToolImpl.class);
|
82 | 82 | private static final String NO_MERGE_ERR = "Error encountered, no merged file was written";
|
| 83 | + private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("uuuu.MM.dd 'at' HH:mm:ss z"); |
| 84 | + |
83 | 85 |
|
84 | 86 | private boolean isXdOnly = true;
|
85 | 87 | private boolean debug = false;
|
@@ -191,7 +193,7 @@ private void printMergedCopy(String output) throws IOException, ParserConfigurat
|
191 | 193 | DocumentBuilder parser = dbf.newDocumentBuilder();
|
192 | 194 | Document mergeDoc = parser.newDocument();
|
193 | 195 | 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()) + " "); |
| 196 | + dateTimeFormatter.format(ZonedDateTime.now()) + " "); |
195 | 197 | mergeDoc.appendChild(comment);
|
196 | 198 |
|
197 | 199 | mergeDoc.appendChild(mergeDoc.importNode(mergeConfigNode, true));
|
@@ -255,24 +257,6 @@ private void printMergedCopy(String output) throws IOException, ParserConfigurat
|
255 | 257 | }
|
256 | 258 | }
|
257 | 259 |
|
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 |
| - |
276 | 260 | mergeConfigNode.appendChild(mergeDoc.createComment(" URI Groups "));
|
277 | 261 |
|
278 | 262 | Node[] uriGrps = null;
|
@@ -701,8 +685,7 @@ private boolean validateEach(String[] inputFiles, String mergeFileName) {
|
701 | 685 | break;
|
702 | 686 | }
|
703 | 687 | }
|
704 |
| - if (!passFail) |
705 |
| - break; |
| 688 | + if (!passFail) break; |
706 | 689 | }
|
707 | 690 | return passFail;
|
708 | 691 | }
|
@@ -734,17 +717,18 @@ protected PluginInfo[] getPluginsInfo() {
|
734 | 717 |
|
735 | 718 | @Override
|
736 | 719 | public void merge(String argv[]) {
|
| 720 | + System.out.println("Thread dumpstack:"); |
| 721 | + Thread.dumpStack(); |
| 722 | + |
737 | 723 | if (argv.length < 2)
|
738 | 724 | throw new IllegalArgumentException("Please provide at least 1 plugin-cfg.xml file to merge.");
|
739 | 725 |
|
740 | 726 | PluginMergeToolImpl toolInstance = new PluginMergeToolImpl();
|
741 |
| - |
742 | 727 | sharedPlugins = new ArrayList<PluginInfo>(); // Needed in order to not add unnecessary server clusters
|
743 | 728 |
|
744 | 729 | List<String> filesList = toolInstance.loadParms(argv);
|
745 | 730 | String mergeFileName = filesList.remove(filesList.size() - 1);
|
746 | 731 | String[] fileList = filesList.toArray(new String[filesList.size()]);
|
747 |
| - // plugins = new PluginInfo[fileList.length]; |
748 | 732 | try {
|
749 | 733 | Tr.info(traceComponent, "Merging...");
|
750 | 734 | fileList = toolInstance.sortFiles(fileList, FILEINFO_SMALL_TO_LARGE_COMPARATOR);
|
|
0 commit comments