Utilities.java

1
/*
2
 * $Id: Utilities.java 3514 2008-06-27 09:26:36Z blowagie $
3
 *
4
 * Copyright 2007 by Bruno Lowagie.
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * (the "License"); you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
9
 *
10
 * Software distributed under the License is distributed on an "AS IS" basis,
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 * for the specific language governing rights and limitations under the License.
13
 *
14
 * The Original Code is 'iText, a free JAVA-PDF library'.
15
 *
16
 * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by
17
 * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie.
18
 * All Rights Reserved.
19
 * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer
20
 * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved.
21
 *
22
 * Contributor(s): all the names of the contributors are added in the source code
23
 * where applicable.
24
 *
25
 * Alternatively, the contents of this file may be used under the terms of the
26
 * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
27
 * provisions of LGPL are applicable instead of those above.  If you wish to
28
 * allow use of your version of this file only under the terms of the LGPL
29
 * License and not to allow others to use your version of this file under
30
 * the MPL, indicate your decision by deleting the provisions above and
31
 * replace them with the notice and other provisions required by the LGPL.
32
 * If you do not delete the provisions above, a recipient may use your version
33
 * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE.
34
 *
35
 * This library is free software; you can redistribute it and/or modify it
36
 * under the terms of the MPL as stated above or under the terms of the GNU
37
 * Library General Public License as published by the Free Software Foundation;
38
 * either version 2 of the License, or any later version.
39
 *
40
 * This library is distributed in the hope that it will be useful, but WITHOUT
41
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
42
 * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more
43
 * details.
44
 *
45
 * If you didn't download this code from the following link, you should check if
46
 * you aren't using an obsolete version:
47
 * http://www.lowagie.com/iText/
48
 */
49
package com.lowagie.text;
50
51
import java.io.ByteArrayOutputStream;
52
import java.io.File;
53
import java.io.IOException;
54
import java.io.InputStream;
55
import java.net.MalformedURLException;
56
import java.net.URL;
57
import java.util.Collections;
58
import java.util.Hashtable;
59
import java.util.Properties;
60
import java.util.Set;
61
62
import com.lowagie.text.pdf.PRTokeniser;
63
64
/**
65
 * A collection of convenience methods that were present in many different iText
66
 * classes.
67
 */
