@@ -164,8 +164,43 @@ public static boolean validatePatches(List<String> patches, String category, Str
164
164
165
165
try {
166
166
NodeList conflictSets = XPathUtil .applyXPathReturnNodeList (result , "/conflict_sets" );
167
- if (conflictSets .getLength () == 0 )
167
+ if (conflictSets .getLength () == 0 ) {
168
+
169
+
170
+ try {
171
+ String expression = "/conflict_check/conflict_sets/set/merge_patches" ;
172
+
173
+ NodeList nodeList = XPathUtil .applyXPathReturnNodeList (result , expression );
174
+
175
+ DocumentBuilderFactory dbf = DocumentBuilderFactory .newInstance ();
176
+ DocumentBuilder builder = dbf .newDocumentBuilder ();
177
+ Document doc = builder .newDocument ();
178
+ Element element = doc .createElement ("conflict_check_results" );
179
+
180
+ for (int i = 0 ; i < nodeList .getLength (); i ++) {
181
+ Node n = nodeList .item (i );
182
+ Node copyNode = doc .importNode (n , true );
183
+
184
+ if (n instanceof Element )
185
+ element .appendChild (copyNode );
186
+ }
187
+
188
+ doc .appendChild (element );
189
+ System .out .println ("===================================================" );
190
+ System .out .println ("There are conflicts between the patches requested:-" );
191
+ System .out .println ("===================================================" );
192
+ System .out .println ("" );
193
+ XPathUtil .prettyPrint (doc );
194
+
168
195
return true ;
196
+
197
+
198
+ } catch (XPathExpressionException | ParserConfigurationException xpe ) {
199
+ throw new IOException (xpe );
200
+ }
201
+
202
+ }
203
+
169
204
} catch (XPathExpressionException xpe ) {
170
205
throw new IOException (xpe );
171
206
0 commit comments