/** * Finds the original field name(s), appending the first one to the out line, and any additional * alternatives to the extra lines. */ private void originalFieldName( String className, String obfuscatedFieldName, String type, StringBuffer outLine, List extraOutLines) { int extraIndent = -1; // Class name -> obfuscated field names. Map fieldMap = (Map) classFieldMap.get(className); if (fieldMap != null) { // Obfuscated field names -> fields. Set fieldSet = (Set) fieldMap.get(obfuscatedFieldName); if (fieldSet != null) { // Find all matching fields. Iterator fieldInfoIterator = fieldSet.iterator(); while (fieldInfoIterator.hasNext()) { FieldInfo fieldInfo = (FieldInfo) fieldInfoIterator.next(); if (fieldInfo.matches(type)) { // Is this the first matching field? if (extraIndent < 0) { extraIndent = outLine.length(); // Append the first original name. if (verbose) { outLine.append(fieldInfo.type).append(' '); } outLine.append(fieldInfo.originalName); } else { // Create an additional line with the proper // indentation. StringBuffer extraBuffer = new StringBuffer(); for (int counter = 0; counter < extraIndent; counter++) { extraBuffer.append(' '); } // Append the alternative name. if (verbose) { extraBuffer.append(fieldInfo.type).append(' '); } extraBuffer.append(fieldInfo.originalName); // Store the additional line. extraOutLines.add(extraBuffer); } } } } } // Just append the obfuscated name if we haven't found any matching // fields. if (extraIndent < 0) { outLine.append(obfuscatedFieldName); } }