AcroFields.java

1
/*
2
 * Copyright 2003-2005 by Paulo Soares.
3
 *
4
 * The contents of this file are subject to the Mozilla Public License Version 1.1
5
 * (the "License"); you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
7
 *
8
 * Software distributed under the License is distributed on an "AS IS" basis,
9
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
10
 * for the specific language governing rights and limitations under the License.
11
 *
12
 * The Original Code is 'iText, a free JAVA-PDF library'.
13
 *
14
 * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by
15
 * the Initial Developer are Copyright (C) 1999, 2000, 2001, 2002 by Bruno Lowagie.
16
 * All Rights Reserved.
17
 * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer
18
 * are Copyright (C) 2000, 2001, 2002 by Paulo Soares. All Rights Reserved.
19
 *
20
 * Contributor(s): all the names of the contributors are added in the source code
21
 * where applicable.
22
 *
23
 * Alternatively, the contents of this file may be used under the terms of the
24
 * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
25
 * provisions of LGPL are applicable instead of those above.  If you wish to
26
 * allow use of your version of this file only under the terms of the LGPL
27
 * License and not to allow others to use your version of this file under
28
 * the MPL, indicate your decision by deleting the provisions above and
29
 * replace them with the notice and other provisions required by the LGPL.
30
 * If you do not delete the provisions above, a recipient may use your version
31
 * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE.
32
 *
33
 * This library is free software; you can redistribute it and/or modify it
34
 * under the terms of the MPL as stated above or under the terms of the GNU
35
 * Library General Public License as published by the Free Software Foundation;
36
 * either version 2 of the License, or any later version.
37
 *
38
 * This library is distributed in the hope that it will be useful, but WITHOUT
39
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
40
 * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more
41
 * details.
42
 *
43
 * If you didn't download this code from the following link, you should check if
44
 * you aren't using an obsolete version:
45
 * http://www.lowagie.com/iText/
46
 */
47
package com.lowagie.text.pdf;
48
49
import java.awt.Color;
50
import java.io.IOException;
51
import java.io.InputStream;
52
import java.util.*;
53
54
import com.lowagie.text.error_messages.MessageLocalization;
55
56
import com.lowagie.text.ExceptionConverter;
57
import org.w3c.dom.Node;
58
59
import com.lowagie.text.DocumentException;
60
import com.lowagie.text.Element;
61
62
import com.lowagie.text.Image;
63
import com.lowagie.text.Rectangle;
64
65
/**
66
 * Query and change fields in existing documents either by method calls or by FDF merging.
67
 *
68
 * @author Paulo Soares (psoares@consiste.pt)
69
 */