68
69
public class Utilities {
70
71
    /**
72
     * Gets the keys of a Hashtable
73
     * 
74
     * @param table
75
     *            a Hashtable
76
     * @return the keyset of a Hashtable (or an empty set if table is null)
77
     */
78
    public static Set getKeySet(Hashtable table) {
79 2 1. getKeySet : negated conditional → NO_COVERAGE
2. getKeySet : mutated return of Object value for com/lowagie/text/Utilities::getKeySet to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return (table == null) ? Collections.EMPTY_SET : table.keySet();
80
    }
81
82
    /**
83
     * Utility method to extend an array.
84
     * 
85
     * @param original
86
     *            the original array or <CODE>null</CODE>
87
     * @param item
88
     *            the item to be added to the array
89
     * @return a new array with the item appended
90
     */
91
    public static Object[][] addToArray(Object[][] original, Object[] item) {
92 1 1. addToArray : negated conditional → NO_COVERAGE
        if (original == null) {
93
            original = new Object[1][];
94
            original[0] = item;
95 1 1. addToArray : mutated return of Object value for com/lowagie/text/Utilities::addToArray to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return original;
96
        } else {
97 1 1. addToArray : Replaced integer addition with subtraction → NO_COVERAGE
            Object[][] original2 = new Object[original.length + 1][];
98 1 1. addToArray : removed call to java/lang/System::arraycopy → NO_COVERAGE
            System.arraycopy(original, 0, original2, 0, original.length);
99
            original2[original.length] = item;
100 1 1. addToArray : mutated return of Object value for com/lowagie/text/Utilities::addToArray to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return original2;
101
        }
102
    }
103
104
    /**
105
     * Checks for a true/false value of a key in a Properties object.
106
     * @param attributes
107
     * @param key
108
     * @return a true/false value of a key in a Properties object
109
     */
110
    public static boolean checkTrueOrFalse(Properties attributes, String key) {
111 1 1. checkTrueOrFalse : replaced return of integer sized value with (x == 0 ? 1 : 0) → SURVIVED
        return "true".equalsIgnoreCase(attributes.getProperty(key));
112
    }
113
114
    /**
115
     * Unescapes an URL. All the "%xx" are replaced by the 'xx' hex char value.
116
     * @param src the url to unescape
117
     * @return the unescaped value
118
     */    
119
    public static String unEscapeURL(String src) {
120
        StringBuilder bf = new StringBuilder();
121
        char[] s = src.toCharArray();
122 3 1. unEscapeURL : changed conditional boundary → NO_COVERAGE
2. unEscapeURL : Changed increment from 1 to -1 → NO_COVERAGE
3. unEscapeURL : negated conditional → NO_COVERAGE
        for (int k = 0; k < s.length; ++k) {
123
            char c = s[k];
124 1 1. unEscapeURL : negated conditional → NO_COVERAGE
            if (c == '%') {
125 3 1. unEscapeURL : changed conditional boundary → NO_COVERAGE
2. unEscapeURL : Replaced integer addition with subtraction → NO_COVERAGE
3. unEscapeURL : negated conditional → NO_COVERAGE
                if (k + 2 >= s.length) {
126
                    bf.append(c);
127
                    continue;
128
                }
129 1 1. unEscapeURL : Replaced integer addition with subtraction → NO_COVERAGE
                int a0 = PRTokeniser.getHex(s[k + 1]);
130 1 1. unEscapeURL : Replaced integer addition with subtraction → NO_COVERAGE
                int a1 = PRTokeniser.getHex(s[k + 2]);
131 4 1. unEscapeURL : changed conditional boundary → NO_COVERAGE
2. unEscapeURL : changed conditional boundary → NO_COVERAGE
3. unEscapeURL : negated conditional → NO_COVERAGE
4. unEscapeURL : negated conditional → NO_COVERAGE
                if (a0 < 0 || a1 < 0) {
132
                    bf.append(c);
133
                    continue;
134
                }
135 2 1. unEscapeURL : Replaced integer multiplication with division → NO_COVERAGE
2. unEscapeURL : Replaced integer addition with subtraction → NO_COVERAGE
                bf.append((char)(a0 * 16 + a1));
136 1 1. unEscapeURL : Changed increment from 2 to -2 → NO_COVERAGE
                k += 2;
137
            }
138
            else
139
                bf.append(c);
140
        }
141 1 1. unEscapeURL : mutated return of Object value for com/lowagie/text/Utilities::unEscapeURL to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return bf.toString();
142
    }
143
144
    /**
145
     * This method makes a valid URL from a given filename.
146
     * <P>
147
     * This method makes the conversion of this library from the JAVA 2 platform
148
     * to a JDK1.1.x-version easier.
149
     * 
150
     * @param filename
151
     *            a given filename
152
     * @return a valid URL
153
     * @throws MalformedURLException
154
     */
155
    public static URL toURL(String filename) throws MalformedURLException {
156
        try {
157 1 1. toURL : mutated return of Object value for com/lowagie/text/Utilities::toURL to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return new URL(filename);
158
        }
159
        catch (Exception e) {
160 1 1. toURL : mutated return of Object value for com/lowagie/text/Utilities::toURL to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return new File(filename).toURI().toURL();
161
        }
162
    }
163
164
    /**
165
     * This method is an alternative for the <CODE>InputStream.skip()</CODE>
166
     * -method that doesn't seem to work properly for big values of <CODE>size
167
     * </CODE>.
168
     * 
169
     * @param is
170
     *            the <CODE>InputStream</CODE>
171
     * @param size
172
     *            the number of bytes to skip
173
     * @throws IOException
174
     */
175
    static public void skip(InputStream is, int size) throws IOException {
176
        long n;
177 2 1. skip : changed conditional boundary → NO_COVERAGE
2. skip : negated conditional → NO_COVERAGE
        while (size > 0) {
178
            n = is.skip(size);
179 2 1. skip : changed conditional boundary → NO_COVERAGE
2. skip : negated conditional → NO_COVERAGE
            if (n <= 0)
180
                break;
181 1 1. skip : Replaced long subtraction with addition → NO_COVERAGE
            size -= n;
182
        }
183
    }
184
    
185
    /**
186
     * Measurement conversion from millimeters to points.
187
     * @param    value    a value in millimeters
188
     * @return    a value in points
189
     * @since    2.1.2
190
     */
191
    public static final float millimetersToPoints(float value) {
192 1 1. millimetersToPoints : replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::millimetersToPoints → NO_COVERAGE
        return inchesToPoints(millimetersToInches(value));
193
    }
194
195
    /**
196
     * Measurement conversion from millimeters to inches.
197
     * @param    value    a value in millimeters
198
     * @return    a value in inches
199
     * @since    2.1.2
200
     */
201
    public static final float millimetersToInches(float value) {
202 2 1. millimetersToInches : Replaced float division with multiplication → NO_COVERAGE
2. millimetersToInches : replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::millimetersToInches → NO_COVERAGE
        return value / 25.4f;
203
    }
204
205
    /**
206
     * Measurement conversion from points to millimeters.
207
     * @param    value    a value in points
208
     * @return    a value in millimeters
209
     * @since    2.1.2
210
     */
211
    public static final float pointsToMillimeters(float value) {
212 1 1. pointsToMillimeters : replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::pointsToMillimeters → NO_COVERAGE
        return inchesToMillimeters(pointsToInches(value));
213
    }
214
215
    /**
216
     * Measurement conversion from points to inches.
217
     * @param    value    a value in points
218
     * @return    a value in inches
219
     * @since    2.1.2
220
     */
221
    public static final float pointsToInches(float value) {
222 2 1. pointsToInches : Replaced float division with multiplication → NO_COVERAGE
2. pointsToInches : replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::pointsToInches → NO_COVERAGE
        return value / 72f;
223
    }
224
225
    /**
226
     * Measurement conversion from inches to millimeters.
227
     * @param    value    a value in inches
228
     * @return    a value in millimeters
229
     * @since    2.1.2
230
     */
231
    public static final float inchesToMillimeters(float value) {
232 2 1. inchesToMillimeters : Replaced float multiplication with division → NO_COVERAGE
2. inchesToMillimeters : replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::inchesToMillimeters → NO_COVERAGE
        return value * 25.4f;
233
    }
234
235
    /**
236
     * Measurement conversion from inches to points.
237
     * @param    value    a value in inches
238
     * @return    a value in points
239
     * @since    2.1.2
240
     */
241
    public static final float inchesToPoints(float value) {
242 2 1. inchesToPoints : Replaced float multiplication with division → NO_COVERAGE
2. inchesToPoints : replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::inchesToPoints → NO_COVERAGE
        return value * 72f;
243
    }
244
    
245
    /**
246
     * Check if the value of a character belongs to a certain interval
247
     * that indicates it's the higher part of a surrogate pair.
248
     * @param c    the character
249
     * @return    true if the character belongs to the interval
250
     * @since    2.1.2
251
     */
252
    public static boolean isSurrogateHigh(char c) {
253 5 1. isSurrogateHigh : changed conditional boundary → NO_COVERAGE
2. isSurrogateHigh : changed conditional boundary → NO_COVERAGE
3. isSurrogateHigh : negated conditional → NO_COVERAGE
4. isSurrogateHigh : negated conditional → NO_COVERAGE
5. isSurrogateHigh : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return c >= '\ud800' && c <= '\udbff';
254
    }
255
256
    /**
257
     * Check if the value of a character belongs to a certain interval
258
     * that indicates it's the lower part of a surrogate pair.
259
     * @param c    the character
260
     * @return    true if the character belongs to the interval
261
     * @since    2.1.2
262
     */
263
    public static boolean isSurrogateLow(char c) {
264 5 1. isSurrogateLow : changed conditional boundary → NO_COVERAGE
2. isSurrogateLow : changed conditional boundary → NO_COVERAGE
3. isSurrogateLow : negated conditional → NO_COVERAGE
4. isSurrogateLow : negated conditional → NO_COVERAGE
5. isSurrogateLow : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return c >= '\udc00' && c <= '\udfff';
265
    }
266
267
    /**
268
     * Checks if two subsequent characters in a String are
269
     * are the higher and the lower character in a surrogate
270
     * pair (and therefore eligible for conversion to a UTF 32 character).
271
     * @param text    the String with the high and low surrogate characters
272
     * @param idx    the index of the 'high' character in the pair
273
     * @return    true if the characters are surrogate pairs
274
     * @since    2.1.2
275
     */
276
    public static boolean isSurrogatePair(String text, int idx) {
277 5 1. isSurrogatePair : changed conditional boundary → NO_COVERAGE
2. isSurrogatePair : changed conditional boundary → NO_COVERAGE
3. isSurrogatePair : Replaced integer subtraction with addition → NO_COVERAGE
4. isSurrogatePair : negated conditional → NO_COVERAGE
5. isSurrogatePair : negated conditional → NO_COVERAGE
        if (idx < 0 || idx > text.length() - 2)
278 1 1. isSurrogatePair : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return false;
279 4 1. isSurrogatePair : Replaced integer addition with subtraction → NO_COVERAGE
2. isSurrogatePair : negated conditional → NO_COVERAGE
3. isSurrogatePair : negated conditional → NO_COVERAGE
4. isSurrogatePair : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return isSurrogateHigh(text.charAt(idx)) && isSurrogateLow(text.charAt(idx + 1));
280
    }
281
282
    /**
283
     * Checks if two subsequent characters in a character array are
284
     * are the higher and the lower character in a surrogate
285
     * pair (and therefore eligible for conversion to a UTF 32 character).
286
     * @param text    the character array with the high and low surrogate characters
287
     * @param idx    the index of the 'high' character in the pair
288
     * @return    true if the characters are surrogate pairs
289
     * @since    2.1.2
290
     */
291
    public static boolean isSurrogatePair(char[] text, int idx) {
292 5 1. isSurrogatePair : changed conditional boundary → NO_COVERAGE
2. isSurrogatePair : changed conditional boundary → NO_COVERAGE
3. isSurrogatePair : Replaced integer subtraction with addition → NO_COVERAGE
4. isSurrogatePair : negated conditional → NO_COVERAGE
5. isSurrogatePair : negated conditional → NO_COVERAGE
        if (idx < 0 || idx > text.length - 2)
293 1 1. isSurrogatePair : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
            return false;
294 4 1. isSurrogatePair : Replaced integer addition with subtraction → NO_COVERAGE
2. isSurrogatePair : negated conditional → NO_COVERAGE
3. isSurrogatePair : negated conditional → NO_COVERAGE
4. isSurrogatePair : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return isSurrogateHigh(text[idx]) && isSurrogateLow(text[idx + 1]);
295
    }
296
297
    /**
298
     * Returns the code point of a UTF32 character corresponding with
299
     * a high and a low surrogate value.
300
     * @param highSurrogate    the high surrogate value
301
     * @param lowSurrogate    the low surrogate value
302
     * @return    a code point value
303
     * @since    2.1.2
304
     */
305
    public static int convertToUtf32(char highSurrogate, char lowSurrogate) {
306 6 1. convertToUtf32 : Replaced integer subtraction with addition → NO_COVERAGE
2. convertToUtf32 : Replaced integer multiplication with division → NO_COVERAGE
3. convertToUtf32 : Replaced integer subtraction with addition → NO_COVERAGE
4. convertToUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
5. convertToUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
6. convertToUtf32 : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
         return (((highSurrogate - 0xd800) * 0x400) + (lowSurrogate - 0xdc00)) + 0x10000;
307
    }
308
309
    /**
310
     * Converts a unicode character in a character array to a UTF 32 code point value.
311
     * @param text    a character array that has the unicode character(s)
312
     * @param idx    the index of the 'high' character
313
     * @return    the code point value
314
     * @since    2.1.2
315
     */
316
    public static int convertToUtf32(char[] text, int idx) {
317 7 1. convertToUtf32 : Replaced integer subtraction with addition → NO_COVERAGE
2. convertToUtf32 : Replaced integer multiplication with division → NO_COVERAGE
3. convertToUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
4. convertToUtf32 : Replaced integer subtraction with addition → NO_COVERAGE
5. convertToUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
6. convertToUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
7. convertToUtf32 : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
         return (((text[idx] - 0xd800) * 0x400) + (text[idx + 1] - 0xdc00)) + 0x10000;
318
    }
319
320
    /**
321
     * Converts a unicode character in a String to a UTF32 code point value
322
     * @param text    a String that has the unicode character(s)
323
     * @param idx    the index of the 'high' character
324
     * @return    the codepoint value
325
     * @since    2.1.2
326
     */
327
    public static int convertToUtf32(String text, int idx) {
328 7 1. convertToUtf32 : Replaced integer subtraction with addition → NO_COVERAGE
2. convertToUtf32 : Replaced integer multiplication with division → NO_COVERAGE
3. convertToUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
4. convertToUtf32 : Replaced integer subtraction with addition → NO_COVERAGE
5. convertToUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
6. convertToUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
7. convertToUtf32 : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
         return (((text.charAt(idx) - 0xd800) * 0x400) + (text.charAt(idx + 1) - 0xdc00)) + 0x10000;
329
    }
330
331
    /**
332
     * Converts a UTF32 code point value to a String with the corresponding character(s).
333
     * @param codePoint    a Unicode value
334
     * @return    the corresponding characters in a String
335
     * @since    2.1.2
336
     */
337
    public static String convertFromUtf32(int codePoint) {
338 2 1. convertFromUtf32 : changed conditional boundary → NO_COVERAGE
2. convertFromUtf32 : negated conditional → NO_COVERAGE
        if (codePoint < 0x10000)
339 1 1. convertFromUtf32 : mutated return of Object value for com/lowagie/text/Utilities::convertFromUtf32 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return Character.toString((char)codePoint);
340 1 1. convertFromUtf32 : Replaced integer subtraction with addition → NO_COVERAGE
        codePoint -= 0x10000;
341 5 1. convertFromUtf32 : Replaced integer division with multiplication → NO_COVERAGE
2. convertFromUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
3. convertFromUtf32 : Replaced integer modulus with multiplication → NO_COVERAGE
4. convertFromUtf32 : Replaced integer addition with subtraction → NO_COVERAGE
5. convertFromUtf32 : mutated return of Object value for com/lowagie/text/Utilities::convertFromUtf32 to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new String(new char[]{(char)((codePoint / 0x400) + 0xd800), (char)((codePoint % 0x400) + 0xdc00)});
342
    }
343
344
    /**
345
     * Reads an input stream to a byte array.
346
     *
347
     * Similar as IOUtils.toByteArray.
348
     *
349
     * By evernat on Github.
350
     *
351
     * @param is
352
     * @return byte[]
353
     * @throws IOException
354
     */
355
    public static byte[] toByteArray(InputStream is) throws IOException {
356
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
357
358
        int nRead;
359
        byte[] data = new byte[16384];
360
361 1 1. toByteArray : negated conditional → NO_COVERAGE
        while ((nRead = is.read(data, 0, data.length)) != -1) {
362 1 1. toByteArray : removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE
            buffer.write(data, 0, nRead);
363
        }
364
365 1 1. toByteArray : mutated return of Object value for com/lowagie/text/Utilities::toByteArray to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return buffer.toByteArray();
366
    }
367
368
}

