@Override public Map<String,MappedClass> read(BufferedReader fileReader) throws Exception {
  Map<String,MappedClass> remap=new HashMap<String,MappedClass>();
  String line=null;
  while ((line=fileReader.readLine()) != null) {
    if (line.startsWith("CL: ")) {
      String className=line.split(" ")[1];
      String newClassName=line.split(" ")[2];
      if (useNodes && !nodes.containsKey(className)) {
        continue;
      }
      MappedClass mc=new MappedClass(nodes == null ? fakeNode(className) : nodes.get(className),newClassName);
      remap.put(className,mc);
    }
 else     if (line.startsWith("FD: ")) {
      String s1=line.split(" ")[1], s2=line.split(" ")[2];
      String className=s1.substring(0,s1.lastIndexOf('/'));
      if (!remap.containsKey(className)) {
        continue;
      }
      String fieldName=s1.substring(s1.lastIndexOf('/') + 1);
      String newFieldName=s2.substring(s2.lastIndexOf('/') + 1);
      String desc="L" + className + ";";
      MappedClass mc=remap.get(className);
      Object node=getFieldNode(mc.getNode().fields,fieldName,desc);
      MappedMember field=new MappedMember(mc,node,0,desc,fieldName);
      field.setNewName(newFieldName);
      mc.addField(field);
    }
 else     if (line.startsWith("MD: ")) {
      String s1=line.split(" ")[1], desc=line.split(" ")[2], s3=line.split(" ")[3];
      String className=s1.substring(0,s1.lastIndexOf('/'));
      if (!remap.containsKey(className)) {
        continue;
      }
      String methodName=s1.substring(s1.lastIndexOf('/') + 1);
      String newMethodName=s3.substring(s3.lastIndexOf('/') + 1);
      MappedClass mc=remap.get(className);
      Object node=getMethodNode(mc.getNode().methods,methodName,desc);
      MappedMember method=new MappedMember(mc,node,0,desc,methodName);
      method.setNewName(newMethodName);
      mc.addMethod(method);
    }
  }
  return remap;
}

@ Override public Map < String , MappedClass > read ( BufferedReader fileReader ) throws Exception { Map < String , MappedClass > remap = new HashMap < String , MappedClass > ( ) ; String line = null ; while ( ( line = fileReader . readLine ( ) ) != null ) { if ( line . startsWith ( "CL: " ) ) { String className = line . split ( " " ) [ 1 ] ; String newClassName = line . split ( " " ) [ 2 ] ; if ( useNodes && ! nodes . containsKey ( className ) ) { continue ; } MappedClass mc = new MappedClass ( nodes == null ? fakeNode ( className ) : nodes . get ( className ) , newClassName ) ; remap . put ( className , mc ) ; } else if ( line . startsWith ( "FD: " ) ) { String s1 = line . split ( " " ) [ 1 ] , s2 = line . split ( " " ) [ 2 ] ; String className = s1 . substring ( 0 , s1 . lastIndexOf ( '/' ) ) ; if ( ! remap . containsKey ( className ) ) { continue ; } String fieldName = s1 . substring ( s1 . lastIndexOf ( '/' ) + 1 ) ; String newFieldName = s2 . substring ( s2 . lastIndexOf ( '/' ) + 1 ) ; String desc = "L" + className + ";" ; MappedClass mc = remap . get ( className ) ; Object node = getFieldNode ( mc . getNode ( ) . fields , fieldName , desc ) ; MappedMember field = new MappedMember ( mc , node , 0 , desc , fieldName ) ; field . setNewName ( newFieldName ) ; mc . addField ( field ) ; } else if ( line . startsWith ( "MD: " ) ) { String s1 = line . split ( " " ) [ 1 ] , desc = line . split ( " " ) [ 2 ] , s3 = line . split ( " " ) [ 3 ] ; String className = s1 . substring ( 0 , s1 . lastIndexOf ( '/' ) ) ; if ( ! remap . containsKey ( className ) ) { continue ; } String methodName = s1 . substring ( s1 . lastIndexOf ( '/' ) + 1 ) ; String newMethodName = s3 . substring ( s3 . lastIndexOf ( '/' ) + 1 ) ; MappedClass mc = remap . get ( className ) ; Object node = getMethodNode ( mc . getNode ( ) . methods , methodName , desc ) ; MappedMember method = new MappedMember ( mc , node , 0 , desc , methodName ) ; method . setNewName ( newMethodName ) ; mc . addMethod ( method ) ; } } return remap ; }
reads each line in a reader and parses mappings from the srg format .