70
public class AcroFields {
71
72
  PdfReader reader;
73
  PdfWriter writer;
74
  private Map<String, Item> fields;
75
  private int topFirst;
76
  private Map<String, int[]> sigNames;
77
  private boolean append;
78
  public static final int DA_FONT = 0;
79
  public static final int DA_SIZE = 1;
80
  public static final int DA_COLOR = 2;
81
  private final Map<Integer, BaseFont> extensionFonts = new HashMap<>();
82
  private XfaForm xfa;
83
84
  /**
85
   * A field type invalid or not found.
86
   */
87
  public static final int FIELD_TYPE_NONE = 0;
88
89
  /**
90
   * A field type.
91
   */
92
  public static final int FIELD_TYPE_PUSHBUTTON = 1;
93
94
  /**
95
   * A field type.
96
   */
97
  public static final int FIELD_TYPE_CHECKBOX = 2;
98
99
  /**
100
   * A field type.
101
   */
102
  public static final int FIELD_TYPE_RADIOBUTTON = 3;
103
104
  /**
105
   * A field type.
106
   */
107
  public static final int FIELD_TYPE_TEXT = 4;
108
109
  /**
110
   * A field type.
111
   */
112
  public static final int FIELD_TYPE_LIST = 5;
113
114
  /**
115
   * A field type.
116
   */
117
  public static final int FIELD_TYPE_COMBO = 6;
118
119
  /**
120
   * A field type.
121
   */
122
  public static final int FIELD_TYPE_SIGNATURE = 7;
123
124
  private boolean lastWasString;
125
126
  /**
127
   * Holds value of property generateAppearances.
128
   */
129
  private boolean generateAppearances = true;
130
131
  private Map<String, BaseFont> localFonts = new HashMap<>();
132
133
  private float extraMarginLeft;
134
  private float extraMarginTop;
135
  private List<BaseFont> substitutionFonts;
136
137
  AcroFields(PdfReader reader, PdfWriter writer) {
138
    this.reader = reader;
139
    this.writer = writer;
140
    try {
141
      xfa = new XfaForm(reader);
142
    } catch (Exception e) {
143
      throw new ExceptionConverter(e);
144
    }
145 1 1. : negated conditional → NO_COVERAGE
    if (writer instanceof PdfStamperImp) {
146
      append = ((PdfStamperImp) writer).isAppend();
147
    }
148 1 1. : removed call to com/lowagie/text/pdf/AcroFields::fill → NO_COVERAGE
    fill();
149
  }
150
151
  void fill() {
152
    fields = new HashMap<>();
153
    PdfDictionary top = (PdfDictionary) PdfReader.getPdfObjectRelease(reader.getCatalog().get(PdfName.ACROFORM));
154 1 1. fill : negated conditional → NO_COVERAGE
    if (top == null) {
155
      return;
156
    }
157
    PdfArray arrfds = (PdfArray) PdfReader.getPdfObjectRelease(top.get(PdfName.FIELDS));
158 2 1. fill : negated conditional → NO_COVERAGE
2. fill : negated conditional → NO_COVERAGE
    if (arrfds == null || arrfds.size() == 0) {
159
      return;
160
    }
161 3 1. fill : changed conditional boundary → NO_COVERAGE
2. fill : Changed increment from 1 to -1 → NO_COVERAGE
3. fill : negated conditional → NO_COVERAGE
    for (int k = 1; k <= reader.getNumberOfPages(); ++k) {
162
      PdfDictionary page = reader.getPageNRelease(k);
163
      PdfArray annots = (PdfArray) PdfReader.getPdfObjectRelease(page.get(PdfName.ANNOTS), page);
164 1 1. fill : negated conditional → NO_COVERAGE
      if (annots == null) {
165
        continue;
166
      }
167 2 1. fill : changed conditional boundary → NO_COVERAGE
2. fill : negated conditional → NO_COVERAGE
      for (int j = 0; j < annots.size(); ++j) {
168
        PdfDictionary annot = annots.getAsDict(j);
169 1 1. fill : negated conditional → NO_COVERAGE
        if (annot == null) {
170 1 1. fill : removed call to com/lowagie/text/pdf/PdfReader::releaseLastXrefPartial → NO_COVERAGE
          PdfReader.releaseLastXrefPartial(annots.getAsIndirectObject(j));
171
          continue;
172
        }
173 1 1. fill : negated conditional → NO_COVERAGE
        if (!PdfName.WIDGET.equals(annot.getAsName(PdfName.SUBTYPE))) {
174 1 1. fill : removed call to com/lowagie/text/pdf/PdfReader::releaseLastXrefPartial → NO_COVERAGE
          PdfReader.releaseLastXrefPartial(annots.getAsIndirectObject(j));
175
          continue;
176
        }
177
        PdfDictionary widget = annot;
178
        PdfDictionary dic = new PdfDictionary();
179 1 1. fill : removed call to com/lowagie/text/pdf/PdfDictionary::putAll → NO_COVERAGE
        dic.putAll(annot);
180
        String name = "";
181
        PdfDictionary value = null;
182
        PdfObject lastV = null;
183 1 1. fill : negated conditional → NO_COVERAGE
        while (annot != null) {
184 1 1. fill : removed call to com/lowagie/text/pdf/PdfDictionary::mergeDifferent → NO_COVERAGE
          dic.mergeDifferent(annot);
185
          PdfString t = annot.getAsString(PdfName.T);
186 1 1. fill : negated conditional → NO_COVERAGE
          if (t != null) {
187
            name = t.toUnicodeString() + "." + name;
188
          }
189 2 1. fill : negated conditional → NO_COVERAGE
2. fill : negated conditional → NO_COVERAGE
          if (lastV == null && annot.get(PdfName.V) != null) {
190
            lastV = PdfReader.getPdfObjectRelease(annot.get(PdfName.V));
191
          }
192 2 1. fill : negated conditional → NO_COVERAGE
2. fill : negated conditional → NO_COVERAGE
          if (value == null && t != null) {
193
            value = annot;
194 2 1. fill : negated conditional → NO_COVERAGE
2. fill : negated conditional → NO_COVERAGE
            if (annot.get(PdfName.V) == null && lastV != null) {
195 1 1. fill : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
              value.put(PdfName.V, lastV);
196
            }
197
          }
198
          annot = annot.getAsDict(PdfName.PARENT);
199
        }
200 2 1. fill : changed conditional boundary → NO_COVERAGE
2. fill : negated conditional → NO_COVERAGE
        if (name.length() > 0) {
201 1 1. fill : Replaced integer subtraction with addition → NO_COVERAGE
          name = name.substring(0, name.length() - 1);
202
        }
203
        Item item = fields.get(name);
204 1 1. fill : negated conditional → NO_COVERAGE
        if (item == null) {
205
          item = new Item();
206
          fields.put(name, item);
207
        }
208 1 1. fill : negated conditional → NO_COVERAGE
        if (value == null) {
209 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addValue → NO_COVERAGE
          item.addValue(widget);
210
        } else {
211 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addValue → NO_COVERAGE
          item.addValue(value);
212
        }
213 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addWidget → NO_COVERAGE
        item.addWidget(widget);
214 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addWidgetRef → NO_COVERAGE
        item.addWidgetRef(annots.getAsIndirectObject(j)); // must be a reference
215 1 1. fill : removed call to com/lowagie/text/pdf/PdfDictionary::mergeDifferent → NO_COVERAGE
        dic.mergeDifferent(top);
216 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addMerged → NO_COVERAGE
        item.addMerged(dic);
217 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addPage → NO_COVERAGE
        item.addPage(k);
218 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addTabOrder → NO_COVERAGE
        item.addTabOrder(j);
219
      }
220
    }
221
    // some tools produce invisible signatures without an entry in the page annotation array
222
    // look for a single level annotation
223
    PdfNumber sigFlags = top.getAsNumber(PdfName.SIGFLAGS);
224 3 1. fill : Replaced bitwise AND with OR → NO_COVERAGE
2. fill : negated conditional → NO_COVERAGE
3. fill : negated conditional → NO_COVERAGE
    if (sigFlags == null || (sigFlags.intValue() & 1) != 1) {
225
      return;
226
    }
227 2 1. fill : changed conditional boundary → NO_COVERAGE
2. fill : negated conditional → NO_COVERAGE
    for (int j = 0; j < arrfds.size(); ++j) {
228
      PdfDictionary annot = arrfds.getAsDict(j);
229 1 1. fill : negated conditional → NO_COVERAGE
      if (annot == null) {
230 1 1. fill : removed call to com/lowagie/text/pdf/PdfReader::releaseLastXrefPartial → NO_COVERAGE
        PdfReader.releaseLastXrefPartial(arrfds.getAsIndirectObject(j));
231
        continue;
232
      }
233 1 1. fill : negated conditional → NO_COVERAGE
      if (!PdfName.WIDGET.equals(annot.getAsName(PdfName.SUBTYPE))) {
234 1 1. fill : removed call to com/lowagie/text/pdf/PdfReader::releaseLastXrefPartial → NO_COVERAGE
        PdfReader.releaseLastXrefPartial(arrfds.getAsIndirectObject(j));
235
        continue;
236
      }
237
      PdfArray kids = (PdfArray) PdfReader.getPdfObjectRelease(annot.get(PdfName.KIDS));
238 1 1. fill : negated conditional → NO_COVERAGE
      if (kids != null) {
239
        continue;
240
      }
241
      PdfDictionary dic = new PdfDictionary();
242 1 1. fill : removed call to com/lowagie/text/pdf/PdfDictionary::putAll → NO_COVERAGE
      dic.putAll(annot);
243
      PdfString t = annot.getAsString(PdfName.T);
244 1 1. fill : negated conditional → NO_COVERAGE
      if (t == null) {
245
        continue;
246
      }
247
      String name = t.toUnicodeString();
248 1 1. fill : negated conditional → NO_COVERAGE
      if (fields.containsKey(name)) {
249
        continue;
250
      }
251
      Item item = new Item();
252
      fields.put(name, item);
253 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addValue → NO_COVERAGE
      item.addValue(dic);
254 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addWidget → NO_COVERAGE
      item.addWidget(dic);
255 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addWidgetRef → NO_COVERAGE
      item.addWidgetRef(arrfds.getAsIndirectObject(j)); // must be a reference
256 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addMerged → NO_COVERAGE
      item.addMerged(dic);
257 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addPage → NO_COVERAGE
      item.addPage(-1);
258 1 1. fill : removed call to com/lowagie/text/pdf/AcroFields$Item::addTabOrder → NO_COVERAGE
      item.addTabOrder(-1);
259
    }
260
  }
261
262
  /**
263
   * Gets the list of appearance names. Use it to get the names allowed with radio and checkbox fields. If the /Opt key exists the values
264
   * will also be included. The name 'Off' may also be valid even if not returned in the list.
265
   *
266
   * @param fieldName the fully qualified field name
267
   * @return the list of names or <CODE>null</CODE> if the field does not exist
268
   */
269
  public String[] getAppearanceStates(String fieldName) {
270
    Item fd = fields.get(fieldName);
271 1 1. getAppearanceStates : negated conditional → NO_COVERAGE
    if (fd == null) {
272 1 1. getAppearanceStates : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getAppearanceStates to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return null;
273
    }
274
    Map<String, ?> names = new HashMap<>();
275
    PdfDictionary vals = fd.getValue(0);
276
    PdfString stringOpt = vals.getAsString(PdfName.OPT);
277 1 1. getAppearanceStates : negated conditional → NO_COVERAGE
    if (stringOpt != null) {
278
      names.put(stringOpt.toUnicodeString(), null);
279
    } else {
280
      PdfArray arrayOpt = vals.getAsArray(PdfName.OPT);
281 1 1. getAppearanceStates : negated conditional → NO_COVERAGE
      if (arrayOpt != null) {
282 2 1. getAppearanceStates : changed conditional boundary → NO_COVERAGE
2. getAppearanceStates : negated conditional → NO_COVERAGE
        for (int k = 0; k < arrayOpt.size(); ++k) {
283
          PdfString valStr = arrayOpt.getAsString(k);
284 1 1. getAppearanceStates : negated conditional → NO_COVERAGE
          if (valStr != null) {
285
            names.put(valStr.toUnicodeString(), null);
286
          }
287
        }
288
      }
289
    }
290 2 1. getAppearanceStates : changed conditional boundary → NO_COVERAGE
2. getAppearanceStates : negated conditional → NO_COVERAGE
    for (int k = 0; k < fd.size(); ++k) {
291
      PdfDictionary dic = fd.getWidget(k);
292
      dic = dic.getAsDict(PdfName.AP);
293 1 1. getAppearanceStates : negated conditional → NO_COVERAGE
      if (dic == null) {
294
        continue;
295
      }
296
      dic = dic.getAsDict(PdfName.N);
297 1 1. getAppearanceStates : negated conditional → NO_COVERAGE
      if (dic == null) {
298
        continue;
299
      }
300
      for (Object o : dic.getKeys()) {
301
        String name = PdfName.decodeName(o.toString());
302
        names.put(name, null);
303
      }
304
    }
305
    String[] out = new String[names.size()];
306 1 1. getAppearanceStates : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getAppearanceStates to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return names.keySet().toArray(out);
307
  }
308
309
  private String[] getListOption(String fieldName, int idx) {
310
    Item fd = getFieldItem(fieldName);
311 1 1. getListOption : negated conditional → NO_COVERAGE
    if (fd == null) {
312 1 1. getListOption : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getListOption to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return null;
313
    }
314
    PdfArray ar = fd.getMerged(0).getAsArray(PdfName.OPT);
315 1 1. getListOption : negated conditional → NO_COVERAGE
    if (ar == null) {
316 1 1. getListOption : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getListOption to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return null;
317
    }
318
    String[] ret = new String[ar.size()];
319 2 1. getListOption : changed conditional boundary → NO_COVERAGE
2. getListOption : negated conditional → NO_COVERAGE
    for (int k = 0; k < ar.size(); ++k) {
320
      PdfObject obj = ar.getDirectObject(k);
321
      try {
322 1 1. getListOption : negated conditional → NO_COVERAGE
        if (obj.isArray()) {
323
          obj = ((PdfArray) obj).getDirectObject(idx);
324
        }
325 1 1. getListOption : negated conditional → NO_COVERAGE
        if (obj.isString()) {
326
          ret[k] = ((PdfString) obj).toUnicodeString();
327
        } else {
328
          ret[k] = obj.toString();
329
        }
330
      } catch (Exception e) {
331
        ret[k] = "";
332
      }
333
    }
334 1 1. getListOption : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getListOption to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return ret;
335
  }
336
337
  /**
338
   * Gets the list of export option values from fields of type list or combo. If the field doesn't exist or the field type is not list or
339
   * combo it will return
340
   * <CODE>null</CODE>.
341
   *
342
   * @param fieldName the field name
343
   * @return the list of export option values from fields of type list or combo
344
   */
345
  public String[] getListOptionExport(String fieldName) {
346 1 1. getListOptionExport : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getListOptionExport to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return getListOption(fieldName, 0);
347
  }
348
349
  /**
350
   * Gets the list of display option values from fields of type list or combo. If the field doesn't exist or the field type is not list or
351
   * combo it will return
352
   * <CODE>null</CODE>.
353
   *
354
   * @param fieldName the field name
355
   * @return the list of export option values from fields of type list or combo
356
   */
357
  public String[] getListOptionDisplay(String fieldName) {
358 1 1. getListOptionDisplay : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getListOptionDisplay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return getListOption(fieldName, 1);
359
  }
360
361
  /**
362
   * Sets the option list for fields of type list or combo. One of <CODE>exportValues</CODE> or <CODE>displayValues</CODE> may be
363
   * <CODE>null</CODE> but not both. This method will only set the list but will not set the value or appearance. For that, calling
364
   * <CODE>setField()</CODE> is required.
365
   * <p>
366
   * An example:
367
   * <p>
368
   * <PRE>
369
   * PdfReader pdf = new PdfReader("input.pdf"); PdfStamper stp = new PdfStamper(pdf, new FileOutputStream("output.pdf")); AcroFields af =
370
   * stp.getAcroFields(); af.setListOption("ComboBox", new String[]{"a", "b", "c"}, new String[]{"first", "second", "third"});
371
   * af.setField("ComboBox", "b"); stp.close();
372
   * </PRE>
373
   *
374
   * @param fieldName the field name
375
   * @param exportValues the export values
376
   * @param displayValues the display values
377
   * @return <CODE>true</CODE> if the operation succeeded, <CODE>false</CODE> otherwise
378
   */
379
  public boolean setListOption(String fieldName, String[] exportValues, String[] displayValues) {
380 2 1. setListOption : negated conditional → NO_COVERAGE
2. setListOption : negated conditional → NO_COVERAGE
    if (exportValues == null && displayValues == null) {
381 1 1. setListOption : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
382
    }
383 3 1. setListOption : negated conditional → NO_COVERAGE
2. setListOption : negated conditional → NO_COVERAGE
3. setListOption : negated conditional → NO_COVERAGE
    if (exportValues != null && displayValues != null && exportValues.length != displayValues.length) {
384
      throw new IllegalArgumentException(
385
          MessageLocalization.getComposedMessage("the.export.and.the.display.array.must.have.the.same.size"));
386
    }
387
    int ftype = getFieldType(fieldName);
388 2 1. setListOption : negated conditional → NO_COVERAGE
2. setListOption : negated conditional → NO_COVERAGE
    if (ftype != FIELD_TYPE_COMBO && ftype != FIELD_TYPE_LIST) {
389 1 1. setListOption : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
390
    }
391
    Item fd = fields.get(fieldName);
392
    String[] sing = null;
393 2 1. setListOption : negated conditional → NO_COVERAGE
2. setListOption : negated conditional → NO_COVERAGE
    if (exportValues == null && displayValues != null) {
394
      sing = displayValues;
395 2 1. setListOption : negated conditional → NO_COVERAGE
2. setListOption : negated conditional → NO_COVERAGE
    } else if (exportValues != null && displayValues == null) {
396
      sing = exportValues;
397
    }
398
    PdfArray opt = new PdfArray();
399 1 1. setListOption : negated conditional → NO_COVERAGE
    if (sing != null) {
400
      for (String s : sing) {
401
        opt.add(new PdfString(s, PdfObject.TEXT_UNICODE));
402
      }
403
    } else {
404 2 1. setListOption : changed conditional boundary → NO_COVERAGE
2. setListOption : negated conditional → NO_COVERAGE
      for (int k = 0; k < exportValues.length; ++k) {
405
        PdfArray a = new PdfArray();
406
        a.add(new PdfString(exportValues[k], PdfObject.TEXT_UNICODE));
407
        a.add(new PdfString(displayValues[k], PdfObject.TEXT_UNICODE));
408
        opt.add(a);
409
      }
410
    }
411 1 1. setListOption : removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE
    fd.writeToAll(PdfName.OPT, opt, Item.WRITE_VALUE | Item.WRITE_MERGED);
412 1 1. setListOption : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return true;
413
  }
414
415
  /**
416
   * Gets the field type. The type can be one of: <CODE>FIELD_TYPE_PUSHBUTTON</CODE>,
417
   * <CODE>FIELD_TYPE_CHECKBOX</CODE>, <CODE>FIELD_TYPE_RADIOBUTTON</CODE>,
418
   * <CODE>FIELD_TYPE_TEXT</CODE>, <CODE>FIELD_TYPE_LIST</CODE>,
419
   * <CODE>FIELD_TYPE_COMBO</CODE> or <CODE>FIELD_TYPE_SIGNATURE</CODE>.
420
   * <p>
421
   * If the field does not exist or is invalid it returns
422
   * <CODE>FIELD_TYPE_NONE</CODE>.
423
   *
424
   * @param fieldName the field name
425
   * @return the field type
426
   */
427
  public int getFieldType(String fieldName) {
428
    Item fd = getFieldItem(fieldName);
429 1 1. getFieldType : negated conditional → NO_COVERAGE
    if (fd == null) {
430 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return FIELD_TYPE_NONE;
431
    }
432
    PdfDictionary merged = fd.getMerged(0);
433
    PdfName type = merged.getAsName(PdfName.FT);
434 1 1. getFieldType : negated conditional → NO_COVERAGE
    if (type == null) {
435 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return FIELD_TYPE_NONE;
436
    }
437
    int ff = 0;
438
    PdfNumber ffo = merged.getAsNumber(PdfName.FF);
439 1 1. getFieldType : negated conditional → NO_COVERAGE
    if (ffo != null) {
440
      ff = ffo.intValue();
441
    }
442 1 1. getFieldType : negated conditional → NO_COVERAGE
    if (PdfName.BTN.equals(type)) {
443 2 1. getFieldType : Replaced bitwise AND with OR → NO_COVERAGE
2. getFieldType : negated conditional → NO_COVERAGE
      if ((ff & PdfFormField.FF_PUSHBUTTON) != 0) {
444 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return FIELD_TYPE_PUSHBUTTON;
445
      }
446 2 1. getFieldType : Replaced bitwise AND with OR → NO_COVERAGE
2. getFieldType : negated conditional → NO_COVERAGE
      if ((ff & PdfFormField.FF_RADIO) != 0) {
447 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return FIELD_TYPE_RADIOBUTTON;
448
      } else {
449 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return FIELD_TYPE_CHECKBOX;
450
      }
451 1 1. getFieldType : negated conditional → NO_COVERAGE
    } else if (PdfName.TX.equals(type)) {
452 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return FIELD_TYPE_TEXT;
453 1 1. getFieldType : negated conditional → NO_COVERAGE
    } else if (PdfName.CH.equals(type)) {
454 2 1. getFieldType : Replaced bitwise AND with OR → NO_COVERAGE
2. getFieldType : negated conditional → NO_COVERAGE
      if ((ff & PdfFormField.FF_COMBO) != 0) {
455 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return FIELD_TYPE_COMBO;
456
      } else {
457 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return FIELD_TYPE_LIST;
458
      }
459 1 1. getFieldType : negated conditional → NO_COVERAGE
    } else if (PdfName.SIG.equals(type)) {
460 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return FIELD_TYPE_SIGNATURE;
461
    }
462 1 1. getFieldType : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return FIELD_TYPE_NONE;
463
  }
464
465
  /**
466
   * Export the fields as a FDF.
467
   *
468
   * @param writer the FDF writer
469
   */
470
  public void exportAsFdf(FdfWriter writer) {
471
    for (Map.Entry<String, Item> entry : fields.entrySet()) {
472
      Item item = entry.getValue();
473
      String name = entry.getKey();
474
      PdfObject v = item.getMerged(0).get(PdfName.V);
475 1 1. exportAsFdf : negated conditional → NO_COVERAGE
      if (v == null) {
476
        continue;
477
      }
478
      String value = getField(name);
479 1 1. exportAsFdf : negated conditional → NO_COVERAGE
      if (lastWasString) {
480
        writer.setFieldAsString(name, value);
481
      } else {
482
        writer.setFieldAsName(name, value);
483
      }
484
    }
485
  }
486
487
  /**
488
   * Renames a field. Only the last part of the name can be renamed. For example, if the original field is "ab.cd.ef" only the "ef" part can
489
   * be renamed.
490
   *
491
   * @param oldName the old field name
492
   * @param newName the new field name
493
   * @return <CODE>true</CODE> if the renaming was successful, <CODE>false</CODE>
494
   * otherwise
495
   */
496
  public boolean renameField(String oldName, String newName) {
497 1 1. renameField : Replaced integer addition with subtraction → NO_COVERAGE
    int idx1 = oldName.lastIndexOf('.') + 1;
498 1 1. renameField : Replaced integer addition with subtraction → NO_COVERAGE
    int idx2 = newName.lastIndexOf('.') + 1;
499 1 1. renameField : negated conditional → NO_COVERAGE
    if (idx1 != idx2) {
500 1 1. renameField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
501
    }
502 1 1. renameField : negated conditional → NO_COVERAGE
    if (!oldName.substring(0, idx1).equals(newName.substring(0, idx2))) {
503 1 1. renameField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
504
    }
505 1 1. renameField : negated conditional → NO_COVERAGE
    if (fields.containsKey(newName)) {
506 1 1. renameField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
507
    }
508
    Item item = fields.get(oldName);
509 1 1. renameField : negated conditional → NO_COVERAGE
    if (item == null) {
510 1 1. renameField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
511
    }
512
    newName = newName.substring(idx2);
513
    PdfString ss = new PdfString(newName, PdfObject.TEXT_UNICODE);
514
515 1 1. renameField : removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE
    item.writeToAll(PdfName.T, ss, Item.WRITE_VALUE | Item.WRITE_MERGED);
516 1 1. renameField : removed call to com/lowagie/text/pdf/AcroFields$Item::markUsed → NO_COVERAGE
    item.markUsed(this, Item.WRITE_VALUE);
517
518
    fields.remove(oldName);
519
    fields.put(newName, item);
520
521 1 1. renameField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return true;
522
  }
523
524
  public static Object[] splitDAelements(String da) {
525
    try {
526
      PRTokeniser tk = new PRTokeniser(PdfEncodings.convertToBytes(da, null));
527
      List<String> stack = new ArrayList<>();
528
      Object[] ret = new Object[3];
529 1 1. splitDAelements : negated conditional → NO_COVERAGE
      while (tk.nextToken()) {
530 1 1. splitDAelements : negated conditional → NO_COVERAGE
        if (tk.getTokenType() == PRTokeniser.TK_COMMENT) {
531
          continue;
532
        }
533 1 1. splitDAelements : negated conditional → NO_COVERAGE
        if (tk.getTokenType() == PRTokeniser.TK_OTHER) {
534
          String operator = tk.getStringValue();
535
          switch (operator) {
536
            case "Tf":
537 2 1. splitDAelements : changed conditional boundary → NO_COVERAGE
2. splitDAelements : negated conditional → NO_COVERAGE
              if (stack.size() >= 2) {
538 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                ret[DA_FONT] = stack.get(stack.size() - 2);
539 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                ret[DA_SIZE] = Float.parseFloat(stack.get(stack.size() - 1));
540
              }
541
              break;
542
            case "g":
543 2 1. splitDAelements : changed conditional boundary → NO_COVERAGE
2. splitDAelements : negated conditional → NO_COVERAGE
              if (stack.size() >= 1) {
544 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                float gray = Float.parseFloat(stack.get(stack.size() - 1));
545 1 1. splitDAelements : negated conditional → NO_COVERAGE
                if (gray != 0) {
546
                  ret[DA_COLOR] = new GrayColor(gray);
547
                }
548
              }
549
              break;
550
            case "rg":
551 2 1. splitDAelements : changed conditional boundary → NO_COVERAGE
2. splitDAelements : negated conditional → NO_COVERAGE
              if (stack.size() >= 3) {
552 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                float red = Float.parseFloat(stack.get(stack.size() - 3));
553 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                float green = Float.parseFloat(stack.get(stack.size() - 2));
554 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                float blue = Float.parseFloat(stack.get(stack.size() - 1));
555
                ret[DA_COLOR] = new Color(red, green, blue);
556
              }
557
              break;
558
            case "k":
559 2 1. splitDAelements : changed conditional boundary → NO_COVERAGE
2. splitDAelements : negated conditional → NO_COVERAGE
              if (stack.size() >= 4) {
560 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                float cyan = Float.parseFloat(stack.get(stack.size() - 4));
561 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                float magenta = Float.parseFloat(stack.get(stack.size() - 3));
562 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                float yellow = Float.parseFloat(stack.get(stack.size() - 2));
563 1 1. splitDAelements : Replaced integer subtraction with addition → NO_COVERAGE
                float black = Float.parseFloat(stack.get(stack.size() - 1));
564
                ret[DA_COLOR] = new CMYKColor(cyan, magenta, yellow, black);
565
              }
566
              break;
567
          }
568 1 1. splitDAelements : removed call to java/util/List::clear → NO_COVERAGE
          stack.clear();
569
        } else {
570
          stack.add(tk.getStringValue());
571
        }
572
      }
573 1 1. splitDAelements : mutated return of Object value for com/lowagie/text/pdf/AcroFields::splitDAelements to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return ret;
574
    } catch (IOException ioe) {
575
      throw new ExceptionConverter(ioe);
576
    }
577
  }
578
579
  public void decodeGenericDictionary(PdfDictionary merged, BaseField tx) throws DocumentException {
580
    int flags = 0;
581
    // the text size and color
582
    PdfString da = merged.getAsString(PdfName.DA);
583 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
    if (da != null) {
584
      Object[] dab = splitDAelements(da.toUnicodeString());
585 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (dab[DA_SIZE] != null) {
586 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setFontSize → NO_COVERAGE
        tx.setFontSize((Float) dab[DA_SIZE]);
587
      }
588 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (dab[DA_COLOR] != null) {
589 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setTextColor → NO_COVERAGE
        tx.setTextColor((Color) dab[DA_COLOR]);
590
      }
591 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (dab[DA_FONT] != null) {
592
        PdfDictionary font = merged.getAsDict(PdfName.DR);
593 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
        if (font != null) {
594
          font = font.getAsDict(PdfName.FONT);
595 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
          if (font != null) {
596
            PdfObject po = font.get(new PdfName((String) dab[DA_FONT]));
597 2 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
2. decodeGenericDictionary : negated conditional → NO_COVERAGE
            if (po != null && po.type() == PdfObject.INDIRECT) {
598
              PRIndirectReference por = (PRIndirectReference) po;
599
              BaseFont bp = new DocumentFont((PRIndirectReference) po);
600 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setFont → NO_COVERAGE
              tx.setFont(bp);
601
              Integer porkey = por.getNumber();
602
              BaseFont porf = extensionFonts.get(porkey);
603 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
              if (porf == null) {
604 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
                if (!extensionFonts.containsKey(porkey)) {
605
                  PdfDictionary fo = (PdfDictionary) PdfReader.getPdfObject(po);
606
                  PdfDictionary fd = fo.getAsDict(PdfName.FONTDESCRIPTOR);
607 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
                  if (fd != null) {
608
                    PRStream prs = (PRStream) PdfReader.getPdfObject(fd.get(PdfName.FONTFILE2));
609 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
                    if (prs == null) {
610
                      prs = (PRStream) PdfReader.getPdfObject(fd.get(PdfName.FONTFILE3));
611
                    }
612 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
                    if (prs == null) {
613
                      extensionFonts.put(porkey, null);
614
                    } else {
615
                      try {
616
                        porf = BaseFont.createFont("font.ttf", BaseFont.IDENTITY_H, true, false, PdfReader.getStreamBytes(prs), null);
617
                      } catch (Exception ignored) {
618
                      }
619
                      extensionFonts.put(porkey, porf);
620
                    }
621
                  }
622
                }
623
              }
624 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
              if (tx instanceof TextField) {
625 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/TextField::setExtensionFont → NO_COVERAGE
                ((TextField) tx).setExtensionFont(porf);
626
              }
627
            } else {
628
              BaseFont bf = localFonts.get(dab[DA_FONT]);
629 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
              if (bf == null) {
630
                String[] fn = stdFieldFontNames.get(dab[DA_FONT]);
631 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
                if (fn != null) {
632
                  try {
633
                    String enc = "winansi";
634 2 1. decodeGenericDictionary : changed conditional boundary → NO_COVERAGE
2. decodeGenericDictionary : negated conditional → NO_COVERAGE
                    if (fn.length > 1) {
635
                      enc = fn[1];
636
                    }
637
                    bf = BaseFont.createFont(fn[0], enc, false);
638 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setFont → NO_COVERAGE
                    tx.setFont(bf);
639
                  } catch (Exception e) {
640
                    // empty
641
                  }
642
                }
643
              } else {
644 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setFont → NO_COVERAGE
                tx.setFont(bf);
645
              }
646
            }
647
          }
648
        }
649
      }
650
    }
651
    //rotation, border and background color
652
    PdfDictionary mk = merged.getAsDict(PdfName.MK);
653 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
    if (mk != null) {
654
      PdfArray ar = mk.getAsArray(PdfName.BC);
655
      Color border = getMKColor(ar);
656 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBorderColor → NO_COVERAGE
      tx.setBorderColor(border);
657 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (border != null) {
658 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBorderWidth → NO_COVERAGE
        tx.setBorderWidth(1);
659
      }
660
      ar = mk.getAsArray(PdfName.BG);
661 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBackgroundColor → NO_COVERAGE
      tx.setBackgroundColor(getMKColor(ar));
662
      PdfNumber rotation = mk.getAsNumber(PdfName.R);
663 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (rotation != null) {
664 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setRotation → NO_COVERAGE
        tx.setRotation(rotation.intValue());
665
      }
666
    }
667
    //flags
668
    PdfNumber nfl = merged.getAsNumber(PdfName.F);
669
    flags = 0;
670 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setVisibility → NO_COVERAGE
    tx.setVisibility(BaseField.VISIBLE_BUT_DOES_NOT_PRINT);
671 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
    if (nfl != null) {
672
      flags = nfl.intValue();
673 4 1. decodeGenericDictionary : Replaced bitwise AND with OR → NO_COVERAGE
2. decodeGenericDictionary : Replaced bitwise AND with OR → NO_COVERAGE
3. decodeGenericDictionary : negated conditional → NO_COVERAGE
4. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if ((flags & PdfFormField.FLAGS_PRINT) != 0 && (flags & PdfFormField.FLAGS_HIDDEN) != 0) {
674 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setVisibility → NO_COVERAGE
        tx.setVisibility(BaseField.HIDDEN);
675 4 1. decodeGenericDictionary : Replaced bitwise AND with OR → NO_COVERAGE
2. decodeGenericDictionary : Replaced bitwise AND with OR → NO_COVERAGE
3. decodeGenericDictionary : negated conditional → NO_COVERAGE
4. decodeGenericDictionary : negated conditional → NO_COVERAGE
      } else if ((flags & PdfFormField.FLAGS_PRINT) != 0 && (flags & PdfFormField.FLAGS_NOVIEW) != 0) {
676 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setVisibility → NO_COVERAGE
        tx.setVisibility(BaseField.HIDDEN_BUT_PRINTABLE);
677 2 1. decodeGenericDictionary : Replaced bitwise AND with OR → NO_COVERAGE
2. decodeGenericDictionary : negated conditional → NO_COVERAGE
      } else if ((flags & PdfFormField.FLAGS_PRINT) != 0) {
678 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setVisibility → NO_COVERAGE
        tx.setVisibility(BaseField.VISIBLE);
679
      }
680
    }
681
    //multiline
682
    nfl = merged.getAsNumber(PdfName.FF);
683
    flags = 0;
684 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
    if (nfl != null) {
685
      flags = nfl.intValue();
686
    }
687 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setOptions → NO_COVERAGE
    tx.setOptions(flags);
688 2 1. decodeGenericDictionary : Replaced bitwise AND with OR → NO_COVERAGE
2. decodeGenericDictionary : negated conditional → NO_COVERAGE
    if ((flags & PdfFormField.FF_COMB) != 0) {
689
      PdfNumber maxLen = merged.getAsNumber(PdfName.MAXLEN);
690
      int len = 0;
691 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (maxLen != null) {
692
        len = maxLen.intValue();
693
      }
694 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setMaxCharacterLength → NO_COVERAGE
      tx.setMaxCharacterLength(len);
695
    }
696
    //alignment
697
    nfl = merged.getAsNumber(PdfName.Q);
698 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
    if (nfl != null) {
699 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (nfl.intValue() == PdfFormField.Q_CENTER) {
700 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setAlignment → NO_COVERAGE
        tx.setAlignment(Element.ALIGN_CENTER);
701 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      } else if (nfl.intValue() == PdfFormField.Q_RIGHT) {
702 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setAlignment → NO_COVERAGE
        tx.setAlignment(Element.ALIGN_RIGHT);
703
      }
704
    }
705
    //border styles
706
    PdfDictionary bs = merged.getAsDict(PdfName.BS);
707 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
    if (bs != null) {
708
      PdfNumber w = bs.getAsNumber(PdfName.W);
709 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (w != null) {
710 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBorderWidth → NO_COVERAGE
        tx.setBorderWidth(w.floatValue());
711
      }
712
      PdfName s = bs.getAsName(PdfName.S);
713 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (PdfName.D.equals(s)) {
714 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE
        tx.setBorderStyle(PdfBorderDictionary.STYLE_DASHED);
715 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      } else if (PdfName.B.equals(s)) {
716 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE
        tx.setBorderStyle(PdfBorderDictionary.STYLE_BEVELED);
717 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      } else if (PdfName.I.equals(s)) {
718 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE
        tx.setBorderStyle(PdfBorderDictionary.STYLE_INSET);
719 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      } else if (PdfName.U.equals(s)) {
720 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE
        tx.setBorderStyle(PdfBorderDictionary.STYLE_UNDERLINE);
721
      }
722
    } else {
723
      PdfArray bd = merged.getAsArray(PdfName.BORDER);
724 1 1. decodeGenericDictionary : negated conditional → NO_COVERAGE
      if (bd != null) {
725 2 1. decodeGenericDictionary : changed conditional boundary → NO_COVERAGE
2. decodeGenericDictionary : negated conditional → NO_COVERAGE
        if (bd.size() >= 3) {
726 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBorderWidth → NO_COVERAGE
          tx.setBorderWidth(bd.getAsNumber(2).floatValue());
727
        }
728 2 1. decodeGenericDictionary : changed conditional boundary → NO_COVERAGE
2. decodeGenericDictionary : negated conditional → NO_COVERAGE
        if (bd.size() >= 4) {
729 1 1. decodeGenericDictionary : removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE
          tx.setBorderStyle(PdfBorderDictionary.STYLE_DASHED);
730
        }
731
      }
732
    }
733
  }
734
735
  PdfAppearance getAppearance(PdfDictionary merged, String[] values, String fieldName) throws IOException, DocumentException {
736
    topFirst = 0;
737 2 1. getAppearance : changed conditional boundary → NO_COVERAGE
2. getAppearance : negated conditional → NO_COVERAGE
    String text = (values.length > 0) ? values[0] : null;
738
739
    TextField tx = null;
740 2 1. getAppearance : negated conditional → NO_COVERAGE
2. getAppearance : negated conditional → NO_COVERAGE
    if (fieldCache == null || !fieldCache.containsKey(fieldName)) {
741
      tx = new TextField(writer, null, null);
742 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setExtraMargin → NO_COVERAGE
      tx.setExtraMargin(extraMarginLeft, extraMarginTop);
743 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setBorderWidth → NO_COVERAGE
      tx.setBorderWidth(0);
744 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setSubstitutionFonts → NO_COVERAGE
      tx.setSubstitutionFonts(substitutionFonts);
745 1 1. getAppearance : removed call to com/lowagie/text/pdf/AcroFields::decodeGenericDictionary → NO_COVERAGE
      decodeGenericDictionary(merged, tx);
746
      //rect
747
      PdfArray rect = merged.getAsArray(PdfName.RECT);
748
      Rectangle box = PdfReader.getNormalizedRectangle(rect);
749 2 1. getAppearance : negated conditional → NO_COVERAGE
2. getAppearance : negated conditional → NO_COVERAGE
      if (tx.getRotation() == 90 || tx.getRotation() == 270) {
750
        box = box.rotate();
751
      }
752 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setBox → NO_COVERAGE
      tx.setBox(box);
753 1 1. getAppearance : negated conditional → NO_COVERAGE
      if (fieldCache != null) {
754
        fieldCache.put(fieldName, tx);
755
      }
756
    } else {
757
      tx = (TextField) fieldCache.get(fieldName);
758 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setWriter → NO_COVERAGE
      tx.setWriter(writer);
759
    }
760
    PdfName fieldType = merged.getAsName(PdfName.FT);
761 1 1. getAppearance : negated conditional → NO_COVERAGE
    if (PdfName.TX.equals(fieldType)) {
762 3 1. getAppearance : changed conditional boundary → NO_COVERAGE
2. getAppearance : negated conditional → NO_COVERAGE
3. getAppearance : negated conditional → NO_COVERAGE
      if (values.length > 0 && values[0] != null) {
763 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setText → NO_COVERAGE
        tx.setText(values[0]);
764
      }
765 1 1. getAppearance : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getAppearance to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return tx.getAppearance();
766
    }
767 1 1. getAppearance : negated conditional → NO_COVERAGE
    if (!PdfName.CH.equals(fieldType)) {
768
      throw new DocumentException(MessageLocalization.getComposedMessage("an.appearance.was.requested.without.a.variable.text.field"));
769
    }
770
    PdfArray opt = merged.getAsArray(PdfName.OPT);
771
    int flags = 0;
772
    PdfNumber nfl = merged.getAsNumber(PdfName.FF);
773 1 1. getAppearance : negated conditional → NO_COVERAGE
    if (nfl != null) {
774
      flags = nfl.intValue();
775
    }
776 3 1. getAppearance : Replaced bitwise AND with OR → NO_COVERAGE
2. getAppearance : negated conditional → NO_COVERAGE
3. getAppearance : negated conditional → NO_COVERAGE
    if ((flags & PdfFormField.FF_COMBO) != 0 && opt == null) {
777 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setText → NO_COVERAGE
      tx.setText(text);
778 1 1. getAppearance : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getAppearance to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return tx.getAppearance();
779
    }
780 1 1. getAppearance : negated conditional → NO_COVERAGE
    if (opt != null) {
781
      String[] choices = new String[opt.size()];
782
      String[] choicesExp = new String[opt.size()];
783 2 1. getAppearance : changed conditional boundary → NO_COVERAGE
2. getAppearance : negated conditional → NO_COVERAGE
      for (int k = 0; k < opt.size(); ++k) {
784
        PdfObject obj = opt.getPdfObject(k);
785 1 1. getAppearance : negated conditional → NO_COVERAGE
        if (obj.isString()) {
786
          choices[k] = choicesExp[k] = ((PdfString) obj).toUnicodeString();
787
        } else {
788
          PdfArray a = (PdfArray) obj;
789
          choicesExp[k] = a.getAsString(0).toUnicodeString();
790
          choices[k] = a.getAsString(1).toUnicodeString();
791
        }
792
      }
793 2 1. getAppearance : Replaced bitwise AND with OR → NO_COVERAGE
2. getAppearance : negated conditional → NO_COVERAGE
      if ((flags & PdfFormField.FF_COMBO) != 0) {
794 2 1. getAppearance : changed conditional boundary → NO_COVERAGE
2. getAppearance : negated conditional → NO_COVERAGE
        for (int k = 0; k < choices.length; ++k) {
795 1 1. getAppearance : negated conditional → NO_COVERAGE
          if (text.equals(choicesExp[k])) {
796
            text = choices[k];
797
            break;
798
          }
799
        }
800 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setText → NO_COVERAGE
        tx.setText(text);
801 1 1. getAppearance : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getAppearance to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return tx.getAppearance();
802
      }
803
      List<Integer> indexes = new ArrayList<>();
804 3 1. getAppearance : changed conditional boundary → NO_COVERAGE
2. getAppearance : Changed increment from 1 to -1 → NO_COVERAGE
3. getAppearance : negated conditional → NO_COVERAGE
      for (int k = 0; k < choicesExp.length; ++k) {
805
        for (String val : values) {
806 2 1. getAppearance : negated conditional → NO_COVERAGE
2. getAppearance : negated conditional → NO_COVERAGE
          if (val != null && val.equals(choicesExp[k])) {
807
            indexes.add(k);
808
            break;
809
          }
810
        }
811
      }
812 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setChoices → NO_COVERAGE
      tx.setChoices(choices);
813 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setChoiceExports → NO_COVERAGE
      tx.setChoiceExports(choicesExp);
814 1 1. getAppearance : removed call to com/lowagie/text/pdf/TextField::setChoiceSelections → NO_COVERAGE
      tx.setChoiceSelections(indexes);
815
    }
816
    PdfAppearance app = tx.getListAppearance();
817
    topFirst = tx.getTopFirst();
818 1 1. getAppearance : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getAppearance to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return app;
819
  }
820
821
  PdfAppearance getAppearance(PdfDictionary merged, String text, String fieldName) throws IOException, DocumentException {
822
    String[] valueArr = new String[1];
823
    valueArr[0] = text;
824 1 1. getAppearance : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getAppearance to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return getAppearance(merged, valueArr, fieldName);
825
  }
826
827
  Color getMKColor(PdfArray ar) {
828 1 1. getMKColor : negated conditional → NO_COVERAGE
    if (ar == null) {
829 1 1. getMKColor : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getMKColor to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return null;
830
    }
831
    switch (ar.size()) {
832
      case 1:
833 1 1. getMKColor : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getMKColor to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new GrayColor(ar.getAsNumber(0).floatValue());
834
      case 3:
835 1 1. getMKColor : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getMKColor to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new Color(ExtendedColor.normalize(ar.getAsNumber(0).floatValue()), ExtendedColor.normalize(ar.getAsNumber(1).floatValue()),
836
            ExtendedColor.normalize(ar.getAsNumber(2).floatValue()));
837
      case 4:
838 1 1. getMKColor : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getMKColor to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new CMYKColor(ar.getAsNumber(0).floatValue(), ar.getAsNumber(1).floatValue(), ar.getAsNumber(2).floatValue(),
839
            ar.getAsNumber(3).floatValue());
840
      default:
841 1 1. getMKColor : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getMKColor to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return null;
842
    }
843
  }
844
845
  /**
846
   * Gets the field value.
847
   *
848
   * @param name the fully qualified field name
849
   * @return the field value
850
   */
851
  public String getField(String name) {
852 1 1. getField : negated conditional → NO_COVERAGE
    if (xfa.isXfaPresent()) {
853
      name = xfa.findFieldName(name, this);
854 1 1. getField : negated conditional → NO_COVERAGE
      if (name == null) {
855 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return null;
856
      }
857
      name = XfaForm.Xml2Som.getShortName(name);
858 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return XfaForm.getNodeText(xfa.findDatasetsNode(name));
859
    }
860
    Item item = fields.get(name);
861 1 1. getField : negated conditional → NO_COVERAGE
    if (item == null) {
862 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return null;
863
    }
864
    lastWasString = false;
865
    PdfDictionary mergedDict = item.getMerged(0);
866
867
    // Jose A. Rodriguez posted a fix to the mailing list (May 11, 2009)
868
    // explaining that the value can also be a stream value
869
    // the fix was made against an old iText version. Bruno adapted it.
870
    PdfObject v = PdfReader.getPdfObject(mergedDict.get(PdfName.V));
871 1 1. getField : negated conditional → NO_COVERAGE
    if (v == null) {
872 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return "";
873
    }
874 1 1. getField : negated conditional → NO_COVERAGE
    if (v instanceof PRStream) {
875
      byte[] valBytes;
876
      try {
877
        valBytes = PdfReader.getStreamBytes((PRStream) v);
878 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new String(valBytes);
879
      } catch (IOException e) {
880
        throw new ExceptionConverter(e);
881
      }
882
    }
883
884
    PdfName type = mergedDict.getAsName(PdfName.FT);
885 1 1. getField : negated conditional → NO_COVERAGE
    if (PdfName.BTN.equals(type)) {
886
      PdfNumber ff = mergedDict.getAsNumber(PdfName.FF);
887
      int flags = 0;
888 1 1. getField : negated conditional → NO_COVERAGE
      if (ff != null) {
889
        flags = ff.intValue();
890
      }
891 2 1. getField : Replaced bitwise AND with OR → NO_COVERAGE
2. getField : negated conditional → NO_COVERAGE
      if ((flags & PdfFormField.FF_PUSHBUTTON) != 0) {
892 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return "";
893
      }
894
      String value = "";
895 1 1. getField : negated conditional → NO_COVERAGE
      if (v instanceof PdfName) {
896
        value = PdfName.decodeName(v.toString());
897 1 1. getField : negated conditional → NO_COVERAGE
      } else if (v instanceof PdfString) {
898
        value = ((PdfString) v).toUnicodeString();
899
      }
900
      PdfArray opts = item.getValue(0).getAsArray(PdfName.OPT);
901 1 1. getField : negated conditional → NO_COVERAGE
      if (opts != null) {
902
        int idx = 0;
903
        try {
904
          idx = Integer.parseInt(value);
905
          PdfString ps = opts.getAsString(idx);
906
          value = ps.toUnicodeString();
907
          lastWasString = true;
908
        } catch (Exception ignored) {
909
        }
910
      }
911 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return value;
912
    }
913 1 1. getField : negated conditional → NO_COVERAGE
    if (v instanceof PdfString) {
914
      lastWasString = true;
915 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return ((PdfString) v).toUnicodeString();
916 1 1. getField : negated conditional → NO_COVERAGE
    } else if (v instanceof PdfName) {
917 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return PdfName.decodeName(v.toString());
918
    } else {
919 1 1. getField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return "";
920
    }
921
  }
922
923
  /**
924
   * Gets the field values of a Choice field.
925
   *
926
   * @param name the fully qualified field name
927
   * @return the field value
928
   * @since 2.1.3
929
   */
930
  public String[] getListSelection(String name) {
931
    String[] ret;
932
    String s = getField(name);
933 1 1. getListSelection : negated conditional → NO_COVERAGE
    if (s == null) {
934
      ret = new String[]{};
935
    } else {
936
      ret = new String[]{s};
937
    }
938
    Item item = fields.get(name);
939 1 1. getListSelection : negated conditional → NO_COVERAGE
    if (item == null) {
940 1 1. getListSelection : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getListSelection to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return ret;
941
    }
942
    //PdfName type = (PdfName)PdfReader.getPdfObject(((PdfDictionary)item.merged.get(0)).get(PdfName.FT));
943
    //if (!PdfName.CH.equals(type)) {
944
    //    return ret;
945
    //}
946
    PdfArray values = item.getMerged(0).getAsArray(PdfName.I);
947 1 1. getListSelection : negated conditional → NO_COVERAGE
    if (values == null) {
948 1 1. getListSelection : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getListSelection to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return ret;
949
    }
950
    ret = new String[values.size()];
951
    String[] options = getListOptionExport(name);
952
    PdfNumber n;
953
    int idx = 0;
954 1 1. getListSelection : negated conditional → NO_COVERAGE
    for (Iterator i = values.listIterator(); i.hasNext(); ) {
955
      n = (PdfNumber) i.next();
956 1 1. getListSelection : Changed increment from 1 to -1 → NO_COVERAGE
      ret[idx++] = options[n.intValue()];
957
    }
958 1 1. getListSelection : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getListSelection to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return ret;
959
  }
960
961
962
  /**
963
   * Sets a field property. Valid property names are:
964
   * <p>
965
   * <ul>
966
   * <li>textfont - sets the text font. The value for this entry is a <CODE>BaseFont</CODE>.<br>
967
   * <li>textcolor - sets the text color. The value for this entry is a <CODE>java.awt.Color</CODE>.<br>
968
   * <li>textsize - sets the text size. The value for this entry is a <CODE>Float</CODE>.
969
   * <li>bgcolor - sets the background color. The value for this entry is a <CODE>java.awt.Color</CODE>.
970
   * If <code>null</code> removes the background.<br>
971
   * <li>bordercolor - sets the border color. The value for this entry is a <CODE>java.awt.Color</CODE>.
972
   * If <code>null</code> removes the border.<br>
973
   * </ul>
974
   *
975
   * @param field the field name
976
   * @param name the property name
977
   * @param value the property value
978
   * @param inst an array of <CODE>int</CODE> indexing into <CODE>AcroField.Item.merged</CODE> elements to process. Set to <CODE>null</CODE>
979
   * to process all
980
   * @return <CODE>true</CODE> if the property exists, <CODE>false</CODE> otherwise
981
   */
982
  public boolean setFieldProperty(String field, String name, Object value, int[] inst) {
983 1 1. setFieldProperty : negated conditional → NO_COVERAGE
    if (writer == null) {
984
      throw new RuntimeException(MessageLocalization.getComposedMessage("this.acrofields.instance.is.read.only"));
985
    }
986
    try {
987
      Item item = fields.get(field);
988 1 1. setFieldProperty : negated conditional → NO_COVERAGE
      if (item == null) {
989 1 1. setFieldProperty : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return false;
990
      }
991
      InstHit hit = new InstHit(inst);
992
      PdfDictionary merged;
993
      PdfString da;
994 1 1. setFieldProperty : negated conditional → NO_COVERAGE
      if (name.equalsIgnoreCase("textfont")) {
995 2 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : negated conditional → NO_COVERAGE
        for (int k = 0; k < item.size(); ++k) {
996 1 1. setFieldProperty : negated conditional → NO_COVERAGE
          if (hit.isHit(k)) {
997
            merged = item.getMerged(k);
998
            da = merged.getAsString(PdfName.DA);
999
            PdfDictionary dr = merged.getAsDict(PdfName.DR);
1000 2 1. setFieldProperty : negated conditional → NO_COVERAGE
2. setFieldProperty : negated conditional → NO_COVERAGE
            if (da != null && dr != null) {
1001
              Object[] dao = splitDAelements(da.toUnicodeString());
1002
              PdfAppearance cb = new PdfAppearance();
1003 1 1. setFieldProperty : negated conditional → NO_COVERAGE
              if (dao[DA_FONT] != null) {
1004
                BaseFont bf = (BaseFont) value;
1005
                PdfName psn = PdfAppearance.stdFieldFontNames.get(bf.getPostscriptFontName());
1006 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                if (psn == null) {
1007
                  psn = new PdfName(bf.getPostscriptFontName());
1008
                }
1009
                PdfDictionary fonts = dr.getAsDict(PdfName.FONT);
1010 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                if (fonts == null) {
1011
                  fonts = new PdfDictionary();
1012 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                  dr.put(PdfName.FONT, fonts);
1013
                }
1014
                PdfIndirectReference fref = (PdfIndirectReference) fonts.get(psn);
1015
                PdfDictionary top = reader.getCatalog().getAsDict(PdfName.ACROFORM);
1016 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
                markUsed(top);
1017
                dr = top.getAsDict(PdfName.DR);
1018 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                if (dr == null) {
1019
                  dr = new PdfDictionary();
1020 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                  top.put(PdfName.DR, dr);
1021
                }
1022 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
                markUsed(dr);
1023
                PdfDictionary fontsTop = dr.getAsDict(PdfName.FONT);
1024 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                if (fontsTop == null) {
1025
                  fontsTop = new PdfDictionary();
1026 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                  dr.put(PdfName.FONT, fontsTop);
1027
                }
1028 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
                markUsed(fontsTop);
1029
                PdfIndirectReference frefTop = (PdfIndirectReference) fontsTop.get(psn);
1030 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                if (frefTop != null) {
1031 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                  if (fref == null) {
1032 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                    fonts.put(psn, frefTop);
1033
                  }
1034 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                } else if (fref == null) {
1035
                  FontDetails fd;
1036 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                  if (bf.getFontType() == BaseFont.FONT_TYPE_DOCUMENT) {
1037
                    fd = new FontDetails(null, ((DocumentFont) bf).getIndirectReference(), bf);
1038
                  } else {
1039 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/BaseFont::setSubset → NO_COVERAGE
                    bf.setSubset(false);
1040
                    fd = writer.addSimple(bf);
1041
                    localFonts.put(psn.toString().substring(1), bf);
1042
                  }
1043 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                  fontsTop.put(psn, fd.getIndirectReference());
1044 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                  fonts.put(psn, fd.getIndirectReference());
1045
                }
1046
                ByteBuffer buf = cb.getInternalBuffer();
1047
                buf.append(psn.getBytes()).append(' ').append((Float) dao[DA_SIZE]).append(" Tf ");
1048 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                if (dao[DA_COLOR] != null) {
1049 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE
                  cb.setColorFill((Color) dao[DA_COLOR]);
1050
                }
1051
                PdfString s = new PdfString(cb.toString());
1052 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                item.getMerged(k).put(PdfName.DA, s);
1053 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                item.getWidget(k).put(PdfName.DA, s);
1054 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
                markUsed(item.getWidget(k));
1055
              }
1056
            }
1057
          }
1058
        }
1059 1 1. setFieldProperty : negated conditional → NO_COVERAGE
      } else if (name.equalsIgnoreCase("textcolor")) {
1060 2 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : negated conditional → NO_COVERAGE
        for (int k = 0; k < item.size(); ++k) {
1061 1 1. setFieldProperty : negated conditional → NO_COVERAGE
          if (hit.isHit(k)) {
1062
            merged = item.getMerged(k);
1063
            da = merged.getAsString(PdfName.DA);
1064 1 1. setFieldProperty : negated conditional → NO_COVERAGE
            if (da != null) {
1065
              Object[] dao = splitDAelements(da.toUnicodeString());
1066
              PdfAppearance cb = new PdfAppearance();
1067 1 1. setFieldProperty : negated conditional → NO_COVERAGE
              if (dao[DA_FONT] != null) {
1068
                ByteBuffer buf = cb.getInternalBuffer();
1069
                buf.append(new PdfName((String) dao[DA_FONT]).getBytes()).append(' ').append((Float) dao[DA_SIZE])
1070
                    .append(" Tf ");
1071 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE
                cb.setColorFill((Color) value);
1072
                PdfString s = new PdfString(cb.toString());
1073 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                item.getMerged(k).put(PdfName.DA, s);
1074 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                item.getWidget(k).put(PdfName.DA, s);
1075 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
                markUsed(item.getWidget(k));
1076
              }
1077
            }
1078
          }
1079
        }
1080 1 1. setFieldProperty : negated conditional → NO_COVERAGE
      } else if (name.equalsIgnoreCase("textsize")) {
1081 2 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : negated conditional → NO_COVERAGE
        for (int k = 0; k < item.size(); ++k) {
1082 1 1. setFieldProperty : negated conditional → NO_COVERAGE
          if (hit.isHit(k)) {
1083
            merged = item.getMerged(k);
1084
            da = merged.getAsString(PdfName.DA);
1085 1 1. setFieldProperty : negated conditional → NO_COVERAGE
            if (da != null) {
1086
              Object[] dao = splitDAelements(da.toUnicodeString());
1087
              PdfAppearance cb = new PdfAppearance();
1088 1 1. setFieldProperty : negated conditional → NO_COVERAGE
              if (dao[DA_FONT] != null) {
1089
                ByteBuffer buf = cb.getInternalBuffer();
1090
                buf.append(new PdfName((String) dao[DA_FONT]).getBytes()).append(' ').append((Float) value).append(" Tf ");
1091 1 1. setFieldProperty : negated conditional → NO_COVERAGE
                if (dao[DA_COLOR] != null) {
1092 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE
                  cb.setColorFill((Color) dao[DA_COLOR]);
1093
                }
1094
                PdfString s = new PdfString(cb.toString());
1095 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                item.getMerged(k).put(PdfName.DA, s);
1096 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
                item.getWidget(k).put(PdfName.DA, s);
1097 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
                markUsed(item.getWidget(k));
1098
              }
1099
            }
1100
          }
1101
        }
1102 2 1. setFieldProperty : negated conditional → NO_COVERAGE
2. setFieldProperty : negated conditional → NO_COVERAGE
      } else if (name.equalsIgnoreCase("bgcolor") || name.equalsIgnoreCase("bordercolor")) {
1103 1 1. setFieldProperty : negated conditional → NO_COVERAGE
        PdfName dname = (name.equalsIgnoreCase("bgcolor") ? PdfName.BG : PdfName.BC);
1104 2 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : negated conditional → NO_COVERAGE
        for (int k = 0; k < item.size(); ++k) {
1105 1 1. setFieldProperty : negated conditional → NO_COVERAGE
          if (hit.isHit(k)) {
1106
            merged = item.getMerged(k);
1107
            PdfDictionary mk = merged.getAsDict(PdfName.MK);
1108 1 1. setFieldProperty : negated conditional → NO_COVERAGE
            if (mk == null) {
1109 1 1. setFieldProperty : negated conditional → NO_COVERAGE
              if (value == null) {
1110 1 1. setFieldProperty : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
                return true;
1111
              }
1112
              mk = new PdfDictionary();
1113 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
              item.getMerged(k).put(PdfName.MK, mk);
1114 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
              item.getWidget(k).put(PdfName.MK, mk);
1115 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
              markUsed(item.getWidget(k));
1116
            } else {
1117 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
              markUsed(mk);
1118
            }
1119 1 1. setFieldProperty : negated conditional → NO_COVERAGE
            if (value == null) {
1120 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
              mk.remove(dname);
1121
            } else {
1122 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
              mk.put(dname, PdfFormField.getMKColor((Color) value));
1123
            }
1124
          }
1125
        }
1126
      } else {
1127 1 1. setFieldProperty : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return false;
1128
      }
1129 1 1. setFieldProperty : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return true;
1130
    } catch (Exception e) {
1131
      throw new ExceptionConverter(e);
1132
    }
1133
  }
1134
1135
  /**
1136
   * Sets a field property. Valid property names are:
1137
   * <p>
1138
   * <ul>
1139
   * <li>flags - a set of flags specifying various characteristics of the field's widget annotation.
1140
   * The value of this entry replaces that of the F entry in the form's corresponding annotation dictionary.<br>
1141
   * <li>setflags - a set of flags to be set (turned on) in the F entry of the form's corresponding
1142
   * widget annotation dictionary. Bits equal to 1 cause the corresponding bits in F to be set to 1.<br>
1143
   * <li>clrflags - a set of flags to be cleared (turned off) in the F entry of the form's corresponding
1144
   * widget annotation dictionary. Bits equal to 1 cause the corresponding bits in F to be set to 0.<br>
1145
   * <li>fflags - a set of flags specifying various characteristics of the field. The value
1146
   * of this entry replaces that of the Ff entry in the form's corresponding field dictionary.<br>
1147
   * <li>setfflags - a set of flags to be set (turned on) in the Ff entry of the form's corresponding
1148
   * field dictionary. Bits equal to 1 cause the corresponding bits in Ff to be set to 1.<br>
1149
   * <li>clrfflags - a set of flags to be cleared (turned off) in the Ff entry of the form's corresponding
1150
   * field dictionary. Bits equal to 1 cause the corresponding bits in Ff to be set to 0.<br>
1151
   * </ul>
1152
   *
1153
   * @param field the field name
1154
   * @param name the property name
1155
   * @param value the property value
1156
   * @param inst an array of <CODE>int</CODE> indexing into <CODE>AcroField.Item.merged</CODE> elements to process. Set to <CODE>null</CODE>
1157
   * to process all
1158
   * @return <CODE>true</CODE> if the property exists, <CODE>false</CODE> otherwise
1159
   */
1160
  public boolean setFieldProperty(String field, String name, int value, int[] inst) {
1161 1 1. setFieldProperty : negated conditional → NO_COVERAGE
    if (writer == null) {
1162
      throw new RuntimeException(MessageLocalization.getComposedMessage("this.acrofields.instance.is.read.only"));
1163
    }
1164
    Item item = fields.get(field);
1165 1 1. setFieldProperty : negated conditional → NO_COVERAGE
    if (item == null) {
1166 1 1. setFieldProperty : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1167
    }
1168
    InstHit hit = new InstHit(inst);
1169 1 1. setFieldProperty : negated conditional → NO_COVERAGE
    if (name.equalsIgnoreCase("flags")) {
1170
      PdfNumber num = new PdfNumber(value);
1171 2 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : negated conditional → NO_COVERAGE
      for (int k = 0; k < item.size(); ++k) {
1172 1 1. setFieldProperty : negated conditional → NO_COVERAGE
        if (hit.isHit(k)) {
1173 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          item.getMerged(k).put(PdfName.F, num);
1174 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          item.getWidget(k).put(PdfName.F, num);
1175 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
          markUsed(item.getWidget(k));
1176
        }
1177
      }
1178 1 1. setFieldProperty : negated conditional → NO_COVERAGE
    } else if (name.equalsIgnoreCase("setflags")) {
1179 3 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : Changed increment from 1 to -1 → NO_COVERAGE
3. setFieldProperty : negated conditional → NO_COVERAGE
      for (int k = 0; k < item.size(); ++k) {
1180 1 1. setFieldProperty : negated conditional → NO_COVERAGE
        if (hit.isHit(k)) {
1181
          PdfNumber num = item.getWidget(k).getAsNumber(PdfName.F);
1182
          int val = 0;
1183 1 1. setFieldProperty : negated conditional → NO_COVERAGE
          if (num != null) {
1184
            val = num.intValue();
1185
          }
1186 1 1. setFieldProperty : Replaced bitwise OR with AND → NO_COVERAGE
          num = new PdfNumber(val | value);
1187 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          item.getMerged(k).put(PdfName.F, num);
1188 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          item.getWidget(k).put(PdfName.F, num);
1189 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
          markUsed(item.getWidget(k));
1190
        }
1191
      }
1192 1 1. setFieldProperty : negated conditional → NO_COVERAGE
    } else if (name.equalsIgnoreCase("clrflags")) {
1193 3 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : Changed increment from 1 to -1 → NO_COVERAGE
3. setFieldProperty : negated conditional → NO_COVERAGE
      for (int k = 0; k < item.size(); ++k) {
1194 1 1. setFieldProperty : negated conditional → NO_COVERAGE
        if (hit.isHit(k)) {
1195
          PdfDictionary widget = item.getWidget(k);
1196
          PdfNumber num = widget.getAsNumber(PdfName.F);
1197
          int val = 0;
1198 1 1. setFieldProperty : negated conditional → NO_COVERAGE
          if (num != null) {
1199
            val = num.intValue();
1200
          }
1201 2 1. setFieldProperty : Replaced XOR with AND → NO_COVERAGE
2. setFieldProperty : Replaced bitwise AND with OR → NO_COVERAGE
          num = new PdfNumber(val & (~value));
1202 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          item.getMerged(k).put(PdfName.F, num);
1203 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          widget.put(PdfName.F, num);
1204 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
          markUsed(widget);
1205
        }
1206
      }
1207 1 1. setFieldProperty : negated conditional → NO_COVERAGE
    } else if (name.equalsIgnoreCase("fflags")) {
1208
      PdfNumber num = new PdfNumber(value);
1209 2 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : negated conditional → NO_COVERAGE
      for (int k = 0; k < item.size(); ++k) {
1210 1 1. setFieldProperty : negated conditional → NO_COVERAGE
        if (hit.isHit(k)) {
1211 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          item.getMerged(k).put(PdfName.FF, num);
1212 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          item.getValue(k).put(PdfName.FF, num);
1213 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
          markUsed(item.getValue(k));
1214
        }
1215
      }
1216 1 1. setFieldProperty : negated conditional → NO_COVERAGE
    } else if (name.equalsIgnoreCase("setfflags")) {
1217 3 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : Changed increment from 1 to -1 → NO_COVERAGE
3. setFieldProperty : negated conditional → NO_COVERAGE
      for (int k = 0; k < item.size(); ++k) {
1218 1 1. setFieldProperty : negated conditional → NO_COVERAGE
        if (hit.isHit(k)) {
1219
          PdfDictionary valDict = item.getValue(k);
1220
          PdfNumber num = valDict.getAsNumber(PdfName.FF);
1221
          int val = 0;
1222 1 1. setFieldProperty : negated conditional → NO_COVERAGE
          if (num != null) {
1223
            val = num.intValue();
1224
          }
1225 1 1. setFieldProperty : Replaced bitwise OR with AND → NO_COVERAGE
          num = new PdfNumber(val | value);
1226 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          item.getMerged(k).put(PdfName.FF, num);
1227 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          valDict.put(PdfName.FF, num);
1228 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
          markUsed(valDict);
1229
        }
1230
      }
1231 1 1. setFieldProperty : negated conditional → NO_COVERAGE
    } else if (name.equalsIgnoreCase("clrfflags")) {
1232 3 1. setFieldProperty : changed conditional boundary → NO_COVERAGE
2. setFieldProperty : Changed increment from 1 to -1 → NO_COVERAGE
3. setFieldProperty : negated conditional → NO_COVERAGE
      for (int k = 0; k < item.size(); ++k) {
1233 1 1. setFieldProperty : negated conditional → NO_COVERAGE
        if (hit.isHit(k)) {
1234
          PdfDictionary valDict = item.getValue(k);
1235
          PdfNumber num = valDict.getAsNumber(PdfName.FF);
1236
          int val = 0;
1237 1 1. setFieldProperty : negated conditional → NO_COVERAGE
          if (num != null) {
1238
            val = num.intValue();
1239
          }
1240 2 1. setFieldProperty : Replaced XOR with AND → NO_COVERAGE
2. setFieldProperty : Replaced bitwise AND with OR → NO_COVERAGE
          num = new PdfNumber(val & (~value));
1241 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          item.getMerged(k).put(PdfName.FF, num);
1242 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          valDict.put(PdfName.FF, num);
1243 1 1. setFieldProperty : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
          markUsed(valDict);
1244
        }
1245
      }
1246
    } else {
1247 1 1. setFieldProperty : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1248
    }
1249 1 1. setFieldProperty : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return true;
1250
  }
1251
1252
  /**
1253
   * Merges an XML data structure into this form.
1254
   *
1255
   * @param n the top node of the data structure
1256
   * @throws java.io.IOException on error
1257
   * @throws com.lowagie.text.DocumentException o error
1258
   */
1259
  public void mergeXfaData(Node n) throws IOException, DocumentException {
1260
    XfaForm.Xml2SomDatasets data = new XfaForm.Xml2SomDatasets(n);
1261
    for (Object o : data.getOrder()) {
1262
      String name = (String) o;
1263
      String text = XfaForm.getNodeText((Node) data.getName2Node().get(name));
1264
      setField(name, text);
1265
    }
1266
  }
1267
1268
  /**
1269
   * Sets the fields by FDF merging.
1270
   *
1271
   * @param fdf the FDF form
1272
   * @throws IOException on error
1273
   * @throws DocumentException on error
1274
   */
1275
  public void setFields(FdfReader fdf) throws IOException, DocumentException {
1276
    Map<String, PdfDictionary> fd = fdf.getFields();
1277
    for (String f : fd.keySet()) {
1278
      String v = fdf.getFieldValue(f);
1279 1 1. setFields : negated conditional → NO_COVERAGE
      if (v != null) {
1280
        setField(f, v);
1281
      }
1282
    }
1283
  }
1284
1285
  /**
1286
   * Allows merging the fields by a field reader. One use would be to set the fields by XFDF merging.
1287
   *
1288
   * @param fieldReader The fields to merge.
1289
   * @throws IOException on error
1290
   * @throws DocumentException on error
1291
   */
1292
  public void setFields(FieldReader fieldReader) throws IOException, DocumentException {
1293
    Map<String, String> fd = fieldReader.getFields();
1294
    for (String f : fd.keySet()) {
1295
      String v = fieldReader.getFieldValue(f);
1296 1 1. setFields : negated conditional → NO_COVERAGE
      if (v != null) {
1297
        setField(f, v);
1298
      }
1299
      List<String> list = fieldReader.getListValues(f);
1300 1 1. setFields : negated conditional → NO_COVERAGE
      if (list != null) {
1301
        setListSelection(v, list.toArray(new String[0]));
1302
      }
1303
    }
1304
  }
1305
1306
  /**
1307
   * Regenerates the field appearance. This is useful when you change a field property, but not its value, for instance
1308
   * form.setFieldProperty("f", "bgcolor", Color.BLUE, null); This won't have any effect, unless you use regenerateField("f") after changing
1309
   * the property.
1310
   *
1311
   * @param name the fully qualified field name or the partial name in the case of XFA forms
1312
   * @return <CODE>true</CODE> if the field was found and changed,
1313
   * <CODE>false</CODE> otherwise
1314
   * @throws IOException on error
1315
   * @throws DocumentException on error
1316
   */
1317
  public boolean regenerateField(String name) throws IOException, DocumentException {
1318
    String value = getField(name);
1319 1 1. regenerateField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return setField(name, value, value);
1320
  }
1321
1322
  /**
1323
   * Sets the field value.
1324
   *
1325
   * @param name the fully qualified field name or the partial name in the case of XFA forms
1326
   * @param value the field value
1327
   * @return <CODE>true</CODE> if the field was found and changed,
1328
   * <CODE>false</CODE> otherwise
1329
   * @throws IOException on error
1330
   * @throws DocumentException on error
1331
   */
1332
  public boolean setField(String name, String value) throws IOException, DocumentException {
1333 1 1. setField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return setField(name, value, null);
1334
  }
1335
1336
  /**
1337
   * Sets the field value and the display string. The display string is used to build the appearance in the cases where the value is
1338
   * modified by Acrobat with JavaScript and the algorithm is known.
1339
   *
1340
   * @param name the fully qualified field name or the partial name in the case of XFA forms
1341
   * @param value the field value
1342
   * @param display the string that is used for the appearance. If <CODE>null</CODE> the <CODE>value</CODE> parameter will be used
1343
   * @return <CODE>true</CODE> if the field was found and changed,
1344
   * <CODE>false</CODE> otherwise
1345
   * @throws IOException on error
1346
   * @throws DocumentException on error
1347
   */
1348
  public boolean setField(String name, String value, String display) throws IOException, DocumentException {
1349 1 1. setField : negated conditional → NO_COVERAGE
    if (writer == null) {
1350
      throw new DocumentException(MessageLocalization.getComposedMessage("this.acrofields.instance.is.read.only"));
1351
    }
1352 1 1. setField : negated conditional → NO_COVERAGE
    if (xfa.isXfaPresent()) {
1353
      name = xfa.findFieldName(name, this);
1354 1 1. setField : negated conditional → NO_COVERAGE
      if (name == null) {
1355 1 1. setField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return false;
1356
      }
1357
      String shortName = XfaForm.Xml2Som.getShortName(name);
1358
      Node xn = xfa.findDatasetsNode(shortName);
1359 1 1. setField : negated conditional → NO_COVERAGE
      if (xn == null) {
1360
        xn = xfa.getDatasetsSom().insertNode(xfa.getDatasetsNode(), shortName);
1361
      }
1362 1 1. setField : removed call to com/lowagie/text/pdf/XfaForm::setNodeText → NO_COVERAGE
      xfa.setNodeText(xn, value);
1363
    }
1364
    Item item = fields.get(name);
1365 1 1. setField : negated conditional → NO_COVERAGE
    if (item == null) {
1366 1 1. setField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1367
    }
1368
    PdfDictionary merged = item.getMerged(0);
1369
    PdfName type = merged.getAsName(PdfName.FT);
1370 1 1. setField : negated conditional → NO_COVERAGE
    if (PdfName.TX.equals(type)) {
1371
      PdfNumber maxLen = merged.getAsNumber(PdfName.MAXLEN);
1372
      int len = 0;
1373 1 1. setField : negated conditional → NO_COVERAGE
      if (maxLen != null) {
1374
        len = maxLen.intValue();
1375
      }
1376 2 1. setField : changed conditional boundary → NO_COVERAGE
2. setField : negated conditional → NO_COVERAGE
      if (len > 0) {
1377
        value = value.substring(0, Math.min(len, value.length()));
1378
      }
1379
    }
1380 1 1. setField : negated conditional → NO_COVERAGE
    if (display == null) {
1381
      display = value;
1382
    }
1383 2 1. setField : negated conditional → NO_COVERAGE
2. setField : negated conditional → NO_COVERAGE
    if (PdfName.TX.equals(type) || PdfName.CH.equals(type)) {
1384
      PdfString v = new PdfString(value, PdfObject.TEXT_UNICODE);
1385 2 1. setField : changed conditional boundary → NO_COVERAGE
2. setField : negated conditional → NO_COVERAGE
      for (int idx = 0; idx < item.size(); ++idx) {
1386
        PdfDictionary valueDic = item.getValue(idx);
1387 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        valueDic.put(PdfName.V, v);
1388 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
        valueDic.remove(PdfName.I);
1389 1 1. setField : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
        markUsed(valueDic);
1390
        merged = item.getMerged(idx);
1391 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
        merged.remove(PdfName.I);
1392 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        merged.put(PdfName.V, v);
1393
        PdfDictionary widget = item.getWidget(idx);
1394 1 1. setField : negated conditional → NO_COVERAGE
        if (generateAppearances) {
1395
          PdfAppearance app = getAppearance(merged, display, name);
1396 1 1. setField : negated conditional → NO_COVERAGE
          if (PdfName.CH.equals(type)) {
1397
            PdfNumber n = new PdfNumber(topFirst);
1398 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            widget.put(PdfName.TI, n);
1399 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            merged.put(PdfName.TI, n);
1400
          }
1401
          PdfDictionary appDic = widget.getAsDict(PdfName.AP);
1402 1 1. setField : negated conditional → NO_COVERAGE
          if (appDic == null) {
1403
            appDic = new PdfDictionary();
1404 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            widget.put(PdfName.AP, appDic);
1405 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
            merged.put(PdfName.AP, appDic);
1406
          }
1407 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          appDic.put(PdfName.N, app.getIndirectReference());
1408 1 1. setField : removed call to com/lowagie/text/pdf/PdfWriter::releaseTemplate → NO_COVERAGE
          writer.releaseTemplate(app);
1409
        } else {
1410 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
          widget.remove(PdfName.AP);
1411 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
          merged.remove(PdfName.AP);
1412
        }
1413 1 1. setField : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
        markUsed(widget);
1414
      }
1415 1 1. setField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return true;
1416 1 1. setField : negated conditional → NO_COVERAGE
    } else if (PdfName.BTN.equals(type)) {
1417
      PdfNumber ff = item.getMerged(0).getAsNumber(PdfName.FF);
1418
      int flags = 0;
1419 1 1. setField : negated conditional → NO_COVERAGE
      if (ff != null) {
1420
        flags = ff.intValue();
1421
      }
1422 2 1. setField : Replaced bitwise AND with OR → NO_COVERAGE
2. setField : negated conditional → NO_COVERAGE
      if ((flags & PdfFormField.FF_PUSHBUTTON) != 0) {
1423
        //we'll assume that the value is an image in base64
1424
        Image img;
1425
        try {
1426
          img = Image.getInstance(Base64.getDecoder().decode(value));
1427
        } catch (Exception e) {
1428 1 1. setField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
          return false;
1429
        }
1430
        PushbuttonField pb = getNewPushbuttonFromField(name);
1431 1 1. setField : removed call to com/lowagie/text/pdf/PushbuttonField::setImage → NO_COVERAGE
        pb.setImage(img);
1432
        replacePushbuttonField(name, pb.getField());
1433 1 1. setField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return true;
1434
      }
1435
      PdfName v = new PdfName(value);
1436
      List<String> lopt = new ArrayList<>();
1437
      PdfArray opts = item.getValue(0).getAsArray(PdfName.OPT);
1438 1 1. setField : negated conditional → NO_COVERAGE
      if (opts != null) {
1439 2 1. setField : changed conditional boundary → NO_COVERAGE
2. setField : negated conditional → NO_COVERAGE
        for (int k = 0; k < opts.size(); ++k) {
1440
          PdfString valStr = opts.getAsString(k);
1441 1 1. setField : negated conditional → NO_COVERAGE
          if (valStr != null) {
1442
            lopt.add(valStr.toUnicodeString());
1443
          } else {
1444
            lopt.add(null);
1445
          }
1446
        }
1447
      }
1448
      int vidx = lopt.indexOf(value);
1449
      PdfName vt;
1450 2 1. setField : changed conditional boundary → NO_COVERAGE
2. setField : negated conditional → NO_COVERAGE
      if (vidx >= 0) {
1451
        vt = new PdfName(String.valueOf(vidx));
1452
      } else {
1453
        vt = v;
1454
      }
1455 2 1. setField : changed conditional boundary → NO_COVERAGE
2. setField : negated conditional → NO_COVERAGE
      for (int idx = 0; idx < item.size(); ++idx) {
1456
        merged = item.getMerged(idx);
1457
        PdfDictionary widget = item.getWidget(idx);
1458
        PdfDictionary valDict = item.getValue(idx);
1459 1 1. setField : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
        markUsed(item.getValue(idx));
1460 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        valDict.put(PdfName.V, vt);
1461 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        merged.put(PdfName.V, vt);
1462 1 1. setField : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
        markUsed(widget);
1463 1 1. setField : negated conditional → NO_COVERAGE
        if (isInAP(widget, vt)) {
1464 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          merged.put(PdfName.AS, vt);
1465 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          widget.put(PdfName.AS, vt);
1466
        } else {
1467 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          merged.put(PdfName.AS, PdfName.Off);
1468 1 1. setField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          widget.put(PdfName.AS, PdfName.Off);
1469
        }
1470
      }
1471 1 1. setField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return true;
1472
    }
1473 1 1. setField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return false;
1474
  }
1475
1476
  /**
1477
   * Sets different values in a list selection. No appearance is generated yet; nor does the code check if multiple select is allowed.
1478
   *
1479
   * @param  name  the name of the field
1480
   * @param  value  an array with values that need to be selected
1481
   * @return true only if the field value was changed
1482
   * @since 2.1.4
1483
   */
1484
  public boolean setListSelection(String name, String[] value) throws IOException, DocumentException {
1485
    Item item = getFieldItem(name);
1486 1 1. setListSelection : negated conditional → NO_COVERAGE
    if (item == null) {
1487 1 1. setListSelection : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1488
    }
1489
    PdfDictionary merged = item.getMerged(0);
1490
    PdfName type = merged.getAsName(PdfName.FT);
1491 1 1. setListSelection : negated conditional → NO_COVERAGE
    if (!PdfName.CH.equals(type)) {
1492 1 1. setListSelection : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1493
    }
1494
    String[] options = getListOptionExport(name);
1495
    PdfArray array = new PdfArray();
1496
    for (String s1 : value) {
1497 2 1. setListSelection : changed conditional boundary → NO_COVERAGE
2. setListSelection : negated conditional → NO_COVERAGE
      for (int j = 0; j < options.length; j++) {
1498 1 1. setListSelection : negated conditional → NO_COVERAGE
        if (options[j].equals(s1)) {
1499
          array.add(new PdfNumber(j));
1500
          break;
1501
        }
1502
      }
1503
    }
1504 1 1. setListSelection : removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE
    item.writeToAll(PdfName.I, array, Item.WRITE_MERGED | Item.WRITE_VALUE);
1505
1506
    PdfArray vals = new PdfArray();
1507
    for (String s : value) {
1508
      vals.add(new PdfString(s));
1509
    }
1510 1 1. setListSelection : removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE
    item.writeToAll(PdfName.V, vals, Item.WRITE_MERGED | Item.WRITE_VALUE);
1511
1512
    PdfAppearance app = getAppearance(merged, value, name);
1513
1514
    PdfDictionary apDic = new PdfDictionary();
1515 1 1. setListSelection : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
    apDic.put(PdfName.N, app.getIndirectReference());
1516 1 1. setListSelection : removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE
    item.writeToAll(PdfName.AP, apDic, Item.WRITE_MERGED | Item.WRITE_WIDGET);
1517
1518 1 1. setListSelection : removed call to com/lowagie/text/pdf/PdfWriter::releaseTemplate → NO_COVERAGE
    writer.releaseTemplate(app);
1519
1520 1 1. setListSelection : removed call to com/lowagie/text/pdf/AcroFields$Item::markUsed → NO_COVERAGE
    item.markUsed(this, Item.WRITE_VALUE | Item.WRITE_WIDGET);
1521 1 1. setListSelection : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return true;
1522
  }
1523
1524
  boolean isInAP(PdfDictionary dic, PdfName check) {
1525
    PdfDictionary appDic = dic.getAsDict(PdfName.AP);
1526 1 1. isInAP : negated conditional → NO_COVERAGE
    if (appDic == null) {
1527 1 1. isInAP : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1528
    }
1529
    PdfDictionary NDic = appDic.getAsDict(PdfName.N);
1530 3 1. isInAP : negated conditional → NO_COVERAGE
2. isInAP : negated conditional → NO_COVERAGE
3. isInAP : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return (NDic != null && NDic.get(check) != null);
1531
  }
1532
1533
  /**
1534
   * Gets all the fields. The fields are keyed by the fully qualified field name and the value is an instance of
1535
   * <CODE>AcroFields.Item</CODE>.
1536
   *
1537
   * @return all the fields
1538
   */
1539
  public Map<String, Item> getFields() {
1540
    return fields;
1541
  }
1542
1543
  /**
1544
   * Gets the field structure.
1545
   *
1546
   * @param name the name of the field
1547
   * @return the field structure or <CODE>null</CODE> if the field does not exist
1548
   */
1549
  public Item getFieldItem(String name) {
1550 1 1. getFieldItem : negated conditional → NO_COVERAGE
    if (xfa.isXfaPresent()) {
1551
      name = xfa.findFieldName(name, this);
1552 1 1. getFieldItem : negated conditional → NO_COVERAGE
      if (name == null) {
1553 1 1. getFieldItem : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getFieldItem to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return null;
1554
      }
1555
    }
1556 1 1. getFieldItem : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getFieldItem to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return fields.get(name);
1557
  }
1558
1559
  /**
1560
   * Gets the long XFA translated name.
1561
   *
1562
   * @param name the name of the field
1563
   * @return the long field name
1564
   */
1565
  public String getTranslatedFieldName(String name) {
1566 1 1. getTranslatedFieldName : negated conditional → NO_COVERAGE
    if (xfa.isXfaPresent()) {
1567
      String namex = xfa.findFieldName(name, this);
1568 1 1. getTranslatedFieldName : negated conditional → NO_COVERAGE
      if (namex != null) {
1569
        name = namex;
1570
      }
1571
    }
1572 1 1. getTranslatedFieldName : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getTranslatedFieldName to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return name;
1573
  }
1574
1575
  /**
1576
   * Gets the field box positions in the document. The return is an array of <CODE>float</CODE> multiple of 5. For each of this groups the
1577
   * values are: [page, llx, lly, urx, ury]. The coordinates have the page rotation in consideration.
1578
   *
1579
   * @param name the field name
1580
   * @return the positions or <CODE>null</CODE> if field does not exist
1581
   */
1582
  public float[] getFieldPositions(String name) {
1583
    Item item = getFieldItem(name);
1584 1 1. getFieldPositions : negated conditional → NO_COVERAGE
    if (item == null) {
1585 1 1. getFieldPositions : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getFieldPositions to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return null;
1586
    }
1587 1 1. getFieldPositions : Replaced integer multiplication with division → NO_COVERAGE
    float[] ret = new float[item.size() * 5];
1588
    int ptr = 0;
1589 3 1. getFieldPositions : changed conditional boundary → NO_COVERAGE
2. getFieldPositions : Changed increment from 1 to -1 → NO_COVERAGE
3. getFieldPositions : negated conditional → NO_COVERAGE
    for (int k = 0; k < item.size(); ++k) {
1590
      try {
1591
        PdfDictionary wd = item.getWidget(k);
1592
        PdfArray rect = wd.getAsArray(PdfName.RECT);
1593 1 1. getFieldPositions : negated conditional → NO_COVERAGE
        if (rect == null) {
1594
          continue;
1595
        }
1596
        Rectangle r = PdfReader.getNormalizedRectangle(rect);
1597
        int page = item.getPage(k);
1598
        int rotation = reader.getPageRotation(page);
1599 1 1. getFieldPositions : Changed increment from 1 to -1 → NO_COVERAGE
        ret[ptr++] = page;
1600 1 1. getFieldPositions : negated conditional → NO_COVERAGE
        if (rotation != 0) {
1601
          Rectangle pageSize = reader.getPageSize(page);
1602
          switch (rotation) {
1603
            case 270:
1604
              r = new Rectangle(
1605 1 1. getFieldPositions : Replaced float subtraction with addition → NO_COVERAGE
                  pageSize.getTop() - r.getBottom(),
1606
                  r.getLeft(),
1607 1 1. getFieldPositions : Replaced float subtraction with addition → NO_COVERAGE
                  pageSize.getTop() - r.getTop(),
1608
                  r.getRight());
1609
              break;
1610
            case 180:
1611
              r = new Rectangle(
1612 1 1. getFieldPositions : Replaced float subtraction with addition → NO_COVERAGE
                  pageSize.getRight() - r.getLeft(),
1613 1 1. getFieldPositions : Replaced float subtraction with addition → NO_COVERAGE
                  pageSize.getTop() - r.getBottom(),
1614 1 1. getFieldPositions : Replaced float subtraction with addition → NO_COVERAGE
                  pageSize.getRight() - r.getRight(),
1615 1 1. getFieldPositions : Replaced float subtraction with addition → NO_COVERAGE
                  pageSize.getTop() - r.getTop());
1616
              break;
1617
            case 90:
1618
              r = new Rectangle(
1619
                  r.getBottom(),
1620 1 1. getFieldPositions : Replaced float subtraction with addition → NO_COVERAGE
                  pageSize.getRight() - r.getLeft(),
1621
                  r.getTop(),
1622 1 1. getFieldPositions : Replaced float subtraction with addition → NO_COVERAGE
                  pageSize.getRight() - r.getRight());
1623
              break;
1624
          }
1625 1 1. getFieldPositions : removed call to com/lowagie/text/Rectangle::normalize → NO_COVERAGE
          r.normalize();
1626
        }
1627 1 1. getFieldPositions : Changed increment from 1 to -1 → NO_COVERAGE
        ret[ptr++] = r.getLeft();
1628 1 1. getFieldPositions : Changed increment from 1 to -1 → NO_COVERAGE
        ret[ptr++] = r.getBottom();
1629 1 1. getFieldPositions : Changed increment from 1 to -1 → NO_COVERAGE
        ret[ptr++] = r.getRight();
1630 1 1. getFieldPositions : Changed increment from 1 to -1 → NO_COVERAGE
        ret[ptr++] = r.getTop();
1631
      } catch (Exception e) {
1632
        // empty on purpose
1633
      }
1634
    }
1635 2 1. getFieldPositions : changed conditional boundary → NO_COVERAGE
2. getFieldPositions : negated conditional → NO_COVERAGE
    if (ptr < ret.length) {
1636
      float[] ret2 = new float[ptr];
1637 1 1. getFieldPositions : removed call to java/lang/System::arraycopy → NO_COVERAGE
      System.arraycopy(ret, 0, ret2, 0, ptr);
1638 1 1. getFieldPositions : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getFieldPositions to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return ret2;
1639
    }
1640 1 1. getFieldPositions : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getFieldPositions to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return ret;
1641
  }
1642
1643
  private int removeRefFromArray(PdfArray array, PdfObject refo) {
1644 2 1. removeRefFromArray : negated conditional → NO_COVERAGE
2. removeRefFromArray : negated conditional → NO_COVERAGE
    if (refo == null || !refo.isIndirect()) {
1645 1 1. removeRefFromArray : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return array.size();
1646
    }
1647
    PdfIndirectReference ref = (PdfIndirectReference) refo;
1648 2 1. removeRefFromArray : changed conditional boundary → NO_COVERAGE
2. removeRefFromArray : negated conditional → NO_COVERAGE
    for (int j = 0; j < array.size(); ++j) {
1649
      PdfObject obj = array.getPdfObject(j);
1650 1 1. removeRefFromArray : negated conditional → NO_COVERAGE
      if (!obj.isIndirect()) {
1651
        continue;
1652
      }
1653 1 1. removeRefFromArray : negated conditional → NO_COVERAGE
      if (((PdfIndirectReference) obj).getNumber() == ref.getNumber()) {
1654 1 1. removeRefFromArray : Changed increment from -1 to 1 → NO_COVERAGE
        array.remove(j--);
1655
      }
1656
    }
1657 1 1. removeRefFromArray : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return array.size();
1658
  }
1659
1660
  /**
1661
   * Removes all the fields from <CODE>page</CODE>.
1662
   *
1663
   * @param page the page to remove the fields from
1664
   * @return <CODE>true</CODE> if any field was removed, <CODE>false otherwise</CODE>
1665
   */
1666
  public boolean removeFieldsFromPage(int page) {
1667 2 1. removeFieldsFromPage : changed conditional boundary → NO_COVERAGE
2. removeFieldsFromPage : negated conditional → NO_COVERAGE
    if (page < 1) {
1668 1 1. removeFieldsFromPage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1669
    }
1670
    String[] names = new String[fields.size()];
1671
    fields.keySet().toArray(names);
1672
    boolean found = false;
1673
    for (String name : names) {
1674
      boolean fr = removeField(name, page);
1675 2 1. removeFieldsFromPage : negated conditional → NO_COVERAGE
2. removeFieldsFromPage : negated conditional → NO_COVERAGE
      found = (found || fr);
1676
    }
1677 1 1. removeFieldsFromPage : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return found;
1678
  }
1679
1680
  /**
1681
   * Removes a field from the document. If page equals -1 all the fields with this
1682
   * <CODE>name</CODE> are removed from the document otherwise only the fields in
1683
   * that particular page are removed.
1684
   *
1685
   * @param name the field name
1686
   * @param page the page to remove the field from or -1 to remove it from all the pages
1687
   * @return <CODE>true</CODE> if the field exists, <CODE>false otherwise</CODE>
1688
   */
1689
  public boolean removeField(String name, int page) {
1690
    Item item = getFieldItem(name);
1691 1 1. removeField : negated conditional → NO_COVERAGE
    if (item == null) {
1692 1 1. removeField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1693
    }
1694
    PdfDictionary acroForm = (PdfDictionary) PdfReader.getPdfObject(reader.getCatalog().get(PdfName.ACROFORM), reader.getCatalog());
1695
1696 1 1. removeField : negated conditional → NO_COVERAGE
    if (acroForm == null) {
1697 1 1. removeField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1698
    }
1699
    PdfArray arrayf = acroForm.getAsArray(PdfName.FIELDS);
1700 1 1. removeField : negated conditional → NO_COVERAGE
    if (arrayf == null) {
1701 1 1. removeField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
1702
    }
1703 3 1. removeField : changed conditional boundary → NO_COVERAGE
2. removeField : Changed increment from 1 to -1 → NO_COVERAGE
3. removeField : negated conditional → NO_COVERAGE
    for (int k = 0; k < item.size(); ++k) {
1704
      int pageV = item.getPage(k);
1705 2 1. removeField : negated conditional → NO_COVERAGE
2. removeField : negated conditional → NO_COVERAGE
      if (page != -1 && page != pageV) {
1706
        continue;
1707
      }
1708
      PdfIndirectReference ref = item.getWidgetRef(k);
1709
      PdfDictionary wd = item.getWidget(k);
1710
      PdfDictionary pageDic = reader.getPageN(pageV);
1711
      PdfArray annots = pageDic.getAsArray(PdfName.ANNOTS);
1712 1 1. removeField : negated conditional → NO_COVERAGE
      if (annots != null) {
1713 1 1. removeField : negated conditional → NO_COVERAGE
        if (removeRefFromArray(annots, ref) == 0) {
1714 1 1. removeField : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
          pageDic.remove(PdfName.ANNOTS);
1715 1 1. removeField : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
          markUsed(pageDic);
1716
        } else {
1717 1 1. removeField : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
          markUsed(annots);
1718
        }
1719
      }
1720
      PdfReader.killIndirect(ref);
1721
      PdfIndirectReference kid = ref;
1722 1 1. removeField : negated conditional → NO_COVERAGE
      while ((ref = wd.getAsIndirectObject(PdfName.PARENT)) != null) {
1723
        wd = wd.getAsDict(PdfName.PARENT);
1724
        PdfArray kids = wd.getAsArray(PdfName.KIDS);
1725 1 1. removeField : negated conditional → NO_COVERAGE
        if (removeRefFromArray(kids, kid) != 0) {
1726
          break;
1727
        }
1728
        kid = ref;
1729
        PdfReader.killIndirect(ref);
1730
      }
1731 1 1. removeField : negated conditional → NO_COVERAGE
      if (ref == null) {
1732
        removeRefFromArray(arrayf, kid);
1733 1 1. removeField : removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE
        markUsed(arrayf);
1734
      }
1735 1 1. removeField : negated conditional → NO_COVERAGE
      if (page != -1) {
1736 1 1. removeField : removed call to com/lowagie/text/pdf/AcroFields$Item::remove → NO_COVERAGE
        item.remove(k);
1737 1 1. removeField : Changed increment from -1 to 1 → NO_COVERAGE
        --k;
1738
      }
1739
    }
1740 2 1. removeField : negated conditional → NO_COVERAGE
2. removeField : negated conditional → NO_COVERAGE
    if (page == -1 || item.size() == 0) {
1741
      fields.remove(name);
1742
    }
1743 1 1. removeField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return true;
1744
  }
1745
1746
  /**
1747
   * Removes a field from the document.
1748
   *
1749
   * @param name the field name
1750
   * @return <CODE>true</CODE> if the field exists, <CODE>false otherwise</CODE>
1751
   */
1752
  public boolean removeField(String name) {
1753 1 1. removeField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return removeField(name, -1);
1754
  }
1755
1756
  /**
1757
   * Gets the property generateAppearances.
1758
   *
1759
   * @return the property generateAppearances
1760
   */
1761
  public boolean isGenerateAppearances() {
1762
    return generateAppearances;
1763
  }
1764
1765
  /**
1766
   * Sets the option to generate appearances. Not generating appearances will speed-up form filling but the results can be unexpected in
1767
   * Acrobat. Don't use it unless your environment is well controlled. The default is <CODE>true</CODE>.
1768
   *
1769
   * @param generateAppearances the option to generate appearances
1770
   */
1771
  public void setGenerateAppearances(boolean generateAppearances) {
1772
    this.generateAppearances = generateAppearances;
1773
    PdfDictionary top = reader.getCatalog().getAsDict(PdfName.ACROFORM);
1774 1 1. setGenerateAppearances : negated conditional → NO_COVERAGE
    if (generateAppearances) {
1775 1 1. setGenerateAppearances : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
      top.remove(PdfName.NEEDAPPEARANCES);
1776
    } else {
1777 1 1. setGenerateAppearances : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
      top.put(PdfName.NEEDAPPEARANCES, PdfBoolean.PDFTRUE);
1778
    }
1779
  }
1780
1781
  /**
1782
   * The field representations for retrieval and modification.
1783
   */
1784
  public static class Item {
1785
1786
    /**
1787
     * <CODE>writeToAll</CODE> constant.
1788
     *
1789
     * @since 2.1.5
1790
     */
1791
    public static final int WRITE_MERGED = 1;
1792
1793
    /**
1794
     * <CODE>writeToAll</CODE> and <CODE>markUsed</CODE> constant.
1795
     *
1796
     * @since 2.1.5
1797
     */
1798
    public static final int WRITE_WIDGET = 2;
1799
1800
    /**
1801
     * <CODE>writeToAll</CODE> and <CODE>markUsed</CODE> constant.
1802
     *
1803
     * @since 2.1.5
1804
     */
1805
    public static final int WRITE_VALUE = 4;
1806
1807
    /**
1808
     * This function writes the given key/value pair to all the instances of merged, widget, and/or value, depending on the
1809
     * <code>writeFlags</code> setting
1810
     *
1811
     * @param key you'll never guess what this is for.
1812
     * @param value if value is null, the key will be removed
1813
     * @param writeFlags ORed together WRITE_* flags
1814
     * @since 2.1.5
1815
     */
1816
    public void writeToAll(PdfName key, PdfObject value, int writeFlags) {
1817
      int i;
1818
      PdfDictionary curDict = null;
1819 2 1. writeToAll : Replaced bitwise AND with OR → NO_COVERAGE
2. writeToAll : negated conditional → NO_COVERAGE
      if ((writeFlags & WRITE_MERGED) != 0) {
1820 2 1. writeToAll : changed conditional boundary → NO_COVERAGE
2. writeToAll : negated conditional → NO_COVERAGE
        for (i = 0; i < merged.size(); ++i) {
1821
          curDict = getMerged(i);
1822 1 1. writeToAll : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          curDict.put(key, value);
1823
        }
1824
      }
1825 2 1. writeToAll : Replaced bitwise AND with OR → NO_COVERAGE
2. writeToAll : negated conditional → NO_COVERAGE
      if ((writeFlags & WRITE_WIDGET) != 0) {
1826 2 1. writeToAll : changed conditional boundary → NO_COVERAGE
2. writeToAll : negated conditional → NO_COVERAGE
        for (i = 0; i < widgets.size(); ++i) {
1827
          curDict = getWidget(i);
1828 1 1. writeToAll : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          curDict.put(key, value);
1829
        }
1830
      }
1831 2 1. writeToAll : Replaced bitwise AND with OR → NO_COVERAGE
2. writeToAll : negated conditional → NO_COVERAGE
      if ((writeFlags & WRITE_VALUE) != 0) {
1832 2 1. writeToAll : changed conditional boundary → NO_COVERAGE
2. writeToAll : negated conditional → NO_COVERAGE
        for (i = 0; i < values.size(); ++i) {
1833
          curDict = getValue(i);
1834 1 1. writeToAll : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
          curDict.put(key, value);
1835
        }
1836
      }
1837
    }
1838
1839
    /**
1840
     * Mark all the item dictionaries used matching the given flags
1841
     *
1842
     * @param writeFlags WRITE_MERGED is ignored
1843
     * @since 2.1.5
1844
     */
1845
    public void markUsed(AcroFields parentFields, int writeFlags) {
1846 2 1. markUsed : Replaced bitwise AND with OR → NO_COVERAGE
2. markUsed : negated conditional → NO_COVERAGE
      if ((writeFlags & WRITE_VALUE) != 0) {
1847 2 1. markUsed : changed conditional boundary → NO_COVERAGE
2. markUsed : negated conditional → NO_COVERAGE
        for (int i = 0; i < size(); ++i) {
1848 1 1. markUsed : removed call to com/lowagie/text/pdf/AcroFields::access$000 → NO_COVERAGE
          parentFields.markUsed(getValue(i));
1849
        }
1850
      }
1851 2 1. markUsed : Replaced bitwise AND with OR → NO_COVERAGE
2. markUsed : negated conditional → NO_COVERAGE
      if ((writeFlags & WRITE_WIDGET) != 0) {
1852 2 1. markUsed : changed conditional boundary → NO_COVERAGE
2. markUsed : negated conditional → NO_COVERAGE
        for (int i = 0; i < size(); ++i) {
1853 1 1. markUsed : removed call to com/lowagie/text/pdf/AcroFields::access$000 → NO_COVERAGE
          parentFields.markUsed(getWidget(i));
1854
        }
1855
      }
1856
    }
1857
1858
    /**
1859
     * An array of <CODE>PdfDictionary</CODE> where the value tag /V is present.
1860
     *
1861
     * @deprecated (will remove ' public ' in the future)
1862
     */
1863
    public List<PdfDictionary> values = new ArrayList<>();
1864
1865
    /**
1866
     * An array of <CODE>PdfDictionary</CODE> with the widgets.
1867
     *
1868
     * @deprecated (will remove ' public ' in the future)
1869
     */
1870
    public List<PdfDictionary> widgets = new ArrayList<>();
1871
1872
    /**
1873
     * An array of <CODE>PdfDictionary</CODE> with the widget references.
1874
     *
1875
     * @deprecated (will remove ' public ' in the future)
1876
     */
1877
    public List<PdfIndirectReference> widgetRefs = new ArrayList<>();
1878
1879
    /**
1880
     * An array of <CODE>PdfDictionary</CODE> with all the field and widget tags merged.
1881
     *
1882
     * @deprecated (will remove ' public ' in the future)
1883
     */
1884
    public List<PdfDictionary> merged = new ArrayList<>();
1885
1886
    /**
1887
     * An array of <CODE>Integer</CODE> with the page numbers where the widgets are displayed.
1888
     *
1889
     * @deprecated (will remove ' public ' in the future)
1890
     */
1891
    public List<Integer> page = new ArrayList<>();
1892
    /**
1893
     * An array of <CODE>Integer</CODE> with the tab order of the field in the page.
1894
     *
1895
     * @deprecated (will remove ' public ' in the future)
1896
     */
1897
    public List<Integer> tabOrder = new ArrayList<>();
1898
1899
    /**
1900
     * Preferred method of determining the number of instances of a given field.
1901
     *
1902
     * @return number of instances
1903
     * @since 2.1.5
1904
     */
1905
    public int size() {
1906
      return values.size();
1907
    }
1908
1909
    /**
1910
     * Remove the given instance from this item.  It is possible to remove all instances using this function.
1911
     *
1912
     * @since 2.1.5
1913
     */
1914
    void remove(int killIdx) {
1915
      values.remove(killIdx);
1916
      widgets.remove(killIdx);
1917
      widgetRefs.remove(killIdx);
1918
      merged.remove(killIdx);
1919
      page.remove(killIdx);
1920
      tabOrder.remove(killIdx);
1921
    }
1922
1923
    /**
1924
     * Retrieve the value dictionary of the given instance
1925
     *
1926
     * @param idx instance index
1927
     * @return dictionary storing this instance's value.  It may be shared across instances.
1928
     * @since 2.1.5
1929
     */
1930
    public PdfDictionary getValue(int idx) {
1931 1 1. getValue : mutated return of Object value for com/lowagie/text/pdf/AcroFields$Item::getValue to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return values.get(idx);
1932
    }
1933
1934
    /**
1935
     * Add a value dict to this Item
1936
     *
1937
     * @param value new value dictionary
1938
     * @since 2.1.5
1939
     */
1940
    void addValue(PdfDictionary value) {
1941
      values.add(value);
1942
    }
1943
1944
    /**
1945
     * Retrieve the widget dictionary of the given instance
1946
     *
1947
     * @param idx instance index
1948
     * @return The dictionary found in the appropriate page's Annot array.
1949
     * @since 2.1.5
1950
     */
1951
    public PdfDictionary getWidget(int idx) {
1952 1 1. getWidget : mutated return of Object value for com/lowagie/text/pdf/AcroFields$Item::getWidget to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return widgets.get(idx);
1953
    }
1954
1955
    /**
1956
     * Add a widget dict to this Item
1957
     *
1958
     * @since 2.1.5
1959
     */
1960
    void addWidget(PdfDictionary widget) {
1961
      widgets.add(widget);
1962
    }
1963
1964
    /**
1965
     * Retrieve the reference to the given instance
1966
     *
1967
     * @param idx instance index
1968
     * @return reference to the given field instance
1969
     * @since 2.1.5
1970
     */
1971
    public PdfIndirectReference getWidgetRef(int idx) {
1972 1 1. getWidgetRef : mutated return of Object value for com/lowagie/text/pdf/AcroFields$Item::getWidgetRef to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return widgetRefs.get(idx);
1973
    }
1974
1975
    /**
1976
     * Add a widget ref to this Item
1977
     *
1978
     * @since 2.1.5
1979
     */
1980
    void addWidgetRef(PdfIndirectReference widgRef) {
1981
      widgetRefs.add(widgRef);
1982
    }
1983
1984
    /**
1985
     * Retrieve the merged dictionary for the given instance.  The merged dictionary contains all the keys present in parent fields, though
1986
     * they may have been overwritten (or modified?) by children. Example: a merged radio field dict will contain /V
1987
     *
1988
     * @param idx instance index
1989
     * @return the merged dictionary for the given instance
1990
     * @since 2.1.5
1991
     */
1992
    public PdfDictionary getMerged(int idx) {
1993 1 1. getMerged : mutated return of Object value for com/lowagie/text/pdf/AcroFields$Item::getMerged to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return merged.get(idx);
1994
    }
1995
1996
    /**
1997
     * Adds a merged dictionary to this Item.
1998
     *
1999
     * @since 2.1.5
2000
     */
2001
    void addMerged(PdfDictionary mergeDict) {
2002
      merged.add(mergeDict);
2003
    }
2004
2005
    /**
2006
     * Retrieve the page number of the given instance
2007
     *
2008
     * @return remember, pages are "1-indexed", not "0-indexed" like field instances.
2009
     * @since 2.1.5
2010
     */
2011
    public Integer getPage(int idx) {
2012 1 1. getPage : mutated return of Object value for com/lowagie/text/pdf/AcroFields$Item::getPage to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return page.get(idx);
2013
    }
2014
2015
    /**
2016
     * Adds a page to the current Item.
2017
     *
2018
     * @since 2.1.5
2019
     */
2020
    void addPage(int pg) {
2021
      page.add(pg);
2022
    }
2023
2024
    /**
2025
     * forces a page value into the Item.
2026
     *
2027
     * @since 2.1.5
2028
     */
2029
    void forcePage(int idx, int pg) {
2030
      page.set(idx, pg);
2031
    }
2032
2033
    /**
2034
     * Gets the tabOrder.
2035
     *
2036
     * @return tab index of the given field instance
2037
     * @since 2.1.5
2038
     */
2039
    public Integer getTabOrder(int idx) {
2040 1 1. getTabOrder : mutated return of Object value for com/lowagie/text/pdf/AcroFields$Item::getTabOrder to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return tabOrder.get(idx);
2041
    }
2042
2043
    /**
2044
     * Adds a tab order value to this Item.
2045
     *
2046
     * @since 2.1.5
2047
     */
2048
    void addTabOrder(int order) {
2049
      tabOrder.add(order);
2050
    }
2051
  }
2052
2053
  private static class InstHit {
2054
2055
    IntHashtable hits;
2056
2057
    public InstHit(int[] inst) {
2058 1 1. : negated conditional → NO_COVERAGE
      if (inst == null) {
2059
        return;
2060
      }
2061
      hits = new IntHashtable();
2062
      for (int i : inst) {
2063
        hits.put(i, 1);
2064
      }
2065
    }
2066
2067
    public boolean isHit(int n) {
2068 1 1. isHit : negated conditional → NO_COVERAGE
      if (hits == null) {
2069 1 1. isHit : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return true;
2070
      }
2071 1 1. isHit : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return hits.containsKey(n);
2072
    }
2073
  }
2074
2075
  /**
2076
   * Gets the field names that have signatures and are signed.
2077
   *
2078
   * @return the field names that have signatures and are signed
2079
   */
2080
  public List<String> getSignatureNames() {
2081 1 1. getSignatureNames : negated conditional → NO_COVERAGE
    if (sigNames != null) {
2082 1 1. getSignatureNames : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getSignatureNames to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return new ArrayList<>(sigNames.keySet());
2083
    }
2084
    sigNames = new HashMap<>();
2085
    List<Object[]> sorter = new ArrayList<>();
2086
    for (Map.Entry<String, Item> entry : fields.entrySet()) {
2087
      Item item = entry.getValue();
2088
      PdfDictionary merged = item.getMerged(0);
2089 1 1. getSignatureNames : negated conditional → NO_COVERAGE
      if (!PdfName.SIG.equals(merged.get(PdfName.FT))) {
2090
        continue;
2091
      }
2092
      PdfDictionary v = merged.getAsDict(PdfName.V);
2093 1 1. getSignatureNames : negated conditional → NO_COVERAGE
      if (v == null) {
2094
        continue;
2095
      }
2096
      PdfString contents = v.getAsString(PdfName.CONTENTS);
2097 1 1. getSignatureNames : negated conditional → NO_COVERAGE
      if (contents == null) {
2098
        continue;
2099
      }
2100
      PdfArray ro = v.getAsArray(PdfName.BYTERANGE);
2101 1 1. getSignatureNames : negated conditional → NO_COVERAGE
      if (ro == null) {
2102
        continue;
2103
      }
2104
      int rangeSize = ro.size();
2105 2 1. getSignatureNames : changed conditional boundary → NO_COVERAGE
2. getSignatureNames : negated conditional → NO_COVERAGE
      if (rangeSize < 2) {
2106
        continue;
2107
      }
2108
      /*
2109
       * From the PDF32000_2008 spec: Byterange: An array of pairs of integers
2110
       * (starting byte offset, length in bytes) Also see:
2111
       * https://pdf-insecurity.org/download/paper.pdf
2112
       */
2113
      int lengthOfSignedBlocks = 0;
2114 4 1. getSignatureNames : changed conditional boundary → NO_COVERAGE
2. getSignatureNames : Replaced integer subtraction with addition → NO_COVERAGE
3. getSignatureNames : Replaced integer subtraction with addition → NO_COVERAGE
4. getSignatureNames : negated conditional → NO_COVERAGE
      for (int i = rangeSize - 1; i > 0; i = i - 2) {
2115 1 1. getSignatureNames : Replaced integer addition with subtraction → NO_COVERAGE
        lengthOfSignedBlocks += ro.getAsNumber(i).intValue();
2116
      }
2117 2 1. getSignatureNames : Replaced integer multiplication with division → NO_COVERAGE
2. getSignatureNames : Replaced integer addition with subtraction → NO_COVERAGE
      int unsignedBlock = contents.getOriginalBytes().length * 2 + 2;
2118 1 1. getSignatureNames : Replaced integer addition with subtraction → NO_COVERAGE
      int length = lengthOfSignedBlocks + unsignedBlock;
2119
      sorter.add(new Object[]{entry.getKey(), new int[]{length, 0}});
2120
    }
2121 1 1. getSignatureNames : removed call to java/util/List::sort → NO_COVERAGE
    sorter.sort(new SorterComparator());
2122 1 1. getSignatureNames : negated conditional → NO_COVERAGE
    if (!sorter.isEmpty()) {
2123 2 1. getSignatureNames : Replaced integer subtraction with addition → NO_COVERAGE
2. getSignatureNames : negated conditional → NO_COVERAGE
      if (((int[]) sorter.get(sorter.size() - 1)[1])[0] == reader.getFileLength()) {
2124
        totalRevisions = sorter.size();
2125
      } else {
2126 1 1. getSignatureNames : Replaced integer addition with subtraction → NO_COVERAGE
        totalRevisions = sorter.size() + 1;
2127
      }
2128 2 1. getSignatureNames : changed conditional boundary → NO_COVERAGE
2. getSignatureNames : negated conditional → NO_COVERAGE
      for (int k = 0; k < sorter.size(); ++k) {
2129
        Object[] objs = sorter.get(k);
2130
        String name = (String) objs[0];
2131
        int[] p = (int[]) objs[1];
2132 1 1. getSignatureNames : Replaced integer addition with subtraction → NO_COVERAGE
        p[1] = k + 1;
2133
        sigNames.put(name, p);
2134
      }
2135
    }
2136 1 1. getSignatureNames : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getSignatureNames to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return new ArrayList<>(sigNames.keySet());
2137
  }
2138
2139
  /**
2140
   * Gets the field names that have blank signatures.
2141
   *
2142
   * @return the field names that have blank signatures
2143
   */
2144
  public List<String> getBlankSignatureNames() {
2145
    getSignatureNames();
2146
    List<String> sigs = new ArrayList<>();
2147
    for (Map.Entry<String, Item> entry : fields.entrySet()) {
2148
      Item item = entry.getValue();
2149
      PdfDictionary merged = item.getMerged(0);
2150 1 1. getBlankSignatureNames : negated conditional → NO_COVERAGE
      if (!PdfName.SIG.equals(merged.getAsName(PdfName.FT))) {
2151
        continue;
2152
      }
2153 1 1. getBlankSignatureNames : negated conditional → NO_COVERAGE
      if (sigNames.containsKey(entry.getKey())) {
2154
        continue;
2155
      }
2156
      sigs.add(entry.getKey());
2157
    }
2158 1 1. getBlankSignatureNames : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getBlankSignatureNames to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return sigs;
2159
  }
2160
2161
  /**
2162
   * Gets the signature dictionary, the one keyed by /V.
2163
   *
2164
   * @param name the field name
2165
   * @return the signature dictionary keyed by /V or <CODE>null</CODE> if the field is not a signature
2166
   */
2167
  public PdfDictionary getSignatureDictionary(String name) {
2168
    getSignatureNames();
2169
    name = getTranslatedFieldName(name);
2170 1 1. getSignatureDictionary : negated conditional → NO_COVERAGE
    if (!sigNames.containsKey(name)) {
2171 1 1. getSignatureDictionary : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getSignatureDictionary to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return null;
2172
    }
2173
    Item item = fields.get(name);
2174
    PdfDictionary merged = item.getMerged(0);
2175 1 1. getSignatureDictionary : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getSignatureDictionary to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return merged.getAsDict(PdfName.V);
2176
  }
2177
2178
  /**
2179
   * Checks is the signature covers the entire document or just part of it.
2180
   *
2181
   * @param name the signature field name
2182
   * @return <CODE>true</CODE> if the signature covers the entire document,
2183
   * <CODE>false</CODE> otherwise
2184
   */
2185
  public boolean signatureCoversWholeDocument(String name) {
2186
    getSignatureNames();
2187
    name = getTranslatedFieldName(name);
2188 1 1. signatureCoversWholeDocument : negated conditional → NO_COVERAGE
    if (!sigNames.containsKey(name)) {
2189 1 1. signatureCoversWholeDocument : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
2190
    }
2191 2 1. signatureCoversWholeDocument : negated conditional → NO_COVERAGE
2. signatureCoversWholeDocument : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return sigNames.get(name)[0] == reader.getFileLength();
2192
  }
2193
2194
  /**
2195
   * Verifies a signature. An example usage is:
2196
   * <p>
2197
   * <pre>
2198
   * KeyStore kall = PdfPKCS7.loadCacertsKeyStore();
2199
   * PdfReader reader = new PdfReader("my_signed_doc.pdf");
2200
   * AcroFields af = reader.getAcroFields();
2201
   * ArrayList names = af.getSignatureNames();
2202
   * for (int k = 0; k &lt; names.size(); ++k) {
2203
   *    String name = (String)names.get(k);
2204
   *    System.out.println("Signature name: " + name);
2205
   *    System.out.println("Signature covers whole document: " + af.signatureCoversWholeDocument(name));
2206
   *    PdfPKCS7 pk = af.verifySignature(name);
2207
   *    Calendar cal = pk.getSignDate();
2208
   *    Certificate pkc[] = pk.getCertificates();
2209
   *    System.out.println("Subject: " + PdfPKCS7.getSubjectFields(pk.getSigningCertificate()));
2210
   *    System.out.println("Document modified: " + !pk.verify());
2211
   *    Object fails[] = PdfPKCS7.verifyCertificates(pkc, kall, null, cal);
2212
   *    if (fails == null)
2213
   *        System.out.println("Certificates verified against the KeyStore");
2214
   *    else
2215
   *        System.out.println("Certificate failed: " + fails[1]);
2216
   * }
2217
   * </pre>
2218
   *
2219
   * @param name the signature field name
2220
   * @return a <CODE>PdfPKCS7</CODE> class to continue the verification
2221
   */
2222
  public PdfPKCS7 verifySignature(String name) {
2223 1 1. verifySignature : mutated return of Object value for com/lowagie/text/pdf/AcroFields::verifySignature to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return verifySignature(name, null);
2224
  }
2225
2226
  /**
2227
   * Verifies a signature. An example usage is:
2228
   * <p>
2229
   * <pre>
2230
   * KeyStore kall = PdfPKCS7.loadCacertsKeyStore();
2231
   * PdfReader reader = new PdfReader("my_signed_doc.pdf");
2232
   * AcroFields af = reader.getAcroFields();
2233
   * ArrayList names = af.getSignatureNames();
2234
   * for (int k = 0; k &lt; names.size(); ++k) {
2235
   *    String name = (String)names.get(k);
2236
   *    System.out.println("Signature name: " + name);
2237
   *    System.out.println("Signature covers whole document: " + af.signatureCoversWholeDocument(name));
2238
   *    PdfPKCS7 pk = af.verifySignature(name);
2239
   *    Calendar cal = pk.getSignDate();
2240
   *    Certificate pkc[] = pk.getCertificates();
2241
   *    System.out.println("Subject: " + PdfPKCS7.getSubjectFields(pk.getSigningCertificate()));
2242
   *    System.out.println("Document modified: " + !pk.verify());
2243
   *    Object fails[] = PdfPKCS7.verifyCertificates(pkc, kall, null, cal);
2244
   *    if (fails == null)
2245
   *        System.out.println("Certificates verified against the KeyStore");
2246
   *    else
2247
   *        System.out.println("Certificate failed: " + fails[1]);
2248
   * }
2249
   * </pre>
2250
   *
2251
   * @param name the signature field name
2252
   * @param provider the provider or <code>null</code> for the default provider
2253
   * @return a <CODE>PdfPKCS7</CODE> class to continue the verification
2254
   */
2255
  public PdfPKCS7 verifySignature(String name, String provider) {
2256
    PdfDictionary v = getSignatureDictionary(name);
2257 1 1. verifySignature : negated conditional → NO_COVERAGE
    if (v == null) {
2258 1 1. verifySignature : mutated return of Object value for com/lowagie/text/pdf/AcroFields::verifySignature to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return null;
2259
    }
2260
    try {
2261
      PdfName sub = v.getAsName(PdfName.SUBFILTER);
2262
      PdfString contents = v.getAsString(PdfName.CONTENTS);
2263
      PdfPKCS7 pk = null;
2264 1 1. verifySignature : negated conditional → NO_COVERAGE
      if (sub.equals(PdfName.ADBE_X509_RSA_SHA1)) {
2265
        PdfString cert = v.getAsString(PdfName.CERT);
2266
        pk = new PdfPKCS7(contents.getOriginalBytes(), cert.getBytes(), provider);
2267
      } else {
2268
        pk = new PdfPKCS7(contents.getOriginalBytes(), provider);
2269
      }
2270 1 1. verifySignature : removed call to com/lowagie/text/pdf/AcroFields::updateByteRange → NO_COVERAGE
      updateByteRange(pk, v);
2271
      PdfString str = v.getAsString(PdfName.M);
2272 1 1. verifySignature : negated conditional → NO_COVERAGE
      if (str != null) {
2273 1 1. verifySignature : removed call to com/lowagie/text/pdf/PdfPKCS7::setSignDate → NO_COVERAGE
        pk.setSignDate(PdfDate.decode(str.toString()));
2274
      }
2275
      PdfObject obj = PdfReader.getPdfObject(v.get(PdfName.NAME));
2276 1 1. verifySignature : negated conditional → NO_COVERAGE
      if (obj != null) {
2277 1 1. verifySignature : negated conditional → NO_COVERAGE
        if (obj.isString()) {
2278 1 1. verifySignature : removed call to com/lowagie/text/pdf/PdfPKCS7::setSignName → NO_COVERAGE
          pk.setSignName(((PdfString) obj).toUnicodeString());
2279 1 1. verifySignature : negated conditional → NO_COVERAGE
        } else if (obj.isName()) {
2280 1 1. verifySignature : removed call to com/lowagie/text/pdf/PdfPKCS7::setSignName → NO_COVERAGE
          pk.setSignName(PdfName.decodeName(obj.toString()));
2281
        }
2282
      }
2283
      str = v.getAsString(PdfName.REASON);
2284 1 1. verifySignature : negated conditional → NO_COVERAGE
      if (str != null) {
2285 1 1. verifySignature : removed call to com/lowagie/text/pdf/PdfPKCS7::setReason → NO_COVERAGE
        pk.setReason(str.toUnicodeString());
2286
      }
2287
      str = v.getAsString(PdfName.LOCATION);
2288 1 1. verifySignature : negated conditional → NO_COVERAGE
      if (str != null) {
2289 1 1. verifySignature : removed call to com/lowagie/text/pdf/PdfPKCS7::setLocation → NO_COVERAGE
        pk.setLocation(str.toUnicodeString());
2290
      }
2291 1 1. verifySignature : mutated return of Object value for com/lowagie/text/pdf/AcroFields::verifySignature to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return pk;
2292
    } catch (Exception e) {
2293
      throw new ExceptionConverter(e);
2294
    }
2295
  }
2296
2297
  private void updateByteRange(PdfPKCS7 pkcs7, PdfDictionary v) {
2298
    PdfArray b = v.getAsArray(PdfName.BYTERANGE);
2299
    RandomAccessFileOrArray rf = reader.getSafeFile();
2300
    try {
2301 1 1. updateByteRange : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::reOpen → NO_COVERAGE
      rf.reOpen();
2302
      byte[] buf = new byte[8192];
2303 3 1. updateByteRange : changed conditional boundary → NO_COVERAGE
2. updateByteRange : Changed increment from 1 to -1 → NO_COVERAGE
3. updateByteRange : negated conditional → NO_COVERAGE
      for (int k = 0; k < b.size(); ++k) {
2304
        int start = b.getAsNumber(k).intValue();
2305 1 1. updateByteRange : Changed increment from 1 to -1 → NO_COVERAGE
        int length = b.getAsNumber(++k).intValue();
2306 1 1. updateByteRange : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE
        rf.seek(start);
2307 2 1. updateByteRange : changed conditional boundary → NO_COVERAGE
2. updateByteRange : negated conditional → NO_COVERAGE
        while (length > 0) {
2308
          int rd = rf.read(buf, 0, Math.min(length, buf.length));
2309 2 1. updateByteRange : changed conditional boundary → NO_COVERAGE
2. updateByteRange : negated conditional → NO_COVERAGE
          if (rd <= 0) {
2310
            break;
2311
          }
2312 1 1. updateByteRange : Replaced integer subtraction with addition → NO_COVERAGE
          length -= rd;
2313 1 1. updateByteRange : removed call to com/lowagie/text/pdf/PdfPKCS7::update → NO_COVERAGE
          pkcs7.update(buf, 0, rd);
2314
        }
2315
      }
2316
    } catch (Exception e) {
2317
      throw new ExceptionConverter(e);
2318
    } finally {
2319
      try {
2320 1 1. updateByteRange : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::close → NO_COVERAGE
        rf.close();
2321
      } catch (Exception e) {
2322
      }
2323
    }
2324
  }
2325
2326
  private void markUsed(PdfObject obj) {
2327 1 1. markUsed : negated conditional → NO_COVERAGE
    if (!append) {
2328
      return;
2329
    }
2330 1 1. markUsed : removed call to com/lowagie/text/pdf/PdfStamperImp::markUsed → NO_COVERAGE
    ((PdfStamperImp) writer).markUsed(obj);
2331
  }
2332
2333
  /**
2334
   * Gets the total number of revisions this document has.
2335
   *
2336
   * @return the total number of revisions
2337
   */
2338
  public int getTotalRevisions() {
2339
    getSignatureNames();
2340 1 1. getTotalRevisions : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return this.totalRevisions;
2341
  }
2342
2343
  /**
2344
   * Gets this <CODE>field</CODE> revision.
2345
   *
2346
   * @param field the signature field name
2347
   * @return the revision or zero if it's not a signature field
2348
   */
2349
  public int getRevision(String field) {
2350
    getSignatureNames();
2351
    field = getTranslatedFieldName(field);
2352 1 1. getRevision : negated conditional → NO_COVERAGE
    if (!sigNames.containsKey(field)) {
2353 1 1. getRevision : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return 0;
2354
    }
2355 1 1. getRevision : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return sigNames.get(field)[1];
2356
  }
2357
2358
  /**
2359
   * Extracts a revision from the document.
2360
   *
2361
   * @param field the signature field name
2362
   * @return an <CODE>InputStream</CODE> covering the revision. Returns <CODE>null</CODE> if it's not a signature field
2363
   * @throws IOException on error
2364
   */
2365
  public InputStream extractRevision(String field) throws IOException {
2366
    getSignatureNames();
2367
    field = getTranslatedFieldName(field);
2368 1 1. extractRevision : negated conditional → NO_COVERAGE
    if (!sigNames.containsKey(field)) {
2369 1 1. extractRevision : mutated return of Object value for com/lowagie/text/pdf/AcroFields::extractRevision to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return null;
2370
    }
2371
    int length = sigNames.get(field)[0];
2372
    RandomAccessFileOrArray raf = reader.getSafeFile();
2373 1 1. extractRevision : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::reOpen → NO_COVERAGE
    raf.reOpen();
2374 1 1. extractRevision : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE
    raf.seek(0);
2375 1 1. extractRevision : mutated return of Object value for com/lowagie/text/pdf/AcroFields::extractRevision to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return new RevisionStream(raf, length);
2376
  }
2377
2378
  /**
2379
   * Gets the appearances cache.
2380
   *
2381
   * @return the appearances cache
2382
   * @since 2.1.5  this method used to return a HashMap
2383
   */
2384
  public Map getFieldCache() {
2385
    return this.fieldCache;
2386
  }
2387
2388
  /**
2389
   * Sets a cache for field appearances. Parsing the existing PDF to create a new TextField is time expensive. For those tasks that
2390
   * repeatedly fill the same PDF with different field values the use of the cache has dramatic speed advantages. An example usage:
2391
   * <p>
2392
   * <pre>
2393
   * String pdfFile = ...;// the pdf file used as template
2394
   * ArrayList xfdfFiles = ...;// the xfdf file names
2395
   * ArrayList pdfOutFiles = ...;// the output file names, one for each element in xpdfFiles
2396
   * HashMap cache = new HashMap();// the appearances cache
2397
   * PdfReader originalReader = new PdfReader(pdfFile);
2398
   * for (int k = 0; k &lt; xfdfFiles.size(); ++k) {
2399
   *    PdfReader reader = new PdfReader(originalReader);
2400
   *    XfdfReader xfdf = new XfdfReader((String)xfdfFiles.get(k));
2401
   *    PdfStamper stp = new PdfStamper(reader, new FileOutputStream((String)pdfOutFiles.get(k)));
2402
   *    AcroFields af = stp.getAcroFields();
2403
   *    af.setFieldCache(cache);
2404
   *    af.setFields(xfdf);
2405
   *    stp.close();
2406
   * }
2407
   * </pre>
2408
   *
2409
   * @param fieldCache a Map that will carry the cached appearances
2410
   * @since 2.1.5  this method used to take a HashMap as parameter
2411
   */
2412
  public void setFieldCache(Map<String, BaseField> fieldCache) {
2413
    this.fieldCache = fieldCache;
2414
  }
2415
2416
  /**
2417
   * Sets extra margins in text fields to better mimic the Acrobat layout.
2418
   *
2419
   * @param extraMarginLeft the extra margin left
2420
   * @param extraMarginTop the extra margin top
2421
   */
2422
  public void setExtraMargin(float extraMarginLeft, float extraMarginTop) {
2423
    this.extraMarginLeft = extraMarginLeft;
2424
    this.extraMarginTop = extraMarginTop;
2425
  }
2426
2427
  /**
2428
   * Adds a substitution font to the list. The fonts in this list will be used if the original font doesn't contain the needed glyphs.
2429
   *
2430
   * @param font the font
2431
   */
2432
  public void addSubstitutionFont(BaseFont font) {
2433 1 1. addSubstitutionFont : negated conditional → NO_COVERAGE
    if (substitutionFonts == null) {
2434
      substitutionFonts = new ArrayList<>();
2435
    }
2436
    substitutionFonts.add(font);
2437
  }
2438
2439
  private static final HashMap<String, String[]> stdFieldFontNames = new HashMap<>();
2440
2441
  /**
2442
   * Holds value of property totalRevisions.
2443
   */
2444
  private int totalRevisions;
2445
2446
  /**
2447
   * Holds value of property fieldCache.
2448
   *
2449
   * @since 2.1.5  this used to be a HashMap
2450
   */
2451
  private Map<String, BaseField> fieldCache;
2452
2453
  static {
2454
    stdFieldFontNames.put("CoBO", new String[]{"Courier-BoldOblique"});
2455
    stdFieldFontNames.put("CoBo", new String[]{"Courier-Bold"});
2456
    stdFieldFontNames.put("CoOb", new String[]{"Courier-Oblique"});
2457
    stdFieldFontNames.put("Cour", new String[]{"Courier"});
2458
    stdFieldFontNames.put("HeBO", new String[]{"Helvetica-BoldOblique"});
2459
    stdFieldFontNames.put("HeBo", new String[]{"Helvetica-Bold"});
2460
    stdFieldFontNames.put("HeOb", new String[]{"Helvetica-Oblique"});
2461
    stdFieldFontNames.put("Helv", new String[]{"Helvetica"});
2462
    stdFieldFontNames.put("Symb", new String[]{"Symbol"});
2463
    stdFieldFontNames.put("TiBI", new String[]{"Times-BoldItalic"});
2464
    stdFieldFontNames.put("TiBo", new String[]{"Times-Bold"});
2465
    stdFieldFontNames.put("TiIt", new String[]{"Times-Italic"});
2466
    stdFieldFontNames.put("TiRo", new String[]{"Times-Roman"});
2467
    stdFieldFontNames.put("ZaDb", new String[]{"ZapfDingbats"});
2468
    stdFieldFontNames.put("HySm", new String[]{"HYSMyeongJo-Medium", "UniKS-UCS2-H"});
2469
    stdFieldFontNames.put("HyGo", new String[]{"HYGoThic-Medium", "UniKS-UCS2-H"});
2470
    stdFieldFontNames.put("KaGo", new String[]{"HeiseiKakuGo-W5", "UniKS-UCS2-H"});
2471
    stdFieldFontNames.put("KaMi", new String[]{"HeiseiMin-W3", "UniJIS-UCS2-H"});
2472
    stdFieldFontNames.put("MHei", new String[]{"MHei-Medium", "UniCNS-UCS2-H"});
2473
    stdFieldFontNames.put("MSun", new String[]{"MSung-Light", "UniCNS-UCS2-H"});
2474
    stdFieldFontNames.put("STSo", new String[]{"STSong-Light", "UniGB-UCS2-H"});
2475
  }
2476
2477
  private static class RevisionStream extends InputStream {
2478
2479
    private byte[] b = new byte[1];
2480
    private RandomAccessFileOrArray raf;
2481
    private int length;
2482
    private int rangePosition = 0;
2483
    private boolean closed;
2484
2485
    private RevisionStream(RandomAccessFileOrArray raf, int length) {
2486
      this.raf = raf;
2487
      this.length = length;
2488
    }
2489
2490
    public int read() throws IOException {
2491
      int n = read(b);
2492 1 1. read : negated conditional → NO_COVERAGE
      if (n != 1) {
2493 1 1. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return -1;
2494
      }
2495 2 1. read : Replaced bitwise AND with OR → NO_COVERAGE
2. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return b[0] & 0xff;
2496
    }
2497
2498
    public int read(byte[] b, int off, int len) throws IOException {
2499 1 1. read : negated conditional → NO_COVERAGE
      if (b == null) {
2500
        throw new NullPointerException();
2501 12 1. read : changed conditional boundary → NO_COVERAGE
2. read : changed conditional boundary → NO_COVERAGE
3. read : changed conditional boundary → NO_COVERAGE
4. read : changed conditional boundary → NO_COVERAGE
5. read : changed conditional boundary → NO_COVERAGE
6. read : Replaced integer addition with subtraction → NO_COVERAGE
7. read : Replaced integer addition with subtraction → NO_COVERAGE
8. read : negated conditional → NO_COVERAGE
9. read : negated conditional → NO_COVERAGE
10. read : negated conditional → NO_COVERAGE
11. read : negated conditional → NO_COVERAGE
12. read : negated conditional → NO_COVERAGE
      } else if ((off < 0) || (off > b.length) || (len < 0) ||
2502
          ((off + len) > b.length) || ((off + len) < 0)) {
2503
        throw new IndexOutOfBoundsException();
2504 1 1. read : negated conditional → NO_COVERAGE
      } else if (len == 0) {
2505 1 1. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return 0;
2506
      }
2507 2 1. read : changed conditional boundary → NO_COVERAGE
2. read : negated conditional → NO_COVERAGE
      if (rangePosition >= length) {
2508 1 1. read : removed call to com/lowagie/text/pdf/AcroFields$RevisionStream::close → NO_COVERAGE
        close();
2509 1 1. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
        return -1;
2510
      }
2511 1 1. read : Replaced integer subtraction with addition → NO_COVERAGE
      int elen = Math.min(len, length - rangePosition);
2512 1 1. read : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::readFully → NO_COVERAGE
      raf.readFully(b, off, elen);
2513 1 1. read : Replaced integer addition with subtraction → NO_COVERAGE
      rangePosition += elen;
2514 1 1. read : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return elen;
2515
    }
2516
2517
    public void close() throws IOException {
2518 1 1. close : negated conditional → NO_COVERAGE
      if (!closed) {
2519 1 1. close : removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::close → NO_COVERAGE
        raf.close();
2520
        closed = true;
2521
      }
2522
    }
2523
  }
2524
2525
  private static class SorterComparator implements Comparator<Object[]> {
2526
2527
    public int compare(Object[] o1, Object[] o2) {
2528
      int n1 = ((int[]) o1[1])[0];
2529
      int n2 = ((int[]) o2[1])[0];
2530 2 1. compare : Replaced integer subtraction with addition → NO_COVERAGE
2. compare : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return n1 - n2;
2531
    }
2532
  }
2533
2534
  /**
2535
   * Gets the list of substitution fonts. The list is composed of <CODE>BaseFont</CODE> and can be <CODE>null</CODE>. The fonts in this list
2536
   * will be used if the original font doesn't contain the needed glyphs.
2537
   *
2538
   * @return the list
2539
   */
2540
  public List<BaseFont> getSubstitutionFonts() {
2541
    return substitutionFonts;
2542
  }
2543
2544
  /**
2545
   * Sets a list of substitution fonts. The list is composed of <CODE>BaseFont</CODE> and can also be <CODE>null</CODE>. The fonts in this
2546
   * list will be used if the original font doesn't contain the needed glyphs.
2547
   *
2548
   * @param substitutionFonts the list
2549
   */
2550
  public void setSubstitutionFonts(List<BaseFont> substitutionFonts) {
2551
    this.substitutionFonts = substitutionFonts;
2552
  }
2553
2554
  /**
2555
   * Gets the XFA form processor.
2556
   *
2557
   * @return the XFA form processor
2558
   */
2559
  public XfaForm getXfa() {
2560
    return xfa;
2561
  }
2562
2563
  private static final PdfName[] buttonRemove = {PdfName.MK, PdfName.F, PdfName.FF, PdfName.Q, PdfName.BS, PdfName.BORDER};
2564
2565
  /**
2566
   * Creates a new pushbutton from an existing field. If there are several pushbuttons with the same name only the first one is used. This
2567
   * pushbutton can be changed and be used to replace an existing one, with the same name or other name, as long is it is in the same
2568
   * document. To replace an existing pushbutton call {@link #replacePushbuttonField(String, PdfFormField)}.
2569
   *
2570
   * @param field the field name that should be a pushbutton
2571
   * @return a new pushbutton or <CODE>null</CODE> if the field is not a pushbutton
2572
   */
2573
  public PushbuttonField getNewPushbuttonFromField(String field) {
2574 1 1. getNewPushbuttonFromField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getNewPushbuttonFromField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
    return getNewPushbuttonFromField(field, 0);
2575
  }
2576
2577
  /**
2578
   * Creates a new pushbutton from an existing field. This pushbutton can be changed and be used to replace an existing one, with the same
2579
   * name or other name, as long is it is in the same document. To replace an existing pushbutton call {@link
2580
   * #replacePushbuttonField(String, PdfFormField, int)}.
2581
   *
2582
   * @param field the field name that should be a pushbutton
2583
   * @param order the field order in fields with same name
2584
   * @return a new pushbutton or <CODE>null</CODE> if the field is not a pushbutton
2585
   * @since 2.0.7
2586
   */
2587
  public PushbuttonField getNewPushbuttonFromField(String field, int order) {
2588
    try {
2589 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
      if (getFieldType(field) != FIELD_TYPE_PUSHBUTTON) {
2590 1 1. getNewPushbuttonFromField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getNewPushbuttonFromField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return null;
2591
      }
2592
      Item item = getFieldItem(field);
2593 2 1. getNewPushbuttonFromField : changed conditional boundary → NO_COVERAGE
2. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
      if (order >= item.size()) {
2594 1 1. getNewPushbuttonFromField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getNewPushbuttonFromField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return null;
2595
      }
2596 1 1. getNewPushbuttonFromField : Replaced integer multiplication with division → NO_COVERAGE
      int posi = order * 5;
2597
      float[] pos = getFieldPositions(field);
2598 4 1. getNewPushbuttonFromField : Replaced integer addition with subtraction → NO_COVERAGE
2. getNewPushbuttonFromField : Replaced integer addition with subtraction → NO_COVERAGE
3. getNewPushbuttonFromField : Replaced integer addition with subtraction → NO_COVERAGE
4. getNewPushbuttonFromField : Replaced integer addition with subtraction → NO_COVERAGE
      Rectangle box = new Rectangle(pos[posi + 1], pos[posi + 2], pos[posi + 3], pos[posi + 4]);
2599
      PushbuttonField newButton = new PushbuttonField(writer, box, null);
2600
      PdfDictionary dic = item.getMerged(order);
2601 1 1. getNewPushbuttonFromField : removed call to com/lowagie/text/pdf/AcroFields::decodeGenericDictionary → NO_COVERAGE
      decodeGenericDictionary(dic, newButton);
2602
      PdfDictionary mk = dic.getAsDict(PdfName.MK);
2603 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
      if (mk != null) {
2604
        PdfString text = mk.getAsString(PdfName.CA);
2605 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
        if (text != null) {
2606 1 1. getNewPushbuttonFromField : removed call to com/lowagie/text/pdf/PushbuttonField::setText → NO_COVERAGE
          newButton.setText(text.toUnicodeString());
2607
        }
2608
        PdfNumber tp = mk.getAsNumber(PdfName.TP);
2609 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
        if (tp != null) {
2610 2 1. getNewPushbuttonFromField : Replaced integer addition with subtraction → NO_COVERAGE
2. getNewPushbuttonFromField : removed call to com/lowagie/text/pdf/PushbuttonField::setLayout → NO_COVERAGE
          newButton.setLayout(tp.intValue() + 1);
2611
        }
2612
        PdfDictionary ifit = mk.getAsDict(PdfName.IF);
2613 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
        if (ifit != null) {
2614
          PdfName sw = ifit.getAsName(PdfName.SW);
2615 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
          if (sw != null) {
2616
            int scale = PushbuttonField.SCALE_ICON_ALWAYS;
2617 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
            if (sw.equals(PdfName.B)) {
2618
              scale = PushbuttonField.SCALE_ICON_IS_TOO_BIG;
2619 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
            } else if (sw.equals(PdfName.S)) {
2620
              scale = PushbuttonField.SCALE_ICON_IS_TOO_SMALL;
2621 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
            } else if (sw.equals(PdfName.N)) {
2622
              scale = PushbuttonField.SCALE_ICON_NEVER;
2623
            }
2624 1 1. getNewPushbuttonFromField : removed call to com/lowagie/text/pdf/PushbuttonField::setScaleIcon → NO_COVERAGE
            newButton.setScaleIcon(scale);
2625
          }
2626
          sw = ifit.getAsName(PdfName.S);
2627 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
          if (sw != null) {
2628 1 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
            if (sw.equals(PdfName.A)) {
2629 1 1. getNewPushbuttonFromField : removed call to com/lowagie/text/pdf/PushbuttonField::setProportionalIcon → NO_COVERAGE
              newButton.setProportionalIcon(false);
2630
            }
2631
          }
2632
          PdfArray aj = ifit.getAsArray(PdfName.A);
2633 2 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
2. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
          if (aj != null && aj.size() == 2) {
2634
            float left = aj.getAsNumber(0).floatValue();
2635
            float bottom = aj.getAsNumber(1).floatValue();
2636 1 1. getNewPushbuttonFromField : removed call to com/lowagie/text/pdf/PushbuttonField::setIconHorizontalAdjustment → NO_COVERAGE
            newButton.setIconHorizontalAdjustment(left);
2637 1 1. getNewPushbuttonFromField : removed call to com/lowagie/text/pdf/PushbuttonField::setIconVerticalAdjustment → NO_COVERAGE
            newButton.setIconVerticalAdjustment(bottom);
2638
          }
2639
          PdfBoolean fb = ifit.getAsBoolean(PdfName.FB);
2640 2 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
2. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
          if (fb != null && fb.booleanValue()) {
2641 1 1. getNewPushbuttonFromField : removed call to com/lowagie/text/pdf/PushbuttonField::setIconFitToBounds → NO_COVERAGE
            newButton.setIconFitToBounds(true);
2642
          }
2643
        }
2644
        PdfObject i = mk.get(PdfName.I);
2645 2 1. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
2. getNewPushbuttonFromField : negated conditional → NO_COVERAGE
        if (i != null && i.isIndirect()) {
2646 1 1. getNewPushbuttonFromField : removed call to com/lowagie/text/pdf/PushbuttonField::setIconReference → NO_COVERAGE
          newButton.setIconReference((PRIndirectReference) i);
2647
        }
2648
      }
2649 1 1. getNewPushbuttonFromField : mutated return of Object value for com/lowagie/text/pdf/AcroFields::getNewPushbuttonFromField to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
      return newButton;
2650
    } catch (Exception e) {
2651
      throw new ExceptionConverter(e);
2652
    }
2653
  }
2654
2655
  /**
2656
   * Replaces the first field with a new pushbutton. The pushbutton can be created with {@link #getNewPushbuttonFromField(String)} from the
2657
   * same document or it can be a generic PdfFormField of the type pushbutton.
2658
   *
2659
   * @param field the field name
2660
   * @param button the <CODE>PdfFormField</CODE> representing the pushbutton
2661
   * @return <CODE>true</CODE> if the field was replaced, <CODE>false</CODE> if the field
2662
   * was not a pushbutton
2663
   */
2664
  public boolean replacePushbuttonField(String field, PdfFormField button) {
2665 1 1. replacePushbuttonField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return replacePushbuttonField(field, button, 0);
2666
  }
2667
2668
  /**
2669
   * Replaces the designated field with a new pushbutton. The pushbutton can be created with {@link #getNewPushbuttonFromField(String, int)}
2670
   * from the same document or it can be a generic PdfFormField of the type pushbutton.
2671
   *
2672
   * @param field the field name
2673
   * @param button the <CODE>PdfFormField</CODE> representing the pushbutton
2674
   * @param order the field order in fields with same name
2675
   * @return <CODE>true</CODE> if the field was replaced, <CODE>false</CODE> if the field
2676
   * was not a pushbutton
2677
   * @since 2.0.7
2678
   */
2679
  public boolean replacePushbuttonField(String field, PdfFormField button, int order) {
2680 1 1. replacePushbuttonField : negated conditional → NO_COVERAGE
    if (getFieldType(field) != FIELD_TYPE_PUSHBUTTON) {
2681 1 1. replacePushbuttonField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
2682
    }
2683
    Item item = getFieldItem(field);
2684 2 1. replacePushbuttonField : changed conditional boundary → NO_COVERAGE
2. replacePushbuttonField : negated conditional → NO_COVERAGE
    if (order >= item.size()) {
2685 1 1. replacePushbuttonField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
      return false;
2686
    }
2687
    PdfDictionary merged = item.getMerged(order);
2688
    PdfDictionary values = item.getValue(order);
2689
    PdfDictionary widgets = item.getWidget(order);
2690
    for (PdfName pdfName : buttonRemove) {
2691 1 1. replacePushbuttonField : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
      merged.remove(pdfName);
2692 1 1. replacePushbuttonField : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
      values.remove(pdfName);
2693 1 1. replacePushbuttonField : removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE
      widgets.remove(pdfName);
2694
    }
2695
    for (PdfName key : button.getKeys()) {
2696 2 1. replacePushbuttonField : negated conditional → NO_COVERAGE
2. replacePushbuttonField : negated conditional → NO_COVERAGE
      if (key.equals(PdfName.T) || key.equals(PdfName.RECT))
2697
        continue;
2698 1 1. replacePushbuttonField : negated conditional → NO_COVERAGE
      if (key.equals(PdfName.FF))
2699 1 1. replacePushbuttonField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        values.put(key, button.get(key));
2700
      else
2701 1 1. replacePushbuttonField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
        widgets.put(key, button.get(key));
2702 1 1. replacePushbuttonField : removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE
      merged.put(key, button.get(key));
2703
    }
2704 1 1. replacePushbuttonField : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE
    return true;
2705
  }
2706
2707
}

