XmlDomWriter.java

1
/*
2
 * Copyright 1999-2005 The Apache Software Foundation.
3
 * 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 * 
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 * 
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
17
package com.lowagie.text.xml;
18
19
import java.io.OutputStream;
20
import java.io.OutputStreamWriter;
21
import java.io.PrintWriter;
22
import java.io.UnsupportedEncodingException;
23
24
import org.w3c.dom.Attr;
25
import org.w3c.dom.Document;
26
import org.w3c.dom.DocumentType;
27
import org.w3c.dom.NamedNodeMap;
28
import org.w3c.dom.Node;
29
30
/**
31
 *
32
 * @author psoares
33
 */
34
public class XmlDomWriter {
35
    
36
    /** Print writer. */
37
    protected PrintWriter fOut;
38
    
39
    /** Canonical output. */
40
    protected boolean fCanonical;
41
    
42
    /** Processing XML 1.1 document. */
43
    protected boolean fXML11;
44
    
45
    //
46
    // Constructors
47
    //
48
    
49
    /** Default constructor. */
50
    public XmlDomWriter() {
51
    } // <init>()
52
    
53
    public XmlDomWriter(boolean canonical) {
54
        fCanonical = canonical;
55
    } // <init>(boolean)
56
    
57
    //
58
    // Public methods
59
    //
60
    
61
    /** Sets whether output is canonical. */
62
    public void setCanonical(boolean canonical) {
63
        fCanonical = canonical;
64
    } // setCanonical(boolean)
65
    
66
    /** Sets the output stream for printing. */
67
    public void setOutput(OutputStream stream, String encoding)
68
    throws UnsupportedEncodingException {
69
        
70 1 1. setOutput : negated conditional → NO_COVERAGE
        if (encoding == null) {
71
            encoding = "UTF8";
72
        }
73
        
74
        java.io.Writer writer = new OutputStreamWriter(stream, encoding);
75
        fOut = new PrintWriter(writer);
76
        
77
    } // setOutput(OutputStream,String)
78
    
79
    /** Sets the output writer. */
80
    public void setOutput(java.io.Writer writer) {
81
        
82 1 1. setOutput : negated conditional → NO_COVERAGE
        fOut = writer instanceof PrintWriter
83
                ? (PrintWriter)writer : new PrintWriter(writer);
84
        
85
    } // setOutput(java.io.Writer)
86
    
87
    /** Writes the specified node, recursively. */
88
    public void write(Node node) {
89
        
90
        // is there anything to do?
91 1 1. write : negated conditional → NO_COVERAGE
        if (node == null) {
92
            return;
93
        }
94
        
95
        short type = node.getNodeType();
96
        switch (type) {
97
            case Node.DOCUMENT_NODE: {
98
                Document document = (Document)node;
99
                fXML11 = false; //"1.1".equals(getVersion(document));
100 1 1. write : negated conditional → NO_COVERAGE
                if (!fCanonical) {
101 1 1. write : negated conditional → NO_COVERAGE
                    if (fXML11) {
102 1 1. write : removed call to java/io/PrintWriter::println → NO_COVERAGE
                        fOut.println("<?xml version=\"1.1\" encoding=\"UTF-8\"?>");
103
                    } else {
104 1 1. write : removed call to java/io/PrintWriter::println → NO_COVERAGE
                        fOut.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
105
                    }
106 1 1. write : removed call to java/io/PrintWriter::flush → NO_COVERAGE
                    fOut.flush();
107 1 1. write : removed call to com/lowagie/text/xml/XmlDomWriter::write → NO_COVERAGE
                    write(document.getDoctype());
108
                }
109 1 1. write : removed call to com/lowagie/text/xml/XmlDomWriter::write → NO_COVERAGE
                write(document.getDocumentElement());
110
                break;
111
            }
112
            
113
            case Node.DOCUMENT_TYPE_NODE: {
114
                DocumentType doctype = (DocumentType)node;
115 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print("<!DOCTYPE ");
116 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print(doctype.getName());
117
                String publicId = doctype.getPublicId();
118
                String systemId = doctype.getSystemId();
119 1 1. write : negated conditional → NO_COVERAGE
                if (publicId != null) {
120 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(" PUBLIC '");
121 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(publicId);
122 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("' '");
123 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(systemId);
124 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print('\'');
125 1 1. write : negated conditional → NO_COVERAGE
                } else if (systemId != null) {
126 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(" SYSTEM '");
127 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(systemId);
128 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print('\'');
129
                }
130
                String internalSubset = doctype.getInternalSubset();
131 1 1. write : negated conditional → NO_COVERAGE
                if (internalSubset != null) {
132 1 1. write : removed call to java/io/PrintWriter::println → NO_COVERAGE
                    fOut.println(" [");
133 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(internalSubset);
134 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(']');
135
                }
136 1 1. write : removed call to java/io/PrintWriter::println → NO_COVERAGE
                fOut.println('>');
137
                break;
138
            }
139
            
140
            case Node.ELEMENT_NODE: {
141 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print('<');
142 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print(node.getNodeName());
143
                Attr[] attrs = sortAttributes(node.getAttributes());
144
                for (Attr attr : attrs) {
145 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(' ');
146 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(attr.getNodeName());
147 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("=\"");
148 1 1. write : removed call to com/lowagie/text/xml/XmlDomWriter::normalizeAndPrint → NO_COVERAGE
                    normalizeAndPrint(attr.getNodeValue(), true);
149 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print('"');
150
                }
151 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print('>');
152 1 1. write : removed call to java/io/PrintWriter::flush → NO_COVERAGE
                fOut.flush();
153
                
154
                Node child = node.getFirstChild();
155 1 1. write : negated conditional → NO_COVERAGE
                while (child != null) {
156 1 1. write : removed call to com/lowagie/text/xml/XmlDomWriter::write → NO_COVERAGE
                    write(child);
157
                    child = child.getNextSibling();
158
                }
159
                break;
160
            }
161
            
162
            case Node.ENTITY_REFERENCE_NODE: {
163 1 1. write : negated conditional → NO_COVERAGE
                if (fCanonical) {
164
                    Node child = node.getFirstChild();
165 1 1. write : negated conditional → NO_COVERAGE
                    while (child != null) {
166 1 1. write : removed call to com/lowagie/text/xml/XmlDomWriter::write → NO_COVERAGE
                        write(child);
167
                        child = child.getNextSibling();
168
                    }
169
                } else {
170 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print('&');
171 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(node.getNodeName());
172 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(';');
173 1 1. write : removed call to java/io/PrintWriter::flush → NO_COVERAGE
                    fOut.flush();
174
                }
175
                break;
176
            }
177
            
178
            case Node.CDATA_SECTION_NODE: {
179 1 1. write : negated conditional → NO_COVERAGE
                if (fCanonical) {
180 1 1. write : removed call to com/lowagie/text/xml/XmlDomWriter::normalizeAndPrint → NO_COVERAGE
                    normalizeAndPrint(node.getNodeValue(), false);
181
                } else {
182 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("<![CDATA[");
183 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(node.getNodeValue());
184 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("]]>");
185
                }
186 1 1. write : removed call to java/io/PrintWriter::flush → NO_COVERAGE
                fOut.flush();
187
                break;
188
            }
189
            
190
            case Node.TEXT_NODE: {
191 1 1. write : removed call to com/lowagie/text/xml/XmlDomWriter::normalizeAndPrint → NO_COVERAGE
                normalizeAndPrint(node.getNodeValue(), false);
192 1 1. write : removed call to java/io/PrintWriter::flush → NO_COVERAGE
                fOut.flush();
193
                break;
194
            }
195
            
196
            case Node.PROCESSING_INSTRUCTION_NODE: {
197 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print("<?");
198 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print(node.getNodeName());
199
                String data = node.getNodeValue();
200 3 1. write : changed conditional boundary → NO_COVERAGE
2. write : negated conditional → NO_COVERAGE
3. write : negated conditional → NO_COVERAGE
                if (data != null && data.length() > 0) {
201 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(' ');
202 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(data);
203
                }
204 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print("?>");
205 1 1. write : removed call to java/io/PrintWriter::flush → NO_COVERAGE
                fOut.flush();
206
                break;
207
            }
208
            
209
            case Node.COMMENT_NODE: {
210 1 1. write : negated conditional → NO_COVERAGE
                if (!fCanonical) {
211 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("<!--");
212
                    String comment = node.getNodeValue();
213 3 1. write : changed conditional boundary → NO_COVERAGE
2. write : negated conditional → NO_COVERAGE
3. write : negated conditional → NO_COVERAGE
                    if (comment != null && comment.length() > 0) {
214 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                        fOut.print(comment);
215
                    }
216 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("-->");
217 1 1. write : removed call to java/io/PrintWriter::flush → NO_COVERAGE
                    fOut.flush();
218
                }
219
            }
220
        }
221
        
222 1 1. write : negated conditional → NO_COVERAGE
        if (type == Node.ELEMENT_NODE) {
223 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
            fOut.print("</");
224 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
            fOut.print(node.getNodeName());
225 1 1. write : removed call to java/io/PrintWriter::print → NO_COVERAGE
            fOut.print('>');
226 1 1. write : removed call to java/io/PrintWriter::flush → NO_COVERAGE
            fOut.flush();
227
        }
228
        
229
    } // write(Node)
230
    
231
    /** Returns a sorted list of attributes. */
232
    protected Attr[] sortAttributes(NamedNodeMap attrs) {
233
        
234 1 1. sortAttributes : negated conditional → NO_COVERAGE
        int len = (attrs != null) ? attrs.getLength() : 0;
235
        Attr[] array = new Attr[len];
236 3 1. sortAttributes : changed conditional boundary → NO_COVERAGE
2. sortAttributes : Changed increment from 1 to -1 → NO_COVERAGE
3. sortAttributes : negated conditional → NO_COVERAGE
        for (int i = 0; i < len; i++) {
237
            array[i] = (Attr)attrs.item(i);
238
        }
239 4 1. sortAttributes : changed conditional boundary → NO_COVERAGE
2. sortAttributes : Changed increment from 1 to -1 → NO_COVERAGE
3. sortAttributes : Replaced integer subtraction with addition → NO_COVERAGE
4. sortAttributes : negated conditional → NO_COVERAGE
        for (int i = 0; i < len - 1; i++) {
240
            String name = array[i].getNodeName();
241
            int index = i;
242 4 1. sortAttributes : changed conditional boundary → NO_COVERAGE
2. sortAttributes : Changed increment from 1 to -1 → NO_COVERAGE
3. sortAttributes : Replaced integer addition with subtraction → NO_COVERAGE
4. sortAttributes : negated conditional → NO_COVERAGE
            for (int j = i + 1; j < len; j++) {
243
                String curName = array[j].getNodeName();
244 2 1. sortAttributes : changed conditional boundary → NO_COVERAGE
2. sortAttributes : negated conditional → NO_COVERAGE
                if (curName.compareTo(name) < 0) {
245
                    name = curName;
246
                    index = j;
247
                }
248
            }
249 1 1. sortAttributes : negated conditional → NO_COVERAGE
            if (index != i) {
250
                Attr temp = array[i];
251
                array[i] = array[index];
252
                array[index] = temp;
253
            }
254
        }
255
        
256 1 1. sortAttributes : mutated return of Object value for com/lowagie/text/xml/XmlDomWriter::sortAttributes to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return array;
257
        
258
    } // sortAttributes(NamedNodeMap):Attr[]
259
    
260
    //
261
    // Protected methods
262
    //
263
    
264
    /** Normalizes and prints the given string. */
265
    protected void normalizeAndPrint(String s, boolean isAttValue) {
266
        
267 1 1. normalizeAndPrint : negated conditional → NO_COVERAGE
        int len = (s != null) ? s.length() : 0;
268 3 1. normalizeAndPrint : changed conditional boundary → NO_COVERAGE
2. normalizeAndPrint : Changed increment from 1 to -1 → NO_COVERAGE
3. normalizeAndPrint : negated conditional → NO_COVERAGE
        for (int i = 0; i < len; i++) {
269
            char c = s.charAt(i);
270 1 1. normalizeAndPrint : removed call to com/lowagie/text/xml/XmlDomWriter::normalizeAndPrint → NO_COVERAGE
            normalizeAndPrint(c, isAttValue);
271
        }
272
        
273
    } // normalizeAndPrint(String,boolean)
274
    
275
    /** Normalizes and print the given character. */
276
    protected void normalizeAndPrint(char c, boolean isAttValue) {
277
        
278
        switch (c) {
279
            case '<': {
280 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print("&lt;");
281
                break;
282
            }
283
            case '>': {
284 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print("&gt;");
285
                break;
286
            }
287
            case '&': {
288 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print("&amp;");
289
                break;
290
            }
291
            case '"': {
292
                // A '"' that appears in character data
293
                // does not need to be escaped.
294 1 1. normalizeAndPrint : negated conditional → NO_COVERAGE
                if (isAttValue) {
295 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("&quot;");
296
                } else {
297 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("\"");
298
                }
299
                break;
300
            }
301
            case '\r': {
302
                // If CR is part of the document's content, it
303
                // must not be printed as a literal otherwise
304
                // it would be normalized to LF when the document
305
                // is reparsed.
306 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                fOut.print("&#xD;");
307
                break;
308
            }
309
            case '\n': {
310 1 1. normalizeAndPrint : negated conditional → NO_COVERAGE
                if (fCanonical) {
311 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("&#xA;");
312
                    break;
313
                }
314
                // else, default print char
315
            }
316
            default: {
317
                // In XML 1.1, control chars in the ranges [#x1-#x1F, #x7F-#x9F] must be escaped.
318
                //
319
                // Escape space characters that would be normalized to #x20 in attribute values
320
                // when the document is reparsed.
321
                //
322
                // Escape NEL (0x85) and LSEP (0x2028) that appear in content
323
                // if the document is XML 1.1, since they would be normalized to LF
324
                // when the document is reparsed.
325 15 1. normalizeAndPrint : changed conditional boundary → NO_COVERAGE
2. normalizeAndPrint : changed conditional boundary → NO_COVERAGE
3. normalizeAndPrint : changed conditional boundary → NO_COVERAGE
4. normalizeAndPrint : changed conditional boundary → NO_COVERAGE
5. normalizeAndPrint : negated conditional → NO_COVERAGE
6. normalizeAndPrint : negated conditional → NO_COVERAGE
7. normalizeAndPrint : negated conditional → NO_COVERAGE
8. normalizeAndPrint : negated conditional → NO_COVERAGE
9. normalizeAndPrint : negated conditional → NO_COVERAGE
10. normalizeAndPrint : negated conditional → NO_COVERAGE
11. normalizeAndPrint : negated conditional → NO_COVERAGE
12. normalizeAndPrint : negated conditional → NO_COVERAGE
13. normalizeAndPrint : negated conditional → NO_COVERAGE
14. normalizeAndPrint : negated conditional → NO_COVERAGE
15. normalizeAndPrint : negated conditional → NO_COVERAGE
                if (fXML11 && ((c >= 0x01 && c <= 0x1F && c != 0x09 && c != 0x0A)
326
                || (c >= 0x7F && c <= 0x9F) || c == 0x2028)
327
                || isAttValue && (c == 0x09 || c == 0x0A)) {
328 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print("&#x");
329 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(Integer.toHexString(c).toUpperCase());
330 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(";");
331
                } else {
332 1 1. normalizeAndPrint : removed call to java/io/PrintWriter::print → NO_COVERAGE
                    fOut.print(c);
333
                }
334
            }
335
        }
336
    } // normalizeAndPrint(char,boolean)
337
    
338
    /** Extracts the XML version from the Document. */
339
//    protected String getVersion(Document document) {
340
//        if (document == null) {
341
//            return null;
342
//        }
343
//        String version = null;
344
//        Method getXMLVersion = null;
345
//        try {
346
//            getXMLVersion = document.getClass().getMethod("getXmlVersion", new Class[]{});
347
//            // If Document class implements DOM L3, this method will exist.
348
//            if (getXMLVersion != null) {
349
//                version = (String) getXMLVersion.invoke(document, (Object[]) null);
350
//            }
351
//        } catch (Exception e) {
352
//            // Either this locator object doesn't have
353
//            // this method, or we're on an old JDK.
354
//        }
355
//        return version;
356
//    } // getVersion(Document)
357
}

