itext
5091
Anomaly identified by the detector. Please review whether this anomaly corresponds to a misuse.
5
/home/eko/MUBench/MUBench/checkouts/itext/5091/original-src/com/itextpdf/text/pdf/BaseField.java
getHardBreaks(String)
class BaseField { protected static ArrayList<String> getHardBreaks(String text) { ArrayList<String> arr = new ArrayList<String>(); char cs[] = text.toCharArray(); int len = cs.length; StringBuffer buf = new StringBuffer(); for (int k = 0; k < len; ++k) { char c = cs[k]; if (c == '\r') { if (k + 1 < len && cs[k + 1] == '\n') ++k; arr.add(buf.toString()); buf = new StringBuffer(); } else if (c == '\n') { arr.add(buf.toString()); buf = new StringBuffer(); } else buf.append(c); } arr.add(buf.toString()); return arr; } }
StringBuffer#new -> StringBuffer#append;StringBuffer#append -> StringBuffer#toString
StringBuffer#append
0.077
data dependence is broken bug in tool