Mutations

145

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

148

1.1
Location :
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::fill → NO_COVERAGE

154

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

158

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

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

161

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

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

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

164

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

167

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

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

169

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

170

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/PdfReader::releaseLastXrefPartial → NO_COVERAGE

173

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

174

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/PdfReader::releaseLastXrefPartial → NO_COVERAGE

179

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::putAll → NO_COVERAGE

183

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

184

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::mergeDifferent → NO_COVERAGE

186

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

189

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

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

192

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

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

194

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

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

195

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

200

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

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

201

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

204

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

208

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

209

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addValue → NO_COVERAGE

211

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addValue → NO_COVERAGE

213

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addWidget → NO_COVERAGE

214

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addWidgetRef → NO_COVERAGE

215

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::mergeDifferent → NO_COVERAGE

216

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addMerged → NO_COVERAGE

217

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addPage → NO_COVERAGE

218

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addTabOrder → NO_COVERAGE

224

1.1
Location : fill
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

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

227

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

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

229

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

230

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/PdfReader::releaseLastXrefPartial → NO_COVERAGE

233

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

234

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/PdfReader::releaseLastXrefPartial → NO_COVERAGE

238

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

242

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::putAll → NO_COVERAGE

244

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

248

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

253

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addValue → NO_COVERAGE