Mutations

70

1.1
Location : setOutput
Killed by : none
negated conditional → NO_COVERAGE

82

1.1
Location : setOutput
Killed by : none
negated conditional → NO_COVERAGE

91

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

100

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

101

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

102

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::println → NO_COVERAGE

104

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::println → NO_COVERAGE

106

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::flush → NO_COVERAGE

107

1.1
Location : write
Killed by : none
removed call to com/lowagie/text/xml/XmlDomWriter::write → NO_COVERAGE

109

1.1
Location : write
Killed by : none
removed call to com/lowagie/text/xml/XmlDomWriter::write → NO_COVERAGE

115

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

116

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

119

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

120

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

121

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

122

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

123

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

124

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

125

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

126

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

127

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

128

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

131

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

132

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::println → NO_COVERAGE

133

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

134

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

136

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::println → NO_COVERAGE

141

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

142

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

145

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

146

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

147

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

148

1.1
Location : write
Killed by : none
removed call to com/lowagie/text/xml/XmlDomWriter::normalizeAndPrint → NO_COVERAGE

149

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

151

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

152

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::flush → NO_COVERAGE

155

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

156

1.1
Location : write
Killed by : none
removed call to com/lowagie/text/xml/XmlDomWriter::write → NO_COVERAGE

163

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