Mutations

79

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

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

92

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

95

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

97

1.1
Location : addToArray
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

98

1.1
Location : addToArray
Killed by : none
removed call to java/lang/System::arraycopy → NO_COVERAGE

100

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

111

1.1
Location : checkTrueOrFalse
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → SURVIVED

122

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

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

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

124

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

125

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

2.2
Location : unEscapeURL
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

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

129

1.1
Location : unEscapeURL
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

130

1.1
Location : unEscapeURL
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

131

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

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

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

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

135

1.1
Location : unEscapeURL
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

2.2
Location : unEscapeURL
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

136

1.1
Location : unEscapeURL
Killed by : none
Changed increment from 2 to -2 → NO_COVERAGE

141

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

157

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

160

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

177

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

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

179

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

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

181

1.1
Location : skip
Killed by : none
Replaced long subtraction with addition → NO_COVERAGE

192

1.1
Location : millimetersToPoints
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::millimetersToPoints → NO_COVERAGE

202

1.1
Location : millimetersToInches
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

2.2
Location : millimetersToInches
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::millimetersToInches → NO_COVERAGE

212

1.1
Location : pointsToMillimeters
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::pointsToMillimeters → NO_COVERAGE

222

1.1
Location : pointsToInches
Killed by : none
Replaced float division with multiplication → NO_COVERAGE