254

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addWidget → NO_COVERAGE

255

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addWidgetRef → NO_COVERAGE

256

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addMerged → NO_COVERAGE

257

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addPage → NO_COVERAGE

258

1.1
Location : fill
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::addTabOrder → NO_COVERAGE

271

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

272

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

277

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

281

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

282

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

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

284

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

290

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

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

293

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

297

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

306

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

311

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

312

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

315

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

316

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

319

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

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

322

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

325

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

334

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

346

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

358

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

380

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

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

381

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

383

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

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

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

388

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

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

389

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

393

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

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

395

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

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

399

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

404

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

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

411

1.1
Location : setListOption
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE

412

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

429

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

430

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

434

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

435

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

439

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

442

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

443

1.1
Location : getFieldType
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

444

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

446

1.1
Location : getFieldType
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

447

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

449

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

451

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

452

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

453

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

454

1.1
Location : getFieldType
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

455

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

457

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

459

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

460

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

462

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

475

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

479

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

497

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

498

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

499

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

500

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

502

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

503

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

505

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

506

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

509

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

510

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

515

1.1
Location : renameField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE

516

1.1
Location : renameField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::markUsed → NO_COVERAGE

521

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

529

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

530

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

533

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

537

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

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

538

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

539

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

543

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

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

544

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