165

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

166

1.1
Location : write
Killed by : none
removed call to com/lowagie/text/xml/XmlDomWriter::write → NO_COVERAGE

170

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

171

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

172

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

173

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::flush → NO_COVERAGE

179

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

180

1.1
Location : write
Killed by : none
removed call to com/lowagie/text/xml/XmlDomWriter::normalizeAndPrint → NO_COVERAGE

182

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

183

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

184

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

186

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::flush → NO_COVERAGE

191

1.1
Location : write
Killed by : none
removed call to com/lowagie/text/xml/XmlDomWriter::normalizeAndPrint → NO_COVERAGE

192

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::flush → NO_COVERAGE

197

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

198

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

200

1.1
Location : write
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : write
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : write
Killed by : none
negated conditional → NO_COVERAGE

201

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

202

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

204

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

205

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::flush → NO_COVERAGE

210

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

211

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

213

1.1
Location : write
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : write
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : write
Killed by : none
negated conditional → NO_COVERAGE

214

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

216

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

217

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::flush → NO_COVERAGE

222

1.1
Location : write
Killed by : none
negated conditional → NO_COVERAGE

223

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

224

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

225

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

226

1.1
Location : write
Killed by : none
removed call to java/io/PrintWriter::flush → NO_COVERAGE

234