2.2
Location : pointsToInches
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::pointsToInches → NO_COVERAGE

232

1.1
Location : inchesToMillimeters
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : inchesToMillimeters
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::inchesToMillimeters → NO_COVERAGE

242

1.1
Location : inchesToPoints
Killed by : none
Replaced float multiplication with division → NO_COVERAGE

2.2
Location : inchesToPoints
Killed by : none
replaced return of float value with -(x + 1) for com/lowagie/text/Utilities::inchesToPoints → NO_COVERAGE

253

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

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

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

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

5.5
Location : isSurrogateHigh
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

264

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

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

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

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

5.5
Location : isSurrogateLow
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

277

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

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

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

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

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

278

1.1
Location : isSurrogatePair
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

279

1.1
Location : isSurrogatePair
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

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

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

4.4
Location : isSurrogatePair
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

292

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

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

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

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

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

293

1.1
Location : isSurrogatePair
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

294

1.1
Location : isSurrogatePair
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

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

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

4.4
Location : isSurrogatePair
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

306

1.1
Location : convertToUtf32
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : convertToUtf32
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

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

4.4
Location : convertToUtf32
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

5.5
Location : convertToUtf32
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

6.6
Location : convertToUtf32
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

317

1.1
Location : convertToUtf32
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : convertToUtf32
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

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

4.4
Location : convertToUtf32
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

5.5
Location : convertToUtf32
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

6.6
Location : convertToUtf32
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

7.7
Location : convertToUtf32
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

328

1.1
Location : convertToUtf32
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

2.2
Location : convertToUtf32
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

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

4.4
Location : convertToUtf32
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

5.5
Location : convertToUtf32
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

6.6
Location : convertToUtf32
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

7.7
Location : convertToUtf32
Killed by : none
replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE

338

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

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

339

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

340

1.1
Location : convertFromUtf32
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

341

1.1
Location : convertFromUtf32
Killed by : none
Replaced integer division with multiplication → NO_COVERAGE

2.2
Location : convertFromUtf32
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

3.3
Location : convertFromUtf32
Killed by : none
Replaced integer modulus with multiplication → NO_COVERAGE

4.4
Location : convertFromUtf32
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

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

361

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

362

1.1
Location : toByteArray
Killed by : none
removed call to java/io/ByteArrayOutputStream::write → NO_COVERAGE

365

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

Active mutators

Tests examined


Report generated by PIT 1.4.2