545

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

551

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

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

552

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

553

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

554

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

559

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

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

560

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

561

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

562

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

563

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

568

1.1
Location : splitDAelements
Killed by : none
removed call to java/util/List::clear → NO_COVERAGE

573

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

583

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

585

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

586

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setFontSize → NO_COVERAGE

588

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

589

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setTextColor → NO_COVERAGE

591

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

593

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

595

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

597

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

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

600

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setFont → NO_COVERAGE

603

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

604

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

607

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

609

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

612

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

624

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

625

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setExtensionFont → NO_COVERAGE

629

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

631

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

634

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

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

638

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setFont → NO_COVERAGE

644

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setFont → NO_COVERAGE

653

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

656

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBorderColor → NO_COVERAGE

657

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

658

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBorderWidth → NO_COVERAGE

661

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBackgroundColor → NO_COVERAGE

663

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

664

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setRotation → NO_COVERAGE

670

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setVisibility → NO_COVERAGE

671

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

673

1.1
Location : decodeGenericDictionary
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : decodeGenericDictionary
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

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

674

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setVisibility → NO_COVERAGE

675

1.1
Location : decodeGenericDictionary
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

2.2
Location : decodeGenericDictionary
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

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

676

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setVisibility → NO_COVERAGE

677

1.1
Location : decodeGenericDictionary
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