1.1
Location : sortAttributes
Killed by : none
negated conditional → NO_COVERAGE

236

1.1
Location : sortAttributes
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : sortAttributes
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : sortAttributes
Killed by : none
negated conditional → NO_COVERAGE

239

1.1
Location : sortAttributes
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : sortAttributes
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : sortAttributes
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

4.4
Location : sortAttributes
Killed by : none
negated conditional → NO_COVERAGE

242

1.1
Location : sortAttributes
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : sortAttributes
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : sortAttributes
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

4.4
Location : sortAttributes
Killed by : none
negated conditional → NO_COVERAGE

244

1.1
Location : sortAttributes
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : sortAttributes
Killed by : none
negated conditional → NO_COVERAGE

249

1.1
Location : sortAttributes
Killed by : none
negated conditional → NO_COVERAGE

256

1.1
Location : sortAttributes
Killed by : none
mutated return of Object value for com/lowagie/text/xml/XmlDomWriter::sortAttributes to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

267

1.1
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

268

1.1
Location : normalizeAndPrint
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : normalizeAndPrint
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

3.3
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

270

1.1
Location : normalizeAndPrint
Killed by : none
removed call to com/lowagie/text/xml/XmlDomWriter::normalizeAndPrint → NO_COVERAGE

280

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

284

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

288

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

294

1.1
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

295

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

297

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

306

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

310

1.1
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

311

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

325

1.1
Location : normalizeAndPrint
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : normalizeAndPrint
Killed by : none
changed conditional boundary → NO_COVERAGE

3.3
Location : normalizeAndPrint
Killed by : none
changed conditional boundary → NO_COVERAGE

4.4
Location : normalizeAndPrint
Killed by : none
changed conditional boundary → NO_COVERAGE

5.5
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

7.7
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

8.8
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

9.9
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

10.10
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

11.11
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

12.12
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

13.13
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

14.14
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

15.15
Location : normalizeAndPrint
Killed by : none
negated conditional → NO_COVERAGE

328

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

329

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

330

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

332

1.1
Location : normalizeAndPrint
Killed by : none
removed call to java/io/PrintWriter::print → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.4.2