678

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setVisibility → NO_COVERAGE

684

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

687

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setOptions → NO_COVERAGE

688

1.1
Location : decodeGenericDictionary
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

691

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

694

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setMaxCharacterLength → NO_COVERAGE

698

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

699

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

700

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setAlignment → NO_COVERAGE

701

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

702

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setAlignment → NO_COVERAGE

707

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

709

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

710

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBorderWidth → NO_COVERAGE

713

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

714

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE

715

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

716

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE

717

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

718

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE

719

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

720

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE

724

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

725

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

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

726

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBorderWidth → NO_COVERAGE

728

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

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

729

1.1
Location : decodeGenericDictionary
Killed by : none
removed call to com/lowagie/text/pdf/BaseField::setBorderStyle → NO_COVERAGE

737

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

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

740

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

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

742

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setExtraMargin → NO_COVERAGE

743

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setBorderWidth → NO_COVERAGE

744

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setSubstitutionFonts → NO_COVERAGE

745

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::decodeGenericDictionary → NO_COVERAGE

749

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

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

752

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setBox → NO_COVERAGE

753

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

758

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setWriter → NO_COVERAGE

761

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

762

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

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

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

763

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setText → NO_COVERAGE

765

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

767

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

773

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

776

1.1
Location : getAppearance
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

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

777

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setText → NO_COVERAGE

778

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

780

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

783

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

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

785

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

793

1.1
Location : getAppearance
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

794

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

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

795

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

800

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setText → NO_COVERAGE

801

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

804

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

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

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

806

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

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

812

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setChoices → NO_COVERAGE

813

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setChoiceExports → NO_COVERAGE

814

1.1
Location : getAppearance
Killed by : none
removed call to com/lowagie/text/pdf/TextField::setChoiceSelections → NO_COVERAGE

818

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

824

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

828

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

829

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

833

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

835

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

838

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

841

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

852

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

854

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

855

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

858

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

861

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

862

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

871

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

872

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

874

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

878

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

885

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

888

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

891

1.1
Location : getField
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

892

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

895

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

897

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

901

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

911

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

913

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

915

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

916

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

917

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

919

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

933

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

939

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

940

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

947

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

948

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

954

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

956

1.1
Location : getListSelection
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

958

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

983

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

988

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

989

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

994

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

995

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

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

996

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

1000

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

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

1003

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

1006

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

1010

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

1012

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1016

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1018

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

1020

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1022

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1024

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

1026

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1028

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1030

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

1031

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

1032

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1034

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

1036

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

1039

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/BaseFont::setSubset → NO_COVERAGE

1043

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1044

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1048

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

1049

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE

1052

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1053

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1054

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1059

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

1060

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

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

1061

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

1064

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

1067

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

1071

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE

1073

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1074

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1075

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1080

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

1081

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

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

1082

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

1085

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

1088

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

1091

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

1092

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfAppearance::setColorFill → NO_COVERAGE

1095

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1096

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1097

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1102

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

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

1103

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

1104

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

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

1105

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

1108

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

1109

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

1110

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

1113

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1114

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1115

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1117

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1119

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

1120

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

1122

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1127

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

1129

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

1161

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

1165

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

1166

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

1169

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

1171

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

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

1172

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

1173

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1174

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1175

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1178

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

1179

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

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

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

1180

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

1183

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

1186

1.1
Location : setFieldProperty
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

1187

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1188

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1189

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1192

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

1193

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

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

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

1194

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

1198

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

1201

1.1
Location : setFieldProperty
Killed by : none
Replaced XOR with AND → NO_COVERAGE

2.2
Location : setFieldProperty
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

1202

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1203

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1204

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1207

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

1209

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

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

1210

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

1211

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1212

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1213

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1216

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

1217

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

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

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

1218

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

1222

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

1225

1.1
Location : setFieldProperty
Killed by : none
Replaced bitwise OR with AND → NO_COVERAGE

1226

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1227

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1228

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1231

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

1232

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

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

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

1233

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

1237

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

1240

1.1
Location : setFieldProperty
Killed by : none
Replaced XOR with AND → NO_COVERAGE

2.2
Location : setFieldProperty
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

1241

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1242

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1243

1.1
Location : setFieldProperty
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1247

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

1249

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

1279

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

1296

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

1300

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

1319

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

1333

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

1349

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

1352

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

1354

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

1355

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

1359

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

1362

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/XfaForm::setNodeText → NO_COVERAGE

1365

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

1366

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

1370

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

1373

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

1376

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

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

1380

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

1383

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

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

1385

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

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

1387

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1388

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

1389

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1391

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

1392

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1394

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

1396

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

1398

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1399

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1402

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

1404

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1405

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1407

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1408

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfWriter::releaseTemplate → NO_COVERAGE

1410

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

1411

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

1413

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1415

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

1416

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

1419

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

1422

1.1
Location : setField
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

1428

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

1431

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PushbuttonField::setImage → NO_COVERAGE

1433

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

1438

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

1439

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

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

1441

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

1450

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

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

1455

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

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

1459

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1460

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1461

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1462

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1463

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

1464

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1465

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1467

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1468

1.1
Location : setField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1471

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

1473

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

1486

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

1487

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

1491

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

1492

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

1497

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

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

1498

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

1504

1.1
Location : setListSelection
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE

1510

1.1
Location : setListSelection
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE

1515

1.1
Location : setListSelection
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1516

1.1
Location : setListSelection
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::writeToAll → NO_COVERAGE

1518

1.1
Location : setListSelection
Killed by : none
removed call to com/lowagie/text/pdf/PdfWriter::releaseTemplate → NO_COVERAGE

1520

1.1
Location : setListSelection
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::markUsed → NO_COVERAGE

1521

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

1526

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

1527

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

1530

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

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

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

1550

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

1552

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

1553

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

1556

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

1566

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

1568

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

1572

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

1584

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

1585

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

1587

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

1589

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

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

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

1593

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

1599

1.1
Location : getFieldPositions
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1600

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

1605

1.1
Location : getFieldPositions
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1607

1.1
Location : getFieldPositions
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1612

1.1
Location : getFieldPositions
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1613

1.1
Location : getFieldPositions
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1614

1.1
Location : getFieldPositions
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1615

1.1
Location : getFieldPositions
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1620

1.1
Location : getFieldPositions
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1622

1.1
Location : getFieldPositions
Killed by : none
Replaced float subtraction with addition → NO_COVERAGE

1625

1.1
Location : getFieldPositions
Killed by : none
removed call to com/lowagie/text/Rectangle::normalize → NO_COVERAGE

1627

1.1
Location : getFieldPositions
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1628

1.1
Location : getFieldPositions
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1629

1.1
Location : getFieldPositions
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1630

1.1
Location : getFieldPositions
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

1635

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

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

1637

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

1638

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

1640

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

1644

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

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

1645

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

1648

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

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

1650

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

1653

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

1654

1.1
Location : removeRefFromArray
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

1657

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

1667

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

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

1668

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

1675

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

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

1677

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

1691

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

1692

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

1696

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

1697

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

1700

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

1701

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

1703

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

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

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

1705

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

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

1712

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

1713

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

1714

1.1
Location : removeField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

1715

1.1
Location : removeField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1717

1.1
Location : removeField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1722

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

1725

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

1731

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

1733

1.1
Location : removeField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::markUsed → NO_COVERAGE

1735

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

1736

1.1
Location : removeField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$Item::remove → NO_COVERAGE

1737

1.1
Location : removeField
Killed by : none
Changed increment from -1 to 1 → NO_COVERAGE

1740

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

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

1743

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

1753

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

1774

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

1775

1.1
Location : setGenerateAppearances
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

1777

1.1
Location : setGenerateAppearances
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1819

1.1
Location : writeToAll
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

1820

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

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

1822

1.1
Location : writeToAll
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1825

1.1
Location : writeToAll
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

1826

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

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

1828

1.1
Location : writeToAll
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1831

1.1
Location : writeToAll
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

1832

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

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

1834

1.1
Location : writeToAll
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

1846

1.1
Location : markUsed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

1847

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

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

1848

1.1
Location : markUsed
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::access$000 → NO_COVERAGE

1851

1.1
Location : markUsed
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

1852

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

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

1853

1.1
Location : markUsed
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::access$000 → NO_COVERAGE

1931

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

1952

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

1972

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

1993

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

2012

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

2040

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

2058

1.1
Location :
Killed by : none
negated conditional → NO_COVERAGE

2068

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

2069

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

2071

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

2081

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

2082

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

2089

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

2093

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

2097

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

2101

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

2105

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

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

2114

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

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

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

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

2115

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

2117

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

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

2118

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

2121

1.1
Location : getSignatureNames
Killed by : none
removed call to java/util/List::sort → NO_COVERAGE

2122

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

2123

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

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

2126

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

2128

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

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

2132

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

2136

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

2150

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

2153

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

2158

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

2170

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

2171

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

2175

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

2188

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

2189

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

2191

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

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

2223

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

2257

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

2258

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

2264

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

2270

1.1
Location : verifySignature
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::updateByteRange → NO_COVERAGE

2272

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

2273

1.1
Location : verifySignature
Killed by : none
removed call to com/lowagie/text/pdf/PdfPKCS7::setSignDate → NO_COVERAGE

2276

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

2277

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

2278

1.1
Location : verifySignature
Killed by : none
removed call to com/lowagie/text/pdf/PdfPKCS7::setSignName → NO_COVERAGE

2279

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

2280

1.1
Location : verifySignature
Killed by : none
removed call to com/lowagie/text/pdf/PdfPKCS7::setSignName → NO_COVERAGE

2284

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

2285

1.1
Location : verifySignature
Killed by : none
removed call to com/lowagie/text/pdf/PdfPKCS7::setReason → NO_COVERAGE

2288

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

2289

1.1
Location : verifySignature
Killed by : none
removed call to com/lowagie/text/pdf/PdfPKCS7::setLocation → NO_COVERAGE

2291

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

2301

1.1
Location : updateByteRange
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::reOpen → NO_COVERAGE

2303

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

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

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

2305

1.1
Location : updateByteRange
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

2306

1.1
Location : updateByteRange
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE

2307

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

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

2309

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

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

2312

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

2313

1.1
Location : updateByteRange
Killed by : none
removed call to com/lowagie/text/pdf/PdfPKCS7::update → NO_COVERAGE

2320

1.1
Location : updateByteRange
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::close → NO_COVERAGE

2327

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

2330

1.1
Location : markUsed
Killed by : none
removed call to com/lowagie/text/pdf/PdfStamperImp::markUsed → NO_COVERAGE

2340

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

2352

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

2353

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

2355

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

2368

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

2369

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

2373

1.1
Location : extractRevision
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::reOpen → NO_COVERAGE

2374

1.1
Location : extractRevision
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::seek → NO_COVERAGE

2375

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

2433

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

2492

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

2493

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

2495

1.1
Location : read
Killed by : none
Replaced bitwise AND with OR → NO_COVERAGE

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

2499

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

2501

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

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

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

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

5.5
Location : read
Killed by : none
changed conditional boundary → NO_COVERAGE

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

7.7
Location : read
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

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

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

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

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

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

2504

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

2505

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

2507

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

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

2508

1.1
Location : read
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields$RevisionStream::close → NO_COVERAGE

2509

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

2511

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

2512

1.1
Location : read
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::readFully → NO_COVERAGE

2513

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

2514

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

2518

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

2519

1.1
Location : close
Killed by : none
removed call to com/lowagie/text/pdf/RandomAccessFileOrArray::close → NO_COVERAGE

2530

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

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

2574

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

2589

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

2590

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

2593

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

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

2594

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

2596

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

2598

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

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

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

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

2601

1.1
Location : getNewPushbuttonFromField
Killed by : none
removed call to com/lowagie/text/pdf/AcroFields::decodeGenericDictionary → NO_COVERAGE

2603

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

2605

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

2606

1.1
Location : getNewPushbuttonFromField
Killed by : none
removed call to com/lowagie/text/pdf/PushbuttonField::setText → NO_COVERAGE

2609

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

2610

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

2.2
Location : getNewPushbuttonFromField
Killed by : none
removed call to com/lowagie/text/pdf/PushbuttonField::setLayout → NO_COVERAGE

2613

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

2615

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

2617

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

2619

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

2621

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

2624

1.1
Location : getNewPushbuttonFromField
Killed by : none
removed call to com/lowagie/text/pdf/PushbuttonField::setScaleIcon → NO_COVERAGE

2627

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

2628

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

2629

1.1
Location : getNewPushbuttonFromField
Killed by : none
removed call to com/lowagie/text/pdf/PushbuttonField::setProportionalIcon → NO_COVERAGE

2633

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

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

2636

1.1
Location : getNewPushbuttonFromField
Killed by : none
removed call to com/lowagie/text/pdf/PushbuttonField::setIconHorizontalAdjustment → NO_COVERAGE

2637

1.1
Location : getNewPushbuttonFromField
Killed by : none
removed call to com/lowagie/text/pdf/PushbuttonField::setIconVerticalAdjustment → NO_COVERAGE

2640

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

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

2641

1.1
Location : getNewPushbuttonFromField
Killed by : none
removed call to com/lowagie/text/pdf/PushbuttonField::setIconFitToBounds → NO_COVERAGE

2645

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

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

2646

1.1
Location : getNewPushbuttonFromField
Killed by : none
removed call to com/lowagie/text/pdf/PushbuttonField::setIconReference → NO_COVERAGE

2649

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

2665

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

2680

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

2681

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

2684

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

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

2685

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

2691

1.1
Location : replacePushbuttonField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

2692

1.1
Location : replacePushbuttonField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

2693

1.1
Location : replacePushbuttonField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::remove → NO_COVERAGE

2696

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

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

2698

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

2699

1.1
Location : replacePushbuttonField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

2701

1.1
Location : replacePushbuttonField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

2702

1.1
Location : replacePushbuttonField
Killed by : none
removed call to com/lowagie/text/pdf/PdfDictionary::put → NO_COVERAGE

2704

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

Active mutators

Tests examined


Report generated by PIT 1.